pub trait TimestampConfig {
    const MINIMUM_TIME_INTERVAL: u64 = 2_000u64;
    const MAX_DRIFT: u64 = 60_000u64;
    const MIN_TIME_BEFORE_CLEANUP: u64 = 86_400_000u64;
    const MIN_BLOCKS_BEFORE_CLEANUP: u32 = 15_000u32;

    // Required method
    fn block_height() -> u32;
}
Expand description

Options to configure the timestamp piece in your runtime. Currently we only need access to a block number.

Provided Associated Constants§

source

const MINIMUM_TIME_INTERVAL: u64 = 2_000u64

The minimum amount of time by which the timestamp may be updated.

The default is 2 seconds which should be slightly lower than most chains’ block times.

source

const MAX_DRIFT: u64 = 60_000u64

The maximum amount by which a valid block’s timestamp may be ahead of an importing node’s current local time.

Default is 1 minute.

source

const MIN_TIME_BEFORE_CLEANUP: u64 = 86_400_000u64

The minimum amount of time that must have passed before an old timestamp may be cleaned up.

Default is 1 day.

source

const MIN_BLOCKS_BEFORE_CLEANUP: u32 = 15_000u32

The minimum number of blocks that must have passed before an old timestamp may be cleaned up.

Default is 15 thousand which is roughly equivalent to 1 day with 6 second block times which is a common default in Substrate chains because of Polkadot.

Required Methods§

source

fn block_height() -> u32

A means of getting the current block height. Probably this will be the Tuxedo Executive

Object Safety§

This trait is not object safe.

Implementors§