You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Support for eth_simulateV1 Method in Tron JSON-RPC #6199
Currently, Ethereum provides the eth_simulateV1 method, which allows developers to simulate transactions before broadcasting them. This is useful for estimating gas usage, detecting potential reverts, and debugging smart contract interactions. However, Tron Protocol does not currently support this method, which limits the ability of developers to perform pre-execution checks efficiently.
Rationale
Why should this feature exist?
Enhances developer experience by allowing transaction simulation before execution.
Reduces the risk of failed transactions due to insufficient resources or contract failures.
Aligns Tron’s JSON-RPC API with Ethereum’s, improving compatibility for developers building cross-chain applications.
What are the use-cases?
Gas and Energy Estimation: Developers can estimate energy consumption and fees before executing a transaction.
Smart Contract Debugging: Allows developers to test interactions with contracts without submitting real transactions.
Transaction Outcome Prediction: Helps applications check whether a transaction will succeed before submitting it to the network.
Specification
The eth_simulateV1 method should be implemented in the Tron JSON-RPC API, following Ethereum’s standard behavior. The method should:
Accept transaction input parameters similar to eth_call.
Return execution results, including status, logs, and estimated energy used.
Handle different contract call scenarios, including internal calls and delegate calls.
Provide error messages if the transaction would fail.
Scope Of Impact
Requires changes to the Tron JSON-RPC API.
May require modifications to the execution engine to provide accurate simulation results.
No backward compatibility issues, as this is a new method.
As you say, eth_simulateV1 is a very versatile new interface.
Of course on TRON you can implement a similar simulation via /wallet/triggerconstantcontract, but the implementation details and return values are not the same as eth_simulateV1.
We will look into eth_simulateV1 as soon as possible and will continue to report back here as we make any progress.
Compared to other interfaces, eth_simulateV1 incurs significantly higher computational resource consumption due to its capability to provide in-depth simulations and detailed state change information. To prevent resource abuse and ensure the stability of node services, providers typically impose restrictions(eg:resource limit/access control/additionnal fees) based on the complexity of the simulated execution(Gas consumption,Call depth,Number of contracts accessed).
Currently, Ethereum provides the eth_simulateV1 method, which allows developers to simulate transactions before broadcasting them. This is useful for estimating gas usage, detecting potential reverts, and debugging smart contract interactions. However, Tron Protocol does not currently support this method, which limits the ability of developers to perform pre-execution checks efficiently.
Rationale
Why should this feature exist?
Enhances developer experience by allowing transaction simulation before execution.
Reduces the risk of failed transactions due to insufficient resources or contract failures.
Aligns Tron’s JSON-RPC API with Ethereum’s, improving compatibility for developers building cross-chain applications.
What are the use-cases?
Gas and Energy Estimation: Developers can estimate energy consumption and fees before executing a transaction.
Smart Contract Debugging: Allows developers to test interactions with contracts without submitting real transactions.
Transaction Outcome Prediction: Helps applications check whether a transaction will succeed before submitting it to the network.
Specification
The eth_simulateV1 method should be implemented in the Tron JSON-RPC API, following Ethereum’s standard behavior. The method should:
Accept transaction input parameters similar to eth_call.
Return execution results, including status, logs, and estimated energy used.
Handle different contract call scenarios, including internal calls and delegate calls.
Provide error messages if the transaction would fail.
Scope Of Impact
Requires changes to the Tron JSON-RPC API.
May require modifications to the execution engine to provide accurate simulation results.
No backward compatibility issues, as this is a new method.
Status Update: This feature implementation requires completion of prerequisite Issue 6289. Until Issue 6289 is fully implemented, there will be no major updates on this issue.
However, all discussions on the following topics(Not limited) are welcome.
• Alternative implementation proposals that bypass Issue 6289 dependency
• Related technical discussions
Please continue the conversation here if you have innovative approaches. We appreciate your understanding.
@halibobo1205@yanghang8612@Benson0224
I did implemented eth_simulateV1 method for the case, when user need simulation over head state. This might solve biggest portion of use-cases for this method.
Please take a look and share your thoughts.
Also I'm considering on adding new HTTP API endpoint simulatetriggersmartcontract that will do same simulation and provide similar output. This is required to handle case, when we have token_id and call_token_value in our transaction. EVM based JSON-RPC api doesn't handle this and can't accept those params
UPDATE: I implemented simulatetriggersmartcontract in separate branch based on proposed PR. You can check it here APshenkin#1
@APshenkin Thanks for the implementation and the detailed write-up — much appreciated. We're going through it carefully right now, including the head-state eth_simulateV1 path and your proposed simulatetriggersmartcontract HTTP endpoint for the token_id / call_token_value cases that the EVM JSON-RPC surface can't express. We'll follow up with detailed feedback on the PR shortly.
Status update: PR #6785 provides an initial implementation of eth_simulateV1 for simulations against the current head state.
During review, state-view consistency was identified as the main unresolved issue. A simulation request must execute against a single fixed state view while blocks and pending transactions may be updating chainbase concurrently. The subsequent discussion proposed pinning the latest committed block snapshot and retaining the existing overlay for state changes between simulated calls, but this approach has not yet been validated or implemented.
As a result, the PR cannot be merged in its current form. Historical-block simulation and state/block overrides remain separate follow-up work dependent on the archive-node capabilities tracked in #6289. The proposed simulatetriggersmartcontract endpoint should also be considered separately after the shared simulation and isolation model is settled.
This issue will remain open to track further progress.
Activity
DmytroShalaiev commentedon Feb 18, 2025
+1, I am also interested in this feature
DmytroShalaiev commentedon Feb 18, 2025
https://docs.chainstack.com/reference/ethereum-simulatev1
abn2357 commentedon Feb 19, 2025
Two questions about this proposal:
yanghang8612 commentedon Feb 19, 2025
As you say,
eth_simulateV1is a very versatile new interface.Of course on TRON you can implement a similar simulation via
/wallet/triggerconstantcontract, but the implementation details and return values are not the same aseth_simulateV1.We will look into
eth_simulateV1as soon as possible and will continue to report back here as we make any progress.Thank you for your suggestion.
DmytroShalaiev commentedon Feb 20, 2025
Thanks so much
SeriousCoding789 commentedon Feb 21, 2025
How can we prevent users from abusing this feature? I assume there should be a fee associated with calling this API. If so, how is the fee calculated?
DmytroShalaiev commentedon Mar 10, 2025
Fee for the calling 'get' request ? Why needed?
angrynurd commentedon Mar 14, 2025
Compared to other interfaces, eth_simulateV1 incurs significantly higher computational resource consumption due to its capability to provide in-depth simulations and detailed state change information. To prevent resource abuse and ensure the stability of node services, providers typically impose restrictions(eg:resource limit/access control/additionnal fees) based on the complexity of the simulated execution(Gas consumption,Call depth,Number of contracts accessed).
DmytroShalaiev commentedon Mar 14, 2025
Got it, thanks, it seems like the big question is how to deal with it
HamiAlyasin54 commentedon Mar 28, 2025
5 remaining items
Benson0224 commentedon Jul 24, 2025
Status Update: This feature implementation requires completion of prerequisite Issue 6289. Until Issue 6289 is fully implemented, there will be no major updates on this issue.
However, all discussions on the following topics(Not limited) are welcome.
• Alternative implementation proposals that bypass Issue 6289 dependency
• Related technical discussions
Please continue the conversation here if you have innovative approaches. We appreciate your understanding.
wafeishushu commentedon Jan 20, 2026
+1
jiangjinyuan commentedon Jan 20, 2026
+1
APshenkin commentedon May 19, 2026
@halibobo1205 @yanghang8612 @Benson0224
I did implemented
eth_simulateV1method for the case, when user need simulation overheadstate. This might solve biggest portion of use-cases for this method.Please take a look and share your thoughts.
Also I'm considering on adding new HTTP API endpoint
simulatetriggersmartcontractthat will do same simulation and provide similar output. This is required to handle case, when we havetoken_idandcall_token_valuein our transaction. EVM based JSON-RPC api doesn't handle this and can't accept those paramsUPDATE: I implemented
simulatetriggersmartcontractin separate branch based on proposed PR. You can check it here APshenkin#1example of input outputs:
yanghang8612 commentedon May 21, 2026
@APshenkin Thanks for the implementation and the detailed write-up — much appreciated. We're going through it carefully right now, including the
head-stateeth_simulateV1path and your proposedsimulatetriggersmartcontractHTTP endpoint for thetoken_id/call_token_valuecases that the EVM JSON-RPC surface can't express. We'll follow up with detailed feedback on the PR shortly.yanghang8612 commentedon Sep 3, 2026
Status update: PR #6785 provides an initial implementation of
eth_simulateV1for simulations against the current head state.During review, state-view consistency was identified as the main unresolved issue. A simulation request must execute against a single fixed state view while blocks and pending transactions may be updating chainbase concurrently. The subsequent discussion proposed pinning the latest committed block snapshot and retaining the existing overlay for state changes between simulated calls, but this approach has not yet been validated or implemented.
As a result, the PR cannot be merged in its current form. Historical-block simulation and state/block overrides remain separate follow-up work dependent on the archive-node capabilities tracked in #6289. The proposed
simulatetriggersmartcontractendpoint should also be considered separately after the shared simulation and isolation model is settled.This issue will remain open to track further progress.