ccip

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 20 Imported by: 0

README

The code herein is the gRPC wrapper for the CCIP Reporting Plugin Providers

Developing the CCIP Providers requires the follow workflow

  1. Update the golang interfaces in plugin-common/pkg/types, and/or plugin-common/pkg/types/ccip

  2. Mirror those changes as protobuf changes in plugin-common/pkg/loop/internal/pb/ccip note: golang interface <-> gRPC service and struct <-> message remember to run make generate at the top of the repo to generate your changes see docs in internal/pb for more details

  3. If you are adding a new interface, create a file here and implement the gRPC server and client. Follow the testing pattern in the test subdir to ensure roundtrip de/serialization of each and every rpc

  4. If you are updating an interface, then update both the <Interface>GRPCClient and <Interface>GRPCServer in the relevant file.

    • The client code will not compile if you change the interface in plugin-common/pkg/types/ccip and so these are obvious
    • However the server code will compile and you will receive runtime Unimplemented errors (this is a consequence of golang gRPC best practices that embed a UnimplementedServer. the curious reader can go here)
    • Add support for your new method in the static test implementation found in test and add a test case to the roundTrip test for that interface. This roundtrip test is the key to prevent runtime Unimplemented errors
  5. Update the ccip repo with your commit: go get github.com/goplugin/plugin-common@<commit_hash>

    • A useful technique to co-develop changes in plugin-common with ccip (or any other dependent repo) is to use go workspace. A go workspace effectively short circuits the go.mod to use local repos configured by the workspace definition. Ex:
    sh
    make ccip-common-workspace
    cd ccip-common-workspace
    git clone https://github.com/smartcontractkit/ccip.git
    git clone https://github.com/goplugin/plugin-common.git
    go work init
    go work use ccip
    go work use plugin-common 
    
    • NOTE: the plugin-common will be a sore spot for the ccip repo. It is in active develop for Keystone. This means that non-CCIP related changes are happening frequently in plugin-common and core. When these changes necessitate changes in core, it will not be possible to update plugin-common without reconciling the changes between ccip and core. Recent example changes 7992ed8, e9e903b

Example: you add method to OnRampReader

When adding interface methods, maintain alphabetical order of there declaration and implementations. You will thank yourself later! You will find yourself reading multiple files that define or implement the interfaces and this simply organizational principle makes that much easier when there are more than two or three funcs. It really pays off in the tests, when you can easily compare the test cases and the interface definitions.

Example commit: https://github.com/goplugin/plugin-common/commit/c15097958cbdd27943c474052b4bf89c845c2673

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCommitProviderServices

func RegisterCommitProviderServices(s *grpc.Server, provider types.CCIPCommitProvider, brokerExt *net.BrokerExt)

func RegisterExecutionProviderServices

func RegisterExecutionProviderServices(s *grpc.Server, provider types.CCIPExecProvider, brokerExt *net.BrokerExt)

Types

type CommitGasEstimatorGRPCClient

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

CommitGasEstimatorGRPCClient implements cciptypes.GasEstimatorCommit by wrapping a ccippb.CommitGasEstimatorReaderGRPCClient grpc client. It is used by a ReportingPlugin to call the CommitGasEstimatorReader service, which is hosted by the relayer

func (*CommitGasEstimatorGRPCClient) ClientConn

func (*CommitGasEstimatorGRPCClient) Close

func (*CommitGasEstimatorGRPCClient) DenoteInUSD

func (c *CommitGasEstimatorGRPCClient) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error)

DenoteInUSD implements ccip.GasPriceEstimatorCommit.

func (*CommitGasEstimatorGRPCClient) Deviates

func (c *CommitGasEstimatorGRPCClient) Deviates(p1 *big.Int, p2 *big.Int) (bool, error)

Deviates implements ccip.GasPriceEstimatorCommit.

func (*CommitGasEstimatorGRPCClient) GetGasPrice

func (c *CommitGasEstimatorGRPCClient) GetGasPrice(ctx context.Context) (*big.Int, error)

GetGasPrice implements ccip.GasPriceEstimatorCommit.

func (*CommitGasEstimatorGRPCClient) Median

func (c *CommitGasEstimatorGRPCClient) Median(gasPrices []*big.Int) (*big.Int, error)

Median implements ccip.GasPriceEstimatorCommit.

type CommitGasEstimatorGRPCServer

type CommitGasEstimatorGRPCServer struct {
	ccippb.UnimplementedGasPriceEstimatorCommitServer
	// contains filtered or unexported fields
}

CommitGasEstimatorGRPCServer implements ccippb.CommitGasEstimatorReaderServer by wrapping a cciptypes.GasEstimatorCommit implementation. This server is hosted by the relayer and is called ReportingPlugin via the CommitGasEstimatorGRPCClient

func (*CommitGasEstimatorGRPCServer) DenoteInUSD

DenoteInUSD implements ccippb.GasPriceEstimatorCommitServer.

func (*CommitGasEstimatorGRPCServer) Deviates

Deviates implements ccippb.GasPriceEstimatorCommitServer.

func (*CommitGasEstimatorGRPCServer) GetGasPrice

GetGasPrice implements ccippb.GasPriceEstimatorCommitServer.

func (*CommitGasEstimatorGRPCServer) Median

Median implements ccippb.GasPriceEstimatorCommitServer.

type CommitProviderClient

type CommitProviderClient struct {
	*ocr2.PluginProviderClient

	// must be shared with the server
	*net.BrokerExt
	// contains filtered or unexported fields
}

func (*CommitProviderClient) Close

func (e *CommitProviderClient) Close() error

func (*CommitProviderClient) NewCommitStoreReader

func (e *CommitProviderClient) NewCommitStoreReader(ctx context.Context, addr cciptypes.Address) (cciptypes.CommitStoreReader, error)

NewCommitStoreReader implements types.CCIPCommitProvider.

func (*CommitProviderClient) NewOffRampReader

NewOffRampReader implements types.CCIPCommitProvider.

func (*CommitProviderClient) NewOnRampReader

func (e *CommitProviderClient) NewOnRampReader(ctx context.Context, addr cciptypes.Address, sourceChainSelector uint64, destChainSelector uint64) (cciptypes.OnRampReader, error)

NewOnRampReader implements types.CCIPCommitProvider.

func (*CommitProviderClient) NewPriceGetter

func (e *CommitProviderClient) NewPriceGetter(ctx context.Context) (cciptypes.PriceGetter, error)

NewPriceGetter implements types.CCIPCommitProvider.

func (*CommitProviderClient) NewPriceRegistryReader

func (e *CommitProviderClient) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (cciptypes.PriceRegistryReader, error)

NewPriceRegistryReader implements types.CCIPCommitProvider.

func (*CommitProviderClient) SourceNativeToken

func (e *CommitProviderClient) SourceNativeToken(ctx context.Context, addr cciptypes.Address) (cciptypes.Address, error)

SourceNativeToken implements types.CCIPCommitProvider.

type CommitProviderServer

type CommitProviderServer struct {
	ccippb.UnimplementedCommitCustomHandlersServer
	// BCF-3061 this has to be a shared pointer to the same impl as the execProviderClient
	*net.BrokerExt
	// contains filtered or unexported fields
}

CommitProviderServer is a server that wraps the custom methods of the types.CCIPCommitProvider this is necessary because those method create new resources that need to be served by the broker when we are running in legacy mode.

func NewCommitProviderServer

func NewCommitProviderServer(impl types.CCIPCommitProvider, brokerExt *net.BrokerExt) *CommitProviderServer

func (*CommitProviderServer) Close

Close implements ccippb.CommitCustomHandlersServer.

func (*CommitProviderServer) NewCommitStoreReader

NewCommitStoreReader implements ccippb.CommitCustomHandlersServer.

func (*CommitProviderServer) NewOffRampReader

func (*CommitProviderServer) NewOnRampReader

func (*CommitProviderServer) NewPriceGetter

func (*CommitProviderServer) SourceNativeToken

type CommitStoreGRPCClient

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

CommitStoreGRPCClient implements cciptypes.CommitStoreReader by wrapping a ccippb.CommitStoreReaderGRPCClient grpc client. It is used by a ReportingPlugin to call the CommitStoreReader service, which is hosted by the relayer

func NewCommitStoreReaderGRPCClient

func NewCommitStoreReaderGRPCClient(brokerExt *net.BrokerExt, cc grpc.ClientConnInterface) *CommitStoreGRPCClient

func (*CommitStoreGRPCClient) ChangeConfig

func (c *CommitStoreGRPCClient) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (ccip.Address, error)

ChangeConfig implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) ClientConn

ClientConn implements goplugin.GRPCClientConn.

func (*CommitStoreGRPCClient) Close

func (c *CommitStoreGRPCClient) Close() error

func (*CommitStoreGRPCClient) DecodeCommitReport

func (c *CommitStoreGRPCClient) DecodeCommitReport(ctx context.Context, report []byte) (ccip.CommitStoreReport, error)

DecodeCommitReport implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) EncodeCommitReport

func (c *CommitStoreGRPCClient) EncodeCommitReport(ctx context.Context, report ccip.CommitStoreReport) ([]byte, error)

EncodeCommitReport implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) GasPriceEstimator

GasPriceEstimator implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) GetAcceptedCommitReportsGteTimestamp

func (c *CommitStoreGRPCClient) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confirmations int) ([]ccip.CommitStoreReportWithTxMeta, error)

GetAcceptedCommitReportsGteTimestamp implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) GetCommitReportMatchingSeqNum

func (c *CommitStoreGRPCClient) GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confirmations int) ([]ccip.CommitStoreReportWithTxMeta, error)

GetCommitReportMatchingSeqNum implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) GetCommitStoreStaticConfig

func (c *CommitStoreGRPCClient) GetCommitStoreStaticConfig(ctx context.Context) (ccip.CommitStoreStaticConfig, error)

GetCommitStoreStaticConfig implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) GetExpectedNextSequenceNumber

func (c *CommitStoreGRPCClient) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error)

GetExpectedNextSequenceNumber implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) GetLatestPriceEpochAndRound

func (c *CommitStoreGRPCClient) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error)

GetLatestPriceEpochAndRound implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) IsBlessed

func (c *CommitStoreGRPCClient) IsBlessed(ctx context.Context, root [32]byte) (bool, error)

IsBlessed implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) IsDestChainHealthy

func (c *CommitStoreGRPCClient) IsDestChainHealthy(ctx context.Context) (bool, error)

IsDestChainHealthy implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) IsDown

func (c *CommitStoreGRPCClient) IsDown(ctx context.Context) (bool, error)

IsDown implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) OffchainConfig

OffchainConfig implements ccip.CommitStoreReader.

func (*CommitStoreGRPCClient) VerifyExecutionReport

func (c *CommitStoreGRPCClient) VerifyExecutionReport(ctx context.Context, report ccip.ExecReport) (bool, error)

VerifyExecutionReport implements ccip.CommitStoreReader.

type CommitStoreGRPCServer

type CommitStoreGRPCServer struct {
	ccippb.UnimplementedCommitStoreReaderServer
	// contains filtered or unexported fields
}

CommitStoreGRPCServer implements ccippb.CommitStoreReaderServer by wrapping a cciptypes.CommitStoreReader implementation. This server is hosted by the relayer and is called ReportingPlugin via the CommitStoreGRPCClient

func NewCommitStoreReaderGRPCServer

func NewCommitStoreReaderGRPCServer(impl ccip.CommitStoreReader, brokerExt *net.BrokerExt) (*CommitStoreGRPCServer, error)

func (*CommitStoreGRPCServer) AddDep

AddDep adds a closer to the list of dependencies that will be closed when the server is closed.

func (*CommitStoreGRPCServer) ChangeConfig

ChangeConfig implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) Close

func (*CommitStoreGRPCServer) DecodeCommitReport

DecodeCommitReport implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) EncodeCommitReport

EncodeCommitReport implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetAcceptedCommitReportsGteTimestamp

GetAcceptedCommitReportsGteTimestamp implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetCommitGasPriceEstimator

GetCommitGasPriceEstimator implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetCommitReportMatchingSequenceNumber

GeteCommitReportMatchingSequenceNumber implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetCommitStoreStaticConfig

GetCommitStoreStaticConfig implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetExpectedNextSequenceNumber

func (c *CommitStoreGRPCServer) GetExpectedNextSequenceNumber(ctx context.Context, req *emptypb.Empty) (*ccippb.GetExpectedNextSequenceNumberResponse, error)

GetExpectedNextSequenceNumber implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetLatestPriceEpochAndRound

func (c *CommitStoreGRPCServer) GetLatestPriceEpochAndRound(ctx context.Context, req *emptypb.Empty) (*ccippb.GetLatestPriceEpochAndRoundResponse, error)

GetLatestPriceEpochAndRound implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) GetOffchainConfig

GetOffchainConfig implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) IsBlessed

IsBlessed implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) IsDestChainHealthy

IsDestChainHealthy implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) IsDown

IsDown implements ccippb.CommitStoreReaderServer.

func (*CommitStoreGRPCServer) VerifyExecutionReport

VerifyExecutionReport implements ccippb.CommitStoreReaderServer.

type ExecGasEstimatorGRPCClient

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

ExecGasEstimatorGRPCClient implements cciptypes.GasEstimatorExec by wrapping a ccippb.ExecGasEstimatorReaderGRPCClient grpc client. It is used by a ReportingPlugin to call the ExecGasEstimatorReader service, which is hosted by the relayer

func (*ExecGasEstimatorGRPCClient) ClientConn

func (*ExecGasEstimatorGRPCClient) Close

func (e *ExecGasEstimatorGRPCClient) Close() error

func (*ExecGasEstimatorGRPCClient) DenoteInUSD

func (e *ExecGasEstimatorGRPCClient) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error)

DenoteInUSD implements ccip.GasPriceEstimatorExec.

func (*ExecGasEstimatorGRPCClient) EstimateMsgCostUSD

func (e *ExecGasEstimatorGRPCClient) EstimateMsgCostUSD(p *big.Int, wrappedNativePrice *big.Int, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error)

EstimateMsgCostUSD implements ccip.GasPriceEstimatorExec.

func (*ExecGasEstimatorGRPCClient) GetGasPrice

func (e *ExecGasEstimatorGRPCClient) GetGasPrice(ctx context.Context) (*big.Int, error)

GetGasPrice implements ccip.GasPriceEstimatorExec.

func (*ExecGasEstimatorGRPCClient) Median

func (e *ExecGasEstimatorGRPCClient) Median(gasPrices []*big.Int) (*big.Int, error)

Median implements ccip.GasPriceEstimatorExec.

type ExecGasEstimatorGRPCServer

type ExecGasEstimatorGRPCServer struct {
	ccippb.UnimplementedGasPriceEstimatorExecServer
	// contains filtered or unexported fields
}

ExecGasEstimatorGRPCServer implements ccippb.ExecGasEstimatorReaderServer by wrapping a cciptypes.GasEstimatorExec implementation. This server is hosted by the relayer and is called ReportingPlugin via the ExecGasEstimatorGRPCClient

func (*ExecGasEstimatorGRPCServer) DenoteInUSD

DenoteInUSD implements ccippb.GasPriceEstimatorExecServer.

func (*ExecGasEstimatorGRPCServer) EstimateMsgCostUSD

EstimateMsgCostUSD implements ccippb.GasPriceEstimatorExecServer.

func (*ExecGasEstimatorGRPCServer) GetGasPrice

GetGasPrice implements ccippb.GasPriceEstimatorExecServer.

func (*ExecGasEstimatorGRPCServer) Median

Median implements ccippb.GasPriceEstimatorExecServer.

type ExecProviderClient

type ExecProviderClient struct {
	*ocr2.PluginProviderClient

	// must be shared with the server
	*net.BrokerExt
	// contains filtered or unexported fields
}

func NewExecProviderClient

func NewExecProviderClient(b *net.BrokerExt, conn grpc.ClientConnInterface) *ExecProviderClient

func (*ExecProviderClient) Close

func (e *ExecProviderClient) Close() error

Close implements types.CCIPExecProvider.

func (*ExecProviderClient) GetTransactionStatus

func (e *ExecProviderClient) GetTransactionStatus(ctx context.Context, transactionID string) (types.TransactionStatus, error)

GetTransactionStatus implements types.CCIPExecProvider.

func (*ExecProviderClient) NewCommitStoreReader

func (e *ExecProviderClient) NewCommitStoreReader(ctx context.Context, addr cciptypes.Address) (cciptypes.CommitStoreReader, error)

NewCommitStoreReader implements types.CCIPExecProvider.

func (*ExecProviderClient) NewOffRampReader

func (e *ExecProviderClient) NewOffRampReader(ctx context.Context, addr cciptypes.Address) (cciptypes.OffRampReader, error)

NewOffRampReader implements types.CCIPExecProvider.

func (*ExecProviderClient) NewOnRampReader

func (e *ExecProviderClient) NewOnRampReader(ctx context.Context, addr cciptypes.Address, srcChainSelector uint64, dstChainSelector uint64) (cciptypes.OnRampReader, error)

NewOnRampReader implements types.CCIPExecProvider.

func (*ExecProviderClient) NewPriceRegistryReader

func (e *ExecProviderClient) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (cciptypes.PriceRegistryReader, error)

NewPriceRegistryReader implements types.CCIPExecProvider.

func (*ExecProviderClient) NewTokenDataReader

func (e *ExecProviderClient) NewTokenDataReader(ctx context.Context, tokenAddress cciptypes.Address) (cciptypes.TokenDataReader, error)

NewTokenDataReader implements types.CCIPExecProvider.

func (*ExecProviderClient) NewTokenPoolBatchedReader

func (e *ExecProviderClient) NewTokenPoolBatchedReader(ctx context.Context, offRampAddress cciptypes.Address, srcChainSelector uint64) (cciptypes.TokenPoolBatchedReader, error)

NewTokenPoolBatchedReader implements types.CCIPExecProvider.

func (*ExecProviderClient) SourceNativeToken

func (e *ExecProviderClient) SourceNativeToken(ctx context.Context, addr cciptypes.Address) (cciptypes.Address, error)

SourceNativeToken implements types.CCIPExecProvider.

type ExecProviderServer

type ExecProviderServer struct {
	ccippb.UnimplementedExecutionCustomHandlersServer
	// BCF-3061 this has to be a shared pointer to the same impl as the execProviderClient
	*net.BrokerExt
	// contains filtered or unexported fields
}

ExecProviderServer is a server that wraps the custom methods of the types.CCIPExecProvider this is necessary because those method create new resources that need to be served by the broker when we are running in legacy mode.

func NewExecProviderServer

func NewExecProviderServer(impl types.CCIPExecProvider, brokerExt *net.BrokerExt) *ExecProviderServer

func (*ExecProviderServer) Close

Close implements ccippb.ExecutionCustomHandlersServer.

func (*ExecProviderServer) GetTransactionStatus

func (*ExecProviderServer) NewCommitStoreReader

NewCommitStoreReader implements ccippb.ExecutionCustomHandlersServer.

func (*ExecProviderServer) NewOffRampReader

func (*ExecProviderServer) NewOnRampReader

func (*ExecProviderServer) NewTokenDataReader

func (*ExecProviderServer) SourceNativeToken

type GRPCResourceCloser

type GRPCResourceCloser interface {
	Close(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type OffRampReaderGRPCClient

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

OffRampReaderGRPCClient implement cciptypes.OffRampReader by wrapping a grpc client connection this client will be used by the CCIP loop service to communicate with the offramp reader

func NewOffRampReaderGRPCClient

func NewOffRampReaderGRPCClient(brokerExt *net.BrokerExt, cc grpc.ClientConnInterface) *OffRampReaderGRPCClient

NewOffRampReaderGRPCClient creates a new OffRampReaderGRPCClient. It is used by the reporting plugin to call the offramp reader service. The client is created by wrapping a grpc client connection. It requires a brokerExt to allocate and serve the gas estimator server. *must* be the same broker used by the server BCF-3061

func (*OffRampReaderGRPCClient) Address

Address i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) ChangeConfig

func (o *OffRampReaderGRPCClient) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, cciptypes.Address, error)

ChangeConfig implements github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader

func (*OffRampReaderGRPCClient) ClientConn

func (*OffRampReaderGRPCClient) Close

func (o *OffRampReaderGRPCClient) Close() error

func (*OffRampReaderGRPCClient) CurrentRateLimiterState

func (o *OffRampReaderGRPCClient) CurrentRateLimiterState(ctx context.Context) (cciptypes.TokenBucketRateLimit, error)

CurrentRateLimiterState i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) DecodeExecutionReport

func (o *OffRampReaderGRPCClient) DecodeExecutionReport(ctx context.Context, report []byte) (cciptypes.ExecReport, error)

DecodeExecutionReport github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader

func (*OffRampReaderGRPCClient) EncodeExecutionReport

func (o *OffRampReaderGRPCClient) EncodeExecutionReport(ctx context.Context, report cciptypes.ExecReport) ([]byte, error)

EncodeExecutionReport github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader

func (*OffRampReaderGRPCClient) GetExecutionState

func (o *OffRampReaderGRPCClient) GetExecutionState(ctx context.Context, sequenceNumber uint64) (uint8, error)

GetExecutionState i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) GetExecutionStateChangesBetweenSeqNums

func (o *OffRampReaderGRPCClient) GetExecutionStateChangesBetweenSeqNums(ctx context.Context, seqNumMin uint64, seqNumMax uint64, confirmations int) ([]cciptypes.ExecutionStateChangedWithTxMeta, error)

GetExecutionStateChangesBetweenSeqNums i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) GetRouter

GetRouter i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) GetSourceToDestTokensMapping

func (o *OffRampReaderGRPCClient) GetSourceToDestTokensMapping(ctx context.Context) (map[cciptypes.Address]cciptypes.Address, error)

GetSourceToDestTokensMapping i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) GetStaticConfig

GetStaticConfig i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) GetTokens

GetTokens i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) ListSenderNonces

func (o *OffRampReaderGRPCClient) ListSenderNonces(ctx context.Context, senders []cciptypes.Address) (map[cciptypes.Address]uint64, error)

GetSendersNonce i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) OffchainConfig

OffchainConfig i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

func (*OffRampReaderGRPCClient) OnchainConfig

OnchainConfig i[github.com/goplugin/plugin-common/pkg/types/ccip.OffRampReader]

type OffRampReaderGRPCServer

type OffRampReaderGRPCServer struct {
	ccippb.UnimplementedOffRampReaderServer
	// contains filtered or unexported fields
}

OffRampReaderGRPCServer implements ccippb.OffRampReaderServer by wrapping a cciptypes.OffRampReader implementation.

func NewOffRampReaderGRPCServer

func NewOffRampReaderGRPCServer(impl cciptypes.OffRampReader, brokerExt *net.BrokerExt) (*OffRampReaderGRPCServer, error)

NewOffRampReaderGRPCServer creates a new OffRampReaderGRPCServer. It is used by the relayer to serve the offramp reader service. The server is created by wrapping a cciptypes.OffRampReader implementation. It requires a brokerExt to allocate and serve the gas estimator server. *must* be the same broker used by the client. BCF-3061

func (*OffRampReaderGRPCServer) AddDep

AddDep adds a closer to the list of dependencies that will be closed when the server is closed.

func (*OffRampReaderGRPCServer) Address

Address implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) ChangeConfig

ChangeConfig implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) Close

Close implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) CurrentRateLimiterState

CurrentRateLimiterState implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) DecodeExecutionReport

DecodeExecutionReport implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) EncodeExecutionReport

EncodeExecutionReport implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GasPriceEstimator

GasPriceEstimator implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GetExecutionState

GetExecutionState implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GetExecutionStateChanges

GetExecutionStateChanges implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GetRouter

GetRouter implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GetSourceToDestTokensMapping

GetSourceToDestTokensMapping implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GetStaticConfig

GetStaticConfig implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) GetTokens

GetTokens implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) ListSenderNonces

GetSendersNonce implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) OffchainConfig

OffchainConfig implements ccippb.OffRampReaderServer.

func (*OffRampReaderGRPCServer) OnchainConfig

OnchainConfig implements ccippb.OffRampReaderServer.

type OnRampReaderGRPCClient

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

func (*OnRampReaderGRPCClient) Address

Address implements ccip.OnRampReader.

func (*OnRampReaderGRPCClient) ClientConn

func (*OnRampReaderGRPCClient) Close

func (o *OnRampReaderGRPCClient) Close() error

func (*OnRampReaderGRPCClient) GetDynamicConfig

GetDynamicConfig implements ccip.OnRampReader.

func (*OnRampReaderGRPCClient) GetSendRequestsBetweenSeqNums

func (o *OnRampReaderGRPCClient) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin uint64, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error)

GetSendRequestsBetweenSeqNums implements ccip.OnRampReader.

func (*OnRampReaderGRPCClient) IsSourceChainHealthy

func (o *OnRampReaderGRPCClient) IsSourceChainHealthy(ctx context.Context) (bool, error)

IsSourceChainHealthy returns true if the source chain is healthy.

func (*OnRampReaderGRPCClient) IsSourceCursed

func (o *OnRampReaderGRPCClient) IsSourceCursed(ctx context.Context) (bool, error)

IsSourceCursed returns true if the source chain is cursed. OnRamp communicates with the underlying RMN to verify if source chain was cursed or not.

func (*OnRampReaderGRPCClient) RouterAddress

func (o *OnRampReaderGRPCClient) RouterAddress(ctx context.Context) (cciptypes.Address, error)

RouterAddress implements ccip.OnRampReader.

func (*OnRampReaderGRPCClient) SourcePriceRegistryAddress

func (o *OnRampReaderGRPCClient) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error)

SourcePriceRegistryAddress returns the address of the current price registry configured on the onRamp.

type OnRampReaderGRPCServer

type OnRampReaderGRPCServer struct {
	ccippb.UnimplementedOnRampReaderServer
	// contains filtered or unexported fields
}

func NewOnRampReaderGRPCServer

func NewOnRampReaderGRPCServer(impl cciptypes.OnRampReader) *OnRampReaderGRPCServer

func (*OnRampReaderGRPCServer) AddDep

AddDep adds a dependency to the server that will be closed when the server is closed.

func (*OnRampReaderGRPCServer) Address

Address implements ccippb.OnRampReaderServer.

func (*OnRampReaderGRPCServer) Close

func (*OnRampReaderGRPCServer) GetDynamicConfig

GetDynamicConfig implements ccippb.OnRampReaderServer.

func (*OnRampReaderGRPCServer) GetSendRequestsBetweenSeqNums

GetSendRequestsBetweenSeqNums implements ccippb.OnRampReaderServer.

func (*OnRampReaderGRPCServer) IsSourceChainHealthy

IsSourceChainHealthy implements ccippb.OnRampReaderServer.

func (*OnRampReaderGRPCServer) IsSourceCursed

IsSourceCursed implements ccippb.OnRampReaderServer.

func (*OnRampReaderGRPCServer) RouterAddress

RouterAddress implements ccippb.OnRampReaderServer.

func (*OnRampReaderGRPCServer) SourcePriceRegistryAddress

SourcePriceRegistryAddress implements ccippb.OnRampReaderServer.

type PriceGetterGRPCClient

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

PriceGetterGRPCClient implements cciptypes.PriceGetter by wrapping a ccippb.PriceGetterGRPCClient grpc client. This client is used by a ReportingPlugin to call the PriceGetter service, which is hosted by the relayer

func (*PriceGetterGRPCClient) ClientConn

func (*PriceGetterGRPCClient) Close

func (p *PriceGetterGRPCClient) Close() error

func (*PriceGetterGRPCClient) FilterConfiguredTokens

func (p *PriceGetterGRPCClient) FilterConfiguredTokens(ctx context.Context, tokens []cciptypes.Address) (configured []cciptypes.Address, unconfigured []cciptypes.Address, err error)

FilterConfiguredTokens implements ccip.PriceGetter.

func (*PriceGetterGRPCClient) TokenPricesUSD

func (p *PriceGetterGRPCClient) TokenPricesUSD(ctx context.Context, tokens []cciptypes.Address) (map[cciptypes.Address]*big.Int, error)

TokenPricesUSD implements ccip.PriceGetter.

type PriceGetterGRPCServer

type PriceGetterGRPCServer struct {
	ccippb.UnimplementedPriceGetterServer
	// contains filtered or unexported fields
}

PriceGetterGRPCServer implements ccippb.PriceGetterServer by wrapping a cciptypes.PriceGetter implementation. This server is hosted by the relayer and is called ReportingPlugin via the PriceGetterGRPCClient

func NewPriceGetterGRPCServer

func NewPriceGetterGRPCServer(impl cciptypes.PriceGetter) *PriceGetterGRPCServer

func (*PriceGetterGRPCServer) AddDep

func (*PriceGetterGRPCServer) Close

func (*PriceGetterGRPCServer) FilterConfiguredTokens

FilterConfiguredTokens implements ccippb.PriceGetterServer.

func (*PriceGetterGRPCServer) TokenPricesUSD

TokenPricesUSD implements ccippb.PriceGetterServer.

type PriceRegistryGRPCClient

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

PriceRegistryGRPCClient implements cciptypes.PriceRegistryReader by wrapping a ccippb.PriceRegistryReaderGRPCClient grpc client. It is used by a ReportingPlugin to call the PriceRegistryReader service, which is hosted by the relayer

func (*PriceRegistryGRPCClient) Address

Address implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) ClientConn

func (*PriceRegistryGRPCClient) Close

func (p *PriceRegistryGRPCClient) Close() error

Close implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) GetAllGasPriceUpdatesCreatedAfter

func (p *PriceRegistryGRPCClient) GetAllGasPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confirmations int) ([]cciptypes.GasPriceUpdateWithTxMeta, error)

GetAllGasPriceUpdatesCreatedAfter implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) GetFeeTokens

func (p *PriceRegistryGRPCClient) GetFeeTokens(ctx context.Context) ([]cciptypes.Address, error)

GetFeeTokens implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) GetGasPriceUpdatesCreatedAfter

func (p *PriceRegistryGRPCClient) GetGasPriceUpdatesCreatedAfter(ctx context.Context, chainSelector uint64, ts time.Time, confirmations int) ([]cciptypes.GasPriceUpdateWithTxMeta, error)

GetGasPriceUpdatesCreatedAfter implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) GetTokenPriceUpdatesCreatedAfter

func (p *PriceRegistryGRPCClient) GetTokenPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confirmations int) ([]cciptypes.TokenPriceUpdateWithTxMeta, error)

GetTokenPriceUpdatesCreatedAfter implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) GetTokenPrices

func (p *PriceRegistryGRPCClient) GetTokenPrices(ctx context.Context, wantedTokens []cciptypes.Address) ([]cciptypes.TokenPriceUpdate, error)

GetTokenPrices implements ccip.PriceRegistryReader.

func (*PriceRegistryGRPCClient) GetTokensDecimals

func (p *PriceRegistryGRPCClient) GetTokensDecimals(ctx context.Context, tokenAddresses []cciptypes.Address) ([]uint8, error)

GetTokensDecimals implements ccip.PriceRegistryReader.

type PriceRegistryGRPCServer

type PriceRegistryGRPCServer struct {
	ccippb.UnimplementedPriceRegistryReaderServer
	// contains filtered or unexported fields
}

PriceRegistryGRPCServer implements ccippb.PriceRegistryReaderServer by wrapping a cciptypes.PriceRegistryReader implementation. This server is hosted by the relayer and is called ReportingPlugin via the PriceRegistryGRPCClient

func (*PriceRegistryGRPCServer) AddDep

AddDep adds a dependency to the server that will be closed when the server is closed

func (*PriceRegistryGRPCServer) Close

Close implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetAddress

GetAddress implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetAllGasPriceUpdatesCreatedAfter

GetAllGasPriceUpdatesCreatedAfter implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetFeeTokens

GetFeeTokens implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetGasPriceUpdatesCreatedAfter

GetGasPriceUpdatesCreatedAfter implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetTokenPriceUpdatesCreatedAfter

GetTokenPriceUpdatesCreatedAfter implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetTokenPrices

GetTokenPrices implements ccippb.PriceRegistryReaderServer.

func (*PriceRegistryGRPCServer) GetTokensDecimals

GetTokensDecimals implements ccippb.PriceRegistryReaderServer.

type TokenDataReaderGRPCClient

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

TokenDataReaderGRPCClient implements cciptypes.TokenDataReaderReader by wrapping a ccippb.TokenDataReaderReaderGRPCClient grpc client. It is used by a ReportingPlugin to call theTokenDataReaderReader service, which is hosted by the relayer

func (*TokenDataReaderGRPCClient) ClientConn

func (*TokenDataReaderGRPCClient) Close

func (t *TokenDataReaderGRPCClient) Close() error

Close implements ccip.TokenDataReader.

func (*TokenDataReaderGRPCClient) ReadTokenData

func (t *TokenDataReaderGRPCClient) ReadTokenData(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenIndex int) (tokenData []byte, err error)

ReadTokenData implements ccip.TokenDataReader.

type TokenDataReaderGRPCServer

type TokenDataReaderGRPCServer struct {
	ccippb.UnimplementedTokenDataReaderServer
	// contains filtered or unexported fields
}

TokenDataReaderGRPCServer implements ccippb.TokenDataReaderReaderServer by wrapping a cciptypes.TokenDataReaderReader implementation. This server is hosted by the relayer and is called ReportingPlugin via the TokenDataReaderGRPCClient

func (*TokenDataReaderGRPCServer) AddDep

AddDep adds a dependency to the server that will be closed when the server is closed.

func (*TokenDataReaderGRPCServer) Close

Close implements ccippb.TokenDataReaderServer.

func (*TokenDataReaderGRPCServer) ReadTokenData

ReadTokenData implements ccippb.TokenDataReaderServer.

type TokenPoolBatchedReaderGRPCClient

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

func (*TokenPoolBatchedReaderGRPCClient) ClientConn

func (*TokenPoolBatchedReaderGRPCClient) Close

Close implements ccip.TokenPoolBatchedReader.

func (*TokenPoolBatchedReaderGRPCClient) GetInboundTokenPoolRateLimits

func (t *TokenPoolBatchedReaderGRPCClient) GetInboundTokenPoolRateLimits(ctx context.Context, tokenPoolReaders []cciptypes.Address) ([]cciptypes.TokenBucketRateLimit, error)

GetInboundTokenPoolRateLimits implements ccip.TokenPoolBatchedReader.

type TokenPoolBatchedReaderGRPCServer

type TokenPoolBatchedReaderGRPCServer struct {
	ccippb.UnimplementedTokenPoolBatcherReaderServer
	// contains filtered or unexported fields
}

TokenPoolBatchedReaderGRPCServer implements ccippb.TokenPoolBatchedReaderServer by wrapping a cciptypes.TokenPoolBatchedReader implementation. This server is hosted by the relayer and is called ReportingPlugin via the TokenPoolBatchedReaderGRPCClient

func (*TokenPoolBatchedReaderGRPCServer) AddDep

func (*TokenPoolBatchedReaderGRPCServer) Close

func (*TokenPoolBatchedReaderGRPCServer) GetInboundTokenPoolRateLimits

GetInboundTokenPoolRateLimits implements ccippb.TokenPoolBatcherReaderServer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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