Skip to content
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

fix(executor): fix L2 gas computation and inner-call gas estimation #2511

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kkovaacs
Copy link
Contributor

@kkovaacs kkovaacs commented Jan 23, 2025

This PR fixes inner-call gas usage estimation for transaction traces. On the JSON-RPC 0.8 interface we now return l1_gas and l2_gas cost estimation for inner calls instead of the raw VM resources (which are not available anyway when running with L2 gas).

We now determine the gas vector computation mode (whether to use L2 gas) from the resource bounds in the transaction and then consistently use that when computing costs.

@kkovaacs kkovaacs force-pushed the krisztian/call-level-gas-calculation branch from 4a6a4b7 to c44c8d1 Compare January 23, 2025 10:00
This calculation now properly uses the gas vector computation mode.
Just like we had in pre-0.8 JSON-RPC versions transaction traces in
JSON-RPC 0.8 will also have inner call gas consumtion values that
include the costs of all sub-calls.
@kkovaacs kkovaacs marked this pull request as ready for review January 23, 2025 16:16
@kkovaacs kkovaacs requested a review from a team as a code owner January 23, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant