Merged
Conversation
wurdum
approved these changes
Apr 14, 2026
There was a problem hiding this comment.
Pull request overview
This PR ensures validator state tracking in StateReconstructor is properly updated during chain reorgs, so MemDb-pinned reconstructed state is released when it becomes invalid after a reorg.
Changes:
- Add
StateReconstructor.ReorgTo(BlockHeader)and trim prepared/pinned state beyond the reorg target. - Switch prepared-queue entries from
Hash256state roots toBlockHeaderso trimming can be based on block numbers. - Extend tests to cover reorg interactions with
_validHeader,_validHeaderCandidate, and MemDb pinning behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/Nethermind.Arbitrum/Execution/Stateless/StateReconstructor.cs |
Adds ReorgTo + prepared-queue trimming; changes prepared-queue element type to BlockHeader. |
src/Nethermind.Arbitrum/Execution/ArbitrumExecutionEngine.cs |
Updates PrepareForRecord to pass headers (not roots) into PreparedAddTrim. |
src/Nethermind.Arbitrum/Execution/ArbitrumBlockFactory.cs |
Calls stateReconstructor.ReorgTo(...) on reorg when validation is enabled. |
src/Nethermind.Arbitrum.Test/Execution/Stateless/StateReconstructorTests.cs |
Exposes/primes a reusable pruning simulation helper for new reorg tests. |
src/Nethermind.Arbitrum.Test/Execution/Stateless/MarkValidTests.cs |
Adds reorg-focused tests verifying validator state is cleared/preserved appropriately and MemDb pins are released. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AnkushinDaniil
approved these changes
Apr 14, 2026
damian-orzechowski
approved these changes
Apr 15, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #826 +/- ##
==========================================
+ Coverage 76.39% 76.52% +0.13%
==========================================
Files 227 227
Lines 14151 14188 +37
Branches 2107 2119 +12
==========================================
+ Hits 10810 10857 +47
+ Misses 2584 2572 -12
- Partials 757 759 +2
🚀 New features to boost your workflow:
|
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.
No description provided.