Skip to content

Conversation

@niran
Copy link
Contributor

@niran niran commented Dec 2, 2025

Add base_meterBlockByHash and base_meterBlockByNumber RPC methods that re-execute a block and return timing metrics for EVM execution and state root calculation.

Add base_meterBlockByHash and base_meterBlockByNumber RPC methods that
re-execute a block and return timing metrics for EVM execution and
state root calculation.

- Add MeterBlockResponse and MeterBlockTransactions types
- Rename meter module to bundle, add new block module for block metering
- Include per-transaction timing and gas usage data
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Dec 2, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@danyalprout danyalprout marked this pull request as ready for review December 2, 2025 22:43
Comment on lines +69 to +73
let signer = tx
.recover_signer()
.map_err(|e| eyre!("Failed to recover signer for tx {}: {}", tx_hash, e))?;
let recovered_tx =
alloy_consensus::transaction::Recovered::new_unchecked(tx.clone(), signer);

Choose a reason for hiding this comment

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

I would expect signer recovery to not be part of the metered tx execution time. This is something that can always be parallelized, so we should probably record this separately.

let _state_root = state_provider
.state_root(hashed_state)
.map_err(|e| eyre!("Failed to calculate state root: {}", e))?;
let state_root_time = state_root_start.elapsed().as_micros();

Choose a reason for hiding this comment

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

This may depend heavily on the age of the block, as historical tries may need to be fully recomputed from state diffs.

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.

4 participants