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

feat(revm, revme): gas inspector #222

Merged
merged 7 commits into from
Sep 18, 2022
Merged

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Sep 16, 2022

Gas counting became a bit harder with the introduction of gas blocks composed during analysis. So GasInspector was introduced to make it easier to count remaining gas after each executed step.

Approach was adopted from

pub struct CustomPrintTracer {
/// We now batch continual gas_block in one go, that means we need to reduce it ifwe want to get
/// correct gas remaining. Check revm/interp/contract/analyze for more information
reduced_gas_block: u64,
full_gas_block: u64,
was_return: bool,
was_jumpi: Option<usize>,
}

@shekhirin shekhirin changed the title feat(revm): gas inspector feat(revm, revme): gas inspector Sep 16, 2022
Copy link
Collaborator

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible this hurts performance meaningfully?

@shekhirin
Copy link
Collaborator Author

@gakonst you mean new GasInspector? I don't think so, it's just very simple math operations and O(1) lookups.

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

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.

None yet

3 participants