constants

package
v0.0.3-rc-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MilliCents        = Cents / 1000
	Cents             = Dollar / 100
	Dollar            = Units
	Units      uint64 = 10_000_000_000
)
View Source
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)
)
View Source
const AuthoringVersion = 1
View Source
const BlockHashCount = sc.U64(2400)
View Source
const FiveMbPerBlockPerExtrinsic sc.U32 = 5 * 1024 * 1024
View Source
const ImplName = "node-template"
View Source
const ImplVersion = 1
View Source
const SpecName = "node-template"
View Source
const SpecVersion = 100
View Source
const StateVersion = 0
View Source
const StorageVersion = 0
View Source
const TransactionVersion = 1
View Source
const WeightRefTimePerNanos sc.U64 = 1_000
View Source
const WeightRefTimePerSecond sc.U64 = 1_000_000_000_000

Variables

View Source
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)
)
View Source
var (
	Zero       = sc.NewU128(0)
	One        = sc.NewU128(1)
	DefaultTip = Zero
)
View Source
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.

View Source
var BlockExecutionWeight = blockExecutionWeight(WeightRefTimePerNanos)

Time to execute an empty block. Calculated by multiplying the *Average* with `1.0` and adding `0`.

View Source
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`.

MaximumBlockWeight is the maximum weight 2 seconds of compute with a 6-second average block time, with maximum proof size.

View Source
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.

View Source
var PrimaryProbability = types.Tuple2U64{First: 1, Second: 4}

1 in 4 blocks (on average, not counting collisions) will be primary BABE blocks.

View Source
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.

Types

type BlockNumber

type BlockNumber = sc.U32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL