Documentation ¶
Index ¶
- func NewProvider(opts ...options.Option[SybilProtection]) module.Provider[*engine.Engine, sybilprotection.SybilProtection]
- func WithInitialCommittee(committee accounts.AccountsData) options.Option[SybilProtection]
- func WithSeatManagerProvider(seatManagerProvider module.Provider[*engine.Engine, seatmanager.SeatManager]) options.Option[SybilProtection]
- type SybilProtection
- func (o *SybilProtection) CommitSlot(slot iotago.SlotIndex) (committeeRoot iotago.Identifier, rewardsRoot iotago.Identifier, err error)
- func (o *SybilProtection) DelegatorReward(validatorID iotago.AccountID, delegatedAmount iotago.BaseToken, ...) (delegatorReward iotago.Mana, firstRewardEpoch iotago.EpochIndex, ...)
- func (o *SybilProtection) EligibleValidators(epoch iotago.EpochIndex) (accounts.AccountsData, error)
- func (o *SybilProtection) Export(writer io.WriteSeeker, targetSlot iotago.SlotIndex) error
- func (o *SybilProtection) Import(reader io.ReadSeeker) error
- func (o *SybilProtection) IsCandidateActive(validatorID iotago.AccountID, epoch iotago.EpochIndex) (bool, error)
- func (o *SybilProtection) OrderedRegisteredCandidateValidatorsList(epoch iotago.EpochIndex) ([]*api.ValidatorResponse, error)
- func (o *SybilProtection) PoolRewardsForAccount(accountID iotago.AccountID) (poolRewardsForAccount iotago.Mana, exists bool, err error)
- func (o *SybilProtection) Reset()
- func (o *SybilProtection) SeatManager() seatmanager.SeatManager
- func (o *SybilProtection) TrackBlock(block *blocks.Block)
- func (o *SybilProtection) ValidatorReward(validatorID iotago.AccountID, stakingFeature *iotago.StakingFeature, ...) (validatorReward iotago.Mana, firstRewardEpoch iotago.EpochIndex, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
func NewProvider(opts ...options.Option[SybilProtection]) module.Provider[*engine.Engine, sybilprotection.SybilProtection]
func WithInitialCommittee ¶
func WithInitialCommittee(committee accounts.AccountsData) options.Option[SybilProtection]
WithInitialCommittee registers the passed committee on a given slot. This is needed to generate Genesis snapshot with some initial committee.
func WithSeatManagerProvider ¶
func WithSeatManagerProvider(seatManagerProvider module.Provider[*engine.Engine, seatmanager.SeatManager]) options.Option[SybilProtection]
Types ¶
type SybilProtection ¶
func New ¶
func New(subModule module.Module, engine *engine.Engine, opts ...options.Option[SybilProtection]) *SybilProtection
func (*SybilProtection) CommitSlot ¶
func (o *SybilProtection) CommitSlot(slot iotago.SlotIndex) (committeeRoot iotago.Identifier, rewardsRoot iotago.Identifier, err error)
func (*SybilProtection) DelegatorReward ¶
func (o *SybilProtection) DelegatorReward(validatorID iotago.AccountID, delegatedAmount iotago.BaseToken, epochStart iotago.EpochIndex, epochEnd iotago.EpochIndex, claimingEpoch iotago.EpochIndex) (delegatorReward iotago.Mana, firstRewardEpoch iotago.EpochIndex, lastRewardEpoch iotago.EpochIndex, err error)
func (*SybilProtection) EligibleValidators ¶
func (o *SybilProtection) EligibleValidators(epoch iotago.EpochIndex) (accounts.AccountsData, error)
EligibleValidators returns the currently known list of recently active validator candidates for the given epoch.
func (*SybilProtection) Export ¶
func (o *SybilProtection) Export(writer io.WriteSeeker, targetSlot iotago.SlotIndex) error
func (*SybilProtection) Import ¶
func (o *SybilProtection) Import(reader io.ReadSeeker) error
func (*SybilProtection) IsCandidateActive ¶
func (o *SybilProtection) IsCandidateActive(validatorID iotago.AccountID, epoch iotago.EpochIndex) (bool, error)
IsCandidateActive returns true if the given validator is currently active.
func (*SybilProtection) OrderedRegisteredCandidateValidatorsList ¶
func (o *SybilProtection) OrderedRegisteredCandidateValidatorsList(epoch iotago.EpochIndex) ([]*api.ValidatorResponse, error)
OrderedRegisteredCandidateValidatorsList returns the currently known list of registered validator candidates for the given epoch.
func (*SybilProtection) PoolRewardsForAccount ¶
func (*SybilProtection) Reset ¶
func (o *SybilProtection) Reset()
Reset resets the component to a clean state as if it was created at the last commitment.
func (*SybilProtection) SeatManager ¶
func (o *SybilProtection) SeatManager() seatmanager.SeatManager
func (*SybilProtection) TrackBlock ¶
func (o *SybilProtection) TrackBlock(block *blocks.Block)
func (*SybilProtection) ValidatorReward ¶
func (o *SybilProtection) ValidatorReward(validatorID iotago.AccountID, stakingFeature *iotago.StakingFeature, claimingEpoch iotago.EpochIndex) (validatorReward iotago.Mana, firstRewardEpoch iotago.EpochIndex, lastRewardEpoch iotago.EpochIndex, err error)
Click to show internal directories.
Click to hide internal directories.