Skip to content

Commit

Permalink
Changes proposal deadline (long), and maximum deadline extension to 96 h
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrodfinity committed Dec 8, 2021
1 parent bfdc572 commit 738b196
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rs/nns/governance/canister/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ fn canister_post_upgrade() {
}
.expect("Couldn't upgrade canister.");

governance_mut().proto.wait_for_quiet_threshold_seconds = 2 * ONE_DAY_SECONDS;
governance_mut().proto.wait_for_quiet_threshold_seconds = 4 * ONE_DAY_SECONDS;
}

#[export_name = "canister_update update_authz"]
Expand Down
2 changes: 1 addition & 1 deletion rs/nns/governance/src/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const MIN_NUMBER_VOTES_FOR_PROPOSAL_RATIO: f64 = 0.03;

// Parameter of the wait for quiet algorithm. This is the maximum amount the
// deadline can be delayed on each vote.
pub const WAIT_FOR_QUIET_DEADLINE_INCREASE_SECONDS: u64 = ONE_DAY_SECONDS;
pub const WAIT_FOR_QUIET_DEADLINE_INCREASE_SECONDS: u64 = 2 * ONE_DAY_SECONDS;

// 1 KB - maximum payload size of NNS function calls to keep in listing of
// proposals
Expand Down
2 changes: 1 addition & 1 deletion rs/nns/governance/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl GovernanceCanisterInitPayloadBuilder {
Self {
proto: Governance {
economics: Some(NetworkEconomics::with_default_values()),
wait_for_quiet_threshold_seconds: 60 * 60 * 24 * 2, // 2 days
wait_for_quiet_threshold_seconds: 60 * 60 * 24 * 4, // 4 days
short_voting_period_seconds: 60 * 60 * 12, // 12 hours
..Default::default()
},
Expand Down
10 changes: 5 additions & 5 deletions rs/nns/governance/tests/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8753,7 +8753,7 @@ fn test_wfq_real_data() {
/// every 20s.
#[test]
fn test_wfq_constant_flipping() {
let initial_expiration_seconds = 2 * ONE_DAY_SECONDS;
let initial_expiration_seconds = 4 * ONE_DAY_SECONDS;
let mut neuron_votes: Vec<NeuronVote> = vec![NeuronVote {
vote_and_time: Some((Vote::Yes, 1)),
stake: 10,
Expand All @@ -8767,7 +8767,7 @@ fn test_wfq_constant_flipping() {
vote = Vote::No;
}
neuron_votes.push(NeuronVote {
vote_and_time: Some((vote, 40 * i as u64)),
vote_and_time: Some((vote, 80 * i as u64)),
stake: 20,
})
}
Expand All @@ -8781,10 +8781,10 @@ fn test_wfq_constant_flipping() {
.unwrap()
.current_deadline_timestamp_seconds;

assert!(deadline_after_test <= initial_deadline_seconds + 2 * ONE_DAY_SECONDS);
assert!(deadline_after_test <= initial_deadline_seconds + 4 * ONE_DAY_SECONDS);
// Assert that the deadline is moved by 96 hours.
assert!(deadline_after_test <= DEFAULT_TEST_START_TIMESTAMP_SECONDS + 4 * ONE_DAY_SECONDS);
assert!(deadline_after_test <= DEFAULT_TEST_START_TIMESTAMP_SECONDS + 8 * ONE_DAY_SECONDS);
assert!(
deadline_after_test >= DEFAULT_TEST_START_TIMESTAMP_SECONDS + 4 * ONE_DAY_SECONDS - 600
deadline_after_test >= DEFAULT_TEST_START_TIMESTAMP_SECONDS + 8 * ONE_DAY_SECONDS - 600
);
}

0 comments on commit 738b196

Please sign in to comment.