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]
- func WithMaxLikedInsteadReferences(maxLikedInsteadReferences int) options.Option[TipSelection]
- func WithMaxStrongParents(maxStrongParents int) options.Option[TipSelection]
- func WithMaxWeakReferences(maxWeakReferences int) options.Option[TipSelection]
- type TipSelection
- func (t *TipSelection) Construct(tipManager tipmanager.TipManager, ...) *TipSelection
- func (t *TipSelection) Reset()
- func (t *TipSelection) SelectTips(amount int) (references model.ParentReferences)
- func (t *TipSelection) SetAcceptanceTime(acceptanceTime time.Time) (previousValue time.Time)
- func (t *TipSelection) Shutdown()
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.
func WithMaxLikedInsteadReferences ¶
func WithMaxLikedInsteadReferences(maxLikedInsteadReferences int) options.Option[TipSelection]
WithMaxLikedInsteadReferences is an option for the TipSelection that allows to configure the maximum number of liked instead references.
func WithMaxStrongParents ¶
func WithMaxStrongParents(maxStrongParents int) options.Option[TipSelection]
WithMaxStrongParents is an option for the TipSelection that allows to configure the maximum number of strong parents.
func WithMaxWeakReferences ¶
func WithMaxWeakReferences(maxWeakReferences int) options.Option[TipSelection]
WithMaxWeakReferences is an option for the TipSelection that allows to configure the maximum number of weak references.
Types ¶
type TipSelection ¶
type TipSelection struct { // Module embeds the required methods of the module.Interface. 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(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(amount 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.
func (*TipSelection) Shutdown ¶
func (t *TipSelection) Shutdown()
Shutdown triggers the shutdown of the TipSelection.