Skip to content

fix: gas estimation for simple transfers #78

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

Merged
merged 5 commits into from
Feb 20, 2025
Merged

Conversation

prestwich
Copy link
Member

the basic transfer estimation failed when eip2930 or eip7702 attributes were present, by underestimating the gas required.

This is an edge case, as users don't generally attach spurious info that costs money, but regularly encountered during testing things like eth_estimateGas

@prestwich prestwich requested a review from Evalir February 20, 2025 17:36
@prestwich prestwich self-assigned this Feb 20, 2025
@prestwich prestwich force-pushed the prestwich/estimation-fix branch from e2b43bf to 5932673 Compare February 20, 2025 17:41
@@ -41,3 +42,37 @@ impl<Ext, Db: DatabaseRef + Sync> EvmNeedsBlock<'_, Ext, ConcurrentState<Db>> {
bundle
}
}

impl<Ext, Db: DatabaseRef + Sync> EvmNeedsTx<'_, Ext, ConcurrentState<Db>> {
Copy link
Member Author

Choose a reason for hiding this comment

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

drive-by to add feature parity with State

/// them should be done with caution, as it may lead to logic bugs.
///
/// [`CfgEnv`]: revm::primitives::CfgEnv
pub fn env_unchecked(&self) -> &Env {
Copy link
Member Author

Choose a reason for hiding this comment

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

drive-by util functions

@@ -1176,7 +1200,7 @@ impl<'a, Ext, Db: Database + DatabaseCommit, TrevmState: HasTx> Trevm<'a, Ext, D
}
}

// -- HAS TX with State<Db>
// -- NEEDS TX with State<Db>
Copy link
Member Author

Choose a reason for hiding this comment

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

fix doc

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

couple of nits, all good otherwise

@@ -1,6 +1,6 @@
[package]
name = "trevm"
version = "0.19.3"
version = "0.19.5"
Copy link
Member

Choose a reason for hiding this comment

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

why are we skipping a version?

Copy link
Member Author

Choose a reason for hiding this comment

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

to match revm

prestwich and others added 3 commits February 20, 2025 12:51
@prestwich prestwich merged commit ea840af into main Feb 20, 2025
4 checks passed
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.

2 participants