Restore Matrix fork progress and rollback state - #2502
Draft
a-shannon wants to merge 2 commits into
Draft
Conversation
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.
Disjoint input-block fork switches now report every processed abandoned block. The common processed prefix remains excluded, and mempool reinsertion keeps parent-to-child order. Wallet rollback is dispatched newest-first and independently of transaction-cache availability.
Fork selection also reconsiders the contiguous available candidate prefix when bodies arrive in a different order. A late parent body can therefore unblock the already received descendants through the existing transaction-validation path. Missing bodies and an available prefix tied with the selected fork do not cause an early switch.
Applying the selected input-block transactions removes pooled conflicts even when the selected transactions arrived directly through their block and were never admitted to the mempool. Unrelated transactions remain available, and a no-op cleanup preserves pool statistics.
The regression covers three valid body-arrival orders, exact forward/rollback lists, dependent wallet boxes, and mempool restoration/removal. This is separate from #2369, which preserves fork-completion tree updates. Target:
weak-blocks.The generic mempool cleanup change touches code also edited by #2480. That PR retains the absent-transaction guard, so it does not cover this case; integration should preserve both changes.
Local validation passed: 4 rollback regressions, 6 cleanup/recovery regressions, 3 existing mempool compatibility cases and 4 existing processor cases. Independent review covered both followups. The combined three-node lifecycle run also passed all 3 scenarios, including conflict removal and wallet reconciliation before ordering, followed by online restart. It combines this PR at
518d8beawith #2500, #2501, #2503, #2504 and the three-node integration PR #2505 at16fa0397, using Scala 2.12.20, Java 8 host tests and Java 11 node containers. Earlier wallet registry coverage remains 12 passed tests on the unchanged wallet code.CI on this PR currently stops before node tests because the configured repositories cannot resolve the SigmaState snapshot; see the node job. The bootstrap is tracked in #2501: seven checks passed at its reviewed head, while its remaining node-test job ended after the hosted runner lost communication. That job remains unvalidated. The full processor suite also previously encountered a native OpenJDK 17 crash on Windows; full-suite validation remains pending.