-
Notifications
You must be signed in to change notification settings - Fork 371
Aura consensus for parachains #371
Conversation
Co-authored-by: Bastian Köcher <[email protected]>
…r-aura-the-long-way
| force_authoring, | ||
| slot_duration, | ||
| // We got around 500ms for proposing | ||
| block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), |
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.
1 / 24 * 12 sec = 500ms?
Somehow we should pull in the 12 second block times here? else some change in the config will have unintended 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.
This is a proportion, not a duration in milliseconds.
It expresses that we can use 1/24 of the slot duration for proposing. Which in our case is 500ms
| /// but we require the old authorities to verify the seal when validating a PoV. This will always | ||
| /// be updated to the latest AuRa authorities in `on_finalize`. | ||
| #[pallet::storage] | ||
| pub(crate) type Authorities<T: Config> = StorageValue<_, Vec<T::AuthorityId>, ValueQuery>; |
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.
Is it possible to introduce bounded vec here so we dont need to change it 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.
Aura is not yet using BoundedVec. It will start to fail with a compilation error when this change this done. After that we can change it here.
I don't want to introduce a new upper bound here, when we can just fetch it from AURA later.
andresilva
left a comment
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.
Only minor nits the overall approach seems correct to me.
| sc-client-api = { git = "https://github.com/paritytech/substrate", optional = true , branch = "master" } | ||
| sp-runtime = { git = "https://github.com/paritytech/substrate", optional = true , branch = "master" } | ||
| sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } | ||
| sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } | ||
| sp-state-machine = { git = "https://github.com/paritytech/substrate", optional = true , branch = "master" } | ||
| sp-trie = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } | ||
| sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } | ||
| sp-api = { git = "https://github.com/paritytech/substrate", optional = true , branch = "master" } |
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.
Revert?
| IDP::InherentDataProviders: InherentDataProviderExt + Send + Sync, | ||
| { | ||
| sc_consensus_aura::import_queue::<P, _, _, _, _, _, _>(sc_consensus_aura::ImportQueueParams { | ||
| block_import: crate::ParachainBlockImport(block_import), |
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 is the only difference from regular aura import queue right?
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.
Yeah
Co-authored-by: André Silva <[email protected]>
Co-authored-by: André Silva <[email protected]>
Co-authored-by: André Silva <[email protected]>
|
bot merge |
|
Trying merge. |
This pr introduces Aura for parachains. It is working, but at least one thing is missing to make it secure. We don't verify yet that the slot is "valid", based on the time of the relay block. This will come in some later pr, when we are able to read the relay chain storage more easily.
The pr is also not yet mergable:
Fixes: #115