FIX (#1614) : Add comprehensive test to verify proofsForTransactions() does not modify UTXO set tree#2268
Open
dimension-drifter wants to merge 1 commit intoergoplatform:masterfrom
Open
Conversation
…et tree remains unchanged
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.
Problem Statement
While the existing
concurrent applyModifier() and proofsForTransactions()test ensures these methods can work in parallel, it doesn't explicitly verify that the UTXO set tree remains unmodified whenproofsForTransactions()is called. There was concern that the tree might be inadvertently modified in some edge cases.Solution
Added a new property test
proofsForTransactions() does not modify UTXO set tree - extensive testthat:Generates extensive test samples: Creates 50 blocks with ~50 transactions each (configurable to 500×500 for exhaustive testing)
Explicitly verifies tree immutability:
proofsForTransactions()Validates the complete workflow:
proofsForTransactions()and verifies successstateRootheader.ADProofsRootmatchesADProofs.proofDigest(proofBytes)applyModifier()and verifies it completes successfullyapplyModifier()(proving the modification path works correctly)Provides comprehensive coverage: Sequential testing over many blocks ensures edge cases are caught that might not appear in concurrent or single-block tests
Changes Made
proofsForTransactions() does not change state digesttestnumBlocks(default 50) andtxsPerBlock(default 50) for flexible testing depthTesting
The test can be run with:
sbt "testOnly org.ergoplatform.nodeView.state.UtxoStateSpecification"