core/vm: rework gas measurement for call variants#33648
Conversation
|
There's a lint error, but I don't have perms to push to your branch @rjl493456442 . I'm going to apply this PR on top of the bal changes. |
|
Feel free to reown it! |
|
I would like to revert the changes to EIP7702 wrapper for now, if all clients agree the current spec is the best solution, we can add it back! |
| // - transfer value | ||
| // - memory expansion | ||
| // - create new account | ||
| intrinsicCost, err := intrinsicFunc(evm, contract, stack, mem, memorySize) |
There was a problem hiding this comment.
The problem I had with this was that we are computing the intrinsic cost (and with that the readOnly guard) after we potentially added the address to the access list. This could lead to an address ending up in the BAL that was called through a call that should've been stopped by the readOnly guard. I guess our old behavior did the same thing. So the PR is okay, its just something we need to refactor for BALs anyway
There was a problem hiding this comment.
Ah just realized that jared has reordered the clauses to move the readOnly guard first. It kinda duplicates it, but it fixes the issue
There was a problem hiding this comment.
Jared modified it a few weeks ago, the gas calculation should be terminated immediately if the readOnly is applied and state mutation occurs.
|
Issue: duplicated "out of gas" error string in call traces SummaryCommit fd85963 The semantic VM error is still out-of-gas, but the public trace error string to: This is visible in debug_traceTransaction and also propagates to persisted Observed BehaviorExample transaction: Observed trace path: Old behavior, v1.16.8 / old CALL gas flow: New behavior, v1.17.2 / new CALL gas flow: Root CauseBefore fd85963, CALL gas calculation returned the full dynamic gas cost to Therefore tracers exposed: After fd85963, CALL gas calculation was split into intrinsic/stateless and That ErrOutOfGas is returned from operation.dynamicGas(...). The interpreter Since err is already ErrOutOfGas, the final error string becomes: ImpactThe EVM semantics are unchanged, but the public trace error string changes. The difference affects: |
simplified version of #33380