fix(core): skip minimum gas consumption for simulated calls - #305
Conversation
|
pending discussion of better solution |
## Why this should be merged ## How this works ## How this was tested Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
alarso16
left a comment
There was a problem hiding this comment.
Aren't there other RPCs that need changed? Namely, the tracers?
Yeah the other 'simulated' (tracers, access-list) will also need to opt out -- I was thinking this PR provides the option/mechanism to do so, and then when I open the avalanchego bump PR, I can apply it at the appropriate call sites. Does that sound reasonable to you? |
Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com>
I don't think either of these should opt out. Tracers are meant to mirror the actual execution, and access-list-generation is orthogonal to the amount of gas consumed. |
Hm I was just thinking of this through the |
Why this should be merged
This was reported in ava-labs/avalanchego#5850.
ACP-194 charges real transactions:
During
eth_estimateGas, this floor makesUsedGasdepend on the trial gas limit. The geth estimator assumesUsedGasis a lower bound on the gas required for execution, so it can return an estimate near half of the sender's balance-derived gas allowance. This is incorrect, as we should not alter the behavior of RPCs as described in the issue report.UsedGasas its lower boundUsedGasafter refundsceil(gasLimit / 2)How this works
Adds a
StateTransitionOptionthat explicitly disables minimum gas consumption for a state transition.How this was tested
All existing UTs pass and I added a minimum-consumption unit test.