Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions rs/nns/governance/src/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ pub const MAX_NEURONS_FUND_PARTICIPANTS: u64 = 5_000;
/// in the same limit.
const NEURON_RATE_LIMITER_KEY: &str = "ADD_NEURON";

/// The minimum dissolve delay (in seconds) a neuron must have to submit a
/// non-ManageNeuron proposal. This is intentionally decoupled from the voting
/// eligibility threshold (`neuron_minimum_dissolve_delay_to_vote_seconds`),
/// which can be lower.
pub const NEURON_MINIMUM_DISSOLVE_DELAY_TO_PROPOSE_SECONDS: u64 = 6 * ONE_MONTH_SECONDS;
Comment thread
jasonz-dfinity marked this conversation as resolved.

// The maximum dissolve delay allowed for a neuron.
pub const MAX_DISSOLVE_DELAY_SECONDS_PRE_MISSION_70: u64 = 8 * ONE_YEAR_SECONDS;
pub const MAX_DISSOLVE_DELAY_SECONDS_POST_MISSION_70: u64 = 2 * ONE_YEAR_SECONDS;
Expand Down Expand Up @@ -5226,18 +5232,16 @@ impl Governance {
));
}

let min_dissolve_delay_seconds_to_vote = if action.manage_neuron().is_some() {
let min_dissolve_delay_seconds_to_propose = if action.manage_neuron().is_some() {
0
} else {
self.neuron_minimum_dissolve_delay_to_vote_seconds()
NEURON_MINIMUM_DISSOLVE_DELAY_TO_PROPOSE_SECONDS
};

// The proposer must be eligible to vote. This also ensures that the
// neuron cannot be dissolved until the proposal has been adopted or
// rejected.
if proposer_dissolve_delay_seconds < min_dissolve_delay_seconds_to_vote {
// The proposer must have sufficient dissolve delay to submit proposals.
if proposer_dissolve_delay_seconds < min_dissolve_delay_seconds_to_propose {
return Err(GovernanceError::new_with_message(
ErrorType::InsufficientFunds,
ErrorType::PreconditionFailed,
"Neuron's dissolve delay is too short.",
));
}
Expand Down
11 changes: 11 additions & 0 deletions rs/nns/governance/src/network_economics.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::governance::NEURON_MINIMUM_DISSOLVE_DELAY_TO_PROPOSE_SECONDS;
use crate::pb::v1::{
NetworkEconomics, NeuronsFundEconomics, NeuronsFundMatchedFundingCurveCoefficients,
VotingPowerEconomics,
Expand Down Expand Up @@ -380,6 +381,16 @@ impl VotingPowerEconomics {
);
defects.push(defect);
}

if delay > NEURON_MINIMUM_DISSOLVE_DELAY_TO_PROPOSE_SECONDS {
Comment thread
jasonz-dfinity marked this conversation as resolved.
Comment thread
jasonz-dfinity marked this conversation as resolved.
let defect = format!(
"neuron_minimum_dissolve_delay_to_vote_seconds ({:?}) must not exceed \
the minimum dissolve delay required to submit proposals ({}).",
self.neuron_minimum_dissolve_delay_to_vote_seconds,
NEURON_MINIMUM_DISSOLVE_DELAY_TO_PROPOSE_SECONDS,
);
defects.push(defect);
}
} else {
defects.push("neuron_minimum_dissolve_delay_to_vote_seconds must be set.".to_string());
}
Expand Down
16 changes: 12 additions & 4 deletions rs/nns/governance/src/network_economics_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ fn test_neuron_minimum_dissolve_delay_to_vote_seconds_bounds() {
),
(
Some(UPPER_BOUND_SECONDS + 1),
Err(vec![format!(
"neuron_minimum_dissolve_delay_to_vote_seconds (Some({})) must be between two weeks and six months.",
UPPER_BOUND_SECONDS + 1
)]),
Err(vec![
format!(
"neuron_minimum_dissolve_delay_to_vote_seconds (Some({})) must be between two weeks and six months.",
UPPER_BOUND_SECONDS + 1
),
format!(
"neuron_minimum_dissolve_delay_to_vote_seconds (Some({})) must not exceed \
the minimum dissolve delay required to submit proposals ({}).",
UPPER_BOUND_SECONDS + 1,
crate::governance::NEURON_MINIMUM_DISSOLVE_DELAY_TO_PROPOSE_SECONDS,
),
]),
),
(Some(DEFAULT_SECONDS), Ok(())),
(Some(LOWER_BOUND_SECONDS), Ok(())),
Expand Down
2 changes: 2 additions & 0 deletions rs/nns/governance/unreleased_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on the process that this file is part of, see

## Changed

* The minimum dissolve delay required to submit non-manage-neuron proposals is now
a fixed 6 months, decoupled from the voting eligibility threshold which can be lower.
* Mission 70 voting rewards adjustment has been re-calculated. Now: 63.29%. Before: 65.5%.

## Deprecated
Expand Down
Loading