Versions in this module Expand all Collapse all v0 v0.1.3 Oct 3, 2023 v0.1.2 Oct 3, 2023 Changes in this version + const BlockIDLength + const BlockVersion + const ChildTypeLength + const DBSequenceNumber + const DefaultSyncTimeWindow + const LastValidBlockType + const MaxBlockSize + const MaxLocalQueueSize + const MaxParentsBlocksCount + const MaxParentsCount + const MaxReattachmentTimeMin + const MinMana + const MinParentsBlocksCount + const MinParentsCount + const MinStrongParentsCount + const PrefixAttachments + const PrefixBlock + const PrefixBlockMetadata + const PrefixChildren + const PrefixConflictVoters + const PrefixConflictWeight + const PrefixLatestConflictVotes + const PrefixLatestMarkerVotes + const PrefixMarkerBlockMapping + const PrefixMarkerConflictIDMapping + const PrefixMissingBlock + const RateSettingDecrease + const RateSettingIncrease + const Wmax + const Wmin + var DefaultRequesterOptions = &RequesterOptions + var ErrBlockTooSmall = errors.New("block too small") + var ErrBlockTypeIsUnknown = errors.Errorf("block types must range from %d-%d", 1, LastValidBlockType) + var ErrConflictingReferenceAcrossBlocks = errors.New("different blocks have conflicting references") + var ErrInvalidBlockAndTransactionTimestamp = fmt.Errorf("invalid block and transaction timestamp") + var ErrInvalidIssuer = errors.New("block not issued by local node") + var ErrInvalidPOWDifficultly = errors.New("invalid PoW") + var ErrInvalidSignature = fmt.Errorf("invalid signature") + var ErrNoStrongParents = errors.New("missing strong blocks in first parent block") + var ErrNotBootstrapped = errors.New("mesh not bootstrapped") + var ErrNotRunning = errors.New("scheduler stopped") + var ErrParentsInvalid = errors.New("one or more parents is invalid") + var ErrReceivedDuplicateBytes = fmt.Errorf("received duplicate bytes") + var ErrStopped = errors.New("rate setter stopped") + var LatestMarkerVotesKeyPartition = objectstorage.PartitionKey(markers.SequenceID(0).Length(), identity.IDLength) + var MarkerBlockMappingPartitionKeys = objectstorage.PartitionKey(markers.SequenceID(0).Length(), markers.Index(0).Length()) + var MaxDeficit = new(big.Rat).SetInt64(int64(MaxBlockSize)) + var ParentTypeToChildType = map[ParentsType]ChildType + var ZeroWorker = WorkerFunc(func([]byte) (uint64, error) { ... }) + func BlockIDToContext(ctx context.Context, blockID BlockID) context.Context + func IssueAndValidateBlockApproval(t *testing.T, blockAlias string, eventMock *EventMock, ...) + type ActivityUpdatesCount map[identity.ID]uint64 + type ApprovalWeightManager struct + Events *ApprovalWeightManagerEvents + func NewApprovalWeightManager(mesh *Mesh) (approvalWeightManager *ApprovalWeightManager) + func (a *ApprovalWeightManager) Setup() + func (a *ApprovalWeightManager) Shutdown() + func (a *ApprovalWeightManager) VotersOfConflict(conflictID utxo.TransactionID) (voters *Voters) + func (a *ApprovalWeightManager) WeightOfConflict(conflictID utxo.TransactionID) (weight float64) + func (a *ApprovalWeightManager) WeightOfMarker(marker markers.Marker, anchorTime time.Time) (weight float64) + type ApprovalWeightManagerEvents struct + BlockProcessed *event.Event[*BlockProcessedEvent] + ConflictWeightChanged *event.Event[*ConflictWeightChangedEvent] + MarkerWeightChanged *event.Event[*MarkerWeightChangedEvent] + type Attachment struct + func NewAttachment(transactionID utxo.TransactionID, blockID BlockID) *Attachment + func (a *Attachment) BlockID() BlockID + func (a *Attachment) TransactionID() utxo.TransactionID + type Block struct + func NewBlock(references ParentBlockIDs, issuingTime time.Time, ...) *Block + func NewBlockWithValidation(references ParentBlockIDs, issuingTime time.Time, ...) (result *Block, err error) + func (m *Block) DetermineID() (err error) + func (m *Block) ECR() epoch.ECR + func (m *Block) ECRecordEI() epoch.Index + func (m *Block) ForEachParent(consumer func(parent Parent)) + func (m *Block) ForEachParentByType(parentType ParentsType, consumer func(parentBlockID BlockID) bool) + func (m *Block) FromBytes(bytes []byte) (err error) + func (m *Block) IDBytes() []byte + func (m *Block) IssuerPublicKey() ed25519.PublicKey + func (m *Block) IssuingTime() time.Time + func (m *Block) LatestConfirmedEpoch() epoch.Index + func (m *Block) Nonce() uint64 + func (m *Block) Parents() (parents []BlockID) + func (m *Block) ParentsByType(parentType ParentsType) BlockIDs + func (m *Block) ParentsCountByType(parentType ParentsType) uint8 + func (m *Block) Payload() payload.Payload + func (m *Block) PrevEC() epoch.EC + func (m *Block) SequenceNumber() uint64 + func (m *Block) Signature() ed25519.Signature + func (m *Block) Size() int + func (m *Block) String() string + func (m *Block) VerifySignature() (valid bool, err error) + func (m *Block) Version() uint8 + type BlockAcceptedEvent struct + Block *Block + type BlockBookedEvent struct + BlockID BlockID + type BlockConflictUpdatedEvent struct + BlockID BlockID + ConflictID utxo.TransactionID + type BlockConstructedEvent struct + Block *Block + type BlockDiscardedEvent struct + BlockID BlockID + type BlockDispatchedEvent struct + BlockID BlockID + type BlockFactory struct + Events *BlockFactoryEvents + ReferenceProvider *ReferenceProvider + func NewBlockFactory(mesh *Mesh, selector TipSelector, referencesFunc ...ReferencesFunc) *BlockFactory + func (f *BlockFactory) EarliestAttachment(transactionIDs utxo.TransactionIDs, earliestAttachmentMustBeBooked ...bool) (earliestAttachment *Block) + func (f *BlockFactory) IssuePayload(p payload.Payload, parentsCount ...int) (*Block, error) + func (f *BlockFactory) IssuePayloadWithReferences(p payload.Payload, references ParentBlockIDs, parentsCount ...int) (*Block, error) + func (f *BlockFactory) LatestAttachment(transactionID utxo.TransactionID) (latestAttachment *Block) + func (f *BlockFactory) SetTimeout(timeout time.Duration) + func (f *BlockFactory) SetWorker(worker Worker) + func (f *BlockFactory) Shutdown() + type BlockFactoryEvents struct + BlockConstructed *event.Event[*BlockConstructedEvent] + Error *event.Event[error] + func NewBlockFactoryEvents() (new *BlockFactoryEvents) + type BlockFilter interface + Filter func(blk *Block, peer *peer.Peer) + OnAccept func(callback func(blk *Block, peer *peer.Peer)) + OnReject func(callback func(blk *Block, err error, peer *peer.Peer)) + type BlockID struct + EpochIndex epoch.Index + Identifier types.Identifier + var EmptyBlockID BlockID + func BlockIDFromContext(ctx context.Context) BlockID + func NewBlockID(identifier [32]byte, epochIndex epoch.Index) (new BlockID) + func (b *BlockID) FromBase58(base58EncodedString string) (err error) + func (b *BlockID) FromBytes(serialized []byte) (consumedBytes int, err error) + func (b *BlockID) FromRandomness(optionalEpoch ...epoch.Index) (err error) + func (b BlockID) Alias() (alias string) + func (b BlockID) Base58() (base58Encoded string) + func (b BlockID) Bytes() (serialized []byte) + func (b BlockID) CompareTo(other BlockID) int + func (b BlockID) Length() int + func (b BlockID) RegisterAlias(alias string) + func (b BlockID) String() (humanReadable string) + func (b BlockID) UnregisterAlias() + type BlockIDs map[BlockID]types.Empty + func NewBlockIDs(blkIDs ...BlockID) BlockIDs + func (m BlockIDs) Add(blockID BlockID) BlockIDs + func (m BlockIDs) AddAll(blockIDs BlockIDs) BlockIDs + func (m BlockIDs) Base58() (result []string) + func (m BlockIDs) Clone() (clonedBlockIDs BlockIDs) + func (m BlockIDs) Contains(target BlockID) (contains bool) + func (m BlockIDs) Empty() (empty bool) + func (m BlockIDs) First() BlockID + func (m BlockIDs) Slice() []BlockID + func (m BlockIDs) String() string + func (m BlockIDs) Subtract(other BlockIDs) BlockIDs + type BlockInvalidEvent struct + BlockID BlockID + Error error + type BlockMetadata struct + func NewBlockMetadata(blockID BlockID) *BlockMetadata + func (m *BlockMetadata) AddConflictID(conflictID utxo.TransactionID) (modified bool) + func (m *BlockMetadata) AddedConflictIDs() utxo.TransactionIDs + func (m *BlockMetadata) BookedTime() time.Time + func (m *BlockMetadata) ConfirmationState() (result confirmation.State) + func (m *BlockMetadata) ConfirmationStateTime() time.Time + func (m *BlockMetadata) DiscardedTime() time.Time + func (m *BlockMetadata) IsBooked() (result bool) + func (m *BlockMetadata) IsObjectivelyInvalid() (result bool) + func (m *BlockMetadata) IsSolid() (result bool) + func (m *BlockMetadata) IsSubjectivelyInvalid() (result bool) + func (m *BlockMetadata) QueuedTime() time.Time + func (m *BlockMetadata) ReceivedTime() time.Time + func (m *BlockMetadata) Scheduled() bool + func (m *BlockMetadata) ScheduledTime() time.Time + func (m *BlockMetadata) SetAddedConflictIDs(addedConflictIDs utxo.TransactionIDs) (modified bool) + func (m *BlockMetadata) SetBooked(booked bool) (modified bool) + func (m *BlockMetadata) SetConfirmationState(confirmationState confirmation.State) (modified bool) + func (m *BlockMetadata) SetDiscardedTime(discardedTime time.Time) + func (m *BlockMetadata) SetObjectivelyInvalid(invalid bool) (modified bool) + func (m *BlockMetadata) SetQueuedTime(queuedTime time.Time) + func (m *BlockMetadata) SetScheduled(scheduled bool) (modified bool) + func (m *BlockMetadata) SetSolid(solid bool) (modified bool) + func (m *BlockMetadata) SetStructureDetails(structureDetails *markers.StructureDetails) (modified bool) + func (m *BlockMetadata) SetSubjectivelyInvalid(invalid bool) (modified bool) + func (m *BlockMetadata) SetSubtractedConflictIDs(subtractedConflictIDs utxo.TransactionIDs) (modified bool) + func (m *BlockMetadata) SolidificationTime() time.Time + func (m *BlockMetadata) StructureDetails() *markers.StructureDetails + func (m *BlockMetadata) SubtractedConflictIDs() utxo.TransactionIDs + type BlockMissingEvent struct + BlockID BlockID + type BlockModel struct + ECR epoch.ECR + ECRecordEI epoch.Index + IssuerPublicKey ed25519.PublicKey + IssuingTime time.Time + LatestConfirmedEpoch epoch.Index + Nonce uint64 + Parents ParentBlockIDs + PayloadBytes []byte + PrevEC epoch.EC + SequenceNumber uint64 + Signature ed25519.Signature + Version uint8 + type BlockOption func(*BlockTestFrameworkBlockOptions) + func WithColoredOutput(alias string, balances map[devnetvm.Color]uint64) BlockOption + func WithECRecord(ecRecord *epoch.ECRecord) BlockOption + func WithInputs(inputAliases ...string) BlockOption + func WithIssuer(issuer ed25519.PublicKey) BlockOption + func WithIssuingTime(issuingTime time.Time) BlockOption + func WithLatestConfirmedEpoch(ei epoch.Index) BlockOption + func WithOutput(alias string, balance uint64) BlockOption + func WithReattachment(blockAlias string) BlockOption + func WithSequenceNumber(sequenceNumber uint64) BlockOption + func WithShallowLikeParents(blockAliases ...string) BlockOption + func WithStrongParents(blockAliases ...string) BlockOption + func WithWeakParents(blockAliases ...string) BlockOption + type BlockOrphanedEvent struct + Block *Block + Reason error + type BlockParsedEvent struct + Block *Block + Peer *peer.Peer + type BlockProcessedEvent struct + BlockID BlockID + type BlockRejectedEvent struct + Block *Block + Error error + Peer *peer.Peer + type BlockRemovedEvent struct + BlockID BlockID + type BlockScheduledEvent struct + BlockID BlockID + type BlockSignatureFilter struct + func NewBlockSignatureFilter() *BlockSignatureFilter + func (f *BlockSignatureFilter) Close() error + func (f *BlockSignatureFilter) Filter(blk *Block, peer *peer.Peer) + func (f *BlockSignatureFilter) OnAccept(callback func(blk *Block, peer *peer.Peer)) + func (f *BlockSignatureFilter) OnReject(callback func(blk *Block, err error, peer *peer.Peer)) + type BlockSkippedEvent struct + BlockID BlockID + type BlockSolidEvent struct + Block *Block + type BlockStoredEvent struct + Block *Block + type BlockTestFramework struct + func NewBlockTestFramework(mesh *Mesh, options ...BlockTestFrameworkOption) (blockTestFramework *BlockTestFramework) + func (m *BlockTestFramework) Block(alias string) (block *Block) + func (m *BlockTestFramework) BlockIDs(aliases ...string) (blockIDs BlockIDs) + func (m *BlockTestFramework) BlockMetadata(alias string) (blockMetadata *BlockMetadata) + func (m *BlockTestFramework) Conflict(blockAlias string) (b *conflictdag.Conflict[utxo.TransactionID, utxo.OutputID]) + func (m *BlockTestFramework) ConflictID(alias string) (conflictID utxo.TransactionID) + func (m *BlockTestFramework) ConflictIDFromBlock(blockAlias string) utxo.TransactionID + func (m *BlockTestFramework) ConflictIDs(aliases ...string) (conflictIDs utxo.TransactionIDs) + func (m *BlockTestFramework) CreateBlock(blockAlias string, blockOptions ...BlockOption) (block *Block) + func (m *BlockTestFramework) IncreaseMarkersIndexCallback(markers.SequenceID, markers.Index) bool + func (m *BlockTestFramework) IssueBlocks(blockAliases ...string) *BlockTestFramework + func (m *BlockTestFramework) LatestCommitment() (ecRecord *epoch.ECRecord, latestConfirmedEpoch epoch.Index, err error) + func (m *BlockTestFramework) Output(alias string) (output devnetvm.Output) + func (m *BlockTestFramework) OutputMetadata(outputID utxo.OutputID) (outMeta *ledger.OutputMetadata) + func (m *BlockTestFramework) PreventNewMarkers(enabled bool) *BlockTestFramework + func (m *BlockTestFramework) RegisterConflictID(alias, blockAlias string) + func (m *BlockTestFramework) RegisterTransactionID(alias, blockAlias string) + func (m *BlockTestFramework) Snapshot() (snapshot *ledger.Snapshot) + func (m *BlockTestFramework) Transaction(blockAlias string) (tx utxo.Transaction) + func (m *BlockTestFramework) TransactionID(blockAlias string) utxo.TransactionID + func (m *BlockTestFramework) TransactionMetadata(blockAlias string) (txMeta *ledger.TransactionMetadata) + func (m *BlockTestFramework) WaitUntilAllTasksProcessed() (self *BlockTestFramework) + type BlockTestFrameworkBlockOptions struct + func NewBlockTestFrameworkBlockOptions(options ...BlockOption) (blockOptions *BlockTestFrameworkBlockOptions) + type BlockTestFrameworkOption func(*BlockTestFrameworkOptions) + func WithColoredGenesisOutput(alias string, balances map[devnetvm.Color]uint64) BlockTestFrameworkOption + func WithGenesisOutput(alias string, balance uint64) BlockTestFrameworkOption + type BlockTestFrameworkOptions struct + func NewBlockTestFrameworkOptions(options ...BlockTestFrameworkOption) (frameworkOptions *BlockTestFrameworkOptions) + type Booker struct + Events *BookerEvents + MarkersManager *ConflictMarkersMapper + func NewBooker(mesh *Mesh) (blockBooker *Booker) + func (b *Booker) BlockConflictIDs(blockID BlockID) (conflictIDs *set.AdvancedSet[utxo.TransactionID], err error) + func (b *Booker) BookBlock(block *Block, blockMetadata *BlockMetadata) (err error) + func (b *Booker) PayloadConflictIDs(blockID BlockID) (conflictIDs *set.AdvancedSet[utxo.TransactionID], err error) + func (b *Booker) PropagateForkedConflict(transactionID utxo.TransactionID, addedConflictID utxo.TransactionID, ...) (err error) + func (b *Booker) Setup() + func (b *Booker) Shutdown() + type BookerEvents struct + BlockBooked *event.Event[*BlockBookedEvent] + BlockConflictUpdated *event.Event[*BlockConflictUpdatedEvent] + Error *event.Event[error] + MarkerConflictAdded *event.Event[*MarkerConflictAddedEvent] + func NewBookerEvents() (new *BookerEvents) + type BootstrappedEvent struct + type BytesFilter interface + Filter func(bytes []byte, peer *peer.Peer) + OnAccept func(callback func(bytes []byte, peer *peer.Peer)) + OnReject func(callback func(bytes []byte, err error, peer *peer.Peer)) + type BytesRejectedEvent struct + Bytes []byte + Error error + Peer *peer.Peer + type CManaWeightProvider struct + func NewCManaWeightProvider(manaRetrieverFunc ManaRetrieverFunc, timeRetrieverFunc TimeRetrieverFunc, ...) (cManaWeightProvider *CManaWeightProvider) + func (c *CManaWeightProvider) LoadActiveNodes(loadedActiveNodes epoch.SnapshotEpochActivity) + func (c *CManaWeightProvider) Remove(ei epoch.Index, nodeID identity.ID, updatedActivityCount uint64) (removed bool) + func (c *CManaWeightProvider) Shutdown() + func (c *CManaWeightProvider) SnapshotEpochActivity(epochDiffIndex epoch.Index) (epochActivity epoch.SnapshotEpochActivity) + func (c *CManaWeightProvider) Update(ei epoch.Index, nodeID identity.ID) + func (c *CManaWeightProvider) Weight(block *Block) (weight, totalWeight float64) + func (c *CManaWeightProvider) WeightsOfRelevantVoters() (weights map[identity.ID]float64, totalWeight float64) + type CachedLatestMarkerVotesByVoter map[Voter]*objectstorage.CachedObject[*LatestMarkerVotes] + func (c CachedLatestMarkerVotesByVoter) Consume(consumer func(latestMarkerVotes *LatestMarkerVotes), forceRelease ...bool) (consumed bool) + type Child struct + func NewChild(childType ChildType, referencedBlockID BlockID, childBlockID BlockID) *Child + func (a *Child) ChildBlockID() BlockID + func (a *Child) ReferencedBlockID() BlockID + func (a *Child) Type() ChildType + type ChildType uint8 + const ShallowLikeChild + const StrongChild + const WeakChild + func (a ChildType) Bytes() []byte + func (a ChildType) String() string + type ConfirmationEvents struct + BlockAccepted *event.Event[*BlockAcceptedEvent] + BlockOrphaned *event.Event[*BlockAcceptedEvent] + func NewConfirmationEvents() (new *ConfirmationEvents) + type ConfirmationOracle interface + Events func() *ConfirmationEvents + FirstUnconfirmedMarkerIndex func(sequenceID markers.SequenceID) (unconfirmedMarkerIndex markers.Index) + IsBlockConfirmed func(blkID BlockID) bool + IsConflictConfirmed func(conflictID utxo.TransactionID) bool + IsMarkerConfirmed func(marker markers.Marker) bool + IsTransactionConfirmed func(transactionID utxo.TransactionID) bool + type ConfirmedEpochRetrieverFunc func() epoch.Index + type ConflictMarkersMapper struct + func NewConflictMarkersMapper(mesh *Mesh) (b *ConflictMarkersMapper) + func (b *ConflictMarkersMapper) BlockID(marker markers.Marker) (blockID BlockID) + func (b *ConflictMarkersMapper) Ceiling(referenceMarker markers.Marker) (marker markers.Index, conflictIDs *set.AdvancedSet[utxo.TransactionID], ...) + func (b *ConflictMarkersMapper) ConflictIDs(marker markers.Marker) (conflictIDs *set.AdvancedSet[utxo.TransactionID]) + func (b *ConflictMarkersMapper) Floor(referenceMarker markers.Marker) (marker markers.Index, conflictIDs *set.AdvancedSet[utxo.TransactionID], ...) + func (b *ConflictMarkersMapper) ForEachConflictIDMapping(sequenceID markers.SequenceID, thresholdIndex markers.Index, ...) + func (b *ConflictMarkersMapper) ForEachMarkerReferencingMarker(referencedMarker markers.Marker, ...) + func (b *ConflictMarkersMapper) InheritStructureDetails(block *Block, structureDetails []*markers.StructureDetails) (newStructureDetails *markers.StructureDetails, newSequenceCreated bool) + func (b *ConflictMarkersMapper) SetBlockID(marker markers.Marker, blockID BlockID) + func (b *ConflictMarkersMapper) SetConflictIDs(marker markers.Marker, conflictIDs *set.AdvancedSet[utxo.TransactionID]) (updated bool) + type ConflictVote struct + func NewConflictVote(voter Voter, votePower VotePower, conflictID utxo.TransactionID, ...) (voteWithOpinion *ConflictVote) + func (v *ConflictVote) ConflictID() utxo.TransactionID + func (v *ConflictVote) Opinion() Opinion + func (v *ConflictVote) VotePower() VotePower + func (v *ConflictVote) Voter() Voter + func (v *ConflictVote) WithConflictID(conflictID utxo.TransactionID) (rejectedVote *ConflictVote) + func (v *ConflictVote) WithOpinion(opinion Opinion) (voteWithOpinion *ConflictVote) + type ConflictVoters struct + func NewConflictVoters(conflictID utxo.TransactionID) (conflictVoters *ConflictVoters) + func (b *ConflictVoters) AddVoter(voter Voter) (added bool) + func (b *ConflictVoters) AddVoters(voters *Voters) (added bool) + func (b *ConflictVoters) ConflictID() (conflictID utxo.TransactionID) + func (b *ConflictVoters) DeleteVoter(voter Voter) (deleted bool) + func (b *ConflictVoters) Has(voter Voter) bool + func (b *ConflictVoters) Voters() (voters *Voters) + type ConflictWeight struct + func NewConflictWeight(conflictID utxo.TransactionID) (conflictWeight *ConflictWeight) + func (b *ConflictWeight) ConflictID() (conflictID utxo.TransactionID) + func (b *ConflictWeight) SetWeight(weight float64) bool + func (b *ConflictWeight) Weight() (weight float64) + type ConflictWeightChangedEvent struct + ConflictID utxo.TransactionID + Weight float64 + type DBStatsResult struct + BookedCount int + MissingBlockCount int + ScheduledCount int + SolidCount int + StoredCount int + SumBookedReceivedTime time.Duration + SumSchedulerBookedTime time.Duration + SumSchedulerReceivedTime time.Duration + SumSolidificationReceivedTime time.Duration + type DispatcherEvents struct + BlockDispatched *event.Event[*BlockDispatchedEvent] + type EventMock struct + func NewEventMock(t *testing.T, approvalWeightManager *ApprovalWeightManager) *EventMock + func (e *EventMock) AssertExpectations(t mock.TestingT) bool + func (e *EventMock) BlockProcessed(event *BlockProcessedEvent) + func (e *EventMock) ConflictWeightChanged(event *ConflictWeightChangedEvent) + func (e *EventMock) DetachAll() + func (e *EventMock) Expect(eventName string, arguments ...interface{}) + func (e *EventMock) MarkerWeightChanged(event *MarkerWeightChangedEvent) + type Events struct + BlockInvalid *event.Event[*BlockInvalidEvent] + Error *event.Event[error] + type LastBlock struct + BlockID BlockID + BlockTime time.Time + UpdateTime time.Time + func (l LastBlock) Bytes() (marshaledLastConfirmedBlock []byte) + func (l LastBlock) String() string + type LatestConflictVotes struct + func NewLatestConflictVotes(voter Voter) (latestConflictVotes *LatestConflictVotes) + func (l *LatestConflictVotes) Store(vote *ConflictVote) (stored bool) + func (l *LatestConflictVotes) Vote(conflictID utxo.TransactionID) (vote *ConflictVote, exists bool) + type LatestMarkerVotes struct + func NewLatestMarkerVotes(sequenceID markers.SequenceID, voter Voter) (newLatestMarkerVotes *LatestMarkerVotes) + func (l *LatestMarkerVotes) Power(index markers.Index) (power VotePower, exists bool) + func (l *LatestMarkerVotes) Store(index markers.Index, power VotePower) (stored bool, previousHighestIndex markers.Index) + func (l *LatestMarkerVotes) Voter() Voter + type LikedConflictMembers struct + type ManaRetrieverFunc func() map[identity.ID]float64 + type MarkerBlockMapping struct + func NewMarkerBlockMapping(marker markers.Marker, blockID BlockID) *MarkerBlockMapping + func (m *MarkerBlockMapping) BlockID() BlockID + func (m *MarkerBlockMapping) Marker() *markers.Marker + type MarkerConflictAddedEvent struct + Marker markers.Marker + NewConflictID utxo.TransactionID + type MarkerIndexConflictIDMapping struct + func NewMarkerIndexConflictIDMapping(sequenceID markers.SequenceID) (markerConflictMapping *MarkerIndexConflictIDMapping) + func (m *MarkerIndexConflictIDMapping) Ceiling(index markers.Index) (marker markers.Index, conflictIDs utxo.TransactionIDs, exists bool) + func (m *MarkerIndexConflictIDMapping) ConflictIDs(markerIndex markers.Index) (conflictIDs utxo.TransactionIDs) + func (m *MarkerIndexConflictIDMapping) DeleteConflictID(index markers.Index) + func (m *MarkerIndexConflictIDMapping) Floor(index markers.Index) (marker markers.Index, conflictIDs utxo.TransactionIDs, exists bool) + func (m *MarkerIndexConflictIDMapping) SequenceID() markers.SequenceID + func (m *MarkerIndexConflictIDMapping) SetConflictIDs(index markers.Index, conflictIDs utxo.TransactionIDs) + type MarkerWeightChangedEvent struct + Marker markers.Marker + Weight float64 + type Mesh struct + ApprovalWeightManager *ApprovalWeightManager + BlockFactory *BlockFactory + Booker *Booker + ConfirmationOracle ConfirmationOracle + Events *Events + Ledger *ledger.Ledger + OMVConsensusManager *OMVConsensusManager + Options *Options + OrphanageManager *OrphanageManager + Parser *Parser + RateSetter *RateSetter + Requester *Requester + Scheduler *Scheduler + Solidifier *Solidifier + Storage *Storage + TimeManager *TimeManager + TipManager *TipManager + Utils *Utils + WeightProvider WeightProvider + func New(options ...Option) (mesh *Mesh) + func NewTestMesh(options ...Option) *Mesh + func (t *Mesh) Bootstrapped() bool + func (t *Mesh) Configure(options ...Option) + func (t *Mesh) IssuePayload(p payload.Payload, parentsCount ...int) (block *Block, err error) + func (t *Mesh) ProcessGossipBlock(blockBytes []byte, peer *peer.Peer) + func (t *Mesh) Prune() (err error) + func (t *Mesh) Setup() + func (t *Mesh) Shutdown() + func (t *Mesh) Synced() bool + type MissingBlock struct + func NewMissingBlock(blockID BlockID) *MissingBlock + func (m *MissingBlock) BlockID() BlockID + func (m *MissingBlock) MissingSince() time.Time + type MissingBlockStoredEvent struct + BlockID BlockID + type MockConfirmationOracle struct + func (m *MockConfirmationOracle) Events() *ConfirmationEvents + func (m *MockConfirmationOracle) FirstUnconfirmedMarkerIndex(sequenceID markers.SequenceID) (unconfirmedMarkerIndex markers.Index) + func (m *MockConfirmationOracle) IsBlockConfirmed(blkID BlockID) bool + func (m *MockConfirmationOracle) IsConflictConfirmed(conflictID utxo.TransactionID) bool + func (m *MockConfirmationOracle) IsMarkerConfirmed(markers.Marker) bool + func (m *MockConfirmationOracle) IsOutputConfirmed(outputID utxo.OutputID) bool + func (m *MockConfirmationOracle) IsTransactionConfirmed(transactionID utxo.TransactionID) bool + type MockWeightProvider struct + func (m *MockWeightProvider) LoadActiveNodes(loadedActiveNodes epoch.SnapshotEpochActivity) + func (m *MockWeightProvider) Remove(ei epoch.Index, nodeID identity.ID, count uint64) (removed bool) + func (m *MockWeightProvider) Shutdown() + func (m *MockWeightProvider) SnapshotEpochActivity(ei epoch.Index) (epochActivity epoch.SnapshotEpochActivity) + func (m *MockWeightProvider) Update(ei epoch.Index, nodeID identity.ID) + func (m *MockWeightProvider) Weight(block *Block) (weight, totalWeight float64) + func (m *MockWeightProvider) WeightsOfRelevantVoters() (weights map[identity.ID]float64, totalWeight float64) + type NodeBlacklistedEvent struct + NodeID identity.ID + type NodeIdentities map[string]*identity.Identity + type OMVConsensusManager struct + func NewOMVConsensusManager(omvConsensusMechanism consensus.Mechanism) *OMVConsensusManager + type Opinion uint8 + const Confirmed + const Rejected + const UndefinedOpinion + type Option func(*Options) + func ApprovalWeights(weightProvider WeightProvider) Option + func CacheTimeProvider(cacheTimeProvider *database.CacheTimeProvider) Option + func CommitmentFunc(commitmentRetrieverFunc func() (*epoch.ECRecord, epoch.Index, error)) Option + func GenesisNode(genesisNodeBase58 string) Option + func GenesisTime(genesisTime time.Time) Option + func Identity(identity *identity.LocalIdentity) Option + func IncreaseMarkersIndexCallback(callback markers.IncreaseIndexCallback) Option + func RateSetterConfig(params RateSetterParams) Option + func SchedulerConfig(config SchedulerParams) Option + func StartSynced(startSynced bool) Option + func Store(store kvstore.KVStore) Option + func SyncTimeWindow(syncTimeWindow time.Duration) Option + func TimeSinceConfirmationThreshold(tscThreshold time.Duration) Option + func Width(width int) Option + func WithConflictDAGOptions(conflictDAGOptions ...conflictdag.Option) Option + type Options struct + CacheTimeProvider *database.CacheTimeProvider + CommitmentFunc func() (ecRecord *epoch.ECRecord, lastConfirmedEpochIndex epoch.Index, err error) + ConflictDAGOptions []conflictdag.Option + GenesisNode *ed25519.PublicKey + GenesisTime time.Time + Identity *identity.LocalIdentity + IncreaseMarkersIndexCallback markers.IncreaseIndexCallback + MeshWidth int + RateSetterParams RateSetterParams + SchedulerParams SchedulerParams + StartSynced bool + Store kvstore.KVStore + SyncTimeWindow time.Duration + TimeSinceConfirmationThreshold time.Duration + WeightProvider WeightProvider + type OrphanageManager struct + Events *OrphanageManagerEvents + func NewOrphanageManager(mesh *Mesh) *OrphanageManager + func (o *OrphanageManager) OrphanBlock(blockID BlockID, reason error) + func (o *OrphanageManager) Setup() + type OrphanageManagerEvents struct + AllChildrenOrphaned *event.Event[*Block] + BlockOrphaned *event.Event[*BlockOrphanedEvent] + type Parent struct + ID BlockID + Type ParentsType + type ParentBlockIDs map[ParentsType]BlockIDs + func NewParentBlockIDs() ParentBlockIDs + func (p ParentBlockIDs) Add(parentType ParentsType, blockID BlockID) ParentBlockIDs + func (p ParentBlockIDs) AddAll(parentType ParentsType, blockIDs BlockIDs) ParentBlockIDs + func (p ParentBlockIDs) AddStrong(blockID BlockID) ParentBlockIDs + func (p ParentBlockIDs) Clone() ParentBlockIDs + func (p ParentBlockIDs) IsEmpty() bool + type ParentsType uint8 + const ShallowLikeParentType + const StrongParentType + const UndefinedParentType + const WeakParentType + func (bp ParentsType) String() string + type Parser struct + Events *ParserEvents + func NewParser() (result *Parser) + func (p *Parser) AddBlockFilter(filter BlockFilter) + func (p *Parser) AddBytesFilter(filter BytesFilter) + func (p *Parser) Parse(blockBytes []byte, peer *peer.Peer) + func (p *Parser) Setup() + func (p *Parser) Shutdown() + type ParserEvents struct + BlockParsed *event.Event[*BlockParsedEvent] + BlockRejected *event.Event[*BlockRejectedEvent] + BytesRejected *event.Event[*BytesRejectedEvent] + type PowFilter struct + func NewPowFilter(worker *pow.Worker, difficulty int) *PowFilter + func (f *PowFilter) Filter(blkBytes []byte, p *peer.Peer) + func (f *PowFilter) OnAccept(callback func([]byte, *peer.Peer)) + func (f *PowFilter) OnReject(callback func([]byte, error, *peer.Peer)) + type PrePostStepTuple struct + Post TestStep + Pre TestStep + type QueueElement struct + Key time.Time + Value BlockID + type RateSetter struct + Events *RateSetterEvents + func NewRateSetter(mesh *Mesh) *RateSetter + func (r *RateSetter) Estimate() time.Duration + func (r *RateSetter) Issue(block *Block) error + func (r *RateSetter) Rate() float64 + func (r *RateSetter) Setup() + func (r *RateSetter) Shutdown() + func (r *RateSetter) Size() int + type RateSetterEvents struct + BlockDiscarded *event.Event[*BlockDiscardedEvent] + BlockIssued *event.Event[*BlockConstructedEvent] + Error *event.Event[error] + type RateSetterParams struct + Enabled bool + Initial float64 + RateSettingPause time.Duration + type RecentlySeenBytesFilter struct + func NewRecentlySeenBytesFilter() *RecentlySeenBytesFilter + func (r *RecentlySeenBytesFilter) Filter(bytes []byte, peer *peer.Peer) + func (r *RecentlySeenBytesFilter) OnAccept(callback func(bytes []byte, peer *peer.Peer)) + func (r *RecentlySeenBytesFilter) OnReject(callback func(bytes []byte, err error, peer *peer.Peer)) + type ReferenceProvider struct + func NewReferenceProvider(mesh *Mesh) (newInstance *ReferenceProvider) + func (r *ReferenceProvider) References(payload payload.Payload, strongParents BlockIDs, issuingTime time.Time) (references ParentBlockIDs, err error) + func (r *ReferenceProvider) ReferencesToMissingConflicts(issuingTime time.Time, amount int) (blockIDs BlockIDs) + type ReferencesFunc func(payload payload.Payload, strongParents BlockIDs, issuingTime time.Time) (references ParentBlockIDs, err error) + type RequestFailedEvent struct + BlockID BlockID + type RequestIssuedEvent struct + BlockID BlockID + type RequestStartedEvent struct + BlockID BlockID + type RequestStoppedEvent struct + BlockID BlockID + type Requester struct + Events *RequesterEvents + func NewRequester(mesh *Mesh, optionalOptions ...RequesterOption) *Requester + func (r *Requester) RequestQueueSize() int + func (r *Requester) Setup() + func (r *Requester) Shutdown() + func (r *Requester) StartRequest(id BlockID) + func (r *Requester) StopRequest(id BlockID) + type RequesterEvents struct + RequestFailed *event.Event[*RequestFailedEvent] + RequestIssued *event.Event[*RequestIssuedEvent] + RequestStarted *event.Event[*RequestStartedEvent] + RequestStopped *event.Event[*RequestStoppedEvent] + type RequesterOption func(*RequesterOptions) + func MaxRequestThreshold(maxRequestThreshold int) RequesterOption + func RetryInterval(interval time.Duration) RequesterOption + func RetryJitter(retryJitter time.Duration) RequesterOption + type RequesterOptions struct + MaxRequestThreshold int + RetryInterval time.Duration + RetryJitter time.Duration + func (r RequesterOptions) Apply(optionalOptions ...RequesterOption) (updatedOptions RequesterOptions) + type Scheduler struct + Events *SchedulerEvents + func NewScheduler(mesh *Mesh) *Scheduler + func (s *Scheduler) AccessManaCache() *schedulerutils.AccessManaCache + func (s *Scheduler) BufferSize() int + func (s *Scheduler) GetDeficit(nodeID identity.ID) *big.Rat + func (s *Scheduler) GetManaFromCache(nodeID identity.ID) int64 + func (s *Scheduler) MaxBufferSize() int + func (s *Scheduler) NodeQueueSize(nodeID identity.ID) int + func (s *Scheduler) NodeQueueSizes() map[identity.ID]int + func (s *Scheduler) Quanta(nodeID identity.ID) *big.Rat + func (s *Scheduler) Rate() time.Duration + func (s *Scheduler) Ready(blockID BlockID) (err error) + func (s *Scheduler) ReadyBlocksCount() int + func (s *Scheduler) Running() bool + func (s *Scheduler) SetRate(rate time.Duration) + func (s *Scheduler) Setup() + func (s *Scheduler) Shutdown() + func (s *Scheduler) Start() + func (s *Scheduler) Submit(blockID BlockID) (err error) + func (s *Scheduler) SubmitAndReady(block *Block) (err error) + func (s *Scheduler) TotalBlocksCount() int + func (s *Scheduler) Unsubmit(blockID BlockID) (err error) + type SchedulerEvents struct + BlockDiscarded *event.Event[*BlockDiscardedEvent] + BlockScheduled *event.Event[*BlockScheduledEvent] + BlockSkipped *event.Event[*BlockSkippedEvent] + Error *event.Event[error] + NodeBlacklisted *event.Event[*NodeBlacklistedEvent] + func NewSchedulerEvents() (new *SchedulerEvents) + type SchedulerParams struct + AccessManaMapRetrieverFunc func() map[identity.ID]float64 + ConfirmedBlockScheduleThreshold time.Duration + MaxBufferSize int + Rate time.Duration + TotalAccessManaRetrieveFunc func() float64 + TotalSupply int + type SimpleMockOnMeshVoting struct + func (o *SimpleMockOnMeshVoting) ConflictLiked(conflictID utxo.TransactionID) (conflictLiked bool) + func (o *SimpleMockOnMeshVoting) LikedConflictMember(conflictID utxo.TransactionID) (likedConflictID utxo.TransactionID, conflictMembers utxo.TransactionIDs) + type Solidifier struct + Events *SolidifierEvents + func NewSolidifier(mesh *Mesh) (solidifier *Solidifier) + func (s *Solidifier) RetrieveMissingBlock(blockID BlockID) (blockWasMissing bool) + func (s *Solidifier) Setup() + func (s *Solidifier) Solidify(blockID BlockID) + type SolidifierEvents struct + BlockMissing *event.Event[*BlockMissingEvent] + BlockSolid *event.Event[*BlockSolidEvent] + type Storage struct + Events *StorageEvents + func NewStorage(mesh *Mesh) (storage *Storage) + func (s *Storage) AllLatestMarkerVotes(sequenceID markers.SequenceID) (cachedLatestMarkerVotesByVoter CachedLatestMarkerVotesByVoter) + func (s *Storage) AttachmentBlockIDs(transactionID utxo.TransactionID) (blockIDs BlockIDs) + func (s *Storage) Attachments(transactionID utxo.TransactionID) (cachedAttachments objectstorage.CachedObjects[*Attachment]) + func (s *Storage) Block(blockID BlockID) *objectstorage.CachedObject[*Block] + func (s *Storage) BlockMetadata(blockID BlockID, computeIfAbsentCallback ...func() *BlockMetadata) *objectstorage.CachedObject[*BlockMetadata] + func (s *Storage) Children(blockID BlockID, optionalChildType ...ChildType) (cachedChildren objectstorage.CachedObjects[*Child]) + func (s *Storage) ConflictVoters(conflictID utxo.TransactionID, ...) *objectstorage.CachedObject[*ConflictVoters] + func (s *Storage) ConflictWeight(conflictID utxo.TransactionID, ...) *objectstorage.CachedObject[*ConflictWeight] + func (s *Storage) DBStats() (res DBStatsResult) + func (s *Storage) DeleteBlock(blockID BlockID) + func (s *Storage) DeleteMarkerBlockMapping(conflictID utxo.TransactionID, blockID BlockID) + func (s *Storage) DeleteMissingBlock(blockID BlockID) + func (s *Storage) IsTransactionAttachedByBlock(transactionID utxo.TransactionID, blockID BlockID) (attached bool) + func (s *Storage) LatestConflictVotes(voter Voter, computeIfAbsentCallback ...func(voter Voter) *LatestConflictVotes) *objectstorage.CachedObject[*LatestConflictVotes] + func (s *Storage) LatestMarkerVotes(sequenceID markers.SequenceID, voter Voter, ...) *objectstorage.CachedObject[*LatestMarkerVotes] + func (s *Storage) MarkerBlockMapping(marker markers.Marker) (cachedMarkerBlockMappings *objectstorage.CachedObject[*MarkerBlockMapping]) + func (s *Storage) MarkerBlockMappings(sequenceID markers.SequenceID) (cachedMarkerBlockMappings objectstorage.CachedObjects[*MarkerBlockMapping]) + func (s *Storage) MarkerIndexConflictIDMapping(sequenceID markers.SequenceID, ...) *objectstorage.CachedObject[*MarkerIndexConflictIDMapping] + func (s *Storage) MissingBlocks() (ids []BlockID) + func (s *Storage) Prune() error + func (s *Storage) RetrieveAllTips() (tips []BlockID) + func (s *Storage) Setup() + func (s *Storage) Shutdown() + func (s *Storage) StoreAttachment(transactionID utxo.TransactionID, blockID BlockID) (cachedAttachment *objectstorage.CachedObject[*Attachment], stored bool) + func (s *Storage) StoreBlock(block *Block) + func (s *Storage) StoreMarkerBlockMapping(markerBlockMapping *MarkerBlockMapping) + func (s *Storage) StoreMissingBlock(missingBlock *MissingBlock) (cachedMissingBlock *objectstorage.CachedObject[*MissingBlock], stored bool) + type StorageEvents struct + BlockRemoved *event.Event[*BlockRemovedEvent] + BlockStored *event.Event[*BlockStoredEvent] + MissingBlockStored *event.Event[*MissingBlockStoredEvent] + type SyncChangedEvent struct + Synced bool + type TestScenario struct + Mesh *Mesh + PostStep TestStep + Steps []TestStep + TestFramework *BlockTestFramework + func ProcessBlockScenario(t *testing.T, options ...Option) *TestScenario + func ProcessBlockScenario2(t *testing.T, options ...Option) *TestScenario + func (s *TestScenario) Cleanup(t *testing.T) error + func (s *TestScenario) HasNext() bool + func (s *TestScenario) Next(prePostStepTuple *PrePostStepTuple) + func (s *TestScenario) Setup(t *testing.T) error + type TestStep func(t *testing.T, testFramework *BlockTestFramework, testEventMock *EventMock, ...) + type TimeManager struct + Events *TimeManagerEvents + func NewTimeManager(mesh *Mesh) *TimeManager + func (t *TimeManager) ATT() time.Time + func (t *TimeManager) ActivityTime() time.Time + func (t *TimeManager) Bootstrapped() bool + func (t *TimeManager) CTT() time.Time + func (t *TimeManager) LastAcceptedBlock() LastBlock + func (t *TimeManager) LastConfirmedBlock() LastBlock + func (t *TimeManager) RATT() time.Time + func (t *TimeManager) RCTT() time.Time + func (t *TimeManager) Setup() + func (t *TimeManager) Shutdown() + func (t *TimeManager) Start() + func (t *TimeManager) Synced() bool + type TimeManagerEvents struct + AcceptanceTimeUpdated *event.Event[*TimeUpdate] + Bootstrapped *event.Event[*BootstrappedEvent] + ConfirmedTimeUpdated *event.Event[*TimeUpdate] + SyncChanged *event.Event[*SyncChangedEvent] + type TimeRetrieverFunc func() time.Time + type TimeUpdate struct + ATT time.Time + BlockID BlockID + UpdateTime time.Time + type TimedHeap []*QueueElement + func (h *TimedHeap) Pop() interface{} + func (h *TimedHeap) Push(x interface{}) + func (h TimedHeap) Len() int + func (h TimedHeap) Less(i, j int) bool + func (h TimedHeap) Swap(i, j int) + type TipEvent struct + BlockID BlockID + type TipManager struct + Events *TipManagerEvents + func NewTipManager(mesh *Mesh, tips ...BlockID) *TipManager + func (t *TipManager) AddTip(block *Block) + func (t *TipManager) AllTips() BlockIDs + func (t *TipManager) Setup() + func (t *TipManager) Shutdown() + func (t *TipManager) TipCount() int + func (t *TipManager) Tips(p payload.Payload, countParents int) (parents BlockIDs) + type TipManagerEvents struct + TipAdded *event.Event[*TipEvent] + TipRemoved *event.Event[*TipEvent] + type TipSelector interface + Tips func(p payload.Payload, countParents int) (parents BlockIDs) + type TipSelectorFunc func(p payload.Payload, countParents int) (parents BlockIDs) + func (f TipSelectorFunc) Tips(p payload.Payload, countParents int) (parents BlockIDs) + type TipsCleaner struct + func (t *TipsCleaner) Add(key time.Time, value BlockID) + func (t *TipsCleaner) RemoveBefore(minAllowedTime time.Time) + type TipsConflictTracker struct + func NewTipsConflictTracker(mesh *Mesh) *TipsConflictTracker + func (c *TipsConflictTracker) AddTip(blockID BlockID) + func (c *TipsConflictTracker) MissingConflicts(amount int) (missingConflicts utxo.TransactionIDs) + func (c *TipsConflictTracker) RemoveTip(blockID BlockID) + func (c *TipsConflictTracker) Setup() + type TransactionFilter struct + func NewTransactionFilter() *TransactionFilter + func (f *TransactionFilter) Close() error + func (f *TransactionFilter) Filter(blk *Block, peer *peer.Peer) + func (f *TransactionFilter) OnAccept(callback func(blk *Block, peer *peer.Peer)) + func (f *TransactionFilter) OnReject(callback func(blk *Block, err error, peer *peer.Peer)) + type Utils struct + func NewUtils(mesh *Mesh) (utils *Utils) + func (u *Utils) AllConflictsLiked(conflictIDs *set.AdvancedSet[utxo.TransactionID]) bool + func (u *Utils) ApprovingBlockIDs(blockID BlockID, optionalChildType ...ChildType) (approvingBlockIDs BlockIDs) + func (u *Utils) ComputeIfTransaction(blockID BlockID, compute func(utxo.TransactionID)) (computed bool) + func (u *Utils) ConfirmedConsumer(outputID utxo.OutputID) (consumerID utxo.TransactionID) + func (u *Utils) FirstAttachment(transactionID utxo.TransactionID) (oldestAttachmentTime time.Time, oldestAttachmentBlockID BlockID, err error) + func (u *Utils) WalkBlock(callback func(block *Block, walker *walker.Walker[BlockID]), ...) + func (u *Utils) WalkBlockAndMetadata(...) + func (u *Utils) WalkBlockID(callback func(blockID BlockID, walker *walker.Walker[BlockID]), ...) + func (u *Utils) WalkBlockMetadata(callback func(blockMetadata *BlockMetadata, walker *walker.Walker[BlockID]), ...) + type VotePower = uint64 + type Voter = identity.ID + type Voters struct + func NewVoters() (voters *Voters) + func (v *Voters) AddAll(voters *Voters) + func (v *Voters) Clone() (clonedVoters *Voters) + func (v *Voters) Decode(data []byte) (bytesRead int, err error) + func (v *Voters) Intersect(other *Voters) (intersection *Voters) + func (v *Voters) String() string + type WeightProvider interface + LoadActiveNodes func(loadedActiveNodes epoch.SnapshotEpochActivity) + Remove func(ei epoch.Index, nodeID identity.ID, decreaseBy uint64) (removed bool) + Shutdown func() + SnapshotEpochActivity func(epochDiffIndex epoch.Index) (epochActivity epoch.SnapshotEpochActivity) + Update func(ei epoch.Index, nodeID identity.ID) + Weight func(block *Block) (weight, totalWeight float64) + WeightsOfRelevantVoters func() (weights map[identity.ID]float64, totalWeight float64) + type Worker interface + DoPOW func([]byte) (nonce uint64, err error) + type WorkerFunc func([]byte) (uint64, error) + func (f WorkerFunc) DoPOW(blk []byte) (uint64, error)