Documentation ¶
Index ¶
- func DynamicLivenessThreshold(committeeSizeProvider func() int) func(tip tipmanager.TipMetadata) time.Duration
- func NewProvider(opts ...options.Option[TipSelection]) module.Provider[*engine.Engine, tipselection.TipSelection]
- type TipSelection
- func (t *TipSelection) Construct(tipManager tipmanager.TipManager, ...) *TipSelection
- func (t *TipSelection) Reset()
- func (t *TipSelection) SelectTips(maxStrongParents int, maxLikedInsteadParents int, maxWeakParents int) (references model.ParentReferences)
- func (t *TipSelection) SetAcceptanceTime(acceptanceTime time.Time) (previousValue time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DynamicLivenessThreshold ¶
func DynamicLivenessThreshold(committeeSizeProvider func() int) func(tip tipmanager.TipMetadata) time.Duration
DynamicLivenessThreshold returns a function that calculates the liveness threshold for a tip.
func NewProvider ¶
func NewProvider(opts ...options.Option[TipSelection]) module.Provider[*engine.Engine, tipselection.TipSelection]
NewProvider creates a new TipSelection provider, that can be used to inject the component into an engine.
Types ¶
type TipSelection ¶
type TipSelection struct { // Module embeds the required methods of the modular framework. module.Module // contains filtered or unexported fields }
TipSelection is a component that is used to abstract away the tip selection strategy, used to issue new blocks.
func New ¶
func New(subModule module.Module, opts ...options.Option[TipSelection]) *TipSelection
New is the constructor for the TipSelection.
func (*TipSelection) Construct ¶
func (t *TipSelection) Construct(tipManager tipmanager.TipManager, spendDAG spenddag.SpendDAG[iotago.TransactionID, mempool.StateID, ledger.BlockVoteRank], transactionMetadataRetriever func(iotago.TransactionID) (mempool.TransactionMetadata, bool), rootBlockRetriever func() iotago.BlockID, livenessThresholdFunc func(tipmanager.TipMetadata) time.Duration) *TipSelection
Construct fills in the dependencies of the TipSelection and triggers the constructed and initialized events of the module.
This method is separated from the constructor so the TipSelection can be initialized lazily after all dependencies are available.
func (*TipSelection) Reset ¶
func (t *TipSelection) Reset()
Reset resets the component to a clean state as if it was created at the last commitment.
func (*TipSelection) SelectTips ¶
func (t *TipSelection) SelectTips(maxStrongParents int, maxLikedInsteadParents int, maxWeakParents int) (references model.ParentReferences)
SelectTips selects the tips that should be used as references for a new block.
func (*TipSelection) SetAcceptanceTime ¶
func (t *TipSelection) SetAcceptanceTime(acceptanceTime time.Time) (previousValue time.Time)
SetAcceptanceTime updates the acceptance time of the TipSelection.