Skip to content

refactor(governance): NeuronSections no longer implements default. - #2470

Merged
daniel-wong-dfinity-org merged 4 commits into
masterfrom
range-neuron-sections-daniel-wong
Nov 26, 2024
Merged

daniel-wong-dfinity-org merged 4 commits into
masterfrom
range-neuron-sections-daniel-wong

Conversation

@daniel-wong-dfinity-org

@daniel-wong-dfinity-org daniel-wong-dfinity-org commented Nov 6, 2024 •

Copy link
Copy Markdown
Contributor

Instead, callers should use either NeruonSections::ALL or NeuronSections::NONE. It is very easy for a caller to think NeuronSections::default() is equivalent to ALL, when actually, it's equivalent to NONE. Whereas, it is basically impossible to misunderstand what ALL and NONE do.

History of This Pull Request

Earlier, this PR tried to add support for sections to neuron range. But Max developed that independently/concurrently, and he was able to merge first. Therefore, the main change that I was originally trying to do has been removed from this PR. What remains is

  1. Additional tests
  2. NeuronSections::ALL, a constant that replaces NeuronsSections::all (an fn).
  3. Added NeuronSections::NONE.

In terms of interface, the difference between what I did vs. what Max merged is that I figured that there should be one range_neurons method, which should additionally take NeuronSections; whereas, he created range_neurons_sections.

His interface also seems reasonable. I think my "1 range_neurons to rule them all" approach has various advantages, the main one being that it minimizes API surface area.

References

👈 Previous PR | Next PR 👉

github-merge-queue Bot pushed a commit that referenced this pull request Nov 15, 2024
…voting power. (#2385)

Whereas, before, we did not have a distinction between **potential**
voting power vs. **deciding** voting power. When neurons refresh
themselves, there is no difference between these. Whereas, when a neuron
does not refresh itself recently enough, the amount of voting power in
its ballots (its "deciding" voting power) is less than its potential
voting power.

# Example

Suppose there are two neurons:

* A has 100 potential voting power, and refreshed recently, and as a
result, its deciding voting power is also 100.
* B has 1000 potential voting power, but has not refreshed in a long
time, and as a result, it's deciding voting power is just 500.

Then, the total potential voting power is 1100. If both neurons vote,
then A gets 100 / 1100 of the reward purse, while B gets only 500 / 1100
of the reward purse, not 1000 / 1100.

You might also intuitively guess that the neurons get 100 / 600 and 500
/ 600 of the reward purse, but this is (also) incorrect. The reason for
this design is to keep the amount of rewards to refreshed neurons the
same as before, not more. In other words, it should not be that some
other neuron goes to sleep, and as a result, you get more rewards. It
should only be that the sleeper neuron gets less.

# References

This is part of the "periodic confirmation" feature that was recently
approved in proposal [132411][prop].

[prop]: https://dashboard.internetcomputer.org/proposal/132411

Closes https://dfinity.atlassian.net/browse/NNS1-3411.

[👈 Previous PR][prev] | [Next PR (tangent) 👉][next]

[prev]: #2375
[next]: #2470
DFINITYManu pushed a commit that referenced this pull request Nov 19, 2024
…voting power. (#2385)

Whereas, before, we did not have a distinction between **potential**
voting power vs. **deciding** voting power. When neurons refresh
themselves, there is no difference between these. Whereas, when a neuron
does not refresh itself recently enough, the amount of voting power in
its ballots (its "deciding" voting power) is less than its potential
voting power.

# Example

Suppose there are two neurons:

* A has 100 potential voting power, and refreshed recently, and as a
result, its deciding voting power is also 100.
* B has 1000 potential voting power, but has not refreshed in a long
time, and as a result, it's deciding voting power is just 500.

Then, the total potential voting power is 1100. If both neurons vote,
then A gets 100 / 1100 of the reward purse, while B gets only 500 / 1100
of the reward purse, not 1000 / 1100.

You might also intuitively guess that the neurons get 100 / 600 and 500
/ 600 of the reward purse, but this is (also) incorrect. The reason for
this design is to keep the amount of rewards to refreshed neurons the
same as before, not more. In other words, it should not be that some
other neuron goes to sleep, and as a result, you get more rewards. It
should only be that the sleeper neuron gets less.

# References

This is part of the "periodic confirmation" feature that was recently
approved in proposal [132411][prop].

[prop]: https://dashboard.internetcomputer.org/proposal/132411

Closes https://dfinity.atlassian.net/browse/NNS1-3411.

[👈 Previous PR][prev] | [Next PR (tangent) 👉][next]

[prev]: #2375
[next]: #2470
@daniel-wong-dfinity-org
daniel-wong-dfinity-org force-pushed the range-neuron-sections-daniel-wong branch from 2f9023c to ea8ec66 Compare November 25, 2024 16:14
@daniel-wong-dfinity-org daniel-wong-dfinity-org changed the title feat(nns): Add NeuronSections support to StableNeuronStore::range_neurons. test(governance): Neuron range with sections. Nov 25, 2024
@github-actions github-actions Bot added test and removed feat labels Nov 25, 2024
@daniel-wong-dfinity-org daniel-wong-dfinity-org changed the title test(governance): Neuron range with sections. refactor(governance): NeuronSections no longer implements default. Nov 25, 2024
@github-actions github-actions Bot added refactor and removed test labels Nov 25, 2024
@daniel-wong-dfinity-org
daniel-wong-dfinity-org added this pull request to the merge queue Nov 26, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2024
@daniel-wong-dfinity-org
daniel-wong-dfinity-org added this pull request to the merge queue Nov 26, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2024
@daniel-wong-dfinity-org
daniel-wong-dfinity-org added this pull request to the merge queue Nov 26, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2024
…asy to mistakenly think that by default, all auxiliary data is being selected. Instead, people should use either NeuronStore::NONE (the equivalent replacement), or NeuronStore::ALL, because these options are explicit (and therefore, much less error-prone).
… to run again after `git rebase --continue`??
@daniel-wong-dfinity-org
daniel-wong-dfinity-org force-pushed the range-neuron-sections-daniel-wong branch from ed3bcf7 to 2d428e1 Compare November 26, 2024 16:10
@daniel-wong-dfinity-org
daniel-wong-dfinity-org added this pull request to the merge queue Nov 26, 2024
Merged via the queue into master with commit b3b8f9a Nov 26, 2024
@daniel-wong-dfinity-org
daniel-wong-dfinity-org deleted the range-neuron-sections-daniel-wong branch November 26, 2024 16:40
github-merge-queue Bot pushed a commit that referenced this pull request Dec 2, 2024
Remove following when a neuron has not refreshed in more than 7 months.

The one exception is ManageNeuron; following on that topic is retained
forever.

In a later change (soon), this will be called periodically in the
background of the NNS governance canister. For now, this does not result
in any externally visible behavior changes to any canisters.

# References

[👈 Previous PR][prev] | [Next PR 👉][next]

[prev]: #2470
[next]: #2392
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