Make consensus `SlotWorker` don't assume a slot is time / duration (#7441)
* Make consensus `SlotWorker` don't assume a slot is time / duration This removes the last bit of assumption that a slot is always `time / duration`. This will be required by parachains where a slot will be the relay chain block number. Besides this there are also some other drive by changes. One more notable is that `on_slot` now returns a `SlotResult` that holds the block and a potential storage proof. To simplify the implementation and usage of the `SimpleSlotWorker` the `SlotWorker` trait is now implemented for each type that implements `SimpleSlotWorker`. * Update client/consensus/slots/src/lib.rs Co-authored-by:André Silva <123550+andresilva@users.noreply.github.com> * Update client/consensus/slots/src/lib.rs Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com>
Showing
- substrate/Cargo.lock 1 addition, 0 deletionssubstrate/Cargo.lock
- substrate/client/consensus/aura/src/lib.rs 5 additions, 31 deletionssubstrate/client/consensus/aura/src/lib.rs
- substrate/client/consensus/babe/src/lib.rs 1 addition, 21 deletionssubstrate/client/consensus/babe/src/lib.rs
- substrate/client/consensus/slots/Cargo.toml 1 addition, 0 deletionssubstrate/client/consensus/slots/Cargo.toml
- substrate/client/consensus/slots/src/lib.rs 83 additions, 61 deletionssubstrate/client/consensus/slots/src/lib.rs
- substrate/client/consensus/slots/src/slots.rs 1 addition, 30 deletionssubstrate/client/consensus/slots/src/slots.rs
- substrate/primitives/consensus/common/src/lib.rs 7 additions, 0 deletionssubstrate/primitives/consensus/common/src/lib.rs
Please register or sign in to comment