-
Notifications
You must be signed in to change notification settings - Fork 1.2k
apply_authorized_upgrade: Remote authorization if the version check fails
#7812
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cd05afc
`apply_authorized_upgrade`: Implement `feeless_if`
bkchr 0342b1b
Update from bkchr running command 'prdoc --audience runtime_user --bu…
github-actions[bot] 408daab
Fix compile error
bkchr dfc6b4e
Remote `feeless_if` and some other things
bkchr 7e1e963
Update pr_7812.prdoc
bkchr 4ee3329
Update pr_7812.prdoc
bkchr 908768e
Fix test
bkchr bcd1ab5
Merge remote-tracking branch 'refs/remotes/origin/bkchr-code-upgrade-…
bkchr 562f352
AHHHH
bkchr ba30ae3
Merge branch 'master' into bkchr-code-upgrade-stuff
bkchr 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| title: '`apply_authorized_upgrade`: Remote authorization if the version check fails' | ||
| doc: | ||
| - audience: Runtime User | ||
| description: |- | ||
| This pr ensures that we remove the authorization for a runtime upgrade if the version check failed. | ||
| If that check is failing, it means that the runtime upgrade is invalid and the check will never succeed. | ||
|
|
||
| Besides that the pr is doing some clean ups. | ||
| crates: | ||
| - name: cumulus-pallet-parachain-system | ||
| bump: major | ||
| - name: frame-system | ||
| bump: major |
This file contains hidden or 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
Oops, something went wrong.
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.
If a migration is ongoing, the call will fail, and here we don't test for it. But at the same time, if a migration is ongoing it is impossible to dispatch the transaction, so we are fine.
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.
The call is still valid. We are not testing here if the call will not error, we never do this.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, but failing code is roll-backed, so people can spam the chain with this failing code for free, it is better to avoid.
But here we are fine.
And also in any case, the provides being unique, I think it can't spam the transaction pool, only one per block would then be included. But still validator could fill the block with useless extrinsic and the fees would go up.
I wouldn't say a replayable free failing call is valid.
EDIT: Maybe it is useful to keep it around in the transaction pool until it can dispatched, I guess the correct implementation would be to mark it as invalid:
Future.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.
You should not upload invalid wasm files that would fail this check :)
Also the code is now changed to remove the authorization if someone tried and the version check failed. So, you can only send this once.
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.
the check I was talking about is
T::MultiBlockMigrator::ongoing()polkadot-sdk/substrate/frame/system/src/lib.rs
Lines 2269 to 2271 in 007565a
Not about the version check.
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.
Hmm yeah okay, good point.