Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Reward pool migration fix #13715

Merged
merged 11 commits into from
Mar 27, 2023
Merged

Conversation

rossbulat
Copy link

@rossbulat rossbulat commented Mar 26, 2023

RewardPools are currently not being decoded on Westend. This may be because of a migration that was needed on RewardPool for new commission counter fields total_commission_pending and total_commission_claimed.

polkadot companion: paritytech/polkadot#6957

@rossbulat rossbulat added A0-please_review Pull request needs code review. I3-bug The node fails to follow expected behavior. labels Mar 26, 2023
Ross Bulat and others added 5 commits March 26, 2023 23:56
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@rossbulat rossbulat marked this pull request as ready for review March 27, 2023 01:50
@rossbulat rossbulat requested a review from a team March 27, 2023 01:50
@rossbulat rossbulat added C7-critical PR touches the given topic and has a critical impact on builders. E0-runtime_migration PR introduces code that might require downstream chains to run a runtime upgrade. T1-runtime This PR/Issue is related to the topic “runtime”. B0-silent Changes should not be mentioned in any release notes B1-note_worthy Changes should be noted in the release notes D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited and removed B0-silent Changes should not be mentioned in any release notes labels Mar 27, 2023
frame/nomination-pools/src/migration.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ruseinov ruseinov left a comment

Choose a reason for hiding this comment

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

looks good. Please verify this works via try-runtime before merging.

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
@rossbulat
Copy link
Author

bot fmt

@command-bot
Copy link

command-bot bot commented Mar 27, 2023

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2592554 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 47-f150f132-87a6-4270-908d-177324bd9b6c to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Mar 27, 2023

@rossbulat Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2592554 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2592554/artifacts/download.

@kianenigma
Copy link
Contributor

interestingly, could have been caught by #13013

log!(info, "🔥 There are {} undecodable RewardPools in storage. This migration will try to correct them. keys: {}, values: {}", rpool_keys.saturating_sub(rpool_values), rpool_keys, rpool_values);
}

ensure!(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is all fine, but end game is have #13013.

@kianenigma kianenigma removed the I3-bug The node fails to follow expected behavior. label Mar 27, 2023
Otherwise it wont chain together with the V5.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

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

I added two more commits to:

  • Make the V4 migration re-usable
  • Add a MigrateV3ToV5 wrapper

@rossbulat
Copy link
Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 46bdb43 into master Mar 27, 2023
@paritytech-processbot paritytech-processbot bot deleted the rb-reward-pool-migration-fix branch March 27, 2023 15:02
coderobe pushed a commit that referenced this pull request Mar 27, 2023
* reward pool migration fix

* comment

* remove generic

* rm max

* foramtting

* Add note to V4 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more asserts to the V5 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/migration.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* Make V4 migration re-usable

Otherwise it wont chain together with the V5.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add MigrateV3ToV5 wrapper

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
@jakoblell jakoblell added D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Mar 29, 2023
@ggwpez
Copy link
Member

ggwpez commented Apr 3, 2023

For posterity:
This fixes encoding errors for all prefix keys 0x7a6d38deaa01cb6e76ee69889f169627fa0883f96ad25255581bef5ba72b8750...

pgherveou pushed a commit that referenced this pull request Apr 4, 2023
* reward pool migration fix

* comment

* remove generic

* rm max

* foramtting

* Add note to V4 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more asserts to the V5 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/migration.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* Make V4 migration re-usable

Otherwise it wont chain together with the V5.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add MigrateV3ToV5 wrapper

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 10, 2023
* reward pool migration fix

* comment

* remove generic

* rm max

* foramtting

* Add note to V4 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more asserts to the V5 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/migration.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* Make V4 migration re-usable

Otherwise it wont chain together with the V5.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add MigrateV3ToV5 wrapper

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
gpestana added a commit that referenced this pull request Apr 23, 2023
* reward pool migration fix

* comment

* remove generic

* rm max

* foramtting

* Add note to V4 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more asserts to the V5 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/migration.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* Make V4 migration re-usable

Otherwise it wont chain together with the V5.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add MigrateV3ToV5 wrapper

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
mattheworris added a commit to frequency-chain/frequency that referenced this pull request Jun 15, 2023
# Goal
The goal of this PR is upgrade Polkadot to v0.9.42

Polkadot Release Notes:
https://github.com/paritytech/polkadot/releases/tag/v0.9.42
https://github.com/paritytech/polkadot/releases/tag/v0.9.41
https://github.com/paritytech/polkadot/releases/tag/v0.9.40

Polkadot Release Analysis:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-41-v0-9-42/2828/1

Closes #1472 
Closes #1270 
Closes #1332 

# Discussion
- v0.9.40 was not working and there was evidence that changes in v0.9.42
were related, so we decided to jump ahead to v0.9.42
<!-- List discussion items -->
# Runtime Migrations Included
- [x] paritytech/polkadot#6937
- [x] paritytech/substrate#13715
- [x] paritytech/substrate#13936
- [x] paritytech/polkadot#7114
- [x] Further all migrations from 9.38+ are included:
paritytech/polkadot#7162)
# Checklist
- [x] Chain spec updated
- [ ] Custom RPC OR Runtime API added/changed? Updated js/api-augment.
- [ ] Design doc(s) updated
- [ ] Tests added
- [ ] Benchmarks added
- [x] Weights updated
# Tests Performed
- [x] `make ci-local` -- Passing (includes lint, docs, unit-test and
integration-test)
- [x] `make start-native` -- Successfully attached debugger when
creating MSA with Polkadot UI
- [x] `make start-relay` -- Docker Containers successfully started, but
too slow in emulation on Apple Silicon M2.
- [x] `make upgrade-local` -- Successfully started local relay network
and upgraded to a newer test runtime.
- [x] `make upgrade-local` -- Successfully updated a node running the
current version on branch `main`

---------

Co-authored-by: Frequency CI [bot] <do-not-reply@users.noreply.github.com>
Co-authored-by: Matthew Orris <--help>
Co-authored-by: Robert La Ferla <robert@onemsg.co>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* reward pool migration fix

* comment

* remove generic

* rm max

* foramtting

* Add note to V4 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more asserts to the V5 migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/migration.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* Make V4 migration re-usable

Otherwise it wont chain together with the V5.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add MigrateV3ToV5 wrapper

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C7-critical PR touches the given topic and has a critical impact on builders. D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited E0-runtime_migration PR introduces code that might require downstream chains to run a runtime upgrade. T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants