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

Merge neurons #539

Merged
merged 28 commits into from Mar 15, 2022
Merged

Merge neurons #539

merged 28 commits into from Mar 15, 2022

Conversation

anishh2003
Copy link
Contributor

@anishh2003 anishh2003 commented Mar 7, 2022

Motivation

The governance canister supports merging neurons provided that they are controlled by the same principal.
But currently there is no way to use this functionality via the NNS frontend Dapp.
This PR makes it easy for users to merge neurons by adding a new 'Merge Neurons' button to the neurons tab.

Changes

  • Added merge to ServiceApi.ts which calls manage_neuron on the governance canister using the merge command
  • Give users the option to merge neurons via a new 'Merge Neurons' button on the neurons tab

@anishh2003 anishh2003 requested a review from hpeebles March 7, 2022 14:28
@hpeebles
Copy link
Contributor

hpeebles commented Mar 7, 2022

When a user requests to merge 2 neurons, the only check we do in the browser is that the 2 neurons are controlled by the same principal.
There are additional restrictions (eg. neither neuron can be in the community fund and the 2 neurons must have matching followees on the 'ManageNeuron' topic), but these are only checked in the governance canister since it seems possible that these restrictions will be dropped in the future.
Any errors which the governance canister returns are shown to the user so if any of the checks fail the user will be told the reason.

@hpeebles hpeebles removed their request for review March 15, 2022 15:26
@hpeebles
Copy link
Contributor

This code is deployed to here - https://qvhpv-4qaaa-aaaaa-aaagq-cai.nnsdapp.dfinity.network/v2/
I have tested the various scenarios and everything looks to be working.
The target and source neurons are always assigned correctly so as to ensure age bonus is always preserved.
The error messages bubble up to the end user whenever they are unable to merge neurons (eg. the controllers don't match).

@bitdivine bitdivine merged commit 1179461 into main Mar 15, 2022
@bitdivine bitdivine deleted the merge_neurons branch March 15, 2022 15:44
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.

None yet

3 participants