Skip to content

Commit

Permalink
rebase, and document BonsaiReferenceTestWorldState bypass of stateroo…
Browse files Browse the repository at this point in the history
…t check.

Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Sep 28, 2023
1 parent eb5b1e1 commit ce98c60
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,18 @@ public ReferenceTestWorldState copy() {
layerCopy, cachedMerkleTrieLoader, trieLogManager, preImageProxy);
}

/**
* If the supplied header has a non-zero state root, verify. Else we assume that stateroot is an
* output instead of an input for this reference test and we bypass the state root check.
*
* <p>Besu reference-test style test cases should supply a stateroot to verify to prevent bonsai
* regressions.
*
* @param calculatedStateRoot state root calculated during bonsai persist step.
* @param header supplied reference test block header.
*/
@Override
protected void verifyWorldStateRoot(final Hash calculatedStateRoot, final BlockHeader header) {
// if the supplied header has a non-zero state root, verify. Else bypass
if (!header.getStateRoot().equals(Hash.ZERO)) {
super.verifyWorldStateRoot(calculatedStateRoot, header);
}
Expand Down

0 comments on commit ce98c60

Please sign in to comment.