Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPOAParameters ¶
func DefaultPOAParameters() config.Parameters
DefaultPOAParameters returns sampling parameters optimized for POA mode
func GetPOAConsensusParameters ¶
func GetPOAConsensusParameters() config.Parameters
GetPOAConsensusParameters returns sampling parameters optimized for POA mode
Types ¶
type Allower ¶
type Allower interface {
// IsAllowed filters out nodes that are not allowed to connect to this subnet
IsAllowed(nodeID ids.NodeID, isValidator bool) bool
}
var NoOpAllower Allower = noOpAllower{}
NoOpAllower is an Allower that always returns true
type Config ¶
type Config struct {
// ValidatorOnly indicates that this Subnet's Chains are available to only net validators.
// No chain related messages will go out to non-validators.
// Validators will drop messages received from non-validators.
// Also see [AllowedNodes] to allow non-validators to connect to this Subnet.
ValidatorOnly bool `json:"validatorOnly" yaml:"validatorOnly"`
// AllowedNodes is the set of node IDs that are explicitly allowed to connect to this Net when
// ValidatorOnly is enabled.
AllowedNodes set.Set[ids.NodeID] `json:"allowedNodes" yaml:"allowedNodes"`
ConsensusParameters config.Parameters `json:"consensusParameters" yaml:"consensusParameters"`
// ProposerMinBlockDelay is the minimum delay this node will enforce when
// building a linear++ block.
//
ProposerMinBlockDelay time.Duration `json:"proposerMinBlockDelay" yaml:"proposerMinBlockDelay"`
// ProposerNumHistoricalBlocks is the number of historical linear++ blocks
// this node will index per chain. If set to 0, the node will index all
// linear++ blocks.
//
// Note: The last accepted block is not considered a historical block. This
// prevents the user from only storing the last accepted block, which can
// never be safe due to the non-atomic commits between the proposervm
// database and the innerVM's database.
//
// Invariant: This value must be set such that the proposervm never needs to
// rollback more blocks than have been deleted. On startup, the proposervm
// rolls back its accepted chain to match the innerVM's accepted chain. If
// the innerVM is not persisting its last accepted block quickly enough, the
// database can become corrupted.
//
// basis.
ProposerNumHistoricalBlocks uint64 `json:"proposerNumHistoricalBlocks" yaml:"proposerNumHistoricalBlocks"`
// POA Mode Configuration
POAEnabled bool `json:"poaEnabled" yaml:"poaEnabled"`
POASingleNodeMode bool `json:"poaSingleNodeMode" yaml:"poaSingleNodeMode"`
POAMinBlockTime time.Duration `json:"poaMinBlockTime" yaml:"poaMinBlockTime"`
}
func (*Config) ApplyPOAConfig ¶
ApplyPOAConfig modifies the net config for POA mode
type Net ¶
type Net interface {
// IsBootstrapped returns true if the chains in this subnet are done bootstrapping
IsBootstrapped() bool
// Bootstrapped marks the chain as done bootstrapping
Bootstrapped(chainID ids.ID)
// OnBootstrapCompleted is called when bootstrapping completes
OnBootstrapCompleted() error
// AddChain adds a chain to this Subnet
AddChain(chainID ids.ID) bool
// Config returns config of this Subnet
Config() Config
Allower
}
Net keeps track of the currently bootstrapping chains in a subnet. If no chains in the net are currently bootstrapping, the net is considered bootstrapped.
type POAConfig ¶
type POAConfig struct {
// Enabled indicates if POA mode is active
Enabled bool `json:"enabled" yaml:"enabled"`
// SingleNodeMode allows a single node to produce and finalize blocks
SingleNodeMode bool `json:"singleNodeMode" yaml:"singleNodeMode"`
// MinBlockTime is the minimum time between blocks in POA mode
MinBlockTime time.Duration `json:"minBlockTime" yaml:"minBlockTime"`
// AuthorizedNodes are the nodes authorized to produce blocks
AuthorizedNodes []string `json:"authorizedNodes" yaml:"authorizedNodes"`
}
POAConfig provides Proof of Authority configuration for subnets
Click to show internal directories.
Click to hide internal directories.