activity

package
v0.0.0-...-ae0dd77 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityExtractor       = "activity.extractor"
	ActivityLoader          = "activity.loader"
	ActivitySyncer          = "activity.syncer"
	ActivityLivenessCheck   = "activity.liveness_check"
	ActivityReader          = "activity.reader"
	ActivityValidator       = "activity.validator"
	ActivityStreamer        = "activity.streamer"
	ActivityCrossValidator  = "activity.cross_validator"
	ActivityEventReader     = "activity.event_reader"
	ActivityEventReconciler = "activity.event_reconciler"
	ActivityEventLoader     = "activity.event_loader"
	ActivityReplicator      = "activity.replicator"
	ActivityUpdateWatermark = "activity.update_watermark"
)

Variables

View Source
var (
	ErrDownloadFailure = xerrors.New("download failure")
)

Functions

func IsCanceledError

func IsCanceledError(err error) bool

Types

type BlockValidation

type BlockValidation struct {
	Height   uint64
	Metadata *api.BlockMetadata
}

type CrossValidator

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

func NewCrossValidator

func NewCrossValidator(params CrossValidatorParams) *CrossValidator

func (*CrossValidator) Execute

type CrossValidatorParams

type CrossValidatorParams struct {
	fx.In
	fxparams.Params
	Runtime         cadence.Runtime
	ValidatorClient client.Client `name:"validator"`
	MetaStorage     metastorage.MetaStorage
	StorageClient   blobstorage.BlobStorage
	Parser          parser.Parser
}

type CrossValidatorRequest

type CrossValidatorRequest struct {
	Tag                     uint32 `validate:"required"`
	StartHeight             uint64
	ValidationHeightPadding uint64 `validate:"required"`
	MaxHeightsToValidate    uint64 `validate:"required"`
	Parallelism             int    `validate:"required,gt=0"`
}

type CrossValidatorResponse

type CrossValidatorResponse struct {
	EndHeight uint64
	BlockGap  uint64
}

type EventLoader

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

func NewEventLoader

func NewEventLoader(params EventLoaderParams) *EventLoader

func (*EventLoader) Execute

type EventLoaderParams

type EventLoaderParams struct {
	fx.In
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type EventLoaderRequest

type EventLoaderRequest struct {
	EventTag uint32 `validate:"required"`
	Events   []*model.EventEntry
}

type EventLoaderResponse

type EventLoaderResponse struct {
}

type EventReader

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

func NewEventReader

func NewEventReader(params EventReaderParams) *EventReader

func (*EventReader) Execute

type EventReaderParams

type EventReaderParams struct {
	fx.In
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type EventReaderRequest

type EventReaderRequest struct {
	EventTag      uint32
	StartSequence uint64
	EndSequence   uint64
	LatestEvent   bool
}

type EventReaderResponse

type EventReaderResponse struct {
	// Eventdata is set to nil if event does not exist in meta storage
	Eventdata []*model.EventEntry
}

type EventReconciler

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

func NewEventReconciler

func NewEventReconciler(params EventReconcilerParams) *EventReconciler

func (*EventReconciler) Execute

type EventReconcilerParams

type EventReconcilerParams struct {
	fx.In
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type EventReconcilerRequest

type EventReconcilerRequest struct {
	Tag                 uint32 `validate:"required"`
	EventTag            uint32 `validate:"required"`
	UpgradeFromEventTag uint32
	UpgradeFromEvents   []*model.EventEntry
}

type EventReconcilerResponse

type EventReconcilerResponse struct {
	Eventdata []*model.EventEntry
}

type Extractor

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

func NewExtractor

func NewExtractor(params ExtractorParams) *Extractor

func (*Extractor) Execute

func (a *Extractor) Execute(ctx workflow.Context, request *ExtractorRequest) (*ExtractorResponse, error)

type ExtractorParams

type ExtractorParams struct {
	fx.In
	Runtime          cadence.Runtime
	BlockchainClient client.Client `name:"slave"`
	BlobStorage      blobstorage.BlobStorage
	MetaStorage      metastorage.MetaStorage
	FailoverManager  endpoints.FailoverManager
}

type ExtractorRequest

type ExtractorRequest struct {
	Tag              uint32 `validate:"required"`
	Heights          []uint64
	WithBestEffort   bool
	RehydrateFromTag *uint32
	UpgradeFromTag   *uint32
	DataCompression  api.Compression
	Failover         bool
}

type ExtractorResponse

type ExtractorResponse struct {
	Metadatas []*api.BlockMetadata
}

type Heartbeater

type Heartbeater interface {
	RecordHeartbeat(ctx context.Context, details ...any)
}

func NewHeartbeater

func NewHeartbeater() Heartbeater

func NewNopHeartbeater

func NewNopHeartbeater() Heartbeater

type LivenessCheck

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

func NewLivenessCheck

func NewLivenessCheck(params LivenessCheckParams) *LivenessCheck

func (*LivenessCheck) Execute

type LivenessCheckParams

type LivenessCheckParams struct {
	fx.In
	fxparams.Params
	Runtime                cadence.Runtime
	MasterBlockchainClient client.Client `name:"master"`
	FailoverManager        endpoints.FailoverManager
}

type LivenessCheckRequest

type LivenessCheckRequest struct {
	Tag                    uint32        `validate:"required"`
	Failover               bool          // Failover will switch master to failover clusters.
	LivenessCheckThreshold time.Duration // LivenessCheckThreshold is the threshold to check if the last block is too old in nodes.
}

type LivenessCheckResponse

type LivenessCheckResponse struct {
	LivenessCheckViolation bool
}

type Loader

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

func NewLoader

func NewLoader(params LoaderParams) *Loader

func (*Loader) Execute

func (a *Loader) Execute(ctx workflow.Context, request *LoaderRequest) (*LoaderResponse, error)

type LoaderParams

type LoaderParams struct {
	fx.In
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type LoaderRequest

type LoaderRequest struct {
	Metadata        []*api.BlockMetadata `validate:"required"`
	LastBlock       *api.BlockMetadata
	UpdateWatermark bool
}

type LoaderResponse

type LoaderResponse struct {
}

type Reader

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

func NewReader

func NewReader(params ReaderParams) *Reader

func (*Reader) Execute

func (a *Reader) Execute(ctx workflow.Context, request *ReaderRequest) (*ReaderResponse, error)

type ReaderParams

type ReaderParams struct {
	fx.In
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type ReaderRequest

type ReaderRequest struct {
	Tag         uint32 `validate:"required"`
	Height      uint64
	LatestBlock bool
}

type ReaderResponse

type ReaderResponse struct {
	// Metadata is set to nil if the block does not exist in meta storage.
	Metadata *api.BlockMetadata
}

type Replicator

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

func NewReplicator

func NewReplicator(params ReplicatorParams) *Replicator

func (*Replicator) Execute

func (a *Replicator) Execute(ctx workflow.Context, request *ReplicatorRequest) (*ReplicatorResponse, error)

type ReplicatorParams

type ReplicatorParams struct {
	fx.In
	fxparams.Params
	Runtime         cadence.Runtime
	Client          gateway.Client
	BlockDownloader downloader.BlockDownloader
	MetaStorage     metastorage.MetaStorage
	BlobStorage     blobstorage.BlobStorage
}

type ReplicatorRequest

type ReplicatorRequest struct {
	Tag         uint32
	StartHeight uint64
	EndHeight   uint64
	Parallelism int
	Compression api.Compression
}

type ReplicatorResponse

type ReplicatorResponse struct {
	StartHeight uint64
	EndHeight   uint64
}

type Streamer

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

func NewStreamer

func NewStreamer(params StreamerParams) *Streamer

func (*Streamer) Execute

func (s *Streamer) Execute(ctx workflow.Context, request *StreamerRequest) (*StreamerResponse, error)

type StreamerMetrics

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

type StreamerParams

type StreamerParams struct {
	fx.In
	fxparams.Params
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type StreamerRequest

type StreamerRequest struct {
	BatchSize             uint64 `validate:"required"`
	Tag                   uint32 `validate:"required"`
	MaxAllowedReorgHeight uint64
	EventTag              uint32
}

type StreamerResponse

type StreamerResponse struct {
	LatestStreamedHeight uint64
	Gap                  uint64
	EventTag             uint32
	TimeSinceLastBlock   time.Duration
}

type Syncer

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

func NewSyncer

func NewSyncer(params SyncerParams) *Syncer

func (*Syncer) Execute

func (a *Syncer) Execute(ctx workflow.Context, request *SyncerRequest) (*SyncerResponse, error)

type SyncerParams

type SyncerParams struct {
	fx.In
	fxparams.Params
	Runtime          cadence.Runtime
	Heartbeater      Heartbeater
	MetaStorage      metastorage.MetaStorage
	BlobStorage      blobstorage.BlobStorage
	BlockchainClient client.ClientParams
	FailoverManager  endpoints.FailoverManager
}

type SyncerRequest

type SyncerRequest struct {
	Tag                          uint32 `validate:"required"`
	MinStartHeight               uint64
	MaxBlocksToSync              uint64 `validate:"required"`
	Parallelism                  int    `validate:"required"`
	DataCompression              api.Compression
	Failover                     bool   // Failover will switch master/slave to failover clusters.
	ConsensusFailover            bool   // ConsensusFailover will switch consensus client to failover clusters.
	FastSync                     bool   // FastSync should be enabled if the chain has no reorg.
	IrreversibleDistance         uint64 // A reorg will be rejected if it exceeds this distance.
	NumBlocksToSkip              uint64 // Skip the last N blocks to work around syncing delays in the nodes.
	TransactionsWriteParallelism int    // Parallelism set to the concurrency of adding/updating transactions table, it is also the feature flag to enable transaction processing if value > 0.
	ConsensusValidation          bool   // ConsensusValidation is a feature flag to enable consensus layer validation.
	ConsensusValidationMuted     bool   // ConsensusValidationMuted is a feature flag to mute consensus layer validation failures.
}

type SyncerResponse

type SyncerResponse struct {
	LatestSyncedHeight uint64
	SyncGap            uint64
	TimeSinceLastBlock time.Duration
}

type UpdateWatermark

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

func NewUpdateWatermark

func NewUpdateWatermark(params UpdateWatermarkParams) *UpdateWatermark

func (*UpdateWatermark) Execute

type UpdateWatermarkParams

type UpdateWatermarkParams struct {
	fx.In
	fxparams.Params
	Runtime     cadence.Runtime
	MetaStorage metastorage.MetaStorage
}

type UpdateWatermarkRequest

type UpdateWatermarkRequest struct {
	Tag         uint32
	BlockHeight uint64
	// validate the chain starting from this block (inclusive)
	ValidateStart uint64
}

type UpdateWatermarkResponse

type UpdateWatermarkResponse struct {
	BlockHeight uint64
}

type Validator

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

func NewValidator

func NewValidator(params ValidatorParams) *Validator

func (*Validator) Execute

func (v *Validator) Execute(ctx workflow.Context, request *ValidatorRequest) (*ValidatorResponse, error)

type ValidatorParams

type ValidatorParams struct {
	fx.In
	fxparams.Params
	Runtime         cadence.Runtime
	MetaStorage     metastorage.MetaStorage
	Client          client.ClientParams
	Parser          parser.Parser
	StorageClient   blobstorage.BlobStorage
	FailoverManager endpoints.FailoverManager
}

type ValidatorRequest

type ValidatorRequest struct {
	Tag                     uint32 `validate:"required"`
	StartHeight             uint64
	ValidationHeightPadding uint64 `validate:"required"`
	MaxHeightsToValidate    uint64 `validate:"required"`
	StartEventId            int64
	MaxEventsToValidate     uint64 `validate:"required"`
	Parallelism             int    `validate:"required,gt=0"`
	EventTag                uint32
	Failover                bool
}

type ValidatorResponse

type ValidatorResponse struct {
	LastValidatedHeight      uint64
	BlockGap                 uint64
	LastValidatedEventId     int64
	LastValidatedEventHeight uint64
	EventGap                 int64
	EventTag                 uint32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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