Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
If this pull request affects the behavior of any canister owned by
the Governance team, remember to update the corresponding
unreleased_changes.md file(s).
To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, and
supply one of the following reasons:
-
Done.
-
No canister behavior changes.
Contributor
Author
|
Review takes place here: #4705 |
Currently, 'sns-testing' is only capable of deploying hardcoded SNS with the provided SNS-controlled canister. This makes it impossible to tweak SNS settings without recompiling 'sns-testing'. The suggested way to create SNSes is to use 'dfx sns propose' command. To support the workflow to deploy SNSes using this command, 'sns-testing' CLI was extended with the subcommand to complete the swap for the created SNS. 'sns-testing run swap-complete' will wait for swap to be open, generate required number of participation with sufficient amount of tokens to complete the swap, and wait for swap to be completed. Also extract NNS init part into a dedicated binary to simplify the interface.
Users may create SNS proposals that are not automatically accepted. To allow simulating SNS proposal adoption, 'sns-proposal-upvote' subcommand is added to the 'sns-testing'. This command will upvote a given SNS proposal using the same identity neurons that were used in the 'swap-complete' subcommand to complete the SNS swap previously. 'sns-proposal-upvote' will attempt to vote on behalf of all 'Swap.minimum_participants' deterministic identities participated in the swap omitting those that do not have neurons that are eligible for SNS voting.
Users may require ICP tokens to test actions like swap participation using their own identities. To support getting ICP tokens, the new 'transfer-icp' subcommand was added. It uses hardcoded treasury identity that has a large ICP deposit from which tokens are transferred to the provided recipient.
Currently, the identity that transfer ICPs to the swap participants or the user provided account is hardcoded. Which limits the usage of the 'sns-testing' to the network created by 'sns-testing-init'. This commit adds an optional argument to choose the dfx identity to be used as an ICP treasury to 'sns-testing-init' binary and 'swap-complete' and 'transfer-icp' subcommands of 'sns-testing'.
…anisters' 'is_canister_stopped' is currently used by PocketIc and ic-agent implementations. However, the 'CallCanisters' trait requires implementing this function. As a result, some trait implementations have dummy implementation for this method which panics in runtime. To avoid runtime panic, this method is extracted into a dedicated 'CallCanistersWithStoppedCanisterError' trait that inherits 'CallCanisters'. This trait is only implemented for PocketIc and ic-agent's. An attempt to use 'is_canister_stopped_error' for other implementation will cause compilation error instead of runtime panic.
Currently the ID of the NNS neuron that is used to submit proposals is hardcoded which is potentially error-prone. To fix this, 'sns-testing-init' and 'sns-testing run-basic scenario' were made to consider neuron ID instead of using the hardcoded ID from a separate crate.
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Currently, IC network HTTP endpoint port launched by 'sns-testing-init' is hardcoded to 8080. This commit adds an additional command line option to 'sns-testing-init' binary to make the port configurable.
'run-basic-scenario' subcommand is updated to take the WASM module and Candid argument used for the canister upgrade as arguments instead of hardcoding them. This allows users to run this "basic scenario" on arbitrary canisters.
Currently, README requires running binaries using 'bazel run' which bloats usage instructions. Additionally, in the future, we'd like to distribute all these binaries without 'bazel'. This commit adds a bash script that builds all required binaries using 'bazel', copies them to the local directory and updates PATH. README now implies the usage of this script to populate PATH and explains how to use binaries without 'bazel run' wrapper (for all binaries except 'sns-testing-init').
Currently, 'sns-testing-init' requires specifying the path to the PocketIC directory explicitly. This introduces the necessity to clean up the directory before re-running this binary (if the same value for the option is used). This commit makes '--state-dir' argument optional. If it's not provided, a new temporary directory will be created. This directory will remain even after 'pocket-ic-server' process has finished. This temporary directory will be cleaned up on the next system reboot.
aterga
force-pushed
the
serokell/sns-testing
branch
from
April 17, 2025 12:28
8e80e66 to
1cc556b
Compare
aterga
marked this pull request as ready for review
April 17, 2025 12:28
aterga
enabled auto-merge
April 17, 2025 12:29
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 17, 2025
This is a preliminary PR for discussing the changes that will be ported to #4697 Context: Serokell sns-testing milestone III --------- Co-authored-by: Roman Melnikov <[email protected]> Co-authored-by: Roman Melnikov <[email protected]>
Contributor
Author
|
This PR was in the end redundant, as we were able to merge #4705 |
auto-merge was automatically disabled
April 17, 2025 15:27
Pull request was closed
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.
This is the third PR for implementing the next-gen sns-testing tool.
At the core of this tool lies the PocketIC framework, the testing framework capable of creating a fully deterministic environment for testing complex ICP dapp scenarios.
This PR is authored by Serokell and reviewed by the DFINITY Foundation. Please refer to the reviews here: #4705
< Previous PR |