tippool

package
v0.4.4-testnet Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name     = "tippool"
	TraceTag = Name
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	VID *vertex.WrappedTx
}

type LatestSequencerTipData

type LatestSequencerTipData struct {
	LatestMilestoneTxID ledger.TransactionID
	LastBranchTxID      *ledger.TransactionID
	MilestoneCount      int
	LastActivity        time.Time
}

type LatestSequencerTipDataJSONAble

type LatestSequencerTipDataJSONAble struct {
	LatestMilestoneTxID  string `json:"latest_milestone_txid"`
	LastBranchTxID       string `json:"last_branch_txid,omitempty"`
	MilestoneCount       int    `json:"milestone_count"`
	LastActivityUnixNano int64  `json:"last_activity_unix_nano"`
}

type SequencerTips

type SequencerTips struct {
	*work_process.WorkProcess[Input]
	// contains filtered or unexported fields
}

SequencerTips is a collection with input queue, which keeps all latest sequencer transactions for each sequencer ID. One transaction per sequencer TODO input queue is not very much needed because TPS of sequencer transactions is low

func New

func New(env environment) *SequencerTips

func (*SequencerTips) GetKnownLatestSequencerDataJSONAble

func (t *SequencerTips) GetKnownLatestSequencerDataJSONAble() map[string]LatestSequencerTipDataJSONAble

func (*SequencerTips) GetLatestActiveMilestone

func (t *SequencerTips) GetLatestActiveMilestone(seqID ledger.ChainID) *vertex.WrappedTx

GetLatestActiveMilestone will return nil if sequencer is not in the list

func (*SequencerTips) LatestActiveMilestonesDescending

func (t *SequencerTips) LatestActiveMilestonesDescending(filter ...func(seqID ledger.ChainID, vid *vertex.WrappedTx) bool) []*vertex.WrappedTx

LatestActiveMilestonesDescending returns sequencer transactions from sequencer tippool. Optionally filters Sorts in the descending preference order (essentially by ledger coverage)

func (*SequencerTips) LatestActiveMilestonesShuffled

func (t *SequencerTips) LatestActiveMilestonesShuffled(filter ...func(seqID ledger.ChainID, vid *vertex.WrappedTx) bool) []*vertex.WrappedTx

LatestActiveMilestonesShuffled returns sequencer transactions from sequencer tippool. Optionally filters. Randomizes order

func (*SequencerTips) NumSequencerTips

func (t *SequencerTips) NumSequencerTips() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳