Skip to content

Commit

Permalink
Merge branch 'arshavir/remove-legacy-sns-flow' into 'master'
Browse files Browse the repository at this point in the history
feat(NNS): Make NNS proposal action `OpenSnsTokenSwap` obsolete

This MR makes the NNS proposal action `OpenSnsTokenSwap` obsolete and removes NNS Governance-related tests that depended on it.

This change entails making obsolete also the `NnsGov.settle_community_fund_participation` function which depended on `OpenSnsTokenSwap` proposals, and which has already been deprecated since the release of Matched Funding.

Additionally, this MR makes proposal execution code synchronous, as no cross-canister calls are needed anymore. In particular, this lifts the requirement to have locks for SNS proposals.

Additionally, the ic-admin subcommand ProposeToOpenSnsTokenSwap is made obsolete.

Other minor changes:

* `controller` field must always be set for `Neuron`s, which is being checked and is taken care of in test code.

< [Previous MR in this series](https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/17332) |

Closes NNS1-2566 

Closes NNS1-2566

See merge request dfinity-lab/public/ic!16866
  • Loading branch information
aterga committed Jan 31, 2024
2 parents 29567e4 + b35734c commit 821b642
Show file tree
Hide file tree
Showing 17 changed files with 358 additions and 3,947 deletions.
4 changes: 2 additions & 2 deletions rs/nns/governance/benches/scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl IcpLedger for MockLedger {
// will be accepted when submitted and executed in the call to process
// proposals.
fn make_and_process_proposal(gov: &mut Governance) {
tokio_test::block_on(gov.make_proposal(
gov.make_proposal(
&NeuronId { id: 0 },
// Must match neuron 1's serialized_id.
&PrincipalId::try_from(b"SID0".to_vec()).unwrap(),
Expand All @@ -126,7 +126,7 @@ fn make_and_process_proposal(gov: &mut Governance) {
})),
..Default::default()
},
))
)
.unwrap();
gov.run_periodic_tasks().now_or_never();
}
Expand Down
15 changes: 9 additions & 6 deletions rs/nns/governance/canister/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,21 +881,24 @@ fn update_node_provider_(req: UpdateNodeProvider) -> Result<(), GovernanceError>
governance_mut().update_node_provider(&caller(), req)
}

/// TODO[NNS1-2617]: Deprecate this function.
#[export_name = "canister_update settle_community_fund_participation"]
fn settle_community_fund_participation() {
debug_log("settle_community_fund_participation");
over_async(candid_one, settle_community_fund_participation_)
}

/// TODO[NNS1-2617]: Deprecate this function.
/// Obsolete, so always returns an error. Please use `settle_neurons_fund_participation`
/// instead.
#[candid_method(update, rename = "settle_community_fund_participation")]
async fn settle_community_fund_participation_(
request: SettleCommunityFundParticipation,
_request: SettleCommunityFundParticipation,
) -> Result<(), GovernanceError> {
governance_mut()
.settle_community_fund_participation(caller(), &request)
.await
Err(GovernanceError::new_with_message(
ErrorType::Unavailable,
"settle_community_fund_participation is obsolete; please \
use settle_neurons_fund_participation instead."
.to_string(),
))
}

#[export_name = "canister_update settle_neurons_fund_participation"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2331,7 +2331,7 @@ message MostRecentMonthlyNodeProviderRewards {

// TODO(NNS1-1589): Until the Jira ticket gets solved, changes here need to be
// manually propagated to (sns) swap.proto.
/// TODO[NNS1-2617]: Deprecate this message.
// This message is obsolete; please use SettleNeuronsFundParticipation instead.
message SettleCommunityFundParticipation {
// The caller's principal ID must match the value in the
// target_swap_canister_id field in the proposal (more precisely, in the
Expand Down
2 changes: 1 addition & 1 deletion rs/nns/governance/src/gen/ic_nns_governance.pb.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2814,7 +2814,7 @@ pub struct MostRecentMonthlyNodeProviderRewards {
}
/// TODO(NNS1-1589): Until the Jira ticket gets solved, changes here need to be
/// manually propagated to (sns) swap.proto.
/// / TODO\[NNS1-2617\]: Deprecate this message.
/// This message is obsolete; please use SettleNeuronsFundParticipation instead.
#[derive(candid::CandidType, candid::Deserialize, serde::Serialize, comparable::Comparable)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down

0 comments on commit 821b642

Please sign in to comment.