Skip to content

Restore Matrix fork progress and rollback state - #2502

Draft
a-shannon wants to merge 2 commits into
ergoplatform:weak-blocksfrom
a-shannon:fix/matrix-disjoint-fork-rollback
Draft

Restore Matrix fork progress and rollback state#2502
a-shannon wants to merge 2 commits into
ergoplatform:weak-blocksfrom
a-shannon:fix/matrix-disjoint-fork-rollback

Conversation

@a-shannon

@a-shannon a-shannon commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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 518d8bea with #2500, #2501, #2503, #2504 and the three-node integration PR #2505 at 16fa0397, 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.

@a-shannon a-shannon changed the title Restore Matrix input-block rollback state across disjoint forks Restore Matrix fork progress and rollback state Sep 5, 2026
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.

1 participant