processor

package
v0.0.0-...-753386a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Overview

nolint:unparam // this will be refactored in https://github.com/wormhole-foundation/wormhole/pull/1953

Index

Constants

This section is empty.

Variables

View Source
var CleanupInterval = time.Second * 30
View Source
var (
	FirstRetryMinWait = time.Minute * 5
)
View Source
var GovInterval = time.Minute

Functions

func GetFeatures

func GetFeatures() string

GetFeatures returns the processor feature string that can be published in heartbeat messages.

Types

type Observation

type Observation interface {
	// GetEmitterChain returns the id of the chain where this event was observed.
	GetEmitterChain() vaa.ChainID
	// MessageID returns a human-readable emitter_chain/emitter_address/sequence tuple.
	MessageID() string
	// SigningDigest returns the hash of the hash signing body of the observation. This is used
	// for signature generation and verification.
	SigningDigest() ethcommon.Hash
	// IsReliable returns whether this message is considered reliable meaning it can be reobserved.
	IsReliable() bool
	// IsReobservation returns whether this message is the result of a reobservation request.
	IsReobservation() bool
	// HandleQuorum finishes processing the observation once a quorum of signatures have
	// been received for it.
	HandleQuorum(sigs []*vaa.Signature, hash string, p *Processor)
}

Observation defines the interface for any events observed by the guardian.

type Processor

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

func NewProcessor

func NewProcessor(
	ctx context.Context,
	db *db.Database,
	msgC <-chan *common.MessagePublication,
	setC <-chan *common.GuardianSet,
	gossipAttestationSendC chan<- []byte,
	gossipVaaSendC chan<- []byte,
	obsvC chan *common.MsgWithTimeStamp[gossipv1.SignedObservation],
	batchObsvC <-chan *common.MsgWithTimeStamp[gossipv1.SignedObservationBatch],
	obsvReqSendC chan<- *gossipv1.ObservationRequest,
	signedInC <-chan *gossipv1.SignedVAAWithQuorum,
	guardianSigner guardiansigner.GuardianSigner,
	gst *common.GuardianSetState,
	g *governor.ChainGovernor,
	acct *accountant.Accountant,
	acctReadC <-chan *common.MessagePublication,
	gatewayRelayer *gwrelayer.GatewayRelayer,
	networkID string,
) *Processor

func (*Processor) Run

func (p *Processor) Run(ctx context.Context) error

type PythNetVaaEntry

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

type VAA

type VAA struct {
	vaa.VAA
	Unreliable    bool
	Reobservation bool
}

func (*VAA) HandleQuorum

func (v *VAA) HandleQuorum(sigs []*vaa.Signature, hash string, p *Processor)

HandleQuorum is called when a VAA reaches quorum. It publishes the VAA to the gossip network and stores it in the database.

func (*VAA) IsReliable

func (v *VAA) IsReliable() bool

func (*VAA) IsReobservation

func (v *VAA) IsReobservation() bool

Jump to

Keyboard shortcuts

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