WIP: agglayer asset conversion procedure#2121
Closed
partylikeits1983 wants to merge 24 commits intoajl-b2agg-bridge-out-burnfrom
Closed
WIP: agglayer asset conversion procedure#2121partylikeits1983 wants to merge 24 commits intoajl-b2agg-bridge-out-burnfrom
partylikeits1983 wants to merge 24 commits intoajl-b2agg-bridge-out-burnfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements asset conversion functionality to transform Miden amounts (1e6 base) to Ethereum-compatible u256 format with configurable decimal precision. The implementation includes a new MASM procedure, Rust component wrapper, and test suite.
Key changes:
- New
convert_to_u256_scaledMASM procedure that performs decimal scaling and u256 formatting - Asset conversion component library with initialization and wrapper functions
- Comprehensive test suite covering USDC (6 decimals), ETH (18 decimals), and edge cases
- Build system enhancements with debug mode and improved directory handling
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/miden-lib/asm/agglayer/account_components/asset_conversion.masm | Core MASM procedure implementing asset conversion with decimal scaling and u256 formatting |
| crates/miden-lib/src/agglayer/mod.rs | Rust wrapper providing library initialization and component creation for asset conversion |
| crates/miden-testing/tests/agglayer/asset_conversion.rs | Test suite validating conversion behavior for various token types and amounts |
| crates/miden-testing/tests/agglayer/mod.rs | Module declaration adding asset_conversion tests to the test hierarchy |
| crates/miden-lib/build.rs | Build system improvements including debug mode enablement and defensive directory checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crates/miden-lib/asm/agglayer/account_components/asset_conversion.masm
Outdated
Show resolved
Hide resolved
crates/miden-lib/asm/agglayer/account_components/asset_conversion.masm
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Closing in favor of #2141 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asset Conversion Procedure Overview
This PR adds the functionality for converting between asset amounts with various decimals for Agglayer bridging operations.
Note:
Resolves #2011
Builds on top of #2007
The
convert_to_u256_scaledprocedure converts Miden amounts to Agglayer-compatible u256 format for bridging to agglayer chains.