Skip to content

Test that proofsForTransactions() does not modify the UTXO set tree along a growing chain - #2493

Merged
kushti merged 1 commit into
ergoplatform:v6.0.6from
Ergologica:test/utxo-tree-unmodified-1614
Sep 1, 2026
Merged

Test that proofsForTransactions() does not modify the UTXO set tree along a growing chain#2493
kushti merged 1 commit into
ergoplatform:v6.0.6from
Ergologica:test/utxo-tree-unmodified-1614

Conversation

@Ergologica

Copy link
Copy Markdown
Contributor

Addresses #1614.

What was already covered, and what was missing. UtxoStateSpecification already checks that a proofsForTransactions() call does not change the state digest on a fresh state ("proofsForTransactions() does not change state digest") and that it is deterministic there ("proofsForTransactions() to be deterministic"). No test checked the same invariants while a chain grows - a tree with real history, with proofs generated between block applications, which is how the node actually uses it. I asked about this reading of the scope in an issue comment on 2026-08-11 and heard no objection.

The new property, proofsForTransactions() does not modify the UTXO set tree along a growing chain, builds a chain of valid full blocks the same way the neighbouring concurrency test does, and at every height asserts:

  1. the tree root is unchanged after generating proofs (rootDigest before == after);
  2. a second call returns the identical proof digest and state digest, and still leaves the root untouched;
  3. the block assembled from those proofs (stateRoot = adDigest, ADProofsRoot = ADProofs.proofDigest(...)) is accepted by applyModifier, and the state lands exactly on the promised digest.

On the numbers in the issue: the literal 500 blocks x 500 transactions would take hours in CI, so the chain here is 20 blocks with the standard generator transactions - the invariants are the same at any scale, and the length is a one-line constant. Happy to raise it, or to add an ignored long-run variant with the literal numbers, if preferred.

Verified the test bites: injecting a mutation into proofsForTransactions (staging an extra Insert on the persistent prover and committing it) makes the property fail on the root check; on clean master it is green, and the full UtxoStateSpecification suite passes locally (22/22).

Note: the issue shows a years-old assignee with no linked work; if that work is still planned I am happy to defer.

@Ergologica

Copy link
Copy Markdown
Contributor Author

CI note: the red job is Run it node tests. Both failures are Docker multi-node convergence timeouts, in suites this PR does not touch:

  • DeepRollBackSpec ("Deep rollback handling") - TimeoutException: Nodes did not converge to the same best full block at height >= 255
  • ForkResolutionSpec ("Fork resolution after isolated mining") - TimeoutException: Futures timed out after [15 minutes]

This PR only adds one property to UtxoStateSpecification, which runs in Run node tests - green on this run, as are the wallet and ergo-core jobs; 11 of 13 integration tests passed too, including UtxoStateNodesSyncSpec. DeepRollBackSpec timeouts have hit other PRs as well (see #2465 / #2469, "Retrigger CI after DeepRollBackSpec timeout"). Happy to rebase to retrigger if a green re-run is preferred.

@kushti
kushti changed the base branch from master to v6.0.6 September 1, 2026 10:45
@kushti
kushti merged commit 8b7d974 into ergoplatform:v6.0.6 Sep 1, 2026
7 of 8 checks passed
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.

2 participants