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

Proposal based votable state #725

Merged
merged 17 commits into from
Oct 2, 2024
Merged

Conversation

mstrasinskis
Copy link
Contributor

@mstrasinskis mstrasinskis commented Oct 1, 2024

Motivation

There are multiple reports from users who can’t vote. We believe the root cause of this issue is the 100-ballot limit for neurons. If a user has voted on more than 100 proposals (a likely scenario over a 4-day period), they don’t receive ballots for proposals they’ve already voted on, which remain technically votable due to this limit. The suggested solution is to switch from using neuron ballots to proposal ballots when calculating the votable state.

Changes

  • Use proposal ballots to get voting state.

Tests

  • Updated.

Todos

  • Add entry to changelog (if necessary).
    Not necessary.

Copy link
Contributor

github-actions bot commented Oct 1, 2024

size-limit report 📦

Path Size
@dfinity/ckbtc 7.99 KB (0%)
@dfinity/cketh 3.53 KB (0%)
@dfinity/cmc 1.3 KB (0%)
@dfinity/ledger-icrc 4.17 KB (0%)
@dfinity/ledger-icp 15.43 KB (0%)
@dfinity/nns 36.23 KB (-0.06% 🔽)
@dfinity/nns-proto 140.98 KB (0%)
@dfinity/sns 15.87 KB (0%)
@dfinity/utils 4.5 KB (0%)
@dfinity/ic-management 3.01 KB (0%)

@mstrasinskis mstrasinskis marked this pull request as ready for review October 1, 2024 15:30
@mstrasinskis mstrasinskis requested review from a team as code owners October 1, 2024 15:30
packages/nns/src/utils/neurons.utils.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
packages/nns/src/utils/neurons.utils.spec.ts Outdated Show resolved Hide resolved
- Separate describe blocks
- Remove duplications
@mstrasinskis mstrasinskis merged commit 95b5fac into main Oct 2, 2024
11 checks passed
@mstrasinskis mstrasinskis deleted the proposal-based-votable-state branch October 2, 2024 07:32
github-merge-queue bot pushed a commit to dfinity/nns-dapp that referenced this pull request Oct 4, 2024
# Motivation

There are multiple reports from users who can’t vote. We believe the
root cause of this issue is the 100-ballot limit for neurons. If a user
has voted on more than 100 proposals (a likely scenario over a 4-day
period), they don’t receive ballots for proposals they’ve already voted
on, which remain technically votable due to this limit. The suggested
solution is to switch from using neuron ballots to proposal ballots when
calculating the votable state.

The utilities have already been already updated in `ic-js` -
dfinity/ic-js#725

# Changes

- `npm run upgrade:next`
- Update the displayed votable neurons on proposal changes as well,
since we use the proposal ballots to determine the neurons’ voting
state.

# Tests

- Updated.
- Manually
1.	Created 100+ proposals.
2.	Voted on them.
3. Ensured that some of them were still displayed as votable (due to the
recentBallots limit).
4.	Switched to the utilities that rely on the proposal ballots.
5. Verified that all the proposals previously displayed as votable
(despite having already been voted on) were now displayed as voted.

# Todos

- [x] Add entry to changelog (if necessary).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants