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

fix: do not submit invalid NNS proposal to set cycles ledger in CMC #163

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

mraszyk
Copy link
Collaborator

@mraszyk mraszyk commented Jan 6, 2025

This PR removes logic to set the cycles ledger canister ID in CMC by upgrading CMC because that logic was incorrect: it passed the install argument in textual form (instead of its binary encoding) which couldn't be parsed by CMC:

2025-01-06 08:47:46.697067178 UTC: [Canister r7inp-6aaaa-aaaaa-aaabq-cai] [Root Canister] change_canister: Canister change failed: Attempt to call install_code with request ChangeCanisterRequest { stop_before_installing: true, mode: Upgrade, canister_id: CanisterId(rkp4c-7iaaa-aaaaa-aaaca-cai), wasm_module_sha256: "[de, 3d, 29, 97, b5, 6f, f8, b3, d, 80, 20, ac, 9e, 24, 37, bc, e3, a8, 99, 88, d6, bc, 5b, 69, 59, c5, f, 81, 29, 6b, 7b, 7e]", arg_sha256: "[5, c5, db, 83, 70, 35, 2c, 62, 2d, ef, f3, a2, 49, de, d6, e3, 55, 61, 2c, 3, 92, 8f, f6, 42, 18, 31, 87, ca, 80, 36, 4a, 13]", compute_allocation: None, memory_allocation: None } failed with code CanisterError: Error from Canister rkp4c-7iaaa-aaaaa-aaaca-cai: Canister called `ic0.trap` with message: Panicked at 'Deserialization Failed: "Cannot parse header 286f7074207265636f7264207b206379636c65735f6c65646765725f63616e69737465725f6964203d206f7074207072696e636970616c2022756d3569772d72716161612d61616161712d71616162612d63616922207d29"', rs/rust_canisters/dfn_core/src/endpoint.rs:49:41
Canister Backtrace:
unknown function at index 1399
unknown function at index 744
unknown function at index 1030
unknown function at index 1052
unknown function at index 1534
unknown function at index 1143
unknown function at index 1150
unknown function at index 1071
unknown function at index 89

where the header 286f7074207265636f7264207b206379636c65735f6c65646765725f63616e69737465725f6964203d206f7074207072696e636970616c2022756d3569772d72716161612d61616161712d71616162612d63616922207d29 is the hex encoding of the string (opt record { cycles_ledger_canister_id = opt principal "um5iw-rqaaa-aaaaq-qaaba-cai" }).

This logic can be removed since the cycles ledger canister ID is already set in CMC when its initialized:

2025-01-06 08:46:51.976270215 UTC: [Canister rkp4c-7iaaa-aaaaa-aaaca-cai] [cycles] init() with ledger canister ryjl3-tyaaa-aaaaa-aaaba-cai, governance canister rrkah-fqaaa-aaaaa-aaaaq-cai, exchange rate canister <none>, minting account 082ecf2e3f647ac600f43f38a68342fba5b8e68b085f02592b77f39808a8d2b5, and cycles ledger canister um5iw-rqaaa-aaaaq-qaaba-cai

@mraszyk mraszyk requested review from a team as code owners January 6, 2025 09:03
@mraszyk mraszyk merged commit 5fb3206 into main Jan 6, 2025
12 checks passed
@mraszyk mraszyk deleted the mraszyk/cycles-ledger-in-cmc branch January 6, 2025 09:46
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

Successfully merging this pull request may close these issues.

2 participants