tracker

package
v0.38.0-preview.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: AGPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopSealingTracker added in v0.18.3

type NoopSealingTracker struct{}

NoopSealingTracker implements the sealing.SealingTracker and sealing.SealingObservation interfaces. By using the same instance, we avoid GC overhead. All methods are essentially NoOps.

func (*NoopSealingTracker) ApprovalsMissing added in v0.18.3

func (*NoopSealingTracker) ApprovalsRequested added in v0.18.3

func (t *NoopSealingTracker) ApprovalsRequested(*flow.IncorporatedResult, uint)

func (*NoopSealingTracker) Complete added in v0.18.3

func (t *NoopSealingTracker) Complete()

func (*NoopSealingTracker) NewSealingObservation added in v0.18.3

func (*NoopSealingTracker) QualifiesForEmergencySealing added in v0.18.3

func (t *NoopSealingTracker) QualifiesForEmergencySealing(*flow.IncorporatedResult, bool)

type Rec added in v0.18.3

type Rec map[string]interface{}

type SealingObservation added in v0.18.3

type SealingObservation struct {
	*SealingTracker
	// contains filtered or unexported fields
}

SealingObservation captures information about the progress of a _single_ go routine. Consequently, it is _not concurrency safe_, as SealingObservation is intended to be a thread-local structure. SealingObservation is supposed to track the status of various (unsealed) incorporated results, which sealing.Core processes (driven by that single goroutine).

func (*SealingObservation) ApprovalsMissing added in v0.18.3

func (st *SealingObservation) ApprovalsMissing(ir *flow.IncorporatedResult, chunksWithMissingApprovals map[uint64]flow.IdentifierList)

ApprovalsMissing captures whether sealing.Core has determined that some approvals are still missing for the incorporated result. Calling this method with empty `chunksWithMissingApprovals` indicates that all chunks have sufficient approvals.

func (*SealingObservation) ApprovalsRequested added in v0.18.3

func (st *SealingObservation) ApprovalsRequested(ir *flow.IncorporatedResult, requestCount uint)

ApprovalsRequested captures the number of approvals that the business logic has re-requested for the incorporated result.

func (*SealingObservation) Complete added in v0.18.3

func (st *SealingObservation) Complete()

Complete is supposed to be called when a single execution of the sealing logic has been completed. It compiles the information about the incorporated results.

func (*SealingObservation) QualifiesForEmergencySealing added in v0.18.3

func (st *SealingObservation) QualifiesForEmergencySealing(ir *flow.IncorporatedResult, emergencySealable bool)

QualifiesForEmergencySealing captures whether sealing.Core has determined that the incorporated result qualifies for emergency sealing.

type SealingRecord

type SealingRecord struct {
	*SealingObservation

	// the incorporated result whose sealing status is tracked
	IncorporatedResult *flow.IncorporatedResult
	// contains filtered or unexported fields
}

SealingRecord is a record of the sealing status for a specific incorporated result. It holds information whether the result is sealable, or what is missing to be sealable. Not concurrency safe.

func (*SealingRecord) ApprovalsMissing added in v0.18.3

func (r *SealingRecord) ApprovalsMissing(chunksWithMissingApprovals map[uint64]flow.IdentifierList)

func (*SealingRecord) ApprovalsRequested added in v0.18.3

func (r *SealingRecord) ApprovalsRequested(requestCount uint)

func (*SealingRecord) Generate added in v0.18.3

func (r *SealingRecord) Generate() (Rec, error)

Generate generates a key-value map capturing the application-submitted data plus auxiliary data.

func (*SealingRecord) QualifiesForEmergencySealing added in v0.18.3

func (r *SealingRecord) QualifiesForEmergencySealing(emergencySealable bool)

type SealingTracker

type SealingTracker struct {
	// contains filtered or unexported fields
}

SealingTracker is an auxiliary component for tracking progress of the sealing logic (specifically sealing.Core). It has access to the storage, to collect data that is not be available directly from sealing.Core. The SealingTracker is immutable and therefore intrinsically thread safe.

The SealingTracker essentially acts as a factory for individual SealingObservations, which capture information about the progress of a _single_ go routine. Consequently, SealingObservations don't need to be concurrency safe, as they are supposed to be thread-local structure.

func NewSealingTracker

func NewSealingTracker(log zerolog.Logger, headersDB storage.Headers, receiptsDB storage.ExecutionReceipts, sealsPl mempool.IncorporatedResultSeals) *SealingTracker

func (*SealingTracker) NewSealingObservation added in v0.18.3

func (st *SealingTracker) NewSealingObservation(finalizedBlock *flow.Header, seal *flow.Seal, sealedBlock *flow.Header) consensus.SealingObservation

NewSealingObservation constructs a SealingObservation, which capture information about the progress of a _single_ go routine. Consequently, SealingObservations don't need to be concurrency safe, as they are supposed to be thread-local structure.

Jump to

Keyboard shortcuts

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