Skip to content

Conversation

@bragaigor
Copy link
Contributor

@bragaigor bragaigor commented Dec 12, 2025

Fixes NIT-3154

Add new boolean option to BlocksReExecutor called CommitStateToDisk that will allow BlocksReExecutor.Blocks range to not only re-executes blocks but it will also commit their state to triedb on disk.

Problem this PR solves:
When using sparse archive node to debug, each api call requiring state usually requires re-execution of tens of thousands of blocks (e.g. sparse archive keeping each 100,000th state, requires re-executing on average 50,000 blocks / ~1 hour of computation). Now, by setting --blocks-reexecutor.commit-state-to-disk to true, BlocksReExecutor will not only re-execute the block ranges passed to it, but it will also commit their state to triedb on disk; then users querying RPC calls that require state doesn't need to wait several minutes for state to be re-computed.

Add new boolean option to BlocksReExecutor called
CommitStateToDisk that will allow BlocksReExecutor.Blocks
range to not only re-executes blocks but it also commit
their state to triedb.

Signed-off-by: Igor Braga <[email protected]>
Signed-off-by: Igor Braga <[email protected]>
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2186 2 2184 0
View the top 2 failed tests by shortest run time
TestTimeboostTxsTimeoutByBlock
Stack Traces | 34.950s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
DEBUG[12-12|13:56:29.404] Dereferenced trie from memory database   nodes=16  size=3.32KiB   time="44.002µs"  gcnodes=709  gcsize=134.76KiB  gctime=1.777073ms  livenodes=241   livesize=48.17KiB
DEBUG[12-12|13:56:29.404] Dereferenced trie from memory database   nodes=16  size=3.25KiB   time="38.121µs"  gcnodes=725  gcsize=138.01KiB  gctime=1.815094ms  livenodes=225   livesize=44.92KiB
DEBUG[12-12|13:56:29.404] Dereferenced trie from memory database   nodes=16  size=3.24KiB   time="35.306µs"  gcnodes=741  gcsize=141.25KiB  gctime=1.85023ms   livenodes=209   livesize=41.68KiB
DEBUG[12-12|13:56:29.404] Dereferenced trie from memory database   nodes=17  size=3.35KiB   time="44.212µs"  gcnodes=758  gcsize=144.61KiB  gctime=1.894302ms  livenodes=192   livesize=38.32KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=16  size=3.21KiB   time="39.724µs"  gcnodes=774  gcsize=147.81KiB  gctime=1.933896ms  livenodes=176   livesize=35.12KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=16  size=3.25KiB   time="40.575µs"  gcnodes=790  gcsize=151.07KiB  gctime=1.974371ms  livenodes=160   livesize=31.86KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=16  size=3.25KiB   time="37.911µs"  gcnodes=806  gcsize=154.32KiB  gctime=2.012172ms  livenodes=144   livesize=28.61KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=24  size=4.62KiB   time="61.495µs"  gcnodes=830  gcsize=158.94KiB  gctime=2.073536ms  livenodes=120   livesize=23.99KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=18  size=3.59KiB   time="41.968µs"  gcnodes=848  gcsize=162.54KiB  gctime=2.115224ms  livenodes=102   livesize=20.40KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=19  size=3.60KiB   time="52.267µs"  gcnodes=867  gcsize=166.13KiB  gctime=2.167361ms  livenodes=83    livesize=16.80KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=16  size=3.25KiB   time="39.204µs"  gcnodes=883  gcsize=169.39KiB  gctime=2.206454ms  livenodes=67    livesize=13.54KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=16  size=3.25KiB   time="39.083µs"  gcnodes=899  gcsize=172.64KiB  gctime=2.245396ms  livenodes=51    livesize=10.29KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=18  size=3.62KiB   time="44.492µs"  gcnodes=917  gcsize=176.26KiB  gctime=2.289778ms  livenodes=33    livesize=6.67KiB
DEBUG[12-12|13:56:29.405] Dereferenced trie from memory database   nodes=17  size=3.38KiB   time="38.612µs"  gcnodes=934  gcsize=179.65KiB  gctime=2.32829ms   livenodes=16    livesize=3.29KiB
DEBUG[12-12|13:56:29.406] Dereferenced trie from memory database   nodes=16  size=3.29KiB   time="45.986µs"  gcnodes=950  gcsize=182.93KiB  gctime=2.374166ms  livenodes=0     livesize=0.00B
DEBUG[12-12|13:56:29.406] Dereferenced trie from memory database   nodes=0   size=0.00B     time=231ns       gcnodes=950  gcsize=182.93KiB  gctime=2.374297ms  livenodes=0     livesize=0.00B
DEBUG[12-12|13:56:29.406] Dereferenced trie from memory database   nodes=0   size=0.00B     time=120ns       gcnodes=950  gcsize=182.93KiB  gctime=2.374337ms  livenodes=0     livesize=0.00B
INFO [12-12|13:56:29.406] Blockchain stopped
TRACE[12-12|13:56:29.406] P2P networking is spinning down
--- FAIL: TestTimeboostTxsTimeoutByBlock (34.95s)
TestBatchPosterActuallyPostsBlobsToL1
Stack Traces | 68.020s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
TRACE[12-12|14:23:26.607] Handled RPC response                     reqid=2341  duration="1.343µs"
DEBUG[12-12|14:23:26.607] Served eth_getTransactionCount           reqid=2639  duration="44.644µs"
TRACE[12-12|14:23:26.606] Handled RPC response                     reqid=7527  duration="2.575µs"
DEBUG[12-12|14:23:26.604] Pushed sync data from consensus to execution synced=true  maxMessageCount=7   updatedAt=2025-12-12T14:23:26+0000 hasProgressMap=false
DEBUG[12-12|14:23:26.604] Served eth_call                          reqid=18378 duration=1.258375ms
TRACE[12-12|14:23:26.606] Handled RPC response                     reqid=364   duration="2.374µs"
DEBUG[12-12|14:23:26.605] Served eth_getBlockByNumber              reqid=4     duration="307.336µs"
TRACE[12-12|14:23:26.604] advanceValidations: validation not done  pos=1  status=4
TRACE[12-12|14:23:26.607] Handled RPC response                     reqid=2639  duration=691ns
DEBUG[12-12|14:23:26.607] Served eth_getTransactionCount           reqid=7528  duration="36.949µs"
DEBUG[12-12|14:23:26.607] Served eth_call                          reqid=23168 duration="447.448µs"
TRACE[12-12|14:23:26.608] Handled RPC response                     reqid=23168 duration="1.753µs"
DEBUG[12-12|14:23:26.608] Executing EVM call finished              runtime="250.79µs"
DEBUG[12-12|14:23:26.608] Served eth_call                          reqid=2342  duration="306.034µs"
DEBUG[12-12|14:23:26.608] Executing EVM call finished              runtime="223.048µs"
DEBUG[12-12|14:23:26.608] Served eth_call                          reqid=2640  duration="295.133µs"
TRACE[12-12|14:23:26.608] Handled RPC response                     reqid=2640  duration="2.054µs"
TRACE[12-12|14:23:26.607] Handled RPC response                     reqid=7526  duration="1.743µs"
TRACE[12-12|14:23:26.608] Handled RPC response                     reqid=7528  duration="2.505µs"
DEBUG[12-12|14:23:26.608] Served eth_getBlockByNumber              reqid=11969 duration=4.133174ms

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Signed-off-by: Igor Braga <[email protected]>
@bragaigor bragaigor marked this pull request as ready for review December 12, 2025 14:10
@bragaigor bragaigor requested a review from magicxyyz December 12, 2025 14:11
@bragaigor bragaigor requested a review from gligneul December 12, 2025 14:12
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.

3 participants