-
Notifications
You must be signed in to change notification settings - Fork 108
feat(metering): Add state root timing to bundle metering #349
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
Conversation
fda8f6c to
c53ce7c
Compare
fa14653 to
64ae567
Compare
c53ce7c to
d59c560
Compare
d59c560 to
51db7aa
Compare
refcell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM
The base branch was changed.
✅ Heimdall Review Status
|
🟡 Heimdall Review Status
|
51db7aa to
c9302b7
Compare
|
Updated the builder tests with the new |
refcell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Measure and report time spent calculating state root separately from transaction execution, enabling better performance analysis: - Add MeterBundleOutput struct with state_root_time_us field - Calculate state root after transaction execution using merge_transitions - Track state root calculation time separately from total execution time - Update RPC to log state_root_time_us in metering response - Add meter_bundle_state_root_time_invariant test The state root is computed by calling hashed_post_state on the bundle and then state_root_with_updates on the state provider.
c9302b7 to
8319f27
Compare
Summary
Add timing measurement for state root calculation in bundle metering. This provides visibility into the I/O cost of computing state roots, which is critical for understanding the full execution costs of a given bundle.
Key changes:
MeterBundleOutputstruct to replace tuple return type with named fieldsstate_root_time_usfield to measure state root calculation time separatelytotal_time_usfield for overall metering time (includes tx execution + state root)hashed_post_stateandstate_root_with_updatesmeter_bundle_state_root_time_invarianttest to verify timing consistencyTest plan
cargo test -p base-reth-metering- all 20 tests passcargo +nightly fmt --all -- --check- passescargo +nightly clippy --all-targets --all-features -- -D warnings- passes