Documentation
¶
Overview ¶
Package branches implements caching of branch data
Index ¶
- type Branches
- func (b *Branches) BranchKnowsTransaction(branchID, txid base.TransactionID) bool
- func (b *Branches) ChainLines(tipOrig base.TransactionID, prefix ...string) *lines.Lines
- func (b *Branches) Get(branchTxID base.TransactionID) *multistate.BranchData
- func (b *Branches) GetStateReaderForTheBranch(branchID base.TransactionID) multistate.IndexedStateReader
- func (b *Branches) IsDescendantBranch(descendant, ancestor base.TransactionID) (sameLineage bool, isDescendant bool)
- func (b *Branches) LedgerCoverage(branchID base.TransactionID) uint64
- func (b *Branches) SequencerOutputID(branchID base.TransactionID) (base.OutputID, bool)
- func (b *Branches) SnapshotBranchID() base.TransactionID
- func (b *Branches) SnapshotKnowsTransaction(txid base.TransactionID) bool
- func (b *Branches) SnapshotSlot() uint32
- func (b *Branches) Supply(branchID base.TransactionID) uint64
- func (b *Branches) TransactionIsInSnapshotState(txid base.TransactionID) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branches ¶
type Branches struct {
// contains filtered or unexported fields
}
func (*Branches) BranchKnowsTransaction ¶
func (b *Branches) BranchKnowsTransaction(branchID, txid base.TransactionID) bool
func (*Branches) ChainLines ¶
ChainLines for debugging
func (*Branches) Get ¶
func (b *Branches) Get(branchTxID base.TransactionID) *multistate.BranchData
func (*Branches) GetStateReaderForTheBranch ¶
func (b *Branches) GetStateReaderForTheBranch(branchID base.TransactionID) multistate.IndexedStateReader
GetStateReaderForTheBranch returns a state reader for the branch or nil if the state does not exist. If the branch is before the snapshot and branch ChainID is known in the snapshot state, it returns the snapshot state (which always exists)
func (*Branches) IsDescendantBranch ¶
func (b *Branches) IsDescendantBranch(descendant, ancestor base.TransactionID) (sameLineage bool, isDescendant bool)
IsDescendantBranch returns:
compatible = true -> then isDescendentOf=true if branch1 known branch2 and false otherwise compatible = false -> branches not in the same chain and isDescendentOf is undefined
func (*Branches) LedgerCoverage ¶
func (b *Branches) LedgerCoverage(branchID base.TransactionID) uint64
LedgerCoverage strictly speaking, is non-deterministic if the snapshot is after the genesis However:
- if branchID is far enough (63 slots), it is guaranteed to be the real value and therefore deterministic
- if the snapshot is N slots behind the branchID, it is guaranteed that the returned value differs from the real value no more than by 1/2^N
func (*Branches) SequencerOutputID ¶
func (*Branches) SnapshotBranchID ¶
func (b *Branches) SnapshotBranchID() base.TransactionID
func (*Branches) SnapshotKnowsTransaction ¶
func (b *Branches) SnapshotKnowsTransaction(txid base.TransactionID) bool
func (*Branches) SnapshotSlot ¶
func (*Branches) TransactionIsInSnapshotState ¶
func (b *Branches) TransactionIsInSnapshotState(txid base.TransactionID) bool
Click to show internal directories.
Click to hide internal directories.