base

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNode

func AddNode(lg ledger.StateLedger, newNode rbft.NodeInfo) (uint64, error)

AddNode adds a new node to the ledger. It takes a StateLedger instance and a pointer to a NodeInfo struct as parameters. It returns an error if any validation fails.

func GetCurrentEpochInfo

func GetCurrentEpochInfo(lg ledger.StateLedger) (*rbft.EpochInfo, error)

func GetEpochInfo

func GetEpochInfo(lg ledger.StateLedger, epoch uint64) (*rbft.EpochInfo, error)

func GetNextEpochInfo

func GetNextEpochInfo(lg ledger.StateLedger) (*rbft.EpochInfo, error)

func InitEpochInfo

func InitEpochInfo(lg ledger.StateLedger, epochInfo *rbft.EpochInfo) error

func RemoveNode

func RemoveNode(lg ledger.StateLedger, removeNodeID uint64) error

RemoveNode removes a node from the validator set, candidate set, or data syncer set. It takes a StateLedger and the ID of the node to remove as input. It returns an error if the node ID is not found in any of the sets.

func RemoveNodeByP2PNodeID

func RemoveNodeByP2PNodeID(lg ledger.StateLedger, removeByP2PNodeID string) error

func SetNextEpochInfo

func SetNextEpochInfo(lg ledger.StateLedger, n *rbft.EpochInfo) error

func TurnIntoNewEpoch

func TurnIntoNewEpoch(electValidatorsByWrfSeed []byte, lg ledger.StateLedger) (*rbft.EpochInfo, error)

TurnIntoNewEpoch when execute epoch last, return new current epoch info

Types

type EpochManager

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

func NewEpochManager

func NewEpochManager(cfg *common.SystemContractConfig) *EpochManager

func (*EpochManager) EstimateGas

func (m *EpochManager) EstimateGas(callArgs *types.CallArgs) (uint64, error)

func (*EpochManager) Reset

func (m *EpochManager) Reset(lastHeight uint64, stateLedger ledger.StateLedger)

func (*EpochManager) Run

func (m *EpochManager) Run(msg *vm.Message) (*vm.ExecutionResult, error)

Jump to

Keyboard shortcuts

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