You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: extract leading zeros/flag validation from global index helpers
Address review feedback:
- Remove leading zeros assertion and mainnet flag validation from
process_global_index_mainnet and process_global_index_rollup helpers.
These are now done once in verify_leaf before branching.
- The helpers now take [rollup_index_le, leaf_index_le] instead of the
full 8-element global index.
- In process_global_index_rollup, removed unnecessary byte-swap before
asserting zero (zero is byte-order-independent). This is now moot
since the mainnet flag is no longer checked in the helper.
- Updated MASM unit tests to match the new helper signatures.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
/// Error Message: "leading bits of global index must be zero"
43
43
pubconstERR_LEADING_BITS_NON_ZERO:MasmError = MasmError::from_static_str("leading bits of global index must be zero");
44
44
45
-
/// Error Message: "mainnet flag must be 0 or 1"
46
-
pubconstERR_MAINNET_FLAG_INVALID:MasmError = MasmError::from_static_str("mainnet flag must be 0 or 1");
47
-
48
45
/// Error Message: "number of leaves in the MMR of the MMR Frontier would exceed 4294967295 (2^32 - 1)"
49
46
pubconstERR_MMR_FRONTIER_LEAVES_NUM_EXCEED_LIMIT:MasmError = MasmError::from_static_str("number of leaves in the MMR of the MMR Frontier would exceed 4294967295 (2^32 - 1)");
0 commit comments