Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Lock/Mint #1009

Open
Primata opened this issue Jan 17, 2025 · 4 comments
Open

Test Lock/Mint #1009

Primata opened this issue Jan 17, 2025 · 4 comments

Comments

@Primata
Copy link
Contributor

Primata commented Jan 17, 2025

Is your feature request related to a problem? Please describe.
Attempting to test if current Elsa Mainnet is able to programmatically have the defined funds on the L1 Bridge for supply parity.

Describe the solution you'd like

Using the the movement-client e2e test framework:

  1. Fund core_resources_account
  2. Send funds to dead address
  3. Check if balances are correct
  4. Burn dead address funds
  5. Transfer desired amount to Relayer address
  6. Burn balance of core_resources_account up to the desired amount
  7. Transfer L1 move desired amount to L1 bridge address
  8. Check if Relayer address balance on L2 equals to L1 bridge address
    Describe alternatives you've considered
    Using the CLI instead of the framework which utilized the native bridge tests, but that solution was slow and found a lot of issues.

Additional context

Issues encountered

  • burn_from is a public function and should be accessible through a script.
  • if attempting to write burn_from from a script, it fails because it requires a burn_capability reference argument, which doesn't seem like we can actually build it outside of the script and pass it as an argument.
  • Making the script burn supply would be the easiest.
  • one option is to use the native_bridge as a proxy and call burn_from from it.
  • Building the BurnCapability failed as a strategy https://github.com/movementlabsxyz/movement/pull/1012/files
  • Updated aptos-core https://github.com/movementlabsxyz/aptos-core/tree/add-burn-from and running on it on branch test-lock-mint-client.
  • currently script fails to identify the signer which signs with private_key 0x1 (indicated in .movement/config.yaml) or 0xA550c18 Error: Unknown error Transaction committed on chain, but failed execution: Move abort in 0x1::system_addresses: ENOT_CORE_RESOURCE_ADDRESS(0x50001): The address/account did not correspond to the core resource address
  • tried changing the addresses in the Move.toml protocol-units/bridge/move-modules/Move.toml but that did not help, matching 0x1 private key: Core Resources Account address: 0xf90391c81027f03cdea491ed8b36ffaced26b6df208a9b569e5baf2590eb9b16 and 0xA550c18 private key: Core Resources Account address: 0x33da451a2e5250c1fbd680a0f49ae7b5bc96fade129781fa3497e4974779bddf.
@l-monninger
Copy link
Collaborator

I feel like this is because you are using the wrong private key. It is not always 0x1. I believe our overlays default to using a random private key, in fact.

@l-monninger
Copy link
Collaborator

Can you provide the full error message with a stack trace?

@Primata
Copy link
Contributor Author

Primata commented Jan 21, 2025

warning: `movement-config` (lib) generated 1 warning (run `cargo fix --lib -p movement-config` to apply 1 suggestion)
   Compiling movement-client v0.0.2 (/Users/primata/movement/networks/movement/movement-client)
warning: unused variable: `relayer_address`
  --> networks/movement/movement-client/src/bin/e2e/lock_mint.rs:82:6
   |
82 |     let relayer_address = AccountAddress::from_str(
   |         ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_relayer_address`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `compile_status`
   --> networks/movement/movement-client/src/bin/e2e/lock_mint.rs:166:6
    |
166 |     let compile_status = Command::new("movement")
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_compile_status`

warning: `movement-client` (bin "movement-tests-e2e-lock-mint") generated 2 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.67s
     Running `target/debug/movement-tests-e2e-lock-mint`
Core Resources Account address: 0xf90391c81027f03cdea491ed8b36ffaced26b6df208a9b569e5baf2590eb9b16
Compiling, may take a little while to download git dependencies...
UPDATING GIT DEPENDENCY https://github.com/movementlabsxyz/aptos-core.git
INCLUDING DEPENDENCY AptosFramework
INCLUDING DEPENDENCY AptosStdlib
INCLUDING DEPENDENCY MoveStdlib
BUILDING bridge-modules
warning[W09001]: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:2:26
  │
2 │     use aptos_framework::aptos_account;
  │                          ^^^^^^^^^^^^^ Unused 'use' of alias 'aptos_account'. Consider removing it

warning[W09001]: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:5:33
  │
5 │     use aptos_framework::coin::{BurnCapability};
  │                                 ^^^^^^^^^^^^^^ Unused 'use' of alias 'BurnCapability'. Consider removing it

warning[W09001]: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:6:38
  │
6 │     use aptos_framework::aptos_coin::AptosCoin;
  │                                      ^^^^^^^^^ Unused 'use' of alias 'AptosCoin'. Consider removing it

warning[W09001]: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:7:26
  │
7 │     use aptos_framework::system_addresses;
  │                          ^^^^^^^^^^^^^^^^ Unused 'use' of alias 'system_addresses'. Consider removing it

warning: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:2:26
  │
2 │     use aptos_framework::aptos_account;
  │                          ^^^^^^^^^^^^^ Unused 'use' of alias 'aptos_account'. Consider removing it

warning: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:5:33
  │
5 │     use aptos_framework::coin::{BurnCapability};
  │                                 ^^^^^^^^^^^^^^ Unused 'use' of alias 'BurnCapability'. Consider removing it

warning: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:6:38
  │
6 │     use aptos_framework::aptos_coin::AptosCoin;
  │                                      ^^^^^^^^^ Unused 'use' of alias 'AptosCoin'. Consider removing it

warning: unused alias
  ┌─ protocol-units/bridge/move-modules/scripts/burn_from.move:7:26
  │
7 │     use aptos_framework::system_addresses;
  │                          ^^^^^^^^^^^^^^^^ Unused 'use' of alias 'system_addresses'. Consider removing it

{
  "Result": [
    "c3bb8488ab1a5815a9d543d7e41b0e0df46a7396f89b22821f07a4362f75ddc5::moveth_tests",
    "c3bb8488ab1a5815a9d543d7e41b0e0df46a7396f89b22821f07a4362f75ddc5::placeholder_for_compiling"
  ]
}
Error: Failed to execute burn dead balance script transaction

Caused by:
    Unknown error Transaction committed on chain, but failed execution: Move abort in 0x1::system_addresses: ENOT_CORE_RESOURCE_ADDRESS(0x50001): The address/account did not correspond to the core resource address

@Primata
Copy link
Contributor Author

Primata commented Jan 21, 2025

0x1 priv key public key is 0xf90391c81027f03cdea491ed8b36ffaced26b6df208a9b569e5baf2590eb9b16

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

No branches or pull requests

2 participants