Parachains: Use relay chain slot for velocity measurement (#6825)
closes #3967
## Changes
We now use relay chain slots to measure velocity on chain. Previously we
were storing the current parachain slot. Then in `on_state_proof` of the
`ConsensusHook` we were checking how many blocks were athored in the
current parachain slot. This works well when the parachain slot time and
relay chain slot time is the same. With elastic scaling, we can have
parachain slot times lower than that of the relay chain. In these cases
we want to measure velocity in relation to the relay chain. This PR
adjusts that.
## Migration
This PR includes a migration. Storage item `SlotInfo` of pallet
`aura-ext` is renamed to `RelaySlotInfo` to better reflect its new
content. A migration has been added that just kills the old storage
item. `RelaySlotInfo` will be `None` initially but its value will be
adjusted after one new relay chain slot arrives.
---------
Co-authored-by: command-bot <>
Co-authored-by:
Bastian Köcher <git@kchr.de>
parent
5f391db8
Showing
- Cargo.lock 5 additions, 0 deletionsCargo.lock
- cumulus/client/consensus/aura/src/collators/lookahead.rs 1 addition, 0 deletionscumulus/client/consensus/aura/src/collators/lookahead.rs
- cumulus/client/consensus/aura/src/collators/mod.rs 17 additions, 13 deletionscumulus/client/consensus/aura/src/collators/mod.rs
- cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs 10 additions, 1 deletion...ensus/aura/src/collators/slot_based/block_builder_task.rs
- cumulus/client/parachain-inherent/src/mock.rs 4 additions, 7 deletionscumulus/client/parachain-inherent/src/mock.rs
- cumulus/pallets/aura-ext/Cargo.toml 7 additions, 1 deletioncumulus/pallets/aura-ext/Cargo.toml
- cumulus/pallets/aura-ext/src/consensus_hook.rs 25 additions, 17 deletionscumulus/pallets/aura-ext/src/consensus_hook.rs
- cumulus/pallets/aura-ext/src/lib.rs 9 additions, 17 deletionscumulus/pallets/aura-ext/src/lib.rs
- cumulus/pallets/aura-ext/src/migration.rs 74 additions, 0 deletionscumulus/pallets/aura-ext/src/migration.rs
- cumulus/pallets/aura-ext/src/test.rs 338 additions, 0 deletionscumulus/pallets/aura-ext/src/test.rs
- cumulus/pallets/parachain-system/src/consensus_hook.rs 2 additions, 2 deletionscumulus/pallets/parachain-system/src/consensus_hook.rs
- cumulus/pallets/parachain-system/src/lib.rs 2 additions, 2 deletionscumulus/pallets/parachain-system/src/lib.rs
- cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs 1 addition, 0 deletions...us/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
- cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs 1 addition, 1 deletion...s/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs 1 addition, 0 deletions...achains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs 1 addition, 0 deletions...chains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
- cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs 1 addition, 0 deletions...hains/runtimes/collectives/collectives-westend/src/lib.rs
- cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs 1 addition, 0 deletions...parachains/runtimes/contracts/contracts-rococo/src/lib.rs
- cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs 1 addition, 0 deletions...s/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
- cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs 1 addition, 0 deletions.../parachains/runtimes/coretime/coretime-westend/src/lib.rs
Please register or sign in to comment