diff --git a/Cargo.lock b/Cargo.lock index feccf0c..44eb8a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7534,6 +7534,7 @@ dependencies = [ "sp-block-builder", "sp-blockchain", "sp-consensus-aura", + "sp-consensus-babe", "sp-core 21.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-io 23.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-keystore 0.27.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", diff --git a/Cargo.toml b/Cargo.toml index 3485839..b326968 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,6 +80,7 @@ sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-core = { version = "21.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } sp-io = { version = "23.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index b6adfdc..acd8daa 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -49,6 +49,7 @@ sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-blockchain = { workspace = true } sp-consensus-aura = { workspace = true } +sp-consensus-babe = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true, optional = true } sp-keystore = { workspace = true } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 95ad7fc..571d146 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -291,10 +291,15 @@ pub mod devnet { ..Default::default() }, transaction_payment: Default::default(), - babe: Some(BabeConfig { authorities: vec![] }), - grandpa: GrandpaConfig { - authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), + babe: BabeConfig { + authorities: vec![], + epoch_config: Some(sp_consensus_babe::BabeEpochConfiguration { + c: (1, 4), + allowed_slots: sp_consensus_babe::AllowedSlots::PrimaryAndSecondaryPlainSlots, + }), + _config: std::marker::PhantomData, }, + grandpa: GrandpaConfig { authorities: vec![], _config: std::marker::PhantomData }, } } } diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index 745b5fd..895099b 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -224,6 +224,13 @@ pub const UNIT: Balance = 1_000 * MILLIUNIT; pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; +// pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); + +// pub const pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = sp_consensus_babe::BabeEpochConfiguration { +// c: PRIMARY_PROBABILITY, +// allowed_slots: sp_consensus_babe::AllowedSlots::PrimaryAndSecondaryPlainSlots, +// }; + pub const fn deposit(items: u32, bytes: u32) -> Balance { (items as Balance * 20 * UNIT + (bytes as Balance) * 100 * MICROUNIT) / 100 }