markerbooker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, BSD-2-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultTestFramework

func NewDefaultTestFramework(t *testing.T, workers *workerpool.Group, ledger mempool.MemPool, optsBooker ...options.Option[Booker]) *booker.TestFramework

func NewProvider

func NewProvider(opts ...options.Option[Booker]) module.Provider[*engine.Engine, booker.Booker]

func WithSequenceCutoffCallback

func WithSequenceCutoffCallback(sequenceCutoffCallback func(id markers.SequenceID) markers.Index) options.Option[Booker]

func WithSlotCutoffCallback

func WithSlotCutoffCallback(slotCutoffCallback func() slot.Index) options.Option[Booker]

Types

type Booker

type Booker struct {
	MemPool mempool.MemPool

	module.Module
	// contains filtered or unexported fields
}

func New

func New(workers *workerpool.Group, evictionState *eviction.State, memPool mempool.MemPool, validators *sybilprotection.WeightedSet, slotTimeProviderFunc func() *slot.TimeProvider, opts ...options.Option[Booker]) *Booker

func (*Booker) Block

func (b *Booker) Block(id models.BlockID) (block *booker.Block, exists bool)

Block retrieves a Block with metadata from the in-memory storage of the Booker.

func (*Booker) BlockBookingDetails

func (b *Booker) BlockBookingDetails(block *booker.Block) (pastMarkersConflictIDs, blockConflictIDs utxo.TransactionIDs)

BlockBookingDetails returns the Conflict and Marker related details of the given Block.

func (*Booker) BlockCeiling

func (b *Booker) BlockCeiling(marker markers.Marker) (ceilingMarker markers.Marker, exists bool)

BlockCeiling returns the smallest Index that is >= the given Marker and a boolean value indicating if it exists.

func (*Booker) BlockConflicts

func (b *Booker) BlockConflicts(block *booker.Block) (blockConflictIDs utxo.TransactionIDs)

BlockConflicts returns the Conflict related details of the given Block.

func (*Booker) BlockFloor

func (b *Booker) BlockFloor(marker markers.Marker) (floorMarker markers.Marker, exists bool)

BlockFloor returns the largest Index that is <= the given Marker and a boolean value indicating if it exists.

func (*Booker) BlockFromMarker

func (b *Booker) BlockFromMarker(marker markers.Marker) (block *booker.Block, exists bool)

BlockFromMarker retrieves the Block of the given Marker.

func (*Booker) Events

func (b *Booker) Events() *booker.Events

func (*Booker) EvictSequence

func (b *Booker) EvictSequence(sequenceID markers.SequenceID)

func (*Booker) EvictSlotTracker

func (b *Booker) EvictSlotTracker(slotIndex slot.Index)

func (*Booker) GetAllAttachments

func (b *Booker) GetAllAttachments(txID utxo.TransactionID) (attachments *advancedset.AdvancedSet[*booker.Block])

func (*Booker) GetEarliestAttachment

func (b *Booker) GetEarliestAttachment(txID utxo.TransactionID) (attachment *booker.Block)

GetEarliestAttachment returns the earliest attachment for a given transaction ID. returnOrphaned parameter specifies whether the returned attachment may be orphaned.

func (*Booker) GetLatestAttachment

func (b *Booker) GetLatestAttachment(txID utxo.TransactionID) (attachment *booker.Block)

GetLatestAttachment returns the latest attachment for a given transaction ID. returnOrphaned parameter specifies whether the returned attachment may be orphaned.

func (*Booker) Initialize

func (b *Booker) Initialize(blockDAG blockdag.BlockDAG)

func (*Booker) MarkerVotersTotalWeight

func (b *Booker) MarkerVotersTotalWeight(marker markers.Marker) (totalWeight int64)

MarkerVotersTotalWeight retrieves Validators supporting a given marker.

func (*Booker) OrphanAttachment

func (b *Booker) OrphanAttachment(block *booker.Block)

func (*Booker) PayloadConflictID

func (b *Booker) PayloadConflictID(block *booker.Block) (conflictID utxo.TransactionID, conflictingConflictIDs utxo.TransactionIDs, isTransaction bool)

PayloadConflictID returns the ConflictID of the conflicting payload contained in the given Block without conflicts from the UTXO past cone.

func (*Booker) ProcessForkedMarker

func (b *Booker) ProcessForkedMarker(marker markers.Marker, forkedConflictID utxo.TransactionID, parentConflictIDs utxo.TransactionIDs)

func (*Booker) PropagateForkedConflict

func (b *Booker) PropagateForkedConflict(transactionID, addedConflictID utxo.TransactionID, removedConflictIDs utxo.TransactionIDs) (err error)

PropagateForkedConflict propagates the forked ConflictID to the future cone of the attachments of the given Transaction.

func (*Booker) Queue

func (b *Booker) Queue(block *booker.Block) (wasQueued bool, err error)

Queue adds a new Block to the booking queue.

func (*Booker) Sequence

func (b *Booker) Sequence(id markers.SequenceID) (sequence *markers.Sequence, exists bool)

Sequence retrieves a Sequence by its ID.

func (*Booker) SequenceManager

func (b *Booker) SequenceManager() *markers.SequenceManager

func (*Booker) SequenceTracker

func (*Booker) SlotVotersTotalWeight

func (b *Booker) SlotVotersTotalWeight(slotIndex slot.Index) (totalWeight int64)

SlotVotersTotalWeight retrieves the total weight of the Validators voting for a given slot.

func (*Booker) TransactionConflictIDs

func (b *Booker) TransactionConflictIDs(block *booker.Block) (conflictIDs utxo.TransactionIDs)

TransactionConflictIDs returns the ConflictIDs of the Transaction contained in the given Block including conflicts from the UTXO past cone.

func (*Booker) VirtualVoting

func (b *Booker) VirtualVoting() booker.VirtualVoting

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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