Repository navigation
perf(storage-overlay): register proof cursor metrics on first multiproof - #30
Closed
BrianBland wants to merge 1 commit into
Closed
BrianBland wants to merge 1 commit into
BrianBland wants to merge 1 commit into
Conversation
OverlayStateProvider::new and new_ref registered four groups of trie and hashed cursor metric handles with the global recorder on every call, so every BlockchainProvider::history_by_* call paid for them even when no multiproof was computed. Defer registration to the first multiproof for providers built outside a factory; factory providers keep sharing the factory's handles. Co-authored-by: Toshi <toshi-noreply@coinbase.com>
BrianBland
added a commit
that referenced
this pull request
Oct 21, 2026
BrianBland
added a commit
to base/base
that referenced
this pull request
Oct 21, 2026
Carry base/reth#30, which stops OverlayStateProvider from registering proof cursor metrics on every history_by_* call. Reth v2.8.0 (#27945) roughly doubled the instructions per historical provider open, the regression the storage provider benchmark flagged. Co-authored-by: Toshi <toshi-noreply@coinbase.com>
BrianBland
added a commit
to base/base
that referenced
this pull request
Oct 21, 2026
Drop base/reth#30 for now. The extra per-open cost from reth#27945 is about 0.4 µs per historical state provider open and does not touch the engine or latest-state paths, so carrying a fork patch for it is not worth the cost. Co-authored-by: Toshi <toshi-noreply@coinbase.com>
Author
|
Not carrying this in the fork for now: ~0.4 µs per historical provider open, and the engine and latest-state paths are unaffected. base/base is back on base-v2.8.0.1. The fix will go to paradigmxyz/reth instead. The branch stays for reference; tag base-v2.8.0.2 still exists but nothing pins it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a v2.8.0 regression in
BlockchainProvider::history_by_*, reported by base/base#6148's storage provider benchmark (historical_provider/open+36%, the*_before_changebenches +17–22%).Bisected to paradigmxyz#27945.
OverlayStateProvider::new/new_refnow build aProofCursorMetrics::default(), which registers 4 groups of trie and hashed cursor histograms with the global recorder on every provider open, even when the provider never computes a multiproof. This change keeps those handles asOptionon the provider: factory-built providers still share the factory's handles, and standalone providers register them on their first multiproof.Instructions retired per op, with the base/base
historical_providerfixture (macOStime -l, (N=420k − N=20k)/400k, median of 3):The remaining ~2k instructions/op spreads across many v2.7.0..v2.8.0 commits and has no single cause.
Tests:
cargo test -p reth-storage-overlay --all-features(52 passed); clippy with-D warnings;fmt --check.