mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Use BABE to author blocks on Rialto (previously: Aura) (#1050)
* use BABE to author blocks on Rialto (previously: Aura) * removed extra script * use bp_rialto::Moment * fix tests * Babe should control session end * test * Revert "test" This reverts commit 4bbbd76b1fe0aa65002fcfa600cfdc6d15c899e2. * clippy * fix test * Revert "Revert "test"" This reverts commit e9220184d4a14ef4f5a792b239e835528d3baa31. * Revert "Revert "Revert "test""" This reverts commit 9f56a5528945f1d8f82c6346826be68207bf9c75.
This commit is contained in:
committed by
Bastian Köcher
parent
e18844d1f4
commit
08fd53adef
@@ -105,7 +105,7 @@ pub use time_units::*;
|
||||
|
||||
/// Human readable time units defined in terms of number of blocks.
|
||||
pub mod time_units {
|
||||
use super::BlockNumber;
|
||||
use super::{BlockNumber, SESSION_LENGTH};
|
||||
|
||||
pub const MILLISECS_PER_BLOCK: u64 = 6000;
|
||||
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
|
||||
@@ -113,6 +113,11 @@ pub mod time_units {
|
||||
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
|
||||
pub const HOURS: BlockNumber = MINUTES * 60;
|
||||
pub const DAYS: BlockNumber = HOURS * 24;
|
||||
|
||||
pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = SESSION_LENGTH;
|
||||
|
||||
// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks.
|
||||
pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4);
|
||||
}
|
||||
|
||||
/// Block number type used in Rialto.
|
||||
@@ -140,6 +145,9 @@ pub type AccountSigner = MultiSigner;
|
||||
/// Balance of an account.
|
||||
pub type Balance = u128;
|
||||
|
||||
/// An instant or duration in time.
|
||||
pub type Moment = u64;
|
||||
|
||||
/// Rialto chain.
|
||||
#[derive(RuntimeDebug)]
|
||||
pub struct Rialto;
|
||||
|
||||
Reference in New Issue
Block a user