Skip to content

Conversation

@datnguyencse
Copy link
Contributor

Replaces StateProvider with EvmStateProvider trait bound in estimate_gas_with since the EVM only needs the minimal database interface, not the full state provider API with block lookups, proofs, etc. This reduces trait overhead and makes dependencies explicit.

It also makes it easier to implement another state provider to feed estimate_gas_with, which we need.

Use a minimal EvmStateProvider instead of full StateProvider trait.
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

makes sense, but have questions re what appear to be unrelated changes

Comment on lines 97 to 101
let TxKind::Call(to) = tx_env.kind()
{
code.map(|code| code.is_empty()).unwrap_or(true)
match db.basic(to) {
Ok(Some(account)) => account.code_hash == KECCAK_EMPTY,
_ => true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why was this changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

When switching from the StateProvider trait to EvmStateProvider, we can no longer use the account_code function and can only use the basic or basic_account functions from the Database or EvmStateProvider traits.

Copy link
Collaborator

@mattsse mattsse Nov 15, 2025

Choose a reason for hiding this comment

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

ah I see, ty

Copy link
Collaborator

Choose a reason for hiding this comment

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

then this is equivalent

) -> Result<U256, Self::Error>
where
DB: Database<Error = ProviderError>,
DB: Database<Error = ProviderError> + Debug,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems appropriate, but why is this necessary here?

can we undo?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch, let me undo. Because I switched to using revm’s Database trait without Debug, I’ll switch back to reth_revm.

Copy link
Contributor Author

@datnguyencse datnguyencse Nov 18, 2025

Choose a reason for hiding this comment

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

@mattsse In case you've missed this PR, it's ready again Sir.

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Nov 14, 2025
@mattsse mattsse added the A-rpc Related to the RPC implementation label Nov 14, 2025
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 97 to 101
let TxKind::Call(to) = tx_env.kind()
{
code.map(|code| code.is_empty()).unwrap_or(true)
match db.basic(to) {
Ok(Some(account)) => account.code_hash == KECCAK_EMPTY,
_ => true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

then this is equivalent

@mattsse mattsse added this pull request to the merge queue Nov 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 18, 2025
@mattsse mattsse added this pull request to the merge queue Nov 18, 2025
Merged via the queue into paradigmxyz:main with commit 7a72550 Nov 18, 2025
42 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants