perf(rpc): avoid IndexedBatch allocation in read-only state views - #3941
Draft
thiagodeev wants to merge 2 commits into
Draft
perf(rpc): avoid IndexedBatch allocation in read-only state views#3941thiagodeev wants to merge 2 commits into
thiagodeev wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3941 +/- ##
==========================================
- Coverage 74.63% 74.51% -0.13%
==========================================
Files 462 462
Lines 40989 40990 +1
==========================================
- Hits 30592 30543 -49
- Misses 8294 8347 +53
+ Partials 2103 2100 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
thiagodeev
force-pushed
the
perf/getNonce
branch
from
August 20, 2026 05:15
eed24cd to
0d237a9
Compare
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.
Read-only state views (
HeadState,StateAtBlockNumber,StateAtBlockHash) indeprecatedStateBackendpreviously allocated a PebbleIndexedBatchper call, paying the batch setup cost and the batch-overlay merge on every subsequentGet- despite never writing. They now read the database directly through areadOnlyTxnadapter that satisfies thedb.IndexedBatchinterfacedeprecatedstate.Newrequires but rejects writes.Also adds
BenchmarkNonce, benchmarkingHandler.Nonceagainst a real Pebble-backed state with 50k contracts under pseudorandom addresses.Numbers
BenchmarkNonce, benchstat over 6 runs each (-benchtime=2s):Every read-only RPC that goes through these state views benefits, not just
starknet_getNonce.