Skip to content

Exercise Matrix lifecycle on three nodes and fix API dispatch - #2505

Draft
a-shannon wants to merge 4 commits into
ergoplatform:weak-blocksfrom
a-shannon:fix/matrix-multi-node-integration
Draft

Exercise Matrix lifecycle on three nodes and fix API dispatch#2505
a-shannon wants to merge 4 commits into
ergoplatform:weak-blocksfrom
a-shannon:fix/matrix-multi-node-integration

Conversation

@a-shannon

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

Copy link
Copy Markdown
Contributor

Matrix gains a three-node devnet integration suite covering input-block wallet and mempool updates, competing input chains, restart recovery, and payment fees reaching the ordering miner and becoming spendable after maturity.

The suite uses the normal mining REST API. Two prerequisites are fixed here: ErgoMiner forwards typed ordering/input SolutionFound messages with the original sender, and full-block lookup stops at the end of its path so input-block transaction subroutes remain reachable.

The six scenarios cover normal payment inclusion, competing input-chain recovery, restart at a settled checkpoint, restart with a payment awaiting ordering, local restoration of confirmed state before connecting peers, and fee payout through mature reward spending. Assertions identify exact transactions, wallet balances and boxes, UTXO state, eligible mempool restoration, conflicting-transaction removal, and continued ordering progress. Pending-payment recovery checks one ordering inclusion and absence from the following block.

The fee scenario creates an ordinary payment with the existing fee contract, follows it through an input block and ordering confirmation, and checks exact fee-box consumption on all three nodes. The reward script uses the actual ordering header's miner key and configured delay. Reward value and creation height are exact; emission is accounted for separately. Before maturity, rewards must be in the mining scan and absent from the payment scan. At maturity, they must move into the payment scan with the exact balance change, including older rewards maturing at each checkpoint. The miner reward is then spent with a normal funding input and followed through input and ordering confirmation.

Fork and pending-payment recovery resume input-block production after reconnection. These scenarios do not establish idle reconnection convergence or abrupt-crash recovery. Offline restart covers confirmed state, without asserting persistence of pending input blocks or the mempool. The new lifecycle case proves successful spending after maturity; premature-spend rejection remains covered by the existing collector properties.

The Docker harness adds opt-in typed configuration files, loopback port publication, explicit image selection, and container removal that preserves the data bind for restart. Existing callers retain their defaults. The suite derives its custom devnet genesis through the normal state producer and mines normal PoW solutions.

Validation uses the combined contributions from #2500 through #2505. Fee selection belongs to PR #2504, the arrival-order correction belongs to PR #2502, and dependency bootstrapping belongs to PR #2501. Those changes are not duplicated here.

All six local scenarios passed in 5m54s, with zero canceled, ignored or pending tests. The fee scenario exposed remote-input cache staleness, corrected in #2504. Its wallet assertions now follow the existing reward-maturity scan behavior. Independent source review covered the exact assertions. Focused actor/cache validation passed 30 tests, and the mempool suite in #2501 passed 13 tests. Combined CI passed all eight jobs at candidate df2df798: 1,116 node tests, 696 wallet/core tests and all six lifecycle scenarios. The CI lifecycle run took 5m11s with no ignored or canceled cases. Across all jobs there were eight ignored instances and zero failed, aborted, canceled or pending tests. This PR remains a draft for coordinated maintainer review of the combined changes.

The candidate pins weak-blocks at c216c5b6, #2500 at 998066fe, #2501 at c33e35a73, #2502 at 518d8bea, #2503 at a4224d58, #2504 at 3fd1ef21d, and this PR at 9d02fae38. SigmaState source is pinned to 368a860be033af94aa14895381f42099b3646db6. Builds and host tests use Java 8 and Scala 2.12.20; containers use Java 11.

After assembling a matching combined node image:

ERGO_MATRIX_TEST_IMAGE=<node image ID> sbt "it:testOnly org.ergoplatform.it.MatrixLifecycleSpec"

ERGO_MATRIX_TEST_IMAGE is optional when the image has the integration harness's default tag. Combined fork results do not change the individual upstream PR checks.

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