-
Notifications
You must be signed in to change notification settings - Fork 0
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
sns-testing: SNS lifecycle #2
Conversation
fe1bd22
to
65bea14
Compare
ae0ca5d
to
fc71de3
Compare
704dbac
to
4899f0c
Compare
}, | ||
swap::{await_swap_lifecycle, smoke_test_participate_and_finalize}, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like nesting is a bit too much here in these imports.
/// 5. `install_index_canister` - a flag indicating whether the Index canister for ICP Ledger should be installed. | ||
/// 6. `install_cmc` - a flag indicating whether the Cycles minting canister should be installed. | ||
/// 4. `custom_initial_registry_mutations` are custom mutations for the inital Registry. These | ||
/// should mutations should comply with Registry invariants, otherwise this function will fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems that "should" is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this typo was there before my changes, but I'll fix it
custom_initial_registry_mutations: Option<Vec<RegistryAtomicMutateRequest>>, | ||
neurons_fund_hotkeys: Vec<PrincipalId>, | ||
install_index_canister: bool, | ||
install_cmc: bool, | ||
) -> Vec<PrincipalId> { | ||
assert!( | ||
!(with_mainnet_nns_canister_versions && with_test_nns_governance_canister), | ||
"Cannot mainnet canister version together wit NNS governance test canister version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Cannot mainnet canister version together wit NNS governance test canister version"
Did you mean "Cannot use mainnet" ?
wit
Typo?
let (sns, proposal_id) = | ||
propose_to_deploy_sns_and_wait(pocket_ic, create_service_nervous_system, sns_proposal_id) | ||
.await; | ||
await_swap_lifecycle(pocket_ic, sns.swap.canister_id, Lifecycle::Open) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue seem to require this
sns-testing scenario should close the swap using a sufficient amount of test participants with a sufficient amount of ICPs.
Do we know that it works like this in this await_swap_lifecycle
? Or is it done somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is it done somewhere else?
The swap is handled in smoke_test_participate_and_finalize
slightly below. This helper considers required parameters in order to correctly close the swap
4214bb7
to
018ddc3
Compare
e263103
to
3763b44
Compare
match x { | ||
None => (), | ||
Some(x) => { | ||
match x.greeting { | ||
None => (), | ||
Some(g) => { | ||
STR.with(|s| *s.borrow_mut() = g); | ||
} | ||
}; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be using if let
is better here..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1) Add a simple test canister that will be decentralized as a part of newly created SNS 2) Add helpers to install this canister and run it as the new SNS 3) Complete the SNS swap to finalize SNS adoption
Add helpers to upgrade the test canister. Currently, the helper will reuse the same WASM module, but it's possible to provide the new state value as a 'post_upgrade' hook argument. Test scenario as well as CLI now perform canister upgrade. The former also allows to see the SNS voting procedure in the NNS dapp web UI.
Problem: Currently, helpers from 'pocket_ic_helpers' module use 'advance_time' pocket-ic method to artificially advance time in order to wait for certain events to happen. However, using 'advance_time' in live mode breaks agent certificates checking since pocket-ic time becomes larger than the real time. Solution: 1) When pocket-ic is running in live mode, run 'std::thread::sleep()' instead of 'advance_time()'. 2) Avoid waiting two days for SNS swap to start in live mode. 3) Allow to use the test version of NNS Governance canister which is capable of starting SNS swap immediately after SNS proposal adoption.
Problem: We want to be able to run pocket-ic in live mode. However, this is not viable with non-test version of NNS Governance canister because it postpones the SNS swap start. Solution: Use test version of NNS Governance canister. Ensure that swap start_time is 'None' to start the swap immediately after SNS creation proposal adoption.
529a00b
to
9d4a80e
Compare
No description provided.