Documentation ¶
Index ¶
Constants ¶
const ( MilliCents = Cents / 1000 Cents = Dollar / 100 Dollar = Units Units uint64 = 10_000_000_000 )
const ( MillisecsPerBlock sc.U64 = 3000 SecsPerBlock sc.U64 = MillisecsPerBlock / 1000 // Currently it is not possible to change the slot duration after the chain has started. // Attempting to do so will brick block production. SlotDuration = MillisecsPerBlock // These time units are defined in number of blocks. Minutes BlockNumber = 60 / BlockNumber(SecsPerBlock) Hours BlockNumber = Minutes * 60 Days BlockNumber = Hours * 24 // Currently it is not possible to change the epoch duration after the chain has started. // Attempting to do so will brick block production. EpochDurationInBlocks BlockNumber = 10 * Minutes SlotFillRate = float64(MillisecsPerBlock) / float64(SlotDuration) EpochDurationInSlots = sc.U64(float64(EpochDurationInBlocks) * SlotFillRate) )
const AuthoringVersion = 1
const BlockHashCount = sc.U64(2400)
const FiveMbPerBlockPerExtrinsic sc.U32 = 5 * 1024 * 1024
const ImplName = "node-template"
const ImplVersion = 1
const SpecName = "node-template"
const SpecVersion = 100
const StateVersion = 0
const StorageVersion = 0
const TransactionVersion = 1
const WeightRefTimePerNanos sc.U64 = 1_000
const WeightRefTimePerSecond sc.U64 = 1_000_000_000_000
Variables ¶
var (
ZeroAddress, _ = primitives.NewAddress32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
OneAddress, _ = primitives.NewAddress32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
TwoAddress, _ = primitives.NewAddress32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2)
ZeroAccountId = primitives.NewAccountIdFromAddress32(ZeroAddress)
OneAccountId = primitives.NewAccountIdFromAddress32(OneAddress)
TwoAccountId = primitives.NewAccountIdFromAddress32(TwoAddress)
)
var AverageOnInitializeRatio types.Perbill = types.Perbill{Percentage: 10}
We assume that ~10% of the block weight is consumed by `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic.
var BlockExecutionWeight = blockExecutionWeight(WeightRefTimePerNanos)
Time to execute an empty block. Calculated by multiplying the *Average* with `1.0` and adding `0`.
var ExtrinsicBaseWeight = baseExtrinsicWeight(WeightRefTimePerNanos)
ExtrinsicBaseWeight is the time to execute a NO-OP extrinsic, for example `System::remark`. Calculated by multiplying the *Average* with `1.0` and adding `0`.
var MaximumBlockWeight = types.WeightFromParts( sc.SaturatingMulU64(WeightRefTimePerSecond, 2), math.MaxUint64, )
MaximumBlockWeight is the maximum weight 2 seconds of compute with a 6-second average block time, with maximum proof size.
var NormalDispatchRatio types.Perbill = types.Perbill{Percentage: 75}
We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by Operational extrinsics.
var PrimaryProbability = types.Tuple2U64{First: 1, Second: 4}
1 in 4 blocks (on average, not counting collisions) will be primary BABE blocks.
var RocksDbWeight = types.RuntimeDbWeight{ Read: sc.U64(25_000) * WeightRefTimePerNanos, Write: sc.U64(100_000) * WeightRefTimePerNanos, }
RocksDbWeight for RocksDB, used throughout the runtime.
Functions ¶
This section is empty.