Skip to content

Commit a69502c

Browse files
authored
fix: attempt to fix flake in e2e cross chain messaging test (#10634)
I was missing a case in this nullifier check assertion. There are actually 2 ways for a low nullifier leaf to "skip" a target nullifier. Low leaf nullifier < target nullifier and either: 1. low leaf next nullifier > target nullifier 2. or (was missing) low leaf's "next index" is 0 (it is the largest-value nullifier in the tree) I also switched the order of the left/right hand operands in the assertion to match the very similar public data assertion. The test failure I'm trying to fix is pasted below. I was unable to replicate it locally. ![image](https://github.com/user-attachments/assets/262e435c-46c6-4b8f-9ad8-958a064fdd92)
1 parent 7746a39 commit a69502c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yarn-project/simulator/src/avm/journal/journal.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ export class AvmPersistableStateManager {
379379
} else {
380380
// Sanity check that the leaf value is skipped by low leaf when it doesn't exist
381381
assert(
382-
siloedNullifier.toBigInt() > leafPreimage.nullifier.toBigInt() &&
383-
siloedNullifier.toBigInt() < leafPreimage.nextNullifier.toBigInt(),
382+
leafPreimage.nullifier.toBigInt() < siloedNullifier.toBigInt() &&
383+
(leafPreimage.nextIndex === 0n || leafPreimage.nextNullifier.toBigInt() > siloedNullifier.toBigInt()),
384384
'Nullifier tree low leaf should skip the target leaf nullifier when the target leaf does not exist.',
385385
);
386386
}

0 commit comments

Comments
 (0)