tracker

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopSealingTracker

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

func (*NoopSealingTracker) ApprovalsRequested

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

func (*NoopSealingTracker) Complete

func (t *NoopSealingTracker) Complete()

func (*NoopSealingTracker) NewSealingObservation

func (*NoopSealingTracker) QualifiesForEmergencySealing

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

type Rec

type Rec map[string]interface{}

type SealingObservation

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

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

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

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

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

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

func (*SealingRecord) ApprovalsRequested

func (r *SealingRecord) ApprovalsRequested(requestCount uint)

func (*SealingRecord) Generate

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

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

func (*SealingRecord) QualifiesForEmergencySealing

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

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