From a2d9165698dacc22718f633e97c09fea451ff952 Mon Sep 17 00:00:00 2001 From: Marti Date: Sat, 14 Mar 2026 09:42:39 +0000 Subject: [PATCH 1/9] chore: pass faucet ID on stack to verify_claim_amount --- .../asm/agglayer/bridge/bridge_in.masm | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm index 182c345a46..f9bb1f85ab 100644 --- a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm +++ b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm @@ -339,9 +339,7 @@ pub proc claim exec.bridge_config::lookup_faucet_by_token_address # => [faucet_id_prefix, faucet_id_suffix, pad(16)] - mem_store.CLAIM_FAUCET_ID_PREFIX_MEM_ADDR - mem_store.CLAIM_FAUCET_ID_SUFFIX_MEM_ADDR - # => [pad(16)] + # => [faucet_id_prefix, faucet_id_suffix, pad(16)] # Verify faucet_mint_amount matches the leaf data amount exec.verify_claim_amount @@ -368,7 +366,7 @@ end #! 4. Calls `verify_u256_to_native_amount_conversion` to assert that: #! faucet_mint_amount == floor(raw_amount / 10^scale) #! -#! Inputs: [] +#! Inputs: [faucet_id_prefix, faucet_id_suffix] #! Outputs: [] #! #! Panics if: @@ -378,15 +376,13 @@ end #! Invocation: exec proc verify_claim_amount # Step 1: Pad the stack explicitly for FPI call (get_scale takes no inputs) - padw padw padw padw - # => [pad(16)] - - # Step 2: Load the faucet account ID from global memory - mem_load.CLAIM_FAUCET_ID_SUFFIX_MEM_ADDR - mem_load.CLAIM_FAUCET_ID_PREFIX_MEM_ADDR + padw padw + movup.9 movup.9 + padw padw + movup.9 movup.9 # => [faucet_id_prefix, faucet_id_suffix, pad(16)] - # Step 3: FPI call to faucet's get_scale procedure + # Step 2: FPI call to faucet's get_scale procedure procref.agglayer_faucet::get_scale # => [PROC_MAST_ROOT(4), faucet_id_prefix, faucet_id_suffix, pad(16)] @@ -400,18 +396,18 @@ proc verify_claim_amount movdn.15 dropw dropw dropw drop drop drop # => [scale] - # Step 4: Load the raw U256 amount from leaf data memory + # Step 3: Load the raw U256 amount from leaf data memory exec.get_raw_claim_amount # => [x7, x6, x5, x4, x3, x2, x1, x0, scale] - # Step 5: Load faucet_mint_amount (y) and position it for verification + # Step 4: Load faucet_mint_amount (y) and position it for verification mem_load.CLAIM_OUTPUT_NOTE_FAUCET_AMOUNT # => [y, x7, x6, x5, x4, x3, x2, x1, x0, scale] movdn.9 # => [x7, x6, x5, x4, x3, x2, x1, x0, scale, y] - # Step 6: Verify that y = floor(x / 10^scale) + # Step 5: Verify that y = floor(x / 10^scale) exec.asset_conversion::verify_u256_to_native_amount_conversion # => [y] From f568a3ef90aae1d92adc92fe6290e7b35e5350f2 Mon Sep 17 00:00:00 2001 From: Marti Date: Sat, 14 Mar 2026 09:59:21 +0000 Subject: [PATCH 2/9] chore: pass faucet ID on stack to build_mint_output_note --- .../asm/agglayer/bridge/bridge_in.masm | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm index f9bb1f85ab..3f05597ea6 100644 --- a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm +++ b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm @@ -81,7 +81,6 @@ const CLAIM_LEAF_DATA_KEY_MEM_ADDR = 704 # Memory addresses for the faucet ID looked up during claim (used by claim procedure) const CLAIM_FAUCET_ID_PREFIX_MEM_ADDR = 708 -const CLAIM_FAUCET_ID_SUFFIX_MEM_ADDR = 709 # Memory addresses for leaf data fields (derived from leaf data layout at CLAIM_LEAF_DATA_START_PTR=536) const ORIGIN_TOKEN_ADDRESS_0 = 538 @@ -339,15 +338,16 @@ pub proc claim exec.bridge_config::lookup_faucet_by_token_address # => [faucet_id_prefix, faucet_id_suffix, pad(16)] - # => [faucet_id_prefix, faucet_id_suffix, pad(16)] + dup.1 dup.1 + # => [faucet_id_prefix, faucet_id_suffix, faucet_id_prefix, faucet_id_suffix, pad(16)] # Verify faucet_mint_amount matches the leaf data amount exec.verify_claim_amount - # => [pad(16)] + # => [faucet_id_prefix, faucet_id_suffix, pad(16)] # Build MINT output note targeting the aggfaucet loc_load.CLAIM_DEST_ID_SUFFIX_LOCAL loc_load.CLAIM_DEST_ID_PREFIX_LOCAL - # => [destination_id_prefix, destination_id_suffix, pad(16)] + # => [destination_id_prefix, destination_id_suffix, faucet_id_prefix, faucet_id_suffix, pad(16)] exec.build_mint_output_note # => [pad(16)] @@ -586,18 +586,18 @@ end #! 2. Build the MINT note recipient digest from the storage. #! 3. Look up the faucet, create the output note, and set the attachment. #! -#! Inputs: [destination_id_prefix, destination_id_suffix] +#! Inputs: [destination_id_prefix, destination_id_suffix, faucet_id_prefix, faucet_id_suffix] #! Outputs: [] #! #! Invocation: exec proc build_mint_output_note # Step 1: Write all 18 MINT note storage items to global memory exec.write_mint_note_storage - # => [] + # => [faucet_id_prefix, faucet_id_suffix] # Step 2: Build the MINT note recipient digest exec.build_mint_recipient - # => [MINT_RECIPIENT] + # => [MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] # Step 3: Create the output note and set the faucet attachment exec.create_mint_note_with_attachment @@ -716,35 +716,36 @@ end #! creates a public output note with no assets, and sets the attachment so only the #! target faucet can consume the note. #! -#! Inputs: [MINT_RECIPIENT] +#! Inputs: [MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] #! Outputs: [] #! #! Invocation: exec proc create_mint_note_with_attachment # Create the MINT output note targeting the faucet push.OUTPUT_NOTE_TYPE_PUBLIC - # => [note_type, MINT_RECIPIENT] + # => [note_type, MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] # Load the faucet account ID from global memory (looked up once in `claim`) mem_load.CLAIM_FAUCET_ID_PREFIX_MEM_ADDR - # => [faucet_id_prefix, note_type, MINT_RECIPIENT] + # => [faucet_id_prefix, note_type, MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] # Compute note tag targeting the faucet account exec.note_tag::create_account_target - # => [faucet_tag, note_type, MINT_RECIPIENT] + # => [faucet_tag, note_type, MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] # Create the output note (no assets - MINT notes carry no assets) exec.output_note::create - # => [note_idx] + # => [note_idx, faucet_id_prefix, faucet_id_suffix] + movdn.2 + # => [faucet_id_prefix, faucet_id_suffix, note_idx] # Set the attachment on the MINT note to target the faucet account # NetworkAccountTarget attachment: targets the faucet so only it can consume the note # network_account_target::new expects [prefix, suffix, exec_hint] # and returns [attachment_scheme, attachment_kind, ATTACHMENT] push.ALWAYS # exec_hint = ALWAYS - mem_load.CLAIM_FAUCET_ID_SUFFIX_MEM_ADDR - mem_load.CLAIM_FAUCET_ID_PREFIX_MEM_ADDR - # => [faucet_prefix, faucet_suffix, exec_hint, note_idx] + movdn.2 + # => [faucet_id_prefix, faucet_id_suffix, exec_hint, note_idx] exec.network_account_target::new # => [attachment_scheme, attachment_kind, ATTACHMENT, note_idx] From 850fe33918957759311547731d8b25a9f2627d37 Mon Sep 17 00:00:00 2001 From: Marti Date: Sat, 14 Mar 2026 10:01:52 +0000 Subject: [PATCH 3/9] chore: completely remove CLAIM_FAUCET_ID_PREFIX_MEM_ADDR --- crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm index 3f05597ea6..5ba3fa8160 100644 --- a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm +++ b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm @@ -79,9 +79,6 @@ const CLAIM_OUTPUT_NOTE_FAUCET_AMOUNT = 568 const CLAIM_PROOF_DATA_KEY_MEM_ADDR = 700 const CLAIM_LEAF_DATA_KEY_MEM_ADDR = 704 -# Memory addresses for the faucet ID looked up during claim (used by claim procedure) -const CLAIM_FAUCET_ID_PREFIX_MEM_ADDR = 708 - # Memory addresses for leaf data fields (derived from leaf data layout at CLAIM_LEAF_DATA_START_PTR=536) const ORIGIN_TOKEN_ADDRESS_0 = 538 const ORIGIN_TOKEN_ADDRESS_1 = 539 @@ -725,8 +722,7 @@ proc create_mint_note_with_attachment push.OUTPUT_NOTE_TYPE_PUBLIC # => [note_type, MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] - # Load the faucet account ID from global memory (looked up once in `claim`) - mem_load.CLAIM_FAUCET_ID_PREFIX_MEM_ADDR + dup.5 # => [faucet_id_prefix, note_type, MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] # Compute note tag targeting the faucet account From 527445b39f3b462ccbf161efcb3a4f3b63624bbc Mon Sep 17 00:00:00 2001 From: Marti Date: Sat, 14 Mar 2026 09:40:13 +0000 Subject: [PATCH 4/9] chore: drop "y" in verify_u128_to_native_amount_conversion --- .../asm/agglayer/bridge/bridge_in.masm | 3 --- .../asm/agglayer/common/asset_conversion.masm | 9 ++++++--- .../miden-testing/tests/agglayer/asset_conversion.rs | 12 ++++-------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm index 5ba3fa8160..bd149a671f 100644 --- a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm +++ b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm @@ -406,9 +406,6 @@ proc verify_claim_amount # Step 5: Verify that y = floor(x / 10^scale) exec.asset_conversion::verify_u256_to_native_amount_conversion - # => [y] - - drop # => [] end diff --git a/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm b/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm index bc455ab001..4fcf44db63 100644 --- a/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm +++ b/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm @@ -231,7 +231,7 @@ end #! Inputs: [x0, x1, x2, x3, scale_exp, y] #! Where x is encoded as 4 u32 limbs in little-endian order. #! (x0 is least significant limb) -#! Outputs: [y] +#! Outputs: [] #! #! Where: #! - x: The original amount as an unsigned 128-bit integer (U128). @@ -328,6 +328,9 @@ pub proc verify_u128_to_native_amount_conversion assert.err=ERR_REMAINDER_TOO_LARGE # => [y] + + drop + # => [] end #! Verify conversion from an AggLayer U256 amount to a Miden native amount (Felt) @@ -355,7 +358,7 @@ end #! Where x is encoded as 8 u32 limbs in big-endian order. #! (x7 is most significant limb and is at the top of the stack) #! Each limb is expected to contain little-endian bytes. -#! Outputs: [y] +#! Outputs: [] #! #! Where: #! - x: The original AggLayer amount as an unsigned 256-bit integer (U256). @@ -387,5 +390,5 @@ pub proc verify_u256_to_native_amount_conversion # Delegate to verify_u128_to_native_amount_conversion for the remaining verification exec.verify_u128_to_native_amount_conversion - # => [y] + # => [] end diff --git a/crates/miden-testing/tests/agglayer/asset_conversion.rs b/crates/miden-testing/tests/agglayer/asset_conversion.rs index 868c3257de..dd877f1455 100644 --- a/crates/miden-testing/tests/agglayer/asset_conversion.rs +++ b/crates/miden-testing/tests/agglayer/asset_conversion.rs @@ -149,8 +149,7 @@ fn build_scale_down_script(x: EthAmount, scale_exp: u32, y: u64) -> String { async fn assert_scale_down_ok(x: EthAmount, scale: u32) -> anyhow::Result { let y = x.scale_to_token_amount(scale).unwrap().as_int(); 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?; Ok(y) } @@ -345,12 +344,9 @@ async fn test_verify_scale_down_inline() -> anyhow::Result<()> { x_felts[0].as_int(), ); - // Execute the script - let exec_output = execute_masm_script(&script_code).await?; - - // Verify the result - let result = exec_output.stack[0].as_int(); - assert_eq!(result, y); + // 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?; Ok(()) } From f9bda8c5786125d04f76a2f8a59f24accf4bd34f Mon Sep 17 00:00:00 2001 From: Marti Date: Sat, 14 Mar 2026 09:56:08 +0000 Subject: [PATCH 5/9] chore: avoid uplicating y only to drop it later --- .../asm/agglayer/common/asset_conversion.masm | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm b/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm index 4fcf44db63..77bfa65cc6 100644 --- a/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm +++ b/crates/miden-agglayer/asm/agglayer/common/asset_conversion.masm @@ -275,30 +275,28 @@ pub proc verify_u128_to_native_amount_conversion movup.5 # => [y, scale_exp, x0, x1, x2, x3] - dup.1 dup.1 - # => [y, scale_exp, y, scale_exp, x0, x1, x2, x3] + # Duplicate scale_exp (needed later for remainder bound check in Step 4) + dup.1 swap + # => [y, scale_exp, scale_exp, x0, x1, x2, x3] exec.scale_native_amount_to_u256 - # => [y_scaled0..y_scaled7, y, scale_exp, x0, x1, x2, x3] + # => [y_scaled0..y_scaled7, scale_exp, x0, x1, x2, x3] # Drop the upper word as it's guaranteed to be zero since y_scaled will fit in 123 bits # (amount: 63 bits, 10^target_scale: 60 bits). swapw dropw - # => [y_scaled0, y_scaled1, y_scaled2, y_scaled3, y, scale_exp, x0, x1, x2, x3] + # => [y_scaled0, y_scaled1, y_scaled2, y_scaled3, scale_exp, x0, x1, x2, x3] # ============================================================================================= # Step 3: Compute z = x - y_scaled and prove no underflow # z := x - y_scaled # Constraint: y_scaled <= x # ============================================================================================= - movup.5 movup.5 - # => [y, scale_exp, y_scaled0, y_scaled1, y_scaled2, y_scaled3, x0, x1, x2, x3] - - movdn.9 movdn.9 - # => [y_scaled0, y_scaled1, y_scaled2, y_scaled3, x0, x1, x2, x3, y, scale_exp] + movup.4 movdn.8 + # => [y_scaled0, y_scaled1, y_scaled2, y_scaled3, x0, x1, x2, x3, scale_exp] exec.u128_sub_no_underflow - # => [z0, z1, z2, z3, y, scale_exp] + # => [z0, z1, z2, z3, scale_exp] # ============================================================================================= # Step 4: Enforce z < 10^scale_exp (remainder bound) @@ -310,26 +308,23 @@ pub proc verify_u128_to_native_amount_conversion # Therefore any valid remainder z < 10^scale_exp must be < 2^60 and thus must have z2 == z3 == 0. # ============================================================================================= exec.word::reverse - # => [z3, z2, z1, z0, y, scale_exp] + # => [z3, z2, z1, z0, scale_exp] assertz.err=ERR_REMAINDER_TOO_LARGE # z3 == 0 assertz.err=ERR_REMAINDER_TOO_LARGE # z2 == 0 - # => [z1, z0, y, scale_exp] + # => [z1, z0, scale_exp] - movup.3 + movup.2 exec.pow10 - # => [scale, z1, z0, y] + # => [scale, z1, z0] u32split - # => [scale_hi, scale_lo, z1, z0, y] + # => [scale_hi, scale_lo, z1, z0] exec.u64::lt - # => [is_lt, y] + # => [is_lt] assert.err=ERR_REMAINDER_TOO_LARGE - # => [y] - - drop # => [] end From 3f7b6718e96ef3970e5f5eca67dff00da7f6141b Mon Sep 17 00:00:00 2001 From: Marti Date: Sun, 15 Mar 2026 09:09:33 +0000 Subject: [PATCH 6/9] chore: adjust comments; no longer reading faucetID from mem --- .../asm/agglayer/bridge/bridge_in.masm | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm index bd149a671f..d56f85e31e 100644 --- a/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm +++ b/crates/miden-agglayer/asm/agglayer/bridge/bridge_in.masm @@ -326,9 +326,7 @@ pub proc claim exec.verify_leaf_bridge # => [pad(16)] - # Look up the faucet account ID from the origin token address once, - # and store it in global memory for use by verify_claim_amount and - # create_mint_note_with_attachment. + # Look up the faucet account ID from the origin token address exec.get_origin_token_address # => [origin_token_addr(5), pad(16)] @@ -357,10 +355,9 @@ end #! scaled down by the faucet's scale factor. #! #! This procedure: -#! 1. Reads the faucet account ID from global memory (looked up once in `claim`). -#! 2. Performs an FPI call to the faucet's `get_scale` procedure to retrieve the scale factor. -#! 3. Loads the raw U256 amount from the leaf data in memory. -#! 4. Calls `verify_u256_to_native_amount_conversion` to assert that: +#! 1. Performs an FPI call to the faucet's `get_scale` procedure to retrieve the scale factor. +#! 2. Loads the raw U256 amount from the leaf data in memory. +#! 3. Calls `verify_u256_to_native_amount_conversion` to assert that: #! faucet_mint_amount == floor(raw_amount / 10^scale) #! #! Inputs: [faucet_id_prefix, faucet_id_suffix] @@ -373,7 +370,7 @@ end #! Invocation: exec proc verify_claim_amount # Step 1: Pad the stack explicitly for FPI call (get_scale takes no inputs) - padw padw + padw padw movup.9 movup.9 padw padw movup.9 movup.9 @@ -578,7 +575,7 @@ end #! a PUBLIC P2ID note on consumption. This procedure orchestrates three steps: #! 1. Write all 18 MINT note storage items to global memory. #! 2. Build the MINT note recipient digest from the storage. -#! 3. Look up the faucet, create the output note, and set the attachment. +#! 3. Create the output note, and set the attachment. #! #! Inputs: [destination_id_prefix, destination_id_suffix, faucet_id_prefix, faucet_id_suffix] #! Outputs: [] @@ -706,8 +703,7 @@ end #! Creates the MINT output note and sets the NetworkAccountTarget attachment on it. #! -#! Reads the faucet account ID from global memory (looked up once in `claim`), -#! creates a public output note with no assets, and sets the attachment so only the +#! Creates a public output note with no assets, and sets the attachment so only the #! target faucet can consume the note. #! #! Inputs: [MINT_RECIPIENT, faucet_id_prefix, faucet_id_suffix] From f6832092d4d12867ab3da10a72e5517a8f065fd6 Mon Sep 17 00:00:00 2001 From: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:41:53 +0300 Subject: [PATCH 7/9] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- crates/miden-testing/tests/agglayer/asset_conversion.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/miden-testing/tests/agglayer/asset_conversion.rs b/crates/miden-testing/tests/agglayer/asset_conversion.rs index dd877f1455..9568841285 100644 --- a/crates/miden-testing/tests/agglayer/asset_conversion.rs +++ b/crates/miden-testing/tests/agglayer/asset_conversion.rs @@ -316,19 +316,19 @@ async fn test_verify_scale_down_inline() -> anyhow::Result<()> { use miden::agglayer::common::asset_conversion begin - # Push y (expected quotient) + # Push expected quotient y used for verification (not returned as an output) push.{} # Push scale_exp push.{} - # Push x as 8 u32 limbs (little-endian, x0 at top) + # Push x as 8 u32 limbs in the order expected by the verifier push.{}.{}.{}.{}.{}.{}.{}.{} - # Call the scale down procedure + # Call the scale down procedure (verifies conversion and may panic on failure) exec.asset_conversion::verify_u256_to_native_amount_conversion - # Truncate stack to just return y + # Truncate stack so the program returns with no public outputs (Outputs: []) exec.sys::truncate_stack end "#, From 0231b40c0e19e6a9efaa7f23cf0968cb66fed2d0 Mon Sep 17 00:00:00 2001 From: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:42:18 +0300 Subject: [PATCH 8/9] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- crates/miden-testing/tests/agglayer/asset_conversion.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/miden-testing/tests/agglayer/asset_conversion.rs b/crates/miden-testing/tests/agglayer/asset_conversion.rs index 9568841285..cd93bf7005 100644 --- a/crates/miden-testing/tests/agglayer/asset_conversion.rs +++ b/crates/miden-testing/tests/agglayer/asset_conversion.rs @@ -149,7 +149,11 @@ fn build_scale_down_script(x: EthAmount, scale_exp: u32, y: u64) -> String { async fn assert_scale_down_ok(x: EthAmount, scale: u32) -> anyhow::Result { let y = x.scale_to_token_amount(scale).unwrap().as_int(); let script = build_scale_down_script(x, scale, y); - execute_masm_script(&script).await?; + let stack = execute_masm_script(&script).await?; + assert!( + stack.is_empty(), + "verify_u256_to_native_amount_conversion should leave an empty stack after truncate_stack" + ); Ok(y) } From 70296e13152d807949f2217f5baeb476982cc041 Mon Sep 17 00:00:00 2001 From: riemann Date: Mon, 16 Mar 2026 14:08:56 +0300 Subject: [PATCH 9/9] fix: rename to output & fix copilot suggestion --- crates/miden-testing/tests/agglayer/asset_conversion.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/miden-testing/tests/agglayer/asset_conversion.rs b/crates/miden-testing/tests/agglayer/asset_conversion.rs index cd93bf7005..b577ac2d2f 100644 --- a/crates/miden-testing/tests/agglayer/asset_conversion.rs +++ b/crates/miden-testing/tests/agglayer/asset_conversion.rs @@ -149,9 +149,9 @@ fn build_scale_down_script(x: EthAmount, scale_exp: u32, y: u64) -> String { async fn assert_scale_down_ok(x: EthAmount, scale: u32) -> anyhow::Result { let y = x.scale_to_token_amount(scale).unwrap().as_int(); let script = build_scale_down_script(x, scale, y); - let stack = execute_masm_script(&script).await?; + let output = execute_masm_script(&script).await?; assert!( - stack.is_empty(), + output.stack.is_empty(), "verify_u256_to_native_amount_conversion should leave an empty stack after truncate_stack" ); Ok(y)