I believe the default era
period in substrate-node-template
is 24 hours. Is there a way for me to change that period?
1 Answer
Eras are measured in sessions. The duration of sessions are dependent on the consensus mechanism.
To reduce the number of sessions per era, simply adjust the SessionsPerEra
value in the implementation of pallet_staking::Config
.
In BABE, the EpochDuration
config member is used to set the number of slots (and therefore the amount of time) in a session. This can only be set in the genesis. The actual parameters given to BABE which determine the block time are in the epoch_config
field of pallet_babe
's GenesisConfig
.
To sum up: you have a few variables to play with - the time between blocks, the amount of blocks in a session, and the amount of sessions in an era. By adjusting these, you can adjust the overall time in a staking era.
-
1
-
-
1It's possible to change the sessions per era in a runtime upgrade, but not possible (with BABE) to update the block time or number of slots in a session with a runtime upgrade.– robCommented Mar 24, 2022 at 2:19