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(ICRC_Ledger): FI-1589: Adapt icrc golden state tests to ledger V3 stable structures migration #2739

Open
wants to merge 4 commits into
base: maciej-icrc-v3
Choose a base branch
from

Conversation

mbjorkqvist
Copy link
Member

The ICRC ledger does not support downgrading once allowances have been migrated to stable structures. This PR adapts the golden state tests accordingly.

@github-actions github-actions bot added the test label Nov 21, 2024
@mbjorkqvist mbjorkqvist force-pushed the mathias-FI-1589-adapt-icrc-golden-state-tests-to-V3 branch from fb22395 to e96ab18 Compare November 21, 2024 12:24
@mbjorkqvist
Copy link
Member Author

The ICRC golden state tests succeeded for commit 0627938 here.

@mbjorkqvist mbjorkqvist marked this pull request as ready for review November 21, 2024 21:03
@mbjorkqvist mbjorkqvist requested review from a team as code owners November 21, 2024 21:03
@@ -79,6 +79,10 @@
"rev": "e54d3fa34ded227c885d04e64505fa4b5d564743",
"sha256": "3d808fa63a3d8ebd4510c0400aa078e99a31afaa0515f0b68778f929ce4b2a46"
},
"sns_ledger_v2": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does sns_ledger_v2 point to ledger V3? :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This points to V2 of the ledger wrt. the migration to stable structures as define in the design doc, which supports reading both "raw" stable memory, as well as stable memory written using the MemoryManager, in the post_upgrade. In the pre_upgrade, the serialized ledger state is written using the MemoryManager.

@aterga
Copy link
Contributor

aterga commented Nov 21, 2024

@mbjorkqvist
Copy link
Member Author

Should we also adopt the tests from https://sourcegraph.com/github.com/dfinity/ic/-/blob/rs/nervous_system/integration_tests/tests/sns_ledger_upgrade.rs?L29 ?

From a quick glance, neither of those test would seem to need updating, since they both first install the SNS using the mainnet canister versions (which is the latest blessed versions, i.e., for the ledger, "V2", which writes the ledger state using the MemoryManager in the pre_upgrade).

The problem is with (SNS) ledgers that haven't upgraded to V2, since we don't support upgrading from a pre-V2 version to V3 or later (to migrate the Allowances in V3 to a virtual memory managed by the MemoryManager, the ledger state must have been written using the MemoryManager in the pre_upgrade of the previous ledger version, and this is only done from V2 onwards).

Since SNSs can (currently?) only upgrade one version at a time, and not skip versions, there shouldn't be any issues, but let's perhaps sync offline to see if there are any potential gaps that we haven't considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants