-
Notifications
You must be signed in to change notification settings - Fork 690
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
feat: compute pallet/storage prefix hash at compile time #1539
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6b8cacf
wip
yjhmelody 2085d3f
feat: compile time two128 for storage prefix and pallet prefix
yjhmelody 8cef0a2
fix `storage_prefix_hash`
yjhmelody 2852706
Merge branch 'master' into comptime-storage-prefix
yjhmelody 8d72a7d
Update substrate/frame/support/src/traits/storage.rs
yjhmelody 9fd6bab
Update substrate/frame/support/src/traits/storage.rs
yjhmelody 23af461
".git/.scripts/commands/fmt/fmt.sh"
5f0e7ad
Merge branch 'master' into comptime-storage-prefix
yjhmelody 6e7a2e0
minor improve
yjhmelody 2f486ff
rename all `module_prefix` to `pallet_prefix`
yjhmelody cc7337e
add `name_hash` to `PalletInfoAccess`
yjhmelody c81c7cd
impl `name_hash`
yjhmelody ab74491
fmt
yjhmelody 3ff7d98
Merge branch 'master' into comptime-storage-prefix
yjhmelody 7f542a5
Merge branch 'master' into comptime-storage-prefix
yjhmelody 2eed609
Merge branch 'master' into comptime-storage-prefix
yjhmelody 63974e2
Merge branch 'master' into comptime-storage-prefix
yjhmelody 3d3b99d
Merge branch 'master' into comptime-storage-prefix
yjhmelody 891d7c2
Merge branch 'master' into comptime-storage-prefix
yjhmelody 32888bd
Merge branch 'master' into comptime-storage-prefix
yjhmelody 5394c97
Merge branch 'master' into comptime-storage-prefix
yjhmelody be2e302
Merge branch 'master' into comptime-storage-prefix
yjhmelody 2eb3840
Merge branch 'master' into comptime-storage-prefix
ggwpez 44c8c05
Merge branch 'master' into comptime-storage-prefix
yjhmelody 18f13e6
`fn prefix_hash() -> [u8; 32]`
yjhmelody ccfadd5
Merge branch 'master' into comptime-storage-prefix
yjhmelody 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.
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.
So, this might not be true under a misconfiguration, i.e. someone implements the pallet
Config
trait for a runtime, but forgets to include the actual pallet inconstruct_runtime
.Hopefully we do now have lints or warnings to catch this, but on the off-chance that we don't, I'd want to make sure that this
expect
doesn't trigger and cause a panic in runtime.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.
This assumption is already used there multiple times.