Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownState = errors.New("unknown state")
Functions ¶
This section is empty.
Types ¶
type Acceptor ¶
type Acceptor interface { // Accept must be called before [containerID] is committed to the VM as // accepted. // // If the returned error is non-nil, the chain associated with [ctx] should // shut down and not commit [container] or any other container to its // database as accepted. Accept(ctx *ConsensusContext, containerID ids.ID, container []byte) error }
Acceptor is implemented when a struct is monitoring if a message is accepted
type AcceptorGroup ¶
type AcceptorGroup interface { // Calling Accept() calls all of the registered acceptors for the relevant // chain. Acceptor // RegisterAcceptor causes [acceptor] to be called every time an operation // is accepted on chain [chainID]. // If [dieOnError], chain [chainID] stops if Accept returns a non-nil error. RegisterAcceptor(chainID ids.ID, acceptorName string, acceptor Acceptor, dieOnError bool) error // DeregisterAcceptor removes an acceptor from the group. DeregisterAcceptor(chainID ids.ID, acceptorName string) error }
func NewAcceptorGroup ¶
func NewAcceptorGroup(log logging.Logger) AcceptorGroup
type ConsensusContext ¶
type ConsensusContext struct { *Context // Registers all common and snowman consensus metrics. Unlike the cryft // consensus engine metrics, we do not prefix the name with the engine name, // as snowman is used for all chains by default. Registerer Registerer // Only used to register Cryft consensus metrics. Previously, all // metrics were prefixed with "cryft_{chainID}_". Now we add cryft // to the prefix, "cryft_{chainID}_cryft_", to differentiate // consensus operations after the DAG linearization. CryftRegisterer Registerer // BlockAcceptor is the callback that will be fired whenever a VM is // notified that their block was accepted. BlockAcceptor Acceptor // TxAcceptor is the callback that will be fired whenever a VM is notified // that their transaction was accepted. TxAcceptor Acceptor // VertexAcceptor is the callback that will be fired whenever a vertex was // accepted. VertexAcceptor Acceptor // State indicates the current state of this consensus instance. State utils.Atomic[EngineState] // True iff this chain is executing transactions as part of bootstrapping. Executing utils.Atomic[bool] // True iff this chain is currently state-syncing StateSyncing utils.Atomic[bool] }
type Context ¶
type Context struct { NetworkID uint32 SubnetID ids.ID ChainID ids.ID NodeID ids.NodeID PublicKey *bls.PublicKey XChainID ids.ID CChainID ids.ID CRYFTAssetID ids.ID Log logging.Logger Lock sync.RWMutex Keystore keystore.BlockchainKeystore BCLookup ids.AliaserReader Metrics metrics.OptionalGatherer WarpSigner warp.Signer // snowman++ attributes ValidatorState validators.State // interface for P-Chain validators // Chain-specific directory where arbitrary data can be written ChainDataDir string }
Context is information about the current execution. [NetworkID] is the ID of the network this context exists within. [ChainID] is the ID of the chain this context exists within. [NodeID] is the ID of this node
type ContextInitializable ¶
type ContextInitializable interface { // InitCtx initializes an object provided a *Context object InitCtx(ctx *Context) }
ContextInitializable represents an object that can be initialized given a *Context object
type EngineState ¶
type EngineState struct { Type p2p.EngineType State State }
type Registerer ¶
type Registerer interface { prometheus.Registerer prometheus.Gatherer }
Expose gatherer interface for unit testing.
Directories
¶
Path | Synopsis |
---|---|
consensus
|
|
snowman/snowmantest
Package snowmantest is a generated GoMock package.
|
Package snowmantest is a generated GoMock package. |
engine
|
|
avalanche/state
Package state manages the meta-data required by consensus for an cryft dag.
|
Package state manages the meta-data required by consensus for an cryft dag. |
avalanche/vertex
Package vertex is a generated GoMock package.
|
Package vertex is a generated GoMock package. |
common
Package common is a generated GoMock package.
|
Package common is a generated GoMock package. |
snowman/block
Package block is a generated GoMock package.
|
Package block is a generated GoMock package. |
networking
|
|
handler
Package handler is a generated GoMock package.
|
Package handler is a generated GoMock package. |
router
Package router is a generated GoMock package.
|
Package router is a generated GoMock package. |
sender
Package sender is a generated GoMock package.
|
Package sender is a generated GoMock package. |
timeout
Package timeout is a generated GoMock package.
|
Package timeout is a generated GoMock package. |
tracker
Package tracker is a generated GoMock package.
|
Package tracker is a generated GoMock package. |
Package uptime is a generated GoMock package.
|
Package uptime is a generated GoMock package. |
Package validators is a generated GoMock package.
|
Package validators is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.