destinationreader

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// OffRampContractID is the Stellar contract address of the OffRamp.
	OffRampContractID string `toml:"offramp_contract_id"`
	// RMNRemoteContractID is the Stellar contract address of the RMN Remote.
	RMNRemoteContractID string `toml:"rmn_remote_contract_id"`
}

Config is the configuration required to create a Stellar destination reader.

type DestinationReader

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

DestinationReader reads execution state and CCV data from the Stellar OffRamp contract.

func New

func New(
	invoker bindings.Invoker,
	rpcClient *rpcclient.Client,
	offRampContractID string,
	rmnRemoteContractID string,
	lggr *zerolog.Logger,
	attemptCacheExpiration time.Duration,
) (*DestinationReader, error)

New creates a new Stellar DestinationReader.

func (*DestinationReader) CheckHealth

func (d *DestinationReader) CheckHealth(chain protocol.ChainSelector) error

CheckHealth implements chainaccess.DestinationReader. Currently always returns nil. TODO: Implement this.

func (*DestinationReader) Close

func (d *DestinationReader) Close() error

Close implements services.Service.

func (*DestinationReader) GetCCVSForMessage

func (d *DestinationReader) GetCCVSForMessage(ctx context.Context, message protocol.Message) (protocol.CCVAddressInfo, error)

GetCCVSForMessage returns the cross-chain verification addresses for the message. It queries the OffRamp's source chain config to determine which CCVs are required (lane-mandated) and which are optional (defaults). The Stellar OffRamp quorum logic requires all lane-mandated CCVs plus at least one default CCV to verify.

func (*DestinationReader) GetExecutionAttempts

func (d *DestinationReader) GetExecutionAttempts(ctx context.Context, message protocol.Message) ([]protocol.ExecutionAttempt, error)

GetExecutionAttempts retrieves execution attempts for the given message from the poller cache.

func (*DestinationReader) GetMessageSuccess

func (d *DestinationReader) GetMessageSuccess(ctx context.Context, message protocol.Message) (bool, error)

GetMessageSuccess queries the OffRamp contract for the execution state of a message and returns true if the message has been successfully executed.

func (*DestinationReader) GetRMNCursedSubjects

func (d *DestinationReader) GetRMNCursedSubjects(ctx context.Context) ([]protocol.Bytes16, error)

GetRMNCursedSubjects queries the RMN Remote contract for cursed subjects.

func (*DestinationReader) HasHonestAttempt

func (d *DestinationReader) HasHonestAttempt(ctx context.Context, message protocol.Message, verifierResults []protocol.VerifierResult, ccvAddressInfo protocol.CCVAddressInfo) (bool, error)

HasHonestAttempt implements chainaccess.DestinationReader. Currently always returns false. Returning false means that the offchain will attempt to submit an execution attempt for this message. TODO: Implement this.

func (*DestinationReader) HealthReport

func (d *DestinationReader) HealthReport() map[string]error

HealthReport implements services.Service.

func (*DestinationReader) IsReady

func (d *DestinationReader) IsReady(chain protocol.ChainSelector) bool

IsReady implements chainaccess.DestinationReader. Currently always returns true. TODO: Implement this.

func (*DestinationReader) Name

func (d *DestinationReader) Name() string

Name implements services.Service.

func (*DestinationReader) Ready

func (d *DestinationReader) Ready() error

Ready implements services.Service.

func (*DestinationReader) Start

func (d *DestinationReader) Start(ctx context.Context) error

Start implements services.Service.

type StellarExecutionAttemptPoller

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

StellarExecutionAttemptPoller polls for ExecutionStateChanged events on the Stellar offramp contract and caches the decoded execution attempts by message ID.

func NewStellarExecutionAttemptPoller

func NewStellarExecutionAttemptPoller(
	rpcClient *rpcclient.Client,
	offrampContractID string,
	lggr *zerolog.Logger,
	attemptCacheExpiration time.Duration,
) (*StellarExecutionAttemptPoller, error)

NewStellarExecutionAttemptPoller creates a new execution attempt poller for the Stellar offramp. On startup the poller performs a backfill over the lookback window, then continues polling for new events at the configured interval.

func (*StellarExecutionAttemptPoller) Close

Close stops the poller and waits for the background goroutine to exit.

func (*StellarExecutionAttemptPoller) GetExecutionAttempts

GetExecutionAttempts retrieves cached execution attempts for the given message.

func (*StellarExecutionAttemptPoller) HealthReport

func (p *StellarExecutionAttemptPoller) HealthReport() map[string]error

func (*StellarExecutionAttemptPoller) Name

func (*StellarExecutionAttemptPoller) Start

Start calculates the start ledger, runs an initial backfill, and begins the background polling loop.

Jump to

Keyboard shortcuts

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