Skip to content

chore: opinionated improvements to #2528#2602

Open
mmagician wants to merge 6 commits intoajl-reorient-claim-note-flowfrom
mmagician-reorient-claim-faucet-on-stack
Open

chore: opinionated improvements to #2528#2602
mmagician wants to merge 6 commits intoajl-reorient-claim-note-flowfrom
mmagician-reorient-claim-faucet-on-stack

Conversation

@mmagician
Copy link
Collaborator

Addresses own PR review comments:

@mmagician mmagician added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Mar 14, 2026
@mmagician mmagician added agglayer PRs or issues related to AggLayer bridging integration pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority labels Mar 14, 2026
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

This PR updates AggLayer asset conversion verification to be “assert-only” (no stack return value), then propagates the new stack behavior through bridge claim logic and the associated tests.

Changes:

  • Change verify_u128_to_native_amount_conversion / verify_u256_to_native_amount_conversion MASM procedures to return no outputs (validation via successful execution).
  • Update bridge claim flow to keep faucet ID on the operand stack instead of storing/loading it from global memory during claim verification and note construction.
  • Adjust Rust tests to stop asserting on returned stack values for scale-down verification.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
crates/miden-testing/tests/agglayer/asset_conversion.rs Updates tests to treat successful execution of the verifier as sufficient validation.
crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm Updates verifier procedures to produce no stack outputs and adjusts internal stack choreography accordingly.
crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm Refactors claim flow to thread faucet ID via stack and updates verifier usage to match the new “no output” convention.

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

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

This PR updates Agglayer asset conversion verification procedures to consume their inputs without leaving values on the stack, and adjusts bridge-in flow and tests accordingly.

Changes:

  • Update verify_u128_to_native_amount_conversion / verify_u256_to_native_amount_conversion to return no outputs and adjust internal stack choreography.
  • Refactor bridge_in::claim flow to avoid storing faucet account ID in global memory, keeping it on the operand stack across calls instead.
  • Update Rust tests to treat successful execution of the verifier as validation (since the verifier no longer returns y).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
crates/miden-testing/tests/agglayer/asset_conversion.rs Adjusts scale-down tests to align with verifier procedures no longer returning y.
crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm Changes verifier procedures to Outputs: [] and updates stack manipulation accordingly.
crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm Removes faucet-id global-memory storage and threads faucet ID through claim logic via the stack.

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

let script = build_scale_down_script(x, scale, y);
let out = execute_masm_script(&script).await?;
assert_eq!(out.stack[0].as_int(), y);
execute_masm_script(&script).await?;
Comment on lines +347 to +349
// Execute the script - verify_u256_to_native_amount_conversion panics on invalid
// conversions, so successful execution is sufficient validation
execute_masm_script(&script_code).await?;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agglayer PRs or issues related to AggLayer bridging integration no changelog This PR does not require an entry in the `CHANGELOG.md` file pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants