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

Runtime migrations tracking issue #164

Closed
20 tasks done
apopiak opened this issue May 29, 2020 · 8 comments
Closed
20 tasks done

Runtime migrations tracking issue #164

apopiak opened this issue May 29, 2020 · 8 comments

Comments

@apopiak
Copy link
Collaborator

apopiak commented May 29, 2020

This issue tracks the runtime migrations necessary for the edgeware chain upgrade.
Based on PRs with migrations hackMD as well as Substrate PRs labeled D1-runtime-migration.

Migration Strategy

General strategy:

  1. pre-hasher migrations first in custom runtime migration here
  2. hasher migration including account migration as the last migration in the custom migration
  3. post-hasher migrations that assume up-to-date hashers in the modules

Some pallets need to go through this flow in a custom way (e.g. staking combines a pre- and post-hasher migration (lazy and simple payouts)).

Relevant Migration PRs

Last commit in v1.0.1redo was on 2020-02-13.

These might include more than one logical migration each.

⬆️ pre-hasher migrations

⬇️ post-hasher migrations

Removed Migrations

Maybe Relevant Migrations

Removed Migrations

@drewstone
Copy link
Collaborator

Thanks for sharing! Will keep an eye on this here as well. I've also gone ahead with updating the branch with more recent substrate versions (on our fork). I'll link you there so we can make sure we're not stepping on each others feet, though I presume updating the time-travel node shouldn't change your efforts.

@drewstone
Copy link
Collaborator

@apopiak would you be able to document how you're running the upgrades/tests? Are you using Alice/bob accounts. Would be appreciated to keep the info here as up-to-date :)!

@apopiak
Copy link
Collaborator Author

apopiak commented Jun 23, 2020

Build:

cargo build --release

Purge:

./target/release/edgeware purge-chain -y --chain=./chains/hybrid-mainnet-dev.json

Run:

#!/usr/bin/env bash
timestamp=$(date +%s)
mkdir -p ./logs
./target/release/edgeware --chain=./chains/hybrid-mainnet-dev.json --alice -lruntime=debug |& tee logs/${timestamp}.log

Then I connect with polkadot-js apps to the local node and:

  • run sudo > setBalance to increase Alice's balance to something very high (e.g 1'000'000) (with Alice's account, she is configured as sudo).
  • run sudo > setCodeWithoutChecks with Alice's account.

drewstone pushed a commit that referenced this issue Jun 23, 2020
* add migration.md to track the process

* remove migration md (moved to issue #164)

* WIP add signaling hasher migration and (failing) test

* fix migration test

* add voting hasher change test and fix migration

* add WIP state grafting script

* actually execute migration for voting pallet

* use live chain for grafting and reformt code

* use apopiak-migrations substrate branch

* update grafting script to skip staking

* remove berlin.json loading line

* add mainnet-dev hybrid chainspec for migration testing

* update Cargo.lock

* add custom migration that orders balances and account migration correctly

* update cargo.lock
@apopiak
Copy link
Collaborator Author

apopiak commented Jul 1, 2020

@apopiak
Copy link
Collaborator Author

apopiak commented Jul 2, 2020

Do we need to migrate authorities?
https://github.com/paritytech/substrate/pull/5226/files#diff-74f259f248f6d1f0adbc9b87d8bc322dR212

Nope, removed the code.

@apopiak
Copy link
Collaborator Author

apopiak commented Jul 6, 2020

Found a missing migration: indices migration.

@apopiak
Copy link
Collaborator Author

apopiak commented Sep 3, 2020

removed the pallet listing, leaving it here just in case:

Pallets

  • System: frame_system
  • Utility: pallet_utility
  • Aura: pallet_aura
  • Timestamp: pallet_timestamp
  • Authorship: pallet_authorship
  • Indices: pallet_indices
  • Balances: pallet_balances
  • TransactionPayment: pallet_transaction_payment
  • Staking: pallet_staking
  • Session: pallet_session
  • Democracy: pallet_democracy
  • Council: pallet_collective::
  • Elections: pallet_elections_phragmen
  • FinalityTracker: pallet_finality_tracker
  • Grandpa: pallet_grandpa
  • Treasury: pallet_treasury
  • Contracts: pallet_contracts
  • Sudo: pallet_sudo
  • ImOnline: pallet_im_online
  • AuthorityDiscovery: pallet_authority_discovery
  • Offences: pallet_offences
  • RandomnessCollectiveFlip: pallet_randomness_collective_flip
  • Identity: pallet_identity
  • Scheduler: pallet_scheduler
  • Vesting: pallet_vesting
  • EVM: pallet_evm
  • Historical: pallet_session_historical
  • Signaling: signaling
  • Voting: voting
  • TreasuryReward: treasury_reward

@apopiak
Copy link
Collaborator Author

apopiak commented Nov 10, 2020

Migration was run.

@apopiak apopiak closed this as completed Nov 10, 2020
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

No branches or pull requests

2 participants