Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

RPC endpoint eth_estimateGasBundle always returns a gasUsed value even if transaction execution fails #82

Open
spencerxiao opened this issue Jul 5, 2023 · 0 comments

Comments

@spencerxiao
Copy link

System information

Builder version: latest
CL client & version: e.g. lighthouse/nimbus/[email protected]
OS & Version: Windows/Linux/OSX
Commit hash : (if develop)

Expected behaviour

An error field which contains the error message shall be returned along with the gasUsed field so that RPC callers knows that the gas estimation fails and the returned gasUsed value shall not be used for gas estimation.

Actual behaviour

No error field is returned and the returned gasUsed value is only the gas usage until the point that the transaction failed and thus it is not a valid gas estimation.

Steps to reproduce the behaviour

Send the following RPC request to the builder node and note that you may need to change the blockNumber and stateBlockNumber field to a more recent main block number.
{"method":"eth_estimateGasBundle","params":[{"txs":[{"from":"0x682CD3E420f2bFAcc633D289eF6F42d8543A6Ee0","to":"0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9","data":"0x00a718a9000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c557f40a556a0e7eca4c7a81c49bb2f21d3b4cbc000000000000000000000000000000000000000000000000000000000d14d8b00000000000000000000000000000000000000000000000000000000000000000","gasLimit":2000000,"value":"0x0"}],"blockNumber":"0x10cd21f","stateBlockNumber":"0x10cd21f"}],"id":1,"jsonrpc":"2.0"}

If you send the same transaction to the go-ethereum node to the eth_esitmateGas endpoint:
{"method":"eth_estimateGas","params":[{"from":"0x682CD3E420f2bFAcc633D289eF6F42d8543A6Ee0","to":"0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9","data":"0x00a718a9000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c557f40a556a0e7eca4c7a81c49bb2f21d3b4cbc000000000000000000000000000000000000000000000000000000000d14d8b00000000000000000000000000000000000000000000000000000000000000000","gasLimit":2000000,"value":"0x0"}],"id":1,"jsonrpc":"2.0"} it will shows that the transaction is invalid.

Backtrace

[backtrace]

When submitting logs: please submit them as text and not screenshots.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant