-
Notifications
You must be signed in to change notification settings - Fork 316
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
feat(sns): Create test-only function that can be used to advance the target version directly (rather than through a proposal) #1743
base: master
Are you sure you want to change the base?
Conversation
@@ -733,6 +734,14 @@ fn add_maturity_(request: AddMaturityRequest) -> AddMaturityResponse { | |||
governance_mut().add_maturity(request) | |||
} | |||
|
|||
#[cfg(feature = "test")] | |||
#[export_name = "canister_update advance_target_version"] | |||
fn advance_target_version(request: AdvanceTargetVersionRequest) { |
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.
Why didn't this function end up in rs/sns/governance/canister/governance_test.did?
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.
Hmm, seems like it's not enforced by the candid type enforcement in CI
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.
No, the candid type enforecment seems to specifically reject it, not sure what's going on here
#[export_name = "canister_update advance_target_version"] | ||
fn advance_target_version(request: AdvanceTargetVersionRequest) { | ||
over(candid_one, |request: AdvanceTargetVersionRequest| { | ||
AdvanceTargetVersionResponse {} |
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.
Why not implement this function in the same PR?
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.
That is the plan, however the scope of this PR has unfortunately grown and I may have to start splitting it up before merging it
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.
Yes, let's keep this PR just for bumping the target in testing.
Note that it should still only be possible to advance the target using new_target, not go back to an older version (I recommend implementing that logic in this PR as well).
fdd5d6e
to
5f45cf4
Compare
5f45cf4
to
3c6f329
Compare
The scope of this PR has expanded, to the point where it is now starting to implement Periodic Task A. I think that should be brought into a separate PR, with this one just keeping the AdvanceSnsVersion endpoint. |
This will be useful for testing the new SNS upgrade flow, because we will be able to easily trigger the process at arbitrary times without the complexity of going through the (relatively more complex) proposal mechanism.
This PR also creates a
target_version
field in SNS Go's proto. I'm not 100% sure this is the right choice though.