mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
Fetch Babe configuration from runtime state (#11760)
* Fetch babe config data from runtime state * Some renaming * More renaming * Final nits * Fix tests and benches * Rename to in BabeConfiguration * Remove duplicate babe parameter description Already specified over the 'PRIMARY_PROBABILITY' constant value * trigger pipeline * trigger pipeline
This commit is contained in:
@@ -1859,19 +1859,15 @@ impl_runtime_apis! {
|
||||
}
|
||||
|
||||
impl sp_consensus_babe::BabeApi<Block> for Runtime {
|
||||
fn configuration() -> sp_consensus_babe::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>
|
||||
sp_consensus_babe::BabeGenesisConfiguration {
|
||||
fn configuration() -> sp_consensus_babe::BabeConfiguration {
|
||||
let epoch_config = Babe::epoch_config().unwrap_or(BABE_GENESIS_EPOCH_CONFIG);
|
||||
sp_consensus_babe::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