Skip to content

feat(agglayer): store block number with each registered GER#2579

Open
mmagician wants to merge 2 commits intoagglayerfrom
mmagician-claude/store-block-num-with-ger
Open

feat(agglayer): store block number with each registered GER#2579
mmagician wants to merge 2 commits intoagglayerfrom
mmagician-claude/store-block-num-with-ger

Conversation

@mmagician
Copy link
Collaborator

Summary

  • Store the transaction's reference block number alongside the GER flag in the bridge's GER map, changing the value from [1, 0, 0, 0] to [1, block_num, 0, 0]
  • Update assert_valid_ger to check only the flag element (instead of full word comparison), since block_num is now variable
  • Update SPEC.md to reflect the new GER map value layout

Test plan

  • BUILD_GENERATED_FILES_IN_SRC=1 make test name=update_ger - all 3 tests pass
  • make lint - clean

Closes #2578

🤖 Generated with Claude Code

Store the transaction's reference block number alongside the GER flag
in the bridge's GER map, changing the value from [1, 0, 0, 0] to
[1, block_num, 0, 0]. This enables recovery scenarios that need to
know when each GER was registered.

The assert_valid_ger procedure now checks only the flag element instead
of comparing the full word, since the block_num element is variable.

Closes #2578

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address review feedback: reorder stack operations so the flag is pushed
before getting the block number, eliminating the need for a swap.

Also add changelog entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the AggLayer bridge GER registry to persist the transaction reference block number alongside the “known” flag, enabling recovery workflows to determine when a GER was registered.

Changes:

  • Store [GER_KNOWN_FLAG, block_num, 0, 0] as the GER map value (instead of a fixed sentinel).
  • Update assert_valid_ger to validate only the flag element, since block_num varies.
  • Update tests and spec/docs to reflect the new GER value layout.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/miden-testing/tests/agglayer/update_ger.rs Updates storage assertion to include the stored reference block number.
crates/miden-agglayer/asm/agglayer/bridge/bridge_config.masm Writes block_num into GER map values and adjusts GER validation logic accordingly.
crates/miden-agglayer/SPEC.md Documents the updated GER map value encoding and meaning.
CHANGELOG.md Notes the new feature in the upcoming release changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants