MCPcopy
hub / github.com/canopy-network/canopy / StateMachine

Struct StateMachine

fsm/state.go:22–38  ·  view source on GitHub ↗

* This is the 'main' file of the state machine store, with the structure definition and other high level operations */ StateMachine the core protocol component responsible for maintaining and updating the state of the blockchain as it progresses it represents the collective state of all accounts, va

Source from the content-addressed store, hash-verified

20// StateMachine the core protocol component responsible for maintaining and updating the state of the blockchain as it progresses
21// it represents the collective state of all accounts, validators, and other relevant data stored on the blockchain
22type StateMachine struct {
23 store lib.RWStoreI
24
25 ProtocolVersion uint64 // the version of the protocol this node is running
26 NetworkID uint32 // the id of the network this node is configured to be on
27 height uint64 // the 'version' of the state based on number of blocks currently on
28 totalVDFIterations uint64 // the number of 'verifiable delay iterations' in the blockchain up to this version
29 slashTracker *SlashTracker // tracks total slashes across multiple blocks
30 proposeVoteConfig GovProposalVoteConfig // the configuration of how the state machine behaves with governance proposals
31 Config lib.Config // the main configuration as defined by the 'config.json' file
32 Metrics *lib.Metrics // the telemetry module
33 events *lib.EventsTracker // a simple event tracker for 'per-transaction' events
34 log lib.LoggerI // the logger for standard output and debugging
35 cache *cache // the state machine cache
36 LastValidatorSet map[uint64]map[uint64]*lib.ValidatorSet // reference to the last validator set saved in the controller
37 Plugin *lib.Plugin // extensible plugin for the FSM
38}
39
40// cache is the set of items to be cached used by the state machine
41type cache struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected