Skip to content

perf: pack withdrawal queue bounds into one slot#693

Draft
0xalpharush wants to merge 1 commit into
mainfrom
agent/multicall-queue-bounds
Draft

perf: pack withdrawal queue bounds into one slot#693
0xalpharush wants to merge 1 commit into
mainfrom
agent/multicall-queue-bounds

Conversation

@0xalpharush

@0xalpharush 0xalpharush commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pack withdrawal queue head and tail as uint64 values in one storage slot
  • add withdrawalQueueBounds() so the sequencer reads both values with one eth_call
  • update the shifted ZonePortal slot constants and regenerate the storage layout and dev genesis

Deployment

This intentionally does not preserve the previous ZonePortal storage layout. Deploy a fresh ZoneFactory/ZonePortal before updating sequencers.

Validation

  • forge test — 555 passed
  • cargo test -p zone-sequencer --lib — 45 passed
  • bundled genesis artifact tests — 2 passed

@0xalpharush
0xalpharush force-pushed the agent/multicall-queue-bounds branch from ae790f9 to b1d41a9 Compare July 16, 2026 22:22
@0xalpharush 0xalpharush changed the title perf: batch withdrawal queue reads with multicall perf: pack withdrawal queue bounds Jul 16, 2026
@0xalpharush 0xalpharush changed the title perf: pack withdrawal queue bounds perf: pack withdrawal queue bounds into one slot Jul 16, 2026
@0xalpharush
0xalpharush force-pushed the agent/multicall-queue-bounds branch from b1d41a9 to afae97f Compare July 16, 2026 22:33

@legion2002 legion2002 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow big diff for a small change :)

function withdrawalQueueTail() external view returns (uint256);
function withdrawalQueueHead() external view returns (uint64);
function withdrawalQueueTail() external view returns (uint64);
function withdrawalQueueBounds() external view returns (uint64 head, uint64 tail);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this new fn? withdrawalQueueBounds
maybe we can just remove the individual head and tail fns?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is used by process_queue to retrieve both without multiple RPC calls

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but fine to drop if you think we should

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.

2 participants