-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: add support of eth_estimateGas for L1 transactions #694
base: main
Are you sure you want to change the base?
feat: add support of eth_estimateGas for L1 transactions #694
Conversation
1d180a4
to
516b62e
Compare
...art-contract-client/src/main/kotlin/net/consensys/linea/contract/Web3JContractAsyncHelper.kt
Outdated
Show resolved
Hide resolved
...lient/src/main/kotlin/net/consensys/linea/contract/l1/Web3JLineaRollupSmartContractClient.kt
Outdated
Show resolved
Hide resolved
516b62e
to
4136437
Compare
contractAddress, | ||
FunctionEncoder.encode(function) | ||
) | ||
return getGasLimit(function) |
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.
This doesn't quite makes sense because getGasLimit
already does what executeEthCall
is supposed to do if useEthEstimateGas
is enabled
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.
Yes, I was thinking the same but indeed it's a bit different, if useEtheEstimateGas
is enabled, we would call eth_estimateGas
to estimate the gas limit and then explicitly set it as the gas
field in the subsequent eth_call
to double check against if the "estimated gas limit" is sufficient enough, given that "estimated gas limit" is not a guarantee and could sometimes be insufficient when being used in eth_call
or eth_sendRawTransaction
In practice, this mismatch can happen, especially in complex transactions or when dealing with contracts that have unpredictable gas usage. To mitigate this:
- Test with eth_call: Before relying on the estimate for a real transaction, simulate the call with eth_call using the estimated gas to see if it holds up.
wdyt?
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.
It makes sense with a static limit, but when useEtheEstimateGas
is set, I don't really see any point in eth_estimateGas
-> eth_call
-> eth_estimateGas
-> eth_sendRawTransaction
flow.
I think we'll have an issue with blob submissions. For blob submission the way things work now we'd send 1 |
This PR implements issue(s) #3898
Checklist