Documentation
¶
Index ¶
- Constants
- func IsPreferredMilestoneAgainstTheOther(vid1, vid2 *WrappedTx) bool
- func VerticesLines(vertices []*WrappedTx, prefix ...string) *lines.Lines
- func WrappedOutputsShortLines(wOuts []WrappedOutput) *lines.Lines
- type DetachedVertex
- type Flags
- type FlagsPastCone
- type MutationStats
- type PastCone
- func (pc *PastCone) AddVirtuallyConsumedOutput(wOut WrappedOutput, ...) *WrappedOutput
- func (pc *PastCone) Assertf(cond bool, format string, args ...any)
- func (pc *PastCone) BeginDelta()
- func (pc *PastCone) CheckAndClean(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (conflict *WrappedOutput)
- func (pc *PastCone) CheckConflicts(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (conflict *WrappedOutput)
- func (pc *PastCone) CheckFinalPastCone(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (err error)
- func (pc *PastCone) CloneForDebugOnly(env global.Logging, name string) *PastCone
- func (pc *PastCone) CommitDelta()
- func (pc *PastCone) ContainsUndefined() bool
- func (pc *PastCone) CoverageDeltaRaw(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (delta, frozen uint64)
- func (pc *PastCone) Dispose()
- func (pc *PastCone) Flags(vid *WrappedTx) FlagsPastCone
- func (pc *PastCone) GetBaseline() *base.TransactionID
- func (pc *PastCone) IsComplete() bool
- func (pc *PastCone) IsConsumed(wOut WrappedOutput) bool
- func (pc *PastCone) IsInTheState(vid *WrappedTx) (rooted bool)
- func (pc *PastCone) IsKnown(vid *WrappedTx) bool
- func (pc *PastCone) IsKnownDefined(vid *WrappedTx) bool
- func (pc *PastCone) Lines(prefix ...string) *lines.Lines
- func (pc *PastCone) LinesShort(prefix ...string) *lines.Lines
- func (pc *PastCone) MakeGraph() graph.Graph[string, string]
- func (pc *PastCone) MarkVertexKnown(vid *WrappedTx)
- func (pc *PastCone) MergePastCone(pcb *PastConeBase, br *branches.Branches) bool
- func (pc *PastCone) MustMarkVertexNotInTheState(vid *WrappedTx)
- func (pc *PastCone) Mutations(slot uint32) (muts *multistate.Mutations, stats MutationStats)
- func (pc *PastCone) NumVertices() int
- func (pc *PastCone) RollbackDelta()
- func (pc *PastCone) SaveGraph(fname string)
- func (pc *PastCone) SetBaseline(baselineID *base.TransactionID)
- func (pc *PastCone) SetFlagsDown(vid *WrappedTx, f FlagsPastCone)
- func (pc *PastCone) SetFlagsUp(vid *WrappedTx, f FlagsPastCone)
- func (pc *PastCone) SlotInflation() (ret uint64)
- func (pc *PastCone) UndefinedList() []*WrappedTx
- func (pc *PastCone) UndefinedListLines(prefix ...string) *lines.Lines
- func (pc *PastCone) VertexLine(vid *WrappedTx) string
- type PastConeBase
- type Status
- type TxIDStatus
- type TxIDStatusJSONAble
- type UnwrapOptions
- type UnwrapOptionsForTraverse
- type Vertex
- func (v *Vertex) ForEachEndorsement(fun func(i byte, vidEndorsed *WrappedTx) bool)
- func (v *Vertex) ForEachInputDependency(fun func(i byte, vidInput *WrappedTx) bool)
- func (v *Vertex) GetConsumedOutput(i byte) (ret *ledger.Output)
- func (v *Vertex) InputLoaderByIndex(i byte) (*ledger.Output, error)
- func (v *Vertex) Lines(prefix ...string) *lines.Lines
- func (v *Vertex) MissingInputTxIDSet() set.Set[base.TransactionID]
- func (v *Vertex) MissingInputTxIDString() string
- func (v *Vertex) NumMissingInputs() (missingInputs int, missingEndorsements int)
- func (v *Vertex) ReferenceEndorsement(i byte, vid *WrappedTx)
- func (v *Vertex) ReferenceInput(i byte, vid *WrappedTx)
- func (v *Vertex) SequencerInputIndex() byte
- func (v *Vertex) SetOfInputTransactions() set.Set[*WrappedTx]
- func (v *Vertex) StemInputIndex() byte
- func (v *Vertex) TimeSlot() uint32
- func (v *Vertex) UnReferenceDependencies()
- func (v *Vertex) ValidateConstraints(traceOption ...int) error
- func (v *Vertex) Wrap() *WrappedTx
- type VirtualTransaction
- func (v *VirtualTransaction) OutputAt(idx byte) (*ledger.Output, bool)
- func (v *VirtualTransaction) PullNeeded() bool
- func (v *VirtualTransaction) PullPatienceExpired(maxPullAttempts int) bool
- func (v *VirtualTransaction) PullRulesDefined() bool
- func (v *VirtualTransaction) SequencerOutputs() (*ledger.Output, *ledger.Output)
- func (v *VirtualTransaction) SetPullHappened(repeatAfter time.Duration)
- func (v *VirtualTransaction) SetPullNeeded()
- type WrappedOutput
- func (o *WrappedOutput) DecodeID() (ret base.OutputID)
- func (o *WrappedOutput) IDHasFragment(frag string) bool
- func (o *WrappedOutput) IDString() string
- func (o *WrappedOutput) IDStringShort() string
- func (o *WrappedOutput) IsAvailable() (available bool)
- func (o *WrappedOutput) Lock() ledger.Lock
- func (o *WrappedOutput) LockName() string
- func (o *WrappedOutput) Output() (ret *ledger.Output)
- func (o *WrappedOutput) OutputWithChainID() (ledger.OutputWithChainID, bool)
- func (o *WrappedOutput) OutputWithID() *ledger.OutputWithID
- func (o *WrappedOutput) Slot() uint32
- func (o *WrappedOutput) Timestamp() base.LedgerTime
- func (o *WrappedOutput) ValidID() bool
- type WrappedTx
- func (vid *WrappedTx) AddConsumer(outputIndex byte, consumer *WrappedTx)
- func (vid *WrappedTx) BaselineBranch() (baselineBranchID base.TransactionID, ok bool)
- func (vid *WrappedTx) Before(vid1 *WrappedTx) bool
- func (vid *WrappedTx) ConsumersOf(outIdx byte) set.Set[*WrappedTx]
- func (vid *WrappedTx) ConvertToDetached()
- func (vid *WrappedTx) ConvertVirtualTxToVertexNoLock(v *Vertex)
- func (vid *WrappedTx) FindChainOutput(chainID *base.ChainID) (ret *ledger.OutputWithID)
- func (vid *WrappedTx) FlagsNoLock() Flags
- func (vid *WrappedTx) FlagsUp(f Flags) bool
- func (vid *WrappedTx) FlagsUpNoLock(f Flags) bool
- func (vid *WrappedTx) GetAttachmentDepthNoLock() int
- func (vid *WrappedTx) GetError() error
- func (vid *WrappedTx) GetErrorNoLock() error
- func (vid *WrappedTx) GetLedgerCoverage() uint64
- func (vid *WrappedTx) GetLedgerCoverageNoLock() *uint64
- func (vid *WrappedTx) GetLedgerCoverageP() *uint64
- func (vid *WrappedTx) GetLedgerCoverageString() string
- func (vid *WrappedTx) GetPastConeNoLock() *PastConeBase
- func (vid *WrappedTx) GetTransaction() (tx *transaction.Transaction)
- func (vid *WrappedTx) GetTxStatus() Status
- func (vid *WrappedTx) GetTxStatusNoLock() Status
- func (vid *WrappedTx) ID() base.TransactionID
- func (vid *WrappedTx) IDHasFragment(frag ...string) bool
- func (vid *WrappedTx) IDShortString() string
- func (vid *WrappedTx) IDVeryShort() string
- func (vid *WrappedTx) InflationAmount() (ret uint64)
- func (vid *WrappedTx) IsBad() bool
- func (vid *WrappedTx) IsBranchTransaction() bool
- func (vid *WrappedTx) IsSequencerMilestone() bool
- func (vid *WrappedTx) IsVirtualTx() (ret bool)
- func (vid *WrappedTx) Lines(prefix ...string) *lines.Lines
- func (vid *WrappedTx) LinesNoLock(prefix ...string) *lines.Lines
- func (vid *WrappedTx) LinesTx(prefix ...string) *lines.Lines
- func (vid *WrappedTx) MustEnsureOutput(o *ledger.Output, idx byte)
- func (vid *WrappedTx) MustOutputAt(idx byte) *ledger.Output
- func (vid *WrappedTx) MustOutputWithIDAt(idx byte) (ret ledger.OutputWithID)
- func (vid *WrappedTx) MustSequencerIDAndStemID() (seqID base.ChainID, stemID base.OutputID)
- func (vid *WrappedTx) NotConsumedOutputIndices(allConsumers set.Set[*WrappedTx]) []byte
- func (vid *WrappedTx) NumConsumers() (numConsumedOutputs, numConflictSets int)
- func (vid *WrappedTx) NumInputs() int
- func (vid *WrappedTx) NumProducedOutputs() int
- func (vid *WrappedTx) OnPoke(fun func())
- func (vid *WrappedTx) OnPokeNop()
- func (vid *WrappedTx) OutputAt(idx byte) (*ledger.Output, error)
- func (vid *WrappedTx) OutputID(idx byte) (ret base.OutputID)
- func (vid *WrappedTx) OutputWithIDAt(idx byte) (ledger.OutputWithID, error)
- func (vid *WrappedTx) Poke()
- func (vid *WrappedTx) RUnwrap(opt UnwrapOptions)
- func (vid *WrappedTx) SequencerIDStringVeryShort() string
- func (vid *WrappedTx) SequencerName() (ret string)
- func (vid *WrappedTx) SequencerPredecessor(reattachBranch func(txid base.TransactionID) *WrappedTx) (ret *WrappedTx)
- func (vid *WrappedTx) SequencerWrappedOutput() (ret WrappedOutput)
- func (vid *WrappedTx) SetAttachmentDepthNoLock(depth int)
- func (vid *WrappedTx) SetFlagsDownNoLock(f Flags)
- func (vid *WrappedTx) SetFlagsUpNoLock(f Flags)
- func (vid *WrappedTx) SetSequencerAttachmentFinished()
- func (vid *WrappedTx) SetTxStatusBad(reason error)
- func (vid *WrappedTx) SetTxStatusBadNoLock(reason error)
- func (vid *WrappedTx) SetTxStatusGood(pastCone *PastConeBase, coverage uint64)
- func (vid *WrappedTx) SetTxStatusGoodNoLock(pastCone *PastConeBase, coverage uint64)
- func (vid *WrappedTx) ShortString() string
- func (vid *WrappedTx) Slot() uint32
- func (vid *WrappedTx) StemWrappedOutput() (ret WrappedOutput)
- func (vid *WrappedTx) String() (ret string)
- func (vid *WrappedTx) StringNoLock() string
- func (vid *WrappedTx) Timestamp() base.LedgerTime
- func (vid *WrappedTx) TraversePastConeDepthFirst(opt UnwrapOptionsForTraverse, visited ...set.Set[*WrappedTx])
- func (vid *WrappedTx) TxLines(prefix ...string) (ret *lines.Lines)
- func (vid *WrappedTx) Unwrap(opt UnwrapOptions)
- func (vid *WrappedTx) UnwrapVirtualTx(unwrapFun func(v *VirtualTransaction))
- func (vid *WrappedTx) ValidSequencerPace(targetTs base.LedgerTime) bool
- func (vid *WrappedTx) WithConsumersRLock(fun func())
Constants ¶
const ( FlagPastConeVertexKnown = FlagsPastCone(0b00000001) // each vertex of consideration has this flag on FlagPastConeVertexDefined = FlagsPastCone(0b00000010) // means vertex is 'defined', i.e. its validity is checked FlagPastConeVertexCheckedInTheState = FlagsPastCone(0b00000100) // means vertex has been checked if it is in the state (it may or may not be there) FlagPastConeVertexInTheState = FlagsPastCone(0b00001000) // means vertex is definitely in the state (must be checked before) FlagPastConeVertexEndorsementsSolid = FlagsPastCone(0b00010000) // means all endorsements were validated FlagPastConeVertexInputsSolid = FlagsPastCone(0b00100000) // means all consumed inputs are checked and valid FlagPastConeVertexAskedForPoke = FlagsPastCone(0b01000000) // )
const ( FlagVertexDefined = Flags(0b00000001) FlagVertexConstraintsValid = Flags(0b00000010) FlagVertexTxAttachmentStarted = Flags(0b00000100) FlagVertexTxAttachmentFinished = Flags(0b00001000) FlagVertexIgnoreAbsenceOfPastCone = Flags(0b00010000) )
const ( Undefined = Status(iota) Good Bad )
Variables ¶
This section is empty.
Functions ¶
func IsPreferredMilestoneAgainstTheOther ¶
IsPreferredMilestoneAgainstTheOther returns if vid1 is strongly better than vid2 'better' means aligned coverage is bigger, or, if equal, transaction id is smaller
func WrappedOutputsShortLines ¶
func WrappedOutputsShortLines(wOuts []WrappedOutput) *lines.Lines
Types ¶
type DetachedVertex ¶
type DetachedVertex struct {
Tx *transaction.Transaction
BranchID *base.TransactionID
}
type FlagsPastCone ¶
type FlagsPastCone byte
func (FlagsPastCone) FlagsUp ¶
func (f FlagsPastCone) FlagsUp(fl FlagsPastCone) bool
func (FlagsPastCone) String ¶
func (f FlagsPastCone) String() string
type MutationStats ¶
type PastCone ¶
type PastCone struct {
global.Logging // TODO not very necessary
*PastConeBase
// contains filtered or unexported fields
}
func NewPastCone ¶
func (*PastCone) AddVirtuallyConsumedOutput ¶
func (pc *PastCone) AddVirtuallyConsumedOutput(wOut WrappedOutput, getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) *WrappedOutput
func (*PastCone) BeginDelta ¶
func (pc *PastCone) BeginDelta()
func (*PastCone) CheckAndClean ¶
func (pc *PastCone) CheckAndClean(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (conflict *WrappedOutput)
CheckAndClean iterates past cone, checks for conflicts and removes those vertices that have consumers and all consumers are already in the state
func (*PastCone) CheckConflicts ¶
func (pc *PastCone) CheckConflicts(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (conflict *WrappedOutput)
CheckConflicts returns double-spent output (conflict) or nil if the past cone is consistent The complexity is O(NxM) where N is number of vertices and M is an average number of conflicts in the UTXO tangle Practically, it is linear wrt the number of vertices because M is 1 or close to 1.
func (*PastCone) CheckFinalPastCone ¶
func (pc *PastCone) CheckFinalPastCone(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (err error)
CheckFinalPastCone check determinism consistency of the past cone If rootVid == nil, past cone must be fully deterministic
func (*PastCone) CloneForDebugOnly ¶
func (*PastCone) CommitDelta ¶
func (pc *PastCone) CommitDelta()
func (*PastCone) ContainsUndefined ¶
func (*PastCone) CoverageDeltaRaw ¶
func (pc *PastCone) CoverageDeltaRaw(getStateReader func(branchID base.TransactionID) multistate.IndexedStateReader) (delta, frozen uint64)
CoverageDeltaRaw is not adjusted for sequencer output. Function does not check the consistency of the past cone. Calculates coverage by checking them right in the state. For chained outputs adds non-frozen coverage . Accounts for the frozen coverage in sequencer outputs. Returns: - total coverage delta - frozen coverage (included in the delta)
func (*PastCone) Flags ¶
func (pc *PastCone) Flags(vid *WrappedTx) FlagsPastCone
func (*PastCone) GetBaseline ¶
func (pc *PastCone) GetBaseline() *base.TransactionID
func (*PastCone) IsComplete ¶
func (*PastCone) IsConsumed ¶
func (pc *PastCone) IsConsumed(wOut WrappedOutput) bool
func (*PastCone) IsInTheState ¶
IsInTheState is definitely known it is in the state
func (*PastCone) IsKnownDefined ¶
func (*PastCone) MarkVertexKnown ¶
func (*PastCone) MergePastCone ¶
func (pc *PastCone) MergePastCone(pcb *PastConeBase, br *branches.Branches) bool
MergePastCone checks the compatibility of baselines and swaps them if necessary. Does not check for double-spends
func (*PastCone) MustMarkVertexNotInTheState ¶
MustMarkVertexNotInTheState is marked definitely not rooted
func (*PastCone) Mutations ¶
func (pc *PastCone) Mutations(slot uint32) (muts *multistate.Mutations, stats MutationStats)
func (*PastCone) NumVertices ¶
func (*PastCone) RollbackDelta ¶
func (pc *PastCone) RollbackDelta()
func (*PastCone) SetBaseline ¶
func (pc *PastCone) SetBaseline(baselineID *base.TransactionID)
func (*PastCone) SetFlagsDown ¶
func (pc *PastCone) SetFlagsDown(vid *WrappedTx, f FlagsPastCone)
func (*PastCone) SetFlagsUp ¶
func (pc *PastCone) SetFlagsUp(vid *WrappedTx, f FlagsPastCone)
func (*PastCone) SlotInflation ¶
func (*PastCone) UndefinedList ¶
func (*PastCone) UndefinedListLines ¶
func (*PastCone) VertexLine ¶
type PastConeBase ¶
type PastConeBase struct {
// contains filtered or unexported fields
}
func NewPastConeBase ¶
func NewPastConeBase(baselineID *base.TransactionID) *PastConeBase
func (*PastConeBase) CloneImmutable ¶
func (pb *PastConeBase) CloneImmutable() *PastConeBase
func (*PastConeBase) Dispose ¶
func (pb *PastConeBase) Dispose()
func (*PastConeBase) Len ¶
func (pb *PastConeBase) Len() int
type TxIDStatus ¶
type TxIDStatus struct {
ID base.TransactionID
OnDAG bool
InStorage bool
VirtualOrDetached bool
Deleted bool
Status Status
Flags Flags
Coverage *uint64
Err error
}
func (*TxIDStatus) JSONAble ¶
func (s *TxIDStatus) JSONAble() (ret TxIDStatusJSONAble)
type TxIDStatusJSONAble ¶
type TxIDStatusJSONAble struct {
ID string `json:"id"`
OnDAG bool `json:"on_dag"`
InStorage bool `json:"in_storage"`
VirtualOrDetached bool `json:"virtual_or_detached"`
Deleted bool `json:"deleted"`
Status string `json:"status"`
Flags byte `json:"flags"`
Coverage uint64 `json:"coverage,omitempty"`
Err error `json:"err"`
}
func (*TxIDStatusJSONAble) Parse ¶
func (s *TxIDStatusJSONAble) Parse() (*TxIDStatus, error)
type UnwrapOptions ¶
type UnwrapOptions struct {
Vertex func(v *Vertex)
DetachedVertex func(v *DetachedVertex)
VirtualTx func(v *VirtualTransaction)
}
type UnwrapOptionsForTraverse ¶
type UnwrapOptionsForTraverse struct {
Vertex func(vidCur *WrappedTx, v *Vertex) bool
DetachedVertex func(vidCur *WrappedTx, v *DetachedVertex) bool
VirtualTx func(vidCur *WrappedTx, v *VirtualTransaction) bool
TxID func(txid *base.TransactionID)
}
type Vertex ¶
type Vertex struct {
Tx *transaction.Transaction
Inputs []*WrappedTx
Endorsements []*WrappedTx
BaselineBranchID *base.TransactionID
}
Vertex is a transaction with past cone dependencies
func NewVertex ¶
func NewVertex(tx *transaction.Transaction) *Vertex
func (*Vertex) ForEachEndorsement ¶
func (*Vertex) ForEachInputDependency ¶
func (*Vertex) GetConsumedOutput ¶
GetConsumedOutput return produced output, is available. Returns nil if unavailable for any reason
func (*Vertex) InputLoaderByIndex ¶
InputLoaderByIndex returns consumed output at index i or nil (if input is orphaned or inaccessible in the virtualTx)
func (*Vertex) MissingInputTxIDSet ¶
func (v *Vertex) MissingInputTxIDSet() set.Set[base.TransactionID]
MissingInputTxIDSet returns set of txids for the missing inputs and endorsements
func (*Vertex) MissingInputTxIDString ¶
func (*Vertex) NumMissingInputs ¶
func (*Vertex) ReferenceEndorsement ¶
func (*Vertex) ReferenceInput ¶
ReferenceInput puts a new input and references it. If referencing fails, no change happens and returns false
func (*Vertex) SequencerInputIndex ¶
func (*Vertex) SetOfInputTransactions ¶
func (*Vertex) StemInputIndex ¶
func (*Vertex) UnReferenceDependencies ¶
func (v *Vertex) UnReferenceDependencies()
UnReferenceDependencies un-references all not nil inputs and endorsements and invalidates vertex structure TODO revisit usages
func (*Vertex) ValidateConstraints ¶
ValidateConstraints creates full transaction context from the (solid) vertex data and runs validation of all constraints in the context
type VirtualTransaction ¶
VirtualTransaction is a collection of produced outputs
func (*VirtualTransaction) OutputAt ¶
func (v *VirtualTransaction) OutputAt(idx byte) (*ledger.Output, bool)
OutputAt return output at the index and true, or nil, false if output is not available in the virtual tx
func (*VirtualTransaction) PullNeeded ¶
func (v *VirtualTransaction) PullNeeded() bool
func (*VirtualTransaction) PullPatienceExpired ¶
func (v *VirtualTransaction) PullPatienceExpired(maxPullAttempts int) bool
func (*VirtualTransaction) PullRulesDefined ¶
func (v *VirtualTransaction) PullRulesDefined() bool
func (*VirtualTransaction) SequencerOutputs ¶
func (v *VirtualTransaction) SequencerOutputs() (*ledger.Output, *ledger.Output)
SequencerOutputs returns <seq output>, <stem output> or respective nils
func (*VirtualTransaction) SetPullHappened ¶
func (v *VirtualTransaction) SetPullHappened(repeatAfter time.Duration)
SetPullHappened increases pull counter and sets nex pull deadline
func (*VirtualTransaction) SetPullNeeded ¶
func (v *VirtualTransaction) SetPullNeeded()
type WrappedOutput ¶
func (*WrappedOutput) DecodeID ¶
func (o *WrappedOutput) DecodeID() (ret base.OutputID)
func (*WrappedOutput) IDHasFragment ¶
func (o *WrappedOutput) IDHasFragment(frag string) bool
func (*WrappedOutput) IDString ¶
func (o *WrappedOutput) IDString() string
func (*WrappedOutput) IDStringShort ¶
func (o *WrappedOutput) IDStringShort() string
func (*WrappedOutput) IsAvailable ¶
func (o *WrappedOutput) IsAvailable() (available bool)
func (*WrappedOutput) Lock ¶
func (o *WrappedOutput) Lock() ledger.Lock
func (*WrappedOutput) LockName ¶
func (o *WrappedOutput) LockName() string
func (*WrappedOutput) Output ¶
func (o *WrappedOutput) Output() (ret *ledger.Output)
func (*WrappedOutput) OutputWithChainID ¶
func (o *WrappedOutput) OutputWithChainID() (ledger.OutputWithChainID, bool)
func (*WrappedOutput) OutputWithID ¶
func (o *WrappedOutput) OutputWithID() *ledger.OutputWithID
func (*WrappedOutput) Slot ¶
func (o *WrappedOutput) Slot() uint32
func (*WrappedOutput) Timestamp ¶
func (o *WrappedOutput) Timestamp() base.LedgerTime
func (*WrappedOutput) ValidID ¶
func (o *WrappedOutput) ValidID() bool
type WrappedTx ¶
type WrappedTx struct {
// sequencer id not nil for sequencer transactions only. Once it is set not nil, it is immutable since.
// It is set whenever the transaction becomes available
SequencerID atomic.Pointer[base.ChainID]
SlotWhenAdded uint32 // immutable
// contains filtered or unexported fields
}
WrappedTx value of *WrappedTx is used as transaction identity on the UTXO tangle, a vertex Behind this identity can be wrapped usual vertex or virtual transactions
func WrapBranchDataAsVirtualTx ¶
func WrapBranchDataAsVirtualTx(branchData *multistate.BranchData) *WrappedTx
WrapBranchDataAsVirtualTx branch vertex immediately becomes 'good'
func WrapTxID ¶
func WrapTxID(txid base.TransactionID) *WrappedTx
WrapTxID creates VID with a virtualTx which only contains txid. Also sets the solidification deadline, after which IsPullDeadlineDue will start returning true The pull deadline will be dropped after transaction becomes available and virtualTx will be converted to full vertex
func (*WrappedTx) AddConsumer ¶
AddConsumer stores consumer of the vid[outputIndex] consumed output. Function checkConflicts checks if the new consumer conflicts with already existing ones
func (*WrappedTx) BaselineBranch ¶
func (vid *WrappedTx) BaselineBranch() (baselineBranchID base.TransactionID, ok bool)
BaselineBranch baseline branch of the vertex
func (*WrappedTx) ConvertToDetached ¶
func (vid *WrappedTx) ConvertToDetached()
ConvertToDetached detaches past cone and leaves only a collection of produced outputs Detaches input dependencies and converts to the DetachedVertex Note, however, that for branches, WrappedTx with DetachedVertex can later contain reference to the pastCone structure. Upon repeated calls to ConvertToDetached we set pastCone to nil. If not this, DAG remains always connected and old vertices are not garbage collected -> memory leak!
func (*WrappedTx) ConvertVirtualTxToVertexNoLock ¶
func (*WrappedTx) FindChainOutput ¶
func (vid *WrappedTx) FindChainOutput(chainID *base.ChainID) (ret *ledger.OutputWithID)
func (*WrappedTx) FlagsNoLock ¶
func (*WrappedTx) FlagsUpNoLock ¶
func (*WrappedTx) GetAttachmentDepthNoLock ¶
func (*WrappedTx) GetErrorNoLock ¶
func (*WrappedTx) GetLedgerCoverage ¶
func (*WrappedTx) GetLedgerCoverageNoLock ¶
func (*WrappedTx) GetLedgerCoverageP ¶
func (*WrappedTx) GetLedgerCoverageString ¶
func (*WrappedTx) GetPastConeNoLock ¶
func (vid *WrappedTx) GetPastConeNoLock() *PastConeBase
func (*WrappedTx) GetTransaction ¶
func (vid *WrappedTx) GetTransaction() (tx *transaction.Transaction)
func (*WrappedTx) GetTxStatus ¶
func (*WrappedTx) GetTxStatusNoLock ¶
func (*WrappedTx) ID ¶
func (vid *WrappedTx) ID() base.TransactionID
func (*WrappedTx) IDHasFragment ¶
func (*WrappedTx) IDShortString ¶
func (*WrappedTx) IDVeryShort ¶
func (*WrappedTx) InflationAmount ¶
InflationAmount is sum of inflation values on the produced outputs
func (*WrappedTx) IsBranchTransaction ¶
func (*WrappedTx) IsSequencerMilestone ¶
func (*WrappedTx) IsVirtualTx ¶
func (*WrappedTx) MustEnsureOutput ¶
func (*WrappedTx) MustOutputWithIDAt ¶
func (vid *WrappedTx) MustOutputWithIDAt(idx byte) (ret ledger.OutputWithID)
func (*WrappedTx) MustSequencerIDAndStemID ¶
func (*WrappedTx) NotConsumedOutputIndices ¶
func (*WrappedTx) NumConsumers ¶
NumConsumers returns: - number of consumed outputs - number of conflict sets
func (*WrappedTx) NumProducedOutputs ¶
func (*WrappedTx) OutputAt ¶
OutputAt return output at index, if available. err != nil indicates wrong index nil, nil means output not available, but no error (orphaned)
func (*WrappedTx) OutputWithIDAt ¶
func (vid *WrappedTx) OutputWithIDAt(idx byte) (ledger.OutputWithID, error)
func (*WrappedTx) RUnwrap ¶
func (vid *WrappedTx) RUnwrap(opt UnwrapOptions)
func (*WrappedTx) SequencerIDStringVeryShort ¶
func (*WrappedTx) SequencerName ¶
func (*WrappedTx) SequencerPredecessor ¶
func (vid *WrappedTx) SequencerPredecessor(reattachBranch func(txid base.TransactionID) *WrappedTx) (ret *WrappedTx)
func (*WrappedTx) SequencerWrappedOutput ¶
func (vid *WrappedTx) SequencerWrappedOutput() (ret WrappedOutput)
func (*WrappedTx) SetAttachmentDepthNoLock ¶
func (*WrappedTx) SetFlagsDownNoLock ¶
func (*WrappedTx) SetFlagsUpNoLock ¶
func (*WrappedTx) SetSequencerAttachmentFinished ¶
func (vid *WrappedTx) SetSequencerAttachmentFinished()
func (*WrappedTx) SetTxStatusBad ¶
func (*WrappedTx) SetTxStatusBadNoLock ¶
func (*WrappedTx) SetTxStatusGood ¶
func (vid *WrappedTx) SetTxStatusGood(pastCone *PastConeBase, coverage uint64)
SetTxStatusGood sets 'good' status and past cone
func (*WrappedTx) SetTxStatusGoodNoLock ¶
func (vid *WrappedTx) SetTxStatusGoodNoLock(pastCone *PastConeBase, coverage uint64)
func (*WrappedTx) ShortString ¶
func (*WrappedTx) StemWrappedOutput ¶
func (vid *WrappedTx) StemWrappedOutput() (ret WrappedOutput)
func (*WrappedTx) StringNoLock ¶
func (*WrappedTx) Timestamp ¶
func (vid *WrappedTx) Timestamp() base.LedgerTime
func (*WrappedTx) TraversePastConeDepthFirst ¶
func (vid *WrappedTx) TraversePastConeDepthFirst(opt UnwrapOptionsForTraverse, visited ...set.Set[*WrappedTx])
TraversePastConeDepthFirst performs depth-first traverse of the MemDAG. Visiting once each node and calling vertex-type specific function if provided on each. If function returns false, the traverse is cancelled globally. The traverse stops at terminal dag. The vertex is terminal if it either is not-full vertex i.e. (booked, orphaned, deleted) or it belongs to 'visited' set If 'visited' set is provided at call, it is mutable. In the end it contains all initial dag plus all dag visited during the traverse
func (*WrappedTx) Unwrap ¶
func (vid *WrappedTx) Unwrap(opt UnwrapOptions)
func (*WrappedTx) UnwrapVirtualTx ¶
func (vid *WrappedTx) UnwrapVirtualTx(unwrapFun func(v *VirtualTransaction))
UnwrapVirtualTx calls callback only if it is virtualTx
func (*WrappedTx) ValidSequencerPace ¶
func (vid *WrappedTx) ValidSequencerPace(targetTs base.LedgerTime) bool
func (*WrappedTx) WithConsumersRLock ¶
func (vid *WrappedTx) WithConsumersRLock(fun func())