sequencer

package
v0.1.3-testnet Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxTagAlongInputs  = 20
	MinimumBacklogTTLSlots    = 10
	MinimumMilestonesTTLSlots = 24 // 10
)
View Source
const TraceTag = "sequencer"

Variables

This section is empty.

Functions

func WithSingleSequencerEnforced

func WithSingleSequencerEnforced(o *ConfigOptions)

Types

type ConfigOption

type ConfigOption func(options *ConfigOptions)

func WithBacklogTTLSlots

func WithBacklogTTLSlots(slots int) ConfigOption

func WithDelayStart

func WithDelayStart(delay time.Duration) ConfigOption

func WithMaxBranches

func WithMaxBranches(maxBranches int) ConfigOption

func WithMaxTagAlongInputs

func WithMaxTagAlongInputs(maxInputs int) ConfigOption

func WithMilestonesTTLSlots

func WithMilestonesTTLSlots(slots int) ConfigOption

func WithName

func WithName(name string) ConfigOption

func WithPace

func WithPace(pace int) ConfigOption

type ConfigOptions

type ConfigOptions struct {
	SequencerName           string
	Pace                    int // pace in ticks
	MaxTagAlongInputs       int
	MaxTargetTs             ledger.Time
	MaxBranches             int
	DelayStart              time.Duration
	BacklogTTLSlots         int
	MilestonesTTLSlots      int
	SingleSequencerEnforced bool
}

type Environment

type Environment interface {
	global.NodeGlobal
	attacher.Environment
	IsSynced() bool
	TxBytesStore() global.TxBytesStore
	GetLatestMilestone(seqID ledger.ChainID) *vertex.WrappedTx
	LatestMilestonesDescending(filter ...func(seqID ledger.ChainID, vid *vertex.WrappedTx) bool) []*vertex.WrappedTx
	LatestMilestonesShuffled(filter ...func(seqID ledger.ChainID, vid *vertex.WrappedTx) bool) []*vertex.WrappedTx
	NumSequencerTips() int
	ListenToAccount(account ledger.Accountable, fun func(wOut vertex.WrappedOutput))
	MustEnsureBranch(txid ledger.TransactionID) *vertex.WrappedTx
	OwnSequencerMilestoneIn(txBytes []byte, meta *txmetadata.TransactionMetadata)
}

type Info

type Info struct {
	In                     int
	Out                    int
	InflationAmount        uint64
	NumConsumedFeeOutputs  int
	NumFeeOutputsInTippool int
	NumOtherMsInTippool    int
	LedgerCoverage         uint64
	PrevLedgerCoverage     uint64
}

type Sequencer

type Sequencer struct {
	Environment
	// contains filtered or unexported fields
}

func New

func New(env Environment, seqID ledger.ChainID, controllerKey ed25519.PrivateKey, opts ...ConfigOption) (*Sequencer, error)

func NewFromConfig

func NewFromConfig(glb *workflow.Workflow) (*Sequencer, error)

func (*Sequencer) AddOwnMilestone

func (seq *Sequencer) AddOwnMilestone(vid *vertex.WrappedTx)

func (*Sequencer) Backlog

func (seq *Sequencer) Backlog() *backlog.InputBacklog

func (*Sequencer) BacklogTTLSlots

func (seq *Sequencer) BacklogTTLSlots() int

func (*Sequencer) ControllerPrivateKey

func (seq *Sequencer) ControllerPrivateKey() ed25519.PrivateKey

func (*Sequencer) Ctx

func (seq *Sequencer) Ctx() context.Context

func (*Sequencer) EvidenceBacklogSize

func (seq *Sequencer) EvidenceBacklogSize(size int)

func (*Sequencer) EvidenceBestProposalForTheTarget

func (seq *Sequencer) EvidenceBestProposalForTheTarget(strategyShortName string)

func (*Sequencer) EvidenceProposal

func (seq *Sequencer) EvidenceProposal(strategyShortName string)

func (*Sequencer) FutureConeOwnMilestonesOrdered

func (seq *Sequencer) FutureConeOwnMilestonesOrdered(rootOutput vertex.WrappedOutput, targetTs ledger.Time) []vertex.WrappedOutput

func (*Sequencer) Info

func (seq *Sequencer) Info() Info

func (*Sequencer) IsConsumedInThePastPath

func (seq *Sequencer) IsConsumedInThePastPath(wOut vertex.WrappedOutput, ms *vertex.WrappedTx) bool

func (*Sequencer) Log

func (seq *Sequencer) Log() *zap.SugaredLogger

func (*Sequencer) LogMilestoneSubmitDefault

func (seq *Sequencer) LogMilestoneSubmitDefault(ms *vertex.WrappedTx)

func (*Sequencer) MaxTagAlongInputs

func (seq *Sequencer) MaxTagAlongInputs() int

func (*Sequencer) NumMilestones

func (seq *Sequencer) NumMilestones() int

func (*Sequencer) NumOutputsInBuffer

func (seq *Sequencer) NumOutputsInBuffer() int

func (*Sequencer) OnExit

func (seq *Sequencer) OnExit(fun func())

func (*Sequencer) OnMilestoneSubmitted

func (seq *Sequencer) OnMilestoneSubmitted(fun func(seq *Sequencer, ms *vertex.WrappedTx))

func (*Sequencer) OwnLatestMilestoneOutput

func (seq *Sequencer) OwnLatestMilestoneOutput() vertex.WrappedOutput

func (*Sequencer) SequencerID

func (seq *Sequencer) SequencerID() ledger.ChainID

func (*Sequencer) SequencerName

func (seq *Sequencer) SequencerName() string

func (*Sequencer) Start

func (seq *Sequencer) Start()

func (*Sequencer) Stop

func (seq *Sequencer) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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