chore: opinionated improvements to #2528#2602
chore: opinionated improvements to #2528#2602mmagician wants to merge 6 commits intoajl-reorient-claim-note-flowfrom
Conversation
There was a problem hiding this comment.
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_conversionMASM procedures to return no outputs (validation via successful execution). - Update bridge
claimflow 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.
There was a problem hiding this comment.
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_conversionto return no outputs and adjust internal stack choreography. - Refactor
bridge_in::claimflow 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?; |
| // 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?; |
Addresses own PR review comments:
CLAIMnote consumption flow #2528 (comment) (no need to returnyfromverify_u128_to_native_amount_conversion)CLAIMnote consumption flow #2528 (comment))