Skip to content

refactor(sns): Add controller and hotkeys information to ClaimSwapNeuronsRequest, and use it in SNS Governance - #596

Merged
anchpop merged 3 commits into
masterfrom
@anchpop/neuron-recipies-refactor
Jul 31, 2024
Merged

anchpop merged 3 commits into
masterfrom
@anchpop/neuron-recipies-refactor

Conversation

@anchpop

@anchpop anchpop commented Jul 24, 2024 •

Copy link
Copy Markdown
Contributor

Note that we transition to an entirely new type inside ClaimSwapNeuronsRequest, NeuronRecipes rather than NeuronParameters. However the types are generally very similar isomorphic.

Change 1:

A oneof has been added to collect information that is unique to direct participants and neurons' fund participants.

Change 2:

They hotkey field has been replaced with nns_neuron_controller. This is convenient because otherwise the next change would have been confusing. The old field was named that way because it becomes a hotkey on the SNS neuron that is allocated to that NNS neuron, but it does not represent a hotkey on the NNS neuron.

Change 2:

A hotkeys field has been added.

This is useful because we want to transfer NF neurons' hotkeys from the NNS over to the SNS.

Change 3

SNS Governance has been updated to support the new type. The old type is still supported as of this MR. SNS Swap still sends uses the old type.

Upgrade dependency

None

NNS1-3198 (which tracks the removal NeuronParameters) can only be implemented once the old field, neuron_parameters, is no longer used by any canisters, and will have to be rolled out carefully since the neuron_parameters field is non-optional.

@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch 2 times, most recently from 1efa825 to 24668ed Compare July 25, 2024 20:32
@anchpop anchpop changed the title Add controller and hotkeys information to ClaimSwapNeuronsRequest Add controller and hotkeys information to ClaimSwapNeuronsRequest, and use it in SNS Governance Jul 25, 2024
@anchpop anchpop changed the title Add controller and hotkeys information to ClaimSwapNeuronsRequest, and use it in SNS Governance refactor(sns): Add controller and hotkeys information to ClaimSwapNeuronsRequest, and use it in SNS Governance Jul 25, 2024
@anchpop
anchpop marked this pull request as ready for review July 25, 2024 21:51
@anchpop
anchpop requested a review from a team as a code owner July 25, 2024 21:51
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch 5 times, most recently from 4328a29 to 0a867c0 Compare July 26, 2024 15:21
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch from 0a867c0 to eea0ce9 Compare July 26, 2024 16:13
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch 2 times, most recently from 43e73e7 to 4753941 Compare July 26, 2024 17:47
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/types.rs Resolved
Comment thread rs/sns/governance/src/types.rs Resolved
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch 2 times, most recently from e3afc60 to 51319f0 Compare July 26, 2024 21:24
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/types.rs Resolved
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/governance.rs Resolved
Comment thread rs/sns/governance/src/governance.rs Resolved

@aterga aterga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, modulo the changes requested.

@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch 5 times, most recently from aa4e3f4 to e3d0da6 Compare July 29, 2024 19:21
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch from e3d0da6 to be272ad Compare July 30, 2024 15:20
anchpop added a commit that referenced this pull request Jul 30, 2024
…rameters` (#679)

This PR simplifies the implementation of `claim_swap_neurons` in SnsGov
by (1) retrofitting `NeuronRecipes` based on legacy struct
`NeuronParameters` (if the new field was not set), and (2) processing
the new neuron recipes in a uniformly.

< [Previous PR in this series](#596) |

Co-authored-by: Andre Popovitch <[email protected]>
anchpop added a commit that referenced this pull request Jul 30, 2024
…rameters` (#679)

This PR simplifies the implementation of `claim_swap_neurons` in SnsGov
by (1) retrofitting `NeuronRecipes` based on legacy struct
`NeuronParameters` (if the new field was not set), and (2) processing
the new neuron recipes in a uniformly.

< [Previous PR in this series](#596) |

Co-authored-by: Andre Popovitch <[email protected]>
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch 3 times, most recently from 923f0a3 to 634c864 Compare July 30, 2024 17:42
@anchpop
anchpop enabled auto-merge July 30, 2024 17:45
anchpop and others added 3 commits July 30, 2024 16:54
…rameters` (#679)

This PR simplifies the implementation of `claim_swap_neurons` in SnsGov
by (1) retrofitting `NeuronRecipes` based on legacy struct
`NeuronParameters` (if the new field was not set), and (2) processing
the new neuron recipes in a uniformly.

< [Previous PR in this series](#596) |

Co-authored-by: Andre Popovitch <[email protected]>
@anchpop
anchpop force-pushed the @anchpop/neuron-recipies-refactor branch from 634c864 to 4e1bd3b Compare July 30, 2024 21:55
@anchpop
anchpop added this pull request to the merge queue Jul 30, 2024
Merged via the queue into master with commit 96bc278 Jul 31, 2024
@anchpop
anchpop deleted the @anchpop/neuron-recipies-refactor branch July 31, 2024 00:04
github-merge-queue Bot pushed a commit that referenced this pull request Aug 5, 2024
#596 added `NeuronRecipes` in `ClaimSwapNeuronsRequest`, a replacement
for `NeuronParameters`. This PR uses it in SNS Swap

| [Next PR](#705) >

---------

Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
@andrew-lee-work

andrew-lee-work commented Aug 16, 2024 •

Copy link
Copy Markdown
Contributor

LGTM.

The neuron recipe's construct_permissions LGTM.

The new neuron recipe validation introduces a new way to fail claiming a neuron, but this does not lead to any unsafe behavior because the SNS will not go into normal mode if it is unable to create any swap neurons.

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.

4 participants