Documentation
¶
Index ¶
- type ConsensusStateWrapper
- func (w *ConsensusStateWrapper) GetCurrentHeight(ctx context.Context) (uint64, error)
- func (w *ConsensusStateWrapper) GetCurrentValidatorSet(ctx context.Context, subnetID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- func (w *ConsensusStateWrapper) GetMinimumHeight(ctx context.Context) (uint64, error)
- func (w *ConsensusStateWrapper) GetSubnetID(ctx context.Context, chainID ids.ID) (ids.ID, error)
- func (w *ConsensusStateWrapper) GetValidatorSet(ctx context.Context, height uint64, subnetID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsensusStateWrapper ¶ added in v0.8.8
type ConsensusStateWrapper struct {
// contains filtered or unexported fields
}
ConsensusStateWrapper wraps consensuscontext.ValidatorState to implement validators.State
func NewConsensusStateWrapper ¶ added in v0.8.8
func NewConsensusStateWrapper(vs consensuscontext.ValidatorState) *ConsensusStateWrapper
NewConsensusStateWrapper creates a new wrapper
func (*ConsensusStateWrapper) GetCurrentHeight ¶ added in v0.8.8
func (w *ConsensusStateWrapper) GetCurrentHeight(ctx context.Context) (uint64, error)
GetCurrentHeight implements validators.State
func (*ConsensusStateWrapper) GetCurrentValidatorSet ¶ added in v0.8.8
func (w *ConsensusStateWrapper) GetCurrentValidatorSet(ctx context.Context, subnetID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetCurrentValidatorSet implements validators.State
func (*ConsensusStateWrapper) GetMinimumHeight ¶ added in v0.8.8
func (w *ConsensusStateWrapper) GetMinimumHeight(ctx context.Context) (uint64, error)
GetMinimumHeight implements validators.State
func (*ConsensusStateWrapper) GetSubnetID ¶ added in v0.8.8
GetSubnetID implements validators.State
type State ¶
type State struct {
validators.State
// contains filtered or unexported fields
}
State provides a special case used to handle Lux Warp Message verification for messages sent from the Primary Network. Subnets have strictly fewer validators than the Primary Network, so we require signatures from a threshold of the RECEIVING subnet validator set rather than the full Primary Network since the receiving subnet already relies on a majority of its validators being correct.
func NewState ¶
func NewState(state validators.State, mySubnetID ids.ID, sourceChainID ids.ID, requirePrimaryNetworkSigners bool) *State
NewState returns a wrapper of validators.State which special cases the handling of the Primary Network.
The wrapped state will return the [mySubnetID's] validator set instead of the Primary Network when the Primary Network SubnetID is passed in.