iblockproc

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 11 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockCtx

type BlockCtx struct {
	Idx     idx.Block
	Time    inter.Timestamp
	Atropos hash.Event
}

type BlockState

type BlockState struct {
	LastBlock          BlockCtx
	FinalizedStateRoot hash.Hash

	EpochGas        uint64
	EpochCheaters   lachesis.Cheaters
	CheatersWritten uint32

	ValidatorStates       []ValidatorBlockState
	NextValidatorProfiles ValidatorProfiles

	DirtyRules *opera.Rules `rlp:"nil"` // nil means that there's no changes compared to epoch rules

	AdvanceEpochs idx.Epoch
}

func (BlockState) Copy

func (bs BlockState) Copy() BlockState

func (*BlockState) GetValidatorState

func (bs *BlockState) GetValidatorState(id idx.ValidatorID, validators *pos.Validators) *ValidatorBlockState

func (BlockState) Hash

func (bs BlockState) Hash() hash.Hash

type EpochState

type EpochState EpochStateV1

func (EpochState) Copy

func (es EpochState) Copy() EpochState

func (EpochState) Duration

func (es EpochState) Duration() inter.Timestamp

func (*EpochState) GetValidatorState

func (es *EpochState) GetValidatorState(id idx.ValidatorID, validators *pos.Validators) *ValidatorEpochState

func (EpochState) Hash

func (es EpochState) Hash() hash.Hash

type EpochStateV0

type EpochStateV0 struct {
	Epoch          idx.Epoch
	EpochStart     inter.Timestamp
	PrevEpochStart inter.Timestamp

	EpochStateRoot hash.Hash

	Validators        *pos.Validators
	ValidatorStates   []ValidatorEpochStateV0
	ValidatorProfiles ValidatorProfiles

	Rules opera.Rules
}

type EpochStateV1

type EpochStateV1 struct {
	Epoch          idx.Epoch
	EpochStart     inter.Timestamp
	PrevEpochStart inter.Timestamp

	EpochStateRoot hash.Hash

	Validators        *pos.Validators
	ValidatorStates   []ValidatorEpochState
	ValidatorProfiles ValidatorProfiles

	Rules opera.Rules
}

type EventInfo

type EventInfo struct {
	ID           hash.Event
	GasPowerLeft inter.GasPowerLeft
	Time         inter.Timestamp
}

type ValidatorBlockState

type ValidatorBlockState struct {
	LastEvent        EventInfo
	Uptime           inter.Timestamp
	LastOnlineTime   inter.Timestamp
	LastGasPowerLeft inter.GasPowerLeft
	LastBlock        idx.Block
	DirtyGasRefund   uint64
	Originated       *big.Int
}

type ValidatorEpochState

type ValidatorEpochState struct {
	GasRefund      uint64
	PrevEpochEvent EventInfo
}

type ValidatorEpochStateV0

type ValidatorEpochStateV0 struct {
	GasRefund      uint64
	PrevEpochEvent hash.Event
}

type ValidatorProfiles

type ValidatorProfiles map[idx.ValidatorID]drivertype.Validator

func (ValidatorProfiles) Copy

func (*ValidatorProfiles) DecodeRLP

func (vv *ValidatorProfiles) DecodeRLP(s *rlp.Stream) error

DecodeRLP is for RLP deserialization.

func (ValidatorProfiles) EncodeRLP

func (vv ValidatorProfiles) EncodeRLP(w io.Writer) error

EncodeRLP is for RLP serialization.

func (ValidatorProfiles) SortedArray

func (vv ValidatorProfiles) SortedArray() []drivertype.ValidatorAndID

Jump to

Keyboard shortcuts

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