mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 11:17:56 +00:00
Companion - Read babe config parameters from runtime (#5842)
* Read babe config parameters from runtime
* Trigger pipeline
* Trigger pipeline (after PR title change)
* update lockfile for {"substrate"}
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -992,19 +992,15 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
|
||||
impl babe_primitives::BabeApi<Block> for Runtime {
|
||||
fn configuration() -> babe_primitives::BabeGenesisConfiguration {
|
||||
// The choice of `c` parameter (where `1 - c` represents the
|
||||
// probability of a slot being empty), is done in accordance to the
|
||||
// slot duration and expected target block time, for safely
|
||||
// resisting network delays of maximum two seconds.
|
||||
// <https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results>
|
||||
babe_primitives::BabeGenesisConfiguration {
|
||||
fn configuration() -> babe_primitives::BabeConfiguration {
|
||||
let epoch_config = Babe::epoch_config().unwrap_or(BABE_GENESIS_EPOCH_CONFIG);
|
||||
babe_primitives::BabeConfiguration {
|
||||
slot_duration: Babe::slot_duration(),
|
||||
epoch_length: EpochDuration::get(),
|
||||
c: BABE_GENESIS_EPOCH_CONFIG.c,
|
||||
genesis_authorities: Babe::authorities().to_vec(),
|
||||
c: epoch_config.c,
|
||||
authorities: Babe::authorities().to_vec(),
|
||||
randomness: Babe::randomness(),
|
||||
allowed_slots: BABE_GENESIS_EPOCH_CONFIG.allowed_slots,
|
||||
allowed_slots: epoch_config.allowed_slots,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user