-
Notifications
You must be signed in to change notification settings - Fork 995
[BESU-696/492][Fix the eth_estimateGas json rpc #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BESU-696/492][Fix the eth_estimateGas json rpc #842
Conversation
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
…exceeds-gas-limit Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
…-gas-limit Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
|
Is the current version failing to give a high enough estimate in a case other than this?
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_estimategas |
Yes in some cases the estimate was not good despite a sufficient block gas limit. A good test is present and allows you to see the different behavior with Geth (https://github.com/cianx/besu-test). For example in the case of resetting the balance to 0. In the test presented above the block gas limit is "0x1fffffffffffff" |
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
...src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGas.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/CallParameter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
…s-exceeds-gas-limit Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
…s-exceeds-gas-limit Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
0bd6c4d to
3c70ed0
Compare
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
AbdelStark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes need to be addressed.
...src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGas.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionProcessor.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/EstimateGasOperationTracer.java
Outdated
Show resolved
Hide resolved
...reum/core/src/test/java/org/hyperledger/besu/ethereum/vm/EstimateGasOperationTracerTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
…besu-696-fix-intrinsic-gas-exceeds-gas-limit Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Fix cases where the gas estimate is too low and causes the transaction to fail Implementation of a strategy that will estimate the number of gas needed by a transaction 1 - Estimate the number of gas used by a transaction 2 - Estimate the number of gas necessary to add for each sub call present in a transaction (65/64^depth) 3 - Add the minimum gas required for operations that need it (SSTORE) Signed-off-by: Karim TAAM <karim.t2am@gmail.com> Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Fix cases where the gas estimate is too low and causes the transaction to fail Implementation of a strategy that will estimate the number of gas needed by a transaction 1 - Estimate the number of gas used by a transaction 2 - Estimate the number of gas necessary to add for each sub call present in a transaction (65/64^depth) 3 - Add the minimum gas required for operations that need it (SSTORE) Signed-off-by: Karim TAAM <karim.t2am@gmail.com> Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Signed-off-by: Karim TAAM karim.t2am@gmail.com
PR description
Fix cases where the gas estimate is too low and causes the transaction to fail
Implementation of a strategy that will estimate the number of gas needed by a transaction
1 - Estimate the number of gas used by a transaction
2 - Estimate the number of gas necessary to add for each sub call present in a transaction (65/64^depth)
3 - Add the minimum gas required for operations that need it (SSTORE) https://eips.ethereum.org/EIPS/eip-1706
This has been tested with the test network (dev) and the Clique network.