Documentation
¶
Index ¶
- func NewProvider(opts ...options.Option[SeatManager]) module.Provider[*engine.Engine, seatmanager.SeatManager]
- func WithOnlineCommitteeStartup(optsOnlineCommittee ...iotago.AccountID) options.Option[SeatManager]
- type SeatManager
- func (s *SeatManager) CommitteeInEpoch(epoch iotago.EpochIndex) (*account.SeatedAccounts, bool)
- func (s *SeatManager) CommitteeInSlot(slot iotago.SlotIndex) (*account.SeatedAccounts, bool)
- func (s *SeatManager) InitializeCommittee(epoch iotago.EpochIndex, activityTime time.Time) error
- func (s *SeatManager) OnlineCommittee() ds.Set[account.SeatIndex]
- func (s *SeatManager) ReuseCommittee(currentEpoch iotago.EpochIndex, targetEpoch iotago.EpochIndex) (*account.SeatedAccounts, error)
- func (s *SeatManager) RotateCommittee(epoch iotago.EpochIndex, validators accounts.AccountsData) (*account.SeatedAccounts, error)
- func (s *SeatManager) SeatCountInEpoch(_ iotago.EpochIndex) int
- func (s *SeatManager) SeatCountInSlot(_ iotago.SlotIndex) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
func NewProvider(opts ...options.Option[SeatManager]) module.Provider[*engine.Engine, seatmanager.SeatManager]
NewProvider returns a new sybil protection provider that uses the ProofOfAuthority module.
func WithOnlineCommitteeStartup ¶
func WithOnlineCommitteeStartup(optsOnlineCommittee ...iotago.AccountID) options.Option[SeatManager]
Types ¶
type SeatManager ¶
SeatManager is a sybil protection module for the engine that manages the weights of actors according to their stake.
func (*SeatManager) CommitteeInEpoch ¶
func (s *SeatManager) CommitteeInEpoch(epoch iotago.EpochIndex) (*account.SeatedAccounts, bool)
CommitteeInEpoch returns the set of validators selected to be part of the committee in the given epoch.
func (*SeatManager) CommitteeInSlot ¶
func (s *SeatManager) CommitteeInSlot(slot iotago.SlotIndex) (*account.SeatedAccounts, bool)
CommitteeInSlot returns the set of validators selected to be part of the committee in the given slot.
func (*SeatManager) InitializeCommittee ¶
func (s *SeatManager) InitializeCommittee(epoch iotago.EpochIndex, activityTime time.Time) error
func (*SeatManager) OnlineCommittee ¶
func (s *SeatManager) OnlineCommittee() ds.Set[account.SeatIndex]
OnlineCommittee returns the set of validators selected to be part of the committee that has been seen recently.
func (*SeatManager) ReuseCommittee ¶
func (s *SeatManager) ReuseCommittee(currentEpoch iotago.EpochIndex, targetEpoch iotago.EpochIndex) (*account.SeatedAccounts, error)
func (*SeatManager) RotateCommittee ¶
func (s *SeatManager) RotateCommittee(epoch iotago.EpochIndex, validators accounts.AccountsData) (*account.SeatedAccounts, error)
RotateCommittee sets a Proof-of-Authority committee for a given epoch. Given validators are only used if the committee has not been set before, otherwise it's ignored.
func (*SeatManager) SeatCountInEpoch ¶
func (s *SeatManager) SeatCountInEpoch(_ iotago.EpochIndex) int
func (*SeatManager) SeatCountInSlot ¶
func (s *SeatManager) SeatCountInSlot(_ iotago.SlotIndex) int