processor

package
v0.0.0-...-7be3494 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

nolint:unparam // this will be refactored in https://github.com/deltaswapio/deltaswap/pull/1953

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

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 phylax.

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.PhylaxSet,
	gossipSendC chan<- []byte,
	obsvC chan *common.MsgWithTimeStamp[gossipv1.SignedObservation],
	obsvReqSendC chan<- *gossipv1.ObservationRequest,
	signedInC <-chan *gossipv1.SignedVAAWithQuorum,
	gk *ecdsa.PrivateKey,
	gst *common.PhylaxSetState,
	g *governor.ChainGovernor,
	acct *accountant.Accountant,
	acctReadC <-chan *common.MessagePublication,
	gatewayRelayer *gwrelayer.GatewayRelayer,
) *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)

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