genesis

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateLockupField = "state_lockup"
)

Variables

View Source
var (
	ErrInvalidHRP    = errors.New("invalid HRP")
	ErrInvalidTarget = errors.New("invalid target")
)

Functions

This section is empty.

Types

type CustomAllocation

type CustomAllocation struct {
	Address string `json:"address"` // bech32 address
	Balance uint64 `json:"balance"`
}

type Genesis

type Genesis struct {
	// Address prefix
	HRP string `json:"hrp"`

	// Chain Parameters
	MinBlockGap      int64 `json:"minBlockGap"`      // ms
	MinEmptyBlockGap int64 `json:"minEmptyBlockGap"` // ms

	// Chain Fee Parameters
	MinUnitPrice               chain.Dimensions `json:"minUnitPrice"`
	UnitPriceChangeDenominator chain.Dimensions `json:"unitPriceChangeDenominator"`
	WindowTargetUnits          chain.Dimensions `json:"windowTargetUnits"` // 10s
	MaxBlockUnits              chain.Dimensions `json:"maxBlockUnits"`     // must be possible to reach before block too large

	// Tx Parameters
	ValidityWindow int64 `json:"validityWindow"` // ms

	// Tx Fee Parameters
	BaseComputeUnits                  uint64 `json:"baseUnits"`
	BaseWarpComputeUnits              uint64 `json:"baseWarpUnits"`
	WarpComputeUnitsPerSigner         uint64 `json:"warpUnitsPerSigner"`
	OutgoingWarpComputeUnits          uint64 `json:"outgoingWarpComputeUnits"`
	ColdStorageKeyReadUnits           uint64 `json:"coldStorageKeyReadUnits"`
	ColdStorageValueReadUnits         uint64 `json:"coldStorageValueReadUnits"` // per chunk
	WarmStorageKeyReadUnits           uint64 `json:"warmStorageKeyReadUnits"`
	WarmStorageValueReadUnits         uint64 `json:"warmStorageValueReadUnits"` // per chunk
	StorageKeyCreateUnits             uint64 `json:"storageKeyCreateUnits"`
	StorageValueCreateUnits           uint64 `json:"storageKeyValueUnits"` // per chunk
	ColdStorageKeyModificationUnits   uint64 `json:"coldStorageKeyModificationUnits"`
	ColdStorageValueModificationUnits uint64 `json:"coldStorageValueModificationUnits"` // per chunk
	WarmStorageKeyModificationUnits   uint64 `json:"warmStorageKeyModificationUnits"`
	WarmStorageValueModificationUnits uint64 `json:"warmStorageValueModificationUnits"` // per chunk

	// Allocations
	CustomAllocation []*CustomAllocation `json:"customAllocation"`
}

func Default

func Default() *Genesis

func New

func New(b []byte, _ []byte) (*Genesis, error)

func (*Genesis) Load

func (g *Genesis) Load(ctx context.Context, tracer trace.Tracer, mu state.Mutable) error

func (*Genesis) Rules

func (g *Genesis) Rules(_ int64, networkID uint32, chainID ids.ID) *Rules

TODO: use upgradeBytes

type Rules

type Rules struct {
	// contains filtered or unexported fields
}

func (*Rules) ChainID added in v0.3.0

func (r *Rules) ChainID() ids.ID

func (*Rules) FetchCustom

func (*Rules) FetchCustom(string) (any, bool)

func (*Rules) GetBaseComputeUnits added in v0.3.0

func (r *Rules) GetBaseComputeUnits() uint64

func (*Rules) GetBaseWarpComputeUnits added in v0.3.0

func (r *Rules) GetBaseWarpComputeUnits() uint64

func (*Rules) GetColdStorageKeyModificationUnits added in v0.3.0

func (r *Rules) GetColdStorageKeyModificationUnits() uint64

func (*Rules) GetColdStorageKeyReadUnits added in v0.3.0

func (r *Rules) GetColdStorageKeyReadUnits() uint64

func (*Rules) GetColdStorageValueModificationUnits added in v0.3.0

func (r *Rules) GetColdStorageValueModificationUnits() uint64

func (*Rules) GetColdStorageValueReadUnits added in v0.3.0

func (r *Rules) GetColdStorageValueReadUnits() uint64

func (*Rules) GetMaxBlockUnits

func (r *Rules) GetMaxBlockUnits() chain.Dimensions

func (*Rules) GetMinBlockGap added in v0.3.0

func (r *Rules) GetMinBlockGap() int64

func (*Rules) GetMinEmptyBlockGap added in v0.3.0

func (r *Rules) GetMinEmptyBlockGap() int64

func (*Rules) GetMinUnitPrice

func (r *Rules) GetMinUnitPrice() chain.Dimensions

func (*Rules) GetOutgoingWarpComputeUnits added in v0.3.0

func (r *Rules) GetOutgoingWarpComputeUnits() uint64

func (*Rules) GetStorageKeyCreateUnits added in v0.3.0

func (r *Rules) GetStorageKeyCreateUnits() uint64

func (*Rules) GetStorageValueCreateUnits added in v0.3.0

func (r *Rules) GetStorageValueCreateUnits() uint64

func (*Rules) GetUnitPriceChangeDenominator

func (r *Rules) GetUnitPriceChangeDenominator() chain.Dimensions

func (*Rules) GetValidityWindow

func (r *Rules) GetValidityWindow() int64

func (*Rules) GetWarmStorageKeyModificationUnits added in v0.3.0

func (r *Rules) GetWarmStorageKeyModificationUnits() uint64

func (*Rules) GetWarmStorageKeyReadUnits added in v0.3.0

func (r *Rules) GetWarmStorageKeyReadUnits() uint64

func (*Rules) GetWarmStorageValueModificationUnits added in v0.3.0

func (r *Rules) GetWarmStorageValueModificationUnits() uint64

func (*Rules) GetWarmStorageValueReadUnits added in v0.3.0

func (r *Rules) GetWarmStorageValueReadUnits() uint64

func (*Rules) GetWarpComputeUnitsPerSigner added in v0.3.0

func (r *Rules) GetWarpComputeUnitsPerSigner() uint64

func (*Rules) GetWarpConfig

func (*Rules) GetWarpConfig(ids.ID) (bool, uint64, uint64)

func (*Rules) GetWindowTargetUnits

func (r *Rules) GetWindowTargetUnits() chain.Dimensions

func (*Rules) NetworkID added in v0.3.0

func (r *Rules) NetworkID() uint32

Jump to

Keyboard shortcuts

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