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 2.6k
Add OnPostInherent
Hook (try 2)
#10128
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7bb186f
extend trait
shawntabrizi 2c2046e
add OnPostInherent traits
shawntabrizi 24c953d
actually call post inherent hook
shawntabrizi 93a9955
add to client block builder
shawntabrizi db0430a
add logic to executive
shawntabrizi a97e42f
use executive hook
shawntabrizi cadcd77
Update hooks_invalid_item.stderr
shawntabrizi 47a5e72
fix try-runtime feature flag
shawntabrizi 11dabdc
Update storage_info_unsatisfied_nmap.stderr
shawntabrizi 4e4362a
Update frame/support/src/traits/hooks.rs
shawntabrizi a7292d3
feedback
shawntabrizi a6210e5
add reserved function name
shawntabrizi f289c36
frame support tests
shawntabrizi b20daa1
test in executive
shawntabrizi 02a006a
fmt
shawntabrizi 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
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
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.
what will happen if runtime have not yet implemented this API?
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.
Block Production and Block Execution would come to different results.
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 need to think bit more about how to upgrade.
New runtime + old client needs to panic, else I think it will cause forking
Old runtime + new client should have the same behavior as old runtime + old client else it is forking
So the upgrade order should be upgrade client, and then runtime. And all the old client shouldn't be able to produce blocks for new runtime. Syncing maybe is 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.
syncing should be fine since there will be no implementations of
on_post_inherent
before this PR, so everything will be a noop.I agree, this is clearly a client breaking change, and should be handled like any hard change, but also only if the feature is being used.
There is not much danger to release this in the wild as long as the feature is not used.
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 the client call the on_post_inherent api but the api doesn't exist in the runtime, I don't think it will be no-op. I think it will panic, no ?
there should be a way to only execute on_post_inherent if the api is provided by the runtime (by using version or stuff like this https://paritytech.github.io/substrate/master/sp_api/macro.decl_runtime_apis.html#runtime-api-trait-versioning), this way the client support all kind of runtime.
Thought the client will have to upgrade before the runtime, an old client will produce invalid block.
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 more concrete solution to me would be:
When release a version we need to say that client must upgrade before runtime. or at least before runtime implement
on_post_inherent
with something not no-op.