Skip to content

chore(nns): NeuronsFundAuditInfo migration - #1208

Merged
aterga merged 4 commits into
masterfrom
@anchpop/NeuronsFundAuditInfo-migration
Aug 30, 2024
Merged

aterga merged 4 commits into
masterfrom
@anchpop/NeuronsFundAuditInfo-migration

Conversation

@anchpop

@anchpop anchpop commented Aug 28, 2024 •

Copy link
Copy Markdown
Contributor

Problem

We have switched from the hotkey_principal field to a field named nns_neuron_controller in the type NeuronsFundNeuronPortion. This is because the type nns_neuron_controller more clearly explains the semantics of the type than hotkey_principal. However, already-existing ProposalDatas indirectly contain NeuronsFundNeuronPortions which have None for the new field.

Solution

I've implemented a migration for the NeuronsFundNeuronPortions that are transitively stored in ProposalData to use this new field. The migration lives in pre_upgrade and iterates over the stored ProposalDatas, and sets their neurons_fund_data field to a value that contains the migrated state.

< Previous PR |

@anchpop
anchpop force-pushed the @anchpop/NeuronsFundAuditInfo-migration branch 3 times, most recently from 86cc19d to b678639 Compare August 28, 2024 23:43
@anchpop anchpop changed the title Neurons fund audit info migration chore(nns): NeuronsFundAuditInfo migration Aug 28, 2024
@github-actions github-actions Bot added the chore label Aug 28, 2024
@anchpop
anchpop force-pushed the @anchpop/NeuronsFundAuditInfo-migration branch 2 times, most recently from 8fc91ae to 7652a5d Compare August 29, 2024 09:15
Comment thread rs/nns/governance/canister/canister.rs Resolved
Comment thread rs/nns/governance/src/migrations.rs Resolved
Comment thread rs/nns/governance/src/migrations.rs Resolved
Comment thread rs/nns/governance/src/migrations.rs Resolved
Comment thread rs/nns/governance/src/migrations.rs Resolved
Comment thread rs/nns/governance/src/migrations.rs Resolved
Comment thread rs/nns/governance/canister/canister.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, with the following requests:

  1. Add PR description
  2. Test that the migration fits into one ingress
  3. Check that the migration is called from the right place in post_upgrade

@anchpop
anchpop force-pushed the @anchpop/NeuronsFundAuditInfo-migration branch 2 times, most recently from 3744acb to d95ccbe Compare August 29, 2024 13:31
@anchpop

anchpop commented Aug 29, 2024 •

Copy link
Copy Markdown
Contributor Author
$ git status
On branch @anchpop/NeuronsFundAuditInfo-migration

$ bazel test --test_env=SSH_AUTH_SOCK --test_env=NNS_CANISTER_UPGRADE_SEQUENCE=governance,root --test_output=streamed --test_arg=--nocapture //rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state
[...]
//rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state       PASSED in 1133.4s

Executed 1 out of 1 test: 1 test passes.

@aterga

aterga commented Aug 29, 2024

Copy link
Copy Markdown
Contributor
$ git status
On branch @anchpop/NeuronsFundAuditInfo-migration

$ bazel test --test_env=SSH_AUTH_SOCK --test_env=NNS_CANISTER_UPGRADE_SEQUENCE=governance,root --test_output=streamed --test_arg=--nocapture //rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state
[...]
//rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state       PASSED in 1133.4s

Executed 1 out of 1 test: 1 test passes.

Thanks! Just to be sure the right code was executed, may I suggest adding a panic in the post_upgrade before you call the migration, and running the test once more?

Nit: You don't need to also upgrade Root, so NNS_CANISTER_UPGRADE_SEQUENCE=governance should suffice.

Comment thread rs/nns/integration_tests/BUILD.bazel Resolved
@anchpop
anchpop force-pushed the @anchpop/NeuronsFundAuditInfo-migration branch from d95ccbe to 729d15e Compare August 29, 2024 17:04
@anchpop

anchpop commented Aug 29, 2024

Copy link
Copy Markdown
Contributor Author
$ git status
On branch @anchpop/NeuronsFundAuditInfo-migration

$ bazel test --test_env=SSH_AUTH_SOCK --test_env=NNS_CANISTER_UPGRADE_SEQUENCE=governance,root --test_output=streamed --test_arg=--nocapture //rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state
[...]
//rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state       PASSED in 1133.4s

Executed 1 out of 1 test: 1 test passes.

Thanks! Just to be sure the right code was executed, may I suggest adding a panic in the post_upgrade before you call the migration, and running the test once more?

Nit: You don't need to also upgrade Root, so NNS_CANISTER_UPGRADE_SEQUENCE=governance should suffice.

Doing this causes the test to fail as expected!

github-merge-queue Bot pushed a commit that referenced this pull request Aug 29, 2024
#1171)

This PR adds an integration test that will be needed for an upcoming NNS
Governance migration.

| [Next PR](#1208) >

---------

Co-authored-by: Andre Popovitch <[email protected]>
@anchpop
anchpop force-pushed the @anchpop/NeuronsFundAuditInfo-migration branch from 729d15e to 23ee2b5 Compare August 30, 2024 06:24
@aterga
aterga marked this pull request as ready for review August 30, 2024 10:10
@aterga
aterga requested a review from a team as a code owner August 30, 2024 10:10
@aterga
aterga added this pull request to the merge queue Aug 30, 2024
Merged via the queue into master with commit cf23743 Aug 30, 2024
@aterga
aterga deleted the @anchpop/NeuronsFundAuditInfo-migration branch August 30, 2024 10:32
github-merge-queue Bot pushed a commit that referenced this pull request Sep 3, 2024
In #1208, we added a migration to improve the naming of fields in
NeuronsFundNeuronPortion, and in #1171 we added a test of that
migration. They are no longer necessary, so this PR removes them

[Next PR →](#870)

Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
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.

3 participants