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
Add unit tests for meter_block function and RPC tests for
meterBlockByHash and meterBlockByNumber endpoints using TestHarness
to build real blocks via the engine API.

Also rename meter.rs to bundle.rs to match implementation structure.
Signer recovery can be parallelized, so it should be measured separately
from EVM execution time. This adds signer_recovery_time_us to
MeterBlockResponse and moves signer recovery before the execution loop.
Add notes about:
- Pruned parent state will return an error
- Older blocks may have slower state root calculation due to
  uncached trie nodes
Remove strict equality check for signer recovery time on empty blocks
since timing overhead can result in non-zero values.
Instead of requiring the caller to pass a state provider and parent
header separately, meter_block now accepts a provider that implements
both StateProviderFactory and HeaderProvider. This allows the function
to fetch the parent header and state internally, resulting in a cleaner
API.
@niran niran requested a review from BrianBland December 11, 2025 23:40
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