humanode icon indicating copy to clipboard operation
humanode copied to clipboard

Check the way to convert `SlotDuration` into `Duration`

Open dmitrylavrenov opened this issue 3 years ago • 3 comments

As a follow up of #324 and discussion.

dmitrylavrenov avatar May 25 '22 14:05 dmitrylavrenov

The usage of std::time::Duration::from_millis(humanode_runtime::SLOT_DURATION) is clear as SLOT_DURATION is defined in milliseconds. Should we check smth else?

pub const SLOT_DURATION: u64 = super::block_time::MILLISECS_PER_BLOCK;

// NOTE: Currently it is not possible to change the slot duration after the chain has started.
 //       Attempting to do so will brick block production.
pub const MILLISECS_PER_BLOCK: u64 = 6000;

@MOZGIII

dmitrylavrenov avatar Dec 14 '22 10:12 dmitrylavrenov

Rename SLOT_DURATION -> SLOT_DURATION_IN_MILLISECONDS.

dmitrylavrenov avatar Dec 14 '22 13:12 dmitrylavrenov

Please check if this is still relevant after the latest substrate upgrade @dmitrylavrenov

MOZGIII avatar Feb 04 '23 08:02 MOZGIII