This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Companion for substrate#8724 #2994
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a28bfe9
runtime: create migrations for grandpa storage prefix
octol 9c73867
runtime: address review comments
octol e778278
Merge remote-tracking branch 'upstream/master' into jon/migrate-grand…
octol e2dcfa9
Merge remote-tracking branch 'upstream/master' into jon/migrate-grand…
octol 77e477f
runtime: update spec_version
octol bda222e
Merge remote-tracking branch 'upstream/master' into jon/migrate-grand…
octol 57e2491
westend: fix incorrect merge
octol 6da0632
runtime: change to v3.1 from v4 for grandpa migrations
octol 25ba8b8
Merge remote-tracking branch 'upstream/master' into jon/migrate-grand…
octol c4aabf3
cargo.lock: manually specify pallet-grandpa in lock file
octol 850d6f6
cargo.lock: fix typo
octol 5a5b655
Merge branch 'master' into jon/migrate-grandpa-pallet-framev2
andresilva 0ccd4b0
update substrate
andresilva e422708
Merge branch 'master' into jon/migrate-grandpa-pallet-framev2
andresilva 650edbe
update substrate
andresilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could use
expect
here as Grandpa is part of pallets in construct_runtime, thus it has been given a name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this will break the chain if there is something wrong. IMO panic in
on_initialize
is unrecoverable. Very dangerous code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the proof given is correct, GrandPa is declared in construct_runtime, construct_runtime will implement the PalletInfo and give a name to every pallet, so GrandPa must have a name.
This code path should also have been tested at least one time before going to production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that code is correct.
But why not
if let Some
. Any specific reason?This is a runtime level custom migration instead
#[pallet::hook]
. And many other projects will follow this code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, for me the proof makes sense so both are fine.