Skip to content
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

chore(nns): Cleanup constants related to neuron-minimum-dissolve-delay-to-vote #4290

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aterga
Copy link
Member

@aterga aterga commented Mar 9, 2025

This PR cleans up after the recent change that exposed the (priorly code-constant) neuron-minimum-dissolve-delay-to-vote constraint in NNS Governance. In particular:

  1. MIN_DISSOLVE_DELAY_FOR_VOTE_ELIGIBILITY_SECONDS is removed in favor of DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS (which has the same value).
  2. MIN_DISSOLVE_DELAY_FOR_VOTE_ELIGIBILITY_SECONDS_BOUNDS renamed as NEURON_MIN_DISSOLVE_DELAY_TO_VOTE_SECONDS_BOUNDS (for consistency) and lifted next to the constant MIN_DISSOLVE_DELAY_FOR_VOTE_ELIGIBILITY_SECONDS that it bounds.

@github-actions github-actions bot added the chore label Mar 9, 2025
@aterga aterga marked this pull request as ready for review March 9, 2025 22:02
@aterga aterga requested a review from a team as a code owner March 9, 2025 22:02
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Done.

  2. No canister behavior changes.

@aterga aterga dismissed github-actions[bot]’s stale review March 9, 2025 22:11

No canister changes

@aterga aterga enabled auto-merge March 10, 2025 09:02
Copy link
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not say that DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS replaces MIN_DISSOLVE_DELAY_FOR_VOTE_ELIGIBILITY_SECONDS (this is not your exact wording, but I think most ppl would say "replace" is equivalent). Rather, the former is removed, because it is determined by a new field in NetworkEconomics. Whereas, tests that previously used 6 months now get that from DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS.

I guess in some future PR, we might want to change DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS to 3 months, once the proposal goes through.

pub const DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS: u64 = 6 * ONE_MONTH_SECONDS;

pub const NEURON_MIN_DISSOLVE_DELAY_TO_VOTE_SECONDS_BOUNDS: RangeInclusive<u64> =
(3 * ONE_MONTH_SECONDS)..=(6 * ONE_MONTH_SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NC. I assume that a quorum already discussed and decided this.

This seems overly restrictive. Nothing suddenly breaks if the parameter gets set to 2.9 months, right? Nor does anything bad happen if 6.1 months is used, right? I can maybe imagine that something bad might happen if you lower it from 1 second to 0 seconds (0 has a funny way of triggering new behaviors). I can also imagine that maybe INCREASING MDD breaks something (however, I am not specifically aware of anything being broken by a sudden increase).

// value for the system, but it should be updated to align with [MIN_DISSOLVE_DELAY_FOR_VOTE_ELIGIBILITY_SECONDS].
pub const DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS: u64 =
crate::governance::MIN_DISSOLVE_DELAY_FOR_VOTE_ELIGIBILITY_SECONDS;
/// The minimum dissolve delay so that a neuron may vote.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NCR

When a proposal is created, neurons with dissolve delay (in seconds) less than NetworkEconomics.min_dissolve_delay_seconds receive no ballot (to be filled out) for that proposal. Thus, such neurons cannot vote on the proposal.

/// The minimum dissolve delay so that a neuron may vote.
pub const DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS: u64 = 6 * ONE_MONTH_SECONDS;

pub const NEURON_MIN_DISSOLVE_DELAY_TO_VOTE_SECONDS_BOUNDS: RangeInclusive<u64> =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, with the other constant, s/MIN/MINIMUM/.

/// The minimum dissolve delay so that a neuron may vote.
pub const DEFAULT_NEURON_MINIMUM_DISSOLVE_DELAY_TO_VOTE_SECONDS: u64 = 6 * ONE_MONTH_SECONDS;

pub const NEURON_MIN_DISSOLVE_DELAY_TO_VOTE_SECONDS_BOUNDS: RangeInclusive<u64> =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, a comment that says something like

A proposal that tries to set NetworkEconomics.min_dissolve_delay_seconds must propose a value that falls within this range.

Comment on lines +370 to +371
"neuron_minimum_dissolve_delay_to_vote_seconds ({:?}) must be between three \
and six months.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems easy that this wording could get out of sync with the constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants