poa

package
v1.0.0-alpha.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

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

type SeatManager struct {
	module.Module
	// contains filtered or unexported fields
}

SeatManager is a sybil protection module for the engine that manages the weights of actors according to their stake.

func New

func New(subModule module.Module, engine *engine.Engine, opts ...options.Option[SeatManager]) *SeatManager

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL