Skip to content

refactor: use uint64 for L2 sequence numbers in AggregateVerifier#222

Merged
leopoldjoy merged 3 commits intomainfrom
refactor/uint64-sequence-numbers
Mar 25, 2026
Merged

refactor: use uint64 for L2 sequence numbers in AggregateVerifier#222
leopoldjoy merged 3 commits intomainfrom
refactor/uint64-sequence-numbers

Conversation

@leopoldjoy
Copy link
Contributor

@leopoldjoy leopoldjoy commented Mar 25, 2026

Summary

  • Changes startingL2SequenceNumber and endingL2SequenceNumber from uint256 to uint64 in AggregateVerifier's internal functions (_verifyProof, _verifyTeeProof, _verifyZkProof, _getStartingIntermediateRootAndL2SequenceNumbers)
  • Adds explicit uint64() casts at call sites in prove() and verifyProposalProof() where values originate from the uint256 Proposal struct
  • This changes the abi.encodePacked journal encoding (8 bytes vs 32 bytes per sequence number), so off-chain TEE / ZK provers must be updated to match

NOTE: Alternatively, we could change Proposal.l2SequenceNumber in Types.sol to uint64 directly, which would eliminate the casts added here but requires updating ~8 interface files and 5 implementation return types (all mechanical, no logic changes).

Test plan

  • forge build passes
  • All 15 AggregateVerifier tests pass
  • Verify off-chain TEE and ZK provers use matching uint64 encoding

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Mar 25, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

mw2000
mw2000 previously approved these changes Mar 25, 2026
@leopoldjoy leopoldjoy force-pushed the refactor/uint64-sequence-numbers branch from 620b148 to d3cd59c Compare March 25, 2026 02:49
@MrStudeny
Copy link

Nice

@cb-heimdall cb-heimdall dismissed mw2000’s stale review March 25, 2026 13:35

Approved review 4003575916 from mw2000 is now dismissed due to new commit. Re-request for approval.

@leopoldjoy leopoldjoy merged commit 9597d94 into main Mar 25, 2026
8 checks passed
@leopoldjoy leopoldjoy deleted the refactor/uint64-sequence-numbers branch March 25, 2026 14:40
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.

5 participants