-
Notifications
You must be signed in to change notification settings - Fork 26
Inherents and empty block production overhaul #86
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 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
d1bce56
inherent overhaul
liamaharon 20878ee
bump version
liamaharon d58941c
clean up custom idps
liamaharon ff30415
smart inherent provider
liamaharon 5883f46
licence and basic docs
liamaharon b27fd10
clippy
liamaharon 62d9696
remove node-executor node-primitive deps
liamaharon 9c5fcbe
fmt
liamaharon ac898c2
update cargo.lock
liamaharon 36a8cf1
move shared params to common
liamaharon 4424f61
move misc logging to common
liamaharon a0a5485
move parse to common
liamaharon 16c5b39
move state to common
liamaharon 9632a14
move inherents to empty block production dir
liamaharon 4f7e04e
move block creation out of fast forward
liamaharon b728086
improve log
liamaharon 039cdaf
clippy
liamaharon bcdd083
cargo fmt
liamaharon 4a406c6
update test runtimes and snapshots
liamaharon fd0092e
use stable for clippy
liamaharon 4b4648b
fix typos
liamaharon 527c857
Update core/src/common/empty_block/inherents/pre_apply.rs
liamaharon c7dbbfe
address comments
liamaharon 8b465e2
doc comment
liamaharon 828a357
doc
liamaharon 5980993
use valueenum
liamaharon aee8086
rename execute_next_block to mine_block
liamaharon 2254202
bump relay_offset +1
liamaharon 00e2962
blocktime arg
liamaharon e80f524
make blocktime a required value
liamaharon 47a76ca
hardcode relaychain blocktime
liamaharon c6a143b
clippy
liamaharon 5fdd6d5
free disk space on test runner
liamaharon 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
smart inherent provider
- Loading branch information
commit ff30415853a19d3f9b73752e5801518740ff9ab9
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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| pub mod custom_idps; | ||
| pub mod pre_apply; | ||
| pub mod providers; |
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,21 @@ | ||
| use cumulus_primitives_parachain_inherent::MessageQueueChain; | ||
| use parity_scale_codec::Encode; | ||
| use sp_core::{twox_128, H256}; | ||
| use sp_runtime::traits::{Block as BlockT, HashingFor}; | ||
| use sp_state_machine::TestExternalities; | ||
|
|
||
| /// Some operations must be to performed prior to inherents being applied. | ||
| pub fn pre_apply_inherents<B: BlockT>(ext: &mut TestExternalities<HashingFor<B>>) { | ||
| // set the last dmq mcq head value to zero to pass this check | ||
| // https://github.com/paritytech/polkadot-sdk/blob/ef114a422291b44f8973739ab7858a29a523e6a2/cumulus/pallets/parachain-system/src/lib.rs#L1162 | ||
| // | ||
| // it would have been preferable to set it to the real value in the mock inherent | ||
| // provider for parachain system, but that would require the paraid which we cannot | ||
| // derive from the externalities. | ||
| let last_dmq_mqc_head_key = | ||
| [twox_128(b"ParachainSystem"), twox_128(b"LastDmqMqcHead")].concat(); | ||
| ext.insert( | ||
| last_dmq_mqc_head_key.to_vec(), | ||
| MessageQueueChain::new(H256::zero()).encode(), | ||
| ); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.