From 62b4f1ea498924f4fd9b49ae2f7645b70aac0e17 Mon Sep 17 00:00:00 2001 From: joaoluisam Date: Tue, 7 Jan 2025 10:56:38 +0000 Subject: [PATCH 01/91] Add mantle config (#15844) * add mantle, soneium and sonic core configs * add l1 orcale config * update develop --- .../config/toml/defaults/Mantle_Mainnet.toml | 37 +++ .../config/toml/defaults/Mantle_Sepolia.toml | 38 +++ docs/CONFIG.md | 220 ++++++++++++++++++ 3 files changed, 295 insertions(+) create mode 100644 core/chains/evm/config/toml/defaults/Mantle_Mainnet.toml create mode 100644 core/chains/evm/config/toml/defaults/Mantle_Sepolia.toml diff --git a/core/chains/evm/config/toml/defaults/Mantle_Mainnet.toml b/core/chains/evm/config/toml/defaults/Mantle_Mainnet.toml new file mode 100644 index 00000000000..33a34184f0b --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Mantle_Mainnet.toml @@ -0,0 +1,37 @@ +ChainID = '5000' +FinalityTagEnabled = true +FinalityDepth = 1200 +ChainType = 'optimismBedrock' +LogPollInterval = '2s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '40m0s' + +[HeadTracker] +HistoryDepth = 1250 + +[GasEstimator] +PriceMax = '120 gwei' +# Limit values are high as Mantle's GasPrice is in native token (MNT) instead of ETH. Their proprietary TokenRatio parameter is used to adjust fees +LimitDefault = 80_000_000_000 +LimitMax = 100_000_000_000 +BumpMin = '100 wei' +BumpThreshold = 60 +EIP1559DynamicFees = true +FeeCapDefault = '120 gwei' +# Mantle recommends setting Priority Fee to 0 in their docs linked here: https://docs-v2.mantle.xyz/devs/concepts/tx-fee/eip-1559#application-of-eip-1559-in-mantle-v2-tectonic +TipCapDefault = '0 wei' +TipCapMin = '0 wei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' diff --git a/core/chains/evm/config/toml/defaults/Mantle_Sepolia.toml b/core/chains/evm/config/toml/defaults/Mantle_Sepolia.toml new file mode 100644 index 00000000000..bdfa4a204f8 --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Mantle_Sepolia.toml @@ -0,0 +1,38 @@ +ChainID = '5003' +FinalityTagEnabled = true +FinalityDepth = 1200 +ChainType = 'optimismBedrock' +LogPollInterval = '2s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '60m0s' + +[HeadTracker] +HistoryDepth = 1250 + +[GasEstimator] +PriceMax = '120 gwei' +# Limit values are high as Mantle's GasPrice is in native token (MNT) instead of ETH. Their proprietary TokenRatio parameter is used to adjust fees +LimitDefault = 80000000000 +LimitMax = 100000000000 +BumpMin = '100 wei' +BumpPercent = 20 +BumpThreshold = 60 +EIP1559DynamicFees = true +FeeCapDefault = '120 gwei' +# Mantle recommends setting Priority Fee to 0 in their docs linked here: https://docs-v2.mantle.xyz/devs/concepts/tx-fee/eip-1559#application-of-eip-1559-in-mantle-v2-tectonic +TipCapDefault = '0 wei' +TipCapMin = '0 wei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 13ab1548e00..f3a30838366 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -6682,6 +6682,226 @@ GasLimitDefault = 400000

+
Mantle Mainnet (5000)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'optimismBedrock' +FinalityDepth = 1200 +FinalityTagEnabled = true +LogBackfillBatchSize = 1000 +LogPollInterval = '2s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 1 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '40m0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '120 gwei' +PriceMin = '1 gwei' +LimitDefault = 80000000000 +LimitMax = 100000000000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '100 wei' +BumpPercent = 20 +BumpThreshold = 60 +EIP1559DynamicFees = true +FeeCapDefault = '120 gwei' +TipCapDefault = '0' +TipCapMin = '0' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 200 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +EIP1559FeeCapBufferBlocks = 0 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' + +[HeadTracker] +HistoryDepth = 1250 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
Mantle Sepolia (5003)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'optimismBedrock' +FinalityDepth = 1200 +FinalityTagEnabled = true +LogBackfillBatchSize = 1000 +LogPollInterval = '2s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 1 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1h0m0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '120 gwei' +PriceMin = '1 gwei' +LimitDefault = 80000000000 +LimitMax = 100000000000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '100 wei' +BumpPercent = 20 +BumpThreshold = 60 +EIP1559DynamicFees = true +FeeCapDefault = '120 gwei' +TipCapDefault = '0' +TipCapMin = '0' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 200 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +EIP1559FeeCapBufferBlocks = 0 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' + +[HeadTracker] +HistoryDepth = 1250 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+
Klaytn Mainnet (8217)

```toml From 6aa365d600b0f7b9473344942adb9f04f9fb4106 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 7 Jan 2025 08:59:13 -0500 Subject: [PATCH 02/91] Add panic recovery to mercury wsrpc client (#15846) * Add panic recovery to mercury wsrpc client Wraps calls to Transmit and LatestReport with automatic recovers, triggering a redial of the underlying connection. * Changeset --- .changeset/eleven-cheetahs-care.md | 7 + .../relay/evm/mercury/wsrpc/client.go | 173 +++++++++++++----- .../relay/evm/mercury/wsrpc/client_test.go | 77 +++++++- .../relay/evm/mercury/wsrpc/mocks/mocks.go | 11 +- core/services/relay/evm/mercury/wsrpc/pool.go | 4 +- .../relay/evm/mercury/wsrpc/pool_test.go | 17 +- 6 files changed, 224 insertions(+), 65 deletions(-) create mode 100644 .changeset/eleven-cheetahs-care.md diff --git a/.changeset/eleven-cheetahs-care.md b/.changeset/eleven-cheetahs-care.md new file mode 100644 index 00000000000..2ac6417b342 --- /dev/null +++ b/.changeset/eleven-cheetahs-care.md @@ -0,0 +1,7 @@ +--- +"chainlink": patch +--- + +Add panic recovery to wsrpc mercury client + +- Should help to make nodes running wsrpc v0.8.2 more stable #bugfix diff --git a/core/services/relay/evm/mercury/wsrpc/client.go b/core/services/relay/evm/mercury/wsrpc/client.go index c87b555e6a5..ebd282e6093 100644 --- a/core/services/relay/evm/mercury/wsrpc/client.go +++ b/core/services/relay/evm/mercury/wsrpc/client.go @@ -70,11 +70,14 @@ type Client interface { } type Conn interface { + wsrpc.ClientInterface WaitForReady(ctx context.Context) bool GetState() grpc_connectivity.State Close() error } +type DialWithContextFunc func(ctxCaller context.Context, target string, opts ...wsrpc.DialOption) (Conn, error) + type client struct { services.StateMachine @@ -82,9 +85,12 @@ type client struct { serverPubKey []byte serverURL string + dialWithContext DialWithContextFunc + logger logger.Logger conn Conn rawClient pb.MercuryClient + mu sync.RWMutex consecutiveTimeoutCnt atomic.Int32 wg sync.WaitGroup @@ -101,25 +107,47 @@ type client struct { connectionResetCountMetric prometheus.Counter } +type ClientOpts struct { + Logger logger.Logger + ClientPrivKey csakey.KeyV2 + ServerPubKey []byte + ServerURL string + CacheSet cache.CacheSet + + // DialWithContext allows optional dependency injection for testing + DialWithContext DialWithContextFunc +} + // Consumers of wsrpc package should not usually call NewClient directly, but instead use the Pool -func NewClient(lggr logger.Logger, clientPrivKey csakey.KeyV2, serverPubKey []byte, serverURL string, cacheSet cache.CacheSet) Client { - return newClient(lggr, clientPrivKey, serverPubKey, serverURL, cacheSet) +func NewClient(opts ClientOpts) Client { + return newClient(opts) } -func newClient(lggr logger.Logger, clientPrivKey csakey.KeyV2, serverPubKey []byte, serverURL string, cacheSet cache.CacheSet) *client { +func newClient(opts ClientOpts) *client { + var dialWithContext DialWithContextFunc + if opts.DialWithContext != nil { + dialWithContext = opts.DialWithContext + } else { + // NOTE: Wrap here since wsrpc.DialWithContext returns a concrete *wsrpc.Conn, not an interface + dialWithContext = func(ctxCaller context.Context, target string, opts ...wsrpc.DialOption) (Conn, error) { + conn, err := wsrpc.DialWithContext(ctxCaller, target, opts...) + return conn, err + } + } return &client{ - csaKey: clientPrivKey, - serverPubKey: serverPubKey, - serverURL: serverURL, - logger: lggr.Named("WSRPC").Named(serverURL).With("serverURL", serverURL), + dialWithContext: dialWithContext, + csaKey: opts.ClientPrivKey, + serverPubKey: opts.ServerPubKey, + serverURL: opts.ServerURL, + logger: opts.Logger.Named("WSRPC").Named(opts.ServerURL).With("serverURL", opts.ServerURL), chResetTransport: make(chan struct{}, 1), - cacheSet: cacheSet, + cacheSet: opts.CacheSet, chStop: make(services.StopChan), - timeoutCountMetric: timeoutCount.WithLabelValues(serverURL), - dialCountMetric: dialCount.WithLabelValues(serverURL), - dialSuccessCountMetric: dialSuccessCount.WithLabelValues(serverURL), - dialErrorCountMetric: dialErrorCount.WithLabelValues(serverURL), - connectionResetCountMetric: connectionResetCount.WithLabelValues(serverURL), + timeoutCountMetric: timeoutCount.WithLabelValues(opts.ServerURL), + dialCountMetric: dialCount.WithLabelValues(opts.ServerURL), + dialSuccessCountMetric: dialSuccessCount.WithLabelValues(opts.ServerURL), + dialErrorCountMetric: dialErrorCount.WithLabelValues(opts.ServerURL), + connectionResetCountMetric: connectionResetCount.WithLabelValues(opts.ServerURL), } } @@ -148,7 +176,7 @@ func (w *client) Start(ctx context.Context) error { // with error. func (w *client) dial(ctx context.Context, opts ...wsrpc.DialOption) error { w.dialCountMetric.Inc() - conn, err := wsrpc.DialWithContext(ctx, w.serverURL, + conn, err := w.dialWithContext(ctx, w.serverURL, append(opts, wsrpc.WithTransportCreds(w.csaKey.Raw().Bytes(), w.serverPubKey), wsrpc.WithLogger(w.logger), @@ -161,8 +189,10 @@ func (w *client) dial(ctx context.Context, opts ...wsrpc.DialOption) error { } w.dialSuccessCountMetric.Inc() setLivenessMetric(true) + w.mu.Lock() w.conn = conn w.rawClient = pb.NewMercuryClient(conn) + w.mu.Unlock() return nil } @@ -184,6 +214,8 @@ func (w *client) runloop() { func (w *client) resetTransport() { w.connectionResetCountMetric.Inc() ok := w.IfStarted(func() { + w.mu.RLock() + defer w.mu.RUnlock() w.conn.Close() // Close is safe to call multiple times }) if !ok { @@ -211,7 +243,9 @@ func (w *client) resetTransport() { func (w *client) Close() error { return w.StopOnce("WSRPC Client", func() error { close(w.chStop) + w.mu.RLock() w.conn.Close() + w.mu.RUnlock() w.wg.Wait() return nil }) @@ -251,24 +285,46 @@ func (w *client) waitForReady(ctx context.Context) (err error) { } func (w *client) Transmit(ctx context.Context, req *pb.TransmitRequest) (resp *pb.TransmitResponse, err error) { - w.logger.Trace("Transmit") - start := time.Now() - if err = w.waitForReady(ctx); err != nil { - return nil, errors.Wrap(err, "Transmit call failed") - } - resp, err = w.rawClient.Transmit(ctx, req) - w.handleTimeout(err) - if err != nil { - w.logger.Warnw("Transmit call failed due to networking error", "err", err, "resp", resp) - incRequestStatusMetric(statusFailed) - } else { - w.logger.Tracew("Transmit call succeeded", "resp", resp) - incRequestStatusMetric(statusSuccess) - setRequestLatencyMetric(float64(time.Since(start).Milliseconds())) + ok := w.IfStarted(func() { + defer func() { + if r := recover(); r != nil { + w.handlePanic(r) + resp = nil + err = fmt.Errorf("Transmit: caught panic: %v", r) + } + }() + w.logger.Trace("Transmit") + start := time.Now() + if err = w.waitForReady(ctx); err != nil { + err = errors.Wrap(err, "Transmit call failed") + return + } + w.mu.RLock() + rc := w.rawClient + w.mu.RUnlock() + resp, err = rc.Transmit(ctx, req) + w.handleTimeout(err) + if err != nil { + w.logger.Warnw("Transmit call failed due to networking error", "err", err, "resp", resp) + incRequestStatusMetric(statusFailed) + } else { + w.logger.Tracew("Transmit call succeeded", "resp", resp) + incRequestStatusMetric(statusSuccess) + setRequestLatencyMetric(float64(time.Since(start).Milliseconds())) + } + }) + if !ok { + err = errors.New("client is not started") } return } +// hacky workaround to trap panics from buggy underlying wsrpc lib and restart +// the connection from a known good state +func (w *client) handlePanic(r interface{}) { + w.chResetTransport <- struct{}{} +} + func (w *client) handleTimeout(err error) { if errors.Is(err, context.DeadlineExceeded) { w.timeoutCountMetric.Inc() @@ -303,27 +359,44 @@ func (w *client) handleTimeout(err error) { } func (w *client) LatestReport(ctx context.Context, req *pb.LatestReportRequest) (resp *pb.LatestReportResponse, err error) { - lggr := w.logger.With("req.FeedId", hexutil.Encode(req.FeedId)) - lggr.Trace("LatestReport") - if err = w.waitForReady(ctx); err != nil { - return nil, errors.Wrap(err, "LatestReport failed") - } - var cached bool - if w.cache == nil { - resp, err = w.rawClient.LatestReport(ctx, req) - w.handleTimeout(err) - } else { - cached = true - resp, err = w.cache.LatestReport(ctx, req) - } - if err != nil { - lggr.Errorw("LatestReport failed", "err", err, "resp", resp, "cached", cached) - } else if resp.Error != "" { - lggr.Errorw("LatestReport failed; mercury server returned error", "err", resp.Error, "resp", resp, "cached", cached) - } else if !cached { - lggr.Debugw("LatestReport succeeded", "resp", resp, "cached", cached) - } else { - lggr.Tracew("LatestReport succeeded", "resp", resp, "cached", cached) + ok := w.IfStarted(func() { + defer func() { + if r := recover(); r != nil { + w.handlePanic(r) + resp = nil + err = fmt.Errorf("LatestReport: caught panic: %v", r) + } + }() + lggr := w.logger.With("req.FeedId", hexutil.Encode(req.FeedId)) + lggr.Trace("LatestReport") + if err = w.waitForReady(ctx); err != nil { + err = errors.Wrap(err, "LatestReport failed") + return + } + var cached bool + if w.cache == nil { + w.mu.RLock() + rc := w.rawClient + w.mu.RUnlock() + resp, err = rc.LatestReport(ctx, req) + w.handleTimeout(err) + } else { + cached = true + resp, err = w.cache.LatestReport(ctx, req) + } + switch { + case err != nil: + lggr.Errorw("LatestReport failed", "err", err, "resp", resp, "cached", cached) + case resp.Error != "": + lggr.Errorw("LatestReport failed; mercury server returned error", "err", resp.Error, "resp", resp, "cached", cached) + case !cached: + lggr.Debugw("LatestReport succeeded", "resp", resp, "cached", cached) + default: + lggr.Tracew("LatestReport succeeded", "resp", resp, "cached", cached) + } + }) + if !ok { + err = errors.New("client is not started") } return } @@ -333,5 +406,7 @@ func (w *client) ServerURL() string { } func (w *client) RawClient() pb.MercuryClient { + w.mu.RLock() + defer w.mu.RUnlock() return w.rawClient } diff --git a/core/services/relay/evm/mercury/wsrpc/client_test.go b/core/services/relay/evm/mercury/wsrpc/client_test.go index 539148f4ff6..f5b5be82a33 100644 --- a/core/services/relay/evm/mercury/wsrpc/client_test.go +++ b/core/services/relay/evm/mercury/wsrpc/client_test.go @@ -2,13 +2,19 @@ package wsrpc import ( "context" + "math/big" + "math/rand" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + grpc_connectivity "google.golang.org/grpc/connectivity" + + "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" @@ -74,7 +80,15 @@ func Test_Client_Transmit(t *testing.T) { conn := &mocks.MockConn{ Ready: true, } - c := newClient(lggr, csakey.KeyV2{}, nil, "", noopCacheSet) + opts := ClientOpts{ + lggr, + csakey.KeyV2{}, + nil, + "", + noopCacheSet, + nil, + } + c := newClient(opts) c.conn = conn c.rawClient = wsrpcClient require.NoError(t, c.StartOnce("Mock WSRPC Client", func() error { return nil })) @@ -115,6 +129,65 @@ func Test_Client_Transmit(t *testing.T) { } }) }) + + t.Run("recovers panics in underlying client and attempts redial", func(t *testing.T) { + conn := &mocks.MockConn{ + Ready: true, + State: grpc_connectivity.Ready, + InvokeF: func(ctx context.Context, method string, args interface{}, reply interface{}) error { + panic("TESTING CONN INVOKE PANIC") + }, + } + + ch := make(chan struct{}, 100) + cnt := 0 + + f := func(ctxCaller context.Context, target string, opts ...wsrpc.DialOption) (Conn, error) { + cnt++ + switch cnt { + case 1: + ch <- struct{}{} + return conn, nil + case 2: + ch <- struct{}{} + return nil, nil + default: + t.Fatalf("too many dials, got: %d", cnt) + return nil, nil + } + } + + clientKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(rand.Int63())) + serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(rand.Int63())) + opts := ClientOpts{ + lggr, + clientKey, + serverKey.PublicKey, + "", + noopCacheSet, + f, + } + c := newClient(opts) + + require.NoError(t, c.Start(tests.Context(t))) + + // drain the channel + select { + case <-ch: + assert.Equal(t, 1, cnt) + default: + t.Fatalf("expected dial to be called") + } + + _, err := c.Transmit(ctx, req) + require.EqualError(t, err, "Transmit: caught panic: TESTING CONN INVOKE PANIC") + + // expect conn to be closed and re-dialed + <-ch + assert.Equal(t, 2, cnt) + + assert.True(t, conn.Closed) + }) } func Test_Client_LatestReport(t *testing.T) { @@ -159,7 +232,7 @@ func Test_Client_LatestReport(t *testing.T) { conn := &mocks.MockConn{ Ready: true, } - c := newClient(lggr, csakey.KeyV2{}, nil, "", cacheSet) + c := newClient(ClientOpts{lggr, csakey.KeyV2{}, nil, "", cacheSet, nil}) c.conn = conn c.rawClient = wsrpcClient diff --git a/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go b/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go index e202802ea77..199e0b49fa8 100644 --- a/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go +++ b/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go @@ -29,9 +29,10 @@ func (m *MockWSRPCClient) ServerURL() string { return "mock server url" } func (m *MockWSRPCClient) RawClient() pb.MercuryClient { return nil } type MockConn struct { - State grpc_connectivity.State - Ready bool - Closed bool + State grpc_connectivity.State + Ready bool + Closed bool + InvokeF func(ctx context.Context, method string, args interface{}, reply interface{}) error } func (m *MockConn) Close() error { @@ -42,3 +43,7 @@ func (m MockConn) WaitForReady(ctx context.Context) bool { return m.Ready } func (m MockConn) GetState() grpc_connectivity.State { return m.State } + +func (m MockConn) Invoke(ctx context.Context, method string, args interface{}, reply interface{}) error { + return m.InvokeF(ctx, method, args, reply) +} diff --git a/core/services/relay/evm/mercury/wsrpc/pool.go b/core/services/relay/evm/mercury/wsrpc/pool.go index 0bd49ddb5ea..7754d6b2b96 100644 --- a/core/services/relay/evm/mercury/wsrpc/pool.go +++ b/core/services/relay/evm/mercury/wsrpc/pool.go @@ -60,7 +60,7 @@ func (conn *connection) checkout(ctx context.Context) (cco *clientCheckout, err // not thread-safe, access must be serialized func (conn *connection) ensureStartedClient(ctx context.Context) error { if len(conn.checkouts) == 0 { - conn.Client = conn.pool.newClient(conn.lggr, conn.clientPrivKey, conn.serverPubKey, conn.serverURL, conn.pool.cacheSet) + conn.Client = conn.pool.newClient(ClientOpts{conn.lggr, conn.clientPrivKey, conn.serverPubKey, conn.serverURL, conn.pool.cacheSet, nil}) return conn.Client.Start(ctx) } return nil @@ -121,7 +121,7 @@ type pool struct { connections map[string]map[credentials.StaticSizedPublicKey]*connection // embedding newClient makes testing/mocking easier - newClient func(lggr logger.Logger, privKey csakey.KeyV2, serverPubKey []byte, serverURL string, cacheSet cache.CacheSet) Client + newClient func(opts ClientOpts) Client mu sync.RWMutex diff --git a/core/services/relay/evm/mercury/wsrpc/pool_test.go b/core/services/relay/evm/mercury/wsrpc/pool_test.go index bb5ceec0bb6..b11079f3e9b 100644 --- a/core/services/relay/evm/mercury/wsrpc/pool_test.go +++ b/core/services/relay/evm/mercury/wsrpc/pool_test.go @@ -13,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/cache" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" ) @@ -64,10 +63,10 @@ func Test_Pool(t *testing.T) { serverURL := "example.com:443/ws" client := newMockClient(lggr) - p.newClient = func(lggr logger.Logger, cprivk csakey.KeyV2, spubk []byte, surl string, cs cache.CacheSet) Client { - assert.Equal(t, clientPrivKey, cprivk) - assert.Equal(t, serverPubKey, spubk) - assert.Equal(t, serverURL, surl) + p.newClient = func(opts ClientOpts) Client { + assert.Equal(t, clientPrivKey, opts.ClientPrivKey) + assert.Equal(t, serverPubKey, opts.ServerPubKey) + assert.Equal(t, serverURL, opts.ServerURL) return client } @@ -110,8 +109,8 @@ func Test_Pool(t *testing.T) { "example.invalid:8000/ws", } - p.newClient = func(lggr logger.Logger, cprivk csakey.KeyV2, spubk []byte, surl string, cs cache.CacheSet) Client { - return newMockClient(lggr) + p.newClient = func(opts ClientOpts) Client { + return newMockClient(opts.Logger) } // conn 1 @@ -226,8 +225,8 @@ func Test_Pool(t *testing.T) { } var clients []*mockClient - p.newClient = func(lggr logger.Logger, cprivk csakey.KeyV2, spubk []byte, surl string, cs cache.CacheSet) Client { - c := newMockClient(lggr) + p.newClient = func(opts ClientOpts) Client { + c := newMockClient(opts.Logger) clients = append(clients, c) return c } From 9594e823e8db2ca5f299a43ebefa996059ce8a5b Mon Sep 17 00:00:00 2001 From: Jasmin Bakalovic <49901238+athegaul@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:44:59 +0100 Subject: [PATCH 03/91] OPCC: Ink (#15828) * OPCC: Add initial Ink Testnet config * add NoNewFinalizedHeadsThreshold * changes to allow using only https rpcs * revert back to use ws * OPCC: Remove comment * OPCC: make config-docs * OPCC: Add Ink mainnet toml config * OPCC: Generate Ink Mainnet docs --------- Co-authored-by: joaoluisam --- .../evm/config/toml/defaults/Ink_Mainnet.toml | 28 +++ .../evm/config/toml/defaults/Ink_Testnet.toml | 28 +++ docs/CONFIG.md | 218 ++++++++++++++++++ 3 files changed, 274 insertions(+) create mode 100644 core/chains/evm/config/toml/defaults/Ink_Mainnet.toml create mode 100644 core/chains/evm/config/toml/defaults/Ink_Testnet.toml diff --git a/core/chains/evm/config/toml/defaults/Ink_Mainnet.toml b/core/chains/evm/config/toml/defaults/Ink_Mainnet.toml new file mode 100644 index 00000000000..d4b35f291d9 --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Ink_Mainnet.toml @@ -0,0 +1,28 @@ +ChainID = '57073' +# OP stack: https://github.com/inkonchain/node +ChainType = 'optimismBedrock' +# finality_depth was: ~2094 +FinalityDepth = 3000 +# block_time was: ~1s, adding 1 second buffer +LogPollInterval = '2s' + +# batching_size_finalization_percentage = 30% according to the explorer batching view +# ( batching_size_finalization_percentage * finality_depth) * block_time / 60 secs = ~10 min (finality time) +NoNewFinalizedHeadsThreshold = '60m0s' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 1s, per recommendation skip 1-2 blocks +CacheTimeout = '2s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' diff --git a/core/chains/evm/config/toml/defaults/Ink_Testnet.toml b/core/chains/evm/config/toml/defaults/Ink_Testnet.toml new file mode 100644 index 00000000000..936651bfb0c --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Ink_Testnet.toml @@ -0,0 +1,28 @@ +ChainID = '763373' +# OP stack: https://github.com/inkonchain/node +ChainType = 'optimismBedrock' +# finality_depth was: ~2094 +FinalityDepth = 3000 +# block_time was: ~1s, adding 1 second buffer +LogPollInterval = '2s' + +# batching_size_finalization_percentage = 30% according to the explorer batching view +# ( batching_size_finalization_percentage * finality_depth) * block_time / 60 secs = ~10 min (finality time) +NoNewFinalizedHeadsThreshold = '60m0s' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 1s, per recommendation skip 1-2 blocks +CacheTimeout = '2s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' diff --git a/docs/CONFIG.md b/docs/CONFIG.md index f3a30838366..fe55f4ad293 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -8295,6 +8295,115 @@ GasLimitDefault = 400000

+
Ink Mainnet (57073)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'optimismBedrock' +FinalityDepth = 3000 +FinalityTagEnabled = true +LogBackfillBatchSize = 1000 +LogPollInterval = '2s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1h0m0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'FeeHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 100 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '2s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+
Linea Goerli (59140)

```toml @@ -9902,6 +10011,115 @@ GasLimitDefault = 400000

+
Ink Testnet (763373)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'optimismBedrock' +FinalityDepth = 3000 +FinalityTagEnabled = true +LogBackfillBatchSize = 1000 +LogPollInterval = '2s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1h0m0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'FeeHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 100 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '2s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+
BOB Testnet (808813)

```toml From 8729cb73812ae4896808cb8e718cc1b710848289 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 7 Jan 2025 10:56:55 -0500 Subject: [PATCH 04/91] Fix racey test (failed to close client) (#15853) --- .../relay/evm/mercury/wsrpc/client_test.go | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/core/services/relay/evm/mercury/wsrpc/client_test.go b/core/services/relay/evm/mercury/wsrpc/client_test.go index f5b5be82a33..b2bbf074e91 100644 --- a/core/services/relay/evm/mercury/wsrpc/client_test.go +++ b/core/services/relay/evm/mercury/wsrpc/client_test.go @@ -14,7 +14,6 @@ import ( "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" @@ -131,26 +130,26 @@ func Test_Client_Transmit(t *testing.T) { }) t.Run("recovers panics in underlying client and attempts redial", func(t *testing.T) { - conn := &mocks.MockConn{ - Ready: true, - State: grpc_connectivity.Ready, - InvokeF: func(ctx context.Context, method string, args interface{}, reply interface{}) error { - panic("TESTING CONN INVOKE PANIC") - }, + makeConn := func() *mocks.MockConn { + return &mocks.MockConn{ + Ready: true, + State: grpc_connectivity.Ready, + InvokeF: func(ctx context.Context, method string, args interface{}, reply interface{}) error { + panic("TESTING CONN INVOKE PANIC") + }, + } } - ch := make(chan struct{}, 100) + ch := make(chan *mocks.MockConn, 100) cnt := 0 f := func(ctxCaller context.Context, target string, opts ...wsrpc.DialOption) (Conn, error) { cnt++ switch cnt { - case 1: - ch <- struct{}{} + case 1, 2: + conn := makeConn() + ch <- conn return conn, nil - case 2: - ch <- struct{}{} - return nil, nil default: t.Fatalf("too many dials, got: %d", cnt) return nil, nil @@ -169,11 +168,12 @@ func Test_Client_Transmit(t *testing.T) { } c := newClient(opts) - require.NoError(t, c.Start(tests.Context(t))) + servicetest.Run(t, c) // drain the channel + var conn *mocks.MockConn select { - case <-ch: + case conn = <-ch: assert.Equal(t, 1, cnt) default: t.Fatalf("expected dial to be called") @@ -183,10 +183,11 @@ func Test_Client_Transmit(t *testing.T) { require.EqualError(t, err, "Transmit: caught panic: TESTING CONN INVOKE PANIC") // expect conn to be closed and re-dialed - <-ch + conn2 := <-ch assert.Equal(t, 2, cnt) assert.True(t, conn.Closed) + assert.False(t, conn2.Closed) }) } From aabd54df8c4169edf2fd97e18571ca7651e822a4 Mon Sep 17 00:00:00 2001 From: Justin Kaseman Date: Tue, 7 Jan 2025 08:32:02 -0800 Subject: [PATCH 05/91] Checkout Standard Capabilities (#15671) * During build, add standard capability binaries to -plugins image * Shift down token step * Remove set-git-config --- .github/workflows/build-publish-develop-pr.yml | 17 ++++++++++++++++- tools/bin/goreleaser_utils | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-publish-develop-pr.yml b/.github/workflows/build-publish-develop-pr.yml index 85f29a15cb0..4aed811daa6 100644 --- a/.github/workflows/build-publish-develop-pr.yml +++ b/.github/workflows/build-publish-develop-pr.yml @@ -89,13 +89,28 @@ jobs: goarch: arm64 dist_name: linux_arm64_v8.0 steps: - - name: Checkout repository + - name: Checkout chainlink repository uses: actions/checkout@v4.2.1 with: persist-credentials: false ref: ${{ env.CHECKOUT_REF }} fetch-depth: 0 + - name: Setup Github Token + id: token + uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Checkout capabilities repository + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/capabilities + token: ${{ steps.token.outputs.access-token }} + path: capabilities + - name: Configure aws credentials uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 with: diff --git a/tools/bin/goreleaser_utils b/tools/bin/goreleaser_utils index 0bf745d5a58..e38acf6494b 100755 --- a/tools/bin/goreleaser_utils +++ b/tools/bin/goreleaser_utils @@ -13,6 +13,7 @@ before_hook() { install_local_plugins install_remote_plugins mkdir -p "$lib_path/plugins" + build_standard_capabilities # Retrieve GOPATH GOPATH=$(go env GOPATH) @@ -71,6 +72,15 @@ get_remote_plugin_paths() { done } +build_standard_capabilities() { + cd ./capabilities + npx nx@19.8.2 init + ./nx run-many -t build + # binaries get put into /bin under /bin/amd64/ and /bin/arm64/ + cp "./bin/$(go env GOARCH)"/* "../$lib_path/plugins" + cd ../ +} + install_remote_plugins() { ldflags=(-ldflags "$(./tools/bin/ldflags)") From 484124ae569227acaf0d33a8e4599e90fbef23de Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 7 Jan 2025 10:45:42 -0600 Subject: [PATCH 06/91] bump mockery to v2.50.0 (#15789) --- GNUmakefile | 2 +- common/client/mock_head_test.go | 8 +- common/client/mock_node_selector_test.go | 16 +- common/client/mock_node_test.go | 64 +++---- .../mock_pool_chain_info_provider_test.go | 6 +- common/client/mock_rpc_client_test.go | 14 +- common/client/mock_send_only_client_test.go | 10 +- common/client/mock_send_only_node_test.go | 42 +++-- common/headtracker/mocks/head_broadcaster.go | 16 +- common/headtracker/mocks/head_trackable.go | 4 +- common/headtracker/mocks/head_tracker.go | 24 ++- common/txmgr/mocks/tx_manager.go | 24 +-- common/txmgr/types/mocks/forwarder_manager.go | 18 +- common/txmgr/types/mocks/key_store.go | 2 +- .../txmgr/types/mocks/tx_attempt_builder.go | 24 ++- common/txmgr/types/mocks/tx_store.go | 10 +- common/txmgr/types/mocks/tx_strategy.go | 4 +- common/types/mocks/head.go | 34 ++-- common/types/mocks/monitoring_endpoint.go | 4 +- common/types/mocks/subscription.go | 8 +- contracts/GNUmakefile | 2 +- core/bridges/mocks/orm.go | 2 +- .../ccip/types/mocks/ccip_oracle.go | 6 +- .../ccip/types/mocks/oracle_creator.go | 4 +- .../remote/types/mocks/dispatcher.go | 26 +-- .../remote/types/mocks/receiver.go | 4 +- .../targets/mocks/contract_value_getter.go | 16 +- .../targets/mocks/contract_writer.go | 22 +-- core/chains/evm/client/mocks/client.go | 12 +- .../evm/config/mocks/chain_scoped_config.go | 4 +- core/chains/evm/config/mocks/gas_estimator.go | 44 ++--- core/chains/evm/forwarders/mocks/orm.go | 2 +- core/chains/evm/gas/mocks/evm_estimator.go | 14 +- .../chains/evm/gas/mocks/evm_fee_estimator.go | 14 +- .../evm/gas/mocks/fee_estimator_client.go | 2 +- .../gas/mocks/fee_history_estimator_client.go | 2 +- .../chains/evm/gas/rollups/mocks/l1_oracle.go | 10 +- .../evm/gas/rollups/mocks/l1_oracle_client.go | 2 +- core/chains/evm/keystore/mocks/eth.go | 2 +- core/chains/evm/log/mocks/abigen_contract.go | 4 +- core/chains/evm/log/mocks/broadcast.go | 22 +-- core/chains/evm/log/mocks/broadcaster.go | 24 +-- core/chains/evm/logpoller/mocks/log_poller.go | 16 +- core/chains/evm/mocks/balance_monitor.go | 12 +- core/chains/evm/txmgr/mocks/config.go | 12 +- core/chains/evm/txmgr/mocks/evm_tx_store.go | 162 +++++++++--------- core/chains/legacyevm/mocks/chain.go | 76 ++++---- .../legacyevm/mocks/legacy_chain_container.go | 8 +- core/cmd/mocks/prompter.go | 4 +- core/config/mocks/telemetry_ingress.go | 18 +- .../mocks/telemetry_ingress_endpoint.go | 10 +- .../ccip/mocks/commit_store_interface.go | 4 +- .../ccip/mocks/evm2_evm_off_ramp_interface.go | 4 +- .../ccip/mocks/evm2_evm_on_ramp_interface.go | 4 +- .../ccip/mocks/fee_quoter_interface.go | 4 +- .../ccip/mocks/link_token_interface.go | 4 +- .../v1_2_0/evm2_evm_off_ramp_interface.go | 4 +- .../arbitrum_gateway_router_interface.go | 4 +- .../arbitrum_inbox_interface.go | 4 +- .../arbitrum_l1_bridge_adapter_interface.go | 4 +- .../arbitrum_l2_bridge_adapter_interface.go | 4 +- .../arb_rollup_core_interface.go | 4 +- .../mocks/mock_arbsys/arb_sys_interface.go | 4 +- .../l2_arbitrum_gateway_interface.go | 4 +- .../l2_arbitrum_messenger_interface.go | 4 +- .../node_interface_interface.go | 4 +- ...optimism_dispute_game_factory_interface.go | 4 +- .../optimism_l2_output_oracle_interface.go | 4 +- .../optimism_portal_interface.go | 4 +- .../optimism_portal2_interface.go | 4 +- core/internal/mocks/application.go | 52 +++--- core/internal/mocks/flags.go | 4 +- core/internal/mocks/flux_aggregator.go | 4 +- core/logger/logger_mocks.go | 58 +++---- core/services/blockhashstore/mocks/bhs.go | 4 +- core/services/blockhashstore/mocks/timer.go | 2 +- core/services/ccip/mocks/orm.go | 2 +- .../chainlink/mocks/general_config.go | 90 +++++----- .../feeds/mocks/connections_manager.go | 8 +- .../feeds/mocks/feeds_manager_client.go | 2 +- core/services/feeds/mocks/orm.go | 2 +- core/services/feeds/mocks/service.go | 6 +- .../fluxmonitorv2/mocks/contract_submitter.go | 2 +- core/services/fluxmonitorv2/mocks/flags.go | 6 +- .../mocks/key_store_interface.go | 2 +- core/services/fluxmonitorv2/mocks/orm.go | 2 +- .../functions/mocks/bridge_accessor.go | 2 +- .../mocks/external_adapter_client.go | 2 +- .../functions/mocks/functions_listener.go | 4 +- .../functions/mocks/offchain_transmitter.go | 4 +- core/services/functions/mocks/orm.go | 2 +- .../connector/mocks/gateway_connector.go | 14 +- .../mocks/gateway_connector_handler.go | 6 +- .../gateway/connector/mocks/signer.go | 2 +- .../allowlist/mocks/onchain_allowlist.go | 4 +- .../handlers/functions/allowlist/mocks/orm.go | 2 +- .../mocks/onchain_subscriptions.go | 4 +- .../functions/subscriptions/mocks/orm.go | 2 +- core/services/gateway/handlers/mocks/don.go | 2 +- .../gateway/handlers/mocks/handler.go | 4 +- .../network/mocks/connection_acceptor.go | 4 +- .../network/mocks/connection_initiator.go | 2 +- .../gateway/network/mocks/http_client.go | 2 +- .../network/mocks/http_request_handler.go | 2 +- .../gateway/network/mocks/http_server.go | 8 +- .../network/mocks/web_socket_server.go | 6 +- .../headreporter/head_reporter_mock.go | 2 +- .../headreporter/prometheus_backend_mock.go | 12 +- core/services/job/mocks/kv_store.go | 2 +- core/services/job/mocks/orm.go | 8 +- core/services/job/mocks/service_ctx.go | 4 +- core/services/job/mocks/spawner.go | 12 +- core/services/keystore/mocks/aptos.go | 4 +- core/services/keystore/mocks/cosmos.go | 4 +- core/services/keystore/mocks/csa.go | 4 +- core/services/keystore/mocks/eth.go | 6 +- core/services/keystore/mocks/master.go | 24 +-- core/services/keystore/mocks/ocr.go | 4 +- core/services/keystore/mocks/ocr2.go | 4 +- core/services/keystore/mocks/p2p.go | 4 +- core/services/keystore/mocks/solana.go | 4 +- core/services/keystore/mocks/starknet.go | 4 +- core/services/keystore/mocks/vrf.go | 4 +- core/services/keystore/mocks/workflow.go | 4 +- core/services/mocks/checker.go | 10 +- .../ocr/mocks/ocr_contract_tracker_db.go | 2 +- .../internal/cache/mocks/chain_health_mock.go | 4 +- .../mocks/token_pool_batched_reader_mock.go | 4 +- .../mocks/price_registry_mock.go | 2 +- .../mocks/commit_store_reader_mock.go | 4 +- .../ccipdata/mocks/offramp_reader_mock.go | 4 +- .../ccipdata/mocks/onramp_reader_mock.go | 4 +- .../mocks/price_registry_reader_mock.go | 4 +- .../ccipdata/mocks/token_pool_reader_mock.go | 6 +- .../ccipdata/mocks/usdc_reader_mock.go | 2 +- .../ccipdb/mocks/price_service_mock.go | 4 +- .../pricegetter/all_price_getter_mock.go | 4 +- .../plugins/ccip/internal/pricegetter/mock.go | 4 +- .../internal/rpclib/rpclibmocks/evm_mock.go | 2 +- .../prices/gas_price_estimator_commit_mock.go | 2 +- .../prices/gas_price_estimator_exec_mock.go | 2 +- .../ccip/prices/gas_price_estimator_mock.go | 2 +- .../plugins/ccip/tokendata/reader_mock.go | 4 +- .../evmregistry/v20/mocks/registry.go | 2 +- .../v21/core/mocks/upkeep_state_reader.go | 2 +- .../evmregistry/v21/mocks/http_client.go | 2 +- .../evmregistry/v21/mocks/registry.go | 17 +- .../promwrapper/mocks/prometheus_backend.go | 22 +-- .../ocr2/plugins/threshold/mocks/decryptor.go | 2 +- core/services/p2p/types/mocks/peer.go | 54 +++--- core/services/p2p/types/mocks/peer_wrapper.go | 12 +- core/services/p2p/types/mocks/signer.go | 2 +- core/services/pipeline/mocks/config.go | 14 +- core/services/pipeline/mocks/orm.go | 12 +- .../mocks/pipeline_param_unmarshaler.go | 2 +- core/services/pipeline/mocks/runner.go | 12 +- core/services/registrysyncer/mocks/orm.go | 2 +- .../relay/evm/mercury/mocks/async_deleter.go | 4 +- core/services/relay/evm/mocks/codec.go | 30 ++-- .../relay/evm/mocks/request_round_db.go | 2 +- .../relay/evm/read/mocks/batch_caller.go | 2 +- core/services/relay/evm/read/mocks/reader.go | 56 +++--- .../relay/evm/read/mocks/registrar.go | 2 +- .../mocks/ccip_transaction_status_checker.go | 2 +- .../evm/types/mocks/log_poller_wrapper.go | 12 +- core/services/s4/mocks/orm.go | 2 +- core/services/s4/mocks/storage.go | 4 +- .../synchronization/mocks/telem_client.go | 2 +- .../mocks/telemetry_service.go | 12 +- .../monitoring_endpoint_generator_mock.go | 2 +- .../vrf/mocks/aggregator_v3_interface.go | 4 +- core/services/vrf/mocks/config.go | 6 +- core/services/vrf/mocks/fee_config.go | 6 +- core/services/vrf/mocks/vrf_coordinator_v2.go | 4 +- .../mocks/external_initiator_manager.go | 2 +- core/services/webhook/mocks/http_client.go | 2 +- core/services/workflows/syncer/mocks/orm.go | 2 +- core/sessions/ldapauth/mocks/ldap_client.go | 4 +- core/sessions/ldapauth/mocks/ldap_conn.go | 4 +- .../sessions/mocks/authentication_provider.go | 2 +- core/sessions/mocks/basic_admin_users_orm.go | 2 +- deployment/mocks/offchain_client_mock.go | 2 +- 182 files changed, 923 insertions(+), 878 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index bb200cc2cb9..f877f01decb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -146,7 +146,7 @@ gomodslocalupdate: gomods ## Run gomod-local-update .PHONY: mockery mockery: $(mockery) ## Install mockery. - go install github.com/vektra/mockery/v2@v2.46.3 + go install github.com/vektra/mockery/v2@v2.50.0 .PHONY: codecgen codecgen: $(codecgen) ## Install codecgen diff --git a/common/client/mock_head_test.go b/common/client/mock_head_test.go index f75bb340305..01884d3fcfc 100644 --- a/common/client/mock_head_test.go +++ b/common/client/mock_head_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -21,7 +21,7 @@ func (_m *mockHead) EXPECT() *mockHead_Expecter { return &mockHead_Expecter{mock: &_m.Mock} } -// BlockDifficulty provides a mock function with given fields: +// BlockDifficulty provides a mock function with no fields func (_m *mockHead) BlockDifficulty() *big.Int { ret := _m.Called() @@ -68,7 +68,7 @@ func (_c *mockHead_BlockDifficulty_Call) RunAndReturn(run func() *big.Int) *mock return _c } -// BlockNumber provides a mock function with given fields: +// BlockNumber provides a mock function with no fields func (_m *mockHead) BlockNumber() int64 { ret := _m.Called() @@ -113,7 +113,7 @@ func (_c *mockHead_BlockNumber_Call) RunAndReturn(run func() int64) *mockHead_Bl return _c } -// IsValid provides a mock function with given fields: +// IsValid provides a mock function with no fields func (_m *mockHead) IsValid() bool { ret := _m.Called() diff --git a/common/client/mock_node_selector_test.go b/common/client/mock_node_selector_test.go index c01895a0ee7..c4201664b4a 100644 --- a/common/client/mock_node_selector_test.go +++ b/common/client/mock_node_selector_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -8,11 +8,11 @@ import ( ) // mockNodeSelector is an autogenerated mock type for the NodeSelector type -type mockNodeSelector[CHAIN_ID types.ID, RPC any] struct { +type mockNodeSelector[CHAIN_ID types.ID, RPC interface{}] struct { mock.Mock } -type mockNodeSelector_Expecter[CHAIN_ID types.ID, RPC any] struct { +type mockNodeSelector_Expecter[CHAIN_ID types.ID, RPC interface{}] struct { mock *mock.Mock } @@ -20,7 +20,7 @@ func (_m *mockNodeSelector[CHAIN_ID, RPC]) EXPECT() *mockNodeSelector_Expecter[C return &mockNodeSelector_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *mockNodeSelector[CHAIN_ID, RPC]) Name() string { ret := _m.Called() @@ -39,7 +39,7 @@ func (_m *mockNodeSelector[CHAIN_ID, RPC]) Name() string { } // mockNodeSelector_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type mockNodeSelector_Name_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNodeSelector_Name_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -65,7 +65,7 @@ func (_c *mockNodeSelector_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() str return _c } -// Select provides a mock function with given fields: +// Select provides a mock function with no fields func (_m *mockNodeSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { ret := _m.Called() @@ -86,7 +86,7 @@ func (_m *mockNodeSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { } // mockNodeSelector_Select_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Select' -type mockNodeSelector_Select_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNodeSelector_Select_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -114,7 +114,7 @@ func (_c *mockNodeSelector_Select_Call[CHAIN_ID, RPC]) RunAndReturn(run func() N // newMockNodeSelector creates a new instance of mockNodeSelector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func newMockNodeSelector[CHAIN_ID types.ID, RPC any](t interface { +func newMockNodeSelector[CHAIN_ID types.ID, RPC interface{}](t interface { mock.TestingT Cleanup(func()) }) *mockNodeSelector[CHAIN_ID, RPC] { diff --git a/common/client/mock_node_test.go b/common/client/mock_node_test.go index e5b090ab641..f0fc6a4cb58 100644 --- a/common/client/mock_node_test.go +++ b/common/client/mock_node_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -10,11 +10,11 @@ import ( ) // mockNode is an autogenerated mock type for the Node type -type mockNode[CHAIN_ID types.ID, RPC any] struct { +type mockNode[CHAIN_ID types.ID, RPC interface{}] struct { mock.Mock } -type mockNode_Expecter[CHAIN_ID types.ID, RPC any] struct { +type mockNode_Expecter[CHAIN_ID types.ID, RPC interface{}] struct { mock *mock.Mock } @@ -22,7 +22,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) EXPECT() *mockNode_Expecter[CHAIN_ID, RPC] { return &mockNode_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) Close() error { ret := _m.Called() @@ -41,7 +41,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) Close() error { } // mockNode_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type mockNode_Close_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_Close_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -67,7 +67,7 @@ func (_c *mockNode_Close_Call[CHAIN_ID, RPC]) RunAndReturn(run func() error) *mo return _c } -// ConfiguredChainID provides a mock function with given fields: +// ConfiguredChainID provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { ret := _m.Called() @@ -79,14 +79,16 @@ func (_m *mockNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { if rf, ok := ret.Get(0).(func() CHAIN_ID); ok { r0 = rf() } else { - r0 = ret.Get(0).(CHAIN_ID) + if ret.Get(0) != nil { + r0 = ret.Get(0).(CHAIN_ID) + } } return r0 } // mockNode_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' -type mockNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -112,7 +114,7 @@ func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) RunAndReturn(run func( return _c } -// HighestUserObservations provides a mock function with given fields: +// HighestUserObservations provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) HighestUserObservations() ChainInfo { ret := _m.Called() @@ -131,7 +133,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) HighestUserObservations() ChainInfo { } // mockNode_HighestUserObservations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HighestUserObservations' -type mockNode_HighestUserObservations_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_HighestUserObservations_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -157,7 +159,7 @@ func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC]) RunAndReturn(run return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) Name() string { ret := _m.Called() @@ -176,7 +178,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) Name() string { } // mockNode_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type mockNode_Name_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_Name_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -202,7 +204,7 @@ func (_c *mockNode_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mo return _c } -// Order provides a mock function with given fields: +// Order provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) Order() int32 { ret := _m.Called() @@ -221,7 +223,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) Order() int32 { } // mockNode_Order_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Order' -type mockNode_Order_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_Order_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -247,7 +249,7 @@ func (_c *mockNode_Order_Call[CHAIN_ID, RPC]) RunAndReturn(run func() int32) *mo return _c } -// RPC provides a mock function with given fields: +// RPC provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) RPC() RPC { ret := _m.Called() @@ -259,14 +261,16 @@ func (_m *mockNode[CHAIN_ID, RPC]) RPC() RPC { if rf, ok := ret.Get(0).(func() RPC); ok { r0 = rf() } else { - r0 = ret.Get(0).(RPC) + if ret.Get(0) != nil { + r0 = ret.Get(0).(RPC) + } } return r0 } // mockNode_RPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPC' -type mockNode_RPC_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_RPC_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -298,7 +302,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) SetPoolChainInfoProvider(_a0 PoolChainInfoPro } // mockNode_SetPoolChainInfoProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPoolChainInfoProvider' -type mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -321,7 +325,7 @@ func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC]) Return() *mockN } func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC]) RunAndReturn(run func(PoolChainInfoProvider)) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -344,7 +348,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) Start(_a0 context.Context) error { } // mockNode_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type mockNode_Start_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_Start_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -371,7 +375,7 @@ func (_c *mockNode_Start_Call[CHAIN_ID, RPC]) RunAndReturn(run func(context.Cont return _c } -// State provides a mock function with given fields: +// State provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) State() nodeState { ret := _m.Called() @@ -390,7 +394,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) State() nodeState { } // mockNode_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' -type mockNode_State_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_State_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -416,7 +420,7 @@ func (_c *mockNode_State_Call[CHAIN_ID, RPC]) RunAndReturn(run func() nodeState) return _c } -// StateAndLatest provides a mock function with given fields: +// StateAndLatest provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) StateAndLatest() (nodeState, ChainInfo) { ret := _m.Called() @@ -445,7 +449,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) StateAndLatest() (nodeState, ChainInfo) { } // mockNode_StateAndLatest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateAndLatest' -type mockNode_StateAndLatest_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_StateAndLatest_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -471,7 +475,7 @@ func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, RPC]) RunAndReturn(run func() ( return _c } -// String provides a mock function with given fields: +// String provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) String() string { ret := _m.Called() @@ -490,7 +494,7 @@ func (_m *mockNode[CHAIN_ID, RPC]) String() string { } // mockNode_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type mockNode_String_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_String_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -516,13 +520,13 @@ func (_c *mockNode_String_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) * return _c } -// UnsubscribeAllExceptAliveLoop provides a mock function with given fields: +// UnsubscribeAllExceptAliveLoop provides a mock function with no fields func (_m *mockNode[CHAIN_ID, RPC]) UnsubscribeAllExceptAliveLoop() { _m.Called() } // mockNode_UnsubscribeAllExceptAliveLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExceptAliveLoop' -type mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID types.ID, RPC any] struct { +type mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -544,13 +548,13 @@ func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC]) Return() * } func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC]) RunAndReturn(run func()) *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) + _c.Run(run) return _c } // newMockNode creates a new instance of mockNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func newMockNode[CHAIN_ID types.ID, RPC any](t interface { +func newMockNode[CHAIN_ID types.ID, RPC interface{}](t interface { mock.TestingT Cleanup(func()) }) *mockNode[CHAIN_ID, RPC] { diff --git a/common/client/mock_pool_chain_info_provider_test.go b/common/client/mock_pool_chain_info_provider_test.go index c44f10b3f2f..7523a060329 100644 --- a/common/client/mock_pool_chain_info_provider_test.go +++ b/common/client/mock_pool_chain_info_provider_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -17,7 +17,7 @@ func (_m *mockPoolChainInfoProvider) EXPECT() *mockPoolChainInfoProvider_Expecte return &mockPoolChainInfoProvider_Expecter{mock: &_m.Mock} } -// HighestUserObservations provides a mock function with given fields: +// HighestUserObservations provides a mock function with no fields func (_m *mockPoolChainInfoProvider) HighestUserObservations() ChainInfo { ret := _m.Called() @@ -62,7 +62,7 @@ func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) RunAndReturn(r return _c } -// LatestChainInfo provides a mock function with given fields: +// LatestChainInfo provides a mock function with no fields func (_m *mockPoolChainInfoProvider) LatestChainInfo() (int, ChainInfo) { ret := _m.Called() diff --git a/common/client/mock_rpc_client_test.go b/common/client/mock_rpc_client_test.go index 396914f320b..9ad71c646e4 100644 --- a/common/client/mock_rpc_client_test.go +++ b/common/client/mock_rpc_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -38,7 +38,9 @@ func (_m *mockRPCClient[CHAIN_ID, HEAD]) ChainID(ctx context.Context) (CHAIN_ID, if rf, ok := ret.Get(0).(func(context.Context) CHAIN_ID); ok { r0 = rf(ctx) } else { - r0 = ret.Get(0).(CHAIN_ID) + if ret.Get(0) != nil { + r0 = ret.Get(0).(CHAIN_ID) + } } if rf, ok := ret.Get(1).(func(context.Context) error); ok { @@ -78,7 +80,7 @@ func (_c *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(cont return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *mockRPCClient[CHAIN_ID, HEAD]) Close() { _m.Called() } @@ -106,7 +108,7 @@ func (_c *mockRPCClient_Close_Call[CHAIN_ID, HEAD]) Return() *mockRPCClient_Clos } func (_c *mockRPCClient_Close_Call[CHAIN_ID, HEAD]) RunAndReturn(run func()) *mockRPCClient_Close_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -156,7 +158,7 @@ func (_c *mockRPCClient_Dial_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context return _c } -// GetInterceptedChainInfo provides a mock function with given fields: +// GetInterceptedChainInfo provides a mock function with no fields func (_m *mockRPCClient[CHAIN_ID, HEAD]) GetInterceptedChainInfo() (ChainInfo, ChainInfo) { ret := _m.Called() @@ -489,7 +491,7 @@ func (_c *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD]) Return() *moc } func (_c *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(...types.Subscription)) *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/common/client/mock_send_only_client_test.go b/common/client/mock_send_only_client_test.go index b47b56a8304..0def3c58a2e 100644 --- a/common/client/mock_send_only_client_test.go +++ b/common/client/mock_send_only_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -38,7 +38,9 @@ func (_m *mockSendOnlyClient[CHAIN_ID]) ChainID(_a0 context.Context) (CHAIN_ID, if rf, ok := ret.Get(0).(func(context.Context) CHAIN_ID); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(CHAIN_ID) + if ret.Get(0) != nil { + r0 = ret.Get(0).(CHAIN_ID) + } } if rf, ok := ret.Get(1).(func(context.Context) error); ok { @@ -78,7 +80,7 @@ func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) RunAndReturn(run func(conte return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *mockSendOnlyClient[CHAIN_ID]) Close() { _m.Called() } @@ -106,7 +108,7 @@ func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) Return() *mockSendOnlyClient_ } func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) RunAndReturn(run func()) *mockSendOnlyClient_Close_Call[CHAIN_ID] { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/common/client/mock_send_only_node_test.go b/common/client/mock_send_only_node_test.go index 98a6f0ba2fb..16d463df3de 100644 --- a/common/client/mock_send_only_node_test.go +++ b/common/client/mock_send_only_node_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package client @@ -10,11 +10,11 @@ import ( ) // mockSendOnlyNode is an autogenerated mock type for the SendOnlyNode type -type mockSendOnlyNode[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode[CHAIN_ID types.ID, RPC interface{}] struct { mock.Mock } -type mockSendOnlyNode_Expecter[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_Expecter[CHAIN_ID types.ID, RPC interface{}] struct { mock *mock.Mock } @@ -22,7 +22,7 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) EXPECT() *mockSendOnlyNode_Expecter[C return &mockSendOnlyNode_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Close() error { ret := _m.Called() @@ -41,7 +41,7 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Close() error { } // mockSendOnlyNode_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type mockSendOnlyNode_Close_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_Close_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -67,7 +67,7 @@ func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) RunAndReturn(run func() er return _c } -// ConfiguredChainID provides a mock function with given fields: +// ConfiguredChainID provides a mock function with no fields func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { ret := _m.Called() @@ -79,14 +79,16 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { if rf, ok := ret.Get(0).(func() CHAIN_ID); ok { r0 = rf() } else { - r0 = ret.Get(0).(CHAIN_ID) + if ret.Get(0) != nil { + r0 = ret.Get(0).(CHAIN_ID) + } } return r0 } // mockSendOnlyNode_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' -type mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -112,7 +114,7 @@ func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) RunAndReturn(r return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Name() string { ret := _m.Called() @@ -131,7 +133,7 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Name() string { } // mockSendOnlyNode_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type mockSendOnlyNode_Name_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_Name_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -157,7 +159,7 @@ func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() str return _c } -// RPC provides a mock function with given fields: +// RPC provides a mock function with no fields func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) RPC() RPC { ret := _m.Called() @@ -169,14 +171,16 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) RPC() RPC { if rf, ok := ret.Get(0).(func() RPC); ok { r0 = rf() } else { - r0 = ret.Get(0).(RPC) + if ret.Get(0) != nil { + r0 = ret.Get(0).(RPC) + } } return r0 } // mockSendOnlyNode_RPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPC' -type mockSendOnlyNode_RPC_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_RPC_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -221,7 +225,7 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Start(_a0 context.Context) error { } // mockSendOnlyNode_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type mockSendOnlyNode_Start_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_Start_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -248,7 +252,7 @@ func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) RunAndReturn(run func(cont return _c } -// State provides a mock function with given fields: +// State provides a mock function with no fields func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) State() nodeState { ret := _m.Called() @@ -267,7 +271,7 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) State() nodeState { } // mockSendOnlyNode_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' -type mockSendOnlyNode_State_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_State_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -293,7 +297,7 @@ func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) RunAndReturn(run func() no return _c } -// String provides a mock function with given fields: +// String provides a mock function with no fields func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) String() string { ret := _m.Called() @@ -312,7 +316,7 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) String() string { } // mockSendOnlyNode_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type mockSendOnlyNode_String_Call[CHAIN_ID types.ID, RPC any] struct { +type mockSendOnlyNode_String_Call[CHAIN_ID types.ID, RPC interface{}] struct { *mock.Call } @@ -340,7 +344,7 @@ func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) RunAndReturn(run func() s // newMockSendOnlyNode creates a new instance of mockSendOnlyNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func newMockSendOnlyNode[CHAIN_ID types.ID, RPC any](t interface { +func newMockSendOnlyNode[CHAIN_ID types.ID, RPC interface{}](t interface { mock.TestingT Cleanup(func()) }) *mockSendOnlyNode[CHAIN_ID, RPC] { diff --git a/common/headtracker/mocks/head_broadcaster.go b/common/headtracker/mocks/head_broadcaster.go index 87ac609e605..97ef4c4395d 100644 --- a/common/headtracker/mocks/head_broadcaster.go +++ b/common/headtracker/mocks/head_broadcaster.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -53,11 +53,11 @@ func (_c *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH]) Return() } func (_c *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH]) RunAndReturn(run func(H)) *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH] { - _c.Call.Return(run) + _c.Run(run) return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *HeadBroadcaster[H, BLOCK_HASH]) Close() error { ret := _m.Called() @@ -102,7 +102,7 @@ func (_c *HeadBroadcaster_Close_Call[H, BLOCK_HASH]) RunAndReturn(run func() err return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *HeadBroadcaster[H, BLOCK_HASH]) HealthReport() map[string]error { ret := _m.Called() @@ -149,7 +149,7 @@ func (_c *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH]) RunAndReturn(run fun return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *HeadBroadcaster[H, BLOCK_HASH]) Name() string { ret := _m.Called() @@ -194,7 +194,7 @@ func (_c *HeadBroadcaster_Name_Call[H, BLOCK_HASH]) RunAndReturn(run func() stri return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *HeadBroadcaster[H, BLOCK_HASH]) Ready() error { ret := _m.Called() @@ -301,7 +301,9 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) Subscribe(callback headtracker.HeadTra if rf, ok := ret.Get(0).(func(headtracker.HeadTrackable[H, BLOCK_HASH]) H); ok { r0 = rf(callback) } else { - r0 = ret.Get(0).(H) + if ret.Get(0) != nil { + r0 = ret.Get(0).(H) + } } if rf, ok := ret.Get(1).(func(headtracker.HeadTrackable[H, BLOCK_HASH]) func()); ok { diff --git a/common/headtracker/mocks/head_trackable.go b/common/headtracker/mocks/head_trackable.go index 50ea4665280..5475aeec254 100644 --- a/common/headtracker/mocks/head_trackable.go +++ b/common/headtracker/mocks/head_trackable.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -53,7 +53,7 @@ func (_c *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH]) Return() *HeadTra } func (_c *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH]) RunAndReturn(run func(context.Context, H)) *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH] { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/common/headtracker/mocks/head_tracker.go b/common/headtracker/mocks/head_tracker.go index e0541bdd786..97e3233fbcb 100644 --- a/common/headtracker/mocks/head_tracker.go +++ b/common/headtracker/mocks/head_tracker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -70,7 +70,7 @@ func (_c *HeadTracker_Backfill_Call[H, BLOCK_HASH]) RunAndReturn(run func(contex return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *HeadTracker[H, BLOCK_HASH]) Close() error { ret := _m.Called() @@ -115,7 +115,7 @@ func (_c *HeadTracker_Close_Call[H, BLOCK_HASH]) RunAndReturn(run func() error) return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *HeadTracker[H, BLOCK_HASH]) HealthReport() map[string]error { ret := _m.Called() @@ -179,13 +179,17 @@ func (_m *HeadTracker[H, BLOCK_HASH]) LatestAndFinalizedBlock(ctx context.Contex if rf, ok := ret.Get(0).(func(context.Context) H); ok { r0 = rf(ctx) } else { - r0 = ret.Get(0).(H) + if ret.Get(0) != nil { + r0 = ret.Get(0).(H) + } } if rf, ok := ret.Get(1).(func(context.Context) H); ok { r1 = rf(ctx) } else { - r1 = ret.Get(1).(H) + if ret.Get(1) != nil { + r1 = ret.Get(1).(H) + } } if rf, ok := ret.Get(2).(func(context.Context) error); ok { @@ -225,7 +229,7 @@ func (_c *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH]) RunAndReturn( return _c } -// LatestChain provides a mock function with given fields: +// LatestChain provides a mock function with no fields func (_m *HeadTracker[H, BLOCK_HASH]) LatestChain() H { ret := _m.Called() @@ -237,7 +241,9 @@ func (_m *HeadTracker[H, BLOCK_HASH]) LatestChain() H { if rf, ok := ret.Get(0).(func() H); ok { r0 = rf() } else { - r0 = ret.Get(0).(H) + if ret.Get(0) != nil { + r0 = ret.Get(0).(H) + } } return r0 @@ -270,7 +276,7 @@ func (_c *HeadTracker_LatestChain_Call[H, BLOCK_HASH]) RunAndReturn(run func() H return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *HeadTracker[H, BLOCK_HASH]) Name() string { ret := _m.Called() @@ -315,7 +321,7 @@ func (_c *HeadTracker_Name_Call[H, BLOCK_HASH]) RunAndReturn(run func() string) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *HeadTracker[H, BLOCK_HASH]) Ready() error { ret := _m.Called() diff --git a/common/txmgr/mocks/tx_manager.go b/common/txmgr/mocks/tx_manager.go index a296158a005..4e4c2f17bec 100644 --- a/common/txmgr/mocks/tx_manager.go +++ b/common/txmgr/mocks/tx_manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -33,7 +33,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) EXPECT return &TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close() error { ret := _m.Called() @@ -565,7 +565,9 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetFor if rf, ok := ret.Get(0).(func(context.Context, ADDR) ADDR); ok { r0 = rf(ctx, eoa) } else { - r0 = ret.Get(0).(ADDR) + if ret.Get(0) != nil { + r0 = ret.Get(0).(ADDR) + } } if rf, ok := ret.Get(1).(func(context.Context, ADDR) error); ok { @@ -622,7 +624,9 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetFor if rf, ok := ret.Get(0).(func(context.Context, ADDR, ADDR) ADDR); ok { r0 = rf(ctx, eoa, ocr2AggregatorID) } else { - r0 = ret.Get(0).(ADDR) + if ret.Get(0) != nil { + r0 = ret.Get(0).(ADDR) + } } if rf, ok := ret.Get(1).(func(context.Context, ADDR, ADDR) error); ok { @@ -721,7 +725,7 @@ func (_c *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLO return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() map[string]error { ret := _m.Called() @@ -768,7 +772,7 @@ func (_c *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() string { ret := _m.Called() @@ -843,11 +847,11 @@ func (_c *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_ } func (_c *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, HEAD)) *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready() error { ret := _m.Called() @@ -921,7 +925,7 @@ func (_c *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, B } func (_c *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(txmgr.ResumeCallback)) *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1108,7 +1112,7 @@ func (_c *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, } func (_c *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(ADDR)) *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/common/txmgr/types/mocks/forwarder_manager.go b/common/txmgr/types/mocks/forwarder_manager.go index 4582e4bac07..8ee0be73822 100644 --- a/common/txmgr/types/mocks/forwarder_manager.go +++ b/common/txmgr/types/mocks/forwarder_manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -23,7 +23,7 @@ func (_m *ForwarderManager[ADDR]) EXPECT() *ForwarderManager_Expecter[ADDR] { return &ForwarderManager_Expecter[ADDR]{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ForwarderManager[ADDR]) Close() error { ret := _m.Called() @@ -143,7 +143,9 @@ func (_m *ForwarderManager[ADDR]) ForwarderFor(ctx context.Context, addr ADDR) ( if rf, ok := ret.Get(0).(func(context.Context, ADDR) ADDR); ok { r0 = rf(ctx, addr) } else { - r0 = ret.Get(0).(ADDR) + if ret.Get(0) != nil { + r0 = ret.Get(0).(ADDR) + } } if rf, ok := ret.Get(1).(func(context.Context, ADDR) error); ok { @@ -200,7 +202,9 @@ func (_m *ForwarderManager[ADDR]) ForwarderForOCR2Feeds(ctx context.Context, eoa if rf, ok := ret.Get(0).(func(context.Context, ADDR, ADDR) ADDR); ok { r0 = rf(ctx, eoa, ocr2Aggregator) } else { - r0 = ret.Get(0).(ADDR) + if ret.Get(0) != nil { + r0 = ret.Get(0).(ADDR) + } } if rf, ok := ret.Get(1).(func(context.Context, ADDR, ADDR) error); ok { @@ -242,7 +246,7 @@ func (_c *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR]) RunAndReturn(run fu return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *ForwarderManager[ADDR]) HealthReport() map[string]error { ret := _m.Called() @@ -289,7 +293,7 @@ func (_c *ForwarderManager_HealthReport_Call[ADDR]) RunAndReturn(run func() map[ return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *ForwarderManager[ADDR]) Name() string { ret := _m.Called() @@ -334,7 +338,7 @@ func (_c *ForwarderManager_Name_Call[ADDR]) RunAndReturn(run func() string) *For return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *ForwarderManager[ADDR]) Ready() error { ret := _m.Called() diff --git a/common/txmgr/types/mocks/key_store.go b/common/txmgr/types/mocks/key_store.go index 18161301b22..942d2773d9b 100644 --- a/common/txmgr/types/mocks/key_store.go +++ b/common/txmgr/types/mocks/key_store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/common/txmgr/types/mocks/tx_attempt_builder.go b/common/txmgr/types/mocks/tx_attempt_builder.go index 746e580413c..d20b8249050 100644 --- a/common/txmgr/types/mocks/tx_attempt_builder.go +++ b/common/txmgr/types/mocks/tx_attempt_builder.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -28,7 +28,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return &TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close() error { ret := _m.Called() @@ -73,7 +73,7 @@ func (_c *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() map[string]error { ret := _m.Called() @@ -120,7 +120,7 @@ func (_c *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOC return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() string { ret := _m.Called() @@ -190,7 +190,9 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger) FEE); ok { r1 = rf(ctx, tx, previousAttempt, priorAttempts, lggr) } else { - r1 = ret.Get(1).(FEE) + if ret.Get(1) != nil { + r1 = ret.Get(1).(FEE) + } } if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger) uint64); ok { @@ -464,7 +466,9 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) FEE); ok { r1 = rf(ctx, tx, lggr, opts...) } else { - r1 = ret.Get(1).(FEE) + if ret.Get(1) != nil { + r1 = ret.Get(1).(FEE) + } } if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) uint64); ok { @@ -558,7 +562,9 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) FEE); ok { r1 = rf(ctx, tx, lggr, txType, opts...) } else { - r1 = ret.Get(1).(FEE) + if ret.Get(1) != nil { + r1 = ret.Get(1).(FEE) + } } if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) uint64); ok { @@ -651,11 +657,11 @@ func (_c *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, } func (_c *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, HEAD)) *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready() error { ret := _m.Called() diff --git a/common/txmgr/types/mocks/tx_store.go b/common/txmgr/types/mocks/tx_store.go index b75ee69302a..0c3b4d93258 100644 --- a/common/txmgr/types/mocks/tx_store.go +++ b/common/txmgr/types/mocks/tx_store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -130,7 +130,7 @@ func (_c *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Close() { _m.Called() } @@ -158,7 +158,7 @@ func (_c *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) } func (_c *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func()) *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -571,7 +571,9 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindLatestS if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) SEQ); ok { r0 = rf(ctx, fromAddress, chainID) } else { - r0 = ret.Get(0).(SEQ) + if ret.Get(0) != nil { + r0 = ret.Get(0).(SEQ) + } } if rf, ok := ret.Get(1).(func(context.Context, ADDR, CHAIN_ID) error); ok { diff --git a/common/txmgr/types/mocks/tx_strategy.go b/common/txmgr/types/mocks/tx_strategy.go index b4f344d4424..98b6343ca9a 100644 --- a/common/txmgr/types/mocks/tx_strategy.go +++ b/common/txmgr/types/mocks/tx_strategy.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -83,7 +83,7 @@ func (_c *TxStrategy_PruneQueue_Call) RunAndReturn(run func(context.Context, typ return _c } -// Subject provides a mock function with given fields: +// Subject provides a mock function with no fields func (_m *TxStrategy) Subject() uuid.NullUUID { ret := _m.Called() diff --git a/common/types/mocks/head.go b/common/types/mocks/head.go index 85bef18a0be..b00c155ccc7 100644 --- a/common/types/mocks/head.go +++ b/common/types/mocks/head.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *Head[BLOCK_HASH]) EXPECT() *Head_Expecter[BLOCK_HASH] { return &Head_Expecter[BLOCK_HASH]{mock: &_m.Mock} } -// BlockDifficulty provides a mock function with given fields: +// BlockDifficulty provides a mock function with no fields func (_m *Head[BLOCK_HASH]) BlockDifficulty() *big.Int { ret := _m.Called() @@ -71,7 +71,7 @@ func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) RunAndReturn(run func() *big.In return _c } -// BlockHash provides a mock function with given fields: +// BlockHash provides a mock function with no fields func (_m *Head[BLOCK_HASH]) BlockHash() BLOCK_HASH { ret := _m.Called() @@ -83,7 +83,9 @@ func (_m *Head[BLOCK_HASH]) BlockHash() BLOCK_HASH { if rf, ok := ret.Get(0).(func() BLOCK_HASH); ok { r0 = rf() } else { - r0 = ret.Get(0).(BLOCK_HASH) + if ret.Get(0) != nil { + r0 = ret.Get(0).(BLOCK_HASH) + } } return r0 @@ -116,7 +118,7 @@ func (_c *Head_BlockHash_Call[BLOCK_HASH]) RunAndReturn(run func() BLOCK_HASH) * return _c } -// BlockNumber provides a mock function with given fields: +// BlockNumber provides a mock function with no fields func (_m *Head[BLOCK_HASH]) BlockNumber() int64 { ret := _m.Called() @@ -161,7 +163,7 @@ func (_c *Head_BlockNumber_Call[BLOCK_HASH]) RunAndReturn(run func() int64) *Hea return _c } -// ChainLength provides a mock function with given fields: +// ChainLength provides a mock function with no fields func (_m *Head[BLOCK_HASH]) ChainLength() uint32 { ret := _m.Called() @@ -206,7 +208,7 @@ func (_c *Head_ChainLength_Call[BLOCK_HASH]) RunAndReturn(run func() uint32) *He return _c } -// EarliestHeadInChain provides a mock function with given fields: +// EarliestHeadInChain provides a mock function with no fields func (_m *Head[BLOCK_HASH]) EarliestHeadInChain() types.Head[BLOCK_HASH] { ret := _m.Called() @@ -253,7 +255,7 @@ func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) RunAndReturn(run func() typ return _c } -// GetParent provides a mock function with given fields: +// GetParent provides a mock function with no fields func (_m *Head[BLOCK_HASH]) GetParent() types.Head[BLOCK_HASH] { ret := _m.Called() @@ -300,7 +302,7 @@ func (_c *Head_GetParent_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BL return _c } -// GetParentHash provides a mock function with given fields: +// GetParentHash provides a mock function with no fields func (_m *Head[BLOCK_HASH]) GetParentHash() BLOCK_HASH { ret := _m.Called() @@ -312,7 +314,9 @@ func (_m *Head[BLOCK_HASH]) GetParentHash() BLOCK_HASH { if rf, ok := ret.Get(0).(func() BLOCK_HASH); ok { r0 = rf() } else { - r0 = ret.Get(0).(BLOCK_HASH) + if ret.Get(0) != nil { + r0 = ret.Get(0).(BLOCK_HASH) + } } return r0 @@ -345,7 +349,7 @@ func (_c *Head_GetParentHash_Call[BLOCK_HASH]) RunAndReturn(run func() BLOCK_HAS return _c } -// GetTimestamp provides a mock function with given fields: +// GetTimestamp provides a mock function with no fields func (_m *Head[BLOCK_HASH]) GetTimestamp() time.Time { ret := _m.Called() @@ -402,7 +406,9 @@ func (_m *Head[BLOCK_HASH]) HashAtHeight(blockNum int64) BLOCK_HASH { if rf, ok := ret.Get(0).(func(int64) BLOCK_HASH); ok { r0 = rf(blockNum) } else { - r0 = ret.Get(0).(BLOCK_HASH) + if ret.Get(0) != nil { + r0 = ret.Get(0).(BLOCK_HASH) + } } return r0 @@ -494,7 +500,7 @@ func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) RunAndReturn(run func(int64) (type return _c } -// IsValid provides a mock function with given fields: +// IsValid provides a mock function with no fields func (_m *Head[BLOCK_HASH]) IsValid() bool { ret := _m.Called() @@ -539,7 +545,7 @@ func (_c *Head_IsValid_Call[BLOCK_HASH]) RunAndReturn(run func() bool) *Head_IsV return _c } -// LatestFinalizedHead provides a mock function with given fields: +// LatestFinalizedHead provides a mock function with no fields func (_m *Head[BLOCK_HASH]) LatestFinalizedHead() types.Head[BLOCK_HASH] { ret := _m.Called() diff --git a/common/types/mocks/monitoring_endpoint.go b/common/types/mocks/monitoring_endpoint.go index d88be7cbf3f..892391d79a3 100644 --- a/common/types/mocks/monitoring_endpoint.go +++ b/common/types/mocks/monitoring_endpoint.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -46,7 +46,7 @@ func (_c *MonitoringEndpoint_SendLog_Call) Return() *MonitoringEndpoint_SendLog_ } func (_c *MonitoringEndpoint_SendLog_Call) RunAndReturn(run func([]byte)) *MonitoringEndpoint_SendLog_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/common/types/mocks/subscription.go b/common/types/mocks/subscription.go index b0b87c7287a..6c0764683b0 100644 --- a/common/types/mocks/subscription.go +++ b/common/types/mocks/subscription.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -17,7 +17,7 @@ func (_m *Subscription) EXPECT() *Subscription_Expecter { return &Subscription_Expecter{mock: &_m.Mock} } -// Err provides a mock function with given fields: +// Err provides a mock function with no fields func (_m *Subscription) Err() <-chan error { ret := _m.Called() @@ -64,7 +64,7 @@ func (_c *Subscription_Err_Call) RunAndReturn(run func() <-chan error) *Subscrip return _c } -// Unsubscribe provides a mock function with given fields: +// Unsubscribe provides a mock function with no fields func (_m *Subscription) Unsubscribe() { _m.Called() } @@ -92,7 +92,7 @@ func (_c *Subscription_Unsubscribe_Call) Return() *Subscription_Unsubscribe_Call } func (_c *Subscription_Unsubscribe_Call) RunAndReturn(run func()) *Subscription_Unsubscribe_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/contracts/GNUmakefile b/contracts/GNUmakefile index 7361754ee0b..e9d87385b52 100644 --- a/contracts/GNUmakefile +++ b/contracts/GNUmakefile @@ -39,7 +39,7 @@ abigen: ## Build & install abigen. .PHONY: mockery mockery: $(mockery) ## Install mockery. - go install github.com/vektra/mockery/v2@v2.43.2 + go install github.com/vektra/mockery/v2@v2.50.0 .PHONY: foundry foundry: ## Install foundry. diff --git a/core/bridges/mocks/orm.go b/core/bridges/mocks/orm.go index 54dd6ef4d3c..d1ecd7c6adc 100644 --- a/core/bridges/mocks/orm.go +++ b/core/bridges/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/capabilities/ccip/types/mocks/ccip_oracle.go b/core/capabilities/ccip/types/mocks/ccip_oracle.go index 5ab860cc62e..5f1b7202e52 100644 --- a/core/capabilities/ccip/types/mocks/ccip_oracle.go +++ b/core/capabilities/ccip/types/mocks/ccip_oracle.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -17,7 +17,7 @@ func (_m *CCIPOracle) EXPECT() *CCIPOracle_Expecter { return &CCIPOracle_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *CCIPOracle) Close() error { ret := _m.Called() @@ -62,7 +62,7 @@ func (_c *CCIPOracle_Close_Call) RunAndReturn(run func() error) *CCIPOracle_Clos return _c } -// Start provides a mock function with given fields: +// Start provides a mock function with no fields func (_m *CCIPOracle) Start() error { ret := _m.Called() diff --git a/core/capabilities/ccip/types/mocks/oracle_creator.go b/core/capabilities/ccip/types/mocks/oracle_creator.go index 1906df7e063..3618e70e7b7 100644 --- a/core/capabilities/ccip/types/mocks/oracle_creator.go +++ b/core/capabilities/ccip/types/mocks/oracle_creator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -82,7 +82,7 @@ func (_c *OracleCreator_Create_Call) RunAndReturn(run func(context.Context, uint return _c } -// Type provides a mock function with given fields: +// Type provides a mock function with no fields func (_m *OracleCreator) Type() types.OracleType { ret := _m.Called() diff --git a/core/capabilities/remote/types/mocks/dispatcher.go b/core/capabilities/remote/types/mocks/dispatcher.go index d7f2ab45bac..161cec75b2f 100644 --- a/core/capabilities/remote/types/mocks/dispatcher.go +++ b/core/capabilities/remote/types/mocks/dispatcher.go @@ -1,11 +1,11 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks import ( context "context" - p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" mock "github.com/stretchr/testify/mock" types "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" @@ -24,7 +24,7 @@ func (_m *Dispatcher) EXPECT() *Dispatcher_Expecter { return &Dispatcher_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Dispatcher) Close() error { ret := _m.Called() @@ -69,7 +69,7 @@ func (_c *Dispatcher_Close_Call) RunAndReturn(run func() error) *Dispatcher_Clos return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *Dispatcher) HealthReport() map[string]error { ret := _m.Called() @@ -116,7 +116,7 @@ func (_c *Dispatcher_HealthReport_Call) RunAndReturn(run func() map[string]error return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *Dispatcher) Name() string { ret := _m.Called() @@ -161,7 +161,7 @@ func (_c *Dispatcher_Name_Call) RunAndReturn(run func() string) *Dispatcher_Name return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *Dispatcher) Ready() error { ret := _m.Called() @@ -236,12 +236,12 @@ func (_c *Dispatcher_RemoveReceiver_Call) Return() *Dispatcher_RemoveReceiver_Ca } func (_c *Dispatcher_RemoveReceiver_Call) RunAndReturn(run func(string, uint32)) *Dispatcher_RemoveReceiver_Call { - _c.Call.Return(run) + _c.Run(run) return _c } // Send provides a mock function with given fields: peerID, msgBody -func (_m *Dispatcher) Send(peerID p2ptypes.PeerID, msgBody *types.MessageBody) error { +func (_m *Dispatcher) Send(peerID ragep2ptypes.PeerID, msgBody *types.MessageBody) error { ret := _m.Called(peerID, msgBody) if len(ret) == 0 { @@ -249,7 +249,7 @@ func (_m *Dispatcher) Send(peerID p2ptypes.PeerID, msgBody *types.MessageBody) e } var r0 error - if rf, ok := ret.Get(0).(func(p2ptypes.PeerID, *types.MessageBody) error); ok { + if rf, ok := ret.Get(0).(func(ragep2ptypes.PeerID, *types.MessageBody) error); ok { r0 = rf(peerID, msgBody) } else { r0 = ret.Error(0) @@ -264,15 +264,15 @@ type Dispatcher_Send_Call struct { } // Send is a helper method to define mock.On call -// - peerID p2ptypes.PeerID +// - peerID ragep2ptypes.PeerID // - msgBody *types.MessageBody func (_e *Dispatcher_Expecter) Send(peerID interface{}, msgBody interface{}) *Dispatcher_Send_Call { return &Dispatcher_Send_Call{Call: _e.mock.On("Send", peerID, msgBody)} } -func (_c *Dispatcher_Send_Call) Run(run func(peerID p2ptypes.PeerID, msgBody *types.MessageBody)) *Dispatcher_Send_Call { +func (_c *Dispatcher_Send_Call) Run(run func(peerID ragep2ptypes.PeerID, msgBody *types.MessageBody)) *Dispatcher_Send_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(p2ptypes.PeerID), args[1].(*types.MessageBody)) + run(args[0].(ragep2ptypes.PeerID), args[1].(*types.MessageBody)) }) return _c } @@ -282,7 +282,7 @@ func (_c *Dispatcher_Send_Call) Return(_a0 error) *Dispatcher_Send_Call { return _c } -func (_c *Dispatcher_Send_Call) RunAndReturn(run func(p2ptypes.PeerID, *types.MessageBody) error) *Dispatcher_Send_Call { +func (_c *Dispatcher_Send_Call) RunAndReturn(run func(ragep2ptypes.PeerID, *types.MessageBody) error) *Dispatcher_Send_Call { _c.Call.Return(run) return _c } diff --git a/core/capabilities/remote/types/mocks/receiver.go b/core/capabilities/remote/types/mocks/receiver.go index e14e4d0e98f..143c57ab079 100644 --- a/core/capabilities/remote/types/mocks/receiver.go +++ b/core/capabilities/remote/types/mocks/receiver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -52,7 +52,7 @@ func (_c *Receiver_Receive_Call) Return() *Receiver_Receive_Call { } func (_c *Receiver_Receive_Call) RunAndReturn(run func(context.Context, *types.MessageBody)) *Receiver_Receive_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/capabilities/targets/mocks/contract_value_getter.go b/core/capabilities/targets/mocks/contract_value_getter.go index b662562ba44..e342442e3a5 100644 --- a/core/capabilities/targets/mocks/contract_value_getter.go +++ b/core/capabilities/targets/mocks/contract_value_getter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -72,7 +72,7 @@ func (_c *ContractValueGetter_Bind_Call) RunAndReturn(run func(context.Context, } // GetLatestValue provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 -func (_m *ContractValueGetter) GetLatestValue(_a0 context.Context, _a1 string, _a2 primitives.ConfidenceLevel, _a3 any, _a4 any) error { +func (_m *ContractValueGetter) GetLatestValue(_a0 context.Context, _a1 string, _a2 primitives.ConfidenceLevel, _a3 interface{}, _a4 interface{}) error { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) if len(ret) == 0 { @@ -80,7 +80,7 @@ func (_m *ContractValueGetter) GetLatestValue(_a0 context.Context, _a1 string, _ } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, primitives.ConfidenceLevel, any, any) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, primitives.ConfidenceLevel, interface{}, interface{}) error); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) } else { r0 = ret.Error(0) @@ -98,15 +98,15 @@ type ContractValueGetter_GetLatestValue_Call struct { // - _a0 context.Context // - _a1 string // - _a2 primitives.ConfidenceLevel -// - _a3 any -// - _a4 any +// - _a3 interface{} +// - _a4 interface{} func (_e *ContractValueGetter_Expecter) GetLatestValue(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *ContractValueGetter_GetLatestValue_Call { return &ContractValueGetter_GetLatestValue_Call{Call: _e.mock.On("GetLatestValue", _a0, _a1, _a2, _a3, _a4)} } -func (_c *ContractValueGetter_GetLatestValue_Call) Run(run func(_a0 context.Context, _a1 string, _a2 primitives.ConfidenceLevel, _a3 any, _a4 any)) *ContractValueGetter_GetLatestValue_Call { +func (_c *ContractValueGetter_GetLatestValue_Call) Run(run func(_a0 context.Context, _a1 string, _a2 primitives.ConfidenceLevel, _a3 interface{}, _a4 interface{})) *ContractValueGetter_GetLatestValue_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(primitives.ConfidenceLevel), args[3].(any), args[4].(any)) + run(args[0].(context.Context), args[1].(string), args[2].(primitives.ConfidenceLevel), args[3].(interface{}), args[4].(interface{})) }) return _c } @@ -116,7 +116,7 @@ func (_c *ContractValueGetter_GetLatestValue_Call) Return(_a0 error) *ContractVa return _c } -func (_c *ContractValueGetter_GetLatestValue_Call) RunAndReturn(run func(context.Context, string, primitives.ConfidenceLevel, any, any) error) *ContractValueGetter_GetLatestValue_Call { +func (_c *ContractValueGetter_GetLatestValue_Call) RunAndReturn(run func(context.Context, string, primitives.ConfidenceLevel, interface{}, interface{}) error) *ContractValueGetter_GetLatestValue_Call { _c.Call.Return(run) return _c } diff --git a/core/capabilities/targets/mocks/contract_writer.go b/core/capabilities/targets/mocks/contract_writer.go index c6128e68fc7..55eb88b9ce2 100644 --- a/core/capabilities/targets/mocks/contract_writer.go +++ b/core/capabilities/targets/mocks/contract_writer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *ContractWriter) EXPECT() *ContractWriter_Expecter { return &ContractWriter_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ContractWriter) Close() error { ret := _m.Called() @@ -184,7 +184,7 @@ func (_c *ContractWriter_GetTransactionStatus_Call) RunAndReturn(run func(contex return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *ContractWriter) HealthReport() map[string]error { ret := _m.Called() @@ -231,7 +231,7 @@ func (_c *ContractWriter_HealthReport_Call) RunAndReturn(run func() map[string]e return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *ContractWriter) Name() string { ret := _m.Called() @@ -276,7 +276,7 @@ func (_c *ContractWriter_Name_Call) RunAndReturn(run func() string) *ContractWri return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *ContractWriter) Ready() error { ret := _m.Called() @@ -368,7 +368,7 @@ func (_c *ContractWriter_Start_Call) RunAndReturn(run func(context.Context) erro } // SubmitTransaction provides a mock function with given fields: ctx, contractName, method, args, transactionID, toAddress, meta, value -func (_m *ContractWriter) SubmitTransaction(ctx context.Context, contractName string, method string, args any, transactionID string, toAddress string, meta *types.TxMeta, value *big.Int) error { +func (_m *ContractWriter) SubmitTransaction(ctx context.Context, contractName string, method string, args interface{}, transactionID string, toAddress string, meta *types.TxMeta, value *big.Int) error { ret := _m.Called(ctx, contractName, method, args, transactionID, toAddress, meta, value) if len(ret) == 0 { @@ -376,7 +376,7 @@ func (_m *ContractWriter) SubmitTransaction(ctx context.Context, contractName st } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, any, string, string, *types.TxMeta, *big.Int) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, string, string, *types.TxMeta, *big.Int) error); ok { r0 = rf(ctx, contractName, method, args, transactionID, toAddress, meta, value) } else { r0 = ret.Error(0) @@ -394,7 +394,7 @@ type ContractWriter_SubmitTransaction_Call struct { // - ctx context.Context // - contractName string // - method string -// - args any +// - args interface{} // - transactionID string // - toAddress string // - meta *types.TxMeta @@ -403,9 +403,9 @@ func (_e *ContractWriter_Expecter) SubmitTransaction(ctx interface{}, contractNa return &ContractWriter_SubmitTransaction_Call{Call: _e.mock.On("SubmitTransaction", ctx, contractName, method, args, transactionID, toAddress, meta, value)} } -func (_c *ContractWriter_SubmitTransaction_Call) Run(run func(ctx context.Context, contractName string, method string, args any, transactionID string, toAddress string, meta *types.TxMeta, value *big.Int)) *ContractWriter_SubmitTransaction_Call { +func (_c *ContractWriter_SubmitTransaction_Call) Run(run func(ctx context.Context, contractName string, method string, args interface{}, transactionID string, toAddress string, meta *types.TxMeta, value *big.Int)) *ContractWriter_SubmitTransaction_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(any), args[4].(string), args[5].(string), args[6].(*types.TxMeta), args[7].(*big.Int)) + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(interface{}), args[4].(string), args[5].(string), args[6].(*types.TxMeta), args[7].(*big.Int)) }) return _c } @@ -415,7 +415,7 @@ func (_c *ContractWriter_SubmitTransaction_Call) Return(_a0 error) *ContractWrit return _c } -func (_c *ContractWriter_SubmitTransaction_Call) RunAndReturn(run func(context.Context, string, string, any, string, string, *types.TxMeta, *big.Int) error) *ContractWriter_SubmitTransaction_Call { +func (_c *ContractWriter_SubmitTransaction_Call) RunAndReturn(run func(context.Context, string, string, interface{}, string, string, *types.TxMeta, *big.Int) error) *ContractWriter_SubmitTransaction_Call { _c.Call.Return(run) return _c } diff --git a/core/chains/evm/client/mocks/client.go b/core/chains/evm/client/mocks/client.go index 25ed3698fe9..b55c608a590 100644 --- a/core/chains/evm/client/mocks/client.go +++ b/core/chains/evm/client/mocks/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -481,7 +481,7 @@ func (_c *Client_CheckTxValidity_Call) RunAndReturn(run func(context.Context, co return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Client) Close() { _m.Called() } @@ -509,7 +509,7 @@ func (_c *Client_Close_Call) Return() *Client_Close_Call { } func (_c *Client_Close_Call) RunAndReturn(run func()) *Client_Close_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -573,7 +573,7 @@ func (_c *Client_CodeAt_Call) RunAndReturn(run func(context.Context, common.Addr return _c } -// ConfiguredChainID provides a mock function with given fields: +// ConfiguredChainID provides a mock function with no fields func (_m *Client) ConfiguredChainID() *big.Int { ret := _m.Called() @@ -1079,7 +1079,7 @@ func (_c *Client_HeaderByNumber_Call) RunAndReturn(run func(context.Context, *bi return _c } -// IsL2 provides a mock function with given fields: +// IsL2 provides a mock function with no fields func (_m *Client) IsL2() bool { ret := _m.Called() @@ -1300,7 +1300,7 @@ func (_c *Client_LatestFinalizedBlock_Call) RunAndReturn(run func(context.Contex return _c } -// NodeStates provides a mock function with given fields: +// NodeStates provides a mock function with no fields func (_m *Client) NodeStates() map[string]string { ret := _m.Called() diff --git a/core/chains/evm/config/mocks/chain_scoped_config.go b/core/chains/evm/config/mocks/chain_scoped_config.go index a2fe703f98f..000d2a7287c 100644 --- a/core/chains/evm/config/mocks/chain_scoped_config.go +++ b/core/chains/evm/config/mocks/chain_scoped_config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -20,7 +20,7 @@ func (_m *ChainScopedConfig) EXPECT() *ChainScopedConfig_Expecter { return &ChainScopedConfig_Expecter{mock: &_m.Mock} } -// EVM provides a mock function with given fields: +// EVM provides a mock function with no fields func (_m *ChainScopedConfig) EVM() config.EVM { ret := _m.Called() diff --git a/core/chains/evm/config/mocks/gas_estimator.go b/core/chains/evm/config/mocks/gas_estimator.go index 1ead5e68917..2f36086f947 100644 --- a/core/chains/evm/config/mocks/gas_estimator.go +++ b/core/chains/evm/config/mocks/gas_estimator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *GasEstimator) EXPECT() *GasEstimator_Expecter { return &GasEstimator_Expecter{mock: &_m.Mock} } -// BlockHistory provides a mock function with given fields: +// BlockHistory provides a mock function with no fields func (_m *GasEstimator) BlockHistory() config.BlockHistory { ret := _m.Called() @@ -71,7 +71,7 @@ func (_c *GasEstimator_BlockHistory_Call) RunAndReturn(run func() config.BlockHi return _c } -// BumpMin provides a mock function with given fields: +// BumpMin provides a mock function with no fields func (_m *GasEstimator) BumpMin() *assets.Wei { ret := _m.Called() @@ -118,7 +118,7 @@ func (_c *GasEstimator_BumpMin_Call) RunAndReturn(run func() *assets.Wei) *GasEs return _c } -// BumpPercent provides a mock function with given fields: +// BumpPercent provides a mock function with no fields func (_m *GasEstimator) BumpPercent() uint16 { ret := _m.Called() @@ -163,7 +163,7 @@ func (_c *GasEstimator_BumpPercent_Call) RunAndReturn(run func() uint16) *GasEst return _c } -// BumpThreshold provides a mock function with given fields: +// BumpThreshold provides a mock function with no fields func (_m *GasEstimator) BumpThreshold() uint64 { ret := _m.Called() @@ -208,7 +208,7 @@ func (_c *GasEstimator_BumpThreshold_Call) RunAndReturn(run func() uint64) *GasE return _c } -// BumpTxDepth provides a mock function with given fields: +// BumpTxDepth provides a mock function with no fields func (_m *GasEstimator) BumpTxDepth() uint32 { ret := _m.Called() @@ -253,7 +253,7 @@ func (_c *GasEstimator_BumpTxDepth_Call) RunAndReturn(run func() uint32) *GasEst return _c } -// DAOracle provides a mock function with given fields: +// DAOracle provides a mock function with no fields func (_m *GasEstimator) DAOracle() config.DAOracle { ret := _m.Called() @@ -300,7 +300,7 @@ func (_c *GasEstimator_DAOracle_Call) RunAndReturn(run func() config.DAOracle) * return _c } -// EIP1559DynamicFees provides a mock function with given fields: +// EIP1559DynamicFees provides a mock function with no fields func (_m *GasEstimator) EIP1559DynamicFees() bool { ret := _m.Called() @@ -345,7 +345,7 @@ func (_c *GasEstimator_EIP1559DynamicFees_Call) RunAndReturn(run func() bool) *G return _c } -// EstimateLimit provides a mock function with given fields: +// EstimateLimit provides a mock function with no fields func (_m *GasEstimator) EstimateLimit() bool { ret := _m.Called() @@ -390,7 +390,7 @@ func (_c *GasEstimator_EstimateLimit_Call) RunAndReturn(run func() bool) *GasEst return _c } -// FeeCapDefault provides a mock function with given fields: +// FeeCapDefault provides a mock function with no fields func (_m *GasEstimator) FeeCapDefault() *assets.Wei { ret := _m.Called() @@ -437,7 +437,7 @@ func (_c *GasEstimator_FeeCapDefault_Call) RunAndReturn(run func() *assets.Wei) return _c } -// FeeHistory provides a mock function with given fields: +// FeeHistory provides a mock function with no fields func (_m *GasEstimator) FeeHistory() config.FeeHistory { ret := _m.Called() @@ -484,7 +484,7 @@ func (_c *GasEstimator_FeeHistory_Call) RunAndReturn(run func() config.FeeHistor return _c } -// LimitDefault provides a mock function with given fields: +// LimitDefault provides a mock function with no fields func (_m *GasEstimator) LimitDefault() uint64 { ret := _m.Called() @@ -529,7 +529,7 @@ func (_c *GasEstimator_LimitDefault_Call) RunAndReturn(run func() uint64) *GasEs return _c } -// LimitJobType provides a mock function with given fields: +// LimitJobType provides a mock function with no fields func (_m *GasEstimator) LimitJobType() config.LimitJobType { ret := _m.Called() @@ -576,7 +576,7 @@ func (_c *GasEstimator_LimitJobType_Call) RunAndReturn(run func() config.LimitJo return _c } -// LimitMax provides a mock function with given fields: +// LimitMax provides a mock function with no fields func (_m *GasEstimator) LimitMax() uint64 { ret := _m.Called() @@ -621,7 +621,7 @@ func (_c *GasEstimator_LimitMax_Call) RunAndReturn(run func() uint64) *GasEstima return _c } -// LimitMultiplier provides a mock function with given fields: +// LimitMultiplier provides a mock function with no fields func (_m *GasEstimator) LimitMultiplier() float32 { ret := _m.Called() @@ -666,7 +666,7 @@ func (_c *GasEstimator_LimitMultiplier_Call) RunAndReturn(run func() float32) *G return _c } -// LimitTransfer provides a mock function with given fields: +// LimitTransfer provides a mock function with no fields func (_m *GasEstimator) LimitTransfer() uint64 { ret := _m.Called() @@ -711,7 +711,7 @@ func (_c *GasEstimator_LimitTransfer_Call) RunAndReturn(run func() uint64) *GasE return _c } -// Mode provides a mock function with given fields: +// Mode provides a mock function with no fields func (_m *GasEstimator) Mode() string { ret := _m.Called() @@ -756,7 +756,7 @@ func (_c *GasEstimator_Mode_Call) RunAndReturn(run func() string) *GasEstimator_ return _c } -// PriceDefault provides a mock function with given fields: +// PriceDefault provides a mock function with no fields func (_m *GasEstimator) PriceDefault() *assets.Wei { ret := _m.Called() @@ -803,7 +803,7 @@ func (_c *GasEstimator_PriceDefault_Call) RunAndReturn(run func() *assets.Wei) * return _c } -// PriceMax provides a mock function with given fields: +// PriceMax provides a mock function with no fields func (_m *GasEstimator) PriceMax() *assets.Wei { ret := _m.Called() @@ -898,7 +898,7 @@ func (_c *GasEstimator_PriceMaxKey_Call) RunAndReturn(run func(common.Address) * return _c } -// PriceMin provides a mock function with given fields: +// PriceMin provides a mock function with no fields func (_m *GasEstimator) PriceMin() *assets.Wei { ret := _m.Called() @@ -945,7 +945,7 @@ func (_c *GasEstimator_PriceMin_Call) RunAndReturn(run func() *assets.Wei) *GasE return _c } -// TipCapDefault provides a mock function with given fields: +// TipCapDefault provides a mock function with no fields func (_m *GasEstimator) TipCapDefault() *assets.Wei { ret := _m.Called() @@ -992,7 +992,7 @@ func (_c *GasEstimator_TipCapDefault_Call) RunAndReturn(run func() *assets.Wei) return _c } -// TipCapMin provides a mock function with given fields: +// TipCapMin provides a mock function with no fields func (_m *GasEstimator) TipCapMin() *assets.Wei { ret := _m.Called() diff --git a/core/chains/evm/forwarders/mocks/orm.go b/core/chains/evm/forwarders/mocks/orm.go index 860ddef855b..a98769ee8cc 100644 --- a/core/chains/evm/forwarders/mocks/orm.go +++ b/core/chains/evm/forwarders/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/chains/evm/gas/mocks/evm_estimator.go b/core/chains/evm/gas/mocks/evm_estimator.go index 159adb1a037..13f8d210e64 100644 --- a/core/chains/evm/gas/mocks/evm_estimator.go +++ b/core/chains/evm/gas/mocks/evm_estimator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -159,7 +159,7 @@ func (_c *EvmEstimator_BumpLegacyGas_Call) RunAndReturn(run func(context.Context return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *EvmEstimator) Close() error { ret := _m.Called() @@ -344,7 +344,7 @@ func (_c *EvmEstimator_GetLegacyGas_Call) RunAndReturn(run func(context.Context, return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *EvmEstimator) HealthReport() map[string]error { ret := _m.Called() @@ -391,7 +391,7 @@ func (_c *EvmEstimator_HealthReport_Call) RunAndReturn(run func() map[string]err return _c } -// L1Oracle provides a mock function with given fields: +// L1Oracle provides a mock function with no fields func (_m *EvmEstimator) L1Oracle() rollups.L1Oracle { ret := _m.Called() @@ -438,7 +438,7 @@ func (_c *EvmEstimator_L1Oracle_Call) RunAndReturn(run func() rollups.L1Oracle) return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *EvmEstimator) Name() string { ret := _m.Called() @@ -513,11 +513,11 @@ func (_c *EvmEstimator_OnNewLongestChain_Call) Return() *EvmEstimator_OnNewLonge } func (_c *EvmEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *evmtypes.Head)) *EvmEstimator_OnNewLongestChain_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *EvmEstimator) Ready() error { ret := _m.Called() diff --git a/core/chains/evm/gas/mocks/evm_fee_estimator.go b/core/chains/evm/gas/mocks/evm_fee_estimator.go index d0802f81ebd..9a8a9e456a7 100644 --- a/core/chains/evm/gas/mocks/evm_fee_estimator.go +++ b/core/chains/evm/gas/mocks/evm_fee_estimator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -102,7 +102,7 @@ func (_c *EvmFeeEstimator_BumpFee_Call) RunAndReturn(run func(context.Context, g return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *EvmFeeEstimator) Close() error { ret := _m.Called() @@ -309,7 +309,7 @@ func (_c *EvmFeeEstimator_GetMaxCost_Call) RunAndReturn(run func(context.Context return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *EvmFeeEstimator) HealthReport() map[string]error { ret := _m.Called() @@ -356,7 +356,7 @@ func (_c *EvmFeeEstimator_HealthReport_Call) RunAndReturn(run func() map[string] return _c } -// L1Oracle provides a mock function with given fields: +// L1Oracle provides a mock function with no fields func (_m *EvmFeeEstimator) L1Oracle() rollups.L1Oracle { ret := _m.Called() @@ -403,7 +403,7 @@ func (_c *EvmFeeEstimator_L1Oracle_Call) RunAndReturn(run func() rollups.L1Oracl return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *EvmFeeEstimator) Name() string { ret := _m.Called() @@ -478,11 +478,11 @@ func (_c *EvmFeeEstimator_OnNewLongestChain_Call) Return() *EvmFeeEstimator_OnNe } func (_c *EvmFeeEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *evmtypes.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *EvmFeeEstimator) Ready() error { ret := _m.Called() diff --git a/core/chains/evm/gas/mocks/fee_estimator_client.go b/core/chains/evm/gas/mocks/fee_estimator_client.go index 782c897923b..e44c4f9d029 100644 --- a/core/chains/evm/gas/mocks/fee_estimator_client.go +++ b/core/chains/evm/gas/mocks/fee_estimator_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/chains/evm/gas/mocks/fee_history_estimator_client.go b/core/chains/evm/gas/mocks/fee_history_estimator_client.go index 24ad7e23ad9..19cadd700e8 100644 --- a/core/chains/evm/gas/mocks/fee_history_estimator_client.go +++ b/core/chains/evm/gas/mocks/fee_history_estimator_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/chains/evm/gas/rollups/mocks/l1_oracle.go b/core/chains/evm/gas/rollups/mocks/l1_oracle.go index 4ed067663e2..24246a9b30d 100644 --- a/core/chains/evm/gas/rollups/mocks/l1_oracle.go +++ b/core/chains/evm/gas/rollups/mocks/l1_oracle.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -23,7 +23,7 @@ func (_m *L1Oracle) EXPECT() *L1Oracle_Expecter { return &L1Oracle_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *L1Oracle) Close() error { ret := _m.Called() @@ -126,7 +126,7 @@ func (_c *L1Oracle_GasPrice_Call) RunAndReturn(run func(context.Context) (*asset return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *L1Oracle) HealthReport() map[string]error { ret := _m.Called() @@ -173,7 +173,7 @@ func (_c *L1Oracle_HealthReport_Call) RunAndReturn(run func() map[string]error) return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *L1Oracle) Name() string { ret := _m.Called() @@ -218,7 +218,7 @@ func (_c *L1Oracle_Name_Call) RunAndReturn(run func() string) *L1Oracle_Name_Cal return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *L1Oracle) Ready() error { ret := _m.Called() diff --git a/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go b/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go index 8ff0bfa0908..73fac2ae846 100644 --- a/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go +++ b/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/chains/evm/keystore/mocks/eth.go b/core/chains/evm/keystore/mocks/eth.go index b481be1b5c8..aefe6ff7548 100644 --- a/core/chains/evm/keystore/mocks/eth.go +++ b/core/chains/evm/keystore/mocks/eth.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/chains/evm/log/mocks/abigen_contract.go b/core/chains/evm/log/mocks/abigen_contract.go index 7db05b6e097..7fd1479810f 100644 --- a/core/chains/evm/log/mocks/abigen_contract.go +++ b/core/chains/evm/log/mocks/abigen_contract.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *AbigenContract) EXPECT() *AbigenContract_Expecter { return &AbigenContract_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *AbigenContract) Address() common.Address { ret := _m.Called() diff --git a/core/chains/evm/log/mocks/broadcast.go b/core/chains/evm/log/mocks/broadcast.go index 6aadbc50b6d..4d7367819a2 100644 --- a/core/chains/evm/log/mocks/broadcast.go +++ b/core/chains/evm/log/mocks/broadcast.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -25,7 +25,7 @@ func (_m *Broadcast) EXPECT() *Broadcast_Expecter { return &Broadcast_Expecter{mock: &_m.Mock} } -// DecodedLog provides a mock function with given fields: +// DecodedLog provides a mock function with no fields func (_m *Broadcast) DecodedLog() interface{} { ret := _m.Called() @@ -72,7 +72,7 @@ func (_c *Broadcast_DecodedLog_Call) RunAndReturn(run func() interface{}) *Broad return _c } -// EVMChainID provides a mock function with given fields: +// EVMChainID provides a mock function with no fields func (_m *Broadcast) EVMChainID() big.Int { ret := _m.Called() @@ -117,7 +117,7 @@ func (_c *Broadcast_EVMChainID_Call) RunAndReturn(run func() big.Int) *Broadcast return _c } -// JobID provides a mock function with given fields: +// JobID provides a mock function with no fields func (_m *Broadcast) JobID() int32 { ret := _m.Called() @@ -162,7 +162,7 @@ func (_c *Broadcast_JobID_Call) RunAndReturn(run func() int32) *Broadcast_JobID_ return _c } -// LatestBlockHash provides a mock function with given fields: +// LatestBlockHash provides a mock function with no fields func (_m *Broadcast) LatestBlockHash() common.Hash { ret := _m.Called() @@ -209,7 +209,7 @@ func (_c *Broadcast_LatestBlockHash_Call) RunAndReturn(run func() common.Hash) * return _c } -// LatestBlockNumber provides a mock function with given fields: +// LatestBlockNumber provides a mock function with no fields func (_m *Broadcast) LatestBlockNumber() uint64 { ret := _m.Called() @@ -254,7 +254,7 @@ func (_c *Broadcast_LatestBlockNumber_Call) RunAndReturn(run func() uint64) *Bro return _c } -// RawLog provides a mock function with given fields: +// RawLog provides a mock function with no fields func (_m *Broadcast) RawLog() types.Log { ret := _m.Called() @@ -299,7 +299,7 @@ func (_c *Broadcast_RawLog_Call) RunAndReturn(run func() types.Log) *Broadcast_R return _c } -// ReceiptsRoot provides a mock function with given fields: +// ReceiptsRoot provides a mock function with no fields func (_m *Broadcast) ReceiptsRoot() common.Hash { ret := _m.Called() @@ -346,7 +346,7 @@ func (_c *Broadcast_ReceiptsRoot_Call) RunAndReturn(run func() common.Hash) *Bro return _c } -// StateRoot provides a mock function with given fields: +// StateRoot provides a mock function with no fields func (_m *Broadcast) StateRoot() common.Hash { ret := _m.Called() @@ -393,7 +393,7 @@ func (_c *Broadcast_StateRoot_Call) RunAndReturn(run func() common.Hash) *Broadc return _c } -// String provides a mock function with given fields: +// String provides a mock function with no fields func (_m *Broadcast) String() string { ret := _m.Called() @@ -438,7 +438,7 @@ func (_c *Broadcast_String_Call) RunAndReturn(run func() string) *Broadcast_Stri return _c } -// TransactionsRoot provides a mock function with given fields: +// TransactionsRoot provides a mock function with no fields func (_m *Broadcast) TransactionsRoot() common.Hash { ret := _m.Called() diff --git a/core/chains/evm/log/mocks/broadcaster.go b/core/chains/evm/log/mocks/broadcaster.go index 1545624a83d..8e88fd7e30d 100644 --- a/core/chains/evm/log/mocks/broadcaster.go +++ b/core/chains/evm/log/mocks/broadcaster.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -55,11 +55,11 @@ func (_c *Broadcaster_AddDependents_Call) Return() *Broadcaster_AddDependents_Ca } func (_c *Broadcaster_AddDependents_Call) RunAndReturn(run func(int)) *Broadcaster_AddDependents_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// AwaitDependents provides a mock function with given fields: +// AwaitDependents provides a mock function with no fields func (_m *Broadcaster) AwaitDependents() <-chan struct{} { ret := _m.Called() @@ -106,7 +106,7 @@ func (_c *Broadcaster_AwaitDependents_Call) RunAndReturn(run func() <-chan struc return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Broadcaster) Close() error { ret := _m.Called() @@ -151,7 +151,7 @@ func (_c *Broadcaster_Close_Call) RunAndReturn(run func() error) *Broadcaster_Cl return _c } -// DependentReady provides a mock function with given fields: +// DependentReady provides a mock function with no fields func (_m *Broadcaster) DependentReady() { _m.Called() } @@ -179,11 +179,11 @@ func (_c *Broadcaster_DependentReady_Call) Return() *Broadcaster_DependentReady_ } func (_c *Broadcaster_DependentReady_Call) RunAndReturn(run func()) *Broadcaster_DependentReady_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *Broadcaster) HealthReport() map[string]error { ret := _m.Called() @@ -230,7 +230,7 @@ func (_c *Broadcaster_HealthReport_Call) RunAndReturn(run func() map[string]erro return _c } -// IsConnected provides a mock function with given fields: +// IsConnected provides a mock function with no fields func (_m *Broadcaster) IsConnected() bool { ret := _m.Called() @@ -323,7 +323,7 @@ func (_c *Broadcaster_MarkConsumed_Call) RunAndReturn(run func(context.Context, return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *Broadcaster) Name() string { ret := _m.Called() @@ -398,11 +398,11 @@ func (_c *Broadcaster_OnNewLongestChain_Call) Return() *Broadcaster_OnNewLongest } func (_c *Broadcaster_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *types.Head)) *Broadcaster_OnNewLongestChain_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *Broadcaster) Ready() error { ret := _m.Called() @@ -526,7 +526,7 @@ func (_c *Broadcaster_ReplayFromBlock_Call) Return() *Broadcaster_ReplayFromBloc } func (_c *Broadcaster_ReplayFromBlock_Call) RunAndReturn(run func(int64, bool)) *Broadcaster_ReplayFromBlock_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/chains/evm/logpoller/mocks/log_poller.go b/core/chains/evm/logpoller/mocks/log_poller.go index 592157efb1c..444ee7d7e69 100644 --- a/core/chains/evm/logpoller/mocks/log_poller.go +++ b/core/chains/evm/logpoller/mocks/log_poller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -31,7 +31,7 @@ func (_m *LogPoller) EXPECT() *LogPoller_Expecter { return &LogPoller_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *LogPoller) Close() error { ret := _m.Called() @@ -301,7 +301,7 @@ func (_c *LogPoller_GetBlocksRange_Call) RunAndReturn(run func(context.Context, return _c } -// GetFilters provides a mock function with given fields: +// GetFilters provides a mock function with no fields func (_m *LogPoller) GetFilters() map[string]logpoller.Filter { ret := _m.Called() @@ -394,7 +394,7 @@ func (_c *LogPoller_HasFilter_Call) RunAndReturn(run func(string) bool) *LogPoll return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *LogPoller) HealthReport() map[string]error { ret := _m.Called() @@ -441,7 +441,7 @@ func (_c *LogPoller_HealthReport_Call) RunAndReturn(run func() map[string]error) return _c } -// Healthy provides a mock function with given fields: +// Healthy provides a mock function with no fields func (_m *LogPoller) Healthy() error { ret := _m.Called() @@ -1546,7 +1546,7 @@ func (_c *LogPoller_LogsWithSigs_Call) RunAndReturn(run func(context.Context, in return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *LogPoller) Name() string { ret := _m.Called() @@ -1591,7 +1591,7 @@ func (_c *LogPoller_Name_Call) RunAndReturn(run func() string) *LogPoller_Name_C return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *LogPoller) Ready() error { ret := _m.Called() @@ -1759,7 +1759,7 @@ func (_c *LogPoller_ReplayAsync_Call) Return() *LogPoller_ReplayAsync_Call { } func (_c *LogPoller_ReplayAsync_Call) RunAndReturn(run func(int64)) *LogPoller_ReplayAsync_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/chains/evm/mocks/balance_monitor.go b/core/chains/evm/mocks/balance_monitor.go index 95382541179..abb86909046 100644 --- a/core/chains/evm/mocks/balance_monitor.go +++ b/core/chains/evm/mocks/balance_monitor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -26,7 +26,7 @@ func (_m *BalanceMonitor) EXPECT() *BalanceMonitor_Expecter { return &BalanceMonitor_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *BalanceMonitor) Close() error { ret := _m.Called() @@ -119,7 +119,7 @@ func (_c *BalanceMonitor_GetEthBalance_Call) RunAndReturn(run func(common.Addres return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *BalanceMonitor) HealthReport() map[string]error { ret := _m.Called() @@ -166,7 +166,7 @@ func (_c *BalanceMonitor_HealthReport_Call) RunAndReturn(run func() map[string]e return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *BalanceMonitor) Name() string { ret := _m.Called() @@ -241,11 +241,11 @@ func (_c *BalanceMonitor_OnNewLongestChain_Call) Return() *BalanceMonitor_OnNewL } func (_c *BalanceMonitor_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *types.Head)) *BalanceMonitor_OnNewLongestChain_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *BalanceMonitor) Ready() error { ret := _m.Called() diff --git a/core/chains/evm/txmgr/mocks/config.go b/core/chains/evm/txmgr/mocks/config.go index 011ba19a958..91fed44dc7c 100644 --- a/core/chains/evm/txmgr/mocks/config.go +++ b/core/chains/evm/txmgr/mocks/config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -20,7 +20,7 @@ func (_m *Config) EXPECT() *Config_Expecter { return &Config_Expecter{mock: &_m.Mock} } -// ChainType provides a mock function with given fields: +// ChainType provides a mock function with no fields func (_m *Config) ChainType() chaintype.ChainType { ret := _m.Called() @@ -65,7 +65,7 @@ func (_c *Config_ChainType_Call) RunAndReturn(run func() chaintype.ChainType) *C return _c } -// FinalityDepth provides a mock function with given fields: +// FinalityDepth provides a mock function with no fields func (_m *Config) FinalityDepth() uint32 { ret := _m.Called() @@ -110,7 +110,7 @@ func (_c *Config_FinalityDepth_Call) RunAndReturn(run func() uint32) *Config_Fin return _c } -// FinalityTagEnabled provides a mock function with given fields: +// FinalityTagEnabled provides a mock function with no fields func (_m *Config) FinalityTagEnabled() bool { ret := _m.Called() @@ -155,7 +155,7 @@ func (_c *Config_FinalityTagEnabled_Call) RunAndReturn(run func() bool) *Config_ return _c } -// NonceAutoSync provides a mock function with given fields: +// NonceAutoSync provides a mock function with no fields func (_m *Config) NonceAutoSync() bool { ret := _m.Called() @@ -200,7 +200,7 @@ func (_c *Config_NonceAutoSync_Call) RunAndReturn(run func() bool) *Config_Nonce return _c } -// RPCDefaultBatchSize provides a mock function with given fields: +// RPCDefaultBatchSize provides a mock function with no fields func (_m *Config) RPCDefaultBatchSize() uint32 { ret := _m.Called() diff --git a/core/chains/evm/txmgr/mocks/evm_tx_store.go b/core/chains/evm/txmgr/mocks/evm_tx_store.go index ca98ad6ceb8..a00e280d752 100644 --- a/core/chains/evm/txmgr/mocks/evm_tx_store.go +++ b/core/chains/evm/txmgr/mocks/evm_tx_store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -18,8 +18,6 @@ import ( time "time" - txmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" - types "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" uuid "github.com/google/uuid" @@ -135,7 +133,7 @@ func (_c *EvmTxStore_CheckTxQueueCapacity_Call) RunAndReturn(run func(context.Co return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *EvmTxStore) Close() { _m.Called() } @@ -163,7 +161,7 @@ func (_c *EvmTxStore_Close_Call) Return() *EvmTxStore_Close_Call { } func (_c *EvmTxStore_Close_Call) RunAndReturn(run func()) *EvmTxStore_Close_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -494,23 +492,23 @@ func (_c *EvmTxStore_DeleteReceiptByTxHash_Call) RunAndReturn(run func(context.C } // FindAttemptsRequiringReceiptFetch provides a mock function with given fields: ctx, chainID -func (_m *EvmTxStore) FindAttemptsRequiringReceiptFetch(ctx context.Context, chainID *big.Int) ([]txmgr.TxAttempt, error) { +func (_m *EvmTxStore) FindAttemptsRequiringReceiptFetch(ctx context.Context, chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, chainID) if len(ret) == 0 { panic("no return value specified for FindAttemptsRequiringReceiptFetch") } - var r0 []txmgr.TxAttempt + var r0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]txmgr.TxAttempt, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, chainID) } - if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []txmgr.TxAttempt); ok { + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, chainID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]txmgr.TxAttempt) + r0 = ret.Get(0).([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -542,12 +540,12 @@ func (_c *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call) Run(run func(ctx co return _c } -func (_c *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call) Return(hashes []txmgr.TxAttempt, err error) *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call { +func (_c *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call) Return(hashes []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call { _c.Call.Return(hashes, err) return _c } -func (_c *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call) RunAndReturn(run func(context.Context, *big.Int) ([]txmgr.TxAttempt, error)) *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call { +func (_c *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call) RunAndReturn(run func(context.Context, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindAttemptsRequiringReceiptFetch_Call { _c.Call.Return(run) return _c } @@ -915,23 +913,23 @@ func (_c *EvmTxStore_FindReorgOrIncludedTxs_Call) RunAndReturn(run func(context. } // FindTxAttempt provides a mock function with given fields: ctx, hash -func (_m *EvmTxStore) FindTxAttempt(ctx context.Context, hash common.Hash) (*txmgr.TxAttempt, error) { +func (_m *EvmTxStore) FindTxAttempt(ctx context.Context, hash common.Hash) (*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for FindTxAttempt") } - var r0 *txmgr.TxAttempt + var r0 *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*txmgr.TxAttempt, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, hash) } - if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *txmgr.TxAttempt); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, hash) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*txmgr.TxAttempt) + r0 = ret.Get(0).(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -963,34 +961,34 @@ func (_c *EvmTxStore_FindTxAttempt_Call) Run(run func(ctx context.Context, hash return _c } -func (_c *EvmTxStore_FindTxAttempt_Call) Return(_a0 *txmgr.TxAttempt, _a1 error) *EvmTxStore_FindTxAttempt_Call { +func (_c *EvmTxStore_FindTxAttempt_Call) Return(_a0 *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindTxAttempt_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *EvmTxStore_FindTxAttempt_Call) RunAndReturn(run func(context.Context, common.Hash) (*txmgr.TxAttempt, error)) *EvmTxStore_FindTxAttempt_Call { +func (_c *EvmTxStore_FindTxAttempt_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttempt_Call { _c.Call.Return(run) return _c } // FindTxAttemptConfirmedByTxIDs provides a mock function with given fields: ctx, ids -func (_m *EvmTxStore) FindTxAttemptConfirmedByTxIDs(ctx context.Context, ids []int64) ([]txmgr.TxAttempt, error) { +func (_m *EvmTxStore) FindTxAttemptConfirmedByTxIDs(ctx context.Context, ids []int64) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, ids) if len(ret) == 0 { panic("no return value specified for FindTxAttemptConfirmedByTxIDs") } - var r0 []txmgr.TxAttempt + var r0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []int64) ([]txmgr.TxAttempt, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []int64) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, ids) } - if rf, ok := ret.Get(0).(func(context.Context, []int64) []txmgr.TxAttempt); ok { + if rf, ok := ret.Get(0).(func(context.Context, []int64) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, ids) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]txmgr.TxAttempt) + r0 = ret.Get(0).([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -1022,12 +1020,12 @@ func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) Run(run func(ctx contex return _c } -func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) Return(_a0 []txmgr.TxAttempt, _a1 error) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { +func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) Return(_a0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]txmgr.TxAttempt, error)) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { +func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { _c.Call.Return(run) return _c } @@ -1154,23 +1152,23 @@ func (_c *EvmTxStore_FindTxAttemptsRequiringResend_Call) RunAndReturn(run func(c } // FindTxByHash provides a mock function with given fields: ctx, hash -func (_m *EvmTxStore) FindTxByHash(ctx context.Context, hash common.Hash) (*txmgr.Tx, error) { +func (_m *EvmTxStore) FindTxByHash(ctx context.Context, hash common.Hash) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for FindTxByHash") } - var r0 *txmgr.Tx + var r0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*txmgr.Tx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, hash) } - if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *txmgr.Tx); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, hash) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*txmgr.Tx) + r0 = ret.Get(0).(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -1202,33 +1200,33 @@ func (_c *EvmTxStore_FindTxByHash_Call) Run(run func(ctx context.Context, hash c return _c } -func (_c *EvmTxStore_FindTxByHash_Call) Return(_a0 *txmgr.Tx, _a1 error) *EvmTxStore_FindTxByHash_Call { +func (_c *EvmTxStore_FindTxByHash_Call) Return(_a0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindTxByHash_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *EvmTxStore_FindTxByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*txmgr.Tx, error)) *EvmTxStore_FindTxByHash_Call { +func (_c *EvmTxStore_FindTxByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxByHash_Call { _c.Call.Return(run) return _c } // FindTxWithAttempts provides a mock function with given fields: ctx, etxID -func (_m *EvmTxStore) FindTxWithAttempts(ctx context.Context, etxID int64) (txmgr.Tx, error) { +func (_m *EvmTxStore) FindTxWithAttempts(ctx context.Context, etxID int64) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, etxID) if len(ret) == 0 { panic("no return value specified for FindTxWithAttempts") } - var r0 txmgr.Tx + var r0 types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64) (txmgr.Tx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, int64) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, etxID) } - if rf, ok := ret.Get(0).(func(context.Context, int64) txmgr.Tx); ok { + if rf, ok := ret.Get(0).(func(context.Context, int64) types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, etxID) } else { - r0 = ret.Get(0).(txmgr.Tx) + r0 = ret.Get(0).(types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { @@ -1259,12 +1257,12 @@ func (_c *EvmTxStore_FindTxWithAttempts_Call) Run(run func(ctx context.Context, return _c } -func (_c *EvmTxStore_FindTxWithAttempts_Call) Return(etx txmgr.Tx, err error) *EvmTxStore_FindTxWithAttempts_Call { +func (_c *EvmTxStore_FindTxWithAttempts_Call) Return(etx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxWithAttempts_Call { _c.Call.Return(etx, err) return _c } -func (_c *EvmTxStore_FindTxWithAttempts_Call) RunAndReturn(run func(context.Context, int64) (txmgr.Tx, error)) *EvmTxStore_FindTxWithAttempts_Call { +func (_c *EvmTxStore_FindTxWithAttempts_Call) RunAndReturn(run func(context.Context, int64) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxWithAttempts_Call { _c.Call.Return(run) return _c } @@ -1390,23 +1388,23 @@ func (_c *EvmTxStore_FindTxWithSequence_Call) RunAndReturn(run func(context.Cont } // FindTxesByIDs provides a mock function with given fields: ctx, etxIDs, chainID -func (_m *EvmTxStore) FindTxesByIDs(ctx context.Context, etxIDs []int64, chainID *big.Int) ([]*txmgr.Tx, error) { +func (_m *EvmTxStore) FindTxesByIDs(ctx context.Context, etxIDs []int64, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, etxIDs, chainID) if len(ret) == 0 { panic("no return value specified for FindTxesByIDs") } - var r0 []*txmgr.Tx + var r0 []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []int64, *big.Int) ([]*txmgr.Tx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, etxIDs, chainID) } - if rf, ok := ret.Get(0).(func(context.Context, []int64, *big.Int) []*txmgr.Tx); ok { + if rf, ok := ret.Get(0).(func(context.Context, []int64, *big.Int) []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, etxIDs, chainID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*txmgr.Tx) + r0 = ret.Get(0).([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -1439,12 +1437,12 @@ func (_c *EvmTxStore_FindTxesByIDs_Call) Run(run func(ctx context.Context, etxID return _c } -func (_c *EvmTxStore_FindTxesByIDs_Call) Return(etxs []*txmgr.Tx, err error) *EvmTxStore_FindTxesByIDs_Call { +func (_c *EvmTxStore_FindTxesByIDs_Call) Return(etxs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxesByIDs_Call { _c.Call.Return(etxs, err) return _c } -func (_c *EvmTxStore_FindTxesByIDs_Call) RunAndReturn(run func(context.Context, []int64, *big.Int) ([]*txmgr.Tx, error)) *EvmTxStore_FindTxesByIDs_Call { +func (_c *EvmTxStore_FindTxesByIDs_Call) RunAndReturn(run func(context.Context, []int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxesByIDs_Call { _c.Call.Return(run) return _c } @@ -1512,23 +1510,23 @@ func (_c *EvmTxStore_FindTxesByMetaFieldAndStates_Call) RunAndReturn(run func(co } // FindTxesPendingCallback provides a mock function with given fields: ctx, latest, finalized, chainID -func (_m *EvmTxStore) FindTxesPendingCallback(ctx context.Context, latest int64, finalized int64, chainID *big.Int) ([]txmgr.ReceiptPlus, error) { +func (_m *EvmTxStore) FindTxesPendingCallback(ctx context.Context, latest int64, finalized int64, chainID *big.Int) ([]types.ReceiptPlus[*evmtypes.Receipt], error) { ret := _m.Called(ctx, latest, finalized, chainID) if len(ret) == 0 { panic("no return value specified for FindTxesPendingCallback") } - var r0 []txmgr.ReceiptPlus + var r0 []types.ReceiptPlus[*evmtypes.Receipt] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) ([]txmgr.ReceiptPlus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) ([]types.ReceiptPlus[*evmtypes.Receipt], error)); ok { return rf(ctx, latest, finalized, chainID) } - if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) []txmgr.ReceiptPlus); ok { + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) []types.ReceiptPlus[*evmtypes.Receipt]); ok { r0 = rf(ctx, latest, finalized, chainID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]txmgr.ReceiptPlus) + r0 = ret.Get(0).([]types.ReceiptPlus[*evmtypes.Receipt]) } } @@ -1562,12 +1560,12 @@ func (_c *EvmTxStore_FindTxesPendingCallback_Call) Run(run func(ctx context.Cont return _c } -func (_c *EvmTxStore_FindTxesPendingCallback_Call) Return(receiptsPlus []txmgr.ReceiptPlus, err error) *EvmTxStore_FindTxesPendingCallback_Call { +func (_c *EvmTxStore_FindTxesPendingCallback_Call) Return(receiptsPlus []types.ReceiptPlus[*evmtypes.Receipt], err error) *EvmTxStore_FindTxesPendingCallback_Call { _c.Call.Return(receiptsPlus, err) return _c } -func (_c *EvmTxStore_FindTxesPendingCallback_Call) RunAndReturn(run func(context.Context, int64, int64, *big.Int) ([]txmgr.ReceiptPlus, error)) *EvmTxStore_FindTxesPendingCallback_Call { +func (_c *EvmTxStore_FindTxesPendingCallback_Call) RunAndReturn(run func(context.Context, int64, int64, *big.Int) ([]types.ReceiptPlus[*evmtypes.Receipt], error)) *EvmTxStore_FindTxesPendingCallback_Call { _c.Call.Return(run) return _c } @@ -1756,23 +1754,23 @@ func (_c *EvmTxStore_FindTxesWithMetaFieldByStates_Call) RunAndReturn(run func(c } // FindTxsByStateAndFromAddresses provides a mock function with given fields: ctx, addresses, state, chainID -func (_m *EvmTxStore) FindTxsByStateAndFromAddresses(ctx context.Context, addresses []common.Address, state types.TxState, chainID *big.Int) ([]*txmgr.Tx, error) { +func (_m *EvmTxStore) FindTxsByStateAndFromAddresses(ctx context.Context, addresses []common.Address, state types.TxState, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, addresses, state, chainID) if len(ret) == 0 { panic("no return value specified for FindTxsByStateAndFromAddresses") } - var r0 []*txmgr.Tx + var r0 []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []common.Address, types.TxState, *big.Int) ([]*txmgr.Tx, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []common.Address, types.TxState, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { return rf(ctx, addresses, state, chainID) } - if rf, ok := ret.Get(0).(func(context.Context, []common.Address, types.TxState, *big.Int) []*txmgr.Tx); ok { + if rf, ok := ret.Get(0).(func(context.Context, []common.Address, types.TxState, *big.Int) []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, addresses, state, chainID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*txmgr.Tx) + r0 = ret.Get(0).([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -1806,12 +1804,12 @@ func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) Run(run func(ctx conte return _c } -func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) Return(txs []*txmgr.Tx, err error) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { +func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) Return(txs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { _c.Call.Return(txs, err) return _c } -func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) RunAndReturn(run func(context.Context, []common.Address, types.TxState, *big.Int) ([]*txmgr.Tx, error)) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { +func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) RunAndReturn(run func(context.Context, []common.Address, types.TxState, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { _c.Call.Return(run) return _c } @@ -2777,24 +2775,24 @@ func (_c *EvmTxStore_SetBroadcastBeforeBlockNum_Call) RunAndReturn(run func(cont } // Transactions provides a mock function with given fields: ctx, offset, limit -func (_m *EvmTxStore) Transactions(ctx context.Context, offset int, limit int) ([]txmgr.Tx, int, error) { +func (_m *EvmTxStore) Transactions(ctx context.Context, offset int, limit int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error) { ret := _m.Called(ctx, offset, limit) if len(ret) == 0 { panic("no return value specified for Transactions") } - var r0 []txmgr.Tx + var r0 []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 int var r2 error - if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]txmgr.Tx, int, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)); ok { return rf(ctx, offset, limit) } - if rf, ok := ret.Get(0).(func(context.Context, int, int) []txmgr.Tx); ok { + if rf, ok := ret.Get(0).(func(context.Context, int, int) []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, offset, limit) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]txmgr.Tx) + r0 = ret.Get(0).([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -2833,35 +2831,35 @@ func (_c *EvmTxStore_Transactions_Call) Run(run func(ctx context.Context, offset return _c } -func (_c *EvmTxStore_Transactions_Call) Return(_a0 []txmgr.Tx, _a1 int, _a2 error) *EvmTxStore_Transactions_Call { +func (_c *EvmTxStore_Transactions_Call) Return(_a0 []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 int, _a2 error) *EvmTxStore_Transactions_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *EvmTxStore_Transactions_Call) RunAndReturn(run func(context.Context, int, int) ([]txmgr.Tx, int, error)) *EvmTxStore_Transactions_Call { +func (_c *EvmTxStore_Transactions_Call) RunAndReturn(run func(context.Context, int, int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)) *EvmTxStore_Transactions_Call { _c.Call.Return(run) return _c } // TransactionsWithAttempts provides a mock function with given fields: ctx, offset, limit -func (_m *EvmTxStore) TransactionsWithAttempts(ctx context.Context, offset int, limit int) ([]txmgr.Tx, int, error) { +func (_m *EvmTxStore) TransactionsWithAttempts(ctx context.Context, offset int, limit int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error) { ret := _m.Called(ctx, offset, limit) if len(ret) == 0 { panic("no return value specified for TransactionsWithAttempts") } - var r0 []txmgr.Tx + var r0 []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 int var r2 error - if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]txmgr.Tx, int, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)); ok { return rf(ctx, offset, limit) } - if rf, ok := ret.Get(0).(func(context.Context, int, int) []txmgr.Tx); ok { + if rf, ok := ret.Get(0).(func(context.Context, int, int) []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, offset, limit) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]txmgr.Tx) + r0 = ret.Get(0).([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -2900,35 +2898,35 @@ func (_c *EvmTxStore_TransactionsWithAttempts_Call) Run(run func(ctx context.Con return _c } -func (_c *EvmTxStore_TransactionsWithAttempts_Call) Return(_a0 []txmgr.Tx, _a1 int, _a2 error) *EvmTxStore_TransactionsWithAttempts_Call { +func (_c *EvmTxStore_TransactionsWithAttempts_Call) Return(_a0 []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 int, _a2 error) *EvmTxStore_TransactionsWithAttempts_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *EvmTxStore_TransactionsWithAttempts_Call) RunAndReturn(run func(context.Context, int, int) ([]txmgr.Tx, int, error)) *EvmTxStore_TransactionsWithAttempts_Call { +func (_c *EvmTxStore_TransactionsWithAttempts_Call) RunAndReturn(run func(context.Context, int, int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)) *EvmTxStore_TransactionsWithAttempts_Call { _c.Call.Return(run) return _c } // TxAttempts provides a mock function with given fields: ctx, offset, limit -func (_m *EvmTxStore) TxAttempts(ctx context.Context, offset int, limit int) ([]txmgr.TxAttempt, int, error) { +func (_m *EvmTxStore) TxAttempts(ctx context.Context, offset int, limit int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error) { ret := _m.Called(ctx, offset, limit) if len(ret) == 0 { panic("no return value specified for TxAttempts") } - var r0 []txmgr.TxAttempt + var r0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 int var r2 error - if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]txmgr.TxAttempt, int, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)); ok { return rf(ctx, offset, limit) } - if rf, ok := ret.Get(0).(func(context.Context, int, int) []txmgr.TxAttempt); ok { + if rf, ok := ret.Get(0).(func(context.Context, int, int) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf(ctx, offset, limit) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]txmgr.TxAttempt) + r0 = ret.Get(0).([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -2967,12 +2965,12 @@ func (_c *EvmTxStore_TxAttempts_Call) Run(run func(ctx context.Context, offset i return _c } -func (_c *EvmTxStore_TxAttempts_Call) Return(_a0 []txmgr.TxAttempt, _a1 int, _a2 error) *EvmTxStore_TxAttempts_Call { +func (_c *EvmTxStore_TxAttempts_Call) Return(_a0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 int, _a2 error) *EvmTxStore_TxAttempts_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *EvmTxStore_TxAttempts_Call) RunAndReturn(run func(context.Context, int, int) ([]txmgr.TxAttempt, int, error)) *EvmTxStore_TxAttempts_Call { +func (_c *EvmTxStore_TxAttempts_Call) RunAndReturn(run func(context.Context, int, int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)) *EvmTxStore_TxAttempts_Call { _c.Call.Return(run) return _c } diff --git a/core/chains/legacyevm/mocks/chain.go b/core/chains/legacyevm/mocks/chain.go index 14a89027323..e642ca2c608 100644 --- a/core/chains/legacyevm/mocks/chain.go +++ b/core/chains/legacyevm/mocks/chain.go @@ -1,18 +1,22 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks import ( big "math/big" + common "github.com/ethereum/go-ethereum/common" client "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + config "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" context "context" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + gas "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" - headtrackertypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" + headtracker "github.com/smartcontractkit/chainlink/v2/common/headtracker" log "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" @@ -24,7 +28,7 @@ import ( monitor "github.com/smartcontractkit/chainlink/v2/core/chains/evm/monitor" - txmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + txmgr "github.com/smartcontractkit/chainlink/v2/common/txmgr" types "github.com/smartcontractkit/chainlink-common/pkg/types" ) @@ -42,7 +46,7 @@ func (_m *Chain) EXPECT() *Chain_Expecter { return &Chain_Expecter{mock: &_m.Mock} } -// BalanceMonitor provides a mock function with given fields: +// BalanceMonitor provides a mock function with no fields func (_m *Chain) BalanceMonitor() monitor.BalanceMonitor { ret := _m.Called() @@ -89,7 +93,7 @@ func (_c *Chain_BalanceMonitor_Call) RunAndReturn(run func() monitor.BalanceMoni return _c } -// Client provides a mock function with given fields: +// Client provides a mock function with no fields func (_m *Chain) Client() client.Client { ret := _m.Called() @@ -136,7 +140,7 @@ func (_c *Chain_Client_Call) RunAndReturn(run func() client.Client) *Chain_Clien return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Chain) Close() error { ret := _m.Called() @@ -181,7 +185,7 @@ func (_c *Chain_Close_Call) RunAndReturn(run func() error) *Chain_Close_Call { return _c } -// Config provides a mock function with given fields: +// Config provides a mock function with no fields func (_m *Chain) Config() config.ChainScopedConfig { ret := _m.Called() @@ -228,7 +232,7 @@ func (_c *Chain_Config_Call) RunAndReturn(run func() config.ChainScopedConfig) * return _c } -// GasEstimator provides a mock function with given fields: +// GasEstimator provides a mock function with no fields func (_m *Chain) GasEstimator() gas.EvmFeeEstimator { ret := _m.Called() @@ -331,20 +335,20 @@ func (_c *Chain_GetChainStatus_Call) RunAndReturn(run func(context.Context) (typ return _c } -// HeadBroadcaster provides a mock function with given fields: -func (_m *Chain) HeadBroadcaster() headtrackertypes.HeadBroadcaster { +// HeadBroadcaster provides a mock function with no fields +func (_m *Chain) HeadBroadcaster() headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash] { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for HeadBroadcaster") } - var r0 headtrackertypes.HeadBroadcaster - if rf, ok := ret.Get(0).(func() headtrackertypes.HeadBroadcaster); ok { + var r0 headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash] + if rf, ok := ret.Get(0).(func() headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash]); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(headtrackertypes.HeadBroadcaster) + r0 = ret.Get(0).(headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash]) } } @@ -368,30 +372,30 @@ func (_c *Chain_HeadBroadcaster_Call) Run(run func()) *Chain_HeadBroadcaster_Cal return _c } -func (_c *Chain_HeadBroadcaster_Call) Return(_a0 headtrackertypes.HeadBroadcaster) *Chain_HeadBroadcaster_Call { +func (_c *Chain_HeadBroadcaster_Call) Return(_a0 headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash]) *Chain_HeadBroadcaster_Call { _c.Call.Return(_a0) return _c } -func (_c *Chain_HeadBroadcaster_Call) RunAndReturn(run func() headtrackertypes.HeadBroadcaster) *Chain_HeadBroadcaster_Call { +func (_c *Chain_HeadBroadcaster_Call) RunAndReturn(run func() headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash]) *Chain_HeadBroadcaster_Call { _c.Call.Return(run) return _c } -// HeadTracker provides a mock function with given fields: -func (_m *Chain) HeadTracker() headtrackertypes.HeadTracker { +// HeadTracker provides a mock function with no fields +func (_m *Chain) HeadTracker() headtracker.HeadTracker[*evmtypes.Head, common.Hash] { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for HeadTracker") } - var r0 headtrackertypes.HeadTracker - if rf, ok := ret.Get(0).(func() headtrackertypes.HeadTracker); ok { + var r0 headtracker.HeadTracker[*evmtypes.Head, common.Hash] + if rf, ok := ret.Get(0).(func() headtracker.HeadTracker[*evmtypes.Head, common.Hash]); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(headtrackertypes.HeadTracker) + r0 = ret.Get(0).(headtracker.HeadTracker[*evmtypes.Head, common.Hash]) } } @@ -415,17 +419,17 @@ func (_c *Chain_HeadTracker_Call) Run(run func()) *Chain_HeadTracker_Call { return _c } -func (_c *Chain_HeadTracker_Call) Return(_a0 headtrackertypes.HeadTracker) *Chain_HeadTracker_Call { +func (_c *Chain_HeadTracker_Call) Return(_a0 headtracker.HeadTracker[*evmtypes.Head, common.Hash]) *Chain_HeadTracker_Call { _c.Call.Return(_a0) return _c } -func (_c *Chain_HeadTracker_Call) RunAndReturn(run func() headtrackertypes.HeadTracker) *Chain_HeadTracker_Call { +func (_c *Chain_HeadTracker_Call) RunAndReturn(run func() headtracker.HeadTracker[*evmtypes.Head, common.Hash]) *Chain_HeadTracker_Call { _c.Call.Return(run) return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *Chain) HealthReport() map[string]error { ret := _m.Called() @@ -472,7 +476,7 @@ func (_c *Chain_HealthReport_Call) RunAndReturn(run func() map[string]error) *Ch return _c } -// ID provides a mock function with given fields: +// ID provides a mock function with no fields func (_m *Chain) ID() *big.Int { ret := _m.Called() @@ -649,7 +653,7 @@ func (_c *Chain_ListNodeStatuses_Call) RunAndReturn(run func(context.Context, in return _c } -// LogBroadcaster provides a mock function with given fields: +// LogBroadcaster provides a mock function with no fields func (_m *Chain) LogBroadcaster() log.Broadcaster { ret := _m.Called() @@ -696,7 +700,7 @@ func (_c *Chain_LogBroadcaster_Call) RunAndReturn(run func() log.Broadcaster) *C return _c } -// LogPoller provides a mock function with given fields: +// LogPoller provides a mock function with no fields func (_m *Chain) LogPoller() logpoller.LogPoller { ret := _m.Called() @@ -743,7 +747,7 @@ func (_c *Chain_LogPoller_Call) RunAndReturn(run func() logpoller.LogPoller) *Ch return _c } -// Logger provides a mock function with given fields: +// Logger provides a mock function with no fields func (_m *Chain) Logger() logger.Logger { ret := _m.Called() @@ -790,7 +794,7 @@ func (_c *Chain_Logger_Call) RunAndReturn(run func() logger.Logger) *Chain_Logge return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *Chain) Name() string { ret := _m.Called() @@ -835,7 +839,7 @@ func (_c *Chain_Name_Call) RunAndReturn(run func() string) *Chain_Name_Call { return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *Chain) Ready() error { ret := _m.Called() @@ -976,20 +980,20 @@ func (_c *Chain_Transact_Call) RunAndReturn(run func(context.Context, string, st return _c } -// TxManager provides a mock function with given fields: -func (_m *Chain) TxManager() txmgr.TxManager { +// TxManager provides a mock function with no fields +func (_m *Chain) TxManager() txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for TxManager") } - var r0 txmgr.TxManager - if rf, ok := ret.Get(0).(func() txmgr.TxManager); ok { + var r0 txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] + if rf, ok := ret.Get(0).(func() txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(txmgr.TxManager) + r0 = ret.Get(0).(txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } @@ -1013,12 +1017,12 @@ func (_c *Chain_TxManager_Call) Run(run func()) *Chain_TxManager_Call { return _c } -func (_c *Chain_TxManager_Call) Return(_a0 txmgr.TxManager) *Chain_TxManager_Call { +func (_c *Chain_TxManager_Call) Return(_a0 txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) *Chain_TxManager_Call { _c.Call.Return(_a0) return _c } -func (_c *Chain_TxManager_Call) RunAndReturn(run func() txmgr.TxManager) *Chain_TxManager_Call { +func (_c *Chain_TxManager_Call) RunAndReturn(run func() txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) *Chain_TxManager_Call { _c.Call.Return(run) return _c } diff --git a/core/chains/legacyevm/mocks/legacy_chain_container.go b/core/chains/legacyevm/mocks/legacy_chain_container.go index 0425a016014..b5ddfe4891f 100644 --- a/core/chains/legacyevm/mocks/legacy_chain_container.go +++ b/core/chains/legacyevm/mocks/legacy_chain_container.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *LegacyChainContainer) EXPECT() *LegacyChainContainer_Expecter { return &LegacyChainContainer_Expecter{mock: &_m.Mock} } -// ChainNodeConfigs provides a mock function with given fields: +// ChainNodeConfigs provides a mock function with no fields func (_m *LegacyChainContainer) ChainNodeConfigs() types.Configs { ret := _m.Called() @@ -127,7 +127,7 @@ func (_c *LegacyChainContainer_Get_Call) RunAndReturn(run func(string) (legacyev return _c } -// Len provides a mock function with given fields: +// Len provides a mock function with no fields func (_m *LegacyChainContainer) Len() int { ret := _m.Called() @@ -243,7 +243,7 @@ func (_c *LegacyChainContainer_List_Call) RunAndReturn(run func(...string) ([]le return _c } -// Slice provides a mock function with given fields: +// Slice provides a mock function with no fields func (_m *LegacyChainContainer) Slice() []legacyevm.Chain { ret := _m.Called() diff --git a/core/cmd/mocks/prompter.go b/core/cmd/mocks/prompter.go index 03b6dae04cb..aca41d1ed4a 100644 --- a/core/cmd/mocks/prompter.go +++ b/core/cmd/mocks/prompter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -17,7 +17,7 @@ func (_m *Prompter) EXPECT() *Prompter_Expecter { return &Prompter_Expecter{mock: &_m.Mock} } -// IsTerminal provides a mock function with given fields: +// IsTerminal provides a mock function with no fields func (_m *Prompter) IsTerminal() bool { ret := _m.Called() diff --git a/core/config/mocks/telemetry_ingress.go b/core/config/mocks/telemetry_ingress.go index 3e85cf7da09..e77a559cd7c 100644 --- a/core/config/mocks/telemetry_ingress.go +++ b/core/config/mocks/telemetry_ingress.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *TelemetryIngress) EXPECT() *TelemetryIngress_Expecter { return &TelemetryIngress_Expecter{mock: &_m.Mock} } -// BufferSize provides a mock function with given fields: +// BufferSize provides a mock function with no fields func (_m *TelemetryIngress) BufferSize() uint { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *TelemetryIngress_BufferSize_Call) RunAndReturn(run func() uint) *Telem return _c } -// Endpoints provides a mock function with given fields: +// Endpoints provides a mock function with no fields func (_m *TelemetryIngress) Endpoints() []config.TelemetryIngressEndpoint { ret := _m.Called() @@ -114,7 +114,7 @@ func (_c *TelemetryIngress_Endpoints_Call) RunAndReturn(run func() []config.Tele return _c } -// Logging provides a mock function with given fields: +// Logging provides a mock function with no fields func (_m *TelemetryIngress) Logging() bool { ret := _m.Called() @@ -159,7 +159,7 @@ func (_c *TelemetryIngress_Logging_Call) RunAndReturn(run func() bool) *Telemetr return _c } -// MaxBatchSize provides a mock function with given fields: +// MaxBatchSize provides a mock function with no fields func (_m *TelemetryIngress) MaxBatchSize() uint { ret := _m.Called() @@ -204,7 +204,7 @@ func (_c *TelemetryIngress_MaxBatchSize_Call) RunAndReturn(run func() uint) *Tel return _c } -// SendInterval provides a mock function with given fields: +// SendInterval provides a mock function with no fields func (_m *TelemetryIngress) SendInterval() time.Duration { ret := _m.Called() @@ -249,7 +249,7 @@ func (_c *TelemetryIngress_SendInterval_Call) RunAndReturn(run func() time.Durat return _c } -// SendTimeout provides a mock function with given fields: +// SendTimeout provides a mock function with no fields func (_m *TelemetryIngress) SendTimeout() time.Duration { ret := _m.Called() @@ -294,7 +294,7 @@ func (_c *TelemetryIngress_SendTimeout_Call) RunAndReturn(run func() time.Durati return _c } -// UniConn provides a mock function with given fields: +// UniConn provides a mock function with no fields func (_m *TelemetryIngress) UniConn() bool { ret := _m.Called() @@ -339,7 +339,7 @@ func (_c *TelemetryIngress_UniConn_Call) RunAndReturn(run func() bool) *Telemetr return _c } -// UseBatchSend provides a mock function with given fields: +// UseBatchSend provides a mock function with no fields func (_m *TelemetryIngress) UseBatchSend() bool { ret := _m.Called() diff --git a/core/config/mocks/telemetry_ingress_endpoint.go b/core/config/mocks/telemetry_ingress_endpoint.go index 18b3b8a046b..b8fa4dfe485 100644 --- a/core/config/mocks/telemetry_ingress_endpoint.go +++ b/core/config/mocks/telemetry_ingress_endpoint.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -21,7 +21,7 @@ func (_m *TelemetryIngressEndpoint) EXPECT() *TelemetryIngressEndpoint_Expecter return &TelemetryIngressEndpoint_Expecter{mock: &_m.Mock} } -// ChainID provides a mock function with given fields: +// ChainID provides a mock function with no fields func (_m *TelemetryIngressEndpoint) ChainID() string { ret := _m.Called() @@ -66,7 +66,7 @@ func (_c *TelemetryIngressEndpoint_ChainID_Call) RunAndReturn(run func() string) return _c } -// Network provides a mock function with given fields: +// Network provides a mock function with no fields func (_m *TelemetryIngressEndpoint) Network() string { ret := _m.Called() @@ -111,7 +111,7 @@ func (_c *TelemetryIngressEndpoint_Network_Call) RunAndReturn(run func() string) return _c } -// ServerPubKey provides a mock function with given fields: +// ServerPubKey provides a mock function with no fields func (_m *TelemetryIngressEndpoint) ServerPubKey() string { ret := _m.Called() @@ -156,7 +156,7 @@ func (_c *TelemetryIngressEndpoint_ServerPubKey_Call) RunAndReturn(run func() st return _c } -// URL provides a mock function with given fields: +// URL provides a mock function with no fields func (_m *TelemetryIngressEndpoint) URL() *url.URL { ret := _m.Called() diff --git a/core/gethwrappers/ccip/mocks/commit_store_interface.go b/core/gethwrappers/ccip/mocks/commit_store_interface.go index 0cadfd036a8..f1ff6c610a1 100644 --- a/core/gethwrappers/ccip/mocks/commit_store_interface.go +++ b/core/gethwrappers/ccip/mocks/commit_store_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_contracts @@ -89,7 +89,7 @@ func (_c *CommitStoreInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *CommitStoreInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go b/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go index e9e635d8711..73ee46418c9 100644 --- a/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go +++ b/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_contracts @@ -88,7 +88,7 @@ func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*b return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *EVM2EVMOffRampInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go b/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go index 3c65e2c5627..428c71ba393 100644 --- a/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go +++ b/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_contracts @@ -90,7 +90,7 @@ func (_c *EVM2EVMOnRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*bi return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *EVM2EVMOnRampInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/ccip/mocks/fee_quoter_interface.go b/core/gethwrappers/ccip/mocks/fee_quoter_interface.go index 8fadeb40e08..b254eae565b 100644 --- a/core/gethwrappers/ccip/mocks/fee_quoter_interface.go +++ b/core/gethwrappers/ccip/mocks/fee_quoter_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_contracts @@ -90,7 +90,7 @@ func (_c *FeeQuoterInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.T return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *FeeQuoterInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/ccip/mocks/link_token_interface.go b/core/gethwrappers/ccip/mocks/link_token_interface.go index 59e9d7c8543..dcf0c1cadbc 100644 --- a/core/gethwrappers/ccip/mocks/link_token_interface.go +++ b/core/gethwrappers/ccip/mocks/link_token_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_contracts @@ -32,7 +32,7 @@ func (_m *LinkTokenInterface) EXPECT() *LinkTokenInterface_Expecter { return &LinkTokenInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *LinkTokenInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go b/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go index a7de44f93ea..7a20a3bd068 100644 --- a/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go +++ b/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_contracts @@ -90,7 +90,7 @@ func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*b return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *EVM2EVMOffRampInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go index eac55ff03a3..d7b88a8f27b 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_arbitrum_gateway_router @@ -33,7 +33,7 @@ func (_m *ArbitrumGatewayRouterInterface) EXPECT() *ArbitrumGatewayRouterInterfa return &ArbitrumGatewayRouterInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *ArbitrumGatewayRouterInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go index 7e9939b8023..934613e32fc 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_arbitrum_inbox @@ -33,7 +33,7 @@ func (_m *ArbitrumInboxInterface) EXPECT() *ArbitrumInboxInterface_Expecter { return &ArbitrumInboxInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *ArbitrumInboxInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go index 65ddb6e398d..d1728d94e92 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_arbitrum_l1_bridge_adapter @@ -29,7 +29,7 @@ func (_m *ArbitrumL1BridgeAdapterInterface) EXPECT() *ArbitrumL1BridgeAdapterInt return &ArbitrumL1BridgeAdapterInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *ArbitrumL1BridgeAdapterInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go index 873879f7d06..dc176879aa4 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_arbitrum_l2_bridge_adapter @@ -26,7 +26,7 @@ func (_m *ArbitrumL2BridgeAdapterInterface) EXPECT() *ArbitrumL2BridgeAdapterInt return &ArbitrumL2BridgeAdapterInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *ArbitrumL2BridgeAdapterInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go index a41ee15a254..8dead9cf8b1 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_arbitrum_rollup_core @@ -33,7 +33,7 @@ func (_m *ArbRollupCoreInterface) EXPECT() *ArbRollupCoreInterface_Expecter { return &ArbRollupCoreInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *ArbRollupCoreInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go index d07eef5b579..6e1af68b03d 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_arbsys @@ -33,7 +33,7 @@ func (_m *ArbSysInterface) EXPECT() *ArbSysInterface_Expecter { return &ArbSysInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *ArbSysInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go index 5e8f4037eaf..d1b85f5a26b 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_l2_arbitrum_gateway @@ -32,7 +32,7 @@ func (_m *L2ArbitrumGatewayInterface) EXPECT() *L2ArbitrumGatewayInterface_Expec return &L2ArbitrumGatewayInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *L2ArbitrumGatewayInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go index 1ee3fb075c4..576c15dbeef 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_l2_arbitrum_messenger @@ -32,7 +32,7 @@ func (_m *L2ArbitrumMessengerInterface) EXPECT() *L2ArbitrumMessengerInterface_E return &L2ArbitrumMessengerInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *L2ArbitrumMessengerInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go index 6950201b8c8..0f85d52cb23 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_node_interface @@ -29,7 +29,7 @@ func (_m *NodeInterfaceInterface) EXPECT() *NodeInterfaceInterface_Expecter { return &NodeInterfaceInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *NodeInterfaceInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go index 1ffa9426638..0e47f57a1f3 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_optimism_dispute_game_factory @@ -26,7 +26,7 @@ func (_m *OptimismDisputeGameFactoryInterface) EXPECT() *OptimismDisputeGameFact return &OptimismDisputeGameFactoryInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *OptimismDisputeGameFactoryInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go index 2736d2a5ed3..bffece06092 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_optimism_l2_output_oracle @@ -26,7 +26,7 @@ func (_m *OptimismL2OutputOracleInterface) EXPECT() *OptimismL2OutputOracleInter return &OptimismL2OutputOracleInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *OptimismL2OutputOracleInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go index dcfc2758406..cdfd585df4d 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_optimism_portal @@ -28,7 +28,7 @@ func (_m *OptimismPortalInterface) EXPECT() *OptimismPortalInterface_Expecter { return &OptimismPortalInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *OptimismPortalInterface) Address() common.Address { ret := _m.Called() diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go index d693ff317bc..bb820a7f415 100644 --- a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mock_optimism_portal_2 @@ -22,7 +22,7 @@ func (_m *OptimismPortal2Interface) EXPECT() *OptimismPortal2Interface_Expecter return &OptimismPortal2Interface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *OptimismPortal2Interface) Address() common.Address { ret := _m.Called() diff --git a/core/internal/mocks/application.go b/core/internal/mocks/application.go index 69a8a60ef45..65dfbde7559 100644 --- a/core/internal/mocks/application.go +++ b/core/internal/mocks/application.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -108,7 +108,7 @@ func (_c *Application_AddJobV2_Call) RunAndReturn(run func(context.Context, *job return _c } -// AuthenticationProvider provides a mock function with given fields: +// AuthenticationProvider provides a mock function with no fields func (_m *Application) AuthenticationProvider() sessions.AuthenticationProvider { ret := _m.Called() @@ -155,7 +155,7 @@ func (_c *Application_AuthenticationProvider_Call) RunAndReturn(run func() sessi return _c } -// BasicAdminUsersORM provides a mock function with given fields: +// BasicAdminUsersORM provides a mock function with no fields func (_m *Application) BasicAdminUsersORM() sessions.BasicAdminUsersORM { ret := _m.Called() @@ -202,7 +202,7 @@ func (_c *Application_BasicAdminUsersORM_Call) RunAndReturn(run func() sessions. return _c } -// BridgeORM provides a mock function with given fields: +// BridgeORM provides a mock function with no fields func (_m *Application) BridgeORM() bridges.ORM { ret := _m.Called() @@ -344,7 +344,7 @@ func (_c *Application_DeleteLogPollerDataAfter_Call) RunAndReturn(run func(conte return _c } -// EVMORM provides a mock function with given fields: +// EVMORM provides a mock function with no fields func (_m *Application) EVMORM() types.Configs { ret := _m.Called() @@ -450,7 +450,7 @@ func (_c *Application_FindLCA_Call) RunAndReturn(run func(context.Context, *big. return _c } -// GetAuditLogger provides a mock function with given fields: +// GetAuditLogger provides a mock function with no fields func (_m *Application) GetAuditLogger() audit.AuditLogger { ret := _m.Called() @@ -497,7 +497,7 @@ func (_c *Application_GetAuditLogger_Call) RunAndReturn(run func() audit.AuditLo return _c } -// GetConfig provides a mock function with given fields: +// GetConfig provides a mock function with no fields func (_m *Application) GetConfig() chainlink.GeneralConfig { ret := _m.Called() @@ -544,7 +544,7 @@ func (_c *Application_GetConfig_Call) RunAndReturn(run func() chainlink.GeneralC return _c } -// GetDB provides a mock function with given fields: +// GetDB provides a mock function with no fields func (_m *Application) GetDB() sqlutil.DataSource { ret := _m.Called() @@ -591,7 +591,7 @@ func (_c *Application_GetDB_Call) RunAndReturn(run func() sqlutil.DataSource) *A return _c } -// GetExternalInitiatorManager provides a mock function with given fields: +// GetExternalInitiatorManager provides a mock function with no fields func (_m *Application) GetExternalInitiatorManager() webhook.ExternalInitiatorManager { ret := _m.Called() @@ -638,7 +638,7 @@ func (_c *Application_GetExternalInitiatorManager_Call) RunAndReturn(run func() return _c } -// GetFeedsService provides a mock function with given fields: +// GetFeedsService provides a mock function with no fields func (_m *Application) GetFeedsService() feeds.Service { ret := _m.Called() @@ -685,7 +685,7 @@ func (_c *Application_GetFeedsService_Call) RunAndReturn(run func() feeds.Servic return _c } -// GetHealthChecker provides a mock function with given fields: +// GetHealthChecker provides a mock function with no fields func (_m *Application) GetHealthChecker() services.Checker { ret := _m.Called() @@ -732,7 +732,7 @@ func (_c *Application_GetHealthChecker_Call) RunAndReturn(run func() services.Ch return _c } -// GetKeyStore provides a mock function with given fields: +// GetKeyStore provides a mock function with no fields func (_m *Application) GetKeyStore() keystore.Master { ret := _m.Called() @@ -779,7 +779,7 @@ func (_c *Application_GetKeyStore_Call) RunAndReturn(run func() keystore.Master) return _c } -// GetLogger provides a mock function with given fields: +// GetLogger provides a mock function with no fields func (_m *Application) GetLogger() logger.SugaredLogger { ret := _m.Called() @@ -826,7 +826,7 @@ func (_c *Application_GetLogger_Call) RunAndReturn(run func() logger.SugaredLogg return _c } -// GetLoopRegistrarConfig provides a mock function with given fields: +// GetLoopRegistrarConfig provides a mock function with no fields func (_m *Application) GetLoopRegistrarConfig() plugins.RegistrarConfig { ret := _m.Called() @@ -873,7 +873,7 @@ func (_c *Application_GetLoopRegistrarConfig_Call) RunAndReturn(run func() plugi return _c } -// GetLoopRegistry provides a mock function with given fields: +// GetLoopRegistry provides a mock function with no fields func (_m *Application) GetLoopRegistry() *plugins.LoopRegistry { ret := _m.Called() @@ -920,7 +920,7 @@ func (_c *Application_GetLoopRegistry_Call) RunAndReturn(run func() *plugins.Loo return _c } -// GetRelayers provides a mock function with given fields: +// GetRelayers provides a mock function with no fields func (_m *Application) GetRelayers() chainlink.RelayerChainInteroperators { ret := _m.Called() @@ -967,7 +967,7 @@ func (_c *Application_GetRelayers_Call) RunAndReturn(run func() chainlink.Relaye return _c } -// GetWebAuthnConfiguration provides a mock function with given fields: +// GetWebAuthnConfiguration provides a mock function with no fields func (_m *Application) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration { ret := _m.Called() @@ -1012,7 +1012,7 @@ func (_c *Application_GetWebAuthnConfiguration_Call) RunAndReturn(run func() ses return _c } -// ID provides a mock function with given fields: +// ID provides a mock function with no fields func (_m *Application) ID() uuid.UUID { ret := _m.Called() @@ -1059,7 +1059,7 @@ func (_c *Application_ID_Call) RunAndReturn(run func() uuid.UUID) *Application_I return _c } -// JobORM provides a mock function with given fields: +// JobORM provides a mock function with no fields func (_m *Application) JobORM() job.ORM { ret := _m.Called() @@ -1106,7 +1106,7 @@ func (_c *Application_JobORM_Call) RunAndReturn(run func() job.ORM) *Application return _c } -// JobSpawner provides a mock function with given fields: +// JobSpawner provides a mock function with no fields func (_m *Application) JobSpawner() job.Spawner { ret := _m.Called() @@ -1153,7 +1153,7 @@ func (_c *Application_JobSpawner_Call) RunAndReturn(run func() job.Spawner) *App return _c } -// PipelineORM provides a mock function with given fields: +// PipelineORM provides a mock function with no fields func (_m *Application) PipelineORM() pipeline.ORM { ret := _m.Called() @@ -1413,7 +1413,7 @@ func (_c *Application_RunWebhookJobV2_Call) RunAndReturn(run func(context.Contex return _c } -// SecretGenerator provides a mock function with given fields: +// SecretGenerator provides a mock function with no fields func (_m *Application) SecretGenerator() chainlink.SecretGenerator { ret := _m.Called() @@ -1552,7 +1552,7 @@ func (_c *Application_Start_Call) RunAndReturn(run func(context.Context) error) return _c } -// Stop provides a mock function with given fields: +// Stop provides a mock function with no fields func (_m *Application) Stop() error { ret := _m.Called() @@ -1597,7 +1597,7 @@ func (_c *Application_Stop_Call) RunAndReturn(run func() error) *Application_Sto return _c } -// TxmStorageService provides a mock function with given fields: +// TxmStorageService provides a mock function with no fields func (_m *Application) TxmStorageService() txmgr.EvmTxStore { ret := _m.Called() @@ -1644,7 +1644,7 @@ func (_c *Application_TxmStorageService_Call) RunAndReturn(run func() txmgr.EvmT return _c } -// WakeSessionReaper provides a mock function with given fields: +// WakeSessionReaper provides a mock function with no fields func (_m *Application) WakeSessionReaper() { _m.Called() } @@ -1672,7 +1672,7 @@ func (_c *Application_WakeSessionReaper_Call) Return() *Application_WakeSessionR } func (_c *Application_WakeSessionReaper_Call) RunAndReturn(run func()) *Application_WakeSessionReaper_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/internal/mocks/flags.go b/core/internal/mocks/flags.go index 538af708893..53e340b0262 100644 --- a/core/internal/mocks/flags.go +++ b/core/internal/mocks/flags.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -147,7 +147,7 @@ func (_c *Flags_AddAccess_Call) RunAndReturn(run func(*bind.TransactOpts, common return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *Flags) Address() common.Address { ret := _m.Called() diff --git a/core/internal/mocks/flux_aggregator.go b/core/internal/mocks/flux_aggregator.go index 9dd63173fb1..9360a22fba5 100644 --- a/core/internal/mocks/flux_aggregator.go +++ b/core/internal/mocks/flux_aggregator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -149,7 +149,7 @@ func (_c *FluxAggregator_AcceptOwnership_Call) RunAndReturn(run func(*bind.Trans return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *FluxAggregator) Address() common.Address { ret := _m.Called() diff --git a/core/logger/logger_mocks.go b/core/logger/logger_mocks.go index 643f5ff141f..09b303e02d0 100644 --- a/core/logger/logger_mocks.go +++ b/core/logger/logger_mocks.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package logger @@ -58,7 +58,7 @@ func (_c *MockLogger_Critical_Call) Return() *MockLogger_Critical_Call { } func (_c *MockLogger_Critical_Call) RunAndReturn(run func(...interface{})) *MockLogger_Critical_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -102,7 +102,7 @@ func (_c *MockLogger_Criticalf_Call) Return() *MockLogger_Criticalf_Call { } func (_c *MockLogger_Criticalf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Criticalf_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -146,7 +146,7 @@ func (_c *MockLogger_Criticalw_Call) Return() *MockLogger_Criticalw_Call { } func (_c *MockLogger_Criticalw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Criticalw_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -188,7 +188,7 @@ func (_c *MockLogger_Debug_Call) Return() *MockLogger_Debug_Call { } func (_c *MockLogger_Debug_Call) RunAndReturn(run func(...interface{})) *MockLogger_Debug_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -232,7 +232,7 @@ func (_c *MockLogger_Debugf_Call) Return() *MockLogger_Debugf_Call { } func (_c *MockLogger_Debugf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Debugf_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -276,7 +276,7 @@ func (_c *MockLogger_Debugw_Call) Return() *MockLogger_Debugw_Call { } func (_c *MockLogger_Debugw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Debugw_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -318,7 +318,7 @@ func (_c *MockLogger_Error_Call) Return() *MockLogger_Error_Call { } func (_c *MockLogger_Error_Call) RunAndReturn(run func(...interface{})) *MockLogger_Error_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -362,7 +362,7 @@ func (_c *MockLogger_Errorf_Call) Return() *MockLogger_Errorf_Call { } func (_c *MockLogger_Errorf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Errorf_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -406,7 +406,7 @@ func (_c *MockLogger_Errorw_Call) Return() *MockLogger_Errorw_Call { } func (_c *MockLogger_Errorw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Errorw_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -448,7 +448,7 @@ func (_c *MockLogger_Fatal_Call) Return() *MockLogger_Fatal_Call { } func (_c *MockLogger_Fatal_Call) RunAndReturn(run func(...interface{})) *MockLogger_Fatal_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -492,7 +492,7 @@ func (_c *MockLogger_Fatalf_Call) Return() *MockLogger_Fatalf_Call { } func (_c *MockLogger_Fatalf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Fatalf_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -536,7 +536,7 @@ func (_c *MockLogger_Fatalw_Call) Return() *MockLogger_Fatalw_Call { } func (_c *MockLogger_Fatalw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Fatalw_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -626,7 +626,7 @@ func (_c *MockLogger_Info_Call) Return() *MockLogger_Info_Call { } func (_c *MockLogger_Info_Call) RunAndReturn(run func(...interface{})) *MockLogger_Info_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -670,7 +670,7 @@ func (_c *MockLogger_Infof_Call) Return() *MockLogger_Infof_Call { } func (_c *MockLogger_Infof_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Infof_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -714,11 +714,11 @@ func (_c *MockLogger_Infow_Call) Return() *MockLogger_Infow_Call { } func (_c *MockLogger_Infow_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Infow_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *MockLogger) Name() string { ret := _m.Called() @@ -849,7 +849,7 @@ func (_c *MockLogger_Panic_Call) Return() *MockLogger_Panic_Call { } func (_c *MockLogger_Panic_Call) RunAndReturn(run func(...interface{})) *MockLogger_Panic_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -893,7 +893,7 @@ func (_c *MockLogger_Panicf_Call) Return() *MockLogger_Panicf_Call { } func (_c *MockLogger_Panicf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Panicf_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -937,7 +937,7 @@ func (_c *MockLogger_Panicw_Call) Return() *MockLogger_Panicw_Call { } func (_c *MockLogger_Panicw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Panicw_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -970,7 +970,7 @@ func (_c *MockLogger_Recover_Call) Return() *MockLogger_Recover_Call { } func (_c *MockLogger_Recover_Call) RunAndReturn(run func(interface{})) *MockLogger_Recover_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1003,11 +1003,11 @@ func (_c *MockLogger_SetLogLevel_Call) Return() *MockLogger_SetLogLevel_Call { } func (_c *MockLogger_SetLogLevel_Call) RunAndReturn(run func(zapcore.Level)) *MockLogger_SetLogLevel_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Sync provides a mock function with given fields: +// Sync provides a mock function with no fields func (_m *MockLogger) Sync() error { ret := _m.Called() @@ -1090,7 +1090,7 @@ func (_c *MockLogger_Trace_Call) Return() *MockLogger_Trace_Call { } func (_c *MockLogger_Trace_Call) RunAndReturn(run func(...interface{})) *MockLogger_Trace_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1134,7 +1134,7 @@ func (_c *MockLogger_Tracef_Call) Return() *MockLogger_Tracef_Call { } func (_c *MockLogger_Tracef_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Tracef_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1178,7 +1178,7 @@ func (_c *MockLogger_Tracew_Call) Return() *MockLogger_Tracew_Call { } func (_c *MockLogger_Tracew_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Tracew_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1220,7 +1220,7 @@ func (_c *MockLogger_Warn_Call) Return() *MockLogger_Warn_Call { } func (_c *MockLogger_Warn_Call) RunAndReturn(run func(...interface{})) *MockLogger_Warn_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1264,7 +1264,7 @@ func (_c *MockLogger_Warnf_Call) Return() *MockLogger_Warnf_Call { } func (_c *MockLogger_Warnf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Warnf_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1308,7 +1308,7 @@ func (_c *MockLogger_Warnw_Call) Return() *MockLogger_Warnw_Call { } func (_c *MockLogger_Warnw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Warnw_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/blockhashstore/mocks/bhs.go b/core/services/blockhashstore/mocks/bhs.go index 782b22e05f8..d3032c4bb0d 100644 --- a/core/services/blockhashstore/mocks/bhs.go +++ b/core/services/blockhashstore/mocks/bhs.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -80,7 +80,7 @@ func (_c *BHS_IsStored_Call) RunAndReturn(run func(context.Context, uint64) (boo return _c } -// IsTrusted provides a mock function with given fields: +// IsTrusted provides a mock function with no fields func (_m *BHS) IsTrusted() bool { ret := _m.Called() diff --git a/core/services/blockhashstore/mocks/timer.go b/core/services/blockhashstore/mocks/timer.go index 1fe06d98092..e6fa10fbd07 100644 --- a/core/services/blockhashstore/mocks/timer.go +++ b/core/services/blockhashstore/mocks/timer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ccip/mocks/orm.go b/core/services/ccip/mocks/orm.go index 8353cc0f28c..30c365b24f1 100644 --- a/core/services/ccip/mocks/orm.go +++ b/core/services/ccip/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/chainlink/mocks/general_config.go b/core/services/chainlink/mocks/general_config.go index db1efb3d86f..738909538f3 100644 --- a/core/services/chainlink/mocks/general_config.go +++ b/core/services/chainlink/mocks/general_config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -36,7 +36,7 @@ func (_m *GeneralConfig) EXPECT() *GeneralConfig_Expecter { return &GeneralConfig_Expecter{mock: &_m.Mock} } -// AppID provides a mock function with given fields: +// AppID provides a mock function with no fields func (_m *GeneralConfig) AppID() uuid.UUID { ret := _m.Called() @@ -83,7 +83,7 @@ func (_c *GeneralConfig_AppID_Call) RunAndReturn(run func() uuid.UUID) *GeneralC return _c } -// AptosConfigs provides a mock function with given fields: +// AptosConfigs provides a mock function with no fields func (_m *GeneralConfig) AptosConfigs() chainlink.RawConfigs { ret := _m.Called() @@ -130,7 +130,7 @@ func (_c *GeneralConfig_AptosConfigs_Call) RunAndReturn(run func() chainlink.Raw return _c } -// AptosEnabled provides a mock function with given fields: +// AptosEnabled provides a mock function with no fields func (_m *GeneralConfig) AptosEnabled() bool { ret := _m.Called() @@ -175,7 +175,7 @@ func (_c *GeneralConfig_AptosEnabled_Call) RunAndReturn(run func() bool) *Genera return _c } -// AuditLogger provides a mock function with given fields: +// AuditLogger provides a mock function with no fields func (_m *GeneralConfig) AuditLogger() config.AuditLogger { ret := _m.Called() @@ -222,7 +222,7 @@ func (_c *GeneralConfig_AuditLogger_Call) RunAndReturn(run func() config.AuditLo return _c } -// AutoPprof provides a mock function with given fields: +// AutoPprof provides a mock function with no fields func (_m *GeneralConfig) AutoPprof() config.AutoPprof { ret := _m.Called() @@ -269,7 +269,7 @@ func (_c *GeneralConfig_AutoPprof_Call) RunAndReturn(run func() config.AutoPprof return _c } -// Capabilities provides a mock function with given fields: +// Capabilities provides a mock function with no fields func (_m *GeneralConfig) Capabilities() config.Capabilities { ret := _m.Called() @@ -316,7 +316,7 @@ func (_c *GeneralConfig_Capabilities_Call) RunAndReturn(run func() config.Capabi return _c } -// ConfigTOML provides a mock function with given fields: +// ConfigTOML provides a mock function with no fields func (_m *GeneralConfig) ConfigTOML() (string, string) { ret := _m.Called() @@ -371,7 +371,7 @@ func (_c *GeneralConfig_ConfigTOML_Call) RunAndReturn(run func() (string, string return _c } -// CosmosConfigs provides a mock function with given fields: +// CosmosConfigs provides a mock function with no fields func (_m *GeneralConfig) CosmosConfigs() cosmosconfig.TOMLConfigs { ret := _m.Called() @@ -418,7 +418,7 @@ func (_c *GeneralConfig_CosmosConfigs_Call) RunAndReturn(run func() cosmosconfig return _c } -// CosmosEnabled provides a mock function with given fields: +// CosmosEnabled provides a mock function with no fields func (_m *GeneralConfig) CosmosEnabled() bool { ret := _m.Called() @@ -463,7 +463,7 @@ func (_c *GeneralConfig_CosmosEnabled_Call) RunAndReturn(run func() bool) *Gener return _c } -// Database provides a mock function with given fields: +// Database provides a mock function with no fields func (_m *GeneralConfig) Database() config.Database { ret := _m.Called() @@ -510,7 +510,7 @@ func (_c *GeneralConfig_Database_Call) RunAndReturn(run func() config.Database) return _c } -// EVMConfigs provides a mock function with given fields: +// EVMConfigs provides a mock function with no fields func (_m *GeneralConfig) EVMConfigs() toml.EVMConfigs { ret := _m.Called() @@ -557,7 +557,7 @@ func (_c *GeneralConfig_EVMConfigs_Call) RunAndReturn(run func() toml.EVMConfigs return _c } -// EVMEnabled provides a mock function with given fields: +// EVMEnabled provides a mock function with no fields func (_m *GeneralConfig) EVMEnabled() bool { ret := _m.Called() @@ -602,7 +602,7 @@ func (_c *GeneralConfig_EVMEnabled_Call) RunAndReturn(run func() bool) *GeneralC return _c } -// EVMRPCEnabled provides a mock function with given fields: +// EVMRPCEnabled provides a mock function with no fields func (_m *GeneralConfig) EVMRPCEnabled() bool { ret := _m.Called() @@ -647,7 +647,7 @@ func (_c *GeneralConfig_EVMRPCEnabled_Call) RunAndReturn(run func() bool) *Gener return _c } -// Feature provides a mock function with given fields: +// Feature provides a mock function with no fields func (_m *GeneralConfig) Feature() config.Feature { ret := _m.Called() @@ -694,7 +694,7 @@ func (_c *GeneralConfig_Feature_Call) RunAndReturn(run func() config.Feature) *G return _c } -// FluxMonitor provides a mock function with given fields: +// FluxMonitor provides a mock function with no fields func (_m *GeneralConfig) FluxMonitor() config.FluxMonitor { ret := _m.Called() @@ -741,7 +741,7 @@ func (_c *GeneralConfig_FluxMonitor_Call) RunAndReturn(run func() config.FluxMon return _c } -// Insecure provides a mock function with given fields: +// Insecure provides a mock function with no fields func (_m *GeneralConfig) Insecure() config.Insecure { ret := _m.Called() @@ -788,7 +788,7 @@ func (_c *GeneralConfig_Insecure_Call) RunAndReturn(run func() config.Insecure) return _c } -// InsecureFastScrypt provides a mock function with given fields: +// InsecureFastScrypt provides a mock function with no fields func (_m *GeneralConfig) InsecureFastScrypt() bool { ret := _m.Called() @@ -833,7 +833,7 @@ func (_c *GeneralConfig_InsecureFastScrypt_Call) RunAndReturn(run func() bool) * return _c } -// JobPipeline provides a mock function with given fields: +// JobPipeline provides a mock function with no fields func (_m *GeneralConfig) JobPipeline() config.JobPipeline { ret := _m.Called() @@ -880,7 +880,7 @@ func (_c *GeneralConfig_JobPipeline_Call) RunAndReturn(run func() config.JobPipe return _c } -// Keeper provides a mock function with given fields: +// Keeper provides a mock function with no fields func (_m *GeneralConfig) Keeper() config.Keeper { ret := _m.Called() @@ -927,7 +927,7 @@ func (_c *GeneralConfig_Keeper_Call) RunAndReturn(run func() config.Keeper) *Gen return _c } -// Log provides a mock function with given fields: +// Log provides a mock function with no fields func (_m *GeneralConfig) Log() config.Log { ret := _m.Called() @@ -1004,11 +1004,11 @@ func (_c *GeneralConfig_LogConfiguration_Call) Return() *GeneralConfig_LogConfig } func (_c *GeneralConfig_LogConfiguration_Call) RunAndReturn(run func(config.LogfFn, config.LogfFn)) *GeneralConfig_LogConfiguration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Mercury provides a mock function with given fields: +// Mercury provides a mock function with no fields func (_m *GeneralConfig) Mercury() config.Mercury { ret := _m.Called() @@ -1055,7 +1055,7 @@ func (_c *GeneralConfig_Mercury_Call) RunAndReturn(run func() config.Mercury) *G return _c } -// OCR provides a mock function with given fields: +// OCR provides a mock function with no fields func (_m *GeneralConfig) OCR() config.OCR { ret := _m.Called() @@ -1102,7 +1102,7 @@ func (_c *GeneralConfig_OCR_Call) RunAndReturn(run func() config.OCR) *GeneralCo return _c } -// OCR2 provides a mock function with given fields: +// OCR2 provides a mock function with no fields func (_m *GeneralConfig) OCR2() config.OCR2 { ret := _m.Called() @@ -1149,7 +1149,7 @@ func (_c *GeneralConfig_OCR2_Call) RunAndReturn(run func() config.OCR2) *General return _c } -// P2P provides a mock function with given fields: +// P2P provides a mock function with no fields func (_m *GeneralConfig) P2P() config.P2P { ret := _m.Called() @@ -1196,7 +1196,7 @@ func (_c *GeneralConfig_P2P_Call) RunAndReturn(run func() config.P2P) *GeneralCo return _c } -// Password provides a mock function with given fields: +// Password provides a mock function with no fields func (_m *GeneralConfig) Password() config.Password { ret := _m.Called() @@ -1243,7 +1243,7 @@ func (_c *GeneralConfig_Password_Call) RunAndReturn(run func() config.Password) return _c } -// Prometheus provides a mock function with given fields: +// Prometheus provides a mock function with no fields func (_m *GeneralConfig) Prometheus() config.Prometheus { ret := _m.Called() @@ -1290,7 +1290,7 @@ func (_c *GeneralConfig_Prometheus_Call) RunAndReturn(run func() config.Promethe return _c } -// Pyroscope provides a mock function with given fields: +// Pyroscope provides a mock function with no fields func (_m *GeneralConfig) Pyroscope() config.Pyroscope { ret := _m.Called() @@ -1337,7 +1337,7 @@ func (_c *GeneralConfig_Pyroscope_Call) RunAndReturn(run func() config.Pyroscope return _c } -// RootDir provides a mock function with given fields: +// RootDir provides a mock function with no fields func (_m *GeneralConfig) RootDir() string { ret := _m.Called() @@ -1382,7 +1382,7 @@ func (_c *GeneralConfig_RootDir_Call) RunAndReturn(run func() string) *GeneralCo return _c } -// Sentry provides a mock function with given fields: +// Sentry provides a mock function with no fields func (_m *GeneralConfig) Sentry() config.Sentry { ret := _m.Called() @@ -1504,7 +1504,7 @@ func (_c *GeneralConfig_SetLogSQL_Call) Return() *GeneralConfig_SetLogSQL_Call { } func (_c *GeneralConfig_SetLogSQL_Call) RunAndReturn(run func(bool)) *GeneralConfig_SetLogSQL_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1538,11 +1538,11 @@ func (_c *GeneralConfig_SetPasswords_Call) Return() *GeneralConfig_SetPasswords_ } func (_c *GeneralConfig_SetPasswords_Call) RunAndReturn(run func(*string, *string)) *GeneralConfig_SetPasswords_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// ShutdownGracePeriod provides a mock function with given fields: +// ShutdownGracePeriod provides a mock function with no fields func (_m *GeneralConfig) ShutdownGracePeriod() time.Duration { ret := _m.Called() @@ -1587,7 +1587,7 @@ func (_c *GeneralConfig_ShutdownGracePeriod_Call) RunAndReturn(run func() time.D return _c } -// SolanaConfigs provides a mock function with given fields: +// SolanaConfigs provides a mock function with no fields func (_m *GeneralConfig) SolanaConfigs() solanaconfig.TOMLConfigs { ret := _m.Called() @@ -1634,7 +1634,7 @@ func (_c *GeneralConfig_SolanaConfigs_Call) RunAndReturn(run func() solanaconfig return _c } -// SolanaEnabled provides a mock function with given fields: +// SolanaEnabled provides a mock function with no fields func (_m *GeneralConfig) SolanaEnabled() bool { ret := _m.Called() @@ -1679,7 +1679,7 @@ func (_c *GeneralConfig_SolanaEnabled_Call) RunAndReturn(run func() bool) *Gener return _c } -// StarkNetEnabled provides a mock function with given fields: +// StarkNetEnabled provides a mock function with no fields func (_m *GeneralConfig) StarkNetEnabled() bool { ret := _m.Called() @@ -1724,7 +1724,7 @@ func (_c *GeneralConfig_StarkNetEnabled_Call) RunAndReturn(run func() bool) *Gen return _c } -// StarknetConfigs provides a mock function with given fields: +// StarknetConfigs provides a mock function with no fields func (_m *GeneralConfig) StarknetConfigs() chainlinkconfig.TOMLConfigs { ret := _m.Called() @@ -1771,7 +1771,7 @@ func (_c *GeneralConfig_StarknetConfigs_Call) RunAndReturn(run func() chainlinkc return _c } -// Telemetry provides a mock function with given fields: +// Telemetry provides a mock function with no fields func (_m *GeneralConfig) Telemetry() config.Telemetry { ret := _m.Called() @@ -1818,7 +1818,7 @@ func (_c *GeneralConfig_Telemetry_Call) RunAndReturn(run func() config.Telemetry return _c } -// TelemetryIngress provides a mock function with given fields: +// TelemetryIngress provides a mock function with no fields func (_m *GeneralConfig) TelemetryIngress() config.TelemetryIngress { ret := _m.Called() @@ -1865,7 +1865,7 @@ func (_c *GeneralConfig_TelemetryIngress_Call) RunAndReturn(run func() config.Te return _c } -// Threshold provides a mock function with given fields: +// Threshold provides a mock function with no fields func (_m *GeneralConfig) Threshold() config.Threshold { ret := _m.Called() @@ -1912,7 +1912,7 @@ func (_c *GeneralConfig_Threshold_Call) RunAndReturn(run func() config.Threshold return _c } -// Tracing provides a mock function with given fields: +// Tracing provides a mock function with no fields func (_m *GeneralConfig) Tracing() config.Tracing { ret := _m.Called() @@ -1959,7 +1959,7 @@ func (_c *GeneralConfig_Tracing_Call) RunAndReturn(run func() config.Tracing) *G return _c } -// Validate provides a mock function with given fields: +// Validate provides a mock function with no fields func (_m *GeneralConfig) Validate() error { ret := _m.Called() @@ -2004,7 +2004,7 @@ func (_c *GeneralConfig_Validate_Call) RunAndReturn(run func() error) *GeneralCo return _c } -// ValidateDB provides a mock function with given fields: +// ValidateDB provides a mock function with no fields func (_m *GeneralConfig) ValidateDB() error { ret := _m.Called() @@ -2049,7 +2049,7 @@ func (_c *GeneralConfig_ValidateDB_Call) RunAndReturn(run func() error) *General return _c } -// WebServer provides a mock function with given fields: +// WebServer provides a mock function with no fields func (_m *GeneralConfig) WebServer() config.WebServer { ret := _m.Called() diff --git a/core/services/feeds/mocks/connections_manager.go b/core/services/feeds/mocks/connections_manager.go index 2c7b71bd05c..20d68315297 100644 --- a/core/services/feeds/mocks/connections_manager.go +++ b/core/services/feeds/mocks/connections_manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *ConnectionsManager) EXPECT() *ConnectionsManager_Expecter { return &ConnectionsManager_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ConnectionsManager) Close() { _m.Called() } @@ -50,7 +50,7 @@ func (_c *ConnectionsManager_Close_Call) Return() *ConnectionsManager_Close_Call } func (_c *ConnectionsManager_Close_Call) RunAndReturn(run func()) *ConnectionsManager_Close_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -83,7 +83,7 @@ func (_c *ConnectionsManager_Connect_Call) Return() *ConnectionsManager_Connect_ } func (_c *ConnectionsManager_Connect_Call) RunAndReturn(run func(feeds.ConnectOpts)) *ConnectionsManager_Connect_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/feeds/mocks/feeds_manager_client.go b/core/services/feeds/mocks/feeds_manager_client.go index b07362b7787..13ef5ed4c76 100644 --- a/core/services/feeds/mocks/feeds_manager_client.go +++ b/core/services/feeds/mocks/feeds_manager_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/feeds/mocks/orm.go b/core/services/feeds/mocks/orm.go index b4f5c47e51f..b6e00148682 100644 --- a/core/services/feeds/mocks/orm.go +++ b/core/services/feeds/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/feeds/mocks/service.go b/core/services/feeds/mocks/service.go index 8ae42534f58..9d63e706c29 100644 --- a/core/services/feeds/mocks/service.go +++ b/core/services/feeds/mocks/service.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -117,7 +117,7 @@ func (_c *Service_CancelSpec_Call) RunAndReturn(run func(context.Context, int64) return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Service) Close() error { ret := _m.Called() @@ -1436,7 +1436,7 @@ func (_c *Service_Unsafe_SetConnectionsManager_Call) Return() *Service_Unsafe_Se } func (_c *Service_Unsafe_SetConnectionsManager_Call) RunAndReturn(run func(feeds.ConnectionsManager)) *Service_Unsafe_SetConnectionsManager_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/fluxmonitorv2/mocks/contract_submitter.go b/core/services/fluxmonitorv2/mocks/contract_submitter.go index 79143fdbfdd..79fda08d29e 100644 --- a/core/services/fluxmonitorv2/mocks/contract_submitter.go +++ b/core/services/fluxmonitorv2/mocks/contract_submitter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/fluxmonitorv2/mocks/flags.go b/core/services/fluxmonitorv2/mocks/flags.go index f37acea31c8..f1b098f7de6 100644 --- a/core/services/fluxmonitorv2/mocks/flags.go +++ b/core/services/fluxmonitorv2/mocks/flags.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -25,7 +25,7 @@ func (_m *Flags) EXPECT() *Flags_Expecter { return &Flags_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *Flags) Address() common.Address { ret := _m.Called() @@ -72,7 +72,7 @@ func (_c *Flags_Address_Call) RunAndReturn(run func() common.Address) *Flags_Add return _c } -// ContractExists provides a mock function with given fields: +// ContractExists provides a mock function with no fields func (_m *Flags) ContractExists() bool { ret := _m.Called() diff --git a/core/services/fluxmonitorv2/mocks/key_store_interface.go b/core/services/fluxmonitorv2/mocks/key_store_interface.go index c147c7b619e..67a28f97e9b 100644 --- a/core/services/fluxmonitorv2/mocks/key_store_interface.go +++ b/core/services/fluxmonitorv2/mocks/key_store_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/fluxmonitorv2/mocks/orm.go b/core/services/fluxmonitorv2/mocks/orm.go index 6ccd5f40ebe..24f516dcdc2 100644 --- a/core/services/fluxmonitorv2/mocks/orm.go +++ b/core/services/fluxmonitorv2/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/functions/mocks/bridge_accessor.go b/core/services/functions/mocks/bridge_accessor.go index 59f6f8f3db9..6672c55bee9 100644 --- a/core/services/functions/mocks/bridge_accessor.go +++ b/core/services/functions/mocks/bridge_accessor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/functions/mocks/external_adapter_client.go b/core/services/functions/mocks/external_adapter_client.go index a7d76c44a35..661ed076e4a 100644 --- a/core/services/functions/mocks/external_adapter_client.go +++ b/core/services/functions/mocks/external_adapter_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/functions/mocks/functions_listener.go b/core/services/functions/mocks/functions_listener.go index 58acb7981e3..52011a70167 100644 --- a/core/services/functions/mocks/functions_listener.go +++ b/core/services/functions/mocks/functions_listener.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *FunctionsListener) EXPECT() *FunctionsListener_Expecter { return &FunctionsListener_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *FunctionsListener) Close() error { ret := _m.Called() diff --git a/core/services/functions/mocks/offchain_transmitter.go b/core/services/functions/mocks/offchain_transmitter.go index 9b61f9072e5..91ca230be64 100644 --- a/core/services/functions/mocks/offchain_transmitter.go +++ b/core/services/functions/mocks/offchain_transmitter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *OffchainTransmitter) EXPECT() *OffchainTransmitter_Expecter { return &OffchainTransmitter_Expecter{mock: &_m.Mock} } -// ReportChannel provides a mock function with given fields: +// ReportChannel provides a mock function with no fields func (_m *OffchainTransmitter) ReportChannel() chan *functions.OffchainResponse { ret := _m.Called() diff --git a/core/services/functions/mocks/orm.go b/core/services/functions/mocks/orm.go index 22e6368ac1f..4e7f9d393cb 100644 --- a/core/services/functions/mocks/orm.go +++ b/core/services/functions/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/connector/mocks/gateway_connector.go b/core/services/gateway/connector/mocks/gateway_connector.go index ba5c2213b5f..51dcafe7091 100644 --- a/core/services/gateway/connector/mocks/gateway_connector.go +++ b/core/services/gateway/connector/mocks/gateway_connector.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -179,7 +179,7 @@ func (_c *GatewayConnector_ChallengeResponse_Call) RunAndReturn(run func(*url.UR return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *GatewayConnector) Close() error { ret := _m.Called() @@ -224,7 +224,7 @@ func (_c *GatewayConnector_Close_Call) RunAndReturn(run func() error) *GatewayCo return _c } -// DonID provides a mock function with given fields: +// DonID provides a mock function with no fields func (_m *GatewayConnector) DonID() string { ret := _m.Called() @@ -269,7 +269,7 @@ func (_c *GatewayConnector_DonID_Call) RunAndReturn(run func() string) *GatewayC return _c } -// GatewayIDs provides a mock function with given fields: +// GatewayIDs provides a mock function with no fields func (_m *GatewayConnector) GatewayIDs() []string { ret := _m.Called() @@ -316,7 +316,7 @@ func (_c *GatewayConnector_GatewayIDs_Call) RunAndReturn(run func() []string) *G return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *GatewayConnector) HealthReport() map[string]error { ret := _m.Called() @@ -363,7 +363,7 @@ func (_c *GatewayConnector_HealthReport_Call) RunAndReturn(run func() map[string return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *GatewayConnector) Name() string { ret := _m.Called() @@ -466,7 +466,7 @@ func (_c *GatewayConnector_NewAuthHeader_Call) RunAndReturn(run func(*url.URL) ( return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *GatewayConnector) Ready() error { ret := _m.Called() diff --git a/core/services/gateway/connector/mocks/gateway_connector_handler.go b/core/services/gateway/connector/mocks/gateway_connector_handler.go index 6f21cb9dd2f..424f608a9b5 100644 --- a/core/services/gateway/connector/mocks/gateway_connector_handler.go +++ b/core/services/gateway/connector/mocks/gateway_connector_handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -23,7 +23,7 @@ func (_m *GatewayConnectorHandler) EXPECT() *GatewayConnectorHandler_Expecter { return &GatewayConnectorHandler_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *GatewayConnectorHandler) Close() error { ret := _m.Called() @@ -99,7 +99,7 @@ func (_c *GatewayConnectorHandler_HandleGatewayMessage_Call) Return() *GatewayCo } func (_c *GatewayConnectorHandler_HandleGatewayMessage_Call) RunAndReturn(run func(context.Context, string, *api.Message)) *GatewayConnectorHandler_HandleGatewayMessage_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/gateway/connector/mocks/signer.go b/core/services/gateway/connector/mocks/signer.go index 0f240b87e33..9b2aa0fd97a 100644 --- a/core/services/gateway/connector/mocks/signer.go +++ b/core/services/gateway/connector/mocks/signer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go b/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go index 78fb7d4ec4f..8340413718e 100644 --- a/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go +++ b/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -69,7 +69,7 @@ func (_c *OnchainAllowlist_Allow_Call) RunAndReturn(run func(common.Address) boo return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *OnchainAllowlist) Close() error { ret := _m.Called() diff --git a/core/services/gateway/handlers/functions/allowlist/mocks/orm.go b/core/services/gateway/handlers/functions/allowlist/mocks/orm.go index 8a3bddfda78..261e967c820 100644 --- a/core/services/gateway/handlers/functions/allowlist/mocks/orm.go +++ b/core/services/gateway/handlers/functions/allowlist/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go b/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go index 48f0c6cdadb..7312f2a6743 100644 --- a/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go +++ b/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *OnchainSubscriptions) EXPECT() *OnchainSubscriptions_Expecter { return &OnchainSubscriptions_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *OnchainSubscriptions) Close() error { ret := _m.Called() diff --git a/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go b/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go index 118c8d317a1..c093bd1523e 100644 --- a/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go +++ b/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/handlers/mocks/don.go b/core/services/gateway/handlers/mocks/don.go index 7e28a1c5e97..93ab52c2473 100644 --- a/core/services/gateway/handlers/mocks/don.go +++ b/core/services/gateway/handlers/mocks/don.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/handlers/mocks/handler.go b/core/services/gateway/handlers/mocks/handler.go index 3f129a9ca83..96f3faad15c 100644 --- a/core/services/gateway/handlers/mocks/handler.go +++ b/core/services/gateway/handlers/mocks/handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -25,7 +25,7 @@ func (_m *Handler) EXPECT() *Handler_Expecter { return &Handler_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Handler) Close() error { ret := _m.Called() diff --git a/core/services/gateway/network/mocks/connection_acceptor.go b/core/services/gateway/network/mocks/connection_acceptor.go index 4c2aaaabb18..48bcf9884a6 100644 --- a/core/services/gateway/network/mocks/connection_acceptor.go +++ b/core/services/gateway/network/mocks/connection_acceptor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -50,7 +50,7 @@ func (_c *ConnectionAcceptor_AbortHandshake_Call) Return() *ConnectionAcceptor_A } func (_c *ConnectionAcceptor_AbortHandshake_Call) RunAndReturn(run func(string)) *ConnectionAcceptor_AbortHandshake_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/gateway/network/mocks/connection_initiator.go b/core/services/gateway/network/mocks/connection_initiator.go index 2c18ad59cb5..5bf10d01aa9 100644 --- a/core/services/gateway/network/mocks/connection_initiator.go +++ b/core/services/gateway/network/mocks/connection_initiator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/network/mocks/http_client.go b/core/services/gateway/network/mocks/http_client.go index 2702cbd83fd..29bf4348036 100644 --- a/core/services/gateway/network/mocks/http_client.go +++ b/core/services/gateway/network/mocks/http_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/network/mocks/http_request_handler.go b/core/services/gateway/network/mocks/http_request_handler.go index 39b3c71be52..2756bddb3db 100644 --- a/core/services/gateway/network/mocks/http_request_handler.go +++ b/core/services/gateway/network/mocks/http_request_handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/gateway/network/mocks/http_server.go b/core/services/gateway/network/mocks/http_server.go index 0e29525bfc3..ae51ffaa512 100644 --- a/core/services/gateway/network/mocks/http_server.go +++ b/core/services/gateway/network/mocks/http_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *HttpServer) EXPECT() *HttpServer_Expecter { return &HttpServer_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *HttpServer) Close() error { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *HttpServer_Close_Call) RunAndReturn(run func() error) *HttpServer_Clos return _c } -// GetPort provides a mock function with given fields: +// GetPort provides a mock function with no fields func (_m *HttpServer) GetPort() int { ret := _m.Called() @@ -141,7 +141,7 @@ func (_c *HttpServer_SetHTTPRequestHandler_Call) Return() *HttpServer_SetHTTPReq } func (_c *HttpServer_SetHTTPRequestHandler_Call) RunAndReturn(run func(network.HTTPRequestHandler)) *HttpServer_SetHTTPRequestHandler_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/gateway/network/mocks/web_socket_server.go b/core/services/gateway/network/mocks/web_socket_server.go index 96e8a8ee22d..34e478533ee 100644 --- a/core/services/gateway/network/mocks/web_socket_server.go +++ b/core/services/gateway/network/mocks/web_socket_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -21,7 +21,7 @@ func (_m *WebSocketServer) EXPECT() *WebSocketServer_Expecter { return &WebSocketServer_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *WebSocketServer) Close() error { ret := _m.Called() @@ -66,7 +66,7 @@ func (_c *WebSocketServer_Close_Call) RunAndReturn(run func() error) *WebSocketS return _c } -// GetPort provides a mock function with given fields: +// GetPort provides a mock function with no fields func (_m *WebSocketServer) GetPort() int { ret := _m.Called() diff --git a/core/services/headreporter/head_reporter_mock.go b/core/services/headreporter/head_reporter_mock.go index ad9923fd179..1636aec4631 100644 --- a/core/services/headreporter/head_reporter_mock.go +++ b/core/services/headreporter/head_reporter_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package headreporter diff --git a/core/services/headreporter/prometheus_backend_mock.go b/core/services/headreporter/prometheus_backend_mock.go index ebcc88b9722..031b5d4c937 100644 --- a/core/services/headreporter/prometheus_backend_mock.go +++ b/core/services/headreporter/prometheus_backend_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package headreporter @@ -51,7 +51,7 @@ func (_c *MockPrometheusBackend_SetMaxUnconfirmedAge_Call) Return() *MockPrometh } func (_c *MockPrometheusBackend_SetMaxUnconfirmedAge_Call) RunAndReturn(run func(*big.Int, float64)) *MockPrometheusBackend_SetMaxUnconfirmedAge_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -85,7 +85,7 @@ func (_c *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call) Return() *MockProm } func (_c *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call) RunAndReturn(run func(*big.Int, int64)) *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -118,7 +118,7 @@ func (_c *MockPrometheusBackend_SetPipelineRunsQueued_Call) Return() *MockPromet } func (_c *MockPrometheusBackend_SetPipelineRunsQueued_Call) RunAndReturn(run func(int)) *MockPrometheusBackend_SetPipelineRunsQueued_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -151,7 +151,7 @@ func (_c *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call) Return() *MockPr } func (_c *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call) RunAndReturn(run func(int)) *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -185,7 +185,7 @@ func (_c *MockPrometheusBackend_SetUnconfirmedTransactions_Call) Return() *MockP } func (_c *MockPrometheusBackend_SetUnconfirmedTransactions_Call) RunAndReturn(run func(*big.Int, int64)) *MockPrometheusBackend_SetUnconfirmedTransactions_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/job/mocks/kv_store.go b/core/services/job/mocks/kv_store.go index 5a606b12cca..7fe62ded59e 100644 --- a/core/services/job/mocks/kv_store.go +++ b/core/services/job/mocks/kv_store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/job/mocks/orm.go b/core/services/job/mocks/orm.go index 96513866f37..170dfa25c58 100644 --- a/core/services/job/mocks/orm.go +++ b/core/services/job/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -81,7 +81,7 @@ func (_c *ORM_AssertBridgesExist_Call) RunAndReturn(run func(context.Context, pi return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ORM) Close() error { ret := _m.Called() @@ -230,7 +230,7 @@ func (_c *ORM_CreateJob_Call) RunAndReturn(run func(context.Context, *job.Job) e return _c } -// DataSource provides a mock function with given fields: +// DataSource provides a mock function with no fields func (_m *ORM) DataSource() sqlutil.DataSource { ret := _m.Called() @@ -1609,7 +1609,7 @@ func (_c *ORM_TryRecordError_Call) Return() *ORM_TryRecordError_Call { } func (_c *ORM_TryRecordError_Call) RunAndReturn(run func(context.Context, int32, string)) *ORM_TryRecordError_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/job/mocks/service_ctx.go b/core/services/job/mocks/service_ctx.go index d7ac02bfd0e..8f1ba3596c1 100644 --- a/core/services/job/mocks/service_ctx.go +++ b/core/services/job/mocks/service_ctx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -21,7 +21,7 @@ func (_m *ServiceCtx) EXPECT() *ServiceCtx_Expecter { return &ServiceCtx_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ServiceCtx) Close() error { ret := _m.Called() diff --git a/core/services/job/mocks/spawner.go b/core/services/job/mocks/spawner.go index aa40522f358..a8039643bd5 100644 --- a/core/services/job/mocks/spawner.go +++ b/core/services/job/mocks/spawner.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *Spawner) EXPECT() *Spawner_Expecter { return &Spawner_Expecter{mock: &_m.Mock} } -// ActiveJobs provides a mock function with given fields: +// ActiveJobs provides a mock function with no fields func (_m *Spawner) ActiveJobs() map[int32]job.Job { ret := _m.Called() @@ -71,7 +71,7 @@ func (_c *Spawner_ActiveJobs_Call) RunAndReturn(run func() map[int32]job.Job) *S return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Spawner) Close() error { ret := _m.Called() @@ -212,7 +212,7 @@ func (_c *Spawner_DeleteJob_Call) RunAndReturn(run func(context.Context, sqlutil return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *Spawner) HealthReport() map[string]error { ret := _m.Called() @@ -259,7 +259,7 @@ func (_c *Spawner_HealthReport_Call) RunAndReturn(run func() map[string]error) * return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *Spawner) Name() string { ret := _m.Called() @@ -304,7 +304,7 @@ func (_c *Spawner_Name_Call) RunAndReturn(run func() string) *Spawner_Name_Call return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *Spawner) Ready() error { ret := _m.Called() diff --git a/core/services/keystore/mocks/aptos.go b/core/services/keystore/mocks/aptos.go index 9c9124aeeac..98cb90457b7 100644 --- a/core/services/keystore/mocks/aptos.go +++ b/core/services/keystore/mocks/aptos.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *Aptos_Get_Call) RunAndReturn(run func(string) (aptoskey.Key, error)) * return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *Aptos) GetAll() ([]aptoskey.Key, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/cosmos.go b/core/services/keystore/mocks/cosmos.go index 74690bf6889..ef127191285 100644 --- a/core/services/keystore/mocks/cosmos.go +++ b/core/services/keystore/mocks/cosmos.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *Cosmos_Get_Call) RunAndReturn(run func(string) (cosmoskey.Key, error)) return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *Cosmos) GetAll() ([]cosmoskey.Key, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/csa.go b/core/services/keystore/mocks/csa.go index 5ce17c0beff..73a4c048806 100644 --- a/core/services/keystore/mocks/csa.go +++ b/core/services/keystore/mocks/csa.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *CSA_Get_Call) RunAndReturn(run func(string) (csakey.KeyV2, error)) *CS return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *CSA) GetAll() ([]csakey.KeyV2, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/eth.go b/core/services/keystore/mocks/eth.go index 4f2486464eb..7ed960663f7 100644 --- a/core/services/keystore/mocks/eth.go +++ b/core/services/keystore/mocks/eth.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -1293,7 +1293,7 @@ func (_c *Eth_XXXTestingOnlyAdd_Call) Return() *Eth_XXXTestingOnlyAdd_Call { } func (_c *Eth_XXXTestingOnlyAdd_Call) RunAndReturn(run func(context.Context, ethkey.KeyV2)) *Eth_XXXTestingOnlyAdd_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -1327,7 +1327,7 @@ func (_c *Eth_XXXTestingOnlySetState_Call) Return() *Eth_XXXTestingOnlySetState_ } func (_c *Eth_XXXTestingOnlySetState_Call) RunAndReturn(run func(context.Context, ethkey.State)) *Eth_XXXTestingOnlySetState_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/keystore/mocks/master.go b/core/services/keystore/mocks/master.go index 7c86001bc54..01b85a542d8 100644 --- a/core/services/keystore/mocks/master.go +++ b/core/services/keystore/mocks/master.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *Master) EXPECT() *Master_Expecter { return &Master_Expecter{mock: &_m.Mock} } -// Aptos provides a mock function with given fields: +// Aptos provides a mock function with no fields func (_m *Master) Aptos() keystore.Aptos { ret := _m.Called() @@ -69,7 +69,7 @@ func (_c *Master_Aptos_Call) RunAndReturn(run func() keystore.Aptos) *Master_Apt return _c } -// CSA provides a mock function with given fields: +// CSA provides a mock function with no fields func (_m *Master) CSA() keystore.CSA { ret := _m.Called() @@ -116,7 +116,7 @@ func (_c *Master_CSA_Call) RunAndReturn(run func() keystore.CSA) *Master_CSA_Cal return _c } -// Cosmos provides a mock function with given fields: +// Cosmos provides a mock function with no fields func (_m *Master) Cosmos() keystore.Cosmos { ret := _m.Called() @@ -163,7 +163,7 @@ func (_c *Master_Cosmos_Call) RunAndReturn(run func() keystore.Cosmos) *Master_C return _c } -// Eth provides a mock function with given fields: +// Eth provides a mock function with no fields func (_m *Master) Eth() keystore.Eth { ret := _m.Called() @@ -266,7 +266,7 @@ func (_c *Master_IsEmpty_Call) RunAndReturn(run func(context.Context) (bool, err return _c } -// OCR provides a mock function with given fields: +// OCR provides a mock function with no fields func (_m *Master) OCR() keystore.OCR { ret := _m.Called() @@ -313,7 +313,7 @@ func (_c *Master_OCR_Call) RunAndReturn(run func() keystore.OCR) *Master_OCR_Cal return _c } -// OCR2 provides a mock function with given fields: +// OCR2 provides a mock function with no fields func (_m *Master) OCR2() keystore.OCR2 { ret := _m.Called() @@ -360,7 +360,7 @@ func (_c *Master_OCR2_Call) RunAndReturn(run func() keystore.OCR2) *Master_OCR2_ return _c } -// P2P provides a mock function with given fields: +// P2P provides a mock function with no fields func (_m *Master) P2P() keystore.P2P { ret := _m.Called() @@ -407,7 +407,7 @@ func (_c *Master_P2P_Call) RunAndReturn(run func() keystore.P2P) *Master_P2P_Cal return _c } -// Solana provides a mock function with given fields: +// Solana provides a mock function with no fields func (_m *Master) Solana() keystore.Solana { ret := _m.Called() @@ -454,7 +454,7 @@ func (_c *Master_Solana_Call) RunAndReturn(run func() keystore.Solana) *Master_S return _c } -// StarkNet provides a mock function with given fields: +// StarkNet provides a mock function with no fields func (_m *Master) StarkNet() keystore.StarkNet { ret := _m.Called() @@ -548,7 +548,7 @@ func (_c *Master_Unlock_Call) RunAndReturn(run func(context.Context, string) err return _c } -// VRF provides a mock function with given fields: +// VRF provides a mock function with no fields func (_m *Master) VRF() keystore.VRF { ret := _m.Called() @@ -595,7 +595,7 @@ func (_c *Master_VRF_Call) RunAndReturn(run func() keystore.VRF) *Master_VRF_Cal return _c } -// Workflow provides a mock function with given fields: +// Workflow provides a mock function with no fields func (_m *Master) Workflow() keystore.Workflow { ret := _m.Called() diff --git a/core/services/keystore/mocks/ocr.go b/core/services/keystore/mocks/ocr.go index d3bb15aec86..bb0ecae9bda 100644 --- a/core/services/keystore/mocks/ocr.go +++ b/core/services/keystore/mocks/ocr.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *OCR_Get_Call) RunAndReturn(run func(string) (ocrkey.KeyV2, error)) *OC return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *OCR) GetAll() ([]ocrkey.KeyV2, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/ocr2.go b/core/services/keystore/mocks/ocr2.go index 6ff7d2f6b58..3497fa7ac4d 100644 --- a/core/services/keystore/mocks/ocr2.go +++ b/core/services/keystore/mocks/ocr2.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -356,7 +356,7 @@ func (_c *OCR2_Get_Call) RunAndReturn(run func(string) (ocr2key.KeyBundle, error return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *OCR2) GetAll() ([]ocr2key.KeyBundle, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/p2p.go b/core/services/keystore/mocks/p2p.go index 3dead948b14..917f620edd3 100644 --- a/core/services/keystore/mocks/p2p.go +++ b/core/services/keystore/mocks/p2p.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *P2P_Get_Call) RunAndReturn(run func(p2pkey.PeerID) (p2pkey.KeyV2, erro return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *P2P) GetAll() ([]p2pkey.KeyV2, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/solana.go b/core/services/keystore/mocks/solana.go index d55e85436df..3478b83bbe7 100644 --- a/core/services/keystore/mocks/solana.go +++ b/core/services/keystore/mocks/solana.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *Solana_Get_Call) RunAndReturn(run func(string) (solkey.Key, error)) *S return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *Solana) GetAll() ([]solkey.Key, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/starknet.go b/core/services/keystore/mocks/starknet.go index 720d16c9b2f..405408409b7 100644 --- a/core/services/keystore/mocks/starknet.go +++ b/core/services/keystore/mocks/starknet.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *StarkNet_Get_Call) RunAndReturn(run func(string) (starkkey.Key, error) return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *StarkNet) GetAll() ([]starkkey.Key, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/vrf.go b/core/services/keystore/mocks/vrf.go index dff36e8a3e9..e1705daa64a 100644 --- a/core/services/keystore/mocks/vrf.go +++ b/core/services/keystore/mocks/vrf.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -356,7 +356,7 @@ func (_c *VRF_Get_Call) RunAndReturn(run func(string) (vrfkey.KeyV2, error)) *VR return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *VRF) GetAll() ([]vrfkey.KeyV2, error) { ret := _m.Called() diff --git a/core/services/keystore/mocks/workflow.go b/core/services/keystore/mocks/workflow.go index f19045cecc4..91929e13768 100644 --- a/core/services/keystore/mocks/workflow.go +++ b/core/services/keystore/mocks/workflow.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -344,7 +344,7 @@ func (_c *Workflow_Get_Call) RunAndReturn(run func(string) (workflowkey.Key, err return _c } -// GetAll provides a mock function with given fields: +// GetAll provides a mock function with no fields func (_m *Workflow) GetAll() ([]workflowkey.Key, error) { ret := _m.Called() diff --git a/core/services/mocks/checker.go b/core/services/mocks/checker.go index 24b5315254c..cda33d50ad0 100644 --- a/core/services/mocks/checker.go +++ b/core/services/mocks/checker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -20,7 +20,7 @@ func (_m *Checker) EXPECT() *Checker_Expecter { return &Checker_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Checker) Close() error { ret := _m.Called() @@ -65,7 +65,7 @@ func (_c *Checker_Close_Call) RunAndReturn(run func() error) *Checker_Close_Call return _c } -// IsHealthy provides a mock function with given fields: +// IsHealthy provides a mock function with no fields func (_m *Checker) IsHealthy() (bool, map[string]error) { ret := _m.Called() @@ -122,7 +122,7 @@ func (_c *Checker_IsHealthy_Call) RunAndReturn(run func() (bool, map[string]erro return _c } -// IsReady provides a mock function with given fields: +// IsReady provides a mock function with no fields func (_m *Checker) IsReady() (bool, map[string]error) { ret := _m.Called() @@ -225,7 +225,7 @@ func (_c *Checker_Register_Call) RunAndReturn(run func(pkgservices.HealthReporte return _c } -// Start provides a mock function with given fields: +// Start provides a mock function with no fields func (_m *Checker) Start() error { ret := _m.Called() diff --git a/core/services/ocr/mocks/ocr_contract_tracker_db.go b/core/services/ocr/mocks/ocr_contract_tracker_db.go index fc29c50f1ea..ea95cbd83f5 100644 --- a/core/services/ocr/mocks/ocr_contract_tracker_db.go +++ b/core/services/ocr/mocks/ocr_contract_tracker_db.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go b/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go index 316f38f8ffc..5f9d9dcccac 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -21,7 +21,7 @@ func (_m *ChainHealthcheck) EXPECT() *ChainHealthcheck_Expecter { return &ChainHealthcheck_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ChainHealthcheck) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go index 5302ae0b54f..9bda468b31d 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -23,7 +23,7 @@ func (_m *TokenPoolBatchedReader) EXPECT() *TokenPoolBatchedReader_Expecter { return &TokenPoolBatchedReader_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *TokenPoolBatchedReader) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go index 9a9cdb48cad..7655116ede4 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go index a9de0fa0d88..eb8d8179c52 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -87,7 +87,7 @@ func (_c *CommitStoreReader_ChangeConfig_Call) RunAndReturn(run func(context.Con return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *CommitStoreReader) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go index e9766b48ddf..255102feed2 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -144,7 +144,7 @@ func (_c *OffRampReader_ChangeConfig_Call) RunAndReturn(run func(context.Context return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *OffRampReader) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go index 3b029054d17..1cd3d5ee49b 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -79,7 +79,7 @@ func (_c *OnRampReader_Address_Call) RunAndReturn(run func(context.Context) (cci return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *OnRampReader) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go index c312dda2a2f..49812d2a87c 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -81,7 +81,7 @@ func (_c *PriceRegistryReader_Address_Call) RunAndReturn(run func(context.Contex return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *PriceRegistryReader) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go index be50e765c91..6ae5a2478bb 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -20,7 +20,7 @@ func (_m *TokenPoolReader) EXPECT() *TokenPoolReader_Expecter { return &TokenPoolReader_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *TokenPoolReader) Address() common.Address { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *TokenPoolReader_Address_Call) RunAndReturn(run func() common.Address) return _c } -// Type provides a mock function with given fields: +// Type provides a mock function with no fields func (_m *TokenPoolReader) Type() string { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go index 03085bd8973..67823035e5e 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go index 76690f79bf8..8914ca0b987 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -28,7 +28,7 @@ func (_m *PriceService) EXPECT() *PriceService_Expecter { return &PriceService_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *PriceService) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go index 8281137e524..d05b14b67d2 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package pricegetter @@ -24,7 +24,7 @@ func (_m *MockAllTokensPriceGetter) EXPECT() *MockAllTokensPriceGetter_Expecter return &MockAllTokensPriceGetter_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *MockAllTokensPriceGetter) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go index 6b520864a9f..abebd51494c 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package pricegetter @@ -24,7 +24,7 @@ func (_m *MockPriceGetter) EXPECT() *MockPriceGetter_Expecter { return &MockPriceGetter_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *MockPriceGetter) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go b/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go index 3fc2f46cb3e..4d1d3b92735 100644 --- a/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package rpclibmocks diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go index 099c50ea2c0..4632ee0ca24 100644 --- a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package prices diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go index 02f69b01e08..d45cbb202c3 100644 --- a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package prices diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go index 7323f88e3ab..7376f16c0c0 100644 --- a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package prices diff --git a/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go b/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go index 93163fdcfb4..c553eed3586 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go +++ b/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package tokendata @@ -23,7 +23,7 @@ func (_m *MockReader) EXPECT() *MockReader_Expecter { return &MockReader_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *MockReader) Close() error { ret := _m.Called() diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go index ab4a8d5280d..b4d2eea2508 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go index 969c85efac3..24b5d92ace4 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go index e0ad6ae9467..896e1daec97 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go index bb431966763..e386b7e0fab 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -6,7 +6,6 @@ import ( big "math/big" bind "github.com/ethereum/go-ethereum/accounts/abi/bind" - encoding "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" @@ -206,22 +205,22 @@ func (_c *Registry_GetState_Call) RunAndReturn(run func(*bind.CallOpts) (i_autom } // GetUpkeep provides a mock function with given fields: opts, id -func (_m *Registry) GetUpkeep(opts *bind.CallOpts, id *big.Int) (encoding.UpkeepInfo, error) { +func (_m *Registry) GetUpkeep(opts *bind.CallOpts, id *big.Int) (i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, error) { ret := _m.Called(opts, id) if len(ret) == 0 { panic("no return value specified for GetUpkeep") } - var r0 encoding.UpkeepInfo + var r0 i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy var r1 error - if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) (encoding.UpkeepInfo, error)); ok { + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) (i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, error)); ok { return rf(opts, id) } - if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) encoding.UpkeepInfo); ok { + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy); ok { r0 = rf(opts, id) } else { - r0 = ret.Get(0).(encoding.UpkeepInfo) + r0 = ret.Get(0).(i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy) } if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int) error); ok { @@ -252,12 +251,12 @@ func (_c *Registry_GetUpkeep_Call) Run(run func(opts *bind.CallOpts, id *big.Int return _c } -func (_c *Registry_GetUpkeep_Call) Return(_a0 encoding.UpkeepInfo, _a1 error) *Registry_GetUpkeep_Call { +func (_c *Registry_GetUpkeep_Call) Return(_a0 i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, _a1 error) *Registry_GetUpkeep_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Registry_GetUpkeep_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (encoding.UpkeepInfo, error)) *Registry_GetUpkeep_Call { +func (_c *Registry_GetUpkeep_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, error)) *Registry_GetUpkeep_Call { _c.Call.Return(run) return _c } diff --git a/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go b/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go index 2d38cc77387..1e85e0d2735 100644 --- a/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go +++ b/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -47,7 +47,7 @@ func (_c *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLate } func (_c *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -81,7 +81,7 @@ func (_c *PrometheusBackend_SetCloseDuration_Call) Return() *PrometheusBackend_S } func (_c *PrometheusBackend_SetCloseDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetCloseDuration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -115,7 +115,7 @@ func (_c *PrometheusBackend_SetObservationDuration_Call) Return() *PrometheusBac } func (_c *PrometheusBackend_SetObservationDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetObservationDuration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -149,7 +149,7 @@ func (_c *PrometheusBackend_SetObservationToReportLatency_Call) Return() *Promet } func (_c *PrometheusBackend_SetObservationToReportLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetObservationToReportLatency_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -183,7 +183,7 @@ func (_c *PrometheusBackend_SetQueryDuration_Call) Return() *PrometheusBackend_S } func (_c *PrometheusBackend_SetQueryDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetQueryDuration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -217,7 +217,7 @@ func (_c *PrometheusBackend_SetQueryToObservationLatency_Call) Return() *Prometh } func (_c *PrometheusBackend_SetQueryToObservationLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetQueryToObservationLatency_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -251,7 +251,7 @@ func (_c *PrometheusBackend_SetReportDuration_Call) Return() *PrometheusBackend_ } func (_c *PrometheusBackend_SetReportDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetReportDuration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -285,7 +285,7 @@ func (_c *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call) Return } func (_c *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -319,7 +319,7 @@ func (_c *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call) Return( } func (_c *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } @@ -353,7 +353,7 @@ func (_c *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call) Return } func (_c *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/ocr2/plugins/threshold/mocks/decryptor.go b/core/services/ocr2/plugins/threshold/mocks/decryptor.go index edf19e8a284..6b001b73bcc 100644 --- a/core/services/ocr2/plugins/threshold/mocks/decryptor.go +++ b/core/services/ocr2/plugins/threshold/mocks/decryptor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/p2p/types/mocks/peer.go b/core/services/p2p/types/mocks/peer.go index a50bad780b8..e24c662ffaf 100644 --- a/core/services/p2p/types/mocks/peer.go +++ b/core/services/p2p/types/mocks/peer.go @@ -1,12 +1,14 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks import ( context "context" - types "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) // Peer is an autogenerated mock type for the Peer type @@ -22,7 +24,7 @@ func (_m *Peer) EXPECT() *Peer_Expecter { return &Peer_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Peer) Close() error { ret := _m.Called() @@ -67,7 +69,7 @@ func (_c *Peer_Close_Call) RunAndReturn(run func() error) *Peer_Close_Call { return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *Peer) HealthReport() map[string]error { ret := _m.Called() @@ -114,20 +116,20 @@ func (_c *Peer_HealthReport_Call) RunAndReturn(run func() map[string]error) *Pee return _c } -// ID provides a mock function with given fields: -func (_m *Peer) ID() types.PeerID { +// ID provides a mock function with no fields +func (_m *Peer) ID() ragep2ptypes.PeerID { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ID") } - var r0 types.PeerID - if rf, ok := ret.Get(0).(func() types.PeerID); ok { + var r0 ragep2ptypes.PeerID + if rf, ok := ret.Get(0).(func() ragep2ptypes.PeerID); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(types.PeerID) + r0 = ret.Get(0).(ragep2ptypes.PeerID) } } @@ -151,17 +153,17 @@ func (_c *Peer_ID_Call) Run(run func()) *Peer_ID_Call { return _c } -func (_c *Peer_ID_Call) Return(_a0 types.PeerID) *Peer_ID_Call { +func (_c *Peer_ID_Call) Return(_a0 ragep2ptypes.PeerID) *Peer_ID_Call { _c.Call.Return(_a0) return _c } -func (_c *Peer_ID_Call) RunAndReturn(run func() types.PeerID) *Peer_ID_Call { +func (_c *Peer_ID_Call) RunAndReturn(run func() ragep2ptypes.PeerID) *Peer_ID_Call { _c.Call.Return(run) return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *Peer) Name() string { ret := _m.Called() @@ -206,7 +208,7 @@ func (_c *Peer_Name_Call) RunAndReturn(run func() string) *Peer_Name_Call { return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *Peer) Ready() error { ret := _m.Called() @@ -251,7 +253,7 @@ func (_c *Peer_Ready_Call) RunAndReturn(run func() error) *Peer_Ready_Call { return _c } -// Receive provides a mock function with given fields: +// Receive provides a mock function with no fields func (_m *Peer) Receive() <-chan types.Message { ret := _m.Called() @@ -299,7 +301,7 @@ func (_c *Peer_Receive_Call) RunAndReturn(run func() <-chan types.Message) *Peer } // Send provides a mock function with given fields: peerID, msg -func (_m *Peer) Send(peerID types.PeerID, msg []byte) error { +func (_m *Peer) Send(peerID ragep2ptypes.PeerID, msg []byte) error { ret := _m.Called(peerID, msg) if len(ret) == 0 { @@ -307,7 +309,7 @@ func (_m *Peer) Send(peerID types.PeerID, msg []byte) error { } var r0 error - if rf, ok := ret.Get(0).(func(types.PeerID, []byte) error); ok { + if rf, ok := ret.Get(0).(func(ragep2ptypes.PeerID, []byte) error); ok { r0 = rf(peerID, msg) } else { r0 = ret.Error(0) @@ -322,15 +324,15 @@ type Peer_Send_Call struct { } // Send is a helper method to define mock.On call -// - peerID types.PeerID +// - peerID ragep2ptypes.PeerID // - msg []byte func (_e *Peer_Expecter) Send(peerID interface{}, msg interface{}) *Peer_Send_Call { return &Peer_Send_Call{Call: _e.mock.On("Send", peerID, msg)} } -func (_c *Peer_Send_Call) Run(run func(peerID types.PeerID, msg []byte)) *Peer_Send_Call { +func (_c *Peer_Send_Call) Run(run func(peerID ragep2ptypes.PeerID, msg []byte)) *Peer_Send_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(types.PeerID), args[1].([]byte)) + run(args[0].(ragep2ptypes.PeerID), args[1].([]byte)) }) return _c } @@ -340,7 +342,7 @@ func (_c *Peer_Send_Call) Return(_a0 error) *Peer_Send_Call { return _c } -func (_c *Peer_Send_Call) RunAndReturn(run func(types.PeerID, []byte) error) *Peer_Send_Call { +func (_c *Peer_Send_Call) RunAndReturn(run func(ragep2ptypes.PeerID, []byte) error) *Peer_Send_Call { _c.Call.Return(run) return _c } @@ -392,7 +394,7 @@ func (_c *Peer_Start_Call) RunAndReturn(run func(context.Context) error) *Peer_S } // UpdateConnections provides a mock function with given fields: peers -func (_m *Peer) UpdateConnections(peers map[types.PeerID]types.StreamConfig) error { +func (_m *Peer) UpdateConnections(peers map[ragep2ptypes.PeerID]types.StreamConfig) error { ret := _m.Called(peers) if len(ret) == 0 { @@ -400,7 +402,7 @@ func (_m *Peer) UpdateConnections(peers map[types.PeerID]types.StreamConfig) err } var r0 error - if rf, ok := ret.Get(0).(func(map[types.PeerID]types.StreamConfig) error); ok { + if rf, ok := ret.Get(0).(func(map[ragep2ptypes.PeerID]types.StreamConfig) error); ok { r0 = rf(peers) } else { r0 = ret.Error(0) @@ -415,14 +417,14 @@ type Peer_UpdateConnections_Call struct { } // UpdateConnections is a helper method to define mock.On call -// - peers map[types.PeerID]types.StreamConfig +// - peers map[ragep2ptypes.PeerID]types.StreamConfig func (_e *Peer_Expecter) UpdateConnections(peers interface{}) *Peer_UpdateConnections_Call { return &Peer_UpdateConnections_Call{Call: _e.mock.On("UpdateConnections", peers)} } -func (_c *Peer_UpdateConnections_Call) Run(run func(peers map[types.PeerID]types.StreamConfig)) *Peer_UpdateConnections_Call { +func (_c *Peer_UpdateConnections_Call) Run(run func(peers map[ragep2ptypes.PeerID]types.StreamConfig)) *Peer_UpdateConnections_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(map[types.PeerID]types.StreamConfig)) + run(args[0].(map[ragep2ptypes.PeerID]types.StreamConfig)) }) return _c } @@ -432,7 +434,7 @@ func (_c *Peer_UpdateConnections_Call) Return(_a0 error) *Peer_UpdateConnections return _c } -func (_c *Peer_UpdateConnections_Call) RunAndReturn(run func(map[types.PeerID]types.StreamConfig) error) *Peer_UpdateConnections_Call { +func (_c *Peer_UpdateConnections_Call) RunAndReturn(run func(map[ragep2ptypes.PeerID]types.StreamConfig) error) *Peer_UpdateConnections_Call { _c.Call.Return(run) return _c } diff --git a/core/services/p2p/types/mocks/peer_wrapper.go b/core/services/p2p/types/mocks/peer_wrapper.go index 7d1744cb0c5..98ebff5f618 100644 --- a/core/services/p2p/types/mocks/peer_wrapper.go +++ b/core/services/p2p/types/mocks/peer_wrapper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *PeerWrapper) EXPECT() *PeerWrapper_Expecter { return &PeerWrapper_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *PeerWrapper) Close() error { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *PeerWrapper_Close_Call) RunAndReturn(run func() error) *PeerWrapper_Cl return _c } -// GetPeer provides a mock function with given fields: +// GetPeer provides a mock function with no fields func (_m *PeerWrapper) GetPeer() types.Peer { ret := _m.Called() @@ -114,7 +114,7 @@ func (_c *PeerWrapper_GetPeer_Call) RunAndReturn(run func() types.Peer) *PeerWra return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *PeerWrapper) HealthReport() map[string]error { ret := _m.Called() @@ -161,7 +161,7 @@ func (_c *PeerWrapper_HealthReport_Call) RunAndReturn(run func() map[string]erro return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *PeerWrapper) Name() string { ret := _m.Called() @@ -206,7 +206,7 @@ func (_c *PeerWrapper_Name_Call) RunAndReturn(run func() string) *PeerWrapper_Na return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *PeerWrapper) Ready() error { ret := _m.Called() diff --git a/core/services/p2p/types/mocks/signer.go b/core/services/p2p/types/mocks/signer.go index 57afac0cecc..d027fca471a 100644 --- a/core/services/p2p/types/mocks/signer.go +++ b/core/services/p2p/types/mocks/signer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/pipeline/mocks/config.go b/core/services/pipeline/mocks/config.go index 87bf48047bf..f5c6a11b1d7 100644 --- a/core/services/pipeline/mocks/config.go +++ b/core/services/pipeline/mocks/config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *Config) EXPECT() *Config_Expecter { return &Config_Expecter{mock: &_m.Mock} } -// DefaultHTTPLimit provides a mock function with given fields: +// DefaultHTTPLimit provides a mock function with no fields func (_m *Config) DefaultHTTPLimit() int64 { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *Config_DefaultHTTPLimit_Call) RunAndReturn(run func() int64) *Config_D return _c } -// DefaultHTTPTimeout provides a mock function with given fields: +// DefaultHTTPTimeout provides a mock function with no fields func (_m *Config) DefaultHTTPTimeout() config.Duration { ret := _m.Called() @@ -112,7 +112,7 @@ func (_c *Config_DefaultHTTPTimeout_Call) RunAndReturn(run func() config.Duratio return _c } -// MaxRunDuration provides a mock function with given fields: +// MaxRunDuration provides a mock function with no fields func (_m *Config) MaxRunDuration() time.Duration { ret := _m.Called() @@ -157,7 +157,7 @@ func (_c *Config_MaxRunDuration_Call) RunAndReturn(run func() time.Duration) *Co return _c } -// ReaperInterval provides a mock function with given fields: +// ReaperInterval provides a mock function with no fields func (_m *Config) ReaperInterval() time.Duration { ret := _m.Called() @@ -202,7 +202,7 @@ func (_c *Config_ReaperInterval_Call) RunAndReturn(run func() time.Duration) *Co return _c } -// ReaperThreshold provides a mock function with given fields: +// ReaperThreshold provides a mock function with no fields func (_m *Config) ReaperThreshold() time.Duration { ret := _m.Called() @@ -247,7 +247,7 @@ func (_c *Config_ReaperThreshold_Call) RunAndReturn(run func() time.Duration) *C return _c } -// VerboseLogging provides a mock function with given fields: +// VerboseLogging provides a mock function with no fields func (_m *Config) VerboseLogging() bool { ret := _m.Called() diff --git a/core/services/pipeline/mocks/orm.go b/core/services/pipeline/mocks/orm.go index d79825fcf10..7c13aac4c9e 100644 --- a/core/services/pipeline/mocks/orm.go +++ b/core/services/pipeline/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -30,7 +30,7 @@ func (_m *ORM) EXPECT() *ORM_Expecter { return &ORM_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *ORM) Close() error { ret := _m.Called() @@ -180,7 +180,7 @@ func (_c *ORM_CreateSpec_Call) RunAndReturn(run func(context.Context, pipeline.P return _c } -// DataSource provides a mock function with given fields: +// DataSource provides a mock function with no fields func (_m *ORM) DataSource() sqlutil.DataSource { ret := _m.Called() @@ -484,7 +484,7 @@ func (_c *ORM_GetUnfinishedRuns_Call) RunAndReturn(run func(context.Context, tim return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *ORM) HealthReport() map[string]error { ret := _m.Called() @@ -722,7 +722,7 @@ func (_c *ORM_InsertRun_Call) RunAndReturn(run func(context.Context, *pipeline.R return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *ORM) Name() string { ret := _m.Called() @@ -767,7 +767,7 @@ func (_c *ORM_Name_Call) RunAndReturn(run func() string) *ORM_Name_Call { return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *ORM) Ready() error { ret := _m.Called() diff --git a/core/services/pipeline/mocks/pipeline_param_unmarshaler.go b/core/services/pipeline/mocks/pipeline_param_unmarshaler.go index 3ca0dd54666..cb997d57081 100644 --- a/core/services/pipeline/mocks/pipeline_param_unmarshaler.go +++ b/core/services/pipeline/mocks/pipeline_param_unmarshaler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/pipeline/mocks/runner.go b/core/services/pipeline/mocks/runner.go index 7a59569989a..9779d47d70d 100644 --- a/core/services/pipeline/mocks/runner.go +++ b/core/services/pipeline/mocks/runner.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -26,7 +26,7 @@ func (_m *Runner) EXPECT() *Runner_Expecter { return &Runner_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *Runner) Close() error { ret := _m.Called() @@ -208,7 +208,7 @@ func (_c *Runner_ExecuteRun_Call) RunAndReturn(run func(context.Context, pipelin return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *Runner) HealthReport() map[string]error { ret := _m.Called() @@ -411,7 +411,7 @@ func (_c *Runner_InsertFinishedRuns_Call) RunAndReturn(run func(context.Context, return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *Runner) Name() string { ret := _m.Called() @@ -485,11 +485,11 @@ func (_c *Runner_OnRunFinished_Call) Return() *Runner_OnRunFinished_Call { } func (_c *Runner_OnRunFinished_Call) RunAndReturn(run func(func(*pipeline.Run))) *Runner_OnRunFinished_Call { - _c.Call.Return(run) + _c.Run(run) return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *Runner) Ready() error { ret := _m.Called() diff --git a/core/services/registrysyncer/mocks/orm.go b/core/services/registrysyncer/mocks/orm.go index 7fb44286a16..419fe9ae564 100644 --- a/core/services/registrysyncer/mocks/orm.go +++ b/core/services/registrysyncer/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/relay/evm/mercury/mocks/async_deleter.go b/core/services/relay/evm/mercury/mocks/async_deleter.go index f94414af4a3..ce9dee690e5 100644 --- a/core/services/relay/evm/mercury/mocks/async_deleter.go +++ b/core/services/relay/evm/mercury/mocks/async_deleter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -49,7 +49,7 @@ func (_c *AsyncDeleter_AsyncDelete_Call) Return() *AsyncDeleter_AsyncDelete_Call } func (_c *AsyncDeleter_AsyncDelete_Call) RunAndReturn(run func(*pb.TransmitRequest)) *AsyncDeleter_AsyncDelete_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/relay/evm/mocks/codec.go b/core/services/relay/evm/mocks/codec.go index acc9e3a7e3a..f4a1e097e5a 100644 --- a/core/services/relay/evm/mocks/codec.go +++ b/core/services/relay/evm/mocks/codec.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *Codec) EXPECT() *Codec_Expecter { } // Decode provides a mock function with given fields: ctx, raw, into, itemType -func (_m *Codec) Decode(ctx context.Context, raw []byte, into any, itemType string) error { +func (_m *Codec) Decode(ctx context.Context, raw []byte, into interface{}, itemType string) error { ret := _m.Called(ctx, raw, into, itemType) if len(ret) == 0 { @@ -30,7 +30,7 @@ func (_m *Codec) Decode(ctx context.Context, raw []byte, into any, itemType stri } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []byte, any, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte, interface{}, string) error); ok { r0 = rf(ctx, raw, into, itemType) } else { r0 = ret.Error(0) @@ -47,15 +47,15 @@ type Codec_Decode_Call struct { // Decode is a helper method to define mock.On call // - ctx context.Context // - raw []byte -// - into any +// - into interface{} // - itemType string func (_e *Codec_Expecter) Decode(ctx interface{}, raw interface{}, into interface{}, itemType interface{}) *Codec_Decode_Call { return &Codec_Decode_Call{Call: _e.mock.On("Decode", ctx, raw, into, itemType)} } -func (_c *Codec_Decode_Call) Run(run func(ctx context.Context, raw []byte, into any, itemType string)) *Codec_Decode_Call { +func (_c *Codec_Decode_Call) Run(run func(ctx context.Context, raw []byte, into interface{}, itemType string)) *Codec_Decode_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]byte), args[2].(any), args[3].(string)) + run(args[0].(context.Context), args[1].([]byte), args[2].(interface{}), args[3].(string)) }) return _c } @@ -65,13 +65,13 @@ func (_c *Codec_Decode_Call) Return(_a0 error) *Codec_Decode_Call { return _c } -func (_c *Codec_Decode_Call) RunAndReturn(run func(context.Context, []byte, any, string) error) *Codec_Decode_Call { +func (_c *Codec_Decode_Call) RunAndReturn(run func(context.Context, []byte, interface{}, string) error) *Codec_Decode_Call { _c.Call.Return(run) return _c } // Encode provides a mock function with given fields: ctx, item, itemType -func (_m *Codec) Encode(ctx context.Context, item any, itemType string) ([]byte, error) { +func (_m *Codec) Encode(ctx context.Context, item interface{}, itemType string) ([]byte, error) { ret := _m.Called(ctx, item, itemType) if len(ret) == 0 { @@ -80,10 +80,10 @@ func (_m *Codec) Encode(ctx context.Context, item any, itemType string) ([]byte, var r0 []byte var r1 error - if rf, ok := ret.Get(0).(func(context.Context, any, string) ([]byte, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, interface{}, string) ([]byte, error)); ok { return rf(ctx, item, itemType) } - if rf, ok := ret.Get(0).(func(context.Context, any, string) []byte); ok { + if rf, ok := ret.Get(0).(func(context.Context, interface{}, string) []byte); ok { r0 = rf(ctx, item, itemType) } else { if ret.Get(0) != nil { @@ -91,7 +91,7 @@ func (_m *Codec) Encode(ctx context.Context, item any, itemType string) ([]byte, } } - if rf, ok := ret.Get(1).(func(context.Context, any, string) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, interface{}, string) error); ok { r1 = rf(ctx, item, itemType) } else { r1 = ret.Error(1) @@ -107,15 +107,15 @@ type Codec_Encode_Call struct { // Encode is a helper method to define mock.On call // - ctx context.Context -// - item any +// - item interface{} // - itemType string func (_e *Codec_Expecter) Encode(ctx interface{}, item interface{}, itemType interface{}) *Codec_Encode_Call { return &Codec_Encode_Call{Call: _e.mock.On("Encode", ctx, item, itemType)} } -func (_c *Codec_Encode_Call) Run(run func(ctx context.Context, item any, itemType string)) *Codec_Encode_Call { +func (_c *Codec_Encode_Call) Run(run func(ctx context.Context, item interface{}, itemType string)) *Codec_Encode_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(any), args[2].(string)) + run(args[0].(context.Context), args[1].(interface{}), args[2].(string)) }) return _c } @@ -125,7 +125,7 @@ func (_c *Codec_Encode_Call) Return(_a0 []byte, _a1 error) *Codec_Encode_Call { return _c } -func (_c *Codec_Encode_Call) RunAndReturn(run func(context.Context, any, string) ([]byte, error)) *Codec_Encode_Call { +func (_c *Codec_Encode_Call) RunAndReturn(run func(context.Context, interface{}, string) ([]byte, error)) *Codec_Encode_Call { _c.Call.Return(run) return _c } diff --git a/core/services/relay/evm/mocks/request_round_db.go b/core/services/relay/evm/mocks/request_round_db.go index c3c58b0b125..97a499f5d8e 100644 --- a/core/services/relay/evm/mocks/request_round_db.go +++ b/core/services/relay/evm/mocks/request_round_db.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/relay/evm/read/mocks/batch_caller.go b/core/services/relay/evm/read/mocks/batch_caller.go index 3ae9ec97b2a..4ac1d28b3e0 100644 --- a/core/services/relay/evm/read/mocks/batch_caller.go +++ b/core/services/relay/evm/read/mocks/batch_caller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/relay/evm/read/mocks/reader.go b/core/services/relay/evm/read/mocks/reader.go index 79df3cf4025..94fbeecd0f9 100644 --- a/core/services/relay/evm/read/mocks/reader.go +++ b/core/services/relay/evm/read/mocks/reader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -32,7 +32,7 @@ func (_m *Reader) EXPECT() *Reader_Expecter { } // BatchCall provides a mock function with given fields: address, params, retVal -func (_m *Reader) BatchCall(address common.Address, params any, retVal any) (read.Call, error) { +func (_m *Reader) BatchCall(address common.Address, params interface{}, retVal interface{}) (read.Call, error) { ret := _m.Called(address, params, retVal) if len(ret) == 0 { @@ -41,16 +41,16 @@ func (_m *Reader) BatchCall(address common.Address, params any, retVal any) (rea var r0 read.Call var r1 error - if rf, ok := ret.Get(0).(func(common.Address, any, any) (read.Call, error)); ok { + if rf, ok := ret.Get(0).(func(common.Address, interface{}, interface{}) (read.Call, error)); ok { return rf(address, params, retVal) } - if rf, ok := ret.Get(0).(func(common.Address, any, any) read.Call); ok { + if rf, ok := ret.Get(0).(func(common.Address, interface{}, interface{}) read.Call); ok { r0 = rf(address, params, retVal) } else { r0 = ret.Get(0).(read.Call) } - if rf, ok := ret.Get(1).(func(common.Address, any, any) error); ok { + if rf, ok := ret.Get(1).(func(common.Address, interface{}, interface{}) error); ok { r1 = rf(address, params, retVal) } else { r1 = ret.Error(1) @@ -66,15 +66,15 @@ type Reader_BatchCall_Call struct { // BatchCall is a helper method to define mock.On call // - address common.Address -// - params any -// - retVal any +// - params interface{} +// - retVal interface{} func (_e *Reader_Expecter) BatchCall(address interface{}, params interface{}, retVal interface{}) *Reader_BatchCall_Call { return &Reader_BatchCall_Call{Call: _e.mock.On("BatchCall", address, params, retVal)} } -func (_c *Reader_BatchCall_Call) Run(run func(address common.Address, params any, retVal any)) *Reader_BatchCall_Call { +func (_c *Reader_BatchCall_Call) Run(run func(address common.Address, params interface{}, retVal interface{})) *Reader_BatchCall_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Address), args[1].(any), args[2].(any)) + run(args[0].(common.Address), args[1].(interface{}), args[2].(interface{})) }) return _c } @@ -84,7 +84,7 @@ func (_c *Reader_BatchCall_Call) Return(_a0 read.Call, _a1 error) *Reader_BatchC return _c } -func (_c *Reader_BatchCall_Call) RunAndReturn(run func(common.Address, any, any) (read.Call, error)) *Reader_BatchCall_Call { +func (_c *Reader_BatchCall_Call) RunAndReturn(run func(common.Address, interface{}, interface{}) (read.Call, error)) *Reader_BatchCall_Call { _c.Call.Return(run) return _c } @@ -151,7 +151,7 @@ func (_c *Reader_Bind_Call) RunAndReturn(run func(context.Context, ...common.Add } // GetLatestValueWithHeadData provides a mock function with given fields: ctx, addr, confidence, params, returnVal -func (_m *Reader) GetLatestValueWithHeadData(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params any, returnVal any) (*types.Head, error) { +func (_m *Reader) GetLatestValueWithHeadData(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params interface{}, returnVal interface{}) (*types.Head, error) { ret := _m.Called(ctx, addr, confidence, params, returnVal) if len(ret) == 0 { @@ -160,10 +160,10 @@ func (_m *Reader) GetLatestValueWithHeadData(ctx context.Context, addr common.Ad var r0 *types.Head var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address, primitives.ConfidenceLevel, any, any) (*types.Head, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Address, primitives.ConfidenceLevel, interface{}, interface{}) (*types.Head, error)); ok { return rf(ctx, addr, confidence, params, returnVal) } - if rf, ok := ret.Get(0).(func(context.Context, common.Address, primitives.ConfidenceLevel, any, any) *types.Head); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Address, primitives.ConfidenceLevel, interface{}, interface{}) *types.Head); ok { r0 = rf(ctx, addr, confidence, params, returnVal) } else { if ret.Get(0) != nil { @@ -171,7 +171,7 @@ func (_m *Reader) GetLatestValueWithHeadData(ctx context.Context, addr common.Ad } } - if rf, ok := ret.Get(1).(func(context.Context, common.Address, primitives.ConfidenceLevel, any, any) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, common.Address, primitives.ConfidenceLevel, interface{}, interface{}) error); ok { r1 = rf(ctx, addr, confidence, params, returnVal) } else { r1 = ret.Error(1) @@ -189,15 +189,15 @@ type Reader_GetLatestValueWithHeadData_Call struct { // - ctx context.Context // - addr common.Address // - confidence primitives.ConfidenceLevel -// - params any -// - returnVal any +// - params interface{} +// - returnVal interface{} func (_e *Reader_Expecter) GetLatestValueWithHeadData(ctx interface{}, addr interface{}, confidence interface{}, params interface{}, returnVal interface{}) *Reader_GetLatestValueWithHeadData_Call { return &Reader_GetLatestValueWithHeadData_Call{Call: _e.mock.On("GetLatestValueWithHeadData", ctx, addr, confidence, params, returnVal)} } -func (_c *Reader_GetLatestValueWithHeadData_Call) Run(run func(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params any, returnVal any)) *Reader_GetLatestValueWithHeadData_Call { +func (_c *Reader_GetLatestValueWithHeadData_Call) Run(run func(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params interface{}, returnVal interface{})) *Reader_GetLatestValueWithHeadData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(common.Address), args[2].(primitives.ConfidenceLevel), args[3].(any), args[4].(any)) + run(args[0].(context.Context), args[1].(common.Address), args[2].(primitives.ConfidenceLevel), args[3].(interface{}), args[4].(interface{})) }) return _c } @@ -207,13 +207,13 @@ func (_c *Reader_GetLatestValueWithHeadData_Call) Return(_a0 *types.Head, _a1 er return _c } -func (_c *Reader_GetLatestValueWithHeadData_Call) RunAndReturn(run func(context.Context, common.Address, primitives.ConfidenceLevel, any, any) (*types.Head, error)) *Reader_GetLatestValueWithHeadData_Call { +func (_c *Reader_GetLatestValueWithHeadData_Call) RunAndReturn(run func(context.Context, common.Address, primitives.ConfidenceLevel, interface{}, interface{}) (*types.Head, error)) *Reader_GetLatestValueWithHeadData_Call { _c.Call.Return(run) return _c } // QueryKey provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 -func (_m *Reader) QueryKey(_a0 context.Context, _a1 common.Address, _a2 query.KeyFilter, _a3 query.LimitAndSort, _a4 any) ([]types.Sequence, error) { +func (_m *Reader) QueryKey(_a0 context.Context, _a1 common.Address, _a2 query.KeyFilter, _a3 query.LimitAndSort, _a4 interface{}) ([]types.Sequence, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) if len(ret) == 0 { @@ -222,10 +222,10 @@ func (_m *Reader) QueryKey(_a0 context.Context, _a1 common.Address, _a2 query.Ke var r0 []types.Sequence var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, any) ([]types.Sequence, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) ([]types.Sequence, error)); ok { return rf(_a0, _a1, _a2, _a3, _a4) } - if rf, ok := ret.Get(0).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, any) []types.Sequence); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) []types.Sequence); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) } else { if ret.Get(0) != nil { @@ -233,7 +233,7 @@ func (_m *Reader) QueryKey(_a0 context.Context, _a1 common.Address, _a2 query.Ke } } - if rf, ok := ret.Get(1).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, any) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) error); ok { r1 = rf(_a0, _a1, _a2, _a3, _a4) } else { r1 = ret.Error(1) @@ -252,14 +252,14 @@ type Reader_QueryKey_Call struct { // - _a1 common.Address // - _a2 query.KeyFilter // - _a3 query.LimitAndSort -// - _a4 any +// - _a4 interface{} func (_e *Reader_Expecter) QueryKey(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *Reader_QueryKey_Call { return &Reader_QueryKey_Call{Call: _e.mock.On("QueryKey", _a0, _a1, _a2, _a3, _a4)} } -func (_c *Reader_QueryKey_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 query.KeyFilter, _a3 query.LimitAndSort, _a4 any)) *Reader_QueryKey_Call { +func (_c *Reader_QueryKey_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 query.KeyFilter, _a3 query.LimitAndSort, _a4 interface{})) *Reader_QueryKey_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(common.Address), args[2].(query.KeyFilter), args[3].(query.LimitAndSort), args[4].(any)) + run(args[0].(context.Context), args[1].(common.Address), args[2].(query.KeyFilter), args[3].(query.LimitAndSort), args[4].(interface{})) }) return _c } @@ -269,7 +269,7 @@ func (_c *Reader_QueryKey_Call) Return(_a0 []types.Sequence, _a1 error) *Reader_ return _c } -func (_c *Reader_QueryKey_Call) RunAndReturn(run func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, any) ([]types.Sequence, error)) *Reader_QueryKey_Call { +func (_c *Reader_QueryKey_Call) RunAndReturn(run func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) ([]types.Sequence, error)) *Reader_QueryKey_Call { _c.Call.Return(run) return _c } @@ -349,7 +349,7 @@ func (_c *Reader_SetCodec_Call) Return() *Reader_SetCodec_Call { } func (_c *Reader_SetCodec_Call) RunAndReturn(run func(types.RemoteCodec)) *Reader_SetCodec_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/relay/evm/read/mocks/registrar.go b/core/services/relay/evm/read/mocks/registrar.go index 433a8771396..472e68622be 100644 --- a/core/services/relay/evm/read/mocks/registrar.go +++ b/core/services/relay/evm/read/mocks/registrar.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go b/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go index 4bbda1d75bc..82841882328 100644 --- a/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go +++ b/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/relay/evm/types/mocks/log_poller_wrapper.go b/core/services/relay/evm/types/mocks/log_poller_wrapper.go index ee4946b0e4d..de9f9deca6c 100644 --- a/core/services/relay/evm/types/mocks/log_poller_wrapper.go +++ b/core/services/relay/evm/types/mocks/log_poller_wrapper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *LogPollerWrapper) EXPECT() *LogPollerWrapper_Expecter { return &LogPollerWrapper_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *LogPollerWrapper) Close() error { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *LogPollerWrapper_Close_Call) RunAndReturn(run func() error) *LogPoller return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *LogPollerWrapper) HealthReport() map[string]error { ret := _m.Called() @@ -181,7 +181,7 @@ func (_c *LogPollerWrapper_LatestEvents_Call) RunAndReturn(run func(context.Cont return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *LogPollerWrapper) Name() string { ret := _m.Called() @@ -226,7 +226,7 @@ func (_c *LogPollerWrapper_Name_Call) RunAndReturn(run func() string) *LogPoller return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *LogPollerWrapper) Ready() error { ret := _m.Called() @@ -348,7 +348,7 @@ func (_c *LogPollerWrapper_SubscribeToUpdates_Call) Return() *LogPollerWrapper_S } func (_c *LogPollerWrapper_SubscribeToUpdates_Call) RunAndReturn(run func(context.Context, string, types.RouteUpdateSubscriber)) *LogPollerWrapper_SubscribeToUpdates_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/s4/mocks/orm.go b/core/services/s4/mocks/orm.go index 36593dbe85c..a4ac8f7af37 100644 --- a/core/services/s4/mocks/orm.go +++ b/core/services/s4/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/s4/mocks/storage.go b/core/services/s4/mocks/storage.go index e6fdb3b41b9..00ec97962a9 100644 --- a/core/services/s4/mocks/storage.go +++ b/core/services/s4/mocks/storage.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -25,7 +25,7 @@ func (_m *Storage) EXPECT() *Storage_Expecter { return &Storage_Expecter{mock: &_m.Mock} } -// Constraints provides a mock function with given fields: +// Constraints provides a mock function with no fields func (_m *Storage) Constraints() s4.Constraints { ret := _m.Called() diff --git a/core/services/synchronization/mocks/telem_client.go b/core/services/synchronization/mocks/telem_client.go index 5e4066d07b0..bc90bf2ffd6 100644 --- a/core/services/synchronization/mocks/telem_client.go +++ b/core/services/synchronization/mocks/telem_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/synchronization/mocks/telemetry_service.go b/core/services/synchronization/mocks/telemetry_service.go index c6450abd7ea..cd3d64de352 100644 --- a/core/services/synchronization/mocks/telemetry_service.go +++ b/core/services/synchronization/mocks/telemetry_service.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -22,7 +22,7 @@ func (_m *TelemetryService) EXPECT() *TelemetryService_Expecter { return &TelemetryService_Expecter{mock: &_m.Mock} } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *TelemetryService) Close() error { ret := _m.Called() @@ -67,7 +67,7 @@ func (_c *TelemetryService_Close_Call) RunAndReturn(run func() error) *Telemetry return _c } -// HealthReport provides a mock function with given fields: +// HealthReport provides a mock function with no fields func (_m *TelemetryService) HealthReport() map[string]error { ret := _m.Called() @@ -114,7 +114,7 @@ func (_c *TelemetryService_HealthReport_Call) RunAndReturn(run func() map[string return _c } -// Name provides a mock function with given fields: +// Name provides a mock function with no fields func (_m *TelemetryService) Name() string { ret := _m.Called() @@ -159,7 +159,7 @@ func (_c *TelemetryService_Name_Call) RunAndReturn(run func() string) *Telemetry return _c } -// Ready provides a mock function with given fields: +// Ready provides a mock function with no fields func (_m *TelemetryService) Ready() error { ret := _m.Called() @@ -236,7 +236,7 @@ func (_c *TelemetryService_Send_Call) Return() *TelemetryService_Send_Call { } func (_c *TelemetryService_Send_Call) RunAndReturn(run func(context.Context, []byte, string, synchronization.TelemetryType)) *TelemetryService_Send_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/core/services/telemetry/monitoring_endpoint_generator_mock.go b/core/services/telemetry/monitoring_endpoint_generator_mock.go index 9715d864f59..0f0c6a07dab 100644 --- a/core/services/telemetry/monitoring_endpoint_generator_mock.go +++ b/core/services/telemetry/monitoring_endpoint_generator_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package telemetry diff --git a/core/services/vrf/mocks/aggregator_v3_interface.go b/core/services/vrf/mocks/aggregator_v3_interface.go index 3bd209b538f..d4e9fd255e2 100644 --- a/core/services/vrf/mocks/aggregator_v3_interface.go +++ b/core/services/vrf/mocks/aggregator_v3_interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -27,7 +27,7 @@ func (_m *AggregatorV3InterfaceInterface) EXPECT() *AggregatorV3InterfaceInterfa return &AggregatorV3InterfaceInterface_Expecter{mock: &_m.Mock} } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *AggregatorV3InterfaceInterface) Address() common.Address { ret := _m.Called() diff --git a/core/services/vrf/mocks/config.go b/core/services/vrf/mocks/config.go index fa908d30f56..b6195933599 100644 --- a/core/services/vrf/mocks/config.go +++ b/core/services/vrf/mocks/config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -17,7 +17,7 @@ func (_m *Config) EXPECT() *Config_Expecter { return &Config_Expecter{mock: &_m.Mock} } -// FinalityDepth provides a mock function with given fields: +// FinalityDepth provides a mock function with no fields func (_m *Config) FinalityDepth() uint32 { ret := _m.Called() @@ -62,7 +62,7 @@ func (_c *Config_FinalityDepth_Call) RunAndReturn(run func() uint32) *Config_Fin return _c } -// MinIncomingConfirmations provides a mock function with given fields: +// MinIncomingConfirmations provides a mock function with no fields func (_m *Config) MinIncomingConfirmations() uint32 { ret := _m.Called() diff --git a/core/services/vrf/mocks/fee_config.go b/core/services/vrf/mocks/fee_config.go index 3f3ca570460..ee0e869ffba 100644 --- a/core/services/vrf/mocks/fee_config.go +++ b/core/services/vrf/mocks/fee_config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -24,7 +24,7 @@ func (_m *FeeConfig) EXPECT() *FeeConfig_Expecter { return &FeeConfig_Expecter{mock: &_m.Mock} } -// LimitDefault provides a mock function with given fields: +// LimitDefault provides a mock function with no fields func (_m *FeeConfig) LimitDefault() uint64 { ret := _m.Called() @@ -69,7 +69,7 @@ func (_c *FeeConfig_LimitDefault_Call) RunAndReturn(run func() uint64) *FeeConfi return _c } -// LimitJobType provides a mock function with given fields: +// LimitJobType provides a mock function with no fields func (_m *FeeConfig) LimitJobType() config.LimitJobType { ret := _m.Called() diff --git a/core/services/vrf/mocks/vrf_coordinator_v2.go b/core/services/vrf/mocks/vrf_coordinator_v2.go index 578ea83ce61..8db8fca7219 100644 --- a/core/services/vrf/mocks/vrf_coordinator_v2.go +++ b/core/services/vrf/mocks/vrf_coordinator_v2.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -209,7 +209,7 @@ func (_c *VRFCoordinatorV2Interface_AddConsumer_Call) RunAndReturn(run func(*bin return _c } -// Address provides a mock function with given fields: +// Address provides a mock function with no fields func (_m *VRFCoordinatorV2Interface) Address() common.Address { ret := _m.Called() diff --git a/core/services/webhook/mocks/external_initiator_manager.go b/core/services/webhook/mocks/external_initiator_manager.go index e622217f0e5..3d3afc4d895 100644 --- a/core/services/webhook/mocks/external_initiator_manager.go +++ b/core/services/webhook/mocks/external_initiator_manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/webhook/mocks/http_client.go b/core/services/webhook/mocks/http_client.go index ff79cd20c8d..e795914057e 100644 --- a/core/services/webhook/mocks/http_client.go +++ b/core/services/webhook/mocks/http_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/services/workflows/syncer/mocks/orm.go b/core/services/workflows/syncer/mocks/orm.go index 09a543d65e3..29f26701bd0 100644 --- a/core/services/workflows/syncer/mocks/orm.go +++ b/core/services/workflows/syncer/mocks/orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/sessions/ldapauth/mocks/ldap_client.go b/core/sessions/ldapauth/mocks/ldap_client.go index 8f905c3cf70..7a09b6e1658 100644 --- a/core/sessions/ldapauth/mocks/ldap_client.go +++ b/core/sessions/ldapauth/mocks/ldap_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -20,7 +20,7 @@ func (_m *LDAPClient) EXPECT() *LDAPClient_Expecter { return &LDAPClient_Expecter{mock: &_m.Mock} } -// CreateEphemeralConnection provides a mock function with given fields: +// CreateEphemeralConnection provides a mock function with no fields func (_m *LDAPClient) CreateEphemeralConnection() (ldapauth.LDAPConn, error) { ret := _m.Called() diff --git a/core/sessions/ldapauth/mocks/ldap_conn.go b/core/sessions/ldapauth/mocks/ldap_conn.go index 63ba3ae5757..ccd9948f2f4 100644 --- a/core/sessions/ldapauth/mocks/ldap_conn.go +++ b/core/sessions/ldapauth/mocks/ldap_conn.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -68,7 +68,7 @@ func (_c *LDAPConn_Bind_Call) RunAndReturn(run func(string, string) error) *LDAP return _c } -// Close provides a mock function with given fields: +// Close provides a mock function with no fields func (_m *LDAPConn) Close() error { ret := _m.Called() diff --git a/core/sessions/mocks/authentication_provider.go b/core/sessions/mocks/authentication_provider.go index c319ebb0e60..844dc0f7d65 100644 --- a/core/sessions/mocks/authentication_provider.go +++ b/core/sessions/mocks/authentication_provider.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/core/sessions/mocks/basic_admin_users_orm.go b/core/sessions/mocks/basic_admin_users_orm.go index bf9c7f919cb..b69479f248e 100644 --- a/core/sessions/mocks/basic_admin_users_orm.go +++ b/core/sessions/mocks/basic_admin_users_orm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/deployment/mocks/offchain_client_mock.go b/deployment/mocks/offchain_client_mock.go index de7a6df3a0d..f760cd1fda3 100644 --- a/deployment/mocks/offchain_client_mock.go +++ b/deployment/mocks/offchain_client_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package deployment From 5b503a3c02801809533012cd73b5f7c492f73ac8 Mon Sep 17 00:00:00 2001 From: Awbrey Hughlett Date: Tue, 7 Jan 2025 12:52:19 -0500 Subject: [PATCH 07/91] Custom Fallback TOML Config (#15617) * Custom Fallback TOML Config This commit provides using an existing env var `CL_CHAIN_DEFAULTS` as a path to a custom `fallback.toml`. This allows plugins to define their own set of fallback options apart from the core node which override the default fallback options. * collapse helper functions into single helper function and reduce indirection * fix test --- .changeset/tall-falcons-yawn.md | 5 + core/chains/evm/config/toml/defaults.go | 146 +++-- .../node/validate/fallback-override.txtar | 552 ++++++++++++++++++ 3 files changed, 640 insertions(+), 63 deletions(-) create mode 100644 .changeset/tall-falcons-yawn.md create mode 100644 testdata/scripts/node/validate/fallback-override.txtar diff --git a/.changeset/tall-falcons-yawn.md b/.changeset/tall-falcons-yawn.md new file mode 100644 index 00000000000..98b90e5994b --- /dev/null +++ b/.changeset/tall-falcons-yawn.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#added the ability to define a fallback.toml override config using CL_CHAIN_DEFAULTS env var diff --git a/core/chains/evm/config/toml/defaults.go b/core/chains/evm/config/toml/defaults.go index 6f03575056b..60da9bded1b 100644 --- a/core/chains/evm/config/toml/defaults.go +++ b/core/chains/evm/config/toml/defaults.go @@ -4,7 +4,7 @@ import ( "bytes" "embed" "fmt" - "io" + "io/fs" "log" "os" "path/filepath" @@ -19,7 +19,6 @@ import ( ) var ( - //go:embed defaults/*.toml defaultsFS embed.FS fallback Chain @@ -33,48 +32,24 @@ var ( ) func init() { - // read the defaults first + var ( + fb *Chain + err error + ) - fes, err := defaultsFS.ReadDir("defaults") + // read all default configs + DefaultIDs, defaultNames, defaults, fb, err = initDefaults(defaultsFS.ReadDir, defaultsFS.ReadFile, "defaults") if err != nil { - log.Fatalf("failed to read defaults/: %v", err) + log.Fatalf("failed to read defaults: %s", err) } - for _, fe := range fes { - path := filepath.Join("defaults", fe.Name()) - b, err2 := defaultsFS.ReadFile(path) - if err2 != nil { - log.Fatalf("failed to read %q: %v", path, err2) - } - var config = struct { - ChainID *big.Big - Chain - }{} - if err3 := cconfig.DecodeTOML(bytes.NewReader(b), &config); err3 != nil { - log.Fatalf("failed to decode %q: %v", path, err3) - } - if fe.Name() == "fallback.toml" { - if config.ChainID != nil { - log.Fatalf("fallback ChainID must be nil, not: %s", config.ChainID) - } - fallback = config.Chain - continue - } - if config.ChainID == nil { - log.Fatalf("missing ChainID: %s", path) - } - DefaultIDs = append(DefaultIDs, config.ChainID) - id := config.ChainID.String() - if _, ok := defaults[id]; ok { - log.Fatalf("%q contains duplicate ChainID: %s", path, id) - } - defaults[id] = config.Chain - defaultNames[id] = strings.ReplaceAll(strings.TrimSuffix(fe.Name(), ".toml"), "_", " ") + if fb == nil { + log.Fatal("failed to set fallback chain config") } - slices.SortFunc(DefaultIDs, func(a, b *big.Big) int { - return a.Cmp(b) - }) + fallback = *fb + + // check for and apply any overrides // read the custom defaults overrides dir := env.CustomDefaults.Get() if dir == "" { @@ -83,54 +58,99 @@ func init() { } // use evm overrides specifically - evmDir := fmt.Sprintf("%s/evm", dir) + _, _, customDefaults, fb, err = initDefaults(os.ReadDir, os.ReadFile, dir+"/evm") + if err != nil { + log.Fatalf("failed to read custom overrides: %s", err) + } - // Read directory contents for evm only - entries, err := os.ReadDir(evmDir) + if fb != nil { + fallback = *fb + } +} + +func initDefaults( + dirReader func(name string) ([]fs.DirEntry, error), + fileReader func(name string) ([]byte, error), + root string, +) ([]*big.Big, map[string]string, map[string]Chain, *Chain, error) { + entries, err := dirReader(root) if err != nil { - log.Fatalf("error reading evm custom defaults override directory: %v", err) - return + return nil, nil, nil, nil, fmt.Errorf("failed to read directory: %w", err) } + var fb *Chain + + ids := make([]*big.Big, 0) + configs := make(map[string]Chain) + names := make(map[string]string) + for _, entry := range entries { if entry.IsDir() { // Skip directories continue } - path := evmDir + "/" + entry.Name() - file, err := os.Open(path) - if err != nil { - log.Fatalf("error opening file (name: %v) in custom defaults override directory: %v", entry.Name(), err) - } + // read the file to bytes + path := filepath.Join(root, entry.Name()) - // Read file contents - b, err := io.ReadAll(file) - file.Close() + chainID, chain, err := readConfig(path, fileReader) if err != nil { - log.Fatalf("error reading file (name: %v) contents in custom defaults override directory: %v", entry.Name(), err) + return nil, nil, nil, nil, err } - var config = struct { - ChainID *big.Big - Chain - }{} + if entry.Name() == "fallback.toml" { + if chainID != nil { + return nil, nil, nil, nil, fmt.Errorf("fallback ChainID must be nil: found: %s", chainID) + } + + fb = &chain - if err := cconfig.DecodeTOML(bytes.NewReader(b), &config); err != nil { - log.Fatalf("failed to decode %q in custom defaults override directory: %v", path, err) + continue } - if config.ChainID == nil { - log.Fatalf("missing ChainID in: %s in custom defaults override directory. exiting", path) + // ensure ChainID is set + if chainID == nil { + return nil, nil, nil, nil, fmt.Errorf("missing ChainID: %s", path) } - id := config.ChainID.String() + ids = append(ids, chainID) - if _, ok := customDefaults[id]; ok { + // ChainID as a default should not be duplicated + id := chainID.String() + if _, ok := configs[id]; ok { log.Fatalf("%q contains duplicate ChainID: %s", path, id) } - customDefaults[id] = config.Chain + + // set lookups + configs[id] = chain + names[id] = strings.ReplaceAll(strings.TrimSuffix(entry.Name(), ".toml"), "_", " ") } + + // sort IDs in numeric order + slices.SortFunc(ids, func(a, b *big.Big) int { + return a.Cmp(b) + }) + + return ids, names, configs, fb, nil +} + +func readConfig(path string, reader func(name string) ([]byte, error)) (*big.Big, Chain, error) { + bts, err := reader(path) + if err != nil { + return nil, Chain{}, fmt.Errorf("error reading file: %w", err) + } + + var config = struct { + ChainID *big.Big + Chain + }{} + + // decode from toml to a chain config + if err := cconfig.DecodeTOML(bytes.NewReader(bts), &config); err != nil { + return nil, Chain{}, fmt.Errorf("error in TOML decoding %s: %w", path, err) + } + + return config.ChainID, config.Chain, nil } // DefaultsNamed returns the default Chain values, optionally for the given chainID, as well as a name if the chainID is known. diff --git a/testdata/scripts/node/validate/fallback-override.txtar b/testdata/scripts/node/validate/fallback-override.txtar new file mode 100644 index 00000000000..91feb48693d --- /dev/null +++ b/testdata/scripts/node/validate/fallback-override.txtar @@ -0,0 +1,552 @@ +# test with defaults +env CL_CHAIN_DEFAULTS= +exec chainlink node -c config.toml -s secrets.toml validate +cmp stdout out.txt + +# test with fallback override +env CL_CHAIN_DEFAULTS=default_overrides +exec chainlink node -c config.toml -s secrets.toml validate +! cmp stdout out.txt + +-- default_overrides/evm/fallback.toml -- +AutoCreateKey = true +BlockBackfillDepth = 1000000 +BlockBackfillSkip = false +FinalityDepth = 50 +FinalityTagEnabled = false +LogBackfillBatchSize = 1000 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinContractPayment = '.00001 link' +MinIncomingConfirmations = 3 +NonceAutoSync = true +NoNewHeadsThreshold = '3m' +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0' +LogBroadcasterEnabled = true + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h' +ReaperThreshold = '168h' +ResendAfterThreshold = '1m' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500_000 +LimitMax = 500_000 +LimitMultiplier = '1' +LimitTransfer = 21_000 +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = false +FeeCapDefault = '100 gwei' +TipCapDefault = '1' +TipCapMin = '1' +EstimateLimit = false + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 8 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +FinalityTagBypass = true +MaxAllowedFinalityDepth = 10000 +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h' +DeltaCJitterOverride = '1h' +ObservationGracePeriod = '1s' + +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400_000 + +-- config.toml -- +Log.Level = 'debug' + +[[EVM]] +ChainID = '1' + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +-- secrets.toml -- +[Database] +URL = 'postgresql://user:pass1234567890abcd@localhost:5432/dbname?sslmode=disable' + +[Password] +Keystore = 'keystore_pass' + +-- out.txt -- +# Secrets: +[Database] +URL = 'xxxxx' +AllowSimplePasswords = false + +[Password] +Keystore = 'xxxxx' + +# Input Configuration: +[Log] +Level = 'debug' + +[[EVM]] +ChainID = '1' + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +# Effective Configuration, with defaults applied: +InsecureFastScrypt = false +RootDir = '~/.chainlink' +ShutdownGracePeriod = '5s' + +[Feature] +FeedsManager = true +LogPoller = false +UICSAKeys = false +CCIP = true +MultiFeedsManagers = false + +[Database] +DefaultIdleInTxSessionTimeout = '1h0m0s' +DefaultLockTimeout = '15s' +DefaultQueryTimeout = '10s' +LogQueries = false +MaxIdleConns = 10 +MaxOpenConns = 100 +MigrateOnStartup = true + +[Database.Backup] +Dir = '' +Frequency = '1h0m0s' +Mode = 'none' +OnVersionUpgrade = true + +[Database.Listener] +MaxReconnectDuration = '10m0s' +MinReconnectInterval = '1m0s' +FallbackPollInterval = '30s' + +[Database.Lock] +Enabled = true +LeaseDuration = '10s' +LeaseRefreshInterval = '1s' + +[TelemetryIngress] +UniConn = false +Logging = false +BufferSize = 100 +MaxBatchSize = 50 +SendInterval = '500ms' +SendTimeout = '10s' +UseBatchSend = true + +[AuditLogger] +Enabled = false +ForwardToUrl = '' +JsonWrapperKey = '' +Headers = [] + +[Log] +Level = 'debug' +JSONConsole = false +UnixTS = false + +[Log.File] +Dir = '' +MaxSize = '5.12gb' +MaxAgeDays = 0 +MaxBackups = 1 + +[WebServer] +AuthenticationMethod = 'local' +AllowOrigins = 'http://localhost:3000,http://localhost:6688' +BridgeResponseURL = '' +BridgeCacheTTL = '0s' +HTTPWriteTimeout = '10s' +HTTPPort = 6688 +SecureCookies = true +SessionTimeout = '15m0s' +SessionReaperExpiration = '240h0m0s' +HTTPMaxSize = '32.77kb' +StartTimeout = '15s' +ListenIP = '0.0.0.0' + +[WebServer.LDAP] +ServerTLS = true +SessionTimeout = '15m0s' +QueryTimeout = '2m0s' +BaseUserAttr = 'uid' +BaseDN = '' +UsersDN = 'ou=users' +GroupsDN = 'ou=groups' +ActiveAttribute = '' +ActiveAttributeAllowedValue = '' +AdminUserGroupCN = 'NodeAdmins' +EditUserGroupCN = 'NodeEditors' +RunUserGroupCN = 'NodeRunners' +ReadUserGroupCN = 'NodeReadOnly' +UserApiTokenEnabled = false +UserAPITokenDuration = '240h0m0s' +UpstreamSyncInterval = '0s' +UpstreamSyncRateLimit = '2m0s' + +[WebServer.MFA] +RPID = '' +RPOrigin = '' + +[WebServer.RateLimit] +Authenticated = 1000 +AuthenticatedPeriod = '1m0s' +Unauthenticated = 5 +UnauthenticatedPeriod = '20s' + +[WebServer.TLS] +CertPath = '' +ForceRedirect = false +Host = '' +HTTPSPort = 6689 +KeyPath = '' +ListenIP = '0.0.0.0' + +[JobPipeline] +ExternalInitiatorsEnabled = false +MaxRunDuration = '10m0s' +MaxSuccessfulRuns = 10000 +ReaperInterval = '1h0m0s' +ReaperThreshold = '24h0m0s' +ResultWriteQueueDepth = 100 +VerboseLogging = true + +[JobPipeline.HTTPRequest] +DefaultTimeout = '15s' +MaxSize = '32.77kb' + +[FluxMonitor] +DefaultTransactionQueueDepth = 1 +SimulateTransactions = false + +[OCR2] +Enabled = false +ContractConfirmations = 3 +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' +CaptureEATelemetry = false +CaptureAutomationCustomTelemetry = true +DefaultTransactionQueueDepth = 1 +SimulateTransactions = false +TraceLogging = false + +[OCR] +Enabled = false +ObservationTimeout = '5s' +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +DefaultTransactionQueueDepth = 1 +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' +SimulateTransactions = false +TransmitterAddress = '' +CaptureEATelemetry = false +TraceLogging = false + +[P2P] +IncomingMessageBufferSize = 10 +OutgoingMessageBufferSize = 10 +PeerID = '' +TraceLogging = false + +[P2P.V2] +Enabled = true +AnnounceAddresses = [] +DefaultBootstrappers = [] +DeltaDial = '15s' +DeltaReconcile = '1m0s' +ListenAddresses = [] + +[Keeper] +DefaultTransactionQueueDepth = 1 +GasPriceBufferPercent = 20 +GasTipCapBufferPercent = 20 +BaseFeeBufferPercent = 20 +MaxGracePeriod = 100 +TurnLookBack = 1000 + +[Keeper.Registry] +CheckGasOverhead = 200000 +PerformGasOverhead = 300000 +MaxPerformDataSize = 5000 +SyncInterval = '30m0s' +SyncUpkeepQueueSize = 10 + +[AutoPprof] +Enabled = false +ProfileRoot = '' +PollInterval = '10s' +GatherDuration = '10s' +GatherTraceDuration = '5s' +MaxProfileSize = '100.00mb' +CPUProfileRate = 1 +MemProfileRate = 1 +BlockProfileRate = 1 +MutexProfileFraction = 1 +MemThreshold = '4.00gb' +GoroutineThreshold = 5000 + +[Pyroscope] +ServerAddress = '' +Environment = 'mainnet' + +[Sentry] +Debug = false +DSN = '' +Environment = '' +Release = '' + +[Insecure] +DevWebServer = false +OCRDevelopmentMode = false +InfiniteDepthQueries = false +DisableRateLimiting = false + +[Tracing] +Enabled = false +CollectorTarget = '' +NodeID = '' +SamplingRatio = 0.0 +Mode = 'tls' +TLSCertPath = '' + +[Mercury] +VerboseLogging = false + +[Mercury.Cache] +LatestReportTTL = '1s' +MaxStaleAge = '1h0m0s' +LatestReportDeadline = '5s' + +[Mercury.TLS] +CertFile = '' + +[Mercury.Transmitter] +TransmitQueueMaxSize = 10000 +TransmitTimeout = '5s' +TransmitConcurrency = 100 + +[Capabilities] +[Capabilities.Peering] +IncomingMessageBufferSize = 10 +OutgoingMessageBufferSize = 10 +PeerID = '' +TraceLogging = false + +[Capabilities.Peering.V2] +Enabled = false +AnnounceAddresses = [] +DefaultBootstrappers = [] +DeltaDial = '15s' +DeltaReconcile = '1m0s' +ListenAddresses = [] + +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + +[Capabilities.ExternalRegistry] +Address = '' +NetworkID = 'evm' +ChainID = '1' + +[Capabilities.WorkflowRegistry] +Address = '' +NetworkID = 'evm' +ChainID = '1' + +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 +EmitterBatchProcessor = true +EmitterExportTimeout = '1s' + +[[EVM]] +ChainID = '1' +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 50 +FinalityTagEnabled = true +LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' +LogBackfillBatchSize = 1000 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.1 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' + +[EVM.Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[EVM.Transactions.AutoPurge] +Enabled = false + +[EVM.BalanceMonitor] +Enabled = true + +[EVM.GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[EVM.GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 4 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 50 + +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[EVM.HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[EVM.NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[EVM.OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[EVM.OCR2] +[EVM.OCR2.Automation] +GasLimit = 10500000 + +[EVM.Workflow] +GasLimitDefault = 400000 + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +Valid configuration. From 99f21e9b99b51874a7f2b730ead592adabd379c3 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 7 Jan 2025 13:22:20 -0600 Subject: [PATCH 08/91] deployment: golangci-lint run --fix (#15838) --- .golangci.yml | 1 - deployment/.golangci.yml | 1 - deployment/address_book.go | 10 ++--- deployment/ccip/changeset/cs_ccip_home.go | 45 ++++++++++--------- .../ccip/changeset/cs_ccip_home_test.go | 4 +- .../ccip/changeset/cs_chain_contracts.go | 9 ++-- .../ccip/changeset/cs_chain_contracts_test.go | 4 +- deployment/ccip/changeset/cs_deploy_chain.go | 17 +++---- deployment/ccip/changeset/cs_home_chain.go | 18 ++++---- .../ccip/changeset/cs_home_chain_test.go | 4 +- .../ccip/changeset/cs_update_rmn_config.go | 7 +-- deployment/ccip/changeset/state.go | 3 +- deployment/ccip/changeset/test_assertions.go | 11 ++--- deployment/ccip/changeset/test_environment.go | 10 ++--- deployment/ccip/changeset/test_helpers.go | 10 ++--- .../ccip/changeset/test_usdc_helpers.go | 4 +- deployment/ccip/changeset/v1_5/cs_jobspec.go | 5 ++- .../ccip/view/v1_0/rmn_proxy_contract.go | 3 +- deployment/ccip/view/v1_2/price_registry.go | 3 +- .../ccip/view/v1_2/price_registry_test.go | 8 ++-- deployment/ccip/view/v1_5/commit_store.go | 3 +- deployment/ccip/view/v1_5/offramp.go | 3 +- deployment/ccip/view/v1_5/offramp_test.go | 2 +- deployment/ccip/view/v1_5/onramp.go | 3 +- deployment/ccip/view/v1_5/onramp_test.go | 3 +- deployment/ccip/view/v1_5/rmn.go | 3 +- deployment/ccip/view/v1_5/rmn_test.go | 4 +- .../ccip/view/v1_5/tokenadminregistry.go | 3 +- deployment/ccip/view/v1_6/ccip_home.go | 3 +- deployment/ccip/view/v1_6/ccip_home_test.go | 2 +- deployment/ccip/view/v1_6/rmnhome.go | 1 + .../common/changeset/deploy_link_token.go | 4 +- .../example/add_mint_burners_link.go | 2 - .../common/changeset/example/link_transfer.go | 3 -- .../changeset/example/link_transfer_test.go | 1 - .../common/changeset/example/mint_link.go | 2 - deployment/common/changeset/internal/mcms.go | 6 +-- deployment/common/changeset/save_existing.go | 6 +-- .../common/changeset/set_config_mcms.go | 1 - .../common/changeset/set_config_mcms_test.go | 4 +- deployment/common/changeset/test_helpers.go | 1 + .../transfer_to_mcms_with_timelock.go | 16 +++---- .../common/proposalutils/mcms_helpers.go | 11 ++--- deployment/common/proposalutils/propose.go | 4 +- deployment/common/types/types.go | 26 +++++------ deployment/common/view/nops.go | 6 ++- deployment/common/view/v1_0/capreg_test.go | 4 +- deployment/common/view/v1_0/link_token.go | 4 +- .../common/view/v1_0/link_token_test.go | 12 ++--- .../common/view/v1_0/static_link_token.go | 4 +- .../view/v1_0/static_link_token_test.go | 6 +-- deployment/environment.go | 3 +- deployment/environment/crib/types.go | 1 + deployment/environment/devenv/chain.go | 3 +- deployment/environment/devenv/don.go | 6 ++- deployment/environment/devenv/don_test.go | 1 - deployment/environment/devenv/environment.go | 5 ++- deployment/environment/devenv/jd.go | 5 ++- deployment/environment/memory/job_client.go | 30 ++++++------- .../environment/nodeclient/chainlink.go | 11 ++--- .../environment/web/sdk/client/client.go | 38 ++++++++-------- .../environment/web/sdk/client/types.go | 4 +- deployment/evm_kmsclient.go | 15 ++++--- deployment/helpers.go | 3 +- .../changeset/append_node_capabilities.go | 4 +- .../append_node_capabilities_test.go | 7 ++- .../keystone/changeset/deploy_consumer.go | 3 +- .../changeset/deploy_consumer_test.go | 2 +- .../keystone/changeset/deploy_forwarder.go | 6 ++- .../changeset/deploy_forwarder_test.go | 11 ++--- deployment/keystone/changeset/deploy_ocr3.go | 8 ++-- .../keystone/changeset/deploy_ocr3_test.go | 7 +-- .../keystone/changeset/deploy_registry.go | 3 +- .../changeset/deploy_registry_test.go | 2 +- .../internal/append_node_capabilities.go | 5 ++- .../internal/capability_management.go | 1 + .../changeset/internal/contract_set.go | 1 - .../keystone/changeset/internal/deploy.go | 10 ++--- .../changeset/internal/forwarder_deployer.go | 1 + .../changeset/internal/ocr3_deployer.go | 1 + .../keystone/changeset/internal/ocr3config.go | 4 +- .../changeset/internal/ocr3config_test.go | 2 +- .../keystone/changeset/internal/types.go | 13 +++--- .../keystone/changeset/internal/types_test.go | 7 +-- .../keystone/changeset/internal/update_don.go | 8 ++-- .../changeset/internal/update_don_test.go | 7 ++- .../internal/update_node_capabilities.go | 5 ++- .../changeset/internal/update_nodes.go | 3 +- .../changeset/internal/update_nodes_test.go | 2 - deployment/keystone/changeset/update_don.go | 11 +++-- .../keystone/changeset/update_don_test.go | 6 +-- .../changeset/update_node_capabilities.go | 6 ++- .../update_node_capabilities_test.go | 9 ++-- deployment/keystone/changeset/update_nodes.go | 6 ++- .../keystone/changeset/update_nodes_test.go | 7 ++- deployment/keystone/changeset/view.go | 1 - .../changeset/workflowregistry/deploy.go | 3 +- .../changeset/workflowregistry/deploy_test.go | 2 +- .../changeset/workflowregistry/setup_test.go | 3 +- .../update_allowed_dons_test.go | 6 +-- .../update_authorized_addresses_test.go | 4 +- .../workflow_registry_deployer.go | 1 - deployment/multiclient_test.go | 4 +- integration-tests/.golangci.yml | 1 - 104 files changed, 330 insertions(+), 318 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 63b061c2951..d35b6459e05 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,7 +8,6 @@ linters: - errname - errorlint - exhaustive - - exportloopref - fatcontext - ginkgolinter - gocritic diff --git a/deployment/.golangci.yml b/deployment/.golangci.yml index ff1303e26ce..7341210ce00 100644 --- a/deployment/.golangci.yml +++ b/deployment/.golangci.yml @@ -8,7 +8,6 @@ linters: - errname - errorlint - exhaustive - - exportloopref - fatcontext - ginkgolinter - gocritic diff --git a/deployment/address_book.go b/deployment/address_book.go index 3ce0332a4c3..fde0adc2d97 100644 --- a/deployment/address_book.go +++ b/deployment/address_book.go @@ -14,9 +14,9 @@ import ( ) var ( - ErrInvalidChainSelector = fmt.Errorf("invalid chain selector") - ErrInvalidAddress = fmt.Errorf("invalid address") - ErrChainNotFound = fmt.Errorf("chain not found") + ErrInvalidChainSelector = errors.New("invalid chain selector") + ErrInvalidAddress = errors.New("invalid address") + ErrChainNotFound = errors.New("chain not found") ) // ContractType is a simple string type for identifying contract types. @@ -117,7 +117,7 @@ func (m *AddressBookMap) save(chainSelector uint64, address string, typeAndVersi // TODO NONEVM-960: Add validation for non-EVM chain addresses if typeAndVersion.Type == "" { - return fmt.Errorf("type cannot be empty") + return errors.New("type cannot be empty") } if _, exists := m.addressesByChain[chainSelector]; !exists { @@ -256,7 +256,7 @@ func SearchAddressBook(ab AddressBook, chain uint64, typ ContractType) (string, } } - return "", fmt.Errorf("not found") + return "", errors.New("not found") } func AddressBookContains(ab AddressBook, chain uint64, addrToFind string) (bool, error) { diff --git a/deployment/ccip/changeset/cs_ccip_home.go b/deployment/ccip/changeset/cs_ccip_home.go index 0c82afee261..7d3327a31f2 100644 --- a/deployment/ccip/changeset/cs_ccip_home.go +++ b/deployment/ccip/changeset/cs_ccip_home.go @@ -3,6 +3,7 @@ package changeset import ( "bytes" "encoding/hex" + "errors" "fmt" "math/big" "os" @@ -139,7 +140,7 @@ func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([] if p.PluginType != types.PluginTypeCCIPCommit && p.PluginType != types.PluginTypeCCIPExec { - return nil, fmt.Errorf("PluginType must be set to either CCIPCommit or CCIPExec") + return nil, errors.New("PluginType must be set to either CCIPCommit or CCIPExec") } var donIDs []uint32 @@ -153,7 +154,7 @@ func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([] } if chainState.OffRamp == nil { // should not be possible, but a defensive check. - return nil, fmt.Errorf("OffRamp contract does not exist") + return nil, errors.New("OffRamp contract does not exist") } donID, err := internal.DonIDForChain( @@ -182,13 +183,13 @@ func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([] donIDs = append(donIDs, donID) } if len(e.NodeIDs) == 0 { - return nil, fmt.Errorf("NodeIDs must be set") + return nil, errors.New("NodeIDs must be set") } if state.Chains[p.HomeChainSelector].CCIPHome == nil { - return nil, fmt.Errorf("CCIPHome contract does not exist") + return nil, errors.New("CCIPHome contract does not exist") } if state.Chains[p.HomeChainSelector].CapabilityRegistry == nil { - return nil, fmt.Errorf("CapabilityRegistry contract does not exist") + return nil, errors.New("CapabilityRegistry contract does not exist") } return donIDs, nil @@ -316,7 +317,7 @@ func (s SetCandidateConfigBase) Validate(e deployment.Environment, state CCIPOnC } if s.PluginType != types.PluginTypeCCIPCommit && s.PluginType != types.PluginTypeCCIPExec { - return fmt.Errorf("PluginType must be set to either CCIPCommit or CCIPExec") + return errors.New("PluginType must be set to either CCIPCommit or CCIPExec") } // no donID check since this config is used for both adding a new DON and updating an existing one. @@ -340,17 +341,17 @@ func (s SetCandidateConfigBase) Validate(e deployment.Environment, state CCIPOnC // TODO: validate gas config in the chain config in cciphome for this RemoteChainSelectors. } if len(e.NodeIDs) == 0 { - return fmt.Errorf("nodeIDs must be set") + return errors.New("nodeIDs must be set") } if state.Chains[s.HomeChainSelector].CCIPHome == nil { - return fmt.Errorf("CCIPHome contract does not exist") + return errors.New("CCIPHome contract does not exist") } if state.Chains[s.HomeChainSelector].CapabilityRegistry == nil { - return fmt.Errorf("CapabilityRegistry contract does not exist") + return errors.New("CapabilityRegistry contract does not exist") } if e.OCRSecrets.IsEmpty() { - return fmt.Errorf("OCR secrets must be set") + return errors.New("OCR secrets must be set") } return nil @@ -443,7 +444,7 @@ func AddDonAndSetCandidateChangeset( pluginOCR3Config, ok := newDONArgs[cfg.PluginType] if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("missing commit plugin in ocr3Configs") + return deployment.ChangesetOutput{}, errors.New("missing commit plugin in ocr3Configs") } expectedDonID := latestDon.Id + 1 @@ -476,7 +477,7 @@ func AddDonAndSetCandidateChangeset( ChainIdentifier: mcms.ChainIdentifier(cfg.HomeChainSelector), Batch: donOps, }}, - fmt.Sprintf("addDON on new Chain && setCandidate for plugin %s", cfg.PluginType.String()), + "addDON on new Chain && setCandidate for plugin "+cfg.PluginType.String(), cfg.MCMS.MinDelay, ) if err != nil { @@ -671,7 +672,7 @@ func setCandidateOnExistingDon( mcmsEnabled bool, ) ([]mcms.Operation, error) { if donID == 0 { - return nil, fmt.Errorf("donID is zero") + return nil, errors.New("donID is zero") } encodedSetCandidateCall, err := internal.CCIPHomeABI.Pack( @@ -791,7 +792,7 @@ func promoteAllCandidatesForChainOps( mcmsEnabled bool, ) (mcms.Operation, error) { if donID == 0 { - return mcms.Operation{}, fmt.Errorf("donID is zero") + return mcms.Operation{}, errors.New("donID is zero") } updatePluginOp, err := promoteCandidateOp( @@ -831,13 +832,13 @@ func (r RevokeCandidateChangesetConfig) Validate(e deployment.Environment, state return 0, fmt.Errorf("don chain selector invalid: %w", err) } if len(e.NodeIDs) == 0 { - return 0, fmt.Errorf("NodeIDs must be set") + return 0, errors.New("NodeIDs must be set") } if state.Chains[r.HomeChainSelector].CCIPHome == nil { - return 0, fmt.Errorf("CCIPHome contract does not exist") + return 0, errors.New("CCIPHome contract does not exist") } if state.Chains[r.HomeChainSelector].CapabilityRegistry == nil { - return 0, fmt.Errorf("CapabilityRegistry contract does not exist") + return 0, errors.New("CapabilityRegistry contract does not exist") } homeChainState, exists := state.Chains[r.HomeChainSelector] if !exists { @@ -866,7 +867,7 @@ func (r RevokeCandidateChangesetConfig) Validate(e deployment.Environment, state return 0, fmt.Errorf("fetching candidate digest from cciphome: %w", err) } if candidateDigest == [32]byte{} { - return 0, fmt.Errorf("candidate config digest is zero, can't revoke it") + return 0, errors.New("candidate config digest is zero, can't revoke it") } return donID, nil @@ -947,7 +948,7 @@ func revokeCandidateOps( mcmsEnabled bool, ) ([]mcms.Operation, error) { if donID == 0 { - return nil, fmt.Errorf("donID is zero") + return nil, errors.New("donID is zero") } candidateDigest, err := ccipHome.GetCandidateDigest(nil, donID, pluginType) @@ -1017,7 +1018,7 @@ func (c UpdateChainConfigConfig) Validate(e deployment.Environment) error { return fmt.Errorf("home chain selector invalid: %w", err) } if len(c.RemoteChainRemoves) == 0 && len(c.RemoteChainAdds) == 0 { - return fmt.Errorf("no chain adds or removes") + return errors.New("no chain adds or removes") } homeChainState, exists := state.Chains[c.HomeChainSelector] if !exists { @@ -1042,10 +1043,10 @@ func (c UpdateChainConfigConfig) Validate(e deployment.Environment) error { return fmt.Errorf("chain to add %d is not supported", add) } if ccfg.FChain == 0 { - return fmt.Errorf("FChain must be set") + return errors.New("FChain must be set") } if len(ccfg.Readers) == 0 { - return fmt.Errorf("Readers must be set") + return errors.New("Readers must be set") } } return nil diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go index dae32557f8b..eb22f05a703 100644 --- a/deployment/ccip/changeset/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/cs_ccip_home_test.go @@ -459,7 +459,7 @@ func Test_UpdateChainConfigs(t *testing.T) { ccipHome := state.Chains[tenv.HomeChainSel].CCIPHome otherChainConfig, err := ccipHome.GetChainConfig(nil, otherChain) require.NoError(t, err) - assert.True(t, otherChainConfig.FChain != 0) + assert.NotZero(t, otherChainConfig.FChain) var mcmsConfig *MCMSConfig if tc.mcmsEnabled { @@ -488,7 +488,7 @@ func Test_UpdateChainConfigs(t *testing.T) { // other chain should be gone chainConfigAfter, err := ccipHome.GetChainConfig(nil, otherChain) require.NoError(t, err) - assert.True(t, chainConfigAfter.FChain == 0) + assert.Zero(t, chainConfigAfter.FChain) // Lets add it back now. _, err = commonchangeset.ApplyChangesets(t, tenv.Env, map[uint64]*proposalutils.TimelockExecutionContracts{ diff --git a/deployment/ccip/changeset/cs_chain_contracts.go b/deployment/ccip/changeset/cs_chain_contracts.go index f85814f1768..e87e66e06b5 100644 --- a/deployment/ccip/changeset/cs_chain_contracts.go +++ b/deployment/ccip/changeset/cs_chain_contracts.go @@ -221,7 +221,7 @@ func UpdateNonceManagersCS(e deployment.Environment, cfg UpdateNonceManagerConfi type UpdateOnRampDestsConfig struct { UpdatesByChain map[uint64]map[uint64]OnRampDestinationUpdate // Disallow mixing MCMS/non-MCMS per chain for simplicity. - // (can still be acheived by calling this function multiple times) + // (can still be achieved by calling this function multiple times) MCMS *MCMSConfig } @@ -265,7 +265,7 @@ func (cfg UpdateOnRampDestsConfig) Validate(e deployment.Environment) error { return fmt.Errorf("failed to get onramp static config %s: %w", chainState.OnRamp.Address(), err) } if destination == sc.ChainSelector { - return fmt.Errorf("cannot update onramp destination to the same chain") + return errors.New("cannot update onramp destination to the same chain") } } } @@ -514,7 +514,7 @@ func UpdateFeeQuoterPricesCS(e deployment.Environment, cfg UpdateFeeQuoterPrices type UpdateFeeQuoterDestsConfig struct { UpdatesByChain map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. - // (can still be acheived by calling this function multiple times) + // (can still be achieved by calling this function multiple times) MCMS *MCMSConfig } @@ -552,7 +552,7 @@ func (cfg UpdateFeeQuoterDestsConfig) Validate(e deployment.Environment) error { return fmt.Errorf("failed to get onramp static config %s: %w", chainState.OnRamp.Address(), err) } if destination == sc.ChainSelector { - return fmt.Errorf("source and destination chain cannot be the same") + return errors.New("source and destination chain cannot be the same") } } } @@ -824,7 +824,6 @@ func (cfg UpdateRouterRampsConfig) Validate(e deployment.Environment) error { return fmt.Errorf("missing offramp for dest %d", destination) } } - } return nil } diff --git a/deployment/ccip/changeset/cs_chain_contracts_test.go b/deployment/ccip/changeset/cs_chain_contracts_test.go index 0a1e0ce3b7b..adbcc078373 100644 --- a/deployment/ccip/changeset/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/cs_chain_contracts_test.go @@ -81,11 +81,11 @@ func TestUpdateOnRampsDests(t *testing.T) { sourceCfg, err := state.Chains[source].OnRamp.GetDestChainConfig(&bind.CallOpts{Context: ctx}, dest) require.NoError(t, err) require.Equal(t, state.Chains[source].TestRouter.Address(), sourceCfg.Router) - require.Equal(t, false, sourceCfg.AllowlistEnabled) + require.False(t, sourceCfg.AllowlistEnabled) destCfg, err := state.Chains[dest].OnRamp.GetDestChainConfig(&bind.CallOpts{Context: ctx}, source) require.NoError(t, err) require.Equal(t, state.Chains[dest].Router.Address(), destCfg.Router) - require.Equal(t, true, destCfg.AllowlistEnabled) + require.True(t, destCfg.AllowlistEnabled) }) } } diff --git a/deployment/ccip/changeset/cs_deploy_chain.go b/deployment/ccip/changeset/cs_deploy_chain.go index 5a6085202a9..68655377f2e 100644 --- a/deployment/ccip/changeset/cs_deploy_chain.go +++ b/deployment/ccip/changeset/cs_deploy_chain.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "math/big" @@ -81,7 +82,7 @@ func deployChainContractsForChains( capReg := existingState.Chains[homeChainSel].CapabilityRegistry if capReg == nil { e.Logger.Errorw("Failed to get capability registry") - return fmt.Errorf("capability registry not found") + return errors.New("capability registry not found") } cr, err := capReg.GetHashedCapabilityId( &bind.CallOpts{}, internal.CapabilityLabelledName, internal.CapabilityVersion) @@ -105,12 +106,12 @@ func deployChainContractsForChains( return err } if ccipHome.Address() != existingState.Chains[homeChainSel].CCIPHome.Address() { - return fmt.Errorf("ccip home address mismatch") + return errors.New("ccip home address mismatch") } rmnHome := existingState.Chains[homeChainSel].RMNHome if rmnHome == nil { e.Logger.Errorw("Failed to get rmn home", "err", err) - return fmt.Errorf("rmn home not found") + return errors.New("rmn home not found") } deployGrp := errgroup.Group{} for _, chainSel := range chainsToDeploy { @@ -203,7 +204,7 @@ func deployChainContracts( rmnLegacyAddr, ) return deployment.ContractDeploy[*rmn_remote.RMNRemote]{ - rmnRemoteAddr, rmnRemote, tx, deployment.NewTypeAndVersion(RMNRemote, deployment.Version1_6_0_dev), err2, + Address: rmnRemoteAddr, Contract: rmnRemote, Tx: tx, Tv: deployment.NewTypeAndVersion(RMNRemote, deployment.Version1_6_0_dev), Err: err2, } }) if err != nil { @@ -243,7 +244,7 @@ func deployChainContracts( RMNProxy.Address(), ) return deployment.ContractDeploy[*router.Router]{ - routerAddr, routerC, tx2, deployment.NewTypeAndVersion(TestRouter, deployment.Version1_2_0), err2, + Address: routerAddr, Contract: routerC, Tx: tx2, Tv: deployment.NewTypeAndVersion(TestRouter, deployment.Version1_2_0), Err: err2, } }) if err != nil { @@ -264,7 +265,7 @@ func deployChainContracts( []common.Address{}, // Need to add onRamp after ) return deployment.ContractDeploy[*nonce_manager.NonceManager]{ - nonceManagerAddr, nonceManager, tx2, deployment.NewTypeAndVersion(NonceManager, deployment.Version1_6_0_dev), err2, + Address: nonceManagerAddr, Contract: nonceManager, Tx: tx2, Tv: deployment.NewTypeAndVersion(NonceManager, deployment.Version1_6_0_dev), Err: err2, } }) if err != nil { @@ -304,7 +305,7 @@ func deployChainContracts( []fee_quoter.FeeQuoterDestChainConfigArgs{}, ) return deployment.ContractDeploy[*fee_quoter.FeeQuoter]{ - prAddr, pr, tx2, deployment.NewTypeAndVersion(FeeQuoter, deployment.Version1_6_0_dev), err2, + Address: prAddr, Contract: pr, Tx: tx2, Tv: deployment.NewTypeAndVersion(FeeQuoter, deployment.Version1_6_0_dev), Err: err2, } }) if err != nil { @@ -335,7 +336,7 @@ func deployChainContracts( []onramp.OnRampDestChainConfigArgs{}, ) return deployment.ContractDeploy[*onramp.OnRamp]{ - onRampAddr, onRamp, tx2, deployment.NewTypeAndVersion(OnRamp, deployment.Version1_6_0_dev), err2, + Address: onRampAddr, Contract: onRamp, Tx: tx2, Tv: deployment.NewTypeAndVersion(OnRamp, deployment.Version1_6_0_dev), Err: err2, } }) if err != nil { diff --git a/deployment/ccip/changeset/cs_home_chain.go b/deployment/ccip/changeset/cs_home_chain.go index b92a8d132a4..3b985f5c526 100644 --- a/deployment/ccip/changeset/cs_home_chain.go +++ b/deployment/ccip/changeset/cs_home_chain.go @@ -61,23 +61,23 @@ type DeployHomeChainConfig struct { func (c DeployHomeChainConfig) Validate() error { if c.HomeChainSel == 0 { - return fmt.Errorf("home chain selector must be set") + return errors.New("home chain selector must be set") } if c.RMNDynamicConfig.OffchainConfig == nil { - return fmt.Errorf("offchain config for RMNHomeDynamicConfig must be set") + return errors.New("offchain config for RMNHomeDynamicConfig must be set") } if c.RMNStaticConfig.OffchainConfig == nil { - return fmt.Errorf("offchain config for RMNHomeStaticConfig must be set") + return errors.New("offchain config for RMNHomeStaticConfig must be set") } if len(c.NodeOperators) == 0 { - return fmt.Errorf("node operators must be set") + return errors.New("node operators must be set") } for _, nop := range c.NodeOperators { if nop.Admin == (common.Address{}) { - return fmt.Errorf("node operator admin address must be set") + return errors.New("node operator admin address must be set") } if nop.Name == "" { - return fmt.Errorf("node operator name must be set") + return errors.New("node operator name must be set") } if len(c.NodeP2PIDsPerNodeOpAdmin[nop.Name]) == 0 { return fmt.Errorf("node operator %s must have node p2p ids provided", nop.Name) @@ -338,14 +338,14 @@ func (c RemoveDONsConfig) Validate(homeChain CCIPChainState) error { return fmt.Errorf("home chain selector must be set %w", err) } if len(c.DonIDs) == 0 { - return fmt.Errorf("don ids must be set") + return errors.New("don ids must be set") } // Cap reg must exist if homeChain.CapabilityRegistry == nil { - return fmt.Errorf("cap reg does not exist") + return errors.New("cap reg does not exist") } if homeChain.CCIPHome == nil { - return fmt.Errorf("ccip home does not exist") + return errors.New("ccip home does not exist") } if err := internal.DONIdExists(homeChain.CapabilityRegistry, c.DonIDs); err != nil { return err diff --git a/deployment/ccip/changeset/cs_home_chain_test.go b/deployment/ccip/changeset/cs_home_chain_test.go index 8a2d4f87709..e96cd878305 100644 --- a/deployment/ccip/changeset/cs_home_chain_test.go +++ b/deployment/ccip/changeset/cs_home_chain_test.go @@ -52,12 +52,12 @@ func TestDeployHomeChain(t *testing.T) { capRegSnap, ok := snap[chainName].CapabilityRegistry[state.Chains[homeChainSel].CapabilityRegistry.Address().String()] require.True(t, ok) require.NotNil(t, capRegSnap) - require.Equal(t, capRegSnap.Nops, []v1_0.NopView{ + require.Equal(t, []v1_0.NopView{ { Admin: e.Chains[homeChainSel].DeployerKey.From, Name: "NodeOperator", }, - }) + }, capRegSnap.Nops) require.Len(t, capRegSnap.Nodes, len(p2pIds)) } diff --git a/deployment/ccip/changeset/cs_update_rmn_config.go b/deployment/ccip/changeset/cs_update_rmn_config.go index 96f8eacb4cc..337b3756881 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/cs_update_rmn_config.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "math/big" "reflect" @@ -178,14 +179,14 @@ func (c SetRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { } if len(c.RMNDynamicConfig.OffchainConfig) != 0 { - return fmt.Errorf("RMNDynamicConfig.OffchainConfig must be empty") + return errors.New("RMNDynamicConfig.OffchainConfig must be empty") } if len(c.RMNStaticConfig.OffchainConfig) != 0 { - return fmt.Errorf("RMNStaticConfig.OffchainConfig must be empty") + return errors.New("RMNStaticConfig.OffchainConfig must be empty") } if len(c.RMNStaticConfig.Nodes) > 256 { - return fmt.Errorf("RMNStaticConfig.Nodes must be less than 256") + return errors.New("RMNStaticConfig.Nodes must be less than 256") } var ( diff --git a/deployment/ccip/changeset/state.go b/deployment/ccip/changeset/state.go index b50724eaa16..aa07168a6d2 100644 --- a/deployment/ccip/changeset/state.go +++ b/deployment/ccip/changeset/state.go @@ -2,6 +2,7 @@ package changeset import ( "fmt" + "strconv" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" @@ -366,7 +367,7 @@ func (s CCIPOnChainState) View(chains []uint64) (map[string]view.ChainView, erro } name := chainInfo.ChainName if chainInfo.ChainName == "" { - name = fmt.Sprintf("%d", chainSelector) + name = strconv.FormatUint(chainSelector, 10) } m[name] = chainView } diff --git a/deployment/ccip/changeset/test_assertions.go b/deployment/ccip/changeset/test_assertions.go index bcfb49250d4..c83d6e3597a 100644 --- a/deployment/ccip/changeset/test_assertions.go +++ b/deployment/ccip/changeset/test_assertions.go @@ -2,6 +2,7 @@ package changeset import ( "context" + "errors" "fmt" "math/big" "sync" @@ -360,12 +361,12 @@ func ConfirmCommitWithExpectedSeqNumRange( if mr.SourceChainSelector == src.Selector && uint64(expectedSeqNumRange.Start()) >= mr.MinSeqNr && uint64(expectedSeqNumRange.End()) <= mr.MaxSeqNr { - t.Logf("All sequence numbers commited in a single report [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) + t.Logf("All sequence numbers committed in a single report [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) return event, nil } if !enforceSingleCommit && seenMessages.allCommited(src.Selector) { - t.Logf("All sequence numbers already commited from range [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) + t.Logf("All sequence numbers already committed from range [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) return event, nil } } @@ -389,12 +390,12 @@ func ConfirmCommitWithExpectedSeqNumRange( if mr.SourceChainSelector == src.Selector && uint64(expectedSeqNumRange.Start()) >= mr.MinSeqNr && uint64(expectedSeqNumRange.End()) <= mr.MaxSeqNr { - t.Logf("All sequence numbers commited in a single report [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) + t.Logf("All sequence numbers committed in a single report [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) return report, nil } if !enforceSingleCommit && seenMessages.allCommited(src.Selector) { - t.Logf("All sequence numbers already commited from range [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) + t.Logf("All sequence numbers already committed from range [%d, %d]", expectedSeqNumRange.Start(), expectedSeqNumRange.End()) return report, nil } } @@ -482,7 +483,7 @@ func ConfirmExecWithSeqNrs( expectedSeqNrs []uint64, ) (executionStates map[uint64]int, err error) { if len(expectedSeqNrs) == 0 { - return nil, fmt.Errorf("no expected sequence numbers provided") + return nil, errors.New("no expected sequence numbers provided") } timer := time.NewTimer(8 * time.Minute) diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/test_environment.go index f723efbf619..a1307d9820b 100644 --- a/deployment/ccip/changeset/test_environment.go +++ b/deployment/ccip/changeset/test_environment.go @@ -2,7 +2,7 @@ package changeset import ( "context" - "fmt" + "errors" "math/big" "os" "testing" @@ -61,16 +61,16 @@ type TestConfigs struct { func (tc *TestConfigs) Validate() error { if tc.Chains < 2 { - return fmt.Errorf("chains must be at least 2") + return errors.New("chains must be at least 2") } if tc.Nodes < 4 { - return fmt.Errorf("nodes must be at least 4") + return errors.New("nodes must be at least 4") } if tc.Bootstraps < 1 { - return fmt.Errorf("bootstraps must be at least 1") + return errors.New("bootstraps must be at least 1") } if tc.Type == Memory && tc.RMNEnabled { - return fmt.Errorf("cannot run RMN tests in memory mode") + return errors.New("cannot run RMN tests in memory mode") } return nil } diff --git a/deployment/ccip/changeset/test_helpers.go b/deployment/ccip/changeset/test_helpers.go index 2069030191c..03c3ffb175d 100644 --- a/deployment/ccip/changeset/test_helpers.go +++ b/deployment/ccip/changeset/test_helpers.go @@ -582,7 +582,7 @@ func deploySingleFeed( deployFunc func(deployment.Chain) deployment.ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface], symbol TokenSymbol, ) (common.Address, string, error) { - //tokenTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) + // tokenTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) mockTokenFeed, err := deployment.DeployContract(lggr, chain, ab, deployFunc) if err != nil { lggr.Errorw("Failed to deploy token feed", "err", err, "symbol", symbol) @@ -736,7 +736,7 @@ func deployTokenPoolsInParallel( return nil, nil, nil, nil, err } if srcToken == nil || srcPool == nil || dstToken == nil || dstPool == nil { - return nil, nil, nil, nil, fmt.Errorf("failed to deploy token and pool") + return nil, nil, nil, nil, errors.New("failed to deploy token and pool") } return srcToken, srcPool, dstToken, dstPool, nil } @@ -763,7 +763,7 @@ func setUSDCTokenPoolCounterPart( var fixedAddr [32]byte copy(fixedAddr[:], allowedCaller[:32]) - domain, _ := reader.AllAvailableDomains()[destChainSelector] + domain := reader.AllAvailableDomains()[destChainSelector] domains := []usdc_token_pool.USDCTokenPoolDomainUpdate{ { @@ -917,7 +917,7 @@ func deployTransferTokenOneEnd( big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), ) return deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ - tokenAddress, token, tx, deployment.NewTypeAndVersion(BurnMintToken, deployment.Version1_0_0), err2, + Address: tokenAddress, Contract: token, Tx: tx, Tv: deployment.NewTypeAndVersion(BurnMintToken, deployment.Version1_0_0), Err: err2, } }) if err != nil { @@ -946,7 +946,7 @@ func deployTransferTokenOneEnd( common.HexToAddress(routerAddress), ) return deployment.ContractDeploy[*burn_mint_token_pool.BurnMintTokenPool]{ - tokenPoolAddress, tokenPoolContract, tx, deployment.NewTypeAndVersion(BurnMintTokenPool, deployment.Version1_5_1), err2, + Address: tokenPoolAddress, Contract: tokenPoolContract, Tx: tx, Tv: deployment.NewTypeAndVersion(BurnMintTokenPool, deployment.Version1_5_1), Err: err2, } }) if err != nil { diff --git a/deployment/ccip/changeset/test_usdc_helpers.go b/deployment/ccip/changeset/test_usdc_helpers.go index 55f1bd25a36..c9dd87b866e 100644 --- a/deployment/ccip/changeset/test_usdc_helpers.go +++ b/deployment/ccip/changeset/test_usdc_helpers.go @@ -115,8 +115,8 @@ func UpdateFeeQuoterForUSDC( DestChainSelector: dstChain, TokenTransferFeeConfigs: []fee_quoter.FeeQuoterTokenTransferFeeConfigSingleTokenArgs{ { - usdcToken.Address(), - fee_quoter.FeeQuoterTokenTransferFeeConfig{ + Token: usdcToken.Address(), + TokenTransferFeeConfig: fee_quoter.FeeQuoterTokenTransferFeeConfig{ MinFeeUSDCents: 50, MaxFeeUSDCents: 50_000, DeciBps: 0, diff --git a/deployment/ccip/changeset/v1_5/cs_jobspec.go b/deployment/ccip/changeset/v1_5/cs_jobspec.go index bdb36d531f8..e1cd73f1e30 100644 --- a/deployment/ccip/changeset/v1_5/cs_jobspec.go +++ b/deployment/ccip/changeset/v1_5/cs_jobspec.go @@ -1,6 +1,7 @@ package v1_5 import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment" @@ -41,14 +42,14 @@ func (j JobSpecInput) Validate() error { return fmt.Errorf("DestinationChainSelector is invalid: %w", err) } if j.TokenPricesUSDPipeline == "" && j.PriceGetterConfigJson == "" { - return fmt.Errorf("TokenPricesUSDPipeline or PriceGetterConfigJson is required") + return errors.New("TokenPricesUSDPipeline or PriceGetterConfigJson is required") } if j.USDCCfg != nil { if err := j.USDCCfg.ValidateUSDCConfig(); err != nil { return fmt.Errorf("USDCCfg is invalid: %w", err) } if j.USDCAttestationAPI == "" { - return fmt.Errorf("USDCAttestationAPI is required") + return errors.New("USDCAttestationAPI is required") } } return nil diff --git a/deployment/ccip/view/v1_0/rmn_proxy_contract.go b/deployment/ccip/view/v1_0/rmn_proxy_contract.go index 818b9fcac93..5a2ea2807f6 100644 --- a/deployment/ccip/view/v1_0/rmn_proxy_contract.go +++ b/deployment/ccip/view/v1_0/rmn_proxy_contract.go @@ -1,6 +1,7 @@ package v1_0 import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" @@ -16,7 +17,7 @@ type RMNProxyView struct { func GenerateRMNProxyView(r *rmn_proxy_contract.RMNProxy) (RMNProxyView, error) { if r == nil { - return RMNProxyView{}, fmt.Errorf("cannot generate view for nil RMNProxy") + return RMNProxyView{}, errors.New("cannot generate view for nil RMNProxy") } meta, err := types.NewContractMetaData(r, r.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_2/price_registry.go b/deployment/ccip/view/v1_2/price_registry.go index ee0f1067b6c..269c48fccaf 100644 --- a/deployment/ccip/view/v1_2/price_registry.go +++ b/deployment/ccip/view/v1_2/price_registry.go @@ -1,6 +1,7 @@ package v1_2 import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" @@ -18,7 +19,7 @@ type PriceRegistryView struct { func GeneratePriceRegistryView(pr *price_registry_1_2_0.PriceRegistry) (PriceRegistryView, error) { if pr == nil { - return PriceRegistryView{}, fmt.Errorf("cannot generate view for nil PriceRegistry") + return PriceRegistryView{}, errors.New("cannot generate view for nil PriceRegistry") } meta, err := types.NewContractMetaData(pr, pr.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_2/price_registry_test.go b/deployment/ccip/view/v1_2/price_registry_test.go index cbcdbe253ce..8248f55335b 100644 --- a/deployment/ccip/view/v1_2/price_registry_test.go +++ b/deployment/ccip/view/v1_2/price_registry_test.go @@ -29,10 +29,10 @@ func TestGeneratePriceRegistryView(t *testing.T) { v, err := GeneratePriceRegistryView(c) require.NoError(t, err) assert.Equal(t, v.Owner, chain.DeployerKey.From) - assert.Equal(t, v.TypeAndVersion, "PriceRegistry 1.2.0") - assert.Equal(t, v.FeeTokens, []common.Address{f1, f2}) - assert.Equal(t, v.StalenessThreshold, "10") - assert.Equal(t, v.Updaters, []common.Address{chain.DeployerKey.From}) + assert.Equal(t, "PriceRegistry 1.2.0", v.TypeAndVersion) + assert.Equal(t, []common.Address{f1, f2}, v.FeeTokens) + assert.Equal(t, "10", v.StalenessThreshold) + assert.Equal(t, []common.Address{chain.DeployerKey.From}, v.Updaters) _, err = json.MarshalIndent(v, "", " ") require.NoError(t, err) } diff --git a/deployment/ccip/view/v1_5/commit_store.go b/deployment/ccip/view/v1_5/commit_store.go index ffea3b61f5f..396aa8b737a 100644 --- a/deployment/ccip/view/v1_5/commit_store.go +++ b/deployment/ccip/view/v1_5/commit_store.go @@ -1,6 +1,7 @@ package v1_5 import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" @@ -24,7 +25,7 @@ type CommitStoreView struct { func GenerateCommitStoreView(c *commit_store.CommitStore) (CommitStoreView, error) { if c == nil { - return CommitStoreView{}, fmt.Errorf("cannot generate view for nil CommitStore") + return CommitStoreView{}, errors.New("cannot generate view for nil CommitStore") } meta, err := types.NewContractMetaData(c, c.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_5/offramp.go b/deployment/ccip/view/v1_5/offramp.go index 95e40d9da27..95d92c445e4 100644 --- a/deployment/ccip/view/v1_5/offramp.go +++ b/deployment/ccip/view/v1_5/offramp.go @@ -1,6 +1,7 @@ package v1_5 import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment/common/view/types" @@ -15,7 +16,7 @@ type OffRampView struct { func GenerateOffRampView(r *evm_2_evm_offramp.EVM2EVMOffRamp) (OffRampView, error) { if r == nil { - return OffRampView{}, fmt.Errorf("cannot generate view for nil OffRamp") + return OffRampView{}, errors.New("cannot generate view for nil OffRamp") } meta, err := types.NewContractMetaData(r, r.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_5/offramp_test.go b/deployment/ccip/view/v1_5/offramp_test.go index d6539fe2ba5..47370501424 100644 --- a/deployment/ccip/view/v1_5/offramp_test.go +++ b/deployment/ccip/view/v1_5/offramp_test.go @@ -54,7 +54,7 @@ func TestOffRampView(t *testing.T) { v, err := GenerateOffRampView(c2) require.NoError(t, err) assert.Equal(t, v.StaticConfig, sc) - assert.Equal(t, v.TypeAndVersion, "EVM2EVMOffRamp 1.5.0") + assert.Equal(t, "EVM2EVMOffRamp 1.5.0", v.TypeAndVersion) _, err = json.MarshalIndent(v, "", " ") require.NoError(t, err) } diff --git a/deployment/ccip/view/v1_5/onramp.go b/deployment/ccip/view/v1_5/onramp.go index d679f6c14c0..c211c493cbc 100644 --- a/deployment/ccip/view/v1_5/onramp.go +++ b/deployment/ccip/view/v1_5/onramp.go @@ -1,6 +1,7 @@ package v1_5 import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment/common/view/types" @@ -15,7 +16,7 @@ type OnRampView struct { func GenerateOnRampView(r *evm_2_evm_onramp.EVM2EVMOnRamp) (OnRampView, error) { if r == nil { - return OnRampView{}, fmt.Errorf("cannot generate view for nil OnRamp") + return OnRampView{}, errors.New("cannot generate view for nil OnRamp") } meta, err := types.NewContractMetaData(r, r.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_5/onramp_test.go b/deployment/ccip/view/v1_5/onramp_test.go index 4d7ef0225a6..6ce21c9f032 100644 --- a/deployment/ccip/view/v1_5/onramp_test.go +++ b/deployment/ccip/view/v1_5/onramp_test.go @@ -64,8 +64,7 @@ func TestOnRampView(t *testing.T) { // Check a few fields. assert.Equal(t, v.StaticConfig.ChainSelector, chain.Selector) assert.Equal(t, v.DynamicConfig.Router, common.HexToAddress("0x4")) - assert.Equal(t, v.TypeAndVersion, "EVM2EVMOnRamp 1.5.0") + assert.Equal(t, "EVM2EVMOnRamp 1.5.0", v.TypeAndVersion) _, err = json.MarshalIndent(v, "", " ") require.NoError(t, err) - } diff --git a/deployment/ccip/view/v1_5/rmn.go b/deployment/ccip/view/v1_5/rmn.go index cef55460446..19535cf508e 100644 --- a/deployment/ccip/view/v1_5/rmn.go +++ b/deployment/ccip/view/v1_5/rmn.go @@ -1,6 +1,7 @@ package v1_5 import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment/common/view/types" @@ -14,7 +15,7 @@ type RMNView struct { func GenerateRMNView(r *rmn_contract.RMNContract) (RMNView, error) { if r == nil { - return RMNView{}, fmt.Errorf("cannot generate view for nil RMN") + return RMNView{}, errors.New("cannot generate view for nil RMN") } meta, err := types.NewContractMetaData(r, r.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_5/rmn_test.go b/deployment/ccip/view/v1_5/rmn_test.go index 3ec7d7a9cc9..f4ea35a116f 100644 --- a/deployment/ccip/view/v1_5/rmn_test.go +++ b/deployment/ccip/view/v1_5/rmn_test.go @@ -45,8 +45,8 @@ func TestGenerateRMNView(t *testing.T) { v, err := GenerateRMNView(c) require.NoError(t, err) assert.Equal(t, v.Owner, chain.DeployerKey.From) - assert.Equal(t, v.TypeAndVersion, "RMN 1.5.0") - assert.Equal(t, v.ConfigDetails.Version, uint32(1)) + assert.Equal(t, "RMN 1.5.0", v.TypeAndVersion) + assert.Equal(t, uint32(1), v.ConfigDetails.Version) assert.Equal(t, v.ConfigDetails.Config, cfg) _, err = json.MarshalIndent(v, "", " ") require.NoError(t, err) diff --git a/deployment/ccip/view/v1_5/tokenadminregistry.go b/deployment/ccip/view/v1_5/tokenadminregistry.go index 2fd36615bcd..e4a88996247 100644 --- a/deployment/ccip/view/v1_5/tokenadminregistry.go +++ b/deployment/ccip/view/v1_5/tokenadminregistry.go @@ -1,6 +1,7 @@ package v1_5 import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" @@ -20,7 +21,7 @@ type TokenAdminRegistryView struct { func GenerateTokenAdminRegistryView(taContract *token_admin_registry.TokenAdminRegistry) (TokenAdminRegistryView, error) { if taContract == nil { - return TokenAdminRegistryView{}, fmt.Errorf("token admin registry contract is nil") + return TokenAdminRegistryView{}, errors.New("token admin registry contract is nil") } tokens, err := getAllConfiguredTokensPaginated(taContract) if err != nil { diff --git a/deployment/ccip/view/v1_6/ccip_home.go b/deployment/ccip/view/v1_6/ccip_home.go index b188c32c079..04b7dc8c1af 100644 --- a/deployment/ccip/view/v1_6/ccip_home.go +++ b/deployment/ccip/view/v1_6/ccip_home.go @@ -1,6 +1,7 @@ package v1_6 import ( + "errors" "fmt" "math/big" @@ -33,7 +34,7 @@ type CCIPHomeView struct { func GenerateCCIPHomeView(cr *capabilities_registry.CapabilitiesRegistry, ch *ccip_home.CCIPHome) (CCIPHomeView, error) { if ch == nil { - return CCIPHomeView{}, fmt.Errorf("cannot generate view for nil CCIPHome") + return CCIPHomeView{}, errors.New("cannot generate view for nil CCIPHome") } meta, err := types.NewContractMetaData(ch, ch.Address()) if err != nil { diff --git a/deployment/ccip/view/v1_6/ccip_home_test.go b/deployment/ccip/view/v1_6/ccip_home_test.go index 8ea79e8eac3..3d4701d705a 100644 --- a/deployment/ccip/view/v1_6/ccip_home_test.go +++ b/deployment/ccip/view/v1_6/ccip_home_test.go @@ -33,7 +33,7 @@ func TestCCIPHomeView(t *testing.T) { v, err := GenerateCCIPHomeView(cr, ch) require.NoError(t, err) - assert.Equal(t, v.TypeAndVersion, "CCIPHome 1.6.0-dev") + assert.Equal(t, "CCIPHome 1.6.0-dev", v.TypeAndVersion) _, err = json.MarshalIndent(v, "", " ") require.NoError(t, err) diff --git a/deployment/ccip/view/v1_6/rmnhome.go b/deployment/ccip/view/v1_6/rmnhome.go index 82d39074d6f..b05d15bc223 100644 --- a/deployment/ccip/view/v1_6/rmnhome.go +++ b/deployment/ccip/view/v1_6/rmnhome.go @@ -7,6 +7,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/smartcontractkit/chainlink/deployment/common/view/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_home" ) diff --git a/deployment/common/changeset/deploy_link_token.go b/deployment/common/changeset/deploy_link_token.go index c115a7ee083..0c648939c9f 100644 --- a/deployment/common/changeset/deploy_link_token.go +++ b/deployment/common/changeset/deploy_link_token.go @@ -1,7 +1,7 @@ package changeset import ( - "fmt" + "errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -17,7 +17,7 @@ func DeployLinkToken(e deployment.Environment, chains []uint64) (deployment.Chan for _, chain := range chains { _, ok := e.Chains[chain] if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") + return deployment.ChangesetOutput{}, errors.New("chain not found in environment") } } newAddresses := deployment.NewMemoryAddressBook() diff --git a/deployment/common/changeset/example/add_mint_burners_link.go b/deployment/common/changeset/example/add_mint_burners_link.go index 7322f99dd60..d41734519d7 100644 --- a/deployment/common/changeset/example/add_mint_burners_link.go +++ b/deployment/common/changeset/example/add_mint_burners_link.go @@ -18,7 +18,6 @@ var _ deployment.ChangeSet[*AddMintersBurnersLinkConfig] = AddMintersBurnersLink // AddMintersBurnersLink grants the minter / burner role to the provided addresses. func AddMintersBurnersLink(e deployment.Environment, cfg *AddMintersBurnersLinkConfig) (deployment.ChangesetOutput, error) { - chain := e.Chains[cfg.ChainSelector] addresses, err := e.ExistingAddresses.AddressesForChain(cfg.ChainSelector) if err != nil { @@ -66,5 +65,4 @@ func AddMintersBurnersLink(e deployment.Environment, cfg *AddMintersBurnersLinkC } } return deployment.ChangesetOutput{}, nil - } diff --git a/deployment/common/changeset/example/link_transfer.go b/deployment/common/changeset/example/link_transfer.go index 2e3be48a4d1..6253be187c0 100644 --- a/deployment/common/changeset/example/link_transfer.go +++ b/deployment/common/changeset/example/link_transfer.go @@ -135,7 +135,6 @@ func initStatePerChain(cfg *LinkTransferConfig, e deployment.Environment) ( mcmsStatePerChain, err = changeset.MaybeLoadMCMSWithTimelockState(e, chainSelectors) if err != nil { return nil, nil, err - } return linkStatePerChain, mcmsStatePerChain, nil } @@ -160,12 +159,10 @@ func transferOrBuildTx( } } return tx, nil - } // LinkTransfer takes the given link transfers and executes them or creates an MCMS proposal for them. func LinkTransfer(e deployment.Environment, cfg *LinkTransferConfig) (deployment.ChangesetOutput, error) { - err := cfg.Validate(e) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("invalid LinkTransferConfig: %w", err) diff --git a/deployment/common/changeset/example/link_transfer_test.go b/deployment/common/changeset/example/link_transfer_test.go index eecfbd37c95..4cc2bd0880b 100644 --- a/deployment/common/changeset/example/link_transfer_test.go +++ b/deployment/common/changeset/example/link_transfer_test.go @@ -25,7 +25,6 @@ import ( // setupLinkTransferContracts deploys all required contracts for the link transfer tests and returns the updated env. func setupLinkTransferTestEnv(t *testing.T) deployment.Environment { - lggr := logger.TestLogger(t) cfg := memory.MemoryEnvironmentConfig{ Nodes: 1, diff --git a/deployment/common/changeset/example/mint_link.go b/deployment/common/changeset/example/mint_link.go index dc50f8a1a27..8a71555928e 100644 --- a/deployment/common/changeset/example/mint_link.go +++ b/deployment/common/changeset/example/mint_link.go @@ -19,7 +19,6 @@ var _ deployment.ChangeSet[*MintLinkConfig] = MintLink // MintLink mints LINK to the provided contract. func MintLink(e deployment.Environment, cfg *MintLinkConfig) (deployment.ChangesetOutput, error) { - chain := e.Chains[cfg.ChainSelector] addresses, err := e.ExistingAddresses.AddressesForChain(cfg.ChainSelector) if err != nil { @@ -39,5 +38,4 @@ func MintLink(e deployment.Environment, cfg *MintLinkConfig) (deployment.Changes return deployment.ChangesetOutput{}, err } return deployment.ChangesetOutput{}, nil - } diff --git a/deployment/common/changeset/internal/mcms.go b/deployment/common/changeset/internal/mcms.go index baa82d77c8f..61808e1cbbd 100644 --- a/deployment/common/changeset/internal/mcms.go +++ b/deployment/common/changeset/internal/mcms.go @@ -27,7 +27,7 @@ func DeployMCMSWithConfig( chain.Client, ) return deployment.ContractDeploy[*owner_helpers.ManyChainMultiSig]{ - mcmAddr, mcm, tx, deployment.NewTypeAndVersion(contractType, deployment.Version1_0_0), err2, + Address: mcmAddr, Contract: mcm, Tx: tx, Tv: deployment.NewTypeAndVersion(contractType, deployment.Version1_0_0), Err: err2, } }) if err != nil { @@ -115,7 +115,7 @@ func DeployMCMSWithTimelockContracts( []common.Address{bypasser.Address}, // bypassers ) return deployment.ContractDeploy[*owner_helpers.RBACTimelock]{ - timelock, cc, tx2, deployment.NewTypeAndVersion(types.RBACTimelock, deployment.Version1_0_0), err2, + Address: timelock, Contract: cc, Tx: tx2, Tv: deployment.NewTypeAndVersion(types.RBACTimelock, deployment.Version1_0_0), Err: err2, } }) if err != nil { @@ -131,7 +131,7 @@ func DeployMCMSWithTimelockContracts( timelock.Address, ) return deployment.ContractDeploy[*owner_helpers.CallProxy]{ - callProxy, cc, tx2, deployment.NewTypeAndVersion(types.CallProxy, deployment.Version1_0_0), err2, + Address: callProxy, Contract: cc, Tx: tx2, Tv: deployment.NewTypeAndVersion(types.CallProxy, deployment.Version1_0_0), Err: err2, } }) if err != nil { diff --git a/deployment/common/changeset/save_existing.go b/deployment/common/changeset/save_existing.go index a5177c8e49b..57e53607cdc 100644 --- a/deployment/common/changeset/save_existing.go +++ b/deployment/common/changeset/save_existing.go @@ -30,13 +30,13 @@ func (cfg ExistingContractsConfig) Validate() error { return fmt.Errorf("invalid chain selector: %d - %w", ec.ChainSelector, err) } if ec.Address == (common.Address{}) { - return fmt.Errorf("address must be set") + return errors.New("address must be set") } if ec.TypeAndVersion.Type == "" { - return fmt.Errorf("type must be set") + return errors.New("type must be set") } if val, err := ec.TypeAndVersion.Version.Value(); err != nil || val == "" { - return fmt.Errorf("version must be set") + return errors.New("version must be set") } } return nil diff --git a/deployment/common/changeset/set_config_mcms.go b/deployment/common/changeset/set_config_mcms.go index 3ba5d2db4b6..5e2dc718b95 100644 --- a/deployment/common/changeset/set_config_mcms.go +++ b/deployment/common/changeset/set_config_mcms.go @@ -192,7 +192,6 @@ func SetConfigMCMS(e deployment.Environment, cfg MCMSConfig) (deployment.Changes batch := addTxsToProposalBatch(setConfigTxsChain, chainSelector, *state) batches = append(batches, batch) } - } if useMCMS { diff --git a/deployment/common/changeset/set_config_mcms_test.go b/deployment/common/changeset/set_config_mcms_test.go index 7220bdd755a..207b37c00f3 100644 --- a/deployment/common/changeset/set_config_mcms_test.go +++ b/deployment/common/changeset/set_config_mcms_test.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/config" chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -24,7 +25,6 @@ import ( // setupSetConfigTestEnv deploys all required contracts for the setConfig MCMS contract call. func setupSetConfigTestEnv(t *testing.T) deployment.Environment { - lggr := logger.TestLogger(t) cfg := memory.MemoryEnvironmentConfig{ Nodes: 1, @@ -53,7 +53,6 @@ func setupSetConfigTestEnv(t *testing.T) deployment.Environment { // TestSetConfigMCMSVariants tests the SetConfigMCMS changeset variants. func TestSetConfigMCMSVariants(t *testing.T) { - // Add the timelock as a signer to check state changes for _, tc := range []struct { name string @@ -62,7 +61,6 @@ func TestSetConfigMCMSVariants(t *testing.T) { { name: "MCMS disabled", changeSets: func(mcmsState *commonchangeset.MCMSWithTimelockState, chainSel uint64, cfgProp, cfgCancel, cfgBypass config.Config) []commonchangeset.ChangesetApplication { - return []commonchangeset.ChangesetApplication{ { Changeset: commonchangeset.WrapChangeSet(commonchangeset.SetConfigMCMS), diff --git a/deployment/common/changeset/test_helpers.go b/deployment/common/changeset/test_helpers.go index e92b36e5b55..5d524e542ad 100644 --- a/deployment/common/changeset/test_helpers.go +++ b/deployment/common/changeset/test_helpers.go @@ -5,6 +5,7 @@ import ( "testing" mapset "github.com/deckarep/golang-set/v2" + jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" diff --git a/deployment/common/changeset/transfer_to_mcms_with_timelock.go b/deployment/common/changeset/transfer_to_mcms_with_timelock.go index 45efccefd2e..ab0883cc9a7 100644 --- a/deployment/common/changeset/transfer_to_mcms_with_timelock.go +++ b/deployment/common/changeset/transfer_to_mcms_with_timelock.go @@ -36,11 +36,11 @@ func LoadOwnableContract(addr common.Address, client bind.ContractBackend) (comm // Just using the ownership interface from here. c, err := burn_mint_erc677.NewBurnMintERC677(addr, client) if err != nil { - return common.Address{}, nil, fmt.Errorf("failed to create contract: %v", err) + return common.Address{}, nil, fmt.Errorf("failed to create contract: %w", err) } owner, err := c.Owner(nil) if err != nil { - return common.Address{}, nil, fmt.Errorf("failed to get owner of contract: %v", err) + return common.Address{}, nil, fmt.Errorf("failed to get owner of contract: %w", err) } return owner, c, nil } @@ -52,13 +52,13 @@ func (t TransferToMCMSWithTimelockConfig) Validate(e deployment.Environment) err // Note this also assures non-zero addresses. if exists, err := deployment.AddressBookContains(e.ExistingAddresses, chainSelector, contract.String()); err != nil || !exists { if err != nil { - return fmt.Errorf("failed to check address book: %v", err) + return fmt.Errorf("failed to check address book: %w", err) } return fmt.Errorf("contract %s not found in address book", contract) } owner, _, err := LoadOwnableContract(contract, e.Chains[chainSelector].Client) if err != nil { - return fmt.Errorf("failed to load ownable: %v", err) + return fmt.Errorf("failed to load ownable: %w", err) } if owner != e.Chains[chainSelector].DeployerKey.From { return fmt.Errorf("contract %s is not owned by the deployer key", contract) @@ -66,10 +66,10 @@ func (t TransferToMCMSWithTimelockConfig) Validate(e deployment.Environment) err } // If there is no timelock and mcms proposer on the chain, the transfer will fail. if _, err := deployment.SearchAddressBook(e.ExistingAddresses, chainSelector, types.RBACTimelock); err != nil { - return fmt.Errorf("timelock not present on the chain %v", err) + return fmt.Errorf("timelock not present on the chain %w", err) } if _, err := deployment.SearchAddressBook(e.ExistingAddresses, chainSelector, types.ProposerManyChainMultisig); err != nil { - return fmt.Errorf("mcms proposer not present on the chain %v", err) + return fmt.Errorf("mcms proposer not present on the chain %w", err) } } @@ -101,7 +101,7 @@ func TransferToMCMSWithTimelock( timelocksByChain[chainSelector] = common.HexToAddress(timelockAddr) proposer, err := owner_helpers.NewManyChainMultiSig(common.HexToAddress(proposerAddr), e.Chains[chainSelector].Client) if err != nil { - return deployment.ChangesetOutput{}, fmt.Errorf("failed to create proposer mcms: %v", err) + return deployment.ChangesetOutput{}, fmt.Errorf("failed to create proposer mcms: %w", err) } proposersByChain[chainSelector] = proposer @@ -118,7 +118,7 @@ func TransferToMCMSWithTimelock( tx, err := c.TransferOwnership(e.Chains[chainSelector].DeployerKey, common.HexToAddress(timelockAddr)) _, err = deployment.ConfirmIfNoError(e.Chains[chainSelector], tx, err) if err != nil { - return deployment.ChangesetOutput{}, fmt.Errorf("failed to transfer ownership of contract %T: %v", contract, err) + return deployment.ChangesetOutput{}, fmt.Errorf("failed to transfer ownership of contract %T: %w", contract, err) } tx, err = c.AcceptOwnership(deployment.SimTransactOpts()) if err != nil { diff --git a/deployment/common/proposalutils/mcms_helpers.go b/deployment/common/proposalutils/mcms_helpers.go index 51a720a4389..8b7153e526b 100644 --- a/deployment/common/proposalutils/mcms_helpers.go +++ b/deployment/common/proposalutils/mcms_helpers.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" owner_helpers "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/types" @@ -76,21 +77,21 @@ type RunTimelockExecutorConfig struct { func (cfg RunTimelockExecutorConfig) Validate() error { if cfg.Executor == nil { - return fmt.Errorf("executor is nil") + return errors.New("executor is nil") } if cfg.TimelockContracts == nil { - return fmt.Errorf("timelock contracts is nil") + return errors.New("timelock contracts is nil") } if cfg.ChainSelector == 0 { - return fmt.Errorf("chain selector is 0") + return errors.New("chain selector is 0") } if cfg.BlockStart != nil && cfg.BlockEnd == nil { if *cfg.BlockStart > *cfg.BlockEnd { - return fmt.Errorf("block start is greater than block end") + return errors.New("block start is greater than block end") } } if cfg.BlockStart == nil && cfg.BlockEnd != nil { - return fmt.Errorf("block start must not be nil when block end is not nil") + return errors.New("block start must not be nil when block end is not nil") } if len(cfg.Executor.Operations[mcms.ChainIdentifier(cfg.ChainSelector)]) == 0 { diff --git a/deployment/common/proposalutils/propose.go b/deployment/common/proposalutils/propose.go index baf506cb2f8..874bbecbdb8 100644 --- a/deployment/common/proposalutils/propose.go +++ b/deployment/common/proposalutils/propose.go @@ -1,6 +1,7 @@ package proposalutils import ( + "errors" "fmt" "time" @@ -15,7 +16,6 @@ const ( DefaultValidUntil = 72 * time.Hour ) - func BuildProposalMetadata( chainSelectors []uint64, proposerMcmsesPerChain map[uint64]*gethwrappers.ManyChainMultiSig, @@ -55,7 +55,7 @@ func BuildProposalFromBatches( minDelay time.Duration, ) (*timelock.MCMSWithTimelockProposal, error) { if len(batches) == 0 { - return nil, fmt.Errorf("no operations in batch") + return nil, errors.New("no operations in batch") } chains := mapset.NewSet[uint64]() diff --git a/deployment/common/types/types.go b/deployment/common/types/types.go index 0f04421af43..c86fb3e9887 100644 --- a/deployment/common/types/types.go +++ b/deployment/common/types/types.go @@ -1,7 +1,7 @@ package types import ( - "fmt" + "errors" "math/big" "time" @@ -52,40 +52,40 @@ type OCRParameters struct { func (params OCRParameters) Validate() error { if params.DeltaProgress <= 0 { - return fmt.Errorf("deltaProgress must be positive") + return errors.New("deltaProgress must be positive") } if params.DeltaResend <= 0 { - return fmt.Errorf("deltaResend must be positive") + return errors.New("deltaResend must be positive") } if params.DeltaInitial <= 0 { - return fmt.Errorf("deltaInitial must be positive") + return errors.New("deltaInitial must be positive") } if params.DeltaRound <= 0 { - return fmt.Errorf("deltaRound must be positive") + return errors.New("deltaRound must be positive") } if params.DeltaGrace <= 0 { - return fmt.Errorf("deltaGrace must be positive") + return errors.New("deltaGrace must be positive") } if params.DeltaCertifiedCommitRequest <= 0 { - return fmt.Errorf("deltaCertifiedCommitRequest must be positive") + return errors.New("deltaCertifiedCommitRequest must be positive") } if params.DeltaStage <= 0 { - return fmt.Errorf("deltaStage must be positive") + return errors.New("deltaStage must be positive") } if params.Rmax <= 0 { - return fmt.Errorf("rmax must be positive") + return errors.New("rmax must be positive") } if params.MaxDurationQuery <= 0 { - return fmt.Errorf("maxDurationQuery must be positive") + return errors.New("maxDurationQuery must be positive") } if params.MaxDurationObservation <= 0 { - return fmt.Errorf("maxDurationObservation must be positive") + return errors.New("maxDurationObservation must be positive") } if params.MaxDurationShouldAcceptAttestedReport <= 0 { - return fmt.Errorf("maxDurationShouldAcceptAttestedReport must be positive") + return errors.New("maxDurationShouldAcceptAttestedReport must be positive") } if params.MaxDurationShouldTransmitAcceptedReport <= 0 { - return fmt.Errorf("maxDurationShouldTransmitAcceptedReport must be positive") + return errors.New("maxDurationShouldTransmitAcceptedReport must be positive") } return nil } diff --git a/deployment/common/view/nops.go b/deployment/common/view/nops.go index 61e16d59145..74f011dfe44 100644 --- a/deployment/common/view/nops.go +++ b/deployment/common/view/nops.go @@ -2,9 +2,11 @@ package view import ( "context" + "encoding/hex" "fmt" "github.com/pkg/errors" + nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink/deployment" @@ -62,11 +64,11 @@ func GenerateNopsView(nodeIds []string, oc deployment.OffchainClient) (map[strin } for details, ocrConfig := range node.SelToOCRConfig { nop.OCRKeys[details.ChainName] = OCRKeyView{ - OffchainPublicKey: fmt.Sprintf("%x", ocrConfig.OffchainPublicKey[:]), + OffchainPublicKey: hex.EncodeToString(ocrConfig.OffchainPublicKey[:]), OnchainPublicKey: fmt.Sprintf("%x", ocrConfig.OnchainPublicKey[:]), PeerID: ocrConfig.PeerID.String(), TransmitAccount: string(ocrConfig.TransmitAccount), - ConfigEncryptionPublicKey: fmt.Sprintf("%x", ocrConfig.ConfigEncryptionPublicKey[:]), + ConfigEncryptionPublicKey: hex.EncodeToString(ocrConfig.ConfigEncryptionPublicKey[:]), KeyBundleID: ocrConfig.KeyBundleID, } } diff --git a/deployment/common/view/v1_0/capreg_test.go b/deployment/common/view/v1_0/capreg_test.go index 15fe23be00e..eb7c8a83bd4 100644 --- a/deployment/common/view/v1_0/capreg_test.go +++ b/deployment/common/view/v1_0/capreg_test.go @@ -149,7 +149,7 @@ func TestCapRegView_Denormalize(t *testing.T) { {Name: "third nop"}, }, Capabilities: []CapabilityView{ - //capabilities for don1 + // capabilities for don1 NewCapabilityView(cr.CapabilitiesRegistryCapabilityInfo{ HashedId: [32]byte{0: 1}, LabelledName: "cap1", @@ -161,7 +161,7 @@ func TestCapRegView_Denormalize(t *testing.T) { Version: "1.0.0", }), - //capabilities for don2 + // capabilities for don2 NewCapabilityView(cr.CapabilitiesRegistryCapabilityInfo{ HashedId: [32]byte{2: 2}, // matches don ID 2, capabitility ID 1 LabelledName: "other cap", diff --git a/deployment/common/view/v1_0/link_token.go b/deployment/common/view/v1_0/link_token.go index 6dd1a00be3b..2d345f1fd3c 100644 --- a/deployment/common/view/v1_0/link_token.go +++ b/deployment/common/view/v1_0/link_token.go @@ -44,8 +44,8 @@ func GenerateLinkTokenView(lt *link_token.LinkToken) (LinkTokenView, error) { return LinkTokenView{ ContractMetaData: types.ContractMetaData{ TypeAndVersion: deployment.TypeAndVersion{ - commontypes.LinkToken, - deployment.Version1_0_0, + Type: commontypes.LinkToken, + Version: deployment.Version1_0_0, }.String(), Address: lt.Address(), Owner: owner, diff --git a/deployment/common/view/v1_0/link_token_test.go b/deployment/common/view/v1_0/link_token_test.go index c83c0b3e3c2..735d7789169 100644 --- a/deployment/common/view/v1_0/link_token_test.go +++ b/deployment/common/view/v1_0/link_token_test.go @@ -26,12 +26,12 @@ func TestLinkTokenView(t *testing.T) { require.NoError(t, err) assert.Equal(t, v.Owner, chain.DeployerKey.From) - assert.Equal(t, v.TypeAndVersion, "LinkToken 1.0.0") - assert.Equal(t, v.Decimals, uint8(18)) + assert.Equal(t, "LinkToken 1.0.0", v.TypeAndVersion) + assert.Equal(t, uint8(18), v.Decimals) // Initially nothing minted and no minters/burners. - assert.Equal(t, v.Supply.String(), "0") - require.Len(t, v.Minters, 0) - require.Len(t, v.Burners, 0) + assert.Equal(t, "0", v.Supply.String()) + require.Empty(t, v.Minters) + require.Empty(t, v.Burners) // Add some minters tx, err = lt.GrantMintAndBurnRoles(chain.DeployerKey, chain.DeployerKey.From) @@ -45,7 +45,7 @@ func TestLinkTokenView(t *testing.T) { v, err = GenerateLinkTokenView(lt) require.NoError(t, err) - assert.Equal(t, v.Supply.String(), "100") + assert.Equal(t, "100", v.Supply.String()) require.Len(t, v.Minters, 1) require.Equal(t, v.Minters[0].String(), chain.DeployerKey.From.String()) require.Len(t, v.Burners, 1) diff --git a/deployment/common/view/v1_0/static_link_token.go b/deployment/common/view/v1_0/static_link_token.go index 525f1a9f0c5..2c9c60531b2 100644 --- a/deployment/common/view/v1_0/static_link_token.go +++ b/deployment/common/view/v1_0/static_link_token.go @@ -28,8 +28,8 @@ func GenerateStaticLinkTokenView(lt *link_token_interface.LinkToken) (StaticLink return StaticLinkTokenView{ ContractMetaData: types.ContractMetaData{ TypeAndVersion: deployment.TypeAndVersion{ - commontypes.StaticLinkToken, - deployment.Version1_0_0, + Type: commontypes.StaticLinkToken, + Version: deployment.Version1_0_0, }.String(), Address: lt.Address(), // No owner. diff --git a/deployment/common/view/v1_0/static_link_token_test.go b/deployment/common/view/v1_0/static_link_token_test.go index 517efac9438..b276a80fb2e 100644 --- a/deployment/common/view/v1_0/static_link_token_test.go +++ b/deployment/common/view/v1_0/static_link_token_test.go @@ -26,7 +26,7 @@ func TestStaticLinkTokenView(t *testing.T) { require.NoError(t, err) assert.Equal(t, v.Owner, common.HexToAddress("0x0")) // Ownerless - assert.Equal(t, v.TypeAndVersion, "StaticLinkToken 1.0.0") - assert.Equal(t, v.Decimals, uint8(18)) - assert.Equal(t, v.Supply.String(), "1000000000000000000000000000") + assert.Equal(t, "StaticLinkToken 1.0.0", v.TypeAndVersion) + assert.Equal(t, uint8(18), v.Decimals) + assert.Equal(t, "1000000000000000000000000000", v.Supply.String()) } diff --git a/deployment/environment.go b/deployment/environment.go index bfbeac2f0c4..6fc28fac764 100644 --- a/deployment/environment.go +++ b/deployment/environment.go @@ -7,6 +7,7 @@ import ( "fmt" "math/big" "sort" + "strconv" "strings" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -75,7 +76,7 @@ func (c Chain) Name() string { panic(err) } if chainInfo.ChainName == "" { - return fmt.Sprintf("%d", c.Selector) + return strconv.FormatUint(c.Selector, 10) } return chainInfo.ChainName } diff --git a/deployment/environment/crib/types.go b/deployment/environment/crib/types.go index d19c8424443..99baf8e8774 100644 --- a/deployment/environment/crib/types.go +++ b/deployment/environment/crib/types.go @@ -2,6 +2,7 @@ package crib import ( "context" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/environment/devenv" diff --git a/deployment/environment/devenv/chain.go b/deployment/environment/devenv/chain.go index 5c6c4336ed7..265a6647050 100644 --- a/deployment/environment/devenv/chain.go +++ b/deployment/environment/devenv/chain.go @@ -2,6 +2,7 @@ package devenv import ( "context" + "errors" "fmt" "math/big" "time" @@ -39,7 +40,7 @@ func (c *ChainConfig) SetUsers(pvtkeys []string) error { c.Users = []*bind.TransactOpts{c.DeployerKey} return nil } else { - return fmt.Errorf("no private keys provided for users, deployer key is also not set") + return errors.New("no private keys provided for users, deployer key is also not set") } } for _, pvtKeyStr := range pvtkeys { diff --git a/deployment/environment/devenv/don.go b/deployment/environment/devenv/don.go index 76f6ee92b68..a132fe72a2f 100644 --- a/deployment/environment/devenv/don.go +++ b/deployment/environment/devenv/don.go @@ -4,14 +4,16 @@ import ( "context" "errors" "fmt" - chainsel "github.com/smartcontractkit/chain-selectors" "strconv" "strings" "time" + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/hashicorp/go-multierror" "github.com/rs/zerolog" "github.com/sethvargo/go-retry" + nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" clclient "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" "github.com/smartcontractkit/chainlink/deployment/environment/web/sdk/client" @@ -395,7 +397,7 @@ func (n *Node) CreateJobDistributor(ctx context.Context, jd JobDistributor) (str // create the job distributor in the node with the csa key resp, err := n.gqlClient.ListJobDistributors(ctx) if err != nil { - return "", fmt.Errorf("could not list job distrubutors: %w", err) + return "", fmt.Errorf("could not list job distributors: %w", err) } if len(resp.FeedsManagers.Results) > 0 { for _, fm := range resp.FeedsManagers.Results { diff --git a/deployment/environment/devenv/don_test.go b/deployment/environment/devenv/don_test.go index f93436f72f5..0e0578f8275 100644 --- a/deployment/environment/devenv/don_test.go +++ b/deployment/environment/devenv/don_test.go @@ -7,7 +7,6 @@ import ( ) func TestPtrVal(t *testing.T) { - x := "hello" xptr := ptr(x) got := value(xptr) diff --git a/deployment/environment/devenv/environment.go b/deployment/environment/devenv/environment.go index 121caea43bb..2fffe6adf2b 100644 --- a/deployment/environment/devenv/environment.go +++ b/deployment/environment/devenv/environment.go @@ -2,6 +2,7 @@ package devenv import ( "context" + "errors" "fmt" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -30,10 +31,10 @@ func NewEnvironment(ctx func() context.Context, lggr logger.Logger, config Envir jd, ok := offChain.(*JobDistributor) if !ok { - return nil, nil, fmt.Errorf("offchain client does not implement JobDistributor") + return nil, nil, errors.New("offchain client does not implement JobDistributor") } if jd == nil { - return nil, nil, fmt.Errorf("offchain client is not set up") + return nil, nil, errors.New("offchain client is not set up") } var nodeIDs []string if jd.don != nil { diff --git a/deployment/environment/devenv/jd.go b/deployment/environment/devenv/jd.go index 818f9b09400..844068e50da 100644 --- a/deployment/environment/devenv/jd.go +++ b/deployment/environment/devenv/jd.go @@ -2,6 +2,7 @@ package devenv import ( "context" + "errors" "fmt" "golang.org/x/oauth2" @@ -121,7 +122,7 @@ func (jd JobDistributor) GetCSAPublicKey(ctx context.Context) (string, error) { return "", err } if keypairs == nil || len(keypairs.Keypairs) == 0 { - return "", fmt.Errorf("no keypairs found") + return "", errors.New("no keypairs found") } csakey := keypairs.Keypairs[0].PublicKey return csakey, nil @@ -138,7 +139,7 @@ func (jd JobDistributor) ProposeJob(ctx context.Context, in *jobv1.ProposeJobReq return nil, fmt.Errorf("failed to propose job. err: %w", err) } if res.Proposal == nil { - return nil, fmt.Errorf("failed to propose job. err: proposal is nil") + return nil, errors.New("failed to propose job. err: proposal is nil") } if jd.don == nil || len(jd.don.Nodes) == 0 { return res, nil diff --git a/deployment/environment/memory/job_client.go b/deployment/environment/memory/job_client.go index a3cfee41608..e44c664b77e 100644 --- a/deployment/environment/memory/job_client.go +++ b/deployment/environment/memory/job_client.go @@ -29,42 +29,42 @@ type JobClient struct { } func (j JobClient) BatchProposeJob(ctx context.Context, in *jobv1.BatchProposeJobRequest, opts ...grpc.CallOption) (*jobv1.BatchProposeJobResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) UpdateJob(ctx context.Context, in *jobv1.UpdateJobRequest, opts ...grpc.CallOption) (*jobv1.UpdateJobResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) DisableNode(ctx context.Context, in *nodev1.DisableNodeRequest, opts ...grpc.CallOption) (*nodev1.DisableNodeResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) EnableNode(ctx context.Context, in *nodev1.EnableNodeRequest, opts ...grpc.CallOption) (*nodev1.EnableNodeResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) RegisterNode(ctx context.Context, in *nodev1.RegisterNodeRequest, opts ...grpc.CallOption) (*nodev1.RegisterNodeResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (j JobClient) UpdateNode(ctx context.Context, in *nodev1.UpdateNodeRequest, opts ...grpc.CallOption) (*nodev1.UpdateNodeResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) GetKeypair(ctx context.Context, in *csav1.GetKeypairRequest, opts ...grpc.CallOption) (*csav1.GetKeypairResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (j JobClient) ListKeypairs(ctx context.Context, in *csav1.ListKeypairsRequest, opts ...grpc.CallOption) (*csav1.ListKeypairsResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } @@ -84,7 +84,7 @@ func (j JobClient) GetNode(ctx context.Context, in *nodev1.GetNodeRequest, opts } func (j JobClient) ListNodes(ctx context.Context, in *nodev1.ListNodesRequest, opts ...grpc.CallOption) (*nodev1.ListNodesResponse, error) { - //TODO CCIP-3108 + // TODO CCIP-3108 include := func(node *nodev1.Node) bool { if in.Filter == nil { return true @@ -273,22 +273,22 @@ func (j JobClient) ListNodeChainConfigs(ctx context.Context, in *nodev1.ListNode } func (j JobClient) GetJob(ctx context.Context, in *jobv1.GetJobRequest, opts ...grpc.CallOption) (*jobv1.GetJobResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) GetProposal(ctx context.Context, in *jobv1.GetProposalRequest, opts ...grpc.CallOption) (*jobv1.GetProposalResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) ListJobs(ctx context.Context, in *jobv1.ListJobsRequest, opts ...grpc.CallOption) (*jobv1.ListJobsResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) ListProposals(ctx context.Context, in *jobv1.ListProposalsRequest, opts ...grpc.CallOption) (*jobv1.ListProposalsResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } @@ -338,12 +338,12 @@ func (j JobClient) ProposeJob(ctx context.Context, in *jobv1.ProposeJobRequest, } func (j JobClient) RevokeJob(ctx context.Context, in *jobv1.RevokeJobRequest, opts ...grpc.CallOption) (*jobv1.RevokeJobResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } func (j JobClient) DeleteJob(ctx context.Context, in *jobv1.DeleteJobRequest, opts ...grpc.CallOption) (*jobv1.DeleteJobResponse, error) { - //TODO CCIP-3108 implement me + // TODO CCIP-3108 implement me panic("implement me") } diff --git a/deployment/environment/nodeclient/chainlink.go b/deployment/environment/nodeclient/chainlink.go index 9b92dd12759..9aed808d5be 100644 --- a/deployment/environment/nodeclient/chainlink.go +++ b/deployment/environment/nodeclient/chainlink.go @@ -7,6 +7,7 @@ import ( "math/big" "net/http" "os" + "strconv" "strings" "sync" "time" @@ -492,7 +493,7 @@ func (c *ChainlinkClient) DeleteP2PKey(id int) (*http.Response, error) { c.l.Info().Str(NodeURL, c.Config.URL).Int("ID", id).Msg("Deleting P2P Key") resp, err := c.APIClient.R(). SetPathParams(map[string]string{ - "id": fmt.Sprint(id), + "id": strconv.Itoa(id), }). Delete("/v2/keys/p2p/{id}") if err != nil { @@ -528,7 +529,7 @@ func (c *ChainlinkClient) UpdateEthKeyMaxGasPriceGWei(keyId string, gWei int) (* "keyId": keyId, }). SetQueryParams(map[string]string{ - "maxGasPriceGWei": fmt.Sprint(gWei), + "maxGasPriceGWei": strconv.Itoa(gWei), }). SetResult(ethKey). Put("/v2/keys/eth/{keyId}") @@ -1031,7 +1032,7 @@ func (c *ChainlinkClient) Profile(profileTime time.Duration, profileFunction fun "reportType": profileReport.Type, }). SetQueryParams(map[string]string{ - "seconds": fmt.Sprint(profileSeconds), + "seconds": strconv.Itoa(profileSeconds), }). Get("/v2/debug/pprof/{reportType}") if err != nil { @@ -1222,10 +1223,10 @@ func (c *ChainlinkClient) ReplayLogPollerFromBlock(fromBlock, evmChainID int64) resp, err := c.APIClient.R(). SetResult(&specObj). SetQueryParams(map[string]string{ - "evmChainID": fmt.Sprint(evmChainID), + "evmChainID": strconv.FormatInt(evmChainID, 10), }). SetPathParams(map[string]string{ - "fromBlock": fmt.Sprint(fromBlock), + "fromBlock": strconv.FormatInt(fromBlock, 10), }). Post("/v2/replay_from_block/{fromBlock}") if err != nil { diff --git a/deployment/environment/web/sdk/client/client.go b/deployment/environment/web/sdk/client/client.go index e0a56b9e642..331376b2e9f 100644 --- a/deployment/environment/web/sdk/client/client.go +++ b/deployment/environment/web/sdk/client/client.go @@ -3,13 +3,15 @@ package client import ( "context" "encoding/json" + "errors" "fmt" - "github.com/Khan/genqlient/graphql" - "github.com/sethvargo/go-retry" "net/http" "strings" "time" + "github.com/Khan/genqlient/graphql" + "github.com/sethvargo/go-retry" + "github.com/smartcontractkit/chainlink/deployment/environment/web/sdk/client/doer" "github.com/smartcontractkit/chainlink/deployment/environment/web/sdk/internal/generated" ) @@ -61,7 +63,7 @@ func New(baseURI string, creds Credentials) (Client, error) { endpoints: ep, credentials: creds, } - + err := retry.Do(context.Background(), retry.WithMaxDuration(10*time.Second, retry.NewFibonacci(2*time.Second)), func(ctx context.Context) error { err := c.login() if err != nil { @@ -87,7 +89,7 @@ func (c *client) FetchCSAPublicKey(ctx context.Context) (*string, error) { return nil, err } if keys == nil || len(keys.CsaKeys.GetResults()) == 0 { - return nil, fmt.Errorf("no CSA keys found") + return nil, errors.New("no CSA keys found") } return &keys.CsaKeys.GetResults()[0].PublicKey, nil } @@ -98,7 +100,7 @@ func (c *client) FetchP2PPeerID(ctx context.Context) (*string, error) { return nil, err } if keys == nil || len(keys.P2pKeys.GetResults()) == 0 { - return nil, fmt.Errorf("no P2P keys found") + return nil, errors.New("no P2P keys found") } return &keys.P2pKeys.GetResults()[0].PeerID, nil } @@ -109,7 +111,7 @@ func (c *client) FetchOCR2KeyBundleID(ctx context.Context, chainType string) (st return "", err } if keyBundles == nil || len(keyBundles.GetOcr2KeyBundles().Results) == 0 { - return "", fmt.Errorf("no ocr2 keybundle found, check if ocr2 is enabled") + return "", errors.New("no ocr2 keybundle found, check if ocr2 is enabled") } for _, keyBundle := range keyBundles.GetOcr2KeyBundles().Results { if keyBundle.ChainType == generated.OCR2ChainType(chainType) { @@ -125,7 +127,7 @@ func (c *client) FetchAccountAddress(ctx context.Context, chainID string) (*stri return nil, err } if keys == nil || len(keys.EthKeys.GetResults()) == 0 { - return nil, fmt.Errorf("no accounts found") + return nil, errors.New("no accounts found") } for _, keyDetail := range keys.EthKeys.GetResults() { if keyDetail.GetChain().Enabled && keyDetail.GetChain().Id == chainID { @@ -141,7 +143,7 @@ func (c *client) FetchKeys(ctx context.Context, chainType string) ([]string, err return nil, err } if keys == nil { - return nil, fmt.Errorf("no accounts found") + return nil, errors.New("no accounts found") } switch generated.OCR2ChainType(chainType) { case generated.OCR2ChainTypeAptos: @@ -183,12 +185,12 @@ func (c *client) GetJobDistributor(ctx context.Context, id string) (generated.Fe return generated.FeedsManagerParts{}, err } if res == nil { - return generated.FeedsManagerParts{}, fmt.Errorf("no feeds manager found") + return generated.FeedsManagerParts{}, errors.New("no feeds manager found") } if success, ok := res.GetFeedsManager().(*generated.GetFeedsManagerFeedsManager); ok { return success.FeedsManagerParts, nil } - return generated.FeedsManagerParts{}, fmt.Errorf("failed to get feeds manager") + return generated.FeedsManagerParts{}, errors.New("failed to get feeds manager") } func (c *client) ListJobDistributors(ctx context.Context) (*generated.ListFeedsManagersResponse, error) { @@ -238,12 +240,12 @@ func (c *client) CreateJobDistributorChainConfig(ctx context.Context, in JobDist return "", err } if res == nil { - return "", fmt.Errorf("failed to create feeds manager chain config") + return "", errors.New("failed to create feeds manager chain config") } if success, ok := res.GetCreateFeedsManagerChainConfig().(*generated.CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess); ok { return success.ChainConfig.Id, nil } - return "", fmt.Errorf("failed to create feeds manager chain config") + return "", errors.New("failed to create feeds manager chain config") } func (c *client) DeleteJobDistributorChainConfig(ctx context.Context, id string) error { @@ -252,12 +254,12 @@ func (c *client) DeleteJobDistributorChainConfig(ctx context.Context, id string) return err } if res == nil { - return fmt.Errorf("failed to delete feeds manager chain config") + return errors.New("failed to delete feeds manager chain config") } if _, ok := res.GetDeleteFeedsManagerChainConfig().(*generated.DeleteFeedsManagerChainConfigDeleteFeedsManagerChainConfigDeleteFeedsManagerChainConfigSuccess); ok { return nil } - return fmt.Errorf("failed to delete feeds manager chain config") + return errors.New("failed to delete feeds manager chain config") } func (c *client) GetJobProposal(ctx context.Context, id string) (*generated.GetJobProposalJobProposal, error) { @@ -266,12 +268,12 @@ func (c *client) GetJobProposal(ctx context.Context, id string) (*generated.GetJ return nil, err } if proposal == nil { - return nil, fmt.Errorf("no job proposal found") + return nil, errors.New("no job proposal found") } if success, ok := proposal.GetJobProposal().(*generated.GetJobProposalJobProposal); ok { return success, nil } - return nil, fmt.Errorf("failed to get job proposal") + return nil, errors.New("failed to get job proposal") } func (c *client) ApproveJobProposalSpec(ctx context.Context, id string, force bool) (*JobProposalApprovalSuccessSpec, error) { @@ -289,7 +291,7 @@ func (c *client) ApproveJobProposalSpec(ctx context.Context, id string, force bo return &cmd, nil } } - return nil, fmt.Errorf("failed to approve job proposal spec") + return nil, errors.New("failed to approve job proposal spec") } func (c *client) CancelJobProposalSpec(ctx context.Context, id string) (*generated.CancelJobProposalSpecResponse, error) { @@ -327,7 +329,7 @@ func (c *client) login() error { cookieHeader := res.Header.Get("Set-Cookie") if cookieHeader == "" { - return fmt.Errorf("no cookie found in header") + return errors.New("no cookie found in header") } c.cookie = strings.Split(cookieHeader, ";")[0] diff --git a/deployment/environment/web/sdk/client/types.go b/deployment/environment/web/sdk/client/types.go index d213ee161c6..9ecc2cc72ea 100644 --- a/deployment/environment/web/sdk/client/types.go +++ b/deployment/environment/web/sdk/client/types.go @@ -3,7 +3,7 @@ package client import ( "bytes" "encoding/json" - "fmt" + "errors" "reflect" ) @@ -47,7 +47,7 @@ type JobProposalApprovalSuccessSpec struct { func DecodeInput(in, out any) error { if reflect.TypeOf(out).Kind() != reflect.Ptr || reflect.ValueOf(out).IsNil() { - return fmt.Errorf("out type must be a non-nil pointer") + return errors.New("out type must be a non-nil pointer") } jsonBytes, err := json.Marshal(in) if err != nil { diff --git a/deployment/evm_kmsclient.go b/deployment/evm_kmsclient.go index b28a3842930..811125827af 100644 --- a/deployment/evm_kmsclient.go +++ b/deployment/evm_kmsclient.go @@ -11,6 +11,7 @@ import ( "os" "github.com/aws/aws-sdk-go/aws/session" + "github.com/pkg/errors" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" @@ -59,10 +60,10 @@ type KMS struct { func NewKMSClient(config KMS) (KMSClient, error) { if config.KmsDeployerKeyId == "" { - return nil, fmt.Errorf("KMS key ID is required") + return nil, errors.New("KMS key ID is required") } if config.KmsDeployerKeyRegion == "" { - return nil, fmt.Errorf("KMS key region is required") + return nil, errors.New("KMS key region is required") } var awsSessionFn AwsSessionFn if config.AwsProfileName != "" { @@ -94,7 +95,7 @@ func (c *EVMKMSClient) GetKMSTransactOpts(ctx context.Context, chainID *big.Int) pubKeyBytes := secp256k1.S256().Marshal(ecdsaPublicKey.X, ecdsaPublicKey.Y) keyAddr := crypto.PubkeyToAddress(*ecdsaPublicKey) if chainID == nil { - return nil, fmt.Errorf("chainID is required") + return nil, errors.New("chainID is required") } signer := types.LatestSignerForChainID(chainID) @@ -195,7 +196,7 @@ func recoverEthSignature(expectedPublicKeyBytes, txHash, r, s []byte) ([]byte, e } if hex.EncodeToString(recoveredPublicKeyBytes) != hex.EncodeToString(expectedPublicKeyBytes) { - return nil, fmt.Errorf("can not reconstruct public key from sig") + return nil, errors.New("can not reconstruct public key from sig") } } @@ -238,15 +239,15 @@ func KMSConfigFromEnvVars() (KMS, error) { var exists bool config.KmsDeployerKeyId, exists = os.LookupEnv("KMS_DEPLOYER_KEY_ID") if !exists { - return config, fmt.Errorf("KMS_DEPLOYER_KEY_ID is required") + return config, errors.New("KMS_DEPLOYER_KEY_ID is required") } config.KmsDeployerKeyRegion, exists = os.LookupEnv("KMS_DEPLOYER_KEY_REGION") if !exists { - return config, fmt.Errorf("KMS_DEPLOYER_KEY_REGION is required") + return config, errors.New("KMS_DEPLOYER_KEY_REGION is required") } config.AwsProfileName, exists = os.LookupEnv("AWS_PROFILE") if !exists { - return config, fmt.Errorf("AWS_PROFILE is required") + return config, errors.New("AWS_PROFILE is required") } return config, nil } diff --git a/deployment/helpers.go b/deployment/helpers.go index 34a2584a544..d8e15d0200d 100644 --- a/deployment/helpers.go +++ b/deployment/helpers.go @@ -132,7 +132,6 @@ func DecodeErr(encodedABI string, err error) error { return fmt.Errorf("failed to decode error '%s' with abi: %w", encErr, parseErr) } return fmt.Errorf("contract error: %s", errStr) - } return fmt.Errorf("cannot decode error with abi: %w", err) } @@ -182,7 +181,7 @@ func DeployContract[C any]( func IsValidChainSelector(cs uint64) error { if cs == 0 { - return fmt.Errorf("chain selector must be set") + return errors.New("chain selector must be set") } _, err := chain_selectors.GetSelectorFamily(cs) if err != nil { diff --git a/deployment/keystone/changeset/append_node_capabilities.go b/deployment/keystone/changeset/append_node_capabilities.go index d558cf39c95..9ae1923d270 100644 --- a/deployment/keystone/changeset/append_node_capabilities.go +++ b/deployment/keystone/changeset/append_node_capabilities.go @@ -1,11 +1,13 @@ package changeset import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" @@ -30,7 +32,7 @@ func AppendNodeCapabilities(env deployment.Environment, req *AppendNodeCapabilit out := deployment.ChangesetOutput{} if req.UseMCMS() { if r.Ops == nil { - return out, fmt.Errorf("expected MCMS operation to be non-nil") + return out, errors.New("expected MCMS operation to be non-nil") } timelocksPerChain := map[uint64]common.Address{ c.Chain.Selector: c.ContractSet.Timelock.Address(), diff --git a/deployment/keystone/changeset/append_node_capabilities_test.go b/deployment/keystone/changeset/append_node_capabilities_test.go index fb2c99ed15e..3cf6081e966 100644 --- a/deployment/keystone/changeset/append_node_capabilities_test.go +++ b/deployment/keystone/changeset/append_node_capabilities_test.go @@ -38,7 +38,7 @@ func TestAppendNodeCapabilities(t *testing.T) { }) newCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) newCapabilities[k] = caps @@ -52,7 +52,7 @@ func TestAppendNodeCapabilities(t *testing.T) { csOut, err := changeset.AppendNodeCapabilities(te.Env, &cfg) require.NoError(t, err) - require.Len(t, csOut.Proposals, 0) + require.Empty(t, csOut.Proposals) require.Nil(t, csOut.AddressBook) validateCapabilityAppends(t, te, newCapabilities) @@ -68,7 +68,7 @@ func TestAppendNodeCapabilities(t *testing.T) { }) newCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) newCapabilities[k] = caps @@ -105,7 +105,6 @@ func TestAppendNodeCapabilities(t *testing.T) { require.NoError(t, err) validateCapabilityAppends(t, te, newCapabilities) }) - } // validateUpdate checks reads nodes from the registry and checks they have the expected updates diff --git a/deployment/keystone/changeset/deploy_consumer.go b/deployment/keystone/changeset/deploy_consumer.go index d94d7ac0adc..5442a21576a 100644 --- a/deployment/keystone/changeset/deploy_consumer.go +++ b/deployment/keystone/changeset/deploy_consumer.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment" @@ -19,7 +20,7 @@ func DeployFeedsConsumer(env deployment.Environment, req *DeployFeedsConsumerReq lggr := env.Logger chain, ok := env.Chains[chainSelector] if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") + return deployment.ChangesetOutput{}, errors.New("chain not found in environment") } ab := deployment.NewMemoryAddressBook() deployResp, err := kslib.DeployFeedsConsumer(chain, ab) diff --git a/deployment/keystone/changeset/deploy_consumer_test.go b/deployment/keystone/changeset/deploy_consumer_test.go index 9a1e8f57da7..e73986b6ecf 100644 --- a/deployment/keystone/changeset/deploy_consumer_test.go +++ b/deployment/keystone/changeset/deploy_consumer_test.go @@ -36,5 +36,5 @@ func TestDeployFeedsConsumer(t *testing.T) { // no feeds consumer registry on chain 1 require.NotEqual(t, registrySel, env.AllChainSelectors()[1]) oaddrs, _ := resp.AddressBook.AddressesForChain(env.AllChainSelectors()[1]) - require.Len(t, oaddrs, 0) + require.Empty(t, oaddrs) } diff --git a/deployment/keystone/changeset/deploy_forwarder.go b/deployment/keystone/changeset/deploy_forwarder.go index 66923140e6a..8a9cdf4d681 100644 --- a/deployment/keystone/changeset/deploy_forwarder.go +++ b/deployment/keystone/changeset/deploy_forwarder.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "maps" "slices" @@ -8,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" @@ -59,7 +61,7 @@ type ConfigureForwardContractsRequest struct { func (r ConfigureForwardContractsRequest) Validate() error { if len(r.WFNodeIDs) == 0 { - return fmt.Errorf("WFNodeIDs must not be empty") + return errors.New("WFNodeIDs must not be empty") } return nil } @@ -96,7 +98,7 @@ func ConfigureForwardContracts(env deployment.Environment, req ConfigureForwardC var out deployment.ChangesetOutput if req.UseMCMS() { if len(r.OpsPerChain) == 0 { - return out, fmt.Errorf("expected MCMS operation to be non-nil") + return out, errors.New("expected MCMS operation to be non-nil") } for chainSelector, op := range r.OpsPerChain { contracts := cresp.ContractSets[chainSelector] diff --git a/deployment/keystone/changeset/deploy_forwarder_test.go b/deployment/keystone/changeset/deploy_forwarder_test.go index ec80a9432b0..40ef0c02aeb 100644 --- a/deployment/keystone/changeset/deploy_forwarder_test.go +++ b/deployment/keystone/changeset/deploy_forwarder_test.go @@ -4,9 +4,8 @@ import ( "fmt" "testing" - "go.uber.org/zap/zapcore" - "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" @@ -65,7 +64,7 @@ func TestConfigureForwarders(t *testing.T) { }) var wfNodes []string - for id, _ := range te.WFNodes { + for id := range te.WFNodes { wfNodes = append(wfNodes, id) } @@ -77,7 +76,7 @@ func TestConfigureForwarders(t *testing.T) { csOut, err := changeset.ConfigureForwardContracts(te.Env, cfg) require.NoError(t, err) require.Nil(t, csOut.AddressBook) - require.Len(t, csOut.Proposals, 0) + require.Empty(t, csOut.Proposals) // check that forwarder // TODO set up a listener to check that the forwarder is configured contractSet := te.ContractSets() @@ -103,7 +102,7 @@ func TestConfigureForwarders(t *testing.T) { }) var wfNodes []string - for id, _ := range te.WFNodes { + for id := range te.WFNodes { wfNodes = append(wfNodes, id) } @@ -134,9 +133,7 @@ func TestConfigureForwarders(t *testing.T) { }, }) require.NoError(t, err) - }) } }) - } diff --git a/deployment/keystone/changeset/deploy_ocr3.go b/deployment/keystone/changeset/deploy_ocr3.go index ba5ea2921d9..75f9b75ecd1 100644 --- a/deployment/keystone/changeset/deploy_ocr3.go +++ b/deployment/keystone/changeset/deploy_ocr3.go @@ -2,6 +2,7 @@ package changeset import ( "encoding/json" + "errors" "fmt" "io" @@ -23,7 +24,7 @@ func DeployOCR3(env deployment.Environment, registryChainSel uint64) (deployment // ocr3 only deployed on registry chain c, ok := env.Chains[registryChainSel] if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") + return deployment.ChangesetOutput{}, errors.New("chain not found in environment") } ocr3Resp, err := kslib.DeployOCR3(c, ab) if err != nil { @@ -74,14 +75,14 @@ func ConfigureOCR3Contract(env deployment.Environment, cfg ConfigureOCR3Config) return deployment.ChangesetOutput{}, fmt.Errorf("failed to write response output: %w", err) } if n != len(b) { - return deployment.ChangesetOutput{}, fmt.Errorf("failed to write all bytes") + return deployment.ChangesetOutput{}, errors.New("failed to write all bytes") } } // does not create any new addresses var out deployment.ChangesetOutput if cfg.UseMCMS() { if resp.Ops == nil { - return out, fmt.Errorf("expected MCMS operation to be non-nil") + return out, errors.New("expected MCMS operation to be non-nil") } r, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ Chains: env.Chains, @@ -109,7 +110,6 @@ func ConfigureOCR3Contract(env deployment.Environment, cfg ConfigureOCR3Config) return out, fmt.Errorf("failed to build proposal: %w", err) } out.Proposals = []timelock.MCMSWithTimelockProposal{*proposal} - } return out, nil } diff --git a/deployment/keystone/changeset/deploy_ocr3_test.go b/deployment/keystone/changeset/deploy_ocr3_test.go index ea984989703..5ede6c5e6c7 100644 --- a/deployment/keystone/changeset/deploy_ocr3_test.go +++ b/deployment/keystone/changeset/deploy_ocr3_test.go @@ -5,11 +5,10 @@ import ( "encoding/json" "testing" - "go.uber.org/zap/zapcore" - "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -43,7 +42,7 @@ func TestDeployOCR3(t *testing.T) { // nothing on chain 1 require.NotEqual(t, registrySel, env.AllChainSelectors()[1]) oaddrs, _ := resp.AddressBook.AddressesForChain(env.AllChainSelectors()[1]) - assert.Len(t, oaddrs, 0) + assert.Empty(t, oaddrs) } func TestConfigureOCR3(t *testing.T) { @@ -55,7 +54,6 @@ func TestConfigureOCR3(t *testing.T) { } t.Run("no mcms", func(t *testing.T) { - te := test.SetupTestEnv(t, test.TestConfig{ WFDonConfig: test.DonConfig{N: 4}, AssetDonConfig: test.DonConfig{N: 4}, @@ -295,5 +293,4 @@ func TestConfigureOCR3(t *testing.T) { }) require.NoError(t, err) }) - } diff --git a/deployment/keystone/changeset/deploy_registry.go b/deployment/keystone/changeset/deploy_registry.go index 2b8342c06dd..f78b6762f9e 100644 --- a/deployment/keystone/changeset/deploy_registry.go +++ b/deployment/keystone/changeset/deploy_registry.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment" @@ -13,7 +14,7 @@ func DeployCapabilityRegistry(env deployment.Environment, registrySelector uint6 lggr := env.Logger chain, ok := env.Chains[registrySelector] if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") + return deployment.ChangesetOutput{}, errors.New("chain not found in environment") } ab := deployment.NewMemoryAddressBook() capabilitiesRegistryResp, err := kslib.DeployCapabilitiesRegistry(chain, ab) diff --git a/deployment/keystone/changeset/deploy_registry_test.go b/deployment/keystone/changeset/deploy_registry_test.go index 9abf357f2a8..713ef897197 100644 --- a/deployment/keystone/changeset/deploy_registry_test.go +++ b/deployment/keystone/changeset/deploy_registry_test.go @@ -34,5 +34,5 @@ func TestDeployCapabilityRegistry(t *testing.T) { // no capabilities registry on chain 1 require.NotEqual(t, registrySel, env.AllChainSelectors()[1]) oaddrs, _ := resp.AddressBook.AddressesForChain(env.AllChainSelectors()[1]) - require.Len(t, oaddrs, 0) + require.Empty(t, oaddrs) } diff --git a/deployment/keystone/changeset/internal/append_node_capabilities.go b/deployment/keystone/changeset/internal/append_node_capabilities.go index 32fe8572da3..c6379fd24fd 100644 --- a/deployment/keystone/changeset/internal/append_node_capabilities.go +++ b/deployment/keystone/changeset/internal/append_node_capabilities.go @@ -1,6 +1,7 @@ package internal import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -20,10 +21,10 @@ type AppendNodeCapabilitiesRequest struct { func (req *AppendNodeCapabilitiesRequest) Validate() error { if len(req.P2pToCapabilities) == 0 { - return fmt.Errorf("p2pToCapabilities is empty") + return errors.New("p2pToCapabilities is empty") } if req.ContractSet.CapabilitiesRegistry == nil { - return fmt.Errorf("registry is nil") + return errors.New("registry is nil") } return nil } diff --git a/deployment/keystone/changeset/internal/capability_management.go b/deployment/keystone/changeset/internal/capability_management.go index 268b4fd0d01..d85c3f0dfff 100644 --- a/deployment/keystone/changeset/internal/capability_management.go +++ b/deployment/keystone/changeset/internal/capability_management.go @@ -6,6 +6,7 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" diff --git a/deployment/keystone/changeset/internal/contract_set.go b/deployment/keystone/changeset/internal/contract_set.go index e60f37d6f76..540ab80097b 100644 --- a/deployment/keystone/changeset/internal/contract_set.go +++ b/deployment/keystone/changeset/internal/contract_set.go @@ -108,7 +108,6 @@ func DeployFeedsConsumer(chain deployment.Chain, ab deployment.AddressBook) (*De } err = ab.Save(chain.Selector, consumerResp.Address.String(), consumerResp.Tv) if err != nil { - return nil, fmt.Errorf("failed to save FeedsConsumer: %w", err) } return consumerResp, nil diff --git a/deployment/keystone/changeset/internal/deploy.go b/deployment/keystone/changeset/internal/deploy.go index acaabd22131..b52d269518d 100644 --- a/deployment/keystone/changeset/internal/deploy.go +++ b/deployment/keystone/changeset/internal/deploy.go @@ -19,6 +19,7 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink/deployment" "google.golang.org/protobuf/proto" @@ -187,7 +188,7 @@ func GetRegistryContract(e *deployment.Environment, registryChainSel uint64) (*c } registry = registryChainContracts.CapabilitiesRegistry if registry == nil { - return nil, deployment.Chain{}, fmt.Errorf("no registry contract found") + return nil, deployment.Chain{}, errors.New("no registry contract found") } e.Logger.Debugf("registry contract address: %s, chain %d", registry.Address().String(), registryChainSel) return registry, registryChain, nil @@ -409,7 +410,6 @@ func ConfigureOCR3ContractFromJD(env *deployment.Environment, cfg ConfigureOCR3C OCR2OracleConfig: r.ocrConfig, Ops: r.ops, }, nil - } type RegisterCapabilitiesRequest struct { @@ -445,7 +445,7 @@ func FromCapabilitiesRegistryCapability(cap *capabilities_registry.CapabilitiesR // RegisterCapabilities add computes the capability id, adds it to the registry and associates the registered capabilities with appropriate don(s) func RegisterCapabilities(lggr logger.Logger, req RegisterCapabilitiesRequest) (*RegisterCapabilitiesResponse, error) { if len(req.DonToCapabilities) == 0 { - return nil, fmt.Errorf("no capabilities to register") + return nil, errors.New("no capabilities to register") } cresp, err := GetContractSets(req.Env.Logger, &GetContractSetsRequest{ Chains: req.Env.Chains, @@ -891,7 +891,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes return nil, fmt.Errorf("failed to call GetDONs: %w", err) } if !foundAll { - return nil, fmt.Errorf("did not find all desired DONS") + return nil, errors.New("did not find all desired DONS") } resp := RegisterDonsResponse{ @@ -903,7 +903,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes lggr.Debugw("irrelevant DON found in the registry, ignoring", "p2p sorted hash", sortedHash(donInfo.NodeP2PIds)) continue } - lggr.Debugw("adding don info to the reponse (keyed by DON name)", "don", donName) + lggr.Debugw("adding don info to the response (keyed by DON name)", "don", donName) resp.DonInfos[donName] = donInfos[i] } return &resp, nil diff --git a/deployment/keystone/changeset/internal/forwarder_deployer.go b/deployment/keystone/changeset/internal/forwarder_deployer.go index 2ce3ae88146..6e374e200d7 100644 --- a/deployment/keystone/changeset/internal/forwarder_deployer.go +++ b/deployment/keystone/changeset/internal/forwarder_deployer.go @@ -5,6 +5,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" diff --git a/deployment/keystone/changeset/internal/ocr3_deployer.go b/deployment/keystone/changeset/internal/ocr3_deployer.go index beafe9bb9e2..35e75b5ec43 100644 --- a/deployment/keystone/changeset/internal/ocr3_deployer.go +++ b/deployment/keystone/changeset/internal/ocr3_deployer.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" diff --git a/deployment/keystone/changeset/internal/ocr3config.go b/deployment/keystone/changeset/internal/ocr3config.go index 74f8a9dabd5..d1d2e337efb 100644 --- a/deployment/keystone/changeset/internal/ocr3config.go +++ b/deployment/keystone/changeset/internal/ocr3config.go @@ -222,7 +222,7 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets deployment.OCR for index := range nca { identities = append(identities, confighelper.OracleIdentityExtra{ OracleIdentity: confighelper.OracleIdentity{ - OnchainPublicKey: onchainPubKeys[index][:], + OnchainPublicKey: onchainPubKeys[index], OffchainPublicKey: offchainPubKeysBytes[index], PeerID: nca[index].P2PPeerID, TransmitAccount: types.Account(nca[index].EthAddress), @@ -303,7 +303,7 @@ type configureOCR3Response struct { func configureOCR3contract(req configureOCR3Request) (*configureOCR3Response, error) { if req.contract == nil { - return nil, fmt.Errorf("OCR3 contract is nil") + return nil, errors.New("OCR3 contract is nil") } ocrConfig, err := req.generateOCR3Config() if err != nil { diff --git a/deployment/keystone/changeset/internal/ocr3config_test.go b/deployment/keystone/changeset/internal/ocr3config_test.go index b412a727eb9..55769fdaece 100644 --- a/deployment/keystone/changeset/internal/ocr3config_test.go +++ b/deployment/keystone/changeset/internal/ocr3config_test.go @@ -115,7 +115,7 @@ func loadTestData(t *testing.T, path string) []deployment.Node { // in general we can map from the view to the node, but we know the test data var nodes []deployment.Node - //for _, nv := range nodeViews { + // for _, nv := range nodeViews { for _, name := range names { nv := nodeViews[name] node := deployment.Node{ diff --git a/deployment/keystone/changeset/internal/types.go b/deployment/keystone/changeset/internal/types.go index 173e3ba1ad0..cffd69f85e6 100644 --- a/deployment/keystone/changeset/internal/types.go +++ b/deployment/keystone/changeset/internal/types.go @@ -1,6 +1,7 @@ package internal import ( + "encoding/hex" "errors" "fmt" "slices" @@ -14,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + capabilities_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) @@ -81,9 +82,9 @@ func toNodeKeys(o *deployment.Node, registryChainSel uint64) NodeKeys { EthAddress: string(evmCC.TransmitAccount), P2PPeerID: strings.TrimPrefix(o.PeerID.String(), "p2p_"), OCR2BundleID: evmCC.KeyBundleID, - OCR2OffchainPublicKey: fmt.Sprintf("%x", evmCC.OffchainPublicKey[:]), + OCR2OffchainPublicKey: hex.EncodeToString(evmCC.OffchainPublicKey[:]), OCR2OnchainPublicKey: fmt.Sprintf("%x", evmCC.OnchainPublicKey[:]), - OCR2ConfigPublicKey: fmt.Sprintf("%x", evmCC.ConfigEncryptionPublicKey[:]), + OCR2ConfigPublicKey: hex.EncodeToString(evmCC.ConfigEncryptionPublicKey[:]), CSAPublicKey: o.CSAKey, // default value of encryption public key is the CSA public key // TODO: DEVSVCS-760 @@ -266,7 +267,7 @@ func NewRegisteredDon(env deployment.Environment, cfg RegisteredDonConfig) (*Reg } } if don == nil { - return nil, fmt.Errorf("don not found in registry") + return nil, errors.New("don not found in registry") } return &RegisteredDon{ Name: cfg.Name, @@ -286,11 +287,10 @@ func (d RegisteredDon) Signers(chainFamily string) []common.Address { } var found bool var registryChainDetails chainsel.ChainDetails - for details, _ := range n.SelToOCRConfig { + for details := range n.SelToOCRConfig { if family, err := chainsel.GetSelectorFamily(details.ChainSelector); err == nil && family == chainFamily { found = true registryChainDetails = details - } } if !found { @@ -319,7 +319,6 @@ func joinInfoAndNodes(donInfos map[string]kcr.CapabilitiesRegistryDONInfo, dons } var out []RegisteredDon for donName, info := range donInfos { - ocr2nodes, ok := nodes[donName] if !ok { return nil, fmt.Errorf("nodes not found for don %s", donName) diff --git a/deployment/keystone/changeset/internal/types_test.go b/deployment/keystone/changeset/internal/types_test.go index cfc953d6126..e8d02f51df0 100644 --- a/deployment/keystone/changeset/internal/types_test.go +++ b/deployment/keystone/changeset/internal/types_test.go @@ -10,10 +10,11 @@ import ( "github.com/ethereum/go-ethereum/common" chainsel "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func Test_toNodeKeys(t *testing.T) { @@ -49,7 +50,7 @@ func Test_toNodeKeys(t *testing.T) { SelToOCRConfig: map[chainsel.ChainDetails]deployment.OCRConfig{ registryChainDetails: { OffchainPublicKey: types.OffchainPublicKey(common.FromHex("1111111111111111111111111111111111111111111111111111111111111111")), - OnchainPublicKey: signing_1[:], + OnchainPublicKey: signing_1, PeerID: p2pID.PeerID(), TransmitAccount: types.Account(admin_1.String()), ConfigEncryptionPublicKey: encryptionpubkey, diff --git a/deployment/keystone/changeset/internal/update_don.go b/deployment/keystone/changeset/internal/update_don.go index 3cfc386b2ba..aa3e203e5e4 100644 --- a/deployment/keystone/changeset/internal/update_don.go +++ b/deployment/keystone/changeset/internal/update_don.go @@ -5,6 +5,7 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" + "errors" "fmt" "math/big" "sort" @@ -12,10 +13,11 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "google.golang.org/protobuf/proto" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "google.golang.org/protobuf/proto" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" ) @@ -56,10 +58,10 @@ func (r *UpdateDonRequest) AppendNodeCapabilitiesRequest() *AppendNodeCapabiliti func (r *UpdateDonRequest) Validate() error { if r.ContractSet.CapabilitiesRegistry == nil { - return fmt.Errorf("registry is required") + return errors.New("registry is required") } if len(r.P2PIDs) == 0 { - return fmt.Errorf("p2pIDs is required") + return errors.New("p2pIDs is required") } return nil } diff --git a/deployment/keystone/changeset/internal/update_don_test.go b/deployment/keystone/changeset/internal/update_don_test.go index 57b15138538..bf9ab96fecb 100644 --- a/deployment/keystone/changeset/internal/update_don_test.go +++ b/deployment/keystone/changeset/internal/update_don_test.go @@ -11,6 +11,9 @@ import ( "github.com/ethereum/go-ethereum/common" chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" kscs "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" @@ -18,8 +21,6 @@ import ( kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var ( @@ -153,7 +154,6 @@ func TestUpdateDon(t *testing.T) { assert.Equal(t, want.DonInfo.ConfigCount, got.DonInfo.ConfigCount) assert.Equal(t, sortedP2Pids(want.DonInfo.NodeP2PIds), sortedP2Pids(got.DonInfo.NodeP2PIds)) assert.Equal(t, capIds(want.DonInfo.CapabilityConfigurations), capIds(got.DonInfo.CapabilityConfigurations)) - }) } @@ -234,7 +234,6 @@ func registerTestDon(t *testing.T, lggr logger.Logger, cfg setupUpdateDonTestCon t.Helper() req := newSetupTestRegistryRequest(t, cfg.dons, cfg.nops) return kstest.SetupTestRegistry(t, lggr, req) - } func newSetupTestRegistryRequest(t *testing.T, dons []internal.DonInfo, nops []internal.NOP) *kstest.SetupTestRegistryRequest { diff --git a/deployment/keystone/changeset/internal/update_node_capabilities.go b/deployment/keystone/changeset/internal/update_node_capabilities.go index 16c37267060..23e3d66965c 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities.go @@ -1,6 +1,7 @@ package internal import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -19,10 +20,10 @@ type UpdateNodeCapabilitiesImplRequest struct { func (req *UpdateNodeCapabilitiesImplRequest) Validate() error { if len(req.P2pToCapabilities) == 0 { - return fmt.Errorf("p2pToCapabilities is empty") + return errors.New("p2pToCapabilities is empty") } if req.ContractSet == nil { - return fmt.Errorf("registry is nil") + return errors.New("registry is nil") } return nil diff --git a/deployment/keystone/changeset/internal/update_nodes.go b/deployment/keystone/changeset/internal/update_nodes.go index b27c17ad19f..976125e582d 100644 --- a/deployment/keystone/changeset/internal/update_nodes.go +++ b/deployment/keystone/changeset/internal/update_nodes.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink-common/pkg/logger" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" @@ -194,7 +195,6 @@ func AppendCapabilities(lggr logger.Logger, registry *kcr.CapabilitiesRegistry, func makeNodeParams(registry *kcr.CapabilitiesRegistry, p2pToUpdates map[p2pkey.PeerID]NodeUpdate) ([]kcr.CapabilitiesRegistryNodeParams, error) { - var out []kcr.CapabilitiesRegistryNodeParams var p2pIds []p2pkey.PeerID for p2pID := range p2pToUpdates { @@ -257,7 +257,6 @@ func makeNodeParams(registry *kcr.CapabilitiesRegistry, }) return out, nil - } // fetchCapabilityIDs fetches the capability ids for the given capabilities diff --git a/deployment/keystone/changeset/internal/update_nodes_test.go b/deployment/keystone/changeset/internal/update_nodes_test.go index 0f22120998a..1b532129e48 100644 --- a/deployment/keystone/changeset/internal/update_nodes_test.go +++ b/deployment/keystone/changeset/internal/update_nodes_test.go @@ -597,7 +597,6 @@ func TestUpdateNodes(t *testing.T) { } func TestAppendCapabilities(t *testing.T) { - var ( capMap = map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability{ testPeerID(t, "peerID_1"): []kcr.CapabilitiesRegistryCapability{ @@ -663,7 +662,6 @@ func TestAppendCapabilities(t *testing.T) { gotCaps2 := appendedResp2[testPeerID(t, "peerID_1")] require.Len(t, gotCaps2, 3) require.EqualValues(t, gotCaps, gotCaps2) - } func testPeerID(t *testing.T, s string) p2pkey.PeerID { diff --git a/deployment/keystone/changeset/update_don.go b/deployment/keystone/changeset/update_don.go index 5b381a4e498..47cb7c82507 100644 --- a/deployment/keystone/changeset/update_don.go +++ b/deployment/keystone/changeset/update_don.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment" @@ -26,10 +27,10 @@ type UpdateDonRequest struct { func (r *UpdateDonRequest) Validate() error { if len(r.P2PIDs) == 0 { - return fmt.Errorf("p2pIDs is required") + return errors.New("p2pIDs is required") } if len(r.CapabilityConfigs) == 0 { - return fmt.Errorf("capabilityConfigs is required") + return errors.New("capabilityConfigs is required") } return nil } @@ -63,10 +64,10 @@ func UpdateDon(env deployment.Environment, req *UpdateDonRequest) (deployment.Ch out := deployment.ChangesetOutput{} if req.UseMCMS() { if updateResult.Ops == nil { - return out, fmt.Errorf("expected MCMS operation to be non-nil") + return out, errors.New("expected MCMS operation to be non-nil") } if len(appendResult.Proposals) == 0 { - return out, fmt.Errorf("expected append node capabilities to return proposals") + return out, errors.New("expected append node capabilities to return proposals") } out.Proposals = appendResult.Proposals @@ -75,10 +76,8 @@ func UpdateDon(env deployment.Environment, req *UpdateDonRequest) (deployment.Ch // this makes the proposal all-or-nothing because all the operations are in the same batch, there is only one tr // transaction and only one proposal out.Proposals[0].Transactions[0].Batch = append(out.Proposals[0].Transactions[0].Batch, updateResult.Ops.Batch...) - } return out, nil - } func appendRequest(r *UpdateDonRequest) *AppendNodeCapabilitiesRequest { diff --git a/deployment/keystone/changeset/update_don_test.go b/deployment/keystone/changeset/update_don_test.go index 2487087e235..74e2609b0a1 100644 --- a/deployment/keystone/changeset/update_don_test.go +++ b/deployment/keystone/changeset/update_don_test.go @@ -41,7 +41,7 @@ func TestUpdateDon(t *testing.T) { // we have to keep track of the existing capabilities to add to the new ones var p2pIDs []p2pkey.PeerID newCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) p2pIDs = append(p2pIDs, k) @@ -64,7 +64,7 @@ func TestUpdateDon(t *testing.T) { csOut, err := changeset.UpdateDon(te.Env, &cfg) require.NoError(t, err) - require.Len(t, csOut.Proposals, 0) + require.Empty(t, csOut.Proposals) require.Nil(t, csOut.AddressBook) assertDonContainsCapabilities(t, te.ContractSets()[te.RegistrySelector].CapabilitiesRegistry, caps, p2pIDs) @@ -82,7 +82,7 @@ func TestUpdateDon(t *testing.T) { // contract set is already deployed with capabilities // we have to keep track of the existing capabilities to add to the new ones var p2pIDs []p2pkey.PeerID - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) p2pIDs = append(p2pIDs, k) diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go index 8c4d01159ed..c96393328db 100644 --- a/deployment/keystone/changeset/update_node_capabilities.go +++ b/deployment/keystone/changeset/update_node_capabilities.go @@ -1,6 +1,7 @@ package changeset import ( + "errors" "fmt" "strconv" @@ -9,6 +10,7 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" @@ -61,7 +63,7 @@ type MutateNodeCapabilitiesRequest struct { func (req *MutateNodeCapabilitiesRequest) Validate() error { if len(req.P2pToCapabilities) == 0 { - return fmt.Errorf("p2pToCapabilities is empty") + return errors.New("p2pToCapabilities is empty") } _, exists := chainsel.ChainBySelector(req.RegistryChainSel) if !exists { @@ -118,7 +120,7 @@ func UpdateNodeCapabilities(env deployment.Environment, req *UpdateNodeCapabilit out := deployment.ChangesetOutput{} if req.UseMCMS() { if r.Ops == nil { - return out, fmt.Errorf("expected MCMS operation to be non-nil") + return out, errors.New("expected MCMS operation to be non-nil") } timelocksPerChain := map[uint64]common.Address{ c.Chain.Selector: c.ContractSet.Timelock.Address(), diff --git a/deployment/keystone/changeset/update_node_capabilities_test.go b/deployment/keystone/changeset/update_node_capabilities_test.go index cf6b9601039..8962dfc389d 100644 --- a/deployment/keystone/changeset/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/update_node_capabilities_test.go @@ -41,7 +41,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { // we have to keep track of the existing capabilities to add to the new ones var p2pIDs []p2pkey.PeerID newCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) p2pIDs = append(p2pIDs, k) @@ -49,7 +49,6 @@ func TestUpdateNodeCapabilities(t *testing.T) { } t.Run("fails if update drops existing capabilities", func(t *testing.T) { - cfg := changeset.UpdateNodeCapabilitiesRequest{ RegistryChainSel: te.RegistrySelector, P2pToCapabilities: newCapabilities, @@ -73,7 +72,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { csOut, err := changeset.UpdateNodeCapabilities(te.Env, &cfg) require.NoError(t, err) - require.Len(t, csOut.Proposals, 0) + require.Empty(t, csOut.Proposals) require.Nil(t, csOut.AddressBook) validateCapabilityUpdates(t, te, capabiltiesToSet) @@ -92,7 +91,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { // we have to keep track of the existing capabilities to add to the new ones var p2pIDs []p2pkey.PeerID newCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) p2pIDs = append(p2pIDs, k) @@ -135,9 +134,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { }) require.NoError(t, err) validateCapabilityUpdates(t, te, capabiltiesToSet) - }) - } // validateUpdate checks reads nodes from the registry and checks they have the expected updates diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go index 10a7ad4e441..4a98f8b06e9 100644 --- a/deployment/keystone/changeset/update_nodes.go +++ b/deployment/keystone/changeset/update_nodes.go @@ -1,12 +1,14 @@ package changeset import ( + "errors" "fmt" "time" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" @@ -30,7 +32,7 @@ type UpdateNodesRequest struct { func (r *UpdateNodesRequest) Validate() error { if r.P2pToUpdates == nil { - return fmt.Errorf("P2pToUpdates must be non-nil") + return errors.New("P2pToUpdates must be non-nil") } return nil } @@ -74,7 +76,7 @@ func UpdateNodes(env deployment.Environment, req *UpdateNodesRequest) (deploymen out := deployment.ChangesetOutput{} if req.UseMCMS() { if resp.Ops == nil { - return out, fmt.Errorf("expected MCMS operation to be non-nil") + return out, errors.New("expected MCMS operation to be non-nil") } timelocksPerChain := map[uint64]common.Address{ req.RegistryChainSel: contracts.Timelock.Address(), diff --git a/deployment/keystone/changeset/update_nodes_test.go b/deployment/keystone/changeset/update_nodes_test.go index 33662aa669d..5709482ddb3 100644 --- a/deployment/keystone/changeset/update_nodes_test.go +++ b/deployment/keystone/changeset/update_nodes_test.go @@ -28,7 +28,7 @@ func TestUpdateNodes(t *testing.T) { updates := make(map[p2pkey.PeerID]changeset.NodeUpdate) i := uint8(0) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) pubKey := [32]byte{31: i + 1} @@ -48,7 +48,7 @@ func TestUpdateNodes(t *testing.T) { csOut, err := changeset.UpdateNodes(te.Env, &cfg) require.NoError(t, err) - require.Len(t, csOut.Proposals, 0) + require.Empty(t, csOut.Proposals) require.Nil(t, csOut.AddressBook) validateUpdate(t, te, updates) @@ -65,7 +65,7 @@ func TestUpdateNodes(t *testing.T) { updates := make(map[p2pkey.PeerID]changeset.NodeUpdate) i := uint8(0) - for id, _ := range te.WFNodes { + for id := range te.WFNodes { k, err := p2pkey.MakePeerID(id) require.NoError(t, err) pubKey := [32]byte{31: i + 1} @@ -111,7 +111,6 @@ func TestUpdateNodes(t *testing.T) { validateUpdate(t, te, updates) }) - } // validateUpdate checks reads nodes from the registry and checks they have the expected updates diff --git a/deployment/keystone/changeset/view.go b/deployment/keystone/changeset/view.go index 9c8678d8778..f6f495fd30b 100644 --- a/deployment/keystone/changeset/view.go +++ b/deployment/keystone/changeset/view.go @@ -37,7 +37,6 @@ func ViewKeystone(e deployment.Environment) (json.Marshaler, error) { return nil, fmt.Errorf("failed to view contract set: %w", err) } chainViews[chainName] = v - } nopsView, err := commonview.GenerateNopsView(e.NodeIDs, e.Offchain) if err != nil { diff --git a/deployment/keystone/changeset/workflowregistry/deploy.go b/deployment/keystone/changeset/workflowregistry/deploy.go index e55484aa711..bb88918594c 100644 --- a/deployment/keystone/changeset/workflowregistry/deploy.go +++ b/deployment/keystone/changeset/workflowregistry/deploy.go @@ -1,6 +1,7 @@ package workflowregistry import ( + "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment" @@ -12,7 +13,7 @@ func Deploy(env deployment.Environment, registrySelector uint64) (deployment.Cha lggr := env.Logger chain, ok := env.Chains[registrySelector] if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") + return deployment.ChangesetOutput{}, errors.New("chain not found in environment") } ab := deployment.NewMemoryAddressBook() wrResp, err := deployWorkflowRegistry(chain, ab) diff --git a/deployment/keystone/changeset/workflowregistry/deploy_test.go b/deployment/keystone/changeset/workflowregistry/deploy_test.go index 16eb6fa8512..ec40646b378 100644 --- a/deployment/keystone/changeset/workflowregistry/deploy_test.go +++ b/deployment/keystone/changeset/workflowregistry/deploy_test.go @@ -34,5 +34,5 @@ func Test_Deploy(t *testing.T) { // nothing on chain 1 require.NotEqual(t, registrySel, env.AllChainSelectors()[1]) oaddrs, _ := resp.AddressBook.AddressesForChain(env.AllChainSelectors()[1]) - assert.Len(t, oaddrs, 0) + assert.Empty(t, oaddrs) } diff --git a/deployment/keystone/changeset/workflowregistry/setup_test.go b/deployment/keystone/changeset/workflowregistry/setup_test.go index 78e7d852080..ec4d448b93c 100644 --- a/deployment/keystone/changeset/workflowregistry/setup_test.go +++ b/deployment/keystone/changeset/workflowregistry/setup_test.go @@ -3,12 +3,13 @@ package workflowregistry import ( "testing" + "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" - "github.com/stretchr/testify/require" ) type SetupTestWorkflowRegistryResponse struct { diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go index f24db609553..aa869ce1517 100644 --- a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go @@ -29,7 +29,7 @@ func TestUpdateAllowedDons(t *testing.T) { dons, err := registry.GetAllAllowedDONs(&bind.CallOpts{}) require.NoError(t, err) - assert.Len(t, dons, 0) + assert.Empty(t, dons) env := deployment.Environment{ Logger: lggr, @@ -53,7 +53,7 @@ func TestUpdateAllowedDons(t *testing.T) { require.NoError(t, err) assert.Len(t, dons, 1) - assert.Equal(t, dons[0], uint32(1)) + assert.Equal(t, uint32(1), dons[0]) _, err = workflowregistry.UpdateAllowedDons( env, @@ -68,7 +68,7 @@ func TestUpdateAllowedDons(t *testing.T) { dons, err = registry.GetAllAllowedDONs(&bind.CallOpts{}) require.NoError(t, err) - assert.Len(t, dons, 0) + assert.Empty(t, dons) } func Test_UpdateAllowedDons_WithMCMS(t *testing.T) { diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go index a8d969fce0c..ed650ed52c6 100644 --- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go @@ -30,7 +30,7 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { dons, err := registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) require.NoError(t, err) - assert.Len(t, dons, 0) + assert.Empty(t, dons) env := deployment.Environment{ Logger: lggr, @@ -70,7 +70,7 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { dons, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) require.NoError(t, err) - assert.Len(t, dons, 0) + assert.Empty(t, dons) } func Test_UpdateAuthorizedAddresses_WithMCMS(t *testing.T) { diff --git a/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go b/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go index ac5bbd16cc8..6ebe6693482 100644 --- a/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go +++ b/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go @@ -30,7 +30,6 @@ func (c *workflowRegistryDeployer) Contract() *workflow_registry.WorkflowRegistr } func (c *workflowRegistryDeployer) Deploy(req changeset.DeployRequest) (*changeset.DeployResponse, error) { - addr, tx, wr, err := workflow_registry.DeployWorkflowRegistry( req.Chain.DeployerKey, req.Chain.Client) diff --git a/deployment/multiclient_test.go b/deployment/multiclient_test.go index 2e10c46e33f..152cdbc8d0e 100644 --- a/deployment/multiclient_test.go +++ b/deployment/multiclient_test.go @@ -38,7 +38,7 @@ func TestMultiClient(t *testing.T) { require.NoError(t, err) require.NotNil(t, mc) assert.Equal(t, mc.RetryConfig.Attempts, uint(RPC_DEFAULT_RETRY_ATTEMPTS)) - assert.Equal(t, mc.RetryConfig.Delay, RPC_DEFAULT_RETRY_DELAY) + assert.Equal(t, RPC_DEFAULT_RETRY_DELAY, mc.RetryConfig.Delay) _, err = NewMultiClient(lggr, []RPC{}) require.Error(t, err) @@ -49,5 +49,5 @@ func TestMultiClient(t *testing.T) { {WSURL: s.URL}, }) require.NoError(t, err) - require.Equal(t, len(mc.Backups), 1) + require.Len(t, mc.Backups, 1) } diff --git a/integration-tests/.golangci.yml b/integration-tests/.golangci.yml index 337555e17cb..957d11e04ff 100644 --- a/integration-tests/.golangci.yml +++ b/integration-tests/.golangci.yml @@ -8,7 +8,6 @@ linters: - errname - errorlint - exhaustive - - exportloopref - fatcontext - ginkgolinter - gocritic From 7debe85cc458774c0d94c8d2221a9cb17679fbff Mon Sep 17 00:00:00 2001 From: Dmytro Haidashenko <34754799+dhaidashenko@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:29:55 +0100 Subject: [PATCH 09/91] BCFR-1099 sei custom log index (#15858) * add sei chain and error mapping * fix changeset and config_test * remove sei chain type * add pricemax * custom calculation of log's index for Sei * fix lint issues & tests --------- Co-authored-by: flodesi --- .changeset/clever-knives-tap.md | 5 + ccip/config/evm/Sei_Testnet_Atlantic.toml | 18 +++ core/build/platform_arch_guard.go | 3 + core/chains/evm/client/errors.go | 12 +- core/chains/evm/client/errors_test.go | 6 + core/chains/evm/client/helpers_test.go | 8 +- core/chains/evm/client/rpc_client.go | 51 ++++++- .../evm/client/rpc_client_internal_test.go | 93 ++++++++++++ core/chains/evm/client/rpc_client_test.go | 137 +++++++++++++++++- core/chains/evm/client/sub_forwarder.go | 30 ++-- core/chains/evm/client/sub_forwarder_test.go | 48 ++++-- core/chains/evm/config/chaintype/chaintype.go | 6 +- core/services/chainlink/config_test.go | 4 +- core/services/ocr/contract_tracker.go | 2 +- core/services/ocrcommon/block_translator.go | 2 +- 15 files changed, 383 insertions(+), 42 deletions(-) create mode 100644 .changeset/clever-knives-tap.md create mode 100644 ccip/config/evm/Sei_Testnet_Atlantic.toml create mode 100644 core/build/platform_arch_guard.go create mode 100644 core/chains/evm/client/rpc_client_internal_test.go diff --git a/.changeset/clever-knives-tap.md b/.changeset/clever-knives-tap.md new file mode 100644 index 00000000000..8683e89f77d --- /dev/null +++ b/.changeset/clever-knives-tap.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#added Sei config and error mapping diff --git a/ccip/config/evm/Sei_Testnet_Atlantic.toml b/ccip/config/evm/Sei_Testnet_Atlantic.toml new file mode 100644 index 00000000000..f8c23d95c54 --- /dev/null +++ b/ccip/config/evm/Sei_Testnet_Atlantic.toml @@ -0,0 +1,18 @@ +ChainID = '1328' +ChainType = 'sei' +# finality_depth: instant +FinalityDepth = 10 +# block_time: ~0.4s, adding 1 second buffer +LogPollInterval = '2s' +# finality_depth * block_time / 60 secs = ~0.8 min (finality time) +NoNewFinalizedHeadsThreshold = '5m' +# "RPC node returned multiple missing blocks on query for block numbers [31592085 31592084] even though the WS subscription already sent us these blocks. It might help to increase EVM.RPCBlockQueryDelay (currently 1)" +RPCBlockQueryDelay = 5 + +[GasEstimator] +EIP1559DynamicFees = false +Mode = 'BlockHistory' +PriceMax = '3000 gwei' # recommended by ds&a + +[GasEstimator.BlockHistory] +BlockHistorySize = 200 diff --git a/core/build/platform_arch_guard.go b/core/build/platform_arch_guard.go new file mode 100644 index 00000000000..3a22f7df537 --- /dev/null +++ b/core/build/platform_arch_guard.go @@ -0,0 +1,3 @@ +//go:build !amd64 && !arm64 +package build +"non-64-bits architectures are not supported" diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index bde97185580..eaa33f041ac 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -284,6 +284,16 @@ var gnosis = ClientErrors{ TransactionAlreadyInMempool: regexp.MustCompile(`(: |^)(alreadyknown)`), } +var sei = ClientErrors{ + // https://github.com/sei-protocol/sei-tendermint/blob/e9a22c961e83579d8a68cd045c532980d82fb2a0/types/mempool.go#L12 + TransactionAlreadyInMempool: regexp.MustCompile("tx already exists in cache"), + // https://github.com/sei-protocol/sei-cosmos/blob/a4eb451c957b1ca7ca9118406682f93fe83d1f61/types/errors/errors.go#L50 + // https://github.com/sei-protocol/sei-cosmos/blob/a4eb451c957b1ca7ca9118406682f93fe83d1f61/types/errors/errors.go#L56 + // https://github.com/sei-protocol/sei-cosmos/blob/a4eb451c957b1ca7ca9118406682f93fe83d1f61/client/broadcast.go#L27 + // https://github.com/sei-protocol/sei-cosmos/blob/a4eb451c957b1ca7ca9118406682f93fe83d1f61/types/errors/errors.go#L32 + Fatal: regexp.MustCompile(`(: |^)'*out of gas|insufficient fee|Tx too large. Max size is \d+, but got \d+|: insufficient funds`), +} + const TerminallyStuckMsg = "transaction terminally stuck" // Tx.Error messages that are set internally so they are not chain or client specific @@ -291,7 +301,7 @@ var internal = ClientErrors{ TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg), } -var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, internal} +var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, sei, internal} // ClientErrorRegexes returns a map of compiled regexes for each error type func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors { diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index 1f9aaa53365..7ba042ab5c6 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -143,6 +143,7 @@ func Test_Eth_Errors(t *testing.T) { {"ErrorObject { code: ServerError(3), message: \\\"known transaction. transaction with hash 0xf016…ad63 is already in the system\\\", data: Some(RawValue(\\\"0x\\\")) }", true, "zkSync"}, {"client error transaction already in mempool", true, "tomlConfig"}, {"alreadyknown", true, "Gnosis"}, + {"tx already exists in cache", true, "Sei"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message) @@ -442,6 +443,11 @@ func Test_Eth_Errors_Fatal(t *testing.T) { {"client error fatal", true, "tomlConfig"}, {"[Request ID: d9711488-4c1e-4af2-bc1f-7969913d7b60] Error invoking RPC: transaction 0.0.4425573@1718213476.914320044 failed precheck with status INVALID_SIGNATURE", true, "hedera"}, {"invalid chain id for signer", true, "Treasure"}, + + {": out of gas", true, "Sei"}, + {"Tx too large. Max size is 2048576, but got 2097431", true, "Sei"}, + {": insufficient funds", true, "Sei"}, + {"insufficient fee", true, "Sei"}, } for _, test := range tests { diff --git a/core/chains/evm/client/helpers_test.go b/core/chains/evm/client/helpers_test.go index f9751be765c..6369c9dca12 100644 --- a/core/chains/evm/client/helpers_test.go +++ b/core/chains/evm/client/helpers_test.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" "net/url" + "sync" "testing" "time" @@ -216,6 +217,7 @@ const HeadResult = `{"difficulty":"0xf3a00","extraData":"0xd88301050384676574688 type mockSubscription struct { unsubscribed bool Errors chan error + unsub sync.Once } func NewMockSubscription() *mockSubscription { @@ -225,8 +227,10 @@ func NewMockSubscription() *mockSubscription { func (mes *mockSubscription) Err() <-chan error { return mes.Errors } func (mes *mockSubscription) Unsubscribe() { - mes.unsubscribed = true - close(mes.Errors) + mes.unsub.Do(func() { + mes.unsubscribed = true + close(mes.Errors) + }) } func ParseTestNodeConfigs(nodes []NodeConfig) ([]*toml.Node, error) { diff --git a/core/chains/evm/client/rpc_client.go b/core/chains/evm/client/rpc_client.go index 97046b4eff2..35d2a6dcd6b 100644 --- a/core/chains/evm/client/rpc_client.go +++ b/core/chains/evm/client/rpc_client.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "math/big" "net/url" "strconv" @@ -376,6 +377,10 @@ func (r *RPCClient) BatchCallContext(rootCtx context.Context, b []rpc.BatchElem) var requestedFinalizedBlock bool if r.chainType == chaintype.ChainAstar { for _, el := range b { + if el.Method == "eth_getLogs" { + r.rpcLog.Critical("evmclient.BatchCallContext: eth_getLogs is not supported") + return errors.New("evmclient.BatchCallContext: eth_getLogs is not supported") + } if !isRequestingFinalizedBlock(el) { continue } @@ -490,10 +495,10 @@ func (r *RPCClient) SubscribeToHeads(ctx context.Context) (ch <-chan *evmtypes.H }() channel := make(chan *evmtypes.Head) - forwarder := newSubForwarder(channel, func(head *evmtypes.Head) *evmtypes.Head { + forwarder := newSubForwarder(channel, func(head *evmtypes.Head) (*evmtypes.Head, error) { head.EVMChainID = ubig.New(r.chainID) r.onNewHead(ctx, chStopInFlight, head) - return head + return head, nil }, r.wrapRPCClientError) err = forwarder.start(ws.rpc.EthSubscribe(ctx, forwarder.srcCh, args...)) @@ -1199,8 +1204,11 @@ func (r *RPCClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) (l [ l, err = ws.geth.FilterLogs(ctx, q) err = r.wrapWS(err) } - duration := time.Since(start) + if err == nil { + err = r.makeLogsValid(l) + } + duration := time.Since(start) r.logResult(lggr, err, duration, r.getRPCDomain(), "FilterLogs", "log", l, ) @@ -1228,7 +1236,7 @@ func (r *RPCClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQu r.logResult(lggr, err, duration, r.getRPCDomain(), "SubscribeFilterLogs") err = r.wrapWS(err) }() - sub := newSubForwarder(ch, nil, r.wrapRPCClientError) + sub := newSubForwarder(ch, r.makeLogValid, r.wrapRPCClientError) err = sub.start(ws.geth.SubscribeFilterLogs(ctx, q, sub.srcCh)) if err != nil { return @@ -1452,3 +1460,38 @@ func ToBlockNumArg(number *big.Int) string { } return hexutil.EncodeBig(number) } + +func (r *RPCClient) makeLogsValid(logs []types.Log) error { + if r.chainType != chaintype.ChainSei { + return nil + } + + for i := range logs { + var err error + logs[i], err = r.makeLogValid(logs[i]) + if err != nil { + return err + } + } + + return nil +} + +func (r *RPCClient) makeLogValid(log types.Log) (types.Log, error) { + if r.chainType != chaintype.ChainSei { + return log, nil + } + + if log.TxIndex > math.MaxUint32 { + return types.Log{}, fmt.Errorf("TxIndex of tx %s exceeds max supported value of %d", log.TxHash, math.MaxUint32) + } + + if log.Index > math.MaxUint32 { + return types.Log{}, fmt.Errorf("log's index %d of tx %s exceeds max supported value of %d", log.Index, log.TxHash, math.MaxUint32) + } + + // it's safe as we have a build guard to guarantee 64-bit system + newIndex := uint64(log.TxIndex<<32) | uint64(log.Index) + log.Index = uint(newIndex) + return log, nil +} diff --git a/core/chains/evm/client/rpc_client_internal_test.go b/core/chains/evm/client/rpc_client_internal_test.go new file mode 100644 index 00000000000..ef321645fc2 --- /dev/null +++ b/core/chains/evm/client/rpc_client_internal_test.go @@ -0,0 +1,93 @@ +package client + +import ( + "errors" + "math" + "testing" + + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func TestRPCClient_MakeLogsValid(t *testing.T) { + testCases := []struct { + Name string + TxIndex uint + LogIndex uint + ExpectedLogIndex uint + ExpectedError error + }{ + { + Name: "TxIndex = 0 LogIndex = 0", + TxIndex: 0, + LogIndex: 0, + ExpectedLogIndex: 0, + ExpectedError: nil, + }, + { + Name: "TxIndex = 0 LogIndex = 1", + TxIndex: 0, + LogIndex: 1, + ExpectedLogIndex: 1, + ExpectedError: nil, + }, + { + Name: "TxIndex = 0 LogIndex = MaxUint32", + TxIndex: 0, + LogIndex: math.MaxUint32, + ExpectedLogIndex: math.MaxUint32, + ExpectedError: nil, + }, + { + Name: "LogIndex = MaxUint32 + 1 => returns an error", + TxIndex: 0, + LogIndex: math.MaxUint32 + 1, + ExpectedLogIndex: 0, + ExpectedError: errors.New("log's index 4294967296 of tx 0x0000000000000000000000000000000000000000000000000000000000000000 exceeds max supported value of 4294967295"), + }, + { + Name: "TxIndex = 1 LogIndex = 0", + TxIndex: 1, + LogIndex: 0, + ExpectedLogIndex: math.MaxUint32 + 1, + ExpectedError: nil, + }, + { + Name: "TxIndex = MaxUint32 LogIndex = MaxUint32", + TxIndex: math.MaxUint32, + LogIndex: math.MaxUint32, + ExpectedLogIndex: math.MaxUint64, + ExpectedError: nil, + }, + { + Name: "TxIndex = MaxUint32 + 1 => returns an error", + TxIndex: math.MaxUint32 + 1, + LogIndex: 0, + ExpectedLogIndex: 0, + ExpectedError: errors.New("TxIndex of tx 0x0000000000000000000000000000000000000000000000000000000000000000 exceeds max supported value of 4294967295"), + }, + } + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + rpc := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + log, err := rpc.makeLogValid(ethtypes.Log{TxIndex: tc.TxIndex, Index: tc.LogIndex}) + // non sei should return as is + require.NoError(t, err) + require.Equal(t, tc.TxIndex, log.TxIndex) + require.Equal(t, tc.LogIndex, log.Index) + seiRPC := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + log, err = seiRPC.makeLogValid(ethtypes.Log{TxIndex: tc.TxIndex, Index: tc.LogIndex}) + if tc.ExpectedError != nil { + require.EqualError(t, err, tc.ExpectedError.Error()) + return + } + + require.Equal(t, tc.ExpectedLogIndex, log.Index) + require.Equal(t, tc.TxIndex, log.TxIndex) + }) + } +} diff --git a/core/chains/evm/client/rpc_client_test.go b/core/chains/evm/client/rpc_client_test.go index d5286e9acf0..f6e7f9ee338 100644 --- a/core/chains/evm/client/rpc_client_test.go +++ b/core/chains/evm/client/rpc_client_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "math/big" "net/url" "sync" @@ -13,6 +14,7 @@ import ( "time" "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" "github.com/stretchr/testify/assert" @@ -31,14 +33,16 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) -func makeNewHeadWSMessage(head *evmtypes.Head) string { - asJSON, err := json.Marshal(head) +func makeNewWSMessage[T any](v T) string { + asJSON, err := json.Marshal(v) if err != nil { panic(fmt.Errorf("failed to marshal head: %w", err)) } return fmt.Sprintf(`{"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x00","result":%s}}`, string(asJSON)) } +var makeNewHeadWSMessage = makeNewWSMessage[*evmtypes.Head] + func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Parallel() ctx, cancel := context.WithTimeout(tests.Context(t), tests.WaitTimeout(t)) @@ -385,6 +389,135 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { t.Errorf("Expected subscription to return an error, but test timeout instead") } }) + t.Run("Log's index is properly set for Sei chain type", func(t *testing.T) { + server := testutils.NewWSServer(t, chainId, func(method string, params gjson.Result) (resp testutils.JSONRPCResponse) { + if method == "eth_unsubscribe" { + resp.Result = "true" + return + } else if method == "eth_subscribe" { + if assert.True(t, params.IsArray()) && assert.Equal(t, "logs", params.Array()[0].String()) { + resp.Result = `"0x00"` + } + return + } + return + }) + wsURL := server.WSURL() + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + defer rpc.Close() + require.NoError(t, rpc.Dial(ctx)) + ch := make(chan types.Log) + sub, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, ch) + require.NoError(t, err) + testCases := []struct { + TxIndex uint + Index uint + ExpectedIndex uint + }{ + { + TxIndex: 0, + Index: 0, + ExpectedIndex: 0, + }, + { + TxIndex: 0, + Index: 1, + ExpectedIndex: 1, + }, + { + TxIndex: 1, + Index: 0, + ExpectedIndex: math.MaxUint32 + 1, + }, + } + go func() { + for _, testCase := range testCases { + server.MustWriteBinaryMessageSync(t, makeNewWSMessage(types.Log{TxIndex: testCase.TxIndex, Index: testCase.Index, Topics: []common.Hash{{}}})) + } + }() + defer sub.Unsubscribe() + for _, testCase := range testCases { + select { + case <-tests.Context(t).Done(): + require.Fail(t, "context timed out") + case err := <-sub.Err(): + require.NoError(t, err) + require.Fail(t, "Did not expect error channel to be closed or return error before all testcases were consumed") + case log := <-ch: + require.Equal(t, testCase.ExpectedIndex, log.Index, "Unexpected log index %d for test case %v", log.Index, testCase) + } + } + }) +} + +func TestRPCClientFilterLogs(t *testing.T) { + t.Parallel() + + nodePoolCfg := client.TestNodePoolConfig{ + NodeNewHeadsPollInterval: 1 * time.Second, + NodeFinalizedBlockPollInterval: 1 * time.Second, + } + + chainID := big.NewInt(123456) + lggr := logger.Test(t) + ctx, cancel := context.WithTimeout(tests.Context(t), tests.WaitTimeout(t)) + defer cancel() + t.Run("Log's index is properly set for Sei chain type", func(t *testing.T) { + testCases := []struct { + TxIndex uint + Index uint + ExpectedIndex uint + }{ + { + TxIndex: 0, + Index: 0, + ExpectedIndex: 0, + }, + { + TxIndex: 0, + Index: 1, + ExpectedIndex: 1, + }, + { + TxIndex: 1, + Index: 0, + ExpectedIndex: math.MaxUint32 + 1, + }, + } + server := testutils.NewWSServer(t, chainID, func(method string, params gjson.Result) (resp testutils.JSONRPCResponse) { + if method != "eth_getLogs" { + return + } + var logs []types.Log + for _, testCase := range testCases { + logs = append(logs, types.Log{TxIndex: testCase.TxIndex, Index: testCase.Index, Topics: []common.Hash{{}}}) + } + raw, err := json.Marshal(logs) + require.NoError(t, err) + resp.Result = string(raw) + return + }) + wsURL := server.WSURL() + seiRPC := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + defer seiRPC.Close() + require.NoError(t, seiRPC.Dial(ctx)) + logs, err := seiRPC.FilterLogs(ctx, ethereum.FilterQuery{}) + require.NoError(t, err) + for i, testCase := range testCases { + require.Equal(t, testCase.ExpectedIndex, logs[i].Index, "Unexpected log index %d for test case %v", logs[i].Index, testCase) + } + + // non sei should return index as is + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + defer rpc.Close() + require.NoError(t, rpc.Dial(ctx)) + logs, err = rpc.FilterLogs(ctx, ethereum.FilterQuery{}) + require.NoError(t, err) + for i, testCase := range testCases { + require.Equal(t, testCase.Index, logs[i].Index, "Expected non sei log to be returned as is") + require.Equal(t, testCase.TxIndex, logs[i].TxIndex, "Expected non sei log to be returned as is") + } + }) } func TestRPCClient_LatestFinalizedBlock(t *testing.T) { diff --git a/core/chains/evm/client/sub_forwarder.go b/core/chains/evm/client/sub_forwarder.go index 93e9b106b4a..a9b5a97eee0 100644 --- a/core/chains/evm/client/sub_forwarder.go +++ b/core/chains/evm/client/sub_forwarder.go @@ -13,7 +13,7 @@ type subForwarder[T any] struct { srcCh chan T srcSub ethereum.Subscription - interceptResult func(T) T + interceptResult func(T) (T, error) interceptError func(error) error done chan struct{} @@ -21,14 +21,14 @@ type subForwarder[T any] struct { unSub chan struct{} } -func newSubForwarder[T any](destCh chan<- T, interceptResult func(T) T, interceptError func(error) error) *subForwarder[T] { +func newSubForwarder[T any](destCh chan<- T, interceptResult func(T) (T, error), interceptError func(error) error) *subForwarder[T] { return &subForwarder[T]{ interceptResult: interceptResult, interceptError: interceptError, destCh: destCh, srcCh: make(chan T), done: make(chan struct{}), - err: make(chan error), + err: make(chan error, 1), unSub: make(chan struct{}, 1), } } @@ -44,6 +44,14 @@ func (c *subForwarder[T]) start(sub ethereum.Subscription, err error) error { return nil } +func (c *subForwarder[T]) handleError(err error) { + if c.interceptError != nil { + err = c.interceptError(err) + } + c.err <- err // err is buffered, and we never write twice, so write is not blocking + c.srcSub.Unsubscribe() +} + // forwardLoop receives from src, adds the chainID, and then sends to dest. // It also handles Unsubscribing, which may interrupt either forwarding operation. func (c *subForwarder[T]) forwardLoop() { @@ -54,19 +62,17 @@ func (c *subForwarder[T]) forwardLoop() { for { select { case err := <-c.srcSub.Err(): - if c.interceptError != nil { - err = c.interceptError(err) - } - select { - case c.err <- err: - case <-c.unSub: - c.srcSub.Unsubscribe() - } + c.handleError(err) return case h := <-c.srcCh: if c.interceptResult != nil { - h = c.interceptResult(h) + var err error + h, err = c.interceptResult(h) + if err != nil { + c.handleError(err) + return + } } select { case c.destCh <- h: diff --git a/core/chains/evm/client/sub_forwarder_test.go b/core/chains/evm/client/sub_forwarder_test.go index 1bc0122603b..267fa1b8467 100644 --- a/core/chains/evm/client/sub_forwarder_test.go +++ b/core/chains/evm/client/sub_forwarder_test.go @@ -21,9 +21,9 @@ func TestChainIDSubForwarder(t *testing.T) { t.Parallel() newChainIDSubForwarder := func(chainID *big.Int, ch chan<- *evmtypes.Head) *subForwarder[*evmtypes.Head] { - return newSubForwarder(ch, func(head *evmtypes.Head) *evmtypes.Head { + return newSubForwarder(ch, func(head *evmtypes.Head) (*evmtypes.Head, error) { head.EVMChainID = ubig.New(chainID) - return head + return head, nil }, nil) } @@ -54,12 +54,14 @@ func TestChainIDSubForwarder(t *testing.T) { sub := NewMockSubscription() err := forwarder.start(sub, nil) assert.NoError(t, err) - sub.Errors <- errors.New("boo") + expectedError := errors.New("boo") + sub.Errors <- expectedError forwarder.Unsubscribe() assert.True(t, sub.unsubscribed) - _, ok := <-sub.Err() - assert.False(t, ok) + err, ok := <-forwarder.Err() + assert.True(t, ok) + require.ErrorIs(t, err, expectedError) _, ok = <-forwarder.Err() assert.False(t, ok) }) @@ -117,6 +119,31 @@ func TestChainIDSubForwarder(t *testing.T) { }) } +func TestSubscriptionForwarder(t *testing.T) { + t.Run("Error returned by interceptResult is forwarded to err channel", func(t *testing.T) { + t.Parallel() + + ch := make(chan *evmtypes.Head) + expectedErr := errors.New("something went wrong during result interception") + forwarder := newSubForwarder(ch, func(head *evmtypes.Head) (*evmtypes.Head, error) { + return nil, expectedErr + }, nil) + mockedSub := NewMockSubscription() + require.NoError(t, forwarder.start(mockedSub, nil)) + + head := &evmtypes.Head{ + ID: 1, + } + forwarder.srcCh <- head + err := <-forwarder.Err() + require.ErrorIs(t, err, expectedErr) + // ensure forwarder is closed + _, ok := <-forwarder.Err() + assert.False(t, ok) + assert.True(t, mockedSub.unsubscribed) + }) +} + func TestSubscriptionErrorWrapper(t *testing.T) { t.Parallel() newSubscriptionErrorWrapper := func(t *testing.T, sub commontypes.Subscription, errorPrefix string) ethereum.Subscription { @@ -145,17 +172,6 @@ func TestSubscriptionErrorWrapper(t *testing.T) { // subsequence unsubscribe does not causes panic wrapper.Unsubscribe() }) - t.Run("Unsubscribe interrupts error delivery", func(t *testing.T) { - t.Parallel() - sub := NewMockSubscription() - const prefix = "RPC returned error" - wrapper := newSubscriptionErrorWrapper(t, sub, prefix) - sub.Errors <- fmt.Errorf("error") - - wrapper.Unsubscribe() - _, ok := <-wrapper.Err() - assert.False(t, ok) - }) t.Run("Successfully wraps error", func(t *testing.T) { t.Parallel() sub := NewMockSubscription() diff --git a/core/chains/evm/config/chaintype/chaintype.go b/core/chains/evm/config/chaintype/chaintype.go index b2eff02834b..be3afa0ea62 100644 --- a/core/chains/evm/config/chaintype/chaintype.go +++ b/core/chains/evm/config/chaintype/chaintype.go @@ -17,6 +17,7 @@ const ( ChainMantle ChainType = "mantle" ChainMetis ChainType = "metis" ChainOptimismBedrock ChainType = "optimismBedrock" + ChainSei ChainType = "sei" ChainScroll ChainType = "scroll" ChainWeMix ChainType = "wemix" ChainXLayer ChainType = "xlayer" @@ -39,7 +40,7 @@ func (c ChainType) IsL2() bool { func (c ChainType) IsValid() bool { switch c { - case "", ChainArbitrum, ChainAstar, ChainCelo, ChainGnosis, ChainHedera, ChainKroma, ChainMantle, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXLayer, ChainZkEvm, ChainZkSync, ChainZircuit: + case "", ChainArbitrum, ChainAstar, ChainCelo, ChainGnosis, ChainHedera, ChainKroma, ChainMantle, ChainMetis, ChainOptimismBedrock, ChainSei, ChainScroll, ChainWeMix, ChainXLayer, ChainZkEvm, ChainZkSync, ChainZircuit: return true } return false @@ -65,6 +66,8 @@ func FromSlug(slug string) ChainType { return ChainMetis case "optimismBedrock": return ChainOptimismBedrock + case "sei": + return ChainSei case "scroll": return ChainScroll case "wemix": @@ -138,6 +141,7 @@ var ErrInvalid = fmt.Errorf("must be one of %s or omitted", strings.Join([]strin string(ChainMantle), string(ChainMetis), string(ChainOptimismBedrock), + string(ChainSei), string(ChainScroll), string(ChainWeMix), string(ChainXLayer), diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 65ece5a88c0..9a08b356c66 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -1472,7 +1472,7 @@ func TestConfig_Validate(t *testing.T) { - 1: 10 errors: - ChainType: invalid value (Foo): must not be set with this chain id - Nodes: missing: must have at least one node - - ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit or omitted + - ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, sei, scroll, wemix, xlayer, zkevm, zksync, zircuit or omitted - HeadTracker.HistoryDepth: invalid value (30): must be greater than or equal to FinalizedBlockOffset - GasEstimator.BumpThreshold: invalid value (0): cannot be 0 if auto-purge feature is enabled for Foo - Transactions.AutoPurge.Threshold: missing: needs to be set if auto-purge feature is enabled for Foo @@ -1485,7 +1485,7 @@ func TestConfig_Validate(t *testing.T) { - 2: 5 errors: - ChainType: invalid value (Arbitrum): only "optimismBedrock" can be used with this chain id - Nodes: missing: must have at least one node - - ChainType: invalid value (Arbitrum): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit or omitted + - ChainType: invalid value (Arbitrum): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, sei, scroll, wemix, xlayer, zkevm, zksync, zircuit or omitted - FinalityDepth: invalid value (0): must be greater than or equal to 1 - MinIncomingConfirmations: invalid value (0): must be greater than or equal to 1 - 3: 3 errors: diff --git a/core/services/ocr/contract_tracker.go b/core/services/ocr/contract_tracker.go index 618567f0bdb..f2cf1fee9d3 100644 --- a/core/services/ocr/contract_tracker.go +++ b/core/services/ocr/contract_tracker.go @@ -399,7 +399,7 @@ func (t *OCRContractTracker) LatestBlockHeight(ctx context.Context) (blockheight // care about the block height; we have no way of getting the L1 block // height anyway return 0, nil - case "", chaintype.ChainArbitrum, chaintype.ChainAstar, chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainHedera, chaintype.ChainKroma, chaintype.ChainOptimismBedrock, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync, chaintype.ChainZircuit: + case "", chaintype.ChainArbitrum, chaintype.ChainAstar, chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainHedera, chaintype.ChainKroma, chaintype.ChainOptimismBedrock, chaintype.ChainSei, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync, chaintype.ChainZircuit: // continue } latestBlockHeight := t.getLatestBlockHeight() diff --git a/core/services/ocrcommon/block_translator.go b/core/services/ocrcommon/block_translator.go index b25d617e2ab..8a755f767b9 100644 --- a/core/services/ocrcommon/block_translator.go +++ b/core/services/ocrcommon/block_translator.go @@ -22,7 +22,7 @@ func NewBlockTranslator(cfg Config, client evmclient.Client, lggr logger.Logger) switch cfg.ChainType() { case chaintype.ChainArbitrum: return NewArbitrumBlockTranslator(client, lggr) - case "", chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainKroma, chaintype.ChainMetis, chaintype.ChainOptimismBedrock, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync, chaintype.ChainZircuit: + case "", chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainKroma, chaintype.ChainMetis, chaintype.ChainOptimismBedrock, chaintype.ChainSei, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync, chaintype.ChainZircuit: fallthrough default: return &l1BlockTranslator{} From 9bcb3db1fb7eb3ca942ebaa34f3db240bb6f57fd Mon Sep 17 00:00:00 2001 From: Lukasz <120112546+lukaszcl@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:01:32 +0100 Subject: [PATCH 10/91] Flakeguard: Unskip TestChainComponents test (#15851) * Flakeguard: Unskip TestChainComponents test * fail test * Revert "fail test" This reverts commit c4ae8ccb71b01407c8c13c6872c5a28697e21e5f. --- .github/workflows/ci-flakeguard.yml | 2 +- .github/workflows/flakeguard-nightly.yml | 2 +- .github/workflows/flakeguard-on-demand.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-flakeguard.yml b/.github/workflows/ci-flakeguard.yml index caf6a62a3fb..1bd60b20c94 100644 --- a/.github/workflows/ci-flakeguard.yml +++ b/.github/workflows/ci-flakeguard.yml @@ -41,7 +41,7 @@ jobs: findByTestFilesDiff: true findByAffectedPackages: false slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications - extraArgs: '{ "skipped_tests": "TestChainComponents", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "omit_test_outputs_on_success": "true" }' + extraArgs: '{ "skipped_tests": "", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "omit_test_outputs_on_success": "true" }' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 025cca6d0a0..3d62f1f521d 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -16,7 +16,7 @@ jobs: projectPath: '.' maxPassRatio: '1.0' runAllTests: true - extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' + extraArgs: '{ "skipped_tests": "", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index f6df40616f7..a8a71be3ba2 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -48,7 +48,7 @@ on: extraArgs: required: false type: string - default: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' + default: '{ "skipped_tests": "", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' description: 'JSON of extra arguments for the workflow.' jobs: From fcefd62068d6be4fea1820d1a9edef4e16fbfa3b Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Wed, 8 Jan 2025 16:16:15 +0100 Subject: [PATCH 11/91] Remove old Solidity code & move misplaced files (#15852) * rm dead code * move ChainSpecificUtil_v0_8_6.sol to vrf * remove flags * move chainlink client to operatorforwarder * move automation test wrappers to automation * more automation cleanup * move interfaces to operatorforwarder * remove TypeAndVersionInterface.sol in favor of ITypeAndVersion * move and remove mocks * move ChainSpecificUtil to shared * move more testhelpers * move MockV3Aggregator * move logpoller related contracts to shared * clean up broken references * fix broken ref * rebase * fix lint & compile feeds * gen wrapper for ITypeAndVersion * fix lint --- .changeset/cold-coats-battle.md | 5 + .github/CODEOWNERS | 3 - .../workflows/solidity-foundry-artifacts.yml | 1 - contracts/.changeset/angry-needles-approve.md | 5 + contracts/STYLE_GUIDE.md | 3 - contracts/scripts/lcov_prune | 2 - contracts/scripts/native_solc_compile_all | 2 +- .../native_solc_compile_all_automation | 10 +- .../scripts/native_solc_compile_all_feeds | 4 +- .../scripts/native_solc_compile_all_logpoller | 33 -- .../scripts/native_solc_compile_all_shared | 7 +- contracts/src/v0.8/Denominations.sol | 28 -- contracts/src/v0.8/Flags.sol | 124 ----- .../src/v0.8/PermissionedForwardProxy.sol | 65 --- contracts/src/v0.8/ValidatorProxy.sol | 230 --------- .../v0.8/automation/HeartbeatRequester.sol | 4 +- .../src/v0.8/automation/UpkeepTranscoder.sol | 4 +- .../v0.8/automation/dev/MercuryRegistry.sol | 2 +- .../mocks}/MockArbGasInfo.sol | 0 .../{ => automation}/mocks/MockArbSys.sol | 0 .../mocks}/MockGasBoundCaller.sol | 0 .../mocks}/MockZKSyncSystemContext.sol | 0 .../v0.8/automation/test/v2_3/BaseTest.t.sol | 2 +- .../test/v2_3_zksync/BaseTest.t.sol | 6 +- .../AutomationConsumerBenchmark.sol | 0 .../testhelpers}/CronReceiver.sol | 0 .../ERC20BalanceMonitorExposed.sol | 2 +- .../testhelpers}/EthBalanceMonitorExposed.sol | 2 +- .../KeeperCompatibleTestHelper.sol | 2 +- .../testhelpers}/MockOVMGasPriceOracle.sol | 0 .../testhelpers}/ReceiveEmitter.sol | 0 .../testhelpers}/ReceiveFallbackEmitter.sol | 0 .../testhelpers}/ReceiveReverter.sol | 0 .../testhelpers}/StreamsLookupUpkeep.sol | 6 +- .../testhelpers}/VerifiableLoadBase.sol | 10 +- .../VerifiableLoadLogTriggerUpkeep.sol | 4 +- .../VerifiableLoadStreamsLookupUpkeep.sol | 2 +- .../testhelpers}/VerifiableLoadUpkeep.sol | 0 .../automation/v1_2/KeeperRegistrar1_2.sol | 4 +- .../automation/v1_2/KeeperRegistry1_2.sol | 4 +- .../automation/v1_3/KeeperRegistry1_3.sol | 4 +- .../automation/v2_0/KeeperRegistrar2_0.sol | 4 +- .../automation/v2_0/UpkeepTranscoder3_0.sol | 4 +- .../v2_1/AutomationRegistrar2_1.sol | 4 +- .../automation/v2_1/UpkeepTranscoder4_0.sol | 4 +- .../v2_3/AutomationRegistrar2_3.sol | 4 +- .../automation/v2_3/UpkeepTranscoder5_0.sol | 4 +- .../feeQuoter/FeeQuoter.getTokenPrice.t.sol | 2 +- .../FeeQuoter.getValidatedTokenPrice.t.sol | 2 +- .../ccip/test/feeQuoter/FeeQuoterSetup.t.sol | 2 +- .../src/v0.8/functions/tests/v1_X/Setup.t.sol | 4 +- .../tests/v1_X/testhelpers}/MockLinkToken.sol | 2 +- .../v0.8/interfaces/FeedRegistryInterface.sol | 124 ----- .../src/v0.8/interfaces/FlagsInterface.sol | 17 - .../src/v0.8/interfaces/PoRAddressList.sol | 29 -- .../interfaces/TypeAndVersionInterface.sol | 6 - .../{tests => l2ep/test}/FeedConsumer.sol | 3 +- .../src/v0.8/{tests => l2ep/test}/Greeter.sol | 3 +- .../test/mocks}/MockArbitrumInbox.sol | 4 +- .../MockOptimismL1CrossDomainMessenger.sol | 0 .../MockOptimismL2CrossDomainMessenger.sol | 0 .../src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol | 2 +- .../ArbitrumCrossDomainForwarder.t.sol | 2 +- .../ArbitrumCrossDomainGovernor.t.sol | 2 +- .../ArbitrumSequencerUptimeFeed.t.sol | 2 +- .../v1_0_0/arbitrum/ArbitrumValidator.t.sol | 2 +- .../OptimismCrossDomainForwarder.t.sol | 2 +- .../OptimismCrossDomainGovernor.t.sol | 2 +- .../OptimismSequencerUptimeFeed.t.sol | 4 +- .../v1_0_0/optimism/OptimismValidator.t.sol | 4 +- .../scroll/ScrollCrossDomainForwarder.t.sol | 2 +- .../scroll/ScrollCrossDomainGovernor.t.sol | 2 +- .../shared/BaseSequencerUptimeFeed.t.sol | 2 +- .../src/v0.8/llo-feeds/v0.3.0/FeeManager.sol | 6 +- .../v0.8/llo-feeds/v0.3.0/RewardManager.sol | 6 +- .../src/v0.8/llo-feeds/v0.3.0/Verifier.sol | 6 +- .../v0.8/llo-feeds/v0.3.0/VerifierProxy.sol | 6 +- .../v0.4.0/DestinationFeeManager.sol | 6 +- .../v0.4.0/DestinationRewardManager.sol | 6 +- .../llo-feeds/v0.4.0/DestinationVerifier.sol | 6 +- .../v0.4.0/DestinationVerifierProxy.sol | 6 +- .../configuration/ChannelConfigStore.sol | 4 +- .../v0.5.0/configuration/Configurator.sol | 6 +- .../v0.8/mocks/MockAggregatorValidator.sol | 30 -- .../src/v0.8/mocks/MockOffchainAggregator.sol | 14 - .../{ => operatorforwarder}/Chainlink.sol | 4 +- .../ChainlinkClient.sol | 4 +- .../src/v0.8/operatorforwarder/Operator.sol | 4 +- .../interfaces/ChainlinkRequestInterface.sol | 0 .../interfaces/ENSInterface.sol | 0 .../interfaces/OperatorInterface.sol | 0 .../interfaces/OracleInterface.sol | 0 .../interfaces/PointerInterface.sol | 0 .../test}/Broken.sol | 1 + .../testhelpers/ChainlinkClientHelper.sol | 2 +- .../test/testhelpers/Chainlinked.sol | 2 +- .../test/testhelpers/Consumer.sol | 4 +- .../test/testhelpers/EmptyOracle.sol | 4 +- .../test/testhelpers/GasGuzzlingConsumer.sol | 2 +- .../MaliciousMultiWordConsumer.sol | 4 +- .../test/testhelpers/MaliciousRequester.sol | 2 +- .../test/testhelpers/MultiWordConsumer.sol | 4 +- .../mocks}/MockV3Aggregator.sol | 3 +- .../test/helpers}/LogEmitter.sol | 1 + .../test/helpers}/VRFLogEmitter.sol | 0 .../{ => shared/util}/ChainSpecificUtil.sol | 6 +- .../v0.8/tests/ChainlinkClientTestHelper.sol | 83 ---- .../src/v0.8/tests/ChainlinkTestHelper.sol | 57 --- contracts/src/v0.8/tests/Counter.sol | 26 - contracts/src/v0.8/tests/FlagsTestHelper.sol | 20 - .../src/v0.8/tests/MockETHLINKAggregator.sol | 44 -- .../src/v0.8/vrf/BatchBlockhashStore.sol | 2 +- .../{ => vrf}/ChainSpecificUtil_v0_8_6.sol | 6 +- contracts/src/v0.8/vrf/VRFCoordinatorV2.sol | 6 +- contracts/src/v0.8/vrf/VRFV2Wrapper.sol | 6 +- contracts/src/v0.8/vrf/dev/BlockhashStore.sol | 2 +- .../v0.8/vrf/dev/TrustedBlockhashStore.sol | 2 +- .../src/v0.8/vrf/dev/VRFV2PlusWrapper.sol | 4 +- .../testhelpers/VRFCoordinatorTestV2_5.sol | 2 +- .../VRFCoordinatorV2PlusUpgradedVersion.sol | 2 +- .../VRFV2PlusLoadTestWithMetrics.sol | 2 +- .../VRFV2PlusWrapperLoadTestConsumer.sol | 2 +- .../src/v0.8/vrf/test/ChainSpecificUtil.t.sol | 2 +- .../vrf/test/FixtureVRFCoordinatorV2_5.t.sol | 4 +- .../v0.8/vrf/test/VRFCoordinatorV2Mock.t.sol | 4 +- .../test/VRFCoordinatorV2Plus_Migration.t.sol | 4 +- .../vrf/test/VRFCoordinatorV2_5Mock.t.sol | 2 +- .../test/VRFCoordinatorV2_5_Arbitrum.t.sol | 4 +- .../test/VRFCoordinatorV2_5_Optimism.t.sol | 4 +- contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol | 4 +- .../vrf/test/VRFV2PlusSubscriptionAPI.t.sol | 4 +- .../src/v0.8/vrf/test/VRFV2PlusWrapper.t.sol | 4 +- .../vrf/test/VRFV2PlusWrapper_Arbitrum.t.sol | 4 +- .../vrf/test/VRFV2PlusWrapper_Migration.t.sol | 4 +- .../vrf/test/VRFV2PlusWrapper_Optimism.t.sol | 4 +- .../testhelpers/ChainSpecificUtilHelper.sol | 2 +- .../vrf/testhelpers/VRFCoordinatorTestV2.sol | 10 +- .../testhelpers/VRFV2LoadTestWithMetrics.sol | 2 +- .../testhelpers/VRFV2OwnerTestConsumer.sol | 2 +- .../VRFV2WrapperLoadTestConsumer.sol | 2 +- contracts/test/v0.8/Chainlink.test.ts | 182 ------- contracts/test/v0.8/ChainlinkClient.test.ts | 452 ------------------ contracts/test/v0.8/Flags.test.ts | 405 ---------------- .../test/v0.8/HeartbeatRequester.test.ts | 142 ------ .../v0.8/PermissionedForwardProxy.test.ts | 176 ------- contracts/test/v0.8/ValidatorProxy.test.ts | 403 ---------------- .../automation/AutomationGasAnalysis.test.ts | 2 +- .../automation/AutomationRegistrar2_1.test.ts | 2 +- .../automation/AutomationRegistrar2_3.test.ts | 2 +- .../automation/AutomationRegistry2_2.test.ts | 2 +- .../automation/AutomationRegistry2_3.test.ts | 2 +- .../v0.8/automation/KeeperCompatible.test.ts | 2 +- .../automation/UpkeepTranscoder3_0.test.ts | 2 +- .../automation/UpkeepTranscoder4_0.test.ts | 2 +- .../ZKSyncAutomationRegistry2_3.test.ts | 2 +- .../AuthorizedForwarder.test.ts | 2 +- core/chains/evm/logpoller/helper_test.go | 2 +- .../evm/logpoller/log_poller_internal_test.go | 2 +- core/chains/evm/logpoller/log_poller_test.go | 2 +- core/gethwrappers/abigen_test.go | 2 +- .../type_and_version_interface_wrapper.go | 183 ------- ...rapper-dependency-versions-do-not-edit.txt | 3 - core/gethwrappers/go_generate.go | 1 - core/gethwrappers/go_generate_logpoller.go | 7 - .../generated/log_emitter/log_emitter.go | 2 +- .../type_and_version/type_and_version.go | 183 +++++++ .../vrf_log_emitter/vrf_log_emitter.go | 2 +- ...rapper-dependency-versions-do-not-edit.txt | 5 +- core/gethwrappers/shared/go_generate.go | 5 +- core/services/keeper/registry_interface.go | 8 +- .../plugins/ccip/config/type_and_version.go | 4 +- .../batchreader/token_pool_batch_reader.go | 4 +- .../capabilities/testutils/chain_reader.go | 2 +- .../vrf/v2/listener_v2_log_listener_test.go | 4 +- .../ccip-tests/contracts/contract_deployer.go | 4 +- integration-tests/contracts/test_contracts.go | 2 +- .../automationv2_1/automationv2_1_test.go | 2 +- integration-tests/load/automationv2_1/gun.go | 2 +- .../universal/log_poller/helpers.go | 2 +- tools/ci/ccip_lcov_prune | 3 - 180 files changed, 416 insertions(+), 3111 deletions(-) create mode 100644 .changeset/cold-coats-battle.md create mode 100644 contracts/.changeset/angry-needles-approve.md delete mode 100755 contracts/scripts/native_solc_compile_all_logpoller delete mode 100644 contracts/src/v0.8/Denominations.sol delete mode 100644 contracts/src/v0.8/Flags.sol delete mode 100644 contracts/src/v0.8/PermissionedForwardProxy.sol delete mode 100644 contracts/src/v0.8/ValidatorProxy.sol rename contracts/src/v0.8/{tests => automation/mocks}/MockArbGasInfo.sol (100%) rename contracts/src/v0.8/{ => automation}/mocks/MockArbSys.sol (100%) rename contracts/src/v0.8/{tests => automation/mocks}/MockGasBoundCaller.sol (100%) rename contracts/src/v0.8/{tests => automation/mocks}/MockZKSyncSystemContext.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/AutomationConsumerBenchmark.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/CronReceiver.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/ERC20BalanceMonitorExposed.sol (89%) rename contracts/src/v0.8/{tests => automation/testhelpers}/EthBalanceMonitorExposed.sol (88%) rename contracts/src/v0.8/{tests => automation/testhelpers}/KeeperCompatibleTestHelper.sol (88%) rename contracts/src/v0.8/{tests => automation/testhelpers}/MockOVMGasPriceOracle.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/ReceiveEmitter.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/ReceiveFallbackEmitter.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/ReceiveReverter.sol (100%) rename contracts/src/v0.8/{tests => automation/testhelpers}/StreamsLookupUpkeep.sol (95%) rename contracts/src/v0.8/{tests => automation/testhelpers}/VerifiableLoadBase.sol (98%) rename contracts/src/v0.8/{tests => automation/testhelpers}/VerifiableLoadLogTriggerUpkeep.sol (97%) rename contracts/src/v0.8/{tests => automation/testhelpers}/VerifiableLoadStreamsLookupUpkeep.sol (97%) rename contracts/src/v0.8/{tests => automation/testhelpers}/VerifiableLoadUpkeep.sol (100%) rename contracts/src/v0.8/{mocks => functions/tests/v1_X/testhelpers}/MockLinkToken.sol (94%) delete mode 100644 contracts/src/v0.8/interfaces/FeedRegistryInterface.sol delete mode 100644 contracts/src/v0.8/interfaces/FlagsInterface.sol delete mode 100644 contracts/src/v0.8/interfaces/PoRAddressList.sol delete mode 100644 contracts/src/v0.8/interfaces/TypeAndVersionInterface.sol rename contracts/src/v0.8/{tests => l2ep/test}/FeedConsumer.sol (92%) rename contracts/src/v0.8/{tests => l2ep/test}/Greeter.sol (82%) rename contracts/src/v0.8/{tests => l2ep/test/mocks}/MockArbitrumInbox.sol (94%) rename contracts/src/v0.8/{tests => l2ep/test/mocks}/MockOptimismL1CrossDomainMessenger.sol (100%) rename contracts/src/v0.8/{tests => l2ep/test/mocks}/MockOptimismL2CrossDomainMessenger.sol (100%) delete mode 100644 contracts/src/v0.8/mocks/MockAggregatorValidator.sol delete mode 100644 contracts/src/v0.8/mocks/MockOffchainAggregator.sol rename contracts/src/v0.8/{ => operatorforwarder}/Chainlink.sol (96%) rename contracts/src/v0.8/{ => operatorforwarder}/ChainlinkClient.sol (98%) rename contracts/src/v0.8/{ => operatorforwarder}/interfaces/ChainlinkRequestInterface.sol (100%) rename contracts/src/v0.8/{ => operatorforwarder}/interfaces/ENSInterface.sol (100%) rename contracts/src/v0.8/{ => operatorforwarder}/interfaces/OperatorInterface.sol (100%) rename contracts/src/v0.8/{ => operatorforwarder}/interfaces/OracleInterface.sol (100%) rename contracts/src/v0.8/{ => operatorforwarder}/interfaces/PointerInterface.sol (100%) rename contracts/src/v0.8/{tests => operatorforwarder/test}/Broken.sol (95%) rename contracts/src/v0.8/{tests => shared/mocks}/MockV3Aggregator.sol (95%) rename contracts/src/v0.8/{tests => shared/test/helpers}/LogEmitter.sol (97%) rename contracts/src/v0.8/{tests => shared/test/helpers}/VRFLogEmitter.sol (100%) rename contracts/src/v0.8/{ => shared/util}/ChainSpecificUtil.sol (95%) delete mode 100644 contracts/src/v0.8/tests/ChainlinkClientTestHelper.sol delete mode 100644 contracts/src/v0.8/tests/ChainlinkTestHelper.sol delete mode 100644 contracts/src/v0.8/tests/Counter.sol delete mode 100644 contracts/src/v0.8/tests/FlagsTestHelper.sol delete mode 100644 contracts/src/v0.8/tests/MockETHLINKAggregator.sol rename contracts/src/v0.8/{ => vrf}/ChainSpecificUtil_v0_8_6.sol (96%) delete mode 100644 contracts/test/v0.8/Chainlink.test.ts delete mode 100644 contracts/test/v0.8/ChainlinkClient.test.ts delete mode 100644 contracts/test/v0.8/Flags.test.ts delete mode 100644 contracts/test/v0.8/HeartbeatRequester.test.ts delete mode 100644 contracts/test/v0.8/PermissionedForwardProxy.test.ts delete mode 100644 contracts/test/v0.8/ValidatorProxy.test.ts delete mode 100644 core/gethwrappers/generated/type_and_version_interface_wrapper/type_and_version_interface_wrapper.go delete mode 100644 core/gethwrappers/go_generate_logpoller.go rename core/gethwrappers/{ => shared}/generated/log_emitter/log_emitter.go (93%) create mode 100644 core/gethwrappers/shared/generated/type_and_version/type_and_version.go rename core/gethwrappers/{ => shared}/generated/vrf_log_emitter/vrf_log_emitter.go (88%) diff --git a/.changeset/cold-coats-battle.md b/.changeset/cold-coats-battle.md new file mode 100644 index 00000000000..1a72d025bde --- /dev/null +++ b/.changeset/cold-coats-battle.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal minor rename of various gethwrappers diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9f19d52b7ea..6e05a6f1c10 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -89,14 +89,11 @@ core/scripts/gateway @smartcontractkit/dev-services /contracts/src/v0.8/automation @smartcontractkit/dev-services /contracts/src/v0.8/ccip @smartcontractkit/ccip-onchain /contracts/src/v0.8/functions @smartcontractkit/dev-services -# TODO: interfaces folder, folder should be removed and files moved to the correct folders /contracts/src/v0.8/l2ep @smartcontractkit/bix-build /contracts/src/v0.8/llo-feeds @smartcontractkit/data-streams-engineers # TODO: mocks folder, folder should be removed and files moved to the correct folders /contracts/src/v0.8/operatorforwarder @smartcontractkit/data-feeds-engineers /contracts/src/v0.8/shared @smartcontractkit/core-solidity -# TODO: tests folder, folder should be removed and files moved to the correct folders -# TODO: transmission folder, owner should be found /contracts/src/v0.8/vrf @smartcontractkit/dev-services /contracts/src/v0.8/keystone @smartcontractkit/keystone /contracts/src/v0.8/workflow @smartcontractkit/dev-services diff --git a/.github/workflows/solidity-foundry-artifacts.yml b/.github/workflows/solidity-foundry-artifacts.yml index 620d491e82d..5665c786057 100644 --- a/.github/workflows/solidity-foundry-artifacts.yml +++ b/.github/workflows/solidity-foundry-artifacts.yml @@ -69,7 +69,6 @@ jobs: - '!contracts/src/v0.8/**/*.t.sol' - '!contracts/src/v0.8/*.t.sol' - '!contracts/src/v0.8/**/testhelpers/**' - - '!contracts/src/v0.8/testhelpers/**' - '!contracts/src/v0.8/vendor/**' other_shared: - modified|added: 'contracts/src/v0.8/(interfaces/**/*.sol|*.sol)' diff --git a/contracts/.changeset/angry-needles-approve.md b/contracts/.changeset/angry-needles-approve.md new file mode 100644 index 00000000000..689f2ac6063 --- /dev/null +++ b/contracts/.changeset/angry-needles-approve.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': minor +--- + +#internal Removal and moving of various older Solidity contracts. Unused test helpers are removed, used files are now in their proper product folders diff --git a/contracts/STYLE_GUIDE.md b/contracts/STYLE_GUIDE.md index f1faab09644..1fbdc061f23 100644 --- a/contracts/STYLE_GUIDE.md +++ b/contracts/STYLE_GUIDE.md @@ -265,9 +265,6 @@ All contracts will expose a `typeAndVersion` constant. The string has the following format: `-` with the `-dev` part only being applicable to contracts that have not been fully released. Try to fit it into 32 bytes to keep the impact on contract sizes minimal. -Note that `ITypeAndVersion` should be used, not `TypeAndVersionInterface`. - - diff --git a/contracts/scripts/lcov_prune b/contracts/scripts/lcov_prune index 9d5d592c646..9dbd6781d96 100755 --- a/contracts/scripts/lcov_prune +++ b/contracts/scripts/lcov_prune @@ -27,8 +27,6 @@ exclusion_list_ccip=( "src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol" "src/v0.8/ccip/libraries/MerkleMultiProof.sol" "src/v0.8/ccip/libraries/Pool.sol" - "src/v0.8/ConfirmedOwnerWithProposal.sol" - "src/v0.8/tests/MockV3Aggregator.sol" "src/v0.8/ccip/applications/CCIPClientExample.sol" "src/v0.8/keystone/*" ) diff --git a/contracts/scripts/native_solc_compile_all b/contracts/scripts/native_solc_compile_all index 42abac3c6b3..a66456bb6d5 100755 --- a/contracts/scripts/native_solc_compile_all +++ b/contracts/scripts/native_solc_compile_all @@ -12,7 +12,7 @@ python3 -m pip install --require-hashes -r $SCRIPTPATH/requirements.txt # 6 and 7 are legacy contracts, for each other product we have a native_solc_compile_all_$product script # These scripts can be run individually, or all together with this script. # To add new CL products, simply write a native_solc_compile_all_$product script and add it to the list below. -for product in automation events_mock feeds functions keystone llo-feeds logpoller operatorforwarder shared vrf ccip liquiditymanager workflow +for product in automation events_mock feeds functions keystone llo-feeds operatorforwarder shared vrf ccip liquiditymanager workflow do $SCRIPTPATH/native_solc_compile_all_$product done diff --git a/contracts/scripts/native_solc_compile_all_automation b/contracts/scripts/native_solc_compile_all_automation index e189e78cb0f..eb4b39201ba 100755 --- a/contracts/scripts/native_solc_compile_all_automation +++ b/contracts/scripts/native_solc_compile_all_automation @@ -73,11 +73,11 @@ compileContract automation/testhelpers/UpkeepCounter.sol compileContract automation/interfaces/StreamsLookupCompatibleInterface.sol -compileContract tests/VerifiableLoadUpkeep.sol -compileContract tests/VerifiableLoadStreamsLookupUpkeep.sol -compileContract tests/VerifiableLoadLogTriggerUpkeep.sol -compileContract tests/AutomationConsumerBenchmark.sol -compileContract tests/StreamsLookupUpkeep.sol +compileContract automation/testhelpers/VerifiableLoadUpkeep.sol +compileContract automation/testhelpers/VerifiableLoadStreamsLookupUpkeep.sol +compileContract automation/testhelpers/VerifiableLoadLogTriggerUpkeep.sol +compileContract automation/testhelpers/AutomationConsumerBenchmark.sol +compileContract automation/testhelpers/StreamsLookupUpkeep.sol SOLC_VERSION="0.8.19" diff --git a/contracts/scripts/native_solc_compile_all_feeds b/contracts/scripts/native_solc_compile_all_feeds index 66cb3f19161..c6b80958156 100755 --- a/contracts/scripts/native_solc_compile_all_feeds +++ b/contracts/scripts/native_solc_compile_all_feeds @@ -30,5 +30,5 @@ compileContract () { } # Aggregators -compileContract Chainlink.sol -compileContract ChainlinkClient.sol +compileContract operatorforwarder/Chainlink.sol +compileContract operatorforwarder/ChainlinkClient.sol diff --git a/contracts/scripts/native_solc_compile_all_logpoller b/contracts/scripts/native_solc_compile_all_logpoller deleted file mode 100755 index e8ea2a2be80..00000000000 --- a/contracts/scripts/native_solc_compile_all_logpoller +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -set -e - -echo " ┌──────────────────────────────────────────────┐" -echo " │ Compiling LogPoller contracts... │" -echo " └──────────────────────────────────────────────┘" - -SOLC_VERSION="0.8.19" -OPTIMIZE_RUNS=1000000 - - -SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -python3 -m pip install --require-hashes -r "$SCRIPTPATH"/requirements.txt -solc-select install $SOLC_VERSION -solc-select use $SOLC_VERSION -export SOLC_VERSION=$SOLC_VERSION - -ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; cd ../../ && pwd -P )" - -compileContract () { - local contract - contract=$(basename "$1" ".sol") - - solc --overwrite --optimize --optimize-runs $OPTIMIZE_RUNS --metadata-hash none \ - -o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \ - --abi --bin --allow-paths "$ROOT"/contracts/src/v0.8\ - "$ROOT"/contracts/src/v0.8/"$1" -} - - -compileContract tests/LogEmitter.sol -compileContract tests/VRFLogEmitter.sol \ No newline at end of file diff --git a/contracts/scripts/native_solc_compile_all_shared b/contracts/scripts/native_solc_compile_all_shared index d205b51321c..58f24fdaa22 100755 --- a/contracts/scripts/native_solc_compile_all_shared +++ b/contracts/scripts/native_solc_compile_all_shared @@ -33,13 +33,16 @@ compileContract() { $command } +compileContract interfaces/AggregatorV3Interface +compileContract interfaces/ITypeAndVersion compileContract token/ERC677/BurnMintERC677 compileContract token/ERC677/LinkToken compileContract token/ERC20/BurnMintERC20 compileContract test/helpers/ChainReaderTester +compileContract test/helpers/LogEmitter +compileContract test/helpers/VRFLogEmitter +compileContract mocks/MockV3Aggregator compileContract mocks/WERC20Mock -compileContract interfaces/AggregatorV3Interface compileContract openzeppelin-solidity/v4.8.3/contracts/token/ERC20/ERC20 vendor compileContract multicall/ebd8b64/src/Multicall3 vendor -compileContract MockV3Aggregator tests \ No newline at end of file diff --git a/contracts/src/v0.8/Denominations.sol b/contracts/src/v0.8/Denominations.sol deleted file mode 100644 index 6e9aa778ec7..00000000000 --- a/contracts/src/v0.8/Denominations.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -library Denominations { - address public constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; - address public constant BTC = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB; - - // Fiat currencies follow https://en.wikipedia.org/wiki/ISO_4217 - address public constant USD = address(840); - address public constant GBP = address(826); - address public constant EUR = address(978); - address public constant JPY = address(392); - address public constant KRW = address(410); - address public constant CNY = address(156); - address public constant AUD = address(36); - address public constant CAD = address(124); - address public constant CHF = address(756); - address public constant ARS = address(32); - address public constant PHP = address(608); - address public constant NZD = address(554); - address public constant SGD = address(702); - address public constant NGN = address(566); - address public constant ZAR = address(710); - address public constant RUB = address(643); - address public constant INR = address(356); - address public constant BRL = address(986); -} diff --git a/contracts/src/v0.8/Flags.sol b/contracts/src/v0.8/Flags.sol deleted file mode 100644 index de14583bcb4..00000000000 --- a/contracts/src/v0.8/Flags.sol +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {SimpleReadAccessController} from "./shared/access/SimpleReadAccessController.sol"; -import {AccessControllerInterface} from "./shared/interfaces/AccessControllerInterface.sol"; -import {FlagsInterface} from "./interfaces/FlagsInterface.sol"; - -/** - * @title The Flags contract - * @notice Allows flags to signal to any reader on the access control list. - * The owner can set flags, or designate other addresses to set flags. The - * owner must turn the flags off, other setters cannot. An expected pattern is - * to allow addresses to raise flags on themselves, so if you are subscribing to - * FlagOn events you should filter for addresses you care about. - */ -// solhint-disable gas-custom-errors -contract Flags is FlagsInterface, SimpleReadAccessController { - AccessControllerInterface public raisingAccessController; - - mapping(address => bool) private s_flags; - - event FlagRaised(address indexed subject); - event FlagLowered(address indexed subject); - event RaisingAccessControllerUpdated(address indexed previous, address indexed current); - - /** - * @param racAddress address for the raising access controller. - */ - constructor(address racAddress) { - setRaisingAccessController(racAddress); - } - - /** - * @notice read the warning flag status of a contract address. - * @param subject The contract address being checked for a flag. - * @return A true value indicates that a flag was raised and a - * false value indicates that no flag was raised. - */ - function getFlag(address subject) external view override checkAccess returns (bool) { - return s_flags[subject]; - } - - /** - * @notice read the warning flag status of a contract address. - * @param subjects An array of addresses being checked for a flag. - * @return An array of bools where a true value for any flag indicates that - * a flag was raised and a false value indicates that no flag was raised. - */ - function getFlags(address[] calldata subjects) external view override checkAccess returns (bool[] memory) { - bool[] memory responses = new bool[](subjects.length); - for (uint256 i = 0; i < subjects.length; i++) { - responses[i] = s_flags[subjects[i]]; - } - return responses; - } - - /** - * @notice enable the warning flag for an address. - * Access is controlled by raisingAccessController, except for owner - * who always has access. - * @param subject The contract address whose flag is being raised - */ - function raiseFlag(address subject) external override { - require(_allowedToRaiseFlags(), "Not allowed to raise flags"); - - _tryToRaiseFlag(subject); - } - - /** - * @notice enable the warning flags for multiple addresses. - * Access is controlled by raisingAccessController, except for owner - * who always has access. - * @param subjects List of the contract addresses whose flag is being raised - */ - function raiseFlags(address[] calldata subjects) external override { - require(_allowedToRaiseFlags(), "Not allowed to raise flags"); - - for (uint256 i = 0; i < subjects.length; i++) { - _tryToRaiseFlag(subjects[i]); - } - } - - /** - * @notice allows owner to disable the warning flags for multiple addresses. - * @param subjects List of the contract addresses whose flag is being lowered - */ - function lowerFlags(address[] calldata subjects) external override onlyOwner { - for (uint256 i = 0; i < subjects.length; i++) { - address subject = subjects[i]; - - if (s_flags[subject]) { - s_flags[subject] = false; - emit FlagLowered(subject); - } - } - } - - /** - * @notice allows owner to change the access controller for raising flags. - * @param racAddress new address for the raising access controller. - */ - function setRaisingAccessController(address racAddress) public override onlyOwner { - address previous = address(raisingAccessController); - - if (previous != racAddress) { - raisingAccessController = AccessControllerInterface(racAddress); - - emit RaisingAccessControllerUpdated(previous, racAddress); - } - } - - // PRIVATE - - function _allowedToRaiseFlags() private view returns (bool) { - return msg.sender == owner() || raisingAccessController.hasAccess(msg.sender, msg.data); - } - - function _tryToRaiseFlag(address subject) private { - if (!s_flags[subject]) { - s_flags[subject] = true; - emit FlagRaised(subject); - } - } -} diff --git a/contracts/src/v0.8/PermissionedForwardProxy.sol b/contracts/src/v0.8/PermissionedForwardProxy.sol deleted file mode 100644 index 544f89065c0..00000000000 --- a/contracts/src/v0.8/PermissionedForwardProxy.sol +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.6; - -import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import {ConfirmedOwner} from "./shared/access/ConfirmedOwner.sol"; - -/** - * @title PermissionedForwardProxy - * @notice This proxy is used to forward calls from sender to target. It maintains - * a permission list to check which sender is allowed to call which target - */ -contract PermissionedForwardProxy is ConfirmedOwner { - using Address for address; - - error PermissionNotSet(); - - event PermissionSet(address indexed sender, address target); - event PermissionRemoved(address indexed sender); - - mapping(address => address) private s_forwardPermissionList; - - constructor() ConfirmedOwner(msg.sender) {} - - /** - * @notice Verifies if msg.sender has permission to forward to target address and then forwards the handler - * @param target address of the contract to forward the handler to - * @param handler bytes to be passed to target in call data - */ - function forward(address target, bytes calldata handler) external { - if (s_forwardPermissionList[msg.sender] != target) { - revert PermissionNotSet(); - } - target.functionCall(handler); - } - - /** - * @notice Adds permission for sender to forward calls to target via this proxy. - * Note that it allows to overwrite an existing permission - * @param sender The address who will use this proxy to forward calls - * @param target The address where sender will be allowed to forward calls - */ - function setPermission(address sender, address target) external onlyOwner { - s_forwardPermissionList[sender] = target; - - emit PermissionSet(sender, target); - } - - /** - * @notice Removes permission for sender to forward calls via this proxy - * @param sender The address who will use this proxy to forward calls - */ - function removePermission(address sender) external onlyOwner { - delete s_forwardPermissionList[sender]; - - emit PermissionRemoved(sender); - } - - /** - * @notice Returns the target address that the sender can use this proxy for - * @param sender The address to fetch the permissioned target for - */ - function getPermission(address sender) external view returns (address) { - return s_forwardPermissionList[sender]; - } -} diff --git a/contracts/src/v0.8/ValidatorProxy.sol b/contracts/src/v0.8/ValidatorProxy.sol deleted file mode 100644 index 58e0e28a899..00000000000 --- a/contracts/src/v0.8/ValidatorProxy.sol +++ /dev/null @@ -1,230 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {ConfirmedOwner} from "./shared/access/ConfirmedOwner.sol"; -import {AggregatorValidatorInterface} from "./shared/interfaces/AggregatorValidatorInterface.sol"; -import {TypeAndVersionInterface} from "./interfaces/TypeAndVersionInterface.sol"; - -// solhint-disable gas-custom-errors -contract ValidatorProxy is AggregatorValidatorInterface, TypeAndVersionInterface, ConfirmedOwner { - /// @notice Uses a single storage slot to store the current address - struct AggregatorConfiguration { - address target; - bool hasNewProposal; - } - - struct ValidatorConfiguration { - AggregatorValidatorInterface target; - bool hasNewProposal; - } - - // Configuration for the current aggregator - AggregatorConfiguration private s_currentAggregator; - // Proposed aggregator address - address private s_proposedAggregator; - - // Configuration for the current validator - ValidatorConfiguration private s_currentValidator; - // Proposed validator address - AggregatorValidatorInterface private s_proposedValidator; - - event AggregatorProposed(address indexed aggregator); - event AggregatorUpgraded(address indexed previous, address indexed current); - event ValidatorProposed(AggregatorValidatorInterface indexed validator); - event ValidatorUpgraded(AggregatorValidatorInterface indexed previous, AggregatorValidatorInterface indexed current); - /// @notice The proposed aggregator called validate, but the call was not passed on to any validators - event ProposedAggregatorValidateCall( - address indexed proposed, - uint256 previousRoundId, - int256 previousAnswer, - uint256 currentRoundId, - int256 currentAnswer - ); - - /** - * @notice Construct the ValidatorProxy with an aggregator and a validator - * @param aggregator address - * @param validator address - */ - constructor(address aggregator, AggregatorValidatorInterface validator) ConfirmedOwner(msg.sender) { - s_currentAggregator = AggregatorConfiguration({target: aggregator, hasNewProposal: false}); - s_currentValidator = ValidatorConfiguration({target: validator, hasNewProposal: false}); - } - - /** - * @notice Validate a transmission - * @dev Must be called by either the `s_currentAggregator.target`, or the `s_proposedAggregator`. - * If called by the `s_currentAggregator.target` this function passes the call on to the `s_currentValidator.target` - * and the `s_proposedValidator`, if it is set. - * If called by the `s_proposedAggregator` this function emits a `ProposedAggregatorValidateCall` to signal that - * the call was received. - * @dev To guard against external `validate` calls reverting, we use raw calls here. - * We favour `call` over try-catch to ensure that failures are avoided even if the validator address is incorrectly - * set as a non-contract address. - * @dev If the `aggregator` and `validator` are the same contract or collude, this could exhibit reentrancy behavior. - * However, since that contract would have to be explicitly written for reentrancy and that the `owner` would have - * to configure this contract to use that malicious contract, we refrain from using mutex or check here. - * @dev This does not perform any checks on any roundId, so it is possible that a validator receive different reports - * for the same roundId at different points in time. Validator implementations should be aware of this. - * @param previousRoundId uint256 - * @param previousAnswer int256 - * @param currentRoundId uint256 - * @param currentAnswer int256 - * @return bool - */ - function validate( - uint256 previousRoundId, - int256 previousAnswer, - uint256 currentRoundId, - int256 currentAnswer - ) external override returns (bool) { - address currentAggregator = s_currentAggregator.target; - if (msg.sender != currentAggregator) { - address proposedAggregator = s_proposedAggregator; - require(msg.sender == proposedAggregator, "Not a configured aggregator"); - // If the aggregator is still in proposed state, emit an event and don't push to any validator. - // This is to confirm that `validate` is being called prior to upgrade. - emit ProposedAggregatorValidateCall( - proposedAggregator, - previousRoundId, - previousAnswer, - currentRoundId, - currentAnswer - ); - return true; - } - - // Send the validate call to the current validator - ValidatorConfiguration memory currentValidator = s_currentValidator; - address currentValidatorAddress = address(currentValidator.target); - require(currentValidatorAddress != address(0), "No validator set"); - // solhint-disable-next-line avoid-low-level-calls - currentValidatorAddress.call( - abi.encodeWithSelector( - AggregatorValidatorInterface.validate.selector, - previousRoundId, - previousAnswer, - currentRoundId, - currentAnswer - ) - ); - // If there is a new proposed validator, send the validate call to that validator also - if (currentValidator.hasNewProposal) { - // solhint-disable-next-line avoid-low-level-calls - address(s_proposedValidator).call( - abi.encodeWithSelector( - AggregatorValidatorInterface.validate.selector, - previousRoundId, - previousAnswer, - currentRoundId, - currentAnswer - ) - ); - } - return true; - } - - /** AGGREGATOR CONFIGURATION FUNCTIONS **/ - - /** - * @notice Propose an aggregator - * @dev A zero address can be used to unset the proposed aggregator. Only owner can call. - * @param proposed address - */ - function proposeNewAggregator(address proposed) external onlyOwner { - require(s_proposedAggregator != proposed && s_currentAggregator.target != proposed, "Invalid proposal"); - s_proposedAggregator = proposed; - // If proposed is zero address, hasNewProposal = false - s_currentAggregator.hasNewProposal = (proposed != address(0)); - emit AggregatorProposed(proposed); - } - - /** - * @notice Upgrade the aggregator by setting the current aggregator as the proposed aggregator. - * @dev Must have a proposed aggregator. Only owner can call. - */ - function upgradeAggregator() external onlyOwner { - // Get configuration in memory - AggregatorConfiguration memory current = s_currentAggregator; - address previous = current.target; - address proposed = s_proposedAggregator; - - // Perform the upgrade - require(current.hasNewProposal, "No proposal"); - s_currentAggregator = AggregatorConfiguration({target: proposed, hasNewProposal: false}); - delete s_proposedAggregator; - - emit AggregatorUpgraded(previous, proposed); - } - - /** - * @notice Get aggregator details - * @return current address - * @return hasProposal bool - * @return proposed address - */ - function getAggregators() external view returns (address current, bool hasProposal, address proposed) { - current = s_currentAggregator.target; - hasProposal = s_currentAggregator.hasNewProposal; - proposed = s_proposedAggregator; - return (current, hasProposal, proposed); - } - - /** VALIDATOR CONFIGURATION FUNCTIONS **/ - - /** - * @notice Propose an validator - * @dev A zero address can be used to unset the proposed validator. Only owner can call. - * @param proposed address - */ - function proposeNewValidator(AggregatorValidatorInterface proposed) external onlyOwner { - require(s_proposedValidator != proposed && s_currentValidator.target != proposed, "Invalid proposal"); - s_proposedValidator = proposed; - // If proposed is zero address, hasNewProposal = false - s_currentValidator.hasNewProposal = (address(proposed) != address(0)); - emit ValidatorProposed(proposed); - } - - /** - * @notice Upgrade the validator by setting the current validator as the proposed validator. - * @dev Must have a proposed validator. Only owner can call. - */ - function upgradeValidator() external onlyOwner { - // Get configuration in memory - ValidatorConfiguration memory current = s_currentValidator; - AggregatorValidatorInterface previous = current.target; - AggregatorValidatorInterface proposed = s_proposedValidator; - - // Perform the upgrade - require(current.hasNewProposal, "No proposal"); - s_currentValidator = ValidatorConfiguration({target: proposed, hasNewProposal: false}); - delete s_proposedValidator; - - emit ValidatorUpgraded(previous, proposed); - } - - /** - * @notice Get validator details - * @return current address - * @return hasProposal bool - * @return proposed address - */ - function getValidators() - external - view - returns (AggregatorValidatorInterface current, bool hasProposal, AggregatorValidatorInterface proposed) - { - current = s_currentValidator.target; - hasProposal = s_currentValidator.hasNewProposal; - proposed = s_proposedValidator; - return (current, hasProposal, proposed); - } - - /** - * @notice The type and version of this contract - * @return Type and version string - */ - function typeAndVersion() external pure virtual override returns (string memory) { - return "ValidatorProxy 1.0.0"; - } -} diff --git a/contracts/src/v0.8/automation/HeartbeatRequester.sol b/contracts/src/v0.8/automation/HeartbeatRequester.sol index 8ef7fa44422..077bb93d18f 100644 --- a/contracts/src/v0.8/automation/HeartbeatRequester.sol +++ b/contracts/src/v0.8/automation/HeartbeatRequester.sol @@ -2,7 +2,7 @@ // solhint-disable-next-line one-contract-per-file pragma solidity 0.8.6; -import {TypeAndVersionInterface} from "./../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "./../shared/interfaces/ITypeAndVersion.sol"; import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; // defines some interfaces for type safety and reduces encoding/decoding @@ -20,7 +20,7 @@ interface IOffchainAggregator { * by eligible caller, it will call a proxy for an aggregator address and request a new round. The aggregator * is gated by permissions and this requester address needs to be whitelisted. */ -contract HeartbeatRequester is TypeAndVersionInterface, ConfirmedOwner { +contract HeartbeatRequester is ITypeAndVersion, ConfirmedOwner { event HeartbeatPermitted(address indexed permittedCaller, address newProxy, address oldProxy); event HeartbeatRemoved(address indexed permittedCaller, address removedProxy); diff --git a/contracts/src/v0.8/automation/UpkeepTranscoder.sol b/contracts/src/v0.8/automation/UpkeepTranscoder.sol index 03f40d890b8..5e60270d355 100644 --- a/contracts/src/v0.8/automation/UpkeepTranscoder.sol +++ b/contracts/src/v0.8/automation/UpkeepTranscoder.sol @@ -3,14 +3,14 @@ pragma solidity ^0.8.0; import {UpkeepTranscoderInterface} from "./interfaces/UpkeepTranscoderInterface.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; import {UpkeepFormat} from "./UpkeepFormat.sol"; /** * @notice Transcoder for converting upkeep data from one keeper * registry version to another */ -contract UpkeepTranscoder is UpkeepTranscoderInterface, TypeAndVersionInterface { +contract UpkeepTranscoder is UpkeepTranscoderInterface, ITypeAndVersion { error InvalidTranscoding(); /** diff --git a/contracts/src/v0.8/automation/dev/MercuryRegistry.sol b/contracts/src/v0.8/automation/dev/MercuryRegistry.sol index 247301a7438..9035f0af927 100644 --- a/contracts/src/v0.8/automation/dev/MercuryRegistry.sol +++ b/contracts/src/v0.8/automation/dev/MercuryRegistry.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {AutomationCompatibleInterface} from "../interfaces/AutomationCompatibleInterface.sol"; import {StreamsLookupCompatibleInterface} from "../interfaces/StreamsLookupCompatibleInterface.sol"; -import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../shared/util/ChainSpecificUtil.sol"; /*--------------------------------------------------------------------------------------------------------------------+ | Mercury + Automation | diff --git a/contracts/src/v0.8/tests/MockArbGasInfo.sol b/contracts/src/v0.8/automation/mocks/MockArbGasInfo.sol similarity index 100% rename from contracts/src/v0.8/tests/MockArbGasInfo.sol rename to contracts/src/v0.8/automation/mocks/MockArbGasInfo.sol diff --git a/contracts/src/v0.8/mocks/MockArbSys.sol b/contracts/src/v0.8/automation/mocks/MockArbSys.sol similarity index 100% rename from contracts/src/v0.8/mocks/MockArbSys.sol rename to contracts/src/v0.8/automation/mocks/MockArbSys.sol diff --git a/contracts/src/v0.8/tests/MockGasBoundCaller.sol b/contracts/src/v0.8/automation/mocks/MockGasBoundCaller.sol similarity index 100% rename from contracts/src/v0.8/tests/MockGasBoundCaller.sol rename to contracts/src/v0.8/automation/mocks/MockGasBoundCaller.sol diff --git a/contracts/src/v0.8/tests/MockZKSyncSystemContext.sol b/contracts/src/v0.8/automation/mocks/MockZKSyncSystemContext.sol similarity index 100% rename from contracts/src/v0.8/tests/MockZKSyncSystemContext.sol rename to contracts/src/v0.8/automation/mocks/MockZKSyncSystemContext.sol diff --git a/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol b/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol index e0d15daab6c..f1086e7bfa4 100644 --- a/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol @@ -6,7 +6,7 @@ import "forge-std/Test.sol"; import {LinkToken} from "../../../shared/token/ERC677/LinkToken.sol"; import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; import {ERC20Mock6Decimals} from "../../mocks/ERC20Mock6Decimals.sol"; -import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {MockV3Aggregator} from "../../../shared/mocks/MockV3Aggregator.sol"; import {AutomationForwarderLogic} from "../../AutomationForwarderLogic.sol"; import {UpkeepTranscoder5_0 as Transcoder} from "../../v2_3/UpkeepTranscoder5_0.sol"; import {AutomationRegistry2_3} from "../../v2_3/AutomationRegistry2_3.sol"; diff --git a/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol b/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol index cde05ab3a22..dde8f5b3867 100644 --- a/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol @@ -6,7 +6,7 @@ import "forge-std/Test.sol"; import {LinkToken} from "../../../shared/token/ERC677/LinkToken.sol"; import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; import {ERC20Mock6Decimals} from "../../mocks/ERC20Mock6Decimals.sol"; -import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {MockV3Aggregator} from "../../../shared/mocks/MockV3Aggregator.sol"; import {AutomationForwarderLogic} from "../../AutomationForwarderLogic.sol"; import {UpkeepTranscoder5_0 as Transcoder} from "../../v2_3/UpkeepTranscoder5_0.sol"; import {ZKSyncAutomationRegistry2_3} from "../../v2_3_zksync/ZKSyncAutomationRegistry2_3.sol"; @@ -21,8 +21,8 @@ import {IERC20Metadata as IERC20} from "../../../vendor/openzeppelin-solidity/v4 import {MockUpkeep} from "../../mocks/MockUpkeep.sol"; import {IWrappedNative} from "../../interfaces/v2_3/IWrappedNative.sol"; import {WETH9} from "../WETH9.sol"; -import {MockGasBoundCaller} from "../../../tests/MockGasBoundCaller.sol"; -import {MockZKSyncSystemContext} from "../../../tests/MockZKSyncSystemContext.sol"; +import {MockGasBoundCaller} from "../../mocks/MockGasBoundCaller.sol"; +import {MockZKSyncSystemContext} from "../../mocks/MockZKSyncSystemContext.sol"; /** * @title BaseTest provides basic test setup procedures and dependencies for use by other diff --git a/contracts/src/v0.8/tests/AutomationConsumerBenchmark.sol b/contracts/src/v0.8/automation/testhelpers/AutomationConsumerBenchmark.sol similarity index 100% rename from contracts/src/v0.8/tests/AutomationConsumerBenchmark.sol rename to contracts/src/v0.8/automation/testhelpers/AutomationConsumerBenchmark.sol diff --git a/contracts/src/v0.8/tests/CronReceiver.sol b/contracts/src/v0.8/automation/testhelpers/CronReceiver.sol similarity index 100% rename from contracts/src/v0.8/tests/CronReceiver.sol rename to contracts/src/v0.8/automation/testhelpers/CronReceiver.sol diff --git a/contracts/src/v0.8/tests/ERC20BalanceMonitorExposed.sol b/contracts/src/v0.8/automation/testhelpers/ERC20BalanceMonitorExposed.sol similarity index 89% rename from contracts/src/v0.8/tests/ERC20BalanceMonitorExposed.sol rename to contracts/src/v0.8/automation/testhelpers/ERC20BalanceMonitorExposed.sol index a29ba36eeb4..748cf1cb727 100644 --- a/contracts/src/v0.8/tests/ERC20BalanceMonitorExposed.sol +++ b/contracts/src/v0.8/automation/testhelpers/ERC20BalanceMonitorExposed.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.6; -import "../automation/upkeeps/ERC20BalanceMonitor.sol"; +import "../upkeeps/ERC20BalanceMonitor.sol"; contract ERC20BalanceMonitorExposed is ERC20BalanceMonitor { constructor( diff --git a/contracts/src/v0.8/tests/EthBalanceMonitorExposed.sol b/contracts/src/v0.8/automation/testhelpers/EthBalanceMonitorExposed.sol similarity index 88% rename from contracts/src/v0.8/tests/EthBalanceMonitorExposed.sol rename to contracts/src/v0.8/automation/testhelpers/EthBalanceMonitorExposed.sol index 74cc682df23..f27c9621c39 100644 --- a/contracts/src/v0.8/tests/EthBalanceMonitorExposed.sol +++ b/contracts/src/v0.8/automation/testhelpers/EthBalanceMonitorExposed.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.6; -import "../automation/upkeeps/EthBalanceMonitor.sol"; +import "../upkeeps/EthBalanceMonitor.sol"; contract EthBalanceMonitorExposed is EthBalanceMonitor { constructor( diff --git a/contracts/src/v0.8/tests/KeeperCompatibleTestHelper.sol b/contracts/src/v0.8/automation/testhelpers/KeeperCompatibleTestHelper.sol similarity index 88% rename from contracts/src/v0.8/tests/KeeperCompatibleTestHelper.sol rename to contracts/src/v0.8/automation/testhelpers/KeeperCompatibleTestHelper.sol index 2e931c4fb4d..3c71dc2f848 100644 --- a/contracts/src/v0.8/tests/KeeperCompatibleTestHelper.sol +++ b/contracts/src/v0.8/automation/testhelpers/KeeperCompatibleTestHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../automation/KeeperCompatible.sol"; +import "../KeeperCompatible.sol"; contract KeeperCompatibleTestHelper is KeeperCompatible { function checkUpkeep(bytes calldata) external override returns (bool, bytes memory) {} diff --git a/contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol b/contracts/src/v0.8/automation/testhelpers/MockOVMGasPriceOracle.sol similarity index 100% rename from contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol rename to contracts/src/v0.8/automation/testhelpers/MockOVMGasPriceOracle.sol diff --git a/contracts/src/v0.8/tests/ReceiveEmitter.sol b/contracts/src/v0.8/automation/testhelpers/ReceiveEmitter.sol similarity index 100% rename from contracts/src/v0.8/tests/ReceiveEmitter.sol rename to contracts/src/v0.8/automation/testhelpers/ReceiveEmitter.sol diff --git a/contracts/src/v0.8/tests/ReceiveFallbackEmitter.sol b/contracts/src/v0.8/automation/testhelpers/ReceiveFallbackEmitter.sol similarity index 100% rename from contracts/src/v0.8/tests/ReceiveFallbackEmitter.sol rename to contracts/src/v0.8/automation/testhelpers/ReceiveFallbackEmitter.sol diff --git a/contracts/src/v0.8/tests/ReceiveReverter.sol b/contracts/src/v0.8/automation/testhelpers/ReceiveReverter.sol similarity index 100% rename from contracts/src/v0.8/tests/ReceiveReverter.sol rename to contracts/src/v0.8/automation/testhelpers/ReceiveReverter.sol diff --git a/contracts/src/v0.8/tests/StreamsLookupUpkeep.sol b/contracts/src/v0.8/automation/testhelpers/StreamsLookupUpkeep.sol similarity index 95% rename from contracts/src/v0.8/tests/StreamsLookupUpkeep.sol rename to contracts/src/v0.8/automation/testhelpers/StreamsLookupUpkeep.sol index dec93d5b1f7..aaf35b5c595 100644 --- a/contracts/src/v0.8/tests/StreamsLookupUpkeep.sol +++ b/contracts/src/v0.8/automation/testhelpers/StreamsLookupUpkeep.sol @@ -1,8 +1,8 @@ pragma solidity 0.8.16; -import "../automation/interfaces/AutomationCompatibleInterface.sol"; -import "../automation/interfaces/StreamsLookupCompatibleInterface.sol"; -import {ArbSys} from "../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; +import "../interfaces/AutomationCompatibleInterface.sol"; +import "../interfaces/StreamsLookupCompatibleInterface.sol"; +import {ArbSys} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; interface IVerifierProxy { /** diff --git a/contracts/src/v0.8/tests/VerifiableLoadBase.sol b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadBase.sol similarity index 98% rename from contracts/src/v0.8/tests/VerifiableLoadBase.sol rename to contracts/src/v0.8/automation/testhelpers/VerifiableLoadBase.sol index 86ebf8b8c7c..1aa181dd1d3 100644 --- a/contracts/src/v0.8/tests/VerifiableLoadBase.sol +++ b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadBase.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.16; -import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; -import {IKeeperRegistryMaster, IAutomationV21PlusCommon} from "../automation/interfaces/v2_1/IKeeperRegistryMaster.sol"; -import {ArbSys} from "../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; -import "../automation/v2_1/AutomationRegistrar2_1.sol"; -import {LogTriggerConfig} from "../automation/v2_1/AutomationUtils2_1.sol"; +import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {IKeeperRegistryMaster, IAutomationV21PlusCommon} from "../interfaces/v2_1/IKeeperRegistryMaster.sol"; +import {ArbSys} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; +import "../v2_1/AutomationRegistrar2_1.sol"; +import {LogTriggerConfig} from "../v2_1/AutomationUtils2_1.sol"; abstract contract VerifiableLoadBase is ConfirmedOwner { error IndexOutOfRange(); diff --git a/contracts/src/v0.8/tests/VerifiableLoadLogTriggerUpkeep.sol b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadLogTriggerUpkeep.sol similarity index 97% rename from contracts/src/v0.8/tests/VerifiableLoadLogTriggerUpkeep.sol rename to contracts/src/v0.8/automation/testhelpers/VerifiableLoadLogTriggerUpkeep.sol index 39b95bb0ae5..400ddd0c966 100644 --- a/contracts/src/v0.8/tests/VerifiableLoadLogTriggerUpkeep.sol +++ b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadLogTriggerUpkeep.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.16; import "./VerifiableLoadBase.sol"; -import "../automation/interfaces/ILogAutomation.sol"; -import "../automation/interfaces/StreamsLookupCompatibleInterface.sol"; +import "../interfaces/ILogAutomation.sol"; +import "../interfaces/StreamsLookupCompatibleInterface.sol"; contract VerifiableLoadLogTriggerUpkeep is VerifiableLoadBase, StreamsLookupCompatibleInterface, ILogAutomation { bool public useMercury; diff --git a/contracts/src/v0.8/tests/VerifiableLoadStreamsLookupUpkeep.sol b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadStreamsLookupUpkeep.sol similarity index 97% rename from contracts/src/v0.8/tests/VerifiableLoadStreamsLookupUpkeep.sol rename to contracts/src/v0.8/automation/testhelpers/VerifiableLoadStreamsLookupUpkeep.sol index c74aec1a790..97be9ebc81a 100644 --- a/contracts/src/v0.8/tests/VerifiableLoadStreamsLookupUpkeep.sol +++ b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadStreamsLookupUpkeep.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.16; import "./VerifiableLoadBase.sol"; -import "../automation/interfaces/StreamsLookupCompatibleInterface.sol"; +import "../interfaces/StreamsLookupCompatibleInterface.sol"; contract VerifiableLoadStreamsLookupUpkeep is VerifiableLoadBase, StreamsLookupCompatibleInterface { constructor(AutomationRegistrar2_1 _registrar, bool _useArb) VerifiableLoadBase(_registrar, _useArb) {} diff --git a/contracts/src/v0.8/tests/VerifiableLoadUpkeep.sol b/contracts/src/v0.8/automation/testhelpers/VerifiableLoadUpkeep.sol similarity index 100% rename from contracts/src/v0.8/tests/VerifiableLoadUpkeep.sol rename to contracts/src/v0.8/automation/testhelpers/VerifiableLoadUpkeep.sol diff --git a/contracts/src/v0.8/automation/v1_2/KeeperRegistrar1_2.sol b/contracts/src/v0.8/automation/v1_2/KeeperRegistrar1_2.sol index f455d56f17a..d2b6e560487 100644 --- a/contracts/src/v0.8/automation/v1_2/KeeperRegistrar1_2.sol +++ b/contracts/src/v0.8/automation/v1_2/KeeperRegistrar1_2.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.6; import "../interfaces/v1_2/KeeperRegistryInterface1_2.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; +import "../../shared/interfaces/ITypeAndVersion.sol"; import "../../shared/interfaces/LinkTokenInterface.sol"; import "../../shared/access/ConfirmedOwner.sol"; import "../../shared/interfaces/IERC677Receiver.sol"; @@ -17,7 +17,7 @@ import "../../shared/interfaces/IERC677Receiver.sol"; * The idea is to have same interface(functions,events) for UI or anyone using this contract irrespective of auto approve being enabled or not. * they can just listen to `RegistrationRequested` & `RegistrationApproved` events and know the status on registrations. */ -contract KeeperRegistrar is TypeAndVersionInterface, ConfirmedOwner, IERC677Receiver { +contract KeeperRegistrar is ITypeAndVersion, ConfirmedOwner, IERC677Receiver { /** * DISABLED: No auto approvals, all new upkeeps should be approved manually. * ENABLED_SENDER_ALLOWLIST: Auto approvals for allowed senders subject to max allowed. Manual for rest. diff --git a/contracts/src/v0.8/automation/v1_2/KeeperRegistry1_2.sol b/contracts/src/v0.8/automation/v1_2/KeeperRegistry1_2.sol index 2fa1ee6188b..5e1c8dacd48 100644 --- a/contracts/src/v0.8/automation/v1_2/KeeperRegistry1_2.sol +++ b/contracts/src/v0.8/automation/v1_2/KeeperRegistry1_2.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "../KeeperBase.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; +import "../../shared/interfaces/ITypeAndVersion.sol"; import "../../shared/interfaces/AggregatorV3Interface.sol"; import "../interfaces/KeeperCompatibleInterface.sol"; import "../interfaces/v1_2/KeeperRegistryInterface1_2.sol"; @@ -31,7 +31,7 @@ struct Upkeep { * contracts. Clients must support the Upkeep interface. */ contract KeeperRegistry1_2 is - TypeAndVersionInterface, + ITypeAndVersion, ConfirmedOwner, KeeperBase, ReentrancyGuard, diff --git a/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol b/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol index dbef8d77d19..2d56443822b 100644 --- a/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol +++ b/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol @@ -8,7 +8,7 @@ import "./KeeperRegistryBase1_3.sol"; import "./KeeperRegistryLogic1_3.sol"; import {AutomationRegistryExecutableInterface, State} from "../interfaces/v1_3/AutomationRegistryInterface1_3.sol"; import "../interfaces/MigratableKeeperRegistryInterface.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; +import "../../shared/interfaces/ITypeAndVersion.sol"; import "../../shared/interfaces/IERC677Receiver.sol"; /** @@ -18,7 +18,7 @@ import "../../shared/interfaces/IERC677Receiver.sol"; contract KeeperRegistry1_3 is KeeperRegistryBase1_3, Proxy, - TypeAndVersionInterface, + ITypeAndVersion, AutomationRegistryExecutableInterface, MigratableKeeperRegistryInterface, IERC677Receiver diff --git a/contracts/src/v0.8/automation/v2_0/KeeperRegistrar2_0.sol b/contracts/src/v0.8/automation/v2_0/KeeperRegistrar2_0.sol index c1b7e45b859..78cc06a8b20 100644 --- a/contracts/src/v0.8/automation/v2_0/KeeperRegistrar2_0.sol +++ b/contracts/src/v0.8/automation/v2_0/KeeperRegistrar2_0.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.6; import "../../shared/interfaces/LinkTokenInterface.sol"; import "../interfaces/v2_0/AutomationRegistryInterface2_0.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; +import "../../shared/interfaces/ITypeAndVersion.sol"; import "../../shared/access/ConfirmedOwner.sol"; import "../../shared/interfaces/IERC677Receiver.sol"; @@ -17,7 +17,7 @@ import "../../shared/interfaces/IERC677Receiver.sol"; * The idea is to have same interface(functions,events) for UI or anyone using this contract irrespective of auto approve being enabled or not. * they can just listen to `RegistrationRequested` & `RegistrationApproved` events and know the status on registrations. */ -contract KeeperRegistrar2_0 is TypeAndVersionInterface, ConfirmedOwner, IERC677Receiver { +contract KeeperRegistrar2_0 is ITypeAndVersion, ConfirmedOwner, IERC677Receiver { /** * DISABLED: No auto approvals, all new upkeeps should be approved manually. * ENABLED_SENDER_ALLOWLIST: Auto approvals for allowed senders subject to max allowed. Manual for rest. diff --git a/contracts/src/v0.8/automation/v2_0/UpkeepTranscoder3_0.sol b/contracts/src/v0.8/automation/v2_0/UpkeepTranscoder3_0.sol index 0a56f209cc8..df8368de691 100644 --- a/contracts/src/v0.8/automation/v2_0/UpkeepTranscoder3_0.sol +++ b/contracts/src/v0.8/automation/v2_0/UpkeepTranscoder3_0.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.6; import "../../automation/interfaces/UpkeepTranscoderInterface.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; +import "../../shared/interfaces/ITypeAndVersion.sol"; import {Upkeep as UpkeepV1} from "../../automation/v1_2/KeeperRegistry1_2.sol"; import {Upkeep as UpkeepV2} from "../../automation/v1_3/KeeperRegistryBase1_3.sol"; import {Upkeep as UpkeepV3} from "../../automation/v2_0/KeeperRegistryBase2_0.sol"; @@ -13,7 +13,7 @@ import "../../automation/UpkeepFormat.sol"; * @notice UpkeepTranscoder 3_0 allows converting upkeep data from previous keeper registry versions 1.2 and 1.3 to * registry 2.0 */ -contract UpkeepTranscoder3_0 is UpkeepTranscoderInterface, TypeAndVersionInterface { +contract UpkeepTranscoder3_0 is UpkeepTranscoderInterface, ITypeAndVersion { error InvalidTranscoding(); /** diff --git a/contracts/src/v0.8/automation/v2_1/AutomationRegistrar2_1.sol b/contracts/src/v0.8/automation/v2_1/AutomationRegistrar2_1.sol index 407dda2414e..503f16bbe4c 100644 --- a/contracts/src/v0.8/automation/v2_1/AutomationRegistrar2_1.sol +++ b/contracts/src/v0.8/automation/v2_1/AutomationRegistrar2_1.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.16; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {IKeeperRegistryMaster} from "../interfaces/v2_1/IKeeperRegistryMaster.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; @@ -17,7 +17,7 @@ import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; * The idea is to have same interface(functions,events) for UI or anyone using this contract irrespective of auto approve being enabled or not. * they can just listen to `RegistrationRequested` & `RegistrationApproved` events and know the status on registrations. */ -contract AutomationRegistrar2_1 is TypeAndVersionInterface, ConfirmedOwner, IERC677Receiver { +contract AutomationRegistrar2_1 is ITypeAndVersion, ConfirmedOwner, IERC677Receiver { /** * DISABLED: No auto approvals, all new upkeeps should be approved manually. * ENABLED_SENDER_ALLOWLIST: Auto approvals for allowed senders subject to max allowed. Manual for rest. diff --git a/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol b/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol index 53b681d4cc1..41f50de0932 100644 --- a/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol +++ b/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.16; import {UpkeepTranscoderInterfaceV2} from "../interfaces/UpkeepTranscoderInterfaceV2.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {KeeperRegistryBase2_1 as R21} from "./KeeperRegistryBase2_1.sol"; import {IAutomationForwarder} from "../interfaces/IAutomationForwarder.sol"; @@ -52,7 +52,7 @@ struct UpkeepV20 { * @notice UpkeepTranscoder allows converting upkeep data from previous keeper registry versions 1.2, 1.3, and * 2.0 to registry 2.1 */ -contract UpkeepTranscoder4_0 is UpkeepTranscoderInterfaceV2, TypeAndVersionInterface { +contract UpkeepTranscoder4_0 is UpkeepTranscoderInterfaceV2, ITypeAndVersion { error InvalidTranscoding(); /** diff --git a/contracts/src/v0.8/automation/v2_3/AutomationRegistrar2_3.sol b/contracts/src/v0.8/automation/v2_3/AutomationRegistrar2_3.sol index 2effb8d4d2f..251611cfb04 100644 --- a/contracts/src/v0.8/automation/v2_3/AutomationRegistrar2_3.sol +++ b/contracts/src/v0.8/automation/v2_3/AutomationRegistrar2_3.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {IAutomationRegistryMaster2_3} from "../interfaces/v2_3/IAutomationRegistryMaster2_3.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; import {IERC20Metadata as IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; @@ -21,7 +21,7 @@ import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/tok * The idea is to have same interface(functions,events) for UI or anyone using this contract irrespective of auto approve being enabled or not. * they can just listen to `RegistrationRequested` & `RegistrationApproved` events and know the status on registrations. */ -contract AutomationRegistrar2_3 is TypeAndVersionInterface, ConfirmedOwner, IERC677Receiver { +contract AutomationRegistrar2_3 is ITypeAndVersion, ConfirmedOwner, IERC677Receiver { using SafeERC20 for IERC20; /** diff --git a/contracts/src/v0.8/automation/v2_3/UpkeepTranscoder5_0.sol b/contracts/src/v0.8/automation/v2_3/UpkeepTranscoder5_0.sol index 32530c71257..e0312588ed9 100644 --- a/contracts/src/v0.8/automation/v2_3/UpkeepTranscoder5_0.sol +++ b/contracts/src/v0.8/automation/v2_3/UpkeepTranscoder5_0.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; import {UpkeepTranscoderInterfaceV2} from "../interfaces/UpkeepTranscoderInterfaceV2.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; enum RegistryVersion { V12, @@ -17,7 +17,7 @@ enum RegistryVersion { * @notice UpkeepTranscoder is a contract that allows converting upkeep data from previous registry versions to newer versions * @dev it currently only supports 2.3 -> 2.3 migrations */ -contract UpkeepTranscoder5_0 is UpkeepTranscoderInterfaceV2, TypeAndVersionInterface { +contract UpkeepTranscoder5_0 is UpkeepTranscoderInterfaceV2, ITypeAndVersion { error InvalidTranscoding(); string public constant override typeAndVersion = "UpkeepTranscoder 5.0.0"; diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol index a06e4cbebf8..a0f0a1076d8 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; -import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {MockV3Aggregator} from "../../../shared/mocks/MockV3Aggregator.sol"; import {FeeQuoter} from "../../FeeQuoter.sol"; import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol index d43cc5a6799..b5603a61306 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; -import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {MockV3Aggregator} from "../../../shared/mocks/MockV3Aggregator.sol"; import {FeeQuoter} from "../../FeeQuoter.sol"; import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol index 7864d4080a2..e001ccd47cf 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; -import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {MockV3Aggregator} from "../../../shared/mocks/MockV3Aggregator.sol"; import {FeeQuoter} from "../../FeeQuoter.sol"; import {Client} from "../../libraries/Client.sol"; import {Internal} from "../../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol b/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol index 444fc18fe81..f0069231e87 100644 --- a/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol @@ -7,10 +7,10 @@ import {FunctionsRouterHarness, FunctionsRouter} from "./testhelpers/FunctionsRo import {FunctionsCoordinatorHarness} from "./testhelpers/FunctionsCoordinatorHarness.sol"; import {FunctionsBilling} from "../../dev/v1_X/FunctionsBilling.sol"; import {FunctionsResponse} from "../../dev/v1_X/libraries/FunctionsResponse.sol"; -import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {MockV3Aggregator} from "../../../shared/mocks/MockV3Aggregator.sol"; import {TermsOfServiceAllowList} from "../../dev/v1_X/accessControl/TermsOfServiceAllowList.sol"; import {TermsOfServiceAllowListConfig} from "../../dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol"; -import {MockLinkToken} from "../../../mocks/MockLinkToken.sol"; +import {MockLinkToken} from "./testhelpers/MockLinkToken.sol"; import {FunctionsBillingConfig} from "../../dev/v1_X/interfaces/IFunctionsBilling.sol"; import "forge-std/Vm.sol"; diff --git a/contracts/src/v0.8/mocks/MockLinkToken.sol b/contracts/src/v0.8/functions/tests/v1_X/testhelpers/MockLinkToken.sol similarity index 94% rename from contracts/src/v0.8/mocks/MockLinkToken.sol rename to contracts/src/v0.8/functions/tests/v1_X/testhelpers/MockLinkToken.sol index a68f1b1d341..37ab5f50d56 100644 --- a/contracts/src/v0.8/mocks/MockLinkToken.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/testhelpers/MockLinkToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IERC677Receiver} from "../shared/interfaces/IERC677Receiver.sol"; +import {IERC677Receiver} from "../../../../shared/interfaces/IERC677Receiver.sol"; contract MockLinkToken { uint256 private constant TOTAL_SUPPLY = 1_000_000_000 * 1e18; diff --git a/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol b/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol deleted file mode 100644 index 6e353a79263..00000000000 --- a/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; -pragma abicoder v2; - -import {AggregatorV2V3Interface} from "../shared/interfaces/AggregatorV2V3Interface.sol"; - -// solhint-disable-next-line interface-starts-with-i -interface FeedRegistryInterface { - struct Phase { - uint16 phaseId; - uint80 startingAggregatorRoundId; - uint80 endingAggregatorRoundId; - } - - event FeedProposed( - address indexed asset, - address indexed denomination, - address indexed proposedAggregator, - address currentAggregator, - address sender - ); - event FeedConfirmed( - address indexed asset, - address indexed denomination, - address indexed latestAggregator, - address previousAggregator, - uint16 nextPhaseId, - address sender - ); - - // V3 AggregatorV3Interface - - function decimals(address base, address quote) external view returns (uint8); - - function description(address base, address quote) external view returns (string memory); - - function version(address base, address quote) external view returns (uint256); - - function latestRoundData( - address base, - address quote - ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); - - function getRoundData( - address base, - address quote, - uint80 _roundId - ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); - - // V2 AggregatorInterface - - function latestAnswer(address base, address quote) external view returns (int256 answer); - - function latestTimestamp(address base, address quote) external view returns (uint256 timestamp); - - function latestRound(address base, address quote) external view returns (uint256 roundId); - - function getAnswer(address base, address quote, uint256 roundId) external view returns (int256 answer); - - function getTimestamp(address base, address quote, uint256 roundId) external view returns (uint256 timestamp); - - // Registry getters - - function getFeed(address base, address quote) external view returns (AggregatorV2V3Interface aggregator); - - function getPhaseFeed( - address base, - address quote, - uint16 phaseId - ) external view returns (AggregatorV2V3Interface aggregator); - - function isFeedEnabled(address aggregator) external view returns (bool); - - function getPhase(address base, address quote, uint16 phaseId) external view returns (Phase memory phase); - - // Round helpers - - function getRoundFeed( - address base, - address quote, - uint80 roundId - ) external view returns (AggregatorV2V3Interface aggregator); - - function getPhaseRange( - address base, - address quote, - uint16 phaseId - ) external view returns (uint80 startingRoundId, uint80 endingRoundId); - - function getPreviousRoundId( - address base, - address quote, - uint80 roundId - ) external view returns (uint80 previousRoundId); - - function getNextRoundId(address base, address quote, uint80 roundId) external view returns (uint80 nextRoundId); - - // Feed management - - function proposeFeed(address base, address quote, address aggregator) external; - - function confirmFeed(address base, address quote, address aggregator) external; - - // Proposed aggregator - - function getProposedFeed( - address base, - address quote - ) external view returns (AggregatorV2V3Interface proposedAggregator); - - function proposedGetRoundData( - address base, - address quote, - uint80 roundId - ) external view returns (uint80 id, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); - - function proposedLatestRoundData( - address base, - address quote - ) external view returns (uint80 id, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); - - // Phases - function getCurrentPhaseId(address base, address quote) external view returns (uint16 currentPhaseId); -} diff --git a/contracts/src/v0.8/interfaces/FlagsInterface.sol b/contracts/src/v0.8/interfaces/FlagsInterface.sol deleted file mode 100644 index beb2b581e3f..00000000000 --- a/contracts/src/v0.8/interfaces/FlagsInterface.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -// solhint-disable-next-line interface-starts-with-i -interface FlagsInterface { - function getFlag(address) external view returns (bool); - - function getFlags(address[] calldata) external view returns (bool[] memory); - - function raiseFlag(address) external; - - function raiseFlags(address[] calldata) external; - - function lowerFlags(address[] calldata) external; - - function setRaisingAccessController(address) external; -} diff --git a/contracts/src/v0.8/interfaces/PoRAddressList.sol b/contracts/src/v0.8/interfaces/PoRAddressList.sol deleted file mode 100644 index af06e29a456..00000000000 --- a/contracts/src/v0.8/interfaces/PoRAddressList.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -/** - * @title Chainlink Proof-of-Reserve address list interface. - * @notice This interface enables Chainlink nodes to get the list addresses to be used in a PoR feed. A single - * contract that implements this interface can only store an address list for a single PoR feed. - * @dev All functions in this interface are expected to be called off-chain, so gas usage is not a big concern. - * This makes it possible to store addresses in optimized data types and convert them to human-readable strings - * in `getPoRAddressList()`. - */ -// solhint-disable-next-line interface-starts-with-i -interface PoRAddressList { - /// @notice Get total number of addresses in the list. - function getPoRAddressListLength() external view returns (uint256); - - /** - * @notice Get a batch of human-readable addresses from the address list. The requested batch size can be greater - * than the actual address list size, in which the full address list will be returned. - * @dev Due to limitations of gas usage in off-chain calls, we need to support fetching the addresses in batches. - * EVM addresses need to be converted to human-readable strings. The address strings need to be in the same format - * that would be used when querying the balance of that address. - * @param startIndex The index of the first address in the batch. - * @param endIndex The index of the last address in the batch. If `endIndex > getPoRAddressListLength()-1`, - * endIndex need to default to `getPoRAddressListLength()-1`. - * @return Array of addresses as strings. - */ - function getPoRAddressList(uint256 startIndex, uint256 endIndex) external view returns (string[] memory); -} diff --git a/contracts/src/v0.8/interfaces/TypeAndVersionInterface.sol b/contracts/src/v0.8/interfaces/TypeAndVersionInterface.sol deleted file mode 100644 index 786f2750acf..00000000000 --- a/contracts/src/v0.8/interfaces/TypeAndVersionInterface.sol +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -abstract contract TypeAndVersionInterface { - function typeAndVersion() external pure virtual returns (string memory); -} diff --git a/contracts/src/v0.8/tests/FeedConsumer.sol b/contracts/src/v0.8/l2ep/test/FeedConsumer.sol similarity index 92% rename from contracts/src/v0.8/tests/FeedConsumer.sol rename to contracts/src/v0.8/l2ep/test/FeedConsumer.sol index c9fc62357a6..f83781b5ac1 100644 --- a/contracts/src/v0.8/tests/FeedConsumer.sol +++ b/contracts/src/v0.8/l2ep/test/FeedConsumer.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AggregatorV2V3Interface} from "../shared/interfaces/AggregatorV2V3Interface.sol"; +import {AggregatorV2V3Interface} from "../../shared/interfaces/AggregatorV2V3Interface.sol"; contract FeedConsumer { + // solhint-disable-next-line AggregatorV2V3Interface public immutable AGGREGATOR; constructor(address feedAddress) { diff --git a/contracts/src/v0.8/tests/Greeter.sol b/contracts/src/v0.8/l2ep/test/Greeter.sol similarity index 82% rename from contracts/src/v0.8/tests/Greeter.sol rename to contracts/src/v0.8/l2ep/test/Greeter.sol index 88ccca560de..313c7c5e3b0 100644 --- a/contracts/src/v0.8/tests/Greeter.sol +++ b/contracts/src/v0.8/l2ep/test/Greeter.sol @@ -1,7 +1,8 @@ pragma solidity ^0.8.0; -import "../shared/access/ConfirmedOwner.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +// solhint-disable contract Greeter is ConfirmedOwner { string public greeting; diff --git a/contracts/src/v0.8/tests/MockArbitrumInbox.sol b/contracts/src/v0.8/l2ep/test/mocks/MockArbitrumInbox.sol similarity index 94% rename from contracts/src/v0.8/tests/MockArbitrumInbox.sol rename to contracts/src/v0.8/l2ep/test/mocks/MockArbitrumInbox.sol index 445a361b309..3ec76338b8c 100644 --- a/contracts/src/v0.8/tests/MockArbitrumInbox.sol +++ b/contracts/src/v0.8/l2ep/test/mocks/MockArbitrumInbox.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; -import {IInbox} from "../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol"; -import {IBridge} from "../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IBridge.sol"; +import {IInbox} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol"; +import {IBridge} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IBridge.sol"; contract MockArbitrumInbox is IInbox { event RetryableTicketNoRefundAliasRewriteCreated( diff --git a/contracts/src/v0.8/tests/MockOptimismL1CrossDomainMessenger.sol b/contracts/src/v0.8/l2ep/test/mocks/MockOptimismL1CrossDomainMessenger.sol similarity index 100% rename from contracts/src/v0.8/tests/MockOptimismL1CrossDomainMessenger.sol rename to contracts/src/v0.8/l2ep/test/mocks/MockOptimismL1CrossDomainMessenger.sol diff --git a/contracts/src/v0.8/tests/MockOptimismL2CrossDomainMessenger.sol b/contracts/src/v0.8/l2ep/test/mocks/MockOptimismL2CrossDomainMessenger.sol similarity index 100% rename from contracts/src/v0.8/tests/MockOptimismL2CrossDomainMessenger.sol rename to contracts/src/v0.8/l2ep/test/mocks/MockOptimismL2CrossDomainMessenger.sol diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol index 93640f4bcb4..0bd377a7cbf 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import {Greeter} from "../../../tests/Greeter.sol"; +import {Greeter} from "../Greeter.sol"; import {MultiSend} from "../../../vendor/MultiSend.sol"; import {Test} from "forge-std/Test.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol index e0a76a2b37a..62f7cd5651e 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.24; import {ArbitrumCrossDomainForwarder} from "../../../arbitrum/ArbitrumCrossDomainForwarder.sol"; -import {Greeter} from "../../../../tests/Greeter.sol"; +import {Greeter} from "../../Greeter.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; contract ArbitrumCrossDomainForwarderTest is L2EPTest { diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol index 746da3d1cef..45f67d52ccd 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.24; import {ArbitrumCrossDomainGovernor} from "../../../arbitrum/ArbitrumCrossDomainGovernor.sol"; -import {Greeter} from "../../../../tests/Greeter.sol"; +import {Greeter} from "../../Greeter.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; import {MultiSend} from "../../../../vendor/MultiSend.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol index deaa81977b7..1474b680ec2 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {SimpleWriteAccessController} from "../../../../shared/access/SimpleWriteAccessController.sol"; import {ArbitrumSequencerUptimeFeed} from "../../../arbitrum/ArbitrumSequencerUptimeFeed.sol"; import {MockAggregatorV2V3} from "../../mocks/MockAggregatorV2V3.sol"; -import {FeedConsumer} from "../../../../tests/FeedConsumer.sol"; +import {FeedConsumer} from "../../FeedConsumer.sol"; import {Flags} from "../../../Flags.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol index 95278e644b1..7497ae198e2 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol @@ -6,7 +6,7 @@ import {AccessControllerInterface} from "../../../../shared/interfaces/AccessCon import {SimpleWriteAccessController} from "../../../../shared/access/SimpleWriteAccessController.sol"; import {ArbitrumSequencerUptimeFeed} from "../../../arbitrum/ArbitrumSequencerUptimeFeed.sol"; import {ArbitrumValidator} from "../../../arbitrum/ArbitrumValidator.sol"; -import {MockArbitrumInbox} from "../../../../tests/MockArbitrumInbox.sol"; +import {MockArbitrumInbox} from "../../mocks/MockArbitrumInbox.sol"; import {MockAggregatorV2V3} from "../../mocks/MockAggregatorV2V3.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol index 28d70fa35a5..5562b413e3b 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {OptimismCrossDomainForwarder} from "../../../optimism/OptimismCrossDomainForwarder.sol"; import {MockOVMCrossDomainMessenger} from "../../mocks/optimism/MockOVMCrossDomainMessenger.sol"; -import {Greeter} from "../../../../tests/Greeter.sol"; +import {Greeter} from "../../Greeter.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; contract OptimismCrossDomainForwarderTest is L2EPTest { diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol index 57f79124512..3328a89b89d 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {OptimismCrossDomainGovernor} from "../../../optimism/OptimismCrossDomainGovernor.sol"; import {MockOVMCrossDomainMessenger} from "../../mocks/optimism/MockOVMCrossDomainMessenger.sol"; -import {Greeter} from "../../../../tests/Greeter.sol"; +import {Greeter} from "../../Greeter.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; import {MultiSend} from "../../../../vendor/MultiSend.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol index 34010c313e8..393da70d79a 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; -import {MockOptimismL1CrossDomainMessenger} from "../../../../tests/MockOptimismL1CrossDomainMessenger.sol"; -import {MockOptimismL2CrossDomainMessenger} from "../../../../tests/MockOptimismL2CrossDomainMessenger.sol"; +import {MockOptimismL1CrossDomainMessenger} from "../../mocks/MockOptimismL1CrossDomainMessenger.sol"; +import {MockOptimismL2CrossDomainMessenger} from "../../mocks/MockOptimismL2CrossDomainMessenger.sol"; import {OptimismSequencerUptimeFeed} from "../../../optimism/OptimismSequencerUptimeFeed.sol"; import {BaseSequencerUptimeFeed} from "../../../base/BaseSequencerUptimeFeed.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol index 48ff1f7778d..6fb00e708c5 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.24; import {ISequencerUptimeFeed} from "../../../interfaces/ISequencerUptimeFeed.sol"; -import {MockOptimismL1CrossDomainMessenger} from "../../../../tests/MockOptimismL1CrossDomainMessenger.sol"; -import {MockOptimismL2CrossDomainMessenger} from "../../../../tests/MockOptimismL2CrossDomainMessenger.sol"; +import {MockOptimismL1CrossDomainMessenger} from "../../mocks/MockOptimismL1CrossDomainMessenger.sol"; +import {MockOptimismL2CrossDomainMessenger} from "../../mocks/MockOptimismL2CrossDomainMessenger.sol"; import {OptimismSequencerUptimeFeed} from "../../../optimism/OptimismSequencerUptimeFeed.sol"; import {OptimismValidator} from "../../../optimism/OptimismValidator.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol index 0025c6b9937..d28df02e975 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {MockScrollCrossDomainMessenger} from "../../mocks/scroll/MockScrollCrossDomainMessenger.sol"; import {ScrollCrossDomainForwarder} from "../../../scroll/ScrollCrossDomainForwarder.sol"; -import {Greeter} from "../../../../tests/Greeter.sol"; +import {Greeter} from "../../Greeter.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; contract ScrollCrossDomainForwarderTest is L2EPTest { diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol index a2523e5feb6..544923f49f5 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {MockScrollCrossDomainMessenger} from "../../mocks/scroll/MockScrollCrossDomainMessenger.sol"; import {ScrollCrossDomainGovernor} from "../../../scroll/ScrollCrossDomainGovernor.sol"; -import {Greeter} from "../../../../tests/Greeter.sol"; +import {Greeter} from "../../Greeter.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; import {MultiSend} from "../../../../vendor/MultiSend.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/shared/BaseSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/shared/BaseSequencerUptimeFeed.t.sol index 20553e33bab..367aa00a620 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/shared/BaseSequencerUptimeFeed.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/shared/BaseSequencerUptimeFeed.t.sol @@ -5,7 +5,7 @@ import {Vm} from "forge-std/Test.sol"; import {AddressAliasHelper} from "../../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol"; import {BaseSequencerUptimeFeed} from "../../../base/BaseSequencerUptimeFeed.sol"; import {MockBaseSequencerUptimeFeed} from "../../../test/mocks/MockBaseSequencerUptimeFeed.sol"; -import {FeedConsumer} from "../../../../tests/FeedConsumer.sol"; +import {FeedConsumer} from "../../FeedConsumer.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; contract BaseSequencerUptimeFeed_Setup is L2EPTest { diff --git a/contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol index 44f550e3253..71f2f50fcb8 100644 --- a/contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IFeeManager} from "./interfaces/IFeeManager.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {Common} from "../libraries/Common.sol"; import {IRewardManager} from "./interfaces/IRewardManager.sol"; @@ -19,7 +19,7 @@ import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol"; * @author Austin Born * @notice This contract is used for the handling of fees required for users verifying reports. */ -contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { +contract FeeManager is IFeeManager, ConfirmedOwner, ITypeAndVersion { using SafeERC20 for IERC20; /// @notice list of subscribers and their discounts subscriberDiscounts[subscriber][feedId][token] @@ -158,7 +158,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { _; } - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "FeeManager 2.0.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol index 49fef51c569..9e9a58857c7 100644 --- a/contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IRewardManager} from "./interfaces/IRewardManager.sol"; import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {Common} from "../libraries/Common.sol"; import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -14,7 +14,7 @@ import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/tok * @author Austin Born * @notice This contract will be used to reward any configured recipients within a pool. Recipients will receive a share of their pool relative to their configured weight. */ -contract RewardManager is IRewardManager, ConfirmedOwner, TypeAndVersionInterface { +contract RewardManager is IRewardManager, ConfirmedOwner, ITypeAndVersion { using SafeERC20 for IERC20; // @dev The mapping of total fees collected for a particular pot: s_totalRewardRecipientFees[poolId] @@ -73,7 +73,7 @@ contract RewardManager is IRewardManager, ConfirmedOwner, TypeAndVersionInterfac i_linkAddress = linkAddress; } - // @inheritdoc TypeAndVersionInterface + // @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "RewardManager 1.1.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol index fe5742108a5..ce4fe974bd9 100644 --- a/contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IVerifier} from "./interfaces/IVerifier.sol"; import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {Common} from "../libraries/Common.sol"; @@ -18,7 +18,7 @@ uint256 constant MAX_NUM_ORACLES = 31; * a feed. The verifier contract is used to verify that such reports have * been signed by the correct signers. **/ -contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface { +contract Verifier is IVerifier, ConfirmedOwner, ITypeAndVersion { // The first byte of the mask can be 0, because we only ever have 31 oracles uint256 internal constant ORACLE_MASK = 0x0001010101010101010101010101010101010101010101010101010101010101; @@ -193,7 +193,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface { return interfaceId == this.verify.selector; } - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "Verifier 1.2.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol index c06312dd7be..e66b937f153 100644 --- a/contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol"; import {IVerifier} from "./interfaces/IVerifier.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol"; @@ -15,7 +15,7 @@ import {Common} from "../libraries/Common.sol"; * on a chain. It is responsible for taking in a verification request and routing * it to the correct verifier contract. */ -contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterface { +contract VerifierProxy is IVerifierProxy, ConfirmedOwner, ITypeAndVersion { /// @notice This event is emitted whenever a new verifier contract is set /// @param oldConfigDigest The config digest that was previously the latest config /// digest of the verifier contract at the verifier address. @@ -115,7 +115,7 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac _; } - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "VerifierProxy 2.0.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol index 08ac1d45f58..eb35cdc7956 100644 --- a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {Common} from "../libraries/Common.sol"; import {IWERC20} from "../../shared/interfaces/IWERC20.sol"; @@ -23,7 +23,7 @@ contract DestinationFeeManager is IDestinationFeeManager, IDestinationVerifierFeeManager, ConfirmedOwner, - TypeAndVersionInterface + ITypeAndVersion { using SafeERC20 for IERC20; @@ -164,7 +164,7 @@ contract DestinationFeeManager is _; } - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "DestinationFeeManager 0.4.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol index 4b4c1f50efd..9f66a423cb6 100644 --- a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IDestinationRewardManager} from "./interfaces/IDestinationRewardManager.sol"; import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {Common} from "../libraries/Common.sol"; import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -14,7 +14,7 @@ import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/tok * @author Austin Born * @notice This contract will be used to reward any configured recipients within a pool. Recipients will receive a share of their pool relative to their configured weight. */ -contract DestinationRewardManager is IDestinationRewardManager, ConfirmedOwner, TypeAndVersionInterface { +contract DestinationRewardManager is IDestinationRewardManager, ConfirmedOwner, ITypeAndVersion { using SafeERC20 for IERC20; // @dev The mapping of total fees collected for a particular pot: s_totalRewardRecipientFees[poolId] @@ -73,7 +73,7 @@ contract DestinationRewardManager is IDestinationRewardManager, ConfirmedOwner, i_linkAddress = linkAddress; } - // @inheritdoc TypeAndVersionInterface + // @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "DestinationRewardManager 0.4.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol index 8ab0f6acc23..545a0d60727 100644 --- a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IDestinationVerifier} from "./interfaces/IDestinationVerifier.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {Common} from "../libraries/Common.sol"; import {IAccessController} from "../../shared/interfaces/IAccessController.sol"; @@ -23,7 +23,7 @@ contract DestinationVerifier is IDestinationVerifier, IDestinationVerifierProxyVerifier, ConfirmedOwner, - TypeAndVersionInterface + ITypeAndVersion { /// @notice The list of DON configurations by hash(address|donConfigId) - set to true if the signer is part of the config mapping(bytes32 => bool) private s_signerByAddressAndDonConfigId; @@ -436,7 +436,7 @@ contract DestinationVerifier is interfaceId == type(IDestinationVerifierProxyVerifier).interfaceId; } - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "DestinationVerifier 0.4.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol index 6790883ba31..6a16dc20cb3 100644 --- a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {IDestinationVerifierProxy} from "./interfaces/IDestinationVerifierProxy.sol"; import {IDestinationVerifierProxyVerifier} from "./interfaces/IDestinationVerifierProxyVerifier.sol"; @@ -12,7 +12,7 @@ import {IDestinationVerifierProxyVerifier} from "./interfaces/IDestinationVerifi * @author Michael Fletcher * @notice This contract will be used to route all requests through to the assigned verifier contract. This contract does not support individual feed configurations and is aimed at being a simple proxy for the verifier contract on any destination chain. */ -contract DestinationVerifierProxy is IDestinationVerifierProxy, ConfirmedOwner, TypeAndVersionInterface { +contract DestinationVerifierProxy is IDestinationVerifierProxy, ConfirmedOwner, ITypeAndVersion { /// @notice The active verifier for this proxy IDestinationVerifierProxyVerifier private s_verifier; @@ -24,7 +24,7 @@ contract DestinationVerifierProxy is IDestinationVerifierProxy, ConfirmedOwner, constructor() ConfirmedOwner(msg.sender) {} - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "DestinationVerifierProxy 0.4.0"; } diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol index f5e5040bb8f..465292d9e0c 100644 --- a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; import {IChannelConfigStore} from "./interfaces/IChannelConfigStore.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; -contract ChannelConfigStore is ConfirmedOwner, IChannelConfigStore, TypeAndVersionInterface { +contract ChannelConfigStore is ConfirmedOwner, IChannelConfigStore, ITypeAndVersion { event NewChannelDefinition(uint256 indexed donId, uint32 version, string url, bytes32 sha); constructor() ConfirmedOwner(msg.sender) {} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol index c946b3e2508..9b72f3d4fec 100644 --- a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {IConfigurator} from "./interfaces/IConfigurator.sol"; @@ -18,7 +18,7 @@ uint256 constant MIN_SUPPORTED_ONCHAIN_CONFIG_VERSION = 1; * @notice This contract is intended to be deployed on the source chain and acts as a OCR3 configurator for LLO/Mercury **/ -contract Configurator is IConfigurator, ConfirmedOwner, TypeAndVersionInterface, IERC165 { +contract Configurator is IConfigurator, ConfirmedOwner, ITypeAndVersion, IERC165 { /// @notice This error is thrown whenever trying to set a config /// with a fault tolerance of 0 error FaultToleranceMustBePositive(); @@ -334,7 +334,7 @@ contract Configurator is IConfigurator, ConfirmedOwner, TypeAndVersionInterface, return interfaceId == type(IConfigurator).interfaceId; } - /// @inheritdoc TypeAndVersionInterface + /// @inheritdoc ITypeAndVersion function typeAndVersion() external pure override returns (string memory) { return "Configurator 0.5.0"; } diff --git a/contracts/src/v0.8/mocks/MockAggregatorValidator.sol b/contracts/src/v0.8/mocks/MockAggregatorValidator.sol deleted file mode 100644 index bdc935cd231..00000000000 --- a/contracts/src/v0.8/mocks/MockAggregatorValidator.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../shared/interfaces/AggregatorValidatorInterface.sol"; - -contract MockAggregatorValidator is AggregatorValidatorInterface { - uint8 immutable id; - - constructor(uint8 id_) { - id = id_; - } - - event ValidateCalled( - uint8 id, - uint256 previousRoundId, - int256 previousAnswer, - uint256 currentRoundId, - int256 currentAnswer - ); - - function validate( - uint256 previousRoundId, - int256 previousAnswer, - uint256 currentRoundId, - int256 currentAnswer - ) external override returns (bool) { - emit ValidateCalled(id, previousRoundId, previousAnswer, currentRoundId, currentAnswer); - return true; - } -} diff --git a/contracts/src/v0.8/mocks/MockOffchainAggregator.sol b/contracts/src/v0.8/mocks/MockOffchainAggregator.sol deleted file mode 100644 index 5366bbee0b0..00000000000 --- a/contracts/src/v0.8/mocks/MockOffchainAggregator.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.6; - -contract MockOffchainAggregator { - event RoundIdUpdated(uint80 roundId); - - uint80 public roundId; - - function requestNewRound() external returns (uint80) { - roundId++; - emit RoundIdUpdated(roundId); - return roundId; - } -} diff --git a/contracts/src/v0.8/Chainlink.sol b/contracts/src/v0.8/operatorforwarder/Chainlink.sol similarity index 96% rename from contracts/src/v0.8/Chainlink.sol rename to contracts/src/v0.8/operatorforwarder/Chainlink.sol index e511cfc8085..f3ee84cb11e 100644 --- a/contracts/src/v0.8/Chainlink.sol +++ b/contracts/src/v0.8/operatorforwarder/Chainlink.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {CBORChainlink} from "./vendor/CBORChainlink.sol"; -import {BufferChainlink} from "./vendor/BufferChainlink.sol"; +import {CBORChainlink} from "../vendor/CBORChainlink.sol"; +import {BufferChainlink} from "../vendor/BufferChainlink.sol"; /** * @title Library for common Chainlink functions diff --git a/contracts/src/v0.8/ChainlinkClient.sol b/contracts/src/v0.8/operatorforwarder/ChainlinkClient.sol similarity index 98% rename from contracts/src/v0.8/ChainlinkClient.sol rename to contracts/src/v0.8/operatorforwarder/ChainlinkClient.sol index 1d8640a27b2..c619683cbb1 100644 --- a/contracts/src/v0.8/ChainlinkClient.sol +++ b/contracts/src/v0.8/operatorforwarder/ChainlinkClient.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.0; import {Chainlink} from "./Chainlink.sol"; import {ENSInterface} from "./interfaces/ENSInterface.sol"; -import {LinkTokenInterface} from "./shared/interfaces/LinkTokenInterface.sol"; +import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; import {ChainlinkRequestInterface} from "./interfaces/ChainlinkRequestInterface.sol"; import {OperatorInterface} from "./interfaces/OperatorInterface.sol"; import {PointerInterface} from "./interfaces/PointerInterface.sol"; -import {ENSResolver as ENSResolver_Chainlink} from "./vendor/ENSResolver.sol"; +import {ENSResolver as ENSResolver_Chainlink} from "../vendor/ENSResolver.sol"; /** * @title The ChainlinkClient contract diff --git a/contracts/src/v0.8/operatorforwarder/Operator.sol b/contracts/src/v0.8/operatorforwarder/Operator.sol index 64882e43cda..ff22558a098 100644 --- a/contracts/src/v0.8/operatorforwarder/Operator.sol +++ b/contracts/src/v0.8/operatorforwarder/Operator.sol @@ -6,10 +6,10 @@ import {LinkTokenReceiver} from "./LinkTokenReceiver.sol"; import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; import {IAuthorizedReceiver} from "./interfaces/IAuthorizedReceiver.sol"; -import {OperatorInterface} from "../interfaces/OperatorInterface.sol"; +import {OperatorInterface} from "./interfaces/OperatorInterface.sol"; import {IOwnable} from "../shared/interfaces/IOwnable.sol"; import {IWithdrawal} from "./interfaces/IWithdrawal.sol"; -import {OracleInterface} from "../interfaces/OracleInterface.sol"; +import {OracleInterface} from "./interfaces/OracleInterface.sol"; import {SafeCast} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/SafeCast.sol"; // @title The Chainlink Operator contract diff --git a/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol b/contracts/src/v0.8/operatorforwarder/interfaces/ChainlinkRequestInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol rename to contracts/src/v0.8/operatorforwarder/interfaces/ChainlinkRequestInterface.sol diff --git a/contracts/src/v0.8/interfaces/ENSInterface.sol b/contracts/src/v0.8/operatorforwarder/interfaces/ENSInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/ENSInterface.sol rename to contracts/src/v0.8/operatorforwarder/interfaces/ENSInterface.sol diff --git a/contracts/src/v0.8/interfaces/OperatorInterface.sol b/contracts/src/v0.8/operatorforwarder/interfaces/OperatorInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/OperatorInterface.sol rename to contracts/src/v0.8/operatorforwarder/interfaces/OperatorInterface.sol diff --git a/contracts/src/v0.8/interfaces/OracleInterface.sol b/contracts/src/v0.8/operatorforwarder/interfaces/OracleInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/OracleInterface.sol rename to contracts/src/v0.8/operatorforwarder/interfaces/OracleInterface.sol diff --git a/contracts/src/v0.8/interfaces/PointerInterface.sol b/contracts/src/v0.8/operatorforwarder/interfaces/PointerInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/PointerInterface.sol rename to contracts/src/v0.8/operatorforwarder/interfaces/PointerInterface.sol diff --git a/contracts/src/v0.8/tests/Broken.sol b/contracts/src/v0.8/operatorforwarder/test/Broken.sol similarity index 95% rename from contracts/src/v0.8/tests/Broken.sol rename to contracts/src/v0.8/operatorforwarder/test/Broken.sol index 21fa9b014e9..6edfbd88d51 100644 --- a/contracts/src/v0.8/tests/Broken.sol +++ b/contracts/src/v0.8/operatorforwarder/test/Broken.sol @@ -1,6 +1,7 @@ pragma solidity ^0.8.0; // Broken is a contract to aid debugging and testing reverting calls during development. +// solhint-disable contract Broken { error Unauthorized(string reason, int256 reason2); diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/ChainlinkClientHelper.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/ChainlinkClientHelper.sol index 9b6ba6bb432..1efd93114d9 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/ChainlinkClientHelper.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/ChainlinkClientHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ChainlinkClient} from "../../../ChainlinkClient.sol"; +import {ChainlinkClient} from "../../ChainlinkClient.sol"; contract ChainlinkClientHelper is ChainlinkClient { bytes4 public constant FULFILL_SELECTOR = this.fulfill.selector; diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Chainlinked.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Chainlinked.sol index dba5d407623..67fda6452cd 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Chainlinked.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Chainlinked.sol @@ -1,6 +1,6 @@ pragma solidity ^0.8.0; -import {ChainlinkClient, Chainlink} from "../../../ChainlinkClient.sol"; +import {ChainlinkClient, Chainlink} from "../../ChainlinkClient.sol"; /** * @title The Chainlinked contract diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol index 3ec32dd6a29..b422081084e 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ChainlinkClient, ChainlinkRequestInterface, LinkTokenInterface} from "../../../ChainlinkClient.sol"; -import {Chainlink} from "../../../Chainlink.sol"; +import {ChainlinkClient, ChainlinkRequestInterface, LinkTokenInterface} from "../../ChainlinkClient.sol"; +import {Chainlink} from "../../Chainlink.sol"; contract Consumer is ChainlinkClient { using Chainlink for Chainlink.Request; diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/EmptyOracle.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/EmptyOracle.sol index f278791d2bb..6a4c281995a 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/EmptyOracle.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/EmptyOracle.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ChainlinkRequestInterface} from "../../../interfaces/ChainlinkRequestInterface.sol"; -import {OracleInterface} from "../../../interfaces/OracleInterface.sol"; +import {ChainlinkRequestInterface} from "../../interfaces/ChainlinkRequestInterface.sol"; +import {OracleInterface} from "../../interfaces/OracleInterface.sol"; /* solhint-disable no-empty-blocks */ contract EmptyOracle is ChainlinkRequestInterface, OracleInterface { diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/GasGuzzlingConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/GasGuzzlingConsumer.sol index 029102018b0..040eeec394e 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/GasGuzzlingConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/GasGuzzlingConsumer.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {Consumer} from "./Consumer.sol"; -import {Chainlink} from "../../../Chainlink.sol"; +import {Chainlink} from "../../Chainlink.sol"; contract GasGuzzlingConsumer is Consumer { using Chainlink for Chainlink.Request; diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol index 93af16f64fd..ad65927b40b 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ChainlinkClient} from "../../../ChainlinkClient.sol"; -import {Chainlink} from "../../../Chainlink.sol"; +import {ChainlinkClient} from "../../ChainlinkClient.sol"; +import {Chainlink} from "../../Chainlink.sol"; contract MaliciousMultiWordConsumer is ChainlinkClient { uint256 private constant ORACLE_PAYMENT = 1 ether; diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousRequester.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousRequester.sol index c01c8a60bb7..8864d8fdffb 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousRequester.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousRequester.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {MaliciousChainlink} from "./MaliciousChainlink.sol"; import {MaliciousChainlinked, Chainlink} from "./MaliciousChainlinked.sol"; -import {ChainlinkRequestInterface} from "../../../interfaces/ChainlinkRequestInterface.sol"; +import {ChainlinkRequestInterface} from "../../interfaces/ChainlinkRequestInterface.sol"; contract MaliciousRequester is MaliciousChainlinked { uint256 private constant ORACLE_PAYMENT = 1 ether; diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol index b3fdfcb813a..50420807cf9 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol @@ -1,7 +1,7 @@ pragma solidity ^0.8.0; -import {ChainlinkClient, ChainlinkRequestInterface, LinkTokenInterface} from "../../../ChainlinkClient.sol"; -import {Chainlink} from "../../../Chainlink.sol"; +import {ChainlinkClient, ChainlinkRequestInterface, LinkTokenInterface} from "../../ChainlinkClient.sol"; +import {Chainlink} from "../../Chainlink.sol"; contract MultiWordConsumer is ChainlinkClient { using Chainlink for Chainlink.Request; diff --git a/contracts/src/v0.8/tests/MockV3Aggregator.sol b/contracts/src/v0.8/shared/mocks/MockV3Aggregator.sol similarity index 95% rename from contracts/src/v0.8/tests/MockV3Aggregator.sol rename to contracts/src/v0.8/shared/mocks/MockV3Aggregator.sol index 9822d23e853..a405b7f6bef 100644 --- a/contracts/src/v0.8/tests/MockV3Aggregator.sol +++ b/contracts/src/v0.8/shared/mocks/MockV3Aggregator.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../shared/interfaces/AggregatorV2V3Interface.sol"; +import {AggregatorV2V3Interface} from "../interfaces/AggregatorV2V3Interface.sol"; /** * @title MockV3Aggregator @@ -11,6 +11,7 @@ import "../shared/interfaces/AggregatorV2V3Interface.sol"; * aggregator contract, but how the aggregator got * its answer is unimportant */ +// solhint-disable contract MockV3Aggregator is AggregatorV2V3Interface { uint256 public constant override version = 0; diff --git a/contracts/src/v0.8/tests/LogEmitter.sol b/contracts/src/v0.8/shared/test/helpers/LogEmitter.sol similarity index 97% rename from contracts/src/v0.8/tests/LogEmitter.sol rename to contracts/src/v0.8/shared/test/helpers/LogEmitter.sol index 37306cc2bc5..4bf9e9e5674 100644 --- a/contracts/src/v0.8/tests/LogEmitter.sol +++ b/contracts/src/v0.8/shared/test/helpers/LogEmitter.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable contract LogEmitter { event Log1(uint256); event Log2(uint256 indexed); diff --git a/contracts/src/v0.8/tests/VRFLogEmitter.sol b/contracts/src/v0.8/shared/test/helpers/VRFLogEmitter.sol similarity index 100% rename from contracts/src/v0.8/tests/VRFLogEmitter.sol rename to contracts/src/v0.8/shared/test/helpers/VRFLogEmitter.sol diff --git a/contracts/src/v0.8/ChainSpecificUtil.sol b/contracts/src/v0.8/shared/util/ChainSpecificUtil.sol similarity index 95% rename from contracts/src/v0.8/ChainSpecificUtil.sol rename to contracts/src/v0.8/shared/util/ChainSpecificUtil.sol index c5052cd9b25..d541f5f8486 100644 --- a/contracts/src/v0.8/ChainSpecificUtil.sol +++ b/contracts/src/v0.8/shared/util/ChainSpecificUtil.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; -import {ArbSys} from "./vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; -import {ArbGasInfo} from "./vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; -import {OVM_GasPriceOracle} from "./vendor/@eth-optimism/contracts/v0.8.9/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; +import {ArbSys} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; +import {ArbGasInfo} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; +import {OVM_GasPriceOracle} from "../../vendor/@eth-optimism/contracts/v0.8.9/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; /// @dev A library that abstracts out opcodes that behave differently across chains. /// @dev The methods below return values that are pertinent to the given chain. diff --git a/contracts/src/v0.8/tests/ChainlinkClientTestHelper.sol b/contracts/src/v0.8/tests/ChainlinkClientTestHelper.sol deleted file mode 100644 index a344138a17d..00000000000 --- a/contracts/src/v0.8/tests/ChainlinkClientTestHelper.sol +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../ChainlinkClient.sol"; - -contract ChainlinkClientTestHelper is ChainlinkClient { - constructor(address _link, address _oracle) { - _setChainlinkToken(_link); - _setChainlinkOracle(_oracle); - } - - event Request(bytes32 id, address callbackAddress, bytes4 callbackfunctionSelector, bytes data); - event LinkAmount(uint256 amount); - - function publicNewRequest(bytes32 _id, address _address, bytes memory _fulfillmentSignature) public { - Chainlink.Request memory req = _buildChainlinkRequest(_id, _address, bytes4(keccak256(_fulfillmentSignature))); - emit Request(req.id, req.callbackAddress, req.callbackFunctionId, req.buf.buf); - } - - function publicRequest(bytes32 _id, address _address, bytes memory _fulfillmentSignature, uint256 _wei) public { - Chainlink.Request memory req = _buildChainlinkRequest(_id, _address, bytes4(keccak256(_fulfillmentSignature))); - _sendChainlinkRequest(req, _wei); - } - - function publicRequestRunTo( - address _oracle, - bytes32 _id, - address _address, - bytes memory _fulfillmentSignature, - uint256 _wei - ) public { - Chainlink.Request memory run = _buildChainlinkRequest(_id, _address, bytes4(keccak256(_fulfillmentSignature))); - _sendChainlinkRequestTo(_oracle, run, _wei); - } - - function publicRequestOracleData(bytes32 _id, bytes memory _fulfillmentSignature, uint256 _wei) public { - Chainlink.Request memory req = _buildOperatorRequest(_id, bytes4(keccak256(_fulfillmentSignature))); - _sendOperatorRequest(req, _wei); - } - - function publicRequestOracleDataFrom( - address _oracle, - bytes32 _id, - bytes memory _fulfillmentSignature, - uint256 _wei - ) public { - Chainlink.Request memory run = _buildOperatorRequest(_id, bytes4(keccak256(_fulfillmentSignature))); - _sendOperatorRequestTo(_oracle, run, _wei); - } - - function publicCancelRequest( - bytes32 _requestId, - uint256 _payment, - bytes4 _callbackFunctionId, - uint256 _expiration - ) public { - _cancelChainlinkRequest(_requestId, _payment, _callbackFunctionId, _expiration); - } - - function publicChainlinkToken() public view returns (address) { - return _chainlinkTokenAddress(); - } - - function publicFulfillChainlinkRequest(bytes32 _requestId, bytes32) public { - fulfillRequest(_requestId, bytes32(0)); - } - - function fulfillRequest(bytes32 _requestId, bytes32) public { - _validateChainlinkCallback(_requestId); - } - - function publicLINK(uint256 _amount) public { - emit LinkAmount(LINK_DIVISIBILITY * _amount); - } - - function publicOracleAddress() public view returns (address) { - return _chainlinkOracleAddress(); - } - - function publicAddExternalRequest(address _oracle, bytes32 _requestId) public { - _addChainlinkExternalRequest(_oracle, _requestId); - } -} diff --git a/contracts/src/v0.8/tests/ChainlinkTestHelper.sol b/contracts/src/v0.8/tests/ChainlinkTestHelper.sol deleted file mode 100644 index d42f30c374d..00000000000 --- a/contracts/src/v0.8/tests/ChainlinkTestHelper.sol +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../Chainlink.sol"; -import "../vendor/CBORChainlink.sol"; -import "../vendor/BufferChainlink.sol"; - -contract ChainlinkTestHelper { - using Chainlink for Chainlink.Request; - using CBORChainlink for BufferChainlink.buffer; - - Chainlink.Request private req; - - event RequestData(bytes payload); - - function closeEvent() public { - emit RequestData(req.buf.buf); - } - - function setBuffer(bytes memory data) public { - Chainlink.Request memory r2 = req; - r2._setBuffer(data); - req = r2; - } - - function add(string memory _key, string memory _value) public { - Chainlink.Request memory r2 = req; - r2._add(_key, _value); - req = r2; - } - - function addBytes(string memory _key, bytes memory _value) public { - Chainlink.Request memory r2 = req; - r2._addBytes(_key, _value); - req = r2; - } - - function addInt(string memory _key, int256 _value) public { - Chainlink.Request memory r2 = req; - r2._addInt(_key, _value); - req = r2; - } - - function addUint(string memory _key, uint256 _value) public { - Chainlink.Request memory r2 = req; - r2._addUint(_key, _value); - req = r2; - } - - // Temporarily have method receive bytes32[] memory until experimental - // string[] memory can be invoked from truffle tests. - function addStringArray(string memory _key, string[] memory _values) public { - Chainlink.Request memory r2 = req; - r2._addStringArray(_key, _values); - req = r2; - } -} diff --git a/contracts/src/v0.8/tests/Counter.sol b/contracts/src/v0.8/tests/Counter.sol deleted file mode 100644 index 1ceb7891490..00000000000 --- a/contracts/src/v0.8/tests/Counter.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -contract Counter { - error AlwaysRevert(); - - uint256 public count = 0; - - function increment() public returns (uint256) { - count += 1; - return count; - } - - function reset() public { - count = 0; - } - - function alwaysRevert() public pure { - revert AlwaysRevert(); - } - - function alwaysRevertWithString() public pure { - revert("always revert"); - } -} diff --git a/contracts/src/v0.8/tests/FlagsTestHelper.sol b/contracts/src/v0.8/tests/FlagsTestHelper.sol deleted file mode 100644 index 3e35cae8911..00000000000 --- a/contracts/src/v0.8/tests/FlagsTestHelper.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../Flags.sol"; - -contract FlagsTestHelper { - Flags public flags; - - constructor(address flagsContract) { - flags = Flags(flagsContract); - } - - function getFlag(address subject) external view returns (bool) { - return flags.getFlag(subject); - } - - function getFlags(address[] calldata subjects) external view returns (bool[] memory) { - return flags.getFlags(subjects); - } -} diff --git a/contracts/src/v0.8/tests/MockETHLINKAggregator.sol b/contracts/src/v0.8/tests/MockETHLINKAggregator.sol deleted file mode 100644 index d685aac7314..00000000000 --- a/contracts/src/v0.8/tests/MockETHLINKAggregator.sol +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../shared/interfaces/AggregatorV3Interface.sol"; - -contract MockETHLINKAggregator is AggregatorV3Interface { - int256 public answer; - - constructor(int256 _answer) public { - answer = _answer; - } - - function decimals() external view override returns (uint8) { - return 18; - } - - function description() external view override returns (string memory) { - return "MockETHLINKAggregator"; - } - - function version() external view override returns (uint256) { - return 1; - } - - function getRoundData( - uint80 _roundId - ) - external - view - override - returns (uint80 roundId, int256 ans, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) - { - return (1, answer, block.timestamp, block.timestamp, 1); - } - - function latestRoundData() - external - view - override - returns (uint80 roundId, int256 ans, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) - { - return (1, answer, block.timestamp, block.timestamp, 1); - } -} diff --git a/contracts/src/v0.8/vrf/BatchBlockhashStore.sol b/contracts/src/v0.8/vrf/BatchBlockhashStore.sol index cf29f148a54..4ed6f28d381 100644 --- a/contracts/src/v0.8/vrf/BatchBlockhashStore.sol +++ b/contracts/src/v0.8/vrf/BatchBlockhashStore.sol @@ -2,7 +2,7 @@ // solhint-disable-next-line one-contract-per-file pragma solidity 0.8.19; -import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../shared/util/ChainSpecificUtil.sol"; /** * @title BatchBlockhashStore diff --git a/contracts/src/v0.8/ChainSpecificUtil_v0_8_6.sol b/contracts/src/v0.8/vrf/ChainSpecificUtil_v0_8_6.sol similarity index 96% rename from contracts/src/v0.8/ChainSpecificUtil_v0_8_6.sol rename to contracts/src/v0.8/vrf/ChainSpecificUtil_v0_8_6.sol index 0379dc86ca0..eabc061e3f5 100644 --- a/contracts/src/v0.8/ChainSpecificUtil_v0_8_6.sol +++ b/contracts/src/v0.8/vrf/ChainSpecificUtil_v0_8_6.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.6; -import {ArbSys} from "./vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; -import {ArbGasInfo} from "./vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; -import {OVM_GasPriceOracle} from "./vendor/@eth-optimism/contracts/v0.8.6/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; +import {ArbSys} from "../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; +import {ArbGasInfo} from "../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; +import {OVM_GasPriceOracle} from "../vendor/@eth-optimism/contracts/v0.8.6/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; /// @dev A library that abstracts out opcodes that behave differently across chains. /// @dev The methods below return values that are pertinent to the given chain. diff --git a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol index 717826a3b95..ab0eecd6c45 100644 --- a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol +++ b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol @@ -5,13 +5,13 @@ import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; import {BlockhashStoreInterface} from "./interfaces/BlockhashStoreInterface.sol"; import {AggregatorV3Interface} from "../shared/interfaces/AggregatorV3Interface.sol"; import {VRFCoordinatorV2Interface} from "./interfaces/VRFCoordinatorV2Interface.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; import {IERC677Receiver} from "../shared/interfaces/IERC677Receiver.sol"; import {VRF} from "./VRF.sol"; import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; import {VRFConsumerBaseV2} from "./VRFConsumerBaseV2.sol"; -import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; -contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCoordinatorV2Interface, IERC677Receiver { +import {ChainSpecificUtil} from "./ChainSpecificUtil_v0_8_6.sol"; +contract VRFCoordinatorV2 is VRF, ConfirmedOwner, ITypeAndVersion, VRFCoordinatorV2Interface, IERC677Receiver { // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i LinkTokenInterface public immutable LINK; // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i diff --git a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol index a656ef071f1..584136e3beb 100644 --- a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol +++ b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol @@ -3,20 +3,20 @@ pragma solidity ^0.8.6; import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; import {VRFConsumerBaseV2} from "./VRFConsumerBaseV2.sol"; import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; import {AggregatorV3Interface} from "../shared/interfaces/AggregatorV3Interface.sol"; import {VRFCoordinatorV2Interface} from "./interfaces/VRFCoordinatorV2Interface.sol"; import {VRFV2WrapperInterface} from "./interfaces/VRFV2WrapperInterface.sol"; import {VRFV2WrapperConsumerBase} from "./VRFV2WrapperConsumerBase.sol"; -import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; +import {ChainSpecificUtil} from "./ChainSpecificUtil_v0_8_6.sol"; /** * @notice A wrapper for VRFCoordinatorV2 that provides an interface better suited to one-off * @notice requests for randomness. */ -contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBaseV2, VRFV2WrapperInterface { +contract VRFV2Wrapper is ConfirmedOwner, ITypeAndVersion, VRFConsumerBaseV2, VRFV2WrapperInterface { event WrapperFulfillmentFailed(uint256 indexed requestId, address indexed consumer); // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i diff --git a/contracts/src/v0.8/vrf/dev/BlockhashStore.sol b/contracts/src/v0.8/vrf/dev/BlockhashStore.sol index 0bef7aeada5..8889060922b 100644 --- a/contracts/src/v0.8/vrf/dev/BlockhashStore.sol +++ b/contracts/src/v0.8/vrf/dev/BlockhashStore.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../shared/util/ChainSpecificUtil.sol"; /** * @title BlockhashStore diff --git a/contracts/src/v0.8/vrf/dev/TrustedBlockhashStore.sol b/contracts/src/v0.8/vrf/dev/TrustedBlockhashStore.sol index b3b77c8095d..b6a770168e5 100644 --- a/contracts/src/v0.8/vrf/dev/TrustedBlockhashStore.sol +++ b/contracts/src/v0.8/vrf/dev/TrustedBlockhashStore.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../shared/util/ChainSpecificUtil.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {BlockhashStore} from "./BlockhashStore.sol"; diff --git a/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol b/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol index 40fd8a90612..fced5822642 100644 --- a/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {VRFConsumerBaseV2Plus} from "./VRFConsumerBaseV2Plus.sol"; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {AggregatorV3Interface} from "../../shared/interfaces/AggregatorV3Interface.sol"; @@ -15,7 +15,7 @@ import {VRFV2PlusWrapperConsumerBase} from "./VRFV2PlusWrapperConsumerBase.sol"; * @notice requests for randomness. */ // solhint-disable-next-line max-states-count -contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBaseV2Plus, IVRFV2PlusWrapper { +contract VRFV2PlusWrapper is ConfirmedOwner, ITypeAndVersion, VRFConsumerBaseV2Plus, IVRFV2PlusWrapper { event WrapperFulfillmentFailed(uint256 indexed requestId, address indexed consumer); // upper bound limit for premium percentages to make sure fee calculations don't overflow diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol index 2e9c4a2da75..62dfddbee8d 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol @@ -5,7 +5,7 @@ import {BlockhashStoreInterface} from "../../interfaces/BlockhashStoreInterface. import {VRFOld} from "./VRFOld.sol"; import {VRFTypes} from "../../VRFTypes.sol"; import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "../VRFConsumerBaseV2Plus.sol"; -import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../../shared/util/ChainSpecificUtil.sol"; import {SubscriptionAPI} from "../SubscriptionAPI.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol index af5c56bde6c..c16a498fcb7 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol @@ -7,7 +7,7 @@ import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../interfaces/IVRFC import {VRF} from "../../../vrf/VRF.sol"; import {VRFTypes} from "../../VRFTypes.sol"; import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "../VRFConsumerBaseV2Plus.sol"; -import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../../shared/util/ChainSpecificUtil.sol"; import {SubscriptionAPI} from "../SubscriptionAPI.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol index 87e70f60e35..f70c0331cd1 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../../shared/util/ChainSpecificUtil.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol index 6935723d931..ae76fed365a 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.6; import {VRFV2PlusWrapperConsumerBase} from "../VRFV2PlusWrapperConsumerBase.sol"; import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; -import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../../shared/util/ChainSpecificUtil.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, ConfirmedOwner { diff --git a/contracts/src/v0.8/vrf/test/ChainSpecificUtil.t.sol b/contracts/src/v0.8/vrf/test/ChainSpecificUtil.t.sol index efeb9027462..3e81dd2d3c9 100644 --- a/contracts/src/v0.8/vrf/test/ChainSpecificUtil.t.sol +++ b/contracts/src/v0.8/vrf/test/ChainSpecificUtil.t.sol @@ -1,7 +1,7 @@ pragma solidity 0.8.6; import "./BaseTest.t.sol"; -import {ChainSpecificUtil} from "../../ChainSpecificUtil_v0_8_6.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; import {ArbSys} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; import {ArbGasInfo} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; diff --git a/contracts/src/v0.8/vrf/test/FixtureVRFCoordinatorV2_5.t.sol b/contracts/src/v0.8/vrf/test/FixtureVRFCoordinatorV2_5.t.sol index c1c2c7eb27c..3574143f6c5 100644 --- a/contracts/src/v0.8/vrf/test/FixtureVRFCoordinatorV2_5.t.sol +++ b/contracts/src/v0.8/vrf/test/FixtureVRFCoordinatorV2_5.t.sol @@ -8,8 +8,8 @@ import {BlockhashStore} from "../dev/BlockhashStore.sol"; import {VRFV2PlusClient} from "../dev/libraries/VRFV2PlusClient.sol"; import {ExposedVRFCoordinatorV2_5} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {VRFV2PlusConsumerExample} from "../dev/testhelpers/VRFV2PlusConsumerExample.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import "./BaseTest.t.sol"; contract FixtureVRFCoordinatorV2_5 is BaseTest, VRF { diff --git a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Mock.t.sol b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Mock.t.sol index 1716118b765..c0c0a2a2f52 100644 --- a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Mock.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Mock.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.6; import "./BaseTest.t.sol"; import {VRF} from "../VRF.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {VRFCoordinatorV2Mock} from "../mocks/VRFCoordinatorV2Mock.sol"; import {VRFConsumerV2} from "../testhelpers/VRFConsumerV2.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Plus_Migration.t.sol b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Plus_Migration.t.sol index ad239592d41..2d12f5ec82e 100644 --- a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Plus_Migration.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2Plus_Migration.t.sol @@ -6,8 +6,8 @@ import {ExposedVRFCoordinatorV2_5} from "../dev/testhelpers/ExposedVRFCoordinato import {VRFCoordinatorV2_5} from "../dev/VRFCoordinatorV2_5.sol"; import {SubscriptionAPI} from "../dev/SubscriptionAPI.sol"; import {VRFV2PlusConsumerExample} from "../dev/testhelpers/VRFV2PlusConsumerExample.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {VRFV2PlusMaliciousMigrator} from "../dev/testhelpers/VRFV2PlusMaliciousMigrator.sol"; contract VRFCoordinatorV2Plus_Migration is BaseTest { diff --git a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5Mock.t.sol b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5Mock.t.sol index 75c763c88cb..d379ab9679d 100644 --- a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5Mock.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5Mock.t.sol @@ -5,7 +5,7 @@ import {VRFV2PlusClient} from "../dev/libraries/VRFV2PlusClient.sol"; import {SubscriptionAPI} from "../dev/SubscriptionAPI.sol"; import {VRFCoordinatorV2_5Mock} from "../mocks/VRFCoordinatorV2_5Mock.sol"; import {VRFConsumerV2Plus} from "../testhelpers/VRFConsumerV2Plus.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; contract VRFCoordinatorV2_5MockTest is BaseTest { MockLinkToken internal s_linkToken; diff --git a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Arbitrum.t.sol b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Arbitrum.t.sol index 8e47b800ee5..a6c2c88d016 100644 --- a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Arbitrum.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Arbitrum.t.sol @@ -1,8 +1,8 @@ pragma solidity 0.8.19; import "./BaseTest.t.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5_Arbitrum} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5_Arbitrum.sol"; import {BlockhashStore} from "../dev/BlockhashStore.sol"; import {ArbGasInfo} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Optimism.t.sol b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Optimism.t.sol index b54dbbaaa04..0ebec3b1c56 100644 --- a/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Optimism.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFCoordinatorV2_5_Optimism.t.sol @@ -1,8 +1,8 @@ pragma solidity 0.8.19; import "./BaseTest.t.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5_Optimism} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5_Optimism.sol"; import {OptimismL1Fees} from "../dev/OptimismL1Fees.sol"; import {BlockhashStore} from "../dev/BlockhashStore.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol b/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol index dd3f54b580a..5d8366b5c7f 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import "./BaseTest.t.sol"; import {VRF} from "../VRF.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {VRFCoordinatorV2_5} from "../dev/VRFCoordinatorV2_5.sol"; import {SubscriptionAPI} from "../dev/SubscriptionAPI.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFV2PlusSubscriptionAPI.t.sol b/contracts/src/v0.8/vrf/test/VRFV2PlusSubscriptionAPI.t.sol index 4fbb44ea717..4e89c0ec5f7 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2PlusSubscriptionAPI.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2PlusSubscriptionAPI.t.sol @@ -4,8 +4,8 @@ import "./BaseTest.t.sol"; import {ExposedVRFCoordinatorV2_5} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {VRFV2PlusLoadTestWithMetrics} from "../dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol"; import {SubscriptionAPI} from "../dev/SubscriptionAPI.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; // for Strings.toString import {VmSafe} from "forge-std/Vm.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper.t.sol b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper.t.sol index 4b3a893fe1f..45e2131ce7a 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseTest.t.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {SubscriptionAPI} from "../dev/SubscriptionAPI.sol"; import {VRFV2PlusWrapperConsumerExample} from "../dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Arbitrum.t.sol b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Arbitrum.t.sol index 96f14847c41..f88dd15f2d5 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Arbitrum.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Arbitrum.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseTest.t.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5_Arbitrum} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5_Arbitrum.sol"; import {VRFV2PlusWrapper_Arbitrum} from "../dev/VRFV2PlusWrapper_Arbitrum.sol"; import {ArbGasInfo} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Migration.t.sol b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Migration.t.sol index ba77686088e..26cc5a213ec 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Migration.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Migration.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseTest.t.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {VRFCoordinatorV2Plus_V2Example} from "../dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; import {VRFV2PlusWrapperConsumerExample} from "../dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; diff --git a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Optimism.t.sol b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Optimism.t.sol index a8a97a57f0e..de56a9a7e2b 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Optimism.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2PlusWrapper_Optimism.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseTest.t.sol"; -import {MockLinkToken} from "../../mocks/MockLinkToken.sol"; -import {MockV3Aggregator} from "../../tests/MockV3Aggregator.sol"; +import {MockLinkToken} from "../../functions/tests/v1_X/testhelpers/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../shared/mocks/MockV3Aggregator.sol"; import {ExposedVRFCoordinatorV2_5_Optimism} from "../dev/testhelpers/ExposedVRFCoordinatorV2_5_Optimism.sol"; import {VRFV2PlusWrapper_Optimism} from "../dev/VRFV2PlusWrapper_Optimism.sol"; import {OptimismL1Fees} from "../dev/OptimismL1Fees.sol"; diff --git a/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol b/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol index 16a157e3547..96a088a652e 100644 --- a/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol +++ b/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ChainSpecificUtil} from "../../ChainSpecificUtil_v0_8_6.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; /// @dev A helper contract that exposes ChainSpecificUtil methods for testing contract ChainSpecificUtilHelper { diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorTestV2.sol b/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorTestV2.sol index 5774b770750..5c42a4070dc 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorTestV2.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorTestV2.sol @@ -5,19 +5,13 @@ import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol import {BlockhashStoreInterface} from "../interfaces/BlockhashStoreInterface.sol"; import {AggregatorV3Interface} from "../../shared/interfaces/AggregatorV3Interface.sol"; import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; import {VRF} from "../VRF.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; -contract VRFCoordinatorTestV2 is - VRF, - ConfirmedOwner, - TypeAndVersionInterface, - VRFCoordinatorV2Interface, - IERC677Receiver -{ +contract VRFCoordinatorTestV2 is VRF, ConfirmedOwner, ITypeAndVersion, VRFCoordinatorV2Interface, IERC677Receiver { LinkTokenInterface public immutable LINK; AggregatorV3Interface public immutable LINK_ETH_FEED; BlockhashStoreInterface public immutable BLOCKHASH_STORE; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol index b4d0104acee..3e9e7bfc47a 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.0; import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; -import {ChainSpecificUtil} from "../../ChainSpecificUtil_v0_8_6.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; /** diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol index 8f1b275397c..c0c1c659fe1 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {ChainSpecificUtil} from "../../ChainSpecificUtil_v0_8_6.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; contract VRFV2OwnerTestConsumer is VRFConsumerBaseV2, ConfirmedOwner { diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperLoadTestConsumer.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperLoadTestConsumer.sol index 3da8f17469a..9501a74b220 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperLoadTestConsumer.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.6; import {VRFV2WrapperConsumerBase} from "../VRFV2WrapperConsumerBase.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {ChainSpecificUtil} from "../../ChainSpecificUtil_v0_8_6.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil_v0_8_6.sol"; import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; contract VRFV2WrapperLoadTestConsumer is VRFV2WrapperConsumerBase, ConfirmedOwner { diff --git a/contracts/test/v0.8/Chainlink.test.ts b/contracts/test/v0.8/Chainlink.test.ts deleted file mode 100644 index 30063ca1024..00000000000 --- a/contracts/test/v0.8/Chainlink.test.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { ethers } from 'hardhat' -import { publicAbi, decodeDietCBOR, hexToBuf } from '../test-helpers/helpers' -import { assert } from 'chai' -import { Contract, ContractFactory, providers, Signer } from 'ethers' -import { Roles, getUsers } from '../test-helpers/setup' -import { makeDebug } from '../test-helpers/debug' - -const debug = makeDebug('ChainlinkTestHelper') -let concreteChainlinkFactory: ContractFactory - -let roles: Roles - -before(async () => { - roles = (await getUsers()).roles - concreteChainlinkFactory = await ethers.getContractFactory( - 'src/v0.8/tests/ChainlinkTestHelper.sol:ChainlinkTestHelper', - roles.defaultAccount, - ) -}) - -describe('ChainlinkTestHelper', () => { - let ccl: Contract - let defaultAccount: Signer - - beforeEach(async () => { - defaultAccount = roles.defaultAccount - ccl = await concreteChainlinkFactory.connect(defaultAccount).deploy() - }) - - it('has a limited public interface [ @skip-coverage ]', () => { - publicAbi(ccl, [ - 'add', - 'addBytes', - 'addInt', - 'addStringArray', - 'addUint', - 'closeEvent', - 'setBuffer', - ]) - }) - - async function parseCCLEvent(tx: providers.TransactionResponse) { - const receipt = await tx.wait() - const data = receipt.logs?.[0].data - const d = debug.extend('parseCCLEvent') - d('data %s', data) - return ethers.utils.defaultAbiCoder.decode(['bytes'], data ?? '') - } - - describe('#close', () => { - it('handles empty payloads', async () => { - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - assert.deepEqual(decoded, {}) - }) - }) - - describe('#setBuffer', () => { - it('emits the buffer', async () => { - await ccl.setBuffer('0xA161616162') - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - assert.deepEqual(decoded, { a: 'b' }) - }) - }) - - describe('#add', () => { - it('stores and logs keys and values', async () => { - await ccl.add('first', 'word!!') - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - assert.deepEqual(decoded, { first: 'word!!' }) - }) - - it('handles two entries', async () => { - await ccl.add('first', 'uno') - await ccl.add('second', 'dos') - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - - assert.deepEqual(decoded, { - first: 'uno', - second: 'dos', - }) - }) - }) - - describe('#addBytes', () => { - it('stores and logs keys and values', async () => { - await ccl.addBytes('first', '0xaabbccddeeff') - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - const expected = hexToBuf('0xaabbccddeeff') - assert.deepEqual(decoded, { first: expected }) - }) - - it('handles two entries', async () => { - await ccl.addBytes('first', '0x756E6F') - await ccl.addBytes('second', '0x646F73') - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - - const expectedFirst = hexToBuf('0x756E6F') - const expectedSecond = hexToBuf('0x646F73') - assert.deepEqual(decoded, { - first: expectedFirst, - second: expectedSecond, - }) - }) - - it('handles strings', async () => { - await ccl.addBytes('first', ethers.utils.toUtf8Bytes('apple')) - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - const expected = ethers.utils.toUtf8Bytes('apple') - assert.deepEqual(decoded, { first: expected }) - }) - }) - - describe('#addInt', () => { - it('stores and logs keys and values', async () => { - await ccl.addInt('first', 1) - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - assert.deepEqual(decoded, { first: 1 }) - }) - - it('handles two entries', async () => { - await ccl.addInt('first', 1) - await ccl.addInt('second', 2) - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - - assert.deepEqual(decoded, { - first: 1, - second: 2, - }) - }) - }) - - describe('#addUint', () => { - it('stores and logs keys and values', async () => { - await ccl.addUint('first', 1) - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - assert.deepEqual(decoded, { first: 1 }) - }) - - it('handles two entries', async () => { - await ccl.addUint('first', 1) - await ccl.addUint('second', 2) - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - - assert.deepEqual(decoded, { - first: 1, - second: 2, - }) - }) - }) - - describe('#addStringArray', () => { - it('stores and logs keys and values', async () => { - await ccl.addStringArray('word', ['seinfeld', '"4"', 'LIFE']) - const tx = await ccl.closeEvent() - const [payload] = await parseCCLEvent(tx) - const decoded = await decodeDietCBOR(payload) - assert.deepEqual(decoded, { word: ['seinfeld', '"4"', 'LIFE'] }) - }) - }) -}) diff --git a/contracts/test/v0.8/ChainlinkClient.test.ts b/contracts/test/v0.8/ChainlinkClient.test.ts deleted file mode 100644 index c5691211c1a..00000000000 --- a/contracts/test/v0.8/ChainlinkClient.test.ts +++ /dev/null @@ -1,452 +0,0 @@ -import { ethers } from 'hardhat' -import { assert } from 'chai' -import { Contract, ContractFactory } from 'ethers' -import { getUsers, Roles } from '../test-helpers/setup' -import { - convertFufillParams, - decodeCCRequest, - decodeRunRequest, - RunRequest, -} from '../test-helpers/oracle' -import { decodeDietCBOR } from '../test-helpers/helpers' -import { evmRevert } from '../test-helpers/matchers' - -let concreteChainlinkClientFactory: ContractFactory -let emptyOracleFactory: ContractFactory -let getterSetterFactory: ContractFactory -let operatorFactory: ContractFactory -let linkTokenFactory: ContractFactory - -let roles: Roles - -before(async () => { - roles = (await getUsers()).roles - - concreteChainlinkClientFactory = await ethers.getContractFactory( - 'src/v0.8/tests/ChainlinkClientTestHelper.sol:ChainlinkClientTestHelper', - roles.defaultAccount, - ) - emptyOracleFactory = await ethers.getContractFactory( - 'src/v0.8/operatorforwarder/test/testhelpers/EmptyOracle.sol:EmptyOracle', - roles.defaultAccount, - ) - getterSetterFactory = await ethers.getContractFactory( - 'src/v0.8/operatorforwarder/test/testhelpers/GetterSetter.sol:GetterSetter', - roles.defaultAccount, - ) - operatorFactory = await ethers.getContractFactory( - 'src/v0.8/operatorforwarder/Operator.sol:Operator', - roles.defaultAccount, - ) - linkTokenFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - roles.defaultAccount, - ) -}) - -describe('ChainlinkClientTestHelper', () => { - const specId = - '0x4c7b7ffb66b344fbaa64995af81e355a00000000000000000000000000000000' - let cc: Contract - let gs: Contract - let oc: Contract - let newoc: Contract - let link: Contract - - beforeEach(async () => { - link = await linkTokenFactory.connect(roles.defaultAccount).deploy() - oc = await operatorFactory - .connect(roles.defaultAccount) - .deploy(link.address, await roles.defaultAccount.getAddress()) - newoc = await operatorFactory - .connect(roles.defaultAccount) - .deploy(link.address, await roles.defaultAccount.getAddress()) - gs = await getterSetterFactory.connect(roles.defaultAccount).deploy() - cc = await concreteChainlinkClientFactory - .connect(roles.defaultAccount) - .deploy(link.address, oc.address) - }) - - describe('#newRequest', () => { - it('forwards the information to the oracle contract through the link token', async () => { - const tx = await cc.publicNewRequest( - specId, - gs.address, - ethers.utils.toUtf8Bytes('requestedBytes32(bytes32,bytes32)'), - ) - const receipt = await tx.wait() - - assert.equal(1, receipt.logs?.length) - const [jId, cbAddr, cbFId, cborData] = receipt.logs - ? decodeCCRequest(receipt.logs[0]) - : [] - const params = decodeDietCBOR(cborData ?? '') - - assert.equal(specId, jId) - assert.equal(gs.address, cbAddr) - assert.equal('0xed53e511', cbFId) - assert.deepEqual({}, params) - }) - }) - - describe('#chainlinkRequest(Request)', () => { - it('emits an event from the contract showing the run ID', async () => { - const tx = await cc.publicRequest( - specId, - cc.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - - const { events, logs } = await tx.wait() - - assert.equal(4, events?.length) - - assert.equal(logs?.[0].address, cc.address) - assert.equal(events?.[0].event, 'ChainlinkRequested') - }) - }) - - describe('#chainlinkRequestTo(Request)', () => { - it('emits an event from the contract showing the run ID', async () => { - const tx = await cc.publicRequestRunTo( - newoc.address, - specId, - cc.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const { events } = await tx.wait() - - assert.equal(4, events?.length) - assert.equal(events?.[0].event, 'ChainlinkRequested') - }) - - it('emits an event on the target oracle contract', async () => { - const tx = await cc.publicRequestRunTo( - newoc.address, - specId, - cc.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const { logs } = await tx.wait() - const event = logs && newoc.interface.parseLog(logs[3]) - - assert.equal(4, logs?.length) - assert.equal(event?.name, 'OracleRequest') - }) - - it('does not modify the stored oracle address', async () => { - await cc.publicRequestRunTo( - newoc.address, - specId, - cc.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - - const actualOracleAddress = await cc.publicOracleAddress() - assert.equal(oc.address, actualOracleAddress) - }) - }) - - describe('#requestOracleData', () => { - it('emits an event from the contract showing the run ID', async () => { - const tx = await cc.publicRequestOracleData( - specId, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - - const { events, logs } = await tx.wait() - - assert.equal(4, events?.length) - - assert.equal(logs?.[0].address, cc.address) - assert.equal(events?.[0].event, 'ChainlinkRequested') - }) - }) - - describe('#requestOracleDataFrom', () => { - it('emits an event from the contract showing the run ID', async () => { - const tx = await cc.publicRequestOracleDataFrom( - newoc.address, - specId, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const { events } = await tx.wait() - - assert.equal(4, events?.length) - assert.equal(events?.[0].event, 'ChainlinkRequested') - }) - - it('emits an event on the target oracle contract', async () => { - const tx = await cc.publicRequestOracleDataFrom( - newoc.address, - specId, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const { logs } = await tx.wait() - const event = logs && newoc.interface.parseLog(logs[3]) - - assert.equal(4, logs?.length) - assert.equal(event?.name, 'OracleRequest') - }) - - it('does not modify the stored oracle address', async () => { - await cc.publicRequestOracleDataFrom( - newoc.address, - specId, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - - const actualOracleAddress = await cc.publicOracleAddress() - assert.equal(oc.address, actualOracleAddress) - }) - }) - - describe('#cancelChainlinkRequest', () => { - let requestId: string - // a concrete chainlink attached to an empty oracle - let ecc: Contract - - beforeEach(async () => { - const emptyOracle = await emptyOracleFactory - .connect(roles.defaultAccount) - .deploy() - ecc = await concreteChainlinkClientFactory - .connect(roles.defaultAccount) - .deploy(link.address, emptyOracle.address) - - const tx = await ecc.publicRequest( - specId, - ecc.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const { events } = await tx.wait() - requestId = (events?.[0]?.args as any).id - }) - - it('emits an event from the contract showing the run was cancelled', async () => { - const tx = await ecc.publicCancelRequest( - requestId, - 0, - ethers.utils.hexZeroPad('0x', 4), - 0, - ) - const { events } = await tx.wait() - - assert.equal(1, events?.length) - assert.equal(events?.[0].event, 'ChainlinkCancelled') - assert.equal(requestId, (events?.[0].args as any).id) - }) - - it('throws if given a bogus event ID', async () => { - await evmRevert( - ecc.publicCancelRequest( - ethers.utils.formatBytes32String('bogusId'), - 0, - ethers.utils.hexZeroPad('0x', 4), - 0, - ), - ) - }) - }) - - describe('#recordChainlinkFulfillment(modifier)', () => { - let request: RunRequest - - beforeEach(async () => { - await oc.setAuthorizedSenders([await roles.defaultAccount.getAddress()]) - const tx = await cc.publicRequest( - specId, - cc.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const { logs } = await tx.wait() - - request = decodeRunRequest(logs?.[3]) - }) - - it('emits an event marking the request fulfilled', async () => { - const tx = await oc - .connect(roles.defaultAccount) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ) - const { logs } = await tx.wait() - - const event = logs && cc.interface.parseLog(logs[1]) - - assert.equal(2, logs?.length) - assert.equal(event?.name, 'ChainlinkFulfilled') - assert.equal(request.requestId, event?.args.id) - }) - - it('should only allow one fulfillment per id', async () => { - await oc - .connect(roles.defaultAccount) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ) - - await evmRevert( - oc - .connect(roles.defaultAccount) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ), - 'Must have a valid requestId', - ) - }) - - it('should only allow the oracle to fulfill the request', async () => { - await evmRevert( - oc - .connect(roles.stranger) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ), - 'Not authorized sender', - ) - }) - }) - - describe('#fulfillChainlinkRequest(function)', () => { - let request: RunRequest - - beforeEach(async () => { - await oc.setAuthorizedSenders([await roles.defaultAccount.getAddress()]) - const tx = await cc.publicRequest( - specId, - cc.address, - ethers.utils.toUtf8Bytes( - 'publicFulfillChainlinkRequest(bytes32,bytes32)', - ), - 0, - ) - const { logs } = await tx.wait() - - request = decodeRunRequest(logs?.[3]) - }) - - it('emits an event marking the request fulfilled', async () => { - await oc.setAuthorizedSenders([await roles.defaultAccount.getAddress()]) - const tx = await oc - .connect(roles.defaultAccount) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ) - - const { logs } = await tx.wait() - const event = logs && cc.interface.parseLog(logs[1]) - - assert.equal(2, logs?.length) - assert.equal(event?.name, 'ChainlinkFulfilled') - assert.equal(request.requestId, event?.args?.id) - }) - - it('should only allow one fulfillment per id', async () => { - await oc - .connect(roles.defaultAccount) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ) - - await evmRevert( - oc - .connect(roles.defaultAccount) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ), - 'Must have a valid requestId', - ) - }) - - it('should only allow the oracle to fulfill the request', async () => { - await evmRevert( - oc - .connect(roles.stranger) - .fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ), - 'Not authorized sender', - ) - }) - }) - - describe('#chainlinkToken', () => { - it('returns the Link Token address', async () => { - const addr = await cc.publicChainlinkToken() - assert.equal(addr, link.address) - }) - }) - - describe('#addExternalRequest', () => { - let mock: Contract - let request: RunRequest - - beforeEach(async () => { - mock = await concreteChainlinkClientFactory - .connect(roles.defaultAccount) - .deploy(link.address, oc.address) - - const tx = await cc.publicRequest( - specId, - mock.address, - ethers.utils.toUtf8Bytes('fulfillRequest(bytes32,bytes32)'), - 0, - ) - const receipt = await tx.wait() - - request = decodeRunRequest(receipt.logs?.[3]) - await mock.publicAddExternalRequest(oc.address, request.requestId) - }) - - it('allows the external request to be fulfilled', async () => { - await oc.setAuthorizedSenders([await roles.defaultAccount.getAddress()]) - await oc.fulfillOracleRequest( - ...convertFufillParams( - request, - ethers.utils.formatBytes32String('hi mom!'), - ), - ) - }) - - it('does not allow the same requestId to be used', async () => { - await evmRevert( - cc.publicAddExternalRequest(newoc.address, request.requestId), - ) - }) - }) -}) diff --git a/contracts/test/v0.8/Flags.test.ts b/contracts/test/v0.8/Flags.test.ts deleted file mode 100644 index eff0912c9e1..00000000000 --- a/contracts/test/v0.8/Flags.test.ts +++ /dev/null @@ -1,405 +0,0 @@ -import { ethers } from 'hardhat' -import { publicAbi } from '../test-helpers/helpers' -import { assert, expect } from 'chai' -import { Contract, ContractFactory } from 'ethers' -import { Personas, getUsers } from '../test-helpers/setup' - -let personas: Personas - -let controllerFactory: ContractFactory -let flagsFactory: ContractFactory -let consumerFactory: ContractFactory - -let controller: Contract -let flags: Contract -let consumer: Contract - -before(async () => { - personas = (await getUsers()).personas - controllerFactory = await ethers.getContractFactory( - 'src/v0.8/shared/access/SimpleWriteAccessController.sol:SimpleWriteAccessController', - personas.Nelly, - ) - consumerFactory = await ethers.getContractFactory( - 'src/v0.8/tests/FlagsTestHelper.sol:FlagsTestHelper', - personas.Nelly, - ) - flagsFactory = await ethers.getContractFactory( - 'src/v0.8/Flags.sol:Flags', - personas.Nelly, - ) -}) - -describe('Flags', () => { - beforeEach(async () => { - controller = await controllerFactory.deploy() - flags = await flagsFactory.deploy(controller.address) - await flags.disableAccessCheck() - consumer = await consumerFactory.deploy(flags.address) - }) - - it('has a limited public interface [ @skip-coverage ]', async () => { - publicAbi(flags, [ - 'getFlag', - 'getFlags', - 'lowerFlags', - 'raiseFlag', - 'raiseFlags', - 'raisingAccessController', - 'setRaisingAccessController', - // Ownable methods: - 'acceptOwnership', - 'owner', - 'transferOwnership', - // AccessControl methods: - 'addAccess', - 'disableAccessCheck', - 'enableAccessCheck', - 'removeAccess', - 'checkEnabled', - 'hasAccess', - ]) - }) - - describe('#raiseFlag', () => { - describe('when called by the owner', () => { - it('updates the warning flag', async () => { - assert.equal(false, await flags.getFlag(consumer.address)) - - await flags.connect(personas.Nelly).raiseFlag(consumer.address) - - assert.equal(true, await flags.getFlag(consumer.address)) - }) - - it('emits an event log', async () => { - await expect(flags.connect(personas.Nelly).raiseFlag(consumer.address)) - .to.emit(flags, 'FlagRaised') - .withArgs(consumer.address) - }) - - describe('if a flag has already been raised', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).raiseFlag(consumer.address) - }) - - it('emits an event log', async () => { - const tx = await flags - .connect(personas.Nelly) - .raiseFlag(consumer.address) - const receipt = await tx.wait() - assert.equal(0, receipt.events?.length) - }) - }) - }) - - describe('when called by an enabled setter', () => { - beforeEach(async () => { - await controller - .connect(personas.Nelly) - .addAccess(await personas.Neil.getAddress()) - }) - - it('sets the flags', async () => { - await flags.connect(personas.Neil).raiseFlag(consumer.address), - assert.equal(true, await flags.getFlag(consumer.address)) - }) - }) - - describe('when called by a non-enabled setter', () => { - it('reverts', async () => { - await expect( - flags.connect(personas.Neil).raiseFlag(consumer.address), - ).to.be.revertedWith('Not allowed to raise flags') - }) - }) - - describe('when called when there is no raisingAccessController', () => { - beforeEach(async () => { - await expect( - flags - .connect(personas.Nelly) - .setRaisingAccessController( - '0x0000000000000000000000000000000000000000', - ), - ).to.emit(flags, 'RaisingAccessControllerUpdated') - assert.equal( - '0x0000000000000000000000000000000000000000', - await flags.raisingAccessController(), - ) - }) - - it('succeeds for the owner', async () => { - await flags.connect(personas.Nelly).raiseFlag(consumer.address) - assert.equal(true, await flags.getFlag(consumer.address)) - }) - - it('reverts for non-owner', async () => { - await expect(flags.connect(personas.Neil).raiseFlag(consumer.address)) - .to.be.reverted - }) - }) - }) - - describe('#raiseFlags', () => { - describe('when called by the owner', () => { - it('updates the warning flag', async () => { - assert.equal(false, await flags.getFlag(consumer.address)) - - await flags.connect(personas.Nelly).raiseFlags([consumer.address]) - - assert.equal(true, await flags.getFlag(consumer.address)) - }) - - it('emits an event log', async () => { - await expect( - flags.connect(personas.Nelly).raiseFlags([consumer.address]), - ) - .to.emit(flags, 'FlagRaised') - .withArgs(consumer.address) - }) - - describe('if a flag has already been raised', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).raiseFlags([consumer.address]) - }) - - it('emits an event log', async () => { - const tx = await flags - .connect(personas.Nelly) - .raiseFlags([consumer.address]) - const receipt = await tx.wait() - assert.equal(0, receipt.events?.length) - }) - }) - }) - - describe('when called by an enabled setter', () => { - beforeEach(async () => { - await controller - .connect(personas.Nelly) - .addAccess(await personas.Neil.getAddress()) - }) - - it('sets the flags', async () => { - await flags.connect(personas.Neil).raiseFlags([consumer.address]), - assert.equal(true, await flags.getFlag(consumer.address)) - }) - }) - - describe('when called by a non-enabled setter', () => { - it('reverts', async () => { - await expect( - flags.connect(personas.Neil).raiseFlags([consumer.address]), - ).to.be.revertedWith('Not allowed to raise flags') - }) - }) - - describe('when called when there is no raisingAccessController', () => { - beforeEach(async () => { - await expect( - flags - .connect(personas.Nelly) - .setRaisingAccessController( - '0x0000000000000000000000000000000000000000', - ), - ).to.emit(flags, 'RaisingAccessControllerUpdated') - - assert.equal( - '0x0000000000000000000000000000000000000000', - await flags.raisingAccessController(), - ) - }) - - it('succeeds for the owner', async () => { - await flags.connect(personas.Nelly).raiseFlags([consumer.address]) - assert.equal(true, await flags.getFlag(consumer.address)) - }) - - it('reverts for non-owners', async () => { - await expect( - flags.connect(personas.Neil).raiseFlags([consumer.address]), - ).to.be.reverted - }) - }) - }) - - describe('#lowerFlags', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).raiseFlags([consumer.address]) - }) - - describe('when called by the owner', () => { - it('updates the warning flag', async () => { - assert.equal(true, await flags.getFlag(consumer.address)) - - await flags.connect(personas.Nelly).lowerFlags([consumer.address]) - - assert.equal(false, await flags.getFlag(consumer.address)) - }) - - it('emits an event log', async () => { - await expect( - flags.connect(personas.Nelly).lowerFlags([consumer.address]), - ) - .to.emit(flags, 'FlagLowered') - .withArgs(consumer.address) - }) - - describe('if a flag has already been raised', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).lowerFlags([consumer.address]) - }) - - it('emits an event log', async () => { - const tx = await flags - .connect(personas.Nelly) - .lowerFlags([consumer.address]) - const receipt = await tx.wait() - assert.equal(0, receipt.events?.length) - }) - }) - }) - - describe('when called by a non-owner', () => { - it('reverts', async () => { - await expect( - flags.connect(personas.Neil).lowerFlags([consumer.address]), - ).to.be.revertedWith('Only callable by owner') - }) - }) - }) - - describe('#getFlag', () => { - describe('if the access control is turned on', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).enableAccessCheck() - }) - - it('reverts', async () => { - await expect(consumer.getFlag(consumer.address)).to.be.revertedWith( - 'No access', - ) - }) - - describe('if access is granted to the address', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).addAccess(consumer.address) - }) - - it('does not revert', async () => { - await consumer.getFlag(consumer.address) - }) - }) - }) - - describe('if the access control is turned off', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).disableAccessCheck() - }) - - it('does not revert', async () => { - await consumer.getFlag(consumer.address) - }) - - describe('if access is granted to the address', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).addAccess(consumer.address) - }) - - it('does not revert', async () => { - await consumer.getFlag(consumer.address) - }) - }) - }) - }) - - describe('#getFlags', () => { - beforeEach(async () => { - await flags.connect(personas.Nelly).disableAccessCheck() - await flags - .connect(personas.Nelly) - .raiseFlags([ - await personas.Neil.getAddress(), - await personas.Norbert.getAddress(), - ]) - }) - - it('respects the access controls of #getFlag', async () => { - await flags.connect(personas.Nelly).enableAccessCheck() - - await expect(consumer.getFlag(consumer.address)).to.be.revertedWith( - 'No access', - ) - - await flags.connect(personas.Nelly).addAccess(consumer.address) - - await consumer.getFlag(consumer.address) - }) - - it('returns the flags in the order they are requested', async () => { - const response = await consumer.getFlags([ - await personas.Nelly.getAddress(), - await personas.Neil.getAddress(), - await personas.Ned.getAddress(), - await personas.Norbert.getAddress(), - ]) - - assert.deepEqual([false, true, false, true], response) - }) - }) - - describe('#setRaisingAccessController', () => { - let controller2: Contract - - beforeEach(async () => { - controller2 = await controllerFactory.connect(personas.Nelly).deploy() - await controller2.connect(personas.Nelly).enableAccessCheck() - }) - - it('updates access control rules', async () => { - const neilAddress = await personas.Neil.getAddress() - await controller.connect(personas.Nelly).addAccess(neilAddress) - await flags.connect(personas.Neil).raiseFlags([consumer.address]) // doesn't raise - - await flags - .connect(personas.Nelly) - .setRaisingAccessController(controller2.address) - - await expect( - flags.connect(personas.Neil).raiseFlags([consumer.address]), - ).to.be.revertedWith('Not allowed to raise flags') - }) - - it('emits a log announcing the change', async () => { - await expect( - flags - .connect(personas.Nelly) - .setRaisingAccessController(controller2.address), - ) - .to.emit(flags, 'RaisingAccessControllerUpdated') - .withArgs(controller.address, controller2.address) - }) - - it('does not emit a log when there is no change', async () => { - await flags - .connect(personas.Nelly) - .setRaisingAccessController(controller2.address) - - await expect( - flags - .connect(personas.Nelly) - .setRaisingAccessController(controller2.address), - ).to.not.emit(flags, 'RaisingAccessControllerUpdated') - }) - - describe('when called by a non-owner', () => { - it('reverts', async () => { - await expect( - flags - .connect(personas.Neil) - .setRaisingAccessController(controller2.address), - ).to.be.revertedWith('Only callable by owner') - }) - }) - }) -}) diff --git a/contracts/test/v0.8/HeartbeatRequester.test.ts b/contracts/test/v0.8/HeartbeatRequester.test.ts deleted file mode 100644 index bb58192337d..00000000000 --- a/contracts/test/v0.8/HeartbeatRequester.test.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { getUsers, Personas } from '../test-helpers/setup' -import { ethers } from 'hardhat' -import { Signer } from 'ethers' -import { - HeartbeatRequester, - MockAggregatorProxy, - MockOffchainAggregator, -} from '../../typechain' -import { HeartbeatRequester__factory as HeartbeatRequesterFactory } from '../../typechain/factories/HeartbeatRequester__factory' -import { MockAggregatorProxy__factory as MockAggregatorProxyFactory } from '../../typechain/factories/MockAggregatorProxy__factory' -import { MockOffchainAggregator__factory as MockOffchainAggregatorFactory } from '../../typechain/factories/MockOffchainAggregator__factory' -import { assert, expect } from 'chai' - -let personas: Personas -let owner: Signer -let caller1: Signer -let proxy1: Signer -let proxy2: Signer -let aggregator: MockOffchainAggregator -let aggregatorFactory: MockOffchainAggregatorFactory -let aggregatorProxy: MockAggregatorProxy -let aggregatorProxyFactory: MockAggregatorProxyFactory -let requester: HeartbeatRequester -let requesterFactory: HeartbeatRequesterFactory - -describe('HeartbeatRequester', () => { - beforeEach(async () => { - personas = (await getUsers()).personas - owner = personas.Default - caller1 = personas.Carol - proxy1 = personas.Nelly - proxy2 = personas.Eddy - - // deploy heartbeat requester - requesterFactory = await ethers.getContractFactory('HeartbeatRequester') - requester = await requesterFactory.connect(owner).deploy() - await requester.deployed() - }) - - describe('#permitHeartbeat', () => { - it('adds a heartbeat and emits an event', async () => { - const callerAddress = await caller1.getAddress() - const proxyAddress1 = await proxy1.getAddress() - const proxyAddress2 = await proxy2.getAddress() - const tx1 = await requester - .connect(owner) - .permitHeartbeat(callerAddress, proxyAddress1) - await expect(tx1) - .to.emit(requester, 'HeartbeatPermitted') - .withArgs(callerAddress, proxyAddress1, ethers.constants.AddressZero) - - const tx2 = await requester - .connect(owner) - .permitHeartbeat(callerAddress, proxyAddress2) - await expect(tx2) - .to.emit(requester, 'HeartbeatPermitted') - .withArgs(callerAddress, proxyAddress2, proxyAddress1) - }) - - it('reverts when not called by its owner', async () => { - const callerAddress = await caller1.getAddress() - const proxyAddress = await proxy1.getAddress() - await expect( - requester.connect(caller1).permitHeartbeat(callerAddress, proxyAddress), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('#removeHeartbeat', () => { - it('removes a heartbeat and emits an event', async () => { - const callerAddress = await caller1.getAddress() - const proxyAddress = await proxy1.getAddress() - const tx1 = await requester - .connect(owner) - .permitHeartbeat(callerAddress, proxyAddress) - await expect(tx1) - .to.emit(requester, 'HeartbeatPermitted') - .withArgs(callerAddress, proxyAddress, ethers.constants.AddressZero) - - const tx2 = await requester.connect(owner).removeHeartbeat(callerAddress) - await expect(tx2) - .to.emit(requester, 'HeartbeatRemoved') - .withArgs(callerAddress, proxyAddress) - }) - - it('reverts when not called by its owner', async () => { - await expect( - requester.connect(caller1).removeHeartbeat(await caller1.getAddress()), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('#getAggregatorAndRequestHeartbeat', () => { - it('reverts if caller and proxy combination is not allowed', async () => { - const callerAddress = await caller1.getAddress() - const proxyAddress = await proxy1.getAddress() - await requester - .connect(owner) - .permitHeartbeat(callerAddress, proxyAddress) - - await expect( - requester - .connect(caller1) - .getAggregatorAndRequestHeartbeat(await owner.getAddress()), - ).to.be.revertedWithCustomError(requester, 'HeartbeatNotPermitted') - }) - - it('calls corresponding aggregator to request a new round', async () => { - aggregatorFactory = await ethers.getContractFactory( - 'MockOffchainAggregator', - ) - aggregator = await aggregatorFactory.connect(owner).deploy() - await aggregator.deployed() - - aggregatorProxyFactory = await ethers.getContractFactory( - 'MockAggregatorProxy', - ) - aggregatorProxy = await aggregatorProxyFactory - .connect(owner) - .deploy(aggregator.address) - await aggregatorProxy.deployed() - - await requester - .connect(owner) - .permitHeartbeat(await caller1.getAddress(), aggregatorProxy.address) - - const tx1 = await requester - .connect(caller1) - .getAggregatorAndRequestHeartbeat(aggregatorProxy.address) - - await expect(tx1).to.emit(aggregator, 'RoundIdUpdated').withArgs(1) - assert.equal((await aggregator.roundId()).toNumber(), 1) - - const tx2 = await requester - .connect(caller1) - .getAggregatorAndRequestHeartbeat(aggregatorProxy.address) - - await expect(tx2).to.emit(aggregator, 'RoundIdUpdated').withArgs(2) - assert.equal((await aggregator.roundId()).toNumber(), 2) - }) - }) -}) diff --git a/contracts/test/v0.8/PermissionedForwardProxy.test.ts b/contracts/test/v0.8/PermissionedForwardProxy.test.ts deleted file mode 100644 index 12ce63cd9b4..00000000000 --- a/contracts/test/v0.8/PermissionedForwardProxy.test.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { ethers } from 'hardhat' -import { publicAbi } from '../test-helpers/helpers' -import { assert, expect } from 'chai' -import { Contract, ContractFactory } from 'ethers' -import { getUsers, Personas } from '../test-helpers/setup' - -const PERMISSION_NOT_SET = 'PermissionNotSet' - -let personas: Personas - -let controllerFactory: ContractFactory -let counterFactory: ContractFactory -let controller: Contract -let counter: Contract - -before(async () => { - personas = (await getUsers()).personas - controllerFactory = await ethers.getContractFactory( - 'src/v0.8/PermissionedForwardProxy.sol:PermissionedForwardProxy', - personas.Carol, - ) - counterFactory = await ethers.getContractFactory( - 'src/v0.8/tests/Counter.sol:Counter', - personas.Carol, - ) -}) - -describe('PermissionedForwardProxy', () => { - beforeEach(async () => { - controller = await controllerFactory.connect(personas.Carol).deploy() - counter = await counterFactory.connect(personas.Carol).deploy() - }) - - it('has a limited public interface [ @skip-coverage ]', async () => { - publicAbi(controller, [ - 'forward', - 'setPermission', - 'removePermission', - 'getPermission', - // Owned - 'acceptOwnership', - 'owner', - 'transferOwnership', - ]) - }) - - describe('#setPermission', () => { - describe('when called by a non-owner', () => { - it('reverts', async () => { - await expect( - controller - .connect(personas.Eddy) - .setPermission( - await personas.Carol.getAddress(), - await personas.Eddy.getAddress(), - ), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('when called by the owner', () => { - it('adds the permission to the proxy', async () => { - const tx = await controller - .connect(personas.Carol) - .setPermission( - await personas.Carol.getAddress(), - await personas.Eddy.getAddress(), - ) - const receipt = await tx.wait() - const eventLog = receipt?.events - - assert.equal(eventLog?.length, 1) - assert.equal(eventLog?.[0].event, 'PermissionSet') - assert.equal(eventLog?.[0].args?.[0], await personas.Carol.getAddress()) - assert.equal(eventLog?.[0].args?.[1], await personas.Eddy.getAddress()) - - expect( - await controller.getPermission(await personas.Carol.getAddress()), - ).to.be.equal(await personas.Eddy.getAddress()) - }) - }) - }) - - describe('#removePermission', () => { - beforeEach(async () => { - // Add permission before testing - await controller - .connect(personas.Carol) - .setPermission( - await personas.Carol.getAddress(), - await personas.Eddy.getAddress(), - ) - }) - - describe('when called by a non-owner', () => { - it('reverts', async () => { - await expect( - controller - .connect(personas.Eddy) - .removePermission(await personas.Carol.getAddress()), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('when called by the owner', () => { - it('removes the permission to the proxy', async () => { - const tx = await controller - .connect(personas.Carol) - .removePermission(await personas.Carol.getAddress()) - - const receipt = await tx.wait() - const eventLog = receipt?.events - - assert.equal(eventLog?.length, 1) - assert.equal(eventLog?.[0].event, 'PermissionRemoved') - assert.equal(eventLog?.[0].args?.[0], await personas.Carol.getAddress()) - - expect( - await controller.getPermission(await personas.Carol.getAddress()), - ).to.be.equal(ethers.constants.AddressZero) - }) - }) - }) - - describe('#forward', () => { - describe('when permission does not exist', () => { - it('reverts', async () => { - await expect( - controller - .connect(personas.Carol) - .forward(await personas.Eddy.getAddress(), '0x'), - ).to.be.revertedWithCustomError(controller, PERMISSION_NOT_SET) - }) - }) - - describe('when permission exists', () => { - beforeEach(async () => { - // Add permission before testing - await controller - .connect(personas.Carol) - .setPermission(await personas.Carol.getAddress(), counter.address) - }) - - it('calls target successfully', async () => { - await controller - .connect(personas.Carol) - .forward( - counter.address, - counter.interface.encodeFunctionData('increment'), - ) - - expect(await counter.count()).to.be.equal(1) - }) - - it('reverts when target reverts and bubbles up error', async () => { - await expect( - controller - .connect(personas.Carol) - .forward( - counter.address, - counter.interface.encodeFunctionData('alwaysRevertWithString'), - ), - ).to.be.revertedWith('always revert') // Revert strings should be bubbled up - - await expect( - controller - .connect(personas.Carol) - .forward( - counter.address, - counter.interface.encodeFunctionData('alwaysRevert'), - ), - ).to.be.reverted // Javascript VM not able to parse custom errors defined on another contract - }) - }) - }) -}) diff --git a/contracts/test/v0.8/ValidatorProxy.test.ts b/contracts/test/v0.8/ValidatorProxy.test.ts deleted file mode 100644 index 2d274245de4..00000000000 --- a/contracts/test/v0.8/ValidatorProxy.test.ts +++ /dev/null @@ -1,403 +0,0 @@ -import { ethers } from 'hardhat' -import { publicAbi } from '../test-helpers/helpers' -import { assert, expect } from 'chai' -import { Signer, Contract, constants } from 'ethers' -import { Users, getUsers } from '../test-helpers/setup' - -let users: Users - -let owner: Signer -let ownerAddress: string -let aggregator: Signer -let aggregatorAddress: string -let validator: Signer -let validatorAddress: string -let validatorProxy: Contract - -before(async () => { - users = await getUsers() - owner = users.personas.Default - aggregator = users.contracts.contract1 - validator = users.contracts.contract2 - ownerAddress = await owner.getAddress() - aggregatorAddress = await aggregator.getAddress() - validatorAddress = await validator.getAddress() -}) - -describe('ValidatorProxy', () => { - beforeEach(async () => { - const vpf = await ethers.getContractFactory( - 'src/v0.8/ValidatorProxy.sol:ValidatorProxy', - owner, - ) - validatorProxy = await vpf.deploy(aggregatorAddress, validatorAddress) - validatorProxy = await validatorProxy.deployed() - }) - - it('has a limited public interface [ @skip-coverage ]', async () => { - publicAbi(validatorProxy, [ - // ConfirmedOwner functions - 'acceptOwnership', - 'owner', - 'transferOwnership', - // ValidatorProxy functions - 'validate', - 'proposeNewAggregator', - 'upgradeAggregator', - 'getAggregators', - 'proposeNewValidator', - 'upgradeValidator', - 'getValidators', - 'typeAndVersion', - ]) - }) - - describe('#constructor', () => { - it('should set the aggregator addresses correctly', async () => { - const response = await validatorProxy.getAggregators() - assert.equal(response.current, aggregatorAddress) - assert.equal(response.hasProposal, false) - assert.equal(response.proposed, constants.AddressZero) - }) - - it('should set the validator addresses conrrectly', async () => { - const response = await validatorProxy.getValidators() - assert.equal(response.current, validatorAddress) - assert.equal(response.hasProposal, false) - assert.equal(response.proposed, constants.AddressZero) - }) - - it('should set the owner correctly', async () => { - const response = await validatorProxy.owner() - assert.equal(response, ownerAddress) - }) - }) - - describe('#proposeNewAggregator', () => { - let newAggregator: Signer - let newAggregatorAddress: string - beforeEach(async () => { - newAggregator = users.contracts.contract3 - newAggregatorAddress = await newAggregator.getAddress() - }) - - describe('failure', () => { - it('should only be called by the owner', async () => { - const stranger = users.contracts.contract4 - await expect( - validatorProxy - .connect(stranger) - .proposeNewAggregator(newAggregatorAddress), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should revert if no change in proposal', async () => { - await validatorProxy.proposeNewAggregator(newAggregatorAddress) - await expect( - validatorProxy.proposeNewAggregator(newAggregatorAddress), - ).to.be.revertedWith('Invalid proposal') - }) - - it('should revert if the proposal is the same as the current', async () => { - await expect( - validatorProxy.proposeNewAggregator(aggregatorAddress), - ).to.be.revertedWith('Invalid proposal') - }) - }) - - describe('success', () => { - it('should emit an event', async () => { - await expect(validatorProxy.proposeNewAggregator(newAggregatorAddress)) - .to.emit(validatorProxy, 'AggregatorProposed') - .withArgs(newAggregatorAddress) - }) - - it('should set the correct address and hasProposal is true', async () => { - await validatorProxy.proposeNewAggregator(newAggregatorAddress) - const response = await validatorProxy.getAggregators() - assert.equal(response.current, aggregatorAddress) - assert.equal(response.hasProposal, true) - assert.equal(response.proposed, newAggregatorAddress) - }) - - it('should set a zero address and hasProposal is false', async () => { - await validatorProxy.proposeNewAggregator(newAggregatorAddress) - await validatorProxy.proposeNewAggregator(constants.AddressZero) - const response = await validatorProxy.getAggregators() - assert.equal(response.current, aggregatorAddress) - assert.equal(response.hasProposal, false) - assert.equal(response.proposed, constants.AddressZero) - }) - }) - }) - - describe('#upgradeAggregator', () => { - describe('failure', () => { - it('should only be called by the owner', async () => { - const stranger = users.contracts.contract4 - await expect( - validatorProxy.connect(stranger).upgradeAggregator(), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should revert if there is no proposal', async () => { - await expect(validatorProxy.upgradeAggregator()).to.be.revertedWith( - 'No proposal', - ) - }) - }) - - describe('success', () => { - let newAggregator: Signer - let newAggregatorAddress: string - beforeEach(async () => { - newAggregator = users.contracts.contract3 - newAggregatorAddress = await newAggregator.getAddress() - await validatorProxy.proposeNewAggregator(newAggregatorAddress) - }) - - it('should emit an event', async () => { - await expect(validatorProxy.upgradeAggregator()) - .to.emit(validatorProxy, 'AggregatorUpgraded') - .withArgs(aggregatorAddress, newAggregatorAddress) - }) - - it('should upgrade the addresses', async () => { - await validatorProxy.upgradeAggregator() - const response = await validatorProxy.getAggregators() - assert.equal(response.current, newAggregatorAddress) - assert.equal(response.hasProposal, false) - assert.equal(response.proposed, constants.AddressZero) - }) - }) - }) - - describe('#proposeNewValidator', () => { - let newValidator: Signer - let newValidatorAddress: string - - beforeEach(async () => { - newValidator = users.contracts.contract3 - newValidatorAddress = await newValidator.getAddress() - }) - - describe('failure', () => { - it('should only be called by the owner', async () => { - const stranger = users.contracts.contract4 - await expect( - validatorProxy - .connect(stranger) - .proposeNewAggregator(newValidatorAddress), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should revert if no change in proposal', async () => { - await validatorProxy.proposeNewValidator(newValidatorAddress) - await expect( - validatorProxy.proposeNewValidator(newValidatorAddress), - ).to.be.revertedWith('Invalid proposal') - }) - - it('should revert if the proposal is the same as the current', async () => { - await expect( - validatorProxy.proposeNewValidator(validatorAddress), - ).to.be.revertedWith('Invalid proposal') - }) - }) - - describe('success', () => { - it('should emit an event', async () => { - await expect(validatorProxy.proposeNewValidator(newValidatorAddress)) - .to.emit(validatorProxy, 'ValidatorProposed') - .withArgs(newValidatorAddress) - }) - - it('should set the correct address and hasProposal is true', async () => { - await validatorProxy.proposeNewValidator(newValidatorAddress) - const response = await validatorProxy.getValidators() - assert.equal(response.current, validatorAddress) - assert.equal(response.hasProposal, true) - assert.equal(response.proposed, newValidatorAddress) - }) - - it('should set a zero address and hasProposal is false', async () => { - await validatorProxy.proposeNewValidator(newValidatorAddress) - await validatorProxy.proposeNewValidator(constants.AddressZero) - const response = await validatorProxy.getValidators() - assert.equal(response.current, validatorAddress) - assert.equal(response.hasProposal, false) - assert.equal(response.proposed, constants.AddressZero) - }) - }) - }) - - describe('#upgradeValidator', () => { - describe('failure', () => { - it('should only be called by the owner', async () => { - const stranger = users.contracts.contract4 - await expect( - validatorProxy.connect(stranger).upgradeValidator(), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should revert if there is no proposal', async () => { - await expect(validatorProxy.upgradeValidator()).to.be.revertedWith( - 'No proposal', - ) - }) - }) - - describe('success', () => { - let newValidator: Signer - let newValidatorAddress: string - beforeEach(async () => { - newValidator = users.contracts.contract3 - newValidatorAddress = await newValidator.getAddress() - await validatorProxy.proposeNewValidator(newValidatorAddress) - }) - - it('should emit an event', async () => { - await expect(validatorProxy.upgradeValidator()) - .to.emit(validatorProxy, 'ValidatorUpgraded') - .withArgs(validatorAddress, newValidatorAddress) - }) - - it('should upgrade the addresses', async () => { - await validatorProxy.upgradeValidator() - const response = await validatorProxy.getValidators() - assert.equal(response.current, newValidatorAddress) - assert.equal(response.hasProposal, false) - assert.equal(response.proposed, constants.AddressZero) - }) - }) - }) - - describe('#validate', () => { - describe('failure', () => { - it('reverts when not called by aggregator or proposed aggregator', async () => { - const stranger = users.contracts.contract5 - await expect( - validatorProxy.connect(stranger).validate(99, 88, 77, 66), - ).to.be.revertedWith('Not a configured aggregator') - }) - - it('reverts when there is no validator set', async () => { - const vpf = await ethers.getContractFactory( - 'src/v0.8/ValidatorProxy.sol:ValidatorProxy', - owner, - ) - validatorProxy = await vpf.deploy( - aggregatorAddress, - constants.AddressZero, - ) - await validatorProxy.deployed() - await expect( - validatorProxy.connect(aggregator).validate(99, 88, 77, 66), - ).to.be.revertedWith('No validator set') - }) - }) - - describe('success', () => { - describe('from the aggregator', () => { - let mockValidator1: Contract - beforeEach(async () => { - const mvf = await ethers.getContractFactory( - 'src/v0.8/mocks/MockAggregatorValidator.sol:MockAggregatorValidator', - owner, - ) - mockValidator1 = await mvf.deploy(1) - mockValidator1 = await mockValidator1.deployed() - const vpf = await ethers.getContractFactory( - 'src/v0.8/ValidatorProxy.sol:ValidatorProxy', - owner, - ) - validatorProxy = await vpf.deploy( - aggregatorAddress, - mockValidator1.address, - ) - validatorProxy = await validatorProxy.deployed() - }) - - describe('for a single validator', () => { - it('calls validate on the validator', async () => { - await expect( - validatorProxy.connect(aggregator).validate(200, 300, 400, 500), - ) - .to.emit(mockValidator1, 'ValidateCalled') - .withArgs(1, 200, 300, 400, 500) - }) - - it('uses a specific amount of gas [ @skip-coverage ]', async () => { - const resp = await validatorProxy - .connect(aggregator) - .validate(200, 300, 400, 500) - const receipt = await resp.wait() - assert.equal(receipt.gasUsed.toString(), '32373') - }) - }) - - describe('for a validator and a proposed validator', () => { - let mockValidator2: Contract - - beforeEach(async () => { - const mvf = await ethers.getContractFactory( - 'src/v0.8/mocks/MockAggregatorValidator.sol:MockAggregatorValidator', - owner, - ) - mockValidator2 = await mvf.deploy(2) - mockValidator2 = await mockValidator2.deployed() - await validatorProxy.proposeNewValidator(mockValidator2.address) - }) - - it('calls validate on the validator', async () => { - await expect( - validatorProxy - .connect(aggregator) - .validate(2000, 3000, 4000, 5000), - ) - .to.emit(mockValidator1, 'ValidateCalled') - .withArgs(1, 2000, 3000, 4000, 5000) - }) - - it('also calls validate on the proposed validator', async () => { - await expect( - validatorProxy - .connect(aggregator) - .validate(2000, 3000, 4000, 5000), - ) - .to.emit(mockValidator2, 'ValidateCalled') - .withArgs(2, 2000, 3000, 4000, 5000) - }) - - it('uses a specific amount of gas [ @skip-coverage ]', async () => { - const resp = await validatorProxy - .connect(aggregator) - .validate(2000, 3000, 4000, 5000) - const receipt = await resp.wait() - assert.equal(receipt.gasUsed.toString(), '40429') - }) - }) - }) - - describe('from the proposed aggregator', () => { - let newAggregator: Signer - let newAggregatorAddress: string - beforeEach(async () => { - newAggregator = users.contracts.contract3 - newAggregatorAddress = await newAggregator.getAddress() - await validatorProxy - .connect(owner) - .proposeNewAggregator(newAggregatorAddress) - }) - - it('emits an event', async () => { - await expect( - validatorProxy.connect(newAggregator).validate(555, 666, 777, 888), - ) - .to.emit(validatorProxy, 'ProposedAggregatorValidateCall') - .withArgs(newAggregatorAddress, 555, 666, 777, 888) - }) - }) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts b/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts index c2e08f4cd81..f393a5de1c2 100644 --- a/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts +++ b/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts @@ -69,7 +69,7 @@ describeMaybe('Automation Gas Analysis', () => { const getFact = ethers.getContractFactory const linkTokenFactory = await getFact('LinkToken') const mockV3AggregatorFactory = await getFact( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', ) const upkeepMockFactory = await getFact('UpkeepMock') const registry12Factory = await getFact('KeeperRegistry1_2') diff --git a/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts b/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts index a096ee4f481..6d3d591acb0 100644 --- a/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts @@ -41,7 +41,7 @@ describe('AutomationRegistrar2_1 - Frozen [ @skip-coverage ]', () => { // 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', // ) // mockV3AggregatorFactory = (await ethers.getContractFactory( -// 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', +// 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', // )) as unknown as MockV3AggregatorFactory // upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') // }) diff --git a/contracts/test/v0.8/automation/AutomationRegistrar2_3.test.ts b/contracts/test/v0.8/automation/AutomationRegistrar2_3.test.ts index 31712e1380b..e98218ec214 100644 --- a/contracts/test/v0.8/automation/AutomationRegistrar2_3.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistrar2_3.test.ts @@ -44,7 +44,7 @@ before(async () => { 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', ) mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', )) as unknown as MockV3AggregatorFactory upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') }) diff --git a/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts b/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts index 6b220f2f7cb..593ac08a5e7 100644 --- a/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts @@ -419,7 +419,7 @@ describe('AutomationRegistry2_2', () => { ) // need full path because there are two contracts with name MockV3Aggregator mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', )) as unknown as MockV3AggregatorFactory mockArbGasInfoFactory = await ethers.getContractFactory('MockArbGasInfo') mockOVMGasPriceOracleFactory = await ethers.getContractFactory( diff --git a/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts b/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts index f3c2d9bb984..48ec8469f9a 100644 --- a/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts @@ -431,7 +431,7 @@ describe('AutomationRegistry2_3', () => { ) // need full path because there are two contracts with name MockV3Aggregator mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', )) as unknown as MockV3AggregatorFactory mockArbGasInfoFactory = await ethers.getContractFactory('MockArbGasInfo') mockOVMGasPriceOracleFactory = await ethers.getContractFactory( diff --git a/contracts/test/v0.8/automation/KeeperCompatible.test.ts b/contracts/test/v0.8/automation/KeeperCompatible.test.ts index 13d1d0deff5..17c83790811 100644 --- a/contracts/test/v0.8/automation/KeeperCompatible.test.ts +++ b/contracts/test/v0.8/automation/KeeperCompatible.test.ts @@ -10,7 +10,7 @@ describe('KeeperCompatible', () => { before(async () => { const factory = await ethers.getContractFactory( - `src/v0.${version}/tests/KeeperCompatibleTestHelper.sol:KeeperCompatibleTestHelper`, + `src/v0.${version}/automation/testhelpers/KeeperCompatibleTestHelper.sol:KeeperCompatibleTestHelper`, ) contract = await factory.deploy() }) diff --git a/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts b/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts index d58cfd377f7..7fd811d8226 100644 --- a/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts +++ b/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts @@ -132,7 +132,7 @@ before(async () => { ) // need full path because there are two contracts with name MockV3Aggregator mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', )) as unknown as MockV3AggregatorFactory upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') diff --git a/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts b/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts index 392a1cb5966..b49dfb1d5b4 100644 --- a/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts +++ b/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts @@ -335,7 +335,7 @@ const setup = async () => { linkToken = await linkTokenFactory.connect(owner).deploy() // need full path because there are two contracts with name MockV3Aggregator const mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', )) as unknown as MockV3AggregatorFactory gasPriceFeed = await mockV3AggregatorFactory.connect(owner).deploy(0, gasWei) diff --git a/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts b/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts index 95210cf6444..ffbde4464b9 100644 --- a/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts +++ b/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts @@ -416,7 +416,7 @@ describe('ZKSyncAutomationRegistry2_3', () => { ) // need full path because there are two contracts with name MockV3Aggregator mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', )) as unknown as MockV3AggregatorFactory mockZKSyncSystemContextFactory = await ethers.getContractFactory( 'MockZKSyncSystemContext', diff --git a/contracts/test/v0.8/operatorforwarder/AuthorizedForwarder.test.ts b/contracts/test/v0.8/operatorforwarder/AuthorizedForwarder.test.ts index d4e1918c976..6530a2f3c4e 100644 --- a/contracts/test/v0.8/operatorforwarder/AuthorizedForwarder.test.ts +++ b/contracts/test/v0.8/operatorforwarder/AuthorizedForwarder.test.ts @@ -22,7 +22,7 @@ before(async () => { roles.defaultAccount, ) brokenFactory = await ethers.getContractFactory( - 'src/v0.8/tests/Broken.sol:Broken', + 'src/v0.8/operatorforwarder/test/Broken.sol:Broken', roles.defaultAccount, ) forwarderFactory = await ethers.getContractFactory( diff --git a/core/chains/evm/logpoller/helper_test.go b/core/chains/evm/logpoller/helper_test.go index b8d849d7d83..6a5959c5586 100644 --- a/core/chains/evm/logpoller/helper_test.go +++ b/core/chains/evm/logpoller/helper_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) diff --git a/core/chains/evm/logpoller/log_poller_internal_test.go b/core/chains/evm/logpoller/log_poller_internal_test.go index 620bbf14f41..757c5d4193c 100644 --- a/core/chains/evm/logpoller/log_poller_internal_test.go +++ b/core/chains/evm/logpoller/log_poller_internal_test.go @@ -32,7 +32,7 @@ import ( evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) diff --git a/core/chains/evm/logpoller/log_poller_test.go b/core/chains/evm/logpoller/log_poller_test.go index df688cd5e5c..3a1eb7b186f 100644 --- a/core/chains/evm/logpoller/log_poller_test.go +++ b/core/chains/evm/logpoller/log_poller_test.go @@ -38,7 +38,7 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" diff --git a/core/gethwrappers/abigen_test.go b/core/gethwrappers/abigen_test.go index 5874bf0b57c..21858f67ee4 100644 --- a/core/gethwrappers/abigen_test.go +++ b/core/gethwrappers/abigen_test.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/ethclient/simulated" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) diff --git a/core/gethwrappers/generated/type_and_version_interface_wrapper/type_and_version_interface_wrapper.go b/core/gethwrappers/generated/type_and_version_interface_wrapper/type_and_version_interface_wrapper.go deleted file mode 100644 index bf907b0354b..00000000000 --- a/core/gethwrappers/generated/type_and_version_interface_wrapper/type_and_version_interface_wrapper.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package type_and_version_interface_wrapper - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -var TypeAndVersionInterfaceMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", -} - -var TypeAndVersionInterfaceABI = TypeAndVersionInterfaceMetaData.ABI - -type TypeAndVersionInterface struct { - address common.Address - abi abi.ABI - TypeAndVersionInterfaceCaller - TypeAndVersionInterfaceTransactor - TypeAndVersionInterfaceFilterer -} - -type TypeAndVersionInterfaceCaller struct { - contract *bind.BoundContract -} - -type TypeAndVersionInterfaceTransactor struct { - contract *bind.BoundContract -} - -type TypeAndVersionInterfaceFilterer struct { - contract *bind.BoundContract -} - -type TypeAndVersionInterfaceSession struct { - Contract *TypeAndVersionInterface - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type TypeAndVersionInterfaceCallerSession struct { - Contract *TypeAndVersionInterfaceCaller - CallOpts bind.CallOpts -} - -type TypeAndVersionInterfaceTransactorSession struct { - Contract *TypeAndVersionInterfaceTransactor - TransactOpts bind.TransactOpts -} - -type TypeAndVersionInterfaceRaw struct { - Contract *TypeAndVersionInterface -} - -type TypeAndVersionInterfaceCallerRaw struct { - Contract *TypeAndVersionInterfaceCaller -} - -type TypeAndVersionInterfaceTransactorRaw struct { - Contract *TypeAndVersionInterfaceTransactor -} - -func NewTypeAndVersionInterface(address common.Address, backend bind.ContractBackend) (*TypeAndVersionInterface, error) { - abi, err := abi.JSON(strings.NewReader(TypeAndVersionInterfaceABI)) - if err != nil { - return nil, err - } - contract, err := bindTypeAndVersionInterface(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &TypeAndVersionInterface{address: address, abi: abi, TypeAndVersionInterfaceCaller: TypeAndVersionInterfaceCaller{contract: contract}, TypeAndVersionInterfaceTransactor: TypeAndVersionInterfaceTransactor{contract: contract}, TypeAndVersionInterfaceFilterer: TypeAndVersionInterfaceFilterer{contract: contract}}, nil -} - -func NewTypeAndVersionInterfaceCaller(address common.Address, caller bind.ContractCaller) (*TypeAndVersionInterfaceCaller, error) { - contract, err := bindTypeAndVersionInterface(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &TypeAndVersionInterfaceCaller{contract: contract}, nil -} - -func NewTypeAndVersionInterfaceTransactor(address common.Address, transactor bind.ContractTransactor) (*TypeAndVersionInterfaceTransactor, error) { - contract, err := bindTypeAndVersionInterface(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &TypeAndVersionInterfaceTransactor{contract: contract}, nil -} - -func NewTypeAndVersionInterfaceFilterer(address common.Address, filterer bind.ContractFilterer) (*TypeAndVersionInterfaceFilterer, error) { - contract, err := bindTypeAndVersionInterface(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &TypeAndVersionInterfaceFilterer{contract: contract}, nil -} - -func bindTypeAndVersionInterface(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := TypeAndVersionInterfaceMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _TypeAndVersionInterface.Contract.TypeAndVersionInterfaceCaller.contract.Call(opts, result, method, params...) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TypeAndVersionInterface.Contract.TypeAndVersionInterfaceTransactor.contract.Transfer(opts) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _TypeAndVersionInterface.Contract.TypeAndVersionInterfaceTransactor.contract.Transact(opts, method, params...) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _TypeAndVersionInterface.Contract.contract.Call(opts, result, method, params...) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TypeAndVersionInterface.Contract.contract.Transfer(opts) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _TypeAndVersionInterface.Contract.contract.Transact(opts, method, params...) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _TypeAndVersionInterface.contract.Call(opts, &out, "typeAndVersion") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceSession) TypeAndVersion() (string, error) { - return _TypeAndVersionInterface.Contract.TypeAndVersion(&_TypeAndVersionInterface.CallOpts) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterfaceCallerSession) TypeAndVersion() (string, error) { - return _TypeAndVersionInterface.Contract.TypeAndVersion(&_TypeAndVersionInterface.CallOpts) -} - -func (_TypeAndVersionInterface *TypeAndVersionInterface) Address() common.Address { - return _TypeAndVersionInterface.address -} - -type TypeAndVersionInterfaceInterface interface { - TypeAndVersion(opts *bind.CallOpts) (string, error) - - Address() common.Address -} diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 20b5bfbdbad..b10ad89f930 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -49,7 +49,6 @@ keeper_registry_wrapper1_3: ../../contracts/solc/v0.8.6/KeeperRegistry1_3/Keeper keeper_registry_wrapper2_0: ../../contracts/solc/v0.8.6/KeeperRegistry2_0/KeeperRegistry2_0.abi ../../contracts/solc/v0.8.6/KeeperRegistry2_0/KeeperRegistry2_0.bin c32dea7d5ef66b7c58ddc84ddf69aa44df1b3ae8601fbc271c95be4ff5853056 keeper_registry_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistry2_1/KeeperRegistry2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistry2_1/KeeperRegistry2_1.bin 11d36cb9eab0e136a2c3224709f7df17711756a126127e8c82326ce0a2e2b4f4 keepers_vrf_consumer: ../../contracts/solc/v0.8.6/KeepersVRFConsumer/KeepersVRFConsumer.abi ../../contracts/solc/v0.8.6/KeepersVRFConsumer/KeepersVRFConsumer.bin fa75572e689c9e84705c63e8dbe1b7b8aa1a8fe82d66356c4873d024bb9166e8 -log_emitter: ../../contracts/solc/v0.8.19/LogEmitter/LogEmitter.abi ../../contracts/solc/v0.8.19/LogEmitter/LogEmitter.bin 4b129ab93432c95ff9143f0631323e189887668889e0b36ccccf18a571e41ccf log_triggered_streams_lookup_wrapper: ../../contracts/solc/v0.8.16/LogTriggeredStreamsLookup/LogTriggeredStreamsLookup.abi ../../contracts/solc/v0.8.16/LogTriggeredStreamsLookup/LogTriggeredStreamsLookup.bin 920fff3b662909f12ed11b47d168036ffa74ad52070a94e2fa26cdad5e428b4e log_upkeep_counter_wrapper: ../../contracts/solc/v0.8.6/LogUpkeepCounter/LogUpkeepCounter.abi ../../contracts/solc/v0.8.6/LogUpkeepCounter/LogUpkeepCounter.bin 5482033d55eddb653bf580de0cc950db89a329091e085ac4122583df4a9777cd mock_aggregator_proxy: ../../contracts/solc/v0.8.6/MockAggregatorProxy/MockAggregatorProxy.abi ../../contracts/solc/v0.8.6/MockAggregatorProxy/MockAggregatorProxy.bin b16c108f3dd384c342ddff5e94da7c0a8d39d1be5e3d8f2cf61ecc7f0e50ff42 @@ -67,7 +66,6 @@ solidity_vrf_v08_verifier_wrapper: ../../contracts/solc/v0.8.6/VRFTestHelper/VRF streams_lookup_compatible_interface: ../../contracts/solc/v0.8.16/StreamsLookupCompatibleInterface/StreamsLookupCompatibleInterface.abi ../../contracts/solc/v0.8.16/StreamsLookupCompatibleInterface/StreamsLookupCompatibleInterface.bin 2861f553fb4731e89126b13319462df674727005a51982d1e617e2c2e44fa422 streams_lookup_upkeep_wrapper: ../../contracts/solc/v0.8.16/StreamsLookupUpkeep/StreamsLookupUpkeep.abi ../../contracts/solc/v0.8.16/StreamsLookupUpkeep/StreamsLookupUpkeep.bin 37e3a61091cc2a156539dd4aaff987e07577118aa02e97931a647df55705465e trusted_blockhash_store: ../../contracts/solc/v0.8.19/TrustedBlockhashStore/TrustedBlockhashStore.abi ../../contracts/solc/v0.8.19/TrustedBlockhashStore/TrustedBlockhashStore.bin 1570663ef6feabf8660a93e85d2427ad8e7dabcfa5b418d308c62132451c5662 -type_and_version_interface_wrapper: ../../contracts/solc/v0.8.6/KeeperRegistry1_2/TypeAndVersionInterface.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_2/TypeAndVersionInterface.bin bc9c3a6e73e3ebd5b58754df0deeb3b33f4bb404d5709bb904aed51d32f4b45e upkeep_counter_wrapper: ../../contracts/solc/v0.8.16/UpkeepCounter/UpkeepCounter.abi ../../contracts/solc/v0.8.16/UpkeepCounter/UpkeepCounter.bin cef953186d12ac802e54d17c897d01605b60bbe0ce2df3b4cf2c31c5c3168b35 upkeep_perform_counter_restrictive_wrapper: ../../contracts/solc/v0.8.16/UpkeepPerformCounterRestrictive/UpkeepPerformCounterRestrictive.abi ../../contracts/solc/v0.8.16/UpkeepPerformCounterRestrictive/UpkeepPerformCounterRestrictive.bin 20955b21acceb58355fa287b29194a73edf5937067ba7140667301017cb2b24c upkeep_transcoder: ../../contracts/solc/v0.8.6/UpkeepTranscoder/UpkeepTranscoder.abi ../../contracts/solc/v0.8.6/UpkeepTranscoder/UpkeepTranscoder.bin 336c92a981597be26508455f81a908a0784a817b129a59686c5b2c4afcba730a @@ -90,7 +88,6 @@ vrf_external_sub_owner_example: ../../contracts/solc/v0.8.6/VRFExternalSubOwnerE vrf_load_test_external_sub_owner: ../../contracts/solc/v0.8.6/VRFLoadTestExternalSubOwner/VRFLoadTestExternalSubOwner.abi ../../contracts/solc/v0.8.6/VRFLoadTestExternalSubOwner/VRFLoadTestExternalSubOwner.bin 2097faa70265e420036cc8a3efb1f1e0836ad2d7323b295b9a26a125dbbe6c7d vrf_load_test_ownerless_consumer: ../../contracts/solc/v0.8.6/VRFLoadTestOwnerlessConsumer/VRFLoadTestOwnerlessConsumer.abi ../../contracts/solc/v0.8.6/VRFLoadTestOwnerlessConsumer/VRFLoadTestOwnerlessConsumer.bin 74f914843cbc70b9c3079c3e1c709382ce415225e8bb40113e7ac018bfcb0f5c vrf_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics/VRFV2LoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics/VRFV2LoadTestWithMetrics.bin c9621c52d216a090ff6bbe942f1b75d2bce8658a27323c3789e5e14b523277ee -vrf_log_emitter: ../../contracts/solc/v0.8.19/VRFLogEmitter/VRFLogEmitter.abi ../../contracts/solc/v0.8.19/VRFLogEmitter/VRFLogEmitter.bin 15f491d445ac4d0c712d1cbe4e5054c759b080bf20de7d54bfe2a82cde4dcf06 vrf_malicious_consumer_v2: ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2/VRFMaliciousConsumerV2.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2/VRFMaliciousConsumerV2.bin 9755fa8ffc7f5f0b337d5d413d77b0c9f6cd6f68c31727d49acdf9d4a51bc522 vrf_malicious_consumer_v2_plus: ../../contracts/solc/v0.8.19/VRFMaliciousConsumerV2Plus/VRFMaliciousConsumerV2Plus.abi ../../contracts/solc/v0.8.19/VRFMaliciousConsumerV2Plus/VRFMaliciousConsumerV2Plus.bin f6bf81658d3472bb705d28dc4a837097ec93d78c3f786efaa9cd040ada9d3319 vrf_mock_ethlink_aggregator: ../../contracts/solc/v0.8.6/VRFMockETHLINKAggregator/VRFMockETHLINKAggregator.abi ../../contracts/solc/v0.8.6/VRFMockETHLINKAggregator/VRFMockETHLINKAggregator.bin 3657f8c552147eb55d7538fa7d8012c1a983d8c5184610de60600834a72e006b diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index 1fee016fe8b..ab610f01d67 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -17,7 +17,6 @@ package gethwrappers //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistrar1_2/KeeperRegistrar.abi ../../contracts/solc/v0.8.6/KeeperRegistrar1_2/KeeperRegistrar.bin KeeperRegistrar keeper_registrar_wrapper1_2 //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistrar1_2Mock/KeeperRegistrar1_2Mock.abi ../../contracts/solc/v0.8.6/KeeperRegistrar1_2Mock/KeeperRegistrar1_2Mock.bin KeeperRegistrarMock keeper_registrar_wrapper1_2_mock //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistry1_2/KeeperRegistry1_2.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_2/KeeperRegistry1_2.bin KeeperRegistry keeper_registry_wrapper1_2 -//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistry1_2/TypeAndVersionInterface.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_2/TypeAndVersionInterface.bin TypeAndVersionInterface type_and_version_interface_wrapper //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2/KeeperRegistryCheckUpkeepGasUsageWrapper1_2.abi ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2/KeeperRegistryCheckUpkeepGasUsageWrapper1_2.bin KeeperRegistryCheckUpkeepGasUsageWrapper gas_wrapper //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.abi ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.bin KeeperRegistryCheckUpkeepGasUsageWrapperMock gas_wrapper_mock //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeeperRegistry1_3/KeeperRegistry1_3.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_3/KeeperRegistry1_3.bin KeeperRegistry keeper_registry_wrapper1_3 diff --git a/core/gethwrappers/go_generate_logpoller.go b/core/gethwrappers/go_generate_logpoller.go deleted file mode 100644 index b28b8205830..00000000000 --- a/core/gethwrappers/go_generate_logpoller.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package gethwrappers provides tools for wrapping solidity contracts with -// golang packages, using abigen. -package gethwrappers - -// Log tester -//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/LogEmitter/LogEmitter.abi ../../contracts/solc/v0.8.19/LogEmitter/LogEmitter.bin LogEmitter log_emitter -//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/VRFLogEmitter/VRFLogEmitter.abi ../../contracts/solc/v0.8.19/VRFLogEmitter/VRFLogEmitter.bin VRFLogEmitter vrf_log_emitter diff --git a/core/gethwrappers/generated/log_emitter/log_emitter.go b/core/gethwrappers/shared/generated/log_emitter/log_emitter.go similarity index 93% rename from core/gethwrappers/generated/log_emitter/log_emitter.go rename to core/gethwrappers/shared/generated/log_emitter/log_emitter.go index 24fef257af3..6ae06d7f08d 100644 --- a/core/gethwrappers/generated/log_emitter/log_emitter.go +++ b/core/gethwrappers/shared/generated/log_emitter/log_emitter.go @@ -31,7 +31,7 @@ var ( ) var LogEmitterMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"Log1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"Log2\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"Log3\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"Log4\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"v\",\"type\":\"uint256[]\"}],\"name\":\"EmitLog1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"v\",\"type\":\"uint256[]\"}],\"name\":\"EmitLog2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"v\",\"type\":\"string[]\"}],\"name\":\"EmitLog3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"v\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"w\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"}],\"name\":\"EmitLog4\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"type\":\"function\",\"name\":\"EmitLog1\",\"inputs\":[{\"name\":\"v\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"EmitLog2\",\"inputs\":[{\"name\":\"v\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"EmitLog3\",\"inputs\":[{\"name\":\"v\",\"type\":\"string[]\",\"internalType\":\"string[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"EmitLog4\",\"inputs\":[{\"name\":\"v\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"w\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"c\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Log1\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Log2\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Log3\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Log4\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false}]", Bin: "0x608060405234801561001057600080fd5b506105c5806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063696933c914610051578063b4b12d9814610066578063bc253bc014610079578063d9c21f461461008c575b600080fd5b61006461005f3660046102d7565b61009f565b005b61006461007436600461036d565b610113565b6100646100873660046102d7565b610163565b61006461009a366004610399565b6101c7565b60005b815181101561010f577f46692c0e59ca9cd1ad8f984a9d11715ec83424398b7eed4e05c8ce84662415a88282815181106100de576100de6104be565b60200260200101516040516100f591815260200190565b60405180910390a180610107816104ed565b9150506100a2565b5050565b60005b8181101561015d57604051839085907fba21d5b63d64546cb4ab29e370a8972bf26f78cb0c395391b4f451699fdfdc5d90600090a380610155816104ed565b915050610116565b50505050565b60005b815181101561010f57818181518110610181576101816104be565b60200260200101517f624fb00c2ce79f34cb543884c3af64816dce0f4cec3d32661959e49d488a7a9360405160405180910390a2806101bf816104ed565b915050610166565b60005b815181101561010f577fb94ec34dfe32a8a7170992a093976368d1e63decf8f0bc0b38a8eb89cc9f95cf828281518110610206576102066104be565b602002602001015160405161021b919061054c565b60405180910390a18061022d816104ed565b9150506101ca565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156102ab576102ab610235565b604052919050565b600067ffffffffffffffff8211156102cd576102cd610235565b5060051b60200190565b600060208083850312156102ea57600080fd5b823567ffffffffffffffff81111561030157600080fd5b8301601f8101851361031257600080fd5b8035610325610320826102b3565b610264565b81815260059190911b8201830190838101908783111561034457600080fd5b928401925b8284101561036257833582529284019290840190610349565b979650505050505050565b60008060006060848603121561038257600080fd5b505081359360208301359350604090920135919050565b600060208083850312156103ac57600080fd5b823567ffffffffffffffff808211156103c457600080fd5b8185019150601f86818401126103d957600080fd5b82356103e7610320826102b3565b81815260059190911b8401850190858101908983111561040657600080fd5b8686015b838110156104b0578035868111156104225760008081fd5b8701603f81018c136104345760008081fd5b8881013560408882111561044a5761044a610235565b6104798b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08a85011601610264565b8281528e8284860101111561048e5760008081fd5b828285018d83013760009281018c01929092525084525091870191870161040a565b509998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610545577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b600060208083528351808285015260005b818110156105795785810183015185820160400152820161055d565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116850101925050509291505056fea164736f6c6343000813000a", } diff --git a/core/gethwrappers/shared/generated/type_and_version/type_and_version.go b/core/gethwrappers/shared/generated/type_and_version/type_and_version.go new file mode 100644 index 00000000000..a4a518d9ea2 --- /dev/null +++ b/core/gethwrappers/shared/generated/type_and_version/type_and_version.go @@ -0,0 +1,183 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package type_and_version + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ITypeAndVersionMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"}]", +} + +var ITypeAndVersionABI = ITypeAndVersionMetaData.ABI + +type ITypeAndVersion struct { + address common.Address + abi abi.ABI + ITypeAndVersionCaller + ITypeAndVersionTransactor + ITypeAndVersionFilterer +} + +type ITypeAndVersionCaller struct { + contract *bind.BoundContract +} + +type ITypeAndVersionTransactor struct { + contract *bind.BoundContract +} + +type ITypeAndVersionFilterer struct { + contract *bind.BoundContract +} + +type ITypeAndVersionSession struct { + Contract *ITypeAndVersion + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ITypeAndVersionCallerSession struct { + Contract *ITypeAndVersionCaller + CallOpts bind.CallOpts +} + +type ITypeAndVersionTransactorSession struct { + Contract *ITypeAndVersionTransactor + TransactOpts bind.TransactOpts +} + +type ITypeAndVersionRaw struct { + Contract *ITypeAndVersion +} + +type ITypeAndVersionCallerRaw struct { + Contract *ITypeAndVersionCaller +} + +type ITypeAndVersionTransactorRaw struct { + Contract *ITypeAndVersionTransactor +} + +func NewITypeAndVersion(address common.Address, backend bind.ContractBackend) (*ITypeAndVersion, error) { + abi, err := abi.JSON(strings.NewReader(ITypeAndVersionABI)) + if err != nil { + return nil, err + } + contract, err := bindITypeAndVersion(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ITypeAndVersion{address: address, abi: abi, ITypeAndVersionCaller: ITypeAndVersionCaller{contract: contract}, ITypeAndVersionTransactor: ITypeAndVersionTransactor{contract: contract}, ITypeAndVersionFilterer: ITypeAndVersionFilterer{contract: contract}}, nil +} + +func NewITypeAndVersionCaller(address common.Address, caller bind.ContractCaller) (*ITypeAndVersionCaller, error) { + contract, err := bindITypeAndVersion(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ITypeAndVersionCaller{contract: contract}, nil +} + +func NewITypeAndVersionTransactor(address common.Address, transactor bind.ContractTransactor) (*ITypeAndVersionTransactor, error) { + contract, err := bindITypeAndVersion(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ITypeAndVersionTransactor{contract: contract}, nil +} + +func NewITypeAndVersionFilterer(address common.Address, filterer bind.ContractFilterer) (*ITypeAndVersionFilterer, error) { + contract, err := bindITypeAndVersion(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ITypeAndVersionFilterer{contract: contract}, nil +} + +func bindITypeAndVersion(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ITypeAndVersionMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ITypeAndVersion *ITypeAndVersionRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ITypeAndVersion.Contract.ITypeAndVersionCaller.contract.Call(opts, result, method, params...) +} + +func (_ITypeAndVersion *ITypeAndVersionRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ITypeAndVersion.Contract.ITypeAndVersionTransactor.contract.Transfer(opts) +} + +func (_ITypeAndVersion *ITypeAndVersionRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ITypeAndVersion.Contract.ITypeAndVersionTransactor.contract.Transact(opts, method, params...) +} + +func (_ITypeAndVersion *ITypeAndVersionCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ITypeAndVersion.Contract.contract.Call(opts, result, method, params...) +} + +func (_ITypeAndVersion *ITypeAndVersionTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ITypeAndVersion.Contract.contract.Transfer(opts) +} + +func (_ITypeAndVersion *ITypeAndVersionTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ITypeAndVersion.Contract.contract.Transact(opts, method, params...) +} + +func (_ITypeAndVersion *ITypeAndVersionCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ITypeAndVersion.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_ITypeAndVersion *ITypeAndVersionSession) TypeAndVersion() (string, error) { + return _ITypeAndVersion.Contract.TypeAndVersion(&_ITypeAndVersion.CallOpts) +} + +func (_ITypeAndVersion *ITypeAndVersionCallerSession) TypeAndVersion() (string, error) { + return _ITypeAndVersion.Contract.TypeAndVersion(&_ITypeAndVersion.CallOpts) +} + +func (_ITypeAndVersion *ITypeAndVersion) Address() common.Address { + return _ITypeAndVersion.address +} + +type ITypeAndVersionInterface interface { + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generated/vrf_log_emitter/vrf_log_emitter.go b/core/gethwrappers/shared/generated/vrf_log_emitter/vrf_log_emitter.go similarity index 88% rename from core/gethwrappers/generated/vrf_log_emitter/vrf_log_emitter.go rename to core/gethwrappers/shared/generated/vrf_log_emitter/vrf_log_emitter.go index 2cdeaa6c3a8..db6fae033a8 100644 --- a/core/gethwrappers/generated/vrf_log_emitter/vrf_log_emitter.go +++ b/core/gethwrappers/shared/generated/vrf_log_emitter/vrf_log_emitter.go @@ -31,7 +31,7 @@ var ( ) var VRFLogEmitterMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"emitRandomWordsFulfilled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"emitRandomWordsRequested\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"type\":\"function\",\"name\":\"emitRandomWordsFulfilled\",\"inputs\":[{\"name\":\"requestId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"outputSeed\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"payment\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"success\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"emitRandomWordsRequested\",\"inputs\":[{\"name\":\"keyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"requestId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"preSeed\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"subId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"callbackGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"numWords\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"RandomWordsFulfilled\",\"inputs\":[{\"name\":\"requestId\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"outputSeed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"payment\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RandomWordsRequested\",\"inputs\":[{\"name\":\"keyHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"requestId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"preSeed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"subId\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"callbackGasLimit\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"numWords\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", Bin: "0x608060405234801561001057600080fd5b5061027f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063ca920adb1461003b578063fe62d3e914610050575b600080fd5b61004e61004936600461015b565b610063565b005b61004e61005e366004610212565b6100eb565b604080518881526020810188905261ffff86168183015263ffffffff858116606083015284166080820152905173ffffffffffffffffffffffffffffffffffffffff83169167ffffffffffffffff8816918b917f63373d1c4696214b898952999c9aaec57dac1ee2723cec59bea6888f489a9772919081900360a00190a45050505050505050565b604080518481526bffffffffffffffffffffffff8416602082015282151581830152905185917f7dffc5ae5ee4e2e4df1651cf6ad329a73cebdb728f37ea0187b9b17e036756e4919081900360600190a250505050565b803563ffffffff8116811461015657600080fd5b919050565b600080600080600080600080610100898b03121561017857600080fd5b883597506020890135965060408901359550606089013567ffffffffffffffff811681146101a557600080fd5b9450608089013561ffff811681146101bc57600080fd5b93506101ca60a08a01610142565b92506101d860c08a01610142565b915060e089013573ffffffffffffffffffffffffffffffffffffffff8116811461020157600080fd5b809150509295985092959890939650565b6000806000806080858703121561022857600080fd5b843593506020850135925060408501356bffffffffffffffffffffffff8116811461025257600080fd5b91506060850135801515811461026757600080fd5b93969295509093505056fea164736f6c6343000813000a", } diff --git a/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 1c333b653ef..9b7ba5f8832 100644 --- a/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -5,6 +5,9 @@ burn_mint_erc677: ../../../contracts/solc/shared/BurnMintERC677/BurnMintERC677.s chain_reader_tester: ../../../contracts/solc/shared/ChainReaderTester/ChainReaderTester.sol/ChainReaderTester.abi.json ../../../contracts/solc/shared/ChainReaderTester/ChainReaderTester.sol/ChainReaderTester.bin 876c55e8d2556dc9cc953c786ae72b0430cb2c992f84573a2aae9680068f293d erc20: ../../../contracts/solc/vendor/ERC20/ERC20.sol/ERC20.abi.json ../../../contracts/solc/vendor/ERC20/ERC20.sol/ERC20.bin 9a5e3f7ec9fea385eeba374d184d6b83784304f537a90f6b81827c732d0b37c4 link_token: ../../../contracts/solc/shared/LinkToken/LinkToken.sol/LinkToken.abi.json ../../../contracts/solc/shared/LinkToken/LinkToken.sol/LinkToken.bin 9d1c648233822b70b03bf4fdb1af4cffaead8f1391dd149a79b3072defbd0c62 -mock_v3_aggregator_contract: ../../../contracts/solc/tests/MockV3Aggregator/MockV3Aggregator.sol/MockV3Aggregator.abi.json ../../../contracts/solc/tests/MockV3Aggregator/MockV3Aggregator.sol/MockV3Aggregator.bin 76796e0faffb2981d49082d94f2f2c9ec87d8ad960b022993d0681f9c81a832d +log_emitter: ../../../contracts/solc/shared/LogEmitter/LogEmitter.sol/LogEmitter.abi.json ../../../contracts/solc/shared/LogEmitter/LogEmitter.sol/LogEmitter.bin f884ed34204f82dcd1ea8f20db1b24d410bf23ab2687d56968d2c670e98277dd +mock_v3_aggregator_contract: ../../../contracts/solc/shared/MockV3Aggregator/MockV3Aggregator.sol/MockV3Aggregator.abi.json ../../../contracts/solc/shared/MockV3Aggregator/MockV3Aggregator.sol/MockV3Aggregator.bin 76796e0faffb2981d49082d94f2f2c9ec87d8ad960b022993d0681f9c81a832d multicall3: ../../../contracts/solc/vendor/Multicall3/Multicall3.sol/Multicall3.abi.json ../../../contracts/solc/vendor/Multicall3/Multicall3.sol/Multicall3.bin 175cd8790a4c714790c3761c50b0e93694c71bb7f8897eb92150847e6d8a94f4 +type_and_version: ../../../contracts/solc/shared/ITypeAndVersion/ITypeAndVersion.sol/ITypeAndVersion.abi.json ../../../contracts/solc/shared/ITypeAndVersion/ITypeAndVersion.sol/ITypeAndVersion.bin 21f6da4daa754971a4fdafea90ec64a77a5f03e62f9a9639802726b22eaa380a +vrf_log_emitter: ../../../contracts/solc/shared/VRFLogEmitter/VRFLogEmitter.sol/VRFLogEmitter.abi.json ../../../contracts/solc/shared/VRFLogEmitter/VRFLogEmitter.sol/VRFLogEmitter.bin 46788c9519425dd23befdea8e561ee454dcb559f6a8fe70f4a092805574218f6 werc20_mock: ../../../contracts/solc/shared/WERC20Mock/WERC20Mock.sol/WERC20Mock.abi.json ../../../contracts/solc/shared/WERC20Mock/WERC20Mock.sol/WERC20Mock.bin f5ba13fc99c248354508e3bab6cd0fb66607d3b7377f59a1e80b930e96ed4f48 diff --git a/core/gethwrappers/shared/go_generate.go b/core/gethwrappers/shared/go_generate.go index 3ac9b8ac6e9..0881e1b31e3 100644 --- a/core/gethwrappers/shared/go_generate.go +++ b/core/gethwrappers/shared/go_generate.go @@ -8,7 +8,10 @@ package gethwrappers //go:generate go run ../generation/wrap.go shared WERC20Mock werc20_mock //go:generate go run ../generation/wrap.go shared ChainReaderTester chain_reader_tester //go:generate go run ../generation/wrap.go shared AggregatorV3Interface aggregator_v3_interface +//go:generate go run ../generation/wrap.go shared MockV3Aggregator mock_v3_aggregator_contract +//go:generate go run ../generation/wrap.go shared LogEmitter log_emitter +//go:generate go run ../generation/wrap.go shared VRFLogEmitter vrf_log_emitter +//go:generate go run ../generation/wrap.go shared ITypeAndVersion type_and_version //go:generate go run ../generation/wrap.go vendor ERC20 erc20 //go:generate go run ../generation/wrap.go vendor Multicall3 multicall3 -//go:generate go run ../generation/wrap.go tests MockV3Aggregator mock_v3_aggregator_contract diff --git a/core/services/keeper/registry_interface.go b/core/services/keeper/registry_interface.go index 04bcb8e257d..b37917cef60 100644 --- a/core/services/keeper/registry_interface.go +++ b/core/services/keeper/registry_interface.go @@ -16,7 +16,7 @@ import ( registry1_1 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/keeper_registry_wrapper1_1" registry1_2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/keeper_registry_wrapper1_2" registry1_3 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/keeper_registry_wrapper1_3" - type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/type_and_version" ) type RegistryVersion int32 @@ -61,14 +61,14 @@ type RegistryWrapper struct { } func NewRegistryWrapper(address evmtypes.EIP55Address, evmClient evmclient.Client) (*RegistryWrapper, error) { - interface_wrapper, err := type_and_version.NewTypeAndVersionInterface( + interfaceWrapper, err := type_and_version.NewITypeAndVersion( address.Address(), evmClient, ) if err != nil { return nil, errors.Wrap(err, "unable to create type and interface wrapper") } - version, err := getRegistryVersion(interface_wrapper) + version, err := getRegistryVersion(interfaceWrapper) if err != nil { return nil, errors.Wrap(err, "unable to determine version of keeper registry contract") } @@ -105,7 +105,7 @@ func NewRegistryWrapper(address evmtypes.EIP55Address, evmClient evmclient.Clien }, nil } -func getRegistryVersion(contract *type_and_version.TypeAndVersionInterface) (*RegistryVersion, error) { +func getRegistryVersion(contract *type_and_version.ITypeAndVersion) (*RegistryVersion, error) { typeAndVersion, err := contract.TypeAndVersion(nil) if err != nil { jsonErr := evmclient.ExtractRPCErrorOrNil(err) diff --git a/core/services/ocr2/plugins/ccip/config/type_and_version.go b/core/services/ocr2/plugins/ccip/config/type_and_version.go index fdfd892b087..9d5e1629c11 100644 --- a/core/services/ocr2/plugins/ccip/config/type_and_version.go +++ b/core/services/ocr2/plugins/ccip/config/type_and_version.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/type_and_version" ) type ContractType string @@ -39,7 +39,7 @@ func VerifyTypeAndVersion(addr common.Address, client bind.ContractBackend, expe } func TypeAndVersion(addr common.Address, client bind.ContractBackend) (ContractType, semver.Version, error) { - tv, err := type_and_version.NewTypeAndVersionInterface(addr, client) + tv, err := type_and_version.NewITypeAndVersion(addr, client) if err != nil { return "", semver.Version{}, err } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go index 32ec1b24ac9..6d5d000e1fe 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go @@ -13,7 +13,7 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink-common/pkg/logger" - type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/type_and_version" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" @@ -24,7 +24,7 @@ import ( ) var ( - typeAndVersionABI = abihelpers.MustParseABI(type_and_version.TypeAndVersionInterfaceABI) + typeAndVersionABI = abihelpers.MustParseABI(type_and_version.ITypeAndVersionABI) ) type EVMTokenPoolBatchedReader struct { diff --git a/core/services/relay/evm/capabilities/testutils/chain_reader.go b/core/services/relay/evm/capabilities/testutils/chain_reader.go index 64fbf5fe720..07e0f3e05ac 100644 --- a/core/services/relay/evm/capabilities/testutils/chain_reader.go +++ b/core/services/relay/evm/capabilities/testutils/chain_reader.go @@ -14,7 +14,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" commonvalues "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/smartcontractkit/chainlink/v2/core/capabilities/triggers/logevent/logeventcap" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" coretestutils "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" diff --git a/core/services/vrf/v2/listener_v2_log_listener_test.go b/core/services/vrf/v2/listener_v2_log_listener_test.go index 06af4c83f19..a29449a7ebf 100644 --- a/core/services/vrf/v2/listener_v2_log_listener_test.go +++ b/core/services/vrf/v2/listener_v2_log_listener_test.go @@ -26,9 +26,9 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" evmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm/mocks" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/vrf_log_emitter" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/integration-tests/ccip-tests/contracts/contract_deployer.go b/integration-tests/ccip-tests/contracts/contract_deployer.go index 940f76e93b8..0aaec8f66a0 100644 --- a/integration-tests/ccip-tests/contracts/contract_deployer.go +++ b/integration-tests/ccip-tests/contracts/contract_deployer.go @@ -50,10 +50,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" - type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/type_and_version" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" @@ -1259,7 +1259,7 @@ func (e *CCIPContractsDeployer) NewMockAggregator(addr common.Address) (*MockAgg } func (e *CCIPContractsDeployer) TypeAndVersion(addr common.Address) (string, error) { - tv, err := type_and_version.NewTypeAndVersionInterface(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + tv, err := type_and_version.NewITypeAndVersion(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) if err != nil { return "", err } diff --git a/integration-tests/contracts/test_contracts.go b/integration-tests/contracts/test_contracts.go index f8674e2136d..f6ea627ef39 100644 --- a/integration-tests/contracts/test_contracts.go +++ b/integration-tests/contracts/test_contracts.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" - le "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + le "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" ) type LogEmitterContract struct { diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index 823c1bd8825..8d8135d214f 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -47,8 +47,8 @@ import ( aconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_compatible_utils" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/simple_log_upkeep_counter_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" ) const ( diff --git a/integration-tests/load/automationv2_1/gun.go b/integration-tests/load/automationv2_1/gun.go index aa61562741c..7e26d906456 100644 --- a/integration-tests/load/automationv2_1/gun.go +++ b/integration-tests/load/automationv2_1/gun.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/seth" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) diff --git a/integration-tests/universal/log_poller/helpers.go b/integration-tests/universal/log_poller/helpers.go index 0c127d576c0..c75bff6c0c2 100644 --- a/integration-tests/universal/log_poller/helpers.go +++ b/integration-tests/universal/log_poller/helpers.go @@ -45,7 +45,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" cltypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_compatible_utils" - le "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" + le "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/log_emitter" core_logger "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/tools/ci/ccip_lcov_prune b/tools/ci/ccip_lcov_prune index 9ec51e53536..fadb2cc410c 100755 --- a/tools/ci/ccip_lcov_prune +++ b/tools/ci/ccip_lcov_prune @@ -12,7 +12,6 @@ set -e # BurnWithFromMintTokenPool is excluded because Forge doesn't seem to # register coverage, even though it is 100% covered. - lcov --remove $1 -o $2 \ '*/ccip/test/*' \ '*/vendor/*' \ @@ -23,8 +22,6 @@ lcov --remove $1 -o $2 \ 'src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol' \ 'src/v0.8/ccip/libraries/MerkleMultiProof.sol' \ 'src/v0.8/ccip/libraries/Pool.sol' \ - 'src/v0.8/ConfirmedOwnerWithProposal.sol' \ - 'src/v0.8/tests/MockV3Aggregator.sol' \ 'src/v0.8/ccip/applications/CCIPClientExample.sol' \ 'src/v0.8/ccip/pools/BurnWithFromMintTokenPool.sol' \ 'src/v0.8/ccip/rmn/RMNHome.sol' \ From ab46d04d983fe145fa490b43bb2fe685a1c08809 Mon Sep 17 00:00:00 2001 From: FelixFan1992 Date: Wed, 8 Jan 2025 11:05:31 -0500 Subject: [PATCH 12/91] DEVSVCS-1087: remove unused automation hardhat tests (#15847) * remove unused automation hardhat tests * freeze contracts * remove more tests * update --- .../action.yml | 4 + .../automation/AutomationGasAnalysis.test.ts | 258 - .../automation/AutomationRegistrar2_1.test.ts | 1022 --- .../automation/AutomationRegistry2_2.test.ts | 5962 ----------------- .../test/v0.8/automation/CronUpkeep.test.ts | 576 -- .../v0.8/automation/CronUpkeepFactory.test.ts | 107 - .../automation/ERC20BalanceMonitor.test.ts | 695 -- .../v0.8/automation/EthBalanceMonitor.test.ts | 663 -- .../IAutomationRegistryMaster2_2.test.ts | 117 - .../LinkAvailableBalanceMonitor.test.ts | 1077 --- .../automation/UpkeepBalanceMonitor.test.ts | 402 -- .../automation/UpkeepTranscoder3_0.test.ts | 576 -- .../automation/UpkeepTranscoder4_0.test.ts | 654 -- contracts/test/v0.8/automation/helpers.ts | 68 - 14 files changed, 4 insertions(+), 12177 deletions(-) delete mode 100644 contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts delete mode 100644 contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts delete mode 100644 contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts delete mode 100644 contracts/test/v0.8/automation/CronUpkeep.test.ts delete mode 100644 contracts/test/v0.8/automation/CronUpkeepFactory.test.ts delete mode 100644 contracts/test/v0.8/automation/ERC20BalanceMonitor.test.ts delete mode 100644 contracts/test/v0.8/automation/EthBalanceMonitor.test.ts delete mode 100644 contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts delete mode 100644 contracts/test/v0.8/automation/LinkAvailableBalanceMonitor.test.ts delete mode 100644 contracts/test/v0.8/automation/UpkeepBalanceMonitor.test.ts delete mode 100644 contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts delete mode 100644 contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts diff --git a/.github/actions/detect-solidity-readonly-file-changes/action.yml b/.github/actions/detect-solidity-readonly-file-changes/action.yml index faca16d53f0..d0890a9f604 100644 --- a/.github/actions/detect-solidity-readonly-file-changes/action.yml +++ b/.github/actions/detect-solidity-readonly-file-changes/action.yml @@ -16,9 +16,13 @@ runs: filters: | read_only_sol: - 'contracts/src/v0.8/interfaces/**/*' + - 'contracts/src/v0.8/automation/interfaces/**/*' + - 'contracts/src/v0.8/automation/upkeeps/**/*' - 'contracts/src/v0.8/automation/v1_2/**/*' - 'contracts/src/v0.8/automation/v1_3/**/*' - 'contracts/src/v0.8/automation/v2_0/**/*' + - 'contracts/src/v0.8/automation/v2_1/**/*' + - 'contracts/src/v0.8/automation/v2_2/**/*' - name: Fail if read-only files have changed if: ${{ steps.changed_files.outputs.read_only_sol == 'true' }} diff --git a/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts b/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts deleted file mode 100644 index f393a5de1c2..00000000000 --- a/contracts/test/v0.8/automation/AutomationGasAnalysis.test.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { ethers } from 'hardhat' -import { BigNumber } from 'ethers' -import { expect, assert } from 'chai' -import { getUsers } from '../../test-helpers/setup' -import { randomAddress, toWei } from '../../test-helpers/helpers' -import { deployRegistry21 } from './helpers' - -// don't run these tests in CI -const describeMaybe = process.env.CI ? describe.skip : describe - -// registry settings -const f = 1 -const linkEth = BigNumber.from(300000000) -const gasWei = BigNumber.from(100) -const minUpkeepSpend = BigNumber.from('1000000000000000000') -const paymentPremiumPPB = BigNumber.from(250000000) -const flatFeeMicroLink = BigNumber.from(0) -const blockCountPerTurn = 20 -const checkGasLimit = BigNumber.from(20000000) -const fallbackGasPrice = BigNumber.from(200) -const fallbackLinkPrice = BigNumber.from(200000000) -const maxCheckDataSize = BigNumber.from(10000) -const maxPerformDataSize = BigNumber.from(10000) -const maxRevertDataSize = BigNumber.from(1000) -const maxPerformGas = BigNumber.from(5000000) -const stalenessSeconds = BigNumber.from(43820) -const gasCeilingMultiplier = BigNumber.from(1) -const signers = [ - randomAddress(), - randomAddress(), - randomAddress(), - randomAddress(), -] -const transmitters = [ - randomAddress(), - randomAddress(), - randomAddress(), - randomAddress(), -] -const transcoder = ethers.constants.AddressZero - -// registrar settings -const triggerType = 0 // conditional -const autoApproveType = 2 // auto-approve enabled -const autoApproveMaxAllowed = 100 // auto-approve enabled - -// upkeep settings -const name = 'test upkeep' -const encryptedEmail = '0xabcd1234' -const gasLimit = 100_000 -const checkData = '0xdeadbeef' -const amount = toWei('5') -const source = 5 -const triggerConfig = '0x' -const offchainConfig = '0x' - -describeMaybe('Automation Gas Analysis', () => { - it('Compares gas usage amongst registries / registrars', async () => { - assert( - Boolean(process.env.REPORT_GAS), - 'this test must be run with REPORT_GAS=true', - ) - - const personas = (await getUsers()).personas - const owner = personas.Default - const ownerAddress = await owner.getAddress() - - // factories - const getFact = ethers.getContractFactory - const linkTokenFactory = await getFact('LinkToken') - const mockV3AggregatorFactory = await getFact( - 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', - ) - const upkeepMockFactory = await getFact('UpkeepMock') - const registry12Factory = await getFact('KeeperRegistry1_2') - const registrar12Factory = await getFact('KeeperRegistrar') - const registry20Factory = await getFact('KeeperRegistry2_0') - const registryLogic20Factory = await getFact('KeeperRegistryLogic2_0') - const registrar20Factory = await getFact('KeeperRegistrar2_0') - const registrar21Factory = await getFact('AutomationRegistrar2_1') - const forwarderLogicFactory = await getFact('AutomationForwarderLogic') - - // deploy dependancy contracts - const linkToken = await linkTokenFactory.connect(owner).deploy() - const gasPriceFeed = await mockV3AggregatorFactory - .connect(owner) - .deploy(0, gasWei) - const linkEthFeed = await mockV3AggregatorFactory - .connect(owner) - .deploy(9, linkEth) - const upkeep = await upkeepMockFactory.connect(owner).deploy() - - // deploy v1.2 - const registrar12 = await registrar12Factory.connect(owner).deploy( - linkToken.address, - autoApproveType, - autoApproveMaxAllowed, - ethers.constants.AddressZero, // set later - minUpkeepSpend, - ) - const registry12 = await registry12Factory - .connect(owner) - .deploy(linkToken.address, linkEthFeed.address, gasPriceFeed.address, { - paymentPremiumPPB, - flatFeeMicroLink, - blockCountPerTurn, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder, - registrar: registrar12.address, - }) - await registrar12.setRegistrationConfig( - autoApproveType, - autoApproveMaxAllowed, - registry12.address, - minUpkeepSpend, - ) - - // deploy v2.0 - const registryLogic20 = await registryLogic20Factory - .connect(owner) - .deploy(0, linkToken.address, linkEthFeed.address, gasPriceFeed.address) - const registry20 = await registry20Factory - .connect(owner) - .deploy(registryLogic20.address) - const registrar20 = await registrar20Factory - .connect(owner) - .deploy( - linkToken.address, - autoApproveType, - autoApproveMaxAllowed, - registry20.address, - minUpkeepSpend, - ) - const config20 = { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder, - registrar: registrar20.address, - } - const onchainConfig20 = ethers.utils.defaultAbiCoder.encode( - [ - 'tuple(uint32 paymentPremiumPPB,uint32 flatFeeMicroLink,uint32 checkGasLimit,uint24 stalenessSeconds\ - ,uint16 gasCeilingMultiplier,uint96 minUpkeepSpend,uint32 maxPerformGas,uint32 maxCheckDataSize,\ - uint32 maxPerformDataSize,uint256 fallbackGasPrice,uint256 fallbackLinkPrice,address transcoder,\ - address registrar)', - ], - [config20], - ) - await registry20 - .connect(owner) - .setConfig(signers, transmitters, f, onchainConfig20, 1, '0x') - - // deploy v2.1 - const forwarderLogic = await forwarderLogicFactory.connect(owner).deploy() - const registry21 = await deployRegistry21( - owner, - 0, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - forwarderLogic.address, - ) - const registrar21 = await registrar21Factory - .connect(owner) - .deploy(linkToken.address, registry21.address, minUpkeepSpend, [ - { - triggerType, - autoApproveType, - autoApproveMaxAllowed, - }, - ]) - const onchainConfig21 = { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder, - registrars: [registrar21.address], - upkeepPrivilegeManager: randomAddress(), - } - await registry21 - .connect(owner) - .setConfigTypeSafe(signers, transmitters, f, onchainConfig21, 1, '0x') - - // approve LINK - await linkToken.connect(owner).approve(registrar20.address, amount) - await linkToken.connect(owner).approve(registrar21.address, amount) - - const abiEncodedBytes = registrar12.interface.encodeFunctionData( - 'register', - [ - name, - encryptedEmail, - upkeep.address, - gasLimit, - ownerAddress, - checkData, - amount, - source, - ownerAddress, - ], - ) - - let tx = await linkToken - .connect(owner) - .transferAndCall(registrar12.address, amount, abiEncodedBytes) - await expect(tx).to.emit(registry12, 'UpkeepRegistered') - - tx = await registrar20.connect(owner).registerUpkeep({ - name, - encryptedEmail, - upkeepContract: upkeep.address, - gasLimit, - adminAddress: ownerAddress, - checkData, - amount, - offchainConfig, - }) - await expect(tx).to.emit(registry20, 'UpkeepRegistered') - - tx = await registrar21.connect(owner).registerUpkeep({ - name, - encryptedEmail, - upkeepContract: upkeep.address, - gasLimit, - adminAddress: ownerAddress, - triggerType, - checkData, - amount, - triggerConfig, - offchainConfig, - }) - await expect(tx).to.emit(registry21, 'UpkeepRegistered') - }) -}) diff --git a/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts b/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts deleted file mode 100644 index 6d3d591acb0..00000000000 --- a/contracts/test/v0.8/automation/AutomationRegistrar2_1.test.ts +++ /dev/null @@ -1,1022 +0,0 @@ -import { ethers } from 'hardhat' -import { assert } from 'chai' -import { AutomationRegistrar2_1__factory as AutomationRegistrarFactory } from '../../../typechain/factories/AutomationRegistrar2_1__factory' - -////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////// - -/*********************************** REGISTRAR v2.1 IS FROZEN ************************************/ - -// As 2.1 is still actively being deployed, we keep the tests below. - -describe('AutomationRegistrar2_1 - Frozen [ @skip-coverage ]', () => { - it('has not changed', () => { - assert.equal( - ethers.utils.id(AutomationRegistrarFactory.bytecode), - '0x9633058bd81e8479f88baaee9bda533406295c80ccbc43d4509701001bbea6e3', - 'KeeperRegistry bytecode has changed', - ) - }) -}) - -////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////// -// -// // copied from KeeperRegistryBase2_1.sol -// enum Trigger { -// CONDITION, -// LOG, -// } -// -// let linkTokenFactory: LinkTokenFactory -// let mockV3AggregatorFactory: MockV3AggregatorFactory -// let upkeepMockFactory: UpkeepMockFactory -// -// let personas: Personas -// -// before(async () => { -// personas = (await getUsers()).personas -// -// linkTokenFactory = await ethers.getContractFactory( -// 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', -// ) -// mockV3AggregatorFactory = (await ethers.getContractFactory( -// 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', -// )) as unknown as MockV3AggregatorFactory -// upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') -// }) -// -// const errorMsgs = { -// onlyOwner: 'revert Only callable by owner', -// onlyAdmin: 'OnlyAdminOrOwner()', -// hashPayload: 'HashMismatch()', -// requestNotFound: 'RequestNotFound()', -// } -// -// describe('AutomationRegistrar2_1', () => { -// const upkeepName = 'SampleUpkeep' -// -// const linkEth = BigNumber.from(300000000) -// const gasWei = BigNumber.from(100) -// const performGas = BigNumber.from(100000) -// const paymentPremiumPPB = BigNumber.from(250000000) -// const flatFeeMicroLink = BigNumber.from(0) -// const maxAllowedAutoApprove = 5 -// const trigger = '0xdeadbeef' -// const offchainConfig = '0x01234567' -// -// const emptyBytes = '0x00' -// const stalenessSeconds = BigNumber.from(43820) -// const gasCeilingMultiplier = BigNumber.from(1) -// const checkGasLimit = BigNumber.from(20000000) -// const fallbackGasPrice = BigNumber.from(200) -// const fallbackLinkPrice = BigNumber.from(200000000) -// const maxCheckDataSize = BigNumber.from(10000) -// const maxPerformDataSize = BigNumber.from(10000) -// const maxRevertDataSize = BigNumber.from(1000) -// const maxPerformGas = BigNumber.from(5000000) -// const minUpkeepSpend = BigNumber.from('1000000000000000000') -// const amount = BigNumber.from('5000000000000000000') -// const amount1 = BigNumber.from('6000000000000000000') -// const transcoder = ethers.constants.AddressZero -// const upkeepManager = ethers.Wallet.createRandom().address -// -// // Enum values are not auto exported in ABI so have to manually declare -// const autoApproveType_DISABLED = 0 -// const autoApproveType_ENABLED_SENDER_ALLOWLIST = 1 -// const autoApproveType_ENABLED_ALL = 2 -// -// let owner: Signer -// let admin: Signer -// let someAddress: Signer -// let registrarOwner: Signer -// let stranger: Signer -// let requestSender: Signer -// -// let linkToken: LinkToken -// let linkEthFeed: MockV3Aggregator -// let gasPriceFeed: MockV3Aggregator -// let mock: UpkeepMock -// let registry: IKeeperRegistry -// let registrar: Registrar -// -// beforeEach(async () => { -// owner = personas.Default -// admin = personas.Neil -// someAddress = personas.Ned -// registrarOwner = personas.Nelly -// stranger = personas.Nancy -// requestSender = personas.Norbert -// -// linkToken = await linkTokenFactory.connect(owner).deploy() -// gasPriceFeed = await mockV3AggregatorFactory -// .connect(owner) -// .deploy(0, gasWei) -// linkEthFeed = await mockV3AggregatorFactory -// .connect(owner) -// .deploy(9, linkEth) -// -// registry = await deployRegistry21( -// owner, -// 0, -// linkToken.address, -// linkEthFeed.address, -// gasPriceFeed.address, -// ) -// -// mock = await upkeepMockFactory.deploy() -// -// const registrarFactory = await ethers.getContractFactory( -// 'AutomationRegistrar2_1', -// ) -// registrar = await registrarFactory -// .connect(registrarOwner) -// .deploy(linkToken.address, registry.address, minUpkeepSpend, [ -// { -// triggerType: Trigger.CONDITION, -// autoApproveType: autoApproveType_DISABLED, -// autoApproveMaxAllowed: 0, -// }, -// { -// triggerType: Trigger.LOG, -// autoApproveType: autoApproveType_DISABLED, -// autoApproveMaxAllowed: 0, -// }, -// ]) -// -// await linkToken -// .connect(owner) -// .transfer(await requestSender.getAddress(), toWei('1000')) -// -// const keepers = [ -// await personas.Carol.getAddress(), -// await personas.Nancy.getAddress(), -// await personas.Ned.getAddress(), -// await personas.Neil.getAddress(), -// ] -// const onchainConfig = { -// paymentPremiumPPB, -// flatFeeMicroLink, -// checkGasLimit, -// stalenessSeconds, -// gasCeilingMultiplier, -// minUpkeepSpend, -// maxCheckDataSize, -// maxPerformDataSize, -// maxRevertDataSize, -// maxPerformGas, -// fallbackGasPrice, -// fallbackLinkPrice, -// transcoder, -// registrars: [registrar.address], -// upkeepPrivilegeManager: upkeepManager, -// } -// await registry -// .connect(owner) -// .setConfigTypeSafe(keepers, keepers, 1, onchainConfig, 1, '0x') -// }) -// -// describe('#typeAndVersion', () => { -// it('uses the correct type and version', async () => { -// const typeAndVersion = await registrar.typeAndVersion() -// assert.equal(typeAndVersion, 'AutomationRegistrar 2.1.0') -// }) -// }) -// -// describe('#register', () => { -// it('reverts if not called by the LINK token', async () => { -// await evmRevert( -// registrar -// .connect(someAddress) -// .register( -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ), -// 'OnlyLink()', -// ) -// }) -// -// it('reverts if the amount passed in data mismatches actual amount sent', async () => { -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_ENABLED_ALL, -// maxAllowedAutoApprove, -// ) -// -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount1, -// await requestSender.getAddress(), -// ], -// ) -// -// await evmRevert( -// linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes), -// 'AmountMismatch()', -// ) -// }) -// -// it('reverts if the sender passed in data mismatches actual sender', async () => { -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await admin.getAddress(), // Should have been requestSender.getAddress() -// ], -// ) -// await evmRevert( -// linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes), -// 'SenderMismatch()', -// ) -// }) -// -// it('reverts if the admin address is 0x0000...', async () => { -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// '0x0000000000000000000000000000000000000000', -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// -// await evmRevert( -// linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes), -// 'RegistrationRequestFailed()', -// ) -// }) -// -// it('Auto Approve ON - registers an upkeep on KeeperRegistry instantly and emits both RegistrationRequested and RegistrationApproved events', async () => { -// //set auto approve ON with high threshold limits -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_ENABLED_ALL, -// maxAllowedAutoApprove, -// ) -// -// //register with auto approve ON -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// const tx = await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// -// const [id] = await registry.getActiveUpkeepIDs(0, 1) -// -// //confirm if a new upkeep has been registered and the details are the same as the one just registered -// const newupkeep = await registry.getUpkeep(id) -// assert.equal(newupkeep.target, mock.address) -// assert.equal(newupkeep.admin, await admin.getAddress()) -// assert.equal(newupkeep.checkData, emptyBytes) -// assert.equal(newupkeep.balance.toString(), amount.toString()) -// assert.equal(newupkeep.performGas, performGas.toNumber()) -// assert.equal(newupkeep.offchainConfig, offchainConfig) -// -// await expect(tx).to.emit(registrar, 'RegistrationRequested') -// await expect(tx).to.emit(registrar, 'RegistrationApproved') -// }) -// -// it('Auto Approve OFF - does not registers an upkeep on KeeperRegistry, emits only RegistrationRequested event', async () => { -// //get upkeep count before attempting registration -// const beforeCount = (await registry.getState()).state.numUpkeeps -// -// //set auto approve OFF, threshold limits dont matter in this case -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_DISABLED, -// maxAllowedAutoApprove, -// ) -// -// //register with auto approve OFF -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// const tx = await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// const receipt = await tx.wait() -// -// //get upkeep count after attempting registration -// const afterCount = (await registry.getState()).state.numUpkeeps -// //confirm that a new upkeep has NOT been registered and upkeep count is still the same -// assert.deepEqual(beforeCount, afterCount) -// -// //confirm that only RegistrationRequested event is emitted and RegistrationApproved event is not -// await expect(tx).to.emit(registrar, 'RegistrationRequested') -// await expect(tx).not.to.emit(registrar, 'RegistrationApproved') -// -// const hash = receipt.logs[2].topics[1] -// const pendingRequest = await registrar.getPendingRequest(hash) -// assert.equal(await admin.getAddress(), pendingRequest[0]) -// assert.ok(amount.eq(pendingRequest[1])) -// }) -// -// it('Auto Approve ON - Throttle max approvals - does not register an upkeep on KeeperRegistry beyond the max limit, emits only RegistrationRequested event after limit is hit', async () => { -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 0) -// -// //set auto approve on, with max 1 allowed -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig(Trigger.CONDITION, autoApproveType_ENABLED_ALL, 1) -// -// //set auto approve on, with max 1 allowed -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig(Trigger.LOG, autoApproveType_ENABLED_ALL, 1) -// -// // register within threshold, new upkeep should be registered -// let abiEncodedBytes = registrar.interface.encodeFunctionData('register', [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ]) -// await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 1) // 0 -> 1 -// -// // try registering another one, new upkeep should not be registered -// abiEncodedBytes = registrar.interface.encodeFunctionData('register', [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas.toNumber() + 1, // make unique hash -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ]) -// await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 1) // Still 1 -// -// // register a second type of upkeep, different limit -// abiEncodedBytes = registrar.interface.encodeFunctionData('register', [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// Trigger.LOG, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ]) -// await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 2) // 1 -> 2 -// -// // Now set new max limit to 2. One more upkeep should get auto approved -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig(Trigger.CONDITION, autoApproveType_ENABLED_ALL, 2) -// -// abiEncodedBytes = registrar.interface.encodeFunctionData('register', [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas.toNumber() + 2, // make unique hash -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ]) -// await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 3) // 2 -> 3 -// -// // One more upkeep should not get registered -// abiEncodedBytes = registrar.interface.encodeFunctionData('register', [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas.toNumber() + 3, // make unique hash -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ]) -// await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 3) // Still 3 -// }) -// -// it('Auto Approve Sender Allowlist - sender in allowlist - registers an upkeep on KeeperRegistry instantly and emits both RegistrationRequested and RegistrationApproved events', async () => { -// const senderAddress = await requestSender.getAddress() -// -// //set auto approve to ENABLED_SENDER_ALLOWLIST type with high threshold limits -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_ENABLED_SENDER_ALLOWLIST, -// maxAllowedAutoApprove, -// ) -// -// // Add sender to allowlist -// await registrar -// .connect(registrarOwner) -// .setAutoApproveAllowedSender(senderAddress, true) -// -// //register with auto approve ON -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// const tx = await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// -// const [id] = await registry.getActiveUpkeepIDs(0, 1) -// -// //confirm if a new upkeep has been registered and the details are the same as the one just registered -// const newupkeep = await registry.getUpkeep(id) -// assert.equal(newupkeep.target, mock.address) -// assert.equal(newupkeep.admin, await admin.getAddress()) -// assert.equal(newupkeep.checkData, emptyBytes) -// assert.equal(newupkeep.balance.toString(), amount.toString()) -// assert.equal(newupkeep.performGas, performGas.toNumber()) -// -// await expect(tx).to.emit(registrar, 'RegistrationRequested') -// await expect(tx).to.emit(registrar, 'RegistrationApproved') -// }) -// -// it('Auto Approve Sender Allowlist - sender NOT in allowlist - does not registers an upkeep on KeeperRegistry, emits only RegistrationRequested event', async () => { -// const beforeCount = (await registry.getState()).state.numUpkeeps -// const senderAddress = await requestSender.getAddress() -// -// //set auto approve to ENABLED_SENDER_ALLOWLIST type with high threshold limits -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_ENABLED_SENDER_ALLOWLIST, -// maxAllowedAutoApprove, -// ) -// -// // Explicitly remove sender from allowlist -// await registrar -// .connect(registrarOwner) -// .setAutoApproveAllowedSender(senderAddress, false) -// -// //register. auto approve shouldn't happen -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// const tx = await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// const receipt = await tx.wait() -// -// //get upkeep count after attempting registration -// const afterCount = (await registry.getState()).state.numUpkeeps -// //confirm that a new upkeep has NOT been registered and upkeep count is still the same -// assert.deepEqual(beforeCount, afterCount) -// -// //confirm that only RegistrationRequested event is emitted and RegistrationApproved event is not -// await expect(tx).to.emit(registrar, 'RegistrationRequested') -// await expect(tx).not.to.emit(registrar, 'RegistrationApproved') -// -// const hash = receipt.logs[2].topics[1] -// const pendingRequest = await registrar.getPendingRequest(hash) -// assert.equal(await admin.getAddress(), pendingRequest[0]) -// assert.ok(amount.eq(pendingRequest[1])) -// }) -// }) -// -// describe('#registerUpkeep', () => { -// it('reverts with empty message if amount sent is not available in LINK allowance', async () => { -// await evmRevert( -// registrar.connect(someAddress).registerUpkeep({ -// name: upkeepName, -// upkeepContract: mock.address, -// gasLimit: performGas, -// adminAddress: await admin.getAddress(), -// triggerType: 0, -// checkData: emptyBytes, -// triggerConfig: trigger, -// offchainConfig: emptyBytes, -// amount, -// encryptedEmail: emptyBytes, -// }), -// '', -// ) -// }) -// -// it('reverts if the amount passed in data is less than configured minimum', async () => { -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_ENABLED_ALL, -// maxAllowedAutoApprove, -// ) -// -// // amt is one order of magnitude less than minUpkeepSpend -// const amt = BigNumber.from('100000000000000000') -// -// await evmRevert( -// registrar.connect(someAddress).registerUpkeep({ -// name: upkeepName, -// upkeepContract: mock.address, -// gasLimit: performGas, -// adminAddress: await admin.getAddress(), -// triggerType: 0, -// checkData: emptyBytes, -// triggerConfig: trigger, -// offchainConfig: emptyBytes, -// amount: amt, -// encryptedEmail: emptyBytes, -// }), -// 'InsufficientPayment()', -// ) -// }) -// -// it('Auto Approve ON - registers an upkeep on KeeperRegistry instantly and emits both RegistrationRequested and RegistrationApproved events', async () => { -// //set auto approve ON with high threshold limits -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_ENABLED_ALL, -// maxAllowedAutoApprove, -// ) -// -// await linkToken.connect(requestSender).approve(registrar.address, amount) -// -// const tx = await registrar.connect(requestSender).registerUpkeep({ -// name: upkeepName, -// upkeepContract: mock.address, -// gasLimit: performGas, -// adminAddress: await admin.getAddress(), -// triggerType: 0, -// checkData: emptyBytes, -// triggerConfig: trigger, -// offchainConfig, -// amount, -// encryptedEmail: emptyBytes, -// }) -// assert.equal((await registry.getState()).state.numUpkeeps.toNumber(), 1) // 0 -> 1 -// -// //confirm if a new upkeep has been registered and the details are the same as the one just registered -// const [id] = await registry.getActiveUpkeepIDs(0, 1) -// const newupkeep = await registry.getUpkeep(id) -// assert.equal(newupkeep.target, mock.address) -// assert.equal(newupkeep.admin, await admin.getAddress()) -// assert.equal(newupkeep.checkData, emptyBytes) -// assert.equal(newupkeep.balance.toString(), amount.toString()) -// assert.equal(newupkeep.performGas, performGas.toNumber()) -// assert.equal(newupkeep.offchainConfig, offchainConfig) -// -// await expect(tx).to.emit(registrar, 'RegistrationRequested') -// await expect(tx).to.emit(registrar, 'RegistrationApproved') -// }) -// }) -// -// describe('#setAutoApproveAllowedSender', () => { -// it('reverts if not called by the owner', async () => { -// const tx = registrar -// .connect(stranger) -// .setAutoApproveAllowedSender(await admin.getAddress(), false) -// await evmRevert(tx, 'Only callable by owner') -// }) -// -// it('sets the allowed status correctly and emits log', async () => { -// const senderAddress = await stranger.getAddress() -// let tx = await registrar -// .connect(registrarOwner) -// .setAutoApproveAllowedSender(senderAddress, true) -// await expect(tx) -// .to.emit(registrar, 'AutoApproveAllowedSenderSet') -// .withArgs(senderAddress, true) -// -// let senderAllowedStatus = await registrar -// .connect(owner) -// .getAutoApproveAllowedSender(senderAddress) -// assert.isTrue(senderAllowedStatus) -// -// tx = await registrar -// .connect(registrarOwner) -// .setAutoApproveAllowedSender(senderAddress, false) -// await expect(tx) -// .to.emit(registrar, 'AutoApproveAllowedSenderSet') -// .withArgs(senderAddress, false) -// -// senderAllowedStatus = await registrar -// .connect(owner) -// .getAutoApproveAllowedSender(senderAddress) -// assert.isFalse(senderAllowedStatus) -// }) -// }) -// -// describe('#setTriggerConfig', () => { -// it('reverts if not called by the owner', async () => { -// const tx = registrar -// .connect(stranger) -// .setTriggerConfig(Trigger.LOG, autoApproveType_ENABLED_ALL, 100) -// await evmRevert(tx, 'Only callable by owner') -// }) -// -// it('changes the config', async () => { -// const tx = await registrar -// .connect(registrarOwner) -// .setTriggerConfig(Trigger.LOG, autoApproveType_ENABLED_ALL, 100) -// await registrar.getTriggerRegistrationDetails(Trigger.LOG) -// await expect(tx) -// .to.emit(registrar, 'TriggerConfigSet') -// .withArgs(Trigger.LOG, autoApproveType_ENABLED_ALL, 100) -// }) -// }) -// -// describe('#approve', () => { -// let hash: string -// -// beforeEach(async () => { -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_DISABLED, -// maxAllowedAutoApprove, -// ) -// -// //register with auto approve OFF -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// -// const tx = await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// const receipt = await tx.wait() -// hash = receipt.logs[2].topics[1] -// }) -// -// it('reverts if not called by the owner', async () => { -// const tx = registrar -// .connect(stranger) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// emptyBytes, -// hash, -// ) -// await evmRevert(tx, 'Only callable by owner') -// }) -// -// it('reverts if the hash does not exist', async () => { -// const tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// emptyBytes, -// '0x000000000000000000000000322813fd9a801c5507c9de605d63cea4f2ce6c44', -// ) -// await evmRevert(tx, errorMsgs.requestNotFound) -// }) -// -// it('reverts if any member of the payload changes', async () => { -// let tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// ethers.Wallet.createRandom().address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// emptyBytes, -// hash, -// ) -// await evmRevert(tx, errorMsgs.hashPayload) -// tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// 10000, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// emptyBytes, -// hash, -// ) -// await evmRevert(tx, errorMsgs.hashPayload) -// tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// ethers.Wallet.createRandom().address, -// 0, -// emptyBytes, -// trigger, -// emptyBytes, -// hash, -// ) -// await evmRevert(tx, errorMsgs.hashPayload) -// tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// '0x1234', -// trigger, -// emptyBytes, -// hash, -// ) -// await evmRevert(tx, errorMsgs.hashPayload) -// }) -// -// it('approves an existing registration request', async () => { -// const tx = await registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// hash, -// ) -// await expect(tx).to.emit(registrar, 'RegistrationApproved') -// }) -// -// it('deletes the request afterwards / reverts if the request DNE', async () => { -// await registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// hash, -// ) -// const tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// hash, -// ) -// await evmRevert(tx, errorMsgs.requestNotFound) -// }) -// }) -// -// describe('#cancel', () => { -// let hash: string -// -// beforeEach(async () => { -// await registrar -// .connect(registrarOwner) -// .setTriggerConfig( -// Trigger.CONDITION, -// autoApproveType_DISABLED, -// maxAllowedAutoApprove, -// ) -// -// //register with auto approve OFF -// const abiEncodedBytes = registrar.interface.encodeFunctionData( -// 'register', -// [ -// upkeepName, -// emptyBytes, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// offchainConfig, -// amount, -// await requestSender.getAddress(), -// ], -// ) -// const tx = await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// const receipt = await tx.wait() -// hash = receipt.logs[2].topics[1] -// // submit duplicate request (increase balance) -// await linkToken -// .connect(requestSender) -// .transferAndCall(registrar.address, amount, abiEncodedBytes) -// }) -// -// it('reverts if not called by the admin / owner', async () => { -// const tx = registrar.connect(stranger).cancel(hash) -// await evmRevert(tx, errorMsgs.onlyAdmin) -// }) -// -// it('reverts if the hash does not exist', async () => { -// const tx = registrar -// .connect(registrarOwner) -// .cancel( -// '0x000000000000000000000000322813fd9a801c5507c9de605d63cea4f2ce6c44', -// ) -// await evmRevert(tx, errorMsgs.requestNotFound) -// }) -// -// it('refunds the total request balance to the admin address if owner cancels', async () => { -// const before = await linkToken.balanceOf(await admin.getAddress()) -// const tx = await registrar.connect(registrarOwner).cancel(hash) -// const after = await linkToken.balanceOf(await admin.getAddress()) -// assert.isTrue(after.sub(before).eq(amount.mul(BigNumber.from(2)))) -// await expect(tx).to.emit(registrar, 'RegistrationRejected') -// }) -// -// it('refunds the total request balance to the admin address if admin cancels', async () => { -// const before = await linkToken.balanceOf(await admin.getAddress()) -// const tx = await registrar.connect(admin).cancel(hash) -// const after = await linkToken.balanceOf(await admin.getAddress()) -// assert.isTrue(after.sub(before).eq(amount.mul(BigNumber.from(2)))) -// await expect(tx).to.emit(registrar, 'RegistrationRejected') -// }) -// -// it('deletes the request hash', async () => { -// await registrar.connect(registrarOwner).cancel(hash) -// let tx = registrar.connect(registrarOwner).cancel(hash) -// await evmRevert(tx, errorMsgs.requestNotFound) -// tx = registrar -// .connect(registrarOwner) -// .approve( -// upkeepName, -// mock.address, -// performGas, -// await admin.getAddress(), -// 0, -// emptyBytes, -// trigger, -// emptyBytes, -// hash, -// ) -// await evmRevert(tx, errorMsgs.requestNotFound) -// }) -// }) -// }) diff --git a/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts b/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts deleted file mode 100644 index 593ac08a5e7..00000000000 --- a/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts +++ /dev/null @@ -1,5962 +0,0 @@ -import { ethers } from 'hardhat' -import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' -import { assert, expect } from 'chai' -import { - BigNumber, - BigNumberish, - BytesLike, - Contract, - ContractFactory, - ContractReceipt, - ContractTransaction, - Signer, - Wallet, -} from 'ethers' -import { evmRevert, evmRevertCustomError } from '../../test-helpers/matchers' -import { getUsers, Personas } from '../../test-helpers/setup' -import { randomAddress, toWei } from '../../test-helpers/helpers' -import { StreamsLookupUpkeep__factory as StreamsLookupUpkeepFactory } from '../../../typechain/factories/StreamsLookupUpkeep__factory' -import { MockV3Aggregator__factory as MockV3AggregatorFactory } from '../../../typechain/factories/MockV3Aggregator__factory' -import { UpkeepMock__factory as UpkeepMockFactory } from '../../../typechain/factories/UpkeepMock__factory' -import { UpkeepAutoFunder__factory as UpkeepAutoFunderFactory } from '../../../typechain/factories/UpkeepAutoFunder__factory' -import { MockArbGasInfo__factory as MockArbGasInfoFactory } from '../../../typechain/factories/MockArbGasInfo__factory' -import { MockOVMGasPriceOracle__factory as MockOVMGasPriceOracleFactory } from '../../../typechain/factories/MockOVMGasPriceOracle__factory' -import { ChainModuleBase__factory as ChainModuleBaseFactory } from '../../../typechain/factories/ChainModuleBase__factory' -import { ArbitrumModule__factory as ArbitrumModuleFactory } from '../../../typechain/factories/ArbitrumModule__factory' -import { OptimismModuleV2__factory as OptimismModuleV2Factory } from '../../../typechain/factories/OptimismModuleV2__factory' -import { ILogAutomation__factory as ILogAutomationactory } from '../../../typechain/factories/ILogAutomation__factory' -import { IAutomationForwarder__factory as IAutomationForwarderFactory } from '../../../typechain/factories/IAutomationForwarder__factory' -import { MockArbSys__factory as MockArbSysFactory } from '../../../typechain/factories/MockArbSys__factory' -import { AutomationCompatibleUtils } from '../../../typechain/AutomationCompatibleUtils' -import { MockArbGasInfo } from '../../../typechain/MockArbGasInfo' -import { MockOVMGasPriceOracle } from '../../../typechain/MockOVMGasPriceOracle' -import { StreamsLookupUpkeep } from '../../../typechain/StreamsLookupUpkeep' -import { MockV3Aggregator } from '../../../typechain/MockV3Aggregator' -import { UpkeepMock } from '../../../typechain/UpkeepMock' -import { ChainModuleBase } from '../../../typechain/ChainModuleBase' -import { ArbitrumModule } from '../../../typechain/ArbitrumModule' -import { OptimismModuleV2 } from '../../../typechain/OptimismModuleV2' -import { UpkeepTranscoder } from '../../../typechain/UpkeepTranscoder' -import { IChainModule, UpkeepAutoFunder } from '../../../typechain' -import { - CancelledUpkeepReportEvent, - IAutomationRegistryMaster as IAutomationRegistry, - ReorgedUpkeepReportEvent, - StaleUpkeepReportEvent, - UpkeepPerformedEvent, -} from '../../../typechain/IAutomationRegistryMaster' -import { - deployMockContract, - MockContract, -} from '@ethereum-waffle/mock-contract' -import { deployRegistry22 } from './helpers' - -const describeMaybe = process.env.SKIP_SLOW ? describe.skip : describe -const itMaybe = process.env.SKIP_SLOW ? it.skip : it - -// copied from AutomationRegistryInterface2_2.sol -enum UpkeepFailureReason { - NONE, - UPKEEP_CANCELLED, - UPKEEP_PAUSED, - TARGET_CHECK_REVERTED, - UPKEEP_NOT_NEEDED, - PERFORM_DATA_EXCEEDS_LIMIT, - INSUFFICIENT_BALANCE, - CHECK_CALLBACK_REVERTED, - REVERT_DATA_EXCEEDS_LIMIT, - REGISTRY_PAUSED, -} - -// copied from AutomationRegistryBase2_2.sol -enum Trigger { - CONDITION, - LOG, -} - -// un-exported types that must be extracted from the utils contract -type Report = Parameters[0] -type LogTrigger = Parameters[0] -type ConditionalTrigger = Parameters< - AutomationCompatibleUtils['_conditionalTrigger'] ->[0] -type Log = Parameters[0] - -// ----------------------------------------------------------------------------------------------- - -// These values should match the constants declared in registry -let registryConditionalOverhead: BigNumber -let registryLogOverhead: BigNumber -let registryPerSignerGasOverhead: BigNumber -let registryPerPerformByteGasOverhead: BigNumber -let registryTransmitCalldataFixedBytesOverhead: BigNumber -let registryTransmitCalldataPerSignerBytesOverhead: BigNumber -let cancellationDelay: number - -// This is the margin for gas that we test for. Gas charged should always be greater -// than total gas used in tx but should not increase beyond this margin -const gasCalculationMargin = BigNumber.from(5000) -// This is the margin for gas overhead estimation in checkUpkeep. The estimated gas -// overhead should be larger than actual gas overhead but should not increase beyond this margin -const gasEstimationMargin = BigNumber.from(5000) - -const linkEth = BigNumber.from(5000000000000000) // 1 Link = 0.005 Eth -const gasWei = BigNumber.from(1000000000) // 1 gwei -// ----------------------------------------------------------------------------------------------- -// test-wide configs for upkeeps -const linkDivisibility = BigNumber.from('1000000000000000000') -const performGas = BigNumber.from('1000000') -const paymentPremiumBase = BigNumber.from('1000000000') -const paymentPremiumPPB = BigNumber.from('250000000') -const flatFeeMicroLink = BigNumber.from(0) - -const randomBytes = '0x1234abcd' -const emptyBytes = '0x' -const emptyBytes32 = - '0x0000000000000000000000000000000000000000000000000000000000000000' - -const transmitGasOverhead = 1_000_000 -const checkGasOverhead = 500_000 - -const stalenessSeconds = BigNumber.from(43820) -const gasCeilingMultiplier = BigNumber.from(2) -const checkGasLimit = BigNumber.from(10000000) -const fallbackGasPrice = gasWei.mul(BigNumber.from('2')) -const fallbackLinkPrice = linkEth.div(BigNumber.from('2')) -const maxCheckDataSize = BigNumber.from(1000) -const maxPerformDataSize = BigNumber.from(1000) -const maxRevertDataSize = BigNumber.from(1000) -const maxPerformGas = BigNumber.from(5000000) -const minUpkeepSpend = BigNumber.from(0) -const f = 1 -const offchainVersion = 1 -const offchainBytes = '0x' -const zeroAddress = ethers.constants.AddressZero -const epochAndRound5_1 = - '0x0000000000000000000000000000000000000000000000000000000000000501' - -let logTriggerConfig: string - -// ----------------------------------------------------------------------------------------------- - -// Smart contract factories -let linkTokenFactory: ContractFactory -let mockArbGasInfoFactory: MockArbGasInfoFactory -let mockOVMGasPriceOracleFactory: MockOVMGasPriceOracleFactory -let mockV3AggregatorFactory: MockV3AggregatorFactory -let upkeepMockFactory: UpkeepMockFactory -let upkeepAutoFunderFactory: UpkeepAutoFunderFactory -let chainModuleBaseFactory: ChainModuleBaseFactory -let arbitrumModuleFactory: ArbitrumModuleFactory -let optimismModuleV2Factory: OptimismModuleV2Factory -let streamsLookupUpkeepFactory: StreamsLookupUpkeepFactory -let personas: Personas - -// contracts -let linkToken: Contract -let linkEthFeed: MockV3Aggregator -let gasPriceFeed: MockV3Aggregator -let registry: IAutomationRegistry // default registry, used for most tests -let arbRegistry: IAutomationRegistry // arbitrum registry -let opRegistry: IAutomationRegistry // optimism registry -let mgRegistry: IAutomationRegistry // "migrate registry" used in migration tests -let blankRegistry: IAutomationRegistry // used to test initial configurations -let mockArbGasInfo: MockArbGasInfo -let mockOVMGasPriceOracle: MockOVMGasPriceOracle -let mock: UpkeepMock -let autoFunderUpkeep: UpkeepAutoFunder -let ltUpkeep: MockContract -let transcoder: UpkeepTranscoder -let chainModuleBase: ChainModuleBase -let arbitrumModule: ArbitrumModule -let optimismModule: OptimismModuleV2 -let streamsLookupUpkeep: StreamsLookupUpkeep -let automationUtils: AutomationCompatibleUtils - -function now() { - return Math.floor(Date.now() / 1000) -} - -async function getUpkeepID(tx: ContractTransaction): Promise { - const receipt = await tx.wait() - for (const event of receipt.events || []) { - if ( - event.args && - event.eventSignature == 'UpkeepRegistered(uint256,uint32,address)' - ) { - return event.args[0] - } - } - throw new Error('could not find upkeep ID in tx event logs') -} - -const getTriggerType = (upkeepId: BigNumber): Trigger => { - const hexBytes = ethers.utils.defaultAbiCoder.encode(['uint256'], [upkeepId]) - const bytes = ethers.utils.arrayify(hexBytes) - for (let idx = 4; idx < 15; idx++) { - if (bytes[idx] != 0) { - return Trigger.CONDITION - } - } - return bytes[15] as Trigger -} - -const encodeBlockTrigger = (conditionalTrigger: ConditionalTrigger) => { - return ( - '0x' + - automationUtils.interface - .encodeFunctionData('_conditionalTrigger', [conditionalTrigger]) - .slice(10) - ) -} - -const encodeLogTrigger = (logTrigger: LogTrigger) => { - return ( - '0x' + - automationUtils.interface - .encodeFunctionData('_logTrigger', [logTrigger]) - .slice(10) - ) -} - -const encodeLog = (log: Log) => { - return ( - '0x' + automationUtils.interface.encodeFunctionData('_log', [log]).slice(10) - ) -} - -const encodeReport = (report: Report) => { - return ( - '0x' + - automationUtils.interface.encodeFunctionData('_report', [report]).slice(10) - ) -} - -type UpkeepData = { - Id: BigNumberish - performGas: BigNumberish - performData: BytesLike - trigger: BytesLike -} - -const makeReport = (upkeeps: UpkeepData[]) => { - const upkeepIds = upkeeps.map((u) => u.Id) - const performGases = upkeeps.map((u) => u.performGas) - const triggers = upkeeps.map((u) => u.trigger) - const performDatas = upkeeps.map((u) => u.performData) - return encodeReport({ - fastGasWei: gasWei, - linkNative: linkEth, - upkeepIds, - gasLimits: performGases, - triggers, - performDatas, - }) -} - -const makeLatestBlockReport = async (upkeepsIDs: BigNumberish[]) => { - const latestBlock = await ethers.provider.getBlock('latest') - const upkeeps: UpkeepData[] = [] - for (let i = 0; i < upkeepsIDs.length; i++) { - upkeeps.push({ - Id: upkeepsIDs[i], - performGas, - trigger: encodeBlockTrigger({ - blockNum: latestBlock.number, - blockHash: latestBlock.hash, - }), - performData: '0x', - }) - } - return makeReport(upkeeps) -} - -const signReport = ( - reportContext: string[], - report: any, - signers: Wallet[], -) => { - const reportDigest = ethers.utils.keccak256(report) - const packedArgs = ethers.utils.solidityPack( - ['bytes32', 'bytes32[3]'], - [reportDigest, reportContext], - ) - const packedDigest = ethers.utils.keccak256(packedArgs) - - const signatures = [] - for (const signer of signers) { - signatures.push(signer._signingKey().signDigest(packedDigest)) - } - const vs = signatures.map((i) => '0' + (i.v - 27).toString(16)).join('') - return { - vs: '0x' + vs.padEnd(64, '0'), - rs: signatures.map((i) => i.r), - ss: signatures.map((i) => i.s), - } -} - -const parseUpkeepPerformedLogs = (receipt: ContractReceipt) => { - const parsedLogs = [] - for (const rawLog of receipt.logs) { - try { - const log = registry.interface.parseLog(rawLog) - if ( - log.name == - registry.interface.events[ - 'UpkeepPerformed(uint256,bool,uint96,uint256,uint256,bytes)' - ].name - ) { - parsedLogs.push(log as unknown as UpkeepPerformedEvent) - } - } catch { - continue - } - } - return parsedLogs -} - -const parseReorgedUpkeepReportLogs = (receipt: ContractReceipt) => { - const parsedLogs = [] - for (const rawLog of receipt.logs) { - try { - const log = registry.interface.parseLog(rawLog) - if ( - log.name == - registry.interface.events['ReorgedUpkeepReport(uint256,bytes)'].name - ) { - parsedLogs.push(log as unknown as ReorgedUpkeepReportEvent) - } - } catch { - continue - } - } - return parsedLogs -} - -const parseStaleUpkeepReportLogs = (receipt: ContractReceipt) => { - const parsedLogs = [] - for (const rawLog of receipt.logs) { - try { - const log = registry.interface.parseLog(rawLog) - if ( - log.name == - registry.interface.events['StaleUpkeepReport(uint256,bytes)'].name - ) { - parsedLogs.push(log as unknown as StaleUpkeepReportEvent) - } - } catch { - continue - } - } - return parsedLogs -} - -const parseCancelledUpkeepReportLogs = (receipt: ContractReceipt) => { - const parsedLogs = [] - for (const rawLog of receipt.logs) { - try { - const log = registry.interface.parseLog(rawLog) - if ( - log.name == - registry.interface.events['CancelledUpkeepReport(uint256,bytes)'].name - ) { - parsedLogs.push(log as unknown as CancelledUpkeepReportEvent) - } - } catch { - continue - } - } - return parsedLogs -} - -describe('AutomationRegistry2_2', () => { - let owner: Signer - let keeper1: Signer - let keeper2: Signer - let keeper3: Signer - let keeper4: Signer - let keeper5: Signer - let nonkeeper: Signer - let signer1: Wallet - let signer2: Wallet - let signer3: Wallet - let signer4: Wallet - let signer5: Wallet - let admin: Signer - let payee1: Signer - let payee2: Signer - let payee3: Signer - let payee4: Signer - let payee5: Signer - - let upkeepId: BigNumber // conditional upkeep - let afUpkeepId: BigNumber // auto funding upkeep - let logUpkeepId: BigNumber // log trigger upkeepID - let streamsLookupUpkeepId: BigNumber // streams lookup upkeep - const numUpkeeps = 4 // see above - let keeperAddresses: string[] - let payees: string[] - let signers: Wallet[] - let signerAddresses: string[] - let config: any - let arbConfig: any - let opConfig: any - let baseConfig: Parameters - let arbConfigParams: Parameters - let opConfigParams: Parameters - let upkeepManager: string - - before(async () => { - personas = (await getUsers()).personas - - const convFactory = await ethers.getContractFactory( - 'AutomationCompatibleUtils', - ) - automationUtils = await convFactory.deploy() - - linkTokenFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - ) - // need full path because there are two contracts with name MockV3Aggregator - mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', - )) as unknown as MockV3AggregatorFactory - mockArbGasInfoFactory = await ethers.getContractFactory('MockArbGasInfo') - mockOVMGasPriceOracleFactory = await ethers.getContractFactory( - 'MockOVMGasPriceOracle', - ) - upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') - upkeepAutoFunderFactory = - await ethers.getContractFactory('UpkeepAutoFunder') - chainModuleBaseFactory = await ethers.getContractFactory('ChainModuleBase') - arbitrumModuleFactory = await ethers.getContractFactory('ArbitrumModule') - optimismModuleV2Factory = - await ethers.getContractFactory('OptimismModuleV2') - streamsLookupUpkeepFactory = await ethers.getContractFactory( - 'StreamsLookupUpkeep', - ) - - owner = personas.Default - keeper1 = personas.Carol - keeper2 = personas.Eddy - keeper3 = personas.Nancy - keeper4 = personas.Norbert - keeper5 = personas.Nick - nonkeeper = personas.Ned - admin = personas.Neil - payee1 = personas.Nelly - payee2 = personas.Norbert - payee3 = personas.Nick - payee4 = personas.Eddy - payee5 = personas.Carol - upkeepManager = await personas.Norbert.getAddress() - // signers - signer1 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000001', - ) - signer2 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000002', - ) - signer3 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000003', - ) - signer4 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000004', - ) - signer5 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000005', - ) - - keeperAddresses = [ - await keeper1.getAddress(), - await keeper2.getAddress(), - await keeper3.getAddress(), - await keeper4.getAddress(), - await keeper5.getAddress(), - ] - payees = [ - await payee1.getAddress(), - await payee2.getAddress(), - await payee3.getAddress(), - await payee4.getAddress(), - await payee5.getAddress(), - ] - signers = [signer1, signer2, signer3, signer4, signer5] - - // We append 26 random addresses to keepers, payees and signers to get a system of 31 oracles - // This allows f value of 1 - 10 - for (let i = 0; i < 26; i++) { - keeperAddresses.push(randomAddress()) - payees.push(randomAddress()) - signers.push(ethers.Wallet.createRandom()) - } - signerAddresses = [] - for (const signer of signers) { - signerAddresses.push(await signer.getAddress()) - } - - logTriggerConfig = - '0x' + - automationUtils.interface - .encodeFunctionData('_logTriggerConfig', [ - { - contractAddress: randomAddress(), - filterSelector: 0, - topic0: ethers.utils.randomBytes(32), - topic1: ethers.utils.randomBytes(32), - topic2: ethers.utils.randomBytes(32), - topic3: ethers.utils.randomBytes(32), - }, - ]) - .slice(10) - }) - - // This function is similar to registry's _calculatePaymentAmount - // It uses global fastGasWei, linkEth, and assumes isExecution = false (gasFee = fastGasWei*multiplier) - // rest of the parameters are the same - const linkForGas = ( - upkeepGasSpent: BigNumber, - gasOverhead: BigNumber, - gasMultiplier: BigNumber, - premiumPPB: BigNumber, - flatFee: BigNumber, - l1CostWei?: BigNumber, - ) => { - l1CostWei = l1CostWei === undefined ? BigNumber.from(0) : l1CostWei - - const gasSpent = gasOverhead.add(BigNumber.from(upkeepGasSpent)) - const base = gasWei - .mul(gasMultiplier) - .mul(gasSpent) - .mul(linkDivisibility) - .div(linkEth) - const l1Fee = l1CostWei.mul(linkDivisibility).div(linkEth) - const gasPayment = base.add(l1Fee) - - const premium = gasWei - .mul(gasMultiplier) - .mul(upkeepGasSpent) - .add(l1CostWei) - .mul(linkDivisibility) - .div(linkEth) - .mul(premiumPPB) - .div(paymentPremiumBase) - .add(BigNumber.from(flatFee).mul('1000000000000')) - - return { - total: gasPayment.add(premium), - gasPayment, - premium, - } - } - - const verifyMaxPayment = async ( - registry: IAutomationRegistry, - chainModule: IChainModule, - maxl1CostWeWithoutMultiplier?: BigNumber, - ) => { - type TestCase = { - name: string - multiplier: number - gas: number - premium: number - flatFee: number - } - - const tests: TestCase[] = [ - { - name: 'no fees', - multiplier: 1, - gas: 100000, - premium: 0, - flatFee: 0, - }, - { - name: 'basic fees', - multiplier: 1, - gas: 100000, - premium: 250000000, - flatFee: 1000000, - }, - { - name: 'max fees', - multiplier: 3, - gas: 10000000, - premium: 250000000, - flatFee: 1000000, - }, - ] - - const fPlusOne = BigNumber.from(f + 1) - const chainModuleOverheads = await chainModule.getGasOverhead() - const totalConditionalOverhead = registryConditionalOverhead - .add(registryPerSignerGasOverhead.mul(fPlusOne)) - .add( - registryPerPerformByteGasOverhead - .add(chainModuleOverheads.chainModulePerByteOverhead) - .mul( - maxPerformDataSize - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul(fPlusOne), - ), - ), - ) - .add(chainModuleOverheads.chainModuleFixedOverhead) - - const totalLogOverhead = registryLogOverhead - .add(registryPerSignerGasOverhead.mul(fPlusOne)) - .add( - registryPerPerformByteGasOverhead - .add(chainModuleOverheads.chainModulePerByteOverhead) - .mul( - maxPerformDataSize - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul(fPlusOne), - ), - ), - ) - .add(chainModuleOverheads.chainModuleFixedOverhead) - - for (const test of tests) { - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - paymentPremiumPPB: test.premium, - flatFeeMicroLink: test.flatFee, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier: test.multiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModule.address, - reorgProtectionEnabled: true, - }, - offchainVersion, - offchainBytes, - ) - - const conditionalPrice = await registry.getMaxPaymentForGas( - Trigger.CONDITION, - test.gas, - ) - expect(conditionalPrice).to.equal( - linkForGas( - BigNumber.from(test.gas), - totalConditionalOverhead, - BigNumber.from(test.multiplier), - BigNumber.from(test.premium), - BigNumber.from(test.flatFee), - maxl1CostWeWithoutMultiplier?.mul(BigNumber.from(test.multiplier)), - ).total, - ) - - const logPrice = await registry.getMaxPaymentForGas(Trigger.LOG, test.gas) - expect(logPrice).to.equal( - linkForGas( - BigNumber.from(test.gas), - totalLogOverhead, - BigNumber.from(test.multiplier), - BigNumber.from(test.premium), - BigNumber.from(test.flatFee), - maxl1CostWeWithoutMultiplier?.mul(BigNumber.from(test.multiplier)), - ).total, - ) - } - } - - const verifyConsistentAccounting = async ( - maxAllowedSpareChange: BigNumber, - ) => { - const expectedLinkBalance = (await registry.getState()).state - .expectedLinkBalance - const linkTokenBalance = await linkToken.balanceOf(registry.address) - const upkeepIdBalance = (await registry.getUpkeep(upkeepId)).balance - let totalKeeperBalance = BigNumber.from(0) - for (let i = 0; i < keeperAddresses.length; i++) { - totalKeeperBalance = totalKeeperBalance.add( - (await registry.getTransmitterInfo(keeperAddresses[i])).balance, - ) - } - const ownerBalance = (await registry.getState()).state.ownerLinkBalance - assert.isTrue(expectedLinkBalance.eq(linkTokenBalance)) - assert.isTrue( - upkeepIdBalance - .add(totalKeeperBalance) - .add(ownerBalance) - .lte(expectedLinkBalance), - ) - assert.isTrue( - expectedLinkBalance - .sub(upkeepIdBalance) - .sub(totalKeeperBalance) - .sub(ownerBalance) - .lte(maxAllowedSpareChange), - ) - } - - interface GetTransmitTXOptions { - numSigners?: number - startingSignerIndex?: number - gasLimit?: BigNumberish - gasPrice?: BigNumberish - performGas?: BigNumberish - performDatas?: string[] - checkBlockNum?: number - checkBlockHash?: string - logBlockHash?: BytesLike - txHash?: BytesLike - logIndex?: number - timestamp?: number - } - - const getTransmitTx = async ( - registry: IAutomationRegistry, - transmitter: Signer, - upkeepIds: BigNumber[], - overrides: GetTransmitTXOptions = {}, - ) => { - const latestBlock = await ethers.provider.getBlock('latest') - const configDigest = (await registry.getState()).state.latestConfigDigest - const config = { - numSigners: f + 1, - startingSignerIndex: 0, - performDatas: undefined, - performGas, - checkBlockNum: latestBlock.number, - checkBlockHash: latestBlock.hash, - logIndex: 0, - txHash: undefined, // assigned uniquely below - logBlockHash: undefined, // assigned uniquely below - timestamp: now(), - gasLimit: undefined, - gasPrice: undefined, - } - Object.assign(config, overrides) - const upkeeps: UpkeepData[] = [] - for (let i = 0; i < upkeepIds.length; i++) { - let trigger: string - switch (getTriggerType(upkeepIds[i])) { - case Trigger.CONDITION: - trigger = encodeBlockTrigger({ - blockNum: config.checkBlockNum, - blockHash: config.checkBlockHash, - }) - break - case Trigger.LOG: - trigger = encodeLogTrigger({ - logBlockHash: config.logBlockHash || ethers.utils.randomBytes(32), - txHash: config.txHash || ethers.utils.randomBytes(32), - logIndex: config.logIndex, - blockNum: config.checkBlockNum, - blockHash: config.checkBlockHash, - }) - break - } - upkeeps.push({ - Id: upkeepIds[i], - performGas: config.performGas, - trigger, - performData: config.performDatas ? config.performDatas[i] : '0x', - }) - } - - const report = makeReport(upkeeps) - const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] - const sigs = signReport( - reportContext, - report, - signers.slice( - config.startingSignerIndex, - config.startingSignerIndex + config.numSigners, - ), - ) - - type txOverride = { - gasLimit?: BigNumberish | Promise - gasPrice?: BigNumberish | Promise - } - const txOverrides: txOverride = {} - if (config.gasLimit) { - txOverrides.gasLimit = config.gasLimit - } - if (config.gasPrice) { - txOverrides.gasPrice = config.gasPrice - } - - return registry - .connect(transmitter) - .transmit( - [configDigest, epochAndRound5_1, emptyBytes32], - report, - sigs.rs, - sigs.ss, - sigs.vs, - txOverrides, - ) - } - - const getTransmitTxWithReport = async ( - registry: IAutomationRegistry, - transmitter: Signer, - report: BytesLike, - ) => { - const configDigest = (await registry.getState()).state.latestConfigDigest - const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] - const sigs = signReport(reportContext, report, signers.slice(0, f + 1)) - - return registry - .connect(transmitter) - .transmit( - [configDigest, epochAndRound5_1, emptyBytes32], - report, - sigs.rs, - sigs.ss, - sigs.vs, - ) - } - - const setup = async () => { - linkToken = await linkTokenFactory.connect(owner).deploy() - gasPriceFeed = await mockV3AggregatorFactory - .connect(owner) - .deploy(0, gasWei) - linkEthFeed = await mockV3AggregatorFactory - .connect(owner) - .deploy(9, linkEth) - const upkeepTranscoderFactory = await ethers.getContractFactory( - 'UpkeepTranscoder4_0', - ) - transcoder = await upkeepTranscoderFactory.connect(owner).deploy() - mockArbGasInfo = await mockArbGasInfoFactory.connect(owner).deploy() - mockOVMGasPriceOracle = await mockOVMGasPriceOracleFactory - .connect(owner) - .deploy() - chainModuleBase = await chainModuleBaseFactory.connect(owner).deploy() - arbitrumModule = await arbitrumModuleFactory.connect(owner).deploy() - optimismModule = await optimismModuleV2Factory.connect(owner).deploy() - streamsLookupUpkeep = await streamsLookupUpkeepFactory - .connect(owner) - .deploy( - BigNumber.from('10000'), - BigNumber.from('100'), - false /* useArbBlock */, - true /* staging */, - false /* verify mercury response */, - ) - - const arbOracleCode = await ethers.provider.send('eth_getCode', [ - mockArbGasInfo.address, - ]) - await ethers.provider.send('hardhat_setCode', [ - '0x000000000000000000000000000000000000006C', - arbOracleCode, - ]) - - const optOracleCode = await ethers.provider.send('eth_getCode', [ - mockOVMGasPriceOracle.address, - ]) - await ethers.provider.send('hardhat_setCode', [ - '0x420000000000000000000000000000000000000F', - optOracleCode, - ]) - - const mockArbSys = await new MockArbSysFactory(owner).deploy() - const arbSysCode = await ethers.provider.send('eth_getCode', [ - mockArbSys.address, - ]) - await ethers.provider.send('hardhat_setCode', [ - '0x0000000000000000000000000000000000000064', - arbSysCode, - ]) - - config = { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - } - - arbConfig = { ...config } - arbConfig.chainModule = arbitrumModule.address - opConfig = { ...config } - opConfig.chainModule = optimismModule.address - - baseConfig = [ - signerAddresses, - keeperAddresses, - f, - config, - offchainVersion, - offchainBytes, - ] - arbConfigParams = [ - signerAddresses, - keeperAddresses, - f, - arbConfig, - offchainVersion, - offchainBytes, - ] - opConfigParams = [ - signerAddresses, - keeperAddresses, - f, - opConfig, - offchainVersion, - offchainBytes, - ] - - registry = await deployRegistry22( - owner, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - zeroAddress, - ) - - arbRegistry = await deployRegistry22( - owner, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - zeroAddress, - ) - - opRegistry = await deployRegistry22( - owner, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - zeroAddress, - ) - - mgRegistry = await deployRegistry22( - owner, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - zeroAddress, - ) - - blankRegistry = await deployRegistry22( - owner, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - zeroAddress, - ) - - registryConditionalOverhead = await registry.getConditionalGasOverhead() - registryLogOverhead = await registry.getLogGasOverhead() - registryPerSignerGasOverhead = await registry.getPerSignerGasOverhead() - registryPerPerformByteGasOverhead = - await registry.getPerPerformByteGasOverhead() - registryTransmitCalldataFixedBytesOverhead = - await registry.getTransmitCalldataFixedBytesOverhead() - registryTransmitCalldataPerSignerBytesOverhead = - await registry.getTransmitCalldataPerSignerBytesOverhead() - cancellationDelay = (await registry.getCancellationDelay()).toNumber() - - await registry.connect(owner).setConfigTypeSafe(...baseConfig) - await mgRegistry.connect(owner).setConfigTypeSafe(...baseConfig) - await arbRegistry.connect(owner).setConfigTypeSafe(...arbConfigParams) - await opRegistry.connect(owner).setConfigTypeSafe(...opConfigParams) - for (const reg of [registry, arbRegistry, opRegistry, mgRegistry]) { - await reg.connect(owner).setPayees(payees) - await linkToken.connect(admin).approve(reg.address, toWei('1000')) - await linkToken.connect(owner).approve(reg.address, toWei('1000')) - } - - mock = await upkeepMockFactory.deploy() - await linkToken - .connect(owner) - .transfer(await admin.getAddress(), toWei('1000')) - let tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - upkeepId = await getUpkeepID(tx) - - autoFunderUpkeep = await upkeepAutoFunderFactory - .connect(owner) - .deploy(linkToken.address, registry.address) - tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](autoFunderUpkeep.address, performGas, autoFunderUpkeep.address, randomBytes, '0x') - afUpkeepId = await getUpkeepID(tx) - - ltUpkeep = await deployMockContract(owner, ILogAutomationactory.abi) - tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,uint8,bytes,bytes,bytes)' - ](ltUpkeep.address, performGas, await admin.getAddress(), Trigger.LOG, '0x', logTriggerConfig, emptyBytes) - logUpkeepId = await getUpkeepID(tx) - - await autoFunderUpkeep.setUpkeepId(afUpkeepId) - // Give enough funds for upkeep as well as to the upkeep contract - await linkToken - .connect(owner) - .transfer(autoFunderUpkeep.address, toWei('1000')) - - tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](streamsLookupUpkeep.address, performGas, await admin.getAddress(), randomBytes, '0x') - streamsLookupUpkeepId = await getUpkeepID(tx) - } - - const getMultipleUpkeepsDeployedAndFunded = async ( - numPassingConditionalUpkeeps: number, - numPassingLogUpkeeps: number, - numFailingUpkeeps: number, - ) => { - const passingConditionalUpkeepIds = [] - const passingLogUpkeepIds = [] - const failingUpkeepIds = [] - for (let i = 0; i < numPassingConditionalUpkeeps; i++) { - const mock = await upkeepMockFactory.deploy() - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(BigNumber.from('0')) - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - const condUpkeepId = await getUpkeepID(tx) - passingConditionalUpkeepIds.push(condUpkeepId) - - // Add funds to passing upkeeps - await registry.connect(admin).addFunds(condUpkeepId, toWei('100')) - } - for (let i = 0; i < numPassingLogUpkeeps; i++) { - const mock = await upkeepMockFactory.deploy() - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(BigNumber.from('0')) - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,uint8,bytes,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), Trigger.LOG, '0x', logTriggerConfig, emptyBytes) - const logUpkeepId = await getUpkeepID(tx) - passingLogUpkeepIds.push(logUpkeepId) - - // Add funds to passing upkeeps - await registry.connect(admin).addFunds(logUpkeepId, toWei('100')) - } - for (let i = 0; i < numFailingUpkeeps; i++) { - const mock = await upkeepMockFactory.deploy() - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(BigNumber.from('0')) - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - const failingUpkeepId = await getUpkeepID(tx) - failingUpkeepIds.push(failingUpkeepId) - } - return { - passingConditionalUpkeepIds, - passingLogUpkeepIds, - failingUpkeepIds, - } - } - - beforeEach(async () => { - await loadFixture(setup) - }) - - describe('#transmit', () => { - const fArray = [1, 5, 10] - - it('reverts when registry is paused', async () => { - await registry.connect(owner).pause() - await evmRevertCustomError( - getTransmitTx(registry, keeper1, [upkeepId]), - registry, - 'RegistryPaused', - ) - }) - - it('reverts when called by non active transmitter', async () => { - await evmRevertCustomError( - getTransmitTx(registry, payee1, [upkeepId]), - registry, - 'OnlyActiveTransmitters', - ) - }) - - it('reverts when report data lengths mismatches', async () => { - const upkeepIds = [] - const gasLimits: BigNumber[] = [] - const triggers: string[] = [] - const performDatas = [] - - upkeepIds.push(upkeepId) - gasLimits.push(performGas) - triggers.push('0x') - performDatas.push('0x') - // Push an extra perform data - performDatas.push('0x') - - const report = encodeReport({ - fastGasWei: 0, - linkNative: 0, - upkeepIds, - gasLimits, - triggers, - performDatas, - }) - - await evmRevertCustomError( - getTransmitTxWithReport(registry, keeper1, report), - registry, - 'InvalidReport', - ) - }) - - it('returns early when invalid upkeepIds are included in report', async () => { - const tx = await getTransmitTx(registry, keeper1, [ - upkeepId.add(BigNumber.from('1')), - ]) - - const receipt = await tx.wait() - const cancelledUpkeepReportLogs = parseCancelledUpkeepReportLogs(receipt) - // exactly 1 CancelledUpkeepReport log should be emitted - assert.equal(cancelledUpkeepReportLogs.length, 1) - }) - - it('performs even when the upkeep has insufficient funds and the upkeep pays out all the remaining balance', async () => { - // add very little fund to this upkeep - await registry.connect(admin).addFunds(upkeepId, BigNumber.from(10)) - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - const receipt = await tx.wait() - // the upkeep is underfunded in transmit but still performed - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal(upkeepPerformedLogs.length, 1) - const balance = (await registry.getUpkeep(upkeepId)).balance - assert.equal(balance.toNumber(), 0) - }) - - context('When the upkeep is funded', async () => { - beforeEach(async () => { - // Fund the upkeep - await Promise.all([ - registry.connect(admin).addFunds(upkeepId, toWei('100')), - registry.connect(admin).addFunds(logUpkeepId, toWei('100')), - ]) - }) - - it('handles duplicate upkeepIDs', async () => { - const tests: [string, BigNumber, number, number][] = [ - // [name, upkeep, num stale, num performed] - ['conditional', upkeepId, 1, 1], // checkBlocks must be sequential - ['log-trigger', logUpkeepId, 0, 2], // logs are deduped based on the "trigger ID" - ] - for (const [type, id, nStale, nPerformed] of tests) { - const tx = await getTransmitTx(registry, keeper1, [id, id]) - const receipt = await tx.wait() - const staleUpkeepReport = parseStaleUpkeepReportLogs(receipt) - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal( - staleUpkeepReport.length, - nStale, - `wrong log count for ${type} upkeep`, - ) - assert.equal( - upkeepPerformedLogs.length, - nPerformed, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('handles duplicate log triggers', async () => { - const logBlockHash = ethers.utils.randomBytes(32) - const txHash = ethers.utils.randomBytes(32) - const logIndex = 0 - const expectedDedupKey = ethers.utils.solidityKeccak256( - ['uint256', 'bytes32', 'bytes32', 'uint32'], - [logUpkeepId, logBlockHash, txHash, logIndex], - ) - assert.isFalse(await registry.hasDedupKey(expectedDedupKey)) - const tx = await getTransmitTx( - registry, - keeper1, - [logUpkeepId, logUpkeepId], - { logBlockHash, txHash, logIndex }, // will result in the same dedup key - ) - const receipt = await tx.wait() - const staleUpkeepReport = parseStaleUpkeepReportLogs(receipt) - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal(staleUpkeepReport.length, 1) - assert.equal(upkeepPerformedLogs.length, 1) - assert.isTrue(await registry.hasDedupKey(expectedDedupKey)) - await expect(tx) - .to.emit(registry, 'DedupKeyAdded') - .withArgs(expectedDedupKey) - }) - - it('returns early when check block number is less than last perform (block)', async () => { - // First perform an upkeep to put last perform block number on upkeep state - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - await tx.wait() - const lastPerformed = (await registry.getUpkeep(upkeepId)) - .lastPerformedBlockNumber - const lastPerformBlock = await ethers.provider.getBlock(lastPerformed) - assert.equal(lastPerformed.toString(), tx.blockNumber?.toString()) - // Try to transmit a report which has checkBlockNumber = lastPerformed-1, should result in stale report - const transmitTx = await getTransmitTx(registry, keeper1, [upkeepId], { - checkBlockNum: lastPerformBlock.number - 1, - checkBlockHash: lastPerformBlock.parentHash, - }) - const receipt = await transmitTx.wait() - const staleUpkeepReportLogs = parseStaleUpkeepReportLogs(receipt) - // exactly 1 StaleUpkeepReportLogs log should be emitted - assert.equal(staleUpkeepReportLogs.length, 1) - }) - - it('handles case when check block hash does not match', async () => { - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - // Try to transmit a report which has incorrect checkBlockHash - const tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number - 1, - checkBlockHash: latestBlock.hash, // should be latestBlock.parentHash - }) - - const receipt = await tx.wait() - const reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) - // exactly 1 ReorgedUpkeepReportLogs log should be emitted - assert.equal( - reorgedUpkeepReportLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('handles case when check block number is older than 256 blocks', async () => { - for (let i = 0; i < 256; i++) { - await ethers.provider.send('evm_mine', []) - } - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - const old = await ethers.provider.getBlock(latestBlock.number - 256) - // Try to transmit a report which has incorrect checkBlockHash - const tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: old.number, - checkBlockHash: old.hash, - }) - - const receipt = await tx.wait() - const reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) - // exactly 1 ReorgedUpkeepReportLogs log should be emitted - assert.equal( - reorgedUpkeepReportLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('allows bypassing reorg protection with empty blockhash', async () => { - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - const tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number, - checkBlockHash: emptyBytes32, - }) - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal( - upkeepPerformedLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('allows bypassing reorg protection with reorgProtectionEnabled false config', async () => { - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - const newConfig = config - newConfig.reorgProtectionEnabled = false - await registry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ) - - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - // Try to transmit a report which has incorrect checkBlockHash - const tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number - 1, - checkBlockHash: latestBlock.hash, // should be latestBlock.parentHash - }) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal( - upkeepPerformedLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('allows very old trigger block numbers when bypassing reorg protection with reorgProtectionEnabled config', async () => { - const newConfig = config - newConfig.reorgProtectionEnabled = false - await registry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ) - for (let i = 0; i < 256; i++) { - await ethers.provider.send('evm_mine', []) - } - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - const old = await ethers.provider.getBlock(latestBlock.number - 256) - // Try to transmit a report which has incorrect checkBlockHash - const tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: old.number, - checkBlockHash: old.hash, - }) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal( - upkeepPerformedLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('allows very old trigger block numbers when bypassing reorg protection with empty blockhash', async () => { - // mine enough blocks so that blockhash(1) is unavailable - for (let i = 0; i <= 256; i++) { - await ethers.provider.send('evm_mine', []) - } - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: 1, - checkBlockHash: emptyBytes32, - }) - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal( - upkeepPerformedLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('returns early when future block number is provided as trigger, irrespective of blockhash being present', async () => { - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - - // Should fail when blockhash is empty - let tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number + 100, - checkBlockHash: emptyBytes32, - }) - let receipt = await tx.wait() - let reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) - // exactly 1 ReorgedUpkeepReportLogs log should be emitted - assert.equal( - reorgedUpkeepReportLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - - // Should also fail when blockhash is not empty - tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number + 100, - checkBlockHash: latestBlock.hash, - }) - receipt = await tx.wait() - reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) - // exactly 1 ReorgedUpkeepReportLogs log should be emitted - assert.equal( - reorgedUpkeepReportLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('returns early when future block number is provided as trigger, irrespective of reorgProtectionEnabled config', async () => { - const newConfig = config - newConfig.reorgProtectionEnabled = false - await registry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ) - const tests: [string, BigNumber][] = [ - ['conditional', upkeepId], - ['log-trigger', logUpkeepId], - ] - for (const [type, id] of tests) { - const latestBlock = await ethers.provider.getBlock('latest') - - // Should fail when blockhash is empty - let tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number + 100, - checkBlockHash: emptyBytes32, - }) - let receipt = await tx.wait() - let reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) - // exactly 1 ReorgedUpkeepReportLogs log should be emitted - assert.equal( - reorgedUpkeepReportLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - - // Should also fail when blockhash is not empty - tx = await getTransmitTx(registry, keeper1, [id], { - checkBlockNum: latestBlock.number + 100, - checkBlockHash: latestBlock.hash, - }) - receipt = await tx.wait() - reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) - // exactly 1 ReorgedUpkeepReportLogs log should be emitted - assert.equal( - reorgedUpkeepReportLogs.length, - 1, - `wrong log count for ${type} upkeep`, - ) - } - }) - - it('returns early when upkeep is cancelled and cancellation delay has gone', async () => { - const latestBlockReport = await makeLatestBlockReport([upkeepId]) - await registry.connect(admin).cancelUpkeep(upkeepId) - - for (let i = 0; i < cancellationDelay; i++) { - await ethers.provider.send('evm_mine', []) - } - - const tx = await getTransmitTxWithReport( - registry, - keeper1, - latestBlockReport, - ) - - const receipt = await tx.wait() - const cancelledUpkeepReportLogs = - parseCancelledUpkeepReportLogs(receipt) - // exactly 1 CancelledUpkeepReport log should be emitted - assert.equal(cancelledUpkeepReportLogs.length, 1) - }) - - it('does not revert if the target cannot execute', async () => { - await mock.setCanPerform(false) - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const success = upkeepPerformedLog.args.success - assert.equal(success, false) - }) - - it('does not revert if the target runs out of gas', async () => { - await mock.setCanPerform(false) - - const tx = await getTransmitTx(registry, keeper1, [upkeepId], { - performGas: 10, // too little gas - }) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const success = upkeepPerformedLog.args.success - assert.equal(success, false) - }) - - it('reverts if not enough gas supplied', async () => { - await evmRevert( - getTransmitTx(registry, keeper1, [upkeepId], { - gasLimit: performGas, - }), - ) - }) - - it('executes the data passed to the registry', async () => { - await mock.setCanPerform(true) - - const tx = await getTransmitTx(registry, keeper1, [upkeepId], { - performDatas: [randomBytes], - }) - const receipt = await tx.wait() - - const upkeepPerformedWithABI = [ - 'event UpkeepPerformedWith(bytes upkeepData)', - ] - const iface = new ethers.utils.Interface(upkeepPerformedWithABI) - const parsedLogs = [] - for (let i = 0; i < receipt.logs.length; i++) { - const log = receipt.logs[i] - try { - parsedLogs.push(iface.parseLog(log)) - } catch (e) { - // ignore log - } - } - assert.equal(parsedLogs.length, 1) - assert.equal(parsedLogs[0].args.upkeepData, randomBytes) - }) - - it('uses actual execution price for payment and premium calculation', async () => { - // Actual multiplier is 2, but we set gasPrice to be 1x gasWei - const gasPrice = gasWei.mul(BigNumber.from('1')) - await mock.setCanPerform(true) - const registryPremiumBefore = (await registry.getState()).state - .totalPremium - const tx = await getTransmitTx(registry, keeper1, [upkeepId], { - gasPrice, - }) - const receipt = await tx.wait() - const registryPremiumAfter = (await registry.getState()).state - .totalPremium - const premium = registryPremiumAfter.sub(registryPremiumBefore) - - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const gasUsed = upkeepPerformedLog.args.gasUsed - const gasOverhead = upkeepPerformedLog.args.gasOverhead - const totalPayment = upkeepPerformedLog.args.totalPayment - - assert.equal( - linkForGas( - gasUsed, - gasOverhead, - BigNumber.from('1'), // Not the config multiplier, but the actual gas used - paymentPremiumPPB, - flatFeeMicroLink, - ).total.toString(), - totalPayment.toString(), - ) - - assert.equal( - linkForGas( - gasUsed, - gasOverhead, - BigNumber.from('1'), // Not the config multiplier, but the actual gas used - paymentPremiumPPB, - flatFeeMicroLink, - ).premium.toString(), - premium.toString(), - ) - }) - - it('only pays at a rate up to the gas ceiling [ @skip-coverage ]', async () => { - // Actual multiplier is 2, but we set gasPrice to be 10x - const gasPrice = gasWei.mul(BigNumber.from('10')) - await mock.setCanPerform(true) - - const tx = await getTransmitTx(registry, keeper1, [upkeepId], { - gasPrice, - }) - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const gasUsed = upkeepPerformedLog.args.gasUsed - const gasOverhead = upkeepPerformedLog.args.gasOverhead - const totalPayment = upkeepPerformedLog.args.totalPayment - - assert.equal( - linkForGas( - gasUsed, - gasOverhead, - gasCeilingMultiplier, // Should be same with exisitng multiplier - paymentPremiumPPB, - flatFeeMicroLink, - ).total.toString(), - totalPayment.toString(), - ) - }) - - it('correctly accounts for l payment', async () => { - await mock.setCanPerform(true) - // Same as MockArbGasInfo.sol - const l1CostWeiArb = BigNumber.from(1000000) - - let tx = await arbRegistry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - const testUpkeepId = await getUpkeepID(tx) - await arbRegistry.connect(owner).addFunds(testUpkeepId, toWei('100')) - - // Do the thing - tx = await getTransmitTx( - arbRegistry, - keeper1, - [testUpkeepId], - - { gasPrice: gasWei.mul('5') }, // High gas price so that it gets capped - ) - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const gasUsed = upkeepPerformedLog.args.gasUsed - const gasOverhead = upkeepPerformedLog.args.gasOverhead - const totalPayment = upkeepPerformedLog.args.totalPayment - - assert.equal( - linkForGas( - gasUsed, - gasOverhead, - gasCeilingMultiplier, - paymentPremiumPPB, - flatFeeMicroLink, - l1CostWeiArb, - ).total.toString(), - totalPayment.toString(), - ) - }) - - itMaybe('can self fund', async () => { - const maxPayment = await registry.getMaxPaymentForGas( - Trigger.CONDITION, - performGas, - ) - - // First set auto funding amount to 0 and verify that balance is deducted upon performUpkeep - let initialBalance = toWei('100') - await registry.connect(owner).addFunds(afUpkeepId, initialBalance) - await autoFunderUpkeep.setAutoFundLink(0) - await autoFunderUpkeep.setIsEligible(true) - await getTransmitTx(registry, keeper1, [afUpkeepId]) - - let postUpkeepBalance = (await registry.getUpkeep(afUpkeepId)).balance - assert.isTrue(postUpkeepBalance.lt(initialBalance)) // Balance should be deducted - assert.isTrue(postUpkeepBalance.gte(initialBalance.sub(maxPayment))) // Balance should not be deducted more than maxPayment - - // Now set auto funding amount to 100 wei and verify that the balance increases - initialBalance = postUpkeepBalance - const autoTopupAmount = toWei('100') - await autoFunderUpkeep.setAutoFundLink(autoTopupAmount) - await autoFunderUpkeep.setIsEligible(true) - await getTransmitTx(registry, keeper1, [afUpkeepId]) - - postUpkeepBalance = (await registry.getUpkeep(afUpkeepId)).balance - // Balance should increase by autoTopupAmount and decrease by max maxPayment - assert.isTrue( - postUpkeepBalance.gte( - initialBalance.add(autoTopupAmount).sub(maxPayment), - ), - ) - }) - - it('can self cancel', async () => { - await registry.connect(owner).addFunds(afUpkeepId, toWei('100')) - - await autoFunderUpkeep.setIsEligible(true) - await autoFunderUpkeep.setShouldCancel(true) - - let registration = await registry.getUpkeep(afUpkeepId) - const oldExpiration = registration.maxValidBlocknumber - - // Do the thing - await getTransmitTx(registry, keeper1, [afUpkeepId]) - - // Verify upkeep gets cancelled - registration = await registry.getUpkeep(afUpkeepId) - const newExpiration = registration.maxValidBlocknumber - assert.isTrue(newExpiration.lt(oldExpiration)) - }) - - it('reverts when configDigest mismatches', async () => { - const report = await makeLatestBlockReport([upkeepId]) - const reportContext = [emptyBytes32, epochAndRound5_1, emptyBytes32] // wrong config digest - const sigs = signReport(reportContext, report, signers.slice(0, f + 1)) - await evmRevertCustomError( - registry - .connect(keeper1) - .transmit( - [reportContext[0], reportContext[1], reportContext[2]], - report, - sigs.rs, - sigs.ss, - sigs.vs, - ), - registry, - 'ConfigDigestMismatch', - ) - }) - - it('reverts with incorrect number of signatures', async () => { - const configDigest = (await registry.getState()).state - .latestConfigDigest - const report = await makeLatestBlockReport([upkeepId]) - const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] // wrong config digest - const sigs = signReport(reportContext, report, signers.slice(0, f + 2)) - await evmRevertCustomError( - registry - .connect(keeper1) - .transmit( - [reportContext[0], reportContext[1], reportContext[2]], - report, - sigs.rs, - sigs.ss, - sigs.vs, - ), - registry, - 'IncorrectNumberOfSignatures', - ) - }) - - it('reverts with invalid signature for inactive signers', async () => { - const configDigest = (await registry.getState()).state - .latestConfigDigest - const report = await makeLatestBlockReport([upkeepId]) - const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] // wrong config digest - const sigs = signReport(reportContext, report, [ - new ethers.Wallet(ethers.Wallet.createRandom()), - new ethers.Wallet(ethers.Wallet.createRandom()), - ]) - await evmRevertCustomError( - registry - .connect(keeper1) - .transmit( - [reportContext[0], reportContext[1], reportContext[2]], - report, - sigs.rs, - sigs.ss, - sigs.vs, - ), - registry, - 'OnlyActiveSigners', - ) - }) - - it('reverts with invalid signature for duplicated signers', async () => { - const configDigest = (await registry.getState()).state - .latestConfigDigest - const report = await makeLatestBlockReport([upkeepId]) - const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] // wrong config digest - const sigs = signReport(reportContext, report, [signer1, signer1]) - await evmRevertCustomError( - registry - .connect(keeper1) - .transmit( - [reportContext[0], reportContext[1], reportContext[2]], - report, - sigs.rs, - sigs.ss, - sigs.vs, - ), - registry, - 'DuplicateSigners', - ) - }) - - itMaybe( - 'has a large enough gas overhead to cover upkeep that use all its gas [ @skip-coverage ]', - async () => { - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - 10, // maximise f to maximise overhead - config, - offchainVersion, - offchainBytes, - ) - const tx = await registry - .connect(owner) - ['registerUpkeep(address,uint32,address,bytes,bytes)']( - mock.address, - maxPerformGas, // max allowed gas - await admin.getAddress(), - randomBytes, - '0x', - ) - const testUpkeepId = await getUpkeepID(tx) - await registry.connect(admin).addFunds(testUpkeepId, toWei('100')) - - let performData = '0x' - for (let i = 0; i < maxPerformDataSize.toNumber(); i++) { - performData += '11' - } // max allowed performData - - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(maxPerformGas) - - await getTransmitTx(registry, keeper1, [testUpkeepId], { - gasLimit: maxPerformGas.add(transmitGasOverhead), - numSigners: 11, - performDatas: [performData], - }) // Should not revert - }, - ) - - itMaybe( - 'performs upkeep, deducts payment, updates lastPerformed and emits events', - async () => { - await mock.setCanPerform(true) - - for (const i in fArray) { - const newF = fArray[i] - await registry - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - newF, - config, - offchainVersion, - offchainBytes, - ) - const checkBlock = await ethers.provider.getBlock('latest') - - const keeperBefore = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const registrationBefore = await registry.getUpkeep(upkeepId) - const registryPremiumBefore = (await registry.getState()).state - .totalPremium - const keeperLinkBefore = await linkToken.balanceOf( - await keeper1.getAddress(), - ) - const registryLinkBefore = await linkToken.balanceOf( - registry.address, - ) - - // Do the thing - const tx = await getTransmitTx(registry, keeper1, [upkeepId], { - checkBlockNum: checkBlock.number, - checkBlockHash: checkBlock.hash, - numSigners: newF + 1, - }) - - const receipt = await tx.wait() - - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const id = upkeepPerformedLog.args.id - const success = upkeepPerformedLog.args.success - const trigger = upkeepPerformedLog.args.trigger - const gasUsed = upkeepPerformedLog.args.gasUsed - const gasOverhead = upkeepPerformedLog.args.gasOverhead - const totalPayment = upkeepPerformedLog.args.totalPayment - assert.equal(id.toString(), upkeepId.toString()) - assert.equal(success, true) - assert.equal( - trigger, - encodeBlockTrigger({ - blockNum: checkBlock.number, - blockHash: checkBlock.hash, - }), - ) - assert.isTrue(gasUsed.gt(BigNumber.from('0'))) - assert.isTrue(gasOverhead.gt(BigNumber.from('0'))) - assert.isTrue(totalPayment.gt(BigNumber.from('0'))) - - const keeperAfter = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const registrationAfter = await registry.getUpkeep(upkeepId) - const keeperLinkAfter = await linkToken.balanceOf( - await keeper1.getAddress(), - ) - const registryLinkAfter = await linkToken.balanceOf( - registry.address, - ) - const registryPremiumAfter = (await registry.getState()).state - .totalPremium - const premium = registryPremiumAfter.sub(registryPremiumBefore) - // Keeper payment is gasPayment + premium / num keepers - const keeperPayment = totalPayment - .sub(premium) - .add(premium.div(BigNumber.from(keeperAddresses.length))) - - assert.equal( - keeperAfter.balance.sub(keeperPayment).toString(), - keeperBefore.balance.toString(), - ) - assert.equal( - registrationBefore.balance.sub(totalPayment).toString(), - registrationAfter.balance.toString(), - ) - assert.isTrue(keeperLinkAfter.eq(keeperLinkBefore)) - assert.isTrue(registryLinkBefore.eq(registryLinkAfter)) - - // Amount spent should be updated correctly - assert.equal( - registrationAfter.amountSpent.sub(totalPayment).toString(), - registrationBefore.amountSpent.toString(), - ) - assert.isTrue( - registrationAfter.amountSpent - .sub(registrationBefore.amountSpent) - .eq(registrationBefore.balance.sub(registrationAfter.balance)), - ) - // Last perform block number should be updated - assert.equal( - registrationAfter.lastPerformedBlockNumber.toString(), - tx.blockNumber?.toString(), - ) - - // Latest epoch should be 5 - assert.equal((await registry.getState()).state.latestEpoch, 5) - } - }, - ) - - // skipping it for now as it is passing in local but failing in CI - describe.skip('Gas benchmarking conditional upkeeps [ @skip-coverage ]', function () { - const fs = [1, 10] - fs.forEach(function (newF) { - it( - 'When f=' + - newF + - ' calculates gas overhead appropriately within a margin for different scenarios', - async () => { - // Perform the upkeep once to remove non-zero storage slots and have predictable gas measurement - let tx = await getTransmitTx(registry, keeper1, [upkeepId]) - await tx.wait() - - // Different test scenarios - let longBytes = '0x' - for (let i = 0; i < maxPerformDataSize.toNumber(); i++) { - longBytes += '11' - } - const upkeepSuccessArray = [true, false] - const performGasArray = [5000, performGas] - const performDataArray = ['0x', longBytes] - const chainModuleOverheads = - await chainModuleBase.getGasOverhead() - - for (const i in upkeepSuccessArray) { - for (const j in performGasArray) { - for (const k in performDataArray) { - const upkeepSuccess = upkeepSuccessArray[i] - const performGas = performGasArray[j] - const performData = performDataArray[k] - - await mock.setCanPerform(upkeepSuccess) - await mock.setPerformGasToBurn(performGas) - await registry - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - newF, - config, - offchainVersion, - offchainBytes, - ) - tx = await getTransmitTx(registry, keeper1, [upkeepId], { - numSigners: newF + 1, - performDatas: [performData], - }) - const receipt = await tx.wait() - const upkeepPerformedLogs = - parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - - const upkeepGasUsed = upkeepPerformedLog.args.gasUsed - const chargedGasOverhead = - upkeepPerformedLog.args.gasOverhead - const actualGasOverhead = receipt.gasUsed.sub(upkeepGasUsed) - const estimatedGasOverhead = registryConditionalOverhead - .add( - registryPerSignerGasOverhead.mul( - BigNumber.from(newF + 1), - ), - ) - .add( - registryPerPerformByteGasOverhead - .add(chainModuleOverheads.chainModulePerByteOverhead) - .mul( - BigNumber.from(performData.length / 2 - 1) - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul( - BigNumber.from(newF + 1), - ), - ), - ), - ) - .add(chainModuleOverheads.chainModuleFixedOverhead) - - assert.isTrue(upkeepGasUsed.gt(BigNumber.from('0'))) - assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) - assert.isTrue(actualGasOverhead.gt(BigNumber.from('0'))) - - console.log( - 'Gas Benchmarking conditional upkeeps:', - 'upkeepSuccess=', - upkeepSuccess, - 'performGas=', - performGas.toString(), - 'performData length=', - performData.length / 2 - 1, - 'sig verification ( f =', - newF, - '): estimated overhead: ', - estimatedGasOverhead.toString(), - ' charged overhead: ', - chargedGasOverhead.toString(), - ' actual overhead: ', - actualGasOverhead.toString(), - ' calculation margin over gasUsed: ', - chargedGasOverhead.sub(actualGasOverhead).toString(), - ' estimation margin over gasUsed: ', - estimatedGasOverhead.sub(actualGasOverhead).toString(), - ) - - // The actual gas overhead should be less than charged gas overhead, but not by a lot - // The charged gas overhead is controlled by ACCOUNTING_FIXED_GAS_OVERHEAD and - // ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD, and their correct values should be set to - // satisfy constraints in multiple places - assert.isTrue( - chargedGasOverhead.gt(actualGasOverhead), - 'Gas overhead calculated is too low, increase account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD) by at least ' + - actualGasOverhead.sub(chargedGasOverhead).toString(), - ) - assert.isTrue( - chargedGasOverhead - .sub(actualGasOverhead) - .lt(gasCalculationMargin), - 'Gas overhead calculated is too high, decrease account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_SIGNER_GAS_OVERHEAD) by at least ' + - chargedGasOverhead - .sub(actualGasOverhead) - .sub(gasCalculationMargin) - .toString(), - ) - - // The estimated overhead during checkUpkeep should be close to the actual overhead in transaction - // It should be greater than the actual overhead but not by a lot - // The estimated overhead is controlled by variables - // REGISTRY_CONDITIONAL_OVERHEAD, REGISTRY_LOG_OVERHEAD, REGISTRY_PER_SIGNER_GAS_OVERHEAD - // REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD - assert.isTrue( - estimatedGasOverhead.gt(actualGasOverhead), - 'Gas overhead estimated in check upkeep is too low, increase estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + - estimatedGasOverhead.sub(chargedGasOverhead).toString(), - ) - assert.isTrue( - estimatedGasOverhead - .sub(actualGasOverhead) - .lt(gasEstimationMargin), - 'Gas overhead estimated is too high, decrease estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + - estimatedGasOverhead - .sub(actualGasOverhead) - .sub(gasEstimationMargin) - .toString(), - ) - } - } - } - }, - ) - }) - }) - - describe('Gas benchmarking log upkeeps [ @skip-coverage ]', function () { - const fs = [1, 10] - fs.forEach(function (newF) { - it( - 'When f=' + - newF + - ' calculates gas overhead appropriately within a margin', - async () => { - // Perform the upkeep once to remove non-zero storage slots and have predictable gas measurement - let tx = await getTransmitTx(registry, keeper1, [logUpkeepId]) - await tx.wait() - const performData = '0x' - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(performGas) - await registry.setConfigTypeSafe( - signerAddresses, - keeperAddresses, - newF, - config, - offchainVersion, - offchainBytes, - ) - tx = await getTransmitTx(registry, keeper1, [logUpkeepId], { - numSigners: newF + 1, - performDatas: [performData], - }) - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly 1 Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, 1) - const upkeepPerformedLog = upkeepPerformedLogs[0] - const chainModuleOverheads = - await chainModuleBase.getGasOverhead() - - const upkeepGasUsed = upkeepPerformedLog.args.gasUsed - const chargedGasOverhead = upkeepPerformedLog.args.gasOverhead - const actualGasOverhead = receipt.gasUsed.sub(upkeepGasUsed) - const estimatedGasOverhead = registryLogOverhead - .add(registryPerSignerGasOverhead.mul(BigNumber.from(newF + 1))) - .add( - registryPerPerformByteGasOverhead - .add(chainModuleOverheads.chainModulePerByteOverhead) - .mul( - BigNumber.from(performData.length / 2 - 1) - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul( - BigNumber.from(newF + 1), - ), - ), - ), - ) - .add(chainModuleOverheads.chainModuleFixedOverhead) - - assert.isTrue(upkeepGasUsed.gt(BigNumber.from('0'))) - assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) - assert.isTrue(actualGasOverhead.gt(BigNumber.from('0'))) - - console.log( - 'Gas Benchmarking log upkeeps:', - 'upkeepSuccess=', - true, - 'performGas=', - performGas.toString(), - 'performData length=', - performData.length / 2 - 1, - 'sig verification ( f =', - newF, - '): estimated overhead: ', - estimatedGasOverhead.toString(), - ' charged overhead: ', - chargedGasOverhead.toString(), - ' actual overhead: ', - actualGasOverhead.toString(), - ' calculation margin over gasUsed: ', - chargedGasOverhead.sub(actualGasOverhead).toString(), - ' estimation margin over gasUsed: ', - estimatedGasOverhead.sub(actualGasOverhead).toString(), - ) - - assert.isTrue( - chargedGasOverhead.gt(actualGasOverhead), - 'Gas overhead calculated is too low, increase account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD) by at least ' + - actualGasOverhead.sub(chargedGasOverhead).toString(), - ) - assert.isTrue( - chargedGasOverhead - .sub(actualGasOverhead) - .lt(gasCalculationMargin), - 'Gas overhead calculated is too high, decrease account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_SIGNER_GAS_OVERHEAD) by at least ' + - chargedGasOverhead - .sub(actualGasOverhead) - .sub(gasCalculationMargin) - .toString(), - ) - - assert.isTrue( - estimatedGasOverhead.gt(actualGasOverhead), - 'Gas overhead estimated in check upkeep is too low, increase estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + - estimatedGasOverhead.sub(chargedGasOverhead).toString(), - ) - assert.isTrue( - estimatedGasOverhead - .sub(actualGasOverhead) - .lt(gasEstimationMargin), - 'Gas overhead estimated is too high, decrease estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + - estimatedGasOverhead - .sub(actualGasOverhead) - .sub(gasEstimationMargin) - .toString(), - ) - }, - ) - }) - }) - }) - }) - - describe('#transmit with upkeep batches [ @skip-coverage ]', function () { - const numPassingConditionalUpkeepsArray = [0, 1, 5] - const numPassingLogUpkeepsArray = [0, 1, 5] - const numFailingUpkeepsArray = [0, 3] - - for (let idx = 0; idx < numPassingConditionalUpkeepsArray.length; idx++) { - for (let jdx = 0; jdx < numPassingLogUpkeepsArray.length; jdx++) { - for (let kdx = 0; kdx < numFailingUpkeepsArray.length; kdx++) { - const numPassingConditionalUpkeeps = - numPassingConditionalUpkeepsArray[idx] - const numPassingLogUpkeeps = numPassingLogUpkeepsArray[jdx] - const numFailingUpkeeps = numFailingUpkeepsArray[kdx] - if (numPassingConditionalUpkeeps == 0 && numPassingLogUpkeeps == 0) { - continue - } - it( - '[Conditional:' + - numPassingConditionalUpkeeps + - ',Log:' + - numPassingLogUpkeeps + - ',Failures:' + - numFailingUpkeeps + - '] performs successful upkeeps and does not charge failing upkeeps', - async () => { - const allUpkeeps = await getMultipleUpkeepsDeployedAndFunded( - numPassingConditionalUpkeeps, - numPassingLogUpkeeps, - numFailingUpkeeps, - ) - const passingConditionalUpkeepIds = - allUpkeeps.passingConditionalUpkeepIds - const passingLogUpkeepIds = allUpkeeps.passingLogUpkeepIds - const failingUpkeepIds = allUpkeeps.failingUpkeepIds - - const keeperBefore = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const keeperLinkBefore = await linkToken.balanceOf( - await keeper1.getAddress(), - ) - const registryLinkBefore = await linkToken.balanceOf( - registry.address, - ) - const registryPremiumBefore = (await registry.getState()).state - .totalPremium - const registrationConditionalPassingBefore = await Promise.all( - passingConditionalUpkeepIds.map(async (id) => { - const reg = await registry.getUpkeep(BigNumber.from(id)) - assert.equal(reg.lastPerformedBlockNumber.toString(), '0') - return reg - }), - ) - const registrationLogPassingBefore = await Promise.all( - passingLogUpkeepIds.map(async (id) => { - const reg = await registry.getUpkeep(BigNumber.from(id)) - assert.equal(reg.lastPerformedBlockNumber.toString(), '0') - return reg - }), - ) - const registrationFailingBefore = await Promise.all( - failingUpkeepIds.map(async (id) => { - const reg = await registry.getUpkeep(BigNumber.from(id)) - assert.equal(reg.lastPerformedBlockNumber.toString(), '0') - return reg - }), - ) - - // cancel upkeeps so they will fail in the transmit process - // must call the cancel upkeep as the owner to avoid the CANCELLATION_DELAY - for (let ldx = 0; ldx < failingUpkeepIds.length; ldx++) { - await registry - .connect(owner) - .cancelUpkeep(failingUpkeepIds[ldx]) - } - - const tx = await getTransmitTx( - registry, - keeper1, - passingConditionalUpkeepIds.concat( - passingLogUpkeepIds.concat(failingUpkeepIds), - ), - ) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly numPassingUpkeeps Upkeep Performed should be emitted - assert.equal( - upkeepPerformedLogs.length, - numPassingConditionalUpkeeps + numPassingLogUpkeeps, - ) - const cancelledUpkeepReportLogs = - parseCancelledUpkeepReportLogs(receipt) - // exactly numFailingUpkeeps Upkeep Performed should be emitted - assert.equal(cancelledUpkeepReportLogs.length, numFailingUpkeeps) - - const keeperAfter = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const keeperLinkAfter = await linkToken.balanceOf( - await keeper1.getAddress(), - ) - const registryLinkAfter = await linkToken.balanceOf( - registry.address, - ) - const registrationConditionalPassingAfter = await Promise.all( - passingConditionalUpkeepIds.map(async (id) => { - return await registry.getUpkeep(BigNumber.from(id)) - }), - ) - const registrationLogPassingAfter = await Promise.all( - passingLogUpkeepIds.map(async (id) => { - return await registry.getUpkeep(BigNumber.from(id)) - }), - ) - const registrationFailingAfter = await Promise.all( - failingUpkeepIds.map(async (id) => { - return await registry.getUpkeep(BigNumber.from(id)) - }), - ) - const registryPremiumAfter = (await registry.getState()).state - .totalPremium - const premium = registryPremiumAfter.sub(registryPremiumBefore) - - let netPayment = BigNumber.from('0') - for (let i = 0; i < numPassingConditionalUpkeeps; i++) { - const id = upkeepPerformedLogs[i].args.id - const gasUsed = upkeepPerformedLogs[i].args.gasUsed - const gasOverhead = upkeepPerformedLogs[i].args.gasOverhead - const totalPayment = upkeepPerformedLogs[i].args.totalPayment - - expect(id).to.equal(passingConditionalUpkeepIds[i]) - assert.isTrue(gasUsed.gt(BigNumber.from('0'))) - assert.isTrue(gasOverhead.gt(BigNumber.from('0'))) - assert.isTrue(totalPayment.gt(BigNumber.from('0'))) - - // Balance should be deducted - assert.equal( - registrationConditionalPassingBefore[i].balance - .sub(totalPayment) - .toString(), - registrationConditionalPassingAfter[i].balance.toString(), - ) - - // Amount spent should be updated correctly - assert.equal( - registrationConditionalPassingAfter[i].amountSpent - .sub(totalPayment) - .toString(), - registrationConditionalPassingBefore[ - i - ].amountSpent.toString(), - ) - - // Last perform block number should be updated - assert.equal( - registrationConditionalPassingAfter[ - i - ].lastPerformedBlockNumber.toString(), - tx.blockNumber?.toString(), - ) - - netPayment = netPayment.add(totalPayment) - } - - for (let i = 0; i < numPassingLogUpkeeps; i++) { - const id = - upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args.id - const gasUsed = - upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args - .gasUsed - const gasOverhead = - upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args - .gasOverhead - const totalPayment = - upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args - .totalPayment - - expect(id).to.equal(passingLogUpkeepIds[i]) - assert.isTrue(gasUsed.gt(BigNumber.from('0'))) - assert.isTrue(gasOverhead.gt(BigNumber.from('0'))) - assert.isTrue(totalPayment.gt(BigNumber.from('0'))) - - // Balance should be deducted - assert.equal( - registrationLogPassingBefore[i].balance - .sub(totalPayment) - .toString(), - registrationLogPassingAfter[i].balance.toString(), - ) - - // Amount spent should be updated correctly - assert.equal( - registrationLogPassingAfter[i].amountSpent - .sub(totalPayment) - .toString(), - registrationLogPassingBefore[i].amountSpent.toString(), - ) - - // Last perform block number should not be updated for log triggers - assert.equal( - registrationLogPassingAfter[ - i - ].lastPerformedBlockNumber.toString(), - '0', - ) - - netPayment = netPayment.add(totalPayment) - } - - for (let i = 0; i < numFailingUpkeeps; i++) { - // CancelledUpkeep log should be emitted - const id = cancelledUpkeepReportLogs[i].args.id - expect(id).to.equal(failingUpkeepIds[i]) - - // Balance and amount spent should be same - assert.equal( - registrationFailingBefore[i].balance.toString(), - registrationFailingAfter[i].balance.toString(), - ) - assert.equal( - registrationFailingBefore[i].amountSpent.toString(), - registrationFailingAfter[i].amountSpent.toString(), - ) - - // Last perform block number should not be updated - assert.equal( - registrationFailingAfter[ - i - ].lastPerformedBlockNumber.toString(), - '0', - ) - } - - // Keeper payment is gasPayment + premium / num keepers - const keeperPayment = netPayment - .sub(premium) - .add(premium.div(BigNumber.from(keeperAddresses.length))) - - // Keeper should be paid net payment for all passed upkeeps - assert.equal( - keeperAfter.balance.sub(keeperPayment).toString(), - keeperBefore.balance.toString(), - ) - - assert.isTrue(keeperLinkAfter.eq(keeperLinkBefore)) - assert.isTrue(registryLinkBefore.eq(registryLinkAfter)) - }, - ) - - it( - '[Conditional:' + - numPassingConditionalUpkeeps + - ',Log' + - numPassingLogUpkeeps + - ',Failures:' + - numFailingUpkeeps + - '] splits gas overhead appropriately among performed upkeeps [ @skip-coverage ]', - async () => { - const allUpkeeps = await getMultipleUpkeepsDeployedAndFunded( - numPassingConditionalUpkeeps, - numPassingLogUpkeeps, - numFailingUpkeeps, - ) - const passingConditionalUpkeepIds = - allUpkeeps.passingConditionalUpkeepIds - const passingLogUpkeepIds = allUpkeeps.passingLogUpkeepIds - const failingUpkeepIds = allUpkeeps.failingUpkeepIds - - // Perform the upkeeps once to remove non-zero storage slots and have predictable gas measurement - let tx = await getTransmitTx( - registry, - keeper1, - passingConditionalUpkeepIds.concat( - passingLogUpkeepIds.concat(failingUpkeepIds), - ), - ) - - await tx.wait() - - // cancel upkeeps so they will fail in the transmit process - // must call the cancel upkeep as the owner to avoid the CANCELLATION_DELAY - for (let ldx = 0; ldx < failingUpkeepIds.length; ldx++) { - await registry - .connect(owner) - .cancelUpkeep(failingUpkeepIds[ldx]) - } - - // Do the actual thing - - tx = await getTransmitTx( - registry, - keeper1, - passingConditionalUpkeepIds.concat( - passingLogUpkeepIds.concat(failingUpkeepIds), - ), - ) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly numPassingUpkeeps Upkeep Performed should be emitted - assert.equal( - upkeepPerformedLogs.length, - numPassingConditionalUpkeeps + numPassingLogUpkeeps, - ) - - let netGasUsedPlusChargedOverhead = BigNumber.from('0') - for (let i = 0; i < numPassingConditionalUpkeeps; i++) { - const gasUsed = upkeepPerformedLogs[i].args.gasUsed - const chargedGasOverhead = - upkeepPerformedLogs[i].args.gasOverhead - - assert.isTrue(gasUsed.gt(BigNumber.from('0'))) - assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) - - // Overhead should be same for every upkeep - assert.isTrue( - chargedGasOverhead.eq( - upkeepPerformedLogs[0].args.gasOverhead, - ), - ) - netGasUsedPlusChargedOverhead = netGasUsedPlusChargedOverhead - .add(gasUsed) - .add(chargedGasOverhead) - } - - for (let i = 0; i < numPassingLogUpkeeps; i++) { - const gasUsed = - upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args - .gasUsed - const chargedGasOverhead = - upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args - .gasOverhead - - assert.isTrue(gasUsed.gt(BigNumber.from('0'))) - assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) - - // Overhead should be same for every upkeep - assert.isTrue( - chargedGasOverhead.eq( - upkeepPerformedLogs[numPassingConditionalUpkeeps].args - .gasOverhead, - ), - ) - netGasUsedPlusChargedOverhead = netGasUsedPlusChargedOverhead - .add(gasUsed) - .add(chargedGasOverhead) - } - - console.log( - 'Gas Benchmarking - batching (passedConditionalUpkeeps: ', - numPassingConditionalUpkeeps, - 'passedLogUpkeeps:', - numPassingLogUpkeeps, - 'failedUpkeeps:', - numFailingUpkeeps, - '): ', - numPassingConditionalUpkeeps > 0 - ? 'charged conditional overhead' - : '', - numPassingConditionalUpkeeps > 0 - ? upkeepPerformedLogs[0].args.gasOverhead.toString() - : '', - numPassingLogUpkeeps > 0 ? 'charged log overhead' : '', - numPassingLogUpkeeps > 0 - ? upkeepPerformedLogs[ - numPassingConditionalUpkeeps - ].args.gasOverhead.toString() - : '', - ' margin over gasUsed', - netGasUsedPlusChargedOverhead.sub(receipt.gasUsed).toString(), - ) - - // The total gas charged should be greater than tx gas - assert.isTrue( - netGasUsedPlusChargedOverhead.gt(receipt.gasUsed), - 'Charged gas overhead is too low for batch upkeeps, increase ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD', - ) - }, - ) - } - } - } - - it('has enough perform gas overhead for large batches [ @skip-coverage ]', async () => { - const numUpkeeps = 20 - const upkeepIds: BigNumber[] = [] - let totalPerformGas = BigNumber.from('0') - for (let i = 0; i < numUpkeeps; i++) { - const mock = await upkeepMockFactory.deploy() - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - const testUpkeepId = await getUpkeepID(tx) - upkeepIds.push(testUpkeepId) - - // Add funds to passing upkeeps - await registry.connect(owner).addFunds(testUpkeepId, toWei('10')) - - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(performGas) - - totalPerformGas = totalPerformGas.add(performGas) - } - - // Should revert with no overhead added - await evmRevert( - getTransmitTx(registry, keeper1, upkeepIds, { - gasLimit: totalPerformGas, - }), - ) - // Should not revert with overhead added - await getTransmitTx(registry, keeper1, upkeepIds, { - gasLimit: totalPerformGas.add(transmitGasOverhead), - }) - }) - - it('splits l2 payment among performed upkeeps according to perform data weight', async () => { - const numUpkeeps = 7 - const upkeepIds: BigNumber[] = [] - const performDataSizes = [0, 10, 1000, 50, 33, 69, 420] - const performDatas: string[] = [] - const upkeepCalldataWeights: BigNumber[] = [] - let totalCalldataWeight = BigNumber.from('0') - // Same as MockArbGasInfo.sol - const l1CostWeiArb = BigNumber.from(1000000) - - for (let i = 0; i < numUpkeeps; i++) { - const mock = await upkeepMockFactory.deploy() - const tx = await arbRegistry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - const testUpkeepId = await getUpkeepID(tx) - upkeepIds.push(testUpkeepId) - - // Add funds to passing upkeeps - await arbRegistry.connect(owner).addFunds(testUpkeepId, toWei('100')) - - // Generate performData - let pd = '0x' - for (let j = 0; j < performDataSizes[i]; j++) { - pd += '11' - } - performDatas.push(pd) - const w = BigNumber.from(performDataSizes[i]) - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul( - BigNumber.from(f + 1), - ), - ) - upkeepCalldataWeights.push(w) - totalCalldataWeight = totalCalldataWeight.add(w) - } - - // Do the thing - const tx = await getTransmitTx(arbRegistry, keeper1, upkeepIds, { - gasPrice: gasWei.mul('5'), // High gas price so that it gets capped - performDatas, - }) - - const receipt = await tx.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - // exactly numPassingUpkeeps Upkeep Performed should be emitted - assert.equal(upkeepPerformedLogs.length, numUpkeeps) - - for (let i = 0; i < numUpkeeps; i++) { - const upkeepPerformedLog = upkeepPerformedLogs[i] - - const gasUsed = upkeepPerformedLog.args.gasUsed - const gasOverhead = upkeepPerformedLog.args.gasOverhead - const totalPayment = upkeepPerformedLog.args.totalPayment - - assert.equal( - linkForGas( - gasUsed, - gasOverhead, - gasCeilingMultiplier, - paymentPremiumPPB, - flatFeeMicroLink, - l1CostWeiArb.mul(upkeepCalldataWeights[i]).div(totalCalldataWeight), - ).total.toString(), - totalPayment.toString(), - ) - } - }) - }) - - describe('#recoverFunds', () => { - const sent = toWei('7') - - beforeEach(async () => { - await linkToken.connect(admin).approve(registry.address, toWei('100')) - await linkToken - .connect(owner) - .transfer(await keeper1.getAddress(), toWei('1000')) - - // add funds to upkeep 1 and perform and withdraw some payment - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), emptyBytes, emptyBytes) - - const id1 = await getUpkeepID(tx) - await registry.connect(admin).addFunds(id1, toWei('5')) - - await getTransmitTx(registry, keeper1, [id1]) - await getTransmitTx(registry, keeper2, [id1]) - await getTransmitTx(registry, keeper3, [id1]) - - await registry - .connect(payee1) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ) - - // transfer funds directly to the registry - await linkToken.connect(keeper1).transfer(registry.address, sent) - - // add funds to upkeep 2 and perform and withdraw some payment - const tx2 = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), emptyBytes, emptyBytes) - const id2 = await getUpkeepID(tx2) - await registry.connect(admin).addFunds(id2, toWei('5')) - - await getTransmitTx(registry, keeper1, [id2]) - await getTransmitTx(registry, keeper2, [id2]) - await getTransmitTx(registry, keeper3, [id2]) - - await registry - .connect(payee2) - .withdrawPayment( - await keeper2.getAddress(), - await nonkeeper.getAddress(), - ) - - // transfer funds using onTokenTransfer - const data = ethers.utils.defaultAbiCoder.encode(['uint256'], [id2]) - await linkToken - .connect(owner) - .transferAndCall(registry.address, toWei('1'), data) - - // withdraw some funds - await registry.connect(owner).cancelUpkeep(id1) - await registry - .connect(admin) - .withdrawFunds(id1, await nonkeeper.getAddress()) - }) - - it('reverts if not called by owner', async () => { - await evmRevert( - registry.connect(keeper1).recoverFunds(), - 'Only callable by owner', - ) - }) - - it('allows any funds that have been accidentally transfered to be moved', async () => { - const balanceBefore = await linkToken.balanceOf(registry.address) - const ownerBefore = await linkToken.balanceOf(await owner.getAddress()) - - await registry.connect(owner).recoverFunds() - - const balanceAfter = await linkToken.balanceOf(registry.address) - const ownerAfter = await linkToken.balanceOf(await owner.getAddress()) - - assert.isTrue(balanceBefore.eq(balanceAfter.add(sent))) - assert.isTrue(ownerAfter.eq(ownerBefore.add(sent))) - }) - }) - - describe('#getMinBalanceForUpkeep / #checkUpkeep / #transmit', () => { - it('calculates the minimum balance appropriately', async () => { - await mock.setCanCheck(true) - - const oneWei = BigNumber.from(1) - const minBalance = await registry.getMinBalanceForUpkeep(upkeepId) - const tooLow = minBalance.sub(oneWei) - - await registry.connect(admin).addFunds(upkeepId, tooLow) - let checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.INSUFFICIENT_BALANCE, - ) - - await registry.connect(admin).addFunds(upkeepId, oneWei) - checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - assert.equal(checkUpkeepResult.upkeepNeeded, true) - }) - - it('uses maxPerformData size in checkUpkeep but actual performDataSize in transmit', async () => { - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - const upkeepID = await getUpkeepID(tx) - await mock.setCanCheck(true) - await mock.setCanPerform(true) - - // upkeep is underfunded by 1 wei - const minBalance1 = (await registry.getMinBalanceForUpkeep(upkeepID)).sub( - 1, - ) - await registry.connect(owner).addFunds(upkeepID, minBalance1) - - // upkeep check should return false, 2 should return true - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepID) - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.INSUFFICIENT_BALANCE, - ) - - // however upkeep should perform and pay all the remaining balance - let maxPerformData = '0x' - for (let i = 0; i < maxPerformDataSize.toNumber(); i++) { - maxPerformData += '11' - } - - const tx2 = await getTransmitTx(registry, keeper1, [upkeepID], { - gasPrice: gasWei.mul(gasCeilingMultiplier), - performDatas: [maxPerformData], - }) - - const receipt = await tx2.wait() - const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) - assert.equal(upkeepPerformedLogs.length, 1) - }) - }) - - describe('#withdrawFunds', () => { - let upkeepId2: BigNumber - - beforeEach(async () => { - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), randomBytes, '0x') - upkeepId2 = await getUpkeepID(tx) - - await registry.connect(admin).addFunds(upkeepId, toWei('100')) - await registry.connect(admin).addFunds(upkeepId2, toWei('100')) - - // Do a perform so that upkeep is charged some amount - await getTransmitTx(registry, keeper1, [upkeepId]) - await getTransmitTx(registry, keeper1, [upkeepId2]) - }) - - it('reverts if called on a non existing ID', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .withdrawFunds(upkeepId.add(1), await payee1.getAddress()), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry - .connect(owner) - .withdrawFunds(upkeepId, await payee1.getAddress()), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if called on an uncanceled upkeep', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .withdrawFunds(upkeepId, await payee1.getAddress()), - registry, - 'UpkeepNotCanceled', - ) - }) - - it('reverts if called with the 0 address', async () => { - await evmRevertCustomError( - registry.connect(admin).withdrawFunds(upkeepId, zeroAddress), - registry, - 'InvalidRecipient', - ) - }) - - describe('after the registration is paused, then cancelled', () => { - it('allows the admin to withdraw', async () => { - const balance = await registry.getBalance(upkeepId) - const payee = await payee1.getAddress() - await registry.connect(admin).pauseUpkeep(upkeepId) - await registry.connect(owner).cancelUpkeep(upkeepId) - await expect(() => - registry.connect(admin).withdrawFunds(upkeepId, payee), - ).to.changeTokenBalance(linkToken, payee1, balance) - }) - }) - - describe('after the registration is cancelled', () => { - beforeEach(async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - await registry.connect(owner).cancelUpkeep(upkeepId2) - }) - - it('can be called successively on two upkeeps', async () => { - await registry - .connect(admin) - .withdrawFunds(upkeepId, await payee1.getAddress()) - await registry - .connect(admin) - .withdrawFunds(upkeepId2, await payee1.getAddress()) - }) - - it('moves the funds out and updates the balance and emits an event', async () => { - const payee1Before = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const registryBefore = await linkToken.balanceOf(registry.address) - - let registration = await registry.getUpkeep(upkeepId) - const previousBalance = registration.balance - - const tx = await registry - .connect(admin) - .withdrawFunds(upkeepId, await payee1.getAddress()) - await expect(tx) - .to.emit(registry, 'FundsWithdrawn') - .withArgs(upkeepId, previousBalance, await payee1.getAddress()) - - const payee1After = await linkToken.balanceOf(await payee1.getAddress()) - const registryAfter = await linkToken.balanceOf(registry.address) - - assert.isTrue(payee1Before.add(previousBalance).eq(payee1After)) - assert.isTrue(registryBefore.sub(previousBalance).eq(registryAfter)) - - registration = await registry.getUpkeep(upkeepId) - assert.equal(0, registration.balance.toNumber()) - }) - }) - }) - - describe('#simulatePerformUpkeep', () => { - it('reverts if called by non zero address', async () => { - await evmRevertCustomError( - registry - .connect(await owner.getAddress()) - .callStatic.simulatePerformUpkeep(upkeepId, '0x'), - registry, - 'OnlySimulatedBackend', - ) - }) - - it('reverts when registry is paused', async () => { - await registry.connect(owner).pause() - await evmRevertCustomError( - registry - .connect(zeroAddress) - .callStatic.simulatePerformUpkeep(upkeepId, '0x'), - registry, - 'RegistryPaused', - ) - }) - - it('returns false and gasUsed when perform fails', async () => { - await mock.setCanPerform(false) - - const simulatePerformResult = await registry - .connect(zeroAddress) - .callStatic.simulatePerformUpkeep(upkeepId, '0x') - - assert.equal(simulatePerformResult.success, false) - assert.isTrue(simulatePerformResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - }) - - it('returns true, gasUsed, and performGas when perform succeeds', async () => { - await mock.setCanPerform(true) - - const simulatePerformResult = await registry - .connect(zeroAddress) - .callStatic.simulatePerformUpkeep(upkeepId, '0x') - - assert.equal(simulatePerformResult.success, true) - assert.isTrue(simulatePerformResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - }) - - it('returns correct amount of gasUsed when perform succeeds', async () => { - await mock.setCanPerform(true) - await mock.setPerformGasToBurn(performGas) - - const simulatePerformResult = await registry - .connect(zeroAddress) - .callStatic.simulatePerformUpkeep(upkeepId, '0x') - - assert.equal(simulatePerformResult.success, true) - // Full execute gas should be used, with some performGasBuffer(1000) - assert.isTrue( - simulatePerformResult.gasUsed.gt( - performGas.sub(BigNumber.from('1000')), - ), - ) - }) - }) - - describe('#checkUpkeep', () => { - it('reverts if called by non zero address', async () => { - await evmRevertCustomError( - registry - .connect(await owner.getAddress()) - .callStatic['checkUpkeep(uint256)'](upkeepId), - registry, - 'OnlySimulatedBackend', - ) - }) - - it('returns false and error code if the upkeep is cancelled by admin', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.UPKEEP_CANCELLED, - ) - expect(checkUpkeepResult.gasUsed).to.equal(0) - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns false and error code if the upkeep is cancelled by owner', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.UPKEEP_CANCELLED, - ) - expect(checkUpkeepResult.gasUsed).to.equal(0) - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns false and error code if the registry is paused', async () => { - await registry.connect(owner).pause() - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.REGISTRY_PAUSED, - ) - expect(checkUpkeepResult.gasUsed).to.equal(0) - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns false and error code if the upkeep is paused', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.UPKEEP_PAUSED, - ) - expect(checkUpkeepResult.gasUsed).to.equal(0) - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns false and error code if user is out of funds', async () => { - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.INSUFFICIENT_BALANCE, - ) - expect(checkUpkeepResult.gasUsed).to.equal(0) - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - context('when the registration is funded', () => { - beforeEach(async () => { - await linkToken.connect(admin).approve(registry.address, toWei('200')) - await registry.connect(admin).addFunds(upkeepId, toWei('100')) - await registry.connect(admin).addFunds(logUpkeepId, toWei('100')) - }) - - it('returns false, error code, and revert data if the target check reverts', async () => { - await mock.setShouldRevertCheck(true) - await mock.setCheckRevertReason( - 'custom revert error, clever way to insert offchain data', - ) - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - assert.equal(checkUpkeepResult.upkeepNeeded, false) - - const revertReasonBytes = `0x${checkUpkeepResult.performData.slice(10)}` // remove sighash - assert.equal( - ethers.utils.defaultAbiCoder.decode(['string'], revertReasonBytes)[0], - 'custom revert error, clever way to insert offchain data', - ) - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.TARGET_CHECK_REVERTED, - ) - assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - // Feed data should be returned here - assert.isTrue(checkUpkeepResult.fastGasWei.gt(BigNumber.from('0'))) - assert.isTrue(checkUpkeepResult.linkNative.gt(BigNumber.from('0'))) - }) - - it('returns false, error code, and no revert data if the target check revert data exceeds maxRevertDataSize', async () => { - await mock.setShouldRevertCheck(true) - let longRevertReason = '' - for (let i = 0; i <= maxRevertDataSize.toNumber(); i++) { - longRevertReason += 'x' - } - await mock.setCheckRevertReason(longRevertReason) - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - assert.equal(checkUpkeepResult.upkeepNeeded, false) - - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.REVERT_DATA_EXCEEDS_LIMIT, - ) - assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns false and error code if the upkeep is not needed', async () => { - await mock.setCanCheck(false) - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.UPKEEP_NOT_NEEDED, - ) - assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns false and error code if the performData exceeds limit', async () => { - let longBytes = '0x' - for (let i = 0; i < 5000; i++) { - longBytes += '1' - } - await mock.setCanCheck(true) - await mock.setPerformData(longBytes) - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId) - - assert.equal(checkUpkeepResult.upkeepNeeded, false) - assert.equal(checkUpkeepResult.performData, '0x') - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.PERFORM_DATA_EXCEEDS_LIMIT, - ) - assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - }) - - it('returns true with gas used if the target can execute', async () => { - await mock.setCanCheck(true) - await mock.setPerformData(randomBytes) - - const latestBlock = await ethers.provider.getBlock('latest') - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId, { - blockTag: latestBlock.number, - }) - - assert.equal(checkUpkeepResult.upkeepNeeded, true) - assert.equal(checkUpkeepResult.performData, randomBytes) - assert.equal( - checkUpkeepResult.upkeepFailureReason, - UpkeepFailureReason.NONE, - ) - assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - expect(checkUpkeepResult.gasLimit).to.equal(performGas) - assert.isTrue(checkUpkeepResult.fastGasWei.eq(gasWei)) - assert.isTrue(checkUpkeepResult.linkNative.eq(linkEth)) - }) - - it('calls checkLog for log-trigger upkeeps', async () => { - const log: Log = { - index: 0, - timestamp: 0, - txHash: ethers.utils.randomBytes(32), - blockNumber: 100, - blockHash: ethers.utils.randomBytes(32), - source: randomAddress(), - topics: [ethers.utils.randomBytes(32), ethers.utils.randomBytes(32)], - data: ethers.utils.randomBytes(1000), - } - - await ltUpkeep.mock.checkLog.withArgs(log, '0x').returns(true, '0x1234') - - const checkData = encodeLog(log) - - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256,bytes)'](logUpkeepId, checkData) - - expect(checkUpkeepResult.upkeepNeeded).to.be.true - expect(checkUpkeepResult.performData).to.equal('0x1234') - }) - - itMaybe( - 'has a large enough gas overhead to cover upkeeps that use all their gas [ @skip-coverage ]', - async () => { - await mock.setCanCheck(true) - await mock.setCheckGasToBurn(checkGasLimit) - const gas = checkGasLimit.add(checkGasOverhead) - const checkUpkeepResult = await registry - .connect(zeroAddress) - .callStatic['checkUpkeep(uint256)'](upkeepId, { - gasLimit: gas, - }) - - assert.equal(checkUpkeepResult.upkeepNeeded, true) - }, - ) - }) - }) - - describe('#addFunds', () => { - const amount = toWei('1') - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(keeper1).addFunds(upkeepId.add(1), amount), - registry, - 'UpkeepCancelled', - ) - }) - - it('adds to the balance of the registration', async () => { - await registry.connect(admin).addFunds(upkeepId, amount) - const registration = await registry.getUpkeep(upkeepId) - assert.isTrue(amount.eq(registration.balance)) - }) - - it('lets anyone add funds to an upkeep not just admin', async () => { - await linkToken.connect(owner).transfer(await payee1.getAddress(), amount) - await linkToken.connect(payee1).approve(registry.address, amount) - - await registry.connect(payee1).addFunds(upkeepId, amount) - const registration = await registry.getUpkeep(upkeepId) - assert.isTrue(amount.eq(registration.balance)) - }) - - it('emits a log', async () => { - const tx = await registry.connect(admin).addFunds(upkeepId, amount) - await expect(tx) - .to.emit(registry, 'FundsAdded') - .withArgs(upkeepId, await admin.getAddress(), amount) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(keeper1).addFunds(upkeepId, amount), - registry, - 'UpkeepCancelled', - ) - }) - }) - - describe('#getActiveUpkeepIDs', () => { - it('reverts if startIndex is out of bounds ', async () => { - await evmRevertCustomError( - registry.getActiveUpkeepIDs(numUpkeeps, 0), - registry, - 'IndexOutOfRange', - ) - await evmRevertCustomError( - registry.getActiveUpkeepIDs(numUpkeeps + 1, 0), - registry, - 'IndexOutOfRange', - ) - }) - - it('returns upkeep IDs bounded by maxCount', async () => { - let upkeepIds = await registry.getActiveUpkeepIDs(0, 1) - assert(upkeepIds.length == 1) - assert(upkeepIds[0].eq(upkeepId)) - upkeepIds = await registry.getActiveUpkeepIDs(1, 3) - assert(upkeepIds.length == 3) - expect(upkeepIds).to.deep.equal([ - afUpkeepId, - logUpkeepId, - streamsLookupUpkeepId, - ]) - }) - - it('returns as many ids as possible if maxCount > num available', async () => { - const upkeepIds = await registry.getActiveUpkeepIDs(1, numUpkeeps + 100) - assert(upkeepIds.length == numUpkeeps - 1) - }) - - it('returns all upkeep IDs if maxCount is 0', async () => { - let upkeepIds = await registry.getActiveUpkeepIDs(0, 0) - assert(upkeepIds.length == numUpkeeps) - upkeepIds = await registry.getActiveUpkeepIDs(2, 0) - assert(upkeepIds.length == numUpkeeps - 2) - }) - }) - - describe('#getMaxPaymentForGas', () => { - let maxl1CostWeiArbWithoutMultiplier: BigNumber - let maxl1CostWeiOptWithoutMultiplier: BigNumber - - beforeEach(async () => { - const arbL1PriceinWei = BigNumber.from(1000) // Same as MockArbGasInfo.sol - maxl1CostWeiArbWithoutMultiplier = arbL1PriceinWei.mul( - maxPerformDataSize - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul( - BigNumber.from(f + 1), - ), - ), - ) - maxl1CostWeiOptWithoutMultiplier = BigNumber.from(2000000) // Same as MockOVMGasPriceOracle.sol - }) - - itMaybe('calculates the max fee appropriately', async () => { - await verifyMaxPayment(registry, chainModuleBase) - }) - - itMaybe('calculates the max fee appropriately for Arbitrum', async () => { - await verifyMaxPayment( - arbRegistry, - arbitrumModule, - maxl1CostWeiArbWithoutMultiplier, - ) - }) - - itMaybe('calculates the max fee appropriately for Optimism', async () => { - await verifyMaxPayment( - opRegistry, - optimismModule, - maxl1CostWeiOptWithoutMultiplier, - ) - }) - - it('uses the fallback gas price if the feed has issues', async () => { - const chainModuleOverheads = await chainModuleBase.getGasOverhead() - const expectedFallbackMaxPayment = linkForGas( - performGas, - registryConditionalOverhead - .add(registryPerSignerGasOverhead.mul(f + 1)) - .add( - maxPerformDataSize - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul( - BigNumber.from(f + 1), - ), - ) - .mul( - registryPerPerformByteGasOverhead.add( - chainModuleOverheads.chainModulePerByteOverhead, - ), - ), - ) - .add(chainModuleOverheads.chainModuleFixedOverhead), - gasCeilingMultiplier.mul('2'), // fallbackGasPrice is 2x gas price - paymentPremiumPPB, - flatFeeMicroLink, - ).total - - // Stale feed - let roundId = 99 - const answer = 100 - let updatedAt = 946684800 // New Years 2000 🥳 - let startedAt = 946684799 - await gasPriceFeed - .connect(owner) - .updateRoundData(roundId, answer, updatedAt, startedAt) - - assert.equal( - expectedFallbackMaxPayment.toString(), - ( - await registry.getMaxPaymentForGas(Trigger.CONDITION, performGas) - ).toString(), - ) - - // Negative feed price - roundId = 100 - updatedAt = now() - startedAt = 946684799 - await gasPriceFeed - .connect(owner) - .updateRoundData(roundId, -100, updatedAt, startedAt) - - assert.equal( - expectedFallbackMaxPayment.toString(), - ( - await registry.getMaxPaymentForGas(Trigger.CONDITION, performGas) - ).toString(), - ) - - // Zero feed price - roundId = 101 - updatedAt = now() - startedAt = 946684799 - await gasPriceFeed - .connect(owner) - .updateRoundData(roundId, 0, updatedAt, startedAt) - - assert.equal( - expectedFallbackMaxPayment.toString(), - ( - await registry.getMaxPaymentForGas(Trigger.CONDITION, performGas) - ).toString(), - ) - }) - - it('uses the fallback link price if the feed has issues', async () => { - const chainModuleOverheads = await chainModuleBase.getGasOverhead() - const expectedFallbackMaxPayment = linkForGas( - performGas, - registryConditionalOverhead - .add(registryPerSignerGasOverhead.mul(f + 1)) - .add( - maxPerformDataSize - .add(registryTransmitCalldataFixedBytesOverhead) - .add( - registryTransmitCalldataPerSignerBytesOverhead.mul( - BigNumber.from(f + 1), - ), - ) - .mul( - registryPerPerformByteGasOverhead.add( - chainModuleOverheads.chainModulePerByteOverhead, - ), - ), - ) - .add(chainModuleOverheads.chainModuleFixedOverhead), - gasCeilingMultiplier.mul('2'), // fallbackLinkPrice is 1/2 link price, so multiply by 2 - paymentPremiumPPB, - flatFeeMicroLink, - ).total - - // Stale feed - let roundId = 99 - const answer = 100 - let updatedAt = 946684800 // New Years 2000 🥳 - let startedAt = 946684799 - await linkEthFeed - .connect(owner) - .updateRoundData(roundId, answer, updatedAt, startedAt) - - assert.equal( - expectedFallbackMaxPayment.toString(), - ( - await registry.getMaxPaymentForGas(Trigger.CONDITION, performGas) - ).toString(), - ) - - // Negative feed price - roundId = 100 - updatedAt = now() - startedAt = 946684799 - await linkEthFeed - .connect(owner) - .updateRoundData(roundId, -100, updatedAt, startedAt) - - assert.equal( - expectedFallbackMaxPayment.toString(), - ( - await registry.getMaxPaymentForGas(Trigger.CONDITION, performGas) - ).toString(), - ) - - // Zero feed price - roundId = 101 - updatedAt = now() - startedAt = 946684799 - await linkEthFeed - .connect(owner) - .updateRoundData(roundId, 0, updatedAt, startedAt) - - assert.equal( - expectedFallbackMaxPayment.toString(), - ( - await registry.getMaxPaymentForGas(Trigger.CONDITION, performGas) - ).toString(), - ) - }) - }) - - describe('#typeAndVersion', () => { - it('uses the correct type and version', async () => { - const typeAndVersion = await registry.typeAndVersion() - assert.equal(typeAndVersion, 'AutomationRegistry 2.2.0') - }) - }) - - describe('#onTokenTransfer', () => { - const amount = toWei('1') - - it('reverts if not called by the LINK token', async () => { - const data = ethers.utils.defaultAbiCoder.encode(['uint256'], [upkeepId]) - - await evmRevertCustomError( - registry - .connect(keeper1) - .onTokenTransfer(await keeper1.getAddress(), amount, data), - registry, - 'OnlyCallableByLINKToken', - ) - }) - - it('reverts if not called with more or less than 32 bytes', async () => { - const longData = ethers.utils.defaultAbiCoder.encode( - ['uint256', 'uint256'], - ['33', '34'], - ) - const shortData = '0x12345678' - - await evmRevert( - linkToken - .connect(owner) - .transferAndCall(registry.address, amount, longData), - ) - await evmRevert( - linkToken - .connect(owner) - .transferAndCall(registry.address, amount, shortData), - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(keeper1).addFunds(upkeepId, amount), - registry, - 'UpkeepCancelled', - ) - }) - - it('updates the funds of the job id passed', async () => { - const data = ethers.utils.defaultAbiCoder.encode(['uint256'], [upkeepId]) - - const before = (await registry.getUpkeep(upkeepId)).balance - await linkToken - .connect(owner) - .transferAndCall(registry.address, amount, data) - const after = (await registry.getUpkeep(upkeepId)).balance - - assert.isTrue(before.add(amount).eq(after)) - }) - }) - - describeMaybe('#setConfig - onchain', async () => { - const payment = BigNumber.from(1) - const flatFee = BigNumber.from(2) - const maxGas = BigNumber.from(6) - const staleness = BigNumber.from(4) - const ceiling = BigNumber.from(5) - const newMinUpkeepSpend = BigNumber.from(9) - const newMaxCheckDataSize = BigNumber.from(10000) - const newMaxPerformDataSize = BigNumber.from(10000) - const newMaxRevertDataSize = BigNumber.from(10000) - const newMaxPerformGas = BigNumber.from(10000000) - const fbGasEth = BigNumber.from(7) - const fbLinkEth = BigNumber.from(8) - const newTranscoder = randomAddress() - const newRegistrars = [randomAddress(), randomAddress()] - const upkeepManager = randomAddress() - - const newConfig = { - paymentPremiumPPB: payment, - flatFeeMicroLink: flatFee, - checkGasLimit: maxGas, - stalenessSeconds: staleness, - gasCeilingMultiplier: ceiling, - minUpkeepSpend: newMinUpkeepSpend, - maxCheckDataSize: newMaxCheckDataSize, - maxPerformDataSize: newMaxPerformDataSize, - maxRevertDataSize: newMaxRevertDataSize, - maxPerformGas: newMaxPerformGas, - fallbackGasPrice: fbGasEth, - fallbackLinkPrice: fbLinkEth, - transcoder: newTranscoder, - registrars: newRegistrars, - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - } - - it('reverts when called by anyone but the proposed owner', async () => { - await evmRevert( - registry - .connect(payee1) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ), - 'Only callable by owner', - ) - }) - - it('reverts if signers or transmitters are the zero address', async () => { - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - [randomAddress(), randomAddress(), randomAddress(), zeroAddress], - [ - randomAddress(), - randomAddress(), - randomAddress(), - randomAddress(), - ], - f, - newConfig, - offchainVersion, - offchainBytes, - ), - registry, - 'InvalidSigner', - ) - - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - [ - randomAddress(), - randomAddress(), - randomAddress(), - randomAddress(), - ], - [randomAddress(), randomAddress(), randomAddress(), zeroAddress], - f, - newConfig, - offchainVersion, - offchainBytes, - ), - registry, - 'InvalidTransmitter', - ) - }) - - it('updates the onchainConfig and configDigest', async () => { - const old = await registry.getState() - const oldConfig = old.config - const oldState = old.state - assert.isTrue(paymentPremiumPPB.eq(oldConfig.paymentPremiumPPB)) - assert.isTrue(flatFeeMicroLink.eq(oldConfig.flatFeeMicroLink)) - assert.isTrue(stalenessSeconds.eq(oldConfig.stalenessSeconds)) - assert.isTrue(gasCeilingMultiplier.eq(oldConfig.gasCeilingMultiplier)) - - await registry - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ) - - const updated = await registry.getState() - const updatedConfig = updated.config - const updatedState = updated.state - assert.equal(updatedConfig.paymentPremiumPPB, payment.toNumber()) - assert.equal(updatedConfig.flatFeeMicroLink, flatFee.toNumber()) - assert.equal(updatedConfig.stalenessSeconds, staleness.toNumber()) - assert.equal(updatedConfig.gasCeilingMultiplier, ceiling.toNumber()) - assert.equal( - updatedConfig.minUpkeepSpend.toString(), - newMinUpkeepSpend.toString(), - ) - assert.equal( - updatedConfig.maxCheckDataSize, - newMaxCheckDataSize.toNumber(), - ) - assert.equal( - updatedConfig.maxPerformDataSize, - newMaxPerformDataSize.toNumber(), - ) - assert.equal( - updatedConfig.maxRevertDataSize, - newMaxRevertDataSize.toNumber(), - ) - assert.equal(updatedConfig.maxPerformGas, newMaxPerformGas.toNumber()) - assert.equal(updatedConfig.checkGasLimit, maxGas.toNumber()) - assert.equal( - updatedConfig.fallbackGasPrice.toNumber(), - fbGasEth.toNumber(), - ) - assert.equal( - updatedConfig.fallbackLinkPrice.toNumber(), - fbLinkEth.toNumber(), - ) - assert.equal(updatedState.latestEpoch, 0) - - assert(oldState.configCount + 1 == updatedState.configCount) - assert( - oldState.latestConfigBlockNumber != - updatedState.latestConfigBlockNumber, - ) - assert(oldState.latestConfigDigest != updatedState.latestConfigDigest) - - assert.equal(updatedConfig.transcoder, newTranscoder) - assert.deepEqual(updatedConfig.registrars, newRegistrars) - assert.equal(updatedConfig.upkeepPrivilegeManager, upkeepManager) - }) - - it('maintains paused state when config is changed', async () => { - await registry.pause() - const old = await registry.getState() - assert.isTrue(old.state.paused) - - await registry - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ) - - const updated = await registry.getState() - assert.isTrue(updated.state.paused) - }) - - it('emits an event', async () => { - const tx = await registry - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - newConfig, - offchainVersion, - offchainBytes, - ) - await expect(tx).to.emit(registry, 'ConfigSet') - }) - }) - - describe('#setConfig - offchain', () => { - let newKeepers: string[] - - beforeEach(async () => { - newKeepers = [ - await personas.Eddy.getAddress(), - await personas.Nick.getAddress(), - await personas.Neil.getAddress(), - await personas.Carol.getAddress(), - ] - }) - - it('reverts when called by anyone but the owner', async () => { - await evmRevert( - registry - .connect(payee1) - .setConfigTypeSafe( - newKeepers, - newKeepers, - f, - config, - offchainVersion, - offchainBytes, - ), - 'Only callable by owner', - ) - }) - - it('reverts if too many keeperAddresses set', async () => { - for (let i = 0; i < 40; i++) { - newKeepers.push(randomAddress()) - } - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - newKeepers, - newKeepers, - f, - config, - offchainVersion, - offchainBytes, - ), - registry, - 'TooManyOracles', - ) - }) - - it('reverts if f=0', async () => { - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - newKeepers, - newKeepers, - 0, - config, - offchainVersion, - offchainBytes, - ), - registry, - 'IncorrectNumberOfFaultyOracles', - ) - }) - - it('reverts if signers != transmitters length', async () => { - const signers = [randomAddress()] - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - signers, - newKeepers, - f, - config, - offchainVersion, - offchainBytes, - ), - registry, - 'IncorrectNumberOfSigners', - ) - }) - - it('reverts if signers <= 3f', async () => { - newKeepers.pop() - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - newKeepers, - newKeepers, - f, - config, - offchainVersion, - offchainBytes, - ), - registry, - 'IncorrectNumberOfSigners', - ) - }) - - it('reverts on repeated signers', async () => { - const newSigners = [ - await personas.Eddy.getAddress(), - await personas.Eddy.getAddress(), - await personas.Eddy.getAddress(), - await personas.Eddy.getAddress(), - ] - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - newSigners, - newKeepers, - f, - config, - offchainVersion, - offchainBytes, - ), - registry, - 'RepeatedSigner', - ) - }) - - it('reverts on repeated transmitters', async () => { - const newTransmitters = [ - await personas.Eddy.getAddress(), - await personas.Eddy.getAddress(), - await personas.Eddy.getAddress(), - await personas.Eddy.getAddress(), - ] - await evmRevertCustomError( - registry - .connect(owner) - .setConfigTypeSafe( - newKeepers, - newTransmitters, - f, - config, - offchainVersion, - offchainBytes, - ), - registry, - 'RepeatedTransmitter', - ) - }) - - itMaybe('stores new config and emits event', async () => { - // Perform an upkeep so that totalPremium is updated - await registry.connect(admin).addFunds(upkeepId, toWei('100')) - let tx = await getTransmitTx(registry, keeper1, [upkeepId]) - await tx.wait() - - const newOffChainVersion = BigNumber.from('2') - const newOffChainConfig = '0x1122' - - const old = await registry.getState() - const oldState = old.state - assert(oldState.totalPremium.gt(BigNumber.from('0'))) - - const newSigners = newKeepers - tx = await registry - .connect(owner) - .setConfigTypeSafe( - newSigners, - newKeepers, - f, - config, - newOffChainVersion, - newOffChainConfig, - ) - - const updated = await registry.getState() - const updatedState = updated.state - assert(oldState.totalPremium.eq(updatedState.totalPremium)) - - // Old signer addresses which are not in new signers should be non active - for (let i = 0; i < signerAddresses.length; i++) { - const signer = signerAddresses[i] - if (!newSigners.includes(signer)) { - assert(!(await registry.getSignerInfo(signer)).active) - assert((await registry.getSignerInfo(signer)).index == 0) - } - } - // New signer addresses should be active - for (let i = 0; i < newSigners.length; i++) { - const signer = newSigners[i] - assert((await registry.getSignerInfo(signer)).active) - assert((await registry.getSignerInfo(signer)).index == i) - } - // Old transmitter addresses which are not in new transmitter should be non active, update lastCollected but retain other info - for (let i = 0; i < keeperAddresses.length; i++) { - const transmitter = keeperAddresses[i] - if (!newKeepers.includes(transmitter)) { - assert(!(await registry.getTransmitterInfo(transmitter)).active) - assert((await registry.getTransmitterInfo(transmitter)).index == i) - assert( - (await registry.getTransmitterInfo(transmitter)).lastCollected.eq( - oldState.totalPremium.sub( - oldState.totalPremium.mod(keeperAddresses.length), - ), - ), - ) - } - } - // New transmitter addresses should be active - for (let i = 0; i < newKeepers.length; i++) { - const transmitter = newKeepers[i] - assert((await registry.getTransmitterInfo(transmitter)).active) - assert((await registry.getTransmitterInfo(transmitter)).index == i) - assert( - (await registry.getTransmitterInfo(transmitter)).lastCollected.eq( - oldState.totalPremium, - ), - ) - } - - // config digest should be updated - assert(oldState.configCount + 1 == updatedState.configCount) - assert( - oldState.latestConfigBlockNumber != - updatedState.latestConfigBlockNumber, - ) - assert(oldState.latestConfigDigest != updatedState.latestConfigDigest) - - //New config should be updated - assert.deepEqual(updated.signers, newKeepers) - assert.deepEqual(updated.transmitters, newKeepers) - - // Event should have been emitted - await expect(tx).to.emit(registry, 'ConfigSet') - }) - }) - - describe('#setPeerRegistryMigrationPermission() / #getPeerRegistryMigrationPermission()', () => { - const peer = randomAddress() - it('allows the owner to set the peer registries', async () => { - let permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(0) - await registry.setPeerRegistryMigrationPermission(peer, 1) - permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(1) - await registry.setPeerRegistryMigrationPermission(peer, 2) - permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(2) - await registry.setPeerRegistryMigrationPermission(peer, 0) - permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(0) - }) - it('reverts if passed an unsupported permission', async () => { - await expect( - registry.connect(admin).setPeerRegistryMigrationPermission(peer, 10), - ).to.be.reverted - }) - it('reverts if not called by the owner', async () => { - await expect( - registry.connect(admin).setPeerRegistryMigrationPermission(peer, 1), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('#registerUpkeep', () => { - it('reverts when registry is paused', async () => { - await registry.connect(owner).pause() - await evmRevertCustomError( - registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), emptyBytes, '0x'), - registry, - 'RegistryPaused', - ) - }) - - it('reverts if the target is not a contract', async () => { - await evmRevertCustomError( - registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](zeroAddress, performGas, await admin.getAddress(), emptyBytes, '0x'), - registry, - 'NotAContract', - ) - }) - - it('reverts if called by a non-owner', async () => { - await evmRevertCustomError( - registry - .connect(keeper1) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), emptyBytes, '0x'), - registry, - 'OnlyCallableByOwnerOrRegistrar', - ) - }) - - it('reverts if execute gas is too low', async () => { - await evmRevertCustomError( - registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, 2299, await admin.getAddress(), emptyBytes, '0x'), - registry, - 'GasLimitOutsideRange', - ) - }) - - it('reverts if execute gas is too high', async () => { - await evmRevertCustomError( - registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, 5000001, await admin.getAddress(), emptyBytes, '0x'), - registry, - 'GasLimitOutsideRange', - ) - }) - - it('reverts if checkData is too long', async () => { - let longBytes = '0x' - for (let i = 0; i < 10000; i++) { - longBytes += '1' - } - await evmRevertCustomError( - registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), longBytes, '0x'), - registry, - 'CheckDataExceedsLimit', - ) - }) - - it('creates a record of the registration', async () => { - const performGases = [100000, 500000] - const checkDatas = [emptyBytes, '0x12'] - - for (let jdx = 0; jdx < performGases.length; jdx++) { - const performGas = performGases[jdx] - for (let kdx = 0; kdx < checkDatas.length; kdx++) { - const checkData = checkDatas[kdx] - const tx = await registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), checkData, '0x') - - //confirm the upkeep details and verify emitted events - const testUpkeepId = await getUpkeepID(tx) - await expect(tx) - .to.emit(registry, 'UpkeepRegistered') - .withArgs(testUpkeepId, performGas, await admin.getAddress()) - - await expect(tx) - .to.emit(registry, 'UpkeepCheckDataSet') - .withArgs(testUpkeepId, checkData) - await expect(tx) - .to.emit(registry, 'UpkeepTriggerConfigSet') - .withArgs(testUpkeepId, '0x') - - const registration = await registry.getUpkeep(testUpkeepId) - - assert.equal(mock.address, registration.target) - assert.notEqual( - ethers.constants.AddressZero, - await registry.getForwarder(testUpkeepId), - ) - assert.equal( - performGas.toString(), - registration.performGas.toString(), - ) - assert.equal(await admin.getAddress(), registration.admin) - assert.equal(0, registration.balance.toNumber()) - assert.equal(0, registration.amountSpent.toNumber()) - assert.equal(0, registration.lastPerformedBlockNumber) - assert.equal(checkData, registration.checkData) - assert.equal(registration.paused, false) - assert.equal(registration.offchainConfig, '0x') - assert(registration.maxValidBlocknumber.eq('0xffffffff')) - } - } - }) - }) - - describe('#pauseUpkeep', () => { - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(keeper1).pauseUpkeep(upkeepId.add(1)), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is already canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).pauseUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if the upkeep is already paused', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).pauseUpkeep(upkeepId), - registry, - 'OnlyUnpausedUpkeep', - ) - }) - - it('reverts if the caller is not the upkeep admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).pauseUpkeep(upkeepId), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('pauses the upkeep and emits an event', async () => { - const tx = await registry.connect(admin).pauseUpkeep(upkeepId) - await expect(tx).to.emit(registry, 'UpkeepPaused').withArgs(upkeepId) - - const registration = await registry.getUpkeep(upkeepId) - assert.equal(registration.paused, true) - }) - }) - - describe('#unpauseUpkeep', () => { - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(keeper1).unpauseUpkeep(upkeepId.add(1)), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is already canceled', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).unpauseUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('marks the contract as paused', async () => { - assert.isFalse((await registry.getState()).state.paused) - - await registry.connect(owner).pause() - - assert.isTrue((await registry.getState()).state.paused) - }) - - it('reverts if the upkeep is not paused', async () => { - await evmRevertCustomError( - registry.connect(admin).unpauseUpkeep(upkeepId), - registry, - 'OnlyPausedUpkeep', - ) - }) - - it('reverts if the caller is not the upkeep admin', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) - - const registration = await registry.getUpkeep(upkeepId) - - assert.equal(registration.paused, true) - - await evmRevertCustomError( - registry.connect(keeper1).unpauseUpkeep(upkeepId), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('unpauses the upkeep and emits an event', async () => { - const originalCount = (await registry.getActiveUpkeepIDs(0, 0)).length - - await registry.connect(admin).pauseUpkeep(upkeepId) - - const tx = await registry.connect(admin).unpauseUpkeep(upkeepId) - - await expect(tx).to.emit(registry, 'UpkeepUnpaused').withArgs(upkeepId) - - const registration = await registry.getUpkeep(upkeepId) - assert.equal(registration.paused, false) - - const upkeepIds = await registry.getActiveUpkeepIDs(0, 0) - assert.equal(upkeepIds.length, originalCount) - }) - }) - - describe('#setUpkeepCheckData', () => { - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry - .connect(keeper1) - .setUpkeepCheckData(upkeepId.add(1), randomBytes), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the caller is not upkeep admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).setUpkeepCheckData(upkeepId, randomBytes), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is cancelled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).setUpkeepCheckData(upkeepId, randomBytes), - registry, - 'UpkeepCancelled', - ) - }) - - it('is allowed to update on paused upkeep', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) - await registry.connect(admin).setUpkeepCheckData(upkeepId, randomBytes) - - const registration = await registry.getUpkeep(upkeepId) - assert.equal(randomBytes, registration.checkData) - }) - - it('reverts if new data exceeds limit', async () => { - let longBytes = '0x' - for (let i = 0; i < 10000; i++) { - longBytes += '1' - } - - await evmRevertCustomError( - registry.connect(admin).setUpkeepCheckData(upkeepId, longBytes), - registry, - 'CheckDataExceedsLimit', - ) - }) - - it('updates the upkeep check data and emits an event', async () => { - const tx = await registry - .connect(admin) - .setUpkeepCheckData(upkeepId, randomBytes) - await expect(tx) - .to.emit(registry, 'UpkeepCheckDataSet') - .withArgs(upkeepId, randomBytes) - - const registration = await registry.getUpkeep(upkeepId) - assert.equal(randomBytes, registration.checkData) - }) - }) - - describe('#setUpkeepGasLimit', () => { - const newGasLimit = BigNumber.from('300000') - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(admin).setUpkeepGasLimit(upkeepId.add(1), newGasLimit), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(admin).setUpkeepGasLimit(upkeepId, newGasLimit), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry.connect(owner).setUpkeepGasLimit(upkeepId, newGasLimit), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if new gas limit is out of bounds', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepGasLimit(upkeepId, BigNumber.from('100')), - registry, - 'GasLimitOutsideRange', - ) - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepGasLimit(upkeepId, BigNumber.from('6000000')), - registry, - 'GasLimitOutsideRange', - ) - }) - - it('updates the gas limit successfully', async () => { - const initialGasLimit = (await registry.getUpkeep(upkeepId)).performGas - assert.equal(initialGasLimit, performGas.toNumber()) - await registry.connect(admin).setUpkeepGasLimit(upkeepId, newGasLimit) - const updatedGasLimit = (await registry.getUpkeep(upkeepId)).performGas - assert.equal(updatedGasLimit, newGasLimit.toNumber()) - }) - - it('emits a log', async () => { - const tx = await registry - .connect(admin) - .setUpkeepGasLimit(upkeepId, newGasLimit) - await expect(tx) - .to.emit(registry, 'UpkeepGasLimitSet') - .withArgs(upkeepId, newGasLimit) - }) - }) - - describe('#setUpkeepOffchainConfig', () => { - const newConfig = '0xc0ffeec0ffee' - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepOffchainConfig(upkeepId.add(1), newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(admin).setUpkeepOffchainConfig(upkeepId, newConfig), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry.connect(owner).setUpkeepOffchainConfig(upkeepId, newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('updates the config successfully', async () => { - const initialConfig = (await registry.getUpkeep(upkeepId)).offchainConfig - assert.equal(initialConfig, '0x') - await registry.connect(admin).setUpkeepOffchainConfig(upkeepId, newConfig) - const updatedConfig = (await registry.getUpkeep(upkeepId)).offchainConfig - assert.equal(newConfig, updatedConfig) - }) - - it('emits a log', async () => { - const tx = await registry - .connect(admin) - .setUpkeepOffchainConfig(upkeepId, newConfig) - await expect(tx) - .to.emit(registry, 'UpkeepOffchainConfigSet') - .withArgs(upkeepId, newConfig) - }) - }) - - describe('#setUpkeepTriggerConfig', () => { - const newConfig = '0xdeadbeef' - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepTriggerConfig(upkeepId.add(1), newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(admin).setUpkeepTriggerConfig(upkeepId, newConfig), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry.connect(owner).setUpkeepTriggerConfig(upkeepId, newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('emits a log', async () => { - const tx = await registry - .connect(admin) - .setUpkeepTriggerConfig(upkeepId, newConfig) - await expect(tx) - .to.emit(registry, 'UpkeepTriggerConfigSet') - .withArgs(upkeepId, newConfig) - }) - }) - - describe('#transferUpkeepAdmin', () => { - it('reverts when called by anyone but the current upkeep admin', async () => { - await evmRevertCustomError( - registry - .connect(payee1) - .transferUpkeepAdmin(upkeepId, await payee2.getAddress()), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts when transferring to self', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await admin.getAddress()), - registry, - 'ValueNotChanged', - ) - }) - - it('reverts when the upkeep is cancelled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await keeper1.getAddress()), - registry, - 'UpkeepCancelled', - ) - }) - - it('allows cancelling transfer by reverting to zero address', async () => { - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - const tx = await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, ethers.constants.AddressZero) - - await expect(tx) - .to.emit(registry, 'UpkeepAdminTransferRequested') - .withArgs( - upkeepId, - await admin.getAddress(), - ethers.constants.AddressZero, - ) - }) - - it('does not change the upkeep admin', async () => { - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - const upkeep = await registry.getUpkeep(upkeepId) - assert.equal(await admin.getAddress(), upkeep.admin) - }) - - it('emits an event announcing the new upkeep admin', async () => { - const tx = await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - await expect(tx) - .to.emit(registry, 'UpkeepAdminTransferRequested') - .withArgs(upkeepId, await admin.getAddress(), await payee1.getAddress()) - }) - - it('does not emit an event when called with the same proposed upkeep admin', async () => { - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - const tx = await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - const receipt = await tx.wait() - assert.equal(0, receipt.logs.length) - }) - }) - - describe('#acceptUpkeepAdmin', () => { - beforeEach(async () => { - // Start admin transfer to payee1 - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - }) - - it('reverts when not called by the proposed upkeep admin', async () => { - await evmRevertCustomError( - registry.connect(payee2).acceptUpkeepAdmin(upkeepId), - registry, - 'OnlyCallableByProposedAdmin', - ) - }) - - it('reverts when the upkeep is cancelled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(payee1).acceptUpkeepAdmin(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('does change the admin', async () => { - await registry.connect(payee1).acceptUpkeepAdmin(upkeepId) - - const upkeep = await registry.getUpkeep(upkeepId) - assert.equal(await payee1.getAddress(), upkeep.admin) - }) - - it('emits an event announcing the new upkeep admin', async () => { - const tx = await registry.connect(payee1).acceptUpkeepAdmin(upkeepId) - await expect(tx) - .to.emit(registry, 'UpkeepAdminTransferred') - .withArgs(upkeepId, await admin.getAddress(), await payee1.getAddress()) - }) - }) - - describe('#withdrawOwnerFunds', () => { - it('can only be called by owner', async () => { - await evmRevert( - registry.connect(keeper1).withdrawOwnerFunds(), - 'Only callable by owner', - ) - }) - - itMaybe('withdraws the collected fees to owner', async () => { - await registry.connect(admin).addFunds(upkeepId, toWei('100')) - // Very high min spend, whole balance as cancellation fees - const minUpkeepSpend = toWei('1000') - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - }, - offchainVersion, - offchainBytes, - ) - const upkeepBalance = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = await linkToken.balanceOf(await owner.getAddress()) - - await registry.connect(owner).cancelUpkeep(upkeepId) - - // Transfered to owner balance on registry - let ownerRegistryBalance = (await registry.getState()).state - .ownerLinkBalance - assert.isTrue(ownerRegistryBalance.eq(upkeepBalance)) - - // Now withdraw - await registry.connect(owner).withdrawOwnerFunds() - - ownerRegistryBalance = (await registry.getState()).state.ownerLinkBalance - const ownerAfter = await linkToken.balanceOf(await owner.getAddress()) - - // Owner registry balance should be changed to 0 - assert.isTrue(ownerRegistryBalance.eq(BigNumber.from('0'))) - - // Owner should be credited with the balance - assert.isTrue(ownerBefore.add(upkeepBalance).eq(ownerAfter)) - }) - }) - - describe('#transferPayeeship', () => { - it('reverts when called by anyone but the current payee', async () => { - await evmRevertCustomError( - registry - .connect(payee2) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ), - registry, - 'OnlyCallableByPayee', - ) - }) - - it('reverts when transferring to self', async () => { - await evmRevertCustomError( - registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee1.getAddress(), - ), - registry, - 'ValueNotChanged', - ) - }) - - it('does not change the payee', async () => { - await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - - const info = await registry.getTransmitterInfo(await keeper1.getAddress()) - assert.equal(await payee1.getAddress(), info.payee) - }) - - it('emits an event announcing the new payee', async () => { - const tx = await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - await expect(tx) - .to.emit(registry, 'PayeeshipTransferRequested') - .withArgs( - await keeper1.getAddress(), - await payee1.getAddress(), - await payee2.getAddress(), - ) - }) - - it('does not emit an event when called with the same proposal', async () => { - await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - - const tx = await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - const receipt = await tx.wait() - assert.equal(0, receipt.logs.length) - }) - }) - - describe('#acceptPayeeship', () => { - beforeEach(async () => { - await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - }) - - it('reverts when called by anyone but the proposed payee', async () => { - await evmRevertCustomError( - registry.connect(payee1).acceptPayeeship(await keeper1.getAddress()), - registry, - 'OnlyCallableByProposedPayee', - ) - }) - - it('emits an event announcing the new payee', async () => { - const tx = await registry - .connect(payee2) - .acceptPayeeship(await keeper1.getAddress()) - await expect(tx) - .to.emit(registry, 'PayeeshipTransferred') - .withArgs( - await keeper1.getAddress(), - await payee1.getAddress(), - await payee2.getAddress(), - ) - }) - - it('does change the payee', async () => { - await registry.connect(payee2).acceptPayeeship(await keeper1.getAddress()) - - const info = await registry.getTransmitterInfo(await keeper1.getAddress()) - assert.equal(await payee2.getAddress(), info.payee) - }) - }) - - describe('#pause', () => { - it('reverts if called by a non-owner', async () => { - await evmRevert( - registry.connect(keeper1).pause(), - 'Only callable by owner', - ) - }) - - it('marks the contract as paused', async () => { - assert.isFalse((await registry.getState()).state.paused) - - await registry.connect(owner).pause() - - assert.isTrue((await registry.getState()).state.paused) - }) - - it('Does not allow transmits when paused', async () => { - await registry.connect(owner).pause() - - await evmRevertCustomError( - getTransmitTx(registry, keeper1, [upkeepId]), - registry, - 'RegistryPaused', - ) - }) - - it('Does not allow creation of new upkeeps when paused', async () => { - await registry.connect(owner).pause() - - await evmRevertCustomError( - registry - .connect(owner) - [ - 'registerUpkeep(address,uint32,address,bytes,bytes)' - ](mock.address, performGas, await admin.getAddress(), emptyBytes, '0x'), - registry, - 'RegistryPaused', - ) - }) - }) - - describe('#unpause', () => { - beforeEach(async () => { - await registry.connect(owner).pause() - }) - - it('reverts if called by a non-owner', async () => { - await evmRevert( - registry.connect(keeper1).unpause(), - 'Only callable by owner', - ) - }) - - it('marks the contract as not paused', async () => { - assert.isTrue((await registry.getState()).state.paused) - - await registry.connect(owner).unpause() - - assert.isFalse((await registry.getState()).state.paused) - }) - }) - - describe('#migrateUpkeeps() / #receiveUpkeeps()', async () => { - context('when permissions are set', () => { - beforeEach(async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - await registry.setPeerRegistryMigrationPermission(mgRegistry.address, 1) - await mgRegistry.setPeerRegistryMigrationPermission(registry.address, 2) - }) - - it('migrates an upkeep', async () => { - const offchainBytes = '0x987654abcd' - await registry - .connect(admin) - .setUpkeepOffchainConfig(upkeepId, offchainBytes) - const reg1Upkeep = await registry.getUpkeep(upkeepId) - const forwarderAddress = await registry.getForwarder(upkeepId) - expect(reg1Upkeep.balance).to.equal(toWei('100')) - expect(reg1Upkeep.checkData).to.equal(randomBytes) - expect(forwarderAddress).to.not.equal(ethers.constants.AddressZero) - expect(reg1Upkeep.offchainConfig).to.equal(offchainBytes) - expect((await registry.getState()).state.numUpkeeps).to.equal( - numUpkeeps, - ) - const forwarder = IAutomationForwarderFactory.connect( - forwarderAddress, - owner, - ) - expect(await forwarder.getRegistry()).to.equal(registry.address) - // Set an upkeep admin transfer in progress too - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - // migrate - await registry - .connect(admin) - .migrateUpkeeps([upkeepId], mgRegistry.address) - expect((await registry.getState()).state.numUpkeeps).to.equal( - numUpkeeps - 1, - ) - expect((await mgRegistry.getState()).state.numUpkeeps).to.equal(1) - expect((await registry.getUpkeep(upkeepId)).balance).to.equal(0) - expect((await registry.getUpkeep(upkeepId)).checkData).to.equal('0x') - expect((await mgRegistry.getUpkeep(upkeepId)).balance).to.equal( - toWei('100'), - ) - expect( - (await mgRegistry.getState()).state.expectedLinkBalance, - ).to.equal(toWei('100')) - expect((await mgRegistry.getUpkeep(upkeepId)).checkData).to.equal( - randomBytes, - ) - expect((await mgRegistry.getUpkeep(upkeepId)).offchainConfig).to.equal( - offchainBytes, - ) - expect(await mgRegistry.getForwarder(upkeepId)).to.equal( - forwarderAddress, - ) - // test that registry is updated on forwarder - expect(await forwarder.getRegistry()).to.equal(mgRegistry.address) - // migration will delete the upkeep and nullify admin transfer - await expect( - registry.connect(payee1).acceptUpkeepAdmin(upkeepId), - ).to.be.revertedWithCustomError(registry, 'UpkeepCancelled') - await expect( - mgRegistry.connect(payee1).acceptUpkeepAdmin(upkeepId), - ).to.be.revertedWithCustomError( - mgRegistry, - 'OnlyCallableByProposedAdmin', - ) - }) - - it('migrates a paused upkeep', async () => { - expect((await registry.getUpkeep(upkeepId)).balance).to.equal( - toWei('100'), - ) - expect((await registry.getUpkeep(upkeepId)).checkData).to.equal( - randomBytes, - ) - expect((await registry.getState()).state.numUpkeeps).to.equal( - numUpkeeps, - ) - await registry.connect(admin).pauseUpkeep(upkeepId) - // verify the upkeep is paused - expect((await registry.getUpkeep(upkeepId)).paused).to.equal(true) - // migrate - await registry - .connect(admin) - .migrateUpkeeps([upkeepId], mgRegistry.address) - expect((await registry.getState()).state.numUpkeeps).to.equal( - numUpkeeps - 1, - ) - expect((await mgRegistry.getState()).state.numUpkeeps).to.equal(1) - expect((await registry.getUpkeep(upkeepId)).balance).to.equal(0) - expect((await mgRegistry.getUpkeep(upkeepId)).balance).to.equal( - toWei('100'), - ) - expect((await registry.getUpkeep(upkeepId)).checkData).to.equal('0x') - expect((await mgRegistry.getUpkeep(upkeepId)).checkData).to.equal( - randomBytes, - ) - expect( - (await mgRegistry.getState()).state.expectedLinkBalance, - ).to.equal(toWei('100')) - // verify the upkeep is still paused after migration - expect((await mgRegistry.getUpkeep(upkeepId)).paused).to.equal(true) - }) - - it('emits an event on both contracts', async () => { - expect((await registry.getUpkeep(upkeepId)).balance).to.equal( - toWei('100'), - ) - expect((await registry.getUpkeep(upkeepId)).checkData).to.equal( - randomBytes, - ) - expect((await registry.getState()).state.numUpkeeps).to.equal( - numUpkeeps, - ) - const tx = registry - .connect(admin) - .migrateUpkeeps([upkeepId], mgRegistry.address) - await expect(tx) - .to.emit(registry, 'UpkeepMigrated') - .withArgs(upkeepId, toWei('100'), mgRegistry.address) - await expect(tx) - .to.emit(mgRegistry, 'UpkeepReceived') - .withArgs(upkeepId, toWei('100'), registry.address) - }) - - it('is only migratable by the admin', async () => { - await expect( - registry - .connect(owner) - .migrateUpkeeps([upkeepId], mgRegistry.address), - ).to.be.revertedWithCustomError(registry, 'OnlyCallableByAdmin') - await registry - .connect(admin) - .migrateUpkeeps([upkeepId], mgRegistry.address) - }) - }) - - context('when permissions are not set', () => { - it('reverts', async () => { - // no permissions - await registry.setPeerRegistryMigrationPermission(mgRegistry.address, 0) - await mgRegistry.setPeerRegistryMigrationPermission(registry.address, 0) - await expect(registry.migrateUpkeeps([upkeepId], mgRegistry.address)).to - .be.reverted - // only outgoing permissions - await registry.setPeerRegistryMigrationPermission(mgRegistry.address, 1) - await mgRegistry.setPeerRegistryMigrationPermission(registry.address, 0) - await expect(registry.migrateUpkeeps([upkeepId], mgRegistry.address)).to - .be.reverted - // only incoming permissions - await registry.setPeerRegistryMigrationPermission(mgRegistry.address, 0) - await mgRegistry.setPeerRegistryMigrationPermission(registry.address, 2) - await expect(registry.migrateUpkeeps([upkeepId], mgRegistry.address)).to - .be.reverted - // permissions opposite direction - await registry.setPeerRegistryMigrationPermission(mgRegistry.address, 2) - await mgRegistry.setPeerRegistryMigrationPermission(registry.address, 1) - await expect(registry.migrateUpkeeps([upkeepId], mgRegistry.address)).to - .be.reverted - }) - }) - }) - - describe('#setPayees', () => { - const IGNORE_ADDRESS = '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF' - - it('reverts when not called by the owner', async () => { - await evmRevert( - registry.connect(keeper1).setPayees(payees), - 'Only callable by owner', - ) - }) - - it('reverts with different numbers of payees than transmitters', async () => { - await evmRevertCustomError( - registry.connect(owner).setPayees([...payees, randomAddress()]), - registry, - 'ParameterLengthError', - ) - }) - - it('reverts if the payee is the zero address', async () => { - await blankRegistry.connect(owner).setConfigTypeSafe(...baseConfig) // used to test initial config - - await evmRevertCustomError( - blankRegistry // used to test initial config - .connect(owner) - .setPayees([ethers.constants.AddressZero, ...payees.slice(1)]), - registry, - 'InvalidPayee', - ) - }) - - itMaybe( - 'sets the payees when exisitng payees are zero address', - async () => { - //Initial payees should be zero address - await blankRegistry.connect(owner).setConfigTypeSafe(...baseConfig) // used to test initial config - - for (let i = 0; i < keeperAddresses.length; i++) { - const payee = ( - await blankRegistry.getTransmitterInfo(keeperAddresses[i]) - ).payee // used to test initial config - assert.equal(payee, zeroAddress) - } - - await blankRegistry.connect(owner).setPayees(payees) // used to test initial config - - for (let i = 0; i < keeperAddresses.length; i++) { - const payee = ( - await blankRegistry.getTransmitterInfo(keeperAddresses[i]) - ).payee - assert.equal(payee, payees[i]) - } - }, - ) - - it('does not change the payee if IGNORE_ADDRESS is used as payee', async () => { - const signers = Array.from({ length: 5 }, randomAddress) - const keepers = Array.from({ length: 5 }, randomAddress) - const payees = Array.from({ length: 5 }, randomAddress) - const newTransmitter = randomAddress() - const newPayee = randomAddress() - const ignoreAddresses = new Array(payees.length).fill(IGNORE_ADDRESS) - const newPayees = [...ignoreAddresses, newPayee] - // arbitrum registry - // configure registry with 5 keepers // optimism registry - await blankRegistry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - signers, - keepers, - f, - config, - offchainVersion, - offchainBytes, - ) - // arbitrum registry - // set initial payees // optimism registry - await blankRegistry.connect(owner).setPayees(payees) // used to test initial configurations - // arbitrum registry - // add another keeper // optimism registry - await blankRegistry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - [...signers, randomAddress()], - [...keepers, newTransmitter], - f, - config, - offchainVersion, - offchainBytes, - ) - // arbitrum registry - // update payee list // optimism registry // arbitrum registry - await blankRegistry.connect(owner).setPayees(newPayees) // used to test initial configurations // optimism registry - const ignored = await blankRegistry.getTransmitterInfo(newTransmitter) // used to test initial configurations - assert.equal(newPayee, ignored.payee) - assert.equal(true, ignored.active) - }) - - it('reverts if payee is non zero and owner tries to change payee', async () => { - const newPayees = [randomAddress(), ...payees.slice(1)] - - await evmRevertCustomError( - registry.connect(owner).setPayees(newPayees), - registry, - 'InvalidPayee', - ) - }) - - it('emits events for every payee added and removed', async () => { - const tx = await registry.connect(owner).setPayees(payees) - await expect(tx) - .to.emit(registry, 'PayeesUpdated') - .withArgs(keeperAddresses, payees) - }) - }) - - describe('#cancelUpkeep', () => { - it('reverts if the ID is not valid', async () => { - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId.add(1)), - registry, - 'CannotCancel', - ) - }) - - it('reverts if called by a non-owner/non-admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).cancelUpkeep(upkeepId), - registry, - 'OnlyCallableByOwnerOrAdmin', - ) - }) - - describe('when called by the owner', async () => { - it('sets the registration to invalid immediately', async () => { - const tx = await registry.connect(owner).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - const registration = await registry.getUpkeep(upkeepId) - assert.equal( - registration.maxValidBlocknumber.toNumber(), - receipt.blockNumber, - ) - }) - - it('emits an event', async () => { - const tx = await registry.connect(owner).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - await expect(tx) - .to.emit(registry, 'UpkeepCanceled') - .withArgs(upkeepId, BigNumber.from(receipt.blockNumber)) - }) - - it('immediately prevents upkeep', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - const receipt = await tx.wait() - const cancelledUpkeepReportLogs = - parseCancelledUpkeepReportLogs(receipt) - // exactly 1 CancelledUpkeepReport log should be emitted - assert.equal(cancelledUpkeepReportLogs.length, 1) - }) - - it('does not revert if reverts if called multiple times', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - describe('when called by the owner when the admin has just canceled', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let oldExpiration: BigNumber - - beforeEach(async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - const registration = await registry.getUpkeep(upkeepId) - oldExpiration = registration.maxValidBlocknumber - }) - - it('reverts with proper error', async () => { - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - }) - }) - - describe('when called by the admin', async () => { - it('reverts if called again by the admin', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by the owner after the timeout', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - for (let i = 0; i < cancellationDelay; i++) { - await ethers.provider.send('evm_mine', []) - } - - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('sets the registration to invalid in 50 blocks', async () => { - const tx = await registry.connect(admin).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - const registration = await registry.getUpkeep(upkeepId) - assert.equal( - registration.maxValidBlocknumber.toNumber(), - receipt.blockNumber + 50, - ) - }) - - it('emits an event', async () => { - const tx = await registry.connect(admin).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - await expect(tx) - .to.emit(registry, 'UpkeepCanceled') - .withArgs( - upkeepId, - BigNumber.from(receipt.blockNumber + cancellationDelay), - ) - }) - - it('immediately prevents upkeep', async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - await registry.connect(admin).cancelUpkeep(upkeepId) - - await getTransmitTx(registry, keeper1, [upkeepId]) - - for (let i = 0; i < cancellationDelay; i++) { - await ethers.provider.send('evm_mine', []) - } - - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - - const receipt = await tx.wait() - const cancelledUpkeepReportLogs = - parseCancelledUpkeepReportLogs(receipt) - // exactly 1 CancelledUpkeepReport log should be emitted - assert.equal(cancelledUpkeepReportLogs.length, 1) - }) - - describeMaybe('when an upkeep has been performed', async () => { - beforeEach(async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - await getTransmitTx(registry, keeper1, [upkeepId]) - }) - - it('deducts a cancellation fee from the upkeep and gives to owner', async () => { - const minUpkeepSpend = toWei('10') - - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - }, - offchainVersion, - offchainBytes, - ) - - const payee1Before = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = (await registry.getState()).state.ownerLinkBalance - - const amountSpent = toWei('100').sub(upkeepBefore) - const cancellationFee = minUpkeepSpend.sub(amountSpent) - - await registry.connect(admin).cancelUpkeep(upkeepId) - - const payee1After = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance - const ownerAfter = (await registry.getState()).state.ownerLinkBalance - - // post upkeep balance should be previous balance minus cancellation fee - assert.isTrue(upkeepBefore.sub(cancellationFee).eq(upkeepAfter)) - // payee balance should not change - assert.isTrue(payee1Before.eq(payee1After)) - // owner should receive the cancellation fee - assert.isTrue(ownerAfter.sub(ownerBefore).eq(cancellationFee)) - }) - - it('deducts up to balance as cancellation fee', async () => { - // Very high min spend, should deduct whole balance as cancellation fees - const minUpkeepSpend = toWei('1000') - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - }, - offchainVersion, - offchainBytes, - ) - const payee1Before = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = (await registry.getState()).state.ownerLinkBalance - - await registry.connect(admin).cancelUpkeep(upkeepId) - const payee1After = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const ownerAfter = (await registry.getState()).state.ownerLinkBalance - const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance - - // all upkeep balance is deducted for cancellation fee - assert.equal(0, upkeepAfter.toNumber()) - // payee balance should not change - assert.isTrue(payee1After.eq(payee1Before)) - // all upkeep balance is transferred to the owner - assert.isTrue(ownerAfter.sub(ownerBefore).eq(upkeepBefore)) - }) - - it('does not deduct cancellation fee if more than minUpkeepSpend is spent', async () => { - // Very low min spend, already spent in one perform upkeep - const minUpkeepSpend = BigNumber.from(420) - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - }, - offchainVersion, - offchainBytes, - ) - const payee1Before = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = (await registry.getState()).state.ownerLinkBalance - - await registry.connect(admin).cancelUpkeep(upkeepId) - const payee1After = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const ownerAfter = (await registry.getState()).state.ownerLinkBalance - const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance - - // upkeep does not pay cancellation fee after cancellation because minimum upkeep spent is met - assert.isTrue(upkeepBefore.eq(upkeepAfter)) - // owner balance does not change - assert.isTrue(ownerAfter.eq(ownerBefore)) - // payee balance does not change - assert.isTrue(payee1Before.eq(payee1After)) - }) - }) - }) - }) - - describe('#withdrawPayment', () => { - beforeEach(async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - await getTransmitTx(registry, keeper1, [upkeepId]) - }) - - it('reverts if called by anyone but the payee', async () => { - await evmRevertCustomError( - registry - .connect(payee2) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ), - registry, - 'OnlyCallableByPayee', - ) - }) - - it('reverts if called with the 0 address', async () => { - await evmRevertCustomError( - registry - .connect(payee2) - .withdrawPayment(await keeper1.getAddress(), zeroAddress), - registry, - 'InvalidRecipient', - ) - }) - - it('updates the balances', async () => { - const to = await nonkeeper.getAddress() - const keeperBefore = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const registrationBefore = (await registry.getUpkeep(upkeepId)).balance - const toLinkBefore = await linkToken.balanceOf(to) - const registryLinkBefore = await linkToken.balanceOf(registry.address) - const registryPremiumBefore = (await registry.getState()).state - .totalPremium - const ownerBefore = (await registry.getState()).state.ownerLinkBalance - - // Withdrawing for first time, last collected = 0 - assert.equal(keeperBefore.lastCollected.toString(), '0') - - //// Do the thing - await registry - .connect(payee1) - .withdrawPayment(await keeper1.getAddress(), to) - - const keeperAfter = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const registrationAfter = (await registry.getUpkeep(upkeepId)).balance - const toLinkAfter = await linkToken.balanceOf(to) - const registryLinkAfter = await linkToken.balanceOf(registry.address) - const registryPremiumAfter = (await registry.getState()).state - .totalPremium - const ownerAfter = (await registry.getState()).state.ownerLinkBalance - - // registry total premium should not change - assert.isTrue(registryPremiumBefore.eq(registryPremiumAfter)) - - // Last collected should be updated to premium-change - assert.isTrue( - keeperAfter.lastCollected.eq( - registryPremiumBefore.sub( - registryPremiumBefore.mod(keeperAddresses.length), - ), - ), - ) - - // owner balance should remain unchanged - assert.isTrue(ownerAfter.eq(ownerBefore)) - - assert.isTrue(keeperAfter.balance.eq(BigNumber.from(0))) - assert.isTrue(registrationBefore.eq(registrationAfter)) - assert.isTrue(toLinkBefore.add(keeperBefore.balance).eq(toLinkAfter)) - assert.isTrue( - registryLinkBefore.sub(keeperBefore.balance).eq(registryLinkAfter), - ) - }) - - it('emits a log announcing the withdrawal', async () => { - const balance = ( - await registry.getTransmitterInfo(await keeper1.getAddress()) - ).balance - const tx = await registry - .connect(payee1) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ) - await expect(tx) - .to.emit(registry, 'PaymentWithdrawn') - .withArgs( - await keeper1.getAddress(), - balance, - await nonkeeper.getAddress(), - await payee1.getAddress(), - ) - }) - }) - - describe('#checkCallback', () => { - it('returns false with appropriate failure reason when target callback reverts', async () => { - await streamsLookupUpkeep.setShouldRevertCallback(true) - - const values: any[] = ['0x1234', '0xabcd'] - const res = await registry - .connect(zeroAddress) - .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') - - assert.isFalse(res.upkeepNeeded) - assert.equal(res.performData, '0x') - assert.equal( - res.upkeepFailureReason, - UpkeepFailureReason.CHECK_CALLBACK_REVERTED, - ) - assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - }) - - it('returns false with appropriate failure reason when target callback returns big performData', async () => { - let longBytes = '0x' - for (let i = 0; i <= maxPerformDataSize.toNumber(); i++) { - longBytes += '11' - } - const values: any[] = [longBytes, longBytes] - const res = await registry - .connect(zeroAddress) - .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') - - assert.isFalse(res.upkeepNeeded) - assert.equal(res.performData, '0x') - assert.equal( - res.upkeepFailureReason, - UpkeepFailureReason.PERFORM_DATA_EXCEEDS_LIMIT, - ) - assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - }) - - it('returns false with appropriate failure reason when target callback returns false', async () => { - await streamsLookupUpkeep.setCallbackReturnBool(false) - const values: any[] = ['0x1234', '0xabcd'] - const res = await registry - .connect(zeroAddress) - .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') - - assert.isFalse(res.upkeepNeeded) - assert.equal(res.performData, '0x') - assert.equal( - res.upkeepFailureReason, - UpkeepFailureReason.UPKEEP_NOT_NEEDED, - ) - assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - }) - - it('succeeds with upkeep needed', async () => { - const values: any[] = ['0x1234', '0xabcd'] - - const res = await registry - .connect(zeroAddress) - .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') - const expectedPerformData = ethers.utils.defaultAbiCoder.encode( - ['bytes[]', 'bytes'], - [values, '0x'], - ) - - assert.isTrue(res.upkeepNeeded) - assert.equal(res.performData, expectedPerformData) - assert.equal(res.upkeepFailureReason, UpkeepFailureReason.NONE) - assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used - }) - }) - - describe('#setUpkeepPrivilegeConfig() / #getUpkeepPrivilegeConfig()', () => { - it('reverts when non manager tries to set privilege config', async () => { - await evmRevertCustomError( - registry.connect(payee3).setUpkeepPrivilegeConfig(upkeepId, '0x1234'), - registry, - 'OnlyCallableByUpkeepPrivilegeManager', - ) - }) - - it('returns empty bytes for upkeep privilege config before setting', async () => { - const cfg = await registry.getUpkeepPrivilegeConfig(upkeepId) - assert.equal(cfg, '0x') - }) - - it('allows upkeep manager to set privilege config', async () => { - const tx = await registry - .connect(personas.Norbert) - .setUpkeepPrivilegeConfig(upkeepId, '0x1234') - await expect(tx) - .to.emit(registry, 'UpkeepPrivilegeConfigSet') - .withArgs(upkeepId, '0x1234') - - const cfg = await registry.getUpkeepPrivilegeConfig(upkeepId) - assert.equal(cfg, '0x1234') - }) - }) - - describe('#setAdminPrivilegeConfig() / #getAdminPrivilegeConfig()', () => { - const admin = randomAddress() - - it('reverts when non manager tries to set privilege config', async () => { - await evmRevertCustomError( - registry.connect(payee3).setAdminPrivilegeConfig(admin, '0x1234'), - registry, - 'OnlyCallableByUpkeepPrivilegeManager', - ) - }) - - it('returns empty bytes for upkeep privilege config before setting', async () => { - const cfg = await registry.getAdminPrivilegeConfig(admin) - assert.equal(cfg, '0x') - }) - - it('allows upkeep manager to set privilege config', async () => { - const tx = await registry - .connect(personas.Norbert) - .setAdminPrivilegeConfig(admin, '0x1234') - await expect(tx) - .to.emit(registry, 'AdminPrivilegeConfigSet') - .withArgs(admin, '0x1234') - - const cfg = await registry.getAdminPrivilegeConfig(admin) - assert.equal(cfg, '0x1234') - }) - }) - - describe('transmitterPremiumSplit [ @skip-coverage ]', () => { - beforeEach(async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - }) - - it('splits premium evenly across transmitters', async () => { - // Do a transmit from keeper1 - await getTransmitTx(registry, keeper1, [upkeepId]) - - const registryPremium = (await registry.getState()).state.totalPremium - assert.isTrue(registryPremium.gt(BigNumber.from(0))) - - const premiumPerTransmitter = registryPremium.div( - BigNumber.from(keeperAddresses.length), - ) - const k1Balance = ( - await registry.getTransmitterInfo(await keeper1.getAddress()) - ).balance - // transmitter should be reimbursed for gas and get the premium - assert.isTrue(k1Balance.gt(premiumPerTransmitter)) - const k1GasReimbursement = k1Balance.sub(premiumPerTransmitter) - - const k2Balance = ( - await registry.getTransmitterInfo(await keeper2.getAddress()) - ).balance - // non transmitter should get its share of premium - assert.isTrue(k2Balance.eq(premiumPerTransmitter)) - - // Now do a transmit from keeper 2 - await getTransmitTx(registry, keeper2, [upkeepId]) - const registryPremiumNew = (await registry.getState()).state.totalPremium - assert.isTrue(registryPremiumNew.gt(registryPremium)) - const premiumPerTransmitterNew = registryPremiumNew.div( - BigNumber.from(keeperAddresses.length), - ) - const additionalPremium = premiumPerTransmitterNew.sub( - premiumPerTransmitter, - ) - - const k1BalanceNew = ( - await registry.getTransmitterInfo(await keeper1.getAddress()) - ).balance - // k1 should get the new premium - assert.isTrue( - k1BalanceNew.eq(k1GasReimbursement.add(premiumPerTransmitterNew)), - ) - - const k2BalanceNew = ( - await registry.getTransmitterInfo(await keeper2.getAddress()) - ).balance - // k2 should get gas reimbursement in addition to new premium - assert.isTrue(k2BalanceNew.gt(k2Balance.add(additionalPremium))) - }) - - it('updates last collected upon payment withdrawn', async () => { - // Do a transmit from keeper1 - await getTransmitTx(registry, keeper1, [upkeepId]) - - const registryPremium = (await registry.getState()).state.totalPremium - const k1 = await registry.getTransmitterInfo(await keeper1.getAddress()) - const k2 = await registry.getTransmitterInfo(await keeper2.getAddress()) - - // Withdrawing for first time, last collected = 0 - assert.isTrue(k1.lastCollected.eq(BigNumber.from(0))) - assert.isTrue(k2.lastCollected.eq(BigNumber.from(0))) - - //// Do the thing - await registry - .connect(payee1) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ) - - const k1New = await registry.getTransmitterInfo( - await keeper1.getAddress(), - ) - const k2New = await registry.getTransmitterInfo( - await keeper2.getAddress(), - ) - - // transmitter info lastCollected should be updated for k1, not for k2 - assert.isTrue( - k1New.lastCollected.eq( - registryPremium.sub(registryPremium.mod(keeperAddresses.length)), - ), - ) - assert.isTrue(k2New.lastCollected.eq(BigNumber.from(0))) - }) - - itMaybe( - 'maintains consistent balance information across all parties', - async () => { - // throughout transmits, withdrawals, setConfigs total claim on balances should remain less than expected balance - // some spare change can get lost but it should be less than maxAllowedSpareChange - - let maxAllowedSpareChange = BigNumber.from('0') - await verifyConsistentAccounting(maxAllowedSpareChange) - - await getTransmitTx(registry, keeper1, [upkeepId]) - maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('31')) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry - .connect(payee1) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry - .connect(payee2) - .withdrawPayment( - await keeper2.getAddress(), - await nonkeeper.getAddress(), - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await getTransmitTx(registry, keeper1, [upkeepId]) - maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('31')) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry.connect(owner).setConfigTypeSafe( - signerAddresses.slice(2, 15), // only use 2-14th index keepers - keeperAddresses.slice(2, 15), - f, - config, - offchainVersion, - offchainBytes, - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await getTransmitTx(registry, keeper3, [upkeepId], { - startingSignerIndex: 2, - }) - maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('13')) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry - .connect(payee1) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry - .connect(payee3) - .withdrawPayment( - await keeper3.getAddress(), - await nonkeeper.getAddress(), - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry.connect(owner).setConfigTypeSafe( - signerAddresses.slice(0, 4), // only use 0-3rd index keepers - keeperAddresses.slice(0, 4), - f, - config, - offchainVersion, - offchainBytes, - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - await getTransmitTx(registry, keeper1, [upkeepId]) - maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('4')) - await getTransmitTx(registry, keeper3, [upkeepId]) - maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('4')) - - await verifyConsistentAccounting(maxAllowedSpareChange) - await registry - .connect(payee5) - .withdrawPayment( - await keeper5.getAddress(), - await nonkeeper.getAddress(), - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - - await registry - .connect(payee1) - .withdrawPayment( - await keeper1.getAddress(), - await nonkeeper.getAddress(), - ) - await verifyConsistentAccounting(maxAllowedSpareChange) - }, - ) - }) -}) diff --git a/contracts/test/v0.8/automation/CronUpkeep.test.ts b/contracts/test/v0.8/automation/CronUpkeep.test.ts deleted file mode 100644 index 7b769797f12..00000000000 --- a/contracts/test/v0.8/automation/CronUpkeep.test.ts +++ /dev/null @@ -1,576 +0,0 @@ -import moment from 'moment' -import { ethers } from 'hardhat' -import { Contract } from 'ethers' -import { assert, expect } from 'chai' -import { CronUpkeepTestHelper } from '../../../typechain/CronUpkeepTestHelper' -import { CronUpkeepDelegate } from '../../../typechain/CronUpkeepDelegate' -import { CronUpkeepFactory } from '../../../typechain/CronUpkeepFactory' -import { CronUpkeepTestHelper__factory as CronUpkeepTestHelperFactory } from '../../../typechain/factories/CronUpkeepTestHelper__factory' -import { CronInternalTestHelper } from '../../../typechain/CronInternalTestHelper' -import { CronReceiver } from '../../../typechain/CronReceiver' -import { BigNumber, BigNumberish } from '@ethersproject/bignumber' -import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import { validCrons } from '../../test-helpers/fixtures' -import * as h from '../../test-helpers/helpers' - -const { utils } = ethers -const { AddressZero } = ethers.constants - -const OWNABLE_ERR = 'Only callable by owner' -const CRON_NOT_FOUND_ERR = 'CronJobIDNotFound' - -let cron: CronUpkeepTestHelper -let cronFactory: CronUpkeepTestHelperFactory // the typechain factory that deploys cron upkeep contracts -let cronFactoryContract: CronUpkeepFactory // the cron factory contract -let cronDelegate: CronUpkeepDelegate -let cronTestHelper: CronInternalTestHelper -let cronReceiver1: CronReceiver -let cronReceiver2: CronReceiver - -let admin: SignerWithAddress -let owner: SignerWithAddress -let stranger: SignerWithAddress - -const timeStamp = 32503680000 // Jan 1, 3000 12:00AM -const basicCronString = '0 * * * *' - -let handler1Sig: string -let handler2Sig: string -let revertHandlerSig: string -let basicSpec: string - -async function assertJobIDsEqual(expected: number[]) { - const ids = (await cron.getActiveCronJobIDs()).map((n) => n.toNumber()) - assert.deepEqual(ids.sort(), expected.sort()) -} - -function decodePayload(payload: string) { - return utils.defaultAbiCoder.decode( - ['uint256', 'uint256', 'address', 'bytes'], - payload, - ) as [BigNumber, BigNumber, string, string] -} - -function encodePayload(payload: [BigNumberish, BigNumberish, string, string]) { - return utils.defaultAbiCoder.encode( - ['uint256', 'uint256', 'address', 'bytes'], - payload, - ) -} - -async function createBasicCron() { - return await cron.createCronJobFromEncodedSpec( - cronReceiver1.address, - handler1Sig, - basicSpec, - ) -} - -describe('CronUpkeep', () => { - beforeEach(async () => { - const accounts = await ethers.getSigners() - admin = accounts[0] - owner = accounts[1] - stranger = accounts[2] - const crFactory = await ethers.getContractFactory('CronReceiver', owner) - cronReceiver1 = await crFactory.deploy() - cronReceiver2 = await crFactory.deploy() - const cronDelegateFactory = await ethers.getContractFactory( - 'CronUpkeepDelegate', - admin, - ) - cronDelegate = await cronDelegateFactory.deploy() - const cronExternalFactory = await ethers.getContractFactory( - 'src/v0.8/automation/libraries/external/Cron.sol:Cron', - admin, - ) - const cronExternalLib = await cronExternalFactory.deploy() - cronFactory = await ethers.getContractFactory('CronUpkeepTestHelper', { - signer: admin, - libraries: { Cron: cronExternalLib.address }, - }) - cron = ( - await cronFactory.deploy(owner.address, cronDelegate.address, 5, []) - ).connect(owner) - const cronFactoryContractFactory = await ethers.getContractFactory( - 'CronUpkeepFactory', - { signer: admin, libraries: { Cron: cronExternalLib.address } }, - ) // the typechain factory that creates the cron factory contract - cronFactoryContract = await cronFactoryContractFactory.deploy() - const fs = cronReceiver1.interface.functions - handler1Sig = utils.id(fs['handler1()'].format('sighash')).slice(0, 10) - handler2Sig = utils.id(fs['handler2()'].format('sighash')).slice(0, 10) - revertHandlerSig = utils - .id(fs['revertHandler()'].format('sighash')) - .slice(0, 10) - const cronTHFactory = await ethers.getContractFactory( - 'CronInternalTestHelper', - ) - cronTestHelper = await cronTHFactory.deploy() - basicSpec = await cronFactoryContract.encodeCronString(basicCronString) - }) - - afterEach(async () => { - await h.reset() - }) - - it('has a limited public ABI [ @skip-coverage ]', () => { - // Casting cron is necessary due to a tricky versioning mismatch issue, likely between ethers - // and typechain. Remove once the version issue is resolved. - // https://smartcontract-it.atlassian.net/browse/ARCHIVE-22094 - h.publicAbi(cron as unknown as Contract, [ - 's_maxJobs', - 'performUpkeep', - 'createCronJobFromEncodedSpec', - 'updateCronJob', - 'deleteCronJob', - 'checkUpkeep', - 'getActiveCronJobIDs', - 'getCronJob', - // Ownable methods: - 'acceptOwnership', - 'owner', - 'transferOwnership', - // Pausable methods - 'paused', - 'pause', - 'unpause', - // Cron helper methods - 'createCronJobFromString', - 'txCheckUpkeep', - ]) - }) - - describe('constructor()', () => { - it('sets the initial values', async () => { - expect(await cron.owner()).to.equal(owner.address) - expect(await cron.s_maxJobs()).to.equal(5) - }) - - it('optionally creates a first job', async () => { - const payload = await cronFactoryContract.encodeCronJob( - cronReceiver1.address, - handler1Sig, - basicCronString, - ) - cron = ( - await cronFactory.deploy( - owner.address, - cronDelegate.address, - 5, - payload, - ) - ).connect(owner) - const job = await cron.getCronJob(1) - assert.equal(job.target, cronReceiver1.address) - assert.equal(job.handler, handler1Sig) - assert.equal(job.cronString, basicCronString) - }) - }) - - describe('checkUpkeep() / performUpkeep()', () => { - beforeEach(async () => { - await h.setTimestamp(timeStamp) - // id 1 - await cron.createCronJobFromString( - cronReceiver1.address, - handler1Sig, - '0 0 31 * *', // 31st day of every month - ) - // id 2 - await cron.createCronJobFromString( - cronReceiver1.address, - handler2Sig, - '10 * * * *', // on the 10 min mark - ) - // id 3 - await cron.createCronJobFromString( - cronReceiver2.address, - handler1Sig, - '0 0 * 7 *', // every day in July - ) - // id 4 - await cron.createCronJobFromString( - cronReceiver2.address, - revertHandlerSig, - '20 * * * *', // on the 20 min mark - ) - }) - - describe('checkUpkeep()', () => { - it('returns false if no one is elligible', async () => { - const [needsUpkeep] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isFalse(needsUpkeep) - }) - - it('returns the id of eligible cron jobs', async () => { - await h.fastForward(moment.duration(11, 'minutes').asSeconds()) - const [needsUpkeep, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isTrue(needsUpkeep) - const [id, ..._] = decodePayload(payload) - assert.equal(id.toNumber(), 2) - }) - - describe('when mutiple crons are elligible', () => { - it('cycles through the cron IDs based on block number', async () => { - await h.fastForward(moment.duration(1, 'year').asSeconds()) - let [_, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - const [id1] = decodePayload(payload) - await h.mineBlock(ethers.provider) - ;[_, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - const [id2] = decodePayload(payload) - await h.mineBlock(ethers.provider) - ;[_, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - const [id3] = decodePayload(payload) - await h.mineBlock(ethers.provider) - ;[_, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - const [id4] = decodePayload(payload) - assert.deepEqual( - [id1, id2, id3, id4].map((n) => n.toNumber()).sort(), - [1, 2, 3, 4], - ) - }) - }) - }) - - describe('performUpkeep()', () => { - it('forwards the call to the appropriate target/handler', async () => { - await h.fastForward(moment.duration(11, 'minutes').asSeconds()) - const [needsUpkeep, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isTrue(needsUpkeep) - await expect(cron.performUpkeep(payload)).to.emit( - cronReceiver1, - 'Received2', - ) - }) - - it('emits an event', async () => { - await h.fastForward(moment.duration(11, 'minutes').asSeconds()) - const [needsUpkeep, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isTrue(needsUpkeep) - await expect(cron.performUpkeep(payload)) - .to.emit(cron, 'CronJobExecuted') - .withArgs(2, true) - }) - - it('succeeds even if the call to the target fails', async () => { - await cron.deleteCronJob(2) - await h.fastForward(moment.duration(21, 'minutes').asSeconds()) - const payload = encodePayload([ - 4, - moment.unix(timeStamp).add(20, 'minutes').unix(), - cronReceiver2.address, - revertHandlerSig, - ]) - await expect(cron.performUpkeep(payload)) - .to.emit(cron, 'CronJobExecuted') - .withArgs(4, false) - }) - - it('is only callable by anyone', async () => { - await h.fastForward(moment.duration(11, 'minutes').asSeconds()) - const [needsUpkeep, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isTrue(needsUpkeep) - await cron.connect(stranger).performUpkeep(payload) - }) - - it('is only callable once for a given tick', async () => { - await h.fastForward(moment.duration(10, 'minutes').asSeconds()) - const [needsUpkeep, payload] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isTrue(needsUpkeep) - const maliciousPayload = encodePayload([ - 2, - moment.unix(timeStamp).add(10, 'minutes').add(59, 'seconds').unix(), - cronReceiver1.address, - handler2Sig, - ]) - await cron.performUpkeep(payload) - await expect(cron.performUpkeep(payload)).to.be.reverted - await expect(cron.performUpkeep(maliciousPayload)).to.be.reverted - await h.fastForward(moment.duration(1, 'minute').asSeconds()) - await expect(cron.performUpkeep(payload)).to.be.reverted - await expect(cron.performUpkeep(maliciousPayload)).to.be.reverted - await h.fastForward(moment.duration(10, 'minute').asSeconds()) - await expect(cron.performUpkeep(payload)).to.be.reverted - await expect(cron.performUpkeep(maliciousPayload)).to.be.reverted - }) - }) - }) - - describe('createCronJobFromEncodedSpec()', () => { - it('creates jobs with sequential IDs', async () => { - const cronString1 = '0 * * * *' - const cronString2 = '0 1,2,3 */4 5-6 1-2' - const encodedSpec1 = - await cronFactoryContract.encodeCronString(cronString1) - const encodedSpec2 = - await cronFactoryContract.encodeCronString(cronString2) - const nextTick1 = ( - await cronTestHelper.calculateNextTick(cronString1) - ).toNumber() - const nextTick2 = ( - await cronTestHelper.calculateNextTick(cronString2) - ).toNumber() - await cron.createCronJobFromEncodedSpec( - cronReceiver1.address, - handler1Sig, - encodedSpec1, - ) - await assertJobIDsEqual([1]) - await cron.createCronJobFromEncodedSpec( - cronReceiver1.address, - handler2Sig, - encodedSpec1, - ) - await assertJobIDsEqual([1, 2]) - await cron.createCronJobFromEncodedSpec( - cronReceiver2.address, - handler1Sig, - encodedSpec2, - ) - await assertJobIDsEqual([1, 2, 3]) - await cron.createCronJobFromEncodedSpec( - cronReceiver2.address, - handler2Sig, - encodedSpec2, - ) - await assertJobIDsEqual([1, 2, 3, 4]) - const cron1 = await cron.getCronJob(1) - const cron2 = await cron.getCronJob(2) - const cron3 = await cron.getCronJob(3) - const cron4 = await cron.getCronJob(4) - assert.equal(cron1.target, cronReceiver1.address) - assert.equal(cron1.handler, handler1Sig) - assert.equal(cron1.cronString, cronString1) - assert.equal(cron1.nextTick.toNumber(), nextTick1) - assert.equal(cron2.target, cronReceiver1.address) - assert.equal(cron2.handler, handler2Sig) - assert.equal(cron2.cronString, cronString1) - assert.equal(cron2.nextTick.toNumber(), nextTick1) - assert.equal(cron3.target, cronReceiver2.address) - assert.equal(cron3.handler, handler1Sig) - assert.equal(cron3.cronString, cronString2) - assert.equal(cron3.nextTick.toNumber(), nextTick2) - assert.equal(cron4.target, cronReceiver2.address) - assert.equal(cron4.handler, handler2Sig) - assert.equal(cron4.cronString, cronString2) - assert.equal(cron4.nextTick.toNumber(), nextTick2) - }) - - it('emits an event', async () => { - await expect(createBasicCron()).to.emit(cron, 'CronJobCreated') - }) - - it('is only callable by the owner', async () => { - await expect( - cron - .connect(stranger) - .createCronJobFromEncodedSpec( - cronReceiver1.address, - handler1Sig, - basicSpec, - ), - ).to.be.revertedWith(OWNABLE_ERR) - }) - - it('errors if trying to create more jobs than allowed', async () => { - for (let idx = 0; idx < 5; idx++) { - await createBasicCron() - } - await expect(createBasicCron()).to.be.revertedWithCustomError( - cron, - 'ExceedsMaxJobs', - ) - }) - }) - - describe('updateCronJob()', () => { - const newCronString = '0 0 1 1 1' - let newEncodedSpec: string - beforeEach(async () => { - await createBasicCron() - newEncodedSpec = await cronFactoryContract.encodeCronString(newCronString) - }) - - it('updates a cron job', async () => { - let cron1 = await cron.getCronJob(1) - assert.equal(cron1.target, cronReceiver1.address) - assert.equal(cron1.handler, handler1Sig) - assert.equal(cron1.cronString, basicCronString) - await cron.updateCronJob( - 1, - cronReceiver2.address, - handler2Sig, - newEncodedSpec, - ) - cron1 = await cron.getCronJob(1) - assert.equal(cron1.target, cronReceiver2.address) - assert.equal(cron1.handler, handler2Sig) - assert.equal(cron1.cronString, newCronString) - }) - - it('emits an event', async () => { - await expect( - await cron.updateCronJob( - 1, - cronReceiver2.address, - handler2Sig, - newEncodedSpec, - ), - ).to.emit(cron, 'CronJobUpdated') - }) - - it('is only callable by the owner', async () => { - await expect( - cron - .connect(stranger) - .updateCronJob(1, cronReceiver2.address, handler2Sig, newEncodedSpec), - ).to.be.revertedWith(OWNABLE_ERR) - }) - - it('reverts if trying to update a non-existent ID', async () => { - await expect( - cron.updateCronJob( - 2, - cronReceiver2.address, - handler2Sig, - newEncodedSpec, - ), - ).to.be.revertedWithCustomError(cron, CRON_NOT_FOUND_ERR) - }) - }) - - describe('deleteCronJob()', () => { - it("deletes a jobs by it's ID", async () => { - await createBasicCron() - await createBasicCron() - await createBasicCron() - await createBasicCron() - await assertJobIDsEqual([1, 2, 3, 4]) - await cron.deleteCronJob(2) - await expect(cron.getCronJob(2)).to.be.revertedWithCustomError( - cron, - CRON_NOT_FOUND_ERR, - ) - await expect(cron.deleteCronJob(2)).to.be.revertedWithCustomError( - cron, - CRON_NOT_FOUND_ERR, - ) - await assertJobIDsEqual([1, 3, 4]) - await cron.deleteCronJob(1) - await assertJobIDsEqual([3, 4]) - await cron.deleteCronJob(4) - await assertJobIDsEqual([3]) - await cron.deleteCronJob(3) - await assertJobIDsEqual([]) - }) - - it('emits an event', async () => { - await createBasicCron() - await expect(cron.deleteCronJob(1)).to.emit(cron, 'CronJobDeleted') - }) - - it('reverts if trying to delete a non-existent ID', async () => { - await createBasicCron() - await createBasicCron() - await expect(cron.deleteCronJob(0)).to.be.revertedWithCustomError( - cron, - CRON_NOT_FOUND_ERR, - ) - await expect(cron.deleteCronJob(3)).to.be.revertedWithCustomError( - cron, - CRON_NOT_FOUND_ERR, - ) - }) - }) - - describe('pause() / unpause()', () => { - it('is only callable by the owner', async () => { - await expect(cron.connect(stranger).pause()).to.be.reverted - await expect(cron.connect(stranger).unpause()).to.be.reverted - }) - - it('pauses / unpauses the contract', async () => { - expect(await cron.paused()).to.be.false - await cron.pause() - expect(await cron.paused()).to.be.true - await cron.unpause() - expect(await cron.paused()).to.be.false - }) - }) -}) - -// only run during pnpm test:gas -describe.skip('Cron Gas Usage', () => { - before(async () => { - const accounts = await ethers.getSigners() - admin = accounts[0] - owner = accounts[1] - const crFactory = await ethers.getContractFactory('CronReceiver', owner) - cronReceiver1 = await crFactory.deploy() - const cronDelegateFactory = await ethers.getContractFactory( - 'CronUpkeepDelegate', - owner, - ) - const cronDelegate = await cronDelegateFactory.deploy() - const cronExternalFactory = await ethers.getContractFactory( - 'src/v0.8/automation/libraries/external/Cron.sol:Cron', - admin, - ) - const cronExternalLib = await cronExternalFactory.deploy() - const cronFactory = await ethers.getContractFactory( - 'CronUpkeepTestHelper', - { - signer: owner, - libraries: { Cron: cronExternalLib.address }, - }, - ) - cron = await cronFactory.deploy(owner.address, cronDelegate.address, 5, []) - const fs = cronReceiver1.interface.functions - handler1Sig = utils - .id(fs['handler1()'].format('sighash')) // TODO this seems like an ethers bug - .slice(0, 10) - }) - - describe('checkUpkeep() / performUpkeep()', () => { - it('uses gas', async () => { - for (let idx = 0; idx < validCrons.length; idx++) { - const cronString = validCrons[idx] - const cronID = idx + 1 - await cron.createCronJobFromString( - cronReceiver1.address, - handler1Sig, - cronString, - ) - await h.fastForward(moment.duration(100, 'years').asSeconds()) // long enough that at least 1 tick occurs - const [needsUpkeep, data] = await cron - .connect(AddressZero) - .callStatic.checkUpkeep('0x') - assert.isTrue(needsUpkeep, `failed for cron string ${cronString}`) - await cron.txCheckUpkeep('0x') - await cron.performUpkeep(data) - await cron.deleteCronJob(cronID) - } - }) - }) -}) diff --git a/contracts/test/v0.8/automation/CronUpkeepFactory.test.ts b/contracts/test/v0.8/automation/CronUpkeepFactory.test.ts deleted file mode 100644 index e9a7de837b7..00000000000 --- a/contracts/test/v0.8/automation/CronUpkeepFactory.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { ethers } from 'hardhat' -import { Contract } from 'ethers' -import { assert, expect } from 'chai' -import { CronUpkeepFactory } from '../../../typechain/CronUpkeepFactory' -import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import * as h from '../../test-helpers/helpers' -import { reset } from '../../test-helpers/helpers' - -const OWNABLE_ERR = 'Only callable by owner' - -let cronExternalLib: Contract -let factory: CronUpkeepFactory - -let admin: SignerWithAddress -let owner: SignerWithAddress -let stranger: SignerWithAddress - -describe('CronUpkeepFactory', () => { - beforeEach(async () => { - const accounts = await ethers.getSigners() - admin = accounts[0] - owner = accounts[1] - stranger = accounts[2] - const cronExternalFactory = await ethers.getContractFactory( - 'src/v0.8/automation/libraries/external/Cron.sol:Cron', - admin, - ) - cronExternalLib = await cronExternalFactory.deploy() - const cronUpkeepFactoryFactory = await ethers.getContractFactory( - 'CronUpkeepFactory', - { - signer: admin, - libraries: { - Cron: cronExternalLib.address, - }, - }, - ) - factory = await cronUpkeepFactoryFactory.deploy() - }) - - afterEach(async () => { - await reset() - }) - - it('has a limited public ABI [ @skip-coverage ]', () => { - h.publicAbi(factory as unknown as Contract, [ - 's_maxJobs', - 'newCronUpkeep', - 'newCronUpkeepWithJob', - 'setMaxJobs', - 'cronDelegateAddress', - 'encodeCronString', - 'encodeCronJob', - // Ownable methods: - 'acceptOwnership', - 'owner', - 'transferOwnership', - ]) - }) - - describe('constructor()', () => { - it('deploys a delegate contract', async () => { - assert.notEqual( - await factory.cronDelegateAddress(), - ethers.constants.AddressZero, - ) - }) - }) - - describe('newCronUpkeep()', () => { - it('emits an event', async () => { - await expect(factory.connect(owner).newCronUpkeep()).to.emit( - factory, - 'NewCronUpkeepCreated', - ) - }) - it('sets the deployer as the owner', async () => { - const response = await factory.connect(owner).newCronUpkeep() - const { events } = await response.wait() - if (!events) { - assert.fail('no events emitted') - } - const upkeepAddress = events[0].args?.upkeep - const cronUpkeepFactory = await ethers.getContractFactory('CronUpkeep', { - libraries: { Cron: cronExternalLib.address }, - }) - assert( - await cronUpkeepFactory.attach(upkeepAddress).owner(), - owner.address, - ) - }) - }) - - describe('setMaxJobs()', () => { - it('sets the max jobs value', async () => { - expect(await factory.s_maxJobs()).to.equal(5) - await factory.setMaxJobs(6) - expect(await factory.s_maxJobs()).to.equal(6) - }) - - it('is only callable by the owner', async () => { - await expect(factory.connect(stranger).setMaxJobs(6)).to.be.revertedWith( - OWNABLE_ERR, - ) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/ERC20BalanceMonitor.test.ts b/contracts/test/v0.8/automation/ERC20BalanceMonitor.test.ts deleted file mode 100644 index 2d5d113abca..00000000000 --- a/contracts/test/v0.8/automation/ERC20BalanceMonitor.test.ts +++ /dev/null @@ -1,695 +0,0 @@ -import { ethers } from 'hardhat' -import { assert, expect } from 'chai' -import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import { ReceiveEmitter } from '../../../typechain/ReceiveEmitter' -import { ReceiveFallbackEmitter } from '../../../typechain/ReceiveFallbackEmitter' -import * as h from '../../test-helpers/helpers' -import { ERC20BalanceMonitorExposed, LinkToken } from '../../../typechain' -import { BigNumber } from 'ethers' - -const OWNABLE_ERR = 'Only callable by owner' -const INVALID_WATCHLIST_ERR = `InvalidWatchList` -const PAUSED_ERR = 'Pausable: paused' -const ONLY_KEEPER_ERR = `OnlyKeeperRegistry` - -const zeroLINK = ethers.utils.parseEther('0') -const oneLINK = ethers.utils.parseEther('1') -const twoLINK = ethers.utils.parseEther('2') -const threeLINK = ethers.utils.parseEther('3') -const fiveLINK = ethers.utils.parseEther('5') -const sixLINK = ethers.utils.parseEther('6') -const tenLINK = ethers.utils.parseEther('10') - -const oneHundredLINK = ethers.utils.parseEther('100') - -const watchAddress1 = ethers.Wallet.createRandom().address -const watchAddress2 = ethers.Wallet.createRandom().address -const watchAddress3 = ethers.Wallet.createRandom().address -const watchAddress4 = ethers.Wallet.createRandom().address -let watchAddress5: string -let watchAddress6: string - -let bm: ERC20BalanceMonitorExposed -let lt: LinkToken -let receiveEmitter: ReceiveEmitter -let receiveFallbackEmitter: ReceiveFallbackEmitter -let owner: SignerWithAddress -let stranger: SignerWithAddress -let keeperRegistry: SignerWithAddress - -async function assertWatchlistBalances( - balance1: BigNumber, - balance2: BigNumber, - balance3: BigNumber, - balance4: BigNumber, - balance5: BigNumber, - balance6: BigNumber, -) { - await h.assertLinkTokenBalance(lt, watchAddress1, balance1, 'address 1') - await h.assertLinkTokenBalance(lt, watchAddress2, balance2, 'address 2') - await h.assertLinkTokenBalance(lt, watchAddress3, balance3, 'address 3') - await h.assertLinkTokenBalance(lt, watchAddress4, balance4, 'address 4') - await h.assertLinkTokenBalance(lt, watchAddress5, balance5, 'address 5') - await h.assertLinkTokenBalance(lt, watchAddress6, balance6, 'address 6') -} - -describe('ERC20BalanceMonitor', () => { - beforeEach(async () => { - const accounts = await ethers.getSigners() - owner = accounts[0] - stranger = accounts[1] - keeperRegistry = accounts[2] - watchAddress5 = accounts[3].address - watchAddress6 = accounts[4].address - - const bmFactory = await ethers.getContractFactory( - 'ERC20BalanceMonitorExposed', - owner, - ) - const ltFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - owner, - ) - const reFactory = await ethers.getContractFactory('ReceiveEmitter', owner) - const rfeFactory = await ethers.getContractFactory( - 'ReceiveFallbackEmitter', - owner, - ) - - lt = await ltFactory.deploy() - bm = await bmFactory.deploy(lt.address, keeperRegistry.address, 0) - - for (let i = 1; i <= 4; i++) { - const recipient = await accounts[i].getAddress() - await lt.connect(owner).transfer(recipient, oneHundredLINK) - } - - receiveEmitter = await reFactory.deploy() - receiveFallbackEmitter = await rfeFactory.deploy() - await Promise.all([ - bm.deployed(), - receiveEmitter.deployed(), - receiveFallbackEmitter.deployed(), - ]) - }) - - afterEach(async () => { - await h.reset() - }) - - describe('add funds', () => { - it('Should allow anyone to add funds', async () => { - await lt.transfer(bm.address, oneLINK) - await lt.connect(stranger).transfer(bm.address, oneLINK) - }) - }) - - describe('withdraw()', () => { - beforeEach(async () => { - const tx = await lt.connect(owner).transfer(bm.address, oneLINK) - await tx.wait() - }) - - it('Should allow the owner to withdraw', async () => { - const beforeBalance = await lt.balanceOf(owner.address) - const tx = await bm.connect(owner).withdraw(oneLINK, owner.address) - await tx.wait() - const afterBalance = await lt.balanceOf(owner.address) - assert.isTrue( - afterBalance.gt(beforeBalance), - 'balance did not increase after withdraw', - ) - }) - - it('Should emit an event', async () => { - const tx = await bm.connect(owner).withdraw(oneLINK, owner.address) - await expect(tx) - .to.emit(bm, 'FundsWithdrawn') - .withArgs(oneLINK, owner.address) - }) - - it('Should allow the owner to withdraw to anyone', async () => { - const beforeBalance = await lt.balanceOf(stranger.address) - const tx = await bm.connect(owner).withdraw(oneLINK, stranger.address) - await tx.wait() - const afterBalance = await lt.balanceOf(stranger.address) - assert.isTrue( - beforeBalance.add(oneLINK).eq(afterBalance), - 'balance did not increase after withdraw', - ) - }) - - it('Should not allow strangers to withdraw', async () => { - const tx = bm.connect(stranger).withdraw(oneLINK, owner.address) - await expect(tx).to.be.revertedWith(OWNABLE_ERR) - }) - }) - - describe('pause() / unpause()', () => { - it('Should allow owner to pause / unpause', async () => { - const pauseTx = await bm.connect(owner).pause() - await pauseTx.wait() - const unpauseTx = await bm.connect(owner).unpause() - await unpauseTx.wait() - }) - - it('Should not allow strangers to pause / unpause', async () => { - const pauseTxStranger = bm.connect(stranger).pause() - await expect(pauseTxStranger).to.be.revertedWith(OWNABLE_ERR) - const pauseTxOwner = await bm.connect(owner).pause() - await pauseTxOwner.wait() - const unpauseTxStranger = bm.connect(stranger).unpause() - await expect(unpauseTxStranger).to.be.revertedWith(OWNABLE_ERR) - }) - }) - - describe('setWatchList() / getWatchList() / getAccountInfo()', () => { - it('Should allow owner to set the watchlist', async () => { - // should start unactive - assert.isFalse((await bm.getAccountInfo(watchAddress1)).isActive) - // add first watchlist - let setTx = await bm - .connect(owner) - .setWatchList([watchAddress1], [oneLINK], [twoLINK]) - await setTx.wait() - let watchList = await bm.getWatchList() - assert.deepEqual(watchList, [watchAddress1]) - const accountInfo = await bm.getAccountInfo(watchAddress1) - assert.isTrue(accountInfo.isActive) - expect(accountInfo.minBalance).to.equal(oneLINK) - expect(accountInfo.topUpLevel).to.equal(twoLINK) - // add more to watchlist - setTx = await bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress3], - [oneLINK, twoLINK, threeLINK], - [twoLINK, threeLINK, fiveLINK], - ) - await setTx.wait() - watchList = await bm.getWatchList() - assert.deepEqual(watchList, [watchAddress1, watchAddress2, watchAddress3]) - let accountInfo1 = await bm.getAccountInfo(watchAddress1) - let accountInfo2 = await bm.getAccountInfo(watchAddress2) - let accountInfo3 = await bm.getAccountInfo(watchAddress3) - expect(accountInfo1.isActive).to.be.true - expect(accountInfo1.minBalance).to.equal(oneLINK) - expect(accountInfo1.topUpLevel).to.equal(twoLINK) - expect(accountInfo2.isActive).to.be.true - expect(accountInfo2.minBalance).to.equal(twoLINK) - expect(accountInfo2.topUpLevel).to.equal(threeLINK) - expect(accountInfo3.isActive).to.be.true - expect(accountInfo3.minBalance).to.equal(threeLINK) - expect(accountInfo3.topUpLevel).to.equal(fiveLINK) - // remove some from watchlist - setTx = await bm - .connect(owner) - .setWatchList( - [watchAddress3, watchAddress1], - [threeLINK, oneLINK], - [fiveLINK, twoLINK], - ) - await setTx.wait() - watchList = await bm.getWatchList() - assert.deepEqual(watchList, [watchAddress3, watchAddress1]) - accountInfo1 = await bm.getAccountInfo(watchAddress1) - accountInfo2 = await bm.getAccountInfo(watchAddress2) - accountInfo3 = await bm.getAccountInfo(watchAddress3) - expect(accountInfo1.isActive).to.be.true - expect(accountInfo2.isActive).to.be.false - expect(accountInfo3.isActive).to.be.true - }) - - it('Should not allow duplicates in the watchlist', async () => { - const errMsg = `DuplicateAddress` - const setTx = bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress1], - [oneLINK, twoLINK, threeLINK], - [twoLINK, threeLINK, fiveLINK], - ) - await expect(setTx) - .to.be.revertedWithCustomError(bm, errMsg) - .withArgs(watchAddress1) - }) - - it('Should not allow a topUpLevel les than or equal to minBalance in the watchlist', async () => { - const setTx = bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress1], - [oneLINK, twoLINK, threeLINK], - [zeroLINK, twoLINK, threeLINK], - ) - await expect(setTx).to.be.revertedWithCustomError( - bm, - INVALID_WATCHLIST_ERR, - ) - }) - - it('Should not allow larger than maximum watchlist size', async () => { - const watchlist: any[][] = [[], [], []] - Array.from(Array(301).keys()).forEach(() => { - watchlist[0].push(owner.address) - watchlist[1].push(oneLINK) - watchlist[2].push(twoLINK) - }) - const tx = bm - .connect(owner) - .setWatchList(watchlist[0], watchlist[1], watchlist[2]) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - - it('Should not allow strangers to set the watchlist', async () => { - const setTxStranger = bm - .connect(stranger) - .setWatchList([watchAddress1], [oneLINK], [twoLINK]) - await expect(setTxStranger).to.be.revertedWith(OWNABLE_ERR) - }) - - it('Should revert if the list lengths differ', async () => { - let tx = bm.connect(owner).setWatchList([watchAddress1], [], [twoLINK]) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - tx = bm.connect(owner).setWatchList([watchAddress1], [oneLINK], []) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - tx = bm.connect(owner).setWatchList([], [oneLINK], [twoLINK]) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - - it('Should revert if any of the addresses are empty', async () => { - let tx = bm - .connect(owner) - .setWatchList( - [watchAddress1, ethers.constants.AddressZero], - [oneLINK, oneLINK], - [twoLINK, twoLINK], - ) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - - it('Should revert if any of the top up amounts are 0', async () => { - const tx = bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2], - [oneLINK, oneLINK], - [twoLINK, zeroLINK], - ) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - }) - - describe('getKeeperRegistryAddress() / setKeeperRegistryAddress()', () => { - const newAddress = ethers.Wallet.createRandom().address - - it('Should initialize with the registry address provided to the constructor', async () => { - const address = await bm.getKeeperRegistryAddress() - assert.equal(address, keeperRegistry.address) - }) - - it('Should allow the owner to set the registry address', async () => { - const setTx = await bm.connect(owner).setKeeperRegistryAddress(newAddress) - await setTx.wait() - const address = await bm.getKeeperRegistryAddress() - assert.equal(address, newAddress) - }) - - it('Should not allow strangers to set the registry address', async () => { - const setTx = bm.connect(stranger).setKeeperRegistryAddress(newAddress) - await expect(setTx).to.be.revertedWith(OWNABLE_ERR) - }) - - it('Should emit an event', async () => { - const setTx = await bm.connect(owner).setKeeperRegistryAddress(newAddress) - await expect(setTx) - .to.emit(bm, 'KeeperRegistryAddressUpdated') - .withArgs(keeperRegistry.address, newAddress) - }) - }) - - describe('getMinWaitPeriodSeconds / setMinWaitPeriodSeconds()', () => { - const newWaitPeriod = BigNumber.from(1) - - it('Should initialize with the wait period provided to the constructor', async () => { - const minWaitPeriod = await bm.getMinWaitPeriodSeconds() - expect(minWaitPeriod).to.equal(0) - }) - - it('Should allow owner to set the wait period', async () => { - const setTx = await bm - .connect(owner) - .setMinWaitPeriodSeconds(newWaitPeriod) - await setTx.wait() - const minWaitPeriod = await bm.getMinWaitPeriodSeconds() - expect(minWaitPeriod).to.equal(newWaitPeriod) - }) - - it('Should not allow strangers to set the wait period', async () => { - const setTx = bm.connect(stranger).setMinWaitPeriodSeconds(newWaitPeriod) - await expect(setTx).to.be.revertedWith(OWNABLE_ERR) - }) - - it('Should emit an event', async () => { - const setTx = await bm - .connect(owner) - .setMinWaitPeriodSeconds(newWaitPeriod) - await expect(setTx) - .to.emit(bm, 'MinWaitPeriodUpdated') - .withArgs(0, newWaitPeriod) - }) - }) - - describe('checkUpkeep() / getUnderfundedAddresses()', () => { - beforeEach(async () => { - const setTx = await bm.connect(owner).setWatchList( - [ - watchAddress1, // needs funds - watchAddress5, // funded - watchAddress2, // needs funds - watchAddress6, // funded - watchAddress3, // needs funds - ], - new Array(5).fill(oneLINK), - new Array(5).fill(twoLINK), - ) - await setTx.wait() - }) - - it('Should return list of address that are underfunded', async () => { - const fundTx = await lt.connect(owner).transfer( - bm.address, - sixLINK, // needs 6 total - ) - await fundTx.wait() - const [should, payload] = await bm.checkUpkeep('0x') - assert.isTrue(should) - let [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - assert.deepEqual(addresses, [watchAddress1, watchAddress2, watchAddress3]) - // checkUpkeep payload should match getUnderfundedAddresses() - addresses = await bm.getUnderfundedAddresses() - assert.deepEqual(addresses, [watchAddress1, watchAddress2, watchAddress3]) - }) - - it('Should return some results even if contract cannot fund all eligible targets', async () => { - const fundTx = await lt.connect(owner).transfer( - bm.address, - fiveLINK, // needs 6 total - ) - await fundTx.wait() - const [should, payload] = await bm.checkUpkeep('0x') - assert.isTrue(should) - const [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - assert.deepEqual(addresses, [watchAddress1, watchAddress2]) - }) - - it('Should omit addresses that have been funded recently', async () => { - const setWaitPdTx = await bm.setMinWaitPeriodSeconds(3600) // 1 hour - const fundTx = await lt.connect(owner).transfer(bm.address, sixLINK) - await Promise.all([setWaitPdTx.wait(), fundTx.wait()]) - const block = await ethers.provider.getBlock('latest') - const setTopUpTx = await bm.setLastTopUpXXXTestOnly( - watchAddress2, - block.timestamp - 100, - ) - await setTopUpTx.wait() - const [should, payload] = await bm.checkUpkeep('0x') - assert.isTrue(should) - const [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - assert.deepEqual(addresses, [watchAddress1, watchAddress3]) - }) - - it('Should revert when paused', async () => { - const tx = await bm.connect(owner).pause() - await tx.wait() - const ethCall = bm.checkUpkeep('0x') - await expect(ethCall).to.be.revertedWith(PAUSED_ERR) - }) - }) - - describe('performUpkeep()', () => { - let validPayload: string - let invalidPayload: string - - beforeEach(async () => { - validPayload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [[watchAddress1, watchAddress2, watchAddress3]], - ) - invalidPayload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [[watchAddress1, watchAddress2, watchAddress4, watchAddress5]], - ) - const setTx = await bm.connect(owner).setWatchList( - [ - watchAddress1, // needs funds - watchAddress5, // funded - watchAddress2, // needs funds - watchAddress6, // funded - watchAddress3, // needs funds - // watchAddress4 - omitted - ], - new Array(5).fill(oneLINK), - new Array(5).fill(twoLINK), - ) - await setTx.wait() - }) - - it('Should revert when paused', async () => { - const pauseTx = await bm.connect(owner).pause() - await pauseTx.wait() - const performTx = bm.connect(keeperRegistry).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWith(PAUSED_ERR) - }) - - context('when partially funded', () => { - it('Should fund as many addresses as possible', async () => { - const fundTx = await lt.connect(owner).transfer( - bm.address, - fiveLINK, // only enough LINK to fund 2 addresses - ) - await fundTx.wait() - await assertWatchlistBalances( - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload) - await assertWatchlistBalances( - twoLINK, - twoLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(watchAddress1) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(watchAddress2) - }) - }) - - context('when fully funded', () => { - beforeEach(async () => { - const fundTx = await lt.connect(owner).transfer(bm.address, tenLINK) - await fundTx.wait() - }) - - it('Should fund the appropriate addresses', async () => { - await assertWatchlistBalances( - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances( - twoLINK, - twoLINK, - twoLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - }) - - it('Should only fund active, underfunded addresses', async () => { - await assertWatchlistBalances( - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(invalidPayload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances( - twoLINK, - twoLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - }) - - it('Should not fund addresses that have been funded recently', async () => { - const setWaitPdTx = await bm.setMinWaitPeriodSeconds(3600) // 1 hour - await setWaitPdTx.wait() - const block = await ethers.provider.getBlock('latest') - const setTopUpTx = await bm.setLastTopUpXXXTestOnly( - watchAddress2, - block.timestamp - 100, - ) - await setTopUpTx.wait() - await assertWatchlistBalances( - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances( - twoLINK, - zeroLINK, - twoLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - }) - - it('Should only be callable by the keeper registry contract', async () => { - let performTx = bm.connect(owner).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWithCustomError( - bm, - ONLY_KEEPER_ERR, - ) - performTx = bm.connect(stranger).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWithCustomError( - bm, - ONLY_KEEPER_ERR, - ) - }) - - it('Should protect against running out of gas', async () => { - await assertWatchlistBalances( - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - oneHundredLINK, - oneHundredLINK, - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 130_000 }) // too little for all 3 transfers - await performTx.wait() - const balance1 = await lt.balanceOf(watchAddress1) - const balance2 = await lt.balanceOf(watchAddress2) - const balance3 = await lt.balanceOf(watchAddress3) - const balances = [balance1, balance2, balance3].map((n) => n.toString()) - expect(balances) - .to.include(twoLINK.toString()) // expect at least 1 transfer - .to.include(zeroLINK.toString()) // expect at least 1 out of funds - }) - - it('Should provide enough gas to support receive and fallback functions', async () => { - const addresses = [ - receiveEmitter.address, - receiveFallbackEmitter.address, - ] - const payload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [addresses], - ) - const setTx = await bm - .connect(owner) - .setWatchList( - addresses, - new Array(2).fill(oneLINK), - new Array(2).fill(twoLINK), - ) - await setTx.wait() - - const reBalanceBefore = await lt.balanceOf(receiveEmitter.address) - const rfeBalanceBefore = await lt.balanceOf( - receiveFallbackEmitter.address, - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(payload, { gasLimit: 2_500_000 }) - await h.assertLinkTokenBalance( - lt, - receiveEmitter.address, - reBalanceBefore.add(twoLINK), - ) - await h.assertLinkTokenBalance( - lt, - receiveFallbackEmitter.address, - rfeBalanceBefore.add(twoLINK), - ) - - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(receiveEmitter.address) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(receiveFallbackEmitter.address) - }) - }) - }) - - describe('topUp()', () => { - context('when not paused', () => { - it('Should be callable by anyone', async () => { - const users = [owner, keeperRegistry, stranger] - for (let idx = 0; idx < users.length; idx++) { - const user = users[idx] - await bm.connect(user).topUp([]) - } - }) - }) - context('when paused', () => { - it('Should be callable by no one', async () => { - await bm.connect(owner).pause() - const users = [owner, keeperRegistry, stranger] - for (let idx = 0; idx < users.length; idx++) { - const user = users[idx] - const tx = bm.connect(user).topUp([]) - await expect(tx).to.be.revertedWith(PAUSED_ERR) - } - }) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/EthBalanceMonitor.test.ts b/contracts/test/v0.8/automation/EthBalanceMonitor.test.ts deleted file mode 100644 index edcf1b564c9..00000000000 --- a/contracts/test/v0.8/automation/EthBalanceMonitor.test.ts +++ /dev/null @@ -1,663 +0,0 @@ -import { ethers } from 'hardhat' -import { assert, expect } from 'chai' -import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import { EthBalanceMonitorExposed } from '../../../typechain/EthBalanceMonitorExposed' -import { ReceiveReverter } from '../../../typechain/ReceiveReverter' -import { ReceiveEmitter } from '../../../typechain/ReceiveEmitter' -import { ReceiveFallbackEmitter } from '../../../typechain/ReceiveFallbackEmitter' -import { BigNumber } from 'ethers' -import * as h from '../../test-helpers/helpers' - -const OWNABLE_ERR = 'Only callable by owner' -const INVALID_WATCHLIST_ERR = `InvalidWatchList` -const PAUSED_ERR = 'Pausable: paused' -const ONLY_KEEPER_ERR = `OnlyKeeperRegistry` - -const zeroEth = ethers.utils.parseEther('0') -const oneEth = ethers.utils.parseEther('1') -const twoEth = ethers.utils.parseEther('2') -const threeEth = ethers.utils.parseEther('3') -const fiveEth = ethers.utils.parseEther('5') -const sixEth = ethers.utils.parseEther('6') -const tenEth = ethers.utils.parseEther('10') - -const watchAddress1 = ethers.Wallet.createRandom().address -const watchAddress2 = ethers.Wallet.createRandom().address -const watchAddress3 = ethers.Wallet.createRandom().address -const watchAddress4 = ethers.Wallet.createRandom().address -let watchAddress5: string -let watchAddress6: string - -async function assertWatchlistBalances( - balance1: number, - balance2: number, - balance3: number, - balance4: number, - balance5: number, - balance6: number, -) { - const toEth = (n: number) => ethers.utils.parseUnits(n.toString(), 'ether') - await h.assertBalance(watchAddress1, toEth(balance1), 'address 1') - await h.assertBalance(watchAddress2, toEth(balance2), 'address 2') - await h.assertBalance(watchAddress3, toEth(balance3), 'address 3') - await h.assertBalance(watchAddress4, toEth(balance4), 'address 4') - await h.assertBalance(watchAddress5, toEth(balance5), 'address 5') - await h.assertBalance(watchAddress6, toEth(balance6), 'address 6') -} - -let bm: EthBalanceMonitorExposed -let receiveReverter: ReceiveReverter -let receiveEmitter: ReceiveEmitter -let receiveFallbackEmitter: ReceiveFallbackEmitter -let owner: SignerWithAddress -let stranger: SignerWithAddress -let keeperRegistry: SignerWithAddress - -describe('EthBalanceMonitor', () => { - beforeEach(async () => { - const accounts = await ethers.getSigners() - owner = accounts[0] - stranger = accounts[1] - keeperRegistry = accounts[2] - watchAddress5 = accounts[3].address - watchAddress6 = accounts[4].address - - const bmFactory = await ethers.getContractFactory( - 'EthBalanceMonitorExposed', - owner, - ) - const rrFactory = await ethers.getContractFactory('ReceiveReverter', owner) - const reFactory = await ethers.getContractFactory('ReceiveEmitter', owner) - const rfeFactory = await ethers.getContractFactory( - 'ReceiveFallbackEmitter', - owner, - ) - - bm = await bmFactory.deploy(keeperRegistry.address, 0) - receiveReverter = await rrFactory.deploy() - receiveEmitter = await reFactory.deploy() - receiveFallbackEmitter = await rfeFactory.deploy() - await Promise.all([ - bm.deployed(), - receiveReverter.deployed(), - receiveEmitter.deployed(), - receiveFallbackEmitter.deployed(), - ]) - }) - - afterEach(async () => { - await h.reset() - }) - - describe('receive()', () => { - it('Should allow anyone to add funds', async () => { - await owner.sendTransaction({ - to: bm.address, - value: oneEth, - }) - await stranger.sendTransaction({ - to: bm.address, - value: oneEth, - }) - }) - - it('Should emit an event', async () => { - await owner.sendTransaction({ - to: bm.address, - value: oneEth, - }) - const tx = stranger.sendTransaction({ - to: bm.address, - value: oneEth, - }) - await expect(tx) - .to.emit(bm, 'FundsAdded') - .withArgs(oneEth, twoEth, stranger.address) - }) - }) - - describe('withdraw()', () => { - beforeEach(async () => { - const tx = await owner.sendTransaction({ - to: bm.address, - value: oneEth, - }) - await tx.wait() - }) - - it('Should allow the owner to withdraw', async () => { - const beforeBalance = await owner.getBalance() - const tx = await bm.connect(owner).withdraw(oneEth, owner.address) - await tx.wait() - const afterBalance = await owner.getBalance() - assert.isTrue( - afterBalance.gt(beforeBalance), - 'balance did not increase after withdraw', - ) - }) - - it('Should emit an event', async () => { - const tx = await bm.connect(owner).withdraw(oneEth, owner.address) - await expect(tx) - .to.emit(bm, 'FundsWithdrawn') - .withArgs(oneEth, owner.address) - }) - - it('Should allow the owner to withdraw to anyone', async () => { - const beforeBalance = await stranger.getBalance() - const tx = await bm.connect(owner).withdraw(oneEth, stranger.address) - await tx.wait() - const afterBalance = await stranger.getBalance() - assert.isTrue( - beforeBalance.add(oneEth).eq(afterBalance), - 'balance did not increase after withdraw', - ) - }) - - it('Should not allow strangers to withdraw', async () => { - const tx = bm.connect(stranger).withdraw(oneEth, owner.address) - await expect(tx).to.be.revertedWith(OWNABLE_ERR) - }) - }) - - describe('pause() / unpause()', () => { - it('Should allow owner to pause / unpause', async () => { - const pauseTx = await bm.connect(owner).pause() - await pauseTx.wait() - const unpauseTx = await bm.connect(owner).unpause() - await unpauseTx.wait() - }) - - it('Should not allow strangers to pause / unpause', async () => { - const pauseTxStranger = bm.connect(stranger).pause() - await expect(pauseTxStranger).to.be.revertedWith(OWNABLE_ERR) - const pauseTxOwner = await bm.connect(owner).pause() - await pauseTxOwner.wait() - const unpauseTxStranger = bm.connect(stranger).unpause() - await expect(unpauseTxStranger).to.be.revertedWith(OWNABLE_ERR) - }) - }) - - describe('setWatchList() / getWatchList() / getAccountInfo()', () => { - it('Should allow owner to set the watchlist', async () => { - // should start unactive - assert.isFalse((await bm.getAccountInfo(watchAddress1)).isActive) - // add first watchlist - let setTx = await bm - .connect(owner) - .setWatchList([watchAddress1], [oneEth], [twoEth]) - await setTx.wait() - let watchList = await bm.getWatchList() - assert.deepEqual(watchList, [watchAddress1]) - const accountInfo = await bm.getAccountInfo(watchAddress1) - assert.isTrue(accountInfo.isActive) - expect(accountInfo.minBalanceWei).to.equal(oneEth) - expect(accountInfo.topUpAmountWei).to.equal(twoEth) - // add more to watchlist - setTx = await bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress3], - [oneEth, twoEth, threeEth], - [oneEth, twoEth, threeEth], - ) - await setTx.wait() - watchList = await bm.getWatchList() - assert.deepEqual(watchList, [watchAddress1, watchAddress2, watchAddress3]) - let accountInfo1 = await bm.getAccountInfo(watchAddress1) - let accountInfo2 = await bm.getAccountInfo(watchAddress2) - let accountInfo3 = await bm.getAccountInfo(watchAddress3) - expect(accountInfo1.isActive).to.be.true - expect(accountInfo1.minBalanceWei).to.equal(oneEth) - expect(accountInfo1.topUpAmountWei).to.equal(oneEth) - expect(accountInfo2.isActive).to.be.true - expect(accountInfo2.minBalanceWei).to.equal(twoEth) - expect(accountInfo2.topUpAmountWei).to.equal(twoEth) - expect(accountInfo3.isActive).to.be.true - expect(accountInfo3.minBalanceWei).to.equal(threeEth) - expect(accountInfo3.topUpAmountWei).to.equal(threeEth) - // remove some from watchlist - setTx = await bm - .connect(owner) - .setWatchList( - [watchAddress3, watchAddress1], - [threeEth, oneEth], - [threeEth, oneEth], - ) - await setTx.wait() - watchList = await bm.getWatchList() - assert.deepEqual(watchList, [watchAddress3, watchAddress1]) - accountInfo1 = await bm.getAccountInfo(watchAddress1) - accountInfo2 = await bm.getAccountInfo(watchAddress2) - accountInfo3 = await bm.getAccountInfo(watchAddress3) - expect(accountInfo1.isActive).to.be.true - expect(accountInfo2.isActive).to.be.false - expect(accountInfo3.isActive).to.be.true - }) - - it('Should not allow duplicates in the watchlist', async () => { - const errMsg = `DuplicateAddress` - const setTx = bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress1], - [oneEth, twoEth, threeEth], - [oneEth, twoEth, threeEth], - ) - await expect(setTx) - .to.be.revertedWithCustomError(bm, errMsg) - .withArgs(watchAddress1) - }) - - it('Should not allow strangers to set the watchlist', async () => { - const setTxStranger = bm - .connect(stranger) - .setWatchList([watchAddress1], [oneEth], [twoEth]) - await expect(setTxStranger).to.be.revertedWith(OWNABLE_ERR) - }) - - it('Should revert if the list lengths differ', async () => { - let tx = bm.connect(owner).setWatchList([watchAddress1], [], [twoEth]) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - tx = bm.connect(owner).setWatchList([watchAddress1], [oneEth], []) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - tx = bm.connect(owner).setWatchList([], [oneEth], [twoEth]) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - - it('Should revert if any of the addresses are empty', async () => { - let tx = bm - .connect(owner) - .setWatchList( - [watchAddress1, ethers.constants.AddressZero], - [oneEth, oneEth], - [twoEth, twoEth], - ) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - - it('Should revert if any of the top up amounts are 0', async () => { - const tx = bm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2], - [oneEth, oneEth], - [twoEth, zeroEth], - ) - await expect(tx).to.be.revertedWithCustomError(bm, INVALID_WATCHLIST_ERR) - }) - }) - - describe('getKeeperRegistryAddress() / setKeeperRegistryAddress()', () => { - const newAddress = ethers.Wallet.createRandom().address - - it('Should initialize with the registry address provided to the constructor', async () => { - const address = await bm.getKeeperRegistryAddress() - assert.equal(address, keeperRegistry.address) - }) - - it('Should allow the owner to set the registry address', async () => { - const setTx = await bm.connect(owner).setKeeperRegistryAddress(newAddress) - await setTx.wait() - const address = await bm.getKeeperRegistryAddress() - assert.equal(address, newAddress) - }) - - it('Should not allow strangers to set the registry address', async () => { - const setTx = bm.connect(stranger).setKeeperRegistryAddress(newAddress) - await expect(setTx).to.be.revertedWith(OWNABLE_ERR) - }) - - it('Should emit an event', async () => { - const setTx = await bm.connect(owner).setKeeperRegistryAddress(newAddress) - await expect(setTx) - .to.emit(bm, 'KeeperRegistryAddressUpdated') - .withArgs(keeperRegistry.address, newAddress) - }) - }) - - describe('getMinWaitPeriodSeconds / setMinWaitPeriodSeconds()', () => { - const newWaitPeriod = BigNumber.from(1) - - it('Should initialize with the wait period provided to the constructor', async () => { - const minWaitPeriod = await bm.getMinWaitPeriodSeconds() - expect(minWaitPeriod).to.equal(0) - }) - - it('Should allow owner to set the wait period', async () => { - const setTx = await bm - .connect(owner) - .setMinWaitPeriodSeconds(newWaitPeriod) - await setTx.wait() - const minWaitPeriod = await bm.getMinWaitPeriodSeconds() - expect(minWaitPeriod).to.equal(newWaitPeriod) - }) - - it('Should not allow strangers to set the wait period', async () => { - const setTx = bm.connect(stranger).setMinWaitPeriodSeconds(newWaitPeriod) - await expect(setTx).to.be.revertedWith(OWNABLE_ERR) - }) - - it('Should emit an event', async () => { - const setTx = await bm - .connect(owner) - .setMinWaitPeriodSeconds(newWaitPeriod) - await expect(setTx) - .to.emit(bm, 'MinWaitPeriodUpdated') - .withArgs(0, newWaitPeriod) - }) - }) - - describe('checkUpkeep() / getUnderfundedAddresses()', () => { - beforeEach(async () => { - const setTx = await bm.connect(owner).setWatchList( - [ - watchAddress1, // needs funds - watchAddress5, // funded - watchAddress2, // needs funds - watchAddress6, // funded - watchAddress3, // needs funds - ], - new Array(5).fill(oneEth), - new Array(5).fill(twoEth), - ) - await setTx.wait() - }) - - it('Should return list of address that are underfunded', async () => { - const fundTx = await owner.sendTransaction({ - to: bm.address, - value: sixEth, // needs 6 total - }) - await fundTx.wait() - const [should, payload] = await bm.checkUpkeep('0x') - assert.isTrue(should) - let [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - assert.deepEqual(addresses, [watchAddress1, watchAddress2, watchAddress3]) - // checkUpkeep payload should match getUnderfundedAddresses() - addresses = await bm.getUnderfundedAddresses() - assert.deepEqual(addresses, [watchAddress1, watchAddress2, watchAddress3]) - }) - - it('Should return some results even if contract cannot fund all eligible targets', async () => { - const fundTx = await owner.sendTransaction({ - to: bm.address, - value: fiveEth, // needs 6 total - }) - await fundTx.wait() - const [should, payload] = await bm.checkUpkeep('0x') - assert.isTrue(should) - const [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - assert.deepEqual(addresses, [watchAddress1, watchAddress2]) - }) - - it('Should omit addresses that have been funded recently', async () => { - const setWaitPdTx = await bm.setMinWaitPeriodSeconds(3600) // 1 hour - const fundTx = await owner.sendTransaction({ - to: bm.address, - value: sixEth, - }) - await Promise.all([setWaitPdTx.wait(), fundTx.wait()]) - const block = await ethers.provider.getBlock('latest') - const setTopUpTx = await bm.setLastTopUpXXXTestOnly( - watchAddress2, - block.timestamp - 100, - ) - await setTopUpTx.wait() - const [should, payload] = await bm.checkUpkeep('0x') - assert.isTrue(should) - const [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - assert.deepEqual(addresses, [watchAddress1, watchAddress3]) - }) - - it('Should revert when paused', async () => { - const tx = await bm.connect(owner).pause() - await tx.wait() - const ethCall = bm.checkUpkeep('0x') - await expect(ethCall).to.be.revertedWith(PAUSED_ERR) - }) - }) - - describe('performUpkeep()', () => { - let validPayload: string - let invalidPayload: string - - beforeEach(async () => { - validPayload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [[watchAddress1, watchAddress2, watchAddress3]], - ) - invalidPayload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [[watchAddress1, watchAddress2, watchAddress4, watchAddress5]], - ) - const setTx = await bm.connect(owner).setWatchList( - [ - watchAddress1, // needs funds - watchAddress5, // funded - watchAddress2, // needs funds - watchAddress6, // funded - watchAddress3, // needs funds - // watchAddress4 - omitted - ], - new Array(5).fill(oneEth), - new Array(5).fill(twoEth), - ) - await setTx.wait() - }) - - it('Should revert when paused', async () => { - const pauseTx = await bm.connect(owner).pause() - await pauseTx.wait() - const performTx = bm.connect(keeperRegistry).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWith(PAUSED_ERR) - }) - - context('when partially funded', () => { - it('Should fund as many addresses as possible', async () => { - const fundTx = await owner.sendTransaction({ - to: bm.address, - value: fiveEth, // only enough eth to fund 2 addresses - }) - await fundTx.wait() - await assertWatchlistBalances(0, 0, 0, 0, 10_000, 10_000) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload) - await assertWatchlistBalances(2, 2, 0, 0, 10_000, 10_000) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(watchAddress1) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(watchAddress2) - }) - }) - - context('when fully funded', () => { - beforeEach(async () => { - const fundTx = await owner.sendTransaction({ - to: bm.address, - value: tenEth, - }) - await fundTx.wait() - }) - - it('Should fund the appropriate addresses', async () => { - await assertWatchlistBalances(0, 0, 0, 0, 10_000, 10_000) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances(2, 2, 2, 0, 10_000, 10_000) - }) - - it('Should only fund active, underfunded addresses', async () => { - await assertWatchlistBalances(0, 0, 0, 0, 10_000, 10_000) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(invalidPayload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances(2, 2, 0, 0, 10_000, 10_000) - }) - - it('Should continue funding addresses even if one reverts', async () => { - await assertWatchlistBalances(0, 0, 0, 0, 10_000, 10_000) - const addresses = [ - watchAddress1, - receiveReverter.address, - watchAddress2, - ] - const setTx = await bm - .connect(owner) - .setWatchList( - addresses, - new Array(3).fill(oneEth), - new Array(3).fill(twoEth), - ) - await setTx.wait() - const payload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [addresses], - ) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(payload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances(2, 2, 0, 0, 10_000, 10_000) - await h.assertBalance(receiveReverter.address, 0) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(watchAddress1) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(watchAddress2) - await expect(performTx) - .to.emit(bm, 'TopUpFailed') - .withArgs(receiveReverter.address) - }) - - it('Should not fund addresses that have been funded recently', async () => { - const setWaitPdTx = await bm.setMinWaitPeriodSeconds(3600) // 1 hour - await setWaitPdTx.wait() - const block = await ethers.provider.getBlock('latest') - const setTopUpTx = await bm.setLastTopUpXXXTestOnly( - watchAddress2, - block.timestamp - 100, - ) - await setTopUpTx.wait() - await assertWatchlistBalances(0, 0, 0, 0, 10_000, 10_000) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 2_500_000 }) - await performTx.wait() - await assertWatchlistBalances(2, 0, 2, 0, 10_000, 10_000) - }) - - it('Should only be callable by the keeper registry contract', async () => { - let performTx = bm.connect(owner).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWithCustomError( - bm, - ONLY_KEEPER_ERR, - ) - performTx = bm.connect(stranger).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWithCustomError( - bm, - ONLY_KEEPER_ERR, - ) - }) - - it('Should protect against running out of gas', async () => { - await assertWatchlistBalances(0, 0, 0, 0, 10_000, 10_000) - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 130_000 }) // too little for all 3 transfers - await performTx.wait() - const balance1 = await ethers.provider.getBalance(watchAddress1) - const balance2 = await ethers.provider.getBalance(watchAddress2) - const balance3 = await ethers.provider.getBalance(watchAddress3) - const balances = [balance1, balance2, balance3].map((n) => n.toString()) - expect(balances) - .to.include(twoEth.toString()) // expect at least 1 transfer - .to.include(zeroEth.toString()) // expect at least 1 out of funds - }) - - it('Should provide enough gas to support receive and fallback functions', async () => { - const addresses = [ - receiveEmitter.address, - receiveFallbackEmitter.address, - ] - const payload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [addresses], - ) - const setTx = await bm - .connect(owner) - .setWatchList( - addresses, - new Array(2).fill(oneEth), - new Array(2).fill(twoEth), - ) - await setTx.wait() - - const reBalanceBefore = await ethers.provider.getBalance( - receiveEmitter.address, - ) - const rfeBalanceBefore = await ethers.provider.getBalance( - receiveFallbackEmitter.address, - ) - - const performTx = await bm - .connect(keeperRegistry) - .performUpkeep(payload, { gasLimit: 2_500_000 }) - await h.assertBalance( - receiveEmitter.address, - reBalanceBefore.add(twoEth), - ) - await h.assertBalance( - receiveFallbackEmitter.address, - rfeBalanceBefore.add(twoEth), - ) - - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(receiveEmitter.address) - await expect(performTx) - .to.emit(bm, 'TopUpSucceeded') - .withArgs(receiveFallbackEmitter.address) - }) - }) - }) - - describe('topUp()', () => { - context('when not paused', () => { - it('Should be callable by anyone', async () => { - const users = [owner, keeperRegistry, stranger] - for (let idx = 0; idx < users.length; idx++) { - const user = users[idx] - await bm.connect(user).topUp([]) - } - }) - }) - context('when paused', () => { - it('Should be callable by no one', async () => { - await bm.connect(owner).pause() - const users = [owner, keeperRegistry, stranger] - for (let idx = 0; idx < users.length; idx++) { - const user = users[idx] - const tx = bm.connect(user).topUp([]) - await expect(tx).to.be.revertedWith(PAUSED_ERR) - } - }) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts b/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts deleted file mode 100644 index 11da7273ab9..00000000000 --- a/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts +++ /dev/null @@ -1,117 +0,0 @@ -import fs from 'fs' -import { ethers } from 'hardhat' -import { assert } from 'chai' -import { AutomationRegistry2_2__factory as AutomationRegistryFactory } from '../../../typechain/factories/AutomationRegistry2_2__factory' -import { AutomationRegistryLogicA2_2__factory as AutomationRegistryLogicAFactory } from '../../../typechain/factories/AutomationRegistryLogicA2_2__factory' -import { AutomationRegistryLogicB2_2__factory as AutomationRegistryLogicBFactory } from '../../../typechain/factories/AutomationRegistryLogicB2_2__factory' -import { AutomationRegistryBase2_2__factory as AutomationRegistryBaseFactory } from '../../../typechain/factories/AutomationRegistryBase2_2__factory' -import { Chainable__factory as ChainableFactory } from '../../../typechain/factories/Chainable__factory' -import { IAutomationRegistryMaster__factory as IAutomationRegistryMasterFactory } from '../../../typechain/factories/IAutomationRegistryMaster__factory' -import { IAutomationRegistryConsumer__factory as IAutomationRegistryConsumerFactory } from '../../../typechain/factories/IAutomationRegistryConsumer__factory' -import { MigratableKeeperRegistryInterface__factory as MigratableKeeperRegistryInterfaceFactory } from '../../../typechain/factories/MigratableKeeperRegistryInterface__factory' -import { MigratableKeeperRegistryInterfaceV2__factory as MigratableKeeperRegistryInterfaceV2Factory } from '../../../typechain/factories/MigratableKeeperRegistryInterfaceV2__factory' -import { OCR2Abstract__factory as OCR2AbstractFactory } from '../../../typechain/factories/OCR2Abstract__factory' -import { IAutomationV21PlusCommon__factory as IAutomationV21PlusCommonFactory } from '../../../typechain/factories/IAutomationV21PlusCommon__factory' -import { - assertSatisfiesEvents, - assertSatisfiesInterface, - entryID, -} from './helpers' - -const compositeABIs = [ - AutomationRegistryFactory.abi, - AutomationRegistryLogicAFactory.abi, - AutomationRegistryLogicBFactory.abi, -] - -/** - * @dev because the keeper master interface is a composite of several different contracts, - * it is possible that an interface could be satisfied by functions across different - * contracts, and therefore not enforceable by the compiler directly. Instead, we use this - * test to assert that the master interface satisfies the constraints of an individual interface - */ -describe('IAutomationRegistryMaster2_2', () => { - it('is up to date', async () => { - const checksum = ethers.utils.id(compositeABIs.join('')) - const knownChecksum = fs - .readFileSync( - 'src/v0.8/automation/interfaces/v2_2/IAutomationRegistryMaster.sol', - ) - .toString() - .slice(17, 83) // checksum located at top of file - assert.equal( - checksum, - knownChecksum, - 'master interface is out of date - regenerate using "pnpm ts-node ./scripts/generate-automation-master-interface.ts"', - ) - }) - - it('is generated from composite contracts without competing definitions', async () => { - const sharedEntries = [ - ...ChainableFactory.abi, - ...AutomationRegistryBaseFactory.abi, - ] - const abiSet = new Set() - const sharedSet = new Set() - for (const entry of sharedEntries) { - sharedSet.add(entryID(entry)) - } - for (const abi of compositeABIs) { - for (const entry of abi) { - const id = entryID(entry) - if (!abiSet.has(id)) { - abiSet.add(id) - } else if (!sharedSet.has(id)) { - assert.fail( - `composite contracts contain duplicate entry: ${JSON.stringify( - entry, - )}`, - ) - } - } - } - }) - - it('satisfies the IAutomationRegistryConsumer interface', async () => { - assertSatisfiesInterface( - IAutomationRegistryMasterFactory.abi, - IAutomationRegistryConsumerFactory.abi, - ) - }) - - it('satisfies the MigratableKeeperRegistryInterface interface', async () => { - assertSatisfiesInterface( - IAutomationRegistryMasterFactory.abi, - MigratableKeeperRegistryInterfaceFactory.abi, - ) - }) - - it('satisfies the MigratableKeeperRegistryInterfaceV2 interface', async () => { - assertSatisfiesInterface( - IAutomationRegistryMasterFactory.abi, - MigratableKeeperRegistryInterfaceV2Factory.abi, - ) - }) - - // temporarily disable this test due to this update: https://github.com/smartcontractkit/chainlink/pull/14369/files#diff-6e79d46ea0ef204dea679ffd2a9f4dfccd090d8f405ba2d9bffad527d7b862c6L44 - it.skip('satisfies the OCR2Abstract interface', async () => { - assertSatisfiesInterface( - IAutomationRegistryMasterFactory.abi, - OCR2AbstractFactory.abi, - ) - }) - - it('satisfies the IAutomationV2Common interface', async () => { - assertSatisfiesInterface( - IAutomationRegistryMasterFactory.abi, - IAutomationV21PlusCommonFactory.abi, - ) - }) - - it('satisfies the IAutomationV2Common events', async () => { - assertSatisfiesEvents( - IAutomationRegistryMasterFactory.abi, - IAutomationV21PlusCommonFactory.abi, - ) - }) -}) diff --git a/contracts/test/v0.8/automation/LinkAvailableBalanceMonitor.test.ts b/contracts/test/v0.8/automation/LinkAvailableBalanceMonitor.test.ts deleted file mode 100644 index f63de3498b1..00000000000 --- a/contracts/test/v0.8/automation/LinkAvailableBalanceMonitor.test.ts +++ /dev/null @@ -1,1077 +0,0 @@ -import { ethers } from 'hardhat' -import chai, { assert, expect } from 'chai' -import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' -import * as h from '../../test-helpers/helpers' -import { mineBlock } from '../../test-helpers/helpers' -import { IAggregatorProxy__factory as IAggregatorProxyFactory } from '../../../typechain/factories/IAggregatorProxy__factory' -import { ILinkAvailable__factory as ILinkAvailableFactory } from '../../../typechain/factories/ILinkAvailable__factory' -import { LinkAvailableBalanceMonitor, LinkToken } from '../../../typechain' -import { BigNumber } from 'ethers' -import deepEqualInAnyOrder from 'deep-equal-in-any-order' -import { - deployMockContract, - MockContract, -} from '@ethereum-waffle/mock-contract' - -chai.use(deepEqualInAnyOrder) - -//////////////////////////////// GAS USAGE LIMITS - CHANGE WITH CAUTION ////////////////////////// -// // -// we try to keep gas usage under this amount (max is 5M) // -const TARGET_PERFORM_GAS_LIMIT = 2_000_000 -// we try to keep gas usage under this amount (max is 5M) the test is not a perfectly accurate // -// measurement of gas usage because it relies on mocks which may do fewer storage reads // -// therefore, we keep a healthy margin to avoid running over the limit! // -const TARGET_CHECK_GAS_LIMIT = 3_500_000 -// // -////////////////////////////////////////////////////////////////////////////////////////////////// -const INVALID_WATCHLIST_ERR = `InvalidWatchList` -const PAUSED_ERR = 'Pausable: paused' - -const zeroLINK = ethers.utils.parseEther('0') -const oneLINK = ethers.utils.parseEther('1') -const twoLINK = ethers.utils.parseEther('2') -const fourLINK = ethers.utils.parseEther('4') -const tenLINK = ethers.utils.parseEther('10') -const oneHundredLINK = ethers.utils.parseEther('100') - -const randAddr = () => ethers.Wallet.createRandom().address - -let labm: LinkAvailableBalanceMonitor -let lt: LinkToken -let owner: SignerWithAddress -let stranger: SignerWithAddress -let keeperRegistry: SignerWithAddress -let proxy1: MockContract -let proxy2: MockContract -let proxy3: MockContract -let proxy4: MockContract // leave this proxy / aggregator unconfigured for topUp() testing -let aggregator1: MockContract -let aggregator2: MockContract -let aggregator3: MockContract -let aggregator4: MockContract // leave this proxy / aggregator unconfigured for topUp() testing - -let directTarget1: MockContract // Contracts which are direct target of balance monitoring without proxy -let directTarget2: MockContract - -let watchListAddresses: string[] -let watchListMinBalances: BigNumber[] -let watchListTopUpAmounts: BigNumber[] -let watchListDstChainSelectors: number[] - -async function assertContractLinkBalances( - balance1: BigNumber, - balance2: BigNumber, - balance3: BigNumber, - balance4: BigNumber, - balance5: BigNumber, -) { - await h.assertLinkTokenBalance(lt, aggregator1.address, balance1, 'address 1') - await h.assertLinkTokenBalance(lt, aggregator2.address, balance2, 'address 2') - await h.assertLinkTokenBalance(lt, aggregator3.address, balance3, 'address 3') - await h.assertLinkTokenBalance( - lt, - directTarget1.address, - balance4, - 'address 4', - ) - await h.assertLinkTokenBalance( - lt, - directTarget2.address, - balance5, - 'address 5', - ) -} - -const setup = async () => { - const accounts = await ethers.getSigners() - owner = accounts[0] - stranger = accounts[1] - keeperRegistry = accounts[2] - - proxy1 = await deployMockContract(owner, IAggregatorProxyFactory.abi) - proxy2 = await deployMockContract(owner, IAggregatorProxyFactory.abi) - proxy3 = await deployMockContract(owner, IAggregatorProxyFactory.abi) - proxy4 = await deployMockContract(owner, IAggregatorProxyFactory.abi) - aggregator1 = await deployMockContract(owner, ILinkAvailableFactory.abi) - aggregator2 = await deployMockContract(owner, ILinkAvailableFactory.abi) - aggregator3 = await deployMockContract(owner, ILinkAvailableFactory.abi) - aggregator4 = await deployMockContract(owner, ILinkAvailableFactory.abi) - directTarget1 = await deployMockContract(owner, ILinkAvailableFactory.abi) - directTarget2 = await deployMockContract(owner, ILinkAvailableFactory.abi) - - await proxy1.deployed() - await proxy2.deployed() - await proxy3.deployed() - await proxy4.deployed() - await aggregator1.deployed() - await aggregator2.deployed() - await aggregator3.deployed() - await aggregator4.deployed() - await directTarget1.deployed() - await directTarget2.deployed() - - watchListAddresses = [ - proxy1.address, - proxy2.address, - proxy3.address, - directTarget1.address, - directTarget2.address, - ] - watchListMinBalances = [oneLINK, oneLINK, oneLINK, twoLINK, twoLINK] - watchListTopUpAmounts = [twoLINK, twoLINK, twoLINK, twoLINK, twoLINK] - watchListDstChainSelectors = [1, 2, 3, 4, 5] - - await proxy1.mock.aggregator.returns(aggregator1.address) - await proxy2.mock.aggregator.returns(aggregator2.address) - await proxy3.mock.aggregator.returns(aggregator3.address) - - await aggregator1.mock.linkAvailableForPayment.returns(0) - await aggregator2.mock.linkAvailableForPayment.returns(0) - await aggregator3.mock.linkAvailableForPayment.returns(0) - - await directTarget1.mock.linkAvailableForPayment.returns(0) - await directTarget2.mock.linkAvailableForPayment.returns(0) - - const labmFactory = await ethers.getContractFactory( - 'LinkAvailableBalanceMonitor', - owner, - ) - const ltFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - owner, - ) - - // New parameters needed by the constructor - const maxPerform = 5 - const maxCheck = 20 - const minWaitPeriodSeconds = 0 - const upkeepInterval = 10 - - lt = (await ltFactory.deploy()) as LinkToken - labm = await labmFactory.deploy( - owner.address, - lt.address, - minWaitPeriodSeconds, - maxPerform, - maxCheck, - upkeepInterval, - ) - await labm.deployed() - - for (let i = 1; i <= 4; i++) { - const recipient = await accounts[i].getAddress() - await lt.connect(owner).transfer(recipient, oneHundredLINK) - } - - const setTx = await labm - .connect(owner) - .setWatchList( - watchListAddresses, - watchListMinBalances, - watchListTopUpAmounts, - watchListDstChainSelectors, - ) - await setTx.wait() -} - -describe('LinkAvailableBalanceMonitor', () => { - beforeEach(async () => { - await loadFixture(setup) - }) - - describe('add funds', () => { - it('should allow anyone to add funds', async () => { - await lt.transfer(labm.address, oneLINK) - await lt.connect(stranger).transfer(labm.address, oneLINK) - }) - }) - - describe('setTopUpAmount()', () => { - it('configures the top-up amount', async () => { - await labm - .connect(owner) - .setTopUpAmount(directTarget1.address, BigNumber.from(100)) - const report = await labm.getAccountInfo(directTarget1.address) - assert.equal(report.topUpAmount.toString(), '100') - }) - - it('is only callable by the owner', async () => { - await expect( - labm.connect(stranger).setTopUpAmount(directTarget1.address, 100), - ).to.be.reverted - }) - }) - - describe('setMinBalance()', () => { - it('configures the min balance', async () => { - await labm - .connect(owner) - .setMinBalance(proxy1.address, BigNumber.from(100)) - const report = await labm.getAccountInfo(proxy1.address) - assert.equal(report.minBalance.toString(), '100') - }) - - it('reverts if address is not in the watchlist', async () => { - await expect(labm.connect(owner).setMinBalance(proxy4.address, 100)).to.be - .reverted - }) - - it('is only callable by the owner', async () => { - await expect(labm.connect(stranger).setMinBalance(proxy1.address, 100)).to - .be.reverted - }) - }) - - describe('setMaxPerform()', () => { - it('configures the MaxPerform', async () => { - await labm.connect(owner).setMaxPerform(BigNumber.from(100)) - const report = await labm.getMaxPerform() - assert.equal(report.toString(), '100') - }) - - it('is only callable by the owner', async () => { - await expect(labm.connect(stranger).setMaxPerform(100)).to.be.reverted - }) - }) - - describe('setMaxCheck()', () => { - it('configures the MaxCheck', async () => { - await labm.connect(owner).setMaxCheck(BigNumber.from(100)) - const report = await labm.getMaxCheck() - assert.equal(report.toString(), '100') - }) - - it('is only callable by the owner', async () => { - await expect(labm.connect(stranger).setMaxCheck(100)).to.be.reverted - }) - }) - - describe('setUpkeepInterval()', () => { - it('configures the UpkeepInterval', async () => { - await labm.connect(owner).setUpkeepInterval(BigNumber.from(100)) - const report = await labm.getUpkeepInterval() - assert.equal(report.toString(), '100') - }) - - it('is only callable by the owner', async () => { - await expect(labm.connect(stranger).setUpkeepInterval(100)).to.be.reverted - }) - }) - - describe('withdraw()', () => { - beforeEach(async () => { - const tx = await lt.connect(owner).transfer(labm.address, oneLINK) - await tx.wait() - }) - - it('should allow the owner to withdraw', async () => { - const beforeBalance = await lt.balanceOf(owner.address) - const tx = await labm.connect(owner).withdraw(oneLINK, owner.address) - await tx.wait() - const afterBalance = await lt.balanceOf(owner.address) - assert.isTrue( - afterBalance.gt(beforeBalance), - 'balance did not increase after withdraw', - ) - }) - - it('should emit an event', async () => { - const tx = await labm.connect(owner).withdraw(oneLINK, owner.address) - await expect(tx) - .to.emit(labm, 'FundsWithdrawn') - .withArgs(oneLINK, owner.address) - }) - - it('should allow the owner to withdraw to anyone', async () => { - const beforeBalance = await lt.balanceOf(stranger.address) - const tx = await labm.connect(owner).withdraw(oneLINK, stranger.address) - await tx.wait() - const afterBalance = await lt.balanceOf(stranger.address) - assert.isTrue( - beforeBalance.add(oneLINK).eq(afterBalance), - 'balance did not increase after withdraw', - ) - }) - - it('should not allow strangers to withdraw', async () => { - const tx = labm.connect(stranger).withdraw(oneLINK, owner.address) - await expect(tx).to.be.reverted - }) - }) - - describe('pause() / unpause()', () => { - it('should allow owner to pause / unpause', async () => { - const pauseTx = await labm.connect(owner).pause() - await pauseTx.wait() - const unpauseTx = await labm.connect(owner).unpause() - await unpauseTx.wait() - }) - - it('should not allow strangers to pause / unpause', async () => { - const pauseTxStranger = labm.connect(stranger).pause() - await expect(pauseTxStranger).to.be.reverted - const pauseTxOwner = await labm.connect(owner).pause() - await pauseTxOwner.wait() - const unpauseTxStranger = labm.connect(stranger).unpause() - await expect(unpauseTxStranger).to.be.reverted - }) - }) - - describe('setWatchList() / addToWatchListOrDecommissionOrDecommission() / removeFromWatchlist() / getWatchList()', () => { - const watchAddress1 = randAddr() - const watchAddress2 = randAddr() - const watchAddress3 = randAddr() - - beforeEach(async () => { - // reset watchlist to empty before running these tests - await labm.connect(owner).setWatchList([], [], [], []) - const watchList = await labm.getWatchList() - assert.deepEqual(watchList, []) - }) - - it('should allow owner to adjust the watchlist', async () => { - // add first watchlist - await labm - .connect(owner) - .setWatchList([watchAddress1], [oneLINK], [oneLINK], [0]) - let watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress1) - // add more to watchlist - const tx = await labm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress3], - [oneLINK, oneLINK, oneLINK], - [oneLINK, oneLINK, oneLINK], - [1, 2, 3], - ) - await tx.wait() - watchList = await labm.getWatchList() - assert.deepEqual(watchList, [watchAddress1, watchAddress2, watchAddress3]) - }) - - it('should not allow different length arrays in the watchlist', async () => { - const tx = labm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress1], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - await expect(tx).to.be.revertedWithCustomError( - labm, - INVALID_WATCHLIST_ERR, - ) - }) - - it('should not allow duplicates in the watchlist', async () => { - const tx = labm - .connect(owner) - .setWatchList( - [watchAddress1, watchAddress2, watchAddress1], - [oneLINK, oneLINK, oneLINK], - [oneLINK, oneLINK, oneLINK], - [1, 2, 3], - ) - await expect(tx) - .to.be.revertedWithCustomError(labm, 'DuplicateAddress') - .withArgs(watchAddress1) - }) - - it('should not allow strangers to set the watchlist', async () => { - const setTxStranger = labm - .connect(stranger) - .setWatchList([watchAddress1], [oneLINK], [oneLINK], [0]) - await expect(setTxStranger).to.be.reverted - }) - - it('should revert if any of the addresses are empty', async () => { - const tx = labm - .connect(owner) - .setWatchList( - [watchAddress1, ethers.constants.AddressZero], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - await expect(tx).to.be.revertedWithCustomError( - labm, - INVALID_WATCHLIST_ERR, - ) - }) - - it('should allow owner to add multiple addresses with dstChainSelector 0 to the watchlist', async () => { - let tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress1, 0) - await tx.wait - let watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress1) - - tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress2, 0) - await tx.wait - watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress1) - assert.deepEqual(watchList[1], watchAddress2) - - tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress3, 0) - await tx.wait - watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress1) - assert.deepEqual(watchList[1], watchAddress2) - assert.deepEqual(watchList[2], watchAddress3) - }) - - it('should allow owner to add only one address with an unique non-zero dstChainSelector 0 to the watchlist', async () => { - let tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress1, 1) - await tx.wait - let watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress1) - - // 1 is active - let report = await labm.getAccountInfo(watchAddress1) - assert.isTrue(report.isActive) - - tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress2, 1) - await tx.wait - watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress2) - - // 2 is active, 1 should be false - report = await labm.getAccountInfo(watchAddress2) - assert.isTrue(report.isActive) - report = await labm.getAccountInfo(watchAddress1) - assert.isFalse(report.isActive) - - tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress3, 1) - await tx.wait - watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress3) - - // 3 is active, 1 and 2 should be false - report = await labm.getAccountInfo(watchAddress3) - assert.isTrue(report.isActive) - report = await labm.getAccountInfo(watchAddress2) - assert.isFalse(report.isActive) - report = await labm.getAccountInfo(watchAddress1) - assert.isFalse(report.isActive) - }) - - it('should not add address 0 to the watchlist', async () => { - await labm - .connect(owner) - .addToWatchListOrDecommission(ethers.constants.AddressZero, 1) - expect(await labm.getWatchList()).to.not.contain( - ethers.constants.AddressZero, - ) - }) - - it('should not allow stangers to add addresses to the watchlist', async () => { - await expect( - labm.connect(stranger).addToWatchListOrDecommission(watchAddress1, 1), - ).to.be.reverted - }) - - it('should allow owner to remove addresses from the watchlist', async () => { - const tx = await labm - .connect(owner) - .addToWatchListOrDecommission(watchAddress1, 1) - await tx.wait - let watchList = await labm.getWatchList() - assert.deepEqual(watchList[0], watchAddress1) - let report = await labm.getAccountInfo(watchAddress1) - assert.isTrue(report.isActive) - - // remove address - await labm.connect(owner).removeFromWatchList(watchAddress1) - - // address should be false - report = await labm.getAccountInfo(watchAddress1) - assert.isFalse(report.isActive) - - watchList = await labm.getWatchList() - assert.deepEqual(watchList, []) - }) - - it('should allow only one address per dstChainSelector', async () => { - // add address1 - await labm.connect(owner).addToWatchListOrDecommission(watchAddress1, 1) - expect(await labm.getWatchList()).to.contain(watchAddress1) - - // add address2 - await labm.connect(owner).addToWatchListOrDecommission(watchAddress2, 1) - - // only address2 has to be in the watchlist - const watchlist = await labm.getWatchList() - expect(watchlist).to.not.contain(watchAddress1) - expect(watchlist).to.contain(watchAddress2) - }) - - it('should delete the onRamp address on a zero-address with same dstChainSelector', async () => { - // add address1 - await labm.connect(owner).addToWatchListOrDecommission(watchAddress1, 1) - expect(await labm.getWatchList()).to.contain(watchAddress1) - - // simulates an onRampSet(zeroAddress, same dstChainSelector) - await labm - .connect(owner) - .addToWatchListOrDecommission(ethers.constants.AddressZero, 1) - - // address1 should be cleaned - const watchlist = await labm.getWatchList() - expect(watchlist).to.not.contain(watchAddress1) - assert.deepEqual(watchlist, []) - }) - }) - - describe('checkUpkeep() / sampleUnderfundedAddresses() [ @skip-coverage ]', () => { - it('should return list of address that are underfunded', async () => { - const fundTx = await lt - .connect(owner) - .transfer(labm.address, oneHundredLINK) - await fundTx.wait() - - await labm.setWatchList( - watchListAddresses, - watchListMinBalances, - watchListTopUpAmounts, - watchListDstChainSelectors, - ) - - const [should, payload] = await labm.checkUpkeep('0x') - assert.isTrue(should) - let [addresses] = ethers.utils.defaultAbiCoder.decode( - ['address[]'], - payload, - ) - - expect(addresses).to.deep.equalInAnyOrder(watchListAddresses) - addresses = await labm.sampleUnderfundedAddresses() - expect(addresses).to.deep.equalInAnyOrder(watchListAddresses) - }) - - it('should return false because the monitor is underfunded', async () => { - // it needs 10 LINKs to fund all 5 upkeeps, but it only has 8 LINKs - const fundTx = await lt - .connect(owner) - .transfer(labm.address, fourLINK.add(fourLINK)) - await fundTx.wait() - - await labm.setWatchList( - watchListAddresses, - watchListMinBalances, - watchListTopUpAmounts, - watchListDstChainSelectors, - ) - - const [should, _] = await labm.checkUpkeep('0x') - assert.isFalse(should) - }) - - it('should omit aggregators that have sufficient funding', async () => { - const fundTx = await lt.connect(owner).transfer( - labm.address, - oneHundredLINK, // enough for anything that needs funding - ) - await fundTx.wait() - - await labm.setWatchList( - [aggregator2.address, directTarget1.address, directTarget2.address], - [oneLINK, twoLINK, twoLINK], - [oneLINK, oneLINK, oneLINK], - [1, 2, 3], - ) - - // all of them are underfunded, return 3 - await aggregator2.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget1.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget2.mock.linkAvailableForPayment.returns(zeroLINK) - - let addresses = await labm.sampleUnderfundedAddresses() - expect(addresses).to.deep.equalInAnyOrder([ - aggregator2.address, - directTarget1.address, - directTarget2.address, - ]) - - await aggregator2.mock.linkAvailableForPayment.returns(oneLINK) // aggregator2 is enough funded - await directTarget1.mock.linkAvailableForPayment.returns(oneLINK) // directTarget1 is NOT enough funded - await directTarget2.mock.linkAvailableForPayment.returns(oneLINK) // directTarget2 is NOT funded - addresses = await labm.sampleUnderfundedAddresses() - expect(addresses).to.deep.equalInAnyOrder([ - directTarget1.address, - directTarget2.address, - ]) - - await directTarget1.mock.linkAvailableForPayment.returns(tenLINK) - addresses = await labm.sampleUnderfundedAddresses() - expect(addresses).to.deep.equalInAnyOrder([directTarget2.address]) - - await directTarget2.mock.linkAvailableForPayment.returns(tenLINK) - addresses = await labm.sampleUnderfundedAddresses() - expect(addresses).to.deep.equalInAnyOrder([]) - }) - - it('should revert when paused', async () => { - const tx = await labm.connect(owner).pause() - await tx.wait() - const ethCall = labm.checkUpkeep('0x') - await expect(ethCall).to.be.revertedWith(PAUSED_ERR) - }) - - context('with a large set of proxies', async () => { - // in this test, we cheat a little bit and point each proxy to the same aggregator, - // which helps cut down on test time - let MAX_PERFORM: number - let MAX_CHECK: number - let proxyAddresses: string[] - let minBalances: BigNumber[] - let topUpAmount: BigNumber[] - let aggregators: MockContract[] - let dstChainSelectors: number[] - - beforeEach(async () => { - MAX_PERFORM = await labm.getMaxPerform() - MAX_CHECK = await labm.getMaxCheck() - proxyAddresses = [] - minBalances = [] - topUpAmount = [] - aggregators = [] - dstChainSelectors = [] - const numAggregators = MAX_CHECK + 50 - for (let idx = 0; idx < numAggregators; idx++) { - const proxy = await deployMockContract( - owner, - IAggregatorProxyFactory.abi, - ) - const aggregator = await deployMockContract( - owner, - ILinkAvailableFactory.abi, - ) - await proxy.mock.aggregator.returns(aggregator.address) - await aggregator.mock.linkAvailableForPayment.returns(0) - proxyAddresses.push(proxy.address) - minBalances.push(oneLINK) - topUpAmount.push(oneLINK) - aggregators.push(aggregator) - dstChainSelectors.push(0) - } - await labm.setWatchList( - proxyAddresses, - minBalances, - topUpAmount, - dstChainSelectors, - ) - const watchlist = await labm.getWatchList() - expect(watchlist).to.deep.equalInAnyOrder(proxyAddresses) - assert.equal(watchlist.length, minBalances.length) - }) - - it('should not include more than MAX_PERFORM addresses', async () => { - const addresses = await labm.sampleUnderfundedAddresses() - expect(addresses.length).to.be.lessThanOrEqual(MAX_PERFORM) - }) - - it('should sample from the list of addresses pseudorandomly', async () => { - const firstAddress: string[] = [] - for (let idx = 0; idx < 10; idx++) { - const addresses = await labm.sampleUnderfundedAddresses() - assert.equal(addresses.length, MAX_PERFORM) - assert.equal( - new Set(addresses).size, - MAX_PERFORM, - 'duplicate address found', - ) - firstAddress.push(addresses[0]) - await mineBlock(ethers.provider) - } - assert( - new Set(firstAddress).size > 1, - 'sample did not shuffle starting index', - ) - }) - - it('can check MAX_CHECK upkeeps within the allotted gas limit', async () => { - for (const aggregator of aggregators) { - // here we make no aggregators eligible for funding, requiring the function to - // traverse the whole list - await aggregator.mock.linkAvailableForPayment.returns(tenLINK) - } - await labm.checkUpkeep('0x', { gasLimit: TARGET_CHECK_GAS_LIMIT }) - }) - }) - }) - - describe('performUpkeep()', () => { - let validPayload: string - - beforeEach(async () => { - validPayload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [watchListAddresses], - ) - await labm - .connect(owner) - .setWatchList( - watchListAddresses, - watchListMinBalances, - watchListTopUpAmounts, - watchListDstChainSelectors, - ) - }) - - it('should revert when paused', async () => { - await labm.connect(owner).pause() - const performTx = labm.connect(keeperRegistry).performUpkeep(validPayload) - await expect(performTx).to.be.revertedWith(PAUSED_ERR) - }) - - it('should fund the appropriate addresses', async () => { - await aggregator1.mock.linkAvailableForPayment.returns(zeroLINK) - await aggregator2.mock.linkAvailableForPayment.returns(zeroLINK) - await aggregator3.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget1.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget2.mock.linkAvailableForPayment.returns(zeroLINK) - - const fundTx = await lt.connect(owner).transfer(labm.address, tenLINK) - await fundTx.wait() - - await h.assertLinkTokenBalance(lt, aggregator1.address, zeroLINK) - await h.assertLinkTokenBalance(lt, aggregator2.address, zeroLINK) - await h.assertLinkTokenBalance(lt, aggregator3.address, zeroLINK) - await h.assertLinkTokenBalance(lt, directTarget1.address, zeroLINK) - await h.assertLinkTokenBalance(lt, directTarget2.address, zeroLINK) - - const performTx = await labm - .connect(keeperRegistry) - .performUpkeep(validPayload, { gasLimit: 1_500_000 }) - await performTx.wait() - - await h.assertLinkTokenBalance(lt, aggregator1.address, twoLINK) - await h.assertLinkTokenBalance(lt, aggregator2.address, twoLINK) - await h.assertLinkTokenBalance(lt, aggregator3.address, twoLINK) - await h.assertLinkTokenBalance(lt, directTarget1.address, twoLINK) - await h.assertLinkTokenBalance(lt, directTarget2.address, twoLINK) - }) - - it('can handle MAX_PERFORM proxies within gas limit', async () => { - const MAX_PERFORM = await labm.getMaxPerform() - const proxyAddresses = [] - const minBalances = [] - const topUpAmount = [] - const dstChainSelectors = [] - for (let idx = 0; idx < MAX_PERFORM; idx++) { - const proxy = await deployMockContract( - owner, - IAggregatorProxyFactory.abi, - ) - const aggregator = await deployMockContract( - owner, - ILinkAvailableFactory.abi, - ) - await proxy.mock.aggregator.returns(aggregator.address) - await aggregator.mock.linkAvailableForPayment.returns(0) - proxyAddresses.push(proxy.address) - minBalances.push(oneLINK) - topUpAmount.push(oneLINK) - dstChainSelectors.push(0) - } - await labm.setWatchList( - proxyAddresses, - minBalances, - topUpAmount, - dstChainSelectors, - ) - const watchlist = await labm.getWatchList() - expect(watchlist).to.deep.equalInAnyOrder(proxyAddresses) - assert.equal(watchlist.length, minBalances.length) - - // add funds - const wl = await labm.getWatchList() - const fundsNeeded = BigNumber.from(0) - for (let idx = 0; idx < wl.length; idx++) { - const targetInfo = await labm.getAccountInfo(wl[idx]) - const targetTopUpAmount = targetInfo.topUpAmount - fundsNeeded.add(targetTopUpAmount) - } - await lt.connect(owner).transfer(labm.address, fundsNeeded) - - // encode payload - const payload = ethers.utils.defaultAbiCoder.encode( - ['address[]'], - [proxyAddresses], - ) - - // do the thing - await labm - .connect(keeperRegistry) - .performUpkeep(payload, { gasLimit: TARGET_PERFORM_GAS_LIMIT }) - }) - }) - - describe('topUp()', () => { - it('should revert topUp address(0)', async () => { - const tx = await labm.connect(owner).topUp([ethers.constants.AddressZero]) - await expect(tx).to.emit(labm, 'TopUpBlocked') - }) - - context('when not paused', () => { - it('should be callable by anyone', async () => { - const users = [owner, keeperRegistry, stranger] - for (let idx = 0; idx < users.length; idx++) { - const user = users[idx] - await labm.connect(user).topUp([]) - } - }) - }) - - context('when paused', () => { - it('should be callable by no one', async () => { - await labm.connect(owner).pause() - const users = [owner, keeperRegistry, stranger] - for (let idx = 0; idx < users.length; idx++) { - const user = users[idx] - const tx = labm.connect(user).topUp([]) - await expect(tx).to.be.revertedWith(PAUSED_ERR) - } - }) - }) - - context('when fully funded', () => { - beforeEach(async () => { - await lt.connect(owner).transfer(labm.address, tenLINK) - await assertContractLinkBalances( - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - zeroLINK, - ) - }) - - it('should fund the appropriate addresses', async () => { - const ai1 = await labm.getAccountInfo(proxy1.address) - assert.equal(0, ai1.lastTopUpTimestamp.toNumber()) - const ai4 = await labm.getAccountInfo(directTarget1.address) - assert.equal(0, ai4.lastTopUpTimestamp.toNumber()) - - const tx = await labm.connect(keeperRegistry).topUp(watchListAddresses) - - await aggregator1.mock.linkAvailableForPayment.returns(twoLINK) - await aggregator2.mock.linkAvailableForPayment.returns(twoLINK) - await aggregator3.mock.linkAvailableForPayment.returns(twoLINK) - await directTarget1.mock.linkAvailableForPayment.returns(twoLINK) - await directTarget2.mock.linkAvailableForPayment.returns(twoLINK) - - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator1.address, twoLINK) - assert.equal( - (await lt.balanceOf(aggregator1.address)).toBigInt(), - twoLINK.toBigInt(), - ) - const targetInfo1 = await labm.getAccountInfo(proxy1.address) - assert.notEqual(0, targetInfo1.lastTopUpTimestamp.toNumber()) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator2.address, twoLINK) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator3.address, twoLINK) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(directTarget1.address, twoLINK) - assert.equal( - (await lt.balanceOf(directTarget1.address)).toBigInt(), - twoLINK.toBigInt(), - ) - const targetInfo4 = await labm.getAccountInfo(directTarget1.address) - assert.notEqual(0, targetInfo4.lastTopUpTimestamp.toNumber()) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(directTarget2.address, twoLINK) - }) - - it('should only fund the addresses provided', async () => { - await labm - .connect(keeperRegistry) - .topUp([proxy1.address, directTarget1.address]) - - await aggregator1.mock.linkAvailableForPayment.returns(twoLINK) - await aggregator2.mock.linkAvailableForPayment.returns(zeroLINK) - await aggregator3.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget1.mock.linkAvailableForPayment.returns(twoLINK) - await directTarget2.mock.linkAvailableForPayment.returns(zeroLINK) - }) - - it('should skip un-approved addresses', async () => { - await labm - .connect(owner) - .setWatchList( - [proxy1.address, directTarget1.address], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - const tx = await labm - .connect(keeperRegistry) - .topUp([ - proxy1.address, - proxy2.address, - proxy3.address, - directTarget1.address, - directTarget2.address, - ]) - - await h.assertLinkTokenBalance(lt, aggregator1.address, oneLINK) - await h.assertLinkTokenBalance(lt, aggregator2.address, zeroLINK) - await h.assertLinkTokenBalance(lt, aggregator3.address, zeroLINK) - await h.assertLinkTokenBalance(lt, directTarget1.address, oneLINK) - await h.assertLinkTokenBalance(lt, directTarget2.address, zeroLINK) - - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator1.address, oneLINK) - const targetInfo1 = await labm.getAccountInfo(proxy1.address) - assert.notEqual(0, targetInfo1.lastTopUpTimestamp.toNumber()) - - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(directTarget1.address, oneLINK) - await expect(tx).to.emit(labm, 'TopUpBlocked').withArgs(proxy2.address) - await expect(tx).to.emit(labm, 'TopUpBlocked').withArgs(proxy3.address) - await expect(tx) - .to.emit(labm, 'TopUpBlocked') - .withArgs(directTarget2.address) - const targetInfo5 = await labm.getAccountInfo(directTarget2.address) - assert.equal(0, targetInfo5.lastTopUpTimestamp.toNumber()) - }) - - it('should skip an address if the proxy is invalid and it is not a direct target', async () => { - await labm - .connect(owner) - .setWatchList( - [proxy1.address, proxy4.address], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - const tx = await labm - .connect(keeperRegistry) - .topUp([proxy1.address, proxy4.address]) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator1.address, oneLINK) - await expect(tx).to.emit(labm, 'TopUpBlocked').withArgs(proxy4.address) - }) - - it('should skip an address if the aggregator is invalid', async () => { - await proxy4.mock.aggregator.returns(aggregator4.address) - await labm - .connect(owner) - .setWatchList( - [proxy1.address, proxy4.address], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - const tx = await labm - .connect(keeperRegistry) - .topUp([proxy1.address, proxy4.address]) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator1.address, oneLINK) - await expect(tx).to.emit(labm, 'TopUpBlocked').withArgs(proxy4.address) - }) - - it('should skip an address if the aggregator has sufficient funding', async () => { - await proxy4.mock.aggregator.returns(aggregator4.address) - await aggregator4.mock.linkAvailableForPayment.returns(tenLINK) - await labm - .connect(owner) - .setWatchList( - [proxy1.address, proxy4.address], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - const tx = await labm - .connect(keeperRegistry) - .topUp([proxy1.address, proxy4.address]) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator1.address, oneLINK) - await expect(tx).to.emit(labm, 'TopUpBlocked').withArgs(proxy4.address) - }) - - it('should skip an address if the direct target has sufficient funding', async () => { - await directTarget1.mock.linkAvailableForPayment.returns(tenLINK) - await labm - .connect(owner) - .setWatchList( - [proxy1.address, directTarget1.address], - [oneLINK, oneLINK], - [oneLINK, oneLINK], - [1, 2], - ) - const tx = await labm - .connect(keeperRegistry) - .topUp([proxy1.address, directTarget1.address]) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator1.address, oneLINK) - assert.equal( - (await lt.balanceOf(aggregator1.address)).toBigInt(), - oneLINK.toBigInt(), - ) - await expect(tx) - .to.emit(labm, 'TopUpBlocked') - .withArgs(directTarget1.address) - }) - }) - - context('when partially funded', () => { - it('should fund as many addresses as possible', async () => { - await lt.connect(owner).transfer( - labm.address, - fourLINK, // only enough LINK to fund 2 addresses - ) - - await aggregator1.mock.linkAvailableForPayment.returns(twoLINK) - await aggregator2.mock.linkAvailableForPayment.returns(twoLINK) - await aggregator3.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget1.mock.linkAvailableForPayment.returns(zeroLINK) - await directTarget2.mock.linkAvailableForPayment.returns(zeroLINK) - - const tx = await labm.connect(keeperRegistry).topUp(watchListAddresses) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(aggregator3.address, twoLINK) - await expect(tx) - .to.emit(labm, 'TopUpSucceeded') - .withArgs(directTarget1.address, twoLINK) - assert.equal( - (await lt.balanceOf(aggregator3.address)).toBigInt(), - twoLINK.toBigInt(), - ) - assert.equal( - (await lt.balanceOf(directTarget1.address)).toBigInt(), - twoLINK.toBigInt(), - ) - }) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/UpkeepBalanceMonitor.test.ts b/contracts/test/v0.8/automation/UpkeepBalanceMonitor.test.ts deleted file mode 100644 index 0ee244130ab..00000000000 --- a/contracts/test/v0.8/automation/UpkeepBalanceMonitor.test.ts +++ /dev/null @@ -1,402 +0,0 @@ -import { ethers } from 'hardhat' -import { expect } from 'chai' -import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import { randomAddress } from '../../test-helpers/helpers' -import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' -import { IKeeperRegistryMaster__factory as RegistryFactory } from '../../../typechain/factories/IKeeperRegistryMaster__factory' -import { IAutomationForwarder__factory as ForwarderFactory } from '../../../typechain/factories/IAutomationForwarder__factory' -import { UpkeepBalanceMonitor } from '../../../typechain/UpkeepBalanceMonitor' -import { LinkToken } from '../../../typechain/LinkToken' -import { BigNumber } from 'ethers' -import { - deployMockContract, - MockContract, -} from '@ethereum-waffle/mock-contract' - -let owner: SignerWithAddress -let stranger: SignerWithAddress -let registry: MockContract -let registry2: MockContract -let forwarder: MockContract -let linkToken: LinkToken -let upkeepBalanceMonitor: UpkeepBalanceMonitor - -const setup = async () => { - const accounts = await ethers.getSigners() - owner = accounts[0] - stranger = accounts[1] - - const ltFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - owner, - ) - linkToken = (await ltFactory.deploy()) as LinkToken - const bmFactory = await ethers.getContractFactory( - 'UpkeepBalanceMonitor', - owner, - ) - upkeepBalanceMonitor = await bmFactory.deploy(linkToken.address, { - maxBatchSize: 10, - minPercentage: 120, - targetPercentage: 300, - maxTopUpAmount: ethers.utils.parseEther('100'), - }) - registry = await deployMockContract(owner, RegistryFactory.abi) - registry2 = await deployMockContract(owner, RegistryFactory.abi) - forwarder = await deployMockContract(owner, ForwarderFactory.abi) - await forwarder.mock.getRegistry.returns(registry.address) - await upkeepBalanceMonitor.setForwarder(forwarder.address) - await linkToken - .connect(owner) - .transfer(upkeepBalanceMonitor.address, ethers.utils.parseEther('10000')) - await upkeepBalanceMonitor - .connect(owner) - .setWatchList(registry.address, [0, 1, 2, 3, 4, 5, 6, 7, 8]) - await upkeepBalanceMonitor - .connect(owner) - .setWatchList(registry2.address, [9, 10, 11]) - for (let i = 0; i < 9; i++) { - await registry.mock.getMinBalance.withArgs(i).returns(100) - await registry.mock.getBalance.withArgs(i).returns(121) // all upkeeps are sufficiently funded - } - for (let i = 9; i < 12; i++) { - await registry2.mock.getMinBalance.withArgs(i).returns(100) - await registry2.mock.getBalance.withArgs(i).returns(121) // all upkeeps are sufficiently funded - } -} - -describe('UpkeepBalanceMonitor', () => { - beforeEach(async () => { - await loadFixture(setup) - }) - - describe('constructor()', () => { - it('should set the initial values correctly', async () => { - const config = await upkeepBalanceMonitor.getConfig() - expect(config.maxBatchSize).to.equal(10) - expect(config.minPercentage).to.equal(120) - expect(config.targetPercentage).to.equal(300) - expect(config.maxTopUpAmount).to.equal(ethers.utils.parseEther('100')) - }) - }) - - describe('setConfig()', () => { - const newConfig = { - maxBatchSize: 100, - minPercentage: 150, - targetPercentage: 500, - maxTopUpAmount: 1, - } - - it('should set config correctly', async () => { - await upkeepBalanceMonitor.connect(owner).setConfig(newConfig) - const config = await upkeepBalanceMonitor.getConfig() - expect(config.maxBatchSize).to.equal(newConfig.maxBatchSize) - expect(config.minPercentage).to.equal(newConfig.minPercentage) - expect(config.targetPercentage).to.equal(newConfig.targetPercentage) - expect(config.maxTopUpAmount).to.equal(newConfig.maxTopUpAmount) - }) - - it('cannot be called by a non-owner', async () => { - await expect( - upkeepBalanceMonitor.connect(stranger).setConfig(newConfig), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should emit an event', async () => { - await expect( - upkeepBalanceMonitor.connect(owner).setConfig(newConfig), - ).to.emit(upkeepBalanceMonitor, 'ConfigSet') - }) - }) - - describe('setForwarder()', () => { - const newForwarder = randomAddress() - - it('should set the forwarder correctly', async () => { - await upkeepBalanceMonitor.connect(owner).setForwarder(newForwarder) - const forwarderAddress = await upkeepBalanceMonitor.getForwarder() - expect(forwarderAddress).to.equal(newForwarder) - }) - - it('cannot be called by a non-owner', async () => { - await expect( - upkeepBalanceMonitor.connect(stranger).setForwarder(randomAddress()), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should emit an event', async () => { - await expect( - upkeepBalanceMonitor.connect(owner).setForwarder(newForwarder), - ) - .to.emit(upkeepBalanceMonitor, 'ForwarderSet') - .withArgs(newForwarder) - }) - }) - - describe('setWatchList()', () => { - const newWatchList = [ - BigNumber.from(1), - BigNumber.from(2), - BigNumber.from(10), - ] - - it('should add addresses to the watchlist', async () => { - await upkeepBalanceMonitor - .connect(owner) - .setWatchList(registry.address, newWatchList) - const [_, upkeepIDs] = await upkeepBalanceMonitor.getWatchList() - expect(upkeepIDs[0]).to.deep.equal(newWatchList) - }) - - it('cannot be called by a non-owner', async () => { - await expect( - upkeepBalanceMonitor - .connect(stranger) - .setWatchList(registry.address, [1, 2, 3]), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should emit an event', async () => { - await expect( - upkeepBalanceMonitor - .connect(owner) - .setWatchList(registry.address, newWatchList), - ) - .to.emit(upkeepBalanceMonitor, 'WatchListSet') - .withArgs(registry.address) - }) - }) - - describe('withdraw()', () => { - const payee = randomAddress() - const withdrawAmount = 100 - - it('should withdraw funds to a payee', async () => { - const initialBalance = await linkToken.balanceOf( - upkeepBalanceMonitor.address, - ) - await upkeepBalanceMonitor.connect(owner).withdraw(withdrawAmount, payee) - const finalBalance = await linkToken.balanceOf( - upkeepBalanceMonitor.address, - ) - const payeeBalance = await linkToken.balanceOf(payee) - expect(finalBalance).to.equal(initialBalance.sub(withdrawAmount)) - expect(payeeBalance).to.equal(withdrawAmount) - }) - - it('cannot be called by a non-owner', async () => { - await expect( - upkeepBalanceMonitor.connect(stranger).withdraw(withdrawAmount, payee), - ).to.be.revertedWith('Only callable by owner') - }) - - it('should emit an event', async () => { - await expect( - upkeepBalanceMonitor.connect(owner).withdraw(withdrawAmount, payee), - ) - .to.emit(upkeepBalanceMonitor, 'FundsWithdrawn') - .withArgs(100, payee) - }) - }) - - describe('pause() and unpause()', () => { - it('should pause and unpause the contract', async () => { - await upkeepBalanceMonitor.connect(owner).pause() - expect(await upkeepBalanceMonitor.paused()).to.be.true - await upkeepBalanceMonitor.connect(owner).unpause() - expect(await upkeepBalanceMonitor.paused()).to.be.false - }) - - it('cannot be called by a non-owner', async () => { - await expect( - upkeepBalanceMonitor.connect(stranger).pause(), - ).to.be.revertedWith('Only callable by owner') - await upkeepBalanceMonitor.connect(owner).pause() - await expect( - upkeepBalanceMonitor.connect(stranger).unpause(), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('checkUpkeep() / getUnderfundedUpkeeps()', () => { - it('should find the underfunded upkeeps', async () => { - let [upkeepIDs, registries, topUpAmounts] = - await upkeepBalanceMonitor.getUnderfundedUpkeeps() - expect(upkeepIDs.length).to.equal(0) - expect(registries.length).to.equal(0) - expect(topUpAmounts.length).to.equal(0) - let [upkeepNeeded, performData] = - await upkeepBalanceMonitor.checkUpkeep('0x') - expect(upkeepNeeded).to.be.false - expect(performData).to.equal('0x') - // update the balance for some upkeeps - await registry.mock.getBalance.withArgs(2).returns(120) - await registry.mock.getBalance.withArgs(4).returns(15) - await registry.mock.getBalance.withArgs(5).returns(0) - ;[upkeepIDs, registries, topUpAmounts] = - await upkeepBalanceMonitor.getUnderfundedUpkeeps() - expect(upkeepIDs.map((v) => v.toNumber())).to.deep.equal([2, 4, 5]) - expect(registries).to.deep.equal([ - registry.address, - registry.address, - registry.address, - ]) - expect(topUpAmounts.map((v) => v.toNumber())).to.deep.equal([ - 180, 285, 300, - ]) - ;[upkeepNeeded, performData] = - await upkeepBalanceMonitor.checkUpkeep('0x') - expect(upkeepNeeded).to.be.true - expect(performData).to.equal( - ethers.utils.defaultAbiCoder.encode( - ['uint256[]', 'address[]', 'uint256[]'], - [ - [2, 4, 5], - [registry.address, registry.address, registry.address], - [180, 285, 300], - ], - ), - ) - // update all to need funding - for (let i = 0; i < 9; i++) { - await registry.mock.getBalance.withArgs(i).returns(0) - } - for (let i = 9; i < 12; i++) { - await registry2.mock.getBalance.withArgs(i).returns(0) - } - // only the max batch size are included in the list - ;[upkeepIDs, registries, topUpAmounts] = - await upkeepBalanceMonitor.getUnderfundedUpkeeps() - expect(upkeepIDs.length).to.equal(10) - expect(topUpAmounts.length).to.equal(10) - expect(upkeepIDs.map((v) => v.toNumber())).to.deep.equal([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - ]) - expect(registries).to.deep.equal([ - ...Array(9).fill(registry.address), - registry2.address, - ]) - expect(topUpAmounts.map((v) => v.toNumber())).to.deep.equal([ - ...Array(10).fill(300), - ]) - // update the balance for some upkeeps - await registry.mock.getBalance.withArgs(0).returns(300) - await registry.mock.getBalance.withArgs(5).returns(300) - ;[upkeepIDs, registries, topUpAmounts] = - await upkeepBalanceMonitor.getUnderfundedUpkeeps() - expect(upkeepIDs.length).to.equal(10) - expect(topUpAmounts.length).to.equal(10) - expect(upkeepIDs.map((v) => v.toNumber())).to.deep.equal([ - 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, - ]) - expect(registries).to.deep.equal([ - ...Array(7).fill(registry.address), - ...Array(3).fill(registry2.address), - ]) - expect(topUpAmounts.map((v) => v.toNumber())).to.deep.equal([ - ...Array(10).fill(300), - ]) - }) - }) - - describe('topUp()', () => { - beforeEach(async () => { - await registry.mock.onTokenTransfer - .withArgs( - upkeepBalanceMonitor.address, - 100, - ethers.utils.defaultAbiCoder.encode(['uint256'], [1]), - ) - .returns() - await registry.mock.onTokenTransfer - .withArgs( - upkeepBalanceMonitor.address, - 50, - ethers.utils.defaultAbiCoder.encode(['uint256'], [7]), - ) - .returns() - }) - - it('cannot be called by a non-owner', async () => { - await expect( - upkeepBalanceMonitor.connect(stranger).topUp([], [], []), - ).to.be.revertedWithCustomError( - upkeepBalanceMonitor, - 'OnlyForwarderOrOwner', - ) - }) - - it('should revert if the contract is paused', async () => { - await upkeepBalanceMonitor.connect(owner).pause() - await expect( - upkeepBalanceMonitor.connect(owner).topUp([], [], []), - ).to.be.revertedWith('Pausable: paused') - }) - - it('tops up the upkeeps by the amounts provided', async () => { - const initialBalance = await linkToken.balanceOf(registry.address) - const tx = await upkeepBalanceMonitor - .connect(owner) - .topUp([1, 7], [registry.address, registry.address], [100, 50]) - const finalBalance = await linkToken.balanceOf(registry.address) - expect(finalBalance).to.equal(initialBalance.add(150)) - await expect(tx) - .to.emit(upkeepBalanceMonitor, 'TopUpSucceeded') - .withArgs(1, 100) - await expect(tx) - .to.emit(upkeepBalanceMonitor, 'TopUpSucceeded') - .withArgs(7, 50) - }) - - it('does not abort if one top-up fails', async () => { - const initialBalance = await linkToken.balanceOf(registry.address) - const tx = await upkeepBalanceMonitor - .connect(owner) - .topUp( - [1, 7, 100], - [registry.address, registry.address, registry.address], - [100, 50, 100], - ) - const finalBalance = await linkToken.balanceOf(registry.address) - expect(finalBalance).to.equal(initialBalance.add(150)) - await expect(tx) - .to.emit(upkeepBalanceMonitor, 'TopUpSucceeded') - .withArgs(1, 100) - await expect(tx) - .to.emit(upkeepBalanceMonitor, 'TopUpSucceeded') - .withArgs(7, 50) - await expect(tx) - .to.emit(upkeepBalanceMonitor, 'TopUpFailed') - .withArgs(100) - }) - }) - - describe('checkUpkeep() / performUpkeep()', () => { - it('works round-trip', async () => { - await registry.mock.getBalance.withArgs(1).returns(100) // needs 200 - await registry.mock.getBalance.withArgs(7).returns(0) // needs 300 - await registry.mock.onTokenTransfer - .withArgs( - upkeepBalanceMonitor.address, - 200, - ethers.utils.defaultAbiCoder.encode(['uint256'], [1]), - ) - .returns() - await registry.mock.onTokenTransfer - .withArgs( - upkeepBalanceMonitor.address, - 300, - ethers.utils.defaultAbiCoder.encode(['uint256'], [7]), - ) - .returns() - const [upkeepNeeded, performData] = - await upkeepBalanceMonitor.checkUpkeep('0x') - expect(upkeepNeeded).to.be.true - const initialBalance = await linkToken.balanceOf(registry.address) - await upkeepBalanceMonitor.connect(owner).performUpkeep(performData) - const finalBalance = await linkToken.balanceOf(registry.address) - expect(finalBalance).to.equal(initialBalance.add(500)) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts b/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts deleted file mode 100644 index 7fd811d8226..00000000000 --- a/contracts/test/v0.8/automation/UpkeepTranscoder3_0.test.ts +++ /dev/null @@ -1,576 +0,0 @@ -import { ethers } from 'hardhat' -import { assert, expect } from 'chai' -import { UpkeepTranscoder30__factory as UpkeepTranscoderFactory } from '../../../typechain/factories/UpkeepTranscoder30__factory' -import { UpkeepTranscoder30 as UpkeepTranscoder } from '../../../typechain/UpkeepTranscoder30' -import { KeeperRegistry2_0__factory as KeeperRegistry2_0Factory } from '../../../typechain/factories/KeeperRegistry2_0__factory' -import { LinkToken__factory as LinkTokenFactory } from '../../../typechain/factories/LinkToken__factory' -import { MockV3Aggregator__factory as MockV3AggregatorFactory } from '../../../typechain/factories/MockV3Aggregator__factory' -import { UpkeepMock__factory as UpkeepMockFactory } from '../../../typechain/factories/UpkeepMock__factory' -import { evmRevert } from '../../test-helpers/matchers' -import { BigNumber, Signer } from 'ethers' -import { getUsers, Personas } from '../../test-helpers/setup' -import { KeeperRegistryLogic2_0__factory as KeeperRegistryLogic20Factory } from '../../../typechain/factories/KeeperRegistryLogic2_0__factory' -import { KeeperRegistry1_3__factory as KeeperRegistry1_3Factory } from '../../../typechain/factories/KeeperRegistry1_3__factory' -import { KeeperRegistryLogic1_3__factory as KeeperRegistryLogicFactory } from '../../../typechain/factories/KeeperRegistryLogic1_3__factory' -import { toWei } from '../../test-helpers/helpers' -import { LinkToken } from '../../../typechain' - -let upkeepMockFactory: UpkeepMockFactory -let upkeepTranscoderFactory: UpkeepTranscoderFactory -let transcoder: UpkeepTranscoder -let linkTokenFactory: LinkTokenFactory -let mockV3AggregatorFactory: MockV3AggregatorFactory -let keeperRegistryFactory20: KeeperRegistry2_0Factory -let keeperRegistryFactory13: KeeperRegistry1_3Factory -let keeperRegistryLogicFactory20: KeeperRegistryLogic20Factory -let keeperRegistryLogicFactory13: KeeperRegistryLogicFactory -let personas: Personas -let owner: Signer -let upkeepsV1: any[] -let upkeepsV2: any[] -let upkeepsV3: any[] -let admins: string[] -let admin0: Signer -let admin1: Signer -const executeGas = BigNumber.from('100000') -const paymentPremiumPPB = BigNumber.from('250000000') -const flatFeeMicroLink = BigNumber.from(0) -const blockCountPerTurn = BigNumber.from(3) -const randomBytes = '0x1234abcd' -const stalenessSeconds = BigNumber.from(43820) -const gasCeilingMultiplier = BigNumber.from(1) -const checkGasLimit = BigNumber.from(20000000) -const fallbackGasPrice = BigNumber.from(200) -const fallbackLinkPrice = BigNumber.from(200000000) -const maxPerformGas = BigNumber.from(5000000) -const minUpkeepSpend = BigNumber.from(0) -const maxCheckDataSize = BigNumber.from(1000) -const maxPerformDataSize = BigNumber.from(1000) -const mode = BigNumber.from(0) -const linkEth = BigNumber.from(300000000) -const gasWei = BigNumber.from(100) -const registryGasOverhead = BigNumber.from('80000') -const balance = 50000000000000 -const amountSpent = 200000000000000 -const target0 = '0xffffffffffffffffffffffffffffffffffffffff' -const target1 = '0xfffffffffffffffffffffffffffffffffffffffe' -const lastKeeper0 = '0x233a95ccebf3c9f934482c637c08b4015cdd6ddd' -const lastKeeper1 = '0x233a95ccebf3c9f934482c637c08b4015cdd6ddc' -enum UpkeepFormat { - V1, - V2, - V3, - V4, -} -const idx = [123, 124] - -async function getUpkeepID(tx: any) { - const receipt = await tx.wait() - return receipt.events[0].args.id -} - -const encodeConfig = (config: any) => { - return ethers.utils.defaultAbiCoder.encode( - [ - 'tuple(uint32 paymentPremiumPPB,uint32 flatFeeMicroLink,uint32 checkGasLimit,uint24 stalenessSeconds\ - ,uint16 gasCeilingMultiplier,uint96 minUpkeepSpend,uint32 maxPerformGas,uint32 maxCheckDataSize,\ - uint32 maxPerformDataSize,uint256 fallbackGasPrice,uint256 fallbackLinkPrice,address transcoder,\ - address registrar)', - ], - [config], - ) -} - -const encodeUpkeepV1 = (ids: number[], upkeeps: any[], checkDatas: any[]) => { - return ethers.utils.defaultAbiCoder.encode( - [ - 'uint256[]', - 'tuple(uint96,address,uint32,uint64,address,uint96,address)[]', - 'bytes[]', - ], - [ids, upkeeps, checkDatas], - ) -} - -const encodeUpkeepV2 = (ids: number[], upkeeps: any[], checkDatas: any[]) => { - return ethers.utils.defaultAbiCoder.encode( - [ - 'uint256[]', - 'tuple(uint96,address,uint96,address,uint32,uint32,address,bool)[]', - 'bytes[]', - ], - [ids, upkeeps, checkDatas], - ) -} - -const encodeUpkeepV3 = ( - ids: number[], - upkeeps: any[], - checkDatas: any[], - admins: string[], -) => { - return ethers.utils.defaultAbiCoder.encode( - [ - 'uint256[]', - 'tuple(uint32,uint32,bool,address,uint96,uint96,uint32)[]', - 'bytes[]', - 'address[]', - ], - [ids, upkeeps, checkDatas, admins], - ) -} - -before(async () => { - // @ts-ignore bug in autogen file - upkeepTranscoderFactory = await ethers.getContractFactory( - 'UpkeepTranscoder3_0', - ) - personas = (await getUsers()).personas - - linkTokenFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - ) - // need full path because there are two contracts with name MockV3Aggregator - mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', - )) as unknown as MockV3AggregatorFactory - - upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') - - owner = personas.Norbert - admin0 = personas.Neil - admin1 = personas.Nick - admins = [ - (await admin0.getAddress()).toLowerCase(), - (await admin1.getAddress()).toLowerCase(), - ] -}) - -async function deployLinkToken() { - return await linkTokenFactory.connect(owner).deploy() -} - -async function deployFeeds() { - return [ - await mockV3AggregatorFactory.connect(owner).deploy(0, gasWei), - await mockV3AggregatorFactory.connect(owner).deploy(9, linkEth), - ] -} - -async function deployLegacyRegistry1_2( - linkToken: LinkToken, - gasPriceFeed: any, - linkEthFeed: any, -) { - const mock = await upkeepMockFactory.deploy() - // @ts-ignore bug in autogen file - const keeperRegistryFactory = - await ethers.getContractFactory('KeeperRegistry1_2') - transcoder = await upkeepTranscoderFactory.connect(owner).deploy() - const legacyRegistry = await keeperRegistryFactory - .connect(owner) - .deploy(linkToken.address, linkEthFeed.address, gasPriceFeed.address, { - paymentPremiumPPB, - flatFeeMicroLink, - blockCountPerTurn, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrar: ethers.constants.AddressZero, - }) - const tx = await legacyRegistry - .connect(owner) - .registerUpkeep( - mock.address, - executeGas, - await admin0.getAddress(), - randomBytes, - ) - const id = await getUpkeepID(tx) - return [id, legacyRegistry] -} - -async function deployLegacyRegistry1_3( - linkToken: LinkToken, - gasPriceFeed: any, - linkEthFeed: any, -) { - const mock = await upkeepMockFactory.deploy() - // @ts-ignore bug in autogen file - keeperRegistryFactory13 = await ethers.getContractFactory('KeeperRegistry1_3') - // @ts-ignore bug in autogen file - keeperRegistryLogicFactory13 = await ethers.getContractFactory( - 'KeeperRegistryLogic1_3', - ) - - const registryLogic13 = await keeperRegistryLogicFactory13 - .connect(owner) - .deploy( - 0, - registryGasOverhead, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - ) - - const config = { - paymentPremiumPPB, - flatFeeMicroLink, - blockCountPerTurn, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrar: ethers.constants.AddressZero, - } - const Registry1_3 = await keeperRegistryFactory13 - .connect(owner) - .deploy(registryLogic13.address, config) - - const tx = await Registry1_3.connect(owner).registerUpkeep( - mock.address, - executeGas, - await admin0.getAddress(), - randomBytes, - ) - const id = await getUpkeepID(tx) - - return [id, Registry1_3] -} - -async function deployRegistry2_0( - linkToken: LinkToken, - gasPriceFeed: any, - linkEthFeed: any, -) { - // @ts-ignore bug in autogen file - keeperRegistryFactory20 = await ethers.getContractFactory('KeeperRegistry2_0') - // @ts-ignore bug in autogen file - keeperRegistryLogicFactory20 = await ethers.getContractFactory( - 'KeeperRegistryLogic2_0', - ) - - const config = { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrar: ethers.constants.AddressZero, - } - - const registryLogic = await keeperRegistryLogicFactory20 - .connect(owner) - .deploy(mode, linkToken.address, linkEthFeed.address, gasPriceFeed.address) - - const Registry2_0 = await keeperRegistryFactory20 - .connect(owner) - .deploy(registryLogic.address) - - // deploys a registry, setups of initial configuration, registers an upkeep - const keeper1 = personas.Carol - const keeper2 = personas.Eddy - const keeper3 = personas.Nancy - const keeper4 = personas.Norbert - const keeper5 = personas.Nick - const payee1 = personas.Nelly - const payee2 = personas.Norbert - const payee3 = personas.Nick - const payee4 = personas.Eddy - const payee5 = personas.Carol - // signers - const signer1 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000001', - ) - const signer2 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000002', - ) - const signer3 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000003', - ) - const signer4 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000004', - ) - const signer5 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000005', - ) - - const keeperAddresses = [ - await keeper1.getAddress(), - await keeper2.getAddress(), - await keeper3.getAddress(), - await keeper4.getAddress(), - await keeper5.getAddress(), - ] - const payees = [ - await payee1.getAddress(), - await payee2.getAddress(), - await payee3.getAddress(), - await payee4.getAddress(), - await payee5.getAddress(), - ] - const signers = [signer1, signer2, signer3, signer4, signer5] - - const signerAddresses = [] - for (const signer of signers) { - signerAddresses.push(await signer.getAddress()) - } - - const f = 1 - const offchainVersion = 1 - const offchainBytes = '0x' - - await Registry2_0.connect(owner).setConfig( - signerAddresses, - keeperAddresses, - f, - encodeConfig(config), - offchainVersion, - offchainBytes, - ) - await Registry2_0.connect(owner).setPayees(payees) - return Registry2_0 -} - -describe('UpkeepTranscoder3_0', () => { - beforeEach(async () => { - transcoder = await upkeepTranscoderFactory.connect(owner).deploy() - }) - - describe('#typeAndVersion', () => { - it('uses the correct type and version', async () => { - const typeAndVersion = await transcoder.typeAndVersion() - assert.equal(typeAndVersion, 'UpkeepTranscoder 3.0.0') - }) - }) - - describe('#transcodeUpkeeps', () => { - const encodedData = '0xabcd' - - it('reverts if the from type is not V1 or V2', async () => { - await evmRevert( - transcoder.transcodeUpkeeps( - UpkeepFormat.V3, - UpkeepFormat.V1, - encodedData, - ), - ) - await evmRevert( - transcoder.transcodeUpkeeps( - UpkeepFormat.V4, - UpkeepFormat.V1, - encodedData, - ), - ) - }) - - context('when from and to versions are correct', () => { - upkeepsV3 = [ - [executeGas, 2 ** 32 - 1, false, target0, amountSpent, balance, 0], - [executeGas, 2 ** 32 - 1, false, target1, amountSpent, balance, 0], - ] - - it('transcodes V1 upkeeps to V3 properly, regardless of toVersion value', async () => { - upkeepsV1 = [ - [ - balance, - lastKeeper0, - executeGas, - 2 ** 32, - target0, - amountSpent, - await admin0.getAddress(), - ], - [ - balance, - lastKeeper1, - executeGas, - 2 ** 32, - target1, - amountSpent, - await admin1.getAddress(), - ], - ] - - const data = await transcoder.transcodeUpkeeps( - UpkeepFormat.V1, - UpkeepFormat.V1, - encodeUpkeepV1(idx, upkeepsV1, ['0xabcd', '0xffff']), - ) - assert.equal( - encodeUpkeepV3(idx, upkeepsV3, ['0xabcd', '0xffff'], admins), - data, - ) - }) - - it('transcodes V2 upkeeps to V3 properly, regardless of toVersion value', async () => { - upkeepsV2 = [ - [ - balance, - lastKeeper0, - amountSpent, - await admin0.getAddress(), - executeGas, - 2 ** 32 - 1, - target0, - false, - ], - [ - balance, - lastKeeper1, - amountSpent, - await admin1.getAddress(), - executeGas, - 2 ** 32 - 1, - target1, - false, - ], - ] - - const data = await transcoder.transcodeUpkeeps( - UpkeepFormat.V2, - UpkeepFormat.V2, - encodeUpkeepV2(idx, upkeepsV2, ['0xabcd', '0xffff']), - ) - assert.equal( - encodeUpkeepV3(idx, upkeepsV3, ['0xabcd', '0xffff'], admins), - data, - ) - }) - - it('migrates upkeeps from 1.2 registry to 2.0', async () => { - const linkToken = await deployLinkToken() - const [gasPriceFeed, linkEthFeed] = await deployFeeds() - const [id, legacyRegistry] = await deployLegacyRegistry1_2( - linkToken, - gasPriceFeed, - linkEthFeed, - ) - const Registry2_0 = await deployRegistry2_0( - linkToken, - gasPriceFeed, - linkEthFeed, - ) - - await linkToken - .connect(owner) - .approve(legacyRegistry.address, toWei('1000')) - await legacyRegistry.connect(owner).addFunds(id, toWei('1000')) - - // set outgoing permission to registry 2_0 and incoming permission for registry 1_2 - await legacyRegistry.setPeerRegistryMigrationPermission( - Registry2_0.address, - 1, - ) - await Registry2_0.setPeerRegistryMigrationPermission( - legacyRegistry.address, - 2, - ) - - expect((await legacyRegistry.getUpkeep(id)).balance).to.equal( - toWei('1000'), - ) - expect((await legacyRegistry.getUpkeep(id)).checkData).to.equal( - randomBytes, - ) - expect((await legacyRegistry.getState()).state.numUpkeeps).to.equal(1) - - await legacyRegistry - .connect(admin0) - .migrateUpkeeps([id], Registry2_0.address) - - expect((await legacyRegistry.getState()).state.numUpkeeps).to.equal(0) - expect((await Registry2_0.getState()).state.numUpkeeps).to.equal(1) - expect((await legacyRegistry.getUpkeep(id)).balance).to.equal(0) - expect((await legacyRegistry.getUpkeep(id)).checkData).to.equal('0x') - expect((await Registry2_0.getUpkeep(id)).balance).to.equal( - toWei('1000'), - ) - expect( - (await Registry2_0.getState()).state.expectedLinkBalance, - ).to.equal(toWei('1000')) - expect(await linkToken.balanceOf(Registry2_0.address)).to.equal( - toWei('1000'), - ) - expect((await Registry2_0.getUpkeep(id)).checkData).to.equal( - randomBytes, - ) - }) - - it('migrates upkeeps from 1.3 registry to 2.0', async () => { - const linkToken = await deployLinkToken() - const [gasPriceFeed, linkEthFeed] = await deployFeeds() - const [id, legacyRegistry] = await deployLegacyRegistry1_3( - linkToken, - gasPriceFeed, - linkEthFeed, - ) - const Registry2_0 = await deployRegistry2_0( - linkToken, - gasPriceFeed, - linkEthFeed, - ) - - await linkToken - .connect(owner) - .approve(legacyRegistry.address, toWei('1000')) - await legacyRegistry.connect(owner).addFunds(id, toWei('1000')) - - // set outgoing permission to registry 2_0 and incoming permission for registry 1_3 - await legacyRegistry.setPeerRegistryMigrationPermission( - Registry2_0.address, - 1, - ) - await Registry2_0.setPeerRegistryMigrationPermission( - legacyRegistry.address, - 2, - ) - - expect((await legacyRegistry.getUpkeep(id)).balance).to.equal( - toWei('1000'), - ) - expect((await legacyRegistry.getUpkeep(id)).checkData).to.equal( - randomBytes, - ) - expect((await legacyRegistry.getState()).state.numUpkeeps).to.equal(1) - - await legacyRegistry - .connect(admin0) - .migrateUpkeeps([id], Registry2_0.address) - - expect((await legacyRegistry.getState()).state.numUpkeeps).to.equal(0) - expect((await Registry2_0.getState()).state.numUpkeeps).to.equal(1) - expect((await legacyRegistry.getUpkeep(id)).balance).to.equal(0) - expect((await legacyRegistry.getUpkeep(id)).checkData).to.equal('0x') - expect((await Registry2_0.getUpkeep(id)).balance).to.equal( - toWei('1000'), - ) - expect( - (await Registry2_0.getState()).state.expectedLinkBalance, - ).to.equal(toWei('1000')) - expect(await linkToken.balanceOf(Registry2_0.address)).to.equal( - toWei('1000'), - ) - expect((await Registry2_0.getUpkeep(id)).checkData).to.equal( - randomBytes, - ) - }) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts b/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts deleted file mode 100644 index b49dfb1d5b4..00000000000 --- a/contracts/test/v0.8/automation/UpkeepTranscoder4_0.test.ts +++ /dev/null @@ -1,654 +0,0 @@ -import { ethers } from 'hardhat' -import { assert, expect } from 'chai' -import { UpkeepTranscoder4_0 as UpkeepTranscoder } from '../../../typechain/UpkeepTranscoder4_0' -import { KeeperRegistry2_0__factory as KeeperRegistry2_0Factory } from '../../../typechain/factories/KeeperRegistry2_0__factory' -import { LinkToken__factory as LinkTokenFactory } from '../../../typechain/factories/LinkToken__factory' -import { MockV3Aggregator__factory as MockV3AggregatorFactory } from '../../../typechain/factories/MockV3Aggregator__factory' -import { evmRevert } from '../../test-helpers/matchers' -import { BigNumber, Signer } from 'ethers' -import { getUsers, Personas } from '../../test-helpers/setup' -import { KeeperRegistryLogic2_0__factory as KeeperRegistryLogic20Factory } from '../../../typechain/factories/KeeperRegistryLogic2_0__factory' -import { KeeperRegistry1_3__factory as KeeperRegistry1_3Factory } from '../../../typechain/factories/KeeperRegistry1_3__factory' -import { KeeperRegistryLogic1_3__factory as KeeperRegistryLogicFactory } from '../../../typechain/factories/KeeperRegistryLogic1_3__factory' -import { UpkeepTranscoder4_0__factory as UpkeepTranscoderFactory } from '../../../typechain/factories/UpkeepTranscoder4_0__factory' -import { toWei } from '../../test-helpers/helpers' -import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' -import { - IKeeperRegistryMaster, - KeeperRegistry1_2, - KeeperRegistry1_3, - KeeperRegistry2_0, - LinkToken, - MockV3Aggregator, - UpkeepMock, -} from '../../../typechain' -import { deployRegistry21 } from './helpers' - -////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////// - -/*********************************** TRANSCODER v4.0 IS FROZEN ************************************/ - -// We are leaving the original tests enabled, however as automation v2.1 is still actively being deployed - -describe('UpkeepTranscoder v4.0 - Frozen [ @skip-coverage ]', () => { - it('has not changed', () => { - assert.equal( - ethers.utils.id(UpkeepTranscoderFactory.bytecode), - '0xf22c4701b0088e6e69c389a34a22041a69f00890a89246e3c2a6d38172222dae', - 'UpkeepTranscoder bytecode has changed', - ) - }) -}) - -////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////// - -let transcoder: UpkeepTranscoder -let linkTokenFactory: LinkTokenFactory -let keeperRegistryFactory20: KeeperRegistry2_0Factory -let keeperRegistryFactory13: KeeperRegistry1_3Factory -let keeperRegistryLogicFactory20: KeeperRegistryLogic20Factory -let keeperRegistryLogicFactory13: KeeperRegistryLogicFactory -let linkToken: LinkToken -let registry12: KeeperRegistry1_2 -let registry13: KeeperRegistry1_3 -let registry20: KeeperRegistry2_0 -let registry21: IKeeperRegistryMaster -let gasPriceFeed: MockV3Aggregator -let linkEthFeed: MockV3Aggregator -let mock: UpkeepMock -let personas: Personas -let owner: Signer -let upkeepsV12: any[] -let upkeepsV13: any[] -let upkeepsV21: any[] -let admins: string[] -let admin0: Signer -let admin1: Signer -let id12: BigNumber -let id13: BigNumber -let id20: BigNumber -const executeGas = BigNumber.from('100000') -const paymentPremiumPPB = BigNumber.from('250000000') -const flatFeeMicroLink = BigNumber.from(0) -const blockCountPerTurn = BigNumber.from(3) -const randomBytes = '0x1234abcd' -const stalenessSeconds = BigNumber.from(43820) -const gasCeilingMultiplier = BigNumber.from(1) -const checkGasLimit = BigNumber.from(20000000) -const fallbackGasPrice = BigNumber.from(200) -const fallbackLinkPrice = BigNumber.from(200000000) -const maxPerformGas = BigNumber.from(5000000) -const minUpkeepSpend = BigNumber.from(0) -const maxCheckDataSize = BigNumber.from(1000) -const maxPerformDataSize = BigNumber.from(1000) -const mode = BigNumber.from(0) -const linkEth = BigNumber.from(300000000) -const gasWei = BigNumber.from(100) -const registryGasOverhead = BigNumber.from('80000') -const balance = 50000000000000 -const amountSpent = 200000000000000 -const { AddressZero } = ethers.constants -const target0 = '0xffffffffffffffffffffffffffffffffffffffff' -const target1 = '0xfffffffffffffffffffffffffffffffffffffffe' -const lastKeeper0 = '0x233a95ccebf3c9f934482c637c08b4015cdd6ddd' -const lastKeeper1 = '0x233a95ccebf3c9f934482c637c08b4015cdd6ddc' - -const f = 1 -const offchainVersion = 1 -const offchainBytes = '0x' -let keeperAddresses: string[] -let signerAddresses: string[] -let payees: string[] - -enum UpkeepFormat { - V12, - V13, - V20, - V21, - V30, // Does not exist -} -const idx = [123, 124] - -async function getUpkeepID(tx: any): Promise { - const receipt = await tx.wait() - return receipt.events[0].args.id -} - -const encodeConfig20 = (config: any) => { - return ethers.utils.defaultAbiCoder.encode( - [ - 'tuple(uint32 paymentPremiumPPB,uint32 flatFeeMicroLink,uint32 checkGasLimit,uint24 stalenessSeconds\ - ,uint16 gasCeilingMultiplier,uint96 minUpkeepSpend,uint32 maxPerformGas,uint32 maxCheckDataSize,\ - uint32 maxPerformDataSize,uint256 fallbackGasPrice,uint256 fallbackLinkPrice,address transcoder,\ - address registrar)', - ], - [config], - ) -} - -const encodeUpkeepV12 = (ids: number[], upkeeps: any[], checkDatas: any[]) => { - return ethers.utils.defaultAbiCoder.encode( - [ - 'uint256[]', - 'tuple(uint96,address,uint32,uint64,address,uint96,address)[]', - 'bytes[]', - ], - [ids, upkeeps, checkDatas], - ) -} - -async function deployRegistry1_2(): Promise<[BigNumber, KeeperRegistry1_2]> { - const keeperRegistryFactory = - await ethers.getContractFactory('KeeperRegistry1_2') - const registry12 = await keeperRegistryFactory - .connect(owner) - .deploy(linkToken.address, linkEthFeed.address, gasPriceFeed.address, { - paymentPremiumPPB, - flatFeeMicroLink, - blockCountPerTurn, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrar: ethers.constants.AddressZero, - }) - const tx = await registry12 - .connect(owner) - .registerUpkeep( - mock.address, - executeGas, - await admin0.getAddress(), - randomBytes, - ) - const id = await getUpkeepID(tx) - return [id, registry12] -} - -async function deployRegistry1_3(): Promise<[BigNumber, KeeperRegistry1_3]> { - keeperRegistryFactory13 = await ethers.getContractFactory('KeeperRegistry1_3') - keeperRegistryLogicFactory13 = await ethers.getContractFactory( - 'KeeperRegistryLogic1_3', - ) - - const registryLogic13 = await keeperRegistryLogicFactory13 - .connect(owner) - .deploy( - 0, - registryGasOverhead, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - ) - - const config = { - paymentPremiumPPB, - flatFeeMicroLink, - blockCountPerTurn, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrar: ethers.constants.AddressZero, - } - const registry13 = await keeperRegistryFactory13 - .connect(owner) - .deploy(registryLogic13.address, config) - - const tx = await registry13 - .connect(owner) - .registerUpkeep( - mock.address, - executeGas, - await admin0.getAddress(), - randomBytes, - ) - const id = await getUpkeepID(tx) - - return [id, registry13] -} - -async function deployRegistry2_0(): Promise<[BigNumber, KeeperRegistry2_0]> { - keeperRegistryFactory20 = await ethers.getContractFactory('KeeperRegistry2_0') - keeperRegistryLogicFactory20 = await ethers.getContractFactory( - 'KeeperRegistryLogic2_0', - ) - - const config = { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: transcoder.address, - registrar: ethers.constants.AddressZero, - } - - const registryLogic = await keeperRegistryLogicFactory20 - .connect(owner) - .deploy(mode, linkToken.address, linkEthFeed.address, gasPriceFeed.address) - - const registry20 = await keeperRegistryFactory20 - .connect(owner) - .deploy(registryLogic.address) - - await registry20 - .connect(owner) - .setConfig( - signerAddresses, - keeperAddresses, - f, - encodeConfig20(config), - offchainVersion, - offchainBytes, - ) - await registry20.connect(owner).setPayees(payees) - - const tx = await registry20 - .connect(owner) - .registerUpkeep( - mock.address, - executeGas, - await admin0.getAddress(), - randomBytes, - randomBytes, - ) - const id = await getUpkeepID(tx) - - return [id, registry20] -} - -async function deployRegistry2_1() { - const registry = await deployRegistry21( - owner, - mode, - linkToken.address, - linkEthFeed.address, - gasPriceFeed.address, - ) - - const onchainConfig = { - paymentPremiumPPB, - flatFeeMicroLink, - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - minUpkeepSpend, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize: 1000, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - transcoder: ethers.constants.AddressZero, - registrars: [], - upkeepPrivilegeManager: await owner.getAddress(), - } - - await registry - .connect(owner) - .setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - onchainConfig, - offchainVersion, - offchainBytes, - ) - - return registry -} - -const setup = async () => { - personas = (await getUsers()).personas - owner = personas.Norbert - admin0 = personas.Neil - admin1 = personas.Nick - admins = [ - (await admin0.getAddress()).toLowerCase(), - (await admin1.getAddress()).toLowerCase(), - ] - - const upkeepTranscoderFactory = await ethers.getContractFactory( - 'UpkeepTranscoder4_0', - ) - transcoder = await upkeepTranscoderFactory.connect(owner).deploy() - - linkTokenFactory = await ethers.getContractFactory( - 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', - ) - linkToken = await linkTokenFactory.connect(owner).deploy() - // need full path because there are two contracts with name MockV3Aggregator - const mockV3AggregatorFactory = (await ethers.getContractFactory( - 'src/v0.8/shared/mocks/MockV3Aggregator.sol:MockV3Aggregator', - )) as unknown as MockV3AggregatorFactory - - gasPriceFeed = await mockV3AggregatorFactory.connect(owner).deploy(0, gasWei) - linkEthFeed = await mockV3AggregatorFactory.connect(owner).deploy(9, linkEth) - - const upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') - mock = await upkeepMockFactory.deploy() - - const keeper1 = personas.Carol - const keeper2 = personas.Eddy - const keeper3 = personas.Nancy - const keeper4 = personas.Norbert - const keeper5 = personas.Nick - const payee1 = personas.Nelly - const payee2 = personas.Norbert - const payee3 = personas.Nick - const payee4 = personas.Eddy - const payee5 = personas.Carol - // signers - const signer1 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000001', - ) - const signer2 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000002', - ) - const signer3 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000003', - ) - const signer4 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000004', - ) - const signer5 = new ethers.Wallet( - '0x7777777000000000000000000000000000000000000000000000000000000005', - ) - - keeperAddresses = [ - await keeper1.getAddress(), - await keeper2.getAddress(), - await keeper3.getAddress(), - await keeper4.getAddress(), - await keeper5.getAddress(), - ] - - payees = [ - await payee1.getAddress(), - await payee2.getAddress(), - await payee3.getAddress(), - await payee4.getAddress(), - await payee5.getAddress(), - ] - const signers = [signer1, signer2, signer3, signer4, signer5] - - signerAddresses = signers.map((signer) => signer.address) - ;[id12, registry12] = await deployRegistry1_2() - ;[id13, registry13] = await deployRegistry1_3() - ;[id20, registry20] = await deployRegistry2_0() - registry21 = await deployRegistry2_1() - - upkeepsV12 = [ - [ - balance, - lastKeeper0, - executeGas, - 2 ** 32, - target0, - amountSpent, - await admin0.getAddress(), - ], - [ - balance, - lastKeeper1, - executeGas, - 2 ** 32, - target1, - amountSpent, - await admin1.getAddress(), - ], - ] - - upkeepsV13 = [ - [ - balance, - lastKeeper0, - amountSpent, - await admin0.getAddress(), - executeGas, - 2 ** 32 - 1, - target0, - false, - ], - [ - balance, - lastKeeper1, - amountSpent, - await admin1.getAddress(), - executeGas, - 2 ** 32 - 1, - target1, - false, - ], - ] - - upkeepsV21 = [ - [ - false, - executeGas, - 2 ** 32 - 1, - AddressZero, // forwarder will always be zero - amountSpent, - balance, - 0, - target0, - ], - [ - false, - executeGas, - 2 ** 32 - 1, - AddressZero, // forwarder will always be zero - amountSpent, - balance, - 0, - target1, - ], - ] -} - -describe('UpkeepTranscoder4_0', () => { - beforeEach(async () => { - await loadFixture(setup) - }) - - describe('#typeAndVersion', () => { - it('uses the correct type and version', async () => { - const typeAndVersion = await transcoder.typeAndVersion() - assert.equal(typeAndVersion, 'UpkeepTranscoder 4.0.0') - }) - }) - - describe('#transcodeUpkeeps', () => { - const encodedData = '0xabcd' - - it('reverts if the from type is not v1.2, v1.3, v2.0, or v2.1', async () => { - await evmRevert( - transcoder.transcodeUpkeeps( - UpkeepFormat.V30, - UpkeepFormat.V12, - encodedData, - ), - ) - }) - - context('when from version is correct', () => { - // note this is a bugfix - the "to" version should be accounted for in - // future versions of the transcoder - it('transcodes to v2.1, regardless of toVersion value', async () => { - const data1 = await transcoder.transcodeUpkeeps( - UpkeepFormat.V12, - UpkeepFormat.V12, - encodeUpkeepV12(idx, upkeepsV12, ['0xabcd', '0xffff']), - ) - const data2 = await transcoder.transcodeUpkeeps( - UpkeepFormat.V12, - UpkeepFormat.V13, - encodeUpkeepV12(idx, upkeepsV12, ['0xabcd', '0xffff']), - ) - const data3 = await transcoder.transcodeUpkeeps( - UpkeepFormat.V12, - 100, - encodeUpkeepV12(idx, upkeepsV12, ['0xabcd', '0xffff']), - ) - assert.equal(data1, data2) - assert.equal(data1, data3) - }) - - it('migrates upkeeps from 1.2 registry to 2.1', async () => { - await linkToken - .connect(owner) - .approve(registry12.address, toWei('1000')) - await registry12.connect(owner).addFunds(id12, toWei('1000')) - - await registry12.setPeerRegistryMigrationPermission( - registry21.address, - 1, - ) - await registry21.setPeerRegistryMigrationPermission( - registry12.address, - 2, - ) - - expect((await registry12.getUpkeep(id12)).balance).to.equal( - toWei('1000'), - ) - expect((await registry12.getUpkeep(id12)).checkData).to.equal( - randomBytes, - ) - expect((await registry12.getState()).state.numUpkeeps).to.equal(1) - - await registry12 - .connect(admin0) - .migrateUpkeeps([id12], registry21.address) - - expect((await registry12.getState()).state.numUpkeeps).to.equal(0) - expect((await registry21.getState()).state.numUpkeeps).to.equal(1) - expect((await registry12.getUpkeep(id12)).balance).to.equal(0) - expect((await registry12.getUpkeep(id12)).checkData).to.equal('0x') - expect((await registry21.getUpkeep(id12)).balance).to.equal( - toWei('1000'), - ) - expect( - (await registry21.getState()).state.expectedLinkBalance, - ).to.equal(toWei('1000')) - expect(await linkToken.balanceOf(registry21.address)).to.equal( - toWei('1000'), - ) - expect((await registry21.getUpkeep(id12)).checkData).to.equal( - randomBytes, - ) - expect((await registry21.getUpkeep(id12)).offchainConfig).to.equal('0x') - expect(await registry21.getUpkeepTriggerConfig(id12)).to.equal('0x') - }) - - it('migrates upkeeps from 1.3 registry to 2.1', async () => { - await linkToken - .connect(owner) - .approve(registry13.address, toWei('1000')) - await registry13.connect(owner).addFunds(id13, toWei('1000')) - - await registry13.setPeerRegistryMigrationPermission( - registry21.address, - 1, - ) - await registry21.setPeerRegistryMigrationPermission( - registry13.address, - 2, - ) - - expect((await registry13.getUpkeep(id13)).balance).to.equal( - toWei('1000'), - ) - expect((await registry13.getUpkeep(id13)).checkData).to.equal( - randomBytes, - ) - expect((await registry13.getState()).state.numUpkeeps).to.equal(1) - - await registry13 - .connect(admin0) - .migrateUpkeeps([id13], registry21.address) - - expect((await registry13.getState()).state.numUpkeeps).to.equal(0) - expect((await registry21.getState()).state.numUpkeeps).to.equal(1) - expect((await registry13.getUpkeep(id13)).balance).to.equal(0) - expect((await registry13.getUpkeep(id13)).checkData).to.equal('0x') - expect((await registry21.getUpkeep(id13)).balance).to.equal( - toWei('1000'), - ) - expect( - (await registry21.getState()).state.expectedLinkBalance, - ).to.equal(toWei('1000')) - expect(await linkToken.balanceOf(registry21.address)).to.equal( - toWei('1000'), - ) - expect((await registry21.getUpkeep(id13)).checkData).to.equal( - randomBytes, - ) - expect((await registry21.getUpkeep(id13)).offchainConfig).to.equal('0x') - expect(await registry21.getUpkeepTriggerConfig(id13)).to.equal('0x') - }) - - it('migrates upkeeps from 2.0 registry to 2.1', async () => { - await linkToken - .connect(owner) - .approve(registry20.address, toWei('1000')) - await registry20.connect(owner).addFunds(id20, toWei('1000')) - - await registry20.setPeerRegistryMigrationPermission( - registry21.address, - 1, - ) - await registry21.setPeerRegistryMigrationPermission( - registry20.address, - 2, - ) - - expect((await registry20.getUpkeep(id20)).balance).to.equal( - toWei('1000'), - ) - expect((await registry20.getUpkeep(id20)).checkData).to.equal( - randomBytes, - ) - expect((await registry20.getState()).state.numUpkeeps).to.equal(1) - - await registry20 - .connect(admin0) - .migrateUpkeeps([id20], registry21.address) - - expect((await registry20.getState()).state.numUpkeeps).to.equal(0) - expect((await registry21.getState()).state.numUpkeeps).to.equal(1) - expect((await registry20.getUpkeep(id20)).balance).to.equal(0) - expect((await registry20.getUpkeep(id20)).checkData).to.equal('0x') - expect((await registry21.getUpkeep(id20)).balance).to.equal( - toWei('1000'), - ) - expect( - (await registry21.getState()).state.expectedLinkBalance, - ).to.equal(toWei('1000')) - expect(await linkToken.balanceOf(registry21.address)).to.equal( - toWei('1000'), - ) - expect((await registry21.getUpkeep(id20)).checkData).to.equal( - randomBytes, - ) - expect(await registry21.getUpkeepTriggerConfig(id20)).to.equal('0x') - }) - }) - }) -}) diff --git a/contracts/test/v0.8/automation/helpers.ts b/contracts/test/v0.8/automation/helpers.ts index 99f2cef9b87..130bdcbfecf 100644 --- a/contracts/test/v0.8/automation/helpers.ts +++ b/contracts/test/v0.8/automation/helpers.ts @@ -1,11 +1,5 @@ import { Signer } from 'ethers' import { ethers } from 'hardhat' -import { KeeperRegistryLogicB2_1__factory as KeeperRegistryLogicBFactory } from '../../../typechain/factories/KeeperRegistryLogicB2_1__factory' -import { IKeeperRegistryMaster as IKeeperRegistry } from '../../../typechain/IKeeperRegistryMaster' -import { IKeeperRegistryMaster__factory as IKeeperRegistryMasterFactory } from '../../../typechain/factories/IKeeperRegistryMaster__factory' -import { AutomationRegistryLogicB2_2__factory as AutomationRegistryLogicBFactory } from '../../../typechain/factories/AutomationRegistryLogicB2_2__factory' -import { IAutomationRegistryMaster as IAutomationRegistry } from '../../../typechain/IAutomationRegistryMaster' -import { IAutomationRegistryMaster__factory as IAutomationRegistryMasterFactory } from '../../../typechain/factories/IAutomationRegistryMaster__factory' import { assert } from 'chai' import { FunctionFragment } from '@ethersproject/abi' import { AutomationRegistryLogicC2_3__factory as AutomationRegistryLogicC2_3Factory } from '../../../typechain/factories/AutomationRegistryLogicC2_3__factory' @@ -13,32 +7,6 @@ import { ZKSyncAutomationRegistryLogicC2_3__factory as ZKSyncAutomationRegistryL import { IAutomationRegistryMaster2_3 as IAutomationRegistry2_3 } from '../../../typechain/IAutomationRegistryMaster2_3' import { IAutomationRegistryMaster2_3__factory as IAutomationRegistryMaster2_3Factory } from '../../../typechain/factories/IAutomationRegistryMaster2_3__factory' -export const deployRegistry21 = async ( - from: Signer, - mode: Parameters[0], - link: Parameters[1], - linkNative: Parameters[2], - fastgas: Parameters[3], -): Promise => { - const logicBFactory = await ethers.getContractFactory( - 'KeeperRegistryLogicB2_1', - ) - const logicAFactory = await ethers.getContractFactory( - 'KeeperRegistryLogicA2_1', - ) - const registryFactory = await ethers.getContractFactory('KeeperRegistry2_1') - const forwarderLogicFactory = await ethers.getContractFactory( - 'AutomationForwarderLogic', - ) - const forwarderLogic = await forwarderLogicFactory.connect(from).deploy() - const logicB = await logicBFactory - .connect(from) - .deploy(mode, link, linkNative, fastgas, forwarderLogic.address) - const logicA = await logicAFactory.connect(from).deploy(logicB.address) - const master = await registryFactory.connect(from).deploy(logicA.address) - return IKeeperRegistryMasterFactory.connect(master.address, from) -} - type InterfaceABI = ConstructorParameters[0] type Entry = { inputs?: any[] @@ -130,42 +98,6 @@ export const assertSatisfiesInterface = ( } } -export const deployRegistry22 = async ( - from: Signer, - link: Parameters[0], - linkNative: Parameters[1], - fastgas: Parameters[2], - allowedReadOnlyAddress: Parameters< - AutomationRegistryLogicBFactory['deploy'] - >[3], -): Promise => { - const logicBFactory = await ethers.getContractFactory( - 'AutomationRegistryLogicB2_2', - ) - const logicAFactory = await ethers.getContractFactory( - 'AutomationRegistryLogicA2_2', - ) - const registryFactory = await ethers.getContractFactory( - 'AutomationRegistry2_2', - ) - const forwarderLogicFactory = await ethers.getContractFactory( - 'AutomationForwarderLogic', - ) - const forwarderLogic = await forwarderLogicFactory.connect(from).deploy() - const logicB = await logicBFactory - .connect(from) - .deploy( - link, - linkNative, - fastgas, - forwarderLogic.address, - allowedReadOnlyAddress, - ) - const logicA = await logicAFactory.connect(from).deploy(logicB.address) - const master = await registryFactory.connect(from).deploy(logicA.address) - return IAutomationRegistryMasterFactory.connect(master.address, from) -} - export const deployRegistry23 = async ( from: Signer, link: Parameters[0], From da03b850e76296ef652dfe3532c7aebefd58bea2 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Wed, 8 Jan 2025 17:23:37 +0100 Subject: [PATCH 13/91] CCIP Config backported from CCIP repo (#15856) * Moving configs directly from CCIP repo * Moving configs directly from CCIP repo --- ccip/config/evm/Astar_Mainnet.toml | 8 +- ccip/config/evm/Astar_Shibuya.toml | 7 +- ccip/config/evm/Avalanche_ANZ_testnet.toml | 4 +- ccip/config/evm/Avalanche_Fuji.toml | 3 +- ccip/config/evm/Avalanche_Mainnet.toml | 4 +- ccip/config/evm/BOB_Mainnet.toml | 28 +++++++ ccip/config/evm/BOB_Testnet.toml | 28 +++++++ ccip/config/evm/BSC_Mainnet.toml | 7 ++ ccip/config/evm/BSC_Testnet.toml | 3 +- ccip/config/evm/Base_Mainnet.toml | 3 + ccip/config/evm/Base_Sepolia.toml | 3 + ccip/config/evm/Berachain_Testnet.toml | 24 ++++++ ccip/config/evm/Bitlayer_Mainnet.toml | 16 ++++ ccip/config/evm/Bitlayer_Testnet.toml | 16 ++++ ccip/config/evm/Blast_Mainnet.toml | 5 +- ccip/config/evm/Blast_Sepolia.toml | 5 +- ccip/config/evm/Bsquared_Mainnet.toml | 23 ++++++ ccip/config/evm/Bsquared_Testnet.toml | 23 ++++++ ccip/config/evm/Celo_Mainnet.toml | 8 +- ccip/config/evm/Celo_Testnet.toml | 3 + ccip/config/evm/Ethereum_Mainnet.toml | 5 ++ ccip/config/evm/Ethereum_Sepolia.toml | 2 + ccip/config/evm/Fantom_Mainnet.toml | 7 +- ccip/config/evm/Fantom_Testnet.toml | 7 +- ccip/config/evm/Gnosis_Chiado.toml | 5 ++ ccip/config/evm/Gnosis_Mainnet.toml | 5 ++ ccip/config/evm/Harmony_Mainnet.toml | 13 +++ ccip/config/evm/Harmony_Testnet.toml | 13 +++ ccip/config/evm/Hashkey_Mainnet.toml | 16 ++++ ccip/config/evm/Hashkey_Testnet.toml | 16 ++++ ccip/config/evm/Heco_Mainnet.toml | 26 ++++++ ccip/config/evm/Hedera_Mainnet.toml | 35 ++++++++ ccip/config/evm/Hedera_Testnet.toml | 35 ++++++++ ccip/config/evm/Klaytn_Mainnet.toml | 15 ++++ ccip/config/evm/Klaytn_Testnet.toml | 15 ++++ ccip/config/evm/Kroma_Mainnet.toml | 8 +- ccip/config/evm/Kroma_Sepolia.toml | 8 +- ccip/config/evm/L3X_Mainnet.toml | 6 +- ccip/config/evm/L3X_Sepolia.toml | 6 +- ccip/config/evm/Linea_Goerli.toml | 17 ++++ ccip/config/evm/Linea_Mainnet.toml | 7 +- ccip/config/evm/Linea_Sepolia.toml | 5 +- ccip/config/evm/Mantle_Mainnet.toml | 33 ++++++++ ccip/config/evm/Mantle_Sepolia.toml | 31 +++++-- ccip/config/evm/Metis_Mainnet.toml | 15 +++- ccip/config/evm/Metis_Sepolia.toml | 5 +- ccip/config/evm/Mode_Mainnet.toml | 3 + ccip/config/evm/Mode_Sepolia.toml | 3 + ccip/config/evm/Optimism_Mainnet.toml | 3 + ccip/config/evm/Optimism_Sepolia.toml | 3 + ccip/config/evm/Polygon_Amoy.toml | 7 +- ccip/config/evm/Polygon_Mainnet.toml | 3 + ccip/config/evm/Polygon_Mumbai.toml | 31 +++++++ ccip/config/evm/Polygon_Zkevm_Cardona.toml | 13 ++- ccip/config/evm/Polygon_Zkevm_Mainnet.toml | 12 +-- ccip/config/evm/RSK_Mainnet.toml | 13 +++ ccip/config/evm/RSK_Testnet.toml | 10 +++ ccip/config/evm/Ronin_Mainnet.toml | 16 ++++ ccip/config/evm/Ronin_Saigon.toml | 16 ++++ ccip/config/evm/Scroll_Mainnet.toml | 3 + ccip/config/evm/Scroll_Sepolia.toml | 3 + ccip/config/evm/Simulated.toml | 6 +- ccip/config/evm/Soneium_Sepolia.toml | 35 ++++++++ ccip/config/evm/Sonic_Mainnet.toml | 28 +++++++ ccip/config/evm/Sonic_Testnet.toml | 28 +++++++ ccip/config/evm/Unichain_Testnet.toml | 26 ++++++ ccip/config/evm/WeMix_Mainnet.toml | 4 +- ccip/config/evm/WeMix_Testnet.toml | 3 +- ccip/config/evm/Worldchain_Mainnet.toml | 23 ++++++ ccip/config/evm/Worldchain_Testnet.toml | 23 ++++++ ccip/config/evm/XLayer_Mainnet.toml | 2 +- ccip/config/evm/XLayer_Sepolia.toml | 3 + ccip/config/evm/fallback.toml | 95 ++++++++++++++++++++++ ccip/config/evm/zkSync_Mainnet.toml | 2 +- ccip/config/evm/zkSync_Sepolia.toml | 15 ++-- 75 files changed, 955 insertions(+), 54 deletions(-) create mode 100644 ccip/config/evm/BOB_Mainnet.toml create mode 100644 ccip/config/evm/BOB_Testnet.toml create mode 100644 ccip/config/evm/Berachain_Testnet.toml create mode 100644 ccip/config/evm/Bitlayer_Mainnet.toml create mode 100644 ccip/config/evm/Bitlayer_Testnet.toml create mode 100644 ccip/config/evm/Bsquared_Mainnet.toml create mode 100644 ccip/config/evm/Bsquared_Testnet.toml create mode 100644 ccip/config/evm/Harmony_Mainnet.toml create mode 100644 ccip/config/evm/Harmony_Testnet.toml create mode 100644 ccip/config/evm/Hashkey_Mainnet.toml create mode 100644 ccip/config/evm/Hashkey_Testnet.toml create mode 100644 ccip/config/evm/Heco_Mainnet.toml create mode 100644 ccip/config/evm/Hedera_Mainnet.toml create mode 100644 ccip/config/evm/Hedera_Testnet.toml create mode 100644 ccip/config/evm/Klaytn_Mainnet.toml create mode 100644 ccip/config/evm/Klaytn_Testnet.toml create mode 100644 ccip/config/evm/Linea_Goerli.toml create mode 100644 ccip/config/evm/Mantle_Mainnet.toml create mode 100644 ccip/config/evm/Polygon_Mumbai.toml create mode 100644 ccip/config/evm/RSK_Mainnet.toml create mode 100644 ccip/config/evm/RSK_Testnet.toml create mode 100644 ccip/config/evm/Ronin_Mainnet.toml create mode 100644 ccip/config/evm/Ronin_Saigon.toml create mode 100755 ccip/config/evm/Soneium_Sepolia.toml create mode 100644 ccip/config/evm/Sonic_Mainnet.toml create mode 100644 ccip/config/evm/Sonic_Testnet.toml create mode 100644 ccip/config/evm/Unichain_Testnet.toml create mode 100644 ccip/config/evm/Worldchain_Mainnet.toml create mode 100644 ccip/config/evm/Worldchain_Testnet.toml create mode 100644 ccip/config/evm/fallback.toml diff --git a/ccip/config/evm/Astar_Mainnet.toml b/ccip/config/evm/Astar_Mainnet.toml index 87808001eb7..5405a67d563 100644 --- a/ccip/config/evm/Astar_Mainnet.toml +++ b/ccip/config/evm/Astar_Mainnet.toml @@ -1,4 +1,5 @@ ChainID = '592' +ChainType = 'astar' FinalityTagEnabled = true FinalityDepth = 100 LogPollInterval = '6s' @@ -6,4 +7,9 @@ LogPollInterval = '6s' [GasEstimator] EIP1559DynamicFees = false PriceMax = '100000 gwei' -LimitDefault = 8000000 \ No newline at end of file +LimitDefault = 8000000 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Astar_Shibuya.toml b/ccip/config/evm/Astar_Shibuya.toml index 5a5df06f6f0..cfcd7c31c75 100644 --- a/ccip/config/evm/Astar_Shibuya.toml +++ b/ccip/config/evm/Astar_Shibuya.toml @@ -6,4 +6,9 @@ LogPollInterval = '6s' [GasEstimator] EIP1559DynamicFees = false PriceMax = '100000 gwei' -LimitDefault = 8000000 \ No newline at end of file +LimitDefault = 8000000 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false \ No newline at end of file diff --git a/ccip/config/evm/Avalanche_ANZ_testnet.toml b/ccip/config/evm/Avalanche_ANZ_testnet.toml index 1242e1ec06e..936a82d5092 100644 --- a/ccip/config/evm/Avalanche_ANZ_testnet.toml +++ b/ccip/config/evm/Avalanche_ANZ_testnet.toml @@ -19,4 +19,6 @@ PriceMin = '25 gwei' BlockHistorySize = 24 [HeadTracker] -PersistenceEnabled = false +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Avalanche_Fuji.toml b/ccip/config/evm/Avalanche_Fuji.toml index 7df1d26a336..4340b6b861d 100644 --- a/ccip/config/evm/Avalanche_Fuji.toml +++ b/ccip/config/evm/Avalanche_Fuji.toml @@ -17,5 +17,6 @@ PriceDefault = '1 gwei' BlockHistorySize = 24 [HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 FinalityTagBypass = false -PersistenceEnabled = false diff --git a/ccip/config/evm/Avalanche_Mainnet.toml b/ccip/config/evm/Avalanche_Mainnet.toml index 341ae5478b3..ac73a7b98fa 100644 --- a/ccip/config/evm/Avalanche_Mainnet.toml +++ b/ccip/config/evm/Avalanche_Mainnet.toml @@ -18,4 +18,6 @@ PriceDefault = '1 gwei' BlockHistorySize = 24 [HeadTracker] -PersistenceEnabled = false +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/BOB_Mainnet.toml b/ccip/config/evm/BOB_Mainnet.toml new file mode 100644 index 00000000000..70cc2fb8ba4 --- /dev/null +++ b/ccip/config/evm/BOB_Mainnet.toml @@ -0,0 +1,28 @@ +ChainID = '60808' +# OP stack https://docs.gobob.xyz/learn/introduction/stack-overview#rollup-layer +ChainType = 'optimismBedrock' +# FinalityDepth in mainnet showed more than 3k +FinalityDepth = 3150 +# block_time was: 2s, adding 1 second buffer +LogPollInterval = '3s' + +# finality_depth * block_time / 60 secs = ~105 min (finality time) +NoNewFinalizedHeadsThreshold = '110m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 2s, per recommendation skip 1-2 blocks +CacheTimeout = '4s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/BOB_Testnet.toml b/ccip/config/evm/BOB_Testnet.toml new file mode 100644 index 00000000000..bd8505c4e44 --- /dev/null +++ b/ccip/config/evm/BOB_Testnet.toml @@ -0,0 +1,28 @@ +ChainID = '808813' +# OP stack https://docs.gobob.xyz/learn/introduction/stack-overview#rollup-layer +ChainType = 'optimismBedrock' +# FinalityDepth in mainnet showed more than 3k +FinalityDepth = 3150 +# block_time was: 2s, adding 1 second buffer +LogPollInterval = '3s' + +# finality_depth * block_time / 60 secs = ~105 min (finality time) +NoNewFinalizedHeadsThreshold = '110m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 2s, per recommendation skip 1-2 blocks +CacheTimeout = '4s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/BSC_Mainnet.toml b/ccip/config/evm/BSC_Mainnet.toml index 10f4c570bef..df140e63973 100644 --- a/ccip/config/evm/BSC_Mainnet.toml +++ b/ccip/config/evm/BSC_Mainnet.toml @@ -13,6 +13,8 @@ NoNewFinalizedHeadsThreshold = '45s' [GasEstimator] PriceDefault = '5 gwei' +# Set to the BSC node's default Eth.Miner.GasPrice config +PriceMin = '3 gwei' # 15s delay since feeds update every minute in volatile situations BumpThreshold = 5 @@ -26,3 +28,8 @@ ObservationGracePeriod = '500ms' [NodePool] SyncThreshold = 10 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/BSC_Testnet.toml b/ccip/config/evm/BSC_Testnet.toml index bb13501f1a2..9c528f816ea 100644 --- a/ccip/config/evm/BSC_Testnet.toml +++ b/ccip/config/evm/BSC_Testnet.toml @@ -22,8 +22,9 @@ BlockHistorySize = 24 [HeadTracker] HistoryDepth = 100 SamplingInterval = '1s' +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 FinalityTagBypass = false -PersistenceEnabled = false [OCR] DatabaseTimeout = '2s' diff --git a/ccip/config/evm/Base_Mainnet.toml b/ccip/config/evm/Base_Mainnet.toml index da38182b194..0f895e1bc6b 100644 --- a/ccip/config/evm/Base_Mainnet.toml +++ b/ccip/config/evm/Base_Mainnet.toml @@ -20,6 +20,9 @@ ResendAfterThreshold = '30s' [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Base_Sepolia.toml b/ccip/config/evm/Base_Sepolia.toml index 92f7717b27d..202c544fb4b 100644 --- a/ccip/config/evm/Base_Sepolia.toml +++ b/ccip/config/evm/Base_Sepolia.toml @@ -21,6 +21,9 @@ ResendAfterThreshold = '30s' [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Berachain_Testnet.toml b/ccip/config/evm/Berachain_Testnet.toml new file mode 100644 index 00000000000..9fc810e8908 --- /dev/null +++ b/ccip/config/evm/Berachain_Testnet.toml @@ -0,0 +1,24 @@ +ChainID = '80084' +# finality_depth: instant +FinalityDepth = 10 +# block_time: 5s, adding 1 second buffer +LogPollInterval = '6s' + +# finality_depth * block_time / 60 secs = ~0.8 min (finality time) +NoNewFinalizedHeadsThreshold = '5m' + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 5s, per recommendation skip 1-2 blocks +CacheTimeout = '10s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Bitlayer_Mainnet.toml b/ccip/config/evm/Bitlayer_Mainnet.toml new file mode 100644 index 00000000000..f6d669d4f78 --- /dev/null +++ b/ccip/config/evm/Bitlayer_Mainnet.toml @@ -0,0 +1,16 @@ +ChainID = '200901' +FinalityTagEnabled = false +FinalityDepth = 21 # confirmed with Bitlayer team and recommended by docs: https://docs.bitlayer.org/docs/Learn/BitlayerNetwork/AboutFinality/#about-finality-at-stage-bitlayer-pos-bitlayer-mainnet-v1 + +[GasEstimator] +Mode = 'FeeHistory' +EIP1559DynamicFees = false +PriceMax = '1 gwei' # DS&A recommended value +PriceMin = '40 mwei' # During testing, we saw minimum gas prices ~50 mwei +PriceDefault = '1 gwei' # As we set PriceMax to '1 gwei' and PriceDefault must be less than or equal to PriceMax +FeeCapDefault = '1 gwei' # As we set PriceMax to '1 gwei' and FeeCapDefault must be less than or equal to PriceMax + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Bitlayer_Testnet.toml b/ccip/config/evm/Bitlayer_Testnet.toml new file mode 100644 index 00000000000..7107527ce2f --- /dev/null +++ b/ccip/config/evm/Bitlayer_Testnet.toml @@ -0,0 +1,16 @@ +ChainID = '200810' +FinalityTagEnabled = false +FinalityDepth = 21 # confirmed with Bitlayer team and recommended by docs: https://docs.bitlayer.org/docs/Learn/BitlayerNetwork/AboutFinality/#about-finality-at-stage-bitlayer-pos-bitlayer-mainnet-v1 + +[GasEstimator] +Mode='FeeHistory' +EIP1559DynamicFees = false +PriceMax = '1 gwei' # DS&A recommended value +PriceMin = '40 mwei' # During testing, we saw minimum gas prices ~50 mwei +PriceDefault = '1 gwei' # As we set PriceMax to '1 gwei' and PriceDefault must be less than or equal to PriceMax +FeeCapDefault = '1 gwei' # As we set PriceMax to '1 gwei' and FeeCapDefault must be less than or equal to PriceMax + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Blast_Mainnet.toml b/ccip/config/evm/Blast_Mainnet.toml index f8b501723ff..26ecddeec54 100644 --- a/ccip/config/evm/Blast_Mainnet.toml +++ b/ccip/config/evm/Blast_Mainnet.toml @@ -26,9 +26,12 @@ EIP1559FeeCapBufferBlocks = 0 [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] # 4 block sync time between nodes to ensure they aren't labelled unreachable too soon PollFailureThreshold = 4 # polls every 4sec to check if there is a block produced, since blockRate is ~3sec -PollInterval = '4s' \ No newline at end of file +PollInterval = '4s' diff --git a/ccip/config/evm/Blast_Sepolia.toml b/ccip/config/evm/Blast_Sepolia.toml index 96dc5c67871..55f2356ad3a 100644 --- a/ccip/config/evm/Blast_Sepolia.toml +++ b/ccip/config/evm/Blast_Sepolia.toml @@ -26,9 +26,12 @@ EIP1559FeeCapBufferBlocks = 0 [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] # 4 block sync time between nodes to ensure they aren't labelled unreachable too soon PollFailureThreshold = 4 # polls every 4sec to check if there is a block produced, since blockRate is ~3sec -PollInterval = '4s' \ No newline at end of file +PollInterval = '4s' diff --git a/ccip/config/evm/Bsquared_Mainnet.toml b/ccip/config/evm/Bsquared_Mainnet.toml new file mode 100644 index 00000000000..61b0e5337c7 --- /dev/null +++ b/ccip/config/evm/Bsquared_Mainnet.toml @@ -0,0 +1,23 @@ +ChainID = '223' +# OP stack from questionnaire https://docs.google.com/spreadsheets/d/1l8dx1GzxEnjgwH5x3vB60FUr5iFALzPcs6W_wOAiuDs/edit?gid=625078687#gid=625078687 +ChainType = 'optimismBedrock' +# finality_depth was: ~1900 +FinalityDepth = 2000 +# block_time: ~2s, adding 1 second buffer +LogPollInterval = '3s' + +# finality_depth * block_time / 60 secs = ~66 min (finality time) +NoNewFinalizedHeadsThreshold = '70m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 2s, per recommendation skip 1-2 blocks +CacheTimeout = '4s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 diff --git a/ccip/config/evm/Bsquared_Testnet.toml b/ccip/config/evm/Bsquared_Testnet.toml new file mode 100644 index 00000000000..b7cfd35fc41 --- /dev/null +++ b/ccip/config/evm/Bsquared_Testnet.toml @@ -0,0 +1,23 @@ +ChainID = '1123' +# OP stack from questionnaire https://docs.google.com/spreadsheets/d/1l8dx1GzxEnjgwH5x3vB60FUr5iFALzPcs6W_wOAiuDs/edit?gid=625078687#gid=625078687 +ChainType = 'optimismBedrock' +# finality_depth was: ~1900 +FinalityDepth = 2000 +# block_time: ~2s, adding 1 second buffer +LogPollInterval = '3s' + +# finality_depth * block_time / 60 secs = ~66 min (finality time) +NoNewFinalizedHeadsThreshold = '70m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 2s, per recommendation skip 1-2 blocks +CacheTimeout = '4s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 diff --git a/ccip/config/evm/Celo_Mainnet.toml b/ccip/config/evm/Celo_Mainnet.toml index 0ed08986d32..9da7d632d0d 100644 --- a/ccip/config/evm/Celo_Mainnet.toml +++ b/ccip/config/evm/Celo_Mainnet.toml @@ -1,6 +1,10 @@ ChainID = '42220' ChainType = 'celo' +# FT and FD are both present here because the dev effort rely only on FinalityTagEnabled are still in progress. +# We expect to be able to rely only on FinalityTagEnabled=true in the short future. +# https://chainlink-core.slack.com/archives/C05CS33N08N/p1715102940763339?thread_ts=1715102478.537529&cid=C05CS33N08N FinalityDepth = 10 +FinalityTagEnabled = true LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' @@ -18,4 +22,6 @@ BlockHistorySize = 12 [HeadTracker] HistoryDepth = 50 -PersistenceEnabled = false +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Celo_Testnet.toml b/ccip/config/evm/Celo_Testnet.toml index 0e4594150dd..c03d855acf6 100644 --- a/ccip/config/evm/Celo_Testnet.toml +++ b/ccip/config/evm/Celo_Testnet.toml @@ -1,5 +1,8 @@ ChainID = '44787' ChainType = 'celo' +# FT and FD are both present here because the dev effort rely only on FinalityTagEnabled are still in progress. +# We expect to be able to rely only on FinalityTagEnabled=true in the short future. +# https://chainlink-core.slack.com/archives/C05CS33N08N/p1715102940763339?thread_ts=1715102478.537529&cid=C05CS33N08N FinalityTagEnabled = true FinalityDepth = 2750 # mean finality time of ~37 minutes + 500 block buffer LogPollInterval = '1s' # 1 sec block rate diff --git a/ccip/config/evm/Ethereum_Mainnet.toml b/ccip/config/evm/Ethereum_Mainnet.toml index 0bcaf35c648..ec3a78156ed 100644 --- a/ccip/config/evm/Ethereum_Mainnet.toml +++ b/ccip/config/evm/Ethereum_Mainnet.toml @@ -15,3 +15,8 @@ TransactionPercentile = 50 [OCR2.Automation] GasLimit = 10500000 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Ethereum_Sepolia.toml b/ccip/config/evm/Ethereum_Sepolia.toml index 24a0e68f77a..966f091f891 100644 --- a/ccip/config/evm/Ethereum_Sepolia.toml +++ b/ccip/config/evm/Ethereum_Sepolia.toml @@ -14,4 +14,6 @@ TransactionPercentile = 50 GasLimit = 10500000 [HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 FinalityTagBypass = false diff --git a/ccip/config/evm/Fantom_Mainnet.toml b/ccip/config/evm/Fantom_Mainnet.toml index 7e76d94278d..2af504796e0 100644 --- a/ccip/config/evm/Fantom_Mainnet.toml +++ b/ccip/config/evm/Fantom_Mainnet.toml @@ -9,4 +9,9 @@ RPCBlockQueryDelay = 2 Mode = 'SuggestedPrice' [OCR2.Automation] -GasLimit = 3800000 \ No newline at end of file +GasLimit = 3800000 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Fantom_Testnet.toml b/ccip/config/evm/Fantom_Testnet.toml index 5f24a76c2e7..b361a8d14dd 100644 --- a/ccip/config/evm/Fantom_Testnet.toml +++ b/ccip/config/evm/Fantom_Testnet.toml @@ -9,4 +9,9 @@ RPCBlockQueryDelay = 2 Mode = 'SuggestedPrice' [OCR2.Automation] -GasLimit = 3800000 \ No newline at end of file +GasLimit = 3800000 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Gnosis_Chiado.toml b/ccip/config/evm/Gnosis_Chiado.toml index 379377a2266..320aa087209 100644 --- a/ccip/config/evm/Gnosis_Chiado.toml +++ b/ccip/config/evm/Gnosis_Chiado.toml @@ -8,3 +8,8 @@ NoNewFinalizedHeadsThreshold = '2m' [GasEstimator] EIP1559DynamicFees = true PriceMax = '500 gwei' + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Gnosis_Mainnet.toml b/ccip/config/evm/Gnosis_Mainnet.toml index 628646364f5..ec8ac227f78 100644 --- a/ccip/config/evm/Gnosis_Mainnet.toml +++ b/ccip/config/evm/Gnosis_Mainnet.toml @@ -16,3 +16,8 @@ PriceDefault = '1 gwei' PriceMax = '500 gwei' # 1 Gwei is the minimum accepted by the validators (unless whitelisted) PriceMin = '1 gwei' + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Harmony_Mainnet.toml b/ccip/config/evm/Harmony_Mainnet.toml new file mode 100644 index 00000000000..1cee98e77c7 --- /dev/null +++ b/ccip/config/evm/Harmony_Mainnet.toml @@ -0,0 +1,13 @@ +ChainID = '1666600000' +LinkContractAddress = '0x218532a12a389a4a92fC0C5Fb22901D1c19198aA' +LogPollInterval = '2s' +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '30s' + +[GasEstimator] +PriceDefault = '5 gwei' + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Harmony_Testnet.toml b/ccip/config/evm/Harmony_Testnet.toml new file mode 100644 index 00000000000..8b7c85b9c28 --- /dev/null +++ b/ccip/config/evm/Harmony_Testnet.toml @@ -0,0 +1,13 @@ +ChainID = '1666700000' +LinkContractAddress = '0x8b12Ac23BFe11cAb03a634C1F117D64a7f2cFD3e' +LogPollInterval = '2s' +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '30s' + +[GasEstimator] +PriceDefault = '5 gwei' + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Hashkey_Mainnet.toml b/ccip/config/evm/Hashkey_Mainnet.toml new file mode 100644 index 00000000000..69450c96f80 --- /dev/null +++ b/ccip/config/evm/Hashkey_Mainnet.toml @@ -0,0 +1,16 @@ +ChainID = '177' +ChainType = 'optimismBedrock' +FinalityTagEnabled = true + +[GasEstimator] +PriceMax = '1000 gwei' +LimitDefault = 8000000 +FeeCapDefault = '1000 gwei' + +[NodePool] +PollFailureThreshold = 2 +PollInterval = '8s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' \ No newline at end of file diff --git a/ccip/config/evm/Hashkey_Testnet.toml b/ccip/config/evm/Hashkey_Testnet.toml new file mode 100644 index 00000000000..c342e503a33 --- /dev/null +++ b/ccip/config/evm/Hashkey_Testnet.toml @@ -0,0 +1,16 @@ +ChainID = '133' +ChainType = 'optimismBedrock' +FinalityTagEnabled = true + +[GasEstimator] +PriceMax = '1000 gwei' +LimitDefault = 8000000 +FeeCapDefault = '1000 gwei' + +[NodePool] +PollFailureThreshold = 2 +PollInterval = '8s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' \ No newline at end of file diff --git a/ccip/config/evm/Heco_Mainnet.toml b/ccip/config/evm/Heco_Mainnet.toml new file mode 100644 index 00000000000..a39e405be31 --- /dev/null +++ b/ccip/config/evm/Heco_Mainnet.toml @@ -0,0 +1,26 @@ +# Heco uses BSC's settings. +ChainID = '128' +LinkContractAddress = '0x404460C6A5EdE2D891e8297795264fDe62ADBB75' +LogPollInterval = '3s' +NoNewHeadsThreshold = '30s' +RPCBlockQueryDelay = 2 + +[GasEstimator] +PriceDefault = '5 gwei' +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[OCR] +DatabaseTimeout = '2s' +ContractTransmitterTransmitTimeout = '2s' +ObservationGracePeriod = '500ms' + +[NodePool] +SyncThreshold = 10 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Hedera_Mainnet.toml b/ccip/config/evm/Hedera_Mainnet.toml new file mode 100644 index 00000000000..fdd6528e0a4 --- /dev/null +++ b/ccip/config/evm/Hedera_Mainnet.toml @@ -0,0 +1,35 @@ +ChainID = '295' +ChainType = 'hedera' +# Considering the 3-5 (6 including a buffer) seconds of finality and 2 seconds block production +# We set the depth to 6/2 = 3 blocks, setting to 10 for safety +FinalityDepth = 10 +# Hedera has high TPS, so polling less often +LogPollInterval = '10s' +MinIncomingConfirmations = 1 + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'SuggestedPrice' +# Since Hedera dont have mempool and there's no way for a node to front run or a user to bribe a node to submit the transaction earlier than it's consensus timestamp, +# But they have automated congesting pricing throttling which would mean at high sustained level the gasPrice itself could be increased to prevent malicious behaviour. +# Disabling the Bumpthreshold as TXM now implicity handles the bumping after checking on-chain nonce & re-broadcast for Hedera chain type +BumpThreshold = 0 +BumpMin = '10 gwei' +BumpPercent = 20 + +[Transactions] +# To hit throttling you'd need to maintain 15 m gas /sec over a prolonged period of time. +# Because Hedera's block times are every 2 secs it's less less likely to happen as compared to other chains +# Setting this to little higher even though Hedera has High TPS, We have seen 10-12s to get the trasaction mined & 20-25s incase of failures +# Accounting for Node syncs & avoid re-sending txns before fetching the receipt, setting to 2m +ResendAfterThreshold = '2m' + +[NodePool] +SyncThreshold = 10 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Hedera_Testnet.toml b/ccip/config/evm/Hedera_Testnet.toml new file mode 100644 index 00000000000..7e9ec3fe2c6 --- /dev/null +++ b/ccip/config/evm/Hedera_Testnet.toml @@ -0,0 +1,35 @@ +ChainID = '296' +ChainType = 'hedera' +# Considering the 3-5 (6 including a buffer) seconds of finality and 2 seconds block production +# We set the depth to 6/2 = 3 blocks, setting to 10 for safety +FinalityDepth = 10 +# Hedera has high TPS, so polling less often +LogPollInterval = '10s' +MinIncomingConfirmations = 1 + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'SuggestedPrice' +# Since Hedera dont have mempool and there's no way for a node to front run or a user to bribe a node to submit the transaction earlier than it's consensus timestamp, +# But they have automated congesting pricing throttling which would mean at high sustained level the gasPrice itself could be increased to prevent malicious behaviour. +# Disabling the Bumpthreshold as TXM now implicity handles the bumping after checking on-chain nonce & re-broadcast for Hedera chain type +BumpThreshold = 0 +BumpMin = '10 gwei' +BumpPercent = 20 + +[Transactions] +# To hit throttling you'd need to maintain 15 m gas /sec over a prolonged period of time. +# Because Hedera's block times are every 2 secs it's less less likely to happen as compared to other chains +# Setting this to little higher even though Hedera has High TPS, We have seen 10-12s to get the trasaction mined & 20-25s incase of failures +# Accounting for Node syncs & avoid re-sending txns before fetching the receipt, setting to 2m +ResendAfterThreshold = '2m' + +[NodePool] +SyncThreshold = 10 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Klaytn_Mainnet.toml b/ccip/config/evm/Klaytn_Mainnet.toml new file mode 100644 index 00000000000..ff8b97de970 --- /dev/null +++ b/ccip/config/evm/Klaytn_Mainnet.toml @@ -0,0 +1,15 @@ +ChainID = '8217' +FinalityDepth = 10 +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '30s' +OCR.ContractConfirmations = 1 + +[GasEstimator] +Mode = 'SuggestedPrice' +PriceDefault = '750 gwei' # gwei = ston +BumpThreshold = 5 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Klaytn_Testnet.toml b/ccip/config/evm/Klaytn_Testnet.toml new file mode 100644 index 00000000000..599b604f086 --- /dev/null +++ b/ccip/config/evm/Klaytn_Testnet.toml @@ -0,0 +1,15 @@ +ChainID = '1001' +FinalityDepth = 10 +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '30s' +OCR.ContractConfirmations = 1 + +[GasEstimator] +Mode = 'SuggestedPrice' +PriceDefault = '750 gwei' # gwei = ston +BumpThreshold = 5 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Kroma_Mainnet.toml b/ccip/config/evm/Kroma_Mainnet.toml index 3a48aa8ae1b..21bbe7c357c 100644 --- a/ccip/config/evm/Kroma_Mainnet.toml +++ b/ccip/config/evm/Kroma_Mainnet.toml @@ -1,6 +1,9 @@ ChainID = '255' ChainType = 'kroma' # Kroma is based on the Optimism Bedrock architechture -FinalityDepth = 400 +# FT and FD are both present here because the dev effort rely only on FinalityTagEnabled are still in progress. +# We expect to be able to rely only on FinalityTagEnabled=true in the short future. +# https://chainlink-core.slack.com/archives/C05CS33N08N/p1715102940763339?thread_ts=1715102478.537529&cid=C05CS33N08N +FinalityDepth = 700 FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' @@ -19,6 +22,9 @@ ResendAfterThreshold = '30s' [HeadTracker] HistoryDepth = 400 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Kroma_Sepolia.toml b/ccip/config/evm/Kroma_Sepolia.toml index 9609a09e076..120737df47b 100644 --- a/ccip/config/evm/Kroma_Sepolia.toml +++ b/ccip/config/evm/Kroma_Sepolia.toml @@ -1,6 +1,9 @@ ChainID = '2358' ChainType = 'kroma' # Kroma is based on the Optimism Bedrock architechture -FinalityDepth = 400 +# FT and FD are both present here because the dev effort rely only on FinalityTagEnabled are still in progress. +# We expect to be able to rely only on FinalityTagEnabled=true in the short future. +# https://chainlink-core.slack.com/archives/C05CS33N08N/p1715102940763339?thread_ts=1715102478.537529&cid=C05CS33N08N +FinalityDepth = 700 FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' @@ -19,6 +22,9 @@ ResendAfterThreshold = '30s' [HeadTracker] HistoryDepth = 400 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/L3X_Mainnet.toml b/ccip/config/evm/L3X_Mainnet.toml index 9dd33c9e15d..5f14e5e8e8c 100644 --- a/ccip/config/evm/L3X_Mainnet.toml +++ b/ccip/config/evm/L3X_Mainnet.toml @@ -17,5 +17,7 @@ PriceDefault = '0.1 gwei' FeeCapDefault = '1000 gwei' BumpThreshold = 5 -[GasEstimator.DAOracle] -OracleType = 'arbitrum' +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/L3X_Sepolia.toml b/ccip/config/evm/L3X_Sepolia.toml index c0f6a60e943..ca21bc13d6e 100644 --- a/ccip/config/evm/L3X_Sepolia.toml +++ b/ccip/config/evm/L3X_Sepolia.toml @@ -17,5 +17,7 @@ PriceDefault = '0.1 gwei' FeeCapDefault = '1000 gwei' BumpThreshold = 5 -[GasEstimator.DAOracle] -OracleType = 'arbitrum' +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Linea_Goerli.toml b/ccip/config/evm/Linea_Goerli.toml new file mode 100644 index 00000000000..2c85f9cbc02 --- /dev/null +++ b/ccip/config/evm/Linea_Goerli.toml @@ -0,0 +1,17 @@ +ChainID = '59140' +# Block time 12s, finality < 3m +FinalityDepth = 15 +# Blocks are only emitted when a transaction happens / no empty blocks +NoNewHeadsThreshold = '0' + +[GasEstimator] +BumpPercent = 40 + +[Transactions] +# increase resend time to align with finality +ResendAfterThreshold = '3m' + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Linea_Mainnet.toml b/ccip/config/evm/Linea_Mainnet.toml index 5a89873acae..6614fef9d4e 100644 --- a/ccip/config/evm/Linea_Mainnet.toml +++ b/ccip/config/evm/Linea_Mainnet.toml @@ -1,6 +1,6 @@ ChainID = '59144' -# Block time 12s, finality < 60m -FinalityDepth = 300 +#3s block time ~ 20m finality based on committee decision +FinalityDepth = 600 # Blocks are only emitted when a transaction happens / no empty blocks NoNewHeadsThreshold = '0' @@ -15,6 +15,9 @@ ResendAfterThreshold = '3m' # set greater than finality depth [HeadTracker] HistoryDepth = 350 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [Transactions.AutoPurge] Enabled = true diff --git a/ccip/config/evm/Linea_Sepolia.toml b/ccip/config/evm/Linea_Sepolia.toml index 8f168ee93a6..2837c7ca601 100644 --- a/ccip/config/evm/Linea_Sepolia.toml +++ b/ccip/config/evm/Linea_Sepolia.toml @@ -1,5 +1,5 @@ ChainID = '59141' -FinalityDepth = 900 +FinalityDepth = 200 NoNewHeadsThreshold = '0' [GasEstimator] @@ -11,6 +11,9 @@ ResendAfterThreshold = '3m' [HeadTracker] HistoryDepth = 1000 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [Transactions.AutoPurge] Enabled = true diff --git a/ccip/config/evm/Mantle_Mainnet.toml b/ccip/config/evm/Mantle_Mainnet.toml new file mode 100644 index 00000000000..23d5168a7e9 --- /dev/null +++ b/ccip/config/evm/Mantle_Mainnet.toml @@ -0,0 +1,33 @@ +ChainID = '5000' +FinalityTagEnabled = true +FinalityDepth = 1200 +ChainType = 'optimismBedrock' +LogPollInterval = '2s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '40m0s' + +[HeadTracker] +HistoryDepth = 1250 + +[GasEstimator] +PriceMax = '120 gwei' +# Limit values are high as Mantle's GasPrice is in native token (MNT) instead of ETH. Their proprietary TokenRatio parameter is used to adjust fees +LimitDefault = 80_000_000_000 +LimitMax = 100_000_000_000 +BumpMin = '100 wei' +BumpThreshold = 60 +EIP1559DynamicFees = true +FeeCapDefault = '120 gwei' +# Mantle recommends setting Priority Fee to 0 in their docs linked here: https://docs-v2.mantle.xyz/devs/concepts/tx-fee/eip-1559#application-of-eip-1559-in-mantle-v2-tectonic +TipCapDefault = '0 wei' +TipCapMin = '0 wei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 \ No newline at end of file diff --git a/ccip/config/evm/Mantle_Sepolia.toml b/ccip/config/evm/Mantle_Sepolia.toml index ee994a71826..705f91142f2 100644 --- a/ccip/config/evm/Mantle_Sepolia.toml +++ b/ccip/config/evm/Mantle_Sepolia.toml @@ -1,19 +1,34 @@ ChainID = '5003' +FinalityTagEnabled = true +FinalityDepth = 1200 ChainType = 'optimismBedrock' -FinalityDepth = 500 LogPollInterval = '2s' -NoNewHeadsThreshold = '0' MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '60m0s' [HeadTracker] -HistoryDepth = 600 +HistoryDepth = 1250 -[GasEstimator] -Mode = 'L2Suggested' -PriceMax = '200 gwei' -LimitDefault = 100000000 -FeeCapDefault = '200 gwei' +[GasEstimator] +PriceMax = '120 gwei' +# Limit values are high as Mantle's GasPrice is in native token (MNT) instead of ETH. Their proprietary TokenRatio parameter is used to adjust fees +LimitDefault = 80000000000 +LimitMax = 100000000000 +BumpMin = '100 wei' +BumpPercent = 20 +BumpThreshold = 60 +EIP1559DynamicFees = true +FeeCapDefault = '120 gwei' +# Mantle reccomends setting Priority Fee to 0 in their docs linked here: https://docs-v2.mantle.xyz/devs/concepts/tx-fee/eip-1559#application-of-eip-1559-in-mantle-v2-tectonic +TipCapDefault = '0 wei' +TipCapMin = '0 wei' [GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. EIP1559FeeCapBufferBlocks = 0 \ No newline at end of file diff --git a/ccip/config/evm/Metis_Mainnet.toml b/ccip/config/evm/Metis_Mainnet.toml index f057400d014..a95945e9f1b 100644 --- a/ccip/config/evm/Metis_Mainnet.toml +++ b/ccip/config/evm/Metis_Mainnet.toml @@ -1,8 +1,14 @@ # Metis is an L2 chain based on Optimism. ChainID = '1088' -ChainType = 'metis' +ChainType = 'optimismBedrock' # Sequencer offers absolute finality -FinalityDepth = 10 +# High variation on finality depth triggered a commitee to investigate +# and set 500 as a secure finality depth. +# https://chainlink-core.slack.com/archives/C0725LNLJLA/p1717118469587219 +FinalityDepth = 500 +# FT and FD are both present here because the dev effort rely only on FinalityTagEnabled are still in progress. +# We expect to be able to rely only on FinalityTagEnabled=true in the short future. +# https://chainlink-core.slack.com/archives/C05CS33N08N/p1715102940763339?thread_ts=1715102478.537529&cid=C05CS33N08N FinalityTagEnabled = true MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' @@ -19,3 +25,8 @@ BlockHistorySize = 0 [NodePool] SyncThreshold = 10 + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Metis_Sepolia.toml b/ccip/config/evm/Metis_Sepolia.toml index 4ff4056c75d..65247991d31 100644 --- a/ccip/config/evm/Metis_Sepolia.toml +++ b/ccip/config/evm/Metis_Sepolia.toml @@ -1,6 +1,9 @@ ChainID = '59902' ChainType = 'optimismBedrock' -FinalityDepth = 10 +# FT and FD are both present here because the dev effort rely only on FinalityTagEnabled are still in progress. +# We expect to be able to rely only on FinalityTagEnabled=true in the short future. +# https://chainlink-core.slack.com/archives/C05CS33N08N/p1715102940763339?thread_ts=1715102478.537529&cid=C05CS33N08N +FinalityDepth = 3000 FinalityTagEnabled = true MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' diff --git a/ccip/config/evm/Mode_Mainnet.toml b/ccip/config/evm/Mode_Mainnet.toml index 69a8e93fecd..b586cdacc78 100644 --- a/ccip/config/evm/Mode_Mainnet.toml +++ b/ccip/config/evm/Mode_Mainnet.toml @@ -24,6 +24,9 @@ EIP1559FeeCapBufferBlocks = 0 [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] PollFailureThreshold = 2 diff --git a/ccip/config/evm/Mode_Sepolia.toml b/ccip/config/evm/Mode_Sepolia.toml index f7398869beb..d621010b4ef 100644 --- a/ccip/config/evm/Mode_Sepolia.toml +++ b/ccip/config/evm/Mode_Sepolia.toml @@ -24,6 +24,9 @@ EIP1559FeeCapBufferBlocks = 0 [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] PollFailureThreshold = 2 diff --git a/ccip/config/evm/Optimism_Mainnet.toml b/ccip/config/evm/Optimism_Mainnet.toml index b0f56a49d90..e1398775495 100644 --- a/ccip/config/evm/Optimism_Mainnet.toml +++ b/ccip/config/evm/Optimism_Mainnet.toml @@ -21,6 +21,9 @@ ResendAfterThreshold = '30s' [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Optimism_Sepolia.toml b/ccip/config/evm/Optimism_Sepolia.toml index 1c71aa5dd83..2590feec51a 100644 --- a/ccip/config/evm/Optimism_Sepolia.toml +++ b/ccip/config/evm/Optimism_Sepolia.toml @@ -20,6 +20,9 @@ ResendAfterThreshold = '30s' [HeadTracker] HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Polygon_Amoy.toml b/ccip/config/evm/Polygon_Amoy.toml index b05b3053a8e..eb75eab271b 100644 --- a/ccip/config/evm/Polygon_Amoy.toml +++ b/ccip/config/evm/Polygon_Amoy.toml @@ -11,10 +11,10 @@ NoNewFinalizedHeadsThreshold = '12m' MaxQueued = 5000 [GasEstimator] -EIP1559DynamicFees = true -PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' PriceDefault = '25 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' PriceMin = '25 gwei' +EIP1559DynamicFees = true BumpMin = '20 gwei' BumpThreshold = 5 @@ -23,6 +23,9 @@ BlockHistorySize = 24 [HeadTracker] HistoryDepth = 2000 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Polygon_Mainnet.toml b/ccip/config/evm/Polygon_Mainnet.toml index bf605cab3c6..555dbfff815 100644 --- a/ccip/config/evm/Polygon_Mainnet.toml +++ b/ccip/config/evm/Polygon_Mainnet.toml @@ -33,6 +33,9 @@ BlockHistorySize = 24 [HeadTracker] # Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough HistoryDepth = 2000 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [NodePool] SyncThreshold = 10 diff --git a/ccip/config/evm/Polygon_Mumbai.toml b/ccip/config/evm/Polygon_Mumbai.toml new file mode 100644 index 00000000000..83f275a0643 --- /dev/null +++ b/ccip/config/evm/Polygon_Mumbai.toml @@ -0,0 +1,31 @@ +ChainID = '80001' +FinalityDepth = 500 +FinalityTagEnabled = true +LinkContractAddress = '0x326C977E6efc84E512bB9C30f76E30c160eD06FB' +LogPollInterval = '1s' +MinIncomingConfirmations = 5 +NoNewHeadsThreshold = '30s' +RPCBlockQueryDelay = 10 +RPCDefaultBatchSize = 100 + +[Transactions] +MaxQueued = 5000 + +[GasEstimator] +PriceDefault = '25 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' +BumpMin = '20 gwei' +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +HistoryDepth = 2000 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/Polygon_Zkevm_Cardona.toml b/ccip/config/evm/Polygon_Zkevm_Cardona.toml index 5e4861f9d44..146c23a8024 100644 --- a/ccip/config/evm/Polygon_Zkevm_Cardona.toml +++ b/ccip/config/evm/Polygon_Zkevm_Cardona.toml @@ -13,15 +13,20 @@ ContractConfirmations = 1 ResendAfterThreshold = '3m' [GasEstimator] -PriceMin = '1 mwei' +Mode = 'FeeHistory' +# The FeeHistory estimator does not enforce PriceMin, setting it to 0 to not place any limits on the price +PriceMin = '0' BumpPercent = 40 -BumpMin = '20 mwei' -[GasEstimator.BlockHistory] -BlockHistorySize = 12 +[GasEstimator.FeeHistory] +# Refresh the suggested price every 4 seconds, to stay slightly below their polling rate of 5s +CacheTimeout = '4s' [HeadTracker] HistoryDepth = 2000 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [Transactions.AutoPurge] Enabled = true diff --git a/ccip/config/evm/Polygon_Zkevm_Mainnet.toml b/ccip/config/evm/Polygon_Zkevm_Mainnet.toml index b38a483ff35..d42ef9b057e 100644 --- a/ccip/config/evm/Polygon_Zkevm_Mainnet.toml +++ b/ccip/config/evm/Polygon_Zkevm_Mainnet.toml @@ -1,6 +1,6 @@ ChainID = '1101' ChainType = 'zkevm' -FinalityDepth = 500 +FinalityDepth = 1000 NoNewHeadsThreshold = '6m' MinIncomingConfirmations = 1 LogPollInterval = '30s' @@ -14,12 +14,14 @@ ContractConfirmations = 1 ResendAfterThreshold = '3m' [GasEstimator] -PriceMin = '100 mwei' +Mode = 'FeeHistory' +# The FeeHistory estimator does not enforce PriceMin, setting it to 0 to not place any limits on the price +PriceMin = '0' BumpPercent = 40 -BumpMin = '100 mwei' -[GasEstimator.BlockHistory] -BlockHistorySize = 12 +[GasEstimator.FeeHistory] +# Refresh the suggested price every 4 seconds, to stay slightly below their polling rate of 5s +CacheTimeout = '4s' [HeadTracker] # Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough diff --git a/ccip/config/evm/RSK_Mainnet.toml b/ccip/config/evm/RSK_Mainnet.toml new file mode 100644 index 00000000000..8290481a331 --- /dev/null +++ b/ccip/config/evm/RSK_Mainnet.toml @@ -0,0 +1,13 @@ +# RSK prices its txes in sats not wei +ChainID = '30' +LinkContractAddress = '0x14AdaE34beF7ca957Ce2dDe5ADD97ea050123827' +LogPollInterval = '30s' +MinContractPayment = '0.001 link' + +[GasEstimator] +# It's about 100 times more expensive than Wei, very roughly speaking +PriceDefault = '50 mwei' +PriceMax = '50 gwei' +PriceMin = '0' +# rsk does not yet support EIP-1559 but this allows validation to pass +FeeCapDefault = '100 mwei' diff --git a/ccip/config/evm/RSK_Testnet.toml b/ccip/config/evm/RSK_Testnet.toml new file mode 100644 index 00000000000..2fde16aa7cc --- /dev/null +++ b/ccip/config/evm/RSK_Testnet.toml @@ -0,0 +1,10 @@ +ChainID = '31' +LinkContractAddress = '0x8bBbd80981FE76d44854D8DF305e8985c19f0e78' +MinContractPayment = '0.001 link' +LogPollInterval = '30s' + +[GasEstimator] +PriceDefault = '50 mwei' +PriceMax = '50 gwei' +PriceMin = '0' +FeeCapDefault = '100 mwei' diff --git a/ccip/config/evm/Ronin_Mainnet.toml b/ccip/config/evm/Ronin_Mainnet.toml new file mode 100644 index 00000000000..14bb9d1e258 --- /dev/null +++ b/ccip/config/evm/Ronin_Mainnet.toml @@ -0,0 +1,16 @@ +ChainID = "2020" +FinalityTagEnabled = true +LinkContractAddress = "0x3902228D6A3d2Dc44731fD9d45FeE6a61c722D0b" +# Ronin produces blocks every 3 seconds +LogPollInterval = "3s" +NoNewHeadsThreshold = "3m" + +[GasEstimator] +# Ronin uses default gas price of 20 gwei https://docs.skymavis.com/mavis/mpc/guides/estimate-gas#overview +Mode = 'FeeHistory' +PriceMax = "1000 gwei" + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Ronin_Saigon.toml b/ccip/config/evm/Ronin_Saigon.toml new file mode 100644 index 00000000000..b775f8f0626 --- /dev/null +++ b/ccip/config/evm/Ronin_Saigon.toml @@ -0,0 +1,16 @@ +ChainID = "2021" +FinalityTagEnabled = true +LinkContractAddress = "0x5bB50A6888ee6a67E22afFDFD9513be7740F1c15" +# Ronin produces blocks every 3 seconds +LogPollInterval = "3s" +NoNewHeadsThreshold = "3m" + +[GasEstimator] +# Ronin uses default gas price of 20 gwei https://docs.skymavis.com/mavis/mpc/guides/estimate-gas#overview +Mode = 'FeeHistory' +PriceMax = "1000 gwei" + +[HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/Scroll_Mainnet.toml b/ccip/config/evm/Scroll_Mainnet.toml index b8e7bd09e80..f0449ef12be 100644 --- a/ccip/config/evm/Scroll_Mainnet.toml +++ b/ccip/config/evm/Scroll_Mainnet.toml @@ -17,6 +17,9 @@ BlockHistorySize = 24 [HeadTracker] HistoryDepth = 50 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [OCR] ContractConfirmations = 1 diff --git a/ccip/config/evm/Scroll_Sepolia.toml b/ccip/config/evm/Scroll_Sepolia.toml index baee2080d96..aca06ae18d3 100644 --- a/ccip/config/evm/Scroll_Sepolia.toml +++ b/ccip/config/evm/Scroll_Sepolia.toml @@ -17,6 +17,9 @@ BlockHistorySize = 24 [HeadTracker] HistoryDepth = 50 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [OCR] ContractConfirmations = 1 diff --git a/ccip/config/evm/Simulated.toml b/ccip/config/evm/Simulated.toml index e21dc0990f0..4ec8d962b21 100644 --- a/ccip/config/evm/Simulated.toml +++ b/ccip/config/evm/Simulated.toml @@ -1,5 +1,5 @@ ChainID = '1337' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 MinContractPayment = '100' NoNewHeadsThreshold = '0s' @@ -19,7 +19,9 @@ PriceMax = '100 micro' HistoryDepth = 10 MaxBufferSize = 100 SamplingInterval = '0s' -PersistenceEnabled = false +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [OCR] ContractConfirmations = 1 diff --git a/ccip/config/evm/Soneium_Sepolia.toml b/ccip/config/evm/Soneium_Sepolia.toml new file mode 100755 index 00000000000..e0ea59ca22f --- /dev/null +++ b/ccip/config/evm/Soneium_Sepolia.toml @@ -0,0 +1,35 @@ +ChainID = '1946' +ChainType = 'optimismBedrock' +LinkContractAddress = '0x7ea13478Ea3961A0e8b538cb05a9DF0477c79Cd2' +FinalityDepth = 200 +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '120m' # Soneium can take upto 2Hours to finalize +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '1 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 60 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/ccip/config/evm/Sonic_Mainnet.toml b/ccip/config/evm/Sonic_Mainnet.toml new file mode 100644 index 00000000000..523a931c8d6 --- /dev/null +++ b/ccip/config/evm/Sonic_Mainnet.toml @@ -0,0 +1,28 @@ +ChainId = '146' +FinalityDepth = 10 +FinalityTagEnabled = false +LogPollInterval = "1s" #1s block rate +MinIncomingConfirmations = 5 +RPCBlockQueryDelay = 10 +RPCDefaultBatchSize = 100 + +[GasEstimator] +Mode = 'FeeHistory' +EIP1559DynamicFees = true +BumpPercent = 10 +LimitDefault = 8000000 # default ccip value + +[GasEstimator.FeeHistory] +CacheTimeout = '2s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[HeadTracker] +HistoryDepth = 50 + +[NodePool] +SyncThreshold = 10 + +[Transactions] +MaxQueued = 500 \ No newline at end of file diff --git a/ccip/config/evm/Sonic_Testnet.toml b/ccip/config/evm/Sonic_Testnet.toml new file mode 100644 index 00000000000..ca3ccf8f718 --- /dev/null +++ b/ccip/config/evm/Sonic_Testnet.toml @@ -0,0 +1,28 @@ +ChainId = '57054' +FinalityDepth = 10 +FinalityTagEnabled = false +LogPollInterval = "1s" #1s block rate +MinIncomingConfirmations = 5 +RPCBlockQueryDelay = 10 +RPCDefaultBatchSize = 100 + +[GasEstimator] +Mode = 'FeeHistory' +EIP1559DynamicFees = true +BumpPercent = 10 +LimitDefault = 8000000 # default ccip value + +[GasEstimator.FeeHistory] +CacheTimeout = '2s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 + +[HeadTracker] +HistoryDepth = 50 + +[NodePool] +SyncThreshold = 10 + +[Transactions] +MaxQueued = 500 \ No newline at end of file diff --git a/ccip/config/evm/Unichain_Testnet.toml b/ccip/config/evm/Unichain_Testnet.toml new file mode 100644 index 00000000000..5e18f0d4716 --- /dev/null +++ b/ccip/config/evm/Unichain_Testnet.toml @@ -0,0 +1,26 @@ +ChainID = '1301' +# OP stack: https://docs.unichain.org/docs/getting-started/set-up-a-node#overview +ChainType = 'optimismBedrock' +# finality_depth was: ~1900 +FinalityDepth = 2000 +# block_time was: ~1s, adding 1 second buffer +LogPollInterval = '2s' + +# batching_size_finalization_percentage = 30% according to the explorer batching view +# ( batching_size_finalization_percentage * finality_depth) * block_time / 60 secs = ~10 min (finality time) +# After running soak tests using 10m threw issues as there are batchs that take 35m, so we are bumping it to 45m to be sure +NoNewFinalizedHeadsThreshold = '45m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 1s, per recommendation skip 1-2 blocks +CacheTimeout = '2s' + +[GasEstimator.BlockHistory] +# As we see blocks containing between ~[8-12]tx, to get about ~1000 tx to check we would need to rougly go 100 tx back +BlockHistorySize = 100 diff --git a/ccip/config/evm/WeMix_Mainnet.toml b/ccip/config/evm/WeMix_Mainnet.toml index be7c278f692..a4e742d7300 100644 --- a/ccip/config/evm/WeMix_Mainnet.toml +++ b/ccip/config/evm/WeMix_Mainnet.toml @@ -16,4 +16,6 @@ EIP1559DynamicFees = true TipCapDefault = '100 gwei' [HeadTracker] -PersistenceEnabled = false +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false diff --git a/ccip/config/evm/WeMix_Testnet.toml b/ccip/config/evm/WeMix_Testnet.toml index 4591fc4c572..bfb75f158e3 100644 --- a/ccip/config/evm/WeMix_Testnet.toml +++ b/ccip/config/evm/WeMix_Testnet.toml @@ -16,5 +16,6 @@ EIP1559DynamicFees = true TipCapDefault = '100 gwei' [HeadTracker] +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 FinalityTagBypass = false -PersistenceEnabled = false diff --git a/ccip/config/evm/Worldchain_Mainnet.toml b/ccip/config/evm/Worldchain_Mainnet.toml new file mode 100644 index 00000000000..9b25d89d98c --- /dev/null +++ b/ccip/config/evm/Worldchain_Mainnet.toml @@ -0,0 +1,23 @@ +ChainID = '480' +# OP stack: https://worldcoin.notion.site/World-Chain-Developer-Preview-Guide-23c94a67683f4e71986e5303ab88c9f3 +ChainType = 'optimismBedrock' +# finality_depth was: ~2400 +FinalityDepth = 2500 +# block_time was: 2s, adding 1 second buffer +LogPollInterval = '3s' + +# finality_depth * block_time / 60 secs = ~83 min (finality time) +NoNewFinalizedHeadsThreshold = '90m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 2s, per recommendation skip 1-2 blocks +CacheTimeout = '4s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 diff --git a/ccip/config/evm/Worldchain_Testnet.toml b/ccip/config/evm/Worldchain_Testnet.toml new file mode 100644 index 00000000000..01618322285 --- /dev/null +++ b/ccip/config/evm/Worldchain_Testnet.toml @@ -0,0 +1,23 @@ +ChainID = '4801' +# OP stack: https://worldcoin.notion.site/World-Chain-Developer-Preview-Guide-23c94a67683f4e71986e5303ab88c9f3 +ChainType = 'optimismBedrock' +# finality_depth was: ~2400 +FinalityDepth = 2500 +# block_time was: 2s, adding 1 second buffer +LogPollInterval = '3s' + +# finality_depth * block_time / 60 secs = ~83 min (finality time) +NoNewFinalizedHeadsThreshold = '90m' + +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +Mode = 'FeeHistory' + +[GasEstimator.FeeHistory] +# block_time was: 2s, per recommendation skip 1-2 blocks +CacheTimeout = '4s' + +[GasEstimator.BlockHistory] +BlockHistorySize = 100 diff --git a/ccip/config/evm/XLayer_Mainnet.toml b/ccip/config/evm/XLayer_Mainnet.toml index a39a9231ae2..28f7819276c 100644 --- a/ccip/config/evm/XLayer_Mainnet.toml +++ b/ccip/config/evm/XLayer_Mainnet.toml @@ -1,6 +1,6 @@ ChainID = '196' ChainType = 'xlayer' -FinalityDepth = 500 +FinalityDepth = 1000 NoNewHeadsThreshold = '6m' MinIncomingConfirmations = 1 LogPollInterval = '30s' diff --git a/ccip/config/evm/XLayer_Sepolia.toml b/ccip/config/evm/XLayer_Sepolia.toml index 2aa6e58469b..163d909542e 100644 --- a/ccip/config/evm/XLayer_Sepolia.toml +++ b/ccip/config/evm/XLayer_Sepolia.toml @@ -23,6 +23,9 @@ BlockHistorySize = 12 [HeadTracker] HistoryDepth = 2000 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false [Transactions.AutoPurge] Enabled = true diff --git a/ccip/config/evm/fallback.toml b/ccip/config/evm/fallback.toml new file mode 100644 index 00000000000..c1f963a33ff --- /dev/null +++ b/ccip/config/evm/fallback.toml @@ -0,0 +1,95 @@ +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 50 +FinalityTagEnabled = false +LogBackfillBatchSize = 1000 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +# CCIP uses paging when removing logs to avoid pushing too much pressure on the database +LogPrunePageSize = 10000 +BackupLogPollerBlockDelay = 100 +MinContractPayment = '.00001 link' +MinIncomingConfirmations = 3 +NonceAutoSync = true +NoNewHeadsThreshold = '3m' +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0' +LogBroadcasterEnabled = true + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h' +ReaperThreshold = '168h' +ResendAfterThreshold = '1m' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 8_000_000 +LimitMax = 8_000_000 +LimitMultiplier = '1' +LimitTransfer = 21_000 +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = false +FeeCapDefault = '100 gwei' +TipCapDefault = '1' +TipCapMin = '1' +EstimateLimit = false + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 8 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +FinalityTagBypass = true +MaxAllowedFinalityDepth = 10000 + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h' +DeltaCJitterOverride = '1h' +ObservationGracePeriod = '1s' + +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400_000 diff --git a/ccip/config/evm/zkSync_Mainnet.toml b/ccip/config/evm/zkSync_Mainnet.toml index a8910a37e4a..a29098690b4 100644 --- a/ccip/config/evm/zkSync_Mainnet.toml +++ b/ccip/config/evm/zkSync_Mainnet.toml @@ -28,4 +28,4 @@ OracleType = 'zksync' [HeadTracker] # tracks top N blocks to keep in heads database table. Should store atleast the same # of blocks as finalityDepth -HistoryDepth = 1500 \ No newline at end of file +HistoryDepth = 1500 diff --git a/ccip/config/evm/zkSync_Sepolia.toml b/ccip/config/evm/zkSync_Sepolia.toml index 6eb4ba4137e..36b0c9282da 100644 --- a/ccip/config/evm/zkSync_Sepolia.toml +++ b/ccip/config/evm/zkSync_Sepolia.toml @@ -1,23 +1,23 @@ ChainID = '300' ChainType = 'zksync' # 200block ~ 20min concurrent with the l1_committed tag -FinalityDepth = 200 +FinalityDepth = 200 # block rate is ~2-5sec, so this ensures blocks are polled correctly LogPollInterval = '5s' # sufficient time for RPC to be labelled out of sync, since blockRate is pretty fast NoNewHeadsThreshold = '1m' [GasEstimator] -# no EIP1559 to ensure our estimator doesnot estimate gas with MaxPriorityFee which will break minFunding requirement -EIP1559DynamicFees = false -# high LimitDefault for worst case pubdata bytes with BatchGasLimit reduced to 4M in OCR2Config +# no EIP1559 to ensure our estimator doesnot estimate gas with MaxPriorityFee which will break minFunding requirement +EIP1559DynamicFees = false +# high LimitDefault for worst case pubdata bytes with BatchGasLimit reduced to 4M in OCR2Config LimitDefault = 2_500_000_000 FeeCapDefault = '500 mwei' PriceDefault = '25 mwei' # p999 value for gasPrice based on historical data PriceMax = '500 mwei' # avg gasPrices are at 0.025 gwei -PriceMin = '25 mwei' +PriceMin = '25 mwei' [GasEstimator.BlockHistory] # increasing this to smooth out gas estimation @@ -28,4 +28,7 @@ OracleType = 'zksync' [HeadTracker] # tracks top N blocks to keep in heads database table. Should store atleast the same # of blocks as finalityDepth -HistoryDepth = 250 \ No newline at end of file +HistoryDepth = 250 +# FinalityDepth < 1k => FinalityTagBypass = false +# https://smartcontract-it.atlassian.net/browse/SHIP-4078 +FinalityTagBypass = false From d2cb00789be0690e62e7dc8db0220218dae99ce7 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 8 Jan 2025 12:46:01 -0500 Subject: [PATCH 14/91] Remove panic recovery for wsrpc (#15865) - Due to some other bug in the library, the redialled connection never becomes ready. --- .../relay/evm/mercury/wsrpc/client.go | 14 ---- .../relay/evm/mercury/wsrpc/client_test.go | 66 ------------------- 2 files changed, 80 deletions(-) diff --git a/core/services/relay/evm/mercury/wsrpc/client.go b/core/services/relay/evm/mercury/wsrpc/client.go index ebd282e6093..1cd8c9af50d 100644 --- a/core/services/relay/evm/mercury/wsrpc/client.go +++ b/core/services/relay/evm/mercury/wsrpc/client.go @@ -286,13 +286,6 @@ func (w *client) waitForReady(ctx context.Context) (err error) { func (w *client) Transmit(ctx context.Context, req *pb.TransmitRequest) (resp *pb.TransmitResponse, err error) { ok := w.IfStarted(func() { - defer func() { - if r := recover(); r != nil { - w.handlePanic(r) - resp = nil - err = fmt.Errorf("Transmit: caught panic: %v", r) - } - }() w.logger.Trace("Transmit") start := time.Now() if err = w.waitForReady(ctx); err != nil { @@ -360,13 +353,6 @@ func (w *client) handleTimeout(err error) { func (w *client) LatestReport(ctx context.Context, req *pb.LatestReportRequest) (resp *pb.LatestReportResponse, err error) { ok := w.IfStarted(func() { - defer func() { - if r := recover(); r != nil { - w.handlePanic(r) - resp = nil - err = fmt.Errorf("LatestReport: caught panic: %v", r) - } - }() lggr := w.logger.With("req.FeedId", hexutil.Encode(req.FeedId)) lggr.Trace("LatestReport") if err = w.waitForReady(ctx); err != nil { diff --git a/core/services/relay/evm/mercury/wsrpc/client_test.go b/core/services/relay/evm/mercury/wsrpc/client_test.go index b2bbf074e91..7c6706eddf8 100644 --- a/core/services/relay/evm/mercury/wsrpc/client_test.go +++ b/core/services/relay/evm/mercury/wsrpc/client_test.go @@ -2,16 +2,11 @@ package wsrpc import ( "context" - "math/big" - "math/rand" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - grpc_connectivity "google.golang.org/grpc/connectivity" - - "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -128,67 +123,6 @@ func Test_Client_Transmit(t *testing.T) { } }) }) - - t.Run("recovers panics in underlying client and attempts redial", func(t *testing.T) { - makeConn := func() *mocks.MockConn { - return &mocks.MockConn{ - Ready: true, - State: grpc_connectivity.Ready, - InvokeF: func(ctx context.Context, method string, args interface{}, reply interface{}) error { - panic("TESTING CONN INVOKE PANIC") - }, - } - } - - ch := make(chan *mocks.MockConn, 100) - cnt := 0 - - f := func(ctxCaller context.Context, target string, opts ...wsrpc.DialOption) (Conn, error) { - cnt++ - switch cnt { - case 1, 2: - conn := makeConn() - ch <- conn - return conn, nil - default: - t.Fatalf("too many dials, got: %d", cnt) - return nil, nil - } - } - - clientKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(rand.Int63())) - serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(rand.Int63())) - opts := ClientOpts{ - lggr, - clientKey, - serverKey.PublicKey, - "", - noopCacheSet, - f, - } - c := newClient(opts) - - servicetest.Run(t, c) - - // drain the channel - var conn *mocks.MockConn - select { - case conn = <-ch: - assert.Equal(t, 1, cnt) - default: - t.Fatalf("expected dial to be called") - } - - _, err := c.Transmit(ctx, req) - require.EqualError(t, err, "Transmit: caught panic: TESTING CONN INVOKE PANIC") - - // expect conn to be closed and re-dialed - conn2 := <-ch - assert.Equal(t, 2, cnt) - - assert.True(t, conn.Closed) - assert.False(t, conn2.Closed) - }) } func Test_Client_LatestReport(t *testing.T) { From 0747d30778e62cbd5bd913f8754f3c70f1ffb6ea Mon Sep 17 00:00:00 2001 From: Dmytro Haidashenko <34754799+dhaidashenko@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:17:42 +0100 Subject: [PATCH 15/91] Added is_backfiled filed to solana's filter table (#15796) --- .../0263_solana_filter_is_backfilled.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 core/store/migrate/migrations/0263_solana_filter_is_backfilled.sql diff --git a/core/store/migrate/migrations/0263_solana_filter_is_backfilled.sql b/core/store/migrate/migrations/0263_solana_filter_is_backfilled.sql new file mode 100644 index 00000000000..7e81e7c4c5e --- /dev/null +++ b/core/store/migrate/migrations/0263_solana_filter_is_backfilled.sql @@ -0,0 +1,14 @@ +-- +goose Up +-- +goose StatementBegin + +ALTER TABLE solana.log_poller_filters ADD COLUMN is_backfilled BOOLEAN; +UPDATE solana.log_poller_filters SET is_backfilled = true; +ALTER TABLE solana.log_poller_filters ALTER COLUMN is_backfilled SET NOT NULL; +-- +goose StatementEnd + + +-- +goose Down +-- +goose StatementBegin + +ALTER TABLE solana.log_poller_filters DROP COLUMN is_backfilled; +-- +goose StatementEnd From 2450fff71db772d7e771babb5cbe1a55f5a51f84 Mon Sep 17 00:00:00 2001 From: Dylan Tinianov Date: Wed, 8 Jan 2025 13:43:31 -0500 Subject: [PATCH 16/91] Extract MultiNode to chainlink-framework (#15791) * Extract MultiNode * tidy * tidy * Fix generate * Add mock Subscription * lint * Fix sendonly allocation * lint * Add QueryTimeout to client * Use multinode * Update rpc_client_test.go --- .changeset/cold-pillows-sleep.md | 5 + .mockery.yaml | 20 +- common/client/ctx.go | 17 - common/client/ctx_test.go | 16 - common/client/mock_hashable_test.go | 18 - common/client/mock_head_test.go | 173 -- common/client/mock_node_selector_test.go | 127 -- common/client/mock_node_test.go | 567 ----- .../mock_pool_chain_info_provider_test.go | 132 -- common/client/mock_rpc_client_test.go | 510 ----- common/client/mock_send_only_client_test.go | 173 -- common/client/mock_send_only_node_test.go | 357 --- common/client/mocks/config.go | 31 - common/client/models.go | 121 - common/client/models_test.go | 50 - common/client/multi_node.go | 364 --- common/client/multi_node_test.go | 517 ----- common/client/node.go | 336 --- common/client/node_fsm.go | 377 ---- common/client/node_fsm_test.go | 131 -- common/client/node_lifecycle.go | 700 ------ common/client/node_lifecycle_test.go | 1983 ----------------- common/client/node_selector.go | 43 - common/client/node_selector_highest_head.go | 40 - .../client/node_selector_highest_head_test.go | 176 -- common/client/node_selector_priority_level.go | 123 - .../node_selector_priority_level_test.go | 91 - common/client/node_selector_round_robin.go | 48 - .../client/node_selector_round_robin_test.go | 61 - common/client/node_selector_test.go | 18 - .../client/node_selector_total_difficulty.go | 53 - .../node_selector_total_difficulty_test.go | 178 -- common/client/node_test.go | 107 - common/client/poller.go | 95 - common/client/poller_test.go | 194 -- common/client/send_only_node.go | 183 -- common/client/send_only_node_lifecycle.go | 67 - common/client/send_only_node_test.go | 139 -- common/client/timeout.go | 5 + common/client/transaction_sender.go | 301 --- common/client/transaction_sender_test.go | 419 ---- common/client/types.go | 83 - common/client/types_test.go | 34 - common/txmgr/broadcaster.go | 34 +- common/txmgr/confirmer.go | 20 +- common/txmgr/resender.go | 8 +- common/txmgr/types/client.go | 7 +- common/types/mocks/head.go | 607 ----- core/chains/evm/client/chain_client.go | 18 +- core/chains/evm/client/chain_client_test.go | 82 +- core/chains/evm/client/config_builder.go | 4 +- core/chains/evm/client/errors.go | 42 +- core/chains/evm/client/errors_test.go | 7 +- core/chains/evm/client/evm_client.go | 15 +- core/chains/evm/client/helpers_test.go | 29 +- core/chains/evm/client/mocks/client.go | 18 +- core/chains/evm/client/null_client.go | 6 +- core/chains/evm/client/rpc_client.go | 51 +- .../evm/client/rpc_client_internal_test.go | 5 +- core/chains/evm/client/rpc_client_test.go | 54 +- .../evm/client/simulated_backend_client.go | 10 +- core/chains/evm/txmgr/broadcaster_test.go | 88 +- core/chains/evm/txmgr/client.go | 10 +- core/chains/evm/txmgr/confirmer_test.go | 78 +- core/cmd/shell_local_test.go | 8 +- core/internal/cltest/cltest.go | 4 +- core/scripts/go.mod | 9 +- core/scripts/go.sum | 18 +- core/services/chainlink/config_test.go | 6 +- deployment/go.mod | 9 +- deployment/go.sum | 18 +- go.md | 6 + go.mod | 9 +- go.sum | 18 +- integration-tests/go.mod | 9 +- integration-tests/go.sum | 18 +- integration-tests/load/go.mod | 9 +- integration-tests/load/go.sum | 18 +- 78 files changed, 399 insertions(+), 10136 deletions(-) create mode 100644 .changeset/cold-pillows-sleep.md delete mode 100644 common/client/ctx.go delete mode 100644 common/client/ctx_test.go delete mode 100644 common/client/mock_hashable_test.go delete mode 100644 common/client/mock_head_test.go delete mode 100644 common/client/mock_node_selector_test.go delete mode 100644 common/client/mock_node_test.go delete mode 100644 common/client/mock_pool_chain_info_provider_test.go delete mode 100644 common/client/mock_rpc_client_test.go delete mode 100644 common/client/mock_send_only_client_test.go delete mode 100644 common/client/mock_send_only_node_test.go delete mode 100644 common/client/mocks/config.go delete mode 100644 common/client/models.go delete mode 100644 common/client/models_test.go delete mode 100644 common/client/multi_node.go delete mode 100644 common/client/multi_node_test.go delete mode 100644 common/client/node.go delete mode 100644 common/client/node_fsm.go delete mode 100644 common/client/node_fsm_test.go delete mode 100644 common/client/node_lifecycle.go delete mode 100644 common/client/node_lifecycle_test.go delete mode 100644 common/client/node_selector.go delete mode 100644 common/client/node_selector_highest_head.go delete mode 100644 common/client/node_selector_highest_head_test.go delete mode 100644 common/client/node_selector_priority_level.go delete mode 100644 common/client/node_selector_priority_level_test.go delete mode 100644 common/client/node_selector_round_robin.go delete mode 100644 common/client/node_selector_round_robin_test.go delete mode 100644 common/client/node_selector_test.go delete mode 100644 common/client/node_selector_total_difficulty.go delete mode 100644 common/client/node_selector_total_difficulty_test.go delete mode 100644 common/client/node_test.go delete mode 100644 common/client/poller.go delete mode 100644 common/client/poller_test.go delete mode 100644 common/client/send_only_node.go delete mode 100644 common/client/send_only_node_lifecycle.go delete mode 100644 common/client/send_only_node_test.go create mode 100644 common/client/timeout.go delete mode 100644 common/client/transaction_sender.go delete mode 100644 common/client/transaction_sender_test.go delete mode 100644 common/client/types.go delete mode 100644 common/client/types_test.go delete mode 100644 common/types/mocks/head.go diff --git a/.changeset/cold-pillows-sleep.md b/.changeset/cold-pillows-sleep.md new file mode 100644 index 00000000000..45e4e999111 --- /dev/null +++ b/.changeset/cold-pillows-sleep.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Extract EVM MultiNode to chainlink-framework. #internal diff --git a/.mockery.yaml b/.mockery.yaml index 7efde733145..73f46deed57 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -3,20 +3,6 @@ mockname: "{{ .InterfaceName }}" outpkg: mocks filename: "{{ .InterfaceName | snakecase }}.go" packages: - github.com/smartcontractkit/chainlink/v2/common/client: - config: - dir: "{{ .InterfaceDir }}" - filename: "mock_{{ .InterfaceName | snakecase }}_test.go" - inpackage: true - mockname: "mock{{ .InterfaceName | camelcase }}" - interfaces: - Node: - NodeSelector: - sendOnlyClient: - SendOnlyNode: - RPCClient: - Head: - PoolChainInfoProvider: github.com/smartcontractkit/chainlink/v2/common/headtracker: interfaces: HeadTrackable: @@ -35,9 +21,11 @@ packages: TxStrategy: TxAttemptBuilder: TxStore: - github.com/smartcontractkit/chainlink/v2/common/types: + github.com/smartcontractkit/chainlink-framework/multinode: + config: + dir: common/types/mocks + outpkg: mocks interfaces: - Head: Subscription: github.com/smartcontractkit/chainlink/v2/core/bridges: interfaces: diff --git a/common/client/ctx.go b/common/client/ctx.go deleted file mode 100644 index 57b2fc8a866..00000000000 --- a/common/client/ctx.go +++ /dev/null @@ -1,17 +0,0 @@ -package client - -import "context" - -type multiNodeContextKey int - -const ( - contextKeyHeathCheckRequest multiNodeContextKey = iota + 1 -) - -func CtxAddHealthCheckFlag(ctx context.Context) context.Context { - return context.WithValue(ctx, contextKeyHeathCheckRequest, struct{}{}) -} - -func CtxIsHeathCheckRequest(ctx context.Context) bool { - return ctx.Value(contextKeyHeathCheckRequest) != nil -} diff --git a/common/client/ctx_test.go b/common/client/ctx_test.go deleted file mode 100644 index 822b36c3f81..00000000000 --- a/common/client/ctx_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" -) - -func TestContext(t *testing.T) { - ctx := tests.Context(t) - assert.False(t, CtxIsHeathCheckRequest(ctx), "expected false for test context") - ctx = CtxAddHealthCheckFlag(ctx) - assert.True(t, CtxIsHeathCheckRequest(ctx), "expected context to contain the healthcheck flag") -} diff --git a/common/client/mock_hashable_test.go b/common/client/mock_hashable_test.go deleted file mode 100644 index d9f1670c073..00000000000 --- a/common/client/mock_hashable_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import "cmp" - -// Hashable - simple implementation of types.Hashable interface to be used as concrete type in tests -type Hashable string - -func (h Hashable) Cmp(c Hashable) int { - return cmp.Compare(h, c) -} - -func (h Hashable) String() string { - return string(h) -} - -func (h Hashable) Bytes() []byte { - return []byte(h) -} diff --git a/common/client/mock_head_test.go b/common/client/mock_head_test.go deleted file mode 100644 index 01884d3fcfc..00000000000 --- a/common/client/mock_head_test.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import ( - big "math/big" - - mock "github.com/stretchr/testify/mock" -) - -// mockHead is an autogenerated mock type for the Head type -type mockHead struct { - mock.Mock -} - -type mockHead_Expecter struct { - mock *mock.Mock -} - -func (_m *mockHead) EXPECT() *mockHead_Expecter { - return &mockHead_Expecter{mock: &_m.Mock} -} - -// BlockDifficulty provides a mock function with no fields -func (_m *mockHead) BlockDifficulty() *big.Int { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for BlockDifficulty") - } - - var r0 *big.Int - if rf, ok := ret.Get(0).(func() *big.Int); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) - } - } - - return r0 -} - -// mockHead_BlockDifficulty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockDifficulty' -type mockHead_BlockDifficulty_Call struct { - *mock.Call -} - -// BlockDifficulty is a helper method to define mock.On call -func (_e *mockHead_Expecter) BlockDifficulty() *mockHead_BlockDifficulty_Call { - return &mockHead_BlockDifficulty_Call{Call: _e.mock.On("BlockDifficulty")} -} - -func (_c *mockHead_BlockDifficulty_Call) Run(run func()) *mockHead_BlockDifficulty_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockHead_BlockDifficulty_Call) Return(_a0 *big.Int) *mockHead_BlockDifficulty_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockHead_BlockDifficulty_Call) RunAndReturn(run func() *big.Int) *mockHead_BlockDifficulty_Call { - _c.Call.Return(run) - return _c -} - -// BlockNumber provides a mock function with no fields -func (_m *mockHead) BlockNumber() int64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for BlockNumber") - } - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// mockHead_BlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockNumber' -type mockHead_BlockNumber_Call struct { - *mock.Call -} - -// BlockNumber is a helper method to define mock.On call -func (_e *mockHead_Expecter) BlockNumber() *mockHead_BlockNumber_Call { - return &mockHead_BlockNumber_Call{Call: _e.mock.On("BlockNumber")} -} - -func (_c *mockHead_BlockNumber_Call) Run(run func()) *mockHead_BlockNumber_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockHead_BlockNumber_Call) Return(_a0 int64) *mockHead_BlockNumber_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockHead_BlockNumber_Call) RunAndReturn(run func() int64) *mockHead_BlockNumber_Call { - _c.Call.Return(run) - return _c -} - -// IsValid provides a mock function with no fields -func (_m *mockHead) IsValid() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsValid") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// mockHead_IsValid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsValid' -type mockHead_IsValid_Call struct { - *mock.Call -} - -// IsValid is a helper method to define mock.On call -func (_e *mockHead_Expecter) IsValid() *mockHead_IsValid_Call { - return &mockHead_IsValid_Call{Call: _e.mock.On("IsValid")} -} - -func (_c *mockHead_IsValid_Call) Run(run func()) *mockHead_IsValid_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockHead_IsValid_Call) Return(_a0 bool) *mockHead_IsValid_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockHead_IsValid_Call) RunAndReturn(run func() bool) *mockHead_IsValid_Call { - _c.Call.Return(run) - return _c -} - -// newMockHead creates a new instance of mockHead. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockHead(t interface { - mock.TestingT - Cleanup(func()) -}) *mockHead { - mock := &mockHead{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mock_node_selector_test.go b/common/client/mock_node_selector_test.go deleted file mode 100644 index c4201664b4a..00000000000 --- a/common/client/mock_node_selector_test.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import ( - types "github.com/smartcontractkit/chainlink/v2/common/types" - mock "github.com/stretchr/testify/mock" -) - -// mockNodeSelector is an autogenerated mock type for the NodeSelector type -type mockNodeSelector[CHAIN_ID types.ID, RPC interface{}] struct { - mock.Mock -} - -type mockNodeSelector_Expecter[CHAIN_ID types.ID, RPC interface{}] struct { - mock *mock.Mock -} - -func (_m *mockNodeSelector[CHAIN_ID, RPC]) EXPECT() *mockNodeSelector_Expecter[CHAIN_ID, RPC] { - return &mockNodeSelector_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} -} - -// Name provides a mock function with no fields -func (_m *mockNodeSelector[CHAIN_ID, RPC]) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// mockNodeSelector_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type mockNodeSelector_Name_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Name is a helper method to define mock.On call -func (_e *mockNodeSelector_Expecter[CHAIN_ID, RPC]) Name() *mockNodeSelector_Name_Call[CHAIN_ID, RPC] { - return &mockNodeSelector_Name_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Name")} -} - -func (_c *mockNodeSelector_Name_Call[CHAIN_ID, RPC]) Run(run func()) *mockNodeSelector_Name_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNodeSelector_Name_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockNodeSelector_Name_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNodeSelector_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockNodeSelector_Name_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// Select provides a mock function with no fields -func (_m *mockNodeSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Select") - } - - var r0 Node[CHAIN_ID, RPC] - if rf, ok := ret.Get(0).(func() Node[CHAIN_ID, RPC]); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(Node[CHAIN_ID, RPC]) - } - } - - return r0 -} - -// mockNodeSelector_Select_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Select' -type mockNodeSelector_Select_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Select is a helper method to define mock.On call -func (_e *mockNodeSelector_Expecter[CHAIN_ID, RPC]) Select() *mockNodeSelector_Select_Call[CHAIN_ID, RPC] { - return &mockNodeSelector_Select_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Select")} -} - -func (_c *mockNodeSelector_Select_Call[CHAIN_ID, RPC]) Run(run func()) *mockNodeSelector_Select_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNodeSelector_Select_Call[CHAIN_ID, RPC]) Return(_a0 Node[CHAIN_ID, RPC]) *mockNodeSelector_Select_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNodeSelector_Select_Call[CHAIN_ID, RPC]) RunAndReturn(run func() Node[CHAIN_ID, RPC]) *mockNodeSelector_Select_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// newMockNodeSelector creates a new instance of mockNodeSelector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockNodeSelector[CHAIN_ID types.ID, RPC interface{}](t interface { - mock.TestingT - Cleanup(func()) -}) *mockNodeSelector[CHAIN_ID, RPC] { - mock := &mockNodeSelector[CHAIN_ID, RPC]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mock_node_test.go b/common/client/mock_node_test.go deleted file mode 100644 index f0fc6a4cb58..00000000000 --- a/common/client/mock_node_test.go +++ /dev/null @@ -1,567 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import ( - context "context" - - types "github.com/smartcontractkit/chainlink/v2/common/types" - mock "github.com/stretchr/testify/mock" -) - -// mockNode is an autogenerated mock type for the Node type -type mockNode[CHAIN_ID types.ID, RPC interface{}] struct { - mock.Mock -} - -type mockNode_Expecter[CHAIN_ID types.ID, RPC interface{}] struct { - mock *mock.Mock -} - -func (_m *mockNode[CHAIN_ID, RPC]) EXPECT() *mockNode_Expecter[CHAIN_ID, RPC] { - return &mockNode_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} -} - -// Close provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) Close() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Close") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockNode_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type mockNode_Close_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Close is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) Close() *mockNode_Close_Call[CHAIN_ID, RPC] { - return &mockNode_Close_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Close")} -} - -func (_c *mockNode_Close_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_Close_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_Close_Call[CHAIN_ID, RPC]) Return(_a0 error) *mockNode_Close_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_Close_Call[CHAIN_ID, RPC]) RunAndReturn(run func() error) *mockNode_Close_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// ConfiguredChainID provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ConfiguredChainID") - } - - var r0 CHAIN_ID - if rf, ok := ret.Get(0).(func() CHAIN_ID); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(CHAIN_ID) - } - } - - return r0 -} - -// mockNode_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' -type mockNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// ConfiguredChainID is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) ConfiguredChainID() *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - return &mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC]{Call: _e.mock.On("ConfiguredChainID")} -} - -func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) Return(_a0 CHAIN_ID) *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) RunAndReturn(run func() CHAIN_ID) *mockNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// HighestUserObservations provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) HighestUserObservations() ChainInfo { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HighestUserObservations") - } - - var r0 ChainInfo - if rf, ok := ret.Get(0).(func() ChainInfo); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ChainInfo) - } - - return r0 -} - -// mockNode_HighestUserObservations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HighestUserObservations' -type mockNode_HighestUserObservations_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// HighestUserObservations is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) HighestUserObservations() *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC] { - return &mockNode_HighestUserObservations_Call[CHAIN_ID, RPC]{Call: _e.mock.On("HighestUserObservations")} -} - -func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC]) Return(_a0 ChainInfo) *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC]) RunAndReturn(run func() ChainInfo) *mockNode_HighestUserObservations_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// Name provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// mockNode_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type mockNode_Name_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Name is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) Name() *mockNode_Name_Call[CHAIN_ID, RPC] { - return &mockNode_Name_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Name")} -} - -func (_c *mockNode_Name_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_Name_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_Name_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockNode_Name_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockNode_Name_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// Order provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) Order() int32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Order") - } - - var r0 int32 - if rf, ok := ret.Get(0).(func() int32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int32) - } - - return r0 -} - -// mockNode_Order_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Order' -type mockNode_Order_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Order is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) Order() *mockNode_Order_Call[CHAIN_ID, RPC] { - return &mockNode_Order_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Order")} -} - -func (_c *mockNode_Order_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_Order_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_Order_Call[CHAIN_ID, RPC]) Return(_a0 int32) *mockNode_Order_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_Order_Call[CHAIN_ID, RPC]) RunAndReturn(run func() int32) *mockNode_Order_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// RPC provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) RPC() RPC { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for RPC") - } - - var r0 RPC - if rf, ok := ret.Get(0).(func() RPC); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(RPC) - } - } - - return r0 -} - -// mockNode_RPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPC' -type mockNode_RPC_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// RPC is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) RPC() *mockNode_RPC_Call[CHAIN_ID, RPC] { - return &mockNode_RPC_Call[CHAIN_ID, RPC]{Call: _e.mock.On("RPC")} -} - -func (_c *mockNode_RPC_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_RPC_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_RPC_Call[CHAIN_ID, RPC]) Return(_a0 RPC) *mockNode_RPC_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_RPC_Call[CHAIN_ID, RPC]) RunAndReturn(run func() RPC) *mockNode_RPC_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// SetPoolChainInfoProvider provides a mock function with given fields: _a0 -func (_m *mockNode[CHAIN_ID, RPC]) SetPoolChainInfoProvider(_a0 PoolChainInfoProvider) { - _m.Called(_a0) -} - -// mockNode_SetPoolChainInfoProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPoolChainInfoProvider' -type mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// SetPoolChainInfoProvider is a helper method to define mock.On call -// - _a0 PoolChainInfoProvider -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) SetPoolChainInfoProvider(_a0 interface{}) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC] { - return &mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC]{Call: _e.mock.On("SetPoolChainInfoProvider", _a0)} -} - -func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC]) Run(run func(_a0 PoolChainInfoProvider)) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(PoolChainInfoProvider)) - }) - return _c -} - -func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC]) Return() *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC] { - _c.Call.Return() - return _c -} - -func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC]) RunAndReturn(run func(PoolChainInfoProvider)) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, RPC] { - _c.Run(run) - return _c -} - -// Start provides a mock function with given fields: _a0 -func (_m *mockNode[CHAIN_ID, RPC]) Start(_a0 context.Context) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockNode_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type mockNode_Start_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - _a0 context.Context -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) Start(_a0 interface{}) *mockNode_Start_Call[CHAIN_ID, RPC] { - return &mockNode_Start_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Start", _a0)} -} - -func (_c *mockNode_Start_Call[CHAIN_ID, RPC]) Run(run func(_a0 context.Context)) *mockNode_Start_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockNode_Start_Call[CHAIN_ID, RPC]) Return(_a0 error) *mockNode_Start_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_Start_Call[CHAIN_ID, RPC]) RunAndReturn(run func(context.Context) error) *mockNode_Start_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// State provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) State() nodeState { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for State") - } - - var r0 nodeState - if rf, ok := ret.Get(0).(func() nodeState); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(nodeState) - } - - return r0 -} - -// mockNode_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' -type mockNode_State_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// State is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) State() *mockNode_State_Call[CHAIN_ID, RPC] { - return &mockNode_State_Call[CHAIN_ID, RPC]{Call: _e.mock.On("State")} -} - -func (_c *mockNode_State_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_State_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_State_Call[CHAIN_ID, RPC]) Return(_a0 nodeState) *mockNode_State_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_State_Call[CHAIN_ID, RPC]) RunAndReturn(run func() nodeState) *mockNode_State_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// StateAndLatest provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) StateAndLatest() (nodeState, ChainInfo) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for StateAndLatest") - } - - var r0 nodeState - var r1 ChainInfo - if rf, ok := ret.Get(0).(func() (nodeState, ChainInfo)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() nodeState); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(nodeState) - } - - if rf, ok := ret.Get(1).(func() ChainInfo); ok { - r1 = rf() - } else { - r1 = ret.Get(1).(ChainInfo) - } - - return r0, r1 -} - -// mockNode_StateAndLatest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateAndLatest' -type mockNode_StateAndLatest_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// StateAndLatest is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) StateAndLatest() *mockNode_StateAndLatest_Call[CHAIN_ID, RPC] { - return &mockNode_StateAndLatest_Call[CHAIN_ID, RPC]{Call: _e.mock.On("StateAndLatest")} -} - -func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_StateAndLatest_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, RPC]) Return(_a0 nodeState, _a1 ChainInfo) *mockNode_StateAndLatest_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, RPC]) RunAndReturn(run func() (nodeState, ChainInfo)) *mockNode_StateAndLatest_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// mockNode_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type mockNode_String_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) String() *mockNode_String_Call[CHAIN_ID, RPC] { - return &mockNode_String_Call[CHAIN_ID, RPC]{Call: _e.mock.On("String")} -} - -func (_c *mockNode_String_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_String_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_String_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockNode_String_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockNode_String_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockNode_String_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// UnsubscribeAllExceptAliveLoop provides a mock function with no fields -func (_m *mockNode[CHAIN_ID, RPC]) UnsubscribeAllExceptAliveLoop() { - _m.Called() -} - -// mockNode_UnsubscribeAllExceptAliveLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExceptAliveLoop' -type mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// UnsubscribeAllExceptAliveLoop is a helper method to define mock.On call -func (_e *mockNode_Expecter[CHAIN_ID, RPC]) UnsubscribeAllExceptAliveLoop() *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC] { - return &mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC]{Call: _e.mock.On("UnsubscribeAllExceptAliveLoop")} -} - -func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC]) Run(run func()) *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC]) Return() *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC] { - _c.Call.Return() - return _c -} - -func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC]) RunAndReturn(run func()) *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, RPC] { - _c.Run(run) - return _c -} - -// newMockNode creates a new instance of mockNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockNode[CHAIN_ID types.ID, RPC interface{}](t interface { - mock.TestingT - Cleanup(func()) -}) *mockNode[CHAIN_ID, RPC] { - mock := &mockNode[CHAIN_ID, RPC]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mock_pool_chain_info_provider_test.go b/common/client/mock_pool_chain_info_provider_test.go deleted file mode 100644 index 7523a060329..00000000000 --- a/common/client/mock_pool_chain_info_provider_test.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import mock "github.com/stretchr/testify/mock" - -// mockPoolChainInfoProvider is an autogenerated mock type for the PoolChainInfoProvider type -type mockPoolChainInfoProvider struct { - mock.Mock -} - -type mockPoolChainInfoProvider_Expecter struct { - mock *mock.Mock -} - -func (_m *mockPoolChainInfoProvider) EXPECT() *mockPoolChainInfoProvider_Expecter { - return &mockPoolChainInfoProvider_Expecter{mock: &_m.Mock} -} - -// HighestUserObservations provides a mock function with no fields -func (_m *mockPoolChainInfoProvider) HighestUserObservations() ChainInfo { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HighestUserObservations") - } - - var r0 ChainInfo - if rf, ok := ret.Get(0).(func() ChainInfo); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ChainInfo) - } - - return r0 -} - -// mockPoolChainInfoProvider_HighestUserObservations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HighestUserObservations' -type mockPoolChainInfoProvider_HighestUserObservations_Call struct { - *mock.Call -} - -// HighestUserObservations is a helper method to define mock.On call -func (_e *mockPoolChainInfoProvider_Expecter) HighestUserObservations() *mockPoolChainInfoProvider_HighestUserObservations_Call { - return &mockPoolChainInfoProvider_HighestUserObservations_Call{Call: _e.mock.On("HighestUserObservations")} -} - -func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) Run(run func()) *mockPoolChainInfoProvider_HighestUserObservations_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) Return(_a0 ChainInfo) *mockPoolChainInfoProvider_HighestUserObservations_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) RunAndReturn(run func() ChainInfo) *mockPoolChainInfoProvider_HighestUserObservations_Call { - _c.Call.Return(run) - return _c -} - -// LatestChainInfo provides a mock function with no fields -func (_m *mockPoolChainInfoProvider) LatestChainInfo() (int, ChainInfo) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for LatestChainInfo") - } - - var r0 int - var r1 ChainInfo - if rf, ok := ret.Get(0).(func() (int, ChainInfo)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() int); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int) - } - - if rf, ok := ret.Get(1).(func() ChainInfo); ok { - r1 = rf() - } else { - r1 = ret.Get(1).(ChainInfo) - } - - return r0, r1 -} - -// mockPoolChainInfoProvider_LatestChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestChainInfo' -type mockPoolChainInfoProvider_LatestChainInfo_Call struct { - *mock.Call -} - -// LatestChainInfo is a helper method to define mock.On call -func (_e *mockPoolChainInfoProvider_Expecter) LatestChainInfo() *mockPoolChainInfoProvider_LatestChainInfo_Call { - return &mockPoolChainInfoProvider_LatestChainInfo_Call{Call: _e.mock.On("LatestChainInfo")} -} - -func (_c *mockPoolChainInfoProvider_LatestChainInfo_Call) Run(run func()) *mockPoolChainInfoProvider_LatestChainInfo_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockPoolChainInfoProvider_LatestChainInfo_Call) Return(_a0 int, _a1 ChainInfo) *mockPoolChainInfoProvider_LatestChainInfo_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *mockPoolChainInfoProvider_LatestChainInfo_Call) RunAndReturn(run func() (int, ChainInfo)) *mockPoolChainInfoProvider_LatestChainInfo_Call { - _c.Call.Return(run) - return _c -} - -// newMockPoolChainInfoProvider creates a new instance of mockPoolChainInfoProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockPoolChainInfoProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *mockPoolChainInfoProvider { - mock := &mockPoolChainInfoProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mock_rpc_client_test.go b/common/client/mock_rpc_client_test.go deleted file mode 100644 index 9ad71c646e4..00000000000 --- a/common/client/mock_rpc_client_test.go +++ /dev/null @@ -1,510 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import ( - context "context" - - types "github.com/smartcontractkit/chainlink/v2/common/types" - mock "github.com/stretchr/testify/mock" -) - -// mockRPCClient is an autogenerated mock type for the RPCClient type -type mockRPCClient[CHAIN_ID types.ID, HEAD Head] struct { - mock.Mock -} - -type mockRPCClient_Expecter[CHAIN_ID types.ID, HEAD Head] struct { - mock *mock.Mock -} - -func (_m *mockRPCClient[CHAIN_ID, HEAD]) EXPECT() *mockRPCClient_Expecter[CHAIN_ID, HEAD] { - return &mockRPCClient_Expecter[CHAIN_ID, HEAD]{mock: &_m.Mock} -} - -// ChainID provides a mock function with given fields: ctx -func (_m *mockRPCClient[CHAIN_ID, HEAD]) ChainID(ctx context.Context) (CHAIN_ID, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ChainID") - } - - var r0 CHAIN_ID - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (CHAIN_ID, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) CHAIN_ID); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(CHAIN_ID) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// mockRPCClient_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' -type mockRPCClient_ChainID_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// ChainID is a helper method to define mock.On call -// - ctx context.Context -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) ChainID(ctx interface{}) *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_ChainID_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("ChainID", ctx)} -} - -func (_c *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD]) Return(_a0 CHAIN_ID, _a1 error) *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (CHAIN_ID, error)) *mockRPCClient_ChainID_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// Close provides a mock function with no fields -func (_m *mockRPCClient[CHAIN_ID, HEAD]) Close() { - _m.Called() -} - -// mockRPCClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type mockRPCClient_Close_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// Close is a helper method to define mock.On call -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) Close() *mockRPCClient_Close_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_Close_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("Close")} -} - -func (_c *mockRPCClient_Close_Call[CHAIN_ID, HEAD]) Run(run func()) *mockRPCClient_Close_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockRPCClient_Close_Call[CHAIN_ID, HEAD]) Return() *mockRPCClient_Close_Call[CHAIN_ID, HEAD] { - _c.Call.Return() - return _c -} - -func (_c *mockRPCClient_Close_Call[CHAIN_ID, HEAD]) RunAndReturn(run func()) *mockRPCClient_Close_Call[CHAIN_ID, HEAD] { - _c.Run(run) - return _c -} - -// Dial provides a mock function with given fields: ctx -func (_m *mockRPCClient[CHAIN_ID, HEAD]) Dial(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Dial") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockRPCClient_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' -type mockRPCClient_Dial_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// Dial is a helper method to define mock.On call -// - ctx context.Context -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) Dial(ctx interface{}) *mockRPCClient_Dial_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_Dial_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("Dial", ctx)} -} - -func (_c *mockRPCClient_Dial_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockRPCClient_Dial_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockRPCClient_Dial_Call[CHAIN_ID, HEAD]) Return(_a0 error) *mockRPCClient_Dial_Call[CHAIN_ID, HEAD] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockRPCClient_Dial_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) error) *mockRPCClient_Dial_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// GetInterceptedChainInfo provides a mock function with no fields -func (_m *mockRPCClient[CHAIN_ID, HEAD]) GetInterceptedChainInfo() (ChainInfo, ChainInfo) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetInterceptedChainInfo") - } - - var r0 ChainInfo - var r1 ChainInfo - if rf, ok := ret.Get(0).(func() (ChainInfo, ChainInfo)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ChainInfo); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ChainInfo) - } - - if rf, ok := ret.Get(1).(func() ChainInfo); ok { - r1 = rf() - } else { - r1 = ret.Get(1).(ChainInfo) - } - - return r0, r1 -} - -// mockRPCClient_GetInterceptedChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInterceptedChainInfo' -type mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// GetInterceptedChainInfo is a helper method to define mock.On call -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) GetInterceptedChainInfo() *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("GetInterceptedChainInfo")} -} - -func (_c *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]) Run(run func()) *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]) Return(latest ChainInfo, highestUserObservations ChainInfo) *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { - _c.Call.Return(latest, highestUserObservations) - return _c -} - -func (_c *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]) RunAndReturn(run func() (ChainInfo, ChainInfo)) *mockRPCClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// IsSyncing provides a mock function with given fields: ctx -func (_m *mockRPCClient[CHAIN_ID, HEAD]) IsSyncing(ctx context.Context) (bool, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for IsSyncing") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) bool); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// mockRPCClient_IsSyncing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSyncing' -type mockRPCClient_IsSyncing_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// IsSyncing is a helper method to define mock.On call -// - ctx context.Context -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) IsSyncing(ctx interface{}) *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("IsSyncing", ctx)} -} - -func (_c *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD]) Return(_a0 bool, _a1 error) *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (bool, error)) *mockRPCClient_IsSyncing_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// Ping provides a mock function with given fields: _a0 -func (_m *mockRPCClient[CHAIN_ID, HEAD]) Ping(_a0 context.Context) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Ping") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockRPCClient_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping' -type mockRPCClient_Ping_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// Ping is a helper method to define mock.On call -// - _a0 context.Context -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) Ping(_a0 interface{}) *mockRPCClient_Ping_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_Ping_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("Ping", _a0)} -} - -func (_c *mockRPCClient_Ping_Call[CHAIN_ID, HEAD]) Run(run func(_a0 context.Context)) *mockRPCClient_Ping_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockRPCClient_Ping_Call[CHAIN_ID, HEAD]) Return(_a0 error) *mockRPCClient_Ping_Call[CHAIN_ID, HEAD] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockRPCClient_Ping_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) error) *mockRPCClient_Ping_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// SubscribeToFinalizedHeads provides a mock function with given fields: ctx -func (_m *mockRPCClient[CHAIN_ID, HEAD]) SubscribeToFinalizedHeads(ctx context.Context) (<-chan HEAD, types.Subscription, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SubscribeToFinalizedHeads") - } - - var r0 <-chan HEAD - var r1 types.Subscription - var r2 error - if rf, ok := ret.Get(0).(func(context.Context) (<-chan HEAD, types.Subscription, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) <-chan HEAD); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan HEAD) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) types.Subscription); ok { - r1 = rf(ctx) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(types.Subscription) - } - } - - if rf, ok := ret.Get(2).(func(context.Context) error); ok { - r2 = rf(ctx) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// mockRPCClient_SubscribeToFinalizedHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToFinalizedHeads' -type mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// SubscribeToFinalizedHeads is a helper method to define mock.On call -// - ctx context.Context -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) SubscribeToFinalizedHeads(ctx interface{}) *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SubscribeToFinalizedHeads", ctx)} -} - -func (_c *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]) Return(_a0 <-chan HEAD, _a1 types.Subscription, _a2 error) *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (<-chan HEAD, types.Subscription, error)) *mockRPCClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// SubscribeToHeads provides a mock function with given fields: ctx -func (_m *mockRPCClient[CHAIN_ID, HEAD]) SubscribeToHeads(ctx context.Context) (<-chan HEAD, types.Subscription, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for SubscribeToHeads") - } - - var r0 <-chan HEAD - var r1 types.Subscription - var r2 error - if rf, ok := ret.Get(0).(func(context.Context) (<-chan HEAD, types.Subscription, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) <-chan HEAD); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan HEAD) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) types.Subscription); ok { - r1 = rf(ctx) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(types.Subscription) - } - } - - if rf, ok := ret.Get(2).(func(context.Context) error); ok { - r2 = rf(ctx) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// mockRPCClient_SubscribeToHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToHeads' -type mockRPCClient_SubscribeToHeads_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// SubscribeToHeads is a helper method to define mock.On call -// - ctx context.Context -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) SubscribeToHeads(ctx interface{}) *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SubscribeToHeads", ctx)} -} - -func (_c *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]) Return(_a0 <-chan HEAD, _a1 types.Subscription, _a2 error) *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (<-chan HEAD, types.Subscription, error)) *mockRPCClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { - _c.Call.Return(run) - return _c -} - -// UnsubscribeAllExcept provides a mock function with given fields: subs -func (_m *mockRPCClient[CHAIN_ID, HEAD]) UnsubscribeAllExcept(subs ...types.Subscription) { - _va := make([]interface{}, len(subs)) - for _i := range subs { - _va[_i] = subs[_i] - } - var _ca []interface{} - _ca = append(_ca, _va...) - _m.Called(_ca...) -} - -// mockRPCClient_UnsubscribeAllExcept_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExcept' -type mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID types.ID, HEAD Head] struct { - *mock.Call -} - -// UnsubscribeAllExcept is a helper method to define mock.On call -// - subs ...types.Subscription -func (_e *mockRPCClient_Expecter[CHAIN_ID, HEAD]) UnsubscribeAllExcept(subs ...interface{}) *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD] { - return &mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("UnsubscribeAllExcept", - append([]interface{}{}, subs...)...)} -} - -func (_c *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD]) Run(run func(subs ...types.Subscription)) *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD] { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]types.Subscription, len(args)-0) - for i, a := range args[0:] { - if a != nil { - variadicArgs[i] = a.(types.Subscription) - } - } - run(variadicArgs...) - }) - return _c -} - -func (_c *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD]) Return() *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD] { - _c.Call.Return() - return _c -} - -func (_c *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(...types.Subscription)) *mockRPCClient_UnsubscribeAllExcept_Call[CHAIN_ID, HEAD] { - _c.Run(run) - return _c -} - -// newMockRPCClient creates a new instance of mockRPCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockRPCClient[CHAIN_ID types.ID, HEAD Head](t interface { - mock.TestingT - Cleanup(func()) -}) *mockRPCClient[CHAIN_ID, HEAD] { - mock := &mockRPCClient[CHAIN_ID, HEAD]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mock_send_only_client_test.go b/common/client/mock_send_only_client_test.go deleted file mode 100644 index 0def3c58a2e..00000000000 --- a/common/client/mock_send_only_client_test.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import ( - context "context" - - types "github.com/smartcontractkit/chainlink/v2/common/types" - mock "github.com/stretchr/testify/mock" -) - -// mockSendOnlyClient is an autogenerated mock type for the sendOnlyClient type -type mockSendOnlyClient[CHAIN_ID types.ID] struct { - mock.Mock -} - -type mockSendOnlyClient_Expecter[CHAIN_ID types.ID] struct { - mock *mock.Mock -} - -func (_m *mockSendOnlyClient[CHAIN_ID]) EXPECT() *mockSendOnlyClient_Expecter[CHAIN_ID] { - return &mockSendOnlyClient_Expecter[CHAIN_ID]{mock: &_m.Mock} -} - -// ChainID provides a mock function with given fields: _a0 -func (_m *mockSendOnlyClient[CHAIN_ID]) ChainID(_a0 context.Context) (CHAIN_ID, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ChainID") - } - - var r0 CHAIN_ID - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (CHAIN_ID, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) CHAIN_ID); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(CHAIN_ID) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// mockSendOnlyClient_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' -type mockSendOnlyClient_ChainID_Call[CHAIN_ID types.ID] struct { - *mock.Call -} - -// ChainID is a helper method to define mock.On call -// - _a0 context.Context -func (_e *mockSendOnlyClient_Expecter[CHAIN_ID]) ChainID(_a0 interface{}) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { - return &mockSendOnlyClient_ChainID_Call[CHAIN_ID]{Call: _e.mock.On("ChainID", _a0)} -} - -func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) Run(run func(_a0 context.Context)) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) Return(_a0 CHAIN_ID, _a1 error) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) RunAndReturn(run func(context.Context) (CHAIN_ID, error)) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { - _c.Call.Return(run) - return _c -} - -// Close provides a mock function with no fields -func (_m *mockSendOnlyClient[CHAIN_ID]) Close() { - _m.Called() -} - -// mockSendOnlyClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type mockSendOnlyClient_Close_Call[CHAIN_ID types.ID] struct { - *mock.Call -} - -// Close is a helper method to define mock.On call -func (_e *mockSendOnlyClient_Expecter[CHAIN_ID]) Close() *mockSendOnlyClient_Close_Call[CHAIN_ID] { - return &mockSendOnlyClient_Close_Call[CHAIN_ID]{Call: _e.mock.On("Close")} -} - -func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) Run(run func()) *mockSendOnlyClient_Close_Call[CHAIN_ID] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) Return() *mockSendOnlyClient_Close_Call[CHAIN_ID] { - _c.Call.Return() - return _c -} - -func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) RunAndReturn(run func()) *mockSendOnlyClient_Close_Call[CHAIN_ID] { - _c.Run(run) - return _c -} - -// Dial provides a mock function with given fields: ctx -func (_m *mockSendOnlyClient[CHAIN_ID]) Dial(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Dial") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockSendOnlyClient_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' -type mockSendOnlyClient_Dial_Call[CHAIN_ID types.ID] struct { - *mock.Call -} - -// Dial is a helper method to define mock.On call -// - ctx context.Context -func (_e *mockSendOnlyClient_Expecter[CHAIN_ID]) Dial(ctx interface{}) *mockSendOnlyClient_Dial_Call[CHAIN_ID] { - return &mockSendOnlyClient_Dial_Call[CHAIN_ID]{Call: _e.mock.On("Dial", ctx)} -} - -func (_c *mockSendOnlyClient_Dial_Call[CHAIN_ID]) Run(run func(ctx context.Context)) *mockSendOnlyClient_Dial_Call[CHAIN_ID] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockSendOnlyClient_Dial_Call[CHAIN_ID]) Return(_a0 error) *mockSendOnlyClient_Dial_Call[CHAIN_ID] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyClient_Dial_Call[CHAIN_ID]) RunAndReturn(run func(context.Context) error) *mockSendOnlyClient_Dial_Call[CHAIN_ID] { - _c.Call.Return(run) - return _c -} - -// newMockSendOnlyClient creates a new instance of mockSendOnlyClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockSendOnlyClient[CHAIN_ID types.ID](t interface { - mock.TestingT - Cleanup(func()) -}) *mockSendOnlyClient[CHAIN_ID] { - mock := &mockSendOnlyClient[CHAIN_ID]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mock_send_only_node_test.go b/common/client/mock_send_only_node_test.go deleted file mode 100644 index 16d463df3de..00000000000 --- a/common/client/mock_send_only_node_test.go +++ /dev/null @@ -1,357 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package client - -import ( - context "context" - - types "github.com/smartcontractkit/chainlink/v2/common/types" - mock "github.com/stretchr/testify/mock" -) - -// mockSendOnlyNode is an autogenerated mock type for the SendOnlyNode type -type mockSendOnlyNode[CHAIN_ID types.ID, RPC interface{}] struct { - mock.Mock -} - -type mockSendOnlyNode_Expecter[CHAIN_ID types.ID, RPC interface{}] struct { - mock *mock.Mock -} - -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) EXPECT() *mockSendOnlyNode_Expecter[CHAIN_ID, RPC] { - return &mockSendOnlyNode_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} -} - -// Close provides a mock function with no fields -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Close() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Close") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockSendOnlyNode_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type mockSendOnlyNode_Close_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Close is a helper method to define mock.On call -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) Close() *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Close")} -} - -func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) Return(_a0 error) *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) RunAndReturn(run func() error) *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// ConfiguredChainID provides a mock function with no fields -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ConfiguredChainID") - } - - var r0 CHAIN_ID - if rf, ok := ret.Get(0).(func() CHAIN_ID); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(CHAIN_ID) - } - } - - return r0 -} - -// mockSendOnlyNode_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' -type mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// ConfiguredChainID is a helper method to define mock.On call -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) ConfiguredChainID() *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]{Call: _e.mock.On("ConfiguredChainID")} -} - -func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) Return(_a0 CHAIN_ID) *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) RunAndReturn(run func() CHAIN_ID) *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// Name provides a mock function with no fields -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// mockSendOnlyNode_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type mockSendOnlyNode_Name_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Name is a helper method to define mock.On call -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) Name() *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Name")} -} - -func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// RPC provides a mock function with no fields -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) RPC() RPC { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for RPC") - } - - var r0 RPC - if rf, ok := ret.Get(0).(func() RPC); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(RPC) - } - } - - return r0 -} - -// mockSendOnlyNode_RPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPC' -type mockSendOnlyNode_RPC_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// RPC is a helper method to define mock.On call -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) RPC() *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]{Call: _e.mock.On("RPC")} -} - -func (_c *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]) Return(_a0 RPC) *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]) RunAndReturn(run func() RPC) *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// Start provides a mock function with given fields: _a0 -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Start(_a0 context.Context) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// mockSendOnlyNode_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type mockSendOnlyNode_Start_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - _a0 context.Context -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) Start(_a0 interface{}) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Start", _a0)} -} - -func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) Run(run func(_a0 context.Context)) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) Return(_a0 error) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) RunAndReturn(run func(context.Context) error) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// State provides a mock function with no fields -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) State() nodeState { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for State") - } - - var r0 nodeState - if rf, ok := ret.Get(0).(func() nodeState); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(nodeState) - } - - return r0 -} - -// mockSendOnlyNode_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' -type mockSendOnlyNode_State_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// State is a helper method to define mock.On call -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) State() *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_State_Call[CHAIN_ID, RPC]{Call: _e.mock.On("State")} -} - -func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) Return(_a0 nodeState) *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) RunAndReturn(run func() nodeState) *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with no fields -func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// mockSendOnlyNode_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type mockSendOnlyNode_String_Call[CHAIN_ID types.ID, RPC interface{}] struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) String() *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { - return &mockSendOnlyNode_String_Call[CHAIN_ID, RPC]{Call: _e.mock.On("String")} -} - -func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { - _c.Call.Return(_a0) - return _c -} - -func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { - _c.Call.Return(run) - return _c -} - -// newMockSendOnlyNode creates a new instance of mockSendOnlyNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockSendOnlyNode[CHAIN_ID types.ID, RPC interface{}](t interface { - mock.TestingT - Cleanup(func()) -}) *mockSendOnlyNode[CHAIN_ID, RPC] { - mock := &mockSendOnlyNode[CHAIN_ID, RPC]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/client/mocks/config.go b/common/client/mocks/config.go deleted file mode 100644 index 95b57cce0c3..00000000000 --- a/common/client/mocks/config.go +++ /dev/null @@ -1,31 +0,0 @@ -package mocks - -import "time" - -type ChainConfig struct { - IsFinalityTagEnabled bool - FinalityDepthVal uint32 - NoNewHeadsThresholdVal time.Duration - FinalizedBlockOffsetVal uint32 - NoNewFinalizedHeadsThresholdVal time.Duration -} - -func (t ChainConfig) NodeNoNewHeadsThreshold() time.Duration { - return t.NoNewHeadsThresholdVal -} - -func (t ChainConfig) FinalityDepth() uint32 { - return t.FinalityDepthVal -} - -func (t ChainConfig) FinalityTagEnabled() bool { - return t.IsFinalityTagEnabled -} - -func (t ChainConfig) FinalizedBlockOffset() uint32 { - return t.FinalizedBlockOffsetVal -} - -func (t ChainConfig) NoNewFinalizedHeadsThreshold() time.Duration { - return t.NoNewFinalizedHeadsThresholdVal -} diff --git a/common/client/models.go b/common/client/models.go deleted file mode 100644 index 526bb25c887..00000000000 --- a/common/client/models.go +++ /dev/null @@ -1,121 +0,0 @@ -package client - -import ( - "bytes" - "fmt" -) - -type SendTxReturnCode int - -// SendTxReturnCode is a generalized client error that dictates what should be the next action, depending on the RPC error response. -const ( - Successful SendTxReturnCode = iota + 1 - Fatal // Unrecoverable error. Most likely the attempt should be thrown away. - Retryable // The error returned by the RPC indicates that if we retry with the same attempt, the tx will eventually go through. - Underpriced // Attempt was underpriced. New estimation is needed with bumped gas price. - Unknown // Tx failed with an error response that is not recognized by the client. - Unsupported // Attempt failed with an error response that is not supported by the client for the given chain. - TransactionAlreadyKnown // The transaction that was sent has already been received by the RPC. - InsufficientFunds // Tx was rejected due to insufficient funds. - ExceedsMaxFee // Attempt's fee was higher than the node's limit and got rejected. - FeeOutOfValidRange // This error is returned when we use a fee price suggested from an RPC, but the network rejects the attempt due to an invalid range(mostly used by L2 chains). Retry by requesting a new suggested fee price. - TerminallyStuck // The error returned when a transaction is or could get terminally stuck in the mempool without any chance of inclusion. - sendTxReturnCodeLen // tracks the number of errors. Must always be last -) - -// sendTxSevereErrors - error codes which signal that transaction would never be accepted in its current form by the node -var sendTxSevereErrors = []SendTxReturnCode{Fatal, Underpriced, Unsupported, ExceedsMaxFee, FeeOutOfValidRange, Unknown} - -// sendTxSuccessfulCodes - error codes which signal that transaction was accepted by the node -var sendTxSuccessfulCodes = []SendTxReturnCode{Successful, TransactionAlreadyKnown} - -func (c SendTxReturnCode) String() string { - switch c { - case Successful: - return "Successful" - case Fatal: - return "Fatal" - case Retryable: - return "Retryable" - case Underpriced: - return "Underpriced" - case Unknown: - return "Unknown" - case Unsupported: - return "Unsupported" - case TransactionAlreadyKnown: - return "TransactionAlreadyKnown" - case InsufficientFunds: - return "InsufficientFunds" - case ExceedsMaxFee: - return "ExceedsMaxFee" - case FeeOutOfValidRange: - return "FeeOutOfValidRange" - case TerminallyStuck: - return "TerminallyStuck" - default: - return fmt.Sprintf("SendTxReturnCode(%d)", c) - } -} - -type NodeTier int - -const ( - Primary = NodeTier(iota) - Secondary -) - -func (n NodeTier) String() string { - switch n { - case Primary: - return "primary" - case Secondary: - return "secondary" - default: - return fmt.Sprintf("NodeTier(%d)", n) - } -} - -// syncStatus - defines problems related to RPC's state synchronization. Can be used as a bitmask to define multiple issues -type syncStatus int - -const ( - // syncStatusSynced - RPC is fully synced - syncStatusSynced = 0 - // syncStatusNotInSyncWithPool - RPC is lagging behind the highest block observed within the pool of RPCs - syncStatusNotInSyncWithPool syncStatus = 1 << iota - // syncStatusNoNewHead - RPC failed to produce a new head for too long - syncStatusNoNewHead - // syncStatusNoNewFinalizedHead - RPC failed to produce a new finalized head for too long - syncStatusNoNewFinalizedHead - syncStatusLen -) - -func (s syncStatus) String() string { - if s == syncStatusSynced { - return "Synced" - } - var result bytes.Buffer - for i := syncStatusNotInSyncWithPool; i < syncStatusLen; i = i << 1 { - if i&s == 0 { - continue - } - result.WriteString(i.string()) - result.WriteString(",") - } - result.Truncate(result.Len() - 1) - return result.String() -} - -func (s syncStatus) string() string { - switch s { - case syncStatusNotInSyncWithPool: - return "NotInSyncWithRPCPool" - case syncStatusNoNewHead: - return "NoNewHead" - case syncStatusNoNewFinalizedHead: - return "NoNewFinalizedHead" - default: - return fmt.Sprintf("syncStatus(%d)", s) - } -} diff --git a/common/client/models_test.go b/common/client/models_test.go deleted file mode 100644 index a10592c3b68..00000000000 --- a/common/client/models_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package client - -import ( - "strings" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestSendTxReturnCode_String(t *testing.T) { - // ensure all the SendTxReturnCodes have proper name - for c := 1; c < int(sendTxReturnCodeLen); c++ { - strC := SendTxReturnCode(c).String() - if strings.Contains(strC, "SendTxReturnCode(") { - t.Errorf("Expected %s to have a proper string representation", strC) - } - } -} - -func TestSyncStatus_String(t *testing.T) { - t.Run("All of the statuses have proper string representation", func(t *testing.T) { - for i := syncStatusNotInSyncWithPool; i < syncStatusLen; i <<= 1 { - // ensure that i's string representation is not equal to `syncStatus(%d)` - assert.NotContains(t, i.String(), "syncStatus(") - } - }) - t.Run("Unwraps mask", func(t *testing.T) { - testCases := []struct { - Mask syncStatus - ExpectedStr string - }{ - { - ExpectedStr: "Synced", - }, - { - Mask: syncStatusNotInSyncWithPool | syncStatusNoNewHead, - ExpectedStr: "NotInSyncWithRPCPool,NoNewHead", - }, - { - Mask: syncStatusNotInSyncWithPool | syncStatusNoNewHead | syncStatusNoNewFinalizedHead, - ExpectedStr: "NotInSyncWithRPCPool,NoNewHead,NoNewFinalizedHead", - }, - } - for _, testCase := range testCases { - t.Run(testCase.ExpectedStr, func(t *testing.T) { - assert.Equal(t, testCase.ExpectedStr, testCase.Mask.String()) - }) - } - }) -} diff --git a/common/client/multi_node.go b/common/client/multi_node.go deleted file mode 100644 index b946fb8fc2a..00000000000 --- a/common/client/multi_node.go +++ /dev/null @@ -1,364 +0,0 @@ -package client - -import ( - "context" - "fmt" - "math/big" - "sync" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -var ( - // PromMultiNodeRPCNodeStates reports current RPC node state - PromMultiNodeRPCNodeStates = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "multi_node_states", - Help: "The number of RPC nodes currently in the given state for the given chain", - }, []string{"network", "chainId", "state"}) - ErroringNodeError = fmt.Errorf("no live nodes available") -) - -// MultiNode is a generalized multi node client interface that includes methods to interact with different chains. -// It also handles multiple node RPC connections simultaneously. -type MultiNode[ - CHAIN_ID types.ID, - RPC any, -] struct { - services.Service - eng *services.Engine - - primaryNodes []Node[CHAIN_ID, RPC] - sendOnlyNodes []SendOnlyNode[CHAIN_ID, RPC] - chainID CHAIN_ID - lggr logger.SugaredLogger - selectionMode string - nodeSelector NodeSelector[CHAIN_ID, RPC] - leaseDuration time.Duration - leaseTicker *time.Ticker - chainFamily string - reportInterval time.Duration - deathDeclarationDelay time.Duration - - activeMu sync.RWMutex - activeNode Node[CHAIN_ID, RPC] -} - -func NewMultiNode[ - CHAIN_ID types.ID, - RPC any, -]( - lggr logger.Logger, - selectionMode string, // type of the "best" RPC selector (e.g HighestHead, RoundRobin, etc.) - leaseDuration time.Duration, // defines interval on which new "best" RPC should be selected - primaryNodes []Node[CHAIN_ID, RPC], - sendOnlyNodes []SendOnlyNode[CHAIN_ID, RPC], - chainID CHAIN_ID, // configured chain ID (used to verify that passed primaryNodes belong to the same chain) - chainFamily string, // name of the chain family - used in the metrics - deathDeclarationDelay time.Duration, -) *MultiNode[CHAIN_ID, RPC] { - nodeSelector := newNodeSelector(selectionMode, primaryNodes) - // Prometheus' default interval is 15s, set this to under 7.5s to avoid - // aliasing (see: https://en.wikipedia.org/wiki/Nyquist_frequency) - const reportInterval = 6500 * time.Millisecond - c := &MultiNode[CHAIN_ID, RPC]{ - primaryNodes: primaryNodes, - sendOnlyNodes: sendOnlyNodes, - chainID: chainID, - selectionMode: selectionMode, - nodeSelector: nodeSelector, - leaseDuration: leaseDuration, - chainFamily: chainFamily, - reportInterval: reportInterval, - deathDeclarationDelay: deathDeclarationDelay, - } - c.Service, c.eng = services.Config{ - Name: "MultiNode", - Start: c.start, - Close: c.close, - }.NewServiceEngine(logger.With(lggr, "chainID", chainID.String())) - c.lggr = c.eng.SugaredLogger - - c.lggr.Debugf("The MultiNode is configured to use NodeSelectionMode: %s", selectionMode) - - return c -} - -func (c *MultiNode[CHAIN_ID, RPC]) ChainID() CHAIN_ID { - return c.chainID -} - -func (c *MultiNode[CHAIN_ID, RPC]) DoAll(ctx context.Context, do func(ctx context.Context, rpc RPC, isSendOnly bool)) error { - return c.eng.IfNotStopped(func() error { - callsCompleted := 0 - for _, n := range c.primaryNodes { - select { - case <-ctx.Done(): - return ctx.Err() - default: - if n.State() != nodeStateAlive { - continue - } - do(ctx, n.RPC(), false) - callsCompleted++ - } - } - - for _, n := range c.sendOnlyNodes { - select { - case <-ctx.Done(): - return ctx.Err() - default: - if n.State() != nodeStateAlive { - continue - } - do(ctx, n.RPC(), true) - } - } - if callsCompleted == 0 { - return ErroringNodeError - } - return nil - }) -} - -func (c *MultiNode[CHAIN_ID, RPC]) NodeStates() map[string]string { - states := map[string]string{} - for _, n := range c.primaryNodes { - states[n.Name()] = n.State().String() - } - for _, n := range c.sendOnlyNodes { - states[n.Name()] = n.State().String() - } - return states -} - -// Start starts every node in the pool -// -// Nodes handle their own redialing and runloops, so this function does not -// return any error if the nodes aren't available -func (c *MultiNode[CHAIN_ID, RPC]) start(ctx context.Context) error { - if len(c.primaryNodes) == 0 { - return fmt.Errorf("no available nodes for chain %s", c.chainID.String()) - } - var ms services.MultiStart - for _, n := range c.primaryNodes { - if n.ConfiguredChainID().String() != c.chainID.String() { - return ms.CloseBecause(fmt.Errorf("node %s has configured chain ID %s which does not match multinode configured chain ID of %s", n.String(), n.ConfiguredChainID().String(), c.chainID.String())) - } - n.SetPoolChainInfoProvider(c) - // node will handle its own redialing and automatic recovery - if err := ms.Start(ctx, n); err != nil { - return err - } - } - for _, s := range c.sendOnlyNodes { - if s.ConfiguredChainID().String() != c.chainID.String() { - return ms.CloseBecause(fmt.Errorf("sendonly node %s has configured chain ID %s which does not match multinode configured chain ID of %s", s.String(), s.ConfiguredChainID().String(), c.chainID.String())) - } - if err := ms.Start(ctx, s); err != nil { - return err - } - } - c.eng.Go(c.runLoop) - - if c.leaseDuration.Seconds() > 0 && c.selectionMode != NodeSelectionModeRoundRobin { - c.lggr.Infof("The MultiNode will switch to best node every %s", c.leaseDuration.String()) - c.eng.Go(c.checkLeaseLoop) - } else { - c.lggr.Info("Best node switching is disabled") - } - - return nil -} - -// Close tears down the MultiNode and closes all nodes -func (c *MultiNode[CHAIN_ID, RPC]) close() error { - return services.CloseAll(services.MultiCloser(c.primaryNodes), services.MultiCloser(c.sendOnlyNodes)) -} - -// SelectRPC returns an RPC of an active node. If there are no active nodes it returns an error. -// Call this method from your chain-specific client implementation to access any chain-specific rpc calls. -func (c *MultiNode[CHAIN_ID, RPC]) SelectRPC() (rpc RPC, err error) { - n, err := c.selectNode() - if err != nil { - return rpc, err - } - return n.RPC(), nil -} - -// selectNode returns the active Node, if it is still nodeStateAlive, otherwise it selects a new one from the NodeSelector. -func (c *MultiNode[CHAIN_ID, RPC]) selectNode() (node Node[CHAIN_ID, RPC], err error) { - c.activeMu.RLock() - node = c.activeNode - c.activeMu.RUnlock() - if node != nil && node.State() == nodeStateAlive { - return // still alive - } - - // select a new one - c.activeMu.Lock() - defer c.activeMu.Unlock() - node = c.activeNode - if node != nil && node.State() == nodeStateAlive { - return // another goroutine beat us here - } - - var prevNodeName string - if c.activeNode != nil { - prevNodeName = c.activeNode.String() - c.activeNode.UnsubscribeAllExceptAliveLoop() - } - c.activeNode = c.nodeSelector.Select() - if c.activeNode == nil { - c.lggr.Criticalw("No live RPC nodes available", "NodeSelectionMode", c.nodeSelector.Name()) - c.eng.EmitHealthErr(fmt.Errorf("no live nodes available for chain %s", c.chainID.String())) - return nil, ErroringNodeError - } - - c.lggr.Debugw("Switched to a new active node due to prev node heath issues", "prevNode", prevNodeName, "newNode", c.activeNode.String()) - return c.activeNode, err -} - -// LatestChainInfo - returns number of live nodes available in the pool, so we can prevent the last alive node in a pool from being marked as out-of-sync. -// Return highest ChainInfo most recently received by the alive nodes. -// E.g. If Node A's the most recent block is 10 and highest 15 and for Node B it's - 12 and 14. This method will return 12. -func (c *MultiNode[CHAIN_ID, RPC]) LatestChainInfo() (int, ChainInfo) { - var nLiveNodes int - ch := ChainInfo{ - TotalDifficulty: big.NewInt(0), - } - for _, n := range c.primaryNodes { - if s, nodeChainInfo := n.StateAndLatest(); s == nodeStateAlive { - nLiveNodes++ - ch.BlockNumber = max(ch.BlockNumber, nodeChainInfo.BlockNumber) - ch.FinalizedBlockNumber = max(ch.FinalizedBlockNumber, nodeChainInfo.FinalizedBlockNumber) - ch.TotalDifficulty = MaxTotalDifficulty(ch.TotalDifficulty, nodeChainInfo.TotalDifficulty) - } - } - return nLiveNodes, ch -} - -// HighestUserObservations - returns highest ChainInfo ever observed by any user of the MultiNode -func (c *MultiNode[CHAIN_ID, RPC]) HighestUserObservations() ChainInfo { - ch := ChainInfo{ - TotalDifficulty: big.NewInt(0), - } - for _, n := range c.primaryNodes { - nodeChainInfo := n.HighestUserObservations() - ch.BlockNumber = max(ch.BlockNumber, nodeChainInfo.BlockNumber) - ch.FinalizedBlockNumber = max(ch.FinalizedBlockNumber, nodeChainInfo.FinalizedBlockNumber) - ch.TotalDifficulty = MaxTotalDifficulty(ch.TotalDifficulty, nodeChainInfo.TotalDifficulty) - } - return ch -} - -func (c *MultiNode[CHAIN_ID, RPC]) checkLease() { - bestNode := c.nodeSelector.Select() - for _, n := range c.primaryNodes { - // Terminate client subscriptions. Services are responsible for reconnecting, which will be routed to the new - // best node. Only terminate connections with more than 1 subscription to account for the aliveLoop subscription - if n.State() == nodeStateAlive && n != bestNode { - c.lggr.Infof("Switching to best node from %q to %q", n.String(), bestNode.String()) - n.UnsubscribeAllExceptAliveLoop() - } - } - - c.activeMu.Lock() - defer c.activeMu.Unlock() - if bestNode != c.activeNode { - if c.activeNode != nil { - c.activeNode.UnsubscribeAllExceptAliveLoop() - } - c.activeNode = bestNode - } -} - -func (c *MultiNode[CHAIN_ID, RPC]) checkLeaseLoop(ctx context.Context) { - c.leaseTicker = time.NewTicker(c.leaseDuration) - defer c.leaseTicker.Stop() - - for { - select { - case <-c.leaseTicker.C: - c.checkLease() - case <-ctx.Done(): - return - } - } -} - -func (c *MultiNode[CHAIN_ID, RPC]) runLoop(ctx context.Context) { - nodeStates := make([]nodeWithState, len(c.primaryNodes)) - for i, n := range c.primaryNodes { - nodeStates[i] = nodeWithState{ - Node: n.String(), - State: n.State().String(), - DeadSince: nil, - } - } - - c.report(nodeStates) - - monitor := services.NewTicker(c.reportInterval) - defer monitor.Stop() - - for { - select { - case <-monitor.C: - c.report(nodeStates) - case <-ctx.Done(): - return - } - } -} - -type nodeWithState struct { - Node string - State string - DeadSince *time.Time -} - -func (c *MultiNode[CHAIN_ID, RPC]) report(nodesStateInfo []nodeWithState) { - start := time.Now() - var dead int - counts := make(map[nodeState]int) - for i, n := range c.primaryNodes { - state := n.State() - counts[state]++ - nodesStateInfo[i].State = state.String() - if state == nodeStateAlive { - nodesStateInfo[i].DeadSince = nil - continue - } - - if nodesStateInfo[i].DeadSince == nil { - nodesStateInfo[i].DeadSince = &start - } - - if start.Sub(*nodesStateInfo[i].DeadSince) >= c.deathDeclarationDelay { - dead++ - } - } - for _, state := range allNodeStates { - count := counts[state] - PromMultiNodeRPCNodeStates.WithLabelValues(c.chainFamily, c.chainID.String(), state.String()).Set(float64(count)) - } - - total := len(c.primaryNodes) - live := total - dead - c.lggr.Tracew(fmt.Sprintf("MultiNode state: %d/%d nodes are alive", live, total), "nodeStates", nodesStateInfo) - if total == dead { - rerr := fmt.Errorf("no primary nodes available: 0/%d nodes are alive", total) - c.lggr.Criticalw(rerr.Error(), "nodeStates", nodesStateInfo) - c.eng.EmitHealthErr(rerr) - } else if dead > 0 { - c.lggr.Errorw(fmt.Sprintf("At least one primary node is dead: %d/%d nodes are alive", live, total), "nodeStates", nodesStateInfo) - } -} diff --git a/common/client/multi_node_test.go b/common/client/multi_node_test.go deleted file mode 100644 index c1636881dd3..00000000000 --- a/common/client/multi_node_test.go +++ /dev/null @@ -1,517 +0,0 @@ -package client - -import ( - "fmt" - "math/big" - "math/rand" - "testing" - "time" - - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - - "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type multiNodeRPCClient RPCClient[types.ID, types.Head[Hashable]] - -type testMultiNode struct { - *MultiNode[types.ID, multiNodeRPCClient] -} - -type multiNodeOpts struct { - logger logger.Logger - selectionMode string - leaseDuration time.Duration - nodes []Node[types.ID, multiNodeRPCClient] - sendonlys []SendOnlyNode[types.ID, multiNodeRPCClient] - chainID types.ID - chainFamily string - deathDeclarationDelay time.Duration -} - -func newTestMultiNode(t *testing.T, opts multiNodeOpts) testMultiNode { - if opts.logger == nil { - opts.logger = logger.Test(t) - } - - result := NewMultiNode[types.ID, multiNodeRPCClient]( - opts.logger, opts.selectionMode, opts.leaseDuration, opts.nodes, opts.sendonlys, opts.chainID, opts.chainFamily, opts.deathDeclarationDelay) - return testMultiNode{ - result, - } -} - -func newHealthyNode(t *testing.T, chainID types.ID) *mockNode[types.ID, multiNodeRPCClient] { - return newNodeWithState(t, chainID, nodeStateAlive) -} - -func newNodeWithState(t *testing.T, chainID types.ID, state nodeState) *mockNode[types.ID, multiNodeRPCClient] { - node := newMockNode[types.ID, multiNodeRPCClient](t) - node.On("ConfiguredChainID").Return(chainID).Once() - node.On("Start", mock.Anything).Return(nil).Once() - node.On("Close").Return(nil).Once() - node.On("String").Return(fmt.Sprintf("healthy_node_%d", rand.Int())).Maybe() - node.On("SetPoolChainInfoProvider", mock.Anything).Once() - node.On("State").Return(state).Maybe() - return node -} - -func TestMultiNode_Dial(t *testing.T) { - t.Parallel() - - newMockNode := newMockNode[types.ID, multiNodeRPCClient] - newMockSendOnlyNode := newMockSendOnlyNode[types.ID, multiNodeRPCClient] - - t.Run("Fails without nodes", func(t *testing.T) { - t.Parallel() - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: types.RandomID(), - }) - err := mn.Start(tests.Context(t)) - assert.ErrorContains(t, err, fmt.Sprintf("no available nodes for chain %s", mn.chainID)) - }) - t.Run("Fails with wrong node's chainID", func(t *testing.T) { - t.Parallel() - node := newMockNode(t) - multiNodeChainID := types.NewIDFromInt(10) - nodeChainID := types.NewIDFromInt(11) - node.On("ConfiguredChainID").Return(nodeChainID).Twice() - const nodeName = "nodeName" - node.On("String").Return(nodeName).Once() - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: multiNodeChainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - }) - err := mn.Start(tests.Context(t)) - assert.ErrorContains(t, err, fmt.Sprintf("node %s has configured chain ID %s which does not match multinode configured chain ID of %s", nodeName, nodeChainID, mn.chainID)) - }) - t.Run("Fails if node fails", func(t *testing.T) { - t.Parallel() - node := newMockNode(t) - chainID := types.RandomID() - node.On("ConfiguredChainID").Return(chainID).Once() - expectedError := errors.New("failed to start node") - node.On("Start", mock.Anything).Return(expectedError).Once() - node.On("SetPoolChainInfoProvider", mock.Anything).Once() - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - }) - err := mn.Start(tests.Context(t)) - assert.ErrorIs(t, err, expectedError) - }) - - t.Run("Closes started nodes on failure", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node1 := newHealthyNode(t, chainID) - node2 := newMockNode(t) - node2.On("ConfiguredChainID").Return(chainID).Once() - expectedError := errors.New("failed to start node") - node2.On("Start", mock.Anything).Return(expectedError).Once() - node2.On("SetPoolChainInfoProvider", mock.Anything).Once() - - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node1, node2}, - }) - err := mn.Start(tests.Context(t)) - assert.ErrorIs(t, err, expectedError) - }) - t.Run("Fails with wrong send only node's chainID", func(t *testing.T) { - t.Parallel() - multiNodeChainID := types.NewIDFromInt(10) - node := newHealthyNode(t, multiNodeChainID) - sendOnly := newMockSendOnlyNode(t) - sendOnlyChainID := types.NewIDFromInt(11) - sendOnly.On("ConfiguredChainID").Return(sendOnlyChainID).Twice() - const sendOnlyName = "sendOnlyNodeName" - sendOnly.On("String").Return(sendOnlyName).Once() - - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: multiNodeChainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - sendonlys: []SendOnlyNode[types.ID, multiNodeRPCClient]{sendOnly}, - }) - err := mn.Start(tests.Context(t)) - assert.ErrorContains(t, err, fmt.Sprintf("sendonly node %s has configured chain ID %s which does not match multinode configured chain ID of %s", sendOnlyName, sendOnlyChainID, mn.chainID)) - }) - - newHealthySendOnly := func(t *testing.T, chainID types.ID) *mockSendOnlyNode[types.ID, multiNodeRPCClient] { - node := newMockSendOnlyNode(t) - node.On("ConfiguredChainID").Return(chainID).Once() - node.On("Start", mock.Anything).Return(nil).Once() - node.On("Close").Return(nil).Once() - return node - } - t.Run("Fails on send only node failure", func(t *testing.T) { - t.Parallel() - chainID := types.NewIDFromInt(10) - node := newHealthyNode(t, chainID) - sendOnly1 := newHealthySendOnly(t, chainID) - sendOnly2 := newMockSendOnlyNode(t) - sendOnly2.On("ConfiguredChainID").Return(chainID).Once() - expectedError := errors.New("failed to start send only node") - sendOnly2.On("Start", mock.Anything).Return(expectedError).Once() - - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - sendonlys: []SendOnlyNode[types.ID, multiNodeRPCClient]{sendOnly1, sendOnly2}, - }) - err := mn.Start(tests.Context(t)) - assert.ErrorIs(t, err, expectedError) - }) - t.Run("Starts successfully with healthy nodes", func(t *testing.T) { - t.Parallel() - chainID := types.NewIDFromInt(10) - node := newHealthyNode(t, chainID) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - sendonlys: []SendOnlyNode[types.ID, multiNodeRPCClient]{newHealthySendOnly(t, chainID)}, - }) - servicetest.Run(t, mn) - selectedNode, err := mn.selectNode() - require.NoError(t, err) - assert.Equal(t, node, selectedNode) - }) -} - -func TestMultiNode_Report(t *testing.T) { - t.Parallel() - t.Run("Dial starts periodical reporting", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node1 := newHealthyNode(t, chainID) - node2 := newNodeWithState(t, chainID, nodeStateOutOfSync) - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node1, node2}, - logger: lggr, - }) - mn.reportInterval = tests.TestInterval - mn.deathDeclarationDelay = tests.TestInterval - servicetest.Run(t, mn) - tests.AssertLogCountEventually(t, observedLogs, "At least one primary node is dead: 1/2 nodes are alive", 2) - }) - t.Run("Report critical error on all node failure", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node := newNodeWithState(t, chainID, nodeStateOutOfSync) - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - logger: lggr, - }) - mn.reportInterval = tests.TestInterval - mn.deathDeclarationDelay = tests.TestInterval - servicetest.Run(t, mn) - tests.AssertLogCountEventually(t, observedLogs, "no primary nodes available: 0/1 nodes are alive", 2) - err := mn.HealthReport()["MultiNode"] - require.Error(t, err) - assert.Contains(t, err.Error(), "no primary nodes available: 0/1 nodes are alive") - }) -} - -func TestMultiNode_CheckLease(t *testing.T) { - t.Parallel() - t.Run("Round robin disables lease check", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node := newHealthyNode(t, chainID) - lggr, observedLogs := logger.TestObserved(t, zap.InfoLevel) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - logger: lggr, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - }) - servicetest.Run(t, mn) - tests.RequireLogMessage(t, observedLogs, "Best node switching is disabled") - }) - t.Run("Misconfigured lease check period won't start", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node := newHealthyNode(t, chainID) - lggr, observedLogs := logger.TestObserved(t, zap.InfoLevel) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeHighestHead, - chainID: chainID, - logger: lggr, - nodes: []Node[types.ID, multiNodeRPCClient]{node}, - leaseDuration: 0, - }) - servicetest.Run(t, mn) - tests.RequireLogMessage(t, observedLogs, "Best node switching is disabled") - }) - t.Run("Lease check updates active node", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node := newHealthyNode(t, chainID) - node.On("UnsubscribeAllExceptAliveLoop") - bestNode := newHealthyNode(t, chainID) - nodeSelector := newMockNodeSelector[types.ID, multiNodeRPCClient](t) - nodeSelector.On("Select").Return(bestNode) - lggr, observedLogs := logger.TestObserved(t, zap.InfoLevel) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeHighestHead, - chainID: chainID, - logger: lggr, - nodes: []Node[types.ID, multiNodeRPCClient]{node, bestNode}, - leaseDuration: tests.TestInterval, - }) - mn.nodeSelector = nodeSelector - servicetest.Run(t, mn) - tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("Switching to best node from %q to %q", node.String(), bestNode.String())) - tests.AssertEventually(t, func() bool { - mn.activeMu.RLock() - active := mn.activeNode - mn.activeMu.RUnlock() - return bestNode == active - }) - }) - t.Run("NodeStates returns proper states", func(t *testing.T) { - t.Parallel() - chainID := types.NewIDFromInt(10) - nodes := map[string]nodeState{ - "node_1": nodeStateAlive, - "node_2": nodeStateUnreachable, - "node_3": nodeStateDialed, - } - - opts := multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - } - - expectedResult := map[string]string{} - for name, state := range nodes { - node := newMockNode[types.ID, multiNodeRPCClient](t) - node.On("State").Return(state).Once() - node.On("Name").Return(name).Once() - opts.nodes = append(opts.nodes, node) - - sendOnly := newMockSendOnlyNode[types.ID, multiNodeRPCClient](t) - sendOnlyName := "send_only_" + name - sendOnly.On("State").Return(state).Once() - sendOnly.On("Name").Return(sendOnlyName).Once() - opts.sendonlys = append(opts.sendonlys, sendOnly) - - expectedResult[name] = state.String() - expectedResult[sendOnlyName] = state.String() - } - - mn := newTestMultiNode(t, opts) - states := mn.NodeStates() - assert.Equal(t, expectedResult, states) - }) -} - -func TestMultiNode_selectNode(t *testing.T) { - t.Parallel() - t.Run("Returns same node, if it's still healthy", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - node1 := newMockNode[types.ID, multiNodeRPCClient](t) - node1.On("State").Return(nodeStateAlive).Once() - node1.On("String").Return("node1").Maybe() - node2 := newMockNode[types.ID, multiNodeRPCClient](t) - node2.On("String").Return("node2").Maybe() - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{node1, node2}, - }) - nodeSelector := newMockNodeSelector[types.ID, multiNodeRPCClient](t) - nodeSelector.On("Select").Return(node1).Once() - mn.nodeSelector = nodeSelector - prevActiveNode, err := mn.selectNode() - require.NoError(t, err) - require.Equal(t, node1.String(), prevActiveNode.String()) - newActiveNode, err := mn.selectNode() - require.NoError(t, err) - require.Equal(t, prevActiveNode.String(), newActiveNode.String()) - }) - t.Run("Updates node if active is not healthy", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - oldBest := newMockNode[types.ID, multiNodeRPCClient](t) - oldBest.On("String").Return("oldBest").Maybe() - oldBest.On("UnsubscribeAllExceptAliveLoop") - newBest := newMockNode[types.ID, multiNodeRPCClient](t) - newBest.On("String").Return("newBest").Maybe() - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - nodes: []Node[types.ID, multiNodeRPCClient]{oldBest, newBest}, - }) - nodeSelector := newMockNodeSelector[types.ID, multiNodeRPCClient](t) - nodeSelector.On("Select").Return(oldBest).Once() - mn.nodeSelector = nodeSelector - activeNode, err := mn.selectNode() - require.NoError(t, err) - require.Equal(t, oldBest.String(), activeNode.String()) - // old best died, so we should replace it - oldBest.On("State").Return(nodeStateOutOfSync).Twice() - nodeSelector.On("Select").Return(newBest).Once() - newActiveNode, err := mn.selectNode() - require.NoError(t, err) - require.Equal(t, newBest.String(), newActiveNode.String()) - }) - t.Run("No active nodes - reports critical error", func(t *testing.T) { - t.Parallel() - chainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.InfoLevel) - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - logger: lggr, - }) - nodeSelector := newMockNodeSelector[types.ID, multiNodeRPCClient](t) - nodeSelector.On("Select").Return(nil).Once() - nodeSelector.On("Name").Return("MockedNodeSelector").Once() - mn.nodeSelector = nodeSelector - node, err := mn.selectNode() - require.EqualError(t, err, ErroringNodeError.Error()) - require.Nil(t, node) - tests.RequireLogMessage(t, observedLogs, "No live RPC nodes available") - }) -} - -func TestMultiNode_ChainInfo(t *testing.T) { - t.Parallel() - type nodeParams struct { - LatestChainInfo ChainInfo - HighestUserObservations ChainInfo - State nodeState - } - testCases := []struct { - Name string - ExpectedNLiveNodes int - ExpectedLatestChainInfo ChainInfo - ExpectedHighestUserObservations ChainInfo - NodeParams []nodeParams - }{ - { - Name: "no nodes", - ExpectedLatestChainInfo: ChainInfo{ - TotalDifficulty: big.NewInt(0), - }, - ExpectedHighestUserObservations: ChainInfo{ - TotalDifficulty: big.NewInt(0), - }, - }, - { - Name: "Best node is not healthy", - ExpectedNLiveNodes: 3, - ExpectedLatestChainInfo: ChainInfo{ - BlockNumber: 20, - FinalizedBlockNumber: 10, - TotalDifficulty: big.NewInt(10), - }, - ExpectedHighestUserObservations: ChainInfo{ - BlockNumber: 1005, - FinalizedBlockNumber: 995, - TotalDifficulty: big.NewInt(2005), - }, - NodeParams: []nodeParams{ - { - State: nodeStateOutOfSync, - LatestChainInfo: ChainInfo{ - BlockNumber: 1000, - FinalizedBlockNumber: 990, - TotalDifficulty: big.NewInt(2000), - }, - HighestUserObservations: ChainInfo{ - BlockNumber: 1005, - FinalizedBlockNumber: 995, - TotalDifficulty: big.NewInt(2005), - }, - }, - { - State: nodeStateAlive, - LatestChainInfo: ChainInfo{ - BlockNumber: 20, - FinalizedBlockNumber: 10, - TotalDifficulty: big.NewInt(9), - }, - HighestUserObservations: ChainInfo{ - BlockNumber: 25, - FinalizedBlockNumber: 15, - TotalDifficulty: big.NewInt(14), - }, - }, - { - State: nodeStateAlive, - LatestChainInfo: ChainInfo{ - BlockNumber: 19, - FinalizedBlockNumber: 9, - TotalDifficulty: big.NewInt(10), - }, - HighestUserObservations: ChainInfo{ - BlockNumber: 24, - FinalizedBlockNumber: 14, - TotalDifficulty: big.NewInt(15), - }, - }, - { - State: nodeStateAlive, - LatestChainInfo: ChainInfo{ - BlockNumber: 11, - FinalizedBlockNumber: 1, - TotalDifficulty: nil, - }, - HighestUserObservations: ChainInfo{ - BlockNumber: 16, - FinalizedBlockNumber: 6, - TotalDifficulty: nil, - }, - }, - }, - }, - } - - chainID := types.RandomID() - mn := newTestMultiNode(t, multiNodeOpts{ - selectionMode: NodeSelectionModeRoundRobin, - chainID: chainID, - }) - for i := range testCases { - tc := testCases[i] - t.Run(tc.Name, func(t *testing.T) { - for _, params := range tc.NodeParams { - node := newMockNode[types.ID, multiNodeRPCClient](t) - mn.primaryNodes = append(mn.primaryNodes, node) - node.On("StateAndLatest").Return(params.State, params.LatestChainInfo) - node.On("HighestUserObservations").Return(params.HighestUserObservations) - } - - nNodes, latestChainInfo := mn.LatestChainInfo() - assert.Equal(t, tc.ExpectedNLiveNodes, nNodes) - assert.Equal(t, tc.ExpectedLatestChainInfo, latestChainInfo) - - highestChainInfo := mn.HighestUserObservations() - assert.Equal(t, tc.ExpectedHighestUserObservations, highestChainInfo) - }) - } -} diff --git a/common/client/node.go b/common/client/node.go deleted file mode 100644 index 66161ac5d5f..00000000000 --- a/common/client/node.go +++ /dev/null @@ -1,336 +0,0 @@ -package client - -import ( - "context" - "errors" - "fmt" - "net/url" - "sync" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -const QueryTimeout = 10 * time.Second - -var errInvalidChainID = errors.New("invalid chain id") - -var ( - promPoolRPCNodeVerifies = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_verifies", - Help: "The total number of chain ID verifications for the given RPC node", - }, []string{"network", "chainID", "nodeName"}) - promPoolRPCNodeVerifiesFailed = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_verifies_failed", - Help: "The total number of failed chain ID verifications for the given RPC node", - }, []string{"network", "chainID", "nodeName"}) - promPoolRPCNodeVerifiesSuccess = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_verifies_success", - Help: "The total number of successful chain ID verifications for the given RPC node", - }, []string{"network", "chainID", "nodeName"}) -) - -type NodeConfig interface { - PollFailureThreshold() uint32 - PollInterval() time.Duration - SelectionMode() string - SyncThreshold() uint32 - NodeIsSyncingEnabled() bool - FinalizedBlockPollInterval() time.Duration - EnforceRepeatableRead() bool - DeathDeclarationDelay() time.Duration - NewHeadsPollInterval() time.Duration -} - -type ChainConfig interface { - NodeNoNewHeadsThreshold() time.Duration - NoNewFinalizedHeadsThreshold() time.Duration - FinalityDepth() uint32 - FinalityTagEnabled() bool - FinalizedBlockOffset() uint32 -} - -type Node[ - CHAIN_ID types.ID, - RPC any, -] interface { - // State returns most accurate state of the Node on the moment of call. - // While some of the checks may be performed in the background and State may return cached value, critical, like - // `FinalizedBlockOutOfSync`, must be executed upon every call. - State() nodeState - // StateAndLatest returns nodeState with the latest ChainInfo observed by Node during current lifecycle. - StateAndLatest() (nodeState, ChainInfo) - // HighestUserObservations - returns highest ChainInfo ever observed by underlying RPC excluding results of health check requests - HighestUserObservations() ChainInfo - SetPoolChainInfoProvider(PoolChainInfoProvider) - // Name is a unique identifier for this node. - Name() string - // String - returns string representation of the node, useful for debugging (name + URLS used to connect to the RPC) - String() string - RPC() RPC - // UnsubscribeAllExceptAliveLoop - closes all subscriptions except the aliveLoop subscription - UnsubscribeAllExceptAliveLoop() - ConfiguredChainID() CHAIN_ID - // Order - returns priority order configured for the RPC - Order() int32 - // Start - starts health checks - Start(context.Context) error - Close() error -} - -type node[ - CHAIN_ID types.ID, - HEAD Head, - RPC RPCClient[CHAIN_ID, HEAD], -] struct { - services.StateMachine - lfcLog logger.Logger - name string - id int - chainID CHAIN_ID - nodePoolCfg NodeConfig - chainCfg ChainConfig - order int32 - chainFamily string - - ws *url.URL - http *url.URL - - rpc RPC - - stateMu sync.RWMutex // protects state* fields - state nodeState - - poolInfoProvider PoolChainInfoProvider - - stopCh services.StopChan - // wg waits for subsidiary goroutines - wg sync.WaitGroup - - healthCheckSubs []types.Subscription -} - -func NewNode[ - CHAIN_ID types.ID, - HEAD Head, - RPC RPCClient[CHAIN_ID, HEAD], -]( - nodeCfg NodeConfig, - chainCfg ChainConfig, - lggr logger.Logger, - wsuri *url.URL, - httpuri *url.URL, - name string, - id int, - chainID CHAIN_ID, - nodeOrder int32, - rpc RPC, - chainFamily string, -) Node[CHAIN_ID, RPC] { - n := new(node[CHAIN_ID, HEAD, RPC]) - n.name = name - n.id = id - n.chainID = chainID - n.nodePoolCfg = nodeCfg - n.chainCfg = chainCfg - n.order = nodeOrder - if wsuri != nil { - n.ws = wsuri - } - if httpuri != nil { - n.http = httpuri - } - n.stopCh = make(services.StopChan) - lggr = logger.Named(lggr, "Node") - lggr = logger.With(lggr, - "nodeTier", Primary.String(), - "nodeName", name, - "node", n.String(), - "chainID", chainID, - "nodeOrder", n.order, - ) - n.lfcLog = logger.Named(lggr, "Lifecycle") - n.rpc = rpc - n.chainFamily = chainFamily - return n -} - -func (n *node[CHAIN_ID, HEAD, RPC]) String() string { - s := fmt.Sprintf("(%s)%s", Primary.String(), n.name) - if n.ws != nil { - s = s + fmt.Sprintf(":%s", n.ws.String()) - } - if n.http != nil { - s = s + fmt.Sprintf(":%s", n.http.String()) - } - return s -} - -func (n *node[CHAIN_ID, HEAD, RPC]) ConfiguredChainID() (chainID CHAIN_ID) { - return n.chainID -} - -func (n *node[CHAIN_ID, HEAD, RPC]) Name() string { - return n.name -} - -func (n *node[CHAIN_ID, HEAD, RPC]) RPC() RPC { - return n.rpc -} - -// unsubscribeAllExceptAliveLoop is not thread-safe; it should only be called -// while holding the stateMu lock. -func (n *node[CHAIN_ID, HEAD, RPC]) unsubscribeAllExceptAliveLoop() { - n.rpc.UnsubscribeAllExcept(n.healthCheckSubs...) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) UnsubscribeAllExceptAliveLoop() { - n.stateMu.Lock() - defer n.stateMu.Unlock() - n.unsubscribeAllExceptAliveLoop() -} - -func (n *node[CHAIN_ID, HEAD, RPC]) Close() error { - return n.StopOnce(n.name, n.close) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) close() error { - defer func() { - n.wg.Wait() - n.rpc.Close() - }() - - n.stateMu.Lock() - defer n.stateMu.Unlock() - - close(n.stopCh) - n.state = nodeStateClosed - return nil -} - -// Start dials and verifies the node -// Should only be called once in a node's lifecycle -// Return value is necessary to conform to interface but this will never -// actually return an error. -func (n *node[CHAIN_ID, HEAD, RPC]) Start(startCtx context.Context) error { - return n.StartOnce(n.name, func() error { - n.start(startCtx) - return nil - }) -} - -// start initially dials the node and verifies chain ID -// This spins off lifecycle goroutines. -// Not thread-safe. -// Node lifecycle is synchronous: only one goroutine should be running at a -// time. -func (n *node[CHAIN_ID, HEAD, RPC]) start(startCtx context.Context) { - if n.state != nodeStateUndialed { - panic(fmt.Sprintf("cannot dial node with state %v", n.state)) - } - - if err := n.rpc.Dial(startCtx); err != nil { - n.lfcLog.Errorw("Dial failed: Node is unreachable", "err", err) - n.declareUnreachable() - return - } - n.setState(nodeStateDialed) - - state := n.verifyConn(startCtx, n.lfcLog) - n.declareState(state) -} - -// verifyChainID checks that connection to the node matches the given chain ID -// Not thread-safe -// Pure verifyChainID: does not mutate node "state" field. -func (n *node[CHAIN_ID, HEAD, RPC]) verifyChainID(callerCtx context.Context, lggr logger.Logger) nodeState { - promPoolRPCNodeVerifies.WithLabelValues(n.chainFamily, n.chainID.String(), n.name).Inc() - promFailed := func() { - promPoolRPCNodeVerifiesFailed.WithLabelValues(n.chainFamily, n.chainID.String(), n.name).Inc() - } - - st := n.getCachedState() - switch st { - case nodeStateClosed: - // The node is already closed, and any subsequent transition is invalid. - // To make spotting such transitions a bit easier, return the invalid node state. - return nodeStateLen - case nodeStateDialed, nodeStateOutOfSync, nodeStateInvalidChainID, nodeStateSyncing: - default: - panic(fmt.Sprintf("cannot verify node in state %v", st)) - } - - var chainID CHAIN_ID - var err error - if chainID, err = n.rpc.ChainID(callerCtx); err != nil { - promFailed() - lggr.Errorw("Failed to verify chain ID for node", "err", err, "nodeState", n.getCachedState()) - return nodeStateUnreachable - } else if chainID.String() != n.chainID.String() { - promFailed() - err = fmt.Errorf( - "rpc ChainID doesn't match local chain ID: RPC ID=%s, local ID=%s, node name=%s: %w", - chainID.String(), - n.chainID.String(), - n.name, - errInvalidChainID, - ) - lggr.Errorw("Failed to verify RPC node; remote endpoint returned the wrong chain ID", "err", err, "nodeState", n.getCachedState()) - return nodeStateInvalidChainID - } - - promPoolRPCNodeVerifiesSuccess.WithLabelValues(n.chainFamily, n.chainID.String(), n.name).Inc() - - return nodeStateAlive -} - -// createVerifiedConn - establishes new connection with the RPC and verifies that it's valid: chainID matches, and it's not syncing. -// Returns desired state if one of the verifications fails. Otherwise, returns nodeStateAlive. -func (n *node[CHAIN_ID, HEAD, RPC]) createVerifiedConn(ctx context.Context, lggr logger.Logger) nodeState { - if err := n.rpc.Dial(ctx); err != nil { - n.lfcLog.Errorw("Dial failed: Node is unreachable", "err", err, "nodeState", n.getCachedState()) - return nodeStateUnreachable - } - - return n.verifyConn(ctx, lggr) -} - -// verifyConn - verifies that current connection is valid: chainID matches, and it's not syncing. -// Returns desired state if one of the verifications fails. Otherwise, returns nodeStateAlive. -func (n *node[CHAIN_ID, HEAD, RPC]) verifyConn(ctx context.Context, lggr logger.Logger) nodeState { - state := n.verifyChainID(ctx, lggr) - if state != nodeStateAlive { - return state - } - - if n.nodePoolCfg.NodeIsSyncingEnabled() { - isSyncing, err := n.rpc.IsSyncing(ctx) - if err != nil { - lggr.Errorw("Unexpected error while verifying RPC node synchronization status", "err", err, "nodeState", n.getCachedState()) - return nodeStateUnreachable - } - - if isSyncing { - lggr.Errorw("Verification failed: Node is syncing", "nodeState", n.getCachedState()) - return nodeStateSyncing - } - } - - return nodeStateAlive -} - -func (n *node[CHAIN_ID, HEAD, RPC]) Order() int32 { - return n.order -} - -func (n *node[CHAIN_ID, HEAD, RPC]) newCtx() (context.Context, context.CancelFunc) { - ctx, cancel := n.stopCh.NewCtx() - ctx = CtxAddHealthCheckFlag(ctx) - return ctx, cancel -} diff --git a/common/client/node_fsm.go b/common/client/node_fsm.go deleted file mode 100644 index b707e9f4375..00000000000 --- a/common/client/node_fsm.go +++ /dev/null @@ -1,377 +0,0 @@ -package client - -import ( - "fmt" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" -) - -var ( - promPoolRPCNodeTransitionsToAlive = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_alive", - Help: transitionString(nodeStateAlive), - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeTransitionsToInSync = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_in_sync", - Help: fmt.Sprintf("%s to %s", transitionString(nodeStateOutOfSync), nodeStateAlive), - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeTransitionsToOutOfSync = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_out_of_sync", - Help: transitionString(nodeStateOutOfSync), - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeTransitionsToUnreachable = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_unreachable", - Help: transitionString(nodeStateUnreachable), - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeTransitionsToInvalidChainID = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_invalid_chain_id", - Help: transitionString(nodeStateInvalidChainID), - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeTransitionsToUnusable = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_unusable", - Help: transitionString(nodeStateUnusable), - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeTransitionsToSyncing = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_transitions_to_syncing", - Help: transitionString(nodeStateSyncing), - }, []string{"chainID", "nodeName"}) -) - -// nodeState represents the current state of the node -// Node is a FSM (finite state machine) -type nodeState int - -func (n nodeState) String() string { - switch n { - case nodeStateUndialed: - return "Undialed" - case nodeStateDialed: - return "Dialed" - case nodeStateInvalidChainID: - return "InvalidChainID" - case nodeStateAlive: - return "Alive" - case nodeStateUnreachable: - return "Unreachable" - case nodeStateUnusable: - return "Unusable" - case nodeStateOutOfSync: - return "OutOfSync" - case nodeStateClosed: - return "Closed" - case nodeStateSyncing: - return "Syncing" - case nodeStateFinalizedBlockOutOfSync: - return "FinalizedBlockOutOfSync" - default: - return fmt.Sprintf("nodeState(%d)", n) - } -} - -// GoString prints a prettier state -func (n nodeState) GoString() string { - return fmt.Sprintf("nodeState%s(%d)", n.String(), n) -} - -const ( - // nodeStateUndialed is the first state of a virgin node - nodeStateUndialed = nodeState(iota) - // nodeStateDialed is after a node has successfully dialed but before it has verified the correct chain ID - nodeStateDialed - // nodeStateInvalidChainID is after chain ID verification failed - nodeStateInvalidChainID - // nodeStateAlive is a healthy node after chain ID verification succeeded - nodeStateAlive - // nodeStateUnreachable is a node that cannot be dialed or has disconnected - nodeStateUnreachable - // nodeStateOutOfSync is a node that is accepting connections but exceeded - // the failure threshold without sending any new heads. It will be - // disconnected, then put into a revive loop and re-awakened after redial - // if a new head arrives - nodeStateOutOfSync - // nodeStateUnusable is a sendonly node that has an invalid URL that can never be reached - nodeStateUnusable - // nodeStateClosed is after the connection has been closed and the node is at the end of its lifecycle - nodeStateClosed - // nodeStateSyncing is a node that is actively back-filling blockchain. Usually, it's a newly set up node that is - // still syncing the chain. The main difference from `nodeStateOutOfSync` is that it represents state relative - // to other primary nodes configured in the MultiNode. In contrast, `nodeStateSyncing` represents the internal state of - // the node (RPC). - nodeStateSyncing - // nodeStateFinalizedBlockOutOfSync - node is lagging behind on latest finalized block - nodeStateFinalizedBlockOutOfSync - // nodeStateLen tracks the number of states - nodeStateLen -) - -// allNodeStates represents all possible states a node can be in -var allNodeStates []nodeState - -func init() { - for s := nodeState(0); s < nodeStateLen; s++ { - allNodeStates = append(allNodeStates, s) - } -} - -// FSM methods - -// State allows reading the current state of the node. -func (n *node[CHAIN_ID, HEAD, RPC]) State() nodeState { - n.stateMu.RLock() - defer n.stateMu.RUnlock() - return n.recalculateState() -} - -func (n *node[CHAIN_ID, HEAD, RPC]) getCachedState() nodeState { - n.stateMu.RLock() - defer n.stateMu.RUnlock() - return n.state -} - -func (n *node[CHAIN_ID, HEAD, RPC]) recalculateState() nodeState { - if n.state != nodeStateAlive { - return n.state - } - - // double check that node is not lagging on finalized block - if n.nodePoolCfg.EnforceRepeatableRead() && n.isFinalizedBlockOutOfSync() { - return nodeStateFinalizedBlockOutOfSync - } - - return nodeStateAlive -} - -func (n *node[CHAIN_ID, HEAD, RPC]) isFinalizedBlockOutOfSync() bool { - if n.poolInfoProvider == nil { - return false - } - - highestObservedByCaller := n.poolInfoProvider.HighestUserObservations() - latest, rpcHighest := n.rpc.GetInterceptedChainInfo() - isOutOfSync := false - if n.chainCfg.FinalityTagEnabled() { - isOutOfSync = latest.FinalizedBlockNumber < highestObservedByCaller.FinalizedBlockNumber-int64(n.chainCfg.FinalizedBlockOffset()) - } else { - isOutOfSync = latest.BlockNumber < highestObservedByCaller.BlockNumber-int64(n.chainCfg.FinalizedBlockOffset()) - } - - if isOutOfSync { - n.lfcLog.Debugw("finalized block is out of sync", "rpcLatestChainInfo", latest, "rpcHighest", rpcHighest, "highestObservedByCaller", highestObservedByCaller) - } - - return isOutOfSync -} - -// StateAndLatest returns nodeState with the latest ChainInfo observed by Node during current lifecycle. -func (n *node[CHAIN_ID, HEAD, RPC]) StateAndLatest() (nodeState, ChainInfo) { - n.stateMu.RLock() - defer n.stateMu.RUnlock() - latest, _ := n.rpc.GetInterceptedChainInfo() - return n.recalculateState(), latest -} - -// HighestUserObservations - returns highest ChainInfo ever observed by external user of the Node -func (n *node[CHAIN_ID, HEAD, RPC]) HighestUserObservations() ChainInfo { - _, highestUserObservations := n.rpc.GetInterceptedChainInfo() - return highestUserObservations -} -func (n *node[CHAIN_ID, HEAD, RPC]) SetPoolChainInfoProvider(poolInfoProvider PoolChainInfoProvider) { - n.poolInfoProvider = poolInfoProvider -} - -// setState is only used by internal state management methods. -// This is low-level; care should be taken by the caller to ensure the new state is a valid transition. -// State changes should always be synchronous: only one goroutine at a time should change state. -// n.stateMu should not be locked for long periods of time because external clients expect a timely response from n.State() -func (n *node[CHAIN_ID, HEAD, RPC]) setState(s nodeState) { - n.stateMu.Lock() - defer n.stateMu.Unlock() - n.state = s -} - -// declareXXX methods change the state and pass conrol off the new state -// management goroutine - -func (n *node[CHAIN_ID, HEAD, RPC]) declareAlive() { - n.transitionToAlive(func() { - n.lfcLog.Infow("RPC Node is online", "nodeState", n.state) - n.wg.Add(1) - go n.aliveLoop() - }) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) transitionToAlive(fn func()) { - promPoolRPCNodeTransitionsToAlive.WithLabelValues(n.chainID.String(), n.name).Inc() - n.stateMu.Lock() - defer n.stateMu.Unlock() - if n.state == nodeStateClosed { - return - } - switch n.state { - case nodeStateDialed, nodeStateInvalidChainID, nodeStateSyncing: - n.state = nodeStateAlive - default: - panic(transitionFail(n.state, nodeStateAlive)) - } - fn() -} - -// declareInSync puts a node back into Alive state, allowing it to be used by -// pool consumers again -func (n *node[CHAIN_ID, HEAD, RPC]) declareInSync() { - n.transitionToInSync(func() { - n.lfcLog.Infow("RPC Node is back in sync", "nodeState", n.state) - n.wg.Add(1) - go n.aliveLoop() - }) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) transitionToInSync(fn func()) { - promPoolRPCNodeTransitionsToAlive.WithLabelValues(n.chainID.String(), n.name).Inc() - promPoolRPCNodeTransitionsToInSync.WithLabelValues(n.chainID.String(), n.name).Inc() - n.stateMu.Lock() - defer n.stateMu.Unlock() - if n.state == nodeStateClosed { - return - } - switch n.state { - case nodeStateOutOfSync, nodeStateSyncing: - n.state = nodeStateAlive - default: - panic(transitionFail(n.state, nodeStateAlive)) - } - fn() -} - -// declareOutOfSync puts a node into OutOfSync state, disconnecting all current -// clients and making it unavailable for use until back in-sync. -func (n *node[CHAIN_ID, HEAD, RPC]) declareOutOfSync(syncIssues syncStatus) { - n.transitionToOutOfSync(func() { - n.lfcLog.Errorw("RPC Node is out of sync", "nodeState", n.state, "syncIssues", syncIssues) - n.wg.Add(1) - go n.outOfSyncLoop(syncIssues) - }) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) transitionToOutOfSync(fn func()) { - promPoolRPCNodeTransitionsToOutOfSync.WithLabelValues(n.chainID.String(), n.name).Inc() - n.stateMu.Lock() - defer n.stateMu.Unlock() - if n.state == nodeStateClosed { - return - } - switch n.state { - case nodeStateAlive: - n.rpc.Close() - n.state = nodeStateOutOfSync - default: - panic(transitionFail(n.state, nodeStateOutOfSync)) - } - fn() -} - -func (n *node[CHAIN_ID, HEAD, RPC]) declareUnreachable() { - n.transitionToUnreachable(func() { - n.lfcLog.Errorw("RPC Node is unreachable", "nodeState", n.state) - n.wg.Add(1) - go n.unreachableLoop() - }) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) transitionToUnreachable(fn func()) { - promPoolRPCNodeTransitionsToUnreachable.WithLabelValues(n.chainID.String(), n.name).Inc() - n.stateMu.Lock() - defer n.stateMu.Unlock() - if n.state == nodeStateClosed { - return - } - switch n.state { - case nodeStateUndialed, nodeStateDialed, nodeStateAlive, nodeStateOutOfSync, nodeStateInvalidChainID, nodeStateSyncing: - n.rpc.Close() - n.state = nodeStateUnreachable - default: - panic(transitionFail(n.state, nodeStateUnreachable)) - } - fn() -} - -func (n *node[CHAIN_ID, HEAD, RPC]) declareState(state nodeState) { - if n.getCachedState() == nodeStateClosed { - return - } - switch state { - case nodeStateInvalidChainID: - n.declareInvalidChainID() - case nodeStateUnreachable: - n.declareUnreachable() - case nodeStateSyncing: - n.declareSyncing() - case nodeStateAlive: - n.declareAlive() - default: - panic(fmt.Sprintf("%#v state declaration is not implemented", state)) - } -} - -func (n *node[CHAIN_ID, HEAD, RPC]) declareInvalidChainID() { - n.transitionToInvalidChainID(func() { - n.lfcLog.Errorw("RPC Node has the wrong chain ID", "nodeState", n.state) - n.wg.Add(1) - go n.invalidChainIDLoop() - }) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) transitionToInvalidChainID(fn func()) { - promPoolRPCNodeTransitionsToInvalidChainID.WithLabelValues(n.chainID.String(), n.name).Inc() - n.stateMu.Lock() - defer n.stateMu.Unlock() - if n.state == nodeStateClosed { - return - } - switch n.state { - case nodeStateDialed, nodeStateOutOfSync, nodeStateSyncing: - n.rpc.Close() - n.state = nodeStateInvalidChainID - default: - panic(transitionFail(n.state, nodeStateInvalidChainID)) - } - fn() -} - -func (n *node[CHAIN_ID, HEAD, RPC]) declareSyncing() { - n.transitionToSyncing(func() { - n.lfcLog.Errorw("RPC Node is syncing", "nodeState", n.state) - n.wg.Add(1) - go n.syncingLoop() - }) -} - -func (n *node[CHAIN_ID, HEAD, RPC]) transitionToSyncing(fn func()) { - promPoolRPCNodeTransitionsToSyncing.WithLabelValues(n.chainID.String(), n.name).Inc() - n.stateMu.Lock() - defer n.stateMu.Unlock() - if n.state == nodeStateClosed { - return - } - switch n.state { - case nodeStateDialed, nodeStateOutOfSync, nodeStateInvalidChainID: - n.rpc.Close() - n.state = nodeStateSyncing - default: - panic(transitionFail(n.state, nodeStateSyncing)) - } - - if !n.nodePoolCfg.NodeIsSyncingEnabled() { - panic("unexpected transition to nodeStateSyncing, while it's disabled") - } - fn() -} - -func transitionString(state nodeState) string { - return fmt.Sprintf("Total number of times node has transitioned to %s", state) -} - -func transitionFail(from nodeState, to nodeState) string { - return fmt.Sprintf("cannot transition from %#v to %#v", from, to) -} diff --git a/common/client/node_fsm_test.go b/common/client/node_fsm_test.go deleted file mode 100644 index 93460d934a3..00000000000 --- a/common/client/node_fsm_test.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -import ( - "slices" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type fnMock struct{ calls int } - -func (fm *fnMock) Fn() { - fm.calls++ -} - -func (fm *fnMock) AssertNotCalled(t *testing.T) { - assert.Equal(t, 0, fm.calls) -} - -func (fm *fnMock) AssertCalled(t *testing.T) { - assert.Greater(t, fm.calls, 0) -} - -func TestUnit_Node_StateTransitions(t *testing.T) { - t.Parallel() - - t.Run("setState", func(t *testing.T) { - n := newTestNode(t, testNodeOpts{rpc: nil, config: testNodeConfig{nodeIsSyncingEnabled: true}}) - assert.Equal(t, nodeStateUndialed, n.State()) - n.setState(nodeStateAlive) - assert.Equal(t, nodeStateAlive, n.State()) - n.setState(nodeStateUndialed) - assert.Equal(t, nodeStateUndialed, n.State()) - }) - - t.Run("transitionToAlive", func(t *testing.T) { - const destinationState = nodeStateAlive - allowedStates := []nodeState{nodeStateDialed, nodeStateInvalidChainID, nodeStateSyncing} - rpc := newMockRPCClient[types.ID, Head](t) - testTransition(t, rpc, testNode.transitionToAlive, destinationState, allowedStates...) - }) - - t.Run("transitionToInSync", func(t *testing.T) { - const destinationState = nodeStateAlive - allowedStates := []nodeState{nodeStateOutOfSync, nodeStateSyncing} - rpc := newMockRPCClient[types.ID, Head](t) - testTransition(t, rpc, testNode.transitionToInSync, destinationState, allowedStates...) - }) - t.Run("transitionToOutOfSync", func(t *testing.T) { - const destinationState = nodeStateOutOfSync - allowedStates := []nodeState{nodeStateAlive} - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("Close") - testTransition(t, rpc, testNode.transitionToOutOfSync, destinationState, allowedStates...) - }) - t.Run("transitionToUnreachable", func(t *testing.T) { - const destinationState = nodeStateUnreachable - allowedStates := []nodeState{nodeStateUndialed, nodeStateDialed, nodeStateAlive, nodeStateOutOfSync, nodeStateInvalidChainID, nodeStateSyncing} - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("Close") - testTransition(t, rpc, testNode.transitionToUnreachable, destinationState, allowedStates...) - }) - t.Run("transitionToInvalidChain", func(t *testing.T) { - const destinationState = nodeStateInvalidChainID - allowedStates := []nodeState{nodeStateDialed, nodeStateOutOfSync, nodeStateSyncing} - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("Close") - testTransition(t, rpc, testNode.transitionToInvalidChainID, destinationState, allowedStates...) - }) - t.Run("transitionToSyncing", func(t *testing.T) { - const destinationState = nodeStateSyncing - allowedStates := []nodeState{nodeStateDialed, nodeStateOutOfSync, nodeStateInvalidChainID} - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("Close") - testTransition(t, rpc, testNode.transitionToSyncing, destinationState, allowedStates...) - }) - t.Run("transitionToSyncing panics if nodeIsSyncing is disabled", func(t *testing.T) { - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("Close") - node := newTestNode(t, testNodeOpts{rpc: rpc}) - node.setState(nodeStateDialed) - fn := new(fnMock) - defer fn.AssertNotCalled(t) - assert.PanicsWithValue(t, "unexpected transition to nodeStateSyncing, while it's disabled", func() { - node.transitionToSyncing(fn.Fn) - }) - }) -} - -func testTransition(t *testing.T, rpc *mockRPCClient[types.ID, Head], transition func(node testNode, fn func()), destinationState nodeState, allowedStates ...nodeState) { - node := newTestNode(t, testNodeOpts{rpc: rpc, config: testNodeConfig{nodeIsSyncingEnabled: true}}) - for _, allowedState := range allowedStates { - m := new(fnMock) - node.setState(allowedState) - transition(node, m.Fn) - assert.Equal(t, destinationState, node.State(), "Expected node to successfully transition from %s to %s state", allowedState, destinationState) - m.AssertCalled(t) - } - // noop on attempt to transition from Closed state - m := new(fnMock) - node.setState(nodeStateClosed) - transition(node, m.Fn) - m.AssertNotCalled(t) - assert.Equal(t, nodeStateClosed, node.State(), "Expected node to remain in closed state on transition attempt") - - for _, nodeState := range allNodeStates { - if slices.Contains(allowedStates, nodeState) || nodeState == nodeStateClosed { - continue - } - - m := new(fnMock) - node.setState(nodeState) - assert.Panics(t, func() { - transition(node, m.Fn) - }, "Expected transition from `%s` to `%s` to panic", nodeState, destinationState) - m.AssertNotCalled(t) - assert.Equal(t, nodeState, node.State(), "Expected node to remain in initial state on invalid transition") - } -} - -func TestNodeState_String(t *testing.T) { - t.Run("Ensure all states are meaningful when converted to string", func(t *testing.T) { - for _, ns := range allNodeStates { - // ensure that string representation is not nodeState(%d) - assert.NotContains(t, ns.String(), strconv.FormatInt(int64(ns), 10), "Expected node state to have readable name") - } - }) -} diff --git a/common/client/node_lifecycle.go b/common/client/node_lifecycle.go deleted file mode 100644 index 6ec6a598eb2..00000000000 --- a/common/client/node_lifecycle.go +++ /dev/null @@ -1,700 +0,0 @@ -package client - -import ( - "context" - "fmt" - "math" - "math/big" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/utils" - bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - - iutils "github.com/smartcontractkit/chainlink/v2/common/internal/utils" - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -var ( - promPoolRPCNodeHighestSeenBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "pool_rpc_node_highest_seen_block", - Help: "The highest seen block for the given RPC node", - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeHighestFinalizedBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "pool_rpc_node_highest_finalized_block", - Help: "The highest seen finalized block for the given RPC node", - }, []string{"chainID", "nodeName"}) - promPoolRPCNodeNumSeenBlocks = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_num_seen_blocks", - Help: "The total number of new blocks seen by the given RPC node", - }, []string{"chainID", "nodeName"}) - promPoolRPCNodePolls = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_polls_total", - Help: "The total number of poll checks for the given RPC node", - }, []string{"chainID", "nodeName"}) - promPoolRPCNodePollsFailed = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_polls_failed", - Help: "The total number of failed poll checks for the given RPC node", - }, []string{"chainID", "nodeName"}) - promPoolRPCNodePollsSuccess = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pool_rpc_node_polls_success", - Help: "The total number of successful poll checks for the given RPC node", - }, []string{"chainID", "nodeName"}) -) - -// zombieNodeCheckInterval controls how often to re-check to see if we need to -// state change in case we have to force a state transition due to no available -// nodes. -// NOTE: This only applies to out-of-sync nodes if they are the last available node -func zombieNodeCheckInterval(noNewHeadsThreshold time.Duration) time.Duration { - interval := noNewHeadsThreshold - if interval <= 0 || interval > QueryTimeout { - interval = QueryTimeout - } - return utils.WithJitter(interval) -} - -const ( - msgCannotDisable = "but cannot disable this connection because there are no other RPC endpoints, or all other RPC endpoints are dead." - msgDegradedState = "Chainlink is now operating in a degraded state and urgent action is required to resolve the issue" -) - -// Node is a FSM -// Each state has a loop that goes with it, which monitors the node and moves it into another state as necessary. -// Only one loop must run at a time. -// Each loop passes control onto the next loop as it exits, except when the node is Closed which terminates the loop permanently. - -// This handles node lifecycle for the ALIVE state -// Should only be run ONCE per node, after a successful Dial -func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() { - defer n.wg.Done() - ctx, cancel := n.newCtx() - defer cancel() - - { - // sanity check - state := n.getCachedState() - switch state { - case nodeStateAlive: - case nodeStateClosed: - return - default: - panic(fmt.Sprintf("aliveLoop can only run for node in Alive state, got: %s", state)) - } - } - - noNewHeadsTimeoutThreshold := n.chainCfg.NodeNoNewHeadsThreshold() - noNewFinalizedBlocksTimeoutThreshold := n.chainCfg.NoNewFinalizedHeadsThreshold() - pollFailureThreshold := n.nodePoolCfg.PollFailureThreshold() - pollInterval := n.nodePoolCfg.PollInterval() - - lggr := logger.Sugared(n.lfcLog).Named("Alive").With("noNewHeadsTimeoutThreshold", noNewHeadsTimeoutThreshold, "pollInterval", pollInterval, "pollFailureThreshold", pollFailureThreshold) - lggr.Tracew("Alive loop starting", "nodeState", n.getCachedState()) - - headsSub, err := n.registerNewSubscription(ctx, lggr.With("subscriptionType", "heads"), - n.chainCfg.NodeNoNewHeadsThreshold(), n.rpc.SubscribeToHeads) - if err != nil { - lggr.Errorw("Initial subscribe for heads failed", "nodeState", n.getCachedState(), "err", err) - n.declareUnreachable() - return - } - - defer n.unsubscribeHealthChecks() - - var pollCh <-chan time.Time - if pollInterval > 0 { - lggr.Debug("Polling enabled") - pollT := time.NewTicker(pollInterval) - defer pollT.Stop() - pollCh = pollT.C - if pollFailureThreshold > 0 { - // polling can be enabled with no threshold to enable polling but - // the node will not be marked offline regardless of the number of - // poll failures - lggr.Debug("Polling liveness checking enabled") - } - } else { - lggr.Debug("Polling disabled") - } - - var finalizedHeadsSub headSubscription[HEAD] - if n.chainCfg.FinalityTagEnabled() { - finalizedHeadsSub, err = n.registerNewSubscription(ctx, lggr.With("subscriptionType", "finalizedHeads"), - n.chainCfg.NoNewFinalizedHeadsThreshold(), n.rpc.SubscribeToFinalizedHeads) - if err != nil { - lggr.Errorw("Failed to subscribe to finalized heads", "err", err) - n.declareUnreachable() - return - } - } - - // Get the latest chain info to use as local highest - localHighestChainInfo, _ := n.rpc.GetInterceptedChainInfo() - var pollFailures uint32 - - for { - select { - case <-ctx.Done(): - return - case <-pollCh: - promPoolRPCNodePolls.WithLabelValues(n.chainID.String(), n.name).Inc() - lggr.Tracew("Pinging RPC", "nodeState", n.State(), "pollFailures", pollFailures) - pollCtx, cancel := context.WithTimeout(ctx, pollInterval) - err = n.RPC().Ping(pollCtx) - cancel() - if err != nil { - // prevent overflow - if pollFailures < math.MaxUint32 { - promPoolRPCNodePollsFailed.WithLabelValues(n.chainID.String(), n.name).Inc() - pollFailures++ - } - lggr.Warnw(fmt.Sprintf("Poll failure, RPC endpoint %s failed to respond properly", n.String()), "err", err, "pollFailures", pollFailures, "nodeState", n.getCachedState()) - } else { - lggr.Debugw("Ping successful", "nodeState", n.State()) - promPoolRPCNodePollsSuccess.WithLabelValues(n.chainID.String(), n.name).Inc() - pollFailures = 0 - } - if pollFailureThreshold > 0 && pollFailures >= pollFailureThreshold { - lggr.Errorw(fmt.Sprintf("RPC endpoint failed to respond to %d consecutive polls", pollFailures), "pollFailures", pollFailures, "nodeState", n.getCachedState()) - if n.poolInfoProvider != nil { - if l, _ := n.poolInfoProvider.LatestChainInfo(); l < 2 { - lggr.Criticalf("RPC endpoint failed to respond to polls; %s %s", msgCannotDisable, msgDegradedState) - continue - } - } - n.declareUnreachable() - return - } - if outOfSync, liveNodes := n.isOutOfSyncWithPool(); outOfSync { - // note: there must be another live node for us to be out of sync - if liveNodes < 2 { - lggr.Criticalf("RPC endpoint has fallen behind; %s %s", msgCannotDisable, msgDegradedState) - continue - } - n.declareOutOfSync(syncStatusNotInSyncWithPool) - return - } - case bh, open := <-headsSub.Heads: - if !open { - lggr.Errorw("Subscription channel unexpectedly closed", "nodeState", n.getCachedState()) - n.declareUnreachable() - return - } - receivedNewHead := n.onNewHead(lggr, &localHighestChainInfo, bh) - if receivedNewHead && noNewHeadsTimeoutThreshold > 0 { - headsSub.ResetTimer(noNewHeadsTimeoutThreshold) - } - case err = <-headsSub.Errors: - lggr.Errorw("Subscription was terminated", "err", err, "nodeState", n.getCachedState()) - n.declareUnreachable() - return - case <-headsSub.NoNewHeads: - // We haven't received a head on the channel for at least the - // threshold amount of time, mark it broken - lggr.Errorw(fmt.Sprintf("RPC endpoint detected out of sync; no new heads received for %s (last head received was %v)", noNewHeadsTimeoutThreshold, localHighestChainInfo.BlockNumber), "nodeState", n.getCachedState(), "latestReceivedBlockNumber", localHighestChainInfo.BlockNumber, "noNewHeadsTimeoutThreshold", noNewHeadsTimeoutThreshold) - if n.poolInfoProvider != nil { - if l, _ := n.poolInfoProvider.LatestChainInfo(); l < 2 { - lggr.Criticalf("RPC endpoint detected out of sync; %s %s", msgCannotDisable, msgDegradedState) - // We don't necessarily want to wait the full timeout to check again, we should - // check regularly and log noisily in this state - headsSub.ResetTimer(zombieNodeCheckInterval(noNewHeadsTimeoutThreshold)) - continue - } - } - n.declareOutOfSync(syncStatusNoNewHead) - return - case latestFinalized, open := <-finalizedHeadsSub.Heads: - if !open { - lggr.Errorw("Finalized heads subscription channel unexpectedly closed") - n.declareUnreachable() - return - } - - receivedNewHead := n.onNewFinalizedHead(lggr, &localHighestChainInfo, latestFinalized) - if receivedNewHead && noNewFinalizedBlocksTimeoutThreshold > 0 { - finalizedHeadsSub.ResetTimer(noNewFinalizedBlocksTimeoutThreshold) - } - case <-finalizedHeadsSub.NoNewHeads: - // We haven't received a finalized head on the channel for at least the - // threshold amount of time, mark it broken - lggr.Errorw(fmt.Sprintf("RPC's finalized state is out of sync; no new finalized heads received for %s (last finalized head received was %v)", noNewFinalizedBlocksTimeoutThreshold, localHighestChainInfo.FinalizedBlockNumber), "latestReceivedBlockNumber", localHighestChainInfo.BlockNumber) - if n.poolInfoProvider != nil { - if l, _ := n.poolInfoProvider.LatestChainInfo(); l < 2 { - lggr.Criticalf("RPC's finalized state is out of sync; %s %s", msgCannotDisable, msgDegradedState) - // We don't necessarily want to wait the full timeout to check again, we should - // check regularly and log noisily in this state - finalizedHeadsSub.ResetTimer(zombieNodeCheckInterval(noNewFinalizedBlocksTimeoutThreshold)) - continue - } - } - n.declareOutOfSync(syncStatusNoNewFinalizedHead) - return - case <-finalizedHeadsSub.Errors: - lggr.Errorw("Finalized heads subscription was terminated", "err", err) - n.declareUnreachable() - return - } - } -} - -func (n *node[CHAIN_ID, HEAD, RPC]) unsubscribeHealthChecks() { - n.stateMu.Lock() - for _, sub := range n.healthCheckSubs { - sub.Unsubscribe() - } - n.healthCheckSubs = []types.Subscription{} - n.stateMu.Unlock() -} - -type headSubscription[HEAD any] struct { - Heads <-chan HEAD - Errors <-chan error - NoNewHeads <-chan time.Time - - noNewHeadsTicker *time.Ticker - sub types.Subscription - cleanUpTasks []func() -} - -func (sub *headSubscription[HEAD]) ResetTimer(duration time.Duration) { - sub.noNewHeadsTicker.Reset(duration) -} - -func (sub *headSubscription[HEAD]) Unsubscribe() { - for _, doCleanUp := range sub.cleanUpTasks { - doCleanUp() - } -} - -func (n *node[CHAIN_ID, HEAD, PRC]) registerNewSubscription(ctx context.Context, lggr logger.SugaredLogger, - noNewDataThreshold time.Duration, newSub func(ctx context.Context) (<-chan HEAD, types.Subscription, error)) (headSubscription[HEAD], error) { - result := headSubscription[HEAD]{} - var err error - var sub types.Subscription - result.Heads, sub, err = newSub(ctx) - if err != nil { - return result, err - } - - result.Errors = sub.Err() - lggr.Debug("Successfully subscribed") - - result.sub = sub - n.stateMu.Lock() - n.healthCheckSubs = append(n.healthCheckSubs, sub) - n.stateMu.Unlock() - - result.cleanUpTasks = append(result.cleanUpTasks, sub.Unsubscribe) - - if noNewDataThreshold > 0 { - lggr.Debugw("Subscription liveness checking enabled") - result.noNewHeadsTicker = time.NewTicker(noNewDataThreshold) - result.NoNewHeads = result.noNewHeadsTicker.C - result.cleanUpTasks = append(result.cleanUpTasks, result.noNewHeadsTicker.Stop) - } else { - lggr.Debug("Subscription liveness checking disabled") - } - - return result, nil -} - -func (n *node[CHAIN_ID, HEAD, RPC]) onNewFinalizedHead(lggr logger.SugaredLogger, chainInfo *ChainInfo, latestFinalized HEAD) bool { - if !latestFinalized.IsValid() { - lggr.Warn("Latest finalized block is not valid") - return false - } - - latestFinalizedBN := latestFinalized.BlockNumber() - lggr.Debugw("Got latest finalized head", "latestFinalized", latestFinalized) - if latestFinalizedBN <= chainInfo.FinalizedBlockNumber { - lggr.Debugw("Ignoring previously seen finalized block number") - return false - } - - promPoolRPCNodeHighestFinalizedBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(latestFinalizedBN)) - chainInfo.FinalizedBlockNumber = latestFinalizedBN - return true -} - -func (n *node[CHAIN_ID, HEAD, RPC]) onNewHead(lggr logger.SugaredLogger, chainInfo *ChainInfo, head HEAD) bool { - if !head.IsValid() { - lggr.Warn("Latest head is not valid") - return false - } - - promPoolRPCNodeNumSeenBlocks.WithLabelValues(n.chainID.String(), n.name).Inc() - lggr.Debugw("Got head", "head", head) - lggr = lggr.With("latestReceivedBlockNumber", chainInfo.BlockNumber, "blockNumber", head.BlockNumber(), "nodeState", n.getCachedState()) - if head.BlockNumber() <= chainInfo.BlockNumber { - lggr.Debugw("Ignoring previously seen block number") - return false - } - - promPoolRPCNodeHighestSeenBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(head.BlockNumber())) - chainInfo.BlockNumber = head.BlockNumber() - - if !n.chainCfg.FinalityTagEnabled() { - latestFinalizedBN := max(head.BlockNumber()-int64(n.chainCfg.FinalityDepth()), 0) - if latestFinalizedBN > chainInfo.FinalizedBlockNumber { - promPoolRPCNodeHighestFinalizedBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(latestFinalizedBN)) - chainInfo.FinalizedBlockNumber = latestFinalizedBN - } - } - - return true -} - -const ( - msgReceivedBlock = "Received block for RPC node, waiting until back in-sync to mark as live again" - msgReceivedFinalizedBlock = "Received new finalized block for RPC node, waiting until back in-sync to mark as live again" - msgInSync = "RPC node back in sync" -) - -// isOutOfSyncWithPool returns outOfSync true if num or td is more than SyncThresold behind the best node. -// Always returns outOfSync false for SyncThreshold 0. -// liveNodes is only included when outOfSync is true. -func (n *node[CHAIN_ID, HEAD, RPC]) isOutOfSyncWithPool() (outOfSync bool, liveNodes int) { - if n.poolInfoProvider == nil { - n.lfcLog.Warn("skipping sync state against the pool - should only occur in tests") - return // skip for tests - } - threshold := n.nodePoolCfg.SyncThreshold() - if threshold == 0 { - return // disabled - } - // Check against best node - ln, ci := n.poolInfoProvider.LatestChainInfo() - localChainInfo, _ := n.rpc.GetInterceptedChainInfo() - mode := n.nodePoolCfg.SelectionMode() - switch mode { - case NodeSelectionModeHighestHead, NodeSelectionModeRoundRobin, NodeSelectionModePriorityLevel: - outOfSync = localChainInfo.BlockNumber < ci.BlockNumber-int64(threshold) - case NodeSelectionModeTotalDifficulty: - bigThreshold := big.NewInt(int64(threshold)) - outOfSync = localChainInfo.TotalDifficulty.Cmp(bigmath.Sub(ci.TotalDifficulty, bigThreshold)) < 0 - default: - panic("unrecognized NodeSelectionMode: " + mode) - } - - if outOfSync && n.getCachedState() == nodeStateAlive { - n.lfcLog.Errorw("RPC endpoint has fallen behind", "blockNumber", localChainInfo.BlockNumber, "bestLatestBlockNumber", ci.BlockNumber, "totalDifficulty", localChainInfo.TotalDifficulty) - } - return outOfSync, ln -} - -// outOfSyncLoop takes an OutOfSync node and waits until isOutOfSync returns false to go back to live status -func (n *node[CHAIN_ID, HEAD, RPC]) outOfSyncLoop(syncIssues syncStatus) { - defer n.wg.Done() - ctx, cancel := n.newCtx() - defer cancel() - - { - // sanity check - state := n.getCachedState() - switch state { - case nodeStateOutOfSync: - case nodeStateClosed: - return - default: - panic(fmt.Sprintf("outOfSyncLoop can only run for node in OutOfSync state, got: %s", state)) - } - } - - outOfSyncAt := time.Now() - - // set logger name to OutOfSync or FinalizedBlockOutOfSync - lggr := logger.Sugared(logger.Named(n.lfcLog, n.getCachedState().String())).With("nodeState", n.getCachedState()) - lggr.Debugw("Trying to revive out-of-sync RPC node") - - // Need to redial since out-of-sync nodes are automatically disconnected - state := n.createVerifiedConn(ctx, lggr) - if state != nodeStateAlive { - n.declareState(state) - return - } - - noNewHeadsTimeoutThreshold := n.chainCfg.NodeNoNewHeadsThreshold() - headsSub, err := n.registerNewSubscription(ctx, lggr.With("subscriptionType", "heads"), - noNewHeadsTimeoutThreshold, n.rpc.SubscribeToHeads) - if err != nil { - lggr.Errorw("Failed to subscribe heads on out-of-sync RPC node", "err", err) - n.declareUnreachable() - return - } - - defer n.unsubscribeHealthChecks() - - lggr.Tracew("Successfully subscribed to heads feed on out-of-sync RPC node") - - noNewFinalizedBlocksTimeoutThreshold := n.chainCfg.NoNewFinalizedHeadsThreshold() - var finalizedHeadsSub headSubscription[HEAD] - if n.chainCfg.FinalityTagEnabled() { - finalizedHeadsSub, err = n.registerNewSubscription(ctx, lggr.With("subscriptionType", "finalizedHeads"), - noNewFinalizedBlocksTimeoutThreshold, n.rpc.SubscribeToFinalizedHeads) - if err != nil { - lggr.Errorw("Subscribe to finalized heads failed on out-of-sync RPC node", "err", err) - n.declareUnreachable() - return - } - - lggr.Tracew("Successfully subscribed to finalized heads feed on out-of-sync RPC node") - } - - _, localHighestChainInfo := n.rpc.GetInterceptedChainInfo() - for { - if syncIssues == syncStatusSynced { - // back in-sync! flip back into alive loop - lggr.Infow(fmt.Sprintf("%s: %s. Node was out-of-sync for %s", msgInSync, n.String(), time.Since(outOfSyncAt))) - n.declareInSync() - return - } - - select { - case <-ctx.Done(): - return - case head, open := <-headsSub.Heads: - if !open { - lggr.Errorw("Subscription channel unexpectedly closed", "nodeState", n.getCachedState()) - n.declareUnreachable() - return - } - - if !n.onNewHead(lggr, &localHighestChainInfo, head) { - continue - } - - // received a new head - clear NoNewHead flag - syncIssues &= ^syncStatusNoNewHead - if outOfSync, _ := n.isOutOfSyncWithPool(); !outOfSync { - // we caught up with the pool - clear NotInSyncWithPool flag - syncIssues &= ^syncStatusNotInSyncWithPool - } else { - // we've received new head, but lagging behind the pool, add NotInSyncWithPool flag to prevent false transition to alive - syncIssues |= syncStatusNotInSyncWithPool - } - - if noNewHeadsTimeoutThreshold > 0 { - headsSub.ResetTimer(noNewHeadsTimeoutThreshold) - } - - lggr.Debugw(msgReceivedBlock, "blockNumber", head.BlockNumber(), "blockDifficulty", head.BlockDifficulty(), "syncIssues", syncIssues) - case <-time.After(zombieNodeCheckInterval(noNewHeadsTimeoutThreshold)): - if n.poolInfoProvider != nil { - if l, _ := n.poolInfoProvider.LatestChainInfo(); l < 1 { - lggr.Criticalw("RPC endpoint is still out of sync, but there are no other available nodes. This RPC node will be forcibly moved back into the live pool in a degraded state", "syncIssues", syncIssues) - n.declareInSync() - return - } - } - case err := <-headsSub.Errors: - lggr.Errorw("Subscription was terminated", "err", err) - n.declareUnreachable() - return - case <-headsSub.NoNewHeads: - // we are not resetting the timer, as there is no need to add syncStatusNoNewHead until it's removed on new head. - syncIssues |= syncStatusNoNewHead - lggr.Debugw(fmt.Sprintf("No new heads received for %s. Node stays out-of-sync due to sync issues: %s", noNewHeadsTimeoutThreshold, syncIssues)) - case latestFinalized, open := <-finalizedHeadsSub.Heads: - if !open { - lggr.Errorw("Finalized heads subscription channel unexpectedly closed") - n.declareUnreachable() - return - } - if !latestFinalized.IsValid() { - lggr.Warn("Latest finalized block is not valid") - continue - } - - receivedNewHead := n.onNewFinalizedHead(lggr, &localHighestChainInfo, latestFinalized) - if !receivedNewHead { - continue - } - - // on new finalized head remove NoNewFinalizedHead flag from the mask - syncIssues &= ^syncStatusNoNewFinalizedHead - if noNewFinalizedBlocksTimeoutThreshold > 0 { - finalizedHeadsSub.ResetTimer(noNewFinalizedBlocksTimeoutThreshold) - } - - var highestSeen ChainInfo - if n.poolInfoProvider != nil { - highestSeen = n.poolInfoProvider.HighestUserObservations() - } - - lggr.Debugw(msgReceivedFinalizedBlock, "blockNumber", latestFinalized.BlockNumber(), "poolHighestBlockNumber", highestSeen.FinalizedBlockNumber, "syncIssues", syncIssues) - case err := <-finalizedHeadsSub.Errors: - lggr.Errorw("Finalized head subscription was terminated", "err", err) - n.declareUnreachable() - return - case <-finalizedHeadsSub.NoNewHeads: - // we are not resetting the timer, as there is no need to add syncStatusNoNewFinalizedHead until it's removed on new finalized head. - syncIssues |= syncStatusNoNewFinalizedHead - lggr.Debugw(fmt.Sprintf("No new finalized heads received for %s. Node stays out-of-sync due to sync issues: %s", noNewFinalizedBlocksTimeoutThreshold, syncIssues)) - } - } -} - -func (n *node[CHAIN_ID, HEAD, RPC]) unreachableLoop() { - defer n.wg.Done() - ctx, cancel := n.newCtx() - defer cancel() - - { - // sanity check - state := n.getCachedState() - switch state { - case nodeStateUnreachable: - case nodeStateClosed: - return - default: - panic(fmt.Sprintf("unreachableLoop can only run for node in Unreachable state, got: %s", state)) - } - } - - unreachableAt := time.Now() - - lggr := logger.Sugared(logger.Named(n.lfcLog, "Unreachable")) - lggr.Debugw("Trying to revive unreachable RPC node", "nodeState", n.getCachedState()) - - dialRetryBackoff := iutils.NewRedialBackoff() - - for { - select { - case <-ctx.Done(): - return - case <-time.After(dialRetryBackoff.Duration()): - lggr.Tracew("Trying to re-dial RPC node", "nodeState", n.getCachedState()) - - err := n.rpc.Dial(ctx) - if err != nil { - lggr.Errorw(fmt.Sprintf("Failed to redial RPC node; still unreachable: %v", err), "err", err, "nodeState", n.getCachedState()) - continue - } - - n.setState(nodeStateDialed) - - state := n.verifyConn(ctx, lggr) - switch state { - case nodeStateUnreachable: - n.setState(nodeStateUnreachable) - continue - case nodeStateAlive: - lggr.Infow(fmt.Sprintf("Successfully redialled and verified RPC node %s. Node was offline for %s", n.String(), time.Since(unreachableAt)), "nodeState", n.getCachedState()) - fallthrough - default: - n.declareState(state) - return - } - } - } -} - -func (n *node[CHAIN_ID, HEAD, RPC]) invalidChainIDLoop() { - defer n.wg.Done() - ctx, cancel := n.newCtx() - defer cancel() - - { - // sanity check - state := n.getCachedState() - switch state { - case nodeStateInvalidChainID: - case nodeStateClosed: - return - default: - panic(fmt.Sprintf("invalidChainIDLoop can only run for node in InvalidChainID state, got: %s", state)) - } - } - - invalidAt := time.Now() - - lggr := logger.Named(n.lfcLog, "InvalidChainID") - - // Need to redial since invalid chain ID nodes are automatically disconnected - state := n.createVerifiedConn(ctx, lggr) - if state != nodeStateInvalidChainID { - n.declareState(state) - return - } - - lggr.Debugw(fmt.Sprintf("Periodically re-checking RPC node %s with invalid chain ID", n.String()), "nodeState", n.getCachedState()) - - chainIDRecheckBackoff := iutils.NewRedialBackoff() - - for { - select { - case <-ctx.Done(): - return - case <-time.After(chainIDRecheckBackoff.Duration()): - state := n.verifyConn(ctx, lggr) - switch state { - case nodeStateInvalidChainID: - continue - case nodeStateAlive: - lggr.Infow(fmt.Sprintf("Successfully verified RPC node. Node was offline for %s", time.Since(invalidAt)), "nodeState", n.getCachedState()) - fallthrough - default: - n.declareState(state) - return - } - } - } -} - -func (n *node[CHAIN_ID, HEAD, RPC]) syncingLoop() { - defer n.wg.Done() - ctx, cancel := n.newCtx() - defer cancel() - - { - // sanity check - state := n.getCachedState() - switch state { - case nodeStateSyncing: - case nodeStateClosed: - return - default: - panic(fmt.Sprintf("syncingLoop can only run for node in NodeStateSyncing state, got: %s", state)) - } - } - - syncingAt := time.Now() - - lggr := logger.Sugared(logger.Named(n.lfcLog, "Syncing")) - lggr.Debugw(fmt.Sprintf("Periodically re-checking RPC node %s with syncing status", n.String()), "nodeState", n.getCachedState()) - // Need to redial since syncing nodes are automatically disconnected - state := n.createVerifiedConn(ctx, lggr) - if state != nodeStateSyncing { - n.declareState(state) - return - } - - recheckBackoff := iutils.NewRedialBackoff() - - for { - select { - case <-ctx.Done(): - return - case <-time.After(recheckBackoff.Duration()): - lggr.Tracew("Trying to recheck if the node is still syncing", "nodeState", n.getCachedState()) - isSyncing, err := n.rpc.IsSyncing(ctx) - if err != nil { - lggr.Errorw("Unexpected error while verifying RPC node synchronization status", "err", err, "nodeState", n.getCachedState()) - n.declareUnreachable() - return - } - - if isSyncing { - lggr.Errorw("Verification failed: Node is syncing", "nodeState", n.getCachedState()) - continue - } - - lggr.Infow(fmt.Sprintf("Successfully verified RPC node. Node was syncing for %s", time.Since(syncingAt)), "nodeState", n.getCachedState()) - n.declareAlive() - return - } - } -} diff --git a/common/client/node_lifecycle_test.go b/common/client/node_lifecycle_test.go deleted file mode 100644 index 39c39e318ef..00000000000 --- a/common/client/node_lifecycle_test.go +++ /dev/null @@ -1,1983 +0,0 @@ -package client - -import ( - "errors" - "fmt" - "math/big" - "sync" - "sync/atomic" - "testing" - - "github.com/cometbft/cometbft/libs/rand" - prom "github.com/prometheus/client_model/go" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - - clientMocks "github.com/smartcontractkit/chainlink/v2/common/client/mocks" - "github.com/smartcontractkit/chainlink/v2/common/types" - "github.com/smartcontractkit/chainlink/v2/common/types/mocks" -) - -func newSub(t *testing.T) *mocks.Subscription { - sub := mocks.NewSubscription(t) - sub.On("Err").Return((<-chan error)(nil)).Maybe() - sub.On("Unsubscribe") - return sub -} - -func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { - t.Parallel() - - newDialedNode := func(t *testing.T, opts testNodeOpts) testNode { - node := newTestNode(t, opts) - opts.rpc.On("Close").Return(nil) - - node.setState(nodeStateDialed) - return node - } - - t.Run("returns on closed", func(t *testing.T) { - node := newTestNode(t, testNodeOpts{}) - node.setState(nodeStateClosed) - node.wg.Add(1) - node.aliveLoop() - }) - t.Run("if initial subscribe fails, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - }) - defer func() { assert.NoError(t, node.close()) }() - - expectedError := errors.New("failed to subscribe to rpc") - rpc.On("SubscribeToHeads", mock.Anything).Return(nil, nil, expectedError).Once() - // might be called in unreachable loop - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("if remote RPC connection is closed transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - lggr: lggr, - }) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - defer func() { assert.NoError(t, node.close()) }() - - sub := mocks.NewSubscription(t) - errChan := make(chan error) - close(errChan) - sub.On("Err").Return((<-chan error)(errChan)).Once() - sub.On("Unsubscribe").Once() - rpc.On("SubscribeToHeads", mock.Anything).Return(nil, sub, nil).Once() - // might be called in unreachable loop - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Subscription was terminated") - assert.Equal(t, nodeStateUnreachable, node.State()) - }) - - newSubscribedNode := func(t *testing.T, opts testNodeOpts) testNode { - sub := newSub(t) - opts.rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() - return newDialedNode(t, opts) - } - t.Run("Stays alive and waits for signal", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{}, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Subscription liveness checking disabled") - tests.AssertLogEventually(t, observedLogs, "Polling disabled") - assert.Equal(t, nodeStateAlive, node.State()) - }) - t.Run("stays alive while below pollFailureThreshold and resets counter on success", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - const pollFailureThreshold = 3 - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{ - pollFailureThreshold: pollFailureThreshold, - pollInterval: tests.TestInterval, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - pollError := errors.New("failed to get ClientVersion") - // 1. Return error several times, but below threshold - rpc.On("Ping", mock.Anything).Return(pollError).Run(func(_ mock.Arguments) { - // stays healthy while below threshold - assert.Equal(t, nodeStateAlive, node.State()) - }).Times(pollFailureThreshold - 1) - // 2. Successful call that is expected to reset counter - rpc.On("Ping", mock.Anything).Return(nil).Once() - // 3. Return error. If we have not reset the timer, we'll transition to nonAliveState - rpc.On("Ping", mock.Anything).Return(pollError).Once() - // 4. Once during the call, check if node is alive - var ensuredAlive atomic.Bool - rpc.On("Ping", mock.Anything).Return(nil).Run(func(_ mock.Arguments) { - if ensuredAlive.Load() { - return - } - ensuredAlive.Store(true) - assert.Equal(t, nodeStateAlive, node.State()) - }).Once() - // redundant call to stay in alive state - rpc.On("Ping", mock.Anything).Return(nil) - node.declareAlive() - tests.AssertLogCountEventually(t, observedLogs, fmt.Sprintf("Poll failure, RPC endpoint %s failed to respond properly", node.String()), pollFailureThreshold) - tests.AssertLogCountEventually(t, observedLogs, "Ping successful", 2) - assert.True(t, ensuredAlive.Load(), "expected to ensure that node was alive") - }) - t.Run("with threshold poll failures, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - const pollFailureThreshold = 3 - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{ - pollFailureThreshold: pollFailureThreshold, - pollInterval: tests.TestInterval, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - pollError := errors.New("failed to get ClientVersion") - rpc.On("Ping", mock.Anything).Return(pollError) - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogCountEventually(t, observedLogs, fmt.Sprintf("Poll failure, RPC endpoint %s failed to respond properly", node.String()), pollFailureThreshold) - tests.AssertEventually(t, func() bool { - return nodeStateUnreachable == node.State() - }) - }) - t.Run("with threshold poll failures, but we are the last node alive, forcibly keeps it alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - const pollFailureThreshold = 3 - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{ - pollFailureThreshold: pollFailureThreshold, - pollInterval: tests.TestInterval, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ - BlockNumber: 20, - }).Once() - node.SetPoolChainInfoProvider(poolInfo) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: 20}, ChainInfo{BlockNumber: 20}) - pollError := errors.New("failed to get ClientVersion") - rpc.On("Ping", mock.Anything).Return(pollError) - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("RPC endpoint failed to respond to %d consecutive polls", pollFailureThreshold)) - assert.Equal(t, nodeStateAlive, node.State()) - }) - t.Run("when behind more than SyncThreshold, transitions to out of sync", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - const syncThreshold = 10 - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{ - pollInterval: tests.TestInterval, - syncThreshold: syncThreshold, - selectionMode: NodeSelectionModeRoundRobin, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - rpc.On("Ping", mock.Anything).Return(nil) - const mostRecentBlock = 20 - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: mostRecentBlock}, ChainInfo{BlockNumber: 30}) - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(10, ChainInfo{ - BlockNumber: syncThreshold + mostRecentBlock + 1, - TotalDifficulty: big.NewInt(10), - }) - node.SetPoolChainInfoProvider(poolInfo) - // tries to redial in outOfSync - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateOutOfSync, node.State()) - }).Once() - rpc.On("Close").Maybe() - rpc.On("Dial", mock.Anything).Run(func(_ mock.Arguments) { - require.Equal(t, nodeStateOutOfSync, node.State()) - }).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Dial failed: Node is unreachable") - }) - t.Run("when behind more than SyncThreshold but we are the last live node, forcibly stays alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - const syncThreshold = 10 - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{ - pollInterval: tests.TestInterval, - syncThreshold: syncThreshold, - selectionMode: NodeSelectionModeRoundRobin, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - rpc.On("Ping", mock.Anything).Return(nil) - const mostRecentBlock = 20 - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: mostRecentBlock}, ChainInfo{BlockNumber: 30}) - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ - BlockNumber: syncThreshold + mostRecentBlock + 1, - TotalDifficulty: big.NewInt(10), - }) - node.SetPoolChainInfoProvider(poolInfo) - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("RPC endpoint has fallen behind; %s %s", msgCannotDisable, msgDegradedState)) - }) - t.Run("when behind but SyncThreshold=0, stay alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{ - pollInterval: tests.TestInterval, - syncThreshold: 0, - selectionMode: NodeSelectionModeRoundRobin, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - rpc.On("Ping", mock.Anything).Return(nil) - const mostRecentBlock = 20 - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: mostRecentBlock}, ChainInfo{BlockNumber: 30}) - node.declareAlive() - tests.AssertLogCountEventually(t, observedLogs, "Ping successful", 2) - assert.Equal(t, nodeStateAlive, node.State()) - }) - t.Run("when no new heads received for threshold, transitions to out of sync", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{ - NoNewHeadsThresholdVal: tests.TestInterval, - }, - rpc: rpc, - }) - defer func() { assert.NoError(t, node.close()) }() - // tries to redial in outOfSync - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateOutOfSync, node.State()) - }).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertEventually(t, func() bool { - // right after outOfSync we'll transfer to unreachable due to returned error on Dial - // we check that we were in out of sync state on first Dial call - return node.State() == nodeStateUnreachable - }) - }) - t.Run("when no new heads received for threshold but we are the last live node, forcibly stays alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{}, - lggr: lggr, - chainConfig: clientMocks.ChainConfig{ - NoNewHeadsThresholdVal: tests.TestInterval, - }, - rpc: rpc, - }) - defer func() { assert.NoError(t, node.close()) }() - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ - BlockNumber: 20, - TotalDifficulty: big.NewInt(10), - }).Once() - node.SetPoolChainInfoProvider(poolInfo) - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("RPC endpoint detected out of sync; %s %s", msgCannotDisable, msgDegradedState)) - assert.Equal(t, nodeStateAlive, node.State()) - }) - - t.Run("rpc closed head channel", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - sub := newSub(t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - ch := make(chan Head) - rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { - close(ch) - }).Return((<-chan Head)(ch), sub, nil).Once() - lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) - node := newDialedNode(t, testNodeOpts{ - lggr: lggr, - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{ - NoNewHeadsThresholdVal: tests.TestInterval, - }, - rpc: rpc, - }) - defer func() { assert.NoError(t, node.close()) }() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Subscription channel unexpectedly closed") - assert.Equal(t, nodeStateUnreachable, node.State()) - }) - t.Run("If finality tag is not enabled updates finalized block metric using finality depth and latest head", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - sub := newSub(t) - const blockNumber = 1000 - const finalityDepth = 10 - const expectedBlock = 990 - ch := make(chan Head) - rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - go writeHeads(t, ch, head{BlockNumber: blockNumber - 1}, head{BlockNumber: blockNumber}, head{BlockNumber: blockNumber - 1}) - }).Return((<-chan Head)(ch), sub, nil).Once() - name := "node-" + rand.Str(5) - node := newDialedNode(t, testNodeOpts{ - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{FinalityDepthVal: finalityDepth}, - rpc: rpc, - name: name, - chainID: big.NewInt(1), - }) - defer func() { assert.NoError(t, node.close()) }() - node.declareAlive() - tests.AssertEventually(t, func() bool { - metric, err := promPoolRPCNodeHighestFinalizedBlock.GetMetricWithLabelValues(big.NewInt(1).String(), name) - require.NoError(t, err) - var m = &prom.Metric{} - require.NoError(t, metric.Write(m)) - return float64(expectedBlock) == m.Gauge.GetValue() - }) - }) - t.Run("If fails to subscribe to latest finalized blocks, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - sub := newSub(t) - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() - expectedError := errors.New("failed to subscribe to finalized heads") - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(nil, sub, expectedError).Once() - lggr := logger.Test(t) - node := newDialedNode(t, testNodeOpts{ - config: testNodeConfig{ - finalizedBlockPollInterval: tests.TestInterval, - }, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - node.declareAlive() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("Logs warning if latest finalized block is not valid", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - sub := newSub(t) - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() - ch := make(chan Head, 1) - head := newMockHead(t) - head.On("IsValid").Return(false) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Run(func(args mock.Arguments) { - ch <- head - }).Return((<-chan Head)(ch), sub, nil).Once() - - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Latest finalized block is not valid") - }) - t.Run("On new finalized block updates corresponding metric", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - const expectedBlock = 1101 - const finalityDepth = 10 - ch := make(chan Head) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), newSub(t), nil).Once() - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - name := "node-" + rand.Str(5) - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{ - FinalityDepthVal: finalityDepth, - IsFinalityTagEnabled: true, - }, - rpc: rpc, - name: name, - chainID: big.NewInt(1), - }) - defer func() { assert.NoError(t, node.close()) }() - node.declareAlive() - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - writeHeads(t, ch, head{BlockNumber: expectedBlock - 1}, head{BlockNumber: expectedBlock}, head{BlockNumber: expectedBlock - 1}) - }() - tests.AssertEventually(t, func() bool { - metric, err := promPoolRPCNodeHighestFinalizedBlock.GetMetricWithLabelValues(big.NewInt(1).String(), name) - require.NoError(t, err) - var m = &prom.Metric{} - require.NoError(t, metric.Write(m)) - return float64(expectedBlock) == m.Gauge.GetValue() - }) - }) - t.Run("If finalized heads channel is closed, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - ch := make(chan Head) - close(ch) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), newSub(t), nil).Once() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newSubscribedNode(t, testNodeOpts{ - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Finalized heads subscription channel unexpectedly closed") - tests.AssertEventually(t, func() bool { - return nodeStateUnreachable == node.State() - }) - }) - t.Run("when no new finalized heads received for threshold, transitions to out of sync", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - ch := make(chan Head, 1) - ch <- head{BlockNumber: 10}.ToMockHead(t) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), newSub(t), nil).Once() - lggr, observed := logger.TestObserved(t, zap.DebugLevel) - noNewFinalizedHeadsThreshold := tests.TestInterval - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{ - NoNewFinalizedHeadsThresholdVal: noNewFinalizedHeadsThreshold, - IsFinalityTagEnabled: true, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - // tries to redial in outOfSync - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateOutOfSync, node.State()) - }).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogEventually(t, observed, fmt.Sprintf("RPC's finalized state is out of sync; no new finalized heads received for %s (last finalized head received was 10)", noNewFinalizedHeadsThreshold)) - tests.AssertEventually(t, func() bool { - // right after outOfSync we'll transfer to unreachable due to returned error on Dial - // we check that we were in out of sync state on first Dial call - return node.State() == nodeStateUnreachable - }) - }) - t.Run("when no new finalized heads received for threshold but we are the last live node, forcibly stays alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(make(<-chan Head), newSub(t), nil).Once() - lggr, observed := logger.TestObserved(t, zap.DebugLevel) - noNewFinalizedHeadsThreshold := tests.TestInterval - node := newSubscribedNode(t, testNodeOpts{ - config: testNodeConfig{}, - chainConfig: clientMocks.ChainConfig{ - NoNewFinalizedHeadsThresholdVal: noNewFinalizedHeadsThreshold, - IsFinalityTagEnabled: true, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ - BlockNumber: 20, - TotalDifficulty: big.NewInt(10), - }).Once() - node.SetPoolChainInfoProvider(poolInfo) - node.declareAlive() - tests.AssertLogEventually(t, observed, fmt.Sprintf("RPC's finalized state is out of sync; %s %s", msgCannotDisable, msgDegradedState)) - assert.Equal(t, nodeStateAlive, node.State()) - }) - t.Run("If finalized subscription returns an error, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - sub := mocks.NewSubscription(t) - errCh := make(chan error, 1) - errCh <- errors.New("subscription failed") - sub.On("Err").Return((<-chan error)(errCh)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(nil), sub, nil).Once() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newSubscribedNode(t, testNodeOpts{ - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - rpc: rpc, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Finalized heads subscription was terminated") - tests.AssertEventually(t, func() bool { - return nodeStateUnreachable == node.State() - }) - }) -} - -type head struct { - BlockNumber int64 - BlockDifficulty *big.Int -} - -func (h head) ToMockHead(t *testing.T) *mockHead { - m := newMockHead(t) - m.On("BlockNumber").Return(h.BlockNumber).Maybe() - m.On("BlockDifficulty").Return(h.BlockDifficulty).Maybe() - m.On("IsValid").Return(true).Maybe() - return m -} - -func writeHeads(t *testing.T, ch chan<- Head, heads ...head) { - for _, head := range heads { - h := head.ToMockHead(t) - select { - case ch <- h: - case <-tests.Context(t).Done(): - return - } - } -} - -func setupRPCForAliveLoop(t *testing.T, rpc *mockRPCClient[types.ID, Head]) { - rpc.On("Dial", mock.Anything).Return(nil).Maybe() - aliveSubscription := mocks.NewSubscription(t) - aliveSubscription.On("Err").Return(nil).Maybe() - aliveSubscription.On("Unsubscribe").Maybe() - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), aliveSubscription, nil).Maybe() - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(make(<-chan Head), aliveSubscription, nil).Maybe() - rpc.On("SetAliveLoopSub", mock.Anything).Maybe() - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Maybe() -} - -func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { - t.Parallel() - - newAliveNode := func(t *testing.T, opts testNodeOpts) testNode { - node := newTestNode(t, opts) - opts.rpc.On("Close").Return(nil) - node.setState(nodeStateAlive) - return node - } - - t.Run("returns on closed", func(t *testing.T) { - t.Parallel() - node := newTestNode(t, testNodeOpts{}) - node.setState(nodeStateClosed) - node.wg.Add(1) - node.outOfSyncLoop(syncStatusNotInSyncWithPool) - }) - t.Run("on old blocks stays outOfSync and returns on close", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr := logger.Test(t) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: 0}, ChainInfo{BlockNumber: 13}).Once() - - outOfSyncSubscription := mocks.NewSubscription(t) - outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) - outOfSyncSubscription.On("Unsubscribe").Once() - heads := []head{{BlockNumber: 7}, {BlockNumber: 11}, {BlockNumber: 13}} - ch := make(chan Head) - var wg sync.WaitGroup - wg.Add(1) - rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { - go func() { - defer wg.Done() - writeHeads(t, ch, heads...) - }() - }).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() - - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - - node.declareOutOfSync(syncStatusNoNewHead) - // wait until all heads are consumed - wg.Wait() - assert.Equal(t, nodeStateOutOfSync, node.State()) - }) - t.Run("if initial dial fails, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - }) - defer func() { assert.NoError(t, node.close()) }() - - expectedError := errors.New("failed to dial rpc") - // might be called again in unreachable loop, so no need to set once - rpc.On("Dial", mock.Anything).Return(expectedError) - - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("if fail to get chainID, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - chainID := types.RandomID() - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: chainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(chainID, nil) - // for out-of-sync - rpc.On("Dial", mock.Anything).Return(nil).Once() - // for unreachable - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - sub := mocks.NewSubscription(t) - errChan := make(chan error, 1) - errChan <- errors.New("subscription was terminate") - sub.On("Err").Return((<-chan error)(errChan)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - - expectedError := errors.New("failed to get chain ID") - // might be called multiple times - rpc.On("ChainID", mock.Anything).Return(types.NewIDFromInt(0), expectedError) - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("if chainID does not match, transitions to invalidChainID", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - // one for out-of-sync & one for invalid chainID - rpc.On("Dial", mock.Anything).Return(nil).Twice() - - // might be called multiple times - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil) - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateInvalidChainID - }) - }) - t.Run("if syncing, transitions to syncing", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - - // might be called multiple times - rpc.On("IsSyncing", mock.Anything).Return(true, nil) - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateSyncing - }) - }) - t.Run("if fails to fetch syncing status, transitions to unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - // one for out-of-sync - rpc.On("Dial", mock.Anything).Return(nil).Once() - - // for unreachable - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - // might be called multiple times - rpc.On("IsSyncing", mock.Anything).Return(false, errors.New("failed to check syncing")) - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("if fails to subscribe, becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - expectedError := errors.New("failed to subscribe") - rpc.On("SubscribeToHeads", mock.Anything).Return(nil, nil, expectedError).Once() - - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on subscription termination becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - sub := mocks.NewSubscription(t) - errChan := make(chan error, 1) - errChan <- errors.New("subscription was terminate") - sub.On("Err").Return((<-chan error)(errChan)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, "Subscription was terminated") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("becomes unreachable if head channel is closed", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - - sub := newSub(t) - ch := make(chan Head) - rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { - close(ch) - }).Return((<-chan Head)(ch), sub, nil).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, "Subscription channel unexpectedly closed") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("becomes alive if it receives a newer head", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - outOfSyncSubscription := mocks.NewSubscription(t) - outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) - outOfSyncSubscription.On("Unsubscribe").Once() - const highestBlock = 1000 - ch := make(chan Head) - rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { - go writeHeads(t, ch, head{BlockNumber: highestBlock - 1}, head{BlockNumber: highestBlock}, head{BlockNumber: highestBlock + 1}) - }).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: highestBlock}, ChainInfo{BlockNumber: highestBlock}) - setupRPCForAliveLoop(t, rpc) - - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, msgReceivedBlock) - tests.AssertLogEventually(t, observedLogs, msgInSync) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) - t.Run("becomes alive if there is no other nodes", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newAliveNode(t, testNodeOpts{ - chainConfig: clientMocks.ChainConfig{ - NoNewHeadsThresholdVal: tests.TestInterval, - }, - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(0, ChainInfo{ - BlockNumber: 100, - TotalDifficulty: big.NewInt(200), - }) - node.SetPoolChainInfoProvider(poolInfo) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - outOfSyncSubscription := mocks.NewSubscription(t) - outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) - outOfSyncSubscription.On("Unsubscribe").Once() - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), outOfSyncSubscription, nil).Once() - setupRPCForAliveLoop(t, rpc) - - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, "RPC endpoint is still out of sync, but there are no other available nodes. This RPC node will be forcibly moved back into the live pool in a degraded state") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) - t.Run("Stays out-of-sync if received new head, but lags behind pool", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newAliveNode(t, testNodeOpts{ - chainConfig: clientMocks.ChainConfig{ - NoNewHeadsThresholdVal: tests.TestInterval, - }, - config: testNodeConfig{ - syncThreshold: 1, - selectionMode: NodeSelectionModeHighestHead, - }, - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - poolInfo := newMockPoolChainInfoProvider(t) - const highestBlock = 20 - poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ - BlockNumber: highestBlock * 2, - TotalDifficulty: big.NewInt(200), - }) - node.SetPoolChainInfoProvider(poolInfo) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{BlockNumber: highestBlock}) - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - outOfSyncSubscription := mocks.NewSubscription(t) - outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) - outOfSyncSubscription.On("Unsubscribe").Once() - ch := make(chan Head) - rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { - go writeHeads(t, ch, head{BlockNumber: highestBlock - 1}, head{BlockNumber: highestBlock}, head{BlockNumber: highestBlock + 1}) - }).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() - - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, msgReceivedBlock) - tests.AssertLogEventually(t, observedLogs, "No new heads received for") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateOutOfSync - }) - }) - - // creates RPC mock with all calls necessary to create heads subscription that won't produce any events - newRPCWithNoOpHeads := func(t *testing.T, chainID types.ID) *mockRPCClient[types.ID, Head] { - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(chainID, nil).Once() - sub := newSub(t) - rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() - return rpc - } - - t.Run("if fails to subscribe to finalized, becomes unreachable", func(t *testing.T) { - t.Parallel() - nodeChainID := types.RandomID() - rpc := newRPCWithNoOpHeads(t, nodeChainID) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(nil), nil, errors.New("failed to subscribe")).Once() - // unreachable - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on subscription termination becomes unreachable", func(t *testing.T) { - t.Parallel() - nodeChainID := types.RandomID() - rpc := newRPCWithNoOpHeads(t, nodeChainID) - lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - }) - defer func() { assert.NoError(t, node.close()) }() - - sub := mocks.NewSubscription(t) - errChan := make(chan error, 1) - errChan <- errors.New("subscription was terminate") - sub.On("Err").Return((<-chan error)(errChan)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - - // unreachable - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, "Finalized head subscription was terminated") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("becomes unreachable if head channel is closed", func(t *testing.T) { - t.Parallel() - nodeChainID := types.RandomID() - rpc := newRPCWithNoOpHeads(t, nodeChainID) - lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - }, - }) - defer func() { assert.NoError(t, node.close()) }() - - sub := newSub(t) - - ch := make(chan Head) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Run(func(args mock.Arguments) { - close(ch) - }).Return((<-chan Head)(ch), sub, nil).Once() - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) - // unreachable - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(syncStatusNoNewHead) - tests.AssertLogEventually(t, observedLogs, "Finalized heads subscription channel unexpectedly closed") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("becomes alive on new finalized block", func(t *testing.T) { - t.Parallel() - nodeChainID := types.RandomID() - rpc := newRPCWithNoOpHeads(t, nodeChainID) - lggr := logger.Test(t) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - NoNewFinalizedHeadsThresholdVal: tests.TestInterval, - }, - }) - defer func() { assert.NoError(t, node.close()) }() - - const highestBlock = 13 - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{FinalizedBlockNumber: highestBlock}, ChainInfo{FinalizedBlockNumber: highestBlock}) - - outOfSyncSubscription := mocks.NewSubscription(t) - outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) - outOfSyncSubscription.On("Unsubscribe").Once() - ch := make(chan Head) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() - - setupRPCForAliveLoop(t, rpc) - - node.declareOutOfSync(syncStatusNoNewFinalizedHead) - heads := []head{{BlockNumber: highestBlock - 1}, {BlockNumber: highestBlock}} - writeHeads(t, ch, heads...) - assert.Equal(t, nodeStateOutOfSync, node.State()) - writeHeads(t, ch, head{BlockNumber: highestBlock + 1}) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) - t.Run("adds finalized block is not increasing flag, if there is no new finalized heads for too long", func(t *testing.T) { - t.Parallel() - nodeChainID := types.RandomID() - rpc := newRPCWithNoOpHeads(t, nodeChainID) - lggr, observed := logger.TestObserved(t, zap.DebugLevel) - const noNewFinalizedHeads = tests.TestInterval - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - chainConfig: clientMocks.ChainConfig{ - IsFinalityTagEnabled: true, - NoNewFinalizedHeadsThresholdVal: noNewFinalizedHeads, - }, - }) - defer func() { assert.NoError(t, node.close()) }() - - const highestBlock = 13 - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{FinalizedBlockNumber: highestBlock}) - - outOfSyncSubscription := mocks.NewSubscription(t) - outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) - outOfSyncSubscription.On("Unsubscribe").Once() - ch := make(chan Head) - rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() - - node.declareOutOfSync(syncStatusNotInSyncWithPool) - heads := []head{{BlockNumber: highestBlock - 1}, {BlockNumber: highestBlock}} - writeHeads(t, ch, heads...) - assert.Equal(t, nodeStateOutOfSync, node.State()) - tests.AssertLogEventually(t, observed, fmt.Sprintf("No new finalized heads received for %s. Node stays "+ - "out-of-sync due to sync issues: NotInSyncWithRPCPool,NoNewFinalizedHead", noNewFinalizedHeads)) - }) -} - -func TestUnit_NodeLifecycle_unreachableLoop(t *testing.T) { - t.Parallel() - - newAliveNode := func(t *testing.T, opts testNodeOpts) testNode { - node := newTestNode(t, opts) - opts.rpc.On("Close").Return(nil) - - node.setState(nodeStateAlive) - return node - } - t.Run("returns on closed", func(t *testing.T) { - t.Parallel() - node := newTestNode(t, testNodeOpts{}) - node.setState(nodeStateClosed) - node.wg.Add(1) - node.unreachableLoop() - }) - t.Run("on failed redial, keeps trying", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")) - node.declareUnreachable() - tests.AssertLogCountEventually(t, observedLogs, "Failed to redial RPC node; still unreachable", 2) - }) - t.Run("on failed chainID verification, keep trying", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateDialed, node.State()) - }).Return(nodeChainID, errors.New("failed to get chain id")) - node.declareUnreachable() - tests.AssertLogCountEventually(t, observedLogs, "Failed to verify chain ID for node", 2) - }) - t.Run("on chain ID mismatch transitions to invalidChainID", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil) - - node.declareUnreachable() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateInvalidChainID - }) - }) - t.Run("on syncing status check failure, keeps trying", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateDialed, node.State()) - }).Return(nodeChainID, nil) - rpc.On("IsSyncing", mock.Anything).Return(false, errors.New("failed to check syncing status")) - node.declareUnreachable() - tests.AssertLogCountEventually(t, observedLogs, "Unexpected error while verifying RPC node synchronization status", 2) - }) - t.Run("on syncing, transitions to syncing state", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - rpc.On("IsSyncing", mock.Anything).Return(true, nil) - - setupRPCForAliveLoop(t, rpc) - - node.declareUnreachable() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateSyncing - }) - }) - t.Run("on successful verification becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - rpc.On("IsSyncing", mock.Anything).Return(false, nil) - setupRPCForAliveLoop(t, rpc) - - node.declareUnreachable() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) - t.Run("on successful verification without isSyncing becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newAliveNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - - setupRPCForAliveLoop(t, rpc) - - node.declareUnreachable() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) -} - -func TestUnit_NodeLifecycle_invalidChainIDLoop(t *testing.T) { - t.Parallel() - newDialedNode := func(t *testing.T, opts testNodeOpts) testNode { - node := newTestNode(t, opts) - opts.rpc.On("Close").Return(nil) - - node.setState(nodeStateDialed) - return node - } - t.Run("returns on closed", func(t *testing.T) { - t.Parallel() - node := newTestNode(t, testNodeOpts{}) - node.setState(nodeStateClosed) - node.wg.Add(1) - node.invalidChainIDLoop() - }) - t.Run("on invalid dial becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")) - rpc.On("Close") - - node.declareInvalidChainID() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on failed chainID call becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, errors.New("failed to get chain id")) - // once for chainID and maybe another one for unreachable - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - - node.declareInvalidChainID() - tests.AssertLogEventually(t, observedLogs, "Failed to verify chain ID for node") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on chainID mismatch keeps trying", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil) - - node.declareInvalidChainID() - tests.AssertLogCountEventually(t, observedLogs, "Failed to verify RPC node; remote endpoint returned the wrong chain ID", 2) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateInvalidChainID - }) - }) - t.Run("on successful verification without isSyncing becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - setupRPCForAliveLoop(t, rpc) - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - - node.declareInvalidChainID() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) - t.Run("on successful verification becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil).Once() - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - rpc.On("IsSyncing", mock.Anything).Return(false, nil).Once() - - setupRPCForAliveLoop(t, rpc) - - node.declareInvalidChainID() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) -} - -func TestUnit_NodeLifecycle_start(t *testing.T) { - t.Parallel() - - newNode := func(t *testing.T, opts testNodeOpts) testNode { - node := newTestNode(t, opts) - opts.rpc.On("Close").Return(nil) - - return node - } - t.Run("if fails on initial dial, becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")) - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertLogEventually(t, observedLogs, "Dial failed: Node is unreachable") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("if chainID verification fails, becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - rpc.On("ChainID", mock.Anything).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateDialed, node.State()) - }).Return(nodeChainID, errors.New("failed to get chain id")) - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertLogEventually(t, observedLogs, "Failed to verify chain ID for node") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on chain ID mismatch transitions to invalidChainID", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil) - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateInvalidChainID - }) - }) - t.Run("if syncing verification fails, becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - - rpc.On("ChainID", mock.Anything).Run(func(_ mock.Arguments) { - assert.Equal(t, nodeStateDialed, node.State()) - }).Return(nodeChainID, nil).Once() - rpc.On("IsSyncing", mock.Anything).Return(false, errors.New("failed to check syncing status")) - rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")) - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertLogEventually(t, observedLogs, "Unexpected error while verifying RPC node synchronization status") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on isSyncing transitions to syncing", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil) - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - rpc.On("IsSyncing", mock.Anything).Return(true, nil) - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateSyncing - }) - }) - t.Run("on successful verification becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - config: testNodeConfig{nodeIsSyncingEnabled: true}, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - rpc.On("IsSyncing", mock.Anything).Return(false, nil) - setupRPCForAliveLoop(t, rpc) - - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) - t.Run("on successful verification without isSyncing becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) - setupRPCForAliveLoop(t, rpc) - - err := node.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) -} - -func TestUnit_NodeLifecycle_outOfSyncWithPool(t *testing.T) { - t.Parallel() - t.Run("skip if nLiveNodes is not configured", func(t *testing.T) { - node := newTestNode(t, testNodeOpts{}) - outOfSync, liveNodes := node.isOutOfSyncWithPool() - assert.Equal(t, false, outOfSync) - assert.Equal(t, 0, liveNodes) - }) - t.Run("skip if syncThreshold is not configured", func(t *testing.T) { - node := newTestNode(t, testNodeOpts{}) - poolInfo := newMockPoolChainInfoProvider(t) - node.SetPoolChainInfoProvider(poolInfo) - outOfSync, liveNodes := node.isOutOfSyncWithPool() - assert.Equal(t, false, outOfSync) - assert.Equal(t, 0, liveNodes) - }) - t.Run("panics on invalid selection mode", func(t *testing.T) { - node := newTestNode(t, testNodeOpts{ - config: testNodeConfig{syncThreshold: 1}, - }) - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(1, ChainInfo{}).Once() - node.SetPoolChainInfoProvider(poolInfo) - assert.Panics(t, func() { - _, _ = node.isOutOfSyncWithPool() - }) - }) - t.Run("block height selection mode", func(t *testing.T) { - const syncThreshold = 10 - const highestBlock = 1000 - const nodesNum = 20 - const totalDifficulty = 3000 - testCases := []struct { - name string - blockNumber int64 - outOfSync bool - }{ - { - name: "below threshold", - blockNumber: highestBlock - syncThreshold - 1, - outOfSync: true, - }, - { - name: "equal to threshold", - blockNumber: highestBlock - syncThreshold, - outOfSync: false, - }, - { - name: "equal to highest block", - blockNumber: highestBlock, - outOfSync: false, - }, - { - name: "higher than highest block", - blockNumber: highestBlock, - outOfSync: false, - }, - } - - for _, selectionMode := range []string{NodeSelectionModeHighestHead, NodeSelectionModeRoundRobin, NodeSelectionModePriorityLevel} { - node := newTestNode(t, testNodeOpts{ - config: testNodeConfig{ - syncThreshold: syncThreshold, - selectionMode: selectionMode, - }, - }) - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(nodesNum, ChainInfo{ - BlockNumber: highestBlock, - TotalDifficulty: big.NewInt(totalDifficulty), - }) - node.SetPoolChainInfoProvider(poolInfo) - for _, td := range []int64{totalDifficulty - syncThreshold - 1, totalDifficulty - syncThreshold, totalDifficulty, totalDifficulty + 1} { - for _, testCase := range testCases { - t.Run(fmt.Sprintf("%s: SelectionModeVal: %s: total difficulty: %d", testCase.name, selectionMode, td), func(t *testing.T) { - chainInfo := ChainInfo{BlockNumber: testCase.blockNumber, TotalDifficulty: big.NewInt(td)} - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(chainInfo, ChainInfo{}).Once() - node.rpc = rpc - outOfSync, liveNodes := node.isOutOfSyncWithPool() - assert.Equal(t, nodesNum, liveNodes) - assert.Equal(t, testCase.outOfSync, outOfSync) - }) - } - } - } - }) - t.Run("total difficulty selection mode", func(t *testing.T) { - const syncThreshold = 10 - const highestBlock = 1000 - const nodesNum = 20 - const totalDifficulty = 3000 - testCases := []struct { - name string - totalDifficulty int64 - outOfSync bool - }{ - { - name: "below threshold", - totalDifficulty: totalDifficulty - syncThreshold - 1, - outOfSync: true, - }, - { - name: "equal to threshold", - totalDifficulty: totalDifficulty - syncThreshold, - outOfSync: false, - }, - { - name: "equal to highest block", - totalDifficulty: totalDifficulty, - outOfSync: false, - }, - { - name: "higher than highest block", - totalDifficulty: totalDifficulty, - outOfSync: false, - }, - } - - node := newTestNode(t, testNodeOpts{ - config: testNodeConfig{ - syncThreshold: syncThreshold, - selectionMode: NodeSelectionModeTotalDifficulty, - }, - }) - - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("LatestChainInfo").Return(nodesNum, ChainInfo{ - BlockNumber: highestBlock, - TotalDifficulty: big.NewInt(totalDifficulty), - }) - node.SetPoolChainInfoProvider(poolInfo) - for _, hb := range []int64{highestBlock - syncThreshold - 1, highestBlock - syncThreshold, highestBlock, highestBlock + 1} { - for _, testCase := range testCases { - t.Run(fmt.Sprintf("%s: SelectionModeVal: %s: highest block: %d", testCase.name, NodeSelectionModeTotalDifficulty, hb), func(t *testing.T) { - chainInfo := ChainInfo{BlockNumber: hb, TotalDifficulty: big.NewInt(testCase.totalDifficulty)} - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(chainInfo, ChainInfo{}).Once() - node.rpc = rpc - outOfSync, liveNodes := node.isOutOfSyncWithPool() - assert.Equal(t, nodesNum, liveNodes) - assert.Equal(t, testCase.outOfSync, outOfSync) - }) - } - } - }) -} - -func TestUnit_NodeLifecycle_SyncingLoop(t *testing.T) { - t.Parallel() - newDialedNode := func(t *testing.T, opts testNodeOpts) testNode { - opts.config.nodeIsSyncingEnabled = true - node := newTestNode(t, opts) - opts.rpc.On("Close").Return(nil) - - node.setState(nodeStateDialed) - return node - } - t.Run("returns on closed", func(t *testing.T) { - t.Parallel() - node := newTestNode(t, testNodeOpts{}) - node.setState(nodeStateClosed) - node.wg.Add(1) - node.syncingLoop() - }) - t.Run("on invalid dial becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")) - - node.declareSyncing() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on failed chainID call becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, errors.New("failed to get chain id")) - - // once for syncing and maybe another one for unreachable - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - node.declareSyncing() - tests.AssertLogEventually(t, observedLogs, "Failed to verify chain ID for node") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on chainID mismatch transitions to invalidChainID", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.NewIDFromInt(10) - rpcChainID := types.NewIDFromInt(11) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Twice() - - rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil) - node.declareSyncing() - tests.AssertLogCountEventually(t, observedLogs, "Failed to verify RPC node; remote endpoint returned the wrong chain ID", 2) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateInvalidChainID - }) - }) - t.Run("on failed Syncing check - becomes unreachable", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - // first one is needed to enter internal loop - rpc.On("IsSyncing", mock.Anything).Return(true, nil).Once() - rpc.On("IsSyncing", mock.Anything).Return(false, errors.New("failed to check if syncing")).Once() - rpc.On("Dial", mock.Anything).Return(nil).Once() - rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() - - node.declareSyncing() - tests.AssertLogEventually(t, observedLogs, "Unexpected error while verifying RPC node synchronization status") - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateUnreachable - }) - }) - t.Run("on IsSyncing - keeps trying", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - lggr: lggr, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - rpc.On("IsSyncing", mock.Anything).Return(true, nil) - rpc.On("Dial", mock.Anything).Return(nil).Once() - - node.declareSyncing() - tests.AssertLogCountEventually(t, observedLogs, "Verification failed: Node is syncing", 2) - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateSyncing - }) - }) - t.Run("on successful verification becomes alive", func(t *testing.T) { - t.Parallel() - rpc := newMockRPCClient[types.ID, Head](t) - nodeChainID := types.RandomID() - node := newDialedNode(t, testNodeOpts{ - rpc: rpc, - chainID: nodeChainID, - }) - defer func() { assert.NoError(t, node.close()) }() - - rpc.On("Dial", mock.Anything).Return(nil).Once() - - rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - rpc.On("IsSyncing", mock.Anything).Return(true, nil).Once() - rpc.On("IsSyncing", mock.Anything).Return(false, nil).Once() - - setupRPCForAliveLoop(t, rpc) - - node.declareSyncing() - tests.AssertEventually(t, func() bool { - return node.State() == nodeStateAlive - }) - }) -} - -func TestNode_State(t *testing.T) { - t.Run("If not Alive, returns as is", func(t *testing.T) { - for state := nodeState(0); state < nodeStateLen; state++ { - if state == nodeStateAlive { - continue - } - - node := newTestNode(t, testNodeOpts{}) - node.setState(state) - assert.Equal(t, state, node.State()) - } - }) - t.Run("If repeatable read is not enforced, returns alive", func(t *testing.T) { - node := newTestNode(t, testNodeOpts{}) - node.setState(nodeStateAlive) - assert.Equal(t, nodeStateAlive, node.State()) - }) - testCases := []struct { - Name string - FinalizedBlockOffsetVal uint32 - IsFinalityTagEnabled bool - PoolChainInfo ChainInfo - NodeChainInfo ChainInfo - ExpectedState nodeState - }{ - { - Name: "If finality lag does not exceeds offset, returns alive (FinalityDepth)", - FinalizedBlockOffsetVal: 15, - PoolChainInfo: ChainInfo{ - BlockNumber: 20, - }, - NodeChainInfo: ChainInfo{ - BlockNumber: 5, - }, - ExpectedState: nodeStateAlive, - }, - { - Name: "If finality lag does not exceeds offset, returns alive (FinalityTag)", - FinalizedBlockOffsetVal: 15, - IsFinalityTagEnabled: true, - PoolChainInfo: ChainInfo{ - FinalizedBlockNumber: 20, - }, - NodeChainInfo: ChainInfo{ - FinalizedBlockNumber: 5, - }, - ExpectedState: nodeStateAlive, - }, - { - Name: "If finality lag exceeds offset, returns nodeStateFinalizedBlockOutOfSync (FinalityDepth)", - FinalizedBlockOffsetVal: 15, - PoolChainInfo: ChainInfo{ - BlockNumber: 20, - }, - NodeChainInfo: ChainInfo{ - BlockNumber: 4, - }, - ExpectedState: nodeStateFinalizedBlockOutOfSync, - }, - { - Name: "If finality lag exceeds offset, returns nodeStateFinalizedBlockOutOfSync (FinalityTag)", - FinalizedBlockOffsetVal: 15, - IsFinalityTagEnabled: true, - PoolChainInfo: ChainInfo{ - FinalizedBlockNumber: 20, - }, - NodeChainInfo: ChainInfo{ - FinalizedBlockNumber: 4, - }, - ExpectedState: nodeStateFinalizedBlockOutOfSync, - }, - } - for _, tc := range testCases { - t.Run(tc.Name, func(t *testing.T) { - rpc := newMockRPCClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(tc.NodeChainInfo, tc.PoolChainInfo).Once() - node := newTestNode(t, testNodeOpts{ - config: testNodeConfig{ - enforceRepeatableRead: true, - }, - chainConfig: clientMocks.ChainConfig{ - FinalizedBlockOffsetVal: tc.FinalizedBlockOffsetVal, - IsFinalityTagEnabled: tc.IsFinalityTagEnabled, - }, - rpc: rpc, - }) - poolInfo := newMockPoolChainInfoProvider(t) - poolInfo.On("HighestUserObservations").Return(tc.PoolChainInfo).Once() - node.SetPoolChainInfoProvider(poolInfo) - node.setState(nodeStateAlive) - assert.Equal(t, tc.ExpectedState, node.State()) - }) - } -} diff --git a/common/client/node_selector.go b/common/client/node_selector.go deleted file mode 100644 index 372b521bb1c..00000000000 --- a/common/client/node_selector.go +++ /dev/null @@ -1,43 +0,0 @@ -package client - -import ( - "fmt" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -const ( - NodeSelectionModeHighestHead = "HighestHead" - NodeSelectionModeRoundRobin = "RoundRobin" - NodeSelectionModeTotalDifficulty = "TotalDifficulty" - NodeSelectionModePriorityLevel = "PriorityLevel" -) - -type NodeSelector[ - CHAIN_ID types.ID, - RPC any, -] interface { - // Select returns a Node, or nil if none can be selected. - // Implementation must be thread-safe. - Select() Node[CHAIN_ID, RPC] - // Name returns the strategy name, e.g. "HighestHead" or "RoundRobin" - Name() string -} - -func newNodeSelector[ - CHAIN_ID types.ID, - RPC any, -](selectionMode string, nodes []Node[CHAIN_ID, RPC]) NodeSelector[CHAIN_ID, RPC] { - switch selectionMode { - case NodeSelectionModeHighestHead: - return NewHighestHeadNodeSelector[CHAIN_ID, RPC](nodes) - case NodeSelectionModeRoundRobin: - return NewRoundRobinSelector[CHAIN_ID, RPC](nodes) - case NodeSelectionModeTotalDifficulty: - return NewTotalDifficultyNodeSelector[CHAIN_ID, RPC](nodes) - case NodeSelectionModePriorityLevel: - return NewPriorityLevelNodeSelector[CHAIN_ID, RPC](nodes) - default: - panic(fmt.Sprintf("unsupported NodeSelectionMode: %s", selectionMode)) - } -} diff --git a/common/client/node_selector_highest_head.go b/common/client/node_selector_highest_head.go deleted file mode 100644 index 454584a77e1..00000000000 --- a/common/client/node_selector_highest_head.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -import ( - "math" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type highestHeadNodeSelector[ - CHAIN_ID types.ID, - RPC any, -] []Node[CHAIN_ID, RPC] - -func NewHighestHeadNodeSelector[ - CHAIN_ID types.ID, - RPC any, -](nodes []Node[CHAIN_ID, RPC]) NodeSelector[CHAIN_ID, RPC] { - return highestHeadNodeSelector[CHAIN_ID, RPC](nodes) -} - -func (s highestHeadNodeSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { - var highestHeadNumber int64 = math.MinInt64 - var highestHeadNodes []Node[CHAIN_ID, RPC] - for _, n := range s { - state, currentChainInfo := n.StateAndLatest() - currentHeadNumber := currentChainInfo.BlockNumber - if state == nodeStateAlive && currentHeadNumber >= highestHeadNumber { - if highestHeadNumber < currentHeadNumber { - highestHeadNumber = currentHeadNumber - highestHeadNodes = nil - } - highestHeadNodes = append(highestHeadNodes, n) - } - } - return firstOrHighestPriority(highestHeadNodes) -} - -func (s highestHeadNodeSelector[CHAIN_ID, RPC]) Name() string { - return NodeSelectionModeHighestHead -} diff --git a/common/client/node_selector_highest_head_test.go b/common/client/node_selector_highest_head_test.go deleted file mode 100644 index 9d85c688e05..00000000000 --- a/common/client/node_selector_highest_head_test.go +++ /dev/null @@ -1,176 +0,0 @@ -package client - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -func TestHighestHeadNodeSelectorName(t *testing.T) { - selector := newNodeSelector[types.ID, RPCClient[types.ID, Head]](NodeSelectionModeHighestHead, nil) - assert.Equal(t, selector.Name(), NodeSelectionModeHighestHead) -} - -func TestHighestHeadNodeSelector(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - - var nodes []Node[types.ID, nodeClient] - - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - if i == 0 { - // first node is out of sync - node.On("StateAndLatest").Return(nodeStateOutOfSync, ChainInfo{BlockNumber: int64(-1)}) - } else if i == 1 { - // second node is alive, LatestReceivedBlockNumber = 1 - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(1)}) - } else { - // third node is alive, LatestReceivedBlockNumber = 2 (best node) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(2)}) - } - node.On("Order").Maybe().Return(int32(1)) - nodes = append(nodes, node) - } - - selector := newNodeSelector[types.ID, nodeClient](NodeSelectionModeHighestHead, nodes) - assert.Same(t, nodes[2], selector.Select()) - - t.Run("stick to the same node", func(t *testing.T) { - node := newMockNode[types.ID, nodeClient](t) - // fourth node is alive, LatestReceivedBlockNumber = 2 (same as 3rd) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(2)}) - node.On("Order").Return(int32(1)) - nodes = append(nodes, node) - - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - assert.Same(t, nodes[2], selector.Select()) - }) - - t.Run("another best node", func(t *testing.T) { - node := newMockNode[types.ID, nodeClient](t) - // fifth node is alive, LatestReceivedBlockNumber = 3 (better than 3rd and 4th) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(3)}) - node.On("Order").Return(int32(1)) - nodes = append(nodes, node) - - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - assert.Same(t, nodes[4], selector.Select()) - }) - - t.Run("nodes never update latest block number", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(-1)}) - node1.On("Order").Return(int32(1)) - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(-1)}) - node2.On("Order").Return(int32(1)) - selector := newNodeSelector(NodeSelectionModeHighestHead, []Node[types.ID, nodeClient]{node1, node2}) - assert.Same(t, node1, selector.Select()) - }) -} - -func TestHighestHeadNodeSelector_None(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - if i == 0 { - // first node is out of sync - node.On("StateAndLatest").Return(nodeStateOutOfSync, ChainInfo{BlockNumber: int64(-1)}) - } else { - // others are unreachable - node.On("StateAndLatest").Return(nodeStateUnreachable, ChainInfo{BlockNumber: int64(-1)}) - } - nodes = append(nodes, node) - } - - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - assert.Nil(t, selector.Select()) -} - -func TestHighestHeadNodeSelectorWithOrder(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - t.Run("same head and order", func(t *testing.T) { - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(1)}) - node.On("Order").Return(int32(2)) - nodes = append(nodes, node) - } - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - // Should select the first node because all things are equal - assert.Same(t, nodes[0], selector.Select()) - }) - - t.Run("same head but different order", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(3)}) - node1.On("Order").Return(int32(3)) - - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(3)}) - node2.On("Order").Return(int32(1)) - - node3 := newMockNode[types.ID, nodeClient](t) - node3.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(3)}) - node3.On("Order").Return(int32(2)) - - nodes := []Node[types.ID, nodeClient]{node1, node2, node3} - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - // Should select the second node as it has the highest priority - assert.Same(t, nodes[1], selector.Select()) - }) - - t.Run("different head but same order", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(1)}) - node1.On("Order").Maybe().Return(int32(3)) - - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(2)}) - node2.On("Order").Maybe().Return(int32(3)) - - node3 := newMockNode[types.ID, nodeClient](t) - node3.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(3)}) - node3.On("Order").Return(int32(3)) - - nodes := []Node[types.ID, nodeClient]{node1, node2, node3} - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - // Should select the third node as it has the highest head - assert.Same(t, nodes[2], selector.Select()) - }) - - t.Run("different head and different order", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(10)}) - node1.On("Order").Maybe().Return(int32(3)) - - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(11)}) - node2.On("Order").Maybe().Return(int32(4)) - - node3 := newMockNode[types.ID, nodeClient](t) - node3.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(11)}) - node3.On("Order").Maybe().Return(int32(3)) - - node4 := newMockNode[types.ID, nodeClient](t) - node4.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: int64(10)}) - node4.On("Order").Maybe().Return(int32(1)) - - nodes := []Node[types.ID, nodeClient]{node1, node2, node3, node4} - selector := newNodeSelector(NodeSelectionModeHighestHead, nodes) - // Should select the third node as it has the highest head and will win the priority tie-breaker - assert.Same(t, nodes[2], selector.Select()) - }) -} diff --git a/common/client/node_selector_priority_level.go b/common/client/node_selector_priority_level.go deleted file mode 100644 index 6d6784fb216..00000000000 --- a/common/client/node_selector_priority_level.go +++ /dev/null @@ -1,123 +0,0 @@ -package client - -import ( - "math" - "sort" - "sync/atomic" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type priorityLevelNodeSelector[ - CHAIN_ID types.ID, - RPC any, -] struct { - nodes []Node[CHAIN_ID, RPC] - roundRobinCount []atomic.Uint32 -} - -type nodeWithPriority[ - CHAIN_ID types.ID, - RPC any, -] struct { - node Node[CHAIN_ID, RPC] - priority int32 -} - -func NewPriorityLevelNodeSelector[ - CHAIN_ID types.ID, - RPC any, -](nodes []Node[CHAIN_ID, RPC]) NodeSelector[CHAIN_ID, RPC] { - return &priorityLevelNodeSelector[CHAIN_ID, RPC]{ - nodes: nodes, - roundRobinCount: make([]atomic.Uint32, nrOfPriorityTiers(nodes)), - } -} - -func (s priorityLevelNodeSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { - nodes := s.getHighestPriorityAliveTier() - - if len(nodes) == 0 { - return nil - } - priorityLevel := nodes[len(nodes)-1].priority - - // NOTE: Inc returns the number after addition, so we must -1 to get the "current" counter - count := s.roundRobinCount[priorityLevel].Add(1) - 1 - idx := int(count % uint32(len(nodes))) - - return nodes[idx].node -} - -func (s priorityLevelNodeSelector[CHAIN_ID, RPC]) Name() string { - return NodeSelectionModePriorityLevel -} - -// getHighestPriorityAliveTier filters nodes that are not in state nodeStateAlive and -// returns only the highest tier of alive nodes -func (s priorityLevelNodeSelector[CHAIN_ID, RPC]) getHighestPriorityAliveTier() []nodeWithPriority[CHAIN_ID, RPC] { - var nodes []nodeWithPriority[CHAIN_ID, RPC] - for _, n := range s.nodes { - if n.State() == nodeStateAlive { - nodes = append(nodes, nodeWithPriority[CHAIN_ID, RPC]{n, n.Order()}) - } - } - - if len(nodes) == 0 { - return nil - } - - return removeLowerTiers(nodes) -} - -// removeLowerTiers take a slice of nodeWithPriority[CHAIN_ID, BLOCK_HASH, HEAD, RPC] and keeps only the highest tier -func removeLowerTiers[ - CHAIN_ID types.ID, - RPC any, -](nodes []nodeWithPriority[CHAIN_ID, RPC]) []nodeWithPriority[CHAIN_ID, RPC] { - sort.SliceStable(nodes, func(i, j int) bool { - return nodes[i].priority > nodes[j].priority - }) - - var nodes2 []nodeWithPriority[CHAIN_ID, RPC] - currentPriority := nodes[len(nodes)-1].priority - - for _, n := range nodes { - if n.priority == currentPriority { - nodes2 = append(nodes2, n) - } - } - - return nodes2 -} - -// nrOfPriorityTiers calculates the total number of priority tiers -func nrOfPriorityTiers[ - CHAIN_ID types.ID, - RPC any, -](nodes []Node[CHAIN_ID, RPC]) int32 { - highestPriority := int32(0) - for _, n := range nodes { - priority := n.Order() - if highestPriority < priority { - highestPriority = priority - } - } - return highestPriority + 1 -} - -// firstOrHighestPriority takes a list of nodes and returns the first one with the highest priority -func firstOrHighestPriority[ - CHAIN_ID types.ID, - RPC any, -](nodes []Node[CHAIN_ID, RPC]) Node[CHAIN_ID, RPC] { - hp := int32(math.MaxInt32) - var node Node[CHAIN_ID, RPC] - for _, n := range nodes { - if n.Order() < hp { - hp = n.Order() - node = n - } - } - return node -} diff --git a/common/client/node_selector_priority_level_test.go b/common/client/node_selector_priority_level_test.go deleted file mode 100644 index 67aac97be1b..00000000000 --- a/common/client/node_selector_priority_level_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/common/types" - - "github.com/stretchr/testify/assert" -) - -func TestPriorityLevelNodeSelectorName(t *testing.T) { - selector := newNodeSelector[types.ID, RPCClient[types.ID, Head]](NodeSelectionModePriorityLevel, nil) - assert.Equal(t, selector.Name(), NodeSelectionModePriorityLevel) -} - -func TestPriorityLevelNodeSelector(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - type testNode struct { - order int32 - state nodeState - } - type testCase struct { - name string - nodes []testNode - expect []int // indexes of the nodes expected to be returned by Select - } - - testCases := []testCase{ - { - name: "TwoNodesSameOrder: Highest Allowed Order", - nodes: []testNode{ - {order: 1, state: nodeStateAlive}, - {order: 1, state: nodeStateAlive}, - }, - expect: []int{0, 1, 0, 1, 0, 1}, - }, - { - name: "TwoNodesSameOrder: Lowest Allowed Order", - nodes: []testNode{ - {order: 100, state: nodeStateAlive}, - {order: 100, state: nodeStateAlive}, - }, - expect: []int{0, 1, 0, 1, 0, 1}, - }, - { - name: "NoneAvailable", - nodes: []testNode{ - {order: 1, state: nodeStateOutOfSync}, - {order: 1, state: nodeStateUnreachable}, - {order: 1, state: nodeStateUnreachable}, - }, - expect: []int{}, // no nodes should be selected - }, - { - name: "DifferentOrder", - nodes: []testNode{ - {order: 1, state: nodeStateAlive}, - {order: 2, state: nodeStateAlive}, - {order: 3, state: nodeStateAlive}, - }, - expect: []int{0, 0}, // only the highest order node should be selected - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - var nodes []Node[types.ID, nodeClient] - for _, tn := range tc.nodes { - node := newMockNode[types.ID, nodeClient](t) - node.On("State").Return(tn.state) - node.On("Order").Return(tn.order) - nodes = append(nodes, node) - } - - selector := newNodeSelector(NodeSelectionModePriorityLevel, nodes) - for _, idx := range tc.expect { - if idx >= len(nodes) { - t.Fatalf("Invalid node index %d in test case '%s'", idx, tc.name) - } - assert.Same(t, nodes[idx], selector.Select()) - } - - // Check for nil selection if expected slice is empty - if len(tc.expect) == 0 { - assert.Nil(t, selector.Select()) - } - }) - } -} diff --git a/common/client/node_selector_round_robin.go b/common/client/node_selector_round_robin.go deleted file mode 100644 index 18cea03ebd5..00000000000 --- a/common/client/node_selector_round_robin.go +++ /dev/null @@ -1,48 +0,0 @@ -package client - -import ( - "sync/atomic" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type roundRobinSelector[ - CHAIN_ID types.ID, - RPC any, -] struct { - nodes []Node[CHAIN_ID, RPC] - roundRobinCount atomic.Uint32 -} - -func NewRoundRobinSelector[ - CHAIN_ID types.ID, - RPC any, -](nodes []Node[CHAIN_ID, RPC]) NodeSelector[CHAIN_ID, RPC] { - return &roundRobinSelector[CHAIN_ID, RPC]{ - nodes: nodes, - } -} - -func (s *roundRobinSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { - var liveNodes []Node[CHAIN_ID, RPC] - for _, n := range s.nodes { - if n.State() == nodeStateAlive { - liveNodes = append(liveNodes, n) - } - } - - nNodes := len(liveNodes) - if nNodes == 0 { - return nil - } - - // NOTE: Inc returns the number after addition, so we must -1 to get the "current" counter - count := s.roundRobinCount.Add(1) - 1 - idx := int(count % uint32(nNodes)) - - return liveNodes[idx] -} - -func (s *roundRobinSelector[CHAIN_ID, RPC]) Name() string { - return NodeSelectionModeRoundRobin -} diff --git a/common/client/node_selector_round_robin_test.go b/common/client/node_selector_round_robin_test.go deleted file mode 100644 index 189b58da9ea..00000000000 --- a/common/client/node_selector_round_robin_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package client - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -func TestRoundRobinNodeSelectorName(t *testing.T) { - selector := newNodeSelector[types.ID, RPCClient[types.ID, Head]](NodeSelectionModeRoundRobin, nil) - assert.Equal(t, selector.Name(), NodeSelectionModeRoundRobin) -} - -func TestRoundRobinNodeSelector(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - if i == 0 { - // first node is out of sync - node.On("State").Return(nodeStateOutOfSync) - } else { - // second & third nodes are alive - node.On("State").Return(nodeStateAlive) - } - nodes = append(nodes, node) - } - - selector := newNodeSelector(NodeSelectionModeRoundRobin, nodes) - assert.Same(t, nodes[1], selector.Select()) - assert.Same(t, nodes[2], selector.Select()) - assert.Same(t, nodes[1], selector.Select()) - assert.Same(t, nodes[2], selector.Select()) -} - -func TestRoundRobinNodeSelector_None(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - if i == 0 { - // first node is out of sync - node.On("State").Return(nodeStateOutOfSync) - } else { - // others are unreachable - node.On("State").Return(nodeStateUnreachable) - } - nodes = append(nodes, node) - } - - selector := newNodeSelector(NodeSelectionModeRoundRobin, nodes) - assert.Nil(t, selector.Select()) -} diff --git a/common/client/node_selector_test.go b/common/client/node_selector_test.go deleted file mode 100644 index f652bfc50ad..00000000000 --- a/common/client/node_selector_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -func TestNodeSelector(t *testing.T) { - // rest of the tests are located in specific node selectors tests - t.Run("panics on unknown type", func(t *testing.T) { - assert.Panics(t, func() { - _ = newNodeSelector[types.ID, RPCClient[types.ID, Head]]("unknown", nil) - }) - }) -} diff --git a/common/client/node_selector_total_difficulty.go b/common/client/node_selector_total_difficulty.go deleted file mode 100644 index 3a4b9733f0d..00000000000 --- a/common/client/node_selector_total_difficulty.go +++ /dev/null @@ -1,53 +0,0 @@ -package client - -import ( - "math/big" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type totalDifficultyNodeSelector[ - CHAIN_ID types.ID, - RPC any, -] []Node[CHAIN_ID, RPC] - -func NewTotalDifficultyNodeSelector[ - CHAIN_ID types.ID, - RPC any, -](nodes []Node[CHAIN_ID, RPC]) NodeSelector[CHAIN_ID, RPC] { - return totalDifficultyNodeSelector[CHAIN_ID, RPC](nodes) -} - -func (s totalDifficultyNodeSelector[CHAIN_ID, RPC]) Select() Node[CHAIN_ID, RPC] { - // NodeNoNewHeadsThreshold may not be enabled, in this case all nodes have td == nil - var highestTD *big.Int - var nodes []Node[CHAIN_ID, RPC] - var aliveNodes []Node[CHAIN_ID, RPC] - - for _, n := range s { - state, currentChainInfo := n.StateAndLatest() - if state != nodeStateAlive { - continue - } - - currentTD := currentChainInfo.TotalDifficulty - aliveNodes = append(aliveNodes, n) - if currentTD != nil && (highestTD == nil || currentTD.Cmp(highestTD) >= 0) { - if highestTD == nil || currentTD.Cmp(highestTD) > 0 { - highestTD = currentTD - nodes = nil - } - nodes = append(nodes, n) - } - } - - // If all nodes have td == nil pick one from the nodes that are alive - if len(nodes) == 0 { - return firstOrHighestPriority(aliveNodes) - } - return firstOrHighestPriority(nodes) -} - -func (s totalDifficultyNodeSelector[CHAIN_ID, RPC]) Name() string { - return NodeSelectionModeTotalDifficulty -} diff --git a/common/client/node_selector_total_difficulty_test.go b/common/client/node_selector_total_difficulty_test.go deleted file mode 100644 index 7cd5867ddca..00000000000 --- a/common/client/node_selector_total_difficulty_test.go +++ /dev/null @@ -1,178 +0,0 @@ -package client - -import ( - "math/big" - "testing" - - "github.com/smartcontractkit/chainlink/v2/common/types" - - "github.com/stretchr/testify/assert" -) - -func TestTotalDifficultyNodeSelectorName(t *testing.T) { - selector := newNodeSelector[types.ID, RPCClient[types.ID, Head]](NodeSelectionModeTotalDifficulty, nil) - assert.Equal(t, selector.Name(), NodeSelectionModeTotalDifficulty) -} - -func TestTotalDifficultyNodeSelector(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - if i == 0 { - // first node is out of sync - node.On("StateAndLatest").Return(nodeStateOutOfSync, ChainInfo{BlockNumber: -1}) - } else if i == 1 { - // second node is alive - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(7)}) - } else { - // third node is alive and best - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 2, TotalDifficulty: big.NewInt(8)}) - } - node.On("Order").Maybe().Return(int32(1)) - nodes = append(nodes, node) - } - - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - assert.Same(t, nodes[2], selector.Select()) - - t.Run("stick to the same node", func(t *testing.T) { - node := newMockNode[types.ID, nodeClient](t) - // fourth node is alive (same as 3rd) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 2, TotalDifficulty: big.NewInt(8)}) - node.On("Order").Maybe().Return(int32(1)) - nodes = append(nodes, node) - - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - assert.Same(t, nodes[2], selector.Select()) - }) - - t.Run("another best node", func(t *testing.T) { - node := newMockNode[types.ID, nodeClient](t) - // fifth node is alive (better than 3rd and 4th) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 3, TotalDifficulty: big.NewInt(11)}) - node.On("Order").Maybe().Return(int32(1)) - nodes = append(nodes, node) - - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - assert.Same(t, nodes[4], selector.Select()) - }) - - t.Run("nodes never update latest block number", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: -1, TotalDifficulty: nil}) - node1.On("Order").Maybe().Return(int32(1)) - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: -1, TotalDifficulty: nil}) - node2.On("Order").Maybe().Return(int32(1)) - nodes := []Node[types.ID, nodeClient]{node1, node2} - - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - assert.Same(t, node1, selector.Select()) - }) -} - -func TestTotalDifficultyNodeSelector_None(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - if i == 0 { - // first node is out of sync - node.On("StateAndLatest").Return(nodeStateOutOfSync, ChainInfo{BlockNumber: -1, TotalDifficulty: nil}) - } else { - // others are unreachable - node.On("StateAndLatest").Return(nodeStateUnreachable, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(7)}) - } - nodes = append(nodes, node) - } - - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - assert.Nil(t, selector.Select()) -} - -func TestTotalDifficultyNodeSelectorWithOrder(t *testing.T) { - t.Parallel() - - type nodeClient RPCClient[types.ID, Head] - var nodes []Node[types.ID, nodeClient] - - t.Run("same td and order", func(t *testing.T) { - for i := 0; i < 3; i++ { - node := newMockNode[types.ID, nodeClient](t) - node.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(10)}) - node.On("Order").Return(int32(2)) - nodes = append(nodes, node) - } - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - // Should select the first node because all things are equal - assert.Same(t, nodes[0], selector.Select()) - }) - - t.Run("same td but different order", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 3, TotalDifficulty: big.NewInt(10)}) - node1.On("Order").Return(int32(3)) - - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 3, TotalDifficulty: big.NewInt(10)}) - node2.On("Order").Return(int32(1)) - - node3 := newMockNode[types.ID, nodeClient](t) - node3.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 3, TotalDifficulty: big.NewInt(10)}) - node3.On("Order").Return(int32(2)) - - nodes := []Node[types.ID, nodeClient]{node1, node2, node3} - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - // Should select the second node as it has the highest priority - assert.Same(t, nodes[1], selector.Select()) - }) - - t.Run("different td but same order", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(10)}) - node1.On("Order").Maybe().Return(int32(3)) - - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(11)}) - node2.On("Order").Maybe().Return(int32(3)) - - node3 := newMockNode[types.ID, nodeClient](t) - node3.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(12)}) - node3.On("Order").Return(int32(3)) - - nodes := []Node[types.ID, nodeClient]{node1, node2, node3} - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - // Should select the third node as it has the highest td - assert.Same(t, nodes[2], selector.Select()) - }) - - t.Run("different head and different order", func(t *testing.T) { - node1 := newMockNode[types.ID, nodeClient](t) - node1.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(100)}) - node1.On("Order").Maybe().Return(int32(4)) - - node2 := newMockNode[types.ID, nodeClient](t) - node2.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(110)}) - node2.On("Order").Maybe().Return(int32(5)) - - node3 := newMockNode[types.ID, nodeClient](t) - node3.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(110)}) - node3.On("Order").Maybe().Return(int32(1)) - - node4 := newMockNode[types.ID, nodeClient](t) - node4.On("StateAndLatest").Return(nodeStateAlive, ChainInfo{BlockNumber: 1, TotalDifficulty: big.NewInt(105)}) - node4.On("Order").Maybe().Return(int32(2)) - - nodes := []Node[types.ID, nodeClient]{node1, node2, node3, node4} - selector := newNodeSelector(NodeSelectionModeTotalDifficulty, nodes) - // Should select the third node as it has the highest td and will win the priority tie-breaker - assert.Same(t, nodes[2], selector.Select()) - }) -} diff --git a/common/client/node_test.go b/common/client/node_test.go deleted file mode 100644 index 6d98c2d9ea4..00000000000 --- a/common/client/node_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package client - -import ( - "net/url" - "testing" - "time" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - - clientMocks "github.com/smartcontractkit/chainlink/v2/common/client/mocks" - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type testNodeConfig struct { - pollFailureThreshold uint32 - pollInterval time.Duration - selectionMode string - syncThreshold uint32 - nodeIsSyncingEnabled bool - enforceRepeatableRead bool - finalizedBlockPollInterval time.Duration - deathDeclarationDelay time.Duration - newHeadsPollInterval time.Duration -} - -func (n testNodeConfig) NewHeadsPollInterval() time.Duration { - return n.newHeadsPollInterval -} - -func (n testNodeConfig) PollFailureThreshold() uint32 { - return n.pollFailureThreshold -} - -func (n testNodeConfig) PollInterval() time.Duration { - return n.pollInterval -} - -func (n testNodeConfig) SelectionMode() string { - return n.selectionMode -} - -func (n testNodeConfig) SyncThreshold() uint32 { - return n.syncThreshold -} - -func (n testNodeConfig) NodeIsSyncingEnabled() bool { - return n.nodeIsSyncingEnabled -} - -func (n testNodeConfig) FinalizedBlockPollInterval() time.Duration { - return n.finalizedBlockPollInterval -} - -func (n testNodeConfig) EnforceRepeatableRead() bool { - return n.enforceRepeatableRead -} - -func (n testNodeConfig) DeathDeclarationDelay() time.Duration { - return n.deathDeclarationDelay -} - -type testNode struct { - *node[types.ID, Head, RPCClient[types.ID, Head]] -} - -type testNodeOpts struct { - config testNodeConfig - chainConfig clientMocks.ChainConfig - lggr logger.Logger - wsuri *url.URL - httpuri *url.URL - name string - id int - chainID types.ID - nodeOrder int32 - rpc *mockRPCClient[types.ID, Head] - chainFamily string -} - -func newTestNode(t *testing.T, opts testNodeOpts) testNode { - if opts.lggr == nil { - opts.lggr = logger.Test(t) - } - - if opts.name == "" { - opts.name = "tes node" - } - - if opts.chainFamily == "" { - opts.chainFamily = "test node chain family" - } - - if opts.chainID == nil { - opts.chainID = types.RandomID() - } - - if opts.id == 0 { - opts.id = 42 - } - - nodeI := NewNode[types.ID, Head, RPCClient[types.ID, Head]](opts.config, opts.chainConfig, opts.lggr, - opts.wsuri, opts.httpuri, opts.name, opts.id, opts.chainID, opts.nodeOrder, opts.rpc, opts.chainFamily) - - return testNode{ - nodeI.(*node[types.ID, Head, RPCClient[types.ID, Head]]), - } -} diff --git a/common/client/poller.go b/common/client/poller.go deleted file mode 100644 index bdd3d36f16f..00000000000 --- a/common/client/poller.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -import ( - "context" - "time" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -// Poller is a component that polls a function at a given interval -// and delivers the result to a channel. It is used by multinode to poll -// for new heads and implements the Subscription interface. -type Poller[T any] struct { - services.Service - eng *services.Engine - - pollingInterval time.Duration - pollingFunc func(ctx context.Context) (T, error) - pollingTimeout time.Duration - channel chan<- T - errCh chan error -} - -// NewPoller creates a new Poller instance and returns a channel to receive the polled data -func NewPoller[ - T any, -](pollingInterval time.Duration, pollingFunc func(ctx context.Context) (T, error), pollingTimeout time.Duration, lggr logger.Logger) (Poller[T], <-chan T) { - channel := make(chan T) - p := Poller[T]{ - pollingInterval: pollingInterval, - pollingFunc: pollingFunc, - pollingTimeout: pollingTimeout, - channel: channel, - errCh: make(chan error), - } - p.Service, p.eng = services.Config{ - Name: "Poller", - Start: p.start, - Close: p.close, - }.NewServiceEngine(lggr) - return p, channel -} - -var _ types.Subscription = &Poller[any]{} - -func (p *Poller[T]) start(ctx context.Context) error { - p.eng.Go(p.pollingLoop) - return nil -} - -// Unsubscribe cancels the sending of events to the data channel -func (p *Poller[T]) Unsubscribe() { - _ = p.Close() -} - -func (p *Poller[T]) close() error { - close(p.errCh) - close(p.channel) - return nil -} - -func (p *Poller[T]) Err() <-chan error { - return p.errCh -} - -func (p *Poller[T]) pollingLoop(ctx context.Context) { - ticker := services.NewTicker(p.pollingInterval) // reduce possibility of sending two exactly the same request at once - defer ticker.Stop() - - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - // Set polling timeout - pollingCtx, cancelPolling := context.WithTimeout(ctx, p.pollingTimeout) - // Execute polling function - result, err := p.pollingFunc(pollingCtx) - cancelPolling() - if err != nil { - p.eng.Warnf("polling error: %v", err) - continue - } - // Send result to channel or block if channel is full - select { - case p.channel <- result: - case <-ctx.Done(): - return - } - } - } -} diff --git a/common/client/poller_test.go b/common/client/poller_test.go deleted file mode 100644 index 930b101751c..00000000000 --- a/common/client/poller_test.go +++ /dev/null @@ -1,194 +0,0 @@ -package client - -import ( - "context" - "fmt" - "math/big" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" -) - -func Test_Poller(t *testing.T) { - lggr := logger.Test(t) - - t.Run("Test multiple start", func(t *testing.T) { - ctx := tests.Context(t) - pollFunc := func(ctx context.Context) (Head, error) { - return nil, nil - } - - poller, _ := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - err := poller.Start(ctx) - require.NoError(t, err) - - err = poller.Start(ctx) - require.Error(t, err) - poller.Unsubscribe() - }) - - t.Run("Test polling for heads", func(t *testing.T) { - ctx := tests.Context(t) - // Mock polling function that returns a new value every time it's called - var pollNumber int - pollLock := sync.Mutex{} - pollFunc := func(ctx context.Context) (Head, error) { - pollLock.Lock() - defer pollLock.Unlock() - pollNumber++ - h := head{ - BlockNumber: int64(pollNumber), - BlockDifficulty: big.NewInt(int64(pollNumber)), - } - return h.ToMockHead(t), nil - } - - // Create poller and start to receive data - poller, channel := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - require.NoError(t, poller.Start(ctx)) - defer poller.Unsubscribe() - - // Receive updates from the poller - pollCount := 0 - pollMax := 50 - for ; pollCount < pollMax; pollCount++ { - h := <-channel - assert.Equal(t, int64(pollCount+1), h.BlockNumber()) - } - }) - - t.Run("Test polling errors", func(t *testing.T) { - ctx := tests.Context(t) - // Mock polling function that returns an error - var pollNumber int - pollLock := sync.Mutex{} - pollFunc := func(ctx context.Context) (Head, error) { - pollLock.Lock() - defer pollLock.Unlock() - pollNumber++ - return nil, fmt.Errorf("polling error %d", pollNumber) - } - - olggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - - // Create poller and subscribe to receive data - poller, _ := NewPoller[Head](time.Millisecond, pollFunc, time.Second, olggr) - require.NoError(t, poller.Start(ctx)) - defer poller.Unsubscribe() - - // Ensure that all errors were logged as expected - logsSeen := func() bool { - for pollCount := 0; pollCount < 50; pollCount++ { - numLogs := observedLogs.FilterMessage(fmt.Sprintf("polling error: polling error %d", pollCount+1)).Len() - if numLogs != 1 { - return false - } - } - return true - } - require.Eventually(t, logsSeen, tests.WaitTimeout(t), 100*time.Millisecond) - }) - - t.Run("Test polling timeout", func(t *testing.T) { - ctx := tests.Context(t) - pollFunc := func(ctx context.Context) (Head, error) { - if <-ctx.Done(); true { - return nil, ctx.Err() - } - return nil, nil - } - - // Set instant timeout - pollingTimeout := time.Duration(0) - - olggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - - // Create poller and subscribe to receive data - poller, _ := NewPoller[Head](time.Millisecond, pollFunc, pollingTimeout, olggr) - require.NoError(t, poller.Start(ctx)) - defer poller.Unsubscribe() - - // Ensure that timeout errors were logged as expected - logsSeen := func() bool { - return observedLogs.FilterMessage("polling error: context deadline exceeded").Len() >= 1 - } - require.Eventually(t, logsSeen, tests.WaitTimeout(t), 100*time.Millisecond) - }) - - t.Run("Test unsubscribe during polling", func(t *testing.T) { - ctx := tests.Context(t) - wait := make(chan struct{}) - closeOnce := sync.OnceFunc(func() { close(wait) }) - pollFunc := func(ctx context.Context) (Head, error) { - closeOnce() - // Block in polling function until context is cancelled - if <-ctx.Done(); true { - return nil, ctx.Err() - } - return nil, nil - } - - // Set long timeout - pollingTimeout := time.Minute - - olggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - - // Create poller and subscribe to receive data - poller, _ := NewPoller[Head](time.Millisecond, pollFunc, pollingTimeout, olggr) - require.NoError(t, poller.Start(ctx)) - - // Unsubscribe while blocked in polling function - <-wait - poller.Unsubscribe() - - // Ensure error was logged - logsSeen := func() bool { - return observedLogs.FilterMessage("polling error: context canceled").Len() >= 1 - } - require.Eventually(t, logsSeen, tests.WaitTimeout(t), 100*time.Millisecond) - }) -} - -func Test_Poller_Unsubscribe(t *testing.T) { - lggr := logger.Test(t) - pollFunc := func(ctx context.Context) (Head, error) { - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - h := head{ - BlockNumber: 0, - BlockDifficulty: big.NewInt(0), - } - return h.ToMockHead(t), nil - } - } - - t.Run("Test multiple unsubscribe", func(t *testing.T) { - ctx := tests.Context(t) - poller, channel := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - err := poller.Start(ctx) - require.NoError(t, err) - - <-channel - poller.Unsubscribe() - poller.Unsubscribe() - }) - - t.Run("Read channel after unsubscribe", func(t *testing.T) { - ctx := tests.Context(t) - poller, channel := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - err := poller.Start(ctx) - require.NoError(t, err) - - poller.Unsubscribe() - require.Equal(t, <-channel, nil) - }) -} diff --git a/common/client/send_only_node.go b/common/client/send_only_node.go deleted file mode 100644 index 0a1715fa191..00000000000 --- a/common/client/send_only_node.go +++ /dev/null @@ -1,183 +0,0 @@ -package client - -import ( - "context" - "fmt" - "net/url" - "sync" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type sendOnlyClient[ - CHAIN_ID types.ID, -] interface { - Close() - ChainID(context.Context) (CHAIN_ID, error) - Dial(ctx context.Context) error -} - -// SendOnlyNode represents one node used as a sendonly -type SendOnlyNode[ - CHAIN_ID types.ID, - RPC any, -] interface { - // Start may attempt to connect to the node, but should only return error for misconfiguration - never for temporary errors. - Start(context.Context) error - Close() error - - ConfiguredChainID() CHAIN_ID - RPC() RPC - - String() string - // State returns nodeState - State() nodeState - // Name is a unique identifier for this node. - Name() string -} - -// It only supports sending transactions -// It must use an http(s) url -type sendOnlyNode[ - CHAIN_ID types.ID, - RPC sendOnlyClient[CHAIN_ID], -] struct { - services.StateMachine - - stateMu sync.RWMutex // protects state* fields - state nodeState - - rpc RPC - uri url.URL - log logger.Logger - name string - chainID CHAIN_ID - chStop services.StopChan - wg sync.WaitGroup -} - -// NewSendOnlyNode returns a new sendonly node -func NewSendOnlyNode[ - CHAIN_ID types.ID, - RPC sendOnlyClient[CHAIN_ID], -]( - lggr logger.Logger, - httpuri url.URL, - name string, - chainID CHAIN_ID, - rpc RPC, -) SendOnlyNode[CHAIN_ID, RPC] { - s := new(sendOnlyNode[CHAIN_ID, RPC]) - s.name = name - s.log = logger.Named(logger.Named(lggr, "SendOnlyNode"), name) - s.log = logger.With(s.log, - "nodeTier", "sendonly", - ) - s.rpc = rpc - s.uri = httpuri - s.chainID = chainID - s.chStop = make(chan struct{}) - return s -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) Start(ctx context.Context) error { - return s.StartOnce(s.name, func() error { - s.start(ctx) - return nil - }) -} - -// Start setups up and verifies the sendonly node -// Should only be called once in a node's lifecycle -func (s *sendOnlyNode[CHAIN_ID, RPC]) start(startCtx context.Context) { - if s.State() != nodeStateUndialed { - panic(fmt.Sprintf("cannot dial node with state %v", s.state)) - } - - err := s.rpc.Dial(startCtx) - if err != nil { - promPoolRPCNodeTransitionsToUnusable.WithLabelValues(s.chainID.String(), s.name).Inc() - s.log.Errorw("Dial failed: SendOnly Node is unusable", "err", err) - s.setState(nodeStateUnusable) - return - } - s.setState(nodeStateDialed) - - if s.chainID.String() == "0" { - // Skip verification if chainID is zero - s.log.Warn("sendonly rpc ChainID verification skipped") - } else { - chainID, err := s.rpc.ChainID(startCtx) - if err != nil || chainID.String() != s.chainID.String() { - promPoolRPCNodeTransitionsToUnreachable.WithLabelValues(s.chainID.String(), s.name).Inc() - if err != nil { - promPoolRPCNodeTransitionsToUnreachable.WithLabelValues(s.chainID.String(), s.name).Inc() - s.log.Errorw(fmt.Sprintf("Verify failed: %v", err), "err", err) - s.setState(nodeStateUnreachable) - } else { - promPoolRPCNodeTransitionsToInvalidChainID.WithLabelValues(s.chainID.String(), s.name).Inc() - s.log.Errorf( - "sendonly rpc ChainID doesn't match local chain ID: RPC ID=%s, local ID=%s, node name=%s", - chainID.String(), - s.chainID.String(), - s.name, - ) - s.setState(nodeStateInvalidChainID) - } - // Since it has failed, spin up the verifyLoop that will keep - // retrying until success - s.wg.Add(1) - go s.verifyLoop() - return - } - } - - promPoolRPCNodeTransitionsToAlive.WithLabelValues(s.chainID.String(), s.name).Inc() - s.setState(nodeStateAlive) - s.log.Infow("Sendonly RPC Node is online", "nodeState", s.state) -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) Close() error { - return s.StopOnce(s.name, func() error { - s.rpc.Close() - close(s.chStop) - s.wg.Wait() - s.setState(nodeStateClosed) - return nil - }) -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { - return s.chainID -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) RPC() RPC { - return s.rpc -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) String() string { - return fmt.Sprintf("(%s)%s:%s", Secondary.String(), s.name, s.uri.Redacted()) -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) setState(state nodeState) (changed bool) { - s.stateMu.Lock() - defer s.stateMu.Unlock() - if s.state == state { - return false - } - s.state = state - return true -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) State() nodeState { - s.stateMu.RLock() - defer s.stateMu.RUnlock() - return s.state -} - -func (s *sendOnlyNode[CHAIN_ID, RPC]) Name() string { - return s.name -} diff --git a/common/client/send_only_node_lifecycle.go b/common/client/send_only_node_lifecycle.go deleted file mode 100644 index c66d267ed42..00000000000 --- a/common/client/send_only_node_lifecycle.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -import ( - "fmt" - "time" - - "github.com/smartcontractkit/chainlink/v2/common/internal/utils" -) - -// verifyLoop may only be triggered once, on Start, if initial chain ID check -// fails. -// -// It will continue checking until success and then exit permanently. -func (s *sendOnlyNode[CHAIN_ID, RPC]) verifyLoop() { - defer s.wg.Done() - ctx, cancel := s.chStop.NewCtx() - defer cancel() - - backoff := utils.NewRedialBackoff() - for { - select { - case <-ctx.Done(): - return - case <-time.After(backoff.Duration()): - } - chainID, err := s.rpc.ChainID(ctx) - if err != nil { - ok := s.IfStarted(func() { - if changed := s.setState(nodeStateUnreachable); changed { - promPoolRPCNodeTransitionsToUnreachable.WithLabelValues(s.chainID.String(), s.name).Inc() - } - }) - if !ok { - return - } - s.log.Errorw(fmt.Sprintf("Verify failed: %v", err), "err", err) - continue - } else if chainID.String() != s.chainID.String() { - ok := s.IfStarted(func() { - if changed := s.setState(nodeStateInvalidChainID); changed { - promPoolRPCNodeTransitionsToInvalidChainID.WithLabelValues(s.chainID.String(), s.name).Inc() - } - }) - if !ok { - return - } - s.log.Errorf( - "sendonly rpc ChainID doesn't match local chain ID: RPC ID=%s, local ID=%s, node name=%s", - chainID.String(), - s.chainID.String(), - s.name, - ) - - continue - } - ok := s.IfStarted(func() { - if changed := s.setState(nodeStateAlive); changed { - promPoolRPCNodeTransitionsToAlive.WithLabelValues(s.chainID.String(), s.name).Inc() - } - }) - if !ok { - return - } - s.log.Infow("Sendonly RPC Node is online", "nodeState", s.state) - return - } -} diff --git a/common/client/send_only_node_test.go b/common/client/send_only_node_test.go deleted file mode 100644 index 532946da48f..00000000000 --- a/common/client/send_only_node_test.go +++ /dev/null @@ -1,139 +0,0 @@ -package client - -import ( - "errors" - "fmt" - "net/url" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -func TestNewSendOnlyNode(t *testing.T) { - t.Parallel() - - urlFormat := "http://user:%s@testurl.com" - password := "pass" - u, err := url.Parse(fmt.Sprintf(urlFormat, password)) - require.NoError(t, err) - redacted := fmt.Sprintf(urlFormat, "xxxxx") - lggr := logger.Test(t) - name := "TestNewSendOnlyNode" - chainID := types.RandomID() - client := newMockSendOnlyClient[types.ID](t) - - node := NewSendOnlyNode(lggr, *u, name, chainID, client) - assert.NotNil(t, node) - - // Must contain name & url with redacted password - assert.Contains(t, node.String(), fmt.Sprintf("%s:%s", name, redacted)) - assert.Equal(t, node.ConfiguredChainID(), chainID) -} - -func TestStartSendOnlyNode(t *testing.T) { - t.Parallel() - t.Run("becomes unusable if initial dial fails", func(t *testing.T) { - t.Parallel() - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - client := newMockSendOnlyClient[types.ID](t) - client.On("Close").Once() - expectedError := errors.New("some http error") - client.On("Dial", mock.Anything).Return(expectedError).Once() - s := NewSendOnlyNode(lggr, url.URL{}, t.Name(), types.RandomID(), client) - - defer func() { assert.NoError(t, s.Close()) }() - err := s.Start(tests.Context(t)) - require.NoError(t, err) - - assert.Equal(t, nodeStateUnusable, s.State()) - tests.RequireLogMessage(t, observedLogs, "Dial failed: SendOnly Node is unusable") - }) - t.Run("Default ChainID(0) produces warn and skips checks", func(t *testing.T) { - t.Parallel() - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - client := newMockSendOnlyClient[types.ID](t) - client.On("Close").Once() - client.On("Dial", mock.Anything).Return(nil).Once() - s := NewSendOnlyNode(lggr, url.URL{}, t.Name(), types.NewIDFromInt(0), client) - - defer func() { assert.NoError(t, s.Close()) }() - err := s.Start(tests.Context(t)) - require.NoError(t, err) - - assert.Equal(t, nodeStateAlive, s.State()) - tests.RequireLogMessage(t, observedLogs, "sendonly rpc ChainID verification skipped") - }) - t.Run("Can recover from chainID verification failure", func(t *testing.T) { - t.Parallel() - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - client := newMockSendOnlyClient[types.ID](t) - client.On("Close").Once() - client.On("Dial", mock.Anything).Return(nil) - expectedError := errors.New("failed to get chain ID") - chainID := types.RandomID() - const failuresCount = 2 - client.On("ChainID", mock.Anything).Return(types.RandomID(), expectedError).Times(failuresCount) - client.On("ChainID", mock.Anything).Return(chainID, nil) - - s := NewSendOnlyNode(lggr, url.URL{}, t.Name(), chainID, client) - - defer func() { assert.NoError(t, s.Close()) }() - err := s.Start(tests.Context(t)) - require.NoError(t, err) - - assert.Equal(t, nodeStateUnreachable, s.State()) - tests.AssertLogCountEventually(t, observedLogs, fmt.Sprintf("Verify failed: %v", expectedError), failuresCount) - tests.AssertEventually(t, func() bool { - return s.State() == nodeStateAlive - }) - }) - t.Run("Can recover from chainID mismatch", func(t *testing.T) { - t.Parallel() - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - client := newMockSendOnlyClient[types.ID](t) - client.On("Close").Once() - client.On("Dial", mock.Anything).Return(nil).Once() - configuredChainID := types.NewIDFromInt(11) - rpcChainID := types.NewIDFromInt(20) - const failuresCount = 2 - client.On("ChainID", mock.Anything).Return(rpcChainID, nil).Times(failuresCount) - client.On("ChainID", mock.Anything).Return(configuredChainID, nil) - s := NewSendOnlyNode(lggr, url.URL{}, t.Name(), configuredChainID, client) - - defer func() { assert.NoError(t, s.Close()) }() - err := s.Start(tests.Context(t)) - require.NoError(t, err) - - assert.Equal(t, nodeStateInvalidChainID, s.State()) - tests.AssertLogCountEventually(t, observedLogs, "sendonly rpc ChainID doesn't match local chain ID", failuresCount) - tests.AssertEventually(t, func() bool { - return s.State() == nodeStateAlive - }) - }) - t.Run("Start with Random ChainID", func(t *testing.T) { - t.Parallel() - lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel) - client := newMockSendOnlyClient[types.ID](t) - client.On("Close").Once() - client.On("Dial", mock.Anything).Return(nil).Once() - configuredChainID := types.RandomID() - client.On("ChainID", mock.Anything).Return(configuredChainID, nil) - s := NewSendOnlyNode(lggr, url.URL{}, t.Name(), configuredChainID, client) - - defer func() { assert.NoError(t, s.Close()) }() - err := s.Start(tests.Context(t)) - assert.NoError(t, err) - tests.AssertEventually(t, func() bool { - return s.State() == nodeStateAlive - }) - assert.Equal(t, 0, observedLogs.Len()) // No warnings expected - }) -} diff --git a/common/client/timeout.go b/common/client/timeout.go new file mode 100644 index 00000000000..0827b812962 --- /dev/null +++ b/common/client/timeout.go @@ -0,0 +1,5 @@ +package client + +import "time" + +const QueryTimeout = 10 * time.Second diff --git a/common/client/transaction_sender.go b/common/client/transaction_sender.go deleted file mode 100644 index 5f58682142f..00000000000 --- a/common/client/transaction_sender.go +++ /dev/null @@ -1,301 +0,0 @@ -package client - -import ( - "context" - "errors" - "math" - "slices" - "sync" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -var ( - // PromMultiNodeInvariantViolations reports violation of our assumptions - PromMultiNodeInvariantViolations = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "multi_node_invariant_violations", - Help: "The number of invariant violations", - }, []string{"network", "chainId", "invariant"}) -) - -type SendTxResult interface { - Code() SendTxReturnCode - Error() error -} - -const sendTxQuorum = 0.7 - -// SendTxRPCClient - defines interface of an RPC used by TransactionSender to broadcast transaction -type SendTxRPCClient[TX any, RESULT SendTxResult] interface { - // SendTransaction errors returned should include name or other unique identifier of the RPC - SendTransaction(ctx context.Context, tx TX) RESULT -} - -func NewTransactionSender[TX any, RESULT SendTxResult, CHAIN_ID types.ID, RPC SendTxRPCClient[TX, RESULT]]( - lggr logger.Logger, - chainID CHAIN_ID, - chainFamily string, - multiNode *MultiNode[CHAIN_ID, RPC], - newResult func(err error) RESULT, - sendTxSoftTimeout time.Duration, -) *TransactionSender[TX, RESULT, CHAIN_ID, RPC] { - if sendTxSoftTimeout == 0 { - sendTxSoftTimeout = QueryTimeout / 2 - } - return &TransactionSender[TX, RESULT, CHAIN_ID, RPC]{ - chainID: chainID, - chainFamily: chainFamily, - lggr: logger.Sugared(lggr).Named("TransactionSender").With("chainID", chainID.String()), - multiNode: multiNode, - newResult: newResult, - sendTxSoftTimeout: sendTxSoftTimeout, - chStop: make(services.StopChan), - } -} - -type TransactionSender[TX any, RESULT SendTxResult, CHAIN_ID types.ID, RPC SendTxRPCClient[TX, RESULT]] struct { - services.StateMachine - chainID CHAIN_ID - chainFamily string - lggr logger.SugaredLogger - multiNode *MultiNode[CHAIN_ID, RPC] - newResult func(err error) RESULT - sendTxSoftTimeout time.Duration // defines max waiting time from first response til responses evaluation - - wg sync.WaitGroup // waits for all reporting goroutines to finish - chStop services.StopChan -} - -// SendTransaction - broadcasts transaction to all the send-only and primary nodes in MultiNode. -// A returned nil or error does not guarantee that the transaction will or won't be included. Additional checks must be -// performed to determine the final state. -// -// Send-only nodes' results are ignored as they tend to return false-positive responses. Broadcast to them is necessary -// to speed up the propagation of TX in the network. -// -// Handling of primary nodes' results consists of collection and aggregation. -// In the collection step, we gather as many results as possible while minimizing waiting time. This operation succeeds -// on one of the following conditions: -// * Received at least one success -// * Received at least one result and `sendTxSoftTimeout` expired -// * Received results from the sufficient number of nodes defined by sendTxQuorum. -// The aggregation is based on the following conditions: -// * If there is at least one success - returns success -// * If there is at least one terminal error - returns terminal error -// * If there is both success and terminal error - returns success and reports invariant violation -// * Otherwise, returns any (effectively random) of the errors. -func (txSender *TransactionSender[TX, RESULT, CHAIN_ID, RPC]) SendTransaction(ctx context.Context, tx TX) RESULT { - var result RESULT - ctx, cancel := txSender.chStop.Ctx(ctx) - defer cancel() - if !txSender.IfStarted(func() { - txResults := make(chan RESULT) - txResultsToReport := make(chan RESULT) - primaryNodeWg := sync.WaitGroup{} - - healthyNodesNum := 0 - err := txSender.multiNode.DoAll(ctx, func(ctx context.Context, rpc RPC, isSendOnly bool) { - if isSendOnly { - txSender.wg.Add(1) - go func(ctx context.Context) { - defer txSender.wg.Done() - // Send-only nodes' results are ignored as they tend to return false-positive responses. - // Broadcast to them is necessary to speed up the propagation of TX in the network. - _ = txSender.broadcastTxAsync(ctx, rpc, tx) - }(ctx) - return - } - - // Primary Nodes - healthyNodesNum++ - primaryNodeWg.Add(1) - go func(ctx context.Context) { - // Broadcasting transaction and results reporting for invariant detection are background jobs that must be detached from - // callers cancellation. - // Results reporting to SendTransaction caller must respect caller's context to avoid goroutine leak. - defer primaryNodeWg.Done() - r := txSender.broadcastTxAsync(ctx, rpc, tx) - select { - case <-ctx.Done(): - txSender.lggr.Debugw("Failed to send tx results", "err", ctx.Err()) - return - case txResults <- r: - } - - ctx, cancel := txSender.chStop.Ctx(context.WithoutCancel(ctx)) - defer cancel() - select { - case <-ctx.Done(): - txSender.lggr.Debugw("Failed to send tx results to report", "err", ctx.Err()) - return - case txResultsToReport <- r: - } - }(ctx) - }) - - // This needs to be done in parallel so the reporting knows when it's done (when the channel is closed) - txSender.wg.Add(1) - go func() { - defer txSender.wg.Done() - primaryNodeWg.Wait() - close(txResultsToReport) - close(txResults) - }() - - if err != nil { - result = txSender.newResult(err) - return - } - - if healthyNodesNum == 0 { - result = txSender.newResult(ErroringNodeError) - return - } - - txSender.wg.Add(1) - go txSender.reportSendTxAnomalies(tx, txResultsToReport) - - result = txSender.collectTxResults(ctx, tx, healthyNodesNum, txResults) - }) { - result = txSender.newResult(errors.New("TransactionSender not started")) - } - - return result -} - -func (txSender *TransactionSender[TX, RESULT, CHAIN_ID, RPC]) broadcastTxAsync(ctx context.Context, rpc RPC, tx TX) RESULT { - // broadcast is a background job, so always detach from caller's cancellation - ctx, cancel := txSender.chStop.Ctx(context.WithoutCancel(ctx)) - defer cancel() - result := rpc.SendTransaction(ctx, tx) - txSender.lggr.Debugw("Node sent transaction", "tx", tx, "err", result.Error()) - if !slices.Contains(sendTxSuccessfulCodes, result.Code()) && ctx.Err() == nil { - txSender.lggr.Warnw("RPC returned error", "tx", tx, "err", result.Error()) - } - return result -} - -func (txSender *TransactionSender[TX, RESULT, CHAIN_ID, RPC]) reportSendTxAnomalies(tx TX, txResults <-chan RESULT) { - defer txSender.wg.Done() - resultsByCode := sendTxResults[RESULT]{} - // txResults eventually will be closed - for txResult := range txResults { - resultsByCode[txResult.Code()] = append(resultsByCode[txResult.Code()], txResult) - } - - select { - case <-txSender.chStop: - // it's ok to receive no results if txSender is closing. Return early to prevent false reporting of invariant violation. - if len(resultsByCode) == 0 { - return - } - default: - } - - _, criticalErr := aggregateTxResults[RESULT](resultsByCode) - if criticalErr != nil { - txSender.lggr.Criticalw("observed invariant violation on SendTransaction", "tx", tx, "resultsByCode", resultsByCode, "err", criticalErr) - PromMultiNodeInvariantViolations.WithLabelValues(txSender.chainFamily, txSender.chainID.String(), criticalErr.Error()).Inc() - } -} - -type sendTxResults[RESULT any] map[SendTxReturnCode][]RESULT - -func aggregateTxResults[RESULT any](resultsByCode sendTxResults[RESULT]) (result RESULT, criticalErr error) { - severeErrors, hasSevereErrors := findFirstIn(resultsByCode, sendTxSevereErrors) - successResults, hasSuccess := findFirstIn(resultsByCode, sendTxSuccessfulCodes) - if hasSuccess { - // We assume that primary node would never report false positive txResult for a transaction. - // Thus, if such case occurs it's probably due to misconfiguration or a bug and requires manual intervention. - if hasSevereErrors { - const errMsg = "found contradictions in nodes replies on SendTransaction: got success and severe error" - // return success, since at least 1 node has accepted our broadcasted Tx, and thus it can now be included onchain - return successResults[0], errors.New(errMsg) - } - - // other errors are temporary - we are safe to return success - return successResults[0], nil - } - - if hasSevereErrors { - return severeErrors[0], nil - } - - // return temporary error - for _, r := range resultsByCode { - return r[0], nil - } - - criticalErr = errors.New("expected at least one response on SendTransaction") - return result, criticalErr -} - -func (txSender *TransactionSender[TX, RESULT, CHAIN_ID, RPC]) collectTxResults(ctx context.Context, tx TX, healthyNodesNum int, txResults <-chan RESULT) RESULT { - requiredResults := int(math.Ceil(float64(healthyNodesNum) * sendTxQuorum)) - errorsByCode := sendTxResults[RESULT]{} - var softTimeoutChan <-chan time.Time - var resultsCount int -loop: - for { - select { - case <-ctx.Done(): - txSender.lggr.Debugw("Failed to collect of the results before context was done", "tx", tx, "errorsByCode", errorsByCode) - return txSender.newResult(ctx.Err()) - case r := <-txResults: - errorsByCode[r.Code()] = append(errorsByCode[r.Code()], r) - resultsCount++ - if slices.Contains(sendTxSuccessfulCodes, r.Code()) || resultsCount >= requiredResults { - break loop - } - case <-softTimeoutChan: - txSender.lggr.Debugw("Send Tx soft timeout expired - returning responses we've collected so far", "tx", tx, "resultsCount", resultsCount, "requiredResults", requiredResults) - break loop - } - - if softTimeoutChan == nil { - tm := time.NewTimer(txSender.sendTxSoftTimeout) - softTimeoutChan = tm.C - // we are fine with stopping timer at the end of function - //nolint - defer tm.Stop() - } - } - - // ignore critical error as it's reported in reportSendTxAnomalies - result, _ := aggregateTxResults(errorsByCode) - txSender.lggr.Debugw("Collected results", "errorsByCode", errorsByCode, "result", result) - return result -} - -func (txSender *TransactionSender[TX, RESULT, CHAIN_ID, RPC]) Start(ctx context.Context) error { - return txSender.StartOnce("TransactionSender", func() error { - return nil - }) -} - -func (txSender *TransactionSender[TX, RESULT, CHAIN_ID, RPC]) Close() error { - return txSender.StopOnce("TransactionSender", func() error { - txSender.lggr.Debug("Closing TransactionSender") - close(txSender.chStop) - txSender.wg.Wait() - return nil - }) -} - -// findFirstIn - returns the first existing key and value for the slice of keys -func findFirstIn[K comparable, V any](set map[K]V, keys []K) (V, bool) { - for _, k := range keys { - if v, ok := set[k]; ok { - return v, true - } - } - var zeroV V - return zeroV, false -} diff --git a/common/client/transaction_sender_test.go b/common/client/transaction_sender_test.go deleted file mode 100644 index 14dc0799a6a..00000000000 --- a/common/client/transaction_sender_test.go +++ /dev/null @@ -1,419 +0,0 @@ -package client - -import ( - "context" - "fmt" - "testing" - - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -type TestSendTxRPCClient SendTxRPCClient[any, *sendTxResult] - -type sendTxMultiNode struct { - *MultiNode[types.ID, TestSendTxRPCClient] -} - -type sendTxRPC struct { - sendTxRun func(args mock.Arguments) - sendTxErr error -} - -type sendTxResult struct { - err error - code SendTxReturnCode -} - -var _ SendTxResult = (*sendTxResult)(nil) - -func NewSendTxResult(err error) *sendTxResult { - result := &sendTxResult{ - err: err, - } - return result -} - -func (r *sendTxResult) Error() error { - return r.err -} - -func (r *sendTxResult) Code() SendTxReturnCode { - return r.code -} - -var _ TestSendTxRPCClient = (*sendTxRPC)(nil) - -func newSendTxRPC(sendTxErr error, sendTxRun func(args mock.Arguments)) *sendTxRPC { - return &sendTxRPC{sendTxErr: sendTxErr, sendTxRun: sendTxRun} -} - -func (rpc *sendTxRPC) SendTransaction(ctx context.Context, _ any) *sendTxResult { - if rpc.sendTxRun != nil { - rpc.sendTxRun(mock.Arguments{ctx}) - } - return &sendTxResult{err: rpc.sendTxErr, code: classifySendTxError(nil, rpc.sendTxErr)} -} - -// newTestTransactionSender returns a sendTxMultiNode and TransactionSender. -// Only the TransactionSender is run via Start/Close. -func newTestTransactionSender(t *testing.T, chainID types.ID, lggr logger.Logger, - nodes []Node[types.ID, TestSendTxRPCClient], - sendOnlyNodes []SendOnlyNode[types.ID, TestSendTxRPCClient], -) (*sendTxMultiNode, *TransactionSender[any, *sendTxResult, types.ID, TestSendTxRPCClient]) { - mn := sendTxMultiNode{NewMultiNode[types.ID, TestSendTxRPCClient]( - lggr, NodeSelectionModeRoundRobin, 0, nodes, sendOnlyNodes, chainID, "chainFamily", 0)} - - txSender := NewTransactionSender[any, *sendTxResult, types.ID, TestSendTxRPCClient](lggr, chainID, mn.chainFamily, mn.MultiNode, NewSendTxResult, tests.TestInterval) - servicetest.Run(t, txSender) - return &mn, txSender -} - -func classifySendTxError(_ any, err error) SendTxReturnCode { - if err != nil { - return Fatal - } - return Successful -} - -func TestTransactionSender_SendTransaction(t *testing.T) { - t.Parallel() - - newNodeWithState := func(t *testing.T, state nodeState, txErr error, sendTxRun func(args mock.Arguments)) *mockNode[types.ID, TestSendTxRPCClient] { - rpc := newSendTxRPC(txErr, sendTxRun) - node := newMockNode[types.ID, TestSendTxRPCClient](t) - node.On("String").Return("node name").Maybe() - node.On("RPC").Return(rpc).Maybe() - node.On("State").Return(state).Maybe() - node.On("Start", mock.Anything).Return(nil).Maybe() - node.On("Close").Return(nil).Maybe() - node.On("SetPoolChainInfoProvider", mock.Anything).Return(nil).Maybe() - return node - } - - newNode := func(t *testing.T, txErr error, sendTxRun func(args mock.Arguments)) *mockNode[types.ID, TestSendTxRPCClient] { - return newNodeWithState(t, nodeStateAlive, txErr, sendTxRun) - } - - t.Run("Fails if there is no nodes available", func(t *testing.T) { - lggr := logger.Test(t) - _, txSender := newTestTransactionSender(t, types.RandomID(), lggr, nil, nil) - result := txSender.SendTransaction(tests.Context(t), nil) - assert.EqualError(t, result.Error(), ErroringNodeError.Error()) - }) - - t.Run("Transaction failure happy path", func(t *testing.T) { - expectedError := errors.New("transaction failed") - mainNode := newNode(t, expectedError, nil) - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - - _, txSender := newTestTransactionSender(t, types.RandomID(), lggr, - []Node[types.ID, TestSendTxRPCClient]{mainNode}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{newNode(t, errors.New("unexpected error"), nil)}) - - result := txSender.SendTransaction(tests.Context(t), nil) - require.ErrorIs(t, result.Error(), expectedError) - require.Equal(t, Fatal, result.Code()) - tests.AssertLogCountEventually(t, observedLogs, "Node sent transaction", 2) - tests.AssertLogCountEventually(t, observedLogs, "RPC returned error", 2) - }) - - t.Run("Transaction success happy path", func(t *testing.T) { - mainNode := newNode(t, nil, nil) - - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - _, txSender := newTestTransactionSender(t, types.RandomID(), lggr, - []Node[types.ID, TestSendTxRPCClient]{mainNode}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{newNode(t, errors.New("unexpected error"), nil)}) - - result := txSender.SendTransaction(tests.Context(t), nil) - require.NoError(t, result.Error()) - require.Equal(t, Successful, result.Code()) - tests.AssertLogCountEventually(t, observedLogs, "Node sent transaction", 2) - tests.AssertLogCountEventually(t, observedLogs, "RPC returned error", 1) - }) - - t.Run("Context expired before collecting sufficient results", func(t *testing.T) { - testContext, testCancel := context.WithCancel(tests.Context(t)) - defer testCancel() - - mainNode := newNode(t, nil, func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - - lggr := logger.Test(t) - - _, txSender := newTestTransactionSender(t, types.RandomID(), lggr, - []Node[types.ID, TestSendTxRPCClient]{mainNode}, nil) - - requestContext, cancel := context.WithCancel(tests.Context(t)) - cancel() - result := txSender.SendTransaction(requestContext, nil) - require.EqualError(t, result.Error(), "context canceled") - }) - - t.Run("Soft timeout stops results collection", func(t *testing.T) { - chainID := types.RandomID() - expectedError := errors.New("transaction failed") - fastNode := newNode(t, expectedError, nil) - - // hold reply from the node till end of the test - testContext, testCancel := context.WithCancel(tests.Context(t)) - defer testCancel() - slowNode := newNode(t, errors.New("transaction failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - - lggr := logger.Test(t) - - _, txSender := newTestTransactionSender(t, chainID, lggr, []Node[types.ID, TestSendTxRPCClient]{fastNode, slowNode}, nil) - result := txSender.SendTransaction(tests.Context(t), nil) - require.EqualError(t, result.Error(), expectedError.Error()) - }) - t.Run("Returns success without waiting for the rest of the nodes", func(t *testing.T) { - chainID := types.RandomID() - fastNode := newNode(t, nil, nil) - // hold reply from the node till end of the test - testContext, testCancel := context.WithCancel(tests.Context(t)) - defer testCancel() - slowNode := newNode(t, errors.New("transaction failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - slowSendOnly := newNode(t, errors.New("send only failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - lggr, _ := logger.TestObserved(t, zap.WarnLevel) - _, txSender := newTestTransactionSender(t, chainID, lggr, - []Node[types.ID, TestSendTxRPCClient]{fastNode, slowNode}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{slowSendOnly}) - - result := txSender.SendTransaction(tests.Context(t), nil) - require.NoError(t, result.Error()) - require.Equal(t, Successful, result.Code()) - }) - t.Run("Fails when multinode is closed", func(t *testing.T) { - chainID := types.RandomID() - fastNode := newNode(t, nil, nil) - fastNode.On("ConfiguredChainID").Return(chainID).Maybe() - // hold reply from the node till end of the test - testContext, testCancel := context.WithCancel(tests.Context(t)) - defer testCancel() - slowNode := newNode(t, errors.New("transaction failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - slowNode.On("ConfiguredChainID").Return(chainID).Maybe() - slowSendOnly := newNode(t, errors.New("send only failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - slowSendOnly.On("ConfiguredChainID").Return(chainID).Maybe() - - lggr, _ := logger.TestObserved(t, zap.DebugLevel) - - mn, txSender := newTestTransactionSender(t, chainID, lggr, - []Node[types.ID, TestSendTxRPCClient]{fastNode, slowNode}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{slowSendOnly}) - - require.NoError(t, mn.Start(tests.Context(t))) - require.NoError(t, mn.Close()) - result := txSender.SendTransaction(tests.Context(t), nil) - require.EqualError(t, result.Error(), "service is stopped") - }) - t.Run("Fails when closed", func(t *testing.T) { - chainID := types.RandomID() - fastNode := newNode(t, nil, nil) - // hold reply from the node till end of the test - testContext, testCancel := context.WithCancel(tests.Context(t)) - defer testCancel() - slowNode := newNode(t, errors.New("transaction failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - slowSendOnly := newNode(t, errors.New("send only failed"), func(_ mock.Arguments) { - // block caller til end of the test - <-testContext.Done() - }) - - var txSender *TransactionSender[any, *sendTxResult, types.ID, TestSendTxRPCClient] - - t.Cleanup(func() { // after txSender.Close() - result := txSender.SendTransaction(tests.Context(t), nil) - assert.EqualError(t, result.err, "TransactionSender not started") - }) - - _, txSender = newTestTransactionSender(t, chainID, logger.Test(t), - []Node[types.ID, TestSendTxRPCClient]{fastNode, slowNode}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{slowSendOnly}) - }) - t.Run("Returns error if there is no healthy primary nodes", func(t *testing.T) { - chainID := types.RandomID() - primary := newNodeWithState(t, nodeStateUnreachable, nil, nil) - sendOnly := newNodeWithState(t, nodeStateUnreachable, nil, nil) - - lggr := logger.Test(t) - - _, txSender := newTestTransactionSender(t, chainID, lggr, - []Node[types.ID, TestSendTxRPCClient]{primary}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{sendOnly}) - - result := txSender.SendTransaction(tests.Context(t), nil) - assert.EqualError(t, result.Error(), ErroringNodeError.Error()) - }) - - t.Run("Transaction success even if one of the nodes is unhealthy", func(t *testing.T) { - chainID := types.RandomID() - mainNode := newNode(t, nil, nil) - unexpectedCall := func(args mock.Arguments) { - panic("SendTx must not be called for unhealthy node") - } - unhealthyNode := newNodeWithState(t, nodeStateUnreachable, nil, unexpectedCall) - unhealthySendOnlyNode := newNodeWithState(t, nodeStateUnreachable, nil, unexpectedCall) - - lggr := logger.Test(t) - - _, txSender := newTestTransactionSender(t, chainID, lggr, - []Node[types.ID, TestSendTxRPCClient]{mainNode, unhealthyNode}, - []SendOnlyNode[types.ID, TestSendTxRPCClient]{unhealthySendOnlyNode}) - - result := txSender.SendTransaction(tests.Context(t), nil) - require.NoError(t, result.Error()) - require.Equal(t, Successful, result.Code()) - }) - t.Run("All background jobs stop even if RPC returns result after soft timeout", func(t *testing.T) { - chainID := types.RandomID() - expectedError := errors.New("transaction failed") - fastNode := newNode(t, expectedError, nil) - - // hold reply from the node till SendTransaction returns result - sendTxContext, sendTxCancel := context.WithCancel(tests.Context(t)) - slowNode := newNode(t, errors.New("transaction failed"), func(_ mock.Arguments) { - <-sendTxContext.Done() - }) - - lggr := logger.Test(t) - - _, txSender := newTestTransactionSender(t, chainID, lggr, []Node[types.ID, TestSendTxRPCClient]{fastNode, slowNode}, nil) - result := txSender.SendTransaction(sendTxContext, nil) - sendTxCancel() - require.EqualError(t, result.Error(), expectedError.Error()) - // TxSender should stop all background go routines after SendTransaction is done and before test is done. - // Otherwise, it signals that we have a goroutine leak. - txSender.wg.Wait() - }) -} - -func TestTransactionSender_SendTransaction_aggregateTxResults(t *testing.T) { - t.Parallel() - // ensure failure on new SendTxReturnCode - codesToCover := map[SendTxReturnCode]struct{}{} - for code := Successful; code < sendTxReturnCodeLen; code++ { - codesToCover[code] = struct{}{} - } - - testCases := []struct { - Name string - ExpectedTxResult string - ExpectedCriticalErr string - ResultsByCode sendTxResults[*sendTxResult] - }{ - { - Name: "Returns success and logs critical error on success and Fatal", - ExpectedTxResult: "success", - ExpectedCriticalErr: "found contradictions in nodes replies on SendTransaction: got success and severe error", - ResultsByCode: sendTxResults[*sendTxResult]{ - Successful: {NewSendTxResult(errors.New("success"))}, - Fatal: {NewSendTxResult(errors.New("fatal"))}, - }, - }, - { - Name: "Returns TransactionAlreadyKnown and logs critical error on TransactionAlreadyKnown and Fatal", - ExpectedTxResult: "tx_already_known", - ExpectedCriticalErr: "found contradictions in nodes replies on SendTransaction: got success and severe error", - ResultsByCode: sendTxResults[*sendTxResult]{ - TransactionAlreadyKnown: {NewSendTxResult(errors.New("tx_already_known"))}, - Unsupported: {NewSendTxResult(errors.New("unsupported"))}, - }, - }, - { - Name: "Prefers sever error to temporary", - ExpectedTxResult: "underpriced", - ExpectedCriticalErr: "", - ResultsByCode: sendTxResults[*sendTxResult]{ - Retryable: {NewSendTxResult(errors.New("retryable"))}, - Underpriced: {NewSendTxResult(errors.New("underpriced"))}, - }, - }, - { - Name: "Returns temporary error", - ExpectedTxResult: "retryable", - ExpectedCriticalErr: "", - ResultsByCode: sendTxResults[*sendTxResult]{ - Retryable: {NewSendTxResult(errors.New("retryable"))}, - }, - }, - { - Name: "Insufficient funds is treated as error", - ExpectedTxResult: "insufficientFunds", - ExpectedCriticalErr: "", - ResultsByCode: sendTxResults[*sendTxResult]{ - InsufficientFunds: {NewSendTxResult(errors.New("insufficientFunds"))}, - }, - }, - { - Name: "Logs critical error on empty ResultsByCode", - ExpectedCriticalErr: "expected at least one response on SendTransaction", - ResultsByCode: sendTxResults[*sendTxResult]{}, - }, - { - Name: "Zk terminally stuck", - ExpectedTxResult: "not enough keccak counters to continue the execution", - ExpectedCriticalErr: "", - ResultsByCode: sendTxResults[*sendTxResult]{ - TerminallyStuck: {NewSendTxResult(errors.New("not enough keccak counters to continue the execution"))}, - }, - }, - } - - for _, testCase := range testCases { - for code := range testCase.ResultsByCode { - delete(codesToCover, code) - } - - t.Run(testCase.Name, func(t *testing.T) { - txResult, err := aggregateTxResults(testCase.ResultsByCode) - if testCase.ExpectedTxResult != "" { - require.EqualError(t, txResult.Error(), testCase.ExpectedTxResult) - } - - logger.Sugared(logger.Test(t)).Info("Map: " + fmt.Sprint(testCase.ResultsByCode)) - logger.Sugared(logger.Test(t)).Criticalw("observed invariant violation on SendTransaction", "resultsByCode", testCase.ResultsByCode, "err", err) - - if testCase.ExpectedCriticalErr == "" { - require.NoError(t, err) - } else { - require.EqualError(t, err, testCase.ExpectedCriticalErr) - } - }) - } - - // explicitly signal that following codes are properly handled in aggregateTxResults, - // but dedicated test cases won't be beneficial - for _, codeToIgnore := range []SendTxReturnCode{Unknown, ExceedsMaxFee, FeeOutOfValidRange} { - delete(codesToCover, codeToIgnore) - } - assert.Empty(t, codesToCover, "all of the SendTxReturnCode must be covered by this test") -} diff --git a/common/client/types.go b/common/client/types.go deleted file mode 100644 index 38880397442..00000000000 --- a/common/client/types.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -import ( - "context" - "math/big" - - "github.com/smartcontractkit/chainlink/v2/common/types" -) - -// RPCClient includes all the necessary generalized RPC methods used by Node to perform health checks -type RPCClient[ - CHAIN_ID types.ID, - HEAD Head, -] interface { - // ChainID - fetches ChainID from the RPC to verify that it matches config - ChainID(ctx context.Context) (CHAIN_ID, error) - // Dial - prepares the RPC for usage. Can be called on fresh or closed RPC - Dial(ctx context.Context) error - // SubscribeToHeads - returns channel and subscription for new heads. - SubscribeToHeads(ctx context.Context) (<-chan HEAD, types.Subscription, error) - // SubscribeToFinalizedHeads - returns channel and subscription for finalized heads. - SubscribeToFinalizedHeads(ctx context.Context) (<-chan HEAD, types.Subscription, error) - // Ping - returns error if RPC is not reachable - Ping(context.Context) error - // IsSyncing - returns true if the RPC is in Syncing state and can not process calls - IsSyncing(ctx context.Context) (bool, error) - // UnsubscribeAllExcept - close all subscriptions except `subs` - UnsubscribeAllExcept(subs ...types.Subscription) - // Close - closes all subscriptions and aborts all RPC calls - Close() - // GetInterceptedChainInfo - returns latest and highest observed by application layer ChainInfo. - // latest ChainInfo is the most recent value received within a NodeClient's current lifecycle between Dial and DisconnectAll. - // highestUserObservations ChainInfo is the highest ChainInfo observed excluding health checks calls. - // Its values must not be reset. - // The results of corresponding calls, to get the most recent head and the latest finalized head, must be - // intercepted and reflected in ChainInfo before being returned to a caller. Otherwise, MultiNode is not able to - // provide repeatable read guarantee. - // DisconnectAll must reset latest ChainInfo to default value. - // Ensure implementation does not have a race condition when values are reset before request completion and as - // a result latest ChainInfo contains information from the previous cycle. - GetInterceptedChainInfo() (latest, highestUserObservations ChainInfo) -} - -// Head is the interface required by the NodeClient -type Head interface { - BlockNumber() int64 - BlockDifficulty() *big.Int - IsValid() bool -} - -// PoolChainInfoProvider - provides aggregation of nodes pool ChainInfo -type PoolChainInfoProvider interface { - // LatestChainInfo - returns number of live nodes available in the pool, so we can prevent the last alive node in a pool from being - // moved to out-of-sync state. It is better to have one out-of-sync node than no nodes at all. - // Returns highest latest ChainInfo within the alive nodes. E.g. most recent block number and highest block number - // observed by Node A are 10 and 15; Node B - 12 and 14. This method will return 12. - LatestChainInfo() (int, ChainInfo) - // HighestUserObservations - returns highest ChainInfo ever observed by any user of MultiNode. - HighestUserObservations() ChainInfo -} - -// ChainInfo - defines RPC's or MultiNode's view on the chain -type ChainInfo struct { - BlockNumber int64 - FinalizedBlockNumber int64 - TotalDifficulty *big.Int -} - -func MaxTotalDifficulty(a, b *big.Int) *big.Int { - if a == nil { - if b == nil { - return nil - } - - return big.NewInt(0).Set(b) - } - - if b == nil || a.Cmp(b) >= 0 { - return big.NewInt(0).Set(a) - } - - return big.NewInt(0).Set(b) -} diff --git a/common/client/types_test.go b/common/client/types_test.go deleted file mode 100644 index 68d7a3fe78e..00000000000 --- a/common/client/types_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestMaxDifficulty(t *testing.T) { - cases := []struct { - A, B, Result *big.Int - }{ - { - A: nil, B: nil, Result: nil, - }, - { - A: nil, B: big.NewInt(1), Result: big.NewInt(1), - }, - { - A: big.NewInt(1), B: big.NewInt(1), Result: big.NewInt(1), - }, - { - A: big.NewInt(1), B: big.NewInt(2), Result: big.NewInt(2), - }, - } - - for _, test := range cases { - actualResult := MaxTotalDifficulty(test.A, test.B) - assert.Equal(t, test.Result, actualResult, "expected max(%v, %v) to produce %v", test.A, test.B, test.Result) - inverted := MaxTotalDifficulty(test.B, test.A) - assert.Equal(t, actualResult, inverted, "expected max(%v, %v) == max(%v, %v)", test.A, test.B, test.B, test.A) - } -} diff --git a/common/txmgr/broadcaster.go b/common/txmgr/broadcaster.go index 14e959c39ae..41ec0f644b4 100644 --- a/common/txmgr/broadcaster.go +++ b/common/txmgr/broadcaster.go @@ -18,8 +18,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink-framework/multinode" - "github.com/smartcontractkit/chainlink/v2/common/client" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -498,7 +498,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand errType, err = eb.validateOnChainSequence(ctx, lgr, errType, err, etx, retryCount) } - if errType == client.Fatal || errType == client.TerminallyStuck { + if errType == multinode.Fatal || errType == multinode.TerminallyStuck { eb.SvcErrBuffer.Append(err) etx.Error = null.StringFrom(err.Error()) return eb.saveFatallyErroredTransaction(lgr, &etx), true @@ -508,9 +508,9 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand etx.BroadcastAt = &initialBroadcastAt switch errType { - case client.TransactionAlreadyKnown: + case multinode.TransactionAlreadyKnown: fallthrough - case client.Successful: + case multinode.Successful: // Either the transaction was successful or one of the following four scenarios happened: // // SCENARIO 1 @@ -557,14 +557,14 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand // Increment sequence if successfully broadcasted eb.sequenceTracker.GenerateNextSequence(etx.FromAddress, *etx.Sequence) return err, true - case client.Underpriced: + case multinode.Underpriced: bumpedAttempt, retryable, replaceErr := eb.replaceAttemptWithBumpedGas(ctx, lgr, err, etx, attempt) if replaceErr != nil { return replaceErr, retryable } return eb.handleInProgressTx(ctx, etx, bumpedAttempt, initialBroadcastAt, retryCount+1) - case client.InsufficientFunds: + case multinode.InsufficientFunds: // NOTE: This can occur due to either insufficient funds or a gas spike // combined with a high gas limit. Regardless of the cause, we need to obtain a new estimate, // replace the current attempt, and retry after the backoff duration. @@ -574,9 +574,9 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand return replaceErr, true } return err, true - case client.Retryable: + case multinode.Retryable: return err, true - case client.FeeOutOfValidRange: + case multinode.FeeOutOfValidRange: replacementAttempt, retryable, replaceErr := eb.replaceAttemptWithNewEstimation(ctx, lgr, etx, attempt) if replaceErr != nil { return replaceErr, retryable @@ -585,9 +585,9 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand lgr.Warnw("L2 rejected transaction due to incorrect fee, re-estimated and will try again", "etxID", etx.ID, "err", err, "newGasPrice", replacementAttempt.TxFee, "newGasLimit", replacementAttempt.ChainSpecificFeeLimit) return eb.handleInProgressTx(ctx, etx, *replacementAttempt, initialBroadcastAt, 0) - case client.Unsupported: + case multinode.Unsupported: return err, false - case client.ExceedsMaxFee: + case multinode.ExceedsMaxFee: // Broadcaster: Note that we may have broadcast to multiple nodes and had it // accepted by one of them! It is not guaranteed that all nodes share // the same tx fee cap. That is why we must treat this as an unknown @@ -600,7 +600,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand default: // Every error that doesn't fall under one of the above categories will be treated as Unknown. fallthrough - case client.Unknown: + case multinode.Unknown: eb.SvcErrBuffer.Append(err) lgr.Criticalw(`Unknown error occurred while handling tx queue in ProcessUnstartedTxs. This chain/RPC client may not be supported. `+ `Urgent resolution required, Chainlink is currently operating in a degraded state and may miss transactions`, "attempt", attempt, "err", err) @@ -632,9 +632,9 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand } } -func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) validateOnChainSequence(ctx context.Context, lgr logger.SugaredLogger, errType client.SendTxReturnCode, err error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryCount int) (client.SendTxReturnCode, error) { +func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) validateOnChainSequence(ctx context.Context, lgr logger.SugaredLogger, errType multinode.SendTxReturnCode, err error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryCount int) (multinode.SendTxReturnCode, error) { // Only check if sequence was incremented if broadcast was successful, otherwise return the existing err type - if errType != client.Successful { + if errType != multinode.Successful { return errType, err } // Transaction sequence cannot be nil here since a sequence is required to broadcast @@ -649,7 +649,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) vali // Insufficient transaction fee is a common scenario in which the sequence is not incremented by the chain even though we got a successful response // If the sequence failed to increment and hasn't reached the max retries, return the Underpriced error to try again with a bumped attempt if nextSeqOnChain.Int64() == txSeq.Int64() && retryCount < maxHederaBroadcastRetries { - return client.Underpriced, nil + return multinode.Underpriced, nil } // If the transaction reaches the retry limit and fails to get included, mark it as fatally errored @@ -657,17 +657,17 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) vali if nextSeqOnChain.Int64() == txSeq.Int64() && retryCount >= maxHederaBroadcastRetries { err := fmt.Errorf("failed to broadcast transaction on %s after %d retries", hederaChainType, retryCount) lgr.Error(err.Error()) - return client.Fatal, err + return multinode.Fatal, err } // Belts and braces approach to detect and handle sqeuence gaps if the broadcast is considered successful if nextSeqOnChain.Int64() < txSeq.Int64() { err := fmt.Errorf("next expected sequence on-chain (%s) is less than the broadcasted transaction's sequence (%s)", nextSeqOnChain.String(), txSeq.String()) lgr.Criticalw("Sequence gap has been detected and needs to be filled", "error", err) - return client.Fatal, err + return multinode.Fatal, err } - return client.Successful, nil + return multinode.Successful, nil } // Finds next transaction in the queue, assigns a sequence, and moves it to "in_progress" state ready for broadcast. diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index 7c5ba798cf2..7b5a90e70a6 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -20,8 +20,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + "github.com/smartcontractkit/chainlink-framework/multinode" - "github.com/smartcontractkit/chainlink/v2/common/client" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" iutils "github.com/smartcontractkit/chainlink/v2/common/internal/utils" @@ -696,7 +696,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han errType, sendError := ec.client.SendTransactionReturnCode(ctx, etx, attempt, lggr) switch errType { - case client.Underpriced: + case multinode.Underpriced: // This should really not ever happen in normal operation since we // already bumped above the required minimum in broadcaster. ec.lggr.Warnw("Got terminally underpriced error for gas bump, this should never happen unless the remote RPC node changed its configuration on the fly, or you are using multiple RPC nodes with different minimum gas price requirements. This is not recommended", "attempt", attempt) @@ -731,7 +731,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han return fmt.Errorf("saveReplacementInProgressAttempt failed: %w", err) } return ec.handleInProgressAttempt(ctx, lggr, etx, replacementAttempt, blockHeight) - case client.ExceedsMaxFee: + case multinode.ExceedsMaxFee: // Confirmer: Note it is not guaranteed that all nodes share the same tx fee cap. // So it is very likely that this attempt was successful on another node since // it was already successfully broadcasted. So we assume it is successful and @@ -745,7 +745,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han lggr.Criticalw(`RPC node rejected this tx as outside Fee Cap but it may have been accepted by another Node`, "attempt", attempt) timeout := ec.dbConfig.DefaultQueryTimeout() return ec.txStore.SaveSentAttempt(ctx, timeout, &attempt, now) - case client.Fatal: + case multinode.Fatal: // WARNING: This should never happen! // Should NEVER be fatal this is an invariant violation. The // Broadcaster can never create a TxAttempt that will @@ -760,7 +760,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han ec.SvcErrBuffer.Append(sendError) // This will loop continuously on every new head so it must be handled manually by the node operator! return ec.txStore.DeleteInProgressAttempt(ctx, attempt) - case client.TerminallyStuck: + case multinode.TerminallyStuck: // A transaction could broadcast successfully but then be considered terminally stuck on another attempt // Even though the transaction can succeed under different circumstances, we want to purge this transaction as soon as we get this error lggr.Warnw("terminally stuck transaction detected", "err", sendError.Error()) @@ -775,20 +775,20 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han return fmt.Errorf("saveReplacementInProgressAttempt failed: %w", err) } return ec.handleInProgressAttempt(ctx, lggr, etx, purgeAttempt, blockHeight) - case client.TransactionAlreadyKnown: + case multinode.TransactionAlreadyKnown: // Sequence too low indicated that a transaction at this sequence was confirmed already. // Mark confirmed_missing_receipt and wait for the next cycle to try to get a receipt lggr.Debugw("Sequence already used", "txAttemptID", attempt.ID, "txHash", attempt.Hash.String()) timeout := ec.dbConfig.DefaultQueryTimeout() return ec.txStore.SaveConfirmedAttempt(ctx, timeout, &attempt, now) - case client.InsufficientFunds: + case multinode.InsufficientFunds: timeout := ec.dbConfig.DefaultQueryTimeout() return ec.txStore.SaveInsufficientFundsAttempt(ctx, timeout, &attempt, now) - case client.Successful: + case multinode.Successful: lggr.Debugw("Successfully broadcast transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash.String()) timeout := ec.dbConfig.DefaultQueryTimeout() return ec.txStore.SaveSentAttempt(ctx, timeout, &attempt, now) - case client.Unknown: + case multinode.Unknown: // Every error that doesn't fall under one of the above categories will be treated as Unknown. fallthrough default: @@ -838,7 +838,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) For } attempt.Tx = *etx // for logging ec.lggr.Debugw("Sending transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash, "err", err, "meta", etx.Meta, "feeLimit", attempt.ChainSpecificFeeLimit, "callerProvidedFeeLimit", etx.FeeLimit, "attempt", attempt) - if errCode, err := ec.client.SendTransactionReturnCode(ctx, *etx, attempt, ec.lggr); errCode != client.Successful && err != nil { + if errCode, err := ec.client.SendTransactionReturnCode(ctx, *etx, attempt, ec.lggr); errCode != multinode.Successful && err != nil { ec.lggr.Errorw(fmt.Sprintf("ForceRebroadcast: failed to rebroadcast tx %v with sequence %v, gas limit %v, and caller provided fee Limit %v : %s", etx.ID, *etx.Sequence, attempt.ChainSpecificFeeLimit, etx.FeeLimit, err.Error()), "err", err, "fee", attempt.TxFee) continue } diff --git a/common/txmgr/resender.go b/common/txmgr/resender.go index d4f1b4275a1..6b65ca05923 100644 --- a/common/txmgr/resender.go +++ b/common/txmgr/resender.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/chains/label" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink-framework/multinode" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" @@ -184,13 +184,13 @@ func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) resendUnco return nil } -func logResendResult(lggr logger.Logger, codes []client.SendTxReturnCode) { +func logResendResult(lggr logger.Logger, codes []multinode.SendTxReturnCode) { var nNew int var nFatal int for _, c := range codes { - if c == client.Successful { + if c == multinode.Successful { nNew++ - } else if c == client.Fatal { + } else if c == multinode.Fatal { nFatal++ } } diff --git a/common/txmgr/types/client.go b/common/txmgr/types/client.go index 759b15d6162..67426437c8a 100644 --- a/common/txmgr/types/client.go +++ b/common/txmgr/types/client.go @@ -7,7 +7,8 @@ import ( "time" "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink-framework/multinode" + feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -49,7 +50,7 @@ type TransactionClient[ bathSize int, lggr logger.SugaredLogger, ) ( - txCodes []client.SendTxReturnCode, + txCodes []multinode.SendTxReturnCode, txErrs []error, broadcastTime time.Time, successfulTxIDs []int64, @@ -59,7 +60,7 @@ type TransactionClient[ tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.SugaredLogger, - ) (client.SendTxReturnCode, error) + ) (multinode.SendTxReturnCode, error) SendEmptyTransaction( ctx context.Context, newTxAttempt func(ctx context.Context, seq SEQ, feeLimit uint64, fee FEE, fromAddress ADDR) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error), diff --git a/common/types/mocks/head.go b/common/types/mocks/head.go deleted file mode 100644 index b00c155ccc7..00000000000 --- a/common/types/mocks/head.go +++ /dev/null @@ -1,607 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package mocks - -import ( - big "math/big" - time "time" - - mock "github.com/stretchr/testify/mock" - - types "github.com/smartcontractkit/chainlink/v2/common/types" -) - -// Head is an autogenerated mock type for the Head type -type Head[BLOCK_HASH types.Hashable] struct { - mock.Mock -} - -type Head_Expecter[BLOCK_HASH types.Hashable] struct { - mock *mock.Mock -} - -func (_m *Head[BLOCK_HASH]) EXPECT() *Head_Expecter[BLOCK_HASH] { - return &Head_Expecter[BLOCK_HASH]{mock: &_m.Mock} -} - -// BlockDifficulty provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) BlockDifficulty() *big.Int { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for BlockDifficulty") - } - - var r0 *big.Int - if rf, ok := ret.Get(0).(func() *big.Int); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) - } - } - - return r0 -} - -// Head_BlockDifficulty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockDifficulty' -type Head_BlockDifficulty_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// BlockDifficulty is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) BlockDifficulty() *Head_BlockDifficulty_Call[BLOCK_HASH] { - return &Head_BlockDifficulty_Call[BLOCK_HASH]{Call: _e.mock.On("BlockDifficulty")} -} - -func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) Run(run func()) *Head_BlockDifficulty_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) Return(_a0 *big.Int) *Head_BlockDifficulty_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) RunAndReturn(run func() *big.Int) *Head_BlockDifficulty_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// BlockHash provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) BlockHash() BLOCK_HASH { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for BlockHash") - } - - var r0 BLOCK_HASH - if rf, ok := ret.Get(0).(func() BLOCK_HASH); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(BLOCK_HASH) - } - } - - return r0 -} - -// Head_BlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockHash' -type Head_BlockHash_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// BlockHash is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) BlockHash() *Head_BlockHash_Call[BLOCK_HASH] { - return &Head_BlockHash_Call[BLOCK_HASH]{Call: _e.mock.On("BlockHash")} -} - -func (_c *Head_BlockHash_Call[BLOCK_HASH]) Run(run func()) *Head_BlockHash_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_BlockHash_Call[BLOCK_HASH]) Return(_a0 BLOCK_HASH) *Head_BlockHash_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_BlockHash_Call[BLOCK_HASH]) RunAndReturn(run func() BLOCK_HASH) *Head_BlockHash_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// BlockNumber provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) BlockNumber() int64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for BlockNumber") - } - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// Head_BlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockNumber' -type Head_BlockNumber_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// BlockNumber is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) BlockNumber() *Head_BlockNumber_Call[BLOCK_HASH] { - return &Head_BlockNumber_Call[BLOCK_HASH]{Call: _e.mock.On("BlockNumber")} -} - -func (_c *Head_BlockNumber_Call[BLOCK_HASH]) Run(run func()) *Head_BlockNumber_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_BlockNumber_Call[BLOCK_HASH]) Return(_a0 int64) *Head_BlockNumber_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_BlockNumber_Call[BLOCK_HASH]) RunAndReturn(run func() int64) *Head_BlockNumber_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// ChainLength provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) ChainLength() uint32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ChainLength") - } - - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint32) - } - - return r0 -} - -// Head_ChainLength_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainLength' -type Head_ChainLength_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// ChainLength is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) ChainLength() *Head_ChainLength_Call[BLOCK_HASH] { - return &Head_ChainLength_Call[BLOCK_HASH]{Call: _e.mock.On("ChainLength")} -} - -func (_c *Head_ChainLength_Call[BLOCK_HASH]) Run(run func()) *Head_ChainLength_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_ChainLength_Call[BLOCK_HASH]) Return(_a0 uint32) *Head_ChainLength_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_ChainLength_Call[BLOCK_HASH]) RunAndReturn(run func() uint32) *Head_ChainLength_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// EarliestHeadInChain provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) EarliestHeadInChain() types.Head[BLOCK_HASH] { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for EarliestHeadInChain") - } - - var r0 types.Head[BLOCK_HASH] - if rf, ok := ret.Get(0).(func() types.Head[BLOCK_HASH]); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(types.Head[BLOCK_HASH]) - } - } - - return r0 -} - -// Head_EarliestHeadInChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EarliestHeadInChain' -type Head_EarliestHeadInChain_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// EarliestHeadInChain is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) EarliestHeadInChain() *Head_EarliestHeadInChain_Call[BLOCK_HASH] { - return &Head_EarliestHeadInChain_Call[BLOCK_HASH]{Call: _e.mock.On("EarliestHeadInChain")} -} - -func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) Run(run func()) *Head_EarliestHeadInChain_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH]) *Head_EarliestHeadInChain_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BLOCK_HASH]) *Head_EarliestHeadInChain_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// GetParent provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) GetParent() types.Head[BLOCK_HASH] { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParent") - } - - var r0 types.Head[BLOCK_HASH] - if rf, ok := ret.Get(0).(func() types.Head[BLOCK_HASH]); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(types.Head[BLOCK_HASH]) - } - } - - return r0 -} - -// Head_GetParent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParent' -type Head_GetParent_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// GetParent is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) GetParent() *Head_GetParent_Call[BLOCK_HASH] { - return &Head_GetParent_Call[BLOCK_HASH]{Call: _e.mock.On("GetParent")} -} - -func (_c *Head_GetParent_Call[BLOCK_HASH]) Run(run func()) *Head_GetParent_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_GetParent_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH]) *Head_GetParent_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_GetParent_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BLOCK_HASH]) *Head_GetParent_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// GetParentHash provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) GetParentHash() BLOCK_HASH { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentHash") - } - - var r0 BLOCK_HASH - if rf, ok := ret.Get(0).(func() BLOCK_HASH); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(BLOCK_HASH) - } - } - - return r0 -} - -// Head_GetParentHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentHash' -type Head_GetParentHash_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// GetParentHash is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) GetParentHash() *Head_GetParentHash_Call[BLOCK_HASH] { - return &Head_GetParentHash_Call[BLOCK_HASH]{Call: _e.mock.On("GetParentHash")} -} - -func (_c *Head_GetParentHash_Call[BLOCK_HASH]) Run(run func()) *Head_GetParentHash_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_GetParentHash_Call[BLOCK_HASH]) Return(_a0 BLOCK_HASH) *Head_GetParentHash_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_GetParentHash_Call[BLOCK_HASH]) RunAndReturn(run func() BLOCK_HASH) *Head_GetParentHash_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// GetTimestamp provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) GetTimestamp() time.Time { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTimestamp") - } - - var r0 time.Time - if rf, ok := ret.Get(0).(func() time.Time); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Time) - } - - return r0 -} - -// Head_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' -type Head_GetTimestamp_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// GetTimestamp is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) GetTimestamp() *Head_GetTimestamp_Call[BLOCK_HASH] { - return &Head_GetTimestamp_Call[BLOCK_HASH]{Call: _e.mock.On("GetTimestamp")} -} - -func (_c *Head_GetTimestamp_Call[BLOCK_HASH]) Run(run func()) *Head_GetTimestamp_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_GetTimestamp_Call[BLOCK_HASH]) Return(_a0 time.Time) *Head_GetTimestamp_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_GetTimestamp_Call[BLOCK_HASH]) RunAndReturn(run func() time.Time) *Head_GetTimestamp_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// HashAtHeight provides a mock function with given fields: blockNum -func (_m *Head[BLOCK_HASH]) HashAtHeight(blockNum int64) BLOCK_HASH { - ret := _m.Called(blockNum) - - if len(ret) == 0 { - panic("no return value specified for HashAtHeight") - } - - var r0 BLOCK_HASH - if rf, ok := ret.Get(0).(func(int64) BLOCK_HASH); ok { - r0 = rf(blockNum) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(BLOCK_HASH) - } - } - - return r0 -} - -// Head_HashAtHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashAtHeight' -type Head_HashAtHeight_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// HashAtHeight is a helper method to define mock.On call -// - blockNum int64 -func (_e *Head_Expecter[BLOCK_HASH]) HashAtHeight(blockNum interface{}) *Head_HashAtHeight_Call[BLOCK_HASH] { - return &Head_HashAtHeight_Call[BLOCK_HASH]{Call: _e.mock.On("HashAtHeight", blockNum)} -} - -func (_c *Head_HashAtHeight_Call[BLOCK_HASH]) Run(run func(blockNum int64)) *Head_HashAtHeight_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int64)) - }) - return _c -} - -func (_c *Head_HashAtHeight_Call[BLOCK_HASH]) Return(_a0 BLOCK_HASH) *Head_HashAtHeight_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_HashAtHeight_Call[BLOCK_HASH]) RunAndReturn(run func(int64) BLOCK_HASH) *Head_HashAtHeight_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// HeadAtHeight provides a mock function with given fields: blockNum -func (_m *Head[BLOCK_HASH]) HeadAtHeight(blockNum int64) (types.Head[BLOCK_HASH], error) { - ret := _m.Called(blockNum) - - if len(ret) == 0 { - panic("no return value specified for HeadAtHeight") - } - - var r0 types.Head[BLOCK_HASH] - var r1 error - if rf, ok := ret.Get(0).(func(int64) (types.Head[BLOCK_HASH], error)); ok { - return rf(blockNum) - } - if rf, ok := ret.Get(0).(func(int64) types.Head[BLOCK_HASH]); ok { - r0 = rf(blockNum) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(types.Head[BLOCK_HASH]) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(blockNum) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Head_HeadAtHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadAtHeight' -type Head_HeadAtHeight_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// HeadAtHeight is a helper method to define mock.On call -// - blockNum int64 -func (_e *Head_Expecter[BLOCK_HASH]) HeadAtHeight(blockNum interface{}) *Head_HeadAtHeight_Call[BLOCK_HASH] { - return &Head_HeadAtHeight_Call[BLOCK_HASH]{Call: _e.mock.On("HeadAtHeight", blockNum)} -} - -func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) Run(run func(blockNum int64)) *Head_HeadAtHeight_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int64)) - }) - return _c -} - -func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH], _a1 error) *Head_HeadAtHeight_Call[BLOCK_HASH] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) RunAndReturn(run func(int64) (types.Head[BLOCK_HASH], error)) *Head_HeadAtHeight_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// IsValid provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) IsValid() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsValid") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Head_IsValid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsValid' -type Head_IsValid_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// IsValid is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) IsValid() *Head_IsValid_Call[BLOCK_HASH] { - return &Head_IsValid_Call[BLOCK_HASH]{Call: _e.mock.On("IsValid")} -} - -func (_c *Head_IsValid_Call[BLOCK_HASH]) Run(run func()) *Head_IsValid_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_IsValid_Call[BLOCK_HASH]) Return(_a0 bool) *Head_IsValid_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_IsValid_Call[BLOCK_HASH]) RunAndReturn(run func() bool) *Head_IsValid_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// LatestFinalizedHead provides a mock function with no fields -func (_m *Head[BLOCK_HASH]) LatestFinalizedHead() types.Head[BLOCK_HASH] { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for LatestFinalizedHead") - } - - var r0 types.Head[BLOCK_HASH] - if rf, ok := ret.Get(0).(func() types.Head[BLOCK_HASH]); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(types.Head[BLOCK_HASH]) - } - } - - return r0 -} - -// Head_LatestFinalizedHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestFinalizedHead' -type Head_LatestFinalizedHead_Call[BLOCK_HASH types.Hashable] struct { - *mock.Call -} - -// LatestFinalizedHead is a helper method to define mock.On call -func (_e *Head_Expecter[BLOCK_HASH]) LatestFinalizedHead() *Head_LatestFinalizedHead_Call[BLOCK_HASH] { - return &Head_LatestFinalizedHead_Call[BLOCK_HASH]{Call: _e.mock.On("LatestFinalizedHead")} -} - -func (_c *Head_LatestFinalizedHead_Call[BLOCK_HASH]) Run(run func()) *Head_LatestFinalizedHead_Call[BLOCK_HASH] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Head_LatestFinalizedHead_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH]) *Head_LatestFinalizedHead_Call[BLOCK_HASH] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Head_LatestFinalizedHead_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BLOCK_HASH]) *Head_LatestFinalizedHead_Call[BLOCK_HASH] { - _c.Call.Return(run) - return _c -} - -// NewHead creates a new instance of Head. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewHead[BLOCK_HASH types.Hashable](t interface { - mock.TestingT - Cleanup(func()) -}) *Head[BLOCK_HASH] { - mock := &Head[BLOCK_HASH]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/client/chain_client.go b/core/chains/evm/client/chain_client.go index 0835b4c0ed8..612a95b7461 100644 --- a/core/chains/evm/client/chain_client.go +++ b/core/chains/evm/client/chain_client.go @@ -14,7 +14,7 @@ import ( commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/logger" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink-framework/multinode" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -60,7 +60,7 @@ type Client interface { // to use HeadTracker to get latest finalized block. LatestFinalizedBlock(ctx context.Context) (head *evmtypes.Head, err error) - SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (commonclient.SendTxReturnCode, error) + SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (multinode.SendTxReturnCode, error) // Wrapped Geth client methods // blockNumber can be specified as `nil` to imply latest block @@ -97,11 +97,11 @@ type Client interface { } type chainClient struct { - multiNode *commonclient.MultiNode[ + multiNode *multinode.MultiNode[ *big.Int, *RPCClient, ] - txSender *commonclient.TransactionSender[*types.Transaction, *SendTxResult, *big.Int, *RPCClient] + txSender *multinode.TransactionSender[*types.Transaction, *SendTxResult, *big.Int, *RPCClient] logger logger.SugaredLogger chainType chaintype.ChainType clientErrors evmconfig.ClientErrors @@ -111,15 +111,15 @@ func NewChainClient( lggr logger.Logger, selectionMode string, leaseDuration time.Duration, - nodes []commonclient.Node[*big.Int, *RPCClient], - sendonlys []commonclient.SendOnlyNode[*big.Int, *RPCClient], + nodes []multinode.Node[*big.Int, *RPCClient], + sendonlys []multinode.SendOnlyNode[*big.Int, *RPCClient], chainID *big.Int, clientErrors evmconfig.ClientErrors, deathDeclarationDelay time.Duration, chainType chaintype.ChainType, ) Client { chainFamily := "EVM" - multiNode := commonclient.NewMultiNode[*big.Int, *RPCClient]( + multiNode := multinode.NewMultiNode[*big.Int, *RPCClient]( lggr, selectionMode, leaseDuration, @@ -130,7 +130,7 @@ func NewChainClient( deathDeclarationDelay, ) - txSender := commonclient.NewTransactionSender[*types.Transaction, *SendTxResult, *big.Int, *RPCClient]( + txSender := multinode.NewTransactionSender[*types.Transaction, *SendTxResult, *big.Int, *RPCClient]( lggr, chainID, chainFamily, @@ -389,7 +389,7 @@ func (c *chainClient) SendTransaction(ctx context.Context, tx *types.Transaction return result.Error() } -func (c *chainClient) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (commonclient.SendTxReturnCode, error) { +func (c *chainClient) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (multinode.SendTxReturnCode, error) { err := c.SendTransaction(ctx, tx) returnCode := ClassifySendError(err, c.clientErrors, c.logger, tx, fromAddress, c.IsL2()) return returnCode, err diff --git a/core/chains/evm/client/chain_client_test.go b/core/chains/evm/client/chain_client_test.go index 77e11db7a90..e775feb1434 100644 --- a/core/chains/evm/client/chain_client_test.go +++ b/core/chains/evm/client/chain_client_test.go @@ -25,8 +25,8 @@ import ( "github.com/tidwall/gjson" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -39,7 +39,7 @@ func mustNewChainClient(t *testing.T, wsURL string, sendonlys ...url.URL) client func mustNewChainClientWithChainID(t *testing.T, wsURL string, chainID *big.Int, sendonlys ...url.URL) client.Client { cfg := client.TestNodePoolConfig{ - NodeSelectionMode: commonclient.NodeSelectionModeRoundRobin, + NodeSelectionMode: multinode.NodeSelectionModeRoundRobin, } c, err := client.NewChainClientWithTestNode(t, cfg, time.Second*0, cfg.NodeLeaseDuration, wsURL, nil, sendonlys, 42, chainID) require.NoError(t, err) @@ -491,7 +491,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.Fatal) + assert.Equal(t, multinode.Fatal, errType) }) t.Run("returns TransactionAlreadyKnown error type when error message is nonce too low", func(t *testing.T) { @@ -517,7 +517,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.TransactionAlreadyKnown) + assert.Equal(t, multinode.TransactionAlreadyKnown, errType) }) t.Run("returns Successful error type when there is no error message", func(t *testing.T) { @@ -542,7 +542,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.NoError(t, err) - assert.Equal(t, errType, commonclient.Successful) + assert.Equal(t, multinode.Successful, errType) }) t.Run("returns Underpriced error type when transaction is terminally underpriced", func(t *testing.T) { @@ -568,7 +568,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.Underpriced) + assert.Equal(t, multinode.Underpriced, errType) }) t.Run("returns Unsupported error type when error message is queue full", func(t *testing.T) { @@ -594,7 +594,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.Unsupported) + assert.Equal(t, multinode.Unsupported, errType) }) t.Run("returns Retryable error type when there is a transaction gap", func(t *testing.T) { @@ -620,7 +620,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.Retryable) + assert.Equal(t, multinode.Retryable, errType) }) t.Run("returns InsufficientFunds error type when the sender address doesn't have enough funds", func(t *testing.T) { @@ -646,7 +646,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.InsufficientFunds) + assert.Equal(t, multinode.InsufficientFunds, errType) }) t.Run("returns ExceedsFeeCap error type when gas price is too high for the node", func(t *testing.T) { @@ -672,7 +672,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.ExceedsMaxFee) + assert.Equal(t, multinode.ExceedsMaxFee, errType) }) t.Run("returns Unknown error type when the error can't be categorized", func(t *testing.T) { @@ -698,7 +698,7 @@ func TestEthClient_SendTransactionReturnCode(t *testing.T) { errType, err := ethClient.SendTransactionReturnCode(tests.Context(t), tx, fromAddress) assert.Error(t, err) - assert.Equal(t, errType, commonclient.Unknown) + assert.Equal(t, multinode.Unknown, errType) }) } @@ -793,34 +793,34 @@ func TestEthClient_ErroringClient(t *testing.T) { ctx := tests.Context(t) // Empty node means there are no active nodes to select from, causing client to always return error. - erroringClient := client.NewChainClientWithEmptyNode(t, commonclient.NodeSelectionModeRoundRobin, time.Second*0, time.Second*0, testutils.FixtureChainID) + erroringClient := client.NewChainClientWithEmptyNode(t, multinode.NodeSelectionModeRoundRobin, time.Second*0, time.Second*0, testutils.FixtureChainID) _, err := erroringClient.BalanceAt(ctx, common.Address{}, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) err = erroringClient.BatchCallContext(ctx, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) err = erroringClient.BatchCallContextAll(ctx, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.BlockByHash(ctx, common.Hash{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.BlockByNumber(ctx, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) err = erroringClient.CallContext(ctx, nil, "") - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.CallContract(ctx, ethereum.CallMsg{}, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) id := erroringClient.ConfiguredChainID() require.Equal(t, id, big.NewInt(0)) _, err = erroringClient.CodeAt(ctx, common.Address{}, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) id = erroringClient.ConfiguredChainID() require.Equal(t, id, testutils.FixtureChainID) @@ -829,67 +829,67 @@ func TestEthClient_ErroringClient(t *testing.T) { require.ErrorContains(t, err, "no available nodes for chain") _, err = erroringClient.EstimateGas(ctx, ethereum.CallMsg{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.FilterLogs(ctx, ethereum.FilterQuery{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.HeaderByHash(ctx, common.Hash{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.HeaderByNumber(ctx, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.HeadByHash(ctx, common.Hash{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.HeadByNumber(ctx, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.LINKBalance(ctx, common.Address{}, common.Address{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.LatestBlockHeight(ctx) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.PendingCodeAt(ctx, common.Address{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.PendingNonceAt(ctx, common.Address{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) txSenderNotStarted := errors.New("TransactionSender not started") err = erroringClient.SendTransaction(ctx, nil) - require.Equal(t, err, txSenderNotStarted) + require.Equal(t, txSenderNotStarted, err) tx := testutils.NewLegacyTransaction(uint64(42), testutils.NewAddress(), big.NewInt(142), 242, big.NewInt(342), []byte{1, 2, 3}) code, err := erroringClient.SendTransactionReturnCode(ctx, tx, common.Address{}) - require.Equal(t, code, commonclient.Unknown) - require.Equal(t, err, txSenderNotStarted) + require.Equal(t, multinode.Unknown, code) + require.Equal(t, txSenderNotStarted, err) _, err = erroringClient.NonceAt(ctx, common.Address{}, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, nil) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, _, err = erroringClient.SubscribeToHeads(ctx) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.SuggestGasPrice(ctx) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.SuggestGasTipCap(ctx) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.TokenBalance(ctx, common.Address{}, common.Address{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.TransactionByHash(ctx, common.Hash{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) _, err = erroringClient.TransactionReceipt(ctx, common.Hash{}) - require.Equal(t, err, commonclient.ErroringNodeError) + require.Equal(t, multinode.ErrNodeError, err) } const headResult = client.HeadResult diff --git a/core/chains/evm/client/config_builder.go b/core/chains/evm/client/config_builder.go index 66bdfc2614f..7b412815557 100644 --- a/core/chains/evm/client/config_builder.go +++ b/core/chains/evm/client/config_builder.go @@ -8,8 +8,8 @@ import ( "go.uber.org/multierr" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" @@ -44,7 +44,7 @@ func NewClientConfigs( noNewFinalizedHeadsThreshold time.Duration, finalizedBlockPollInterval time.Duration, newHeadsPollInterval time.Duration, -) (commonclient.ChainConfig, evmconfig.NodePool, []*toml.Node, error) { +) (multinode.ChainConfig, evmconfig.NodePool, []*toml.Node, error) { nodes, err := parseNodeConfigs(nodeCfgs) if err != nil { return nil, nil, nil, err diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index eaa33f041ac..871e574aea2 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -14,8 +14,8 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" commontypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/label" ) @@ -407,7 +407,7 @@ func (s *SendError) IsServiceUnavailable(configErrors *ClientErrors) bool { return false } - return s.is(ServiceUnavailable, configErrors) || pkgerrors.Is(s.err, commonclient.ErroringNodeError) + return s.is(ServiceUnavailable, configErrors) || pkgerrors.Is(s.err, multinode.ErrNodeError) } // IsServiceTimeout indicates if the error was caused by a service timeout @@ -571,10 +571,10 @@ func ExtractRPCError(baseErr error) (*JsonError, error) { return &jErr, nil } -func ClassifySendError(err error, clientErrors config.ClientErrors, lggr logger.SugaredLogger, tx *types.Transaction, fromAddress common.Address, isL2 bool) commonclient.SendTxReturnCode { +func ClassifySendError(err error, clientErrors config.ClientErrors, lggr logger.SugaredLogger, tx *types.Transaction, fromAddress common.Address, isL2 bool) multinode.SendTxReturnCode { sendError := NewSendError(err) if sendError == nil { - return commonclient.Successful + return multinode.Successful } configErrors := ClientErrorRegexes(clientErrors) @@ -582,13 +582,13 @@ func ClassifySendError(err error, clientErrors config.ClientErrors, lggr logger. if sendError.Fatal(configErrors) { lggr.Criticalw("Fatal error sending transaction", "err", sendError, "etx", tx) // Attempt is thrown away in this case; we don't need it since it never got accepted by a node - return commonclient.Fatal + return multinode.Fatal } if sendError.IsNonceTooLowError(configErrors) || sendError.IsTransactionAlreadyMined(configErrors) { lggr.Debugw(fmt.Sprintf("Transaction already confirmed for this nonce: %d", tx.Nonce()), "err", sendError, "etx", tx) // Nonce too low indicated that a transaction at this nonce was confirmed already. // Mark it as TransactionAlreadyKnown. - return commonclient.TransactionAlreadyKnown + return multinode.TransactionAlreadyKnown } if sendError.IsReplacementUnderpriced(configErrors) { lggr.Errorw(fmt.Sprintf("Replacement transaction underpriced for eth_tx %x. "+ @@ -596,57 +596,57 @@ func ClassifySendError(err error, clientErrors config.ClientErrors, lggr logger. tx.Hash()), "gasPrice", tx.GasPrice, "gasTipCap", tx.GasTipCap, "gasFeeCap", tx.GasFeeCap, "err", sendError, "etx", tx) // Assume success and hand off to the next cycle. - return commonclient.Successful + return multinode.Successful } if sendError.IsTransactionAlreadyInMempool(configErrors) { lggr.Debugw("Transaction already in mempool", "etx", tx, "err", sendError) - return commonclient.Successful + return multinode.Successful } if sendError.IsTemporarilyUnderpriced(configErrors) { lggr.Infow("Transaction temporarily underpriced", "err", sendError) - return commonclient.Successful + return multinode.Successful } if sendError.IsTerminallyUnderpriced(configErrors) { lggr.Errorw("Transaction terminally underpriced", "etx", tx, "err", sendError) - return commonclient.Underpriced + return multinode.Underpriced } if sendError.L2FeeTooLow(configErrors) || sendError.IsL2FeeTooHigh(configErrors) || sendError.IsL2Full(configErrors) { if isL2 { lggr.Errorw("Transaction fee out of range", "err", sendError, "etx", tx) - return commonclient.FeeOutOfValidRange + return multinode.FeeOutOfValidRange } lggr.Errorw("this error type only handled for L2s", "err", sendError, "etx", tx) - return commonclient.Unsupported + return multinode.Unsupported } if sendError.IsNonceTooHighError(configErrors) { // This error occurs when the tx nonce is greater than current_nonce + tx_count_in_mempool, // instead of keeping the tx in mempool. This can happen if previous transactions haven't // reached the client yet. The correct thing to do is to mark it as retryable. lggr.Warnw("Transaction has a nonce gap.", "err", sendError, "etx", tx) - return commonclient.Retryable + return multinode.Retryable } if sendError.IsInsufficientEth(configErrors) { lggr.Criticalw(fmt.Sprintf("Tx %x with type 0x%d was rejected due to insufficient eth: %s\n"+ "ACTION REQUIRED: Chainlink wallet with address 0x%x is OUT OF FUNDS", tx.Hash(), tx.Type(), sendError.Error(), fromAddress, ), "err", sendError, "etx", tx) - return commonclient.InsufficientFunds + return multinode.InsufficientFunds } if sendError.IsServiceUnavailable(configErrors) { lggr.Errorw(fmt.Sprintf("service unavailable while sending transaction %x", tx.Hash()), "err", sendError, "etx", tx) - return commonclient.Retryable + return multinode.Retryable } if sendError.IsServiceTimeout(configErrors) { lggr.Errorw(fmt.Sprintf("service timed out while sending transaction %x", tx.Hash()), "err", sendError, "etx", tx) - return commonclient.Retryable + return multinode.Retryable } if sendError.IsTimeout() { lggr.Errorw(fmt.Sprintf("timeout while sending transaction %x", tx.Hash()), "err", sendError, "etx", tx) - return commonclient.Retryable + return multinode.Retryable } if sendError.IsCanceled() { lggr.Errorw(fmt.Sprintf("context was canceled while sending transaction %x", tx.Hash()), "err", sendError, "etx", tx) - return commonclient.Retryable + return multinode.Retryable } if sendError.IsTxFeeExceedsCap(configErrors) { lggr.Criticalw(fmt.Sprintf("Sending transaction failed: %s", label.RPCTxFeeCapConfiguredIncorrectlyWarning), @@ -654,15 +654,15 @@ func ClassifySendError(err error, clientErrors config.ClientErrors, lggr logger. "err", sendError, "id", "RPCTxFeeCapExceeded", ) - return commonclient.ExceedsMaxFee + return multinode.ExceedsMaxFee } if sendError.IsTerminallyStuckConfigError(configErrors) { lggr.Warnw("Transaction that would have been terminally stuck in the mempool detected on send. Marking as fatal error.", "err", sendError, "etx", tx) // Attempt is thrown away in this case; we don't need it since it never got accepted by a node - return commonclient.TerminallyStuck + return multinode.TerminallyStuck } lggr.Criticalw("Unknown error encountered when sending transaction", "err", err, "etx", tx) - return commonclient.Unknown + return multinode.Unknown } var infura = ClientErrors{ diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index 7ba042ab5c6..9a046922abb 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -9,7 +9,8 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/stretchr/testify/assert" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink-framework/multinode" + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" ) @@ -255,9 +256,9 @@ func Test_Eth_Errors(t *testing.T) { assert.Equal(t, err.IsServiceUnavailable(clientErrors), test.expect) } { - err = evmclient.NewSendError(commonclient.ErroringNodeError) + err = evmclient.NewSendError(multinode.ErrNodeError) assert.True(t, err.IsServiceUnavailable(clientErrors)) - err = evmclient.NewSendError(fmt.Errorf("failed to send transaction: %w", commonclient.ErroringNodeError)) + err = evmclient.NewSendError(fmt.Errorf("failed to send transaction: %w", multinode.ErrNodeError)) assert.True(t, err.IsServiceUnavailable(clientErrors)) } }) diff --git a/core/chains/evm/client/evm_client.go b/core/chains/evm/client/evm_client.go index 18206265fd7..bf985bdfa28 100644 --- a/core/chains/evm/client/evm_client.go +++ b/core/chains/evm/client/evm_client.go @@ -6,6 +6,7 @@ import ( "time" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-framework/multinode" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" @@ -13,22 +14,22 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" ) -func NewEvmClient(cfg evmconfig.NodePool, chainCfg commonclient.ChainConfig, clientErrors evmconfig.ClientErrors, lggr logger.Logger, chainID *big.Int, nodes []*toml.Node, chainType chaintype.ChainType) (Client, error) { - var primaries []commonclient.Node[*big.Int, *RPCClient] - var sendonlys []commonclient.SendOnlyNode[*big.Int, *RPCClient] +func NewEvmClient(cfg evmconfig.NodePool, chainCfg multinode.ChainConfig, clientErrors evmconfig.ClientErrors, lggr logger.Logger, chainID *big.Int, nodes []*toml.Node, chainType chaintype.ChainType) (Client, error) { + var primaries []multinode.Node[*big.Int, *RPCClient] + var sendonlys []multinode.SendOnlyNode[*big.Int, *RPCClient] largePayloadRPCTimeout, defaultRPCTimeout := getRPCTimeouts(chainType) for i, node := range nodes { if node.SendOnly != nil && *node.SendOnly { rpc := NewRPCClient(cfg, lggr, nil, node.HTTPURL.URL(), *node.Name, i, chainID, - commonclient.Secondary, largePayloadRPCTimeout, defaultRPCTimeout, chainType) - sendonly := commonclient.NewSendOnlyNode(lggr, (url.URL)(*node.HTTPURL), + multinode.Secondary, largePayloadRPCTimeout, defaultRPCTimeout, chainType) + sendonly := multinode.NewSendOnlyNode(lggr, (url.URL)(*node.HTTPURL), *node.Name, chainID, rpc) sendonlys = append(sendonlys, sendonly) } else { rpc := NewRPCClient(cfg, lggr, node.WSURL.URL(), node.HTTPURL.URL(), *node.Name, i, - chainID, commonclient.Primary, largePayloadRPCTimeout, defaultRPCTimeout, chainType) - primaryNode := commonclient.NewNode(cfg, chainCfg, + chainID, multinode.Primary, largePayloadRPCTimeout, defaultRPCTimeout, chainType) + primaryNode := multinode.NewNode(cfg, chainCfg, lggr, node.WSURL.URL(), node.HTTPURL.URL(), *node.Name, i, chainID, *node.Order, rpc, "EVM") primaries = append(primaries, primaryNode) diff --git a/core/chains/evm/client/helpers_test.go b/core/chains/evm/client/helpers_test.go index 6369c9dca12..2a68870e2e5 100644 --- a/core/chains/evm/client/helpers_test.go +++ b/core/chains/evm/client/helpers_test.go @@ -12,8 +12,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-framework/multinode" + "github.com/smartcontractkit/chainlink-framework/multinode/mocks" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" - clientMocks "github.com/smartcontractkit/chainlink/v2/common/client/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -129,7 +130,7 @@ func (tc TestNodePoolConfig) DeathDeclarationDelay() time.Duration { func NewChainClientWithTestNode( t *testing.T, - nodeCfg commonclient.NodeConfig, + nodeCfg multinode.NodeConfig, noNewHeadsThreshold time.Duration, leaseDuration time.Duration, rpcUrl string, @@ -151,21 +152,21 @@ func NewChainClientWithTestNode( nodePoolCfg := TestNodePoolConfig{ NodeFinalizedBlockPollInterval: 1 * time.Second, } - rpc := NewRPCClient(nodePoolCfg, lggr, parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := NewRPCClient(nodePoolCfg, lggr, parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") - n := commonclient.NewNode[*big.Int, *evmtypes.Head, *RPCClient]( - nodeCfg, clientMocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, parsed, rpcHTTPURL, "eth-primary-node-0", id, chainID, 1, rpc, "EVM") - primaries := []commonclient.Node[*big.Int, *RPCClient]{n} + n := multinode.NewNode[*big.Int, *evmtypes.Head, *RPCClient]( + nodeCfg, mocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, parsed, rpcHTTPURL, "eth-primary-node-0", id, chainID, 1, rpc, "EVM") + primaries := []multinode.Node[*big.Int, *RPCClient]{n} - var sendonlys []commonclient.SendOnlyNode[*big.Int, *RPCClient] + sendonlys := make([]multinode.SendOnlyNode[*big.Int, *RPCClient], len(sendonlyRPCURLs)) for i, u := range sendonlyRPCURLs { if u.Scheme != "http" && u.Scheme != "https" { return nil, pkgerrors.Errorf("sendonly ethereum rpc url scheme must be http(s): %s", u.String()) } - rpc := NewRPCClient(nodePoolCfg, lggr, nil, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, commonclient.Secondary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") - s := commonclient.NewSendOnlyNode[*big.Int, *RPCClient]( + rpc := NewRPCClient(nodePoolCfg, lggr, nil, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, multinode.Secondary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + s := multinode.NewSendOnlyNode[*big.Int, *RPCClient]( lggr, u, fmt.Sprintf("eth-sendonly-%d", i), chainID, rpc) - sendonlys = append(sendonlys, s) + sendonlys[i] = s } clientErrors := NewTestClientErrors() @@ -199,13 +200,13 @@ func NewChainClientWithMockedRpc( lggr := logger.Test(t) cfg := TestNodePoolConfig{ - NodeSelectionMode: commonclient.NodeSelectionModeRoundRobin, + NodeSelectionMode: multinode.NodeSelectionModeRoundRobin, } parsed, _ := url.ParseRequestURI("ws://test") - n := commonclient.NewNode[*big.Int, *evmtypes.Head, *RPCClient]( - cfg, clientMocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, parsed, nil, "eth-primary-node-0", 1, chainID, 1, rpc, "EVM") - primaries := []commonclient.Node[*big.Int, *RPCClient]{n} + n := multinode.NewNode[*big.Int, *evmtypes.Head, *RPCClient]( + cfg, mocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, parsed, nil, "eth-primary-node-0", 1, chainID, 1, rpc, "EVM") + primaries := []multinode.Node[*big.Int, *RPCClient]{n} clientErrors := NewTestClientErrors() c := NewChainClient(lggr, selectionMode, leaseDuration, primaries, nil, chainID, &clientErrors, 0, "") t.Cleanup(c.Close) diff --git a/core/chains/evm/client/mocks/client.go b/core/chains/evm/client/mocks/client.go index b55c608a590..b712c297c18 100644 --- a/core/chains/evm/client/mocks/client.go +++ b/core/chains/evm/client/mocks/client.go @@ -11,8 +11,6 @@ import ( common "github.com/ethereum/go-ethereum/common" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" - context "context" ethereum "github.com/ethereum/go-ethereum" @@ -21,6 +19,8 @@ import ( mock "github.com/stretchr/testify/mock" + multinode "github.com/smartcontractkit/chainlink-framework/multinode" + rpc "github.com/ethereum/go-ethereum/rpc" types "github.com/ethereum/go-ethereum/core/types" @@ -1628,22 +1628,22 @@ func (_c *Client_SendTransaction_Call) RunAndReturn(run func(context.Context, *t } // SendTransactionReturnCode provides a mock function with given fields: ctx, tx, fromAddress -func (_m *Client) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (commonclient.SendTxReturnCode, error) { +func (_m *Client) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (multinode.SendTxReturnCode, error) { ret := _m.Called(ctx, tx, fromAddress) if len(ret) == 0 { panic("no return value specified for SendTransactionReturnCode") } - var r0 commonclient.SendTxReturnCode + var r0 multinode.SendTxReturnCode var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) (commonclient.SendTxReturnCode, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) (multinode.SendTxReturnCode, error)); ok { return rf(ctx, tx, fromAddress) } - if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) commonclient.SendTxReturnCode); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) multinode.SendTxReturnCode); ok { r0 = rf(ctx, tx, fromAddress) } else { - r0 = ret.Get(0).(commonclient.SendTxReturnCode) + r0 = ret.Get(0).(multinode.SendTxReturnCode) } if rf, ok := ret.Get(1).(func(context.Context, *types.Transaction, common.Address) error); ok { @@ -1675,12 +1675,12 @@ func (_c *Client_SendTransactionReturnCode_Call) Run(run func(ctx context.Contex return _c } -func (_c *Client_SendTransactionReturnCode_Call) Return(_a0 commonclient.SendTxReturnCode, _a1 error) *Client_SendTransactionReturnCode_Call { +func (_c *Client_SendTransactionReturnCode_Call) Return(_a0 multinode.SendTxReturnCode, _a1 error) *Client_SendTransactionReturnCode_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Client_SendTransactionReturnCode_Call) RunAndReturn(run func(context.Context, *types.Transaction, common.Address) (commonclient.SendTxReturnCode, error)) *Client_SendTransactionReturnCode_Call { +func (_c *Client_SendTransactionReturnCode_Call) RunAndReturn(run func(context.Context, *types.Transaction, common.Address) (multinode.SendTxReturnCode, error)) *Client_SendTransactionReturnCode_Call { _c.Call.Return(run) return _c } diff --git a/core/chains/evm/client/null_client.go b/core/chains/evm/client/null_client.go index b1dedd3f74a..6b40ba93eb7 100644 --- a/core/chains/evm/client/null_client.go +++ b/core/chains/evm/client/null_client.go @@ -11,8 +11,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -122,9 +122,9 @@ func (nc *NullClient) HeaderByHash(ctx context.Context, h common.Hash) (*types.H return nil, nil } -func (nc *NullClient) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, sender common.Address) (commonclient.SendTxReturnCode, error) { +func (nc *NullClient) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, sender common.Address) (multinode.SendTxReturnCode, error) { nc.lggr.Debug("SendTransactionReturnCode") - return commonclient.Successful, nil + return multinode.Successful, nil } func (nc *NullClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { diff --git a/core/chains/evm/client/rpc_client.go b/core/chains/evm/client/rpc_client.go index 35d2a6dcd6b..f560a26dda6 100644 --- a/core/chains/evm/client/rpc_client.go +++ b/core/chains/evm/client/rpc_client.go @@ -26,9 +26,8 @@ import ( commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" - commontypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" @@ -93,7 +92,7 @@ type RPCClient struct { name string id int chainID *big.Int - tier commonclient.NodeTier + tier multinode.NodeTier largePayloadRPCTimeout time.Duration finalizedBlockPollInterval time.Duration newHeadsPollInterval time.Duration @@ -118,13 +117,13 @@ type RPCClient struct { chainInfoLock sync.RWMutex // intercepted values seen by callers of the RPCClient excluding health check calls. Need to ensure MultiNode provides repeatable read guarantee - highestUserObservations commonclient.ChainInfo + highestUserObservations multinode.ChainInfo // most recent chain info observed during current lifecycle (reseted on DisconnectAll) - latestChainInfo commonclient.ChainInfo + latestChainInfo multinode.ChainInfo } -var _ commonclient.RPCClient[*big.Int, *evmtypes.Head] = (*RPCClient)(nil) -var _ commonclient.SendTxRPCClient[*types.Transaction, *SendTxResult] = (*RPCClient)(nil) +var _ multinode.RPCClient[*big.Int, *evmtypes.Head] = (*RPCClient)(nil) +var _ multinode.SendTxRPCClient[*types.Transaction, *SendTxResult] = (*RPCClient)(nil) func NewRPCClient( cfg config.NodePool, @@ -134,7 +133,7 @@ func NewRPCClient( name string, id int, chainID *big.Int, - tier commonclient.NodeTier, + tier multinode.NodeTier, largePayloadRPCTimeout time.Duration, rpcTimeout time.Duration, chainType chaintype.ChainType, @@ -181,11 +180,11 @@ func (r *RPCClient) Ping(ctx context.Context) error { return err } -func (r *RPCClient) UnsubscribeAllExcept(subs ...commontypes.Subscription) { +func (r *RPCClient) UnsubscribeAllExcept(subs ...multinode.Subscription) { r.subsSliceMu.Lock() defer r.subsSliceMu.Unlock() - keepSubs := map[commontypes.Subscription]struct{}{} + keepSubs := map[multinode.Subscription]struct{}{} for _, sub := range subs { keepSubs[sub] = struct{}{} } @@ -265,7 +264,7 @@ func (r *RPCClient) Close() { r.cancelInflightRequests() r.UnsubscribeAllExcept() r.chainInfoLock.Lock() - r.latestChainInfo = commonclient.ChainInfo{} + r.latestChainInfo = multinode.ChainInfo{} r.chainInfoLock.Unlock() } @@ -452,7 +451,7 @@ func isRequestingFinalizedBlock(el rpc.BatchElem) bool { } } -func (r *RPCClient) SubscribeToHeads(ctx context.Context) (ch <-chan *evmtypes.Head, sub commontypes.Subscription, err error) { +func (r *RPCClient) SubscribeToHeads(ctx context.Context) (ch <-chan *evmtypes.Head, sub multinode.Subscription, err error) { ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) defer cancel() args := []interface{}{rpcSubscriptionMethodNewHeads} @@ -463,10 +462,10 @@ func (r *RPCClient) SubscribeToHeads(ctx context.Context) (ch <-chan *evmtypes.H if r.newHeadsPollInterval > 0 { interval := r.newHeadsPollInterval timeout := interval - isHealthCheckRequest := commonclient.CtxIsHeathCheckRequest(ctx) - poller, channel := commonclient.NewPoller[*evmtypes.Head](interval, func(ctx context.Context) (*evmtypes.Head, error) { + isHealthCheckRequest := multinode.CtxIsHeathCheckRequest(ctx) + poller, channel := multinode.NewPoller[*evmtypes.Head](interval, func(ctx context.Context) (*evmtypes.Head, error) { if isHealthCheckRequest { - ctx = commonclient.CtxAddHealthCheckFlag(ctx) + ctx = multinode.CtxAddHealthCheckFlag(ctx) } return r.latestBlock(ctx) }, timeout, r.rpcLog) @@ -514,7 +513,7 @@ func (r *RPCClient) SubscribeToHeads(ctx context.Context) (ch <-chan *evmtypes.H return channel, forwarder, err } -func (r *RPCClient) SubscribeToFinalizedHeads(ctx context.Context) (<-chan *evmtypes.Head, commontypes.Subscription, error) { +func (r *RPCClient) SubscribeToFinalizedHeads(ctx context.Context) (<-chan *evmtypes.Head, multinode.Subscription, error) { ctx, cancel, chStopInFlight, _, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) defer cancel() @@ -523,10 +522,10 @@ func (r *RPCClient) SubscribeToFinalizedHeads(ctx context.Context) (<-chan *evmt return nil, nil, errors.New("FinalizedBlockPollInterval is 0") } timeout := interval - isHealthCheckRequest := commonclient.CtxIsHeathCheckRequest(ctx) - poller, channel := commonclient.NewPoller[*evmtypes.Head](interval, func(ctx context.Context) (*evmtypes.Head, error) { + isHealthCheckRequest := multinode.CtxIsHeathCheckRequest(ctx) + poller, channel := multinode.NewPoller[*evmtypes.Head](interval, func(ctx context.Context) (*evmtypes.Head, error) { if isHealthCheckRequest { - ctx = commonclient.CtxAddHealthCheckFlag(ctx) + ctx = multinode.CtxAddHealthCheckFlag(ctx) } return r.LatestFinalizedBlock(ctx) }, timeout, r.rpcLog) @@ -811,10 +810,10 @@ func (r *RPCClient) BlockByNumberGeth(ctx context.Context, number *big.Int) (blo type SendTxResult struct { err error - code commonclient.SendTxReturnCode + code multinode.SendTxReturnCode } -var _ commonclient.SendTxResult = (*SendTxResult)(nil) +var _ multinode.SendTxResult = (*SendTxResult)(nil) func NewSendTxResult(err error) *SendTxResult { result := &SendTxResult{ @@ -827,7 +826,7 @@ func (r *SendTxResult) Error() error { return r.err } -func (r *SendTxResult) Code() commonclient.SendTxReturnCode { +func (r *SendTxResult) Code() multinode.SendTxReturnCode { return r.code } @@ -1418,9 +1417,9 @@ func (r *RPCClient) onNewHead(ctx context.Context, requestCh <-chan struct{}, he r.chainInfoLock.Lock() defer r.chainInfoLock.Unlock() - if !commonclient.CtxIsHeathCheckRequest(ctx) { + if !multinode.CtxIsHeathCheckRequest(ctx) { r.highestUserObservations.BlockNumber = max(r.highestUserObservations.BlockNumber, head.Number) - r.highestUserObservations.TotalDifficulty = commonclient.MaxTotalDifficulty(r.highestUserObservations.TotalDifficulty, head.TotalDifficulty) + r.highestUserObservations.TotalDifficulty = multinode.MaxTotalDifficulty(r.highestUserObservations.TotalDifficulty, head.TotalDifficulty) } select { case <-requestCh: // no need to update latestChainInfo, as RPCClient already started new life cycle @@ -1437,7 +1436,7 @@ func (r *RPCClient) onNewFinalizedHead(ctx context.Context, requestCh <-chan str } r.chainInfoLock.Lock() defer r.chainInfoLock.Unlock() - if !commonclient.CtxIsHeathCheckRequest(ctx) { + if !multinode.CtxIsHeathCheckRequest(ctx) { r.highestUserObservations.FinalizedBlockNumber = max(r.highestUserObservations.FinalizedBlockNumber, head.Number) } select { @@ -1448,7 +1447,7 @@ func (r *RPCClient) onNewFinalizedHead(ctx context.Context, requestCh <-chan str } } -func (r *RPCClient) GetInterceptedChainInfo() (latest, highestUserObservations commonclient.ChainInfo) { +func (r *RPCClient) GetInterceptedChainInfo() (latest, highestUserObservations multinode.ChainInfo) { r.chainInfoLock.Lock() defer r.chainInfoLock.Unlock() return r.latestChainInfo, r.highestUserObservations diff --git a/core/chains/evm/client/rpc_client_internal_test.go b/core/chains/evm/client/rpc_client_internal_test.go index ef321645fc2..ec1a89886cd 100644 --- a/core/chains/evm/client/rpc_client_internal_test.go +++ b/core/chains/evm/client/rpc_client_internal_test.go @@ -8,6 +8,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-framework/multinode" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -73,13 +74,13 @@ func TestRPCClient_MakeLogsValid(t *testing.T) { } for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - rpc := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") log, err := rpc.makeLogValid(ethtypes.Log{TxIndex: tc.TxIndex, Index: tc.LogIndex}) // non sei should return as is require.NoError(t, err) require.Equal(t, tc.TxIndex, log.TxIndex) require.Equal(t, tc.LogIndex, log.Index) - seiRPC := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + seiRPC := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) log, err = seiRPC.makeLogValid(ethtypes.Log{TxIndex: tc.TxIndex, Index: tc.LogIndex}) if tc.ExpectedError != nil { require.EqualError(t, err, tc.ExpectedError.Error()) diff --git a/core/chains/evm/client/rpc_client_test.go b/core/chains/evm/client/rpc_client_test.go index f6e7f9ee338..6fc02d3b2c1 100644 --- a/core/chains/evm/client/rpc_client_test.go +++ b/core/chains/evm/client/rpc_client_test.go @@ -25,8 +25,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-framework/multinode" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" - commontypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" @@ -74,7 +74,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { return } - checkClosedRPCClientShouldRemoveExistingSub := func(t tests.TestingT, ctx context.Context, sub commontypes.Subscription, rpcClient *client.RPCClient) { + checkClosedRPCClientShouldRemoveExistingSub := func(t tests.TestingT, ctx context.Context, sub multinode.Subscription, rpcClient *client.RPCClient) { errCh := sub.Err() rpcClient.UnsubscribeAllExcept() @@ -92,7 +92,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("WS and HTTP URL cannot be both empty", func(t *testing.T) { // ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing observedLggr := logger.Test(t) - rpcClient := client.NewRPCClient(nodePoolCfgHeadPolling, observedLggr, nil, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpcClient := client.NewRPCClient(nodePoolCfgHeadPolling, observedLggr, nil, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.Equal(t, errors.New("cannot dial rpc client when both ws and http info are missing"), rpcClient.Dial(ctx)) }) @@ -100,7 +100,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) // set to default values @@ -127,7 +127,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { assert.Equal(t, int64(0), latest.FinalizedBlockNumber) assert.Equal(t, big.NewInt(500), latest.TotalDifficulty) - assertHighestUserObservations := func(highestUserObservations commonclient.ChainInfo) { + assertHighestUserObservations := func(highestUserObservations multinode.ChainInfo) { assert.Equal(t, int64(256), highestUserObservations.BlockNumber) assert.Equal(t, int64(0), highestUserObservations.FinalizedBlockNumber) assert.Equal(t, big.NewInt(1000), highestUserObservations.TotalDifficulty) @@ -149,11 +149,11 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) - ch, sub, err := rpc.SubscribeToHeads(commonclient.CtxAddHealthCheckFlag(tests.Context(t))) + ch, sub, err := rpc.SubscribeToHeads(multinode.CtxAddHealthCheckFlag(tests.Context(t))) require.NoError(t, err) defer sub.Unsubscribe() go server.MustWriteBinaryMessageSync(t, makeNewHeadWSMessage(&evmtypes.Head{Number: 256, TotalDifficulty: big.NewInt(1000)})) @@ -192,7 +192,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, server.URL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) latest, highestUserObservations := rpc.GetInterceptedChainInfo() @@ -215,7 +215,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { // subscription with health check flag won't affect user observations sub.Unsubscribe() // stop prev subscription server.Head = &evmtypes.Head{Number: 256} - headCh, sub, err = rpc.SubscribeToHeads(commonclient.CtxAddHealthCheckFlag(tests.Context(t))) + headCh, sub, err = rpc.SubscribeToHeads(multinode.CtxAddHealthCheckFlag(tests.Context(t))) require.NoError(t, err) defer sub.Unsubscribe() @@ -231,7 +231,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) var wg sync.WaitGroup @@ -254,7 +254,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Block's chain ID matched configured", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch, sub, err := rpc.SubscribeToHeads(tests.Context(t)) @@ -270,7 +270,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(nodePoolCfgWSSub, observedLggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, _, err := rpc.SubscribeToHeads(ctx) @@ -280,7 +280,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Closed rpc client should remove existing SubscribeToHeads subscription with WS", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -292,7 +292,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -304,7 +304,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -315,7 +315,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Subscription error is properly wrapper", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) _, sub, err := rpc.SubscribeToHeads(ctx) @@ -345,7 +345,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { t.Run("Failed SubscribeFilterLogs when WSURL is empty", func(t *testing.T) { // ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing observedLggr := logger.Test(t) - rpcClient := client.NewRPCClient(nodePoolCfg, observedLggr, nil, &url.URL{}, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpcClient := client.NewRPCClient(nodePoolCfg, observedLggr, nil, &url.URL{}, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.Nil(t, rpcClient.Dial(ctx)) _, err := rpcClient.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -357,7 +357,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(nodePoolCfg, observedLggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -374,7 +374,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { return resp }) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) sub, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -403,7 +403,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { return }) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch := make(chan types.Log) @@ -498,7 +498,7 @@ func TestRPCClientFilterLogs(t *testing.T) { return }) wsURL := server.WSURL() - seiRPC := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + seiRPC := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) defer seiRPC.Close() require.NoError(t, seiRPC.Dial(ctx)) logs, err := seiRPC.FilterLogs(ctx, ethereum.FilterQuery{}) @@ -508,7 +508,7 @@ func TestRPCClientFilterLogs(t *testing.T) { } // non sei should return index as is - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) logs, err = rpc.FilterLogs(ctx, ethereum.FilterQuery{}) @@ -557,7 +557,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(nodePoolCfg, lggr, server.URL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) defer rpc.Close() server.Head.Store(&evmtypes.Head{Number: 128}) @@ -586,7 +586,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { // health check flg prevents change in highestUserObservations server.Head.Store(&evmtypes.Head{Number: 256}) - _, err = rpc.LatestFinalizedBlock(commonclient.CtxAddHealthCheckFlag(ctx)) + _, err = rpc.LatestFinalizedBlock(multinode.CtxAddHealthCheckFlag(ctx)) require.NoError(t, err) latest, highestUserObservations = rpc.GetInterceptedChainInfo() @@ -614,7 +614,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { // health check subscription only updates latest sub.Unsubscribe() // close previous one server.Head.Store(&evmtypes.Head{Number: 1024}) - ch, sub, err = rpc.SubscribeToFinalizedHeads(commonclient.CtxAddHealthCheckFlag(ctx)) + ch, sub, err = rpc.SubscribeToFinalizedHeads(multinode.CtxAddHealthCheckFlag(ctx)) require.NoError(t, err) defer sub.Unsubscribe() head = <-ch @@ -704,7 +704,7 @@ func TestRpcClientLargePayloadTimeout(t *testing.T) { // use something unreasonably large for RPC timeout to ensure that we use largePayloadRPCTimeout const rpcTimeout = time.Hour const largePayloadRPCTimeout = tests.TestInterval - rpc := client.NewRPCClient(nodePoolCfg, logger.Test(t), rpcURL, nil, "rpc", 1, chainId, commonclient.Primary, largePayloadRPCTimeout, rpcTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, logger.Test(t), rpcURL, nil, "rpc", 1, chainId, multinode.Primary, largePayloadRPCTimeout, rpcTimeout, "") require.NoError(t, rpc.Dial(ctx)) defer rpc.Close() err := testCase.Fn(ctx, rpc) @@ -749,7 +749,7 @@ func TestAstarCustomFinality(t *testing.T) { const expectedFinalizedBlockNumber = int64(4) const expectedFinalizedBlockHash = "0x7441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d22804" - rpcClient := client.NewRPCClient(nodePoolCfg, logger.Test(t), wsURL, nil, "rpc", 1, chainId, commonclient.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar) + rpcClient := client.NewRPCClient(nodePoolCfg, logger.Test(t), wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar) defer rpcClient.Close() err := rpcClient.Dial(tests.Context(t)) require.NoError(t, err) diff --git a/core/chains/evm/client/simulated_backend_client.go b/core/chains/evm/client/simulated_backend_client.go index fd645203856..7b325e861a5 100644 --- a/core/chains/evm/client/simulated_backend_client.go +++ b/core/chains/evm/client/simulated_backend_client.go @@ -24,8 +24,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" @@ -399,16 +399,16 @@ func (c *SimulatedBackendClient) HeaderByHash(ctx context.Context, h common.Hash return c.client.HeaderByHash(ctx, h) } -func (c *SimulatedBackendClient) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (commonclient.SendTxReturnCode, error) { +func (c *SimulatedBackendClient) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (multinode.SendTxReturnCode, error) { err := c.SendTransaction(ctx, tx) if err == nil { - return commonclient.Successful, nil + return multinode.Successful, nil } if strings.Contains(err.Error(), "could not fetch parent") || strings.Contains(err.Error(), "invalid transaction") { - return commonclient.Fatal, err + return multinode.Fatal, err } // All remaining error messages returned from SendTransaction are considered Unknown. - return commonclient.Unknown, err + return multinode.Unknown, err } // SendTransaction sends a transaction. diff --git a/core/chains/evm/txmgr/broadcaster_test.go b/core/chains/evm/txmgr/broadcaster_test.go index 311f1aae648..4ed6729466b 100644 --- a/core/chains/evm/txmgr/broadcaster_test.go +++ b/core/chains/evm/txmgr/broadcaster_test.go @@ -27,8 +27,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" commmonfee "github.com/smartcontractkit/chainlink/v2/common/fee" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -261,7 +261,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { } ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(2) && tx.Value().Cmp(big.NewInt(242)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Earlier tr := int32(99) @@ -289,7 +289,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { require.Equal(t, value.String(), tx.Value().String()) require.Equal(t, earlierEthTx.EncodedPayload, tx.Data()) return true - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Later laterEthTx := txmgr.Tx{ @@ -312,7 +312,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { require.Equal(t, value.String(), tx.Value().String()) require.Equal(t, laterEthTx.EncodedPayload, tx.Data()) return true - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Insertion order deliberately reversed to test ordering require.NoError(t, txStore.InsertTx(ctx, &expensiveEthTx)) @@ -394,7 +394,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { t.Run("sends transactions with type 0x2 in EIP-1559 mode", func(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(343) && tx.Value().Cmp(big.NewInt(242)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, []byte{42, 42, 0}, gasLimit, big.Int(assets.NewEthValue(242)), testutils.FixtureChainID) // Do the thing @@ -445,7 +445,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { } ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(344) && tx.Value().Cmp(big.NewInt(442)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() ethClient.On("CallContext", mock.Anything, mock.AnythingOfType("*hexutil.Bytes"), "eth_call", mock.MatchedBy(func(callarg map[string]interface{}) bool { if fmt.Sprintf("%s", callarg["value"]) == "0x1ba" { // 442 assert.Equal(t, txRequest.FromAddress, callarg["from"]) @@ -478,7 +478,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { t.Run("with unknown error, sends tx as normal", func(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(345) && tx.Value().Cmp(big.NewInt(542)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() ethClient.On("CallContext", mock.Anything, mock.AnythingOfType("*hexutil.Bytes"), "eth_call", mock.MatchedBy(func(callarg map[string]interface{}) bool { return fmt.Sprintf("%s", callarg["value"]) == "0x21e" // 542 }), "latest").Return(errors.New("this is not a revert, something unexpected went wrong")).Once() @@ -529,7 +529,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, []byte{42, 42, 0}, gasLimit, big.Int(assets.NewEthValue(243)), testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(346) && tx.Value().Cmp(big.NewInt(243)) == 0 - }), fromAddress).Return(commonclient.Fatal, errors.New(terminallyStuckError)).Once() + }), fromAddress).Return(multinode.Fatal, errors.New(terminallyStuckError)).Once() // Start processing unstarted transactions retryable, err := eb.ProcessUnstartedTxs(tests.Context(t), fromAddress) @@ -569,7 +569,7 @@ func TestEthBroadcaster_TransmitChecking(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == 0 && tx.Value().Cmp(big.NewInt(442)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() ethTx := mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, testutils.FixtureChainID, txRequestWithValue(big.Int(assets.NewEthValue(442))), @@ -592,7 +592,7 @@ func TestEthBroadcaster_TransmitChecking(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == 1 && tx.Value().Cmp(big.NewInt(442)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() ethTx := mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, testutils.FixtureChainID, txRequestWithValue(big.Int(assets.NewEthValue(442))), @@ -713,7 +713,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success_WithMultiplier(t *testing ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { assert.Equal(t, int(1600), int(tx.Gas())) return true - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() txRequest := txmgr.TxRequest{ FromAddress: fromAddress, @@ -799,7 +799,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(firstNonce) - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Do the thing { @@ -836,7 +836,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(firstNonce) - }), fromAddress).Return(commonclient.Fatal, errors.New("exceeds block gas limit")).Once() + }), fromAddress).Return(multinode.Fatal, errors.New("exceeds block gas limit")).Once() // Do the thing { @@ -873,7 +873,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(firstNonce) - }), fromAddress).Return(commonclient.Successful, errors.New("known transaction: a1313bd99a81fb4d8ad1d2e90b67c6b3fa77545c990d6251444b83b70b6f8980")).Once() + }), fromAddress).Return(multinode.Successful, errors.New("known transaction: a1313bd99a81fb4d8ad1d2e90b67c6b3fa77545c990d6251444b83b70b6f8980")).Once() // Do the thing { @@ -909,7 +909,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(firstNonce) - }), fromAddress).Return(commonclient.TransactionAlreadyKnown, errors.New("nonce too low")).Once() + }), fromAddress).Return(multinode.TransactionAlreadyKnown, errors.New("nonce too low")).Once() // Do the thing { @@ -947,7 +947,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(firstNonce) - }), fromAddress).Return(commonclient.Retryable, failedToReachNodeError).Once() + }), fromAddress).Return(multinode.Retryable, failedToReachNodeError).Once() // Do the thing retryable, err := eb.ProcessUnstartedTxs(tests.Context(t), fromAddress) @@ -994,7 +994,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { s, e := txmgr.GetGethSignedTx(attempt.SignedRawTx) require.NoError(t, e) return tx.Nonce() == uint64(firstNonce) && tx.GasPrice().Int64() == s.GasPrice().Int64() - }), fromAddress).Return(commonclient.Successful, errors.New("known transaction: a1313bd99a81fb4d8ad1d2e90b67c6b3fa77545c990d6251444b83b70b6f8980")).Once() + }), fromAddress).Return(multinode.Successful, errors.New("known transaction: a1313bd99a81fb4d8ad1d2e90b67c6b3fa77545c990d6251444b83b70b6f8980")).Once() // Do the thing { @@ -1059,7 +1059,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // First send, replacement underpriced ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(0) - }), fromAddress).Return(commonclient.Successful, errors.New("replacement transaction underpriced")).Once() + }), fromAddress).Return(multinode.Successful, errors.New("replacement transaction underpriced")).Once() // Do the thing retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) @@ -1096,7 +1096,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Fatal, errors.New(fatalErrorExample)).Once() + }), fromAddress).Return(multinode.Fatal, errors.New(fatalErrorExample)).Once() retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) assert.NoError(t, err) @@ -1146,7 +1146,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Fatal, errors.New(fatalErrorExample)).Once() + }), fromAddress).Return(multinode.Fatal, errors.New(fatalErrorExample)).Once() retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) require.Error(t, err) @@ -1167,7 +1167,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Fatal, errors.New(fatalErrorExample)).Once() + }), fromAddress).Return(multinode.Fatal, errors.New(fatalErrorExample)).Once() { retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) @@ -1200,7 +1200,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.ExceedsMaxFee, errors.New(TxFeeExceedsCapError)).Twice() + }), fromAddress).Return(multinode.ExceedsMaxFee, errors.New(TxFeeExceedsCapError)).Twice() // In the first case, the tx was NOT accepted into the mempool. In the case // of multiple RPC nodes, it is possible that it can be accepted by // another node even if the primary one returns "exceeds the configured @@ -1258,7 +1258,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Unknown, errors.New(retryableErrorExample)).Once() + }), fromAddress).Return(multinode.Unknown, errors.New(retryableErrorExample)).Once() // Nonce is the same as localNextNonce, implying that this sent transaction has not been accepted ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once() @@ -1284,7 +1284,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // Now on the second run, it is successful ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() retryable, err = eb.ProcessUnstartedTxs(ctx, fromAddress) assert.NoError(t, err) @@ -1310,7 +1310,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Unknown, errors.New(retryableErrorExample)).Once() + }), fromAddress).Return(multinode.Unknown, errors.New(retryableErrorExample)).Once() ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), errors.New("pending nonce fetch failed")).Once() // Do the thing @@ -1336,7 +1336,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // Now on the second run, it is successful ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() retryable, err = eb.ProcessUnstartedTxs(ctx, fromAddress) assert.NoError(t, err) @@ -1362,7 +1362,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Unknown, errors.New(retryableErrorExample)).Once() + }), fromAddress).Return(multinode.Unknown, errors.New(retryableErrorExample)).Once() // Nonce is one higher than localNextNonce, implying that despite the error, this sent transaction has been accepted into the mempool ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce+1, nil).Once() @@ -1396,17 +1396,17 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // First was underpriced ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasPrice().Cmp(evmcfg.EVM().GasEstimator().PriceDefault().ToInt()) == 0 - }), fromAddress).Return(commonclient.Underpriced, errors.New(underpricedError)).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New(underpricedError)).Once() // Second with gas bump was still underpriced ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasPrice().Cmp(big.NewInt(25000000000)) == 0 - }), fromAddress).Return(commonclient.Underpriced, errors.New(underpricedError)).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New(underpricedError)).Once() // Third succeeded ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasPrice().Cmp(big.NewInt(30000000000)) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Do the thing retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) @@ -1442,7 +1442,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Retryable, failedToReachNodeError).Once() + }), fromAddress).Return(multinode.Retryable, failedToReachNodeError).Once() // Do the thing retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) @@ -1473,7 +1473,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Successful, errors.New(temporarilyUnderpricedError)).Once() + }), fromAddress).Return(multinode.Successful, errors.New(temporarilyUnderpricedError)).Once() // Do the thing retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) @@ -1512,7 +1512,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // First was underpriced ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasPrice().Cmp(evmcfg2.EVM().GasEstimator().PriceDefault().ToInt()) == 0 - }), fromAddress).Return(commonclient.Underpriced, errors.New(underpricedError)).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New(underpricedError)).Once() // Do the thing retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress) @@ -1530,7 +1530,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.InsufficientFunds, errors.New(insufficientEthError)).Once() + }), fromAddress).Return(multinode.InsufficientFunds, errors.New(insufficientEthError)).Once() retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) require.Error(t, err) @@ -1560,7 +1560,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce - }), fromAddress).Return(commonclient.Retryable, errors.New(nonceGapError)).Once() + }), fromAddress).Return(multinode.Retryable, errors.New(nonceGapError)).Once() retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) require.Error(t, err) @@ -1604,7 +1604,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { localNextNonce = getLocalNextNonce(t, nonceTracker, fromAddress) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasTipCap().Cmp(big.NewInt(1)) == 0 - }), fromAddress).Return(commonclient.Underpriced, errors.New(underpricedError)).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New(underpricedError)).Once() // Check gas tip cap verification retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress) @@ -1635,15 +1635,15 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // Second was underpriced but above minimum ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasTipCap().Cmp(gasTipCapDefault.ToInt()) == 0 - }), fromAddress).Return(commonclient.Underpriced, errors.New(underpricedError)).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New(underpricedError)).Once() // Resend at the bumped price ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasTipCap().Cmp(big.NewInt(0).Add(gasTipCapDefault.ToInt(), evmcfg2.EVM().GasEstimator().BumpMin().ToInt())) == 0 - }), fromAddress).Return(commonclient.Underpriced, errors.New(underpricedError)).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New(underpricedError)).Once() // Final bump succeeds ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNextNonce && tx.GasTipCap().Cmp(big.NewInt(0).Add(gasTipCapDefault.ToInt(), big.NewInt(0).Mul(evmcfg2.EVM().GasEstimator().BumpMin().ToInt(), big.NewInt(2)))) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress) require.NoError(t, err) @@ -1693,7 +1693,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_GasEstimationError(t *testing.T) ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Once() ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(0) - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Do the thing retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) @@ -1860,7 +1860,7 @@ func TestEthBroadcaster_NonceTracker_InProgressTx(t *testing.T) { inProgressTxNonce := uint64(0) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == inProgressTxNonce - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Tx with nonce 0 in DB will set local nonce map to value to 1 mustInsertInProgressEthTxWithAttempt(t, txStore, evmtypes.Nonce(inProgressTxNonce), fromAddress) @@ -1903,7 +1903,7 @@ func TestEthBroadcaster_HederaBroadcastValidation(t *testing.T) { localNonce := uint64(0) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNonce - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(1), nil).Once() mustInsertInProgressEthTxWithAttempt(t, txStore, evmtypes.Nonce(localNonce), fromAddress) @@ -1923,7 +1923,7 @@ func TestEthBroadcaster_HederaBroadcastValidation(t *testing.T) { localNonce := uint64(0) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNonce - }), fromAddress).Return(commonclient.Successful, nil).Twice() + }), fromAddress).Return(multinode.Successful, nil).Twice() ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once() ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(1), nil).Once() @@ -1945,7 +1945,7 @@ func TestEthBroadcaster_HederaBroadcastValidation(t *testing.T) { localNonce := uint64(0) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == localNonce - }), fromAddress).Return(commonclient.Successful, nil).Times(4) + }), fromAddress).Return(multinode.Successful, nil).Times(4) ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Times(4) etx := mustInsertInProgressEthTxWithAttempt(t, txStore, evmtypes.Nonce(localNonce), fromAddress) diff --git a/core/chains/evm/txmgr/client.go b/core/chains/evm/txmgr/client.go index 9ec175048d3..adb70b8c9ef 100644 --- a/core/chains/evm/txmgr/client.go +++ b/core/chains/evm/txmgr/client.go @@ -15,8 +15,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" @@ -48,14 +48,14 @@ func (c *evmTxmClient) BatchSendTransactions( batchSize int, lggr logger.SugaredLogger, ) ( - codes []commonclient.SendTxReturnCode, + codes []multinode.SendTxReturnCode, txErrs []error, broadcastTime time.Time, successfulTxIDs []int64, err error, ) { // preallocate - codes = make([]commonclient.SendTxReturnCode, len(attempts)) + codes = make([]multinode.SendTxReturnCode, len(attempts)) txErrs = make([]error, len(attempts)) reqs, broadcastTime, successfulTxIDs, batchErr := batchSendTransactions(ctx, attempts, batchSize, lggr, c.client) @@ -95,11 +95,11 @@ func (c *evmTxmClient) BatchSendTransactions( return } -func (c *evmTxmClient) SendTransactionReturnCode(ctx context.Context, etx Tx, attempt TxAttempt, lggr logger.SugaredLogger) (commonclient.SendTxReturnCode, error) { +func (c *evmTxmClient) SendTransactionReturnCode(ctx context.Context, etx Tx, attempt TxAttempt, lggr logger.SugaredLogger) (multinode.SendTxReturnCode, error) { signedTx, err := GetGethSignedTx(attempt.SignedRawTx) if err != nil { lggr.Criticalw("Fatal error signing transaction", "err", err, "etx", etx) - return commonclient.Fatal, err + return multinode.Fatal, err } return c.client.SendTransactionReturnCode(ctx, signedTx, etx.FromAddress) } diff --git a/core/chains/evm/txmgr/confirmer_test.go b/core/chains/evm/txmgr/confirmer_test.go index ea251971860..a35765272bb 100644 --- a/core/chains/evm/txmgr/confirmer_test.go +++ b/core/chains/evm/txmgr/confirmer_test.go @@ -21,8 +21,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -751,7 +751,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing require.NoError(t, db.Get(&dbAttempt, `UPDATE evm.tx_attempts SET broadcast_before_block_num=$1 WHERE id=$2 RETURNING *`, oldEnough, attempt1.ID)) // Send transaction and assume success. - ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return(commonclient.Successful, nil).Once() + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return(multinode.Successful, nil).Once() err := ec.RebroadcastWhereNecessary(tests.Context(t), currentHead) require.NoError(t, err) @@ -800,7 +800,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing require.NoError(t, db.Get(&dbAttempt, `UPDATE evm.tx_attempts SET broadcast_before_block_num=$1 WHERE id=$2 RETURNING *`, oldEnough, attempt1.ID)) // Send transaction and assume success. - ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return(commonclient.Successful, nil).Once() + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return(multinode.Successful, nil).Once() err := ec.RebroadcastWhereNecessary(tests.Context(t), currentHead) require.NoError(t, err) @@ -862,7 +862,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_MaxFeeScenario(t *testing.T) { // Once for the bumped attempt which exceeds limit ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.GasPrice().Int64() == int64(20000000000) && tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.ExceedsMaxFee, errors.New("tx fee (1.10 ether) exceeds the configured cap (1.00 ether)")).Once() + }), fromAddress).Return(multinode.ExceedsMaxFee, errors.New("tx fee (1.10 ether) exceeds the configured cap (1.00 ether)")).Once() // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) @@ -940,7 +940,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Fatal, errors.New("exceeds block gas limit")).Once() + }), fromAddress).Return(multinode.Fatal, errors.New("exceeds block gas limit")).Once() require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) var err error @@ -960,7 +960,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) var err error @@ -1003,7 +1003,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, fmt.Errorf("known transaction: %s", etx.TxAttempts[0].Hash.Hex())).Once() + }), fromAddress).Return(multinode.Successful, fmt.Errorf("known transaction: %s", etx.TxAttempts[0].Hash.Hex())).Once() require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) var err error @@ -1030,7 +1030,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.TransactionAlreadyKnown, errors.New("nonce too low")).Once() + }), fromAddress).Return(multinode.TransactionAlreadyKnown, errors.New("nonce too low")).Once() require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) var err error @@ -1061,7 +1061,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Unknown, errors.New("some network error")).Once() + }), fromAddress).Return(multinode.Unknown, errors.New("some network error")).Once() err := ec.RebroadcastWhereNecessary(ctx, currentHead) require.Error(t, err) @@ -1085,7 +1085,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Try again and move the attempt into "broadcast" ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) @@ -1112,10 +1112,10 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Underpriced, errors.New("replacement transaction underpriced")).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New("replacement transaction underpriced")).Once() ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) @@ -1148,7 +1148,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Underpriced, errors.New("underpriced")).Once() // we already submitted at this price, now it's time to bump and submit again but since we simply resubmitted rather than increasing gas price, geth already knows about this tx + }), fromAddress).Return(multinode.Underpriced, errors.New("underpriced")).Once() // we already submitted at this price, now it's time to bump and submit again but since we simply resubmitted rather than increasing gas price, geth already knows about this tx // Do the thing require.Error(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) @@ -1179,7 +1179,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Underpriced, errors.New("underpriced")).Once() // we already submitted at this price, now it's time to bump and submit again but since we simply resubmitted rather than increasing gas price, geth already knows about this tx + }), fromAddress).Return(multinode.Underpriced, errors.New("underpriced")).Once() // we already submitted at this price, now it's time to bump and submit again but since we simply resubmitted rather than increasing gas price, geth already knows about this tx // Do the thing require.Error(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) @@ -1210,7 +1210,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) etx, err = txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -1242,7 +1242,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Underpriced, errors.New("underpriced")).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New("underpriced")).Once() require.Error(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) etx, err = txStore.FindTxWithAttempts(ctx, etx.ID) @@ -1273,10 +1273,10 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Underpriced, errors.New("replacement transaction underpriced")).Once() + }), fromAddress).Return(multinode.Underpriced, errors.New("replacement transaction underpriced")).Once() ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Do it require.NoError(t, ec.RebroadcastWhereNecessary(ctx, currentHead)) @@ -1330,10 +1330,10 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh // Fail the first time with terminally underpriced. ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( - commonclient.Underpriced, errors.New("Transaction gas price is too low. It does not satisfy your node's minimal gas price")).Once() + multinode.Underpriced, errors.New("Transaction gas price is too low. It does not satisfy your node's minimal gas price")).Once() // Succeed the second time after bumping gas. ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( - commonclient.Successful, nil).Once() + multinode.Successful, nil).Once() kst.On("SignTx", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( signedTx, nil, ).Once() @@ -1353,10 +1353,10 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh // Fail a few times with terminally underpriced ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( - commonclient.Underpriced, errors.New("Transaction gas price is too low. It does not satisfy your node's minimal gas price")).Times(3) + multinode.Underpriced, errors.New("Transaction gas price is too low. It does not satisfy your node's minimal gas price")).Times(3) // Succeed the second time after bumping gas. ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( - commonclient.Successful, nil).Once() + multinode.Successful, nil).Once() signedLegacyTx := new(types.Transaction) kst.On("SignTx", mock.Anything, mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Type() == 0x0 && tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 @@ -1385,10 +1385,10 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh // Fail a few times with terminally underpriced ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( - commonclient.Underpriced, errors.New("transaction underpriced")).Times(3) + multinode.Underpriced, errors.New("transaction underpriced")).Times(3) // Succeed the second time after bumping gas. ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( - commonclient.Successful, nil).Once() + multinode.Successful, nil).Once() signedDxFeeTx := new(types.Transaction) kst.On("SignTx", mock.Anything, mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Type() == 0x2 && tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 @@ -1445,7 +1445,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return expectedBumpedGasPrice.Cmp(tx.GasPrice()) == 0 - }), fromAddress).Return(commonclient.InsufficientFunds, insufficientEthError).Once() + }), fromAddress).Return(multinode.InsufficientFunds, insufficientEthError).Once() // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) @@ -1471,7 +1471,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return expectedBumpedGasPrice.Cmp(tx.GasPrice()) == 0 - }), fromAddress).Return(commonclient.InsufficientFunds, insufficientEthError).Once() + }), fromAddress).Return(multinode.InsufficientFunds, insufficientEthError).Once() // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) @@ -1496,7 +1496,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return expectedBumpedGasPrice.Cmp(tx.GasPrice()) == 0 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) @@ -1528,7 +1528,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { mustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, txStore, nonce, fromAddress) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(n) - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() nonce++ } @@ -1576,11 +1576,11 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyStuckError(t *testing. // Return terminally stuck error on first rebroadcast ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.TerminallyStuck, errors.New(terminallyStuckError)).Once() + }), fromAddress).Return(multinode.TerminallyStuck, errors.New(terminallyStuckError)).Once() // Return successful for purge attempt ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx.Sequence) //nolint:gosec // disable G115 - }), fromAddress).Return(commonclient.Successful, nil).Once() + }), fromAddress).Return(multinode.Successful, nil).Once() // Start processing transactions for rebroadcast require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) @@ -1622,7 +1622,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { tx.Gas() == overrideGasLimit && reflect.DeepEqual(tx.Data(), etx1.EncodedPayload) && tx.To().String() == etx1.ToAddress.String() - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() require.NoError(t, ec.ForceRebroadcast(tests.Context(t), []evmtypes.Nonce{1}, gasPriceWei, fromAddress, overrideGasLimit)) }) @@ -1637,7 +1637,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { tx.Gas() == etx1.FeeLimit && reflect.DeepEqual(tx.Data(), etx1.EncodedPayload) && tx.To().String() == etx1.ToAddress.String() - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() require.NoError(t, ec.ForceRebroadcast(tests.Context(t), []evmtypes.Nonce{(1)}, gasPriceWei, fromAddress, 0)) }) @@ -1648,10 +1648,10 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx1.Sequence) && tx.GasPrice().Int64() == gasPriceWei.GasPrice.Int64() && tx.Gas() == overrideGasLimit - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx2.Sequence) && tx.GasPrice().Int64() == gasPriceWei.GasPrice.Int64() && tx.Gas() == overrideGasLimit - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() require.NoError(t, ec.ForceRebroadcast(tests.Context(t), []evmtypes.Nonce{(1), (2)}, gasPriceWei, fromAddress, overrideGasLimit)) }) @@ -1662,10 +1662,10 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(1) - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(2) - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() for i := 3; i <= 5; i++ { nonce := i ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { @@ -1675,7 +1675,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { *tx.To() == fromAddress && tx.Value().Cmp(big.NewInt(0)) == 0 && len(tx.Data()) == 0 - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() } nonces := []evmtypes.Nonce{(1), (2), (3), (4), (5)} @@ -1688,7 +1688,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(0) && tx.GasPrice().Int64() == gasPriceWei.GasPrice.Int64() && tx.Gas() == config.EVM().GasEstimator().LimitDefault() - }), mock.Anything).Return(commonclient.Successful, nil).Once() + }), mock.Anything).Return(multinode.Successful, nil).Once() require.NoError(t, ec.ForceRebroadcast(tests.Context(t), []evmtypes.Nonce{(0)}, gasPriceWei, fromAddress, 0)) }) @@ -1702,7 +1702,7 @@ func TestEthConfirmer_ProcessStuckTransactions(t *testing.T) { ethKeyStore := cltest.NewKeyStore(t, db).Eth() _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) ethClient := testutils.NewEthClientMockWithDefaultChain(t) - ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return(commonclient.Successful, nil).Once() + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return(multinode.Successful, nil).Once() lggr := logger.Test(t) feeEstimator := gasmocks.NewEvmFeeEstimator(t) diff --git a/core/cmd/shell_local_test.go b/core/cmd/shell_local_test.go index 7cdc8c21840..5c9449b2107 100644 --- a/core/cmd/shell_local_test.go +++ b/core/cmd/shell_local_test.go @@ -12,8 +12,8 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" pgcommon "github.com/smartcontractkit/chainlink-common/pkg/sqlutil/pg" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + "github.com/smartcontractkit/chainlink-framework/multinode" - "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/cmd" @@ -337,7 +337,7 @@ func TestShell_RebroadcastTransactions_Txm(t *testing.T) { n := i ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == n - }), mock.Anything).Once().Return(client.Successful, nil) + }), mock.Anything).Once().Return(multinode.Successful, nil) } assert.NoError(t, c.RebroadcastTransactions(ctx)) @@ -417,7 +417,7 @@ func TestShell_RebroadcastTransactions_OutsideRange_Txm(t *testing.T) { n := i ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return uint(tx.Nonce()) == n - }), mock.Anything).Once().Return(client.Successful, nil) + }), mock.Anything).Once().Return(multinode.Successful, nil) } assert.NoError(t, c.RebroadcastTransactions(ctx)) @@ -469,7 +469,7 @@ func TestShell_RebroadcastTransactions_AddressCheck(t *testing.T) { mockRelayerChainInteroperators := &chainlinkmocks.FakeRelayerChainInteroperators{EVMChains: legacy} app.On("GetRelayers").Return(mockRelayerChainInteroperators).Maybe() - ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, mock.Anything).Maybe().Return(client.Successful, nil) + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, mock.Anything).Maybe().Return(multinode.Successful, nil) client := cmd.Shell{ Config: config, diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index a55c57cc9a2..85faad8e5fe 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -48,8 +48,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-framework/multinode" - "github.com/smartcontractkit/chainlink/v2/common/client" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" @@ -561,7 +561,7 @@ func NewEthMocksWithTransactionsOnBlocksAssertions(t testing.TB) *evmclimocks.Cl c.On("Dial", mock.Anything).Maybe().Return(nil) c.On("SubscribeToHeads", mock.Anything).Maybe().Return(chHead, EmptyMockSubscription(t), nil) c.On("SendTransaction", mock.Anything, mock.Anything).Maybe().Return(nil) - c.On("SendTransactionReturnCode", mock.Anything, mock.Anything, mock.Anything).Maybe().Return(client.Successful, nil) + c.On("SendTransactionReturnCode", mock.Anything, mock.Anything, mock.Anything).Maybe().Return(multinode.Successful, nil) // Construct chain h2 := Head(2) h1 := HeadWithHash(1, h2.ParentHash) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index a9e5130db2c..91924b9b681 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -37,7 +37,7 @@ require ( github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/umbracle/ethgo v0.1.3 github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 github.com/urfave/cli v1.22.14 @@ -277,13 +277,13 @@ require ( github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pressly/goose/v3 v3.21.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.60.0 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prometheus v0.54.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect @@ -296,7 +296,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect @@ -307,6 +307,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 7b004d6eae7..b39eed9a91b 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1031,9 +1031,8 @@ github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1071,8 +1070,8 @@ github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7q github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= -github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1125,8 +1124,8 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ= github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= @@ -1170,6 +1169,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= @@ -1247,8 +1248,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 9a08b356c66..7d5b8628651 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -22,10 +22,10 @@ import ( commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" + "github.com/smartcontractkit/chainlink-framework/multinode" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" - "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" @@ -49,7 +49,7 @@ var ( second = *commoncfg.MustNewDuration(time.Second) minute = *commoncfg.MustNewDuration(time.Minute) - selectionMode = client.NodeSelectionModeHighestHead + selectionMode = multinode.NodeSelectionModeHighestHead multiChain = Config{ Core: toml.Core{ @@ -258,7 +258,7 @@ func TestConfig_Marshal(t *testing.T) { require.NoError(t, err) return &a } - selectionMode := client.NodeSelectionModeHighestHead + selectionMode := multinode.NodeSelectionModeHighestHead global := Config{ Core: toml.Core{ diff --git a/deployment/go.mod b/deployment/go.mod index 34fbc7fd21d..5261299679f 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -33,7 +33,7 @@ require ( github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/test-go/testify v1.1.4 github.com/testcontainers/testcontainers-go v0.34.0 go.uber.org/multierr v1.11.0 @@ -375,14 +375,14 @@ require ( github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/alertmanager v0.27.0 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.60.0 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/exporter-toolkit v0.11.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect @@ -397,7 +397,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/sercand/kuberesolver/v5 v5.1.1 // indirect @@ -410,6 +410,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index a364fc9b1ec..5f3ef4e5776 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1273,9 +1273,8 @@ github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNH github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1323,8 +1322,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= -github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= @@ -1380,8 +1379,8 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 h1:BkTk4gynLjguayxrYxZoMZjBnAOh7ntQvUkOFmkMqPU= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= @@ -1435,6 +1434,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= @@ -1522,8 +1523,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= diff --git a/go.md b/go.md index 9f51ecd4c81..c2d3e050b1e 100644 --- a/go.md +++ b/go.md @@ -37,6 +37,8 @@ flowchart LR click chainlink-data-streams href "https://github.com/smartcontractkit/chainlink-data-streams" chainlink-feeds --> chainlink-common click chainlink-feeds href "https://github.com/smartcontractkit/chainlink-feeds" + chainlink-framework/multinode --> chainlink-common + click chainlink-framework/multinode href "https://github.com/smartcontractkit/chainlink-framework" chainlink-protos/orchestrator --> wsrpc click chainlink-protos/orchestrator href "https://github.com/smartcontractkit/chainlink-protos" chainlink-solana --> chainlink-common @@ -48,6 +50,7 @@ flowchart LR chainlink/v2 --> chainlink-cosmos chainlink/v2 --> chainlink-data-streams chainlink/v2 --> chainlink-feeds + chainlink/v2 --> chainlink-framework/multinode chainlink/v2 --> chainlink-protos/orchestrator chainlink/v2 --> chainlink-solana chainlink/v2 --> chainlink-starknet/relayer @@ -114,6 +117,8 @@ flowchart LR click chainlink-data-streams href "https://github.com/smartcontractkit/chainlink-data-streams" chainlink-feeds --> chainlink-common click chainlink-feeds href "https://github.com/smartcontractkit/chainlink-feeds" + chainlink-framework/multinode --> chainlink-common + click chainlink-framework/multinode href "https://github.com/smartcontractkit/chainlink-framework" chainlink-protos/job-distributor click chainlink-protos/job-distributor href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/orchestrator --> wsrpc @@ -150,6 +155,7 @@ flowchart LR chainlink/v2 --> chainlink-cosmos chainlink/v2 --> chainlink-data-streams chainlink/v2 --> chainlink-feeds + chainlink/v2 --> chainlink-framework/multinode chainlink/v2 --> chainlink-protos/orchestrator chainlink/v2 --> chainlink-solana chainlink/v2 --> chainlink-starknet/relayer diff --git a/go.mod b/go.mod index a0b4bca1a87..c12790b12c7 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,7 @@ require ( github.com/pressly/goose/v3 v3.21.1 github.com/prometheus/client_golang v1.20.5 github.com/prometheus/client_model v0.6.1 - github.com/prometheus/common v0.60.0 + github.com/prometheus/common v0.60.1 github.com/prometheus/prometheus v0.54.1 github.com/robfig/cron/v3 v3.0.1 github.com/rogpeppe/go-internal v1.13.1 @@ -83,6 +83,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-feeds v0.1.1 + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 @@ -91,7 +92,7 @@ require ( github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de github.com/smartcontractkit/wsrpc v0.8.2 github.com/spf13/cast v1.6.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/test-go/testify v1.1.4 github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a github.com/tidwall/gjson v1.17.0 @@ -305,7 +306,7 @@ require ( github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/runc v1.1.10 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect @@ -318,7 +319,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/go.sum b/go.sum index 49520fd1845..c8778ab3532 100644 --- a/go.sum +++ b/go.sum @@ -1021,9 +1021,8 @@ github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1061,8 +1060,8 @@ github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7q github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= -github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1116,8 +1115,8 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ= github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= @@ -1159,6 +1158,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= @@ -1232,8 +1233,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 1c63ac6738e..e19f4dbe60d 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -38,7 +38,7 @@ require ( github.com/onsi/gomega v1.34.2 github.com/pelletier/go-toml/v2 v2.2.3 github.com/pkg/errors v0.9.1 - github.com/prometheus/common v0.60.0 + github.com/prometheus/common v0.60.1 github.com/rs/zerolog v1.33.0 github.com/scylladb/go-reflectx v1.0.1 github.com/segmentio/ksuid v1.0.4 @@ -56,7 +56,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/subosito/gotenv v1.6.0 github.com/test-go/testify v1.1.4 github.com/testcontainers/testcontainers-go v0.34.0 @@ -394,7 +394,7 @@ require ( github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect @@ -415,7 +415,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/sercand/kuberesolver/v5 v5.1.1 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect @@ -427,6 +427,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 1baff05f3f1..6c71b224f8e 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1290,9 +1290,8 @@ github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNH github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1340,8 +1339,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= -github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= @@ -1397,8 +1396,8 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 h1:BkTk4gynLjguayxrYxZoMZjBnAOh7ntQvUkOFmkMqPU= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= @@ -1456,6 +1455,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= @@ -1545,8 +1546,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 04f9b07f93b..5c6be37328c 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -32,7 +32,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/wiremock/go-wiremock v1.9.0 go.uber.org/ratelimit v0.3.1 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c @@ -371,14 +371,14 @@ require ( github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/alertmanager v0.27.0 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.60.0 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/exporter-toolkit v0.11.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect @@ -393,7 +393,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/segmentio/ksuid v1.0.4 // indirect @@ -411,6 +411,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 48bdf1cb5b1..75a961d80a8 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1280,9 +1280,8 @@ github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNH github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1330,8 +1329,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= -github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= @@ -1387,8 +1386,8 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 h1:BkTk4gynLjguayxrYxZoMZjBnAOh7ntQvUkOFmkMqPU= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= @@ -1447,6 +1446,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= @@ -1536,8 +1537,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= From 5f5e552d587223bd817f7d0f62a6a2eda53a3079 Mon Sep 17 00:00:00 2001 From: dimitris Date: Thu, 9 Jan 2025 12:05:47 +0200 Subject: [PATCH 17/91] improve peer group dialer sync function logs (#15867) --- .../capabilities/ccip/oraclecreator/bootstrap.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/capabilities/ccip/oraclecreator/bootstrap.go b/core/capabilities/ccip/oraclecreator/bootstrap.go index 8dfe3e99ffb..40b3727640d 100644 --- a/core/capabilities/ccip/oraclecreator/bootstrap.go +++ b/core/capabilities/ccip/oraclecreator/bootstrap.go @@ -12,6 +12,7 @@ import ( "time" mapset "github.com/deckarep/golang-set/v2" + logger2 "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/smartcontractkit/libocr/networking" @@ -373,13 +374,22 @@ func (d *peerGroupDialer) sync() { defer d.mu.Unlock() activeDigest, candidateDigest := d.rmnHomeReader.GetAllConfigDigests() + + lggr := logger2.With( + d.lggr, + "method", "sync", + "activeDigest", activeDigest, + "candidateDigest", candidateDigest, + "activeConfigDigests", d.activeConfigDigests, + ) + actions := calculateSyncActions(d.activeConfigDigests, activeDigest, candidateDigest) if len(actions) == 0 { - d.lggr.Debugw("No peer group actions needed") + lggr.Debugw("No peer group actions needed") return } - d.lggr.Infow("Syncing peer groups", "actions", actions) + lggr.Infof("Syncing peer groups by applying the actions: %v", actions) // Handle each action for _, action := range actions { @@ -388,7 +398,7 @@ func (d *peerGroupDialer) sync() { d.closePeerGroup(action.configDigest) case ActionCreate: if err := d.createPeerGroup(action.configDigest); err != nil { - d.lggr.Errorw("Failed to create peer group", + lggr.Errorw("Failed to create peer group", "configDigest", action.configDigest, "err", err) // Consider closing all groups on error From 8270318279ab992328288973f2b831aa9440f6b1 Mon Sep 17 00:00:00 2001 From: Yashvardhan Nevatia Date: Thu, 9 Jan 2025 10:09:11 +0000 Subject: [PATCH 18/91] Solana devnet spin up in memory env (A) (#15831) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding solchains in NewEnv * Revert "Adding solchains in NewEnv" This reverts commit aaab52e01412ea4f1de4f748cadf0c127682418c. * adding sol chains to newenv * newEnv needs to send nil * adding test env setup * adding nil for crib sol chains * adding chain selectors commit * go mod tidy * linting * chain sel update * update core/scripts go files * again * add changeset * go imports * go mod tidy * Update modgraph --------- Co-authored-by: Terry Tata Co-authored-by: Blaž Hrastnik --- .changeset/cuddly-turtles-arrive.md | 5 + core/scripts/go.mod | 24 ++-- core/scripts/go.sum | 125 +++---------------- deployment/environment.go | 13 ++ deployment/environment/crib/types.go | 1 + deployment/environment/devenv/environment.go | 1 + deployment/environment/memory/chain.go | 41 +++++- deployment/environment/memory/environment.go | 35 ++++++ deployment/go.mod | 23 ++-- deployment/go.sum | 118 +++-------------- deployment/solana_chain.go | 38 ++++++ go.md | 11 +- integration-tests/go.mod | 23 ++-- integration-tests/go.sum | 117 +++-------------- integration-tests/load/go.mod | 22 ++-- integration-tests/load/go.sum | 117 +++-------------- 16 files changed, 262 insertions(+), 452 deletions(-) create mode 100644 .changeset/cuddly-turtles-arrive.md diff --git a/.changeset/cuddly-turtles-arrive.md b/.changeset/cuddly-turtles-arrive.md new file mode 100644 index 00000000000..81ceed3e8ff --- /dev/null +++ b/.changeset/cuddly-turtles-arrive.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal adding solana devnet to ccip deployment diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 91924b9b681..e016559d6cf 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -48,7 +48,6 @@ require ( ) require ( - contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect @@ -118,8 +117,7 @@ require ( github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -138,8 +136,8 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gagliardetto/binary v0.7.7 // indirect - github.com/gagliardetto/solana-go v1.8.4 // indirect + github.com/gagliardetto/binary v0.8.0 // indirect + github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect @@ -178,7 +176,6 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/glog v1.2.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect @@ -302,8 +299,9 @@ require ( github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect - github.com/smartcontractkit/chain-selectors v1.0.34 // indirect + github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 // indirect + github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect @@ -322,13 +320,12 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/status-im/keycard-go v0.2.0 // indirect - github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect + github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/test-go/testify v1.1.4 // indirect github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect github.com/tidwall/btree v1.6.0 // indirect @@ -355,7 +352,6 @@ require ( go.dedis.ch/kyber/v3 v3.1.0 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect - go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect @@ -382,16 +378,16 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.11.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect - golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.30.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.7.0 // indirect - golang.org/x/tools v0.26.0 // indirect + golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index b39eed9a91b..b716caa9ec3 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -3,7 +3,6 @@ cel.dev/expr v0.17.0/go.mod h1:HCwbrn+qQoHPXgfz6cl2J0hDybnX2N1sQQkl9EggXx8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -54,10 +53,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.45.0 h1:5av0QcIVj77t+44mV4gffFC/LscFRUhto6UBMB5SimM= cloud.google.com/go/storage v1.45.0/go.mod h1:wpPblkIuMP5jCB/E48Pz9zIo2S/zD8g+ITmxKkPCITE= -contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= @@ -73,7 +68,6 @@ cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -100,8 +94,6 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Depado/ginprom v1.8.0 h1:zaaibRLNI1dMiiuj1MKzatm8qrcHzikMlCc1anqOdyo= github.com/Depado/ginprom v1.8.0/go.mod h1:XBaKzeNBqPF4vxJpNLincSQZeMDnZp1tIbU0FU0UKgg= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.3 h1:cb3br57K508pQEFgBxn9GDhPS9HefpyMPK1RzmtMNzk= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.3/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.3 h1:xir5X8TS8UBVPWg2jHL+cSTf0jZgqYQSA54TscSt1/0= @@ -128,7 +120,6 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -138,7 +129,6 @@ github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1L github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -156,8 +146,6 @@ github.com/atombender/go-jsonschema v0.16.1-0.20240916205339-a74cd4e2851c h1:cxQ github.com/atombender/go-jsonschema v0.16.1-0.20240916205339-a74cd4e2851c/go.mod h1:3XzxudkrYVUvbduN/uI2fl4lSrMSzU0+3RCu2mpnfx8= github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA= github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= -github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= @@ -178,7 +166,6 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= @@ -267,16 +254,13 @@ github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7b github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= @@ -314,7 +298,6 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e h1:5jVSh2l/ho6ajWhSPNN84eHEdq3dp0T7+f6r3Tc6hsk= @@ -328,23 +311,18 @@ github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80N github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= @@ -384,7 +362,6 @@ github.com/ethereum/go-ethereum v1.14.11/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2 github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A= github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= @@ -403,12 +380,12 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= -github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= +github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= +github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= -github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtLDMZeodE= -github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= +github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= +github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= @@ -526,7 +503,6 @@ github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -562,7 +538,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -638,12 +613,10 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grafana/pyroscope-go v1.1.2 h1:7vCfdORYQMCxIzI3NlYAs3FcBP760+gWuYWOyiVyYx8= @@ -654,15 +627,12 @@ github.com/graph-gophers/dataloader v5.0.0+incompatible h1:R+yjsbrNq1Mo3aPG+Z/EK github.com/graph-gophers/dataloader v5.0.0+incompatible/go.mod h1:jk4jk0c5ZISbKaMe8WsVopGB5/15GvGHMdMdPtwlRp4= github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= @@ -717,7 +687,6 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= @@ -807,10 +776,8 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -821,7 +788,6 @@ github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -841,7 +807,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -883,7 +848,6 @@ github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczG github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -899,7 +863,6 @@ github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -908,8 +871,6 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -964,7 +925,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -983,7 +943,6 @@ github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJm github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 h1:dOYG7LS/WK00RWZc8XGgcUTlTxpp3mKhdR2Q9z9HbXM= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -991,7 +950,6 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1055,7 +1013,6 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:Om github.com/pressly/goose/v3 v3.21.1 h1:5SSAKKWej8LVVzNLuT6KIvP1eFDuPvxa+B6H0w78buQ= github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfWh8pHEe+vE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= @@ -1066,21 +1023,17 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.54.1 h1:vKuwQNjnYN2/mDoWfHXDhAsz/68q/dQDb+YbcEqU7MQ= github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx98BzeCR99991NY= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= @@ -1094,7 +1047,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -1155,12 +1107,14 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix h1:DPJD++yKLSx0EfT+U14P8vLVxjXFmoIETiCO9lVwQo8= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix/go.mod h1:NnT6w4Kj42OFFXhSx99LvJZWPpMjmo4+CpDEWfw61xY= -github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3fePb3eCreuAnUA3RBj4= -github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= +github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPorGF//PAqwq2Cm4gRK0= +github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= @@ -1195,7 +1149,6 @@ github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1210,7 +1163,6 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1220,15 +1172,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -1260,22 +1210,17 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDd github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 h1:3SNcvBmEPE1YlB1JpVZouslJpI3GBNoiqW7+wb0Rz7w= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a h1:YuO+afVc3eqrjiCUizNCxI53bl/BnPiVwXqLzqYTqgU= github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a/go.mod h1:/sfW47zCZp9FrtGcWyo1VjbgDaodxX9ovZvgLb/MxaA= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -1285,7 +1230,6 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -1311,24 +1255,17 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1353,18 +1290,15 @@ go.dedis.ch/kyber/v3 v3.1.0/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1 go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo= go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1436,15 +1370,12 @@ go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKY go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -1471,7 +1402,6 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= @@ -1485,8 +1415,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1515,15 +1445,14 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1536,7 +1465,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1569,8 +1497,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1605,7 +1533,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1621,7 +1548,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1686,7 +1612,6 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= @@ -1731,7 +1656,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1741,7 +1665,6 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1777,8 +1700,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1794,7 +1717,6 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -1819,7 +1741,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -1829,7 +1750,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1878,9 +1798,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38/go. google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1934,16 +1852,13 @@ gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/deployment/environment.go b/deployment/environment.go index 6fc28fac764..a37622dc3ac 100644 --- a/deployment/environment.go +++ b/deployment/environment.go @@ -111,6 +111,7 @@ func NewEnvironment( logger logger.Logger, existingAddrs AddressBook, chains map[uint64]Chain, + solChains map[uint64]SolChain, nodeIDs []string, offchain OffchainClient, ctx func() context.Context, @@ -121,6 +122,7 @@ func NewEnvironment( Logger: logger, ExistingAddresses: existingAddrs, Chains: chains, + SolChains: solChains, NodeIDs: nodeIDs, Offchain: offchain, GetContext: ctx, @@ -159,6 +161,17 @@ func (e Environment) AllChainSelectorsExcluding(excluding []uint64) []uint64 { return selectors } +func (e Environment) AllChainSelectorsSolana() []uint64 { + selectors := make([]uint64, 0, len(e.SolChains)) + for sel := range e.SolChains { + selectors = append(selectors, sel) + } + sort.Slice(selectors, func(i, j int) bool { + return selectors[i] < selectors[j] + }) + return selectors +} + func (e Environment) AllDeployerKeys() []common.Address { var deployerKeys []common.Address for sel := range e.Chains { diff --git a/deployment/environment/crib/types.go b/deployment/environment/crib/types.go index 99baf8e8774..771880053f9 100644 --- a/deployment/environment/crib/types.go +++ b/deployment/environment/crib/types.go @@ -33,6 +33,7 @@ func NewDeployEnvironmentFromCribOutput(lggr logger.Logger, output DeployOutput) lggr, output.AddressBook, chains, + nil, // nil for solana chains, can use memory solana chain example when required output.NodeIDs, nil, // todo: populate the offchain client using output.DON func() context.Context { return context.Background() }, deployment.XXXGenerateTestOCRSecrets(), diff --git a/deployment/environment/devenv/environment.go b/deployment/environment/devenv/environment.go index 2fffe6adf2b..b6b5198f8fb 100644 --- a/deployment/environment/devenv/environment.go +++ b/deployment/environment/devenv/environment.go @@ -50,6 +50,7 @@ func NewEnvironment(ctx func() context.Context, lggr logger.Logger, config Envir lggr, deployment.NewMemoryAddressBook(), chains, + nil, // sending nil for solana chains right now, we can build this when we need it nodeIDs, offChain, ctx, diff --git a/deployment/environment/memory/chain.go b/deployment/environment/memory/chain.go index 77a8f397d39..cc22b40d844 100644 --- a/deployment/environment/memory/chain.go +++ b/deployment/environment/memory/chain.go @@ -9,12 +9,16 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient/simulated" + "github.com/gagliardetto/solana-go" + solRpc "github.com/gagliardetto/solana-go/rpc" + "github.com/stretchr/testify/require" + solTestUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/contracts/tests/testutils" + chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -24,6 +28,11 @@ type EVMChain struct { Users []*bind.TransactOpts } +type SolanaChain struct { + Client *solRpc.Client + DeployerKey *solana.PrivateKey +} + func fundAddress(t *testing.T, from *bind.TransactOpts, to common.Address, amount *big.Int, backend *simulated.Backend) { ctx := tests.Context(t) nonce, err := backend.Client().PendingNonceAt(ctx, from.From) @@ -53,6 +62,36 @@ func GenerateChains(t *testing.T, numChains int, numUsers int) map[uint64]EVMCha return chains } +func getTestSolanaChainSelectors() []uint64 { + result := []uint64{} + for _, x := range chainsel.SolanaALL { + if x.Name == x.ChainID { + result = append(result, x.Selector) + } + } + return result +} + +func GenerateChainsSol(t *testing.T, numChains int) map[uint64]SolanaChain { + chains := make(map[uint64]SolanaChain) + testSolanaChainSelectors := getTestSolanaChainSelectors() + if len(testSolanaChainSelectors) < numChains { + t.Fatalf("not enough test solana chain selectors available") + } + + for i := 0; i < numChains; i++ { + chainID := testSolanaChainSelectors[i] + url, _ := solTestUtil.SetupLocalSolNodeWithFlags(t) + admin, gerr := solana.NewRandomPrivateKey() + require.NoError(t, gerr) + chains[chainID] = SolanaChain{ + Client: solRpc.New(url), + DeployerKey: &admin, + } + } + return chains +} + func GenerateChainsWithIds(t *testing.T, chainIDs []uint64, numUsers int) map[uint64]EVMChain { chains := make(map[uint64]EVMChain) for _, chainID := range chainIDs { diff --git a/deployment/environment/memory/environment.go b/deployment/environment/memory/environment.go index a74d23a847b..3c5fdc6e779 100644 --- a/deployment/environment/memory/environment.go +++ b/deployment/environment/memory/environment.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" + "github.com/gagliardetto/solana-go" "github.com/hashicorp/consul/sdk/freeport" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" @@ -19,6 +20,9 @@ import ( "github.com/smartcontractkit/chainlink/deployment" + solRpc "github.com/gagliardetto/solana-go/rpc" + + solCommomUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" "github.com/smartcontractkit/chainlink-common/pkg/logger" ) @@ -28,6 +32,7 @@ const ( type MemoryEnvironmentConfig struct { Chains int + SolChains int NumOfUsersPerChain int Nodes int Bootstraps int @@ -59,6 +64,11 @@ func NewMemoryChains(t *testing.T, numChains int, numUsers int) (map[uint64]depl return generateMemoryChain(t, mchains), users } +func NewMemoryChainsSol(t *testing.T, numChains int) map[uint64]deployment.SolChain { + mchains := GenerateChainsSol(t, numChains) + return generateMemoryChainSol(t, mchains) +} + func NewMemoryChainsWithChainIDs(t *testing.T, chainIDs []uint64, numUsers int) (map[uint64]deployment.Chain, map[uint64][]*bind.TransactOpts) { mchains := GenerateChainsWithIds(t, chainIDs, numUsers) users := make(map[uint64][]*bind.TransactOpts) @@ -111,6 +121,28 @@ func generateMemoryChain(t *testing.T, inputs map[uint64]EVMChain) map[uint64]de return chains } +func generateMemoryChainSol(t *testing.T, inputs map[uint64]SolanaChain) map[uint64]deployment.SolChain { + chains := make(map[uint64]deployment.SolChain) + for cid, chain := range inputs { + chain := chain + chains[cid] = deployment.SolChain{ + Selector: cid, + Client: chain.Client, + DeployerKey: chain.DeployerKey, + Confirm: func(instructions []solana.Instruction, opts ...solCommomUtil.TxModifier) error { + _, err := solCommomUtil.SendAndConfirm( + context.Background(), chain.Client, instructions, *chain.DeployerKey, solRpc.CommitmentConfirmed, opts..., + ) + if err != nil { + return err + } + return nil + }, + } + } + return chains +} + func NewNodes(t *testing.T, logLevel zapcore.Level, chains map[uint64]deployment.Chain, numNodes, numBootstraps int, registryConfig deployment.CapabilityRegistryConfig) map[string]Node { nodesByPeerID := make(map[string]Node) if numNodes+numBootstraps == 0 { @@ -149,6 +181,7 @@ func NewMemoryEnvironmentFromChainsNodes( lggr, deployment.NewMemoryAddressBook(), chains, + nil, nodeIDs, // Note these have the p2p_ prefix. NewMemoryJobClient(nodes), ctx, @@ -159,6 +192,7 @@ func NewMemoryEnvironmentFromChainsNodes( // To be used by tests and any kind of deployment logic. func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, logLevel zapcore.Level, config MemoryEnvironmentConfig) deployment.Environment { chains, _ := NewMemoryChains(t, config.Chains, config.NumOfUsersPerChain) + solChains := NewMemoryChainsSol(t, config.SolChains) nodes := NewNodes(t, logLevel, chains, config.Nodes, config.Bootstraps, config.RegistryConfig) var nodeIDs []string for id := range nodes { @@ -169,6 +203,7 @@ func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, logLevel zapcore.Lev lggr, deployment.NewMemoryAddressBook(), chains, + solChains, nodeIDs, NewMemoryJobClient(nodes), func() context.Context { return tests.Context(t) }, diff --git a/deployment/go.mod b/deployment/go.mod index 5261299679f..cbec5d95744 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -18,6 +18,7 @@ require ( github.com/aws/aws-sdk-go v1.54.19 github.com/deckarep/golang-set/v2 v2.6.0 github.com/ethereum/go-ethereum v1.14.11 + github.com/gagliardetto/solana-go v1.12.0 github.com/go-resty/resty/v2 v2.15.3 github.com/google/uuid v1.6.0 github.com/hashicorp/consul/sdk v0.16.1 @@ -27,8 +28,9 @@ require ( github.com/rs/zerolog v1.33.0 github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix - github.com/smartcontractkit/chain-selectors v1.0.34 + github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 + github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 @@ -38,7 +40,7 @@ require ( github.com/testcontainers/testcontainers-go v0.34.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.10.0 google.golang.org/grpc v1.67.1 @@ -48,7 +50,6 @@ require ( ) require ( - contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect @@ -160,9 +161,8 @@ require ( github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dennwc/varint v1.0.0 // indirect - github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -189,8 +189,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gagliardetto/binary v0.7.7 // indirect - github.com/gagliardetto/solana-go v1.8.4 // indirect + github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect @@ -430,13 +429,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect - github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect + github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/tidwall/gjson v1.17.0 // indirect @@ -465,7 +463,6 @@ require ( go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect go.etcd.io/etcd/client/v3 v3.5.14 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect - go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/pdata v1.12.0 // indirect go.opentelemetry.io/collector/semconv v0.105.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect @@ -495,13 +492,13 @@ require ( go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.11.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.30.0 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.7.0 // indirect - golang.org/x/tools v0.26.0 // indirect + golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 5f3ef4e5776..e58794f2e97 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -3,7 +3,6 @@ cel.dev/expr v0.17.0/go.mod h1:HCwbrn+qQoHPXgfz6cl2J0hDybnX2N1sQQkl9EggXx8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -54,10 +53,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.45.0 h1:5av0QcIVj77t+44mV4gffFC/LscFRUhto6UBMB5SimM= cloud.google.com/go/storage v1.45.0/go.mod h1:wpPblkIuMP5jCB/E48Pz9zIo2S/zD8g+ITmxKkPCITE= -contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= @@ -75,7 +70,6 @@ cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8 dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -118,8 +112,6 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Depado/ginprom v1.8.0 h1:zaaibRLNI1dMiiuj1MKzatm8qrcHzikMlCc1anqOdyo= github.com/Depado/ginprom v1.8.0/go.mod h1:XBaKzeNBqPF4vxJpNLincSQZeMDnZp1tIbU0FU0UKgg= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.3 h1:cb3br57K508pQEFgBxn9GDhPS9HefpyMPK1RzmtMNzk= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.3/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.3 h1:xir5X8TS8UBVPWg2jHL+cSTf0jZgqYQSA54TscSt1/0= @@ -159,7 +151,6 @@ github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -181,7 +172,6 @@ github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= @@ -210,8 +200,6 @@ github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinR github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E= github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= -github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= @@ -269,7 +257,6 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= @@ -376,9 +363,7 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -389,7 +374,6 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= @@ -430,7 +414,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e h1:5jVSh2l/ho6ajWhSPNN84eHEdq3dp0T7+f6r3Tc6hsk= @@ -444,27 +427,22 @@ github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80N github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/digitalocean/godo v1.118.0 h1:lkzGFQmACrVCp7UqH1sAi4JK/PWwlc5aaxubgorKmC4= @@ -539,12 +517,12 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= -github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= +github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= +github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= -github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtLDMZeodE= -github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= +github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= +github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= @@ -670,7 +648,6 @@ github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -706,7 +683,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -790,12 +766,10 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grafana/dskit v0.0.0-20231120170505-765e343eda4f h1:gyojr97YeWZ70pKNakWv5/tKwBHuLy3icnIeCo9gQr4= @@ -820,15 +794,12 @@ github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMN github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= @@ -901,7 +872,6 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -1004,10 +974,8 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -1018,7 +986,6 @@ github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -1043,7 +1010,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -1093,7 +1059,6 @@ github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/z github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -1194,7 +1159,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -1215,7 +1179,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 h1:dOYG7LS/WK00RWZc8XGgcUTlTxpp3mKhdR2Q9z9HbXM= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1302,7 +1265,6 @@ github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfW github.com/prometheus/alertmanager v0.27.0 h1:V6nTa2J5V4s8TG4C4HtrBP/WNSebCCTYGGv4qecA/+I= github.com/prometheus/alertmanager v0.27.0/go.mod h1:8Ia/R3urPmbzJ8OsdvmZvIprDwvwmYCmUbwBL+jlPOE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -1315,8 +1277,6 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -1329,7 +1289,6 @@ github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57J github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= github.com/prometheus/exporter-toolkit v0.11.0/go.mod h1:BVnENhnNecpwoTLiABx7mrPB/OLRIgN74qlQbV+FK1Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -1338,7 +1297,6 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.54.1 h1:vKuwQNjnYN2/mDoWfHXDhAsz/68q/dQDb+YbcEqU7MQ= github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx98BzeCR99991NY= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= @@ -1350,7 +1308,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -1420,12 +1377,14 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix h1:DPJD++yKLSx0EfT+U14P8vLVxjXFmoIETiCO9lVwQo8= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix/go.mod h1:NnT6w4Kj42OFFXhSx99LvJZWPpMjmo4+CpDEWfw61xY= -github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3fePb3eCreuAnUA3RBj4= -github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= +github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPorGF//PAqwq2Cm4gRK0= +github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= @@ -1466,7 +1425,6 @@ github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= @@ -1485,7 +1443,6 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1495,15 +1452,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -1535,9 +1490,6 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDd github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 h1:3SNcvBmEPE1YlB1JpVZouslJpI3GBNoiqW7+wb0Rz7w= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= @@ -1546,12 +1498,10 @@ github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a h1:YuO+afVc3eqrj github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a/go.mod h1:/sfW47zCZp9FrtGcWyo1VjbgDaodxX9ovZvgLb/MxaA= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -1559,7 +1509,6 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -1586,10 +1535,8 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= @@ -1598,10 +1545,6 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/ github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1609,7 +1552,6 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGC github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1636,7 +1578,6 @@ go.dedis.ch/kyber/v3 v3.1.0/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1 go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo= go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= @@ -1648,12 +1589,10 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSv go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= -go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1727,15 +1666,12 @@ go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKY go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -1765,7 +1701,6 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= @@ -1780,8 +1715,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1810,15 +1745,14 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1869,8 +1803,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1906,7 +1840,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1922,7 +1855,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1998,7 +1930,6 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -2047,7 +1978,6 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2057,7 +1987,6 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2093,8 +2022,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2112,7 +2041,6 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -2137,7 +2065,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -2148,7 +2075,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2198,7 +2124,6 @@ google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -2251,16 +2176,13 @@ gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/deployment/solana_chain.go b/deployment/solana_chain.go index 338642e3e32..ba02e74f892 100644 --- a/deployment/solana_chain.go +++ b/deployment/solana_chain.go @@ -1,5 +1,43 @@ package deployment +import ( + "fmt" + "strconv" + + "github.com/gagliardetto/solana-go" + solRpc "github.com/gagliardetto/solana-go/rpc" + + solCommomUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" +) + // SolChain represents a Solana chain. type SolChain struct { + // Selectors used as canonical chain identifier. + Selector uint64 + // RPC cient + Client *solRpc.Client + // TODO: raw private key for now, need to replace with a more secure way + DeployerKey *solana.PrivateKey + Confirm func(instructions []solana.Instruction, opts ...solCommomUtil.TxModifier) error +} + +func (c SolChain) String() string { + chainInfo, err := ChainInfo(c.Selector) + if err != nil { + // we should never get here, if the selector is invalid it should not be in the environment + panic(err) + } + return fmt.Sprintf("%s (%d)", chainInfo.ChainName, chainInfo.ChainSelector) +} + +func (c SolChain) Name() string { + chainInfo, err := ChainInfo(c.Selector) + if err != nil { + // we should never get here, if the selector is invalid it should not be in the environment + panic(err) + } + if chainInfo.ChainName == "" { + return strconv.FormatUint(c.Selector, 10) + } + return chainInfo.ChainName } diff --git a/go.md b/go.md index c2d3e050b1e..ed41edee2b0 100644 --- a/go.md +++ b/go.md @@ -108,6 +108,8 @@ flowchart LR chainlink-ccip --> chain-selectors chainlink-ccip --> chainlink-common click chainlink-ccip href "https://github.com/smartcontractkit/chainlink-ccip" + chainlink-ccip/chains/solana --> chainlink-common + click chainlink-ccip/chains/solana href "https://github.com/smartcontractkit/chainlink-ccip" chainlink-common --> grpc-proxy chainlink-common --> libocr click chainlink-common href "https://github.com/smartcontractkit/chainlink-common" @@ -141,6 +143,7 @@ flowchart LR chainlink/core/scripts --> chainlink/deployment click chainlink/core/scripts href "https://github.com/smartcontractkit/chainlink" chainlink/deployment --> ccip-owner-contracts + chainlink/deployment --> chainlink-ccip/chains/solana chainlink/deployment --> chainlink-protos/job-distributor chainlink/deployment --> chainlink-testing-framework/lib chainlink/deployment --> chainlink/v2 @@ -184,6 +187,12 @@ flowchart LR end click chainlink-repo href "https://github.com/smartcontractkit/chainlink" + subgraph chainlink-ccip-repo[chainlink-ccip] + chainlink-ccip + chainlink-ccip/chains/solana + end + click chainlink-ccip-repo href "https://github.com/smartcontractkit/chainlink-ccip" + subgraph chainlink-protos-repo[chainlink-protos] chainlink-protos/job-distributor chainlink-protos/orchestrator @@ -206,5 +215,5 @@ flowchart LR click tdh2-repo href "https://github.com/smartcontractkit/tdh2" classDef outline stroke-dasharray:6,fill:none; - class chainlink-repo,chainlink-protos-repo,chainlink-testing-framework-repo,tdh2-repo outline + class chainlink-repo,chainlink-ccip-repo,chainlink-protos-repo,chainlink-testing-framework-repo,tdh2-repo outline ``` diff --git a/integration-tests/go.mod b/integration-tests/go.mod index e19f4dbe60d..efd538007b1 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -44,7 +44,7 @@ require ( github.com/segmentio/ksuid v1.0.4 github.com/shopspring/decimal v1.4.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chain-selectors v1.0.34 + github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 @@ -65,7 +65,7 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.31.0 - golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 golang.org/x/sync v0.10.0 golang.org/x/text v0.21.0 google.golang.org/grpc v1.67.1 @@ -74,7 +74,6 @@ require ( ) require ( - contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect @@ -183,9 +182,8 @@ require ( github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dennwc/varint v1.0.0 // indirect - github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -211,8 +209,8 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gagliardetto/binary v0.7.7 // indirect - github.com/gagliardetto/solana-go v1.8.4 // indirect + github.com/gagliardetto/binary v0.8.0 // indirect + github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect @@ -424,6 +422,7 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect + github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect @@ -443,12 +442,11 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect - github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect + github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/tidwall/gjson v1.17.0 // indirect @@ -479,7 +477,6 @@ require ( go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect go.etcd.io/etcd/client/v3 v3.5.14 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect - go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/pdata v1.12.0 // indirect go.opentelemetry.io/collector/semconv v0.105.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect @@ -507,13 +504,13 @@ require ( go.uber.org/ratelimit v0.3.1 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.11.0 // indirect - golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.30.0 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/time v0.7.0 // indirect - golang.org/x/tools v0.26.0 // indirect + golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 6c71b224f8e..a2f198d4856 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -3,7 +3,6 @@ cel.dev/expr v0.17.0/go.mod h1:HCwbrn+qQoHPXgfz6cl2J0hDybnX2N1sQQkl9EggXx8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -54,10 +53,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.45.0 h1:5av0QcIVj77t+44mV4gffFC/LscFRUhto6UBMB5SimM= cloud.google.com/go/storage v1.45.0/go.mod h1:wpPblkIuMP5jCB/E48Pz9zIo2S/zD8g+ITmxKkPCITE= -contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= @@ -75,7 +70,6 @@ cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8 dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -118,8 +112,6 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Depado/ginprom v1.8.0 h1:zaaibRLNI1dMiiuj1MKzatm8qrcHzikMlCc1anqOdyo= github.com/Depado/ginprom v1.8.0/go.mod h1:XBaKzeNBqPF4vxJpNLincSQZeMDnZp1tIbU0FU0UKgg= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.3 h1:xir5X8TS8UBVPWg2jHL+cSTf0jZgqYQSA54TscSt1/0= @@ -159,7 +151,6 @@ github.com/Workiva/go-datastructures v1.1.0 h1:hu20UpgZneBhQ3ZvwiOGlqJSKIosin2Rd github.com/Workiva/go-datastructures v1.1.0/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -177,7 +168,6 @@ github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= @@ -204,8 +194,6 @@ github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinR github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E= github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= -github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= @@ -263,7 +251,6 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= @@ -380,9 +367,7 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -393,7 +378,6 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= @@ -434,7 +418,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e h1:5jVSh2l/ho6ajWhSPNN84eHEdq3dp0T7+f6r3Tc6hsk= @@ -448,27 +431,22 @@ github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80N github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.118.0 h1:lkzGFQmACrVCp7UqH1sAi4JK/PWwlc5aaxubgorKmC4= github.com/digitalocean/godo v1.118.0/go.mod h1:Vk0vpCot2HOAJwc5WE8wljZGtJ3ZtWIc8MQ8rF38sdo= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= @@ -541,12 +519,12 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= -github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= +github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= +github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= -github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtLDMZeodE= -github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= +github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= +github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= @@ -674,7 +652,6 @@ github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -710,7 +687,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -795,7 +771,6 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= @@ -825,15 +800,12 @@ github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMN github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= @@ -906,7 +878,6 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -1011,10 +982,8 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -1025,7 +994,6 @@ github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -1050,7 +1018,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -1102,7 +1069,6 @@ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -1203,7 +1169,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -1228,7 +1193,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 h1:dOYG7LS/WK00RWZc8XGgcUTlTxpp3mKhdR2Q9z9HbXM= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1319,7 +1283,6 @@ github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfW github.com/prometheus/alertmanager v0.27.0 h1:V6nTa2J5V4s8TG4C4HtrBP/WNSebCCTYGGv4qecA/+I= github.com/prometheus/alertmanager v0.27.0/go.mod h1:8Ia/R3urPmbzJ8OsdvmZvIprDwvwmYCmUbwBL+jlPOE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -1332,8 +1295,6 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -1346,7 +1307,6 @@ github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57J github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= github.com/prometheus/exporter-toolkit v0.11.0/go.mod h1:BVnENhnNecpwoTLiABx7mrPB/OLRIgN74qlQbV+FK1Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -1355,7 +1315,6 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.54.1 h1:vKuwQNjnYN2/mDoWfHXDhAsz/68q/dQDb+YbcEqU7MQ= github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx98BzeCR99991NY= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= @@ -1367,7 +1326,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -1441,12 +1399,14 @@ github.com/slack-go/slack v0.15.0 h1:LE2lj2y9vqqiOf+qIIy0GvEoxgF1N5yLGZffmEZykt0 github.com/slack-go/slack v0.15.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix h1:DPJD++yKLSx0EfT+U14P8vLVxjXFmoIETiCO9lVwQo8= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix/go.mod h1:NnT6w4Kj42OFFXhSx99LvJZWPpMjmo4+CpDEWfw61xY= -github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3fePb3eCreuAnUA3RBj4= -github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= +github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPorGF//PAqwq2Cm4gRK0= +github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= @@ -1489,7 +1449,6 @@ github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= @@ -1508,7 +1467,6 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1518,15 +1476,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -1558,9 +1514,6 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDd github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 h1:3SNcvBmEPE1YlB1JpVZouslJpI3GBNoiqW7+wb0Rz7w= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= @@ -1571,12 +1524,10 @@ github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e h1:Buzhfgf github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e/go.mod h1:/Tnicc6m/lsJE0irFMA0LfIwTBo4QP7A8IfyIv4zZKI= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -1584,7 +1535,6 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -1611,10 +1561,8 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= @@ -1623,10 +1571,6 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/ github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1634,7 +1578,6 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGC github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1661,7 +1604,6 @@ go.dedis.ch/kyber/v3 v3.1.0/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1 go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo= go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= @@ -1673,12 +1615,10 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSv go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= -go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1752,15 +1692,12 @@ go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKY go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -1791,7 +1728,6 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= @@ -1806,8 +1742,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1836,15 +1772,14 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1895,8 +1830,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1932,7 +1867,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1949,7 +1883,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2026,7 +1959,6 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -2075,7 +2007,6 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2085,7 +2016,6 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2121,8 +2051,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2140,7 +2070,6 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -2165,7 +2094,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -2176,7 +2104,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2226,7 +2153,6 @@ google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -2279,16 +2205,13 @@ gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 5c6be37328c..94d86cb5cd4 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -35,11 +35,10 @@ require ( github.com/stretchr/testify v1.10.0 github.com/wiremock/go-wiremock v1.9.0 go.uber.org/ratelimit v0.3.1 - golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 ) require ( - contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect @@ -153,9 +152,8 @@ require ( github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dennwc/varint v1.0.0 // indirect - github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -182,8 +180,8 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gagliardetto/binary v0.7.7 // indirect - github.com/gagliardetto/solana-go v1.8.4 // indirect + github.com/gagliardetto/binary v0.8.0 // indirect + github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect @@ -405,7 +403,7 @@ require ( github.com/shoenig/test v0.6.6 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/smartcontractkit/chain-selectors v1.0.34 // indirect + github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect @@ -430,13 +428,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect - github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect + github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/test-go/testify v1.1.4 // indirect github.com/testcontainers/testcontainers-go v0.34.0 // indirect github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect @@ -470,7 +467,6 @@ require ( go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect go.etcd.io/etcd/client/v3 v3.5.14 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect - go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/pdata v1.12.0 // indirect go.opentelemetry.io/collector/semconv v0.105.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect @@ -501,15 +497,15 @@ require ( go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.11.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.30.0 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.7.0 // indirect - golang.org/x/tools v0.26.0 // indirect + golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 75a961d80a8..eb114fa0e28 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -3,7 +3,6 @@ cel.dev/expr v0.17.0/go.mod h1:HCwbrn+qQoHPXgfz6cl2J0hDybnX2N1sQQkl9EggXx8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -54,10 +53,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.45.0 h1:5av0QcIVj77t+44mV4gffFC/LscFRUhto6UBMB5SimM= cloud.google.com/go/storage v1.45.0/go.mod h1:wpPblkIuMP5jCB/E48Pz9zIo2S/zD8g+ITmxKkPCITE= -contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= -contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= @@ -75,7 +70,6 @@ cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8 dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -118,8 +112,6 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Depado/ginprom v1.8.0 h1:zaaibRLNI1dMiiuj1MKzatm8qrcHzikMlCc1anqOdyo= github.com/Depado/ginprom v1.8.0/go.mod h1:XBaKzeNBqPF4vxJpNLincSQZeMDnZp1tIbU0FU0UKgg= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.3 h1:xir5X8TS8UBVPWg2jHL+cSTf0jZgqYQSA54TscSt1/0= @@ -163,7 +155,6 @@ github.com/Workiva/go-datastructures v1.1.0 h1:hu20UpgZneBhQ3ZvwiOGlqJSKIosin2Rd github.com/Workiva/go-datastructures v1.1.0/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -181,7 +172,6 @@ github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= @@ -208,8 +198,6 @@ github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinR github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E= github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= -github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= @@ -267,7 +255,6 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= @@ -374,9 +361,7 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -387,7 +372,6 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= @@ -428,7 +412,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e h1:5jVSh2l/ho6ajWhSPNN84eHEdq3dp0T7+f6r3Tc6hsk= @@ -442,27 +425,22 @@ github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80N github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= -github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.118.0 h1:lkzGFQmACrVCp7UqH1sAi4JK/PWwlc5aaxubgorKmC4= github.com/digitalocean/godo v1.118.0/go.mod h1:Vk0vpCot2HOAJwc5WE8wljZGtJ3ZtWIc8MQ8rF38sdo= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= @@ -535,12 +513,12 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= -github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= +github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= +github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= -github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtLDMZeodE= -github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= +github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= +github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= @@ -668,7 +646,6 @@ github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -704,7 +681,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -789,7 +765,6 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= @@ -823,15 +798,12 @@ github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMN github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= @@ -904,7 +876,6 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -1007,10 +978,8 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -1021,7 +990,6 @@ github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -1046,7 +1014,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -1096,7 +1063,6 @@ github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/z github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -1197,7 +1163,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -1218,7 +1183,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 h1:dOYG7LS/WK00RWZc8XGgcUTlTxpp3mKhdR2Q9z9HbXM= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1309,7 +1273,6 @@ github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfW github.com/prometheus/alertmanager v0.27.0 h1:V6nTa2J5V4s8TG4C4HtrBP/WNSebCCTYGGv4qecA/+I= github.com/prometheus/alertmanager v0.27.0/go.mod h1:8Ia/R3urPmbzJ8OsdvmZvIprDwvwmYCmUbwBL+jlPOE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -1322,8 +1285,6 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -1336,7 +1297,6 @@ github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57J github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= github.com/prometheus/exporter-toolkit v0.11.0/go.mod h1:BVnENhnNecpwoTLiABx7mrPB/OLRIgN74qlQbV+FK1Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -1345,7 +1305,6 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.54.1 h1:vKuwQNjnYN2/mDoWfHXDhAsz/68q/dQDb+YbcEqU7MQ= github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx98BzeCR99991NY= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= @@ -1357,7 +1316,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -1432,12 +1390,14 @@ github.com/slack-go/slack v0.15.0 h1:LE2lj2y9vqqiOf+qIIy0GvEoxgF1N5yLGZffmEZykt0 github.com/slack-go/slack v0.15.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix h1:DPJD++yKLSx0EfT+U14P8vLVxjXFmoIETiCO9lVwQo8= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix/go.mod h1:NnT6w4Kj42OFFXhSx99LvJZWPpMjmo4+CpDEWfw61xY= -github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3fePb3eCreuAnUA3RBj4= -github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= +github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPorGF//PAqwq2Cm4gRK0= +github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= +github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= @@ -1480,7 +1440,6 @@ github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= @@ -1499,7 +1458,6 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1509,15 +1467,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= -github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -1549,9 +1505,6 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDd github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 h1:3SNcvBmEPE1YlB1JpVZouslJpI3GBNoiqW7+wb0Rz7w= -github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= @@ -1560,12 +1513,10 @@ github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a h1:YuO+afVc3eqrj github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a/go.mod h1:/sfW47zCZp9FrtGcWyo1VjbgDaodxX9ovZvgLb/MxaA= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -1573,7 +1524,6 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -1600,10 +1550,8 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= @@ -1614,10 +1562,6 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/ github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1625,7 +1569,6 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGC github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1652,7 +1595,6 @@ go.dedis.ch/kyber/v3 v3.1.0/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1 go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo= go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= @@ -1664,12 +1606,10 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSv go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= -go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1743,15 +1683,12 @@ go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKY go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -1782,7 +1719,6 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= @@ -1797,8 +1733,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1827,15 +1763,14 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1886,8 +1821,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1923,7 +1858,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1939,7 +1873,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2015,7 +1948,6 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -2064,7 +1996,6 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2074,7 +2005,6 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2110,8 +2040,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2129,7 +2059,6 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -2154,7 +2083,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -2165,7 +2093,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2215,7 +2142,6 @@ google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -2268,16 +2194,13 @@ gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 0199523f9042d58c87ea2909e10e7468aa5b36c1 Mon Sep 17 00:00:00 2001 From: cfal Date: Thu, 9 Jan 2025 12:50:22 +0000 Subject: [PATCH 19/91] add TRON integration (#14783) * Add tron integration * .changeset/wise-buttons-fry.md: add changeset * .mockery.yaml: add tron keystore * core/services: update mocks * core: cleanup chain type * add to graphql * rename TronLoopKeystore -> TronLOOPKeystore * clean up keystore addresses * fix keystore chaintypes * fix graphql errors * fix linting * fix linting * chore: regenerate mock --------- Co-authored-by: Calvin Wang Co-authored-by: Calvin <78729586+calvwang9@users.noreply.github.com> Co-authored-by: Graham Goh --- .changeset/wise-buttons-fry.md | 5 + .mockery.yaml | 3 +- core/cmd/app.go | 1 + core/cmd/shell.go | 7 + core/cmd/shell_local.go | 6 + core/cmd/tron_keys_commands.go | 57 ++ core/cmd/tron_keys_commands_test.go | 174 ++++++ core/config/app_config.go | 1 + core/config/docs/chains-tron.toml | 13 + core/config/env/env.go | 1 + core/internal/cltest/cltest.go | 9 + core/services/chainlink/config.go | 7 + core/services/chainlink/config_general.go | 13 + .../services/chainlink/config_general_test.go | 1 + core/services/chainlink/config_test.go | 7 +- .../chainlink/mocks/general_config.go | 92 +++ .../chainlink/relayer_chain_interoperators.go | 17 + .../relayer_chain_interoperators_test.go | 2 + core/services/chainlink/relayer_factory.go | 11 + .../chainlink/testdata/config-invalid.toml | 9 + core/services/chainlink/types.go | 1 + core/services/job/job_orm_test.go | 12 + core/services/job/orm.go | 5 + core/services/keystore/chaintype/chaintype.go | 8 +- core/services/keystore/keys/ocr2key/export.go | 2 + .../keystore/keys/ocr2key/export_test.go | 1 + .../keystore/keys/ocr2key/key_bundle.go | 6 + .../services/keystore/keys/tronkey/account.go | 178 ++++++ .../keystore/keys/tronkey/account_test.go | 177 ++++++ core/services/keystore/keys/tronkey/export.go | 46 ++ .../keystore/keys/tronkey/export_test.go | 19 + core/services/keystore/keys/tronkey/key.go | 109 ++++ .../keystore/keys/tronkey/key_test.go | 85 +++ core/services/keystore/keystoretest.go | 1 + core/services/keystore/master.go | 10 + core/services/keystore/mocks/master.go | 47 ++ core/services/keystore/mocks/tron.go | 534 ++++++++++++++++++ core/services/keystore/models.go | 18 + core/services/keystore/models_test.go | 7 + core/services/keystore/tron.go | 187 ++++++ core/services/keystore/tron_test.go | 240 ++++++++ core/services/relay/relay.go | 2 + core/web/auth/auth_test.go | 4 + core/web/presenters/node_test.go | 2 +- core/web/presenters/tron_chain.go | 45 ++ core/web/presenters/tron_key.go | 34 ++ .../feeds_manager_chain_config_test.go | 75 +++ core/web/resolver/ocr2_keys.go | 6 + core/web/resolver/ocr2_keys_test.go | 1 + core/web/resolver/query.go | 13 + core/web/resolver/resolver_test.go | 2 + core/web/resolver/tron_key.go | 43 ++ core/web/resolver/tron_key_test.go | 74 +++ core/web/router.go | 1 + core/web/schema/schema.graphql | 1 + core/web/schema/type/ocr2_keys.graphql | 1 + core/web/schema/type/tron_key.graphql | 7 + core/web/tron_keys_controller.go | 12 + core/web/tron_keys_controller_test.go | 105 ++++ .../environment/nodeclient/chainlink.go | 28 + .../nodeclient/chainlink_models.go | 42 ++ testdata/scripts/chains/help.txtar | 1 + testdata/scripts/chains/tron/help.txtar | 16 + testdata/scripts/chains/tron/list/help.txtar | 9 + testdata/scripts/help-all/help-all.txtar | 10 + testdata/scripts/keys/help.txtar | 1 + testdata/scripts/keys/tron/help.txtar | 20 + .../node/validate/invalid-duplicates.txtar | 18 +- testdata/scripts/nodes/help.txtar | 1 + testdata/scripts/nodes/tron/help.txtar | 16 + testdata/scripts/nodes/tron/list/help.txtar | 9 + 71 files changed, 2723 insertions(+), 5 deletions(-) create mode 100644 .changeset/wise-buttons-fry.md create mode 100644 core/cmd/tron_keys_commands.go create mode 100644 core/cmd/tron_keys_commands_test.go create mode 100644 core/config/docs/chains-tron.toml create mode 100644 core/services/keystore/keys/tronkey/account.go create mode 100644 core/services/keystore/keys/tronkey/account_test.go create mode 100644 core/services/keystore/keys/tronkey/export.go create mode 100644 core/services/keystore/keys/tronkey/export_test.go create mode 100644 core/services/keystore/keys/tronkey/key.go create mode 100644 core/services/keystore/keys/tronkey/key_test.go create mode 100644 core/services/keystore/mocks/tron.go create mode 100644 core/services/keystore/tron.go create mode 100644 core/services/keystore/tron_test.go create mode 100644 core/web/presenters/tron_chain.go create mode 100644 core/web/presenters/tron_key.go create mode 100644 core/web/resolver/tron_key.go create mode 100644 core/web/resolver/tron_key_test.go create mode 100644 core/web/schema/type/tron_key.graphql create mode 100644 core/web/tron_keys_controller.go create mode 100644 core/web/tron_keys_controller_test.go create mode 100644 testdata/scripts/chains/tron/help.txtar create mode 100644 testdata/scripts/chains/tron/list/help.txtar create mode 100644 testdata/scripts/keys/tron/help.txtar create mode 100644 testdata/scripts/nodes/tron/help.txtar create mode 100644 testdata/scripts/nodes/tron/list/help.txtar diff --git a/.changeset/wise-buttons-fry.md b/.changeset/wise-buttons-fry.md new file mode 100644 index 00000000000..aa3cb1dab79 --- /dev/null +++ b/.changeset/wise-buttons-fry.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Add TRON integration #added diff --git a/.mockery.yaml b/.mockery.yaml index 73f46deed57..7fd4ff242bb 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -221,6 +221,7 @@ packages: StarkNet: config: filename: starknet.go + Tron: VRF: Workflow: github.com/smartcontractkit/chainlink/v2/core/services/ocr: @@ -579,4 +580,4 @@ packages: dir: "{{ .InterfaceDir }}" github.com/smartcontractkit/chainlink/v2/core/capabilities/targets: interfaces: - ContractValueGetter: \ No newline at end of file + ContractValueGetter: diff --git a/core/cmd/app.go b/core/cmd/app.go index 8128d578238..f605b3973c7 100644 --- a/core/cmd/app.go +++ b/core/cmd/app.go @@ -201,6 +201,7 @@ func NewApp(s *Shell) *cli.App { keysCommand("Solana", NewSolanaKeysClient(s)), keysCommand("StarkNet", NewStarkNetKeysClient(s)), keysCommand("Aptos", NewAptosKeysClient(s)), + keysCommand("Tron", NewTronKeysClient(s)), initVRFKeysSubCmd(s), }, diff --git a/core/cmd/shell.go b/core/cmd/shell.go index 94664a3cf3d..09eacd7dc39 100644 --- a/core/cmd/shell.go +++ b/core/cmd/shell.go @@ -293,6 +293,13 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G } initOps = append(initOps, chainlink.InitAptos(ctx, relayerFactory, aptosCfg)) } + if cfg.TronEnabled() { + tronCfg := chainlink.TronFactoryConfig{ + Keystore: keyStore.Tron(), + TOMLConfigs: cfg.TronConfigs(), + } + initOps = append(initOps, chainlink.InitTron(ctx, relayerFactory, tronCfg)) + } relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) if err != nil { diff --git a/core/cmd/shell_local.go b/core/cmd/shell_local.go index 1fdc1a46d34..ed71c5be369 100644 --- a/core/cmd/shell_local.go +++ b/core/cmd/shell_local.go @@ -469,6 +469,12 @@ func (s *Shell) runNode(c *cli.Context) error { return errors.Wrap(err2, "failed to ensure aptos key") } } + if s.Config.TronEnabled() { + err2 := app.GetKeyStore().Tron().EnsureKey(rootCtx) + if err2 != nil { + return errors.Wrap(err2, "failed to ensure tron key") + } + } err2 := app.GetKeyStore().Workflow().EnsureKey(rootCtx) if err2 != nil { diff --git a/core/cmd/tron_keys_commands.go b/core/cmd/tron_keys_commands.go new file mode 100644 index 00000000000..67b3242e1f5 --- /dev/null +++ b/core/cmd/tron_keys_commands.go @@ -0,0 +1,57 @@ +package cmd + +import ( + "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" + "github.com/smartcontractkit/chainlink/v2/core/web/presenters" +) + +type TronKeyPresenter struct { + JAID + presenters.TronKeyResource +} + +// RenderTable implements TableRenderer +func (p TronKeyPresenter) RenderTable(rt RendererTable) error { + headers := []string{"ID", "Public key"} + rows := [][]string{p.ToRow()} + + if _, err := rt.Write([]byte("🔑 Tron Keys\n")); err != nil { + return err + } + renderList(headers, rows, rt.Writer) + + return utils.JustError(rt.Write([]byte("\n"))) +} + +func (p *TronKeyPresenter) ToRow() []string { + row := []string{ + p.ID, + p.PubKey, + } + + return row +} + +type TronKeyPresenters []TronKeyPresenter + +// RenderTable implements TableRenderer +func (ps TronKeyPresenters) RenderTable(rt RendererTable) error { + headers := []string{"ID", "Public key"} + rows := [][]string{} + + for _, p := range ps { + rows = append(rows, p.ToRow()) + } + + if _, err := rt.Write([]byte("🔑 Tron Keys\n")); err != nil { + return err + } + renderList(headers, rows, rt.Writer) + + return utils.JustError(rt.Write([]byte("\n"))) +} + +func NewTronKeysClient(s *Shell) KeysClient { + return newKeysClient[tronkey.Key, TronKeyPresenter, TronKeyPresenters]("Tron", s) +} diff --git a/core/cmd/tron_keys_commands_test.go b/core/cmd/tron_keys_commands_test.go new file mode 100644 index 00000000000..29480600d74 --- /dev/null +++ b/core/cmd/tron_keys_commands_test.go @@ -0,0 +1,174 @@ +package cmd_test + +import ( + "bytes" + "context" + "flag" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/urfave/cli" + + "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink/v2/core/cmd" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" + "github.com/smartcontractkit/chainlink/v2/core/web/presenters" +) + +func TestTronKeyPresenter_RenderTable(t *testing.T) { + t.Parallel() + + var ( + id = "1" + pubKey = "somepubkey" + buffer = bytes.NewBufferString("") + r = cmd.RendererTable{Writer: buffer} + ) + + p := cmd.TronKeyPresenter{ + JAID: cmd.JAID{ID: id}, + TronKeyResource: presenters.TronKeyResource{ + JAID: presenters.NewJAID(id), + PubKey: pubKey, + }, + } + + // Render a single resource + require.NoError(t, p.RenderTable(r)) + + output := buffer.String() + assert.Contains(t, output, id) + assert.Contains(t, output, pubKey) + + // Render many resources + buffer.Reset() + ps := cmd.TronKeyPresenters{p} + require.NoError(t, ps.RenderTable(r)) + + output = buffer.String() + assert.Contains(t, output, id) + assert.Contains(t, output, pubKey) +} + +func TestShell_TronKeys(t *testing.T) { + app := startNewApplicationV2(t, nil) + ks := app.GetKeyStore().Tron() + cleanup := func() { + ctx := context.Background() + keys, err := ks.GetAll() + require.NoError(t, err) + for _, key := range keys { + require.NoError(t, utils.JustError(ks.Delete(ctx, key.ID()))) + } + requireTronKeyCount(t, app, 0) + } + + t.Run("ListTronKeys", func(tt *testing.T) { + defer cleanup() + ctx := testutils.Context(t) + client, r := app.NewShellAndRenderer() + key, err := app.GetKeyStore().Tron().Create(ctx) + require.NoError(t, err) + requireTronKeyCount(t, app, 1) + require.NoError(t, cmd.NewTronKeysClient(client).ListKeys(cltest.EmptyCLIContext())) + require.Len(t, r.Renders, 1) + keys := *r.Renders[0].(*cmd.TronKeyPresenters) + assert.Equal(t, key.PublicKeyStr(), keys[0].PubKey) + }) + + t.Run("CreateTronKey", func(tt *testing.T) { + defer cleanup() + client, _ := app.NewShellAndRenderer() + require.NoError(t, cmd.NewTronKeysClient(client).CreateKey(nilContext)) + keys, err := app.GetKeyStore().Tron().GetAll() + require.NoError(t, err) + require.Len(t, keys, 1) + }) + + t.Run("DeleteTronKey", func(tt *testing.T) { + defer cleanup() + ctx := testutils.Context(t) + client, _ := app.NewShellAndRenderer() + key, err := app.GetKeyStore().Tron().Create(ctx) + require.NoError(t, err) + requireTronKeyCount(t, app, 1) + set := flag.NewFlagSet("test", 0) + flagSetApplyFromAction(cmd.NewTronKeysClient(client).DeleteKey, set, "tron") + + require.NoError(tt, set.Set("yes", "true")) + + strID := key.ID() + err = set.Parse([]string{strID}) + require.NoError(t, err) + c := cli.NewContext(nil, set, nil) + err = cmd.NewTronKeysClient(client).DeleteKey(c) + require.NoError(t, err) + requireTronKeyCount(t, app, 0) + }) + + t.Run("ImportExportTronKey", func(tt *testing.T) { + defer cleanup() + defer deleteKeyExportFile(t) + ctx := testutils.Context(t) + client, _ := app.NewShellAndRenderer() + + _, err := app.GetKeyStore().Tron().Create(ctx) + require.NoError(t, err) + + keys := requireTronKeyCount(t, app, 1) + key := keys[0] + keyName := keyNameForTest(t) + + // Export test invalid id + set := flag.NewFlagSet("test Tron export", 0) + flagSetApplyFromAction(cmd.NewTronKeysClient(client).ExportKey, set, "tron") + + require.NoError(tt, set.Parse([]string{"0"})) + require.NoError(tt, set.Set("new-password", "../internal/fixtures/incorrect_password.txt")) + require.NoError(tt, set.Set("output", keyName)) + + c := cli.NewContext(nil, set, nil) + err = cmd.NewTronKeysClient(client).ExportKey(c) + require.Error(t, err, "Error exporting") + require.Error(t, utils.JustError(os.Stat(keyName))) + + // Export test + set = flag.NewFlagSet("test Tron export", 0) + flagSetApplyFromAction(cmd.NewTronKeysClient(client).ExportKey, set, "tron") + + require.NoError(tt, set.Parse([]string{key.ID()})) + require.NoError(tt, set.Set("new-password", "../internal/fixtures/incorrect_password.txt")) + require.NoError(tt, set.Set("output", keyName)) + + c = cli.NewContext(nil, set, nil) + + require.NoError(t, cmd.NewTronKeysClient(client).ExportKey(c)) + require.NoError(t, utils.JustError(os.Stat(keyName))) + + require.NoError(t, utils.JustError(app.GetKeyStore().Tron().Delete(ctx, key.ID()))) + requireTronKeyCount(t, app, 0) + + set = flag.NewFlagSet("test Tron import", 0) + flagSetApplyFromAction(cmd.NewTronKeysClient(client).ImportKey, set, "tron") + + require.NoError(tt, set.Parse([]string{keyName})) + require.NoError(tt, set.Set("old-password", "../internal/fixtures/incorrect_password.txt")) + c = cli.NewContext(nil, set, nil) + require.NoError(t, cmd.NewTronKeysClient(client).ImportKey(c)) + + requireTronKeyCount(t, app, 1) + }) +} + +func requireTronKeyCount(t *testing.T, app chainlink.Application, length int) []tronkey.Key { + t.Helper() + keys, err := app.GetKeyStore().Tron().GetAll() + require.NoError(t, err) + require.Len(t, keys, length) + return keys +} diff --git a/core/config/app_config.go b/core/config/app_config.go index 3f2a5472b24..4ce8873bb96 100644 --- a/core/config/app_config.go +++ b/core/config/app_config.go @@ -25,6 +25,7 @@ type AppConfig interface { SolanaEnabled() bool StarkNetEnabled() bool AptosEnabled() bool + TronEnabled() bool Validate() error ValidateDB() error diff --git a/core/config/docs/chains-tron.toml b/core/config/docs/chains-tron.toml new file mode 100644 index 00000000000..55a44bacd7a --- /dev/null +++ b/core/config/docs/chains-tron.toml @@ -0,0 +1,13 @@ +[[Tron]] +# ChainID is the Tron chain ID. +ChainID = 'foobar' # Example +# Enabled enables this chain. +Enabled = true # Default + +[[Tron.Nodes]] +# Name is a unique (per-chain) identifier for this node. +Name = 'primary' # Example +# URL is the full node HTTP endpoint for this node. +URL = 'https://api.trongrid.io/wallet' # Example +# SolidityURL is the solidity node HTTP endpoint for this node. +SolidityURL = 'http://api.trongrid.io/wallet' # Example diff --git a/core/config/env/env.go b/core/config/env/env.go index c34cd7f4f5e..68b79c7575c 100644 --- a/core/config/env/env.go +++ b/core/config/env/env.go @@ -29,6 +29,7 @@ var ( MercuryPlugin = NewPlugin("mercury") SolanaPlugin = NewPlugin("solana") StarknetPlugin = NewPlugin("starknet") + TronPlugin = NewPlugin("tron") // PrometheusDiscoveryHostName is the externally accessible hostname // published by the node in the `/discovery` endpoint. Generally, it is expected to match // the public hostname of node. diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 85faad8e5fe..5780410ab60 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -82,6 +82,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/pg" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" @@ -133,6 +134,7 @@ var ( DefaultSolanaKey = solkey.MustNewInsecure(keystest.NewRandReaderFromSeed(KeyBigIntSeed)) DefaultStarkNetKey = starkkey.MustNewInsecure(keystest.NewRandReaderFromSeed(KeyBigIntSeed)) DefaultAptosKey = aptoskey.MustNewInsecure(keystest.NewRandReaderFromSeed(KeyBigIntSeed)) + DefaultTronKey = tronkey.MustNewInsecure(keystest.NewRandReaderFromSeed(KeyBigIntSeed)) DefaultVRFKey = vrfkey.MustNewV2XXXTestingOnly(big.NewInt(KeyBigIntSeed)) ) @@ -471,6 +473,13 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn } initOps = append(initOps, chainlink.InitAptos(ctx, relayerFactory, aptosCfg)) } + if cfg.TronEnabled() { + tronCfg := chainlink.TronFactoryConfig{ + Keystore: keyStore.Tron(), + TOMLConfigs: cfg.TronConfigs(), + } + initOps = append(initOps, chainlink.InitTron(ctx, relayerFactory, tronCfg)) + } relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) if err != nil { diff --git a/core/services/chainlink/config.go b/core/services/chainlink/config.go index 9f083ef89af..dd54856cf0a 100644 --- a/core/services/chainlink/config.go +++ b/core/services/chainlink/config.go @@ -46,6 +46,8 @@ type Config struct { Starknet stkcfg.TOMLConfigs `toml:",omitempty"` Aptos RawConfigs `toml:",omitempty"` + + Tron RawConfigs `toml:",omitempty"` } // RawConfigs is a list of RawConfig. @@ -260,6 +262,7 @@ func (c *Config) TOMLString() (string, error) { // warnings aggregates warnings from valueWarnings and deprecationWarnings func (c *Config) warnings() (err error) { deprecationErr := c.deprecationWarnings() + warningErr := c.valueWarnings() err = multierr.Append(deprecationErr, warningErr) _, list := commonconfig.MultiErrorList(err) @@ -352,6 +355,10 @@ func (c *Config) SetFrom(f *Config) (err error) { err = multierr.Append(err, commonconfig.NamedMultiErrorList(err5, "Aptos")) } + if err6 := c.Tron.SetFrom(f.Tron); err6 != nil { + err = multierr.Append(err, commonconfig.NamedMultiErrorList(err6, "Tron")) + } + _, err = commonconfig.MultiErrorList(err) return err diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index dd0dc87b59a..e67d92fefc9 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -213,6 +213,10 @@ func (g *generalConfig) AptosConfigs() RawConfigs { return g.c.Aptos } +func (g *generalConfig) TronConfigs() RawConfigs { + return g.c.Tron +} + func (g *generalConfig) Validate() error { return g.validate(g.secrets.Validate) } @@ -358,6 +362,15 @@ func (g *generalConfig) AptosEnabled() bool { return false } +func (g *generalConfig) TronEnabled() bool { + for _, c := range g.c.Tron { + if c.IsEnabled() { + return true + } + } + return false +} + func (g *generalConfig) WebServer() config.WebServer { return &webServerConfig{c: g.c.WebServer, s: g.secrets.WebServer, rootDir: g.RootDir} } diff --git a/core/services/chainlink/config_general_test.go b/core/services/chainlink/config_general_test.go index 29393ee0fdd..3f02b880baf 100644 --- a/core/services/chainlink/config_general_test.go +++ b/core/services/chainlink/config_general_test.go @@ -28,6 +28,7 @@ func TestTOMLGeneralConfig_Defaults(t *testing.T) { assert.False(t, config.CosmosEnabled()) assert.False(t, config.SolanaEnabled()) assert.False(t, config.StarkNetEnabled()) + assert.False(t, config.TronEnabled()) assert.Equal(t, false, config.JobPipeline().ExternalInitiatorsEnabled()) assert.Equal(t, 15*time.Minute, config.WebServer().SessionTimeout().Duration()) } diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 7d5b8628651..eb467835b6f 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -1440,7 +1440,7 @@ func TestConfig_Validate(t *testing.T) { toml string exp string }{ - {name: "invalid", toml: invalidTOML, exp: `invalid configuration: 8 errors: + {name: "invalid", toml: invalidTOML, exp: `invalid configuration: 9 errors: - P2P.V2.Enabled: invalid value (false): P2P required for OCR or OCR2. Please enable P2P or disable OCR/OCR2. - Database.Lock.LeaseRefreshInterval: invalid value (6s): must be less than or equal to half of LeaseDuration (10s) - WebServer: 8 errors: @@ -1537,6 +1537,11 @@ func TestConfig_Validate(t *testing.T) { - Nodes: missing: must have at least one node - Aptos: 2 errors: - 0.Nodes.1.Name: invalid value (primary): duplicate - must be unique + - 0: 2 errors: + - Enabled: invalid value (1): expected bool + - ChainID: missing: required for all chains + - Tron: 2 errors: + - 0.Nodes.1.Name: invalid value (tron-test): duplicate - must be unique - 0: 2 errors: - Enabled: invalid value (1): expected bool - ChainID: missing: required for all chains`}, diff --git a/core/services/chainlink/mocks/general_config.go b/core/services/chainlink/mocks/general_config.go index 738909538f3..9df0ab85985 100644 --- a/core/services/chainlink/mocks/general_config.go +++ b/core/services/chainlink/mocks/general_config.go @@ -1959,6 +1959,98 @@ func (_c *GeneralConfig_Tracing_Call) RunAndReturn(run func() config.Tracing) *G return _c } +// TronConfigs provides a mock function with no fields +func (_m *GeneralConfig) TronConfigs() chainlink.RawConfigs { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TronConfigs") + } + + var r0 chainlink.RawConfigs + if rf, ok := ret.Get(0).(func() chainlink.RawConfigs); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(chainlink.RawConfigs) + } + } + + return r0 +} + +// GeneralConfig_TronConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TronConfigs' +type GeneralConfig_TronConfigs_Call struct { + *mock.Call +} + +// TronConfigs is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) TronConfigs() *GeneralConfig_TronConfigs_Call { + return &GeneralConfig_TronConfigs_Call{Call: _e.mock.On("TronConfigs")} +} + +func (_c *GeneralConfig_TronConfigs_Call) Run(run func()) *GeneralConfig_TronConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_TronConfigs_Call) Return(_a0 chainlink.RawConfigs) *GeneralConfig_TronConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_TronConfigs_Call) RunAndReturn(run func() chainlink.RawConfigs) *GeneralConfig_TronConfigs_Call { + _c.Call.Return(run) + return _c +} + +// TronEnabled provides a mock function with no fields +func (_m *GeneralConfig) TronEnabled() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TronEnabled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// GeneralConfig_TronEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TronEnabled' +type GeneralConfig_TronEnabled_Call struct { + *mock.Call +} + +// TronEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) TronEnabled() *GeneralConfig_TronEnabled_Call { + return &GeneralConfig_TronEnabled_Call{Call: _e.mock.On("TronEnabled")} +} + +func (_c *GeneralConfig_TronEnabled_Call) Run(run func()) *GeneralConfig_TronEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_TronEnabled_Call) Return(_a0 bool) *GeneralConfig_TronEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_TronEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_TronEnabled_Call { + _c.Call.Return(run) + return _c +} + // Validate provides a mock function with no fields func (_m *GeneralConfig) Validate() error { ret := _m.Called() diff --git a/core/services/chainlink/relayer_chain_interoperators.go b/core/services/chainlink/relayer_chain_interoperators.go index 2fc671bfe6e..6242af51935 100644 --- a/core/services/chainlink/relayer_chain_interoperators.go +++ b/core/services/chainlink/relayer_chain_interoperators.go @@ -204,6 +204,23 @@ func InitAptos(ctx context.Context, factory RelayerFactory, config AptosFactoryC } } +// InitTron is a option for instantiating Tron relayers +func InitTron(ctx context.Context, factory RelayerFactory, config TronFactoryConfig) CoreRelayerChainInitFunc { + return func(op *CoreRelayerChainInteroperators) error { + tronRelayers, err := factory.NewTron(config.Keystore, config.TOMLConfigs) + if err != nil { + return fmt.Errorf("failed to setup Tron relayer: %w", err) + } + + for id, relayer := range tronRelayers { + op.srvs = append(op.srvs, relayer) + op.loopRelayers[id] = relayer + } + + return nil + } +} + // Get a [loop.Relayer] by id func (rs *CoreRelayerChainInteroperators) Get(id types.RelayID) (loop.Relayer, error) { rs.mu.Lock() diff --git a/core/services/chainlink/relayer_chain_interoperators_test.go b/core/services/chainlink/relayer_chain_interoperators_test.go index a4bd8c168ba..f03e172542c 100644 --- a/core/services/chainlink/relayer_chain_interoperators_test.go +++ b/core/services/chainlink/relayer_chain_interoperators_test.go @@ -378,6 +378,8 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { expectedChainCnt, expectedNodeCnt = tt.expectedDummyChainCnt, tt.expectedDummyNodeCnt case relay.NetworkAptos: t.Skip("aptos doesn't need a CoreRelayerChainInteroperator") + case relay.NetworkTron: + t.Skip("tron doesn't need a CoreRelayerChainInteroperator") default: require.Fail(t, "untested relay network", relayNetwork) diff --git a/core/services/chainlink/relayer_factory.go b/core/services/chainlink/relayer_factory.go index a1571663d5a..c173c7fecb7 100644 --- a/core/services/chainlink/relayer_factory.go +++ b/core/services/chainlink/relayer_factory.go @@ -371,3 +371,14 @@ func (r *RelayerFactory) NewLOOPRelayer(name string, network string, plugin env. } return relayers, nil } + +type TronFactoryConfig struct { + Keystore keystore.Tron + TOMLConfigs RawConfigs +} + +func (r *RelayerFactory) NewTron(ks keystore.Tron, chainCfgs RawConfigs) (map[types.RelayID]loop.Relayer, error) { + plugin := env.NewPlugin("tron") + loopKs := &keystore.TronLOOPKeystore{Tron: ks} + return r.NewLOOPRelayer("Tron", relay.NetworkTron, plugin, loopKs, chainCfgs) +} diff --git a/core/services/chainlink/testdata/config-invalid.toml b/core/services/chainlink/testdata/config-invalid.toml index 967ef76de8e..347530cec53 100644 --- a/core/services/chainlink/testdata/config-invalid.toml +++ b/core/services/chainlink/testdata/config-invalid.toml @@ -187,6 +187,15 @@ Name = 'primary' [[Aptos.Nodes]] Name = 'primary' +[[Tron]] +Enabled = 1 + +[[Tron.Nodes]] +Name = 'tron-test' + +[[Tron.Nodes]] +Name = 'tron-test' + [OCR2] Enabled = true diff --git a/core/services/chainlink/types.go b/core/services/chainlink/types.go index 74ffc5dc66d..53e7d2a9366 100644 --- a/core/services/chainlink/types.go +++ b/core/services/chainlink/types.go @@ -16,6 +16,7 @@ type GeneralConfig interface { SolanaConfigs() solcfg.TOMLConfigs StarknetConfigs() stkcfg.TOMLConfigs AptosConfigs() RawConfigs + TronConfigs() RawConfigs // ConfigTOML returns both the user provided and effective configuration as TOML. ConfigTOML() (user, effective string) } diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index 27223e0d706..7a310d6f791 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -1020,6 +1020,18 @@ func TestORM_ValidateKeyStoreMatch(t *testing.T) { require.NoError(t, err) }) + t.Run(("test Tron key validation"), func(t *testing.T) { + ctx := testutils.Context(t) + jb.OCR2OracleSpec.Relay = relay.NetworkTron + err := job.ValidateKeyStoreMatch(ctx, jb.OCR2OracleSpec, keyStore, "bad key") + require.EqualError(t, err, "no Tron key matching: \"bad key\"") + + tronKey, err := keyStore.Tron().Create(ctx) + require.NoError(t, err) + err = job.ValidateKeyStoreMatch(ctx, jb.OCR2OracleSpec, keyStore, tronKey.ID()) + require.NoError(t, err) + }) + t.Run("test Mercury ETH key validation", func(t *testing.T) { ctx := testutils.Context(t) jb.OCR2OracleSpec.PluginType = types.Mercury diff --git a/core/services/job/orm.go b/core/services/job/orm.go index cfd8060d60c..fa64404ec3a 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -658,6 +658,11 @@ func validateKeyStoreMatchForRelay(ctx context.Context, network string, keyStore if err != nil { return errors.Errorf("no Aptos key matching: %q", key) } + case relay.NetworkTron: + _, err := keyStore.Tron().Get(key) + if err != nil { + return errors.Errorf("no Tron key matching: %q", key) + } } return nil } diff --git a/core/services/keystore/chaintype/chaintype.go b/core/services/keystore/chaintype/chaintype.go index 419dfa2d073..8aca72d4f83 100644 --- a/core/services/keystore/chaintype/chaintype.go +++ b/core/services/keystore/chaintype/chaintype.go @@ -21,6 +21,8 @@ const ( StarkNet ChainType = "starknet" // Aptos for the Aptos chain Aptos ChainType = "aptos" + // Tron for the Tron chain + Tron ChainType = "tron" ) type ChainTypes []ChainType @@ -48,6 +50,8 @@ func NewChainType(typ uint8) (ChainType, error) { return StarkNet, nil case 5: return Aptos, nil + case 6: + return Tron, nil default: return "", fmt.Errorf("unexpected chaintype.ChainType: %#v", typ) } @@ -65,13 +69,15 @@ func (c ChainType) Type() (uint8, error) { return 4, nil case Aptos: return 5, nil + case Tron: + return 6, nil default: return 0, fmt.Errorf("unexpected chaintype.ChainType: %#v", c) } } // SupportedChainTypes contain all chains that are supported -var SupportedChainTypes = ChainTypes{EVM, Cosmos, Solana, StarkNet, Aptos} +var SupportedChainTypes = ChainTypes{EVM, Cosmos, Solana, StarkNet, Aptos, Tron} // ErrInvalidChainType is an error to indicate an unsupported chain type var ErrInvalidChainType error diff --git a/core/services/keystore/keys/ocr2key/export.go b/core/services/keystore/keys/ocr2key/export.go index 8fa5ffedfed..eb7fe5f5eb9 100644 --- a/core/services/keystore/keys/ocr2key/export.go +++ b/core/services/keystore/keys/ocr2key/export.go @@ -48,6 +48,8 @@ func FromEncryptedJSON(keyJSON []byte, password string) (KeyBundle, error) { kb = newKeyBundle(new(starkkey.OCR2Key)) case chaintype.Aptos: kb = newKeyBundle(new(aptosKeyring)) + case chaintype.Tron: + kb = newKeyBundle(new(evmKeyring)) default: return nil, chaintype.NewErrInvalidChainType(export.ChainType) } diff --git a/core/services/keystore/keys/ocr2key/export_test.go b/core/services/keystore/keys/ocr2key/export_test.go index b0ffa2db009..fd1e867dfa9 100644 --- a/core/services/keystore/keys/ocr2key/export_test.go +++ b/core/services/keystore/keys/ocr2key/export_test.go @@ -19,6 +19,7 @@ func TestExport(t *testing.T) { {chain: chaintype.Solana}, {chain: chaintype.StarkNet}, {chain: chaintype.Aptos}, + {chain: chaintype.Tron}, } for _, tc := range tt { tc := tc diff --git a/core/services/keystore/keys/ocr2key/key_bundle.go b/core/services/keystore/keys/ocr2key/key_bundle.go index a08bd84ac30..07ac352a17d 100644 --- a/core/services/keystore/keys/ocr2key/key_bundle.go +++ b/core/services/keystore/keys/ocr2key/key_bundle.go @@ -59,6 +59,8 @@ func New(chainType chaintype.ChainType) (KeyBundle, error) { return newKeyBundleRand(chaintype.StarkNet, starkkey.NewOCR2Key) case chaintype.Aptos: return newKeyBundleRand(chaintype.Aptos, newAptosKeyring) + case chaintype.Tron: + return newKeyBundleRand(chaintype.Tron, newEVMKeyring) } return nil, chaintype.NewErrInvalidChainType(chainType) } @@ -76,6 +78,8 @@ func MustNewInsecure(reader io.Reader, chainType chaintype.ChainType) KeyBundle return mustNewKeyBundleInsecure(chaintype.StarkNet, starkkey.NewOCR2Key, reader) case chaintype.Aptos: return mustNewKeyBundleInsecure(chaintype.Aptos, newAptosKeyring, reader) + case chaintype.Tron: + return mustNewKeyBundleInsecure(chaintype.Tron, newEVMKeyring, reader) } panic(chaintype.NewErrInvalidChainType(chainType)) } @@ -126,6 +130,8 @@ func (raw Raw) Key() (kb KeyBundle) { kb = newKeyBundle(new(starkkey.OCR2Key)) case chaintype.Aptos: kb = newKeyBundle(new(aptosKeyring)) + case chaintype.Tron: + kb = newKeyBundle(new(evmKeyring)) default: return nil } diff --git a/core/services/keystore/keys/tronkey/account.go b/core/services/keystore/keys/tronkey/account.go new file mode 100644 index 00000000000..9c90422d2a7 --- /dev/null +++ b/core/services/keystore/keys/tronkey/account.go @@ -0,0 +1,178 @@ +package tronkey + +import ( + "crypto/ecdsa" + "crypto/sha256" + "encoding/hex" + "errors" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/mr-tron/base58" +) + +// Extracted from go-tron sdk: https://github.com/fbsobreira/gotron-sdk + +const ( + // HashLength is the expected length of the hash + HashLength = 32 + // AddressLengthBase58 is the expected length of the address in base58format + AddressLengthBase58 = 34 + // Tron Address Prefix + prefixMainnet = 0x41 + // TronBytePrefix is the hex prefix to address + TronBytePrefix = byte(prefixMainnet) + // Tron address should have 21 bytes (20 bytes + 1 byte prefix) + AddressLength = 21 +) + +// Address represents the 21 byte address of an Tron account. +type Address [AddressLength]byte + +// Bytes get bytes from address +func (a Address) Bytes() []byte { + return a[:] +} + +// Hex get bytes from address in string +func (a Address) Hex() string { + return BytesToHexString(a[:]) +} + +// HexToAddress returns Address with byte values of s. +func HexToAddress(s string) (Address, error) { + addr, err := FromHex(s) + if err != nil { + return Address{}, err + } + // Check if the address starts with '41' and is 21 characters long + if len(addr) != AddressLength || addr[0] != prefixMainnet { + return Address{}, errors.New("invalid Tron address") + } + return Address(addr), nil +} + +// Base58ToAddress returns Address with byte values of s. +func Base58ToAddress(s string) (Address, error) { + addr, err := DecodeCheck(s) + if err != nil { + return Address{}, err + } + return Address(addr), nil +} + +// String implements fmt.Stringer. +// Returns the address as a base58 encoded string. +func (a Address) String() string { + if len(a) == 0 { + return "" + } + + if a[0] == 0 { + return new(big.Int).SetBytes(a.Bytes()).String() + } + return EncodeCheck(a.Bytes()) +} + +// PubkeyToAddress returns address from ecdsa public key +func PubkeyToAddress(p ecdsa.PublicKey) Address { + address := crypto.PubkeyToAddress(p) + + addressTron := make([]byte, 0) + addressTron = append(addressTron, TronBytePrefix) + addressTron = append(addressTron, address.Bytes()...) + return Address(addressTron) +} + +// BytesToHexString encodes bytes as a hex string. +func BytesToHexString(bytes []byte) string { + encode := make([]byte, len(bytes)*2) + hex.Encode(encode, bytes) + return "0x" + string(encode) +} + +// FromHex returns the bytes represented by the hexadecimal string s. +// s may be prefixed with "0x". +func FromHex(s string) ([]byte, error) { + if Has0xPrefix(s) { + s = s[2:] + } + if len(s)%2 == 1 { + s = "0" + s + } + return HexToBytes(s) +} + +// Has0xPrefix validates str begins with '0x' or '0X'. +func Has0xPrefix(str string) bool { + return len(str) >= 2 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X') +} + +// HexToBytes returns the bytes represented by the hexadecimal string str. +func HexToBytes(str string) ([]byte, error) { + return hex.DecodeString(str) +} + +func Encode(input []byte) string { + return base58.Encode(input) +} + +func EncodeCheck(input []byte) string { + h256h0 := sha256.New() + h256h0.Write(input) + h0 := h256h0.Sum(nil) + + h256h1 := sha256.New() + h256h1.Write(h0) + h1 := h256h1.Sum(nil) + + inputCheck := input + inputCheck = append(inputCheck, h1[:4]...) + + return Encode(inputCheck) +} + +func DecodeCheck(input string) ([]byte, error) { + decodeCheck, err := Decode(input) + if err != nil { + return nil, err + } + + if len(decodeCheck) < 4 { + return nil, errors.New("base58 check error") + } + + // tron address should should have 21 bytes (including prefix) + 4 checksum + if len(decodeCheck) != AddressLength+4 { + return nil, fmt.Errorf("invalid address length: %d", len(decodeCheck)) + } + + // check prefix + if decodeCheck[0] != prefixMainnet { + return nil, errors.New("invalid prefix") + } + + decodeData := decodeCheck[:len(decodeCheck)-4] + + h256h0 := sha256.New() + h256h0.Write(decodeData) + h0 := h256h0.Sum(nil) + + h256h1 := sha256.New() + h256h1.Write(h0) + h1 := h256h1.Sum(nil) + + if h1[0] == decodeCheck[len(decodeData)] && + h1[1] == decodeCheck[len(decodeData)+1] && + h1[2] == decodeCheck[len(decodeData)+2] && + h1[3] == decodeCheck[len(decodeData)+3] { + return decodeData, nil + } + + return nil, errors.New("base58 check error") +} + +func Decode(input string) ([]byte, error) { + return base58.Decode(input) +} diff --git a/core/services/keystore/keys/tronkey/account_test.go b/core/services/keystore/keys/tronkey/account_test.go new file mode 100644 index 00000000000..9a92801bb13 --- /dev/null +++ b/core/services/keystore/keys/tronkey/account_test.go @@ -0,0 +1,177 @@ +package tronkey + +import ( + "bytes" + "regexp" + "strings" + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_DecodeBase58(t *testing.T) { + invalidAddresses := []string{ + "TronEnergyioE1Z3ukeRv38sYkv5Jn55bL", + "TronEnergyioNijNo8g3LF2ABKUAae6D2Z", + "TronEnergyio3ZMcXA5hSjrTxaioKGgqyr", + } + + validAddresses := []string{ + "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", + "TVj7RNVHy6thbM7BWdSe9G6gXwKhjhdNZS", + "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC", + } + + for _, addr := range invalidAddresses { + _, err := DecodeCheck(addr) + require.Error(t, err) + } + + for _, addr := range validAddresses { + _, err := DecodeCheck(addr) + require.NoError(t, err) + } +} + +func TestAddress(t *testing.T) { + t.Run("Valid Addresses", func(t *testing.T) { + validAddresses := []string{ + "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", + "TVj7RNVHy6thbM7BWdSe9G6gXwKhjhdNZS", + "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC", + } + + for _, addrStr := range validAddresses { + t.Run(addrStr, func(t *testing.T) { + addr, err := Base58ToAddress(addrStr) + require.NoError(t, err) + require.Equal(t, addrStr, addr.String()) + + decoded, err := DecodeCheck(addrStr) + require.NoError(t, err) + require.True(t, bytes.Equal(decoded, addr.Bytes())) + }) + } + }) + + t.Run("Invalid Addresses", func(t *testing.T) { + invalidAddresses := []string{ + "TronEnergyioE1Z3ukeRv38sYkv5Jn55bL", + "TronEnergyioNijNo8g3LF2ABKUAae6D2Z", + "TronEnergyio3ZMcXA5hSjrTxaioKGgqyr", + } + + for _, addrStr := range invalidAddresses { + t.Run(addrStr, func(t *testing.T) { + _, err := Base58ToAddress(addrStr) + require.Error(t, err) + + _, err = DecodeCheck(addrStr) + require.Error(t, err) + }) + } + }) + + t.Run("Address Conversion", func(t *testing.T) { + addrStr := "TSvT6Bg3siokv3dbdtt9o4oM1CTXmymGn1" + addr, err := Base58ToAddress(addrStr) + require.NoError(t, err) + + t.Run("To Bytes", func(t *testing.T) { + bytes := addr.Bytes() + require.Len(t, bytes, 21) + }) + + t.Run("To Hex", func(t *testing.T) { + hex := addr.Hex() + require.Equal(t, "0x", hex[:2]) + require.Len(t, hex, 44) + }) + }) + + t.Run("Address Validity", func(t *testing.T) { + t.Run("Valid Address", func(t *testing.T) { + addr, err := Base58ToAddress("TSvT6Bg3siokv3dbdtt9o4oM1CTXmymGn1") + require.NoError(t, err) + require.True(t, isValid(addr)) + }) + + t.Run("Zero Address", func(t *testing.T) { + addr := Address{} + require.False(t, isValid(addr)) + }) + }) +} + +func TestHexToAddress(t *testing.T) { + t.Run("Valid Hex Addresses", func(t *testing.T) { + validHexAddresses := []string{ + "41a614f803b6fd780986a42c78ec9c7f77e6ded13c", + "41b2a2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2", + "41c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", + } + + for _, hexStr := range validHexAddresses { + t.Run(hexStr, func(t *testing.T) { + addr, err := HexToAddress(hexStr) + require.NoError(t, err) + require.Equal(t, "0x"+hexStr, addr.Hex()) + }) + } + }) + + t.Run("Invalid Hex Addresses", func(t *testing.T) { + invalidHexAddresses := []string{ + "41a614f803b6fd780986a42c78ec9c7f77e6ded13", // Too short + "41b2a2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2", // Too long + "41g3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", // Invalid character 'g' + "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", // Missing prefix '41' + } + + for _, hexStr := range invalidHexAddresses { + t.Run(hexStr, func(t *testing.T) { + _, err := HexToAddress(hexStr) + require.Error(t, err) + }) + } + }) +} + +// Helper Functions for testing + +// isValid checks if the address is a valid TRON address +func isValid(a Address) bool { + // Check if it's a valid Base58 address + base58Str := a.String() + if isValidBase58Address(base58Str) { + return true + } + + // Check if it's a valid hex address + hexStr := a.Hex() + return isValidHexAddress(strings.TrimPrefix(hexStr, "0x")) +} + +// isValidBase58Address check if a string is a valid Base58 TRON address +func isValidBase58Address(address string) bool { + // Check if the address starts with 'T' and is 34 characters long + if len(address) != 34 || address[0] != 'T' { + return false + } + + // Check if the address contains only valid Base58 characters + validChars := regexp.MustCompile("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$") + return validChars.MatchString(address) +} + +// isValidHexAddressto check if a string is a valid hex TRON address +func isValidHexAddress(address string) bool { + // Check if the address starts with '41' and is 42 characters long + if len(address) != 42 || address[:2] != "41" { + return false + } + + // Check if the address contains only valid hexadecimal characters + validChars := regexp.MustCompile("^[0-9A-Fa-f]+$") + return validChars.MatchString(address[2:]) // Check the part after '41' +} diff --git a/core/services/keystore/keys/tronkey/export.go b/core/services/keystore/keys/tronkey/export.go new file mode 100644 index 00000000000..7688650c58d --- /dev/null +++ b/core/services/keystore/keys/tronkey/export.go @@ -0,0 +1,46 @@ +package tronkey + +import ( + "github.com/ethereum/go-ethereum/accounts/keystore" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +const keyTypeIdentifier = "Tron" + +// FromEncryptedJSON gets key from json and password +func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { + return keys.FromEncryptedJSON( + keyTypeIdentifier, + keyJSON, + password, + adulteratedPassword, + func(_ keys.EncryptedKeyExport, rawPrivKey []byte) (Key, error) { + return Raw(rawPrivKey).Key(), nil + }, + ) +} + +// ToEncryptedJSON returns encrypted JSON representing key +func (key Key) ToEncryptedJSON(password string, scryptParams utils.ScryptParams) (export []byte, err error) { + return keys.ToEncryptedJSON( + keyTypeIdentifier, + key.Raw(), + key, + password, + scryptParams, + adulteratedPassword, + func(id string, key Key, cryptoJSON keystore.CryptoJSON) keys.EncryptedKeyExport { + return keys.EncryptedKeyExport{ + KeyType: id, + PublicKey: key.PublicKeyStr(), + Crypto: cryptoJSON, + } + }, + ) +} + +func adulteratedPassword(password string) string { + return "tronkey" + password +} diff --git a/core/services/keystore/keys/tronkey/export_test.go b/core/services/keystore/keys/tronkey/export_test.go new file mode 100644 index 00000000000..5e3e605ed34 --- /dev/null +++ b/core/services/keystore/keys/tronkey/export_test.go @@ -0,0 +1,19 @@ +package tronkey + +import ( + "testing" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" +) + +func TestTronKeys_ExportImport(t *testing.T) { + keys.RunKeyExportImportTestcase(t, createKey, decryptKey) +} + +func createKey() (keys.KeyType, error) { + return New() +} + +func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { + return FromEncryptedJSON(keyJSON, password) +} diff --git a/core/services/keystore/keys/tronkey/key.go b/core/services/keystore/keys/tronkey/key.go new file mode 100644 index 00000000000..5f5b36b8c14 --- /dev/null +++ b/core/services/keystore/keys/tronkey/key.go @@ -0,0 +1,109 @@ +package tronkey + +import ( + "crypto/ecdsa" + "crypto/rand" + "encoding/hex" + "fmt" + "io" + "math/big" + + "github.com/ethereum/go-ethereum/crypto" +) + +// Tron uses the same elliptic curve cryptography as Ethereum (ECDSA with secp256k1) +var curve = crypto.S256() + +// Raw represents the Tron private key +type Raw []byte + +// Key generates a public-private key pair from the raw private key +func (raw Raw) Key() Key { + var privKey ecdsa.PrivateKey + d := big.NewInt(0).SetBytes(raw) + privKey.PublicKey.Curve = curve + privKey.D = d + privKey.PublicKey.X, privKey.PublicKey.Y = curve.ScalarBaseMult(d.Bytes()) + return Key{ + pubKey: &privKey.PublicKey, + privKey: &privKey, + } +} + +func (raw Raw) String() string { + return "" +} + +func (raw Raw) GoString() string { + return raw.String() +} + +var _ fmt.GoStringer = &Key{} + +type Key struct { + privKey *ecdsa.PrivateKey + pubKey *ecdsa.PublicKey +} + +func New() (Key, error) { + return newFrom(rand.Reader) +} + +// MustNewInsecure return Key if no error +// This insecure function is used for testing purposes only +func MustNewInsecure(reader io.Reader) Key { + key, err := newFrom(reader) + if err != nil { + panic(err) + } + return key +} + +func newFrom(reader io.Reader) (Key, error) { + privKeyECDSA, err := ecdsa.GenerateKey(curve, reader) + if err != nil { + return Key{}, err + } + return Key{ + privKey: privKeyECDSA, + pubKey: &privKeyECDSA.PublicKey, + }, nil +} + +func (key Key) ID() string { + return key.Base58Address() +} + +func (key Key) Raw() Raw { + return key.privKey.D.Bytes() +} + +func (key Key) ToEcdsaPrivKey() *ecdsa.PrivateKey { + return key.privKey +} + +func (key Key) String() string { + return fmt.Sprintf("TronKey{PrivateKey: , Address: %s}", key.Base58Address()) +} + +// GoString wraps String() +func (key Key) GoString() string { + return key.String() +} + +// Sign is used to sign a message +func (key Key) Sign(msg []byte) ([]byte, error) { + return crypto.Sign(msg, key.privKey) +} + +// PublicKeyStr returns the public key as a hexadecimal string +func (key Key) PublicKeyStr() string { + pubKeyBytes := crypto.FromECDSAPub(key.pubKey) + return hex.EncodeToString(pubKeyBytes) +} + +// Base58Address returns the Tron address in Base58 format with checksum +func (key Key) Base58Address() string { + address := PubkeyToAddress(*key.pubKey) + return address.String() +} diff --git a/core/services/keystore/keys/tronkey/key_test.go b/core/services/keystore/keys/tronkey/key_test.go new file mode 100644 index 00000000000..d3714228483 --- /dev/null +++ b/core/services/keystore/keys/tronkey/key_test.go @@ -0,0 +1,85 @@ +package tronkey + +import ( + "crypto/ecdsa" + "crypto/rand" + "encoding/hex" + "testing" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestTronKeyRawPrivateKey(t *testing.T) { + t.Run("Create from raw bytes and check string representation", func(t *testing.T) { + // Generate a private key + privateKeyECDSA, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) + require.NoError(t, err, "Failed to generate ECDSA key") + + // Create TronKey from raw bytes + tronKey := Raw(privateKeyECDSA.D.Bytes()) + + // Check string representation + expectedStr := "" + assert.Equal(t, expectedStr, tronKey.String(), "Unexpected string representation") + assert.Equal(t, expectedStr, tronKey.GoString(), "String() and GoString() should return the same value") + }) +} + +func TestTronKeyNewKeyGeneration(t *testing.T) { + t.Run("Generate new key and verify its components", func(t *testing.T) { + // Generate a new key + key, err := New() + require.NoError(t, err, "Failed to generate new TronKey") + + // Verify key components + assert.NotNil(t, key.pubKey, "Public key should not be nil") + assert.NotNil(t, key.privKey, "Private key should not be nil") + }) + + t.Run("Multiple key generations produce unique keys", func(t *testing.T) { + key1, err := New() + require.NoError(t, err, "Failed to generate first key") + + key2, err := New() + require.NoError(t, err, "Failed to generate second key") + + assert.NotEqual(t, key1.privKey, key2.privKey, "Generated private keys should be unique") + assert.NotEqual(t, key1.pubKey, key2.pubKey, "Generated public keys should be unique") + }) +} + +func TestKeyAddress(t *testing.T) { + t.Run("Known private key and expected address", func(t *testing.T) { + // Tests cases from https://developers.tron.network/docs/account + privateKeyHex := "b406adb115b43e103c7b1dc8b5931f63279a5b6b2cf7328638814c43171a2908" + expectedAddress := "TDdcf5iMDkB61oGM27TNak55eVX214thBG" + + privateKeyBytes, err := hex.DecodeString(privateKeyHex) + require.NoError(t, err, "Failed to decode private key hex") + + privateKey, err := crypto.ToECDSA(privateKeyBytes) + require.NoError(t, err, "Failed to convert private key to ECDSA") + + key := Key{ + privKey: privateKey, + pubKey: &privateKey.PublicKey, + } + require.NotNil(t, key.privKey, "Private key is nil") + + address := key.Base58Address() + require.Equal(t, expectedAddress, address, "Generated address does not match expected address") + }) + + t.Run("Generate new key and check address format", func(t *testing.T) { + newKey, err := New() + if err != nil { + t.Fatalf("Failed to generate new key: %v", err) + } + + newAddress := newKey.Base58Address() + isValid := isValidBase58Address(newAddress) + require.True(t, isValid, "Generated address is not valid") + }) +} diff --git a/core/services/keystore/keystoretest.go b/core/services/keystore/keystoretest.go index 626cc4bab99..9814801b2a5 100644 --- a/core/services/keystore/keystoretest.go +++ b/core/services/keystore/keystoretest.go @@ -74,6 +74,7 @@ func NewInMemory(ds sqlutil.DataSource, scryptParams utils.ScryptParams, lggr lo solana: newSolanaKeyStore(km), starknet: newStarkNetKeyStore(km), aptos: newAptosKeyStore(km), + tron: newTronKeyStore(km), vrf: newVRFKeyStore(km), workflow: newWorkflowKeyStore(km), } diff --git a/core/services/keystore/master.go b/core/services/keystore/master.go index 72677a166a3..50ca6d0c34d 100644 --- a/core/services/keystore/master.go +++ b/core/services/keystore/master.go @@ -20,6 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -45,6 +46,7 @@ type Master interface { Cosmos() Cosmos StarkNet() StarkNet Aptos() Aptos + Tron() Tron VRF() VRF Workflow() Workflow Unlock(ctx context.Context, password string) error @@ -62,6 +64,7 @@ type master struct { solana *solana starknet *starknet aptos *aptos + tron *tron vrf *vrf workflow *workflow } @@ -91,6 +94,7 @@ func newMaster(ds sqlutil.DataSource, scryptParams utils.ScryptParams, lggr logg solana: newSolanaKeyStore(km), starknet: newStarkNetKeyStore(km), aptos: newAptosKeyStore(km), + tron: newTronKeyStore(km), vrf: newVRFKeyStore(km), workflow: newWorkflowKeyStore(km), } @@ -132,6 +136,10 @@ func (ks *master) Aptos() Aptos { return ks.aptos } +func (ks *master) Tron() Tron { + return ks.tron +} + func (ks *master) VRF() VRF { return ks.vrf } @@ -273,6 +281,8 @@ func GetFieldNameForKey(unknownKey Key) (string, error) { return "StarkNet", nil case aptoskey.Key: return "Aptos", nil + case tronkey.Key: + return "Tron", nil case vrfkey.KeyV2: return "VRF", nil case workflowkey.Key: diff --git a/core/services/keystore/mocks/master.go b/core/services/keystore/mocks/master.go index 01b85a542d8..6ea57639196 100644 --- a/core/services/keystore/mocks/master.go +++ b/core/services/keystore/mocks/master.go @@ -501,6 +501,53 @@ func (_c *Master_StarkNet_Call) RunAndReturn(run func() keystore.StarkNet) *Mast return _c } +// Tron provides a mock function with no fields +func (_m *Master) Tron() keystore.Tron { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Tron") + } + + var r0 keystore.Tron + if rf, ok := ret.Get(0).(func() keystore.Tron); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(keystore.Tron) + } + } + + return r0 +} + +// Master_Tron_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tron' +type Master_Tron_Call struct { + *mock.Call +} + +// Tron is a helper method to define mock.On call +func (_e *Master_Expecter) Tron() *Master_Tron_Call { + return &Master_Tron_Call{Call: _e.mock.On("Tron")} +} + +func (_c *Master_Tron_Call) Run(run func()) *Master_Tron_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_Tron_Call) Return(_a0 keystore.Tron) *Master_Tron_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_Tron_Call) RunAndReturn(run func() keystore.Tron) *Master_Tron_Call { + _c.Call.Return(run) + return _c +} + // Unlock provides a mock function with given fields: ctx, password func (_m *Master) Unlock(ctx context.Context, password string) error { ret := _m.Called(ctx, password) diff --git a/core/services/keystore/mocks/tron.go b/core/services/keystore/mocks/tron.go new file mode 100644 index 00000000000..0636f4e54e9 --- /dev/null +++ b/core/services/keystore/mocks/tron.go @@ -0,0 +1,534 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + tronkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" +) + +// Tron is an autogenerated mock type for the Tron type +type Tron struct { + mock.Mock +} + +type Tron_Expecter struct { + mock *mock.Mock +} + +func (_m *Tron) EXPECT() *Tron_Expecter { + return &Tron_Expecter{mock: &_m.Mock} +} + +// Add provides a mock function with given fields: ctx, key +func (_m *Tron) Add(ctx context.Context, key tronkey.Key) error { + ret := _m.Called(ctx, key) + + if len(ret) == 0 { + panic("no return value specified for Add") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, tronkey.Key) error); ok { + r0 = rf(ctx, key) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Tron_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Tron_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key tronkey.Key +func (_e *Tron_Expecter) Add(ctx interface{}, key interface{}) *Tron_Add_Call { + return &Tron_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *Tron_Add_Call) Run(run func(ctx context.Context, key tronkey.Key)) *Tron_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(tronkey.Key)) + }) + return _c +} + +func (_c *Tron_Add_Call) Return(_a0 error) *Tron_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Tron_Add_Call) RunAndReturn(run func(context.Context, tronkey.Key) error) *Tron_Add_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: ctx +func (_m *Tron) Create(ctx context.Context) (tronkey.Key, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 tronkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (tronkey.Key, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) tronkey.Key); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(tronkey.Key) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Tron_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *Tron_Expecter) Create(ctx interface{}) *Tron_Create_Call { + return &Tron_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *Tron_Create_Call) Run(run func(ctx context.Context)) *Tron_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Tron_Create_Call) Return(_a0 tronkey.Key, _a1 error) *Tron_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Tron_Create_Call) RunAndReturn(run func(context.Context) (tronkey.Key, error)) *Tron_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, id +func (_m *Tron) Delete(ctx context.Context, id string) (tronkey.Key, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 tronkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (tronkey.Key, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) tronkey.Key); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Get(0).(tronkey.Key) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Tron_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Tron_Expecter) Delete(ctx interface{}, id interface{}) *Tron_Delete_Call { + return &Tron_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *Tron_Delete_Call) Run(run func(ctx context.Context, id string)) *Tron_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Tron_Delete_Call) Return(_a0 tronkey.Key, _a1 error) *Tron_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Tron_Delete_Call) RunAndReturn(run func(context.Context, string) (tronkey.Key, error)) *Tron_Delete_Call { + _c.Call.Return(run) + return _c +} + +// EnsureKey provides a mock function with given fields: ctx +func (_m *Tron) EnsureKey(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for EnsureKey") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Tron_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type Tron_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *Tron_Expecter) EnsureKey(ctx interface{}) *Tron_EnsureKey_Call { + return &Tron_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *Tron_EnsureKey_Call) Run(run func(ctx context.Context)) *Tron_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Tron_EnsureKey_Call) Return(_a0 error) *Tron_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Tron_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *Tron_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + +// Export provides a mock function with given fields: id, password +func (_m *Tron) Export(id string, password string) ([]byte, error) { + ret := _m.Called(id, password) + + if len(ret) == 0 { + panic("no return value specified for Export") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]byte, error)); ok { + return rf(id, password) + } + if rf, ok := ret.Get(0).(func(string, string) []byte); ok { + r0 = rf(id, password) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(string, string) error); ok { + r1 = rf(id, password) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type Tron_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *Tron_Expecter) Export(id interface{}, password interface{}) *Tron_Export_Call { + return &Tron_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *Tron_Export_Call) Run(run func(id string, password string)) *Tron_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Tron_Export_Call) Return(_a0 []byte, _a1 error) *Tron_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Tron_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *Tron_Export_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: id +func (_m *Tron) Get(id string) (tronkey.Key, error) { + ret := _m.Called(id) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 tronkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(string) (tronkey.Key, error)); ok { + return rf(id) + } + if rf, ok := ret.Get(0).(func(string) tronkey.Key); ok { + r0 = rf(id) + } else { + r0 = ret.Get(0).(tronkey.Key) + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Tron_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *Tron_Expecter) Get(id interface{}) *Tron_Get_Call { + return &Tron_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *Tron_Get_Call) Run(run func(id string)) *Tron_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Tron_Get_Call) Return(_a0 tronkey.Key, _a1 error) *Tron_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Tron_Get_Call) RunAndReturn(run func(string) (tronkey.Key, error)) *Tron_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetAll provides a mock function with no fields +func (_m *Tron) GetAll() ([]tronkey.Key, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAll") + } + + var r0 []tronkey.Key + var r1 error + if rf, ok := ret.Get(0).(func() ([]tronkey.Key, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []tronkey.Key); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]tronkey.Key) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type Tron_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *Tron_Expecter) GetAll() *Tron_GetAll_Call { + return &Tron_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *Tron_GetAll_Call) Run(run func()) *Tron_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Tron_GetAll_Call) Return(_a0 []tronkey.Key, _a1 error) *Tron_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Tron_GetAll_Call) RunAndReturn(run func() ([]tronkey.Key, error)) *Tron_GetAll_Call { + _c.Call.Return(run) + return _c +} + +// Import provides a mock function with given fields: ctx, keyJSON, password +func (_m *Tron) Import(ctx context.Context, keyJSON []byte, password string) (tronkey.Key, error) { + ret := _m.Called(ctx, keyJSON, password) + + if len(ret) == 0 { + panic("no return value specified for Import") + } + + var r0 tronkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, string) (tronkey.Key, error)); ok { + return rf(ctx, keyJSON, password) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte, string) tronkey.Key); ok { + r0 = rf(ctx, keyJSON, password) + } else { + r0 = ret.Get(0).(tronkey.Key) + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte, string) error); ok { + r1 = rf(ctx, keyJSON, password) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type Tron_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *Tron_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *Tron_Import_Call { + return &Tron_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *Tron_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *Tron_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *Tron_Import_Call) Return(_a0 tronkey.Key, _a1 error) *Tron_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Tron_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (tronkey.Key, error)) *Tron_Import_Call { + _c.Call.Return(run) + return _c +} + +// Sign provides a mock function with given fields: ctx, id, msg +func (_m *Tron) Sign(ctx context.Context, id string, msg []byte) ([]byte, error) { + ret := _m.Called(ctx, id, msg) + + if len(ret) == 0 { + panic("no return value specified for Sign") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) ([]byte, error)); ok { + return rf(ctx, id, msg) + } + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) []byte); ok { + r0 = rf(ctx, id, msg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, []byte) error); ok { + r1 = rf(ctx, id, msg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tron_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Tron_Sign_Call struct { + *mock.Call +} + +// Sign is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - msg []byte +func (_e *Tron_Expecter) Sign(ctx interface{}, id interface{}, msg interface{}) *Tron_Sign_Call { + return &Tron_Sign_Call{Call: _e.mock.On("Sign", ctx, id, msg)} +} + +func (_c *Tron_Sign_Call) Run(run func(ctx context.Context, id string, msg []byte)) *Tron_Sign_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *Tron_Sign_Call) Return(signature []byte, err error) *Tron_Sign_Call { + _c.Call.Return(signature, err) + return _c +} + +func (_c *Tron_Sign_Call) RunAndReturn(run func(context.Context, string, []byte) ([]byte, error)) *Tron_Sign_Call { + _c.Call.Return(run) + return _c +} + +// NewTron creates a new instance of Tron. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTron(t interface { + mock.TestingT + Cleanup(func()) +}) *Tron { + mock := &Tron{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/keystore/models.go b/core/services/keystore/models.go index 151934827c3..1ebc7480997 100644 --- a/core/services/keystore/models.go +++ b/core/services/keystore/models.go @@ -20,6 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -158,6 +159,7 @@ type keyRing struct { Solana map[string]solkey.Key StarkNet map[string]starkkey.Key Aptos map[string]aptoskey.Key + Tron map[string]tronkey.Key VRF map[string]vrfkey.KeyV2 Workflow map[string]workflowkey.Key LegacyKeys LegacyKeyStorage @@ -174,6 +176,7 @@ func newKeyRing() *keyRing { Solana: make(map[string]solkey.Key), StarkNet: make(map[string]starkkey.Key), Aptos: make(map[string]aptoskey.Key), + Tron: make(map[string]tronkey.Key), VRF: make(map[string]vrfkey.KeyV2), Workflow: make(map[string]workflowkey.Key), } @@ -236,6 +239,9 @@ func (kr *keyRing) raw() (rawKeys rawKeyRing) { for _, aptoskey := range kr.Aptos { rawKeys.Aptos = append(rawKeys.Aptos, aptoskey.Raw()) } + for _, tronkey := range kr.Tron { + rawKeys.Tron = append(rawKeys.Tron, tronkey.Raw()) + } for _, vrfKey := range kr.VRF { rawKeys.VRF = append(rawKeys.VRF, vrfKey.Raw()) } @@ -283,6 +289,10 @@ func (kr *keyRing) logPubKeys(lggr logger.Logger) { for _, aptosKey := range kr.Aptos { aptosIDs = append(aptosIDs, aptosKey.ID()) } + tronIDs := []string{} + for _, tronKey := range kr.Tron { + tronIDs = append(tronIDs, tronKey.ID()) + } var vrfIDs []string for _, VRFKey := range kr.VRF { vrfIDs = append(vrfIDs, VRFKey.ID()) @@ -320,6 +330,9 @@ func (kr *keyRing) logPubKeys(lggr logger.Logger) { if len(aptosIDs) > 0 { lggr.Infow(fmt.Sprintf("Unlocked %d Aptos keys", len(aptosIDs)), "keys", aptosIDs) } + if len(tronIDs) > 0 { + lggr.Infow(fmt.Sprintf("Unlocked %d Tron keys", len(tronIDs)), "keys", tronIDs) + } if len(vrfIDs) > 0 { lggr.Infow(fmt.Sprintf("Unlocked %d VRF keys", len(vrfIDs)), "keys", vrfIDs) } @@ -344,6 +357,7 @@ type rawKeyRing struct { Solana []solkey.Raw StarkNet []starkkey.Raw Aptos []aptoskey.Raw + Tron []tronkey.Raw VRF []vrfkey.Raw Workflow []workflowkey.Raw LegacyKeys LegacyKeyStorage `json:"-"` @@ -388,6 +402,10 @@ func (rawKeys rawKeyRing) keys() (*keyRing, error) { aptosKey := rawAptosKey.Key() keyRing.Aptos[aptosKey.ID()] = aptosKey } + for _, rawTronKey := range rawKeys.Tron { + tronKey := rawTronKey.Key() + keyRing.Tron[tronKey.ID()] = tronKey + } for _, rawVRFKey := range rawKeys.VRF { vrfKey := rawVRFKey.Key() keyRing.VRF[vrfKey.ID()] = vrfKey diff --git a/core/services/keystore/models_test.go b/core/services/keystore/models_test.go index a828fbbf4f6..a66e29865d1 100644 --- a/core/services/keystore/models_test.go +++ b/core/services/keystore/models_test.go @@ -16,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -40,6 +41,7 @@ func TestKeyRing_Encrypt_Decrypt(t *testing.T) { sol1, sol2 := solkey.MustNewInsecure(rand.Reader), solkey.MustNewInsecure(rand.Reader) vrf1, vrf2 := vrfkey.MustNewV2XXXTestingOnly(big.NewInt(1)), vrfkey.MustNewV2XXXTestingOnly(big.NewInt(2)) tk1, tk2 := cosmoskey.MustNewInsecure(rand.Reader), cosmoskey.MustNewInsecure(rand.Reader) + uk1, uk2 := tronkey.MustNewInsecure(rand.Reader), tronkey.MustNewInsecure(rand.Reader) originalKeyRingRaw := rawKeyRing{ CSA: []csakey.Raw{csa1.Raw(), csa2.Raw()}, Eth: []ethkey.Raw{eth1.Raw(), eth2.Raw()}, @@ -49,6 +51,7 @@ func TestKeyRing_Encrypt_Decrypt(t *testing.T) { Solana: []solkey.Raw{sol1.Raw(), sol2.Raw()}, VRF: []vrfkey.Raw{vrf1.Raw(), vrf2.Raw()}, Cosmos: []cosmoskey.Raw{tk1.Raw(), tk2.Raw()}, + Tron: []tronkey.Raw{uk1.Raw(), uk2.Raw()}, } originalKeyRing, kerr := originalKeyRingRaw.keys() require.NoError(t, kerr) @@ -62,6 +65,10 @@ func TestKeyRing_Encrypt_Decrypt(t *testing.T) { require.Equal(t, 2, len(decryptedKeyRing.Cosmos)) require.Equal(t, originalKeyRing.Cosmos[tk1.ID()].PublicKey(), decryptedKeyRing.Cosmos[tk1.ID()].PublicKey()) require.Equal(t, originalKeyRing.Cosmos[tk2.ID()].PublicKey(), decryptedKeyRing.Cosmos[tk2.ID()].PublicKey()) + // compare tron keys + require.Len(t, decryptedKeyRing.Tron, 2) + require.Equal(t, originalKeyRing.Tron[uk1.ID()].Base58Address(), decryptedKeyRing.Tron[uk1.ID()].Base58Address()) + require.Equal(t, originalKeyRing.Tron[uk2.ID()].Base58Address(), decryptedKeyRing.Tron[uk2.ID()].Base58Address()) // compare csa keys require.Equal(t, 2, len(decryptedKeyRing.CSA)) require.Equal(t, originalKeyRing.CSA[csa1.ID()].PublicKey, decryptedKeyRing.CSA[csa1.ID()].PublicKey) diff --git a/core/services/keystore/tron.go b/core/services/keystore/tron.go new file mode 100644 index 00000000000..d5302d572b0 --- /dev/null +++ b/core/services/keystore/tron.go @@ -0,0 +1,187 @@ +package keystore + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" +) + +type Tron interface { + Get(id string) (tronkey.Key, error) + GetAll() ([]tronkey.Key, error) + Create(ctx context.Context) (tronkey.Key, error) + Add(ctx context.Context, key tronkey.Key) error + Delete(ctx context.Context, id string) (tronkey.Key, error) + Import(ctx context.Context, keyJSON []byte, password string) (tronkey.Key, error) + Export(id string, password string) ([]byte, error) + EnsureKey(ctx context.Context) error + Sign(ctx context.Context, id string, msg []byte) (signature []byte, err error) +} + +type tron struct { + *keyManager +} + +var _ Tron = &tron{} + +func newTronKeyStore(km *keyManager) *tron { + return &tron{ + km, + } +} + +func (ks *tron) Get(id string) (tronkey.Key, error) { + ks.lock.RLock() + defer ks.lock.RUnlock() + if ks.isLocked() { + return tronkey.Key{}, ErrLocked + } + return ks.getByID(id) +} + +func (ks *tron) GetAll() (keys []tronkey.Key, _ error) { + ks.lock.RLock() + defer ks.lock.RUnlock() + if ks.isLocked() { + return nil, ErrLocked + } + for _, key := range ks.keyRing.Tron { + keys = append(keys, key) + } + return keys, nil +} + +func (ks *tron) Create(ctx context.Context) (tronkey.Key, error) { + ks.lock.Lock() + defer ks.lock.Unlock() + if ks.isLocked() { + return tronkey.Key{}, ErrLocked + } + key, err := tronkey.New() + if err != nil { + return tronkey.Key{}, err + } + return key, ks.safeAddKey(ctx, key) +} + +func (ks *tron) Add(ctx context.Context, key tronkey.Key) error { + ks.lock.Lock() + defer ks.lock.Unlock() + if ks.isLocked() { + return ErrLocked + } + if _, found := ks.keyRing.Tron[key.ID()]; found { + return fmt.Errorf("key with ID %s already exists", key.ID()) + } + return ks.safeAddKey(ctx, key) +} + +func (ks *tron) Delete(ctx context.Context, id string) (tronkey.Key, error) { + ks.lock.Lock() + defer ks.lock.Unlock() + if ks.isLocked() { + return tronkey.Key{}, ErrLocked + } + key, err := ks.getByID(id) + if err != nil { + return tronkey.Key{}, err + } + err = ks.safeRemoveKey(ctx, key) + return key, err +} + +func (ks *tron) Import(ctx context.Context, keyJSON []byte, password string) (tronkey.Key, error) { + ks.lock.Lock() + defer ks.lock.Unlock() + if ks.isLocked() { + return tronkey.Key{}, ErrLocked + } + key, err := tronkey.FromEncryptedJSON(keyJSON, password) + if err != nil { + return tronkey.Key{}, errors.Wrap(err, "TronKeyStore#ImportKey failed to decrypt key") + } + if _, found := ks.keyRing.Tron[key.ID()]; found { + return tronkey.Key{}, fmt.Errorf("key with ID %s already exists", key.ID()) + } + return key, ks.keyManager.safeAddKey(ctx, key) +} + +func (ks *tron) Export(id string, password string) ([]byte, error) { + ks.lock.RLock() + defer ks.lock.RUnlock() + if ks.isLocked() { + return nil, ErrLocked + } + key, err := ks.getByID(id) + if err != nil { + return nil, err + } + return key.ToEncryptedJSON(password, ks.scryptParams) +} + +func (ks *tron) EnsureKey(ctx context.Context) error { + ks.lock.Lock() + defer ks.lock.Unlock() + if ks.isLocked() { + return ErrLocked + } + + if len(ks.keyRing.Tron) > 0 { + return nil + } + + key, err := tronkey.New() + if err != nil { + return err + } + + ks.logger.Infof("Created Tron key with ID %s", key.ID()) + + return ks.safeAddKey(ctx, key) +} + +func (ks *tron) getByID(id string) (tronkey.Key, error) { + key, found := ks.keyRing.Tron[id] + if !found { + return tronkey.Key{}, KeyNotFoundError{ID: id, KeyType: "Tron"} + } + return key, nil +} + +func (ks *tron) Sign(_ context.Context, id string, msg []byte) (signature []byte, err error) { + k, err := ks.Get(id) + if err != nil { + return nil, err + } + // loopp spec requires passing nil hash to check existence of id + if msg == nil { + return nil, nil + } + return k.Sign(msg) +} + +// TronLOOPKeystore implements the [github.com/smartcontractkit/chainlink-common/pkg/loop.Keystore] interface and +// handles signing for Tron messages. +type TronLOOPKeystore struct { + Tron +} + +var _ loop.Keystore = &TronLOOPKeystore{} + +func (lk *TronLOOPKeystore) Accounts(ctx context.Context) ([]string, error) { + keys, err := lk.GetAll() + if err != nil { + return nil, err + } + + accounts := []string{} + for _, k := range keys { + accounts = append(accounts, k.PublicKeyStr()) + } + + return accounts, nil +} diff --git a/core/services/keystore/tron_test.go b/core/services/keystore/tron_test.go new file mode 100644 index 00000000000..2450e573898 --- /dev/null +++ b/core/services/keystore/tron_test.go @@ -0,0 +1,240 @@ +package keystore_test + +import ( + "context" + "crypto/sha256" + "encoding/json" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" +) + +func Test_TronKeyStore_E2E(t *testing.T) { + db := pgtest.NewSqlxDB(t) + + keyStore := keystore.ExposedNewMaster(t, db) + require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) + ks := keyStore.Tron() + reset := func() { + ctx := context.Background() // Executed on cleanup + require.NoError(t, utils.JustError(db.Exec("DELETE FROM encrypted_key_rings"))) + keyStore.ResetXXXTestOnly() + require.NoError(t, keyStore.Unlock(ctx, cltest.Password)) + } + + t.Run("initializes with an empty state", func(t *testing.T) { + defer reset() + keys, err := ks.GetAll() + require.NoError(t, err) + require.Empty(t, keys) + }) + + t.Run("errors when getting non-existent ID", func(t *testing.T) { + defer reset() + _, err := ks.Get("non-existent-id") + require.Error(t, err) + }) + + t.Run("creates a key", func(t *testing.T) { + defer reset() + ctx := testutils.Context(t) + key, err := ks.Create(ctx) + require.NoError(t, err) + retrievedKey, err := ks.Get(key.ID()) + require.NoError(t, err) + require.Equal(t, key, retrievedKey) + }) + + t.Run("imports and exports a key", func(t *testing.T) { + defer reset() + ctx := testutils.Context(t) + key, err := ks.Create(ctx) + require.NoError(t, err) + exportJSON, err := ks.Export(key.ID(), cltest.Password) + require.NoError(t, err) + _, err = ks.Export("non-existent", cltest.Password) + require.Error(t, err) + _, err = ks.Delete(ctx, key.ID()) + require.NoError(t, err) + _, err = ks.Get(key.ID()) + require.Error(t, err) + importedKey, err := ks.Import(ctx, exportJSON, cltest.Password) + require.NoError(t, err) + _, err = ks.Import(ctx, exportJSON, cltest.Password) + require.Error(t, err) + _, err = ks.Import(ctx, []byte(""), cltest.Password) + require.Error(t, err) + require.Equal(t, key.ID(), importedKey.ID()) + retrievedKey, err := ks.Get(key.ID()) + require.NoError(t, err) + require.Equal(t, importedKey, retrievedKey) + }) + + t.Run("adds an externally created key / deletes a key", func(t *testing.T) { + defer reset() + ctx := testutils.Context(t) + newKey, err := tronkey.New() + require.NoError(t, err) + err = ks.Add(ctx, newKey) + require.NoError(t, err) + err = ks.Add(ctx, newKey) + require.Error(t, err) + keys, err := ks.GetAll() + require.NoError(t, err) + require.Len(t, keys, 1) + _, err = ks.Delete(ctx, newKey.ID()) + require.NoError(t, err) + _, err = ks.Delete(ctx, newKey.ID()) + require.Error(t, err) + keys, err = ks.GetAll() + require.NoError(t, err) + require.Empty(t, keys) + _, err = ks.Get(newKey.ID()) + require.Error(t, err) + }) + + t.Run("ensures key", func(t *testing.T) { + defer reset() + ctx := testutils.Context(t) + err := ks.EnsureKey(ctx) + require.NoError(t, err) + + err = ks.EnsureKey(ctx) + require.NoError(t, err) + + keys, err := ks.GetAll() + require.NoError(t, err) + require.Len(t, keys, 1) + }) + + t.Run("sign tx", func(t *testing.T) { + defer reset() + ctx := testutils.Context(t) + newKey, err := tronkey.New() + require.NoError(t, err) + require.NoError(t, ks.Add(ctx, newKey)) + + // sign unknown ID + _, err = ks.Sign(testutils.Context(t), "not-real", nil) + require.Error(t, err) + + // sign known key + + // Create a mock transaction + mockTx := createMockTronTransaction(newKey.PublicKeyStr(), "TJRabPrwbZy45sbavfcjinPJC18kjpRTv8", 1000000) + serializedTx, err := serializeMockTransaction(mockTx) + require.NoError(t, err) + + hash := sha256.Sum256(serializedTx) + txHash := hash[:] + sig, err := ks.Sign(testutils.Context(t), newKey.ID(), txHash) + require.NoError(t, err) + + directSig, err := newKey.Sign(txHash) + require.NoError(t, err) + + // signatures should match using keystore sign or key sign + require.Equal(t, directSig, sig) + }) +} + +// MockTronTransaction represents a mock TRON transaction +// This is based on https://developers.tron.network/docs/tron-protocol-transaction +type MockTronTransaction struct { + RawData struct { + Contract []struct { + Parameter struct { + Value struct { + Amount int64 `json:"amount"` + OwnerAddress string `json:"owner_address"` + ToAddress string `json:"to_address"` + } `json:"value"` + TypeURL string `json:"type_url"` + } `json:"parameter"` + Type string `json:"type"` + } `json:"contract"` + RefBlockBytes string `json:"ref_block_bytes"` + RefBlockHash string `json:"ref_block_hash"` + Expiration int64 `json:"expiration"` + Timestamp int64 `json:"timestamp"` + FeeLimit int64 `json:"fee_limit"` + } `json:"raw_data"` + Signature []string `json:"signature"` + TxID string `json:"txID"` +} + +// CreateMockTronTransaction generates a mock TRON transaction for testing +func createMockTronTransaction(ownerAddress, toAddress string, amount int64) MockTronTransaction { + return MockTronTransaction{ + RawData: struct { + Contract []struct { + Parameter struct { + Value struct { + Amount int64 `json:"amount"` + OwnerAddress string `json:"owner_address"` + ToAddress string `json:"to_address"` + } `json:"value"` + TypeURL string `json:"type_url"` + } `json:"parameter"` + Type string `json:"type"` + } `json:"contract"` + RefBlockBytes string `json:"ref_block_bytes"` + RefBlockHash string `json:"ref_block_hash"` + Expiration int64 `json:"expiration"` + Timestamp int64 `json:"timestamp"` + FeeLimit int64 `json:"fee_limit"` + }{ + Contract: []struct { + Parameter struct { + Value struct { + Amount int64 `json:"amount"` + OwnerAddress string `json:"owner_address"` + ToAddress string `json:"to_address"` + } `json:"value"` + TypeURL string `json:"type_url"` + } `json:"parameter"` + Type string `json:"type"` + }{ + { + Parameter: struct { + Value struct { + Amount int64 `json:"amount"` + OwnerAddress string `json:"owner_address"` + ToAddress string `json:"to_address"` + } `json:"value"` + TypeURL string `json:"type_url"` + }{ + Value: struct { + Amount int64 `json:"amount"` + OwnerAddress string `json:"owner_address"` + ToAddress string `json:"to_address"` + }{ + Amount: amount, + OwnerAddress: ownerAddress, + ToAddress: toAddress, + }, + TypeURL: "type.googleapis.com/protocol.TransferContract", + }, + Type: "TransferContract", + }, + }, + RefBlockBytes: "1234", + RefBlockHash: "abcdef0123456789", + Expiration: time.Now().Unix() + 60*60, + Timestamp: time.Now().Unix(), + FeeLimit: 10000000, + }, + } +} + +func serializeMockTransaction(tx MockTronTransaction) ([]byte, error) { + return json.Marshal(tx) +} diff --git a/core/services/relay/relay.go b/core/services/relay/relay.go index 0b1293c8d79..8a6a12e30e3 100644 --- a/core/services/relay/relay.go +++ b/core/services/relay/relay.go @@ -14,6 +14,7 @@ const ( NetworkSolana = "solana" NetworkStarkNet = "starknet" NetworkAptos = "aptos" + NetworkTron = "tron" NetworkDummy = "dummy" ) @@ -24,6 +25,7 @@ var SupportedNetworks = map[string]struct{}{ NetworkSolana: {}, NetworkStarkNet: {}, NetworkAptos: {}, + NetworkTron: {}, NetworkDummy: {}, } diff --git a/core/web/auth/auth_test.go b/core/web/auth/auth_test.go index 25479409545..df869a8b1a3 100644 --- a/core/web/auth/auth_test.go +++ b/core/web/auth/auth_test.go @@ -276,14 +276,17 @@ var routesRolesMap = [...]routeRules{ {"GET", "/v2/keys/cosmos", true, true, true}, {"GET", "/v2/keys/starknet", true, true, true}, {"GET", "/v2/keys/aptos", true, true, true}, + {"GET", "/v2/keys/tron", true, true, true}, {"POST", "/v2/keys/solana", false, false, true}, {"POST", "/v2/keys/cosmos", false, false, true}, {"POST", "/v2/keys/starknet", false, false, true}, {"POST", "/v2/keys/aptos", false, false, true}, + {"POST", "/v2/keys/tron", false, false, true}, {"DELETE", "/v2/keys/solana/MOCK", false, false, false}, {"DELETE", "/v2/keys/cosmos/MOCK", false, false, false}, {"DELETE", "/v2/keys/starknet/MOCK", false, false, false}, {"DELETE", "/v2/keys/aptos/MOCK", false, false, false}, + {"DELETE", "/v2/keys/tron/MOCK", false, false, false}, {"POST", "/v2/keys/solana/import", false, false, false}, {"POST", "/v2/keys/cosmos/import", false, false, false}, {"POST", "/v2/keys/starknet/import", false, false, false}, @@ -292,6 +295,7 @@ var routesRolesMap = [...]routeRules{ {"POST", "/v2/keys/cosmos/export/MOCK", false, false, false}, {"POST", "/v2/keys/starknet/export/MOCK", false, false, false}, {"POST", "/v2/keys/aptos/export/MOCK", false, false, false}, + {"POST", "/v2/keys/tron/export/MOCK", false, false, false}, {"GET", "/v2/keys/vrf", true, true, true}, {"POST", "/v2/keys/vrf", false, false, true}, {"DELETE", "/v2/keys/vrf/MOCK", false, false, false}, diff --git a/core/web/presenters/node_test.go b/core/web/presenters/node_test.go index d2db83009d9..9f980e22484 100644 --- a/core/web/presenters/node_test.go +++ b/core/web/presenters/node_test.go @@ -15,7 +15,7 @@ func TestNodeResource(t *testing.T) { var nodeResource NodeResource state := "test" cfg := "cfg" - testCases := []string{"solana", "cosmos", "starknet"} + testCases := []string{"solana", "cosmos", "starknet", "tron"} for _, tc := range testCases { chainID := fmt.Sprintf("%s chain ID", tc) nodeName := fmt.Sprintf("%s_node", tc) diff --git a/core/web/presenters/tron_chain.go b/core/web/presenters/tron_chain.go new file mode 100644 index 00000000000..7ab6109bd39 --- /dev/null +++ b/core/web/presenters/tron_chain.go @@ -0,0 +1,45 @@ +package presenters + +import ( + "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +// TronChainResource is an Tron chain JSONAPI resource. +type TronChainResource struct { + ChainResource +} + +// GetName implements the api2go EntityNamer interface +func (r TronChainResource) GetName() string { + return "tron_chain" +} + +// NewTronChainResource returns a new TronChainResource for chain. +func NewTronChainResource(chain types.ChainStatus) TronChainResource { + return TronChainResource{ChainResource{ + JAID: NewJAID(chain.ID), + Config: chain.Config, + Enabled: chain.Enabled, + }} +} + +// TronNodeResource is a Tron node JSONAPI resource. +type TronNodeResource struct { + NodeResource +} + +// GetName implements the api2go EntityNamer interface +func (r TronNodeResource) GetName() string { + return "tron_node" +} + +// NewTronNodeResource returns a new TronNodeResource for node. +func NewTronNodeResource(node types.NodeStatus) TronNodeResource { + return TronNodeResource{NodeResource{ + JAID: NewPrefixedJAID(node.Name, node.ChainID), + ChainID: node.ChainID, + Name: node.Name, + State: node.State, + Config: node.Config, + }} +} diff --git a/core/web/presenters/tron_key.go b/core/web/presenters/tron_key.go new file mode 100644 index 00000000000..abe74ed7f41 --- /dev/null +++ b/core/web/presenters/tron_key.go @@ -0,0 +1,34 @@ +package presenters + +import ( + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" +) + +// TronKeyResource represents a Tron key JSONAPI resource. +type TronKeyResource struct { + JAID + PubKey string `json:"publicKey"` +} + +// GetName implements the api2go EntityNamer interface +func (TronKeyResource) GetName() string { + return "encryptedTronKeys" +} + +func NewTronKeyResource(key tronkey.Key) *TronKeyResource { + r := &TronKeyResource{ + JAID: JAID{ID: key.ID()}, + PubKey: key.PublicKeyStr(), + } + + return r +} + +func NewTronKeyResources(keys []tronkey.Key) []TronKeyResource { + rs := []TronKeyResource{} + for _, key := range keys { + rs = append(rs, *NewTronKeyResource(key)) + } + + return rs +} diff --git a/core/web/resolver/feeds_manager_chain_config_test.go b/core/web/resolver/feeds_manager_chain_config_test.go index 957583dbb7d..b4118cfa873 100644 --- a/core/web/resolver/feeds_manager_chain_config_test.go +++ b/core/web/resolver/feeds_manager_chain_config_test.go @@ -375,6 +375,81 @@ func Test_CreateFeedsManagerChainConfig(t *testing.T) { } }`, }, + { + name: "success Tron", + authenticated: true, + before: func(ctx context.Context, f *gqlTestFramework) { + f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) + f.Mocks.feedsSvc.On("CreateChainConfig", mock.Anything, feeds.ChainConfig{ + FeedsManagerID: mgrID, + ChainType: feeds.ChainTypeTron, + ChainID: chainID, + AccountAddress: accountAddr, + AccountAddressPublicKey: null.StringFrom(acctAddrPubKey), + AdminAddress: adminAddr, + FluxMonitorConfig: feeds.FluxMonitorConfig{ + Enabled: false, + }, + OCR1Config: feeds.OCR1Config{ + Enabled: true, + P2PPeerID: peerID, + KeyBundleID: keyBundleID, + }, + OCR2Config: feeds.OCR2ConfigModel{ + Enabled: true, + P2PPeerID: peerID, + KeyBundleID: keyBundleID, + ForwarderAddress: null.StringFrom(forwarderAddr), + Plugins: feeds.Plugins{ + Commit: true, + Execute: true, + Median: false, + Mercury: true, + Rebalancer: true, + }, + }, + }).Return(cfgID, nil) + f.Mocks.feedsSvc.On("GetChainConfig", mock.Anything, cfgID).Return(&feeds.ChainConfig{ + ID: cfgID, + ChainType: feeds.ChainTypeTron, + ChainID: chainID, + AccountAddress: accountAddr, + AccountAddressPublicKey: null.StringFrom(acctAddrPubKey), + AdminAddress: adminAddr, + FluxMonitorConfig: feeds.FluxMonitorConfig{ + Enabled: false, + }, + OCR1Config: feeds.OCR1Config{ + Enabled: true, + P2PPeerID: peerID, + KeyBundleID: keyBundleID, + }, + OCR2Config: feeds.OCR2ConfigModel{ + Enabled: true, + P2PPeerID: peerID, + KeyBundleID: keyBundleID, + ForwarderAddress: null.StringFrom(forwarderAddr), + Plugins: feeds.Plugins{ + Commit: true, + Execute: true, + Median: false, + Mercury: true, + Rebalancer: true, + }, + }, + }, nil) + }, + query: mutation, + variables: withVariables("TRON"), + result: ` + { + "createFeedsManagerChainConfig": { + "chainConfig": { + "id": "1" + } + } + }`, + }, { name: "create call not found", authenticated: true, diff --git a/core/web/resolver/ocr2_keys.go b/core/web/resolver/ocr2_keys.go index d04ebbd0e2f..345dd07d984 100644 --- a/core/web/resolver/ocr2_keys.go +++ b/core/web/resolver/ocr2_keys.go @@ -27,6 +27,8 @@ const ( OCR2ChainTypeStarkNet = "STARKNET" // OCRChainTypeAptos defines OCR Aptos Chain Type OCRChainTypeAptos = "APTOS" + // OCRChainTypeTron defines OCR2 Tron Chain Type + OCRChainTypeTron = "TRON" ) // ToOCR2ChainType turns a valid string into a OCR2ChainType @@ -42,6 +44,8 @@ func ToOCR2ChainType(s string) (OCR2ChainType, error) { return OCR2ChainTypeStarkNet, nil case string(chaintype.Aptos): return OCRChainTypeAptos, nil + case string(chaintype.Tron): + return OCRChainTypeTron, nil default: return "", errors.New("unknown ocr2 chain type") } @@ -60,6 +64,8 @@ func FromOCR2ChainType(ct OCR2ChainType) string { return string(chaintype.StarkNet) case OCRChainTypeAptos: return string(chaintype.Aptos) + case OCRChainTypeTron: + return string(chaintype.Tron) default: return strings.ToLower(string(ct)) } diff --git a/core/web/resolver/ocr2_keys_test.go b/core/web/resolver/ocr2_keys_test.go index 033d22799b1..e131aa0b5f5 100644 --- a/core/web/resolver/ocr2_keys_test.go +++ b/core/web/resolver/ocr2_keys_test.go @@ -42,6 +42,7 @@ func TestResolver_GetOCR2KeyBundles(t *testing.T) { ocr2key.MustNewInsecure(keystest.NewRandReaderFromSeed(1), "solana"), ocr2key.MustNewInsecure(keystest.NewRandReaderFromSeed(1), "starknet"), ocr2key.MustNewInsecure(keystest.NewRandReaderFromSeed(1), "aptos"), + ocr2key.MustNewInsecure(keystest.NewRandReaderFromSeed(1), "tron"), } expectedBundles := []map[string]interface{}{} for _, k := range fakeKeys { diff --git a/core/web/resolver/query.go b/core/web/resolver/query.go index ae33e5688bb..6348b805b3a 100644 --- a/core/web/resolver/query.go +++ b/core/web/resolver/query.go @@ -625,6 +625,19 @@ func (r *Resolver) StarkNetKeys(ctx context.Context) (*StarkNetKeysPayloadResolv return NewStarkNetKeysPayload(keys), nil } +func (r *Resolver) TronKeys(ctx context.Context) (*TronKeysPayloadResolver, error) { + if err := authenticateUser(ctx); err != nil { + return nil, err + } + + keys, err := r.App.GetKeyStore().Tron().GetAll() + if err != nil { + return nil, err + } + + return NewTronKeysPayload(keys), nil +} + func (r *Resolver) SQLLogging(ctx context.Context) (*GetSQLLoggingPayloadResolver, error) { if err := authenticateUser(ctx); err != nil { return nil, err diff --git a/core/web/resolver/resolver_test.go b/core/web/resolver/resolver_test.go index 0d365b0891e..6ff9d954b37 100644 --- a/core/web/resolver/resolver_test.go +++ b/core/web/resolver/resolver_test.go @@ -54,6 +54,7 @@ type mocks struct { aptos *keystoreMocks.Aptos cosmos *keystoreMocks.Cosmos starknet *keystoreMocks.StarkNet + tron *keystoreMocks.Tron chain *legacyEvmORMMocks.Chain legacyEVMChains *legacyEvmORMMocks.LegacyChainContainer relayerChainInterops *chainlinkMocks.FakeRelayerChainInteroperators @@ -112,6 +113,7 @@ func setupFramework(t *testing.T) *gqlTestFramework { aptos: keystoreMocks.NewAptos(t), cosmos: keystoreMocks.NewCosmos(t), starknet: keystoreMocks.NewStarkNet(t), + tron: keystoreMocks.NewTron(t), chain: legacyEvmORMMocks.NewChain(t), legacyEVMChains: legacyEvmORMMocks.NewLegacyChainContainer(t), relayerChainInterops: &chainlinkMocks.FakeRelayerChainInteroperators{}, diff --git a/core/web/resolver/tron_key.go b/core/web/resolver/tron_key.go new file mode 100644 index 00000000000..d42ed2071c4 --- /dev/null +++ b/core/web/resolver/tron_key.go @@ -0,0 +1,43 @@ +package resolver + +import ( + "github.com/graph-gophers/graphql-go" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" +) + +type TronKeyResolver struct { + key tronkey.Key +} + +func NewTronKey(key tronkey.Key) *TronKeyResolver { + return &TronKeyResolver{key: key} +} + +func NewTronKeys(keys []tronkey.Key) []*TronKeyResolver { + resolvers := make([]*TronKeyResolver, 0, len(keys)) + + for _, k := range keys { + resolvers = append(resolvers, NewTronKey(k)) + } + + return resolvers +} + +func (r *TronKeyResolver) ID() graphql.ID { + return graphql.ID(r.key.ID()) +} + +// -- GetTronKeys Query -- + +type TronKeysPayloadResolver struct { + keys []tronkey.Key +} + +func NewTronKeysPayload(keys []tronkey.Key) *TronKeysPayloadResolver { + return &TronKeysPayloadResolver{keys: keys} +} + +func (r *TronKeysPayloadResolver) Results() []*TronKeyResolver { + return NewTronKeys(r.keys) +} diff --git a/core/web/resolver/tron_key_test.go b/core/web/resolver/tron_key_test.go new file mode 100644 index 00000000000..6ccbeb1072d --- /dev/null +++ b/core/web/resolver/tron_key_test.go @@ -0,0 +1,74 @@ +package resolver + +import ( + "context" + "errors" + "fmt" + "testing" + + gqlerrors "github.com/graph-gophers/graphql-go/errors" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" +) + +func TestResolver_TronKeys(t *testing.T) { + t.Parallel() + + query := ` + query GetTronKeys { + tronKeys { + results { + id + } + } + }` + k := tronkey.MustNewInsecure(keystest.NewRandReaderFromSeed(1)) + result := fmt.Sprintf(` + { + "tronKeys": { + "results": [ + { + "id": "%s" + } + ] + } + }`, k.ID()) + gError := errors.New("error") + + testCases := []GQLTestCase{ + unauthorizedTestCase(GQLTestCase{query: query}, "tronKeys"), + { + name: "success", + authenticated: true, + before: func(ctx context.Context, f *gqlTestFramework) { + f.Mocks.tron.On("GetAll").Return([]tronkey.Key{k}, nil) + f.Mocks.keystore.On("Tron").Return(f.Mocks.tron) + f.App.On("GetKeyStore").Return(f.Mocks.keystore) + }, + query: query, + result: result, + }, + { + name: "no keys returned by GetAll", + authenticated: true, + before: func(ctx context.Context, f *gqlTestFramework) { + f.Mocks.tron.On("GetAll").Return([]tronkey.Key{}, gError) + f.Mocks.keystore.On("Tron").Return(f.Mocks.tron) + f.App.On("GetKeyStore").Return(f.Mocks.keystore) + }, + query: query, + result: `null`, + errors: []*gqlerrors.QueryError{ + { + Extensions: nil, + ResolverError: gError, + Path: []interface{}{"tronKeys"}, + Message: gError.Error(), + }, + }, + }, + } + + RunGQLTests(t, testCases) +} diff --git a/core/web/router.go b/core/web/router.go index c57bf3c8095..f56d3e69651 100644 --- a/core/web/router.go +++ b/core/web/router.go @@ -351,6 +351,7 @@ func v2Routes(app chainlink.Application, r *gin.RouterGroup) { {"cosmos", NewCosmosKeysController(app)}, {"starknet", NewStarkNetKeysController(app)}, {"aptos", NewAptosKeysController(app)}, + {"tron", NewTronKeysController(app)}, } { authv2.GET("/keys/"+keys.path, keys.kc.Index) authv2.POST("/keys/"+keys.path, auth.RequiresEditRole(keys.kc.Create)) diff --git a/core/web/schema/schema.graphql b/core/web/schema/schema.graphql index 568716f7b76..6f9e51b79eb 100644 --- a/core/web/schema/schema.graphql +++ b/core/web/schema/schema.graphql @@ -36,6 +36,7 @@ type Query { aptosKeys: AptosKeysPayload! cosmosKeys: CosmosKeysPayload! starknetKeys: StarkNetKeysPayload! + tronKeys: TronKeysPayload! sqlLogging: GetSQLLoggingPayload! vrfKey(id: ID!): VRFKeyPayload! vrfKeys: VRFKeysPayload! diff --git a/core/web/schema/type/ocr2_keys.graphql b/core/web/schema/type/ocr2_keys.graphql index c25148c686a..89125d86b54 100644 --- a/core/web/schema/type/ocr2_keys.graphql +++ b/core/web/schema/type/ocr2_keys.graphql @@ -4,6 +4,7 @@ enum OCR2ChainType { SOLANA STARKNET APTOS + TRON } type OCR2KeyBundle { diff --git a/core/web/schema/type/tron_key.graphql b/core/web/schema/type/tron_key.graphql new file mode 100644 index 00000000000..e7319f08d6b --- /dev/null +++ b/core/web/schema/type/tron_key.graphql @@ -0,0 +1,7 @@ +type TronKey { + id: ID! +} + +type TronKeysPayload { + results: [TronKey!]! +} diff --git a/core/web/tron_keys_controller.go b/core/web/tron_keys_controller.go new file mode 100644 index 00000000000..e9ac2e0252e --- /dev/null +++ b/core/web/tron_keys_controller.go @@ -0,0 +1,12 @@ +package web + +import ( + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" + "github.com/smartcontractkit/chainlink/v2/core/web/presenters" +) + +func NewTronKeysController(app chainlink.Application) KeysController { + return NewKeysController[tronkey.Key, presenters.TronKeyResource](app.GetKeyStore().Tron(), app.GetLogger(), app.GetAuditLogger(), + "tronKey", presenters.NewTronKeyResource, presenters.NewTronKeyResources) +} diff --git a/core/web/tron_keys_controller_test.go b/core/web/tron_keys_controller_test.go new file mode 100644 index 00000000000..5628d7ac2dc --- /dev/null +++ b/core/web/tron_keys_controller_test.go @@ -0,0 +1,105 @@ +package web_test + +import ( + "net/http" + "testing" + + "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/web" + "github.com/smartcontractkit/chainlink/v2/core/web/presenters" + + "github.com/stretchr/testify/require" +) + +func TestTronKeysController_Index_HappyPath(t *testing.T) { + t.Parallel() + + client, keyStore := setupTronKeysControllerTests(t) + keys, _ := keyStore.Tron().GetAll() + + response, cleanup := client.Get("/v2/keys/tron") + t.Cleanup(cleanup) + cltest.AssertServerResponse(t, response, http.StatusOK) + + resources := []presenters.TronKeyResource{} + err := web.ParseJSONAPIResponse(cltest.ParseResponseBody(t, response), &resources) + require.NoError(t, err) + + require.Len(t, resources, len(keys)) + + require.Equal(t, keys[0].ID(), resources[0].ID) + require.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) +} + +func TestTronKeysController_Create_HappyPath(t *testing.T) { + t.Parallel() + + app := cltest.NewApplicationEVMDisabled(t) + require.NoError(t, app.Start(testutils.Context(t))) + client := app.NewHTTPClient(nil) + keyStore := app.GetKeyStore() + + response, cleanup := client.Post("/v2/keys/tron", nil) + t.Cleanup(cleanup) + cltest.AssertServerResponse(t, response, http.StatusOK) + + keys, _ := keyStore.Tron().GetAll() + require.Len(t, keys, 1) + + resource := presenters.TronKeyResource{} + err := web.ParseJSONAPIResponse(cltest.ParseResponseBody(t, response), &resource) + require.NoError(t, err) + + require.Equal(t, keys[0].ID(), resource.ID) + require.Equal(t, keys[0].PublicKeyStr(), resource.PubKey) + + _, err = keyStore.Tron().Get(resource.ID) + require.NoError(t, err) +} + +func TestTronKeysController_Delete_NonExistentTronKeyID(t *testing.T) { + t.Parallel() + + client, _ := setupTronKeysControllerTests(t) + + nonExistentTronKeyID := "foobar" + response, cleanup := client.Delete("/v2/keys/tron/" + nonExistentTronKeyID) + t.Cleanup(cleanup) + require.Equal(t, http.StatusNotFound, response.StatusCode) +} + +func TestTronKeysController_Delete_HappyPath(t *testing.T) { + t.Parallel() + ctx := testutils.Context(t) + + client, keyStore := setupTronKeysControllerTests(t) + + keys, _ := keyStore.Tron().GetAll() + initialLength := len(keys) + key, _ := keyStore.Tron().Create(ctx) + + response, cleanup := client.Delete("/v2/keys/tron/" + key.ID()) + t.Cleanup(cleanup) + require.Equal(t, http.StatusOK, response.StatusCode) + require.Error(t, utils.JustError(keyStore.Tron().Get(key.ID()))) + + keys, _ = keyStore.Tron().GetAll() + require.Len(t, keys, initialLength) +} + +func setupTronKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, keystore.Master) { + t.Helper() + ctx := testutils.Context(t) + + app := cltest.NewApplication(t) + require.NoError(t, app.Start(ctx)) + require.NoError(t, app.KeyStore.OCR().Add(ctx, cltest.DefaultOCRKey)) + require.NoError(t, app.KeyStore.Tron().Add(ctx, cltest.DefaultTronKey)) + + client := app.NewHTTPClient(nil) + + return client, app.GetKeyStore() +} diff --git a/deployment/environment/nodeclient/chainlink.go b/deployment/environment/nodeclient/chainlink.go index 9aed808d5be..52aee76cd98 100644 --- a/deployment/environment/nodeclient/chainlink.go +++ b/deployment/environment/nodeclient/chainlink.go @@ -1006,6 +1006,34 @@ func (c *ChainlinkClient) CreateStarkNetNode(node *StarkNetNodeAttributes) (*Sta return &response, resp.RawResponse, err } +// CreateTronChain creates a tron chain +func (c *ChainlinkClient) CreateTronChain(chain *TronChainAttributes) (*TronChainCreate, *http.Response, error) { + response := TronChainCreate{} + c.l.Info().Str(NodeURL, c.Config.URL).Str("Chain ID", chain.ChainID).Msg("Creating Tron Chain") + resp, err := c.APIClient.R(). + SetBody(chain). + SetResult(&response). + Post("/v2/chains/tron") + if err != nil { + return nil, nil, err + } + return &response, resp.RawResponse, err +} + +// CreateTronNode creates a tron node +func (c *ChainlinkClient) CreateTronNode(node *TronNodeAttributes) (*TronNodeCreate, *http.Response, error) { + response := TronNodeCreate{} + c.l.Info().Str(NodeURL, c.Config.URL).Str("Name", node.Name).Msg("Creating Tron Node") + resp, err := c.APIClient.R(). + SetBody(node). + SetResult(&response). + Post("/v2/nodes/tron") + if err != nil { + return nil, nil, err + } + return &response, resp.RawResponse, err +} + // InternalIP retrieves the inter-cluster IP of the Chainlink node, for use with inter-node communications func (c *ChainlinkClient) InternalIP() string { return c.Config.InternalIP diff --git a/deployment/environment/nodeclient/chainlink_models.go b/deployment/environment/nodeclient/chainlink_models.go index 84bea9cec31..1f4bbe4ebd0 100644 --- a/deployment/environment/nodeclient/chainlink_models.go +++ b/deployment/environment/nodeclient/chainlink_models.go @@ -520,6 +520,48 @@ type StarkNetNodeCreate struct { Data StarkNetNode `json:"data"` } +type TronChainConfig struct { + OCR2CachePollPeriod null.String + OCR2CacheTTL null.String + RequestTimeout null.String + TxTimeout null.Bool + TxSendFrequency null.String + TxMaxBatchSize null.String +} + +// TronChainAttributes is the model that represents the tron chain +type TronChainAttributes struct { + ChainID string `json:"chainID"` + Config TronChainConfig `json:"config"` +} + +// TronChain is the model that represents the tron chain when read +type TronChain struct { + Attributes TronChainAttributes `json:"attributes"` +} + +// TronChainCreate is the model that represents the tron chain when created +type TronChainCreate struct { + Data TronChain `json:"data"` +} + +// TronNodeAttributes is the model that represents the tron node +type TronNodeAttributes struct { + Name string `json:"name"` + ChainID string `json:"chainId"` + URL string `json:"url"` +} + +// TronNode is the model that represents the tron node when read +type TronNode struct { + Attributes TronNodeAttributes `json:"attributes"` +} + +// TronNodeCreate is the model that represents the tron node when created +type TronNodeCreate struct { + Data TronNode `json:"data"` +} + // SpecForm is the form used when creating a v2 job spec, containing the TOML of the v2 job type SpecForm struct { TOML string `json:"toml"` diff --git a/testdata/scripts/chains/help.txtar b/testdata/scripts/chains/help.txtar index ccfb54d2928..5d9a8945ad9 100644 --- a/testdata/scripts/chains/help.txtar +++ b/testdata/scripts/chains/help.txtar @@ -14,6 +14,7 @@ COMMANDS: evm Commands for handling evm chains solana Commands for handling solana chains starknet Commands for handling starknet chains + tron Commands for handling tron chains OPTIONS: --help, -h show help diff --git a/testdata/scripts/chains/tron/help.txtar b/testdata/scripts/chains/tron/help.txtar new file mode 100644 index 00000000000..b0af73f1a25 --- /dev/null +++ b/testdata/scripts/chains/tron/help.txtar @@ -0,0 +1,16 @@ +exec chainlink chains tron --help +cmp stdout out.txt + +-- out.txt -- +NAME: + chainlink chains tron - Commands for handling tron chains + +USAGE: + chainlink chains tron command [command options] [arguments...] + +COMMANDS: + list List all existing tron chains + +OPTIONS: + --help, -h show help + diff --git a/testdata/scripts/chains/tron/list/help.txtar b/testdata/scripts/chains/tron/list/help.txtar new file mode 100644 index 00000000000..ce18cf3de6d --- /dev/null +++ b/testdata/scripts/chains/tron/list/help.txtar @@ -0,0 +1,9 @@ +exec chainlink chains tron list --help +cmp stdout out.txt + +-- out.txt -- +NAME: + chainlink chains tron list - List all existing tron chains + +USAGE: + chainlink chains tron list [arguments...] diff --git a/testdata/scripts/help-all/help-all.txtar b/testdata/scripts/help-all/help-all.txtar index 078853ef6a5..87d715edcba 100644 --- a/testdata/scripts/help-all/help-all.txtar +++ b/testdata/scripts/help-all/help-all.txtar @@ -34,6 +34,8 @@ chains solana # Commands for handling solana chains chains solana list # List all existing solana chains chains starknet # Commands for handling starknet chains chains starknet list # List all existing starknet chains +chains tron # Commands for handling tron chains +chains tron list # List all existing tron chains config # Commands for the node's configuration config loglevel # Set log level config logsql # Enable/disable SQL statement logging @@ -111,6 +113,12 @@ keys starknet delete # Delete StarkNet key if present keys starknet export # Export StarkNet key to keyfile keys starknet import # Import StarkNet key from keyfile keys starknet list # List the StarkNet keys +keys tron # Remote commands for administering the node's Tron keys +keys tron create # Create a Tron key +keys tron delete # Delete Tron key if present +keys tron export # Export Tron key to keyfile +keys tron import # Import Tron key from keyfile +keys tron list # List the Tron keys keys vrf # Remote commands for administering the node's vrf keys keys vrf create # Create a VRF key keys vrf delete # Archive or delete VRF key from memory and the database, if present. Note that jobs referencing the removed key will also be removed. @@ -144,6 +152,8 @@ nodes solana # Commands for handling solana node configuration nodes solana list # List all existing solana nodes nodes starknet # Commands for handling starknet node configuration nodes starknet list # List all existing starknet nodes +nodes tron # Commands for handling tron node configuration +nodes tron list # List all existing tron nodes txs # Commands for handling transactions txs cosmos # Commands for handling Cosmos transactions txs cosmos create # Send of from node Cosmos account to destination . diff --git a/testdata/scripts/keys/help.txtar b/testdata/scripts/keys/help.txtar index 83253d6906d..e930b928f54 100644 --- a/testdata/scripts/keys/help.txtar +++ b/testdata/scripts/keys/help.txtar @@ -18,6 +18,7 @@ COMMANDS: solana Remote commands for administering the node's Solana keys starknet Remote commands for administering the node's StarkNet keys aptos Remote commands for administering the node's Aptos keys + tron Remote commands for administering the node's Tron keys vrf Remote commands for administering the node's vrf keys OPTIONS: diff --git a/testdata/scripts/keys/tron/help.txtar b/testdata/scripts/keys/tron/help.txtar new file mode 100644 index 00000000000..6e0b8bf31a2 --- /dev/null +++ b/testdata/scripts/keys/tron/help.txtar @@ -0,0 +1,20 @@ +exec chainlink keys tron --help +cmp stdout out.txt + +-- out.txt -- +NAME: + chainlink keys tron - Remote commands for administering the node's Tron keys + +USAGE: + chainlink keys tron command [command options] [arguments...] + +COMMANDS: + create Create a Tron key + import Import Tron key from keyfile + export Export Tron key to keyfile + delete Delete Tron key if present + list List the Tron keys + +OPTIONS: + --help, -h show help + diff --git a/testdata/scripts/node/validate/invalid-duplicates.txtar b/testdata/scripts/node/validate/invalid-duplicates.txtar index 84e6c23aa71..d13fff5f620 100644 --- a/testdata/scripts/node/validate/invalid-duplicates.txtar +++ b/testdata/scripts/node/validate/invalid-duplicates.txtar @@ -63,6 +63,19 @@ URL = 'http://stark.node' Name = 'primary' URL = 'http://stark.node' +[[Tron]] +ChainID = '1' + +[[Tron]] +ChainID = '1' + +[[Tron.Nodes]] +Name = 'fake' +URL = 'https://foo.bar' + +[[Tron.Nodes]] +Name = 'fake' +URL = 'https://foo.bar' -- secrets.toml -- [Database] @@ -74,7 +87,7 @@ Keystore = '' -- out.txt -- -- err.txt -- -Error running app: invalid configuration: 4 errors: +Error running app: invalid configuration: 5 errors: - EVM: 4 errors: - 1.ChainID: invalid value (1): duplicate - must be unique - 1.Nodes.1.Name: invalid value (fake): duplicate - must be unique @@ -92,3 +105,6 @@ Error running app: invalid configuration: 4 errors: - 1.ChainID: invalid value (foobar): duplicate - must be unique - 1.Nodes.1.Name: invalid value (primary): duplicate - must be unique - 1.Nodes.1.URL: invalid value (http://stark.node): duplicate - must be unique + - Tron: 2 errors: + - 1.ChainID: invalid value (1): duplicate - must be unique + - 1.Nodes.1.Name: invalid value (fake): duplicate - must be unique diff --git a/testdata/scripts/nodes/help.txtar b/testdata/scripts/nodes/help.txtar index f9132045d29..c8409d62691 100644 --- a/testdata/scripts/nodes/help.txtar +++ b/testdata/scripts/nodes/help.txtar @@ -14,6 +14,7 @@ COMMANDS: evm Commands for handling evm node configuration solana Commands for handling solana node configuration starknet Commands for handling starknet node configuration + tron Commands for handling tron node configuration OPTIONS: --help, -h show help diff --git a/testdata/scripts/nodes/tron/help.txtar b/testdata/scripts/nodes/tron/help.txtar new file mode 100644 index 00000000000..e35e174e6d8 --- /dev/null +++ b/testdata/scripts/nodes/tron/help.txtar @@ -0,0 +1,16 @@ +exec chainlink nodes tron --help +cmp stdout out.txt + +-- out.txt -- +NAME: + chainlink nodes tron - Commands for handling tron node configuration + +USAGE: + chainlink nodes tron command [command options] [arguments...] + +COMMANDS: + list List all existing tron nodes + +OPTIONS: + --help, -h show help + diff --git a/testdata/scripts/nodes/tron/list/help.txtar b/testdata/scripts/nodes/tron/list/help.txtar new file mode 100644 index 00000000000..08c9d07d56b --- /dev/null +++ b/testdata/scripts/nodes/tron/list/help.txtar @@ -0,0 +1,9 @@ +exec chainlink nodes tron list --help +cmp stdout out.txt + +-- out.txt -- +NAME: + chainlink nodes tron list - List all existing tron nodes + +USAGE: + chainlink nodes tron list [arguments...] From ba343f35df697b7a8a5a9262376969b9bbc6d834 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Thu, 9 Jan 2025 06:06:50 -0800 Subject: [PATCH 20/91] fix: goreleaser builds cache/dist path (#15875) --- .github/workflows/build-publish-develop-pr.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-publish-develop-pr.yml b/.github/workflows/build-publish-develop-pr.yml index 4aed811daa6..58f5ee560a7 100644 --- a/.github/workflows/build-publish-develop-pr.yml +++ b/.github/workflows/build-publish-develop-pr.yml @@ -83,11 +83,11 @@ jobs: include: - runner: ubuntu-latest goarch: amd64 - dist_name: linux_amd64_v1 + dist_name: linux_amd64 - runner: ubuntu-24.04-4cores-16GB-ARM goarch: arm64 - dist_name: linux_arm64_v8.0 + dist_name: linux_arm64 steps: - name: Checkout chainlink repository uses: actions/checkout@v4.2.1 @@ -122,7 +122,7 @@ jobs: - id: cache uses: actions/cache@v4 with: - path: dist/${{ matrix.dist_name }} + path: ./dist/${{ matrix.dist_name }} key: chainlink-${{ matrix.goarch }}-${{ github.sha }} - name: Build images for ${{ matrix.goarch }} @@ -159,13 +159,13 @@ jobs: - uses: actions/cache/restore@v4 with: - path: dist/linux_amd64_v1 + path: ./dist/linux_amd64 key: chainlink-amd64-${{ github.sha }} fail-on-cache-miss: true - uses: actions/cache/restore@v4 with: - path: dist/linux_arm64_v8.0 + path: ./dist/linux_arm64 key: chainlink-arm64-${{ github.sha }} fail-on-cache-miss: true From bfe91d405dd7f9d016dc604d93da97c42d40acea Mon Sep 17 00:00:00 2001 From: Gabriel Paradiso Date: Thu, 9 Jan 2025 15:26:59 +0100 Subject: [PATCH 21/91] [CAPPL-320] use decoded workflowName when logged via beholder (#15815) * fix: hex decode workflowName when logged via beholder * feat: decode workflow name on the engine * chore: bump chainlink-common * chore: add workflow name to model to avoid decoding in multiple places --- core/capabilities/compute/compute.go | 2 +- core/capabilities/targets/write_target.go | 3 ++- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- core/services/workflows/delegate.go | 2 +- core/services/workflows/engine.go | 8 ++++++-- core/services/workflows/engine_test.go | 4 ++-- core/services/workflows/models.go | 1 + core/services/workflows/syncer/handler.go | 7 ++++--- core/services/workflows/syncer/handler_test.go | 13 ++++++++----- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 18 files changed, 40 insertions(+), 30 deletions(-) diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index 2ba5daefaa6..156c5154c99 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -300,7 +300,7 @@ func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchReq cma := c.emitter.With( platform.KeyWorkflowID, req.Metadata.WorkflowId, - platform.KeyWorkflowName, req.Metadata.WorkflowName, + platform.KeyWorkflowName, req.Metadata.DecodedWorkflowName, platform.KeyWorkflowOwner, req.Metadata.WorkflowOwner, platform.KeyWorkflowExecutionID, req.Metadata.WorkflowExecutionId, timestampKey, time.Now().UTC().Format(time.RFC3339Nano), diff --git a/core/capabilities/targets/write_target.go b/core/capabilities/targets/write_target.go index 09a0bbd2b36..3fc51270c86 100644 --- a/core/capabilities/targets/write_target.go +++ b/core/capabilities/targets/write_target.go @@ -345,10 +345,11 @@ func (cap *WriteTarget) Execute(ctx context.Context, rawRequest capabilities.Cap return capabilities.CapabilityResponse{}, nil case commontypes.Failed, commontypes.Fatal: cap.lggr.Error("Transaction failed", "request", request, "transaction", txID) + msg := "failed to submit transaction with ID: " + txID.String() err = cap.emitter.With( platform.KeyWorkflowID, request.Metadata.WorkflowID, - platform.KeyWorkflowName, request.Metadata.WorkflowName, + platform.KeyWorkflowName, request.Metadata.DecodedWorkflowName, platform.KeyWorkflowOwner, request.Metadata.WorkflowOwner, platform.KeyWorkflowExecutionID, request.Metadata.WorkflowExecutionID, ).Emit(ctx, msg) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index e016559d6cf..bccad12b396 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index b716caa9ec3..d0c9ebe9e1f 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1115,8 +1115,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/core/services/workflows/delegate.go b/core/services/workflows/delegate.go index fc8fe3fe840..9e50f5ec092 100644 --- a/core/services/workflows/delegate.go +++ b/core/services/workflows/delegate.go @@ -81,7 +81,7 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.Ser type noopSecretsFetcher struct{} -func (n *noopSecretsFetcher) SecretsFor(ctx context.Context, workflowOwner, workflowName, workflowID string) (map[string]string, error) { +func (n *noopSecretsFetcher) SecretsFor(ctx context.Context, workflowOwner, hexWorkflowName, decodedWorkflowName, workflowID string) (map[string]string, error) { return map[string]string{}, nil } diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index d153e53bc07..0b35bf4b06f 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -96,7 +96,7 @@ func (sucm *stepUpdateManager) len() int64 { } type secretsFetcher interface { - SecretsFor(ctx context.Context, workflowOwner, workflowName, workflowID string) (map[string]string, error) + SecretsFor(ctx context.Context, workflowOwner, hexWorkflowName, decodedWorkflowName, workflowID string) (map[string]string, error) } // Engine handles the lifecycle of a single workflow and its executions. @@ -440,6 +440,7 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig WorkflowDonID: e.localNode.WorkflowDON.ID, WorkflowDonConfigVersion: e.localNode.WorkflowDON.ConfigVersion, ReferenceID: t.Ref, + DecodedWorkflowName: e.workflow.name, }, Config: t.config.Load(), TriggerID: triggerID, @@ -868,7 +869,7 @@ func (e *Engine) interpolateEnvVars(config map[string]any, env exec.Env) (*value // registry (for capability-level configuration). It doesn't perform any caching of the config values, since // the two registries perform their own caching. func (e *Engine) configForStep(ctx context.Context, lggr logger.Logger, step *step) (*values.Map, error) { - secrets, err := e.secretsFetcher.SecretsFor(ctx, e.workflow.owner, e.workflow.hexName, e.workflow.id) + secrets, err := e.secretsFetcher.SecretsFor(ctx, e.workflow.owner, e.workflow.hexName, e.workflow.name, e.workflow.id) if err != nil { return nil, fmt.Errorf("failed to fetch secrets: %w", err) } @@ -964,6 +965,7 @@ func (e *Engine) executeStep(ctx context.Context, lggr logger.Logger, msg stepRe WorkflowDonID: e.localNode.WorkflowDON.ID, WorkflowDonConfigVersion: e.localNode.WorkflowDON.ConfigVersion, ReferenceID: msg.stepRef, + DecodedWorkflowName: e.workflow.name, }, } @@ -989,6 +991,7 @@ func (e *Engine) deregisterTrigger(ctx context.Context, t *triggerCapability, tr WorkflowName: e.workflow.hexName, WorkflowOwner: e.workflow.owner, ReferenceID: t.Ref, + DecodedWorkflowName: e.workflow.name, }, TriggerID: generateTriggerId(e.workflow.id, triggerIdx), Config: t.config.Load(), @@ -1295,6 +1298,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { workflow.id = cfg.WorkflowID workflow.owner = cfg.WorkflowOwner workflow.hexName = hex.EncodeToString([]byte(cfg.WorkflowName)) + workflow.name = cfg.WorkflowName engine = &Engine{ cma: cma, diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 95ac74f0c76..839e3680f72 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -153,7 +153,7 @@ func newTestEngineWithYAMLSpec(t *testing.T, reg *coreCap.Registry, spec string, type mockSecretsFetcher struct{} -func (s mockSecretsFetcher) SecretsFor(ctx context.Context, workflowOwner, workflowName, workflowID string) (map[string]string, error) { +func (s mockSecretsFetcher) SecretsFor(ctx context.Context, workflowOwner, hexWorkflowName, decodedWorkflowName, workflowID string) (map[string]string, error) { return map[string]string{}, nil } @@ -1606,7 +1606,7 @@ type mockFetcher struct { retval map[string]string } -func (m *mockFetcher) SecretsFor(ctx context.Context, workflowOwner, workflowName, workflowID string) (map[string]string, error) { +func (m *mockFetcher) SecretsFor(ctx context.Context, workflowOwner, hexWorkflowName, decodedWorkflowName, workflowID string) (map[string]string, error) { return m.retval, nil } diff --git a/core/services/workflows/models.go b/core/services/workflows/models.go index e5d26a474f6..ec149bf6371 100644 --- a/core/services/workflows/models.go +++ b/core/services/workflows/models.go @@ -23,6 +23,7 @@ type workflow struct { id string owner string hexName string + name string graph.Graph[string, *step] triggers []*triggerCapability diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index cb4f013d502..bae311c846b 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -224,7 +224,7 @@ func (h *eventHandler) refreshSecrets(ctx context.Context, workflowOwner, workfl return updatedSecrets, nil } -func (h *eventHandler) SecretsFor(ctx context.Context, workflowOwner, workflowName, workflowID string) (map[string]string, error) { +func (h *eventHandler) SecretsFor(ctx context.Context, workflowOwner, hexWorkflowName, decodedWorkflowName, workflowID string) (map[string]string, error) { secretsURLHash, secretsPayload, err := h.orm.GetContentsByWorkflowID(ctx, workflowID) if err != nil { // The workflow record was found, but secrets_id was empty. @@ -238,15 +238,16 @@ func (h *eventHandler) SecretsFor(ctx context.Context, workflowOwner, workflowNa lastFetchedAt, ok := h.lastFetchedAtMap.Get(secretsURLHash) if !ok || h.clock.Now().Sub(lastFetchedAt) > h.secretsFreshnessDuration { - updatedSecrets, innerErr := h.refreshSecrets(ctx, workflowOwner, workflowName, workflowID, secretsURLHash) + updatedSecrets, innerErr := h.refreshSecrets(ctx, workflowOwner, hexWorkflowName, workflowID, secretsURLHash) if innerErr != nil { msg := fmt.Sprintf("could not refresh secrets: proceeding with stale secrets for workflowID %s: %s", workflowID, innerErr) h.lggr.Error(msg) + logCustMsg( ctx, h.emitter.With( platform.KeyWorkflowID, workflowID, - platform.KeyWorkflowName, workflowName, + platform.KeyWorkflowName, decodedWorkflowName, platform.KeyWorkflowOwner, workflowOwner, ), msg, diff --git a/core/services/workflows/syncer/handler_test.go b/core/services/workflows/syncer/handler_test.go index 994b820b5ce..3b3231a3d3d 100644 --- a/core/services/workflows/syncer/handler_test.go +++ b/core/services/workflows/syncer/handler_test.go @@ -780,6 +780,7 @@ func Test_Handler_SecretsFor(t *testing.T) { workflowOwner := hex.EncodeToString([]byte("anOwner")) workflowName := "aName" workflowID := "anID" + decodedWorkflowName := "decodedName" encryptionKey, err := workflowkey.New() require.NoError(t, err) @@ -820,7 +821,7 @@ func Test_Handler_SecretsFor(t *testing.T) { encryptionKey, ) - gotSecrets, err := h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, workflowID) + gotSecrets, err := h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, decodedWorkflowName, workflowID) require.NoError(t, err) expectedSecrets := map[string]string{ @@ -837,6 +838,7 @@ func Test_Handler_SecretsFor_RefreshesSecrets(t *testing.T) { workflowOwner := hex.EncodeToString([]byte("anOwner")) workflowName := "aName" workflowID := "anID" + decodedWorkflowName := "decodedName" encryptionKey, err := workflowkey.New() require.NoError(t, err) @@ -881,7 +883,7 @@ func Test_Handler_SecretsFor_RefreshesSecrets(t *testing.T) { encryptionKey, ) - gotSecrets, err := h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, workflowID) + gotSecrets, err := h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, decodedWorkflowName, workflowID) require.NoError(t, err) expectedSecrets := map[string]string{ @@ -898,6 +900,7 @@ func Test_Handler_SecretsFor_RefreshLogic(t *testing.T) { workflowOwner := hex.EncodeToString([]byte("anOwner")) workflowName := "aName" workflowID := "anID" + decodedWorkflowName := "decodedName" encryptionKey, err := workflowkey.New() require.NoError(t, err) @@ -943,7 +946,7 @@ func Test_Handler_SecretsFor_RefreshLogic(t *testing.T) { encryptionKey, ) - gotSecrets, err := h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, workflowID) + gotSecrets, err := h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, decodedWorkflowName, workflowID) require.NoError(t, err) expectedSecrets := map[string]string{ @@ -955,7 +958,7 @@ func Test_Handler_SecretsFor_RefreshLogic(t *testing.T) { // SecretsFor should still succeed. fetcher.responseMap[url] = mockFetchResp{} - gotSecrets, err = h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, workflowID) + gotSecrets, err = h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, decodedWorkflowName, workflowID) require.NoError(t, err) assert.Equal(t, expectedSecrets, gotSecrets) @@ -963,7 +966,7 @@ func Test_Handler_SecretsFor_RefreshLogic(t *testing.T) { // Now advance so that we hit the freshness limit clock.Advance(48 * time.Hour) - _, err = h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, workflowID) + _, err = h.SecretsFor(testutils.Context(t), workflowOwner, workflowName, decodedWorkflowName, workflowID) assert.ErrorContains(t, err, "unexpected end of JSON input") } diff --git a/deployment/go.mod b/deployment/go.mod index cbec5d95744..7ca3e8a4398 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -31,7 +31,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 diff --git a/deployment/go.sum b/deployment/go.sum index e58794f2e97..49d9771239e 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1385,8 +1385,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/go.mod b/go.mod index c12790b12c7..85baf8f3812 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index c8778ab3532..1a2b9a010c6 100644 --- a/go.sum +++ b/go.sum @@ -1150,8 +1150,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index efd538007b1..299723a8c9a 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -47,7 +47,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index a2f198d4856..f94166bdeae 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1407,8 +1407,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 94d86cb5cd4..8d7d2e18488 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -27,7 +27,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index eb114fa0e28..033b52e5d4f 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1398,8 +1398,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= From c7759e15e2b15bdeacf00ddbd433a4b420072cf3 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 9 Jan 2025 09:35:52 -0500 Subject: [PATCH 22/91] Multistream specs (#15603) * Multistream specs * . * w * Fix lint * Lint * Add concurrency stress tests * Fix lint * Lint * Add benchmark * Benchmark on datasource.Observe * Fix lint --- .changeset/rotten-books-cross.md | 5 + core/internal/testutils/httptest/httptest.go | 3 +- core/services/llo/data_source.go | 95 +---- core/services/llo/data_source_test.go | 165 +++++++- core/services/llo/observation_context.go | 193 ++++++++++ core/services/llo/observation_context_test.go | 358 ++++++++++++++++++ core/services/pipeline/common.go | 1 + core/services/pipeline/runner.go | 4 +- core/services/pipeline/task.base.go | 9 + .../relay/evm/mercury/mocks/pipeline.go | 1 + core/services/streams/delegate.go | 37 +- core/services/streams/delegate_test.go | 11 +- core/services/streams/pipeline.go | 131 +++++++ core/services/streams/stream.go | 94 ----- core/services/streams/stream_registry.go | 59 ++- core/services/streams/stream_registry_test.go | 198 +++++++--- core/services/streams/stream_test.go | 25 +- go.mod | 1 + 18 files changed, 1103 insertions(+), 287 deletions(-) create mode 100644 .changeset/rotten-books-cross.md create mode 100644 core/services/llo/observation_context.go create mode 100644 core/services/llo/observation_context_test.go create mode 100644 core/services/streams/pipeline.go delete mode 100644 core/services/streams/stream.go diff --git a/.changeset/rotten-books-cross.md b/.changeset/rotten-books-cross.md new file mode 100644 index 00000000000..95231ec47f2 --- /dev/null +++ b/.changeset/rotten-books-cross.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Support multiple streamIDs in stream specs #added diff --git a/core/internal/testutils/httptest/httptest.go b/core/internal/testutils/httptest/httptest.go index a1bd941fb02..69549ae3e45 100644 --- a/core/internal/testutils/httptest/httptest.go +++ b/core/internal/testutils/httptest/httptest.go @@ -12,7 +12,8 @@ import ( // NewTestHTTPClient returns a real HTTP client that may only make requests to // localhost func NewTestLocalOnlyHTTPClient() *http.Client { - tr := http.DefaultTransport.(*http.Transport).Clone() + // Don't use the default transport, we want zero limits and zero timeouts + tr := &http.Transport{} tr.DialContext = testDialContext tr.DisableCompression = true return &http.Client{Transport: tr} diff --git a/core/services/llo/data_source.go b/core/services/llo/data_source.go index 2afe9e090a3..855ac7d9940 100644 --- a/core/services/llo/data_source.go +++ b/core/services/llo/data_source.go @@ -2,15 +2,16 @@ package llo import ( "context" + "errors" "fmt" "slices" "sort" + "strconv" "sync" "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/shopspring/decimal" "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -19,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/streams" - "github.com/smartcontractkit/chainlink/v2/core/utils" ) var ( @@ -42,7 +42,7 @@ var ( ) type Registry interface { - Get(streamID streams.StreamID) (strm streams.Stream, exists bool) + Get(streamID streams.StreamID) (p streams.Pipeline, exists bool) } type ErrObservationFailed struct { @@ -109,43 +109,25 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues, successfulStreamIDs := make([]streams.StreamID, 0, len(streamValues)) var errs []ErrObservationFailed + // oc only lives for the duration of this Observe call + oc := NewObservationContext(d.registry, d.t) + for _, streamID := range maps.Keys(streamValues) { go func(streamID llotypes.StreamID) { defer wg.Done() - - var val llo.StreamValue - - stream, exists := d.registry.Get(streamID) - if !exists { - mu.Lock() - errs = append(errs, ErrObservationFailed{streamID: streamID, reason: fmt.Sprintf("missing stream: %d", streamID)}) - mu.Unlock() - promMissingStreamCount.WithLabelValues(fmt.Sprintf("%d", streamID)).Inc() - return - } - run, trrs, err := stream.Run(ctx) - if err != nil { - mu.Lock() - errs = append(errs, ErrObservationFailed{inner: err, run: run, streamID: streamID, reason: "pipeline run failed"}) - mu.Unlock() - promObservationErrorCount.WithLabelValues(fmt.Sprintf("%d", streamID)).Inc() - // TODO: Consolidate/reduce telemetry. We should send all observation results in a single packet - // https://smartcontract-it.atlassian.net/browse/MERC-6290 - d.t.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, nil, err) - return - } - // TODO: Consolidate/reduce telemetry. We should send all observation results in a single packet - // https://smartcontract-it.atlassian.net/browse/MERC-6290 - val, err = ExtractStreamValue(trrs) + val, err := oc.Observe(ctx, streamID, opts) if err != nil { + strmIDStr := strconv.FormatUint(uint64(streamID), 10) + if errors.As(err, &MissingStreamError{}) { + promMissingStreamCount.WithLabelValues(strmIDStr).Inc() + } + promObservationErrorCount.WithLabelValues(strmIDStr).Inc() mu.Lock() - errs = append(errs, ErrObservationFailed{inner: err, run: run, streamID: streamID, reason: "failed to extract big.Int"}) + errs = append(errs, ErrObservationFailed{inner: err, streamID: streamID, reason: "failed to observe stream"}) mu.Unlock() return } - d.t.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, val, nil) - mu.Lock() defer mu.Unlock() @@ -186,54 +168,3 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues, return nil } - -// ExtractStreamValue extracts a StreamValue from a TaskRunResults -func ExtractStreamValue(trrs pipeline.TaskRunResults) (llo.StreamValue, error) { - // pipeline.TaskRunResults comes ordered asc by index, this is guaranteed - // by the pipeline executor - finaltrrs := trrs.Terminals() - - // HACK: Right now we rely on the number of outputs to determine whether - // its a Decimal or a Quote. - // This isn't very robust or future-proof but is sufficient to support v0.3 - // compat. - // There are a number of different possible ways to solve this in future. - // See: https://smartcontract-it.atlassian.net/browse/MERC-5934 - switch len(finaltrrs) { - case 1: - res := finaltrrs[0].Result - if res.Error != nil { - return nil, res.Error - } - val, err := toDecimal(res.Value) - if err != nil { - return nil, fmt.Errorf("failed to parse BenchmarkPrice: %w", err) - } - return llo.ToDecimal(val), nil - case 3: - // Expect ordering of Benchmark, Bid, Ask - results := make([]decimal.Decimal, 3) - for i, trr := range finaltrrs { - res := trr.Result - if res.Error != nil { - return nil, fmt.Errorf("failed to parse stream output into Quote (task index: %d): %w", i, res.Error) - } - val, err := toDecimal(res.Value) - if err != nil { - return nil, fmt.Errorf("failed to parse decimal: %w", err) - } - results[i] = val - } - return &llo.Quote{ - Benchmark: results[0], - Bid: results[1], - Ask: results[2], - }, nil - default: - return nil, fmt.Errorf("invalid number of results, expected: 1 or 3, got: %d", len(finaltrrs)) - } -} - -func toDecimal(val interface{}) (decimal.Decimal, error) { - return utils.ToDecimal(val) -} diff --git a/core/services/llo/data_source_test.go b/core/services/llo/data_source_test.go index 932c4c0c73a..349ec70007d 100644 --- a/core/services/llo/data_source_test.go +++ b/core/services/llo/data_source_test.go @@ -3,6 +3,8 @@ package llo import ( "context" "errors" + "fmt" + "math" "math/big" "sync" "testing" @@ -10,38 +12,54 @@ import ( "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + clhttptest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/httptest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/streams" ) -type mockStream struct { +type mockPipeline struct { run *pipeline.Run trrs pipeline.TaskRunResults err error + + streamIDs []streams.StreamID + + runCount int } -func (m *mockStream) Run(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { +func (m *mockPipeline) Run(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { + m.runCount++ return m.run, m.trrs, m.err } +func (m *mockPipeline) StreamIDs() []streams.StreamID { + return m.streamIDs +} + type mockRegistry struct { - streams map[streams.StreamID]*mockStream + pipelines map[streams.StreamID]*mockPipeline } -func (m *mockRegistry) Get(streamID streams.StreamID) (strm streams.Stream, exists bool) { - strm, exists = m.streams[streamID] +func (m *mockRegistry) Get(streamID streams.StreamID) (p streams.Pipeline, exists bool) { + p, exists = m.pipelines[streamID] return } -func makeStreamWithSingleResult[T any](runID int64, res T, err error) *mockStream { - return &mockStream{ +func makePipelineWithSingleResult[T any](runID int64, res T, err error) *mockPipeline { + return &mockPipeline{ run: &pipeline.Run{ID: runID}, trrs: []pipeline.TaskRunResult{pipeline.TaskRunResult{Task: &pipeline.MemoTask{}, Result: pipeline.Result{Value: res}}}, err: err, @@ -56,9 +74,11 @@ func makeStreamValues() llo.StreamValues { } } -type mockOpts struct{} +type mockOpts struct { + verboseLogging bool +} -func (m *mockOpts) VerboseLogging() bool { return true } +func (m *mockOpts) VerboseLogging() bool { return m.verboseLogging } func (m *mockOpts) SeqNr() uint64 { return 1042 } func (m *mockOpts) OutCtx() ocr3types.OutcomeContext { return ocr3types.OutcomeContext{SeqNr: 1042, PreviousOutcome: ocr3types.Outcome([]byte("foo"))} @@ -91,7 +111,7 @@ func (m *mockTelemeter) EnqueueV3PremiumLegacy(run *pipeline.Run, trrs pipeline. func Test_DataSource(t *testing.T) { lggr := logger.TestLogger(t) - reg := &mockRegistry{make(map[streams.StreamID]*mockStream)} + reg := &mockRegistry{make(map[streams.StreamID]*mockPipeline)} ds := newDataSource(lggr, reg, NullTelemeter) ctx := testutils.Context(t) opts := &mockOpts{} @@ -105,9 +125,9 @@ func Test_DataSource(t *testing.T) { assert.Equal(t, makeStreamValues(), vals) }) t.Run("observes each stream with success and returns values matching map argument", func(t *testing.T) { - reg.streams[1] = makeStreamWithSingleResult[*big.Int](1, big.NewInt(2181), nil) - reg.streams[2] = makeStreamWithSingleResult[*big.Int](2, big.NewInt(40602), nil) - reg.streams[3] = makeStreamWithSingleResult[*big.Int](3, big.NewInt(15), nil) + reg.pipelines[1] = makePipelineWithSingleResult[*big.Int](1, big.NewInt(2181), nil) + reg.pipelines[2] = makePipelineWithSingleResult[*big.Int](2, big.NewInt(40602), nil) + reg.pipelines[3] = makePipelineWithSingleResult[*big.Int](3, big.NewInt(15), nil) vals := makeStreamValues() err := ds.Observe(ctx, vals, opts) @@ -120,9 +140,9 @@ func Test_DataSource(t *testing.T) { }, vals) }) t.Run("observes each stream and returns success/errors", func(t *testing.T) { - reg.streams[1] = makeStreamWithSingleResult[*big.Int](1, big.NewInt(2181), errors.New("something exploded")) - reg.streams[2] = makeStreamWithSingleResult[*big.Int](2, big.NewInt(40602), nil) - reg.streams[3] = makeStreamWithSingleResult[*big.Int](3, nil, errors.New("something exploded 2")) + reg.pipelines[1] = makePipelineWithSingleResult[*big.Int](1, big.NewInt(2181), errors.New("something exploded")) + reg.pipelines[2] = makePipelineWithSingleResult[*big.Int](2, big.NewInt(40602), nil) + reg.pipelines[3] = makePipelineWithSingleResult[*big.Int](3, nil, errors.New("something exploded 2")) vals := makeStreamValues() err := ds.Observe(ctx, vals, opts) @@ -139,9 +159,9 @@ func Test_DataSource(t *testing.T) { tm := &mockTelemeter{} ds.t = tm - reg.streams[1] = makeStreamWithSingleResult[*big.Int](100, big.NewInt(2181), nil) - reg.streams[2] = makeStreamWithSingleResult[*big.Int](101, big.NewInt(40602), nil) - reg.streams[3] = makeStreamWithSingleResult[*big.Int](102, big.NewInt(15), nil) + reg.pipelines[1] = makePipelineWithSingleResult[*big.Int](100, big.NewInt(2181), nil) + reg.pipelines[2] = makePipelineWithSingleResult[*big.Int](101, big.NewInt(40602), nil) + reg.pipelines[3] = makePipelineWithSingleResult[*big.Int](102, big.NewInt(15), nil) vals := makeStreamValues() err := ds.Observe(ctx, vals, opts) @@ -166,5 +186,112 @@ func Test_DataSource(t *testing.T) { assert.Equal(t, "2181", pkt.val.(*llo.Decimal).String()) assert.Nil(t, pkt.err) }) + + t.Run("records telemetry for errors", func(t *testing.T) { + tm := &mockTelemeter{} + ds.t = tm + + reg.pipelines[1] = makePipelineWithSingleResult[*big.Int](100, big.NewInt(2181), errors.New("something exploded")) + reg.pipelines[2] = makePipelineWithSingleResult[*big.Int](101, big.NewInt(40602), nil) + reg.pipelines[3] = makePipelineWithSingleResult[*big.Int](102, nil, errors.New("something exploded 2")) + + vals := makeStreamValues() + err := ds.Observe(ctx, vals, opts) + require.NoError(t, err) + + assert.Equal(t, llo.StreamValues{ + 2: llo.ToDecimal(decimal.NewFromInt(40602)), + 1: nil, + 3: nil, + }, vals) + + require.Len(t, tm.v3PremiumLegacyPackets, 3) + m := make(map[int]v3PremiumLegacyPacket) + for _, pkt := range tm.v3PremiumLegacyPackets { + m[int(pkt.run.ID)] = pkt + } + pkt := m[100] + assert.Equal(t, 100, int(pkt.run.ID)) + assert.Len(t, pkt.trrs, 1) + assert.Equal(t, 1, int(pkt.streamID)) + assert.Equal(t, opts, pkt.opts) + assert.Nil(t, pkt.val) + assert.Error(t, pkt.err) + }) }) } + +func BenchmarkObserve(b *testing.B) { + lggr := logger.TestLogger(b) + ctx := testutils.Context(b) + // can enable/disable verbose logging to test performance here + opts := &mockOpts{verboseLogging: true} + + db := pgtest.NewSqlxDB(b) + bridgesORM := bridges.NewORM(db) + + if b.N > math.MaxInt32 { + b.Fatalf("N is too large: %d", b.N) + } + + n := uint32(b.N) //nolint:gosec // G115 // overflow impossible + + createBridge(b, "foo-bridge", `123.456`, bridgesORM, 0) + createBridge(b, "bar-bridge", `"124.456"`, bridgesORM, 0) + + c := clhttptest.NewTestLocalOnlyHTTPClient() + runner := pipeline.NewRunner( + nil, + bridgesORM, + &mockPipelineConfig{}, + &mockBridgeConfig{}, + nil, + nil, + nil, + lggr, + c, + c, + ) + + r := streams.NewRegistry(lggr, runner) + for i := uint32(0); i < n; i++ { + i := i + jb := job.Job{ + ID: int32(i), //nolint:gosec // G115 // overflow impossible + Name: null.StringFrom(fmt.Sprintf("job-%d", i)), + Type: job.Stream, + StreamID: &i, + PipelineSpec: &pipeline.Spec{ + ID: int32(i * 100), //nolint:gosec // G115 // overflow impossible + DotDagSource: fmt.Sprintf(` +// Benchmark Price +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=%d index=0]; // force conversion to decimal + +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=%d index=1]; + +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=%d index=2]; // force conversion to decimal + +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`, i+n, i+2*n, i+3*n), + }, + } + err := r.Register(jb, nil) + require.NoError(b, err) + } + + ds := newDataSource(lggr, r, NullTelemeter) + vals := make(map[llotypes.StreamID]llo.StreamValue) + for i := uint32(0); i < 4*n; i++ { + vals[i] = nil + } + + b.ResetTimer() + err := ds.Observe(ctx, vals, opts) + require.NoError(b, err) +} diff --git a/core/services/llo/observation_context.go b/core/services/llo/observation_context.go new file mode 100644 index 00000000000..5bf82fa5a79 --- /dev/null +++ b/core/services/llo/observation_context.go @@ -0,0 +1,193 @@ +package llo + +import ( + "context" + "fmt" + "sync" + + "github.com/shopspring/decimal" + + "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/streams" + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +// ObservationContext ensures that each pipeline is only executed once. It is +// intended to be instantiated and used then discarded as part of one +// Observation cycle. Subsequent calls to Observe will return the same cached +// values. + +var _ ObservationContext = (*observationContext)(nil) + +type ObservationContext interface { + Observe(ctx context.Context, streamID streams.StreamID, opts llo.DSOpts) (val llo.StreamValue, err error) +} + +type execution struct { + done <-chan struct{} + + run *pipeline.Run + trrs pipeline.TaskRunResults + err error +} + +type observationContext struct { + r Registry + t Telemeter + + executionsMu sync.Mutex + // only execute each pipeline once + executions map[streams.Pipeline]*execution +} + +func NewObservationContext(r Registry, t Telemeter) ObservationContext { + return newObservationContext(r, t) +} + +func newObservationContext(r Registry, t Telemeter) *observationContext { + return &observationContext{r, t, sync.Mutex{}, make(map[streams.Pipeline]*execution)} +} + +func (oc *observationContext) Observe(ctx context.Context, streamID streams.StreamID, opts llo.DSOpts) (val llo.StreamValue, err error) { + run, trrs, err := oc.run(ctx, streamID) + if err != nil { + // FIXME: This is a hack specific for V3 telemetry, future schemas should + // use a generic stream value telemetry instead + // https://smartcontract-it.atlassian.net/browse/MERC-6290 + oc.t.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, val, err) + return nil, err + } + // Extract stream value based on streamID attribute + for _, trr := range trrs { + if trr.Task.TaskStreamID() != nil && *trr.Task.TaskStreamID() == streamID { + val, err = resultToStreamValue(trr.Result.Value) + if err != nil { + return nil, fmt.Errorf("failed to convert result to StreamValue for streamID %d: %w", streamID, err) + } + return val, nil + } + } + // If no streamID attribute is found in the task results, then assume the + // final output is the stream ID and return that. This is safe to do since + // the registry will never return a spec that doesn't match either by tag + // or by spec streamID. + + val, err = extractFinalResultAsStreamValue(trrs) + // FIXME: This is a hack specific for V3 telemetry, future schemas should + // use a generic stream value telemetry instead + // https://smartcontract-it.atlassian.net/browse/MERC-6290 + oc.t.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, val, err) + return +} + +func resultToStreamValue(val interface{}) (llo.StreamValue, error) { + switch v := val.(type) { + case decimal.Decimal: + return llo.ToDecimal(v), nil + case float64: + return llo.ToDecimal(decimal.NewFromFloat(v)), nil + case pipeline.ObjectParam: + switch v.Type { + case pipeline.DecimalType: + return llo.ToDecimal(decimal.Decimal(v.DecimalValue)), nil + default: + return nil, fmt.Errorf("don't know how to convert pipeline.ObjectParam with type %d to llo.StreamValue", v.Type) + } + default: + return nil, fmt.Errorf("don't know how to convert pipeline output result of type %T to llo.StreamValue (got: %v)", val, val) + } +} + +// extractFinalResultAsStreamValue extracts a final StreamValue from a TaskRunResults +func extractFinalResultAsStreamValue(trrs pipeline.TaskRunResults) (llo.StreamValue, error) { + // pipeline.TaskRunResults comes ordered asc by index, this is guaranteed + // by the pipeline executor + finaltrrs := trrs.Terminals() + + // HACK: Right now we rely on the number of outputs to determine whether + // its a Decimal or a Quote. + // This is a hack to support the legacy "Quote" case. + // Future stream specs should use streamID tags instead. + switch len(finaltrrs) { + case 1: + res := finaltrrs[0].Result + if res.Error != nil { + return nil, res.Error + } + val, err := toDecimal(res.Value) + if err != nil { + return nil, fmt.Errorf("failed to parse BenchmarkPrice: %w", err) + } + return llo.ToDecimal(val), nil + case 3: + // Expect ordering of Benchmark, Bid, Ask + results := make([]decimal.Decimal, 3) + for i, trr := range finaltrrs { + res := trr.Result + if res.Error != nil { + return nil, fmt.Errorf("failed to parse stream output into Quote (task index: %d): %w", i, res.Error) + } + val, err := toDecimal(res.Value) + if err != nil { + return nil, fmt.Errorf("failed to parse decimal: %w", err) + } + results[i] = val + } + return &llo.Quote{ + Benchmark: results[0], + Bid: results[1], + Ask: results[2], + }, nil + default: + return nil, fmt.Errorf("invalid number of results, expected: 1 or 3, got: %d", len(finaltrrs)) + } +} + +func toDecimal(val interface{}) (decimal.Decimal, error) { + return utils.ToDecimal(val) +} + +type MissingStreamError struct { + StreamID streams.StreamID +} + +func (e MissingStreamError) Error() string { + return fmt.Sprintf("no pipeline for stream: %d", e.StreamID) +} + +func (oc *observationContext) run(ctx context.Context, streamID streams.StreamID) (*pipeline.Run, pipeline.TaskRunResults, error) { + p, exists := oc.r.Get(streamID) + if !exists { + return nil, nil, MissingStreamError{StreamID: streamID} + } + + // In case of multiple streamIDs per pipeline then the + // first call executes and the others wait for result + oc.executionsMu.Lock() + ex, isExecuting := oc.executions[p] + if isExecuting { + oc.executionsMu.Unlock() + // wait for it to finish + select { + case <-ex.done: + return ex.run, ex.trrs, ex.err + case <-ctx.Done(): + return nil, nil, ctx.Err() + } + } + + // execute here + ch := make(chan struct{}) + ex = &execution{done: ch} + oc.executions[p] = ex + oc.executionsMu.Unlock() + + run, trrs, err := p.Run(ctx) + ex.run = run + ex.trrs = trrs + ex.err = err + close(ch) + + return run, trrs, err +} diff --git a/core/services/llo/observation_context_test.go b/core/services/llo/observation_context_test.go new file mode 100644 index 00000000000..fe626815603 --- /dev/null +++ b/core/services/llo/observation_context_test.go @@ -0,0 +1,358 @@ +package llo + +import ( + "errors" + "fmt" + "io" + "math" + "math/rand/v2" + "net/http" + "net/http/httptest" + "net/url" + "testing" + "time" + + "github.com/shopspring/decimal" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/atomic" + "golang.org/x/sync/errgroup" + + "gopkg.in/guregu/null.v4" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink/v2/core/bridges" + clhttptest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/httptest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + clnull "github.com/smartcontractkit/chainlink/v2/core/null" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/streams" + "github.com/smartcontractkit/chainlink/v2/core/store/models" +) + +func makeErroringPipeline() *mockPipeline { + return &mockPipeline{ + err: errors.New("pipeline error"), + } +} + +func makePipelineWithMultipleStreamResults(streamIDs []streams.StreamID, results []interface{}) *mockPipeline { + if len(streamIDs) != len(results) { + panic("streamIDs and results must have the same length") + } + trrs := make([]pipeline.TaskRunResult, len(streamIDs)) + for i, res := range results { + trrs[i] = pipeline.TaskRunResult{Task: &pipeline.MemoTask{BaseTask: pipeline.BaseTask{StreamID: clnull.Uint32From(streamIDs[i])}}, Result: pipeline.Result{Value: res}} + } + return &mockPipeline{ + run: &pipeline.Run{}, + trrs: trrs, + err: nil, + streamIDs: streamIDs, + } +} + +func TestObservationContext_Observe(t *testing.T) { + ctx := tests.Context(t) + r := &mockRegistry{} + telem := &mockTelemeter{} + oc := newObservationContext(r, telem) + opts := llo.DSOpts(nil) + + missingStreamID := streams.StreamID(0) + streamID1 := streams.StreamID(1) + streamID2 := streams.StreamID(2) + streamID3 := streams.StreamID(3) + streamID4 := streams.StreamID(4) + streamID5 := streams.StreamID(5) + streamID6 := streams.StreamID(6) + + multiPipelineDecimal := makePipelineWithMultipleStreamResults([]streams.StreamID{streamID4, streamID5, streamID6}, []interface{}{decimal.NewFromFloat(12.34), decimal.NewFromFloat(56.78), decimal.NewFromFloat(90.12)}) + + r.pipelines = map[streams.StreamID]*mockPipeline{ + streamID1: &mockPipeline{}, + streamID2: makePipelineWithSingleResult[decimal.Decimal](rand.Int64(), decimal.NewFromFloat(12.34), nil), + streamID3: makeErroringPipeline(), + streamID4: multiPipelineDecimal, + streamID5: multiPipelineDecimal, + streamID6: multiPipelineDecimal, + } + + t.Run("returns error in case of missing pipeline", func(t *testing.T) { + _, err := oc.Observe(ctx, missingStreamID, opts) + require.EqualError(t, err, "no pipeline for stream: 0") + }) + t.Run("returns error in case of zero results", func(t *testing.T) { + _, err := oc.Observe(ctx, streamID1, opts) + require.EqualError(t, err, "invalid number of results, expected: 1 or 3, got: 0") + }) + t.Run("returns composite value from legacy job with single top-level streamID", func(t *testing.T) { + val, err := oc.Observe(ctx, streamID2, opts) + require.NoError(t, err) + + assert.Equal(t, "12.34", val.(*llo.Decimal).String()) + }) + t.Run("returns error in case of erroring pipeline", func(t *testing.T) { + _, err := oc.Observe(ctx, streamID3, opts) + require.EqualError(t, err, "pipeline error") + }) + t.Run("returns values for multiple stream IDs within the same job based on streamID tag with a single pipeline execution", func(t *testing.T) { + val, err := oc.Observe(ctx, streamID4, opts) + require.NoError(t, err) + assert.Equal(t, "12.34", val.(*llo.Decimal).String()) + + val, err = oc.Observe(ctx, streamID5, opts) + require.NoError(t, err) + assert.Equal(t, "56.78", val.(*llo.Decimal).String()) + + val, err = oc.Observe(ctx, streamID6, opts) + require.NoError(t, err) + assert.Equal(t, "90.12", val.(*llo.Decimal).String()) + + assert.Equal(t, 1, multiPipelineDecimal.runCount) + + // returns cached values on subsequent calls + val, err = oc.Observe(ctx, streamID6, opts) + require.NoError(t, err) + assert.Equal(t, "90.12", val.(*llo.Decimal).String()) + + assert.Equal(t, 1, multiPipelineDecimal.runCount) + }) +} + +func TestObservationContext_Observe_concurrencyStressTest(t *testing.T) { + ctx := tests.Context(t) + r := &mockRegistry{} + telem := &mockTelemeter{} + oc := newObservationContext(r, telem) + opts := llo.DSOpts(nil) + + streamID := streams.StreamID(1) + val := decimal.NewFromFloat(123.456) + + // observes the same pipeline 1000 times to try and detect races etc + r.pipelines = make(map[streams.StreamID]*mockPipeline) + r.pipelines[streamID] = makePipelineWithSingleResult[decimal.Decimal](0, val, nil) + g, ctx := errgroup.WithContext(ctx) + for i := 0; i < 1000; i++ { + g.Go(func() error { + _, err := oc.Observe(ctx, streamID, opts) + return err + }) + } + if err := g.Wait(); err != nil { + t.Fatalf("Observation failed: %v", err) + } +} + +type mockPipelineConfig struct{} + +func (m *mockPipelineConfig) DefaultHTTPLimit() int64 { return 10000 } +func (m *mockPipelineConfig) DefaultHTTPTimeout() commonconfig.Duration { + return *commonconfig.MustNewDuration(1 * time.Hour) +} +func (m *mockPipelineConfig) MaxRunDuration() time.Duration { return 1 * time.Hour } +func (m *mockPipelineConfig) ReaperInterval() time.Duration { return 0 } +func (m *mockPipelineConfig) ReaperThreshold() time.Duration { return 0 } + +// func (m *mockPipelineConfig) VerboseLogging() bool { return true } +func (m *mockPipelineConfig) VerboseLogging() bool { return false } + +type mockBridgeConfig struct{} + +func (m *mockBridgeConfig) BridgeResponseURL() *url.URL { + return nil +} +func (m *mockBridgeConfig) BridgeCacheTTL() time.Duration { + return 0 +} + +func createBridge(t testing.TB, name string, val string, borm bridges.ORM, maxCalls int64) { + callcount := atomic.NewInt64(0) + bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + n := callcount.Inc() + if maxCalls > 0 && n > maxCalls { + panic("too many calls to bridge" + name) + } + _, herr := io.ReadAll(req.Body) + if herr != nil { + panic(herr) + } + + res.WriteHeader(http.StatusOK) + resp := fmt.Sprintf(`{"result": %s}`, val) + _, herr = res.Write([]byte(resp)) + if herr != nil { + panic(herr) + } + })) + t.Cleanup(bridge.Close) + u, _ := url.Parse(bridge.URL) + require.NoError(t, borm.CreateBridgeType(tests.Context(t), &bridges.BridgeType{ + Name: bridges.BridgeName(name), + URL: models.WebURL(*u), + })) +} + +func TestObservationContext_Observe_integrationRealPipeline(t *testing.T) { + ctx := tests.Context(t) + lggr := logger.TestLogger(t) + db := pgtest.NewSqlxDB(t) + bridgesORM := bridges.NewORM(db) + + createBridge(t, "foo-bridge", `123.456`, bridgesORM, 1) + createBridge(t, "bar-bridge", `"124.456"`, bridgesORM, 1) + + c := clhttptest.NewTestLocalOnlyHTTPClient() + runner := pipeline.NewRunner( + nil, + bridgesORM, + &mockPipelineConfig{}, + &mockBridgeConfig{}, + nil, + nil, + nil, + lggr, + c, + c, + ) + + r := streams.NewRegistry(lggr, runner) + + jobStreamID := streams.StreamID(5) + + t.Run("using only streamID attributes", func(t *testing.T) { + jb := job.Job{ + Type: job.Stream, + StreamID: &jobStreamID, + PipelineSpec: &pipeline.Spec{ + DotDagSource: ` +// Benchmark Price +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=1 index=0]; // force conversion to decimal + +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=2 index=1]; + +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=3 index=2]; // force conversion to decimal + +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`, + }, + } + err := r.Register(jb, nil) + require.NoError(t, err) + + telem := &mockTelemeter{} + oc := newObservationContext(r, telem) + opts := llo.DSOpts(nil) + + val, err := oc.Observe(ctx, streams.StreamID(1), opts) + require.NoError(t, err) + assert.Equal(t, "900.0022", val.(*llo.Decimal).String()) + val, err = oc.Observe(ctx, streams.StreamID(2), opts) + require.NoError(t, err) + assert.Equal(t, "123.456", val.(*llo.Decimal).String()) + val, err = oc.Observe(ctx, streams.StreamID(3), opts) + require.NoError(t, err) + assert.Equal(t, "124.456", val.(*llo.Decimal).String()) + + val, err = oc.Observe(ctx, jobStreamID, opts) + require.NoError(t, err) + assert.Equal(t, &llo.Quote{ + Bid: decimal.NewFromFloat32(123.456), + Benchmark: decimal.NewFromFloat32(900.0022), + Ask: decimal.NewFromFloat32(124.456), + }, val.(*llo.Quote)) + }) +} + +func BenchmarkObservationContext_Observe_integrationRealPipeline_concurrencyStressTest_manyStreams(b *testing.B) { + ctx := tests.Context(b) + lggr := logger.TestLogger(b) + db := pgtest.NewSqlxDB(b) + bridgesORM := bridges.NewORM(db) + + if b.N > math.MaxInt32 { + b.Fatalf("N is too large: %d", b.N) + } + n := uint32(b.N) //nolint:gosec // G115 // overflow impossible + + createBridge(b, "foo-bridge", `123.456`, bridgesORM, 0) + createBridge(b, "bar-bridge", `"124.456"`, bridgesORM, 0) + + c := clhttptest.NewTestLocalOnlyHTTPClient() + runner := pipeline.NewRunner( + nil, + bridgesORM, + &mockPipelineConfig{}, + &mockBridgeConfig{}, + nil, + nil, + nil, + lggr, + c, + c, + ) + + r := streams.NewRegistry(lggr, runner) + + for i := uint32(0); i < n; i++ { + i := i + jb := job.Job{ + ID: int32(i), //nolint:gosec // G115 // overflow impossible + Name: null.StringFrom(fmt.Sprintf("job-%d", i)), + Type: job.Stream, + StreamID: &i, + PipelineSpec: &pipeline.Spec{ + ID: int32(i * 100), //nolint:gosec // G115 // overflow impossible + DotDagSource: fmt.Sprintf(` +// Benchmark Price +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=%d index=0]; // force conversion to decimal + +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=%d index=1]; + +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=%d index=2]; // force conversion to decimal + +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`, i+n, i+2*n, i+3*n), + }, + } + err := r.Register(jb, nil) + require.NoError(b, err) + } + + telem := &mockTelemeter{} + oc := newObservationContext(r, telem) + opts := llo.DSOpts(nil) + + // concurrency stress test + b.ResetTimer() + g, ctx := errgroup.WithContext(ctx) + for i := uint32(0); i < n; i++ { + for _, strmID := range []uint32{i, i + n, i + 2*n, i + 3*n} { + g.Go(func() error { + // ignore errors, only care about races + oc.Observe(ctx, strmID, opts) //nolint:errcheck // ignore error + return nil + }) + } + } + if err := g.Wait(); err != nil { + b.Fatalf("Observation failed: %v", err) + } +} diff --git a/core/services/pipeline/common.go b/core/services/pipeline/common.go index 50611ee32a4..56af199078a 100644 --- a/core/services/pipeline/common.go +++ b/core/services/pipeline/common.go @@ -61,6 +61,7 @@ type ( TaskMinBackoff() time.Duration TaskMaxBackoff() time.Duration TaskTags() string + TaskStreamID() *uint32 GetDescendantTasks() []Task } diff --git a/core/services/pipeline/runner.go b/core/services/pipeline/runner.go index 2194cb8be46..30c7842914d 100644 --- a/core/services/pipeline/runner.go +++ b/core/services/pipeline/runner.go @@ -377,7 +377,9 @@ func (r *runner) InitializePipeline(spec Spec) (pipeline *Pipeline, err error) { func (r *runner) run(ctx context.Context, pipeline *Pipeline, run *Run, vars Vars) TaskRunResults { l := r.lggr.With("run.ID", run.ID, "executionID", uuid.New(), "specID", run.PipelineSpecID, "jobID", run.PipelineSpec.JobID, "jobName", run.PipelineSpec.JobName) - l.Debug("Initiating tasks for pipeline run of spec") + if r.config.VerboseLogging() { + l.Debug("Initiating tasks for pipeline run of spec") + } scheduler := newScheduler(pipeline, run, vars, l) go scheduler.Run() diff --git a/core/services/pipeline/task.base.go b/core/services/pipeline/task.base.go index 3e1db5fcdb5..fdedb69193e 100644 --- a/core/services/pipeline/task.base.go +++ b/core/services/pipeline/task.base.go @@ -24,6 +24,8 @@ type BaseTask struct { Tags string `mapstructure:"tags" json:"-"` + StreamID null.Uint32 `mapstructure:"streamID"` + uuid uuid.UUID } @@ -84,6 +86,13 @@ func (t BaseTask) TaskTags() string { return t.Tags } +func (t BaseTask) TaskStreamID() *uint32 { + if t.StreamID.Valid { + return &t.StreamID.Uint32 + } + return nil +} + // GetDescendantTasks retrieves all descendant tasks of a given task func (t BaseTask) GetDescendantTasks() []Task { if len(t.outputs) == 0 { diff --git a/core/services/relay/evm/mercury/mocks/pipeline.go b/core/services/relay/evm/mercury/mocks/pipeline.go index a7183c9a037..429eba66674 100644 --- a/core/services/relay/evm/mercury/mocks/pipeline.go +++ b/core/services/relay/evm/mercury/mocks/pipeline.go @@ -41,3 +41,4 @@ func (m *MockTask) TaskTimeout() (time.Duration, bool) { return 0, false } func (m *MockTask) TaskRetries() uint32 { return 0 } func (m *MockTask) TaskMinBackoff() time.Duration { return 0 } func (m *MockTask) TaskMaxBackoff() time.Duration { return 0 } +func (m *MockTask) TaskStreamID() *uint32 { return nil } diff --git a/core/services/streams/delegate.go b/core/services/streams/delegate.go index bf492d4bd15..2f62a7bf1f4 100644 --- a/core/services/streams/delegate.go +++ b/core/services/streams/delegate.go @@ -52,8 +52,7 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, jb job.Job) (services [] rrs := ocrcommon.NewResultRunSaver(d.runner, lggr, d.cfg.MaxSuccessfulRuns(), d.cfg.ResultWriteQueueDepth()) services = append(services, rrs, &StreamService{ d.registry, - id, - jb.PipelineSpec, + jb, lggr, rrs, }) @@ -66,23 +65,22 @@ type ResultRunSaver interface { type StreamService struct { registry Registry - id StreamID - spec *pipeline.Spec + jb job.Job lggr logger.Logger rrs ResultRunSaver } func (s *StreamService) Start(_ context.Context) error { - if s.spec == nil { - return fmt.Errorf("pipeline spec unexpectedly missing for stream %q", s.id) + if s.jb.PipelineSpec == nil { + return errors.New("pipeline spec unexpectedly missing for stream") } - s.lggr.Debugf("Starting stream %d", s.id) - return s.registry.Register(s.id, *s.spec, s.rrs) + s.lggr.Debugw("Registering stream", "jobID", s.jb.ID) + return s.registry.Register(s.jb, s.rrs) } func (s *StreamService) Close() error { - s.lggr.Debugf("Stopping stream %d", s.id) - s.registry.Unregister(s.id) + s.lggr.Debugw("Unregistering stream", "jobID", s.jb.ID) + s.registry.Unregister(s.jb.ID) return nil } @@ -101,8 +99,23 @@ func ValidatedStreamSpec(tomlString string) (job.Job, error) { return jb, errors.Errorf("unsupported type: %q", jb.Type) } - if jb.StreamID == nil { - return jb, errors.New("jobs of type 'stream' require streamID to be specified") + // The spec stream ID is optional, but if provided represents the final output of the pipeline run. + // nodes in the DAG may also contain streamID tags. + // Every spec must have at least one streamID. + var streamIDs []StreamID + + if jb.StreamID != nil { + streamIDs = append(streamIDs, *jb.StreamID) + } + + for _, t := range jb.Pipeline.Tasks { + if streamID := t.TaskStreamID(); streamID != nil { + streamIDs = append(streamIDs, *streamID) + } + } + + if len(streamIDs) == 0 { + return jb, errors.New("no streamID found in spec (must be either specified as top-level key 'streamID' or at least one streamID tag must be provided in the pipeline)") } return jb, nil diff --git a/core/services/streams/delegate_test.go b/core/services/streams/delegate_test.go index d177c977e1b..dfd3da8ca07 100644 --- a/core/services/streams/delegate_test.go +++ b/core/services/streams/delegate_test.go @@ -15,11 +15,11 @@ import ( type mockRegistry struct{} -func (m *mockRegistry) Get(streamID StreamID) (strm Stream, exists bool) { return } -func (m *mockRegistry) Register(streamID StreamID, spec pipeline.Spec, rrs ResultRunSaver) error { +func (m *mockRegistry) Get(streamID StreamID) (p Pipeline, exists bool) { return } +func (m *mockRegistry) Register(jb job.Job, rrs ResultRunSaver) error { return nil } -func (m *mockRegistry) Unregister(streamID StreamID) {} +func (m *mockRegistry) Unregister(int32) {} type mockDelegateConfig struct{} @@ -49,8 +49,7 @@ func Test_Delegate(t *testing.T) { strmSrv := srvs[1].(*StreamService) assert.Equal(t, registry, strmSrv.registry) - assert.Equal(t, StreamID(42), strmSrv.id) - assert.Equal(t, jb.PipelineSpec, strmSrv.spec) + assert.Equal(t, jb, strmSrv.jb) assert.NotNil(t, strmSrv.lggr) assert.Equal(t, srvs[0], strmSrv.rrs) }) @@ -168,7 +167,7 @@ answer1 [type=median index=0]; """ `, assertion: func(t *testing.T, jb job.Job, err error) { - assert.EqualError(t, err, "jobs of type 'stream' require streamID to be specified") + assert.EqualError(t, err, "no streamID found in spec (must be either specified as top-level key 'streamID' or at least one streamID tag must be provided in the pipeline)") }, }, } diff --git a/core/services/streams/pipeline.go b/core/services/streams/pipeline.go new file mode 100644 index 00000000000..de52fed26e5 --- /dev/null +++ b/core/services/streams/pipeline.go @@ -0,0 +1,131 @@ +package streams + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" +) + +type Runner interface { + ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) + InitializePipeline(spec pipeline.Spec) (*pipeline.Pipeline, error) +} + +type RunResultSaver interface { + Save(run *pipeline.Run) +} + +type Pipeline interface { + Run(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) + StreamIDs() []StreamID +} + +type multiStreamPipeline struct { + lggr logger.Logger + spec pipeline.Spec + runner Runner + rrs RunResultSaver + streamIDs []StreamID + vars pipeline.Vars +} + +func NewMultiStreamPipeline(lggr logger.Logger, jb job.Job, runner Runner, rrs RunResultSaver) (Pipeline, error) { + return newMultiStreamPipeline(lggr, jb, runner, rrs) +} + +func newMultiStreamPipeline(lggr logger.Logger, jb job.Job, runner Runner, rrs RunResultSaver) (*multiStreamPipeline, error) { + if jb.PipelineSpec == nil { + // should never happen + return nil, errors.New("job has no pipeline spec") + } + spec := *jb.PipelineSpec + spec.JobID = jb.ID + spec.JobName = jb.Name.ValueOrZero() + spec.JobType = string(jb.Type) + if spec.Pipeline == nil { + pipeline, err := spec.ParsePipeline() + if err != nil { + return nil, fmt.Errorf("unparseable pipeline: %w", err) + } + + spec.Pipeline = pipeline + // initialize it for the given runner + if _, err := runner.InitializePipeline(spec); err != nil { + return nil, fmt.Errorf("error while initializing pipeline: %w", err) + } + } + var streamIDs []StreamID + for _, t := range spec.Pipeline.Tasks { + if t.TaskStreamID() != nil { + streamIDs = append(streamIDs, *t.TaskStreamID()) + } + } + if jb.StreamID != nil { + streamIDs = append(streamIDs, *jb.StreamID) + } + if err := validateStreamIDs(streamIDs); err != nil { + return nil, fmt.Errorf("invalid stream IDs: %w", err) + } + vars := pipeline.NewVarsFrom(map[string]interface{}{ + "pipelineSpec": map[string]interface{}{ + "id": jb.PipelineSpecID, + }, + "jb": map[string]interface{}{ + "databaseID": jb.ID, + "externalJobID": jb.ExternalJobID, + "name": jb.Name.ValueOrZero(), + }, + }) + + return &multiStreamPipeline{ + lggr.Named("MultiStreamPipeline").With("spec.ID", spec.ID, "jobID", spec.JobID, "jobName", spec.JobName, "jobType", spec.JobType), + spec, + runner, + rrs, + streamIDs, + vars}, nil +} + +func validateStreamIDs(streamIDs []StreamID) error { + seen := make(map[StreamID]struct{}) + for _, id := range streamIDs { + if _, ok := seen[id]; ok { + return fmt.Errorf("duplicate stream ID: %v", id) + } + seen[id] = struct{}{} + } + return nil +} + +func (s *multiStreamPipeline) Run(ctx context.Context) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) { + run, trrs, err = s.executeRun(ctx) + + if err != nil { + return nil, nil, fmt.Errorf("Run failed: %w", err) + } + if s.rrs != nil { + s.rrs.Save(run) + } + + return +} + +func (s *multiStreamPipeline) StreamIDs() []StreamID { + return s.streamIDs +} + +// The context passed in here has a timeout of (ObservationTimeout + ObservationGracePeriod). +// Upon context cancellation, its expected that we return any usable values within ObservationGracePeriod. +func (s *multiStreamPipeline) executeRun(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { + run, trrs, err := s.runner.ExecuteRun(ctx, s.spec, s.vars) + if err != nil { + return nil, nil, fmt.Errorf("error executing run for spec ID %v: %w", s.spec.ID, err) + } + + return run, trrs, err +} diff --git a/core/services/streams/stream.go b/core/services/streams/stream.go deleted file mode 100644 index b65c6dc12f6..00000000000 --- a/core/services/streams/stream.go +++ /dev/null @@ -1,94 +0,0 @@ -package streams - -import ( - "context" - "fmt" - "sync" - - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" -) - -type Runner interface { - ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) - InitializePipeline(spec pipeline.Spec) (*pipeline.Pipeline, error) -} - -type RunResultSaver interface { - Save(run *pipeline.Run) -} - -type Stream interface { - Run(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) -} - -type stream struct { - sync.RWMutex - id StreamID - lggr logger.Logger - spec *pipeline.Spec - runner Runner - rrs RunResultSaver -} - -func NewStream(lggr logger.Logger, id StreamID, spec pipeline.Spec, runner Runner, rrs RunResultSaver) Stream { - return newStream(lggr, id, spec, runner, rrs) -} - -func newStream(lggr logger.Logger, id StreamID, spec pipeline.Spec, runner Runner, rrs RunResultSaver) *stream { - return &stream{sync.RWMutex{}, id, lggr.Named("Stream").With("streamID", id), &spec, runner, rrs} -} - -func (s *stream) Run(ctx context.Context) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) { - run, trrs, err = s.executeRun(ctx) - - if err != nil { - return nil, nil, fmt.Errorf("Run failed: %w", err) - } - if s.rrs != nil { - s.rrs.Save(run) - } - - return -} - -// The context passed in here has a timeout of (ObservationTimeout + ObservationGracePeriod). -// Upon context cancellation, its expected that we return any usable values within ObservationGracePeriod. -func (s *stream) executeRun(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { - // the hot path here is to avoid parsing and use the pre-parsed, cached, pipeline - s.RLock() - initialize := s.spec.Pipeline == nil - s.RUnlock() - if initialize { - pipeline, err := s.spec.ParsePipeline() - if err != nil { - return nil, nil, fmt.Errorf("Run failed due to unparseable pipeline: %w", err) - } - - s.Lock() - if s.spec.Pipeline == nil { - s.spec.Pipeline = pipeline - // initialize it for the given runner - if _, err := s.runner.InitializePipeline(*s.spec); err != nil { - return nil, nil, fmt.Errorf("Run failed due to error while initializing pipeline: %w", err) - } - } - s.Unlock() - } - - vars := pipeline.NewVarsFrom(map[string]interface{}{ - "pipelineSpec": map[string]interface{}{ - "id": s.spec.ID, - }, - "stream": map[string]interface{}{ - "id": s.id, - }, - }) - - run, trrs, err := s.runner.ExecuteRun(ctx, *s.spec, vars) - if err != nil { - return nil, nil, fmt.Errorf("error executing run for spec ID %v: %w", s.spec.ID, err) - } - - return run, trrs, err -} diff --git a/core/services/streams/stream_registry.go b/core/services/streams/stream_registry.go index 9ab2df11d33..cf5a59944b7 100644 --- a/core/services/streams/stream_registry.go +++ b/core/services/streams/stream_registry.go @@ -7,7 +7,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/job" ) // alias for easier refactoring @@ -15,19 +15,22 @@ type StreamID = llo.StreamID type Registry interface { Getter - Register(streamID StreamID, spec pipeline.Spec, rrs ResultRunSaver) error - Unregister(streamID StreamID) + Register(jb job.Job, rrs ResultRunSaver) error + Unregister(jobID int32) } type Getter interface { - Get(streamID StreamID) (strm Stream, exists bool) + Get(streamID StreamID) (p Pipeline, exists bool) } type streamRegistry struct { sync.RWMutex - lggr logger.Logger - runner Runner - streams map[StreamID]Stream + lggr logger.Logger + runner Runner + // keyed by stream ID + pipelines map[StreamID]Pipeline + // keyed by job ID + pipelinesByJobID map[int32]Pipeline } func NewRegistry(lggr logger.Logger, runner Runner) Registry { @@ -39,29 +42,53 @@ func newRegistry(lggr logger.Logger, runner Runner) *streamRegistry { sync.RWMutex{}, lggr.Named("Registry"), runner, - make(map[StreamID]Stream), + make(map[StreamID]Pipeline), + make(map[int32]Pipeline), } } -func (s *streamRegistry) Get(streamID StreamID) (strm Stream, exists bool) { +func (s *streamRegistry) Get(streamID StreamID) (p Pipeline, exists bool) { s.RLock() defer s.RUnlock() - strm, exists = s.streams[streamID] + p, exists = s.pipelines[streamID] return } -func (s *streamRegistry) Register(streamID StreamID, spec pipeline.Spec, rrs ResultRunSaver) error { +func (s *streamRegistry) Register(jb job.Job, rrs ResultRunSaver) error { + if jb.Type != job.Stream { + return fmt.Errorf("cannot register job type %s; only Stream jobs are supported", jb.Type) + } + p, err := NewMultiStreamPipeline(s.lggr, jb, s.runner, rrs) + if err != nil { + return fmt.Errorf("cannot register job with ID: %d; %w", jb.ID, err) + } s.Lock() defer s.Unlock() - if _, exists := s.streams[streamID]; exists { - return fmt.Errorf("stream already registered for id: %d", streamID) + if _, exists := s.pipelinesByJobID[jb.ID]; exists { + return fmt.Errorf("cannot register job with ID: %d; it is already registered", jb.ID) + } + for _, strmID := range p.StreamIDs() { + if _, exists := s.pipelines[strmID]; exists { + return fmt.Errorf("cannot register job with ID: %d; stream id %d is already registered", jb.ID, strmID) + } + } + s.pipelinesByJobID[jb.ID] = p + streamIDs := p.StreamIDs() + for _, strmID := range streamIDs { + s.pipelines[strmID] = p } - s.streams[streamID] = NewStream(s.lggr, streamID, spec, s.runner, rrs) return nil } -func (s *streamRegistry) Unregister(streamID StreamID) { +func (s *streamRegistry) Unregister(jobID int32) { s.Lock() defer s.Unlock() - delete(s.streams, streamID) + p, exists := s.pipelinesByJobID[jobID] + if !exists { + return + } + streamIDs := p.StreamIDs() + for _, id := range streamIDs { + delete(s.pipelines, id) + } } diff --git a/core/services/streams/stream_registry_test.go b/core/services/streams/stream_registry_test.go index 738b68f5d4d..e20b29e9262 100644 --- a/core/services/streams/stream_registry_test.go +++ b/core/services/streams/stream_registry_test.go @@ -5,22 +5,31 @@ import ( "testing" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -type mockStream struct { +var _ Pipeline = &mockPipeline{} + +type mockPipeline struct { run *pipeline.Run trrs pipeline.TaskRunResults err error + + streamIDs []StreamID } -func (m *mockStream) Run(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { +func (m *mockPipeline) Run(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { return m.run, m.trrs, m.err } +func (m *mockPipeline) StreamIDs() []StreamID { + return m.streamIDs +} + func Test_Registry(t *testing.T) { lggr := logger.TestLogger(t) runner := &mockRunner{} @@ -28,21 +37,21 @@ func Test_Registry(t *testing.T) { t.Run("Get", func(t *testing.T) { sr := newRegistry(lggr, runner) - sr.streams[1] = &mockStream{run: &pipeline.Run{ID: 1}} - sr.streams[2] = &mockStream{run: &pipeline.Run{ID: 2}} - sr.streams[3] = &mockStream{run: &pipeline.Run{ID: 3}} + sr.pipelines[1] = &mockPipeline{run: &pipeline.Run{ID: 1}} + sr.pipelines[2] = &mockPipeline{run: &pipeline.Run{ID: 2}} + sr.pipelines[3] = &mockPipeline{run: &pipeline.Run{ID: 3}} v, exists := sr.Get(1) assert.True(t, exists) - assert.Equal(t, sr.streams[1], v) + assert.Equal(t, sr.pipelines[1], v) v, exists = sr.Get(2) assert.True(t, exists) - assert.Equal(t, sr.streams[2], v) + assert.Equal(t, sr.pipelines[2], v) v, exists = sr.Get(3) assert.True(t, exists) - assert.Equal(t, sr.streams[3], v) + assert.Equal(t, sr.pipelines[3], v) v, exists = sr.Get(4) assert.Nil(t, v) @@ -51,56 +60,159 @@ func Test_Registry(t *testing.T) { t.Run("Register", func(t *testing.T) { sr := newRegistry(lggr, runner) - t.Run("registers new stream", func(t *testing.T) { - assert.Len(t, sr.streams, 0) - err := sr.Register(1, pipeline.Spec{ID: 32, DotDagSource: "source"}, nil) - require.NoError(t, err) - assert.Len(t, sr.streams, 1) - - v, exists := sr.Get(1) - require.True(t, exists) - strm := v.(*stream) - assert.Equal(t, StreamID(1), strm.id) - assert.Equal(t, int32(32), strm.spec.ID) - }) + // registers new pipeline with multiple stream IDs + assert.Empty(t, sr.pipelines) + // err := sr.Register(job.Job{PipelineSpec: &pipeline.Spec{ID: 32, DotDagSource: "source"}}, nil) + // TODO: what if the dag is unparseable? + // err := sr.Register(1, pipeline.Spec{ID: 32, DotDagSource: "source"}, nil) + err := sr.Register(job.Job{ID: 100, Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 32, DotDagSource: ` +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=1 index=0]; // force conversion to decimal +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=2 index=1]; +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=3 index=2]; // force conversion to decimal +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`}}, nil) + require.NoError(t, err) + assert.Len(t, sr.pipelines, 3) // three streams, one pipeline + assert.Contains(t, sr.pipelines, StreamID(1)) + assert.Contains(t, sr.pipelines, StreamID(2)) + assert.Contains(t, sr.pipelines, StreamID(3)) + p := sr.pipelines[1] + assert.Equal(t, p, sr.pipelines[2]) + assert.Equal(t, p, sr.pipelines[3]) - t.Run("errors when attempt to re-register a stream with an existing ID", func(t *testing.T) { - assert.Len(t, sr.streams, 1) - err := sr.Register(1, pipeline.Spec{ID: 33, DotDagSource: "source"}, nil) - require.Error(t, err) - assert.Len(t, sr.streams, 1) - assert.EqualError(t, err, "stream already registered for id: 1") - - v, exists := sr.Get(1) - require.True(t, exists) - strm := v.(*stream) - assert.Equal(t, StreamID(1), strm.id) - assert.Equal(t, int32(32), strm.spec.ID) - }) + v, exists := sr.Get(1) + require.True(t, exists) + msp := v.(*multiStreamPipeline) + assert.Equal(t, []StreamID{1, 2, 3}, msp.StreamIDs()) + assert.Equal(t, int32(32), msp.spec.ID) + + // errors when attempt to re-register a stream with an existing job ID + err = sr.Register(job.Job{ID: 100, Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022"]; + `}}, nil) + require.EqualError(t, err, "cannot register job with ID: 100; it is already registered") + + // errors when attempt to register a new job with duplicates stream IDs within ig + err = sr.Register(job.Job{ID: 101, StreamID: ptr(StreamID(100)), Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022" streamID=100]; + `}}, nil) + require.EqualError(t, err, "cannot register job with ID: 101; invalid stream IDs: duplicate stream ID: 100") + + // errors with unparseable pipeline + err = sr.Register(job.Job{ID: 101, Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: "source"}}, nil) + require.Error(t, err) + require.EqualError(t, err, "cannot register job with ID: 101; unparseable pipeline: UnmarshalTaskFromMap: unknown task type: \"\"") + + // errors when attempt to re-register a stream with an existing streamID at top-level + err = sr.Register(job.Job{ID: 101, StreamID: ptr(StreamID(3)), Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=4 index=0]; // force conversion to decimal +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=5 index=1]; +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=6 index=2]; // force conversion to decimal +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`}}, nil) + require.Error(t, err) + require.EqualError(t, err, "cannot register job with ID: 101; stream id 3 is already registered") + + // errors when attempt to re-register a stream with an existing streamID in DAG + err = sr.Register(job.Job{ID: 101, StreamID: ptr(StreamID(4)), Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=1 index=0]; // force conversion to decimal +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=5 index=1]; +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=6 index=2]; // force conversion to decimal +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`}}, nil) + require.Error(t, err) + require.EqualError(t, err, "cannot register job with ID: 101; stream id 1 is already registered") + + // registers new job with all new stream IDs + err = sr.Register(job.Job{ID: 101, StreamID: ptr(StreamID(4)), Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022"]; +multiply2 [type=multiply times=1 streamID=5 index=0]; // force conversion to decimal +result2 [type=bridge name="foo-bridge" requestData="{\"data\":{\"data\":\"foo\"}}"]; +result2_parse [type=jsonparse path="result" streamID=6 index=1]; +result3 [type=bridge name="bar-bridge" requestData="{\"data\":{\"data\":\"bar\"}}"]; +result3_parse [type=jsonparse path="result"]; +multiply3 [type=multiply times=1 streamID=7 index=2]; // force conversion to decimal +result1 -> multiply2; +result2 -> result2_parse; +result3 -> result3_parse -> multiply3; +`}}, nil) + require.NoError(t, err) + + // did not overwrite existing stream + assert.Len(t, sr.pipelines, 7) + assert.Equal(t, p, sr.pipelines[1]) + assert.Equal(t, p, sr.pipelines[2]) + assert.Equal(t, p, sr.pipelines[3]) + p2 := sr.pipelines[4] + assert.NotEqual(t, p, p2) + assert.Equal(t, p2, sr.pipelines[5]) + assert.Equal(t, p2, sr.pipelines[6]) + assert.Equal(t, p2, sr.pipelines[7]) + + v, exists = sr.Get(1) + require.True(t, exists) + msp = v.(*multiStreamPipeline) + assert.ElementsMatch(t, []StreamID{1, 2, 3}, msp.StreamIDs()) + assert.Equal(t, int32(32), msp.spec.ID) + + v, exists = sr.Get(4) + require.True(t, exists) + msp = v.(*multiStreamPipeline) + assert.ElementsMatch(t, []StreamID{4, 5, 6, 7}, msp.StreamIDs()) + assert.Equal(t, int32(33), msp.spec.ID) }) t.Run("Unregister", func(t *testing.T) { sr := newRegistry(lggr, runner) - sr.streams[1] = &mockStream{run: &pipeline.Run{ID: 1}} - sr.streams[2] = &mockStream{run: &pipeline.Run{ID: 2}} - sr.streams[3] = &mockStream{run: &pipeline.Run{ID: 3}} + err := sr.Register(job.Job{ID: 100, StreamID: ptr(StreamID(1)), Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022" streamID=2]; + `}}, nil) + require.NoError(t, err) + err = sr.Register(job.Job{ID: 101, Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022" streamID=3]; + `}}, nil) + require.NoError(t, err) + err = sr.Register(job.Job{ID: 102, Type: job.Stream, PipelineSpec: &pipeline.Spec{ID: 33, DotDagSource: ` +result1 [type=memo value="900.0022" streamID=4]; + `}}, nil) + require.NoError(t, err) t.Run("unregisters a stream", func(t *testing.T) { - assert.Len(t, sr.streams, 3) + assert.Len(t, sr.pipelines, 4) - sr.Unregister(1) + sr.Unregister(100) - assert.Len(t, sr.streams, 2) - _, exists := sr.streams[1] + assert.Len(t, sr.pipelines, 2) + _, exists := sr.pipelines[1] + assert.False(t, exists) + _, exists = sr.pipelines[2] assert.False(t, exists) }) t.Run("no effect when unregistering a non-existent stream", func(t *testing.T) { - assert.Len(t, sr.streams, 2) + assert.Len(t, sr.pipelines, 2) sr.Unregister(1) - assert.Len(t, sr.streams, 2) - _, exists := sr.streams[1] + assert.Len(t, sr.pipelines, 2) + _, exists := sr.pipelines[1] assert.False(t, exists) }) }) diff --git a/core/services/streams/stream_test.go b/core/services/streams/stream_test.go index 78174138121..905d421bddf 100644 --- a/core/services/streams/stream_test.go +++ b/core/services/streams/stream_test.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) @@ -57,24 +58,22 @@ func (m *MockTask) TaskMaxBackoff() time.Duration { return 0 } func Test_Stream(t *testing.T) { lggr := logger.TestLogger(t) runner := &mockRunner{} - spec := pipeline.Spec{} - id := StreamID(123) ctx := testutils.Context(t) - t.Run("Run", func(t *testing.T) { - strm := newStream(lggr, id, spec, runner, nil) - - t.Run("errors with empty pipeline", func(t *testing.T) { - _, _, err := strm.Run(ctx) - assert.EqualError(t, err, "Run failed: Run failed due to unparseable pipeline: empty pipeline") - }) + t.Run("errors with empty pipeline", func(t *testing.T) { + jbInvalid := job.Job{StreamID: ptr(StreamID(123)), PipelineSpec: &pipeline.Spec{DotDagSource: ``}} + _, err := newMultiStreamPipeline(lggr, jbInvalid, runner, nil) + require.EqualError(t, err, "unparseable pipeline: empty pipeline") + }) - spec.DotDagSource = ` -succeed [type=memo value=42] + jb := job.Job{StreamID: ptr(StreamID(123)), PipelineSpec: &pipeline.Spec{DotDagSource: ` +succeed [type=memo value=42 streamID=124]; succeed; -` + `}} - strm = newStream(lggr, id, spec, runner, nil) + t.Run("Run", func(t *testing.T) { + strm, err := newMultiStreamPipeline(lggr, jb, runner, nil) + require.NoError(t, err) t.Run("executes the pipeline (success)", func(t *testing.T) { runner.run = &pipeline.Run{ID: 42} diff --git a/go.mod b/go.mod index 85baf8f3812..0fb1fc579e9 100644 --- a/go.mod +++ b/go.mod @@ -109,6 +109,7 @@ require ( go.opentelemetry.io/otel/metric v1.31.0 go.opentelemetry.io/otel/sdk/metric v1.31.0 go.opentelemetry.io/otel/trace v1.31.0 + go.uber.org/atomic v1.11.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.31.0 From 401842030a451589cdab61062dda1e2530b0530b Mon Sep 17 00:00:00 2001 From: Austin <107539019+0xAustinWang@users.noreply.github.com> Date: Thu, 9 Jan 2025 23:51:41 +0800 Subject: [PATCH 23/91] add chains to ccip in crib setup (#15862) * support the chains in crib setup * use fchain of 1 * actually add the changesets, apply them * apply changeset within the whole system * go imports --- deployment/environment/crib/ccip_deployer.go | 44 ++++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/deployment/environment/crib/ccip_deployer.go b/deployment/environment/crib/ccip_deployer.go index bb3acec8aa4..639e42b4024 100644 --- a/deployment/environment/crib/ccip_deployer.go +++ b/deployment/environment/crib/ccip_deployer.go @@ -7,22 +7,23 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/config" + "github.com/smartcontractkit/chainlink-ccip/chainconfig" + cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/devenv" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" - "github.com/smartcontractkit/chainlink/v2/core/services/relay" - - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" ) -// DeployHomeChainContracts deploys the home chain contracts so that the chainlink nodes can be started with the CR address in Capabilities.ExternalRegistry -// DeployHomeChainContracts is to 1. Set up crib with chains and chainlink nodes ( cap reg is not known yet so not setting the config with capreg address) -// Call DeployHomeChain changeset with nodeinfo ( the peer id and all) +// DeployHomeChainContracts deploys the home chain contracts so that the chainlink nodes can use the CR address in Capabilities.ExternalRegistry +// Afterwards, we call DeployHomeChain changeset with nodeinfo ( the peer id and all) func DeployHomeChainContracts(ctx context.Context, lggr logger.Logger, envConfig devenv.EnvironmentConfig, homeChainSel uint64, feedChainSel uint64) (deployment.CapabilityRegistryConfig, deployment.AddressBook, error) { e, _, err := devenv.NewEnvironment(func() context.Context { return ctx }, lggr, envConfig) if err != nil { @@ -68,6 +69,7 @@ func DeployHomeChainContracts(ctx context.Context, lggr logger.Logger, envConfig return capRegConfig, e.ExistingAddresses, nil } +// DeployCCIPAndAddLanes is the actual ccip setup once the nodes are initialized. func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig devenv.EnvironmentConfig, homeChainSel, feedChainSel uint64, ab deployment.AddressBook) (DeployCCIPOutput, error) { e, _, err := devenv.NewEnvironment(func() context.Context { return ctx }, lggr, envConfig) if err != nil { @@ -93,9 +95,33 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de }) } - // This will not apply any proposals because we pass nil to testing. - // However, setup is ok because we only need to deploy the contracts and distribute job specs + // set up chains + chainConfigs := make(map[uint64]changeset.ChainConfig) + nodeInfo, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + if err != nil { + return DeployCCIPOutput{}, fmt.Errorf("failed to get node info from env: %w", err) + } + for _, chain := range chainSelectors { + chainConfigs[chain] = changeset.ChainConfig{ + Readers: nodeInfo.NonBootstraps().PeerIDs(), + FChain: 1, + EncodableChainConfig: chainconfig.ChainConfig{ + GasPriceDeviationPPB: cciptypes.BigInt{Int: big.NewInt(1000)}, + DAGasPriceDeviationPPB: cciptypes.BigInt{Int: big.NewInt(1_000_000)}, + OptimisticConfirmations: 1, + }, + } + } + + // Setup because we only need to deploy the contracts and distribute job specs *e, err = commonchangeset.ApplyChangesets(nil, *e, nil, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfig), + Config: changeset.UpdateChainConfigConfig{ + HomeChainSelector: homeChainSel, + RemoteChainAdds: chainConfigs, + }, + }, { Changeset: commonchangeset.WrapChangeSet(commonchangeset.DeployLinkToken), Config: chainSelectors, From f2da1e158c1aee3180f906cdd937ef50d0e7aaa6 Mon Sep 17 00:00:00 2001 From: Yashvardhan Nevatia Date: Thu, 9 Jan 2025 16:02:50 +0000 Subject: [PATCH 24/91] Solana link deploy (B) (#15845) * Adding solchains in NewEnv * Revert "Adding solchains in NewEnv" This reverts commit aaab52e01412ea4f1de4f748cadf0c127682418c. * adding sol chains to newenv * newEnv needs to send nil * adding test env setup * adding link token deployment and test * adding nil for crib sol chains * using switch case * Adding decimal const * adding chain selectors commit * go mod tidy * linting * chain sel update * update core/scripts go files * again * add changeset * go imports * go mod * go mod * go mod tidy * linting --------- Co-authored-by: Terry Tata --- .../common/changeset/deploy_link_token.go | 76 +++++++++++++++++-- .../changeset/deploy_link_token_test.go | 12 ++- deployment/common/changeset/test_helpers.go | 1 + deployment/environment/memory/chain.go | 4 +- 4 files changed, 81 insertions(+), 12 deletions(-) diff --git a/deployment/common/changeset/deploy_link_token.go b/deployment/common/changeset/deploy_link_token.go index 0c648939c9f..607c33fbeaa 100644 --- a/deployment/common/changeset/deploy_link_token.go +++ b/deployment/common/changeset/deploy_link_token.go @@ -1,10 +1,17 @@ package changeset import ( - "errors" + "context" + "fmt" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/gagliardetto/solana-go" + solRpc "github.com/gagliardetto/solana-go/rpc" + chainsel "github.com/smartcontractkit/chain-selectors" + + solCommomUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" + solTokenUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/link_token" @@ -12,27 +19,48 @@ import ( var _ deployment.ChangeSet[[]uint64] = DeployLinkToken +const ( + TokenDecimalsSolana = 9 +) + // DeployLinkToken deploys a link token contract to the chain identified by the ChainSelector. func DeployLinkToken(e deployment.Environment, chains []uint64) (deployment.ChangesetOutput, error) { for _, chain := range chains { - _, ok := e.Chains[chain] - if !ok { - return deployment.ChangesetOutput{}, errors.New("chain not found in environment") + _, evmOk := e.Chains[chain] + _, solOk := e.SolChains[chain] + if !evmOk && !solOk { + return deployment.ChangesetOutput{}, fmt.Errorf("chain %d not found in environment", chain) } } newAddresses := deployment.NewMemoryAddressBook() for _, chain := range chains { - _, err := deployLinkTokenContract( - e.Logger, e.Chains[chain], newAddresses, - ) + family, err := chainsel.GetSelectorFamily(chain) if err != nil { return deployment.ChangesetOutput{AddressBook: newAddresses}, err } + switch family { + case chainsel.FamilyEVM: + // Deploy EVM LINK token + _, err := deployLinkTokenContractEVM( + e.Logger, e.Chains[chain], newAddresses, + ) + if err != nil { + return deployment.ChangesetOutput{AddressBook: newAddresses}, err + } + case chainsel.FamilySolana: + // Deploy Solana LINK token + err := deployLinkTokenContractSolana( + e.Logger, e.SolChains[chain], newAddresses, + ) + if err != nil { + return deployment.ChangesetOutput{AddressBook: newAddresses}, err + } + } } return deployment.ChangesetOutput{AddressBook: newAddresses}, nil } -func deployLinkTokenContract( +func deployLinkTokenContractEVM( lggr logger.Logger, chain deployment.Chain, ab deployment.AddressBook, @@ -57,3 +85,35 @@ func deployLinkTokenContract( } return linkToken, nil } + +func deployLinkTokenContractSolana( + lggr logger.Logger, + chain deployment.SolChain, + ab deployment.AddressBook, +) error { + adminPublicKey := chain.DeployerKey.PublicKey() + mint, _ := solana.NewRandomPrivateKey() + // this is the token address + mintPublicKey := mint.PublicKey() + instructions, err := solTokenUtil.CreateToken( + context.Background(), solana.Token2022ProgramID, mintPublicKey, adminPublicKey, TokenDecimalsSolana, chain.Client, solRpc.CommitmentConfirmed, + ) + if err != nil { + lggr.Errorw("Failed to generate instructions for link token deployment", "chain", chain.String(), "err", err) + return err + } + err = chain.Confirm(instructions, solCommomUtil.AddSigners(mint)) + if err != nil { + lggr.Errorw("Failed to confirm instructions for link token deployment", "chain", chain.String(), "err", err) + return err + } + tv := deployment.NewTypeAndVersion(types.LinkToken, deployment.Version1_0_0) + lggr.Infow("Deployed contract", "Contract", tv.String(), "addr", mintPublicKey.String(), "chain", chain.String()) + err = ab.Save(chain.Selector, mintPublicKey.String(), tv) + if err != nil { + lggr.Errorw("Failed to save link token", "chain", chain.String(), "err", err) + return err + } + + return nil +} diff --git a/deployment/common/changeset/deploy_link_token_test.go b/deployment/common/changeset/deploy_link_token_test.go index bc472d2a247..ddaca52c2d5 100644 --- a/deployment/common/changeset/deploy_link_token_test.go +++ b/deployment/common/changeset/deploy_link_token_test.go @@ -15,13 +15,15 @@ func TestDeployLinkToken(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) e := memory.NewMemoryEnvironment(t, lggr, zapcore.InfoLevel, memory.MemoryEnvironmentConfig{ - Chains: 1, + Chains: 1, + SolChains: 1, }) chain1 := e.AllChainSelectors()[0] + solChain1 := e.AllChainSelectorsSolana()[0] e, err := changeset.ApplyChangesets(t, e, nil, []changeset.ChangesetApplication{ { Changeset: changeset.WrapChangeSet(changeset.DeployLinkToken), - Config: []uint64{chain1}, + Config: []uint64{chain1, solChain1}, }, }) require.NoError(t, err) @@ -32,4 +34,10 @@ func TestDeployLinkToken(t *testing.T) { // View itself already unit tested _, err = state.GenerateLinkView() require.NoError(t, err) + + // solana test + addrs, err = e.ExistingAddresses.AddressesForChain(solChain1) + require.NoError(t, err) + require.NotEmpty(t, addrs) + } diff --git a/deployment/common/changeset/test_helpers.go b/deployment/common/changeset/test_helpers.go index 5d524e542ad..a8105b26561 100644 --- a/deployment/common/changeset/test_helpers.go +++ b/deployment/common/changeset/test_helpers.go @@ -90,6 +90,7 @@ func ApplyChangesets(t *testing.T, e deployment.Environment, timelockContractsPe Logger: e.Logger, ExistingAddresses: addresses, Chains: e.Chains, + SolChains: e.SolChains, NodeIDs: e.NodeIDs, Offchain: e.Offchain, OCRSecrets: e.OCRSecrets, diff --git a/deployment/environment/memory/chain.go b/deployment/environment/memory/chain.go index cc22b40d844..193def7ba08 100644 --- a/deployment/environment/memory/chain.go +++ b/deployment/environment/memory/chain.go @@ -73,16 +73,16 @@ func getTestSolanaChainSelectors() []uint64 { } func GenerateChainsSol(t *testing.T, numChains int) map[uint64]SolanaChain { - chains := make(map[uint64]SolanaChain) testSolanaChainSelectors := getTestSolanaChainSelectors() if len(testSolanaChainSelectors) < numChains { t.Fatalf("not enough test solana chain selectors available") } - + chains := make(map[uint64]SolanaChain) for i := 0; i < numChains; i++ { chainID := testSolanaChainSelectors[i] url, _ := solTestUtil.SetupLocalSolNodeWithFlags(t) admin, gerr := solana.NewRandomPrivateKey() + solTestUtil.FundTestAccounts(t, []solana.PublicKey{admin.PublicKey()}, url) require.NoError(t, gerr) chains[chainID] = SolanaChain{ Client: solRpc.New(url), From 8c65527c82a20c74b2a4707221ef496802b21804 Mon Sep 17 00:00:00 2001 From: Josh Weintraub <26035072+jhweintraub@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:10:05 -0500 Subject: [PATCH 25/91] CCIP-4058 replace f with fObserve and fSign in RMHome and RMNRemote (#15605) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace f with fObserve in RMHome and RMNRemote * Update gethwrappers * rename fObserve to fSign * fix off-chain components of renaming RMN parameters * core changeset * update missing file for new parameter name * fix wrappers * fix merge conflict broken text * Update gethwrappers * attempt fix json export tag * Update gethwrappers * upgrade cl-ccip and fix test * upgrade cl-ccip@main * upgrade cl-ccip@main * fix test * upgrade cl-ccip@main * Update gethwrappers * upgrade chainlink ccip * DEVSVCS-1087: remove unused automation hardhat tests (#15847) * remove unused automation hardhat tests * freeze contracts * remove more tests * update * CCIP Config backported from CCIP repo (#15856) * Moving configs directly from CCIP repo * Moving configs directly from CCIP repo * Remove panic recovery for wsrpc (#15865) - Due to some other bug in the library, the redialled connection never becomes ready. * Added is_backfiled filed to solana's filter table (#15796) * Extract MultiNode to chainlink-framework (#15791) * Extract MultiNode * tidy * tidy * Fix generate * Add mock Subscription * lint * Fix sendonly allocation * lint * Add QueryTimeout to client * Use multinode * Update rpc_client_test.go * improve peer group dialer sync function logs (#15867) * Solana devnet spin up in memory env (A) (#15831) * Adding solchains in NewEnv * Revert "Adding solchains in NewEnv" This reverts commit aaab52e01412ea4f1de4f748cadf0c127682418c. * adding sol chains to newenv * newEnv needs to send nil * adding test env setup * adding nil for crib sol chains * adding chain selectors commit * go mod tidy * linting * chain sel update * update core/scripts go files * again * add changeset * go imports * go mod tidy * Update modgraph --------- Co-authored-by: Terry Tata Co-authored-by: Blaž Hrastnik * upgrade chainlink ccip fixing router binding issues in migration * upgrade chainlink ccip fixing router binding issues in migration * fix comment * gomodtidy and formatting fix * update go mod file for newest cl-ccip * update comment --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Simon B.Robert Co-authored-by: dimkouv Co-authored-by: asoliman Co-authored-by: FelixFan1992 Co-authored-by: Mateusz Sekara Co-authored-by: Sam Co-authored-by: Dmytro Haidashenko <34754799+dhaidashenko@users.noreply.github.com> Co-authored-by: Dylan Tinianov Co-authored-by: Yashvardhan Nevatia Co-authored-by: Terry Tata Co-authored-by: Blaž Hrastnik --- .changeset/fluffy-lizards-laugh.md | 5 +++++ contracts/.changeset/stale-dots-destroy.md | 5 +++++ contracts/src/v0.8/ccip/rmn/RMNHome.sol | 4 ++-- contracts/src/v0.8/ccip/rmn/RMNRemote.sol | 6 +++--- .../test/rmn/RMNHome/RMNHome.revokeCandidate.t.sol | 2 +- .../test/rmn/RMNHome/RMNHome.setCandidate.t.sol | 2 +- .../rmn/RMNHome/RMNHome.setDynamicConfig.t.sol | 8 +++++--- .../RMNHome.validateStaticAndDynamicConfig.t.sol | 2 +- .../ccip/test/rmn/RMNHome/RMNHomeTestSetup.t.sol | 6 ++++-- .../test/rmn/RMNRemote/RMNRemote.setConfig.t.sol | 14 +++++++------- .../RMNRemote/RMNRemote.verifywithConfigSet.t.sol | 4 ++-- .../integrationhelpers/integration_helpers.go | 2 +- .../usdcreader/usdcreader_test.go | 7 ++++--- .../ccip/generated/rmn_home/rmn_home.go | 4 ++-- .../ccip/generated/rmn_remote/rmn_remote.go | 4 ++-- ...ted-wrapper-dependency-versions-do-not-edit.txt | 4 ++-- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/ccip/changeset/cs_deploy_chain.go | 2 +- deployment/ccip/changeset/cs_update_rmn_config.go | 2 +- deployment/ccip/view/v1_6/rmnhome.go | 4 ++-- deployment/ccip/view/v1_6/rmnremote.go | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/contracts/ccipreader_test.go | 6 +++--- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- integration-tests/smoke/ccip/ccip_rmn_test.go | 2 +- 32 files changed, 72 insertions(+), 57 deletions(-) create mode 100644 .changeset/fluffy-lizards-laugh.md create mode 100644 contracts/.changeset/stale-dots-destroy.md diff --git a/.changeset/fluffy-lizards-laugh.md b/.changeset/fluffy-lizards-laugh.md new file mode 100644 index 00000000000..3d38170c2d8 --- /dev/null +++ b/.changeset/fluffy-lizards-laugh.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Changed RMNRemote and RMNHome parameter f to fObserve and fSign #updated diff --git a/contracts/.changeset/stale-dots-destroy.md b/contracts/.changeset/stale-dots-destroy.md new file mode 100644 index 00000000000..98cea8292e0 --- /dev/null +++ b/contracts/.changeset/stale-dots-destroy.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +replace f with fObserve in RMNHome and RMNRemote and update all tests CCIP-4058 diff --git a/contracts/src/v0.8/ccip/rmn/RMNHome.sol b/contracts/src/v0.8/ccip/rmn/RMNHome.sol index 4fd01a7115b..b1eb56679f4 100644 --- a/contracts/src/v0.8/ccip/rmn/RMNHome.sol +++ b/contracts/src/v0.8/ccip/rmn/RMNHome.sol @@ -81,7 +81,7 @@ contract RMNHome is Ownable2StepMsgSender, ITypeAndVersion { struct SourceChain { uint64 chainSelector; // ─╮ The Source chain selector. - uint64 f; // ─────────────╯ Maximum number of faulty observers; f+1 observers required to agree on an observation for this source chain. + uint64 fObserve; // ──────╯ Maximum number of faulty observers; f+1 observers required to agree on an observation for this source chain. uint256 observerNodesBitmap; // ObserverNodesBitmap & (1< Date: Thu, 9 Jan 2025 18:43:00 +0200 Subject: [PATCH 26/91] deployment/ccip/changeset: add active/candidate test (#15863) * deployment/ccip/changeset: add active/candidate test * goimports --- .../changeset/cs_active_candidate_test.go | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 deployment/ccip/changeset/cs_active_candidate_test.go diff --git a/deployment/ccip/changeset/cs_active_candidate_test.go b/deployment/ccip/changeset/cs_active_candidate_test.go new file mode 100644 index 00000000000..92e3e825620 --- /dev/null +++ b/deployment/ccip/changeset/cs_active_candidate_test.go @@ -0,0 +1,252 @@ +package changeset + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "golang.org/x/exp/maps" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func Test_ActiveCandidate(t *testing.T) { + // Setup an environment with 2 chains, a source and a dest. + // We want to have the active instance execute a few messages + // and then setup a candidate instance. The candidate instance + // should not be able to transmit anything until we make it active. + tenv := NewMemoryEnvironment(t, + WithChains(2), + WithNodes(4)) + state, err := LoadOnchainState(tenv.Env) + require.NoError(t, err) + + // Deploy to all chains. + allChains := maps.Keys(tenv.Env.Chains) + source := allChains[0] + dest := allChains[1] + + // Connect source to dest + sourceState := state.Chains[source] + tenv.Env, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(UpdateOnRampsDests), + Config: UpdateOnRampDestsConfig{ + UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{ + source: { + dest: { + IsEnabled: true, + AllowListEnabled: false, + }, + }, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(UpdateFeeQuoterPricesCS), + Config: UpdateFeeQuoterPricesConfig{ + PricesByChain: map[uint64]FeeQuoterPriceUpdatePerSource{ + source: { + TokenPrices: map[common.Address]*big.Int{ + sourceState.LinkToken.Address(): DefaultLinkPrice, + sourceState.Weth9.Address(): DefaultWethPrice, + }, + GasPrices: map[uint64]*big.Int{ + dest: DefaultGasPrice, + }, + }, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(UpdateFeeQuoterDests), + Config: UpdateFeeQuoterDestsConfig{ + UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ + source: { + dest: DefaultFeeQuoterDestChainConfig(), + }, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(UpdateOffRampSources), + Config: UpdateOffRampSourcesConfig{ + UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{ + dest: { + source: { + IsEnabled: true, + }, + }, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(UpdateRouterRamps), + Config: UpdateRouterRampsConfig{ + UpdatesByChain: map[uint64]RouterUpdates{ + // onRamp update on source chain + source: { + OnRampUpdates: map[uint64]bool{ + dest: true, + }, + }, + // offramp update on dest chain + dest: { + OffRampUpdates: map[uint64]bool{ + source: true, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) + + // check that source router has dest enabled + onRamp, err := sourceState.Router.GetOnRamp(&bind.CallOpts{ + Context: testcontext.Get(t), + }, dest) + require.NoError(t, err) + require.NotEqual(t, common.HexToAddress("0x0"), onRamp, "expected onRamp to be set") + + // Transfer ownership so that we can set new candidate configs + // and set new config digest on the offramp. + _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), + Config: genTestTransferOwnershipConfig(tenv, allChains, state), + }, + }) + require.NoError(t, err) + assertTimelockOwnership(t, tenv, allChains, state) + + sendMsg := func() { + latesthdr, err := tenv.Env.Chains[dest].Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + block := latesthdr.Number.Uint64() + msgSentEvent := TestSendRequest(t, tenv.Env, state, source, dest, false, router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello world"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }) + + var ( + startBlocks = map[uint64]*uint64{ + dest: &block, + } + expectedSeqNum = map[SourceDestPair]uint64{ + { + SourceChainSelector: source, + DestChainSelector: dest, + }: msgSentEvent.SequenceNumber, + } + expectedSeqNumExec = map[SourceDestPair][]uint64{ + { + SourceChainSelector: source, + DestChainSelector: dest, + }: {msgSentEvent.SequenceNumber}, + } + ) + + // Confirm execution of the message + ConfirmCommitForAllWithExpectedSeqNums(t, tenv.Env, state, expectedSeqNum, startBlocks) + ConfirmExecWithSeqNrsForAll(t, tenv.Env, state, expectedSeqNumExec, startBlocks) + } + + // send a message from source to dest and ensure that it gets executed + sendMsg() + + var ( + capReg = state.Chains[tenv.HomeChainSel].CapabilityRegistry + ccipHome = state.Chains[tenv.HomeChainSel].CCIPHome + ) + donID, err := internal.DonIDForChain(capReg, ccipHome, dest) + require.NoError(t, err) + candidateDigestCommitBefore, err := ccipHome.GetCandidateDigest(&bind.CallOpts{ + Context: testcontext.Get(t), + }, donID, uint8(types.PluginTypeCCIPCommit)) + require.NoError(t, err) + require.Equal(t, [32]byte{}, candidateDigestCommitBefore) + candidateDigestExecBefore, err := ccipHome.GetCandidateDigest(&bind.CallOpts{ + Context: testcontext.Get(t), + }, donID, uint8(types.PluginTypeCCIPExec)) + require.NoError(t, err) + require.Equal(t, [32]byte{}, candidateDigestExecBefore) + + // Now we can add a candidate config, send another request, and observe behavior. + // The candidate config should not be able to execute messages. + tokenConfig := NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) + _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), + Config: SetCandidateChangesetConfig{ + SetCandidateConfigBase: SetCandidateConfigBase{ + HomeChainSelector: tenv.HomeChainSel, + FeedChainSelector: tenv.FeedChainSel, + // NOTE: this is technically not a new chain, but needed for validation. + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams( + tenv.FeedChainSel, + tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), + nil, + ), + }, + PluginType: types.PluginTypeCCIPCommit, + MCMS: &MCMSConfig{ + MinDelay: 0, + }, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), + Config: SetCandidateChangesetConfig{ + SetCandidateConfigBase: SetCandidateConfigBase{ + HomeChainSelector: tenv.HomeChainSel, + FeedChainSelector: tenv.FeedChainSel, + // NOTE: this is technically not a new chain, but needed for validation. + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams( + tenv.FeedChainSel, + tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), + nil, + ), + }, + PluginType: types.PluginTypeCCIPExec, + MCMS: &MCMSConfig{ + MinDelay: 0, + }, + }, + }, + }, + }) + require.NoError(t, err) + + // check that CCIPHome state is updated with the new candidate configs + // for the dest chain DON. + candidateDigestCommit, err := ccipHome.GetCandidateDigest(&bind.CallOpts{ + Context: testcontext.Get(t), + }, donID, uint8(types.PluginTypeCCIPCommit)) + require.NoError(t, err) + require.NotEqual(t, candidateDigestCommit, candidateDigestCommitBefore) + candidateDigestExec, err := ccipHome.GetCandidateDigest(&bind.CallOpts{ + Context: testcontext.Get(t), + }, donID, uint8(types.PluginTypeCCIPExec)) + require.NoError(t, err) + require.NotEqual(t, candidateDigestExec, candidateDigestExecBefore) + + // send a message from source to dest and ensure that it gets executed after the candidate config is set + sendMsg() +} From 182575a823d8e011f4a03a8a69d5498ef5346019 Mon Sep 17 00:00:00 2001 From: joaoluisam Date: Fri, 10 Jan 2025 10:05:09 +0000 Subject: [PATCH 27/91] Add soneium config (#15883) * Add soneium config * Add changeset --- .changeset/silver-books-grab.md | 5 + .../config/toml/defaults/Soneium_Mainnet.toml | 36 ++++++ docs/CONFIG.md | 110 ++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 .changeset/silver-books-grab.md create mode 100644 core/chains/evm/config/toml/defaults/Soneium_Mainnet.toml diff --git a/.changeset/silver-books-grab.md b/.changeset/silver-books-grab.md new file mode 100644 index 00000000000..2aa20e97f27 --- /dev/null +++ b/.changeset/silver-books-grab.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#add #nops Add soneium config diff --git a/core/chains/evm/config/toml/defaults/Soneium_Mainnet.toml b/core/chains/evm/config/toml/defaults/Soneium_Mainnet.toml new file mode 100644 index 00000000000..9dd633123cb --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Soneium_Mainnet.toml @@ -0,0 +1,36 @@ +ChainID = '1868' +ChainType = 'optimismBedrock' +LinkContractAddress = '0x7ea13478Ea3961A0e8b538cb05a9DF0477c79Cd2' +FinalityDepth = 200 +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '120m' # Soneium can take upto 2Hours to finalize +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '1 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 60 + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/docs/CONFIG.md b/docs/CONFIG.md index fe55f4ad293..6f50a7ab16e 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -5933,6 +5933,116 @@ GasLimitDefault = 400000

+
Soneium Mainnet (1868)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = true +LinkContractAddress = '0x7ea13478Ea3961A0e8b538cb05a9DF0477c79Cd2' +LogBackfillBatchSize = 1000 +LogPollInterval = '2s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 1 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '2h0m0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '30s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 wei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '1 mwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 60 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[GasEstimator.DAOracle] +OracleType = 'opstack' +OracleAddress = '0x420000000000000000000000000000000000000F' + +[HeadTracker] +HistoryDepth = 300 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 10 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 1 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+
Soneium Sepolia (1946)

```toml From c57f910327ad2a0cb104a156b289f75b5bb7d972 Mon Sep 17 00:00:00 2001 From: amit-momin <108959691+amit-momin@users.noreply.github.com> Date: Fri, 10 Jan 2025 05:09:43 -0600 Subject: [PATCH 28/91] Update abandon tx functionality to drop related attempts (#15616) * Updated abandon tx to drop related attemtps * Added changeset --- .changeset/gorgeous-ants-promise.md | 5 +++ core/chains/evm/txmgr/evm_tx_store.go | 15 +++++-- core/chains/evm/txmgr/evm_tx_store_test.go | 50 +++++++++++++++++++++- 3 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 .changeset/gorgeous-ants-promise.md diff --git a/.changeset/gorgeous-ants-promise.md b/.changeset/gorgeous-ants-promise.md new file mode 100644 index 00000000000..117bc9a85a9 --- /dev/null +++ b/.changeset/gorgeous-ants-promise.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Updated TXM abandon transaction functionality to drop related attempts. #updated diff --git a/core/chains/evm/txmgr/evm_tx_store.go b/core/chains/evm/txmgr/evm_tx_store.go index 95756790cf3..66e0cc84971 100644 --- a/core/chains/evm/txmgr/evm_tx_store.go +++ b/core/chains/evm/txmgr/evm_tx_store.go @@ -1786,8 +1786,17 @@ func (o *evmTxStore) Abandon(ctx context.Context, chainID *big.Int, addr common. var cancel context.CancelFunc ctx, cancel = o.stopCh.Ctx(ctx) defer cancel() - _, err := o.q.ExecContext(ctx, `UPDATE evm.txes SET state='fatal_error', nonce = NULL, error = 'abandoned' WHERE state IN ('unconfirmed', 'in_progress', 'unstarted') AND evm_chain_id = $1 AND from_address = $2`, chainID.String(), addr) - return err + return o.Transact(ctx, false, func(orm *evmTxStore) error { + var abandonedIDs []string + err := orm.q.SelectContext(ctx, &abandonedIDs, `UPDATE evm.txes SET state='fatal_error', nonce = NULL, error = 'abandoned' WHERE state IN ('unconfirmed', 'in_progress', 'unstarted') AND evm_chain_id = $1 AND from_address = $2 RETURNING id`, chainID.String(), addr) + if err != nil { + return fmt.Errorf("failed to mark transactions as abandoned: %w", err) + } + if _, err := orm.q.ExecContext(ctx, `DELETE FROM evm.tx_attempts WHERE eth_tx_id = ANY($1)`, pq.Array(abandonedIDs)); err != nil { + return fmt.Errorf("failed to delete attempts related to abandoned transactions: %w", err) + } + return nil + }) } // Find transactions by a field in the TxMeta blob and transaction states @@ -1916,7 +1925,7 @@ func (o *evmTxStore) FindAttemptsRequiringReceiptFetch(ctx context.Context, chai query := ` SELECT evm.tx_attempts.* FROM evm.tx_attempts JOIN evm.txes ON evm.txes.ID = evm.tx_attempts.eth_tx_id - WHERE evm.tx_attempts.state = 'broadcast' AND evm.txes.state IN ('confirmed', 'confirmed_missing_receipt', 'fatal_error') AND evm.txes.evm_chain_id = $1 AND evm.txes.ID NOT IN ( + WHERE evm.tx_attempts.state = 'broadcast' AND evm.txes.nonce IS NOT NULL AND evm.txes.state IN ('confirmed', 'confirmed_missing_receipt', 'fatal_error') AND evm.txes.evm_chain_id = $1 AND evm.txes.ID NOT IN ( SELECT DISTINCT evm.txes.ID FROM evm.txes JOIN evm.tx_attempts ON evm.tx_attempts.eth_tx_id = evm.txes.ID JOIN evm.receipts ON evm.receipts.tx_hash = evm.tx_attempts.hash diff --git a/core/chains/evm/txmgr/evm_tx_store_test.go b/core/chains/evm/txmgr/evm_tx_store_test.go index a05cf3f9010..9f515c22be4 100644 --- a/core/chains/evm/txmgr/evm_tx_store_test.go +++ b/core/chains/evm/txmgr/evm_tx_store_test.go @@ -1796,11 +1796,16 @@ func TestORM_FindAttemptsRequiringReceiptFetch(t *testing.T) { // Terminally stuck transaction with receipt should NOT be picked up for receipt fetch stuckTx := mustInsertTerminallyStuckTxWithAttempt(t, txStore, fromAddress, 1, blockNum) mustInsertEthReceipt(t, txStore, blockNum, utils.NewHash(), stuckTx.TxAttempts[0].Hash) + // Fatal transactions with nil nonce and stored attempts should NOT be picked up for receipt fetch + fatalTxWithAttempt := mustInsertFatalErrorEthTx(t, txStore, fromAddress) + attempt := newBroadcastLegacyEthTxAttempt(t, fatalTxWithAttempt.ID) + err := txStore.InsertTxAttempt(ctx, &attempt) + require.NoError(t, err) // Confirmed transaction without receipt should be picked up for receipt fetch confirmedTx := mustInsertConfirmedEthTx(t, txStore, 0, fromAddress) - attempt := newBroadcastLegacyEthTxAttempt(t, confirmedTx.ID) - err := txStore.InsertTxAttempt(ctx, &attempt) + attempt = newBroadcastLegacyEthTxAttempt(t, confirmedTx.ID) + err = txStore.InsertTxAttempt(ctx, &attempt) require.NoError(t, err) attempts, err := txStore.FindAttemptsRequiringReceiptFetch(ctx, testutils.FixtureChainID) @@ -1823,6 +1828,12 @@ func TestORM_FindAttemptsRequiringReceiptFetch(t *testing.T) { // Terminally stuck transaction with receipt should NOT be picked up for receipt fetch stuckTxWithReceipt := mustInsertTerminallyStuckTxWithAttempt(t, txStore, fromAddress, 1, blockNum) mustInsertEthReceipt(t, txStore, blockNum, utils.NewHash(), stuckTxWithReceipt.TxAttempts[0].Hash) + // Fatal transactions with nil nonce and stored attempts should NOT be picked up for receipt fetch + fatalTxWithAttempt := mustInsertFatalErrorEthTx(t, txStore, fromAddress) + attempt := newBroadcastLegacyEthTxAttempt(t, fatalTxWithAttempt.ID) + err := txStore.InsertTxAttempt(ctx, &attempt) + require.NoError(t, err) + // Terminally stuck transaction without receipt should be picked up for receipt fetch stuckTxWoutReceipt := mustInsertTerminallyStuckTxWithAttempt(t, txStore, fromAddress, 0, blockNum) @@ -2008,6 +2019,41 @@ func TestORM_DeleteReceiptsByTxHash(t *testing.T) { require.Len(t, etx2.TxAttempts[0].Receipts, 1) } +func TestORM_Abandon(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + txStore := cltest.NewTestTxStore(t, db) + ctx := tests.Context(t) + ethKeyStore := cltest.NewKeyStore(t, db).Eth() + _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore) + etx1 := mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, testutils.FixtureChainID) + etx2 := mustInsertInProgressEthTxWithAttempt(t, txStore, 1, fromAddress) + etx3 := mustInsertUnconfirmedEthTxWithAttemptState(t, txStore, 0, fromAddress, txmgrtypes.TxAttemptBroadcast) + + err := txStore.Abandon(ctx, testutils.FixtureChainID, fromAddress) + require.NoError(t, err) + + // transactions marked as fatal error with abandon reason, nil sequence, and no attempts + etx1, err = txStore.FindTxWithAttempts(ctx, etx1.ID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFatalError, etx1.State) + require.Nil(t, etx1.Sequence) + require.Empty(t, etx1.TxAttempts) + + etx2, err = txStore.FindTxWithAttempts(ctx, etx2.ID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFatalError, etx2.State) + require.Nil(t, etx2.Sequence) + require.Empty(t, etx2.TxAttempts) + + etx3, err = txStore.FindTxWithAttempts(ctx, etx3.ID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFatalError, etx3.State) + require.Nil(t, etx3.Sequence) + require.Empty(t, etx3.TxAttempts) +} + func mustInsertTerminallyStuckTxWithAttempt(t *testing.T, txStore txmgr.TestEvmTxStore, fromAddress common.Address, nonceInt int64, broadcastBeforeBlockNum int64) txmgr.Tx { ctx := tests.Context(t) broadcast := time.Now() From 3dcfd1c591939653d184d9b26972a67bf89f8dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 10 Jan 2025 21:24:35 +0900 Subject: [PATCH 29/91] deployment/memory: Solana support (develop) (#15889) * deployment: memory: Generate more transmitter key types, expose in JD * deployment: memory: Configure nodes with solana config too * Use CTF to spin up the solana validator for in-memory tests * Use autopatchelf on solana binaries to make them usable on NixOS * memory: solana: Shut down the container when test terminates * go mod tidy * Use latest upstream CTF * Add missing import * make modgraph * Use framework.DefaultNetwork() --- core/scripts/go.mod | 12 +- core/scripts/go.sum | 73 +++++-- deployment/environment/memory/chain.go | 92 ++++++++- deployment/environment/memory/environment.go | 8 +- deployment/environment/memory/job_client.go | 46 +---- deployment/environment/memory/node.go | 205 ++++++++++++++----- deployment/environment/memory/node_test.go | 2 +- deployment/go.mod | 15 +- deployment/go.sum | 31 +-- deployment/solana_chain.go | 56 ++++- go.md | 4 + integration-tests/go.mod | 13 +- integration-tests/go.sum | 37 ++-- integration-tests/load/go.mod | 12 +- integration-tests/load/go.sum | 27 +-- shell.nix | 50 +++++ 16 files changed, 497 insertions(+), 186 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index dcef0492207..79addebee3f 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -82,8 +82,8 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -135,7 +135,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect @@ -164,7 +164,7 @@ require ( github.com/go-openapi/swag v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.22.0 // indirect + github.com/go-playground/validator/v10 v10.22.1 // indirect github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect github.com/go-webauthn/x v0.1.5 // indirect @@ -251,7 +251,7 @@ require ( github.com/maruel/natural v1.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mfridman/interpolate v0.0.2 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -284,7 +284,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prometheus v0.54.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 779360c646d..21d260ebdb9 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -67,6 +67,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -148,6 +150,34 @@ github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinR github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= +github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= +github.com/aws/aws-sdk-go-v2/config v1.28.0 h1:FosVYWcqEtWNxHn8gB/Vs6jOlNwSoyOCA/g/sxyySOQ= +github.com/aws/aws-sdk-go-v2/config v1.28.0/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc= +github.com/aws/aws-sdk-go-v2/credentials v1.17.41 h1:7gXo+Axmp+R4Z+AK8YFQO0ZV3L0gizGINCOWxSLY9W8= +github.com/aws/aws-sdk-go-v2/credentials v1.17.41/go.mod h1:u4Eb8d3394YLubphT4jLEwN1rLNq2wFOlT6OuxFwPzU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 h1:TMH3f/SCAWdNtXXVPPu5D6wrr4G5hI1rAxbcocKfC7Q= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17/go.mod h1:1ZRXLdTpzdJb9fwTMXiLipENRxkGMTn1sfKexGllQCw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2 h1:Rrqru2wYkKQCS2IM5/JrgKUQIoNTqA6y/iuxkjzxC6M= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2/go.mod h1:QuCURO98Sqee2AXmqDNxKXYFm2OEDAVAPApMqO0Vqnc= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2/go.mod h1:o8aQygT2+MVP0NaV6kbdE1YnnIM8RRVQzoeUH45GOdI= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 h1:CiS7i0+FUe+/YY1GvIBLLrR/XNGZ4CtM1Ll0XavNuVo= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.2/go.mod h1:HtaiBI8CjYoNVde8arShXb94UbQQi9L4EMr6D+xGBwo= +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= @@ -184,10 +214,11 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMU github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 h1:NJvU4S8KEk1GnF6+FvlnzMD/8wXTj/mYJSG6Q4yu3Pw= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0/go.mod h1:5YIL+Ouiww2zpO7u+iZ1U1G5NvmwQYaXdmCZQGjQM0U= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -254,6 +285,8 @@ github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7b github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -284,6 +317,8 @@ github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5s github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA= +github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -378,8 +413,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= +github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -466,8 +501,8 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= -github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -846,6 +881,7 @@ github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLm github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= @@ -877,8 +913,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -916,6 +952,14 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= +github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= +github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= +github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1043,8 +1087,8 @@ github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -1088,6 +1132,7 @@ github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKl github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.24.3 h1:eoUGJSmdfLzJ3mxIhmOAhgKEKgQkeOwKpz1NbhVnuPE= github.com/shirou/gopsutil/v3 v3.24.3/go.mod h1:JpND7O217xa72ewWz9zN2eIIkPWsDN/3pl0H8Qt0uwg= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= @@ -1133,6 +1178,8 @@ github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dc github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13/go.mod h1:1CKUOzoK+Ga19WuhRH9pxZ+qUUnrlIx108VEA6qSzeQ= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= @@ -1212,6 +1259,8 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= +github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= +github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ= github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a h1:YuO+afVc3eqrjiCUizNCxI53bl/BnPiVwXqLzqYTqgU= github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a/go.mod h1:/sfW47zCZp9FrtGcWyo1VjbgDaodxX9ovZvgLb/MxaA= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= @@ -1380,7 +1429,6 @@ go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4= golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1915,7 +1963,6 @@ nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYm pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/deployment/environment/memory/chain.go b/deployment/environment/memory/chain.go index 193def7ba08..d3aa3a614f4 100644 --- a/deployment/environment/memory/chain.go +++ b/deployment/environment/memory/chain.go @@ -1,8 +1,14 @@ package memory import ( + "encoding/json" "math/big" + "os" + "path" + "strconv" + "sync" "testing" + "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -11,14 +17,20 @@ import ( "github.com/ethereum/go-ethereum/ethclient/simulated" "github.com/gagliardetto/solana-go" solRpc "github.com/gagliardetto/solana-go/rpc" - + "github.com/hashicorp/consul/sdk/freeport" "github.com/stretchr/testify/require" + "github.com/testcontainers/testcontainers-go" solTestUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/contracts/tests/testutils" chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + chainselectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-testing-framework/framework" + "github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -30,7 +42,9 @@ type EVMChain struct { type SolanaChain struct { Client *solRpc.Client - DeployerKey *solana.PrivateKey + URL string + WSURL string + DeployerKey solana.PrivateKey } func fundAddress(t *testing.T, from *bind.TransactOpts, to common.Address, amount *big.Int, backend *simulated.Backend) { @@ -80,13 +94,12 @@ func GenerateChainsSol(t *testing.T, numChains int) map[uint64]SolanaChain { chains := make(map[uint64]SolanaChain) for i := 0; i < numChains; i++ { chainID := testSolanaChainSelectors[i] - url, _ := solTestUtil.SetupLocalSolNodeWithFlags(t) - admin, gerr := solana.NewRandomPrivateKey() - solTestUtil.FundTestAccounts(t, []solana.PublicKey{admin.PublicKey()}, url) - require.NoError(t, gerr) + solChain := solChain(t) + admin := solChain.DeployerKey + solTestUtil.FundTestAccounts(t, []solana.PublicKey{admin.PublicKey()}, solChain.URL) chains[chainID] = SolanaChain{ - Client: solRpc.New(url), - DeployerKey: &admin, + Client: solChain.Client, + DeployerKey: solChain.DeployerKey, } } return chains @@ -126,3 +139,66 @@ func evmChain(t *testing.T, numUsers int) EVMChain { Users: users, } } + +var once = &sync.Once{} + +func solChain(t *testing.T) SolanaChain { + t.Helper() + + // initialize the docker network used by CTF + err := framework.DefaultNetwork(once) + require.NoError(t, err) + + deployerKey, err := solana.NewRandomPrivateKey() + require.NoError(t, err) + + t.TempDir() + // store the generated keypair somewhere + bytes, err := json.Marshal([]byte(deployerKey)) + require.NoError(t, err) + keypairPath := path.Join(t.TempDir(), "solana-keypair.json") + err = os.WriteFile(keypairPath, bytes, 0600) + require.NoError(t, err) + + port := freeport.GetOne(t) + + bcInput := &blockchain.Input{ + Type: "solana", + ChainID: chainselectors.SOLANA_DEVNET.ChainID, + PublicKey: deployerKey.PublicKey().String(), + Port: strconv.Itoa(port), + // TODO: ContractsDir & SolanaPrograms via env vars + } + output, err := blockchain.NewBlockchainNetwork(bcInput) + require.NoError(t, err) + testcontainers.CleanupContainer(t, output.Container) + + url := output.Nodes[0].HostHTTPUrl + wsURL := output.Nodes[0].HostWSUrl + + // Wait for api server to boot + client := solRpc.New(url) + var ready bool + for i := 0; i < 30; i++ { + time.Sleep(time.Second) + out, err := client.GetHealth(tests.Context(t)) + if err != nil || out != solRpc.HealthOk { + t.Logf("API server not ready yet (attempt %d)\n", i+1) + continue + } + ready = true + break + } + if !ready { + t.Logf("solana-test-validator is not ready after 30 attempts") + } + require.True(t, ready) + t.Logf("solana-test-validator is ready at %s", url) + + return SolanaChain{ + Client: client, + URL: url, + WSURL: wsURL, + DeployerKey: deployerKey, + } +} diff --git a/deployment/environment/memory/environment.go b/deployment/environment/memory/environment.go index 3c5fdc6e779..c9044792834 100644 --- a/deployment/environment/memory/environment.go +++ b/deployment/environment/memory/environment.go @@ -128,10 +128,10 @@ func generateMemoryChainSol(t *testing.T, inputs map[uint64]SolanaChain) map[uin chains[cid] = deployment.SolChain{ Selector: cid, Client: chain.Client, - DeployerKey: chain.DeployerKey, + DeployerKey: &chain.DeployerKey, Confirm: func(instructions []solana.Instruction, opts ...solCommomUtil.TxModifier) error { _, err := solCommomUtil.SendAndConfirm( - context.Background(), chain.Client, instructions, *chain.DeployerKey, solRpc.CommitmentConfirmed, opts..., + context.Background(), chain.Client, instructions, chain.DeployerKey, solRpc.CommitmentConfirmed, opts..., ) if err != nil { return err @@ -153,13 +153,13 @@ func NewNodes(t *testing.T, logLevel zapcore.Level, chains map[uint64]deployment // since we won't run a bootstrapper and a plugin oracle on the same // chainlink node in production. for i := 0; i < numBootstraps; i++ { - node := NewNode(t, ports[i], chains, logLevel, true /* bootstrap */, registryConfig) + node := NewNode(t, ports[i], chains, nil, logLevel, true /* bootstrap */, registryConfig) nodesByPeerID[node.Keys.PeerID.String()] = *node // Note in real env, this ID is allocated by JD. } for i := 0; i < numNodes; i++ { // grab port offset by numBootstraps, since above loop also takes some ports. - node := NewNode(t, ports[numBootstraps+i], chains, logLevel, false /* bootstrap */, registryConfig) + node := NewNode(t, ports[numBootstraps+i], chains, nil, logLevel, false /* bootstrap */, registryConfig) nodesByPeerID[node.Keys.PeerID.String()] = *node // Note in real env, this ID is allocated by JD. } diff --git a/deployment/environment/memory/job_client.go b/deployment/environment/memory/job_client.go index e44c664b77e..e025ea18fda 100644 --- a/deployment/environment/memory/job_client.go +++ b/deployment/environment/memory/job_client.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "slices" - "strconv" "strings" "github.com/ethereum/go-ethereum/common" @@ -153,49 +152,12 @@ func (j JobClient) ListNodeChainConfigs(ctx context.Context, in *nodev1.ListNode if !ok { return nil, fmt.Errorf("node id not found: %s", in.Filter.NodeIds[0]) } - evmBundle := n.Keys.OCRKeyBundles[chaintype.EVM] - offpk := evmBundle.OffchainPublicKey() - cpk := evmBundle.ConfigEncryptionPublicKey() - - evmKeyBundle := &nodev1.OCR2Config_OCRKeyBundle{ - BundleId: evmBundle.ID(), - ConfigPublicKey: common.Bytes2Hex(cpk[:]), - OffchainPublicKey: common.Bytes2Hex(offpk[:]), - OnchainSigningAddress: evmBundle.OnChainPublicKey(), - } - var chainConfigs []*nodev1.ChainConfig - for evmChainID, transmitter := range n.Keys.TransmittersByEVMChainID { - chainConfigs = append(chainConfigs, &nodev1.ChainConfig{ - Chain: &nodev1.Chain{ - Id: strconv.Itoa(int(evmChainID)), - Type: nodev1.ChainType_CHAIN_TYPE_EVM, - }, - AccountAddress: transmitter.String(), - AdminAddress: transmitter.String(), // TODO: custom address - Ocr1Config: nil, - Ocr2Config: &nodev1.OCR2Config{ - Enabled: true, - IsBootstrap: n.IsBoostrap, - P2PKeyBundle: &nodev1.OCR2Config_P2PKeyBundle{ - PeerId: n.Keys.PeerID.String(), - }, - OcrKeyBundle: evmKeyBundle, - Multiaddr: n.Addr.String(), - Plugins: nil, - ForwarderAddress: ptr(""), - }, - }) - } for _, selector := range n.Chains { family, err := chainsel.GetSelectorFamily(selector) if err != nil { return nil, err } - if family == chainsel.FamilyEVM { - // already handled above - continue - } // NOTE: this supports non-EVM too chainID, err := chainsel.GetChainIDFromSelector(selector) @@ -220,7 +182,6 @@ func (j JobClient) ListNodeChainConfigs(ctx context.Context, in *nodev1.ListNode } bundle := n.Keys.OCRKeyBundles[ocrtype] - offpk := bundle.OffchainPublicKey() cpk := bundle.ConfigEncryptionPublicKey() @@ -245,13 +206,15 @@ func (j JobClient) ListNodeChainConfigs(ctx context.Context, in *nodev1.ListNode panic(fmt.Sprintf("Unsupported chain family %v", family)) } + transmitter := n.Keys.Transmitters[selector] + chainConfigs = append(chainConfigs, &nodev1.ChainConfig{ Chain: &nodev1.Chain{ Id: chainID, Type: ctype, }, - AccountAddress: "", // TODO: support AccountAddress - AdminAddress: "", + AccountAddress: transmitter, + AdminAddress: transmitter, Ocr1Config: nil, Ocr2Config: &nodev1.OCR2Config{ Enabled: true, @@ -266,7 +229,6 @@ func (j JobClient) ListNodeChainConfigs(ctx context.Context, in *nodev1.ListNode }, }) } - // TODO: I think we can pull it from the feeds manager. return &nodev1.ListNodeChainConfigsResponse{ ChainConfigs: chainConfigs, }, nil diff --git a/deployment/environment/memory/node.go b/deployment/environment/memory/node.go index 84f0d2e443f..606c080be94 100644 --- a/deployment/environment/memory/node.go +++ b/deployment/environment/memory/node.go @@ -6,6 +6,7 @@ import ( "math/big" "net" "net/http" + "slices" "strconv" "testing" "time" @@ -22,6 +23,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/v2/core/capabilities" @@ -72,14 +75,19 @@ func NewNode( t *testing.T, port int, // Port for the P2P V2 listener. chains map[uint64]deployment.Chain, + solchains map[uint64]deployment.SolChain, logLevel zapcore.Level, bootstrap bool, registryConfig deployment.CapabilityRegistryConfig, ) *Node { evmchains := make(map[uint64]EVMChain) for _, chain := range chains { - // we're only mapping evm chains here - if family, err := chainsel.GetSelectorFamily(chain.Selector); err != nil || family != chainsel.FamilyEVM { + family, err := chainsel.GetSelectorFamily(chain.Selector) + if err != nil { + t.Fatal(err) + } + // we're only mapping evm chains here, currently this list could also contain non-EVMs, e.g. Aptos + if family != chainsel.FamilyEVM { continue } evmChainID, err := chainsel.ChainIdFromSelector(chain.Selector) @@ -120,11 +128,21 @@ func NewNode( c.Log.Level = ptr(configv2.LogLevel(logLevel)) - var chainConfigs v2toml.EVMConfigs + var evmConfigs v2toml.EVMConfigs for chainID := range evmchains { - chainConfigs = append(chainConfigs, createConfigV2Chain(chainID)) + evmConfigs = append(evmConfigs, createConfigV2Chain(chainID)) } - c.EVM = chainConfigs + c.EVM = evmConfigs + + var solConfigs solcfg.TOMLConfigs + for chainID, chain := range solchains { + solanaChainID, err := chainsel.GetChainIDFromSelector(chainID) + if err != nil { + t.Fatal(err) + } + solConfigs = append(solConfigs, createSolanaChainConfig(solanaChainID, chain)) + } + c.Solana = solConfigs }) // Set logging. @@ -164,6 +182,12 @@ func NewNode( CSAETHKeystore: kStore, } + solanaOpts := chainlink.SolanaFactoryConfig{ + Keystore: master.Solana(), + TOMLConfigs: cfg.SolanaConfigs(), + DS: db, + } + // Build Beholder auth ctx := tests.Context(t) require.NoError(t, master.Unlock(ctx, "password")) @@ -171,14 +195,19 @@ func NewNode( beholderAuthHeaders, csaPubKeyHex, err := keystore.BuildBeholderAuth(master) require.NoError(t, err) - // Build relayer factory with EVM. + loopRegistry := plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), cfg.Tracing(), cfg.Telemetry(), beholderAuthHeaders, csaPubKeyHex) + + // Build relayer factory relayerFactory := chainlink.RelayerFactory{ Logger: lggr, - LoopRegistry: plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), cfg.Tracing(), cfg.Telemetry(), beholderAuthHeaders, csaPubKeyHex), + LoopRegistry: loopRegistry, GRPCOpts: loop.GRPCOpts{}, CapabilitiesRegistry: capabilities.NewRegistry(lggr), } - initOps := []chainlink.CoreRelayerChainInitFunc{chainlink.InitEVM(context.Background(), relayerFactory, evmOpts)} + initOps := []chainlink.CoreRelayerChainInitFunc{ + chainlink.InitEVM(context.Background(), relayerFactory, evmOpts), + chainlink.InitSolana(context.Background(), relayerFactory, solanaOpts), + } rci, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) require.NoError(t, err) @@ -194,17 +223,20 @@ func NewNode( RestrictedHTTPClient: &http.Client{}, AuditLogger: audit.NoopLogger, MailMon: mailMon, - LoopRegistry: plugins.NewLoopRegistry(lggr, cfg.Tracing(), cfg.Telemetry(), beholderAuthHeaders, csaPubKeyHex), + LoopRegistry: loopRegistry, }) require.NoError(t, err) t.Cleanup(func() { require.NoError(t, db.Close()) }) - keys := CreateKeys(t, app, chains) + keys := CreateKeys(t, app, chains, solchains) return &Node{ - App: app, - Chains: maps.Keys(chains), + App: app, + Chains: slices.Concat( + maps.Keys(chains), + maps.Keys(solchains), + ), Keys: keys, Addr: net.TCPAddr{IP: net.ParseIP("127.0.0.1"), Port: port}, IsBoostrap: bootstrap, @@ -212,14 +244,17 @@ func NewNode( } type Keys struct { - PeerID p2pkey.PeerID - CSA csakey.KeyV2 - TransmittersByEVMChainID map[uint64]common.Address - OCRKeyBundles map[chaintype.ChainType]ocr2key.KeyBundle + PeerID p2pkey.PeerID + CSA csakey.KeyV2 + Transmitters map[uint64]string // chainSelector => address + OCRKeyBundles map[chaintype.ChainType]ocr2key.KeyBundle } func CreateKeys(t *testing.T, - app chainlink.Application, chains map[uint64]deployment.Chain) Keys { + app chainlink.Application, + chains map[uint64]deployment.Chain, + solchains map[uint64]deployment.SolChain, +) Keys { ctx := tests.Context(t) _, err := app.GetKeyStore().P2P().Create(ctx) require.NoError(t, err) @@ -235,7 +270,7 @@ func CreateKeys(t *testing.T, require.Len(t, p2pIDs, 1) peerID := p2pIDs[0].PeerID() // create a transmitter for each chain - transmitters := make(map[uint64]common.Address) + transmitters := make(map[uint64]string) keybundles := make(map[chaintype.ChainType]ocr2key.KeyBundle) for _, chain := range chains { family, err := chainsel.GetSelectorFamily(chain.Selector) @@ -257,44 +292,100 @@ func CreateKeys(t *testing.T, panic(fmt.Sprintf("Unsupported chain family %v", family)) } - keybundle, err := app.GetKeyStore().OCR2().Create(ctx, ctype) + err = app.GetKeyStore().OCR2().EnsureKeys(ctx, ctype) + require.NoError(t, err) + keys, err := app.GetKeyStore().OCR2().GetAllOfType(ctype) require.NoError(t, err) + require.Len(t, keys, 1) + keybundle := keys[0] + keybundles[ctype] = keybundle - if family != chainsel.FamilyEVM { - // TODO: only support EVM transmission keys for now - continue + switch family { + case chainsel.FamilyEVM: + evmChainID, err := chainsel.ChainIdFromSelector(chain.Selector) + require.NoError(t, err) + + cid := new(big.Int).SetUint64(evmChainID) + addrs, err2 := app.GetKeyStore().Eth().EnabledAddressesForChain(ctx, cid) + require.NoError(t, err2) + var transmitter common.Address + if len(addrs) == 1 { + // just fund the address + transmitter = addrs[0] + } else { + // create key and fund it + _, err3 := app.GetKeyStore().Eth().Create(ctx, cid) + require.NoError(t, err3, "failed to create key for chain", evmChainID) + sendingKeys, err3 := app.GetKeyStore().Eth().EnabledAddressesForChain(ctx, cid) + require.NoError(t, err3) + require.Len(t, sendingKeys, 1) + transmitter = sendingKeys[0] + } + transmitters[chain.Selector] = transmitter.String() + + backend := chain.Client.(*Backend).Sim + fundAddress(t, chain.DeployerKey, transmitter, assets.Ether(1000).ToInt(), backend) + // need to look more into it, but it seems like with sim chains nodes are sending txs with 0x from address + fundAddress(t, chain.DeployerKey, common.Address{}, assets.Ether(1000).ToInt(), backend) + case chainsel.FamilyAptos: + err = app.GetKeyStore().Aptos().EnsureKey(ctx) + require.NoError(t, err, "failed to create key for aptos") + + keys, err := app.GetKeyStore().Aptos().GetAll() + require.NoError(t, err) + require.Len(t, keys, 1) + + transmitter := keys[0] + transmitters[chain.Selector] = transmitter.ID() + + // TODO: funding + case chainsel.FamilyStarknet: + err = app.GetKeyStore().StarkNet().EnsureKey(ctx) + require.NoError(t, err, "failed to create key for starknet") + + keys, err := app.GetKeyStore().StarkNet().GetAll() + require.NoError(t, err) + require.Len(t, keys, 1) + + transmitter := keys[0] + transmitters[chain.Selector] = transmitter.ID() + + // TODO: funding + default: + // TODO: other transmission keys unsupported for now } + } - evmChainID, err := chainsel.ChainIdFromSelector(chain.Selector) + for chain := range solchains { + ctype := chaintype.Solana + err = app.GetKeyStore().OCR2().EnsureKeys(ctx, ctype) + require.NoError(t, err) + keys, err := app.GetKeyStore().OCR2().GetAllOfType(ctype) require.NoError(t, err) + require.Len(t, keys, 1) + keybundle := keys[0] - cid := big.NewInt(int64(evmChainID)) - addrs, err2 := app.GetKeyStore().Eth().EnabledAddressesForChain(ctx, cid) - require.NoError(t, err2) - if len(addrs) == 1 { - // just fund the address - transmitters[evmChainID] = addrs[0] - } else { - // create key and fund it - _, err3 := app.GetKeyStore().Eth().Create(ctx, cid) - require.NoError(t, err3, "failed to create key for chain", evmChainID) - sendingKeys, err3 := app.GetKeyStore().Eth().EnabledAddressesForChain(ctx, cid) - require.NoError(t, err3) - require.Len(t, sendingKeys, 1) - transmitters[evmChainID] = sendingKeys[0] - } - backend := chain.Client.(*Backend).Sim - fundAddress(t, chain.DeployerKey, transmitters[evmChainID], assets.Ether(1000).ToInt(), backend) - // need to look more into it, but it seems like with sim chains nodes are sending txs with 0x from address - fundAddress(t, chain.DeployerKey, common.Address{}, assets.Ether(1000).ToInt(), backend) + keybundles[ctype] = keybundle + + err = app.GetKeyStore().Solana().EnsureKey(ctx) + require.NoError(t, err, "failed to create key for solana") + + solkeys, err := app.GetKeyStore().Solana().GetAll() + require.NoError(t, err) + require.Len(t, solkeys, 1) + + transmitter := solkeys[0] + transmitters[chain] = transmitter.ID() + + // TODO: funding } return Keys{ - PeerID: peerID, - CSA: csaKey, - TransmittersByEVMChainID: transmitters, - OCRKeyBundles: keybundles, + PeerID: peerID, + CSA: csaKey, + Transmitters: transmitters, + OCRKeyBundles: keybundles, } } @@ -313,6 +404,28 @@ func createConfigV2Chain(chainID uint64) *v2toml.EVMConfig { } } +func createSolanaChainConfig(chainID string, chain deployment.SolChain) *solcfg.TOMLConfig { + chainConfig := solcfg.Chain{} + chainConfig.SetDefaults() + + url, err := config.ParseURL(chain.URL) + if err != nil { + panic(err) + } + + return &solcfg.TOMLConfig{ + ChainID: &chainID, + Enabled: ptr(true), + Chain: chainConfig, + MultiNode: solcfg.MultiNodeConfig{}, + Nodes: []*solcfg.Node{{ + Name: ptr("primary"), + URL: url, + SendOnly: false, + }}, + } +} + func ptr[T any](v T) *T { return &v } var _ keystore.Eth = &EthKeystoreSim{} diff --git a/deployment/environment/memory/node_test.go b/deployment/environment/memory/node_test.go index 78bc2db90e5..b9562f0290a 100644 --- a/deployment/environment/memory/node_test.go +++ b/deployment/environment/memory/node_test.go @@ -15,7 +15,7 @@ import ( func TestNode(t *testing.T) { chains, _ := NewMemoryChains(t, 3, 5) ports := freeport.GetN(t, 1) - node := NewNode(t, ports[0], chains, zapcore.DebugLevel, false, deployment.CapabilityRegistryConfig{}) + node := NewNode(t, ports[0], chains, nil, zapcore.DebugLevel, false, deployment.CapabilityRegistryConfig{}) // We expect 3 transmitter keys keys, err := node.App.GetKeyStore().Eth().GetAll(tests.Context(t)) require.NoError(t, err) diff --git a/deployment/go.mod b/deployment/go.mod index 813acf2ec05..f8875c64544 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -33,6 +33,8 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce + github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/stretchr/testify v1.10.0 @@ -117,8 +119,8 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 // indirect github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 // indirect @@ -188,7 +190,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect @@ -217,7 +219,7 @@ require ( github.com/go-openapi/validate v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.22.0 // indirect + github.com/go-playground/validator/v10 v10.22.1 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect @@ -331,7 +333,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/miekg/dns v1.1.61 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -387,7 +389,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prometheus v0.54.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect @@ -411,7 +413,6 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index d7a410108c0..7e7fb74354d 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -281,10 +281,11 @@ github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40 github.com/bxcodec/faker v2.0.1+incompatible/go.mod h1:BNzfpVdTwnFJ6GtfYTcQu6l6rHShT+veBxNCnjCx5XM= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 h1:NJvU4S8KEk1GnF6+FvlnzMD/8wXTj/mYJSG6Q4yu3Pw= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0/go.mod h1:5YIL+Ouiww2zpO7u+iZ1U1G5NvmwQYaXdmCZQGjQM0U= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK84APFuMvxqsk3tEIaKH/z4Rpu3g= @@ -412,8 +413,8 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= +github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e h1:5jVSh2l/ho6ajWhSPNN84eHEdq3dp0T7+f6r3Tc6hsk= @@ -515,8 +516,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= +github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -603,8 +604,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= -github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-resty/resty/v2 v2.15.3 h1:bqff+hcqAflpiF591hhJzNdkRsFhlB96CYfBwSFvql8= @@ -1090,8 +1091,8 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1304,8 +1305,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -1403,6 +1404,8 @@ github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dc github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13/go.mod h1:1CKUOzoK+Ga19WuhRH9pxZ+qUUnrlIx108VEA6qSzeQ= github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg= @@ -1678,7 +1681,6 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4= golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -2232,7 +2234,6 @@ nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYm pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/deployment/solana_chain.go b/deployment/solana_chain.go index ba02e74f892..34410c2d06a 100644 --- a/deployment/solana_chain.go +++ b/deployment/solana_chain.go @@ -1,11 +1,16 @@ package deployment import ( + "bytes" "fmt" + "os/exec" "strconv" + "strings" + "time" "github.com/gagliardetto/solana-go" solRpc "github.com/gagliardetto/solana-go/rpc" + "github.com/pkg/errors" solCommomUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" ) @@ -14,11 +19,16 @@ import ( type SolChain struct { // Selectors used as canonical chain identifier. Selector uint64 - // RPC cient + // RPC client Client *solRpc.Client + URL string + WSURL string // TODO: raw private key for now, need to replace with a more secure way DeployerKey *solana.PrivateKey - Confirm func(instructions []solana.Instruction, opts ...solCommomUtil.TxModifier) error + // deploy uses the solana CLI which needs a keyfile + KeypairPath string + ProgramsPath string + Confirm func(instructions []solana.Instruction, opts ...solCommomUtil.TxModifier) error } func (c SolChain) String() string { @@ -41,3 +51,45 @@ func (c SolChain) Name() string { } return chainInfo.ChainName } + +func (c SolChain) DeployProgram(programName string) (string, error) { + programFile := fmt.Sprintf("%s/%s.so", c.ProgramsPath, programName) + programKeyPair := fmt.Sprintf("%s/%s-keypair.json", c.ProgramsPath, programName) + + // Construct the CLI command: solana program deploy + // TODO: @terry doing this on the fly + cmd := exec.Command("solana", "program", "deploy", programFile, "--keypair", c.KeypairPath, "--program-id", programKeyPair) + + // Capture the command output + var stdout, stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + + // Run the command + if err := cmd.Run(); err != nil { + return "", fmt.Errorf("error deploying program: %s: %s", err.Error(), stderr.String()) + } + + // Parse and return the program ID + output := stdout.String() + + time.Sleep(5 * time.Second) // obviously need to do this better + return parseProgramID(output) +} + +// parseProgramID parses the program ID from the deploy output. +func parseProgramID(output string) (string, error) { + // Look for the program ID in the CLI output + // Example output: "Program Id: " + const prefix = "Program Id: " + startIdx := strings.Index(output, prefix) + if startIdx == -1 { + return "", errors.New("failed to find program ID in output") + } + startIdx += len(prefix) + endIdx := strings.Index(output[startIdx:], "\n") + if endIdx == -1 { + endIdx = len(output) + } + return output[startIdx : startIdx+endIdx], nil +} diff --git a/go.md b/go.md index ed41edee2b0..5a9081747f2 100644 --- a/go.md +++ b/go.md @@ -129,6 +129,8 @@ flowchart LR click chainlink-solana href "https://github.com/smartcontractkit/chainlink-solana" chainlink-starknet/relayer --> chainlink-common click chainlink-starknet/relayer href "https://github.com/smartcontractkit/chainlink-starknet" + chainlink-testing-framework/framework + click chainlink-testing-framework/framework href "https://github.com/smartcontractkit/chainlink-testing-framework" chainlink-testing-framework/havoc --> chainlink-testing-framework/lib/grafana click chainlink-testing-framework/havoc href "https://github.com/smartcontractkit/chainlink-testing-framework" chainlink-testing-framework/lib --> chainlink-testing-framework/seth @@ -145,6 +147,7 @@ flowchart LR chainlink/deployment --> ccip-owner-contracts chainlink/deployment --> chainlink-ccip/chains/solana chainlink/deployment --> chainlink-protos/job-distributor + chainlink/deployment --> chainlink-testing-framework/framework chainlink/deployment --> chainlink-testing-framework/lib chainlink/deployment --> chainlink/v2 click chainlink/deployment href "https://github.com/smartcontractkit/chainlink" @@ -200,6 +203,7 @@ flowchart LR click chainlink-protos-repo href "https://github.com/smartcontractkit/chainlink-protos" subgraph chainlink-testing-framework-repo[chainlink-testing-framework] + chainlink-testing-framework/framework chainlink-testing-framework/havoc chainlink-testing-framework/lib chainlink-testing-framework/lib/grafana diff --git a/integration-tests/go.mod b/integration-tests/go.mod index b5cf870b900..5b3322a4a44 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -137,8 +137,8 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 // indirect github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 // indirect @@ -208,7 +208,7 @@ require ( github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect @@ -238,7 +238,7 @@ require ( github.com/go-openapi/validate v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.22.0 // indirect + github.com/go-playground/validator/v10 v10.22.1 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect @@ -351,7 +351,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/miekg/dns v1.1.61 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -404,7 +404,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prometheus v0.54.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect @@ -430,6 +430,7 @@ require ( github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect + github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index b0f5879cb11..ea4e33c1e7b 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -231,6 +231,8 @@ github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -273,10 +275,11 @@ github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40 github.com/bxcodec/faker v2.0.1+incompatible/go.mod h1:BNzfpVdTwnFJ6GtfYTcQu6l6rHShT+veBxNCnjCx5XM= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 h1:NJvU4S8KEk1GnF6+FvlnzMD/8wXTj/mYJSG6Q4yu3Pw= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0/go.mod h1:5YIL+Ouiww2zpO7u+iZ1U1G5NvmwQYaXdmCZQGjQM0U= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK84APFuMvxqsk3tEIaKH/z4Rpu3g= @@ -416,8 +419,8 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= +github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e h1:5jVSh2l/ho6ajWhSPNN84eHEdq3dp0T7+f6r3Tc6hsk= @@ -517,8 +520,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= +github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -605,8 +608,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= -github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-resty/resty/v2 v2.15.3 h1:bqff+hcqAflpiF591hhJzNdkRsFhlB96CYfBwSFvql8= @@ -1100,8 +1103,8 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1181,8 +1184,8 @@ github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.12.0 h1:KuQRUE3PgxRFWhq4gHvZtPSLCGDqM5q/cYr1pZ39ytc= -github.com/muesli/termenv v0.12.0/go.mod h1:WCCv32tusQ/EEZ5S8oUIIrC/nIuBcxCVqlN4Xfkv+7A= +github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a h1:2MaM6YC3mGu54x+RKAA6JiFFHlHDY1UbkxqppT7wYOg= +github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a/go.mod h1:hxSnBBYLK21Vtq/PHd0S2FYCxBXzBua8ov5s1RobyRQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1322,8 +1325,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -1425,6 +1428,8 @@ github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dc github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2/go.mod h1:DsT43c1oTBmp3iQkMcoZOoKThwZvt8X3Pz6UmznJ4GY= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 h1:9PMwKNqFKc5FXf4VchyD3CGzZelnSgi13fgVdT2X7T4= @@ -1704,7 +1709,6 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4= golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -2262,7 +2266,6 @@ nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYm pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index ddcf26ebb71..da059e156b7 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -107,8 +107,8 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 // indirect github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 // indirect @@ -179,7 +179,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect @@ -209,7 +209,7 @@ require ( github.com/go-openapi/validate v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.22.0 // indirect + github.com/go-playground/validator/v10 v10.22.1 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect @@ -327,7 +327,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/miekg/dns v1.1.61 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -382,7 +382,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prometheus v0.54.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index c5dff273180..b592320e882 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -277,10 +277,11 @@ github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40 github.com/bxcodec/faker v2.0.1+incompatible/go.mod h1:BNzfpVdTwnFJ6GtfYTcQu6l6rHShT+veBxNCnjCx5XM= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 h1:NJvU4S8KEk1GnF6+FvlnzMD/8wXTj/mYJSG6Q4yu3Pw= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0/go.mod h1:5YIL+Ouiww2zpO7u+iZ1U1G5NvmwQYaXdmCZQGjQM0U= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK84APFuMvxqsk3tEIaKH/z4Rpu3g= @@ -511,8 +512,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= +github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -599,8 +600,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= -github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-resty/resty/v2 v2.15.3 h1:bqff+hcqAflpiF591hhJzNdkRsFhlB96CYfBwSFvql8= @@ -1094,8 +1095,8 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1312,8 +1313,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -1416,6 +1417,8 @@ github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dc github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2/go.mod h1:DsT43c1oTBmp3iQkMcoZOoKThwZvt8X3Pz6UmznJ4GY= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 h1:9PMwKNqFKc5FXf4VchyD3CGzZelnSgi13fgVdT2X7T4= @@ -1695,7 +1698,6 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4= golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -2251,7 +2253,6 @@ nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYm pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/shell.nix b/shell.nix index 4065e7e3def..456bbd8a9c1 100644 --- a/shell.nix +++ b/shell.nix @@ -6,6 +6,53 @@ with pkgs; let nodePackages = pkgs.nodePackages.override {inherit nodejs;}; pnpm = pnpm_9; + version = "v2.0.18"; + getBinDerivation = + { + name, + filename, + sha256, + }: + pkgs.stdenv.mkDerivation rec { + inherit name; + url = "https://github.com/anza-xyz/agave/releases/download/${version}/${filename}"; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + autoPatchelfIgnoreMissingDeps = true; + + buildInputs = with pkgs; [stdenv.cc.cc.libgcc stdenv.cc.cc.lib] ++ lib.optionals stdenv.isLinux [ libudev-zero ]; + + src = pkgs.fetchzip { + inherit url sha256; + }; + + installPhase = '' + mkdir -p $out/bin + ls -lah $src + cp -r $src/bin/* $out/bin + ''; + }; + + solanaBinaries = { + x86_64-linux = getBinDerivation { + name = "solana-cli-x86_64-linux"; + filename = "solana-release-x86_64-unknown-linux-gnu.tar.bz2"; + ### BEGIN_LINUX_SHA256 ### + sha256 = "sha256-3FW6IMZeDtyU4GTsRIwT9BFLNzLPEuP+oiQdur7P13s="; + ### END_LINUX_SHA256 ### + }; + aarch64-apple-darwin = getBinDerivation { + name = "solana-cli-aarch64-apple-darwin"; + filename = "solana-release-aarch64-apple-darwin.tar.bz2"; + ### BEGIN_DARWIN_SHA256 ### + sha256 = "sha256-6VjycYU0NU0evXoqtGAZMYGHQEKijofnFQnBJNVsb6Q="; + ### END_DARWIN_SHA256 ### + }; + }; + mkShell' = mkShell.override { # The current nix default sdk for macOS fails to compile go projects, so we use a newer one for now. stdenv = @@ -50,9 +97,12 @@ in pkg-config libudev-zero libusb1 + solanaBinaries.x86_64-linux ] ++ lib.optionals isCrib [ nur.repos.goreleaser.goreleaser-pro patchelf + ] ++ pkgs.lib.optionals (pkgs.stdenv.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) [ + solanaBinaries.aarch64-apple-darwin ]; shellHook = '' From 437ef640db1d4455e7b4d90868c9e5c4d62054df Mon Sep 17 00:00:00 2001 From: Suryansh <39276431+0xsuryansh@users.noreply.github.com> Date: Fri, 10 Jan 2025 22:48:41 +0530 Subject: [PATCH 30/91] CCIP-4223 bubble up revert for estimation (#15504) * feat: fix estimation by adding a reverting clause * CCIP-4223 changeset * [Bot] Update changeset file with jira issues * Update gethwrappers * updates wrapper and gas snapshot * add tests * fix test vars * add comments reasoning for address(1) * reorder import * fix comments * updated code after via ir merge * update sender with C11 address * update wrappers * fmt * move GAS_ESTIMATION_SENDER to Internal.sol + minor refactoring * make gas estimator const public and use encodeCall * lint fix * fix test --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> --- contracts/.changeset/twelve-pianos-chew.md | 10 ++++ contracts/gas-snapshots/ccip.gas-snapshot | 31 +++++----- .../src/v0.8/ccip/libraries/Internal.sol | 5 ++ contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol | 6 +- contracts/src/v0.8/ccip/offRamp/OffRamp.sol | 8 +++ .../OffRamp/OffRamp.trialExecute.t.sol | 57 +++++++++++++++++++ .../multi_ocr3_helper/multi_ocr3_helper.go | 4 +- .../ccip/generated/offramp/offramp.go | 4 +- ...rapper-dependency-versions-do-not-edit.txt | 4 +- 9 files changed, 108 insertions(+), 21 deletions(-) create mode 100644 contracts/.changeset/twelve-pianos-chew.md diff --git a/contracts/.changeset/twelve-pianos-chew.md b/contracts/.changeset/twelve-pianos-chew.md new file mode 100644 index 00000000000..9aa4fa8f2b2 --- /dev/null +++ b/contracts/.changeset/twelve-pianos-chew.md @@ -0,0 +1,10 @@ +--- +'@chainlink/contracts': minor +--- + +#internal Fix gas estimation by adding a reverting clause + +PR issue: CCIP-4223 + + +Solidity Review issue: CCIP-3966 \ No newline at end of file diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 019626e6a67..afc2768185f 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -226,18 +226,18 @@ OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 141051) OffRamp_commit:test_RootWithRMNDisabled() (gas: 153873) OffRamp_commit:test_StaleReportWithRoot() (gas: 232101) OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot() (gas: 206722) -OffRamp_constructor:test_Constructor() (gas: 6269512) +OffRamp_constructor:test_Constructor() (gas: 6311247) OffRamp_execute:test_LargeBatch() (gas: 3373860) OffRamp_execute:test_MultipleReports() (gas: 291458) -OffRamp_execute:test_MultipleReportsWithPartialValidationFailures() (gas: 364776) +OffRamp_execute:test_MultipleReportsWithPartialValidationFailures() (gas: 364826) OffRamp_execute:test_SingleReport() (gas: 168850) OffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens() (gas: 51610) OffRamp_executeSingleMessage:test_executeSingleMessage_NonContract() (gas: 20514) OffRamp_executeSingleMessage:test_executeSingleMessage_NonContractWithTokens() (gas: 230418) OffRamp_executeSingleMessage:test_executeSingleMessage_WithMessageInterceptor() (gas: 87465) OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens() (gas: 259935) -OffRamp_executeSingleReport:test_InvalidSourcePoolAddress() (gas: 455358) -OffRamp_executeSingleReport:test_ReceiverError() (gas: 180797) +OffRamp_executeSingleReport:test_InvalidSourcePoolAddress() (gas: 455383) +OffRamp_executeSingleReport:test_ReceiverError() (gas: 180822) OffRamp_executeSingleReport:test_SingleMessageNoTokens() (gas: 205270) OffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain() (gas: 241357) OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered() (gas: 185263) @@ -254,23 +254,26 @@ OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered OffRamp_getExecutionState:test_FillExecutionState() (gas: 3955662) OffRamp_getExecutionState:test_GetDifferentChainExecutionState() (gas: 121311) OffRamp_getExecutionState:test_GetExecutionState() (gas: 90102) -OffRamp_manuallyExecute:test_manuallyExecute() (gas: 212368) -OffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched() (gas: 165742) -OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit() (gas: 479145) +OffRamp_manuallyExecute:test_manuallyExecute() (gas: 212393) +OffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched() (gas: 165767) +OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit() (gas: 479170) OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails() (gas: 2229662) -OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride() (gas: 212918) -OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride() (gas: 732218) -OffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages() (gas: 337015) +OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride() (gas: 212943) +OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride() (gas: 732343) +OffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages() (gas: 337040) OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken() (gas: 94629) OffRamp_releaseOrMintTokens:test_releaseOrMintTokens() (gas: 161157) OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride() (gas: 163023) OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals() (gas: 174276) OffRamp_setDynamicConfig:test_SetDynamicConfig() (gas: 25442) OffRamp_setDynamicConfig:test_SetDynamicConfigWithInterceptor() (gas: 47493) -OffRamp_trialExecute:test_trialExecute() (gas: 263635) -OffRamp_trialExecute:test_trialExecute_RateLimitError() (gas: 120721) -OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 132031) -OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 281380) +OffRamp_trialExecute:test_trialExecute() (gas: 263614) +OffRamp_trialExecute:test_trialExecute_CallWithExactGasRevertsAndSenderIsNotGasEstimator() (gas: 24490) +OffRamp_trialExecute:test_trialExecute_RateLimitError() (gas: 120710) +OffRamp_trialExecute:test_trialExecute_RevertsWhen_NoEnoughGasForCallSigAndSenderIsGasEstimator() (gas: 29391) +OffRamp_trialExecute:test_trialExecute_RevertsWhen_NoGasForCallExactCheckAndSenderIsGasEstimator() (gas: 29539) +OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 131932) +OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 281327) OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy() (gas: 244294) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates() (gas: 325979) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 17190) diff --git a/contracts/src/v0.8/ccip/libraries/Internal.sol b/contracts/src/v0.8/ccip/libraries/Internal.sol index 25d923ee1ed..443ea22a107 100644 --- a/contracts/src/v0.8/ccip/libraries/Internal.sol +++ b/contracts/src/v0.8/ccip/libraries/Internal.sol @@ -17,6 +17,11 @@ library Internal { /// @dev The expected number of bytes returned by the balanceOf function. uint256 internal constant MAX_BALANCE_OF_RET_BYTES = 32; + /// @dev The address used to send calls for gas estimation. + /// You only need to use this address if the minimum gas limit specified by the user is not actually enough to execute the + /// given message and you're attempting to estimate the actual necessary gas limit + address public constant GAS_ESTIMATION_SENDER = address(0xC11C11C11C11C11C11C11C11C11C11C11C11C1); + /// @notice A collection of token price and gas price updates. /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. struct PriceUpdates { diff --git a/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol b/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol index b6741f78fbe..a6feb0b069c 100644 --- a/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol +++ b/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.4; import {Ownable2StepMsgSender} from "../../shared/access/Ownable2StepMsgSender.sol"; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {Internal} from "../libraries/Internal.sol"; /// @notice Onchain verification of reports from the offchain reporting protocol with multiple OCR plugin support. abstract contract MultiOCR3Base is ITypeAndVersion, Ownable2StepMsgSender { @@ -42,6 +43,7 @@ abstract contract MultiOCR3Base is ITypeAndVersion, Ownable2StepMsgSender { error NonUniqueSignatures(); error OracleCannotBeZeroAddress(); error StaticConfigCannotBeChanged(uint8 ocrPluginType); + error InsufficientGasForCallWithExact(); /// @dev Packing these fields used on the hot path in a ConfigInfo variable reduces the retrieval of all /// of them to a minimum number of SLOADs. @@ -274,7 +276,9 @@ abstract contract MultiOCR3Base is ITypeAndVersion, Ownable2StepMsgSender { && msg.sender == s_ocrConfigs[ocrPluginType].transmitters[transmitter.index] ) ) { - revert UnauthorizedTransmitter(); + if (msg.sender != Internal.GAS_ESTIMATION_SENDER) { + revert UnauthorizedTransmitter(); + } } } diff --git a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol index 2b6f075bc7a..9ecf41272ab 100644 --- a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol +++ b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol @@ -544,6 +544,14 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { ) internal returns (Internal.MessageExecutionState executionState, bytes memory) { try this.executeSingleMessage(message, offchainTokenData, tokenGasOverrides) {} catch (bytes memory err) { + if (msg.sender == Internal.GAS_ESTIMATION_SENDER) { + if ( + CallWithExactGas.NOT_ENOUGH_GAS_FOR_CALL_SIG == bytes4(err) + || CallWithExactGas.NO_GAS_FOR_CALL_EXACT_CHECK_SIG == bytes4(err) + ) { + revert InsufficientGasForCallWithExact(); + } + } // return the message execution state as FAILURE and the revert data. // Max length of revert data is Router.MAX_RET_BYTES, max length of err is 4 + Router.MAX_RET_BYTES. return (Internal.MessageExecutionState.FAILURE, err); diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.trialExecute.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.trialExecute.t.sol index 1acb4c4ee0a..6b72b25bb61 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.trialExecute.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.trialExecute.t.sol @@ -1,8 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; +import {CallWithExactGas} from "../../../../shared/call/CallWithExactGas.sol"; import {Internal} from "../../../libraries/Internal.sol"; import {RateLimiter} from "../../../libraries/RateLimiter.sol"; +import {MultiOCR3Base} from "../../../ocr/MultiOCR3Base.sol"; import {OffRamp} from "../../../offRamp/OffRamp.sol"; import {OffRampSetup} from "./OffRampSetup.t.sol"; @@ -117,4 +119,59 @@ contract OffRamp_trialExecute is OffRampSetup { assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); assertEq(abi.encodeWithSelector(OffRamp.NotACompatiblePool.selector, address(0)), err); } + + function test_trialExecute_CallWithExactGasRevertsAndSenderIsNotGasEstimator() public { + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + + bytes[] memory offchainTokenData = new bytes[](message.tokenAmounts.length); + uint32[] memory tokenGasOverrides = new uint32[](0); + + vm.mockCallRevert( + address(s_offRamp), + abi.encodeCall(s_offRamp.executeSingleMessage, (message, offchainTokenData, tokenGasOverrides)), + abi.encodeWithSelector(CallWithExactGas.NOT_ENOUGH_GAS_FOR_CALL_SIG, "") + ); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, offchainTokenData, tokenGasOverrides); + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(CallWithExactGas.NotEnoughGasForCall.selector, bytes4(err)); + } + + function test_trialExecute_RevertsWhen_NoGasForCallExactCheckAndSenderIsGasEstimator() public { + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + + bytes[] memory offchainTokenData = new bytes[](message.tokenAmounts.length); + uint32[] memory tokenGasOverrides = new uint32[](0); + + vm.mockCallRevert( + address(s_offRamp), + abi.encodeCall(s_offRamp.executeSingleMessage, (message, offchainTokenData, tokenGasOverrides)), + abi.encodeWithSelector(CallWithExactGas.NO_GAS_FOR_CALL_EXACT_CHECK_SIG, "") + ); + + changePrank(Internal.GAS_ESTIMATION_SENDER); + vm.expectRevert(MultiOCR3Base.InsufficientGasForCallWithExact.selector); + s_offRamp.trialExecute(message, offchainTokenData, tokenGasOverrides); + } + + function test_trialExecute_RevertsWhen_NoEnoughGasForCallSigAndSenderIsGasEstimator() public { + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + + bytes[] memory offchainTokenData = new bytes[](message.tokenAmounts.length); + uint32[] memory tokenGasOverrides = new uint32[](0); + + vm.mockCallRevert( + address(s_offRamp), + abi.encodeCall(s_offRamp.executeSingleMessage, (message, offchainTokenData, tokenGasOverrides)), + abi.encodeWithSelector(CallWithExactGas.NOT_ENOUGH_GAS_FOR_CALL_SIG, "") + ); + + changePrank(Internal.GAS_ESTIMATION_SENDER); + vm.expectRevert(MultiOCR3Base.InsufficientGasForCallWithExact.selector); + s_offRamp.trialExecute(message, offchainTokenData, tokenGasOverrides); + } } diff --git a/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go b/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go index 5a06ea5bea5..3b0b885126a 100644 --- a/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go +++ b/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go @@ -58,8 +58,8 @@ type MultiOCR3BaseOracle struct { } var MultiOCR3HelperMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getOracle\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"oracleAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.Oracle\",\"components\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"role\",\"type\":\"uint8\",\"internalType\":\"enumMultiOCR3Base.Role\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestConfigDetails\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"ocrConfig\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"components\":[{\"name\":\"configInfo\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"n\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setOCR3Configs\",\"inputs\":[{\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setTransmitOcrPluginType\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transmitWithSignatures\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"rs\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"ss\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"rawVs\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transmitWithoutSignatures\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"AfterConfigSet\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ConfigSet\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"signers\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"F\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transmitted\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ConfigDigestMismatch\",\"inputs\":[{\"name\":\"expected\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"actual\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ForkedChain\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidConfig\",\"inputs\":[{\"name\":\"errorType\",\"type\":\"uint8\",\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NonUniqueSignatures\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OracleCannotBeZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignaturesOutOfRegistration\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StaticConfigCannotBeChanged\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedSigner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedTransmitter\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongMessageLength\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WrongNumberOfSignatures\",\"inputs\":[]}]", - Bin: "0x60a080604052346051573315604057600180546001600160a01b0319163317905546608052611f2090816100578239608051818181610f2f015261169b0152f35b639b15e16f60e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806310061068146115df578063181f5a771461150f57806334a9c92e146114285780633ecdb95b14610e2d57806379ba509714610d445780637ac0aa1a14610cdc5780638da5cb5b14610c8a578063c673e58414610b2e578063f2fde38b14610a3b5763f716f99f1461008a57600080fd5b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760043567ffffffffffffffff8111610a365736602382011215610a365780600401356100e481611c1a565b916100f26040519384611bd9565b8183526024602084019260051b82010190368211610a365760248101925b82841061093b5784610120611e58565b6002906000805b82518110156109395761013a8184611dc8565b5190604082019060ff8251161561090a5760ff60208401511692836000528660205260406000206001810190815460ff8116156000146108c6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff62ff00006060860151151560101b1691161782555b60a08301928351956101008751116107dc578651156108975760038301996101eb6101de6101e58d60405192838092611d78565b0382611bd9565b8a611ea3565b6060830151610566575b60005b88518110156103b55773ffffffffffffffffffffffffffffffffffffffff610220828b611dc8565b5116908a600052600360205260ff60408060002060009073ffffffffffffffffffffffffffffffffffffffff86168252602052205460081c16600381101561032e5761038757811561035d578b6040519261027a84611b85565b60ff83168452602084019161032e578f604060ff928f8493865260005260036020528160002073ffffffffffffffffffffffffffffffffffffffff60009216825260205220945116167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008454161783555191600383101561032e576001927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff0083549260081b169116179055016101f8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7fd6c62c9b0000000000000000000000000000000000000000000000000000000060005260046000fd5b7f367f56a2000000000000000000000000000000000000000000000000000000006000526004805260246000fd5b509997969091929394959781519167ffffffffffffffff83116105375768010000000000000000831161053757815483835580841061050e575b509060208d989796959493920190600052602060002060005b8381106104e157505050509360019796936104cb7fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547946104bd7f897ac1b2c12867721b284f3eb147bd4ab046d4eef1cf31c1d8988bfcfb962b53999560ff60209a51169460ff86167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055519485835551916040519687968a88528b88015260a0604088015260a087019101611d78565b908482036060860152611b3b565b9060808301520390a1604051908152a101610127565b825173ffffffffffffffffffffffffffffffffffffffff16818301558e9950602090920191600101610408565b8260005283602060002091820191015b81811061052b57506103ef565b6000815560010161051e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8b840161058360405161057d816101de8186611d78565b8b611ea3565b60808401519061010082511161086957815160ff8551166003029060ff821691820361083a57111561080b5781518a51116107dc5781519087547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff008460081b16911617885567ffffffffffffffff8211610537576801000000000000000082116105375780548282558083106107b3575b506020830190600052602060002060005b8381106107895750600193600093508392509050835b61064c575b505050506101f5565b80518310156107845773ffffffffffffffffffffffffffffffffffffffff6106748483611dc8565b5116928d600052600360205260ff60408060002060009073ffffffffffffffffffffffffffffffffffffffff88168252602052205460081c16600381101561032e5761038757831561035d5782604051946106ce86611b85565b60ff83168652602086019161032e578f604060ff9283928a865260005260036020528160002073ffffffffffffffffffffffffffffffffffffffff60009216825260205220965116167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008654161785555190600382101561032e57859485927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff0083549260081b169116179055019261063e565b610643565b600190602073ffffffffffffffffffffffffffffffffffffffff8551169401938184015501610628565b8160005282602060002091820191015b8181106107d05750610617565b600081556001016107c3565b7f367f56a200000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f367f56a200000000000000000000000000000000000000000000000000000000600052600360045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8d7f367f56a20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f367f56a200000000000000000000000000000000000000000000000000000000600052600560045260246000fd5b60ff606085015115159160101c16151503156101aa57857f87f6037c0000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f367f56a200000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b005b833567ffffffffffffffff8111610a3657820160c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8236030112610a36576040519160c0830183811067ffffffffffffffff82111761053757604052602482013583526109ab60448301611afc565b60208401526109bc60648301611afc565b604084015260848201358015158103610a3657606084015260a482013567ffffffffffffffff8111610a36576109f89060243691850101611c32565b608084015260c48201359267ffffffffffffffff8411610a3657610a26602094936024869536920101611c32565b60a0820152815201930192610110565b600080fd5b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760043573ffffffffffffffffffffffffffffffffffffffff8116809103610a3657610a93611e58565b338114610b0457807fffffffffffffffffffffffff0000000000000000000000000000000000000000600054161760005573ffffffffffffffffffffffffffffffffffffffff600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760ff610b67611aec565b606060408051610b7681611ba1565b8151610b8181611bbd565b60008152600060208201526000838201526000848201528152826020820152015216600052600260205260606040600020610c866003610c5560405193610bc785611ba1565b610bd081611d3f565b8552610c0860405191610bf183610bea8160028501611d78565b0384611bd9565b60208701928352610bea6040518096819301611d78565b6040850192835260405195869560208752518051602088015260ff602082015116604088015260ff604082015116828801520151151560808601525160c060a086015260e0850190611b3b565b90517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160c0850152611b3b565b0390f35b34610a365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a3657602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760ff610d15611aec565b167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006004541617600455600080f35b34610a365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760005473ffffffffffffffffffffffffffffffffffffffff81163303610e03577fffffffffffffffffffffffff00000000000000000000000000000000000000006001549133828416176001551660005573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b34610a365760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365736604411610a365760443567ffffffffffffffff8111610a3657610e84903690600401611abe565b9060643567ffffffffffffffff8111610a3657610ea5903690600401611b0a565b919060843567ffffffffffffffff8111610a3657610eca610ee9913690600401611b0a565b9190610ee160a4359460ff60045416973691611cf3565b923691611cf3565b90846000526002602052610f006040600020611d3f565b9560043594610f0e82611e0b565b97606081019889516113db575b8036036113aa5750805187810361137857507f00000000000000000000000000000000000000000000000000000000000000004681036113475750876000526003602052604060002073ffffffffffffffffffffffffffffffffffffffff331660005260205260406000209860405199610f948b611b85565b5460ff81168b52610faf60ff60208d019260081c1682611ce7565b519960038b101561032e57600260009b1490816112d2575b50156112aa5751611014575b88887f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef060408a815190815267ffffffffffffffff602435166020820152a280f35b60ff611027816020875194015116611e34565b160361128257825184510361125a578761104083611cad565b9161104e6040519384611bd9565b8383526020830193368183011161125657806020928637830101525190206040516020810191825260406004818301376060815261108d608082611bd9565b51902090869281519488945b8686106110a65750610fd3565b60208610156112295760208a60806110bf858a1a611e46565b6110c98a89611dc8565b516110d48b89611dc8565b519060ff604051938c855216868401526040830152606082015282805260015afa1561121e578951898b52600360205273ffffffffffffffffffffffffffffffffffffffff60408c2091168b5260205260408a206040519061113582611b85565b5460ff8116825261115060ff602084019260081c1682611ce7565b5160038110156111f1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016111c957600160ff8251161b82166111a15790600160ff819351161b17950194611099565b60048b7ff67bc7c4000000000000000000000000000000000000000000000000000000008152fd5b60048b7fca31867a000000000000000000000000000000000000000000000000000000008152fd5b60248c7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b6040513d8b823e3d90fd5b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8280fd5b6004887fa75d88af000000000000000000000000000000000000000000000000000000008152fd5b6004887f71253a25000000000000000000000000000000000000000000000000000000008152fd5b60048a7fda0f08e8000000000000000000000000000000000000000000000000000000008152fd5b9050898b52600260205260ff600360408d200191511690805482101561131a579073ffffffffffffffffffffffffffffffffffffffff918c5260208c2001541633148b610fc7565b60248c7f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b7f0f01ce85000000000000000000000000000000000000000000000000000000006000526004524660245260446000fd5b87907f93df584c0000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b7f8e1192e1000000000000000000000000000000000000000000000000000000006000526004523660245260446000fd5b84518060051b908082046020149015171561083a576113f990611e19565b908651918260051b928084046020149015171561083a576114239261141d91611e27565b90611e27565b610f1b565b34610a365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365761145f611aec565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610a365760ff906000602060405161149381611b85565b828152015216600052600360205273ffffffffffffffffffffffffffffffffffffffff604060002091166000526020526040600020604051906114d582611b85565b5460ff811682526114f060ff602084019260081c1682611ce7565b60ff60405192511682525190600382101561032e576040916020820152f35b34610a365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a3657604080519061154d8183611bd9565b601982527f4d756c74694f4352334261736548656c70657220312e302e30000000000000006020830152805180926020825280519081602084015260005b8281106115c85750506000828201840152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168101030190f35b60208282018101518783018701528694500161158b565b34610a365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365736604411610a365760443567ffffffffffffffff8111610a3657611636903690600401611abe565b604051602092916116478483611bd9565b60008252600036813760ff6004541691826000526002855261166c6040600020611d3f565b936004359261167a81611e0b565b9560608101968751611a79575b8036036113aa57508051858103611a4757507f000000000000000000000000000000000000000000000000000000000000000046810361134757508560005260038852604060002073ffffffffffffffffffffffffffffffffffffffff33166000528852604060002096604051976116fe89611b85565b5460ff8116895261171860ff8b8b019260081c1682611ce7565b5197600389101561032e576002600099149081611a01575b50156119d9575161177d575b86867f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef06040888c825191825267ffffffffffffffff6024351690820152a280f35b60ff61178f818a875194015116611e34565b16036119b15761179e81611cad565b906117ac6040519283611bd9565b8082528782019236828201116119ad578188928a928637830101525190206040518681019182526040600481830137606081526117ea608082611bd9565b519020849082519286925b848410611802575061173c565b88841015611980578888608061181982881a611e46565b6118238887611dc8565b5161182e8988611dc8565b519060ff604051938a855216868401526040830152606082015282805260015afa1561197557875187895260038a5273ffffffffffffffffffffffffffffffffffffffff60408a20911689528952604088206040519061188d82611b85565b5460ff811682526118a760ff8c84019260081c1682611ce7565b516003811015611948577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0161192057600160ff8251161b82166118f85790600160ff819351161b179301926117f5565b6004897ff67bc7c4000000000000000000000000000000000000000000000000000000008152fd5b6004897fca31867a000000000000000000000000000000000000000000000000000000008152fd5b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b6040513d89823e3d90fd5b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8780fd5b6004867f71253a25000000000000000000000000000000000000000000000000000000008152fd5b6004887fda0f08e8000000000000000000000000000000000000000000000000000000008152fd5b905087895260028a5260ff600360408b2001915116908054821015611229579073ffffffffffffffffffffffffffffffffffffffff918a528a8a2001541633148a611730565b85907f93df584c0000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b84518060051b908082048b149015171561083a57611a9690611e19565b908551918260051b928084048c149015171561083a57611ab99261141d91611e27565b611687565b9181601f84011215610a365782359167ffffffffffffffff8311610a365760208381860195010111610a3657565b6004359060ff82168203610a3657565b359060ff82168203610a3657565b9181601f84011215610a365782359167ffffffffffffffff8311610a36576020808501948460051b010111610a3657565b906020808351928381520192019060005b818110611b595750505090565b825173ffffffffffffffffffffffffffffffffffffffff16845260209384019390920191600101611b4c565b6040810190811067ffffffffffffffff82111761053757604052565b6060810190811067ffffffffffffffff82111761053757604052565b6080810190811067ffffffffffffffff82111761053757604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761053757604052565b67ffffffffffffffff81116105375760051b60200190565b9080601f83011215610a3657813590611c4a82611c1a565b92611c586040519485611bd9565b82845260208085019360051b820101918211610a3657602001915b818310611c805750505090565b823573ffffffffffffffffffffffffffffffffffffffff81168103610a3657815260209283019201611c73565b67ffffffffffffffff811161053757601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600382101561032e5752565b929190611cff81611c1a565b93611d0d6040519586611bd9565b602085838152019160051b8101928311610a3657905b828210611d2f57505050565b8135815260209182019101611d23565b90604051611d4c81611bbd565b606060ff600183958054855201548181166020850152818160081c16604085015260101c161515910152565b906020825491828152019160005260206000209060005b818110611d9c5750505090565b825473ffffffffffffffffffffffffffffffffffffffff16845260209093019260019283019201611d8f565b8051821015611ddc5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b608401908160841161083a57565b60a001908160a01161083a57565b9190820180921161083a57565b60ff60019116019060ff821161083a57565b60ff601b9116019060ff821161083a57565b73ffffffffffffffffffffffffffffffffffffffff600154163303611e7957565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b91909160005b8351811015611f0d5760019060ff831660005260036020526000604080822073ffffffffffffffffffffffffffffffffffffffff611ee7858a611dc8565b511673ffffffffffffffffffffffffffffffffffffffff16835260205281205501611ea9565b5050905056fea164736f6c634300081a000a", + ABI: "[{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getOracle\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"oracleAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.Oracle\",\"components\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"role\",\"type\":\"uint8\",\"internalType\":\"enumMultiOCR3Base.Role\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestConfigDetails\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"ocrConfig\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"components\":[{\"name\":\"configInfo\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"n\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setOCR3Configs\",\"inputs\":[{\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setTransmitOcrPluginType\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transmitWithSignatures\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"rs\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"ss\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"rawVs\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transmitWithoutSignatures\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"AfterConfigSet\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ConfigSet\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"signers\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"F\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transmitted\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ConfigDigestMismatch\",\"inputs\":[{\"name\":\"expected\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"actual\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ForkedChain\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InsufficientGasForCallWithExact\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidConfig\",\"inputs\":[{\"name\":\"errorType\",\"type\":\"uint8\",\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NonUniqueSignatures\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OracleCannotBeZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignaturesOutOfRegistration\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StaticConfigCannotBeChanged\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedSigner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedTransmitter\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongMessageLength\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WrongNumberOfSignatures\",\"inputs\":[]}]", + Bin: "0x60a080604052346051573315604057600180546001600160a01b0319163317905546608052611f5890816100578239608051818181610f2f01526116b70152f35b639b15e16f60e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806310061068146115fb578063181f5a771461152b57806334a9c92e146114445780633ecdb95b14610e2d57806379ba509714610d445780637ac0aa1a14610cdc5780638da5cb5b14610c8a578063c673e58414610b2e578063f2fde38b14610a3b5763f716f99f1461008a57600080fd5b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760043567ffffffffffffffff8111610a365736602382011215610a365780600401356100e481611c52565b916100f26040519384611c11565b8183526024602084019260051b82010190368211610a365760248101925b82841061093b5784610120611e90565b6002906000805b82518110156109395761013a8184611e00565b5190604082019060ff8251161561090a5760ff60208401511692836000528660205260406000206001810190815460ff8116156000146108c6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff62ff00006060860151151560101b1691161782555b60a08301928351956101008751116107dc578651156108975760038301996101eb6101de6101e58d60405192838092611db0565b0382611c11565b8a611edb565b6060830151610566575b60005b88518110156103b55773ffffffffffffffffffffffffffffffffffffffff610220828b611e00565b5116908a600052600360205260ff60408060002060009073ffffffffffffffffffffffffffffffffffffffff86168252602052205460081c16600381101561032e5761038757811561035d578b6040519261027a84611bbd565b60ff83168452602084019161032e578f604060ff928f8493865260005260036020528160002073ffffffffffffffffffffffffffffffffffffffff60009216825260205220945116167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008454161783555191600383101561032e576001927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff0083549260081b169116179055016101f8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7fd6c62c9b0000000000000000000000000000000000000000000000000000000060005260046000fd5b7f367f56a2000000000000000000000000000000000000000000000000000000006000526004805260246000fd5b509997969091929394959781519167ffffffffffffffff83116105375768010000000000000000831161053757815483835580841061050e575b509060208d989796959493920190600052602060002060005b8381106104e157505050509360019796936104cb7fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547946104bd7f897ac1b2c12867721b284f3eb147bd4ab046d4eef1cf31c1d8988bfcfb962b53999560ff60209a51169460ff86167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055519485835551916040519687968a88528b88015260a0604088015260a087019101611db0565b908482036060860152611b73565b9060808301520390a1604051908152a101610127565b825173ffffffffffffffffffffffffffffffffffffffff16818301558e9950602090920191600101610408565b8260005283602060002091820191015b81811061052b57506103ef565b6000815560010161051e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8b840161058360405161057d816101de8186611db0565b8b611edb565b60808401519061010082511161086957815160ff8551166003029060ff821691820361083a57111561080b5781518a51116107dc5781519087547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff008460081b16911617885567ffffffffffffffff8211610537576801000000000000000082116105375780548282558083106107b3575b506020830190600052602060002060005b8381106107895750600193600093508392509050835b61064c575b505050506101f5565b80518310156107845773ffffffffffffffffffffffffffffffffffffffff6106748483611e00565b5116928d600052600360205260ff60408060002060009073ffffffffffffffffffffffffffffffffffffffff88168252602052205460081c16600381101561032e5761038757831561035d5782604051946106ce86611bbd565b60ff83168652602086019161032e578f604060ff9283928a865260005260036020528160002073ffffffffffffffffffffffffffffffffffffffff60009216825260205220965116167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008654161785555190600382101561032e57859485927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff0083549260081b169116179055019261063e565b610643565b600190602073ffffffffffffffffffffffffffffffffffffffff8551169401938184015501610628565b8160005282602060002091820191015b8181106107d05750610617565b600081556001016107c3565b7f367f56a200000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f367f56a200000000000000000000000000000000000000000000000000000000600052600360045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8d7f367f56a20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f367f56a200000000000000000000000000000000000000000000000000000000600052600560045260246000fd5b60ff606085015115159160101c16151503156101aa57857f87f6037c0000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f367f56a200000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b005b833567ffffffffffffffff8111610a3657820160c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8236030112610a36576040519160c0830183811067ffffffffffffffff82111761053757604052602482013583526109ab60448301611b34565b60208401526109bc60648301611b34565b604084015260848201358015158103610a3657606084015260a482013567ffffffffffffffff8111610a36576109f89060243691850101611c6a565b608084015260c48201359267ffffffffffffffff8411610a3657610a26602094936024869536920101611c6a565b60a0820152815201930192610110565b600080fd5b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760043573ffffffffffffffffffffffffffffffffffffffff8116809103610a3657610a93611e90565b338114610b0457807fffffffffffffffffffffffff0000000000000000000000000000000000000000600054161760005573ffffffffffffffffffffffffffffffffffffffff600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760ff610b67611b24565b606060408051610b7681611bd9565b8151610b8181611bf5565b60008152600060208201526000838201526000848201528152826020820152015216600052600260205260606040600020610c866003610c5560405193610bc785611bd9565b610bd081611d77565b8552610c0860405191610bf183610bea8160028501611db0565b0384611c11565b60208701928352610bea6040518096819301611db0565b6040850192835260405195869560208752518051602088015260ff602082015116604088015260ff604082015116828801520151151560808601525160c060a086015260e0850190611b73565b90517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160c0850152611b73565b0390f35b34610a365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a3657602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b34610a365760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760ff610d15611b24565b167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006004541617600455600080f35b34610a365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760005473ffffffffffffffffffffffffffffffffffffffff81163303610e03577fffffffffffffffffffffffff00000000000000000000000000000000000000006001549133828416176001551660005573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b34610a365760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365736604411610a365760443567ffffffffffffffff8111610a3657610e84903690600401611af6565b9060643567ffffffffffffffff8111610a3657610ea5903690600401611b42565b919060843567ffffffffffffffff8111610a3657610eca610ee9913690600401611b42565b9190610ee160a4359460ff60045416973691611d2b565b923691611d2b565b90846000526002602052610f006040600020611d77565b9560043594610f0e82611e43565b97606081019889516113f7575b8036036113c65750805187810361139457507f00000000000000000000000000000000000000000000000000000000000000004681036113635750876000526003602052604060002073ffffffffffffffffffffffffffffffffffffffff331660005260205260406000209860405199610f948b611bbd565b5460ff81168b52610faf60ff60208d019260081c1682611d1f565b519960038b101561032e57600260009b1490816112ee575b50156112ab575b51611015575b88887f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef060408a815190815267ffffffffffffffff602435166020820152a280f35b60ff611028816020875194015116611e6c565b160361128357825184510361125b578761104183611ce5565b9161104f6040519384611c11565b8383526020830193368183011161125757806020928637830101525190206040516020810191825260406004818301376060815261108e608082611c11565b51902090869281519488945b8686106110a75750610fd4565b602086101561122a5760208a60806110c0858a1a611e7e565b6110ca8a89611e00565b516110d58b89611e00565b519060ff604051938c855216868401526040830152606082015282805260015afa1561121f578951898b52600360205273ffffffffffffffffffffffffffffffffffffffff60408c2091168b5260205260408a206040519061113682611bbd565b5460ff8116825261115160ff602084019260081c1682611d1f565b5160038110156111f2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016111ca57600160ff8251161b82166111a25790600160ff819351161b1795019461109a565b60048b7ff67bc7c4000000000000000000000000000000000000000000000000000000008152fd5b60048b7fca31867a000000000000000000000000000000000000000000000000000000008152fd5b60248c7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b6040513d8b823e3d90fd5b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8280fd5b6004887fa75d88af000000000000000000000000000000000000000000000000000000008152fd5b6004887f71253a25000000000000000000000000000000000000000000000000000000008152fd5b72c11c11c11c11c11c11c11c11c11c11c11c11c1330315610fce5760048a7fda0f08e8000000000000000000000000000000000000000000000000000000008152fd5b9050898b52600260205260ff600360408d2001915116908054821015611336579073ffffffffffffffffffffffffffffffffffffffff918c5260208c2001541633148b610fc7565b60248c7f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b7f0f01ce85000000000000000000000000000000000000000000000000000000006000526004524660245260446000fd5b87907f93df584c0000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b7f8e1192e1000000000000000000000000000000000000000000000000000000006000526004523660245260446000fd5b84518060051b908082046020149015171561083a5761141590611e51565b908651918260051b928084046020149015171561083a5761143f9261143991611e5f565b90611e5f565b610f1b565b34610a365760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365761147b611b24565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610a365760ff90600060206040516114af81611bbd565b828152015216600052600360205273ffffffffffffffffffffffffffffffffffffffff604060002091166000526020526040600020604051906114f182611bbd565b5460ff8116825261150c60ff602084019260081c1682611d1f565b60ff60405192511682525190600382101561032e576040916020820152f35b34610a365760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365760408051906115698183611c11565b601982527f4d756c74694f4352334261736548656c70657220312e302e30000000000000006020830152805180926020825280519081602084015260005b8281106115e45750506000828201840152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168101030190f35b6020828201810151878301870152869450016115a7565b34610a365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a365736604411610a365760443567ffffffffffffffff8111610a3657611652903690600401611af6565b604051602092916116638483611c11565b60008252600036813760ff600454169182600052600285526116886040600020611d77565b936004359261169681611e43565b9560608101968751611ab1575b8036036113c657508051858103611a7f57507f000000000000000000000000000000000000000000000000000000000000000046810361136357508560005260038852604060002073ffffffffffffffffffffffffffffffffffffffff331660005288526040600020966040519761171a89611bbd565b5460ff8116895261173460ff8b8b019260081c1682611d1f565b5197600389101561032e576002600099149081611a39575b50156119f6575b5161179a575b86867f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef06040888c825191825267ffffffffffffffff6024351690820152a280f35b60ff6117ac818a875194015116611e6c565b16036119ce576117bb81611ce5565b906117c96040519283611c11565b8082528782019236828201116119ca578188928a92863783010152519020604051868101918252604060048183013760608152611807608082611c11565b519020849082519286925b84841061181f5750611759565b8884101561199d578888608061183682881a611e7e565b6118408887611e00565b5161184b8988611e00565b519060ff604051938a855216868401526040830152606082015282805260015afa1561199257875187895260038a5273ffffffffffffffffffffffffffffffffffffffff60408a2091168952895260408820604051906118aa82611bbd565b5460ff811682526118c460ff8c84019260081c1682611d1f565b516003811015611965577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0161193d57600160ff8251161b82166119155790600160ff819351161b17930192611812565b6004897ff67bc7c4000000000000000000000000000000000000000000000000000000008152fd5b6004897fca31867a000000000000000000000000000000000000000000000000000000008152fd5b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b6040513d89823e3d90fd5b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8780fd5b6004867f71253a25000000000000000000000000000000000000000000000000000000008152fd5b72c11c11c11c11c11c11c11c11c11c11c11c11c1330315611753576004887fda0f08e8000000000000000000000000000000000000000000000000000000008152fd5b905087895260028a5260ff600360408b200191511690805482101561122a579073ffffffffffffffffffffffffffffffffffffffff918a528a8a2001541633148a61174c565b85907f93df584c0000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b84518060051b908082048b149015171561083a57611ace90611e51565b908551918260051b928084048c149015171561083a57611af19261143991611e5f565b6116a3565b9181601f84011215610a365782359167ffffffffffffffff8311610a365760208381860195010111610a3657565b6004359060ff82168203610a3657565b359060ff82168203610a3657565b9181601f84011215610a365782359167ffffffffffffffff8311610a36576020808501948460051b010111610a3657565b906020808351928381520192019060005b818110611b915750505090565b825173ffffffffffffffffffffffffffffffffffffffff16845260209384019390920191600101611b84565b6040810190811067ffffffffffffffff82111761053757604052565b6060810190811067ffffffffffffffff82111761053757604052565b6080810190811067ffffffffffffffff82111761053757604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761053757604052565b67ffffffffffffffff81116105375760051b60200190565b9080601f83011215610a3657813590611c8282611c52565b92611c906040519485611c11565b82845260208085019360051b820101918211610a3657602001915b818310611cb85750505090565b823573ffffffffffffffffffffffffffffffffffffffff81168103610a3657815260209283019201611cab565b67ffffffffffffffff811161053757601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600382101561032e5752565b929190611d3781611c52565b93611d456040519586611c11565b602085838152019160051b8101928311610a3657905b828210611d6757505050565b8135815260209182019101611d5b565b90604051611d8481611bf5565b606060ff600183958054855201548181166020850152818160081c16604085015260101c161515910152565b906020825491828152019160005260206000209060005b818110611dd45750505090565b825473ffffffffffffffffffffffffffffffffffffffff16845260209093019260019283019201611dc7565b8051821015611e145760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b608401908160841161083a57565b60a001908160a01161083a57565b9190820180921161083a57565b60ff60019116019060ff821161083a57565b60ff601b9116019060ff821161083a57565b73ffffffffffffffffffffffffffffffffffffffff600154163303611eb157565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b91909160005b8351811015611f455760019060ff831660005260036020526000604080822073ffffffffffffffffffffffffffffffffffffffff611f1f858a611e00565b511673ffffffffffffffffffffffffffffffffffffffff16835260205281205501611ee1565b5050905056fea164736f6c634300081a000a", } var MultiOCR3HelperABI = MultiOCR3HelperMetaData.ABI diff --git a/core/gethwrappers/ccip/generated/offramp/offramp.go b/core/gethwrappers/ccip/generated/offramp/offramp.go index 3370efd2261..08a10e52878 100644 --- a/core/gethwrappers/ccip/generated/offramp/offramp.go +++ b/core/gethwrappers/ccip/generated/offramp/offramp.go @@ -156,8 +156,8 @@ type OffRampStaticConfig struct { } var OffRampMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.StaticConfig\",\"components\":[{\"name\":\"chainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"rmnRemote\",\"type\":\"address\",\"internalType\":\"contractIRMNRemote\"},{\"name\":\"tokenAdminRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonceManager\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"dynamicConfig\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"sourceChainConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOffRamp.SourceChainConfigArgs[]\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applySourceChainConfigUpdates\",\"inputs\":[{\"name\":\"sourceChainConfigUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structOffRamp.SourceChainConfigArgs[]\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ccipReceive\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structClient.Any2EVMMessage\",\"components\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sender\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"commit\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"rs\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"ss\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"rawVs\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"execute\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"executeSingleMessage\",\"inputs\":[{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structInternal.Any2EVMRampMessage\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structInternal.RampMessageHeader\",\"components\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"sender\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"receiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.Any2EVMTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destGasAmount\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"offchainTokenData\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenGasOverrides\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getAllSourceChainConfigs\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"},{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structOffRamp.SourceChainConfig[]\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDynamicConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getExecutionState\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumInternal.MessageExecutionState\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestPriceSequenceNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMerkleRoot\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSourceChainConfig\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.SourceChainConfig\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStaticConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.StaticConfig\",\"components\":[{\"name\":\"chainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"rmnRemote\",\"type\":\"address\",\"internalType\":\"contractIRMNRemote\"},{\"name\":\"tokenAdminRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonceManager\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestConfigDetails\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"ocrConfig\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"components\":[{\"name\":\"configInfo\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"n\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"manuallyExecute\",\"inputs\":[{\"name\":\"reports\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.ExecutionReport[]\",\"components\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messages\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.Any2EVMRampMessage[]\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structInternal.RampMessageHeader\",\"components\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"sender\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"receiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.Any2EVMTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destGasAmount\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\",\"internalType\":\"bytes[][]\"},{\"name\":\"proofs\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proofFlagBits\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"gasLimitOverrides\",\"type\":\"tuple[][]\",\"internalType\":\"structOffRamp.GasLimitOverride[][]\",\"components\":[{\"name\":\"receiverExecutionGasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenGasOverrides\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setDynamicConfig\",\"inputs\":[{\"name\":\"dynamicConfig\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOCR3Configs\",\"inputs\":[{\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"AlreadyAttempted\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"CommitReportAccepted\",\"inputs\":[{\"name\":\"merkleRoots\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structInternal.MerkleRoot[]\",\"components\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRampAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maxSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"merkleRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"priceUpdates\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structInternal.PriceUpdates\",\"components\":[{\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"usdPerToken\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]},{\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.GasPriceUpdate[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"usdPerUnitGas\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ConfigSet\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"signers\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"F\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DynamicConfigSet\",\"inputs\":[{\"name\":\"dynamicConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionStateChanged\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"messageId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"state\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\"},{\"name\":\"returnData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"gasUsed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RootRemoved\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SkippedAlreadyExecutedMessage\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SkippedReportExecution\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SourceChainConfigSet\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"sourceConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOffRamp.SourceChainConfig\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SourceChainSelectorAdded\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StaticConfigSet\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOffRamp.StaticConfig\",\"components\":[{\"name\":\"chainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"rmnRemote\",\"type\":\"address\",\"internalType\":\"contractIRMNRemote\"},{\"name\":\"tokenAdminRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonceManager\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transmitted\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CanOnlySelfCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CommitOnRampMismatch\",\"inputs\":[{\"name\":\"reportOnRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"configOnRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"ConfigDigestMismatch\",\"inputs\":[{\"name\":\"expected\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"actual\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"CursedByRMN\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"EmptyBatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EmptyReport\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ExecutionError\",\"inputs\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"err\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"ForkedChain\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidConfig\",\"inputs\":[{\"name\":\"errorType\",\"type\":\"uint8\",\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\"}]},{\"type\":\"error\",\"name\":\"InvalidDataLength\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"got\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidInterval\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"min\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"max\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidManualExecutionGasLimit\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"newLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidManualExecutionTokenGasOverride\",\"inputs\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"tokenIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"oldLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenGasOverride\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageDestChainSelector\",\"inputs\":[{\"name\":\"messageDestChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidNewState\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"newState\",\"type\":\"uint8\",\"internalType\":\"enumInternal.MessageExecutionState\"}]},{\"type\":\"error\",\"name\":\"InvalidOnRampUpdate\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"LeavesCannotBeEmpty\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ManualExecutionGasAmountCountMismatch\",\"inputs\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ManualExecutionGasLimitMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ManualExecutionNotYetEnabled\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MessageValidationError\",\"inputs\":[{\"name\":\"errorReason\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NonUniqueSignatures\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotACompatiblePool\",\"inputs\":[{\"name\":\"notPool\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OracleCannotBeZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReceiverError\",\"inputs\":[{\"name\":\"err\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"ReleaseOrMintBalanceMismatch\",\"inputs\":[{\"name\":\"amountReleased\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"balancePre\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"balancePost\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"RootAlreadyCommitted\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"merkleRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"RootNotCommitted\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"SignatureVerificationNotAllowedInExecutionPlugin\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignatureVerificationRequiredInCommitPlugin\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignaturesOutOfRegistration\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SourceChainNotEnabled\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"SourceChainSelectorMismatch\",\"inputs\":[{\"name\":\"reportSourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageSourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"StaleCommitReport\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StaticConfigCannotBeChanged\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"TokenDataMismatch\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"TokenHandlingError\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"err\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedSigner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedTransmitter\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnexpectedTokenData\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongMessageLength\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WrongNumberOfSignatures\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroAddressNotAllowed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroChainSelectorNotAllowed\",\"inputs\":[]}]", - Bin: "0x6101408060405234610848576162ef803803809161001d828561087e565b833981019080820361014081126108485760a08112610848576040519060a082016001600160401b0381118382101761084d5760405261005c836108a1565b825260208301519261ffff84168403610848576020830193845260408101516001600160a01b0381168103610848576040840190815261009e606083016108b5565b946060850195865260806100b38185016108b5565b86820190815294609f19011261084857604051946100d086610863565b6100dc60a085016108b5565b865260c08401519463ffffffff86168603610848576020870195865261010460e086016108c9565b976040880198895261011961010087016108b5565b6060890190815261012087015190966001600160401b03821161084857018a601f820112156108485780519a6001600160401b038c1161084d578b60051b916020806040519e8f9061016d8388018361087e565b81520193820101908282116108485760208101935b828510610748575050505050331561073757600180546001600160a01b031916331790554660805284516001600160a01b0316158015610725575b8015610713575b6106f15782516001600160401b0316156107025782516001600160401b0390811660a090815286516001600160a01b0390811660c0528351811660e0528451811661010052865161ffff90811661012052604080519751909416875296519096166020860152955185169084015251831660608301525190911660808201527fb0fa1fb01508c5097c502ad056fd77018870c9be9a86d9e56b6b471862d7c5b79190a182516001600160a01b0316156106f1579151600480548351865160ff60c01b90151560c01b1663ffffffff60a01b60a09290921b919091166001600160a01b039485166001600160c81b0319909316831717179091558351600580549184166001600160a01b031990921691909117905560408051918252925163ffffffff166020820152935115159184019190915290511660608201527fcbb53bda7106a610de67df506ac86b65c44d5afac0fd2b11070dc2d61a6f2dee90608090a160005b815181101561066b576020600582901b8301810151908101516001600160401b031690600090821561065c5780516001600160a01b03161561064d57828252600860205260408220906060810151600183019361038585546108d6565b6105ee578354600160a81b600160e81b031916600160a81b1784556040518681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb990602090a15b815180159081156105c3575b506105b4578151916001600160401b0383116105a0576103f986546108d6565b601f811161055b575b50602091601f84116001146104e257926001989796949281926000805160206162cf8339815191529795926104d7575b5050600019600383901b1c191690881b1783555b60408101518254915160a089811b8a9003801960ff60a01b1990951693151590911b60ff60a01b169290921792909216911617815561048484610993565b506104ce6040519283926020845254888060a01b038116602085015260ff8160a01c1615156040850152888060401b039060a81c16606084015260808084015260a0830190610910565b0390a201610328565b015190503880610432565b9190601f198416878452828420935b818110610543575092600199989795939285926000805160206162cf83398151915298968c951061052a575b505050811b018355610446565b015160001960f88460031b161c1916905538808061051d565b929360206001819287860151815501950193016104f1565b86835260208320601f850160051c81019160208610610596575b601f0160051c01905b81811061058b5750610402565b83815560010161057e565b9091508190610575565b634e487b7160e01b82526041600452602482fd5b6342bcdf7f60e11b8152600490fd5b905060208301206040516020810190838252602081526105e460408261087e565b51902014386103d9565b835460a81c6001600160401b0316600114158061061f575b156103cd57632105803760e11b81526004869052602490fd5b50604051610638816106318189610910565b038261087e565b60208151910120825160208401201415610606565b6342bcdf7f60e11b8252600482fd5b63c656089560e01b8252600482fd5b6040516158a89081610a2782396080518161368c015260a05181818161048e01526141a1015260c0518181816104e401528181612cba0152818161310e015261413b015260e051818181610513015261497e01526101005181818161054201526145640152610120518181816104b50152818161243401528181614a7101526155dd0152f35b6342bcdf7f60e11b60005260046000fd5b63c656089560e01b60005260046000fd5b5081516001600160a01b0316156101c4565b5080516001600160a01b0316156101bd565b639b15e16f60e01b60005260046000fd5b84516001600160401b0381116108485782016080818603601f190112610848576040519061077582610863565b60208101516001600160a01b0381168103610848578252610798604082016108a1565b60208301526107a9606082016108c9565b604083015260808101516001600160401b03811161084857602091010185601f820112156108485780516001600160401b03811161084d57604051916107f9601f8301601f19166020018461087e565b81835287602083830101116108485760005b8281106108335750509181600060208096949581960101526060820152815201940193610182565b8060208092840101518282870101520161080b565b600080fd5b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b0382111761084d57604052565b601f909101601f19168101906001600160401b0382119082101761084d57604052565b51906001600160401b038216820361084857565b51906001600160a01b038216820361084857565b5190811515820361084857565b90600182811c92168015610906575b60208310146108f057565b634e487b7160e01b600052602260045260246000fd5b91607f16916108e5565b60009291815491610920836108d6565b8083529260018116908115610976575060011461093c57505050565b60009081526020812093945091925b83831061095c575060209250010190565b60018160209294939454838587010152019101919061094b565b915050602093945060ff929192191683830152151560051b010190565b80600052600760205260406000205415600014610a20576006546801000000000000000081101561084d576001810180600655811015610a0a577ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0181905560065460009182526007602052604090912055600190565b634e487b7160e01b600052603260045260246000fd5b5060009056fe6080604052600436101561001257600080fd5b60003560e01c806304666f9c1461015757806306285c6914610152578063181f5a771461014d5780633f4b04aa146101485780635215505b146101435780635e36480c1461013e5780635e7bb0081461013957806360987c20146101345780637437ff9f1461012f57806379ba50971461012a5780637edf52f41461012557806385572ffb146101205780638da5cb5b1461011b578063c673e58414610116578063ccd37ba314610111578063de5e0b9a1461010c578063e9d68a8e14610107578063f2fde38b14610102578063f58e03fc146100fd5763f716f99f146100f857600080fd5b6118d4565b6117b7565b61172c565b611691565b6115f5565b611571565b6114c6565b6113de565b6113a8565b6111e2565b611162565b6110b9565b61103e565b610e39565b6108ce565b610789565b61067c565b61061d565b61043d565b61031f565b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b0382111761018d57604052565b61015c565b60a081019081106001600160401b0382111761018d57604052565b604081019081106001600160401b0382111761018d57604052565b606081019081106001600160401b0382111761018d57604052565b90601f801991011681019081106001600160401b0382111761018d57604052565b6040519061021360c0836101e3565b565b6040519061021360a0836101e3565b60405190610213610100836101e3565b604051906102136040836101e3565b6001600160401b03811161018d5760051b60200190565b6001600160a01b0381160361026b57565b600080fd5b600435906001600160401b038216820361026b57565b35906001600160401b038216820361026b57565b8015150361026b57565b35906102138261029a565b6001600160401b03811161018d57601f01601f191660200190565b9291926102d6826102af565b916102e460405193846101e3565b82948184528183011161026b578281602093846000960137010152565b9080601f8301121561026b5781602061031c933591016102ca565b90565b3461026b57602036600319011261026b576004356001600160401b03811161026b573660238201121561026b5780600401359061035b82610243565b9061036960405192836101e3565b8282526024602083019360051b8201019036821161026b5760248101935b8285106103995761039784611a0f565b005b84356001600160401b03811161026b5782016080602319823603011261026b57604051916103c683610172565b60248201356103d48161025a565b83526103e260448301610286565b602084015260648201356103f58161029a565b60408401526084820135926001600160401b03841161026b57610422602094936024869536920101610301565b6060820152815201940193610387565b600091031261026b57565b3461026b57600036600319011261026b576000608060405161045e81610192565b82815282602082015282604082015282606082015201526105bc60405161048481610192565b6001600160401b037f000000000000000000000000000000000000000000000000000000000000000016815261ffff7f00000000000000000000000000000000000000000000000000000000000000001660208201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660408201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660608201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660808201526040519182918291909160806001600160a01b038160a08401956001600160401b03815116855261ffff6020820151166020860152826040820151166040860152826060820151166060860152015116910152565b0390f35b604051906105cf6020836101e3565b60008252565b60005b8381106105e85750506000910152565b81810151838201526020016105d8565b90602091610611815180928185528580860191016105d5565b601f01601f1916010190565b3461026b57600036600319011261026b576105bc604080519061064081836101e3565b601182527f4f666652616d7020312e362e302d6465760000000000000000000000000000006020830152519182916020835260208301906105f8565b3461026b57600036600319011261026b5760206001600160401b03600b5416604051908152f35b906080606061031c936001600160a01b0381511684526020810151151560208501526001600160401b03604082015116604085015201519181606082015201906105f8565b6040810160408252825180915260206060830193019060005b81811061076a575050506020818303910152815180825260208201916020808360051b8301019401926000915b83831061073d57505050505090565b909192939460208061075b600193601f1986820301875289516106a3565b9701930193019193929061072e565b82516001600160401b0316855260209485019490920191600101610701565b3461026b57600036600319011261026b576006546107a681610243565b906107b460405192836101e3565b808252601f196107c382610243565b0160005b8181106108855750506107d981611ce2565b9060005b8181106107f55750506105bc604051928392836106e8565b8061082b610813610807600194614022565b6001600160401b031690565b61081d8387611d3c565b906001600160401b03169052565b61086961086461084b61083e8488611d3c565b516001600160401b031690565b6001600160401b03166000526008602052604060002090565b611e28565b6108738287611d3c565b5261087e8186611d3c565b50016107dd565b602090610890611cbb565b828287010152016107c7565b634e487b7160e01b600052602160045260246000fd5b600411156108bc57565b61089c565b9060048210156108bc5752565b3461026b57604036600319011261026b576108e7610270565b602435906001600160401b038216820361026b5760209161090791611ec4565b61091460405180926108c1565bf35b91908260a091031261026b5760405161092e81610192565b60806109738183958035855261094660208201610286565b602086015261095760408201610286565b604086015261096860608201610286565b606086015201610286565b910152565b35906102138261025a565b63ffffffff81160361026b57565b359061021382610983565b81601f8201121561026b578035906109b382610243565b926109c160405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b8385106109ed57505050505090565b84356001600160401b03811161026b57820160a0818503601f19011261026b5760405191610a1a83610192565b60208201356001600160401b03811161026b57856020610a3c92850101610301565b83526040820135610a4c8161025a565b6020840152610a5d60608301610991565b60408401526080820135926001600160401b03841161026b5760a083610a8a886020809881980101610301565b6060840152013560808201528152019401936109de565b9190916101408184031261026b57610ab7610204565b92610ac28183610916565b845260a08201356001600160401b03811161026b5781610ae3918401610301565b602085015260c08201356001600160401b03811161026b5781610b07918401610301565b6040850152610b1860e08301610978565b606085015261010082013560808501526101208201356001600160401b03811161026b57610b46920161099c565b60a0830152565b9080601f8301121561026b578135610b6481610243565b92610b7260405194856101e3565b81845260208085019260051b8201019183831161026b5760208201905b838210610b9e57505050505090565b81356001600160401b03811161026b57602091610bc087848094880101610aa1565b815201910190610b8f565b81601f8201121561026b57803590610be282610243565b92610bf060405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b838510610c1c57505050505090565b84356001600160401b03811161026b57820183603f8201121561026b576020810135610c4781610243565b91610c5560405193846101e3565b8183526020808085019360051b830101019186831161026b5760408201905b838210610c8e575050509082525060209485019401610c0d565b81356001600160401b03811161026b57602091610cb28a8480809589010101610301565b815201910190610c74565b929190610cc981610243565b93610cd760405195866101e3565b602085838152019160051b810192831161026b57905b828210610cf957505050565b8135815260209182019101610ced565b9080601f8301121561026b5781602061031c93359101610cbd565b81601f8201121561026b57803590610d3b82610243565b92610d4960405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b838510610d7557505050505090565b84356001600160401b03811161026b57820160a0818503601f19011261026b57610d9d610215565b91610daa60208301610286565b835260408201356001600160401b03811161026b57856020610dce92850101610b4d565b602084015260608201356001600160401b03811161026b57856020610df592850101610bcb565b60408401526080820135926001600160401b03841161026b5760a083610e22886020809881980101610d09565b606084015201356080820152815201940193610d66565b3461026b57604036600319011261026b576004356001600160401b03811161026b57610e69903690600401610d24565b6024356001600160401b03811161026b573660238201121561026b57806004013591610e9483610243565b91610ea260405193846101e3565b8383526024602084019460051b8201019036821161026b5760248101945b828610610ed1576103978585611f0c565b85356001600160401b03811161026b5782013660438201121561026b576024810135610efc81610243565b91610f0a60405193846101e3565b818352602060248185019360051b830101019036821161026b5760448101925b828410610f44575050509082525060209586019501610ec0565b83356001600160401b03811161026b576024908301016040601f19823603011261026b5760405190610f75826101ad565b6020810135825260408101356001600160401b03811161026b57602091010136601f8201121561026b57803590610fab82610243565b91610fb960405193846101e3565b80835260208084019160051b8301019136831161026b57602001905b828210610ff45750505091816020938480940152815201930192610f2a565b60208091833561100381610983565b815201910190610fd5565b9181601f8401121561026b578235916001600160401b03831161026b576020808501948460051b01011161026b57565b3461026b57606036600319011261026b576004356001600160401b03811161026b5761106e903690600401610aa1565b6024356001600160401b03811161026b5761108d90369060040161100e565b91604435926001600160401b03841161026b576110b161039794369060040161100e565b939092612318565b3461026b57600036600319011261026b576110d26125e5565b506105bc6040516110e281610172565b60ff6004546001600160a01b038116835263ffffffff8160a01c16602084015260c01c16151560408201526001600160a01b036005541660608201526040519182918291909160606001600160a01b0381608084019582815116855263ffffffff6020820151166020860152604081015115156040860152015116910152565b3461026b57600036600319011261026b576000546001600160a01b03811633036111d1576001600160a01b0319600154913382841617600155166000556001600160a01b033391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b63015aa1e360e11b60005260046000fd5b3461026b57608036600319011261026b57600060405161120181610172565b60043561120d8161025a565b815260243561121b81610983565b602082015260443561122c8161029a565b604082015260643561123d8161025a565b606082015261124a613489565b6001600160a01b038151161561139957611393816112a96001600160a01b037fcbb53bda7106a610de67df506ac86b65c44d5afac0fd2b11070dc2d61a6f2dee9451166001600160a01b03166001600160a01b03196004541617600455565b60208101516004547fffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffff77ffffffff000000000000000000000000000000000000000078ff0000000000000000000000000000000000000000000000006040860151151560c01b169360a01b169116171760045561134f61133360608301516001600160a01b031690565b6001600160a01b03166001600160a01b03196005541617600555565b6040519182918291909160606001600160a01b0381608084019582815116855263ffffffff6020820151166020860152604081015115156040860152015116910152565b0390a180f35b6342bcdf7f60e11b8252600482fd5b3461026b57602036600319011261026b576004356001600160401b03811161026b5760a090600319903603011261026b57600080fd5b3461026b57600036600319011261026b5760206001600160a01b0360015416604051908152f35b6004359060ff8216820361026b57565b359060ff8216820361026b57565b906020808351928381520192019060005b8181106114415750505090565b82516001600160a01b0316845260209384019390920191600101611434565b9061031c9160208152606082518051602084015260ff602082015116604084015260ff6040820151168284015201511515608082015260406114b1602084015160c060a085015260e0840190611423565b9201519060c0601f1982850301910152611423565b3461026b57602036600319011261026b5760ff6114e1611405565b6060604080516114f0816101c8565b6114f86125e5565b815282602082015201521660005260026020526105bc6040600020600361156060405192611525846101c8565b61152e8161260a565b845260405161154b816115448160028601612643565b03826101e3565b60208501526115446040518094819301612643565b604082015260405191829182611460565b3461026b57604036600319011261026b5761158a610270565b6001600160401b036024359116600052600a6020526040600020906000526020526020604060002054604051908152f35b9060049160441161026b57565b9181601f8401121561026b578235916001600160401b03831161026b576020838186019501011161026b57565b3461026b5760c036600319011261026b5761160f366115bb565b6044356001600160401b03811161026b5761162e9036906004016115c8565b6064929192356001600160401b03811161026b5761165090369060040161100e565b60843594916001600160401b03861161026b5761167461039796369060040161100e565b94909360a43596612c75565b90602061031c9281815201906106a3565b3461026b57602036600319011261026b576001600160401b036116b2610270565b6116ba611cbb565b501660005260086020526105bc6040600020600161171b604051926116de84610172565b6001600160401b0381546001600160a01b038116865260ff8160a01c161515602087015260a81c1660408501526115446040518094819301611d8a565b606082015260405191829182611680565b3461026b57602036600319011261026b576001600160a01b036004356117518161025a565b611759613489565b163381146117a657806001600160a01b031960005416176000556001600160a01b03600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b636d6c4ee560e11b60005260046000fd5b3461026b57606036600319011261026b576117d1366115bb565b6044356001600160401b03811161026b576117f09036906004016115c8565b9182820160208382031261026b578235906001600160401b03821161026b5761181a918401610d24565b60405190602061182a81846101e3565b60008352601f19810160005b81811061185e57505050610397949161184e916136cd565b611856613184565b928392613a33565b60608582018401528201611836565b9080601f8301121561026b57813561188481610243565b9261189260405194856101e3565b81845260208085019260051b82010192831161026b57602001905b8282106118ba5750505090565b6020809183356118c98161025a565b8152019101906118ad565b3461026b57602036600319011261026b576004356001600160401b03811161026b573660238201121561026b5780600401359061191082610243565b9061191e60405192836101e3565b8282526024602083019360051b8201019036821161026b5760248101935b82851061194c57610397846131a0565b84356001600160401b03811161026b57820160c0602319823603011261026b57611974610204565b916024820135835261198860448301611415565b602084015261199960648301611415565b60408401526119aa608483016102a4565b606084015260a48201356001600160401b03811161026b576119d2906024369185010161186d565b608084015260c4820135926001600160401b03841161026b576119ff60209493602486953692010161186d565b60a082015281520194019361193c565b611a17613489565b60005b8151811015611cb757611a2d8183611d3c565b5190611a4360208301516001600160401b031690565b916001600160401b038316908115611ca657611a78611a6c611a6c83516001600160a01b031690565b6001600160a01b031690565b15611c0d57611a9a846001600160401b03166000526008602052604060002090565b906060810151916001810195611ab08754611d50565b611c3457611b237ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb991611b0984750100000000000000000000000000000000000000000067ffffffffffffffff60a81b19825416179055565b6040516001600160401b0390911681529081906020820190565b0390a15b82518015908115611c1e575b50611c0d57611bee611bd2611c0493611b6f7f49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b9660019a61352b565b611bc5611b7f6040830151151590565b85547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690151560a01b74ff000000000000000000000000000000000000000016178555565b516001600160a01b031690565b82906001600160a01b03166001600160a01b0319825416179055565b611bf78461504a565b50604051918291826135fc565b0390a201611a1a565b6342bcdf7f60e11b60005260046000fd5b90506020840120611c2d6134ae565b1438611b33565b60016001600160401b03611c5384546001600160401b039060a81c1690565b16141580611c87575b611c665750611b27565b632105803760e11b6000526001600160401b031660045260246000fd5b6000fd5b50611c9187611e0d565b60208151910120845160208601201415611c5c565b63c656089560e01b60005260046000fd5b5050565b60405190611cc882610172565b606080836000815260006020820152600060408201520152565b90611cec82610243565b611cf960405191826101e3565b8281528092611d0a601f1991610243565b0190602036910137565b634e487b7160e01b600052603260045260246000fd5b805115611d375760200190565b611d14565b8051821015611d375760209160051b010190565b90600182811c92168015611d80575b6020831014611d6a57565b634e487b7160e01b600052602260045260246000fd5b91607f1691611d5f565b60009291815491611d9a83611d50565b8083529260018116908115611df05750600114611db657505050565b60009081526020812093945091925b838310611dd6575060209250010190565b600181602092949394548385870101520191019190611dc5565b915050602093945060ff929192191683830152151560051b010190565b90610213611e219260405193848092611d8a565b03836101e3565b9060016060604051611e3981610172565b611e8281956001600160401b0381546001600160a01b038116855260ff8160a01c161515602086015260a81c166040840152611e7b6040518096819301611d8a565b03846101e3565b0152565b634e487b7160e01b600052601160045260246000fd5b908160051b9180830460201490151715611eb257565b611e86565b91908203918211611eb257565b611ed082607f92613646565b9116906801fffffffffffffffe6001600160401b0383169260011b169180830460021490151715611eb2576003911c1660048110156108bc5790565b611f1461368a565b80518251810361210b5760005b818110611f3457505090610213916136cd565b611f3e8184611d3c565b516020810190815151611f518488611d3c565b51928351820361210b5790916000925b808410611f75575050505050600101611f21565b91949398611f87848b98939598611d3c565b515198611f95888851611d3c565b5199806120c2575b5060a08a01988b6020611fb38b8d515193611d3c565b51015151036120855760005b8a515181101561207057611ffb611ff2611fe88f6020611fe08f8793611d3c565b510151611d3c565b5163ffffffff1690565b63ffffffff1690565b8b8161200c575b5050600101611fbf565b611ff2604061201f8561202b9451611d3c565b51015163ffffffff1690565b9081811061203a57508b612002565b8d51516040516348e617b360e01b81526004810191909152602481019390935260448301919091526064820152608490fd5b0390fd5b50985098509893949095600101929091611f61565b611c838b516120a0606082519201516001600160401b031690565b6370a193fd60e01b6000526004919091526001600160401b0316602452604490565b60808b0151811015611f9d57611c83908b6120e488516001600160401b031690565b905151633a98d46360e11b6000526001600160401b03909116600452602452604452606490565b6320f8fd5960e21b60005260046000fd5b60405190612129826101ad565b60006020838281520152565b604051906121446020836101e3565b600080835282815b82811061215857505050565b60209061216361211c565b8282850101520161214c565b805182526001600160401b03602082015116602083015260806121b66121a4604084015160a0604087015260a08601906105f8565b606084015185820360608701526105f8565b9101519160808183039101526020808351928381520192019060005b8181106121df5750505090565b825180516001600160a01b0316855260209081015181860152604090940193909201916001016121d2565b90602061031c92818152019061216f565b6040513d6000823e3d90fd5b3d15612252573d90612238826102af565b9161224660405193846101e3565b82523d6000602084013e565b606090565b90602061031c9281815201906105f8565b909160608284031261026b57815161227f8161029a565b9260208301516001600160401b03811161026b5783019080601f8301121561026b578151916122ad836102af565b916122bb60405193846101e3565b8383526020848301011161026b576040926122dc91602080850191016105d5565b92015190565b9293606092959461ffff6123066001600160a01b039460808852608088019061216f565b97166020860152604085015216910152565b929093913033036125d45761232b612135565b9460a0850151805161258d575b5050505050805191612356602084519401516001600160401b031690565b906020830151916040840192612383845192612370610215565b9788526001600160401b03166020880152565b6040860152606085015260808401526001600160a01b036123ac6005546001600160a01b031690565b1680612510575b5051511580612504575b80156124ee575b80156124c5575b611cb75761245d9181612402611a6c6123f561084b602060009751016001600160401b0390511690565b546001600160a01b031690565b908361241d606060808401519301516001600160a01b031690565b604051633cf9798360e01b815296879586948593917f000000000000000000000000000000000000000000000000000000000000000090600486016122e2565b03925af19081156124c057600090600092612499575b501561247c5750565b6040516302a35ba360e21b815290819061206c9060048301612257565b90506124b891503d806000833e6124b081836101e3565b810190612268565b509038612473565b61221b565b506124e96124e56124e060608401516001600160a01b031690565b6138f4565b1590565b6123cb565b5060608101516001600160a01b03163b156123c4565b506080810151156123bd565b803b1561026b57600060405180926308d450a160e01b82528183816125388a6004830161220a565b03925af19081612572575b5061256c5761206c612553612227565b6040516309c2532560e01b815291829160048301612257565b386123b3565b806125816000612587936101e3565b80610432565b38612543565b85965060206125c99601516125ac60608901516001600160a01b031690565b906125c360208a51016001600160401b0390511690565b926137db565b903880808080612338565b6306e34e6560e31b60005260046000fd5b604051906125f282610172565b60006060838281528260208201528260408201520152565b9060405161261781610172565b606060ff600183958054855201548181166020850152818160081c16604085015260101c161515910152565b906020825491828152019160005260206000209060005b8181106126675750505090565b82546001600160a01b031684526020909301926001928301920161265a565b90610213611e219260405193848092612643565b35906001600160e01b038216820361026b57565b81601f8201121561026b578035906126c582610243565b926126d360405194856101e3565b82845260208085019360061b8301019181831161026b57602001925b8284106126fd575050505090565b60408483031261026b5760206040918251612717816101ad565b61272087610286565b815261272d83880161269a565b838201528152019301926126ef565b81601f8201121561026b5780359061275382610243565b9261276160405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b83851061278d57505050505090565b84356001600160401b03811161026b57820160a0818503601f19011261026b57604051916127ba83610192565b6127c660208301610286565b83526040820135926001600160401b03841161026b5760a0836127f0886020809881980101610301565b8584015261280060608201610286565b604084015261281160808201610286565b60608401520135608082015281520194019361277e565b81601f8201121561026b5780359061283f82610243565b9261284d60405194856101e3565b82845260208085019360061b8301019181831161026b57602001925b828410612877575050505090565b60408483031261026b5760206040918251612891816101ad565b863581528287013583820152815201930192612869565b60208183031261026b578035906001600160401b03821161026b570160608183031261026b57604051916128db836101c8565b81356001600160401b03811161026b57820160408183031261026b5760405190612904826101ad565b80356001600160401b03811161026b57810183601f8201121561026b57803561292c81610243565b9161293a60405193846101e3565b81835260208084019260061b8201019086821161026b57602001915b8183106129d25750505082526020810135906001600160401b03821161026b57612982918491016126ae565b6020820152835260208201356001600160401b03811161026b57816129a891840161273c565b602084015260408201356001600160401b03811161026b576129ca9201612828565b604082015290565b60408388031261026b57602060409182516129ec816101ad565b85356129f78161025a565b8152612a0483870161269a565b83820152815201920191612956565b9080602083519182815201916020808360051b8301019401926000915b838310612a3f57505050505090565b9091929394602080600192601f198582030186528851906001600160401b038251168152608080612a7d8585015160a08786015260a08501906105f8565b936001600160401b0360408201511660408501526001600160401b036060820151166060850152015191015297019301930191939290612a30565b916001600160a01b03612ad992168352606060208401526060830190612a13565b9060408183039101526020808351928381520192019060005b818110612aff5750505090565b8251805185526020908101518186015260409094019390920191600101612af2565b906020808351928381520192019060005b818110612b3f5750505090565b825180516001600160401b031685526020908101516001600160e01b03168186015260409094019390920191600101612b32565b9190604081019083519160408252825180915260206060830193019060005b818110612bb357505050602061031c93940151906020818403910152612b21565b825180516001600160a01b031686526020908101516001600160e01b03168187015260409095019490920191600101612b92565b90602061031c928181520190612b73565b9081602091031261026b575161031c8161029a565b9091612c2461031c936040845260408401906105f8565b916020818403910152611d8a565b6001600160401b036001911601906001600160401b038211611eb257565b9091612c6761031c93604084526040840190612a13565b916020818403910152612b73565b929693959190979497612c8a828201826128a8565b98612c9e6124e560045460ff9060c01c1690565b6130f2575b895180515115908115916130e3575b5061300a575b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316999860208a019860005b8a518051821015612fa85781612d0191611d3c565b518d612d1482516001600160401b031690565b604051632cbc26bb60e01b815267ffffffffffffffff60801b608083901b1660048201529091602090829060249082905afa9081156124c057600091612f7a575b50612f5d57612d6390613942565b60208201805160208151910120906001830191612d7f83611e0d565b6020815191012003612f40575050805460408301516001600160401b039081169160a81c168114801590612f18575b612ec657506080820151908115612eb557612dff82612df0612dd786516001600160401b031690565b6001600160401b0316600052600a602052604060002090565b90600052602052604060002090565b54612e81578291612e65612e7a92612e2c612e2760606001999801516001600160401b031690565b612c32565b67ffffffffffffffff60a81b197cffffffffffffffff00000000000000000000000000000000000000000083549260a81b169116179055565b612df0612dd74294516001600160401b031690565b5501612cec565b50612e96611c8392516001600160401b031690565b6332cf0cbf60e01b6000526001600160401b0316600452602452604490565b63504570e360e01b60005260046000fd5b82611c8391612ef06060612ee184516001600160401b031690565b9301516001600160401b031690565b636af0786b60e11b6000526001600160401b0392831660045290821660245216604452606490565b50612f3061080760608501516001600160401b031690565b6001600160401b03821611612dae565b5161206c60405192839263b80d8fa960e01b845260048401612c0d565b637edeb53960e11b6000526001600160401b031660045260246000fd5b612f9b915060203d8111612fa1575b612f9381836101e3565b810190612bf8565b38612d55565b503d612f89565b50506130049496989b507f35c02761bcd3ef995c6a601a1981f4ed3934dcbe5041e24e286c89f5531d17e46102139b612ffc949597999b51905190612ff260405192839283612c50565b0390a13691610cbd565b943691610cbd565b93613d11565b61301f602086015b356001600160401b031690565b600b546001600160401b03828116911610156130c757613055906001600160401b03166001600160401b0319600b541617600b55565b61306d611a6c611a6c6004546001600160a01b031690565b8a5190803b1561026b57604051633937306f60e01b815291600091839182908490829061309d9060048301612be7565b03925af180156124c0576130b2575b50612cb8565b8061258160006130c1936101e3565b386130ac565b5060208a015151612cb857632261116760e01b60005260046000fd5b60209150015151151538612cb2565b60208a01518051613104575b50612ca3565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060408c0151823b1561026b57604051633854844f60e11b815292600092849283918291613160913060048501612ab8565b03915afa80156124c057156130fe5780612581600061317e936101e3565b386130fe565b604051906131936020836101e3565b6000808352366020840137565b6131a8613489565b60005b8151811015611cb7576131be8183611d3c565b51906040820160ff6131d1825160ff1690565b161561347357602083015160ff16926131f78460ff166000526002602052604060002090565b916001830191825461321261320c8260ff1690565b60ff1690565b613438575061323f6132276060830151151590565b845462ff0000191690151560101b62ff000016178455565b60a081019182516101008151116133e057805115613422576003860161326d61326782612686565b8a614df8565b60608401516132fd575b947fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547946002946132d96132c96132f79a966132c28760019f9c6132bd6132ef9a8f614f59565b613f25565b5160ff1690565b845460ff191660ff821617909455565b5190818555519060405195869501908886613fab565b0390a1614fdb565b016131ab565b9794600287939597019661331961331389612686565b88614df8565b60808501519461010086511161340c57855161334161320c61333c8a5160ff1690565b613f11565b10156133f65785518451116133e0576132d96132c97fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547986132c28760019f6132bd6132f79f9a8f6133c860029f6133c26132ef9f8f906132bd84926133a7845160ff1690565b908054909161ff001990911660089190911b61ff0016179055565b82614e8c565b505050979c9f50975050969a50505094509450613277565b631b3fab5160e11b600052600160045260246000fd5b631b3fab5160e11b600052600360045260246000fd5b631b3fab5160e11b600052600260045260246000fd5b631b3fab5160e11b600052600560045260246000fd5b60101c60ff1661345361344e6060840151151590565b151590565b9015151461323f576321fd80df60e21b60005260ff861660045260246000fd5b631b3fab5160e11b600090815260045260246000fd5b6001600160a01b0360015416330361349d57565b6315ae3a6f60e11b60005260046000fd5b604051602081019060008252602081526134c96040826101e3565b51902090565b8181106134da575050565b600081556001016134cf565b9190601f81116134f557505050565b610213926000526020600020906020601f840160051c83019310613521575b601f0160051c01906134cf565b9091508190613514565b91909182516001600160401b03811161018d576135528161354c8454611d50565b846134e6565b6020601f8211600114613593578190613584939495600092613588575b50508160011b916000199060031b1c19161790565b9055565b01519050388061356f565b601f198216906135a884600052602060002090565b9160005b8181106135e4575095836001959697106135cb575b505050811b019055565b015160001960f88460031b161c191690553880806135c1565b9192602060018192868b0151815501940192016135ac565b90600160a061031c93602081526001600160401b0384546001600160a01b038116602084015260ff81851c161515604084015260a81c166060820152608080820152019101611d8a565b906001600160401b03613686921660005260096020526701ffffffffffffff60406000209160071c166001600160401b0316600052602052604060002090565b5490565b7f00000000000000000000000000000000000000000000000000000000000000004681036136b55750565b630f01ce8560e01b6000526004524660245260446000fd5b91909180511561376f5782511592602091604051926136ec81856101e3565b60008452601f19810160005b81811061374b5750505060005b8151811015613743578061372c61371e60019385611d3c565b5188156137325786906140ea565b01613705565b61373c8387611d3c565b51906140ea565b505050509050565b8290604051613759816101ad565b60008152606083820152828289010152016136f8565b63c2e5347d60e01b60005260046000fd5b9190811015611d375760051b0190565b3561031c81610983565b9190811015611d375760051b81013590601e198136030182121561026b5701908135916001600160401b03831161026b57602001823603811361026b579190565b909294919397968151966137ee88610243565b976137fc604051998a6101e3565b80895261380b601f1991610243565b0160005b8181106138dd57505060005b83518110156138d057806138628c8a8a8a61385c613855878d61384e828f8f9d8f9e60019f8161387e575b505050611d3c565b519761379a565b36916102ca565b9361492f565b61386c828c611d3c565b52613877818b611d3c565b500161381b565b63ffffffff613896613891858585613780565b613790565b1615613846576138c6926138ad9261389192613780565b60406138b98585611d3c565b51019063ffffffff169052565b8f8f908391613846565b5096985050505050505050565b6020906138e861211c565b82828d0101520161380f565b6139056385572ffb60e01b82614c92565b908161391f575b81613915575090565b61031c9150614c64565b905061392a81614be9565b159061390c565b61390563aff2afbf60e01b82614c92565b6001600160401b031680600052600860205260406000209060ff825460a01c161561396b575090565b63ed053c5960e01b60005260045260246000fd5b6084019081608411611eb257565b60a001908160a011611eb257565b91908201809211611eb257565b600311156108bc57565b60038210156108bc5752565b906102136040516139ce816101ad565b602060ff829554818116845260081c1691016139b2565b8054821015611d375760005260206000200190600090565b60ff60019116019060ff8211611eb257565b60ff601b9116019060ff8211611eb257565b90606092604091835260208301370190565b6001600052600260205293613a677fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e061260a565b93853594613a748561397f565b6060820190613a838251151590565b613ce3575b803603613ccb57508151878103613cb25750613aa261368a565b60016000526003602052613af1613aec7fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c5b336001600160a01b0316600052602052604060002090565b6139be565b60026020820151613b01816139a8565b613b0a816139a8565b149081613c4a575b5015613c395751613b70575b50505050507f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef090613b5461301260019460200190565b604080519283526001600160401b0391909116602083015290a2565b613b9161320c613b8c602085969799989a955194015160ff1690565b6139fd565b03613c28578151835103613c1757613c0f6000613b549461301294613bdb7f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef09960019b36916102ca565b60208151910120604051613c0681613bf889602083019586613a21565b03601f1981018352826101e3565b5190208a614cc2565b948394613b1e565b63a75d88af60e01b60005260046000fd5b6371253a2560e01b60005260046000fd5b631b41e11d60e31b60005260046000fd5b60016000526002602052613caa9150611a6c90613c9790613c9160037fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e05b01915160ff1690565b906139e5565b90546001600160a01b039160031b1c1690565b331438613b12565b6324f7d61360e21b600052600452602487905260446000fd5b638e1192e160e01b6000526004523660245260446000fd5b613d0c90613d06613cfc613cf78751611e9c565b61398d565b613d068851611e9c565b9061399b565b613a88565b60008052600260205294909390929091613d4a7fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b61260a565b94863595613d578361397f565b6060820190613d668251151590565b613eee575b803603613ccb57508151888103613ed55750613d8561368a565b600080526003602052613dba613aec7f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff613ad4565b60026020820151613dca816139a8565b613dd3816139a8565b149081613e8c575b5015613c395751613e1e575b5050505050507f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef090613b5461301260009460200190565b613e3a61320c613b8c602087989a999b96975194015160ff1690565b03613c28578351865103613c17576000967f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef096613b5495613bdb613e83946130129736916102ca565b94839438613de7565b600080526002602052613ecd9150611a6c90613c9790613c9160037fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b613c88565b331438613ddb565b6324f7d61360e21b600052600452602488905260446000fd5b613f0c90613d06613f02613cf78951611e9c565b613d068a51611e9c565b613d6b565b60ff166003029060ff8216918203611eb257565b8151916001600160401b03831161018d5768010000000000000000831161018d576020908254848455808510613f8e575b500190600052602060002060005b838110613f715750505050565b60019060206001600160a01b038551169401938184015501613f64565b613fa59084600052858460002091820191016134cf565b38613f56565b95949392909160ff613fd093168752602087015260a0604087015260a0860190612643565b84810360608601526020808351928381520192019060005b818110614003575050509060806102139294019060ff169052565b82516001600160a01b0316845260209384019390920191600101613fe8565b600654811015611d375760066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f015490565b6001600160401b0361031c94938160609416835216602082015281604082015201906105f8565b60409061031c9392815281602082015201906105f8565b9291906001600160401b039081606495166004521660245260048110156108bc57604452565b9493926140d46060936140e593885260208801906108c1565b6080604087015260808601906105f8565b930152565b906140fc82516001600160401b031690565b8151604051632cbc26bb60e01b815267ffffffffffffffff60801b608084901b1660048201529015159391906001600160401b038216906020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156124c057600091614818575b506147d65760208301918251519485156147a6576040850180515187036147955761419e87611ce2565b957f00000000000000000000000000000000000000000000000000000000000000006141d460016141ce87613942565b01611e0d565b6020815191012060405161423481613bf86020820194868b876001600160401b036060929594938160808401977f2425b0b9f9054c76ff151b0a175b18f37a4a4e82013a72e9f15c9caa095ed21f85521660208401521660408201520152565b519020906001600160401b031660005b8a81106146fd57505050806080606061426493015191015190888661528b565b9788156146df5760005b8881106142815750505050505050505050565b5a61428d828951611d3c565b518051606001516142a7906001600160401b031688611ec4565b6142b0816108b2565b8015908d82831593846146cc575b15614689576060881561460c57506142e560206142db898d611d3c565b5101519242611eb7565b6004546142fa9060a01c63ffffffff16611ff2565b1080156145f9575b156145db57614311878b611d3c565b51516145c5575b845160800151614330906001600160401b0316610807565b61450d575b50614341868951611d3c565b5160a0850151518151036144d157936143a69695938c938f966143868e958c9261438061437a60608951016001600160401b0390511690565b896152bd565b86615464565b9a9080966143a060608851016001600160401b0390511690565b90615345565b61447f575b50506143b6826108b2565b60028203614437575b60019661442d7f05665fe9ad095383d018353f4cbcba77e84db27dd215081bbf7cdf9ae6fbe48b936001600160401b0393519261441e6144158b61440d60608801516001600160401b031690565b96519b611d3c565b51985a90611eb7565b916040519586951698856140bb565b0390a45b0161426e565b91509193949250614447826108b2565b6003820361445b578b929493918a916143bf565b51606001516349362d1f60e11b600052611c8391906001600160401b031689614095565b614488846108b2565b600384036143ab5790929495506144a09193506108b2565b6144b0578b92918a9138806143ab565b5151604051632b11b8d960e01b815290819061206c9087906004840161407e565b611c838b6144eb60608851016001600160401b0390511690565b631cfe6d8b60e01b6000526001600160401b0391821660045216602452604490565b614516836108b2565b614521575b38614335565b8351608001516001600160401b0316602080860151918c61455660405194859384936370701e5760e11b855260048501614057565b038160006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156124c0576000916145a7575b5061451b575050505050600190614431565b6145bf915060203d8111612fa157612f9381836101e3565b38614595565b6145cf878b611d3c565b51516080860152614318565b6354e7e43160e11b6000526001600160401b038b1660045260246000fd5b50614603836108b2565b60038314614302565b915083614618846108b2565b1561431857506001959450614681925061465f91507f3ef2a99c550a751d4b0b261268f05a803dfb049ab43616a1ffb388f61fe651209351016001600160401b0390511690565b604080516001600160401b03808c168252909216602083015290918291820190565b0390a1614431565b50505050600192915061468161465f60607f3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c9351016001600160401b0390511690565b506146d6836108b2565b600383146142be565b633ee8bd3f60e11b6000526001600160401b03841660045260246000fd5b614708818a51611d3c565b518051604001516001600160401b031683810361477857508051602001516001600160401b031689810361475557509061474484600193615183565b61474e828d611d3c565b5201614244565b636c95f1eb60e01b6000526001600160401b03808a166004521660245260446000fd5b631c21951160e11b6000526001600160401b031660045260246000fd5b6357e0e08360e01b60005260046000fd5b611c836147ba86516001600160401b031690565b63676cf24b60e11b6000526001600160401b0316600452602490565b5092915050612f5d576040516001600160401b039190911681527faab522ed53d887e56ed53dd37398a01aeef6a58e0fa77c2173beb9512d89493390602090a1565b614831915060203d602011612fa157612f9381836101e3565b38614174565b9081602091031261026b575161031c8161025a565b9061031c916020815260e06148ea6148d5614875855161010060208701526101208601906105f8565b60208601516001600160401b0316604086015260408601516001600160a01b03166060860152606086015160808601526148bf608087015160a08701906001600160a01b03169052565b60a0860151858203601f190160c08701526105f8565b60c0850151848203601f1901848601526105f8565b92015190610100601f19828503019101526105f8565b6040906001600160a01b0361031c949316815281602082015201906105f8565b9081602091031261026b575190565b9193929361493b61211c565b5060208301516001600160a01b031660405163bbe4f6db60e01b81526001600160a01b038216600482015290959092602084806024810103816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156124c057600094614bb8575b506001600160a01b0384169586158015614ba6575b614b8857614a6d614a9692613bf8926149f16149ea611ff260408c015163ffffffff1690565b8c896155a5565b9690996080810151614a1f6060835193015193614a0c610224565b9687526001600160401b03166020870152565b6001600160a01b038a16604086015260608501526001600160a01b038d16608085015260a084015260c083015260e0820152604051633907753760e01b60208201529283916024830161484c565b82857f000000000000000000000000000000000000000000000000000000000000000092615633565b94909115614b6c5750805160208103614b53575090614abf826020808a95518301019101614920565b956001600160a01b03841603614af7575b5050505050614aef614ae0610234565b6001600160a01b039093168352565b602082015290565b614b0a93614b0491611eb7565b916155a5565b50908082108015614b40575b614b2257808481614ad0565b63a966e21f60e01b6000908152600493909352602452604452606490fd5b5082614b4c8284611eb7565b1415614b16565b631e3be00960e21b600052602060045260245260446000fd5b61206c604051928392634ff17cad60e11b845260048401614900565b63ae9b4ce960e01b6000526001600160a01b03851660045260246000fd5b50614bb36124e586613931565b6149c4565b614bdb91945060203d602011614be2575b614bd381836101e3565b810190614837565b92386149af565b503d614bc9565b60405160208101916301ffc9a760e01b835263ffffffff60e01b602483015260248252614c176044836101e3565b6179185a10614c53576020926000925191617530fa6000513d82614c47575b5081614c40575090565b9050151590565b60201115915038614c36565b63753fa58960e11b60005260046000fd5b60405160208101916301ffc9a760e01b83526301ffc9a760e01b602483015260248252614c176044836101e3565b6040519060208201926301ffc9a760e01b845263ffffffff60e01b16602483015260248252614c176044836101e3565b919390926000948051946000965b868810614ce1575050505050505050565b6020881015611d375760206000614cf9878b1a613a0f565b614d038b87611d3c565b5190614d3a614d128d8a611d3c565b5160405193849389859094939260ff6060936080840197845216602083015260408201520152565b838052039060015afa156124c057614d80613aec600051614d688960ff166000526003602052604060002090565b906001600160a01b0316600052602052604060002090565b9060016020830151614d91816139a8565b614d9a816139a8565b03614de757614db7614dad835160ff1690565b60ff600191161b90565b8116614dd657614dcd614dad6001935160ff1690565b17970196614cd0565b633d9ef1f160e21b60005260046000fd5b636518c33d60e11b60005260046000fd5b91909160005b8351811015614e515760019060ff831660005260036020526000614e4a604082206001600160a01b03614e31858a611d3c565b51166001600160a01b0316600052602052604060002090565b5501614dfe565b50509050565b8151815460ff191660ff91909116178155906020015160038110156108bc57815461ff00191660089190911b61ff0016179055565b919060005b8151811015614e5157614ea7611bc58284611d3c565b90614ed0614ec683614d688860ff166000526003602052604060002090565b5460081c60ff1690565b614ed9816139a8565b614f44576001600160a01b03821615614f3357614f2d600192614f28614efd610234565b60ff8516815291614f1186602085016139b2565b614d688960ff166000526003602052604060002090565b614e57565b01614e91565b63d6c62c9b60e01b60005260046000fd5b631b3fab5160e11b6000526004805260246000fd5b919060005b8151811015614e5157614f74611bc58284611d3c565b90614f93614ec683614d688860ff166000526003602052604060002090565b614f9c816139a8565b614f44576001600160a01b03821615614f3357614fd5600192614f28614fc0610234565b60ff8516815291614f116002602085016139b2565b01614f5e565b60ff1680600052600260205260ff60016040600020015460101c16908015600014615029575015615018576001600160401b0319600b5416600b55565b6317bd8dd160e11b60005260046000fd5b6001146150335750565b61503957565b6307b8c74d60e51b60005260046000fd5b806000526007602052604060002054156000146150c8576006546801000000000000000081101561018d57600181016006556000600654821015611d3757600690527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01819055600654906000526007602052604060002055600190565b50600090565b9080602083519182815201916020808360051b8301019401926000915b8383106150fa57505050505090565b9091929394602080600192601f1985820301865288519060808061515d61512a855160a0865260a08601906105f8565b6001600160a01b0387870151168786015263ffffffff6040870151166040860152606086015185820360608701526105f8565b930151910152970193019301919392906150eb565b90602061031c9281815201906150ce565b6134c981518051906152176151a260608601516001600160a01b031690565b613bf86151b960608501516001600160401b031690565b936151d26080808a01519201516001600160401b031690565b90604051958694602086019889936001600160401b036080946001600160a01b0382959998949960a089019a8952166020880152166040860152606085015216910152565b519020613bf86020840151602081519101209360a060408201516020815191012091015160405161525081613bf8602082019485615172565b51902090604051958694602086019889919260a093969594919660c08401976000855260208501526040840152606083015260808201520152565b926001600160401b039261529e926156f0565b9116600052600a60205260406000209060005260205260406000205490565b607f8216906801fffffffffffffffe6001600160401b0383169260011b169180830460021490151715611eb257615342916001600160401b036153008584613646565b921660005260096020526701ffffffffffffff60406000209460071c169160036001831b921b19161792906001600160401b0316600052602052604060002090565b55565b9091607f83166801fffffffffffffffe6001600160401b0382169160011b169080820460021490151715611eb25761537d8484613646565b60048310156108bc576001600160401b036153429416600052600960205260036701ffffffffffffff60406000209660071c1693831b921b19161792906001600160401b0316600052602052604060002090565b9080602083519182815201916020808360051b8301019401926000915b8383106153fd57505050505090565b909192939460208061541b600193601f1986820301875289516105f8565b970193019301919392906153ee565b906020808351928381520192019060005b8181106154485750505090565b825163ffffffff1684526020938401939092019160010161543b565b91606092303b1561026b5761556660a0926155546000956155426040519889978897630304c3e160e51b89528260048a01526001600160401b0360808251805160648d01528260208201511660848d01528260408201511660a48d015282868201511660c48d015201511660e48a015261552361550e6154f78b61014061010460208701519201526101a48d01906105f8565b60408401518c8203606319016101248e01526105f8565b938201516001600160a01b03166101448b0152565b60808101516101648a01520151878203606319016101848901526150ce565b858103600319016024870152906153d1565b8381036003190160448501529061542a565b038183305af19081615590575b5061558557615580612227565b600391565b60029061031c6105c0565b80612581600061559f936101e3565b38615573565b6040516370a0823160e01b60208201526001600160a01b039091166024820152919291615602906155d98160448101613bf8565b84837f000000000000000000000000000000000000000000000000000000000000000092615633565b92909115614b6c5750805160208103614b5357509061562d8260208061031c95518301019101614920565b93611eb7565b93919361564060846102af565b9461564e60405196876101e3565b6084865261565c60846102af565b602087019590601f1901368737833b156156df575a908082106156ce578291038060061c900311156156bd576000918291825a9560208451940192f1905a9003923d90608482116156b4575b6000908287523e929190565b608491506156a8565b6337c3be2960e01b60005260046000fd5b632be8ca8b60e21b60005260046000fd5b63030ed58f60e21b60005260046000fd5b805192825190841561584c5761010185111580615840575b1561576f5781850194600019860195610100871161576f5786156158305761572f87611ce2565b9660009586978795885b84811061579457505050505060011901809514938461578a575b505082615780575b50501561576f5761576b91611d3c565b5190565b6309bde33960e01b60005260046000fd5b149050388061575b565b1492503880615753565b6001811b8281160361582257868a101561580d576157b660018b019a85611d3c565b51905b8c888c10156157f957506157d160018c019b86611d3c565b515b818d1161576f576157f2828f926157ec9060019661585d565b92611d3c565b5201615739565b60018d019c61580791611d3c565b516157d3565b61581b60018c019b8d611d3c565b51906157b9565b61581b600189019884611d3c565b50505050905061576b9150611d2a565b50610101821115615708565b630469ac9960e21b60005260046000fd5b8181101561586f579061031c91615874565b61031c915b906040519060208201926001845260408301526060820152606081526134c96080826101e356fea164736f6c634300081a000a49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.StaticConfig\",\"components\":[{\"name\":\"chainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"rmnRemote\",\"type\":\"address\",\"internalType\":\"contractIRMNRemote\"},{\"name\":\"tokenAdminRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonceManager\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"dynamicConfig\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"sourceChainConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOffRamp.SourceChainConfigArgs[]\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applySourceChainConfigUpdates\",\"inputs\":[{\"name\":\"sourceChainConfigUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structOffRamp.SourceChainConfigArgs[]\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ccipReceive\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structClient.Any2EVMMessage\",\"components\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sender\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"commit\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"rs\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"ss\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"rawVs\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"execute\",\"inputs\":[{\"name\":\"reportContext\",\"type\":\"bytes32[2]\",\"internalType\":\"bytes32[2]\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"executeSingleMessage\",\"inputs\":[{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structInternal.Any2EVMRampMessage\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structInternal.RampMessageHeader\",\"components\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"sender\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"receiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.Any2EVMTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destGasAmount\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"offchainTokenData\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenGasOverrides\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getAllSourceChainConfigs\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"},{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structOffRamp.SourceChainConfig[]\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDynamicConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getExecutionState\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumInternal.MessageExecutionState\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestPriceSequenceNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMerkleRoot\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSourceChainConfig\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.SourceChainConfig\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStaticConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.StaticConfig\",\"components\":[{\"name\":\"chainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"rmnRemote\",\"type\":\"address\",\"internalType\":\"contractIRMNRemote\"},{\"name\":\"tokenAdminRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonceManager\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestConfigDetails\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"ocrConfig\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"components\":[{\"name\":\"configInfo\",\"type\":\"tuple\",\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"n\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"manuallyExecute\",\"inputs\":[{\"name\":\"reports\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.ExecutionReport[]\",\"components\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messages\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.Any2EVMRampMessage[]\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structInternal.RampMessageHeader\",\"components\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"sender\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"receiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.Any2EVMTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destGasAmount\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\",\"internalType\":\"bytes[][]\"},{\"name\":\"proofs\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proofFlagBits\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"gasLimitOverrides\",\"type\":\"tuple[][]\",\"internalType\":\"structOffRamp.GasLimitOverride[][]\",\"components\":[{\"name\":\"receiverExecutionGasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenGasOverrides\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setDynamicConfig\",\"inputs\":[{\"name\":\"dynamicConfig\",\"type\":\"tuple\",\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOCR3Configs\",\"inputs\":[{\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"components\":[{\"name\":\"configDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"F\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"AlreadyAttempted\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"CommitReportAccepted\",\"inputs\":[{\"name\":\"merkleRoots\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structInternal.MerkleRoot[]\",\"components\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRampAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maxSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"merkleRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"priceUpdates\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structInternal.PriceUpdates\",\"components\":[{\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"usdPerToken\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]},{\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.GasPriceUpdate[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"usdPerUnitGas\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ConfigSet\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"signers\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"transmitters\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"F\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DynamicConfigSet\",\"inputs\":[{\"name\":\"dynamicConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOffRamp.DynamicConfig\",\"components\":[{\"name\":\"feeQuoter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isRMNVerificationDisabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageInterceptor\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionStateChanged\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"messageId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"state\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\"},{\"name\":\"returnData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"gasUsed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RootRemoved\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SkippedAlreadyExecutedMessage\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SkippedReportExecution\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SourceChainConfigSet\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"sourceConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOffRamp.SourceChainConfig\",\"components\":[{\"name\":\"router\",\"type\":\"address\",\"internalType\":\"contractIRouter\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"minSeqNr\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"onRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SourceChainSelectorAdded\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StaticConfigSet\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOffRamp.StaticConfig\",\"components\":[{\"name\":\"chainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"rmnRemote\",\"type\":\"address\",\"internalType\":\"contractIRMNRemote\"},{\"name\":\"tokenAdminRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonceManager\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transmitted\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"uint8\"},{\"name\":\"configDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CanOnlySelfCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CommitOnRampMismatch\",\"inputs\":[{\"name\":\"reportOnRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"configOnRamp\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"ConfigDigestMismatch\",\"inputs\":[{\"name\":\"expected\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"actual\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"CursedByRMN\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"EmptyBatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EmptyReport\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ExecutionError\",\"inputs\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"err\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"ForkedChain\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InsufficientGasForCallWithExact\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidConfig\",\"inputs\":[{\"name\":\"errorType\",\"type\":\"uint8\",\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\"}]},{\"type\":\"error\",\"name\":\"InvalidDataLength\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"got\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidInterval\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"min\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"max\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidManualExecutionGasLimit\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"newLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidManualExecutionTokenGasOverride\",\"inputs\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"tokenIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"oldLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"tokenGasOverride\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageDestChainSelector\",\"inputs\":[{\"name\":\"messageDestChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidNewState\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"newState\",\"type\":\"uint8\",\"internalType\":\"enumInternal.MessageExecutionState\"}]},{\"type\":\"error\",\"name\":\"InvalidOnRampUpdate\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"LeavesCannotBeEmpty\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ManualExecutionGasAmountCountMismatch\",\"inputs\":[{\"name\":\"messageId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ManualExecutionGasLimitMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ManualExecutionNotYetEnabled\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MessageValidationError\",\"inputs\":[{\"name\":\"errorReason\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NonUniqueSignatures\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotACompatiblePool\",\"inputs\":[{\"name\":\"notPool\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OracleCannotBeZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReceiverError\",\"inputs\":[{\"name\":\"err\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"ReleaseOrMintBalanceMismatch\",\"inputs\":[{\"name\":\"amountReleased\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"balancePre\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"balancePost\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"RootAlreadyCommitted\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"merkleRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"RootNotCommitted\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"SignatureVerificationNotAllowedInExecutionPlugin\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignatureVerificationRequiredInCommitPlugin\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignaturesOutOfRegistration\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SourceChainNotEnabled\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"SourceChainSelectorMismatch\",\"inputs\":[{\"name\":\"reportSourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageSourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"StaleCommitReport\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StaticConfigCannotBeChanged\",\"inputs\":[{\"name\":\"ocrPluginType\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"TokenDataMismatch\",\"inputs\":[{\"name\":\"sourceChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"TokenHandlingError\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"err\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedSigner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedTransmitter\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnexpectedTokenData\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongMessageLength\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actual\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"WrongNumberOfSignatures\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroAddressNotAllowed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroChainSelectorNotAllowed\",\"inputs\":[]}]", + Bin: "0x6101408060405234610848576163ea803803809161001d828561087e565b833981019080820361014081126108485760a08112610848576040519060a082016001600160401b0381118382101761084d5760405261005c836108a1565b825260208301519261ffff84168403610848576020830193845260408101516001600160a01b0381168103610848576040840190815261009e606083016108b5565b946060850195865260806100b38185016108b5565b86820190815294609f19011261084857604051946100d086610863565b6100dc60a085016108b5565b865260c08401519463ffffffff86168603610848576020870195865261010460e086016108c9565b976040880198895261011961010087016108b5565b6060890190815261012087015190966001600160401b03821161084857018a601f820112156108485780519a6001600160401b038c1161084d578b60051b916020806040519e8f9061016d8388018361087e565b81520193820101908282116108485760208101935b828510610748575050505050331561073757600180546001600160a01b031916331790554660805284516001600160a01b0316158015610725575b8015610713575b6106f15782516001600160401b0316156107025782516001600160401b0390811660a090815286516001600160a01b0390811660c0528351811660e0528451811661010052865161ffff90811661012052604080519751909416875296519096166020860152955185169084015251831660608301525190911660808201527fb0fa1fb01508c5097c502ad056fd77018870c9be9a86d9e56b6b471862d7c5b79190a182516001600160a01b0316156106f1579151600480548351865160ff60c01b90151560c01b1663ffffffff60a01b60a09290921b919091166001600160a01b039485166001600160c81b0319909316831717179091558351600580549184166001600160a01b031990921691909117905560408051918252925163ffffffff166020820152935115159184019190915290511660608201527fcbb53bda7106a610de67df506ac86b65c44d5afac0fd2b11070dc2d61a6f2dee90608090a160005b815181101561066b576020600582901b8301810151908101516001600160401b031690600090821561065c5780516001600160a01b03161561064d57828252600860205260408220906060810151600183019361038585546108d6565b6105ee578354600160a81b600160e81b031916600160a81b1784556040518681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb990602090a15b815180159081156105c3575b506105b4578151916001600160401b0383116105a0576103f986546108d6565b601f811161055b575b50602091601f84116001146104e257926001989796949281926000805160206163ca8339815191529795926104d7575b5050600019600383901b1c191690881b1783555b60408101518254915160a089811b8a9003801960ff60a01b1990951693151590911b60ff60a01b169290921792909216911617815561048484610993565b506104ce6040519283926020845254888060a01b038116602085015260ff8160a01c1615156040850152888060401b039060a81c16606084015260808084015260a0830190610910565b0390a201610328565b015190503880610432565b9190601f198416878452828420935b818110610543575092600199989795939285926000805160206163ca83398151915298968c951061052a575b505050811b018355610446565b015160001960f88460031b161c1916905538808061051d565b929360206001819287860151815501950193016104f1565b86835260208320601f850160051c81019160208610610596575b601f0160051c01905b81811061058b5750610402565b83815560010161057e565b9091508190610575565b634e487b7160e01b82526041600452602482fd5b6342bcdf7f60e11b8152600490fd5b905060208301206040516020810190838252602081526105e460408261087e565b51902014386103d9565b835460a81c6001600160401b0316600114158061061f575b156103cd57632105803760e11b81526004869052602490fd5b50604051610638816106318189610910565b038261087e565b60208151910120825160208401201415610606565b6342bcdf7f60e11b8252600482fd5b63c656089560e01b8252600482fd5b6040516159a39081610a2782396080518161368c015260a05181818161048e01526141ea015260c0518181816104e401528181612cba0152818161310e0152614184015260e05181818161051301526149c701526101005181818161054201526145ad0152610120518181816104b50152818161243401528181614aba01526156d80152f35b6342bcdf7f60e11b60005260046000fd5b63c656089560e01b60005260046000fd5b5081516001600160a01b0316156101c4565b5080516001600160a01b0316156101bd565b639b15e16f60e01b60005260046000fd5b84516001600160401b0381116108485782016080818603601f190112610848576040519061077582610863565b60208101516001600160a01b0381168103610848578252610798604082016108a1565b60208301526107a9606082016108c9565b604083015260808101516001600160401b03811161084857602091010185601f820112156108485780516001600160401b03811161084d57604051916107f9601f8301601f19166020018461087e565b81835287602083830101116108485760005b8281106108335750509181600060208096949581960101526060820152815201940193610182565b8060208092840101518282870101520161080b565b600080fd5b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b0382111761084d57604052565b601f909101601f19168101906001600160401b0382119082101761084d57604052565b51906001600160401b038216820361084857565b51906001600160a01b038216820361084857565b5190811515820361084857565b90600182811c92168015610906575b60208310146108f057565b634e487b7160e01b600052602260045260246000fd5b91607f16916108e5565b60009291815491610920836108d6565b8083529260018116908115610976575060011461093c57505050565b60009081526020812093945091925b83831061095c575060209250010190565b60018160209294939454838587010152019101919061094b565b915050602093945060ff929192191683830152151560051b010190565b80600052600760205260406000205415600014610a20576006546801000000000000000081101561084d576001810180600655811015610a0a577ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0181905560065460009182526007602052604090912055600190565b634e487b7160e01b600052603260045260246000fd5b5060009056fe6080604052600436101561001257600080fd5b60003560e01c806304666f9c1461015757806306285c6914610152578063181f5a771461014d5780633f4b04aa146101485780635215505b146101435780635e36480c1461013e5780635e7bb0081461013957806360987c20146101345780637437ff9f1461012f57806379ba50971461012a5780637edf52f41461012557806385572ffb146101205780638da5cb5b1461011b578063c673e58414610116578063ccd37ba314610111578063de5e0b9a1461010c578063e9d68a8e14610107578063f2fde38b14610102578063f58e03fc146100fd5763f716f99f146100f857600080fd5b6118d4565b6117b7565b61172c565b611691565b6115f5565b611571565b6114c6565b6113de565b6113a8565b6111e2565b611162565b6110b9565b61103e565b610e39565b6108ce565b610789565b61067c565b61061d565b61043d565b61031f565b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b0382111761018d57604052565b61015c565b60a081019081106001600160401b0382111761018d57604052565b604081019081106001600160401b0382111761018d57604052565b606081019081106001600160401b0382111761018d57604052565b90601f801991011681019081106001600160401b0382111761018d57604052565b6040519061021360c0836101e3565b565b6040519061021360a0836101e3565b60405190610213610100836101e3565b604051906102136040836101e3565b6001600160401b03811161018d5760051b60200190565b6001600160a01b0381160361026b57565b600080fd5b600435906001600160401b038216820361026b57565b35906001600160401b038216820361026b57565b8015150361026b57565b35906102138261029a565b6001600160401b03811161018d57601f01601f191660200190565b9291926102d6826102af565b916102e460405193846101e3565b82948184528183011161026b578281602093846000960137010152565b9080601f8301121561026b5781602061031c933591016102ca565b90565b3461026b57602036600319011261026b576004356001600160401b03811161026b573660238201121561026b5780600401359061035b82610243565b9061036960405192836101e3565b8282526024602083019360051b8201019036821161026b5760248101935b8285106103995761039784611a0f565b005b84356001600160401b03811161026b5782016080602319823603011261026b57604051916103c683610172565b60248201356103d48161025a565b83526103e260448301610286565b602084015260648201356103f58161029a565b60408401526084820135926001600160401b03841161026b57610422602094936024869536920101610301565b6060820152815201940193610387565b600091031261026b57565b3461026b57600036600319011261026b576000608060405161045e81610192565b82815282602082015282604082015282606082015201526105bc60405161048481610192565b6001600160401b037f000000000000000000000000000000000000000000000000000000000000000016815261ffff7f00000000000000000000000000000000000000000000000000000000000000001660208201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660408201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660608201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660808201526040519182918291909160806001600160a01b038160a08401956001600160401b03815116855261ffff6020820151166020860152826040820151166040860152826060820151166060860152015116910152565b0390f35b604051906105cf6020836101e3565b60008252565b60005b8381106105e85750506000910152565b81810151838201526020016105d8565b90602091610611815180928185528580860191016105d5565b601f01601f1916010190565b3461026b57600036600319011261026b576105bc604080519061064081836101e3565b601182527f4f666652616d7020312e362e302d6465760000000000000000000000000000006020830152519182916020835260208301906105f8565b3461026b57600036600319011261026b5760206001600160401b03600b5416604051908152f35b906080606061031c936001600160a01b0381511684526020810151151560208501526001600160401b03604082015116604085015201519181606082015201906105f8565b6040810160408252825180915260206060830193019060005b81811061076a575050506020818303910152815180825260208201916020808360051b8301019401926000915b83831061073d57505050505090565b909192939460208061075b600193601f1986820301875289516106a3565b9701930193019193929061072e565b82516001600160401b0316855260209485019490920191600101610701565b3461026b57600036600319011261026b576006546107a681610243565b906107b460405192836101e3565b808252601f196107c382610243565b0160005b8181106108855750506107d981611ce2565b9060005b8181106107f55750506105bc604051928392836106e8565b8061082b61081361080760019461406b565b6001600160401b031690565b61081d8387611d3c565b906001600160401b03169052565b61086961086461084b61083e8488611d3c565b516001600160401b031690565b6001600160401b03166000526008602052604060002090565b611e28565b6108738287611d3c565b5261087e8186611d3c565b50016107dd565b602090610890611cbb565b828287010152016107c7565b634e487b7160e01b600052602160045260246000fd5b600411156108bc57565b61089c565b9060048210156108bc5752565b3461026b57604036600319011261026b576108e7610270565b602435906001600160401b038216820361026b5760209161090791611ec4565b61091460405180926108c1565bf35b91908260a091031261026b5760405161092e81610192565b60806109738183958035855261094660208201610286565b602086015261095760408201610286565b604086015261096860608201610286565b606086015201610286565b910152565b35906102138261025a565b63ffffffff81160361026b57565b359061021382610983565b81601f8201121561026b578035906109b382610243565b926109c160405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b8385106109ed57505050505090565b84356001600160401b03811161026b57820160a0818503601f19011261026b5760405191610a1a83610192565b60208201356001600160401b03811161026b57856020610a3c92850101610301565b83526040820135610a4c8161025a565b6020840152610a5d60608301610991565b60408401526080820135926001600160401b03841161026b5760a083610a8a886020809881980101610301565b6060840152013560808201528152019401936109de565b9190916101408184031261026b57610ab7610204565b92610ac28183610916565b845260a08201356001600160401b03811161026b5781610ae3918401610301565b602085015260c08201356001600160401b03811161026b5781610b07918401610301565b6040850152610b1860e08301610978565b606085015261010082013560808501526101208201356001600160401b03811161026b57610b46920161099c565b60a0830152565b9080601f8301121561026b578135610b6481610243565b92610b7260405194856101e3565b81845260208085019260051b8201019183831161026b5760208201905b838210610b9e57505050505090565b81356001600160401b03811161026b57602091610bc087848094880101610aa1565b815201910190610b8f565b81601f8201121561026b57803590610be282610243565b92610bf060405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b838510610c1c57505050505090565b84356001600160401b03811161026b57820183603f8201121561026b576020810135610c4781610243565b91610c5560405193846101e3565b8183526020808085019360051b830101019186831161026b5760408201905b838210610c8e575050509082525060209485019401610c0d565b81356001600160401b03811161026b57602091610cb28a8480809589010101610301565b815201910190610c74565b929190610cc981610243565b93610cd760405195866101e3565b602085838152019160051b810192831161026b57905b828210610cf957505050565b8135815260209182019101610ced565b9080601f8301121561026b5781602061031c93359101610cbd565b81601f8201121561026b57803590610d3b82610243565b92610d4960405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b838510610d7557505050505090565b84356001600160401b03811161026b57820160a0818503601f19011261026b57610d9d610215565b91610daa60208301610286565b835260408201356001600160401b03811161026b57856020610dce92850101610b4d565b602084015260608201356001600160401b03811161026b57856020610df592850101610bcb565b60408401526080820135926001600160401b03841161026b5760a083610e22886020809881980101610d09565b606084015201356080820152815201940193610d66565b3461026b57604036600319011261026b576004356001600160401b03811161026b57610e69903690600401610d24565b6024356001600160401b03811161026b573660238201121561026b57806004013591610e9483610243565b91610ea260405193846101e3565b8383526024602084019460051b8201019036821161026b5760248101945b828610610ed1576103978585611f0c565b85356001600160401b03811161026b5782013660438201121561026b576024810135610efc81610243565b91610f0a60405193846101e3565b818352602060248185019360051b830101019036821161026b5760448101925b828410610f44575050509082525060209586019501610ec0565b83356001600160401b03811161026b576024908301016040601f19823603011261026b5760405190610f75826101ad565b6020810135825260408101356001600160401b03811161026b57602091010136601f8201121561026b57803590610fab82610243565b91610fb960405193846101e3565b80835260208084019160051b8301019136831161026b57602001905b828210610ff45750505091816020938480940152815201930192610f2a565b60208091833561100381610983565b815201910190610fd5565b9181601f8401121561026b578235916001600160401b03831161026b576020808501948460051b01011161026b57565b3461026b57606036600319011261026b576004356001600160401b03811161026b5761106e903690600401610aa1565b6024356001600160401b03811161026b5761108d90369060040161100e565b91604435926001600160401b03841161026b576110b161039794369060040161100e565b939092612318565b3461026b57600036600319011261026b576110d26125e5565b506105bc6040516110e281610172565b60ff6004546001600160a01b038116835263ffffffff8160a01c16602084015260c01c16151560408201526001600160a01b036005541660608201526040519182918291909160606001600160a01b0381608084019582815116855263ffffffff6020820151166020860152604081015115156040860152015116910152565b3461026b57600036600319011261026b576000546001600160a01b03811633036111d1576001600160a01b0319600154913382841617600155166000556001600160a01b033391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b63015aa1e360e11b60005260046000fd5b3461026b57608036600319011261026b57600060405161120181610172565b60043561120d8161025a565b815260243561121b81610983565b602082015260443561122c8161029a565b604082015260643561123d8161025a565b606082015261124a613489565b6001600160a01b038151161561139957611393816112a96001600160a01b037fcbb53bda7106a610de67df506ac86b65c44d5afac0fd2b11070dc2d61a6f2dee9451166001600160a01b03166001600160a01b03196004541617600455565b60208101516004547fffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffff77ffffffff000000000000000000000000000000000000000078ff0000000000000000000000000000000000000000000000006040860151151560c01b169360a01b169116171760045561134f61133360608301516001600160a01b031690565b6001600160a01b03166001600160a01b03196005541617600555565b6040519182918291909160606001600160a01b0381608084019582815116855263ffffffff6020820151166020860152604081015115156040860152015116910152565b0390a180f35b6342bcdf7f60e11b8252600482fd5b3461026b57602036600319011261026b576004356001600160401b03811161026b5760a090600319903603011261026b57600080fd5b3461026b57600036600319011261026b5760206001600160a01b0360015416604051908152f35b6004359060ff8216820361026b57565b359060ff8216820361026b57565b906020808351928381520192019060005b8181106114415750505090565b82516001600160a01b0316845260209384019390920191600101611434565b9061031c9160208152606082518051602084015260ff602082015116604084015260ff6040820151168284015201511515608082015260406114b1602084015160c060a085015260e0840190611423565b9201519060c0601f1982850301910152611423565b3461026b57602036600319011261026b5760ff6114e1611405565b6060604080516114f0816101c8565b6114f86125e5565b815282602082015201521660005260026020526105bc6040600020600361156060405192611525846101c8565b61152e8161260a565b845260405161154b816115448160028601612643565b03826101e3565b60208501526115446040518094819301612643565b604082015260405191829182611460565b3461026b57604036600319011261026b5761158a610270565b6001600160401b036024359116600052600a6020526040600020906000526020526020604060002054604051908152f35b9060049160441161026b57565b9181601f8401121561026b578235916001600160401b03831161026b576020838186019501011161026b57565b3461026b5760c036600319011261026b5761160f366115bb565b6044356001600160401b03811161026b5761162e9036906004016115c8565b6064929192356001600160401b03811161026b5761165090369060040161100e565b60843594916001600160401b03861161026b5761167461039796369060040161100e565b94909360a43596612c75565b90602061031c9281815201906106a3565b3461026b57602036600319011261026b576001600160401b036116b2610270565b6116ba611cbb565b501660005260086020526105bc6040600020600161171b604051926116de84610172565b6001600160401b0381546001600160a01b038116865260ff8160a01c161515602087015260a81c1660408501526115446040518094819301611d8a565b606082015260405191829182611680565b3461026b57602036600319011261026b576001600160a01b036004356117518161025a565b611759613489565b163381146117a657806001600160a01b031960005416176000556001600160a01b03600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b636d6c4ee560e11b60005260046000fd5b3461026b57606036600319011261026b576117d1366115bb565b6044356001600160401b03811161026b576117f09036906004016115c8565b9182820160208382031261026b578235906001600160401b03821161026b5761181a918401610d24565b60405190602061182a81846101e3565b60008352601f19810160005b81811061185e57505050610397949161184e916136cd565b611856613184565b928392613a33565b60608582018401528201611836565b9080601f8301121561026b57813561188481610243565b9261189260405194856101e3565b81845260208085019260051b82010192831161026b57602001905b8282106118ba5750505090565b6020809183356118c98161025a565b8152019101906118ad565b3461026b57602036600319011261026b576004356001600160401b03811161026b573660238201121561026b5780600401359061191082610243565b9061191e60405192836101e3565b8282526024602083019360051b8201019036821161026b5760248101935b82851061194c57610397846131a0565b84356001600160401b03811161026b57820160c0602319823603011261026b57611974610204565b916024820135835261198860448301611415565b602084015261199960648301611415565b60408401526119aa608483016102a4565b606084015260a48201356001600160401b03811161026b576119d2906024369185010161186d565b608084015260c4820135926001600160401b03841161026b576119ff60209493602486953692010161186d565b60a082015281520194019361193c565b611a17613489565b60005b8151811015611cb757611a2d8183611d3c565b5190611a4360208301516001600160401b031690565b916001600160401b038316908115611ca657611a78611a6c611a6c83516001600160a01b031690565b6001600160a01b031690565b15611c0d57611a9a846001600160401b03166000526008602052604060002090565b906060810151916001810195611ab08754611d50565b611c3457611b237ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb991611b0984750100000000000000000000000000000000000000000067ffffffffffffffff60a81b19825416179055565b6040516001600160401b0390911681529081906020820190565b0390a15b82518015908115611c1e575b50611c0d57611bee611bd2611c0493611b6f7f49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b9660019a61352b565b611bc5611b7f6040830151151590565b85547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690151560a01b74ff000000000000000000000000000000000000000016178555565b516001600160a01b031690565b82906001600160a01b03166001600160a01b0319825416179055565b611bf784615093565b50604051918291826135fc565b0390a201611a1a565b6342bcdf7f60e11b60005260046000fd5b90506020840120611c2d6134ae565b1438611b33565b60016001600160401b03611c5384546001600160401b039060a81c1690565b16141580611c87575b611c665750611b27565b632105803760e11b6000526001600160401b031660045260246000fd5b6000fd5b50611c9187611e0d565b60208151910120845160208601201415611c5c565b63c656089560e01b60005260046000fd5b5050565b60405190611cc882610172565b606080836000815260006020820152600060408201520152565b90611cec82610243565b611cf960405191826101e3565b8281528092611d0a601f1991610243565b0190602036910137565b634e487b7160e01b600052603260045260246000fd5b805115611d375760200190565b611d14565b8051821015611d375760209160051b010190565b90600182811c92168015611d80575b6020831014611d6a57565b634e487b7160e01b600052602260045260246000fd5b91607f1691611d5f565b60009291815491611d9a83611d50565b8083529260018116908115611df05750600114611db657505050565b60009081526020812093945091925b838310611dd6575060209250010190565b600181602092949394548385870101520191019190611dc5565b915050602093945060ff929192191683830152151560051b010190565b90610213611e219260405193848092611d8a565b03836101e3565b9060016060604051611e3981610172565b611e8281956001600160401b0381546001600160a01b038116855260ff8160a01c161515602086015260a81c166040840152611e7b6040518096819301611d8a565b03846101e3565b0152565b634e487b7160e01b600052601160045260246000fd5b908160051b9180830460201490151715611eb257565b611e86565b91908203918211611eb257565b611ed082607f92613646565b9116906801fffffffffffffffe6001600160401b0383169260011b169180830460021490151715611eb2576003911c1660048110156108bc5790565b611f1461368a565b80518251810361210b5760005b818110611f3457505090610213916136cd565b611f3e8184611d3c565b516020810190815151611f518488611d3c565b51928351820361210b5790916000925b808410611f75575050505050600101611f21565b91949398611f87848b98939598611d3c565b515198611f95888851611d3c565b5199806120c2575b5060a08a01988b6020611fb38b8d515193611d3c565b51015151036120855760005b8a515181101561207057611ffb611ff2611fe88f6020611fe08f8793611d3c565b510151611d3c565b5163ffffffff1690565b63ffffffff1690565b8b8161200c575b5050600101611fbf565b611ff2604061201f8561202b9451611d3c565b51015163ffffffff1690565b9081811061203a57508b612002565b8d51516040516348e617b360e01b81526004810191909152602481019390935260448301919091526064820152608490fd5b0390fd5b50985098509893949095600101929091611f61565b611c838b516120a0606082519201516001600160401b031690565b6370a193fd60e01b6000526004919091526001600160401b0316602452604490565b60808b0151811015611f9d57611c83908b6120e488516001600160401b031690565b905151633a98d46360e11b6000526001600160401b03909116600452602452604452606490565b6320f8fd5960e21b60005260046000fd5b60405190612129826101ad565b60006020838281520152565b604051906121446020836101e3565b600080835282815b82811061215857505050565b60209061216361211c565b8282850101520161214c565b805182526001600160401b03602082015116602083015260806121b66121a4604084015160a0604087015260a08601906105f8565b606084015185820360608701526105f8565b9101519160808183039101526020808351928381520192019060005b8181106121df5750505090565b825180516001600160a01b0316855260209081015181860152604090940193909201916001016121d2565b90602061031c92818152019061216f565b6040513d6000823e3d90fd5b3d15612252573d90612238826102af565b9161224660405193846101e3565b82523d6000602084013e565b606090565b90602061031c9281815201906105f8565b909160608284031261026b57815161227f8161029a565b9260208301516001600160401b03811161026b5783019080601f8301121561026b578151916122ad836102af565b916122bb60405193846101e3565b8383526020848301011161026b576040926122dc91602080850191016105d5565b92015190565b9293606092959461ffff6123066001600160a01b039460808852608088019061216f565b97166020860152604085015216910152565b929093913033036125d45761232b612135565b9460a0850151805161258d575b5050505050805191612356602084519401516001600160401b031690565b906020830151916040840192612383845192612370610215565b9788526001600160401b03166020880152565b6040860152606085015260808401526001600160a01b036123ac6005546001600160a01b031690565b1680612510575b5051511580612504575b80156124ee575b80156124c5575b611cb75761245d9181612402611a6c6123f561084b602060009751016001600160401b0390511690565b546001600160a01b031690565b908361241d606060808401519301516001600160a01b031690565b604051633cf9798360e01b815296879586948593917f000000000000000000000000000000000000000000000000000000000000000090600486016122e2565b03925af19081156124c057600090600092612499575b501561247c5750565b6040516302a35ba360e21b815290819061206c9060048301612257565b90506124b891503d806000833e6124b081836101e3565b810190612268565b509038612473565b61221b565b506124e96124e56124e060608401516001600160a01b031690565b6138f4565b1590565b6123cb565b5060608101516001600160a01b03163b156123c4565b506080810151156123bd565b803b1561026b57600060405180926308d450a160e01b82528183816125388a6004830161220a565b03925af19081612572575b5061256c5761206c612553612227565b6040516309c2532560e01b815291829160048301612257565b386123b3565b806125816000612587936101e3565b80610432565b38612543565b85965060206125c99601516125ac60608901516001600160a01b031690565b906125c360208a51016001600160401b0390511690565b926137db565b903880808080612338565b6306e34e6560e31b60005260046000fd5b604051906125f282610172565b60006060838281528260208201528260408201520152565b9060405161261781610172565b606060ff600183958054855201548181166020850152818160081c16604085015260101c161515910152565b906020825491828152019160005260206000209060005b8181106126675750505090565b82546001600160a01b031684526020909301926001928301920161265a565b90610213611e219260405193848092612643565b35906001600160e01b038216820361026b57565b81601f8201121561026b578035906126c582610243565b926126d360405194856101e3565b82845260208085019360061b8301019181831161026b57602001925b8284106126fd575050505090565b60408483031261026b5760206040918251612717816101ad565b61272087610286565b815261272d83880161269a565b838201528152019301926126ef565b81601f8201121561026b5780359061275382610243565b9261276160405194856101e3565b82845260208085019360051b8301019181831161026b5760208101935b83851061278d57505050505090565b84356001600160401b03811161026b57820160a0818503601f19011261026b57604051916127ba83610192565b6127c660208301610286565b83526040820135926001600160401b03841161026b5760a0836127f0886020809881980101610301565b8584015261280060608201610286565b604084015261281160808201610286565b60608401520135608082015281520194019361277e565b81601f8201121561026b5780359061283f82610243565b9261284d60405194856101e3565b82845260208085019360061b8301019181831161026b57602001925b828410612877575050505090565b60408483031261026b5760206040918251612891816101ad565b863581528287013583820152815201930192612869565b60208183031261026b578035906001600160401b03821161026b570160608183031261026b57604051916128db836101c8565b81356001600160401b03811161026b57820160408183031261026b5760405190612904826101ad565b80356001600160401b03811161026b57810183601f8201121561026b57803561292c81610243565b9161293a60405193846101e3565b81835260208084019260061b8201019086821161026b57602001915b8183106129d25750505082526020810135906001600160401b03821161026b57612982918491016126ae565b6020820152835260208201356001600160401b03811161026b57816129a891840161273c565b602084015260408201356001600160401b03811161026b576129ca9201612828565b604082015290565b60408388031261026b57602060409182516129ec816101ad565b85356129f78161025a565b8152612a0483870161269a565b83820152815201920191612956565b9080602083519182815201916020808360051b8301019401926000915b838310612a3f57505050505090565b9091929394602080600192601f198582030186528851906001600160401b038251168152608080612a7d8585015160a08786015260a08501906105f8565b936001600160401b0360408201511660408501526001600160401b036060820151166060850152015191015297019301930191939290612a30565b916001600160a01b03612ad992168352606060208401526060830190612a13565b9060408183039101526020808351928381520192019060005b818110612aff5750505090565b8251805185526020908101518186015260409094019390920191600101612af2565b906020808351928381520192019060005b818110612b3f5750505090565b825180516001600160401b031685526020908101516001600160e01b03168186015260409094019390920191600101612b32565b9190604081019083519160408252825180915260206060830193019060005b818110612bb357505050602061031c93940151906020818403910152612b21565b825180516001600160a01b031686526020908101516001600160e01b03168187015260409095019490920191600101612b92565b90602061031c928181520190612b73565b9081602091031261026b575161031c8161029a565b9091612c2461031c936040845260408401906105f8565b916020818403910152611d8a565b6001600160401b036001911601906001600160401b038211611eb257565b9091612c6761031c93604084526040840190612a13565b916020818403910152612b73565b929693959190979497612c8a828201826128a8565b98612c9e6124e560045460ff9060c01c1690565b6130f2575b895180515115908115916130e3575b5061300a575b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316999860208a019860005b8a518051821015612fa85781612d0191611d3c565b518d612d1482516001600160401b031690565b604051632cbc26bb60e01b815267ffffffffffffffff60801b608083901b1660048201529091602090829060249082905afa9081156124c057600091612f7a575b50612f5d57612d6390613942565b60208201805160208151910120906001830191612d7f83611e0d565b6020815191012003612f40575050805460408301516001600160401b039081169160a81c168114801590612f18575b612ec657506080820151908115612eb557612dff82612df0612dd786516001600160401b031690565b6001600160401b0316600052600a602052604060002090565b90600052602052604060002090565b54612e81578291612e65612e7a92612e2c612e2760606001999801516001600160401b031690565b612c32565b67ffffffffffffffff60a81b197cffffffffffffffff00000000000000000000000000000000000000000083549260a81b169116179055565b612df0612dd74294516001600160401b031690565b5501612cec565b50612e96611c8392516001600160401b031690565b6332cf0cbf60e01b6000526001600160401b0316600452602452604490565b63504570e360e01b60005260046000fd5b82611c8391612ef06060612ee184516001600160401b031690565b9301516001600160401b031690565b636af0786b60e11b6000526001600160401b0392831660045290821660245216604452606490565b50612f3061080760608501516001600160401b031690565b6001600160401b03821611612dae565b5161206c60405192839263b80d8fa960e01b845260048401612c0d565b637edeb53960e11b6000526001600160401b031660045260246000fd5b612f9b915060203d8111612fa1575b612f9381836101e3565b810190612bf8565b38612d55565b503d612f89565b50506130049496989b507f35c02761bcd3ef995c6a601a1981f4ed3934dcbe5041e24e286c89f5531d17e46102139b612ffc949597999b51905190612ff260405192839283612c50565b0390a13691610cbd565b943691610cbd565b93613d2d565b61301f602086015b356001600160401b031690565b600b546001600160401b03828116911610156130c757613055906001600160401b03166001600160401b0319600b541617600b55565b61306d611a6c611a6c6004546001600160a01b031690565b8a5190803b1561026b57604051633937306f60e01b815291600091839182908490829061309d9060048301612be7565b03925af180156124c0576130b2575b50612cb8565b8061258160006130c1936101e3565b386130ac565b5060208a015151612cb857632261116760e01b60005260046000fd5b60209150015151151538612cb2565b60208a01518051613104575b50612ca3565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060408c0151823b1561026b57604051633854844f60e11b815292600092849283918291613160913060048501612ab8565b03915afa80156124c057156130fe5780612581600061317e936101e3565b386130fe565b604051906131936020836101e3565b6000808352366020840137565b6131a8613489565b60005b8151811015611cb7576131be8183611d3c565b51906040820160ff6131d1825160ff1690565b161561347357602083015160ff16926131f78460ff166000526002602052604060002090565b916001830191825461321261320c8260ff1690565b60ff1690565b613438575061323f6132276060830151151590565b845462ff0000191690151560101b62ff000016178455565b60a081019182516101008151116133e057805115613422576003860161326d61326782612686565b8a614e41565b60608401516132fd575b947fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547946002946132d96132c96132f79a966132c28760019f9c6132bd6132ef9a8f614fa2565b613f6e565b5160ff1690565b845460ff191660ff821617909455565b5190818555519060405195869501908886613ff4565b0390a1615024565b016131ab565b9794600287939597019661331961331389612686565b88614e41565b60808501519461010086511161340c57855161334161320c61333c8a5160ff1690565b613f5a565b10156133f65785518451116133e0576132d96132c97fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547986132c28760019f6132bd6132f79f9a8f6133c860029f6133c26132ef9f8f906132bd84926133a7845160ff1690565b908054909161ff001990911660089190911b61ff0016179055565b82614ed5565b505050979c9f50975050969a50505094509450613277565b631b3fab5160e11b600052600160045260246000fd5b631b3fab5160e11b600052600360045260246000fd5b631b3fab5160e11b600052600260045260246000fd5b631b3fab5160e11b600052600560045260246000fd5b60101c60ff1661345361344e6060840151151590565b151590565b9015151461323f576321fd80df60e21b60005260ff861660045260246000fd5b631b3fab5160e11b600090815260045260246000fd5b6001600160a01b0360015416330361349d57565b6315ae3a6f60e11b60005260046000fd5b604051602081019060008252602081526134c96040826101e3565b51902090565b8181106134da575050565b600081556001016134cf565b9190601f81116134f557505050565b610213926000526020600020906020601f840160051c83019310613521575b601f0160051c01906134cf565b9091508190613514565b91909182516001600160401b03811161018d576135528161354c8454611d50565b846134e6565b6020601f8211600114613593578190613584939495600092613588575b50508160011b916000199060031b1c19161790565b9055565b01519050388061356f565b601f198216906135a884600052602060002090565b9160005b8181106135e4575095836001959697106135cb575b505050811b019055565b015160001960f88460031b161c191690553880806135c1565b9192602060018192868b0151815501940192016135ac565b90600160a061031c93602081526001600160401b0384546001600160a01b038116602084015260ff81851c161515604084015260a81c166060820152608080820152019101611d8a565b906001600160401b03613686921660005260096020526701ffffffffffffff60406000209160071c166001600160401b0316600052602052604060002090565b5490565b7f00000000000000000000000000000000000000000000000000000000000000004681036136b55750565b630f01ce8560e01b6000526004524660245260446000fd5b91909180511561376f5782511592602091604051926136ec81856101e3565b60008452601f19810160005b81811061374b5750505060005b8151811015613743578061372c61371e60019385611d3c565b518815613732578690614133565b01613705565b61373c8387611d3c565b5190614133565b505050509050565b8290604051613759816101ad565b60008152606083820152828289010152016136f8565b63c2e5347d60e01b60005260046000fd5b9190811015611d375760051b0190565b3561031c81610983565b9190811015611d375760051b81013590601e198136030182121561026b5701908135916001600160401b03831161026b57602001823603811361026b579190565b909294919397968151966137ee88610243565b976137fc604051998a6101e3565b80895261380b601f1991610243565b0160005b8181106138dd57505060005b83518110156138d057806138628c8a8a8a61385c613855878d61384e828f8f9d8f9e60019f8161387e575b505050611d3c565b519761379a565b36916102ca565b93614978565b61386c828c611d3c565b52613877818b611d3c565b500161381b565b63ffffffff613896613891858585613780565b613790565b1615613846576138c6926138ad9261389192613780565b60406138b98585611d3c565b51019063ffffffff169052565b8f8f908391613846565b5096985050505050505050565b6020906138e861211c565b82828d0101520161380f565b6139056385572ffb60e01b82614cdb565b908161391f575b81613915575090565b61031c9150614cad565b905061392a81614c32565b159061390c565b61390563aff2afbf60e01b82614cdb565b6001600160401b031680600052600860205260406000209060ff825460a01c161561396b575090565b63ed053c5960e01b60005260045260246000fd5b6084019081608411611eb257565b60a001908160a011611eb257565b91908201809211611eb257565b600311156108bc57565b60038210156108bc5752565b906102136040516139ce816101ad565b602060ff829554818116845260081c1691016139b2565b8054821015611d375760005260206000200190600090565b60ff60019116019060ff8211611eb257565b60ff601b9116019060ff8211611eb257565b90606092604091835260208301370190565b6001600052600260205293613a677fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e061260a565b93853594613a748561397f565b6060820190613a838251151590565b613cff575b803603613ce757508151878103613cce5750613aa261368a565b60016000526003602052613af1613aec7fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c5b336001600160a01b0316600052602052604060002090565b6139be565b60026020820151613b01816139a8565b613b0a816139a8565b149081613c66575b5015613c3a575b51613b71575b50505050507f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef090613b5561301260019460200190565b604080519283526001600160401b0391909116602083015290a2565b613b9261320c613b8d602085969799989a955194015160ff1690565b6139fd565b03613c29578151835103613c1857613c106000613b559461301294613bdc7f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef09960019b36916102ca565b60208151910120604051613c0781613bf989602083019586613a21565b03601f1981018352826101e3565b5190208a614d0b565b948394613b1f565b63a75d88af60e01b60005260046000fd5b6371253a2560e01b60005260046000fd5b72c11c11c11c11c11c11c11c11c11c11c11c11c1330315613b1957631b41e11d60e31b60005260046000fd5b60016000526002602052613cc69150611a6c90613cb390613cad60037fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e05b01915160ff1690565b906139e5565b90546001600160a01b039160031b1c1690565b331438613b12565b6324f7d61360e21b600052600452602487905260446000fd5b638e1192e160e01b6000526004523660245260446000fd5b613d2890613d22613d18613d138751611e9c565b61398d565b613d228851611e9c565b9061399b565b613a88565b60008052600260205294909390929091613d667fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b61260a565b94863595613d738361397f565b6060820190613d828251151590565b613f37575b803603613ce757508151888103613f1e5750613da161368a565b600080526003602052613dd6613aec7f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff613ad4565b60026020820151613de6816139a8565b613def816139a8565b149081613ed5575b5015613ea9575b51613e3b575b5050505050507f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef090613b5561301260009460200190565b613e5761320c613b8d602087989a999b96975194015160ff1690565b03613c29578351865103613c18576000967f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef096613b5595613bdc613ea0946130129736916102ca565b94839438613e04565b72c11c11c11c11c11c11c11c11c11c11c11c11c1330315613dfe57631b41e11d60e31b60005260046000fd5b600080526002602052613f169150611a6c90613cb390613cad60037fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b613ca4565b331438613df7565b6324f7d61360e21b600052600452602488905260446000fd5b613f5590613d22613f4b613d138951611e9c565b613d228a51611e9c565b613d87565b60ff166003029060ff8216918203611eb257565b8151916001600160401b03831161018d5768010000000000000000831161018d576020908254848455808510613fd7575b500190600052602060002060005b838110613fba5750505050565b60019060206001600160a01b038551169401938184015501613fad565b613fee9084600052858460002091820191016134cf565b38613f9f565b95949392909160ff61401993168752602087015260a0604087015260a0860190612643565b84810360608601526020808351928381520192019060005b81811061404c575050509060806102139294019060ff169052565b82516001600160a01b0316845260209384019390920191600101614031565b600654811015611d375760066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f015490565b6001600160401b0361031c94938160609416835216602082015281604082015201906105f8565b60409061031c9392815281602082015201906105f8565b9291906001600160401b039081606495166004521660245260048110156108bc57604452565b94939261411d60609361412e93885260208801906108c1565b6080604087015260808601906105f8565b930152565b9061414582516001600160401b031690565b8151604051632cbc26bb60e01b815267ffffffffffffffff60801b608084901b1660048201529015159391906001600160401b038216906020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156124c057600091614861575b5061481f5760208301918251519485156147ef576040850180515187036147de576141e787611ce2565b957f000000000000000000000000000000000000000000000000000000000000000061421d600161421787613942565b01611e0d565b6020815191012060405161427d81613bf96020820194868b876001600160401b036060929594938160808401977f2425b0b9f9054c76ff151b0a175b18f37a4a4e82013a72e9f15c9caa095ed21f85521660208401521660408201520152565b519020906001600160401b031660005b8a81106147465750505080608060606142ad9301519101519088866152d4565b9788156147285760005b8881106142ca5750505050505050505050565b5a6142d6828951611d3c565b518051606001516142f0906001600160401b031688611ec4565b6142f9816108b2565b8015908d8283159384614715575b156146d25760608815614655575061432e6020614324898d611d3c565b5101519242611eb7565b6004546143439060a01c63ffffffff16611ff2565b108015614642575b156146245761435a878b611d3c565b515161460e575b845160800151614379906001600160401b0316610807565b614556575b5061438a868951611d3c565b5160a08501515181510361451a57936143ef9695938c938f966143cf8e958c926143c96143c360608951016001600160401b0390511690565b89615306565b866155c1565b9a9080966143e960608851016001600160401b0390511690565b9061538e565b6144c8575b50506143ff826108b2565b60028203614480575b6001966144767f05665fe9ad095383d018353f4cbcba77e84db27dd215081bbf7cdf9ae6fbe48b936001600160401b0393519261446761445e8b61445660608801516001600160401b031690565b96519b611d3c565b51985a90611eb7565b91604051958695169885614104565b0390a45b016142b7565b91509193949250614490826108b2565b600382036144a4578b929493918a91614408565b51606001516349362d1f60e11b600052611c8391906001600160401b0316896140de565b6144d1846108b2565b600384036143f45790929495506144e99193506108b2565b6144f9578b92918a9138806143f4565b5151604051632b11b8d960e01b815290819061206c908790600484016140c7565b611c838b61453460608851016001600160401b0390511690565b631cfe6d8b60e01b6000526001600160401b0391821660045216602452604490565b61455f836108b2565b61456a575b3861437e565b8351608001516001600160401b0316602080860151918c61459f60405194859384936370701e5760e11b8552600485016140a0565b038160006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156124c0576000916145f0575b5061456457505050505060019061447a565b614608915060203d8111612fa157612f9381836101e3565b386145de565b614618878b611d3c565b51516080860152614361565b6354e7e43160e11b6000526001600160401b038b1660045260246000fd5b5061464c836108b2565b6003831461434b565b915083614661846108b2565b15614361575060019594506146ca92506146a891507f3ef2a99c550a751d4b0b261268f05a803dfb049ab43616a1ffb388f61fe651209351016001600160401b0390511690565b604080516001600160401b03808c168252909216602083015290918291820190565b0390a161447a565b5050505060019291506146ca6146a860607f3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c9351016001600160401b0390511690565b5061471f836108b2565b60038314614307565b633ee8bd3f60e11b6000526001600160401b03841660045260246000fd5b614751818a51611d3c565b518051604001516001600160401b03168381036147c157508051602001516001600160401b031689810361479e57509061478d846001936151cc565b614797828d611d3c565b520161428d565b636c95f1eb60e01b6000526001600160401b03808a166004521660245260446000fd5b631c21951160e11b6000526001600160401b031660045260246000fd5b6357e0e08360e01b60005260046000fd5b611c8361480386516001600160401b031690565b63676cf24b60e11b6000526001600160401b0316600452602490565b5092915050612f5d576040516001600160401b039190911681527faab522ed53d887e56ed53dd37398a01aeef6a58e0fa77c2173beb9512d89493390602090a1565b61487a915060203d602011612fa157612f9381836101e3565b386141bd565b9081602091031261026b575161031c8161025a565b9061031c916020815260e061493361491e6148be855161010060208701526101208601906105f8565b60208601516001600160401b0316604086015260408601516001600160a01b0316606086015260608601516080860152614908608087015160a08701906001600160a01b03169052565b60a0860151858203601f190160c08701526105f8565b60c0850151848203601f1901848601526105f8565b92015190610100601f19828503019101526105f8565b6040906001600160a01b0361031c949316815281602082015201906105f8565b9081602091031261026b575190565b9193929361498461211c565b5060208301516001600160a01b031660405163bbe4f6db60e01b81526001600160a01b038216600482015290959092602084806024810103816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156124c057600094614c01575b506001600160a01b0384169586158015614bef575b614bd157614ab6614adf92613bf992614a3a614a33611ff260408c015163ffffffff1690565b8c896156a0565b9690996080810151614a686060835193015193614a55610224565b9687526001600160401b03166020870152565b6001600160a01b038a16604086015260608501526001600160a01b038d16608085015260a084015260c083015260e0820152604051633907753760e01b602082015292839160248301614895565b82857f00000000000000000000000000000000000000000000000000000000000000009261572e565b94909115614bb55750805160208103614b9c575090614b08826020808a95518301019101614969565b956001600160a01b03841603614b40575b5050505050614b38614b29610234565b6001600160a01b039093168352565b602082015290565b614b5393614b4d91611eb7565b916156a0565b50908082108015614b89575b614b6b57808481614b19565b63a966e21f60e01b6000908152600493909352602452604452606490fd5b5082614b958284611eb7565b1415614b5f565b631e3be00960e21b600052602060045260245260446000fd5b61206c604051928392634ff17cad60e11b845260048401614949565b63ae9b4ce960e01b6000526001600160a01b03851660045260246000fd5b50614bfc6124e586613931565b614a0d565b614c2491945060203d602011614c2b575b614c1c81836101e3565b810190614880565b92386149f8565b503d614c12565b60405160208101916301ffc9a760e01b835263ffffffff60e01b602483015260248252614c606044836101e3565b6179185a10614c9c576020926000925191617530fa6000513d82614c90575b5081614c89575090565b9050151590565b60201115915038614c7f565b63753fa58960e11b60005260046000fd5b60405160208101916301ffc9a760e01b83526301ffc9a760e01b602483015260248252614c606044836101e3565b6040519060208201926301ffc9a760e01b845263ffffffff60e01b16602483015260248252614c606044836101e3565b919390926000948051946000965b868810614d2a575050505050505050565b6020881015611d375760206000614d42878b1a613a0f565b614d4c8b87611d3c565b5190614d83614d5b8d8a611d3c565b5160405193849389859094939260ff6060936080840197845216602083015260408201520152565b838052039060015afa156124c057614dc9613aec600051614db18960ff166000526003602052604060002090565b906001600160a01b0316600052602052604060002090565b9060016020830151614dda816139a8565b614de3816139a8565b03614e3057614e00614df6835160ff1690565b60ff600191161b90565b8116614e1f57614e16614df66001935160ff1690565b17970196614d19565b633d9ef1f160e21b60005260046000fd5b636518c33d60e11b60005260046000fd5b91909160005b8351811015614e9a5760019060ff831660005260036020526000614e93604082206001600160a01b03614e7a858a611d3c565b51166001600160a01b0316600052602052604060002090565b5501614e47565b50509050565b8151815460ff191660ff91909116178155906020015160038110156108bc57815461ff00191660089190911b61ff0016179055565b919060005b8151811015614e9a57614ef0611bc58284611d3c565b90614f19614f0f83614db18860ff166000526003602052604060002090565b5460081c60ff1690565b614f22816139a8565b614f8d576001600160a01b03821615614f7c57614f76600192614f71614f46610234565b60ff8516815291614f5a86602085016139b2565b614db18960ff166000526003602052604060002090565b614ea0565b01614eda565b63d6c62c9b60e01b60005260046000fd5b631b3fab5160e11b6000526004805260246000fd5b919060005b8151811015614e9a57614fbd611bc58284611d3c565b90614fdc614f0f83614db18860ff166000526003602052604060002090565b614fe5816139a8565b614f8d576001600160a01b03821615614f7c5761501e600192614f71615009610234565b60ff8516815291614f5a6002602085016139b2565b01614fa7565b60ff1680600052600260205260ff60016040600020015460101c16908015600014615072575015615061576001600160401b0319600b5416600b55565b6317bd8dd160e11b60005260046000fd5b60011461507c5750565b61508257565b6307b8c74d60e51b60005260046000fd5b80600052600760205260406000205415600014615111576006546801000000000000000081101561018d57600181016006556000600654821015611d3757600690527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01819055600654906000526007602052604060002055600190565b50600090565b9080602083519182815201916020808360051b8301019401926000915b83831061514357505050505090565b9091929394602080600192601f198582030186528851906080806151a6615173855160a0865260a08601906105f8565b6001600160a01b0387870151168786015263ffffffff6040870151166040860152606086015185820360608701526105f8565b93015191015297019301930191939290615134565b90602061031c928181520190615117565b6134c981518051906152606151eb60608601516001600160a01b031690565b613bf961520260608501516001600160401b031690565b9361521b6080808a01519201516001600160401b031690565b90604051958694602086019889936001600160401b036080946001600160a01b0382959998949960a089019a8952166020880152166040860152606085015216910152565b519020613bf96020840151602081519101209360a060408201516020815191012091015160405161529981613bf96020820194856151bb565b51902090604051958694602086019889919260a093969594919660c08401976000855260208501526040840152606083015260808201520152565b926001600160401b03926152e7926157eb565b9116600052600a60205260406000209060005260205260406000205490565b607f8216906801fffffffffffffffe6001600160401b0383169260011b169180830460021490151715611eb25761538b916001600160401b036153498584613646565b921660005260096020526701ffffffffffffff60406000209460071c169160036001831b921b19161792906001600160401b0316600052602052604060002090565b55565b9091607f83166801fffffffffffffffe6001600160401b0382169160011b169080820460021490151715611eb2576153c68484613646565b60048310156108bc576001600160401b0361538b9416600052600960205260036701ffffffffffffff60406000209660071c1693831b921b19161792906001600160401b0316600052602052604060002090565b9080602083519182815201916020808360051b8301019401926000915b83831061544657505050505090565b9091929394602080615464600193601f1986820301875289516105f8565b97019301930191939290615437565b906020808351928381520192019060005b8181106154915750505090565b825163ffffffff16845260209384019390920191600101615484565b916155769061556861031c9593606086526001600160401b0360808251805160608a015282602082015116828a01528260408201511660a08a01528260608201511660c08a015201511660e087015260a061553461551d60208401516101406101008b01526101a08a01906105f8565b6040840151898203605f19016101208b01526105f8565b60608301516001600160a01b03166101408901529160808101516101608901520151868203605f1901610180880152615117565b90848203602086015261541a565b916040818403910152615473565b80516020909101516001600160e01b03198116929190600482106155a6575050565b6001600160e01b031960049290920360031b82901b16169150565b90303b1561026b576000916155ea6040519485938493630304c3e160e51b8552600485016154ad565b038183305af1908161568b575b5061568057615604612227565b9072c11c11c11c11c11c11c11c11c11c11c11c11c13314615626575b60039190565b61563f61563283615584565b6001600160e01b03191690565b6337c3be2960e01b148015615665575b1561562057631d1ccf9f60e01b60005260046000fd5b5061567261563283615584565b632be8ca8b60e21b1461564f565b60029061031c6105c0565b80612581600061569a936101e3565b386155f7565b6040516370a0823160e01b60208201526001600160a01b0390911660248201529192916156fd906156d48160448101613bf9565b84837f00000000000000000000000000000000000000000000000000000000000000009261572e565b92909115614bb55750805160208103614b9c5750906157288260208061031c95518301019101614969565b93611eb7565b93919361573b60846102af565b9461574960405196876101e3565b6084865261575760846102af565b602087019590601f1901368737833b156157da575a908082106157c9578291038060061c900311156157b8576000918291825a9560208451940192f1905a9003923d90608482116157af575b6000908287523e929190565b608491506157a3565b6337c3be2960e01b60005260046000fd5b632be8ca8b60e21b60005260046000fd5b63030ed58f60e21b60005260046000fd5b8051928251908415615947576101018511158061593b575b1561586a5781850194600019860195610100871161586a57861561592b5761582a87611ce2565b9660009586978795885b84811061588f575050505050600119018095149384615885575b50508261587b575b50501561586a5761586691611d3c565b5190565b6309bde33960e01b60005260046000fd5b1490503880615856565b149250388061584e565b6001811b8281160361591d57868a1015615908576158b160018b019a85611d3c565b51905b8c888c10156158f457506158cc60018c019b86611d3c565b515b818d1161586a576158ed828f926158e790600196615958565b92611d3c565b5201615834565b60018d019c61590291611d3c565b516158ce565b61591660018c019b8d611d3c565b51906158b4565b615916600189019884611d3c565b5050505090506158669150611d2a565b50610101821115615803565b630469ac9960e21b60005260046000fd5b8181101561596a579061031c9161596f565b61031c915b906040519060208201926001845260408301526060820152606081526134c96080826101e356fea164736f6c634300081a000a49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b", } var OffRampABI = OffRampMetaData.ABI diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index d7adcbef142..9d10c76b0ad 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -13,9 +13,9 @@ message_hasher: ../../../contracts/solc/ccip/MessageHasher/MessageHasher.sol/Mes mock_usdc_token_messenger: ../../../contracts/solc/ccip/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.sol/MockE2EUSDCTokenMessenger.abi.json ../../../contracts/solc/ccip/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.sol/MockE2EUSDCTokenMessenger.bin ad7902d63667e582b93b2fad139aa53111f9fddcedf92b1d6d122d1ab7ec4bab mock_usdc_token_transmitter: ../../../contracts/solc/ccip/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.sol/MockE2EUSDCTransmitter.abi.json ../../../contracts/solc/ccip/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.sol/MockE2EUSDCTransmitter.bin ae0d090105bc248f4eccd337836ec1db760c506d6f5578e662305abbbc520fcd multi_aggregate_rate_limiter: ../../../contracts/solc/ccip/MultiAggregateRateLimiter/MultiAggregateRateLimiter.sol/MultiAggregateRateLimiter.abi.json ../../../contracts/solc/ccip/MultiAggregateRateLimiter/MultiAggregateRateLimiter.sol/MultiAggregateRateLimiter.bin d462b10c87ad74b73502c3c97a7fc53771b915adb9a0fbee781e744f3827d179 -multi_ocr3_helper: ../../../contracts/solc/ccip/MultiOCR3Helper/MultiOCR3Helper.sol/MultiOCR3Helper.abi.json ../../../contracts/solc/ccip/MultiOCR3Helper/MultiOCR3Helper.sol/MultiOCR3Helper.bin 6fa79484ac09342282df342055494853521ea5332adaee0b709c6e21bcd17869 +multi_ocr3_helper: ../../../contracts/solc/ccip/MultiOCR3Helper/MultiOCR3Helper.sol/MultiOCR3Helper.abi.json ../../../contracts/solc/ccip/MultiOCR3Helper/MultiOCR3Helper.sol/MultiOCR3Helper.bin 71514db63a2ac5e3bebe0e6b393061ee1b414c9405084f4bbd890cfc76c21b0f nonce_manager: ../../../contracts/solc/ccip/NonceManager/NonceManager.sol/NonceManager.abi.json ../../../contracts/solc/ccip/NonceManager/NonceManager.sol/NonceManager.bin ac76c64749ce07dd2ec1b9346d3401dcc5538253e516aecc4767c4308817ea59 -offramp: ../../../contracts/solc/ccip/OffRamp/OffRamp.sol/OffRamp.abi.json ../../../contracts/solc/ccip/OffRamp/OffRamp.sol/OffRamp.bin 0b6526e1dfc331b45fe742560622a6538d9f134b0aeb560e84cccc7802425be1 +offramp: ../../../contracts/solc/ccip/OffRamp/OffRamp.sol/OffRamp.abi.json ../../../contracts/solc/ccip/OffRamp/OffRamp.sol/OffRamp.bin 61002b1524baea33d1d6a71d007511ccebc4cf8c3105385774cc27e9c00f046e onramp: ../../../contracts/solc/ccip/OnRamp/OnRamp.sol/OnRamp.abi.json ../../../contracts/solc/ccip/OnRamp/OnRamp.sol/OnRamp.bin a829e4efe4d8f600dc20589505701fbce872b09bc763b1a5abded28ef4a3afc9 ping_pong_demo: ../../../contracts/solc/ccip/PingPongDemo/PingPongDemo.sol/PingPongDemo.abi.json ../../../contracts/solc/ccip/PingPongDemo/PingPongDemo.sol/PingPongDemo.bin c87b6e1a8961a9dd2fab1eced0df12d0c1ef47bb1b2511f372b7e33443a20683 registry_module_owner_custom: ../../../contracts/solc/ccip/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.sol/RegistryModuleOwnerCustom.abi.json ../../../contracts/solc/ccip/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.sol/RegistryModuleOwnerCustom.bin ce04722cdea2e96d791e48c6a99f64559125d34cd24e19cfd5281892d2ed8ef0 From 6e09ac75d556c8b05099f7dba78e1db79324ac3f Mon Sep 17 00:00:00 2001 From: Juan Farber Date: Fri, 10 Jan 2025 14:26:56 -0300 Subject: [PATCH 31/91] [NONEVM-984] Solana TXM Reorg Detection reference bump (#15888) * solana bump * bump ref after solana was merged --- .changeset/large-ants-occur.md | 5 +++++ core/scripts/go.mod | 8 +++++++- core/scripts/go.sum | 9 +++++++-- deployment/go.mod | 7 ++++++- deployment/go.sum | 8 ++++++-- go.mod | 8 +++++++- go.sum | 7 +++++-- integration-tests/go.mod | 7 ++++++- integration-tests/go.sum | 7 +++++-- integration-tests/load/go.mod | 7 ++++++- integration-tests/load/go.sum | 7 +++++-- 11 files changed, 65 insertions(+), 15 deletions(-) create mode 100644 .changeset/large-ants-occur.md diff --git a/.changeset/large-ants-occur.md b/.changeset/large-ants-occur.md new file mode 100644 index 00000000000..81bf4ed5728 --- /dev/null +++ b/.changeset/large-ants-occur.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +add reorg detection for Solana TXM. #added diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 79addebee3f..7d32653538d 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -73,6 +73,7 @@ require ( github.com/atombender/go-jsonschema v0.16.1-0.20240916205339-a74cd4e2851c // indirect github.com/avast/retry-go/v4 v4.6.0 // indirect github.com/aws/aws-sdk-go v1.54.19 // indirect + github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -80,6 +81,7 @@ require ( github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect github.com/bytedance/sonic v1.12.3 // indirect @@ -139,6 +141,7 @@ require ( github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect + github.com/gagliardetto/utilz v0.1.1 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect @@ -199,6 +202,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 // indirect github.com/hashicorp/consul/sdk v0.16.1 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -253,6 +257,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mfridman/interpolate v0.0.2 // indirect + github.com/miekg/dns v1.1.61 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -289,6 +294,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect @@ -308,7 +314,7 @@ require ( github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 21d260ebdb9..6494f578fdf 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -419,6 +419,7 @@ github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7 github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= +github.com/gagliardetto/hashsearch v0.0.0-20191005111333-09dd671e19f9/go.mod h1:513DXpQPzeRo7d4dsCP3xO3XI8hgvruMl9njxyQeraQ= github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= @@ -922,6 +923,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -1174,8 +1176,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= @@ -1513,6 +1515,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1599,6 +1602,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1713,6 +1717,7 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/deployment/go.mod b/deployment/go.mod index f8875c64544..9595794978c 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -33,7 +33,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 @@ -107,6 +107,7 @@ require ( github.com/aws/constructs-go/constructs/v10 v10.4.2 // indirect github.com/aws/jsii-runtime-go v1.104.0 // indirect github.com/aws/smithy-go v1.22.0 // indirect + github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect github.com/benbjohnson/clock v1.3.5 // indirect @@ -117,6 +118,7 @@ require ( github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect + github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect github.com/bytedance/sonic v1.12.3 // indirect @@ -193,6 +195,7 @@ require ( github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect + github.com/gagliardetto/utilz v0.1.1 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect @@ -269,6 +272,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 // indirect github.com/hashicorp/consul/api v1.29.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect @@ -394,6 +398,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 7e7fb74354d..4800155620c 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -522,6 +522,7 @@ github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7 github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= +github.com/gagliardetto/hashsearch v0.0.0-20191005111333-09dd671e19f9/go.mod h1:513DXpQPzeRo7d4dsCP3xO3XI8hgvruMl9njxyQeraQ= github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= @@ -1101,6 +1102,7 @@ github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6B github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= @@ -1400,8 +1402,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= @@ -1698,6 +1700,7 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1989,6 +1992,7 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/go.mod b/go.mod index eecb2533829..ccedade99b3 100644 --- a/go.mod +++ b/go.mod @@ -85,7 +85,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de @@ -153,12 +153,14 @@ require ( github.com/apache/arrow-go/v18 v18.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/atombender/go-jsonschema v0.16.1-0.20240916205339-a74cd4e2851c // indirect + github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect + github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect github.com/bytedance/sonic v1.11.6 // indirect @@ -208,6 +210,7 @@ require ( github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gagliardetto/binary v0.7.7 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect + github.com/gagliardetto/utilz v0.1.1 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect github.com/gin-contrib/sse v0.1.0 // indirect @@ -250,6 +253,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect @@ -289,6 +293,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/mfridman/interpolate v0.0.2 // indirect + github.com/miekg/dns v1.1.61 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -316,6 +321,7 @@ require ( github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/cors v1.9.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect diff --git a/go.sum b/go.sum index 0f5735df451..6e8c1b4b5f3 100644 --- a/go.sum +++ b/go.sum @@ -406,6 +406,7 @@ github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyO github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= +github.com/gagliardetto/hashsearch v0.0.0-20191005111333-09dd671e19f9/go.mod h1:513DXpQPzeRo7d4dsCP3xO3XI8hgvruMl9njxyQeraQ= github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtLDMZeodE= github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= @@ -913,6 +914,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -1162,8 +1164,8 @@ github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418- github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= @@ -1612,6 +1614,7 @@ golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 5b3322a4a44..bb1952af8f3 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -126,6 +126,7 @@ require ( github.com/aws/constructs-go/constructs/v10 v10.4.2 // indirect github.com/aws/jsii-runtime-go v1.104.0 // indirect github.com/aws/smithy-go v1.22.0 // indirect + github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect github.com/benbjohnson/clock v1.3.5 // indirect @@ -135,6 +136,7 @@ require ( github.com/blang/semver/v4 v4.0.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect github.com/bytedance/sonic v1.12.3 // indirect @@ -212,6 +214,7 @@ require ( github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect + github.com/gagliardetto/utilz v0.1.1 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect @@ -287,6 +290,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 // indirect github.com/hashicorp/consul/api v1.29.2 // indirect github.com/hashicorp/consul/sdk v0.16.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -409,6 +413,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect @@ -428,7 +433,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index ea4e33c1e7b..2377fe29ce3 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -526,6 +526,7 @@ github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7 github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= +github.com/gagliardetto/hashsearch v0.0.0-20191005111333-09dd671e19f9/go.mod h1:513DXpQPzeRo7d4dsCP3xO3XI8hgvruMl9njxyQeraQ= github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= @@ -1113,6 +1114,7 @@ github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6B github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= @@ -1424,8 +1426,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= @@ -2020,6 +2022,7 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index da059e156b7..2c0703ed3b5 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -95,6 +95,7 @@ require ( github.com/aws/constructs-go/constructs/v10 v10.4.2 // indirect github.com/aws/jsii-runtime-go v1.104.0 // indirect github.com/aws/smithy-go v1.22.0 // indirect + github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df // indirect github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect @@ -105,6 +106,7 @@ require ( github.com/blang/semver/v4 v4.0.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 // indirect github.com/bytedance/sonic v1.12.3 // indirect @@ -183,6 +185,7 @@ require ( github.com/gagliardetto/binary v0.8.0 // indirect github.com/gagliardetto/solana-go v1.12.0 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect + github.com/gagliardetto/utilz v0.1.1 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect @@ -261,6 +264,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 // indirect github.com/hashicorp/consul/api v1.29.2 // indirect github.com/hashicorp/consul/sdk v0.16.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -387,6 +391,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.10.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect @@ -411,7 +416,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index b592320e882..036b3992aaf 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -518,6 +518,7 @@ github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7 github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= +github.com/gagliardetto/hashsearch v0.0.0-20191005111333-09dd671e19f9/go.mod h1:513DXpQPzeRo7d4dsCP3xO3XI8hgvruMl9njxyQeraQ= github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= @@ -1105,6 +1106,7 @@ github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6B github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= @@ -1413,8 +1415,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= @@ -2007,6 +2009,7 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= From 5156cfe5ce0f8e060255b39e6b6ce2160da4a3b5 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Fri, 10 Jan 2025 20:21:17 +0100 Subject: [PATCH 32/91] CCIP-4420 Merging back CCIP codebase (#15890) (#15894) --- .mockery.yaml | 8 + ccip/config/evm/Sei_Mainnet.toml | 18 + core/chains/evm/client/errors.go | 8 +- core/chains/evm/client/errors_test.go | 3 + .../evm/gas/block_history_estimator_test.go | 1 + core/chains/evm/gas/rollups/op_l1_oracle.go | 2 + core/chains/evm/types/models_test.go | 17 +- .../mock_lbtc_token_pool.go | 3042 +++++++++++++++++ core/services/ocr2/delegate.go | 96 +- .../ocr2/plugins/ccip/ccipcommit/factory.go | 29 +- .../plugins/ccip/ccipcommit/factory_test.go | 3 + .../plugins/ccip/ccipcommit/initializers.go | 73 +- .../ocr2/plugins/ccip/ccipcommit/ocr2.go | 76 +- .../ocr2/plugins/ccip/ccipcommit/ocr2_test.go | 162 +- .../ocr2/plugins/ccip/ccipexec/batching.go | 19 +- .../plugins/ccip/ccipexec/batching_test.go | 11 +- .../ocr2/plugins/ccip/ccipexec/factory.go | 17 +- .../plugins/ccip/ccipexec/factory_test.go | 3 + .../plugins/ccip/ccipexec/initializers.go | 32 +- .../ocr2/plugins/ccip/ccipexec/ocr2.go | 23 +- .../ocr2/plugins/ccip/ccipexec/ocr2_test.go | 93 +- .../ocr2/plugins/ccip/config/config.go | 31 +- .../plugins/ccip/config/type_and_version.go | 7 + .../ccip/config/type_and_version_test.go | 50 + .../plugins/ccip/estimatorconfig/config.go | 83 + .../ccip/estimatorconfig/config_test.go | 112 + .../interceptors/mantle/interceptor.go | 82 + .../interceptors/mantle/interceptor_test.go | 96 + .../mocks/gas_price_interceptor_mock.go | 106 + .../ocr2/plugins/ccip/exportinternal.go | 38 +- .../ocr2/plugins/ccip/integration_test.go | 6 +- .../ccip/internal/cache/commit_roots_test.go | 14 +- .../ccip/internal/ccipcommon/shortcuts.go | 13 +- .../internal/ccipcommon/shortcuts_test.go | 15 +- .../token_pool_batch_reader_test.go | 4 +- .../ccipdata/ccipdataprovider/provider.go | 1 - .../ccipdata/commit_store_reader_test.go | 20 +- .../internal/ccipdata/factory/commit_store.go | 14 +- .../ccipdata/factory/commit_store_test.go | 7 +- .../ccip/internal/ccipdata/factory/offramp.go | 14 +- .../internal/ccipdata/factory/offramp_test.go | 7 +- .../ccip/internal/ccipdata/factory/onramp.go | 1 - .../internal/ccipdata/fee_estimator_config.go | 11 + .../mocks/fee_estimator_config_mock.go | 177 + .../internal/ccipdata/offramp_reader_test.go | 14 +- .../plugins/ccip/internal/ccipdata/reader.go | 1 - .../ccip/internal/ccipdata/reader_test.go | 7 +- .../ccip/internal/ccipdata/retry_config.go | 4 +- .../internal/ccipdata/v1_2_0/commit_store.go | 20 +- .../ccipdata/v1_2_0/commit_store_test.go | 7 +- .../ccip/internal/ccipdata/v1_2_0/offramp.go | 20 +- .../ccipdata/v1_2_0/offramp_reader_test.go | 8 +- .../v1_2_0/offramp_reader_unit_test.go | 2 +- .../ccip/internal/ccipdata/v1_2_0/onramp.go | 79 +- .../internal/ccipdata/v1_2_0/onramp_test.go | 5 +- .../ccipdata/v1_2_0/price_registry.go | 1 - .../internal/ccipdata/v1_5_0/commit_store.go | 12 +- .../ccip/internal/ccipdata/v1_5_0/offramp.go | 20 +- .../ccip/internal/ccipdata/v1_5_0/onramp.go | 80 +- .../internal/ccipdata/v1_5_0/onramp_test.go | 8 +- .../plugins/ccip/internal/pricegetter/evm.go | 158 +- .../ccip/internal/pricegetter/evm_test.go | 195 +- .../ccip/internal/pricegetter/pipeline.go | 2 +- .../ocr2/plugins/ccip/internal/rpclib/evm.go | 4 + core/services/ocr2/plugins/ccip/metrics.go | 14 + .../ocr2/plugins/ccip/observations.go | 8 + .../plugins/ccip/prices/da_price_estimator.go | 35 +- .../ccip/prices/da_price_estimator_test.go | 158 +- .../ccip/prices/gas_price_estimator.go | 5 +- .../ccip/testhelpers/ccip_contracts.go | 26 +- .../ccip/testhelpers/integration/chainlink.go | 5 +- .../ccip/testhelpers/integration/jobspec.go | 6 + .../testhelpers_1_4_0/ccip_contracts_1_4_0.go | 1601 +++++++++ .../testhelpers_1_4_0/chainlink.go | 1054 ++++++ .../testhelpers_1_4_0/config_1_4_0.go | 76 + .../ocr2/plugins/ccip/tokendata/bgworker.go | 2 +- .../ccip/tokendata/http/http_client.go | 17 +- .../tokendata/http/observed_http_client.go | 18 +- .../ocr2/plugins/ccip/tokendata/lbtc/lbtc.go | 275 ++ .../plugins/ccip/tokendata/lbtc/lbtc_test.go | 490 +++ .../ocr2/plugins/ccip/tokendata/usdc/usdc.go | 2 +- core/services/relay/evm/ccip.go | 30 +- core/services/relay/evm/commit_provider.go | 47 +- core/services/relay/evm/evm.go | 330 +- core/services/relay/evm/exec_provider.go | 135 +- .../evm/interceptors/mantle/interceptor.go | 81 + .../interceptors/mantle/interceptor_test.go | 96 + 87 files changed, 9041 insertions(+), 762 deletions(-) create mode 100644 ccip/config/evm/Sei_Mainnet.toml create mode 100644 core/gethwrappers/ccip/generated/mock_lbtc_token_pool/mock_lbtc_token_pool.go create mode 100644 core/services/ocr2/plugins/ccip/config/type_and_version_test.go create mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/config.go create mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go create mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go create mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go create mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/mocks/gas_price_interceptor_mock.go create mode 100644 core/services/ocr2/plugins/ccip/internal/ccipdata/fee_estimator_config.go create mode 100644 core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/fee_estimator_config_mock.go create mode 100644 core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go create mode 100644 core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go create mode 100644 core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go create mode 100644 core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc.go create mode 100644 core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go create mode 100644 core/services/relay/evm/interceptors/mantle/interceptor.go create mode 100644 core/services/relay/evm/interceptors/mantle/interceptor_test.go diff --git a/.mockery.yaml b/.mockery.yaml index 7fd4ff242bb..b7dbb8a1e85 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -490,12 +490,20 @@ packages: PriceRegistryReader: config: filename: price_registry_reader_mock.go + FeeEstimatorConfigReader: + config: + filename: fee_estimator_config_mock.go TokenPoolReader: config: filename: token_pool_reader_mock.go USDCReader: config: filename: usdc_reader_mock.go + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig: + interfaces: + GasPriceInterceptor: + config: + filename: gas_price_interceptor_mock.go github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader: config: filename: token_pool_batched_reader_mock.go diff --git a/ccip/config/evm/Sei_Mainnet.toml b/ccip/config/evm/Sei_Mainnet.toml new file mode 100644 index 00000000000..23977756ac1 --- /dev/null +++ b/ccip/config/evm/Sei_Mainnet.toml @@ -0,0 +1,18 @@ +ChainID = '1329' +ChainType = 'sei' +# finality_depth: instant +FinalityDepth = 10 +# block_time: ~0.4s, adding 1 second buffer +LogPollInterval = '2s' +# finality_depth * block_time / 60 secs = ~0.8 min (finality time) +NoNewFinalizedHeadsThreshold = '5m' +# "RPC node returned multiple missing blocks on query for block numbers [31592085 31592084] even though the WS subscription already sent us these blocks. It might help to increase EVM.RPCBlockQueryDelay (currently 1)" +RPCBlockQueryDelay = 5 + +[GasEstimator] +EIP1559DynamicFees = false +Mode = 'BlockHistory' +PriceMax = '3000 gwei' # recommended by ds&a + +[GasEstimator.BlockHistory] +BlockHistorySize = 200 diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index 871e574aea2..a19e03d50cb 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -265,9 +265,11 @@ var aStar = ClientErrors{ } var mantle = ClientErrors{ - InsufficientEth: regexp.MustCompile(`(: |^)'*insufficient funds for gas \* price \+ value`), - Fatal: regexp.MustCompile(`(: |^)'*invalid sender`), - NonceTooLow: regexp.MustCompile(`(: |^)'*nonce too low`), + InsufficientEth: regexp.MustCompile(`(: |^)'*insufficient funds for gas \* price \+ value`), + Fatal: regexp.MustCompile(`(: |^)'*invalid sender`), + NonceTooLow: regexp.MustCompile(`(: |^)'*nonce too low`), + ReplacementTransactionUnderpriced: regexp.MustCompile(`(: |^)'*replacement transaction underpriced`), + TransactionAlreadyInMempool: regexp.MustCompile(`(: |^)'*already known`), } var hederaFatal = regexp.MustCompile(`(: |^)(execution reverted)(:|$) | ^Transaction gas limit '(\d+)' exceeds block gas limit '(\d+)' | ^Transaction gas limit provided '(\d+)' is insufficient of intrinsic gas required '(\d+)' | ^Oversized data:|status INVALID_SIGNATURE`) diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index 9a046922abb..2a28fe3c2c8 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -112,6 +112,7 @@ func Test_Eth_Errors(t *testing.T) { {"gas price too low", false, "Arbitrum"}, {"client error replacement underpriced", true, "tomlConfig"}, {"", false, "tomlConfig"}, + {"failed to forward tx to sequencer, please try again. Error message: 'replacement transaction underpriced'", true, "Mantle"}, } for _, test := range tests { @@ -145,6 +146,8 @@ func Test_Eth_Errors(t *testing.T) { {"client error transaction already in mempool", true, "tomlConfig"}, {"alreadyknown", true, "Gnosis"}, {"tx already exists in cache", true, "Sei"}, + {"failed to forward tx to sequencer, please try again. Error message: 'already known'", true, "Mantle"}, + {"tx already exists in cache", true, "Sei"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message) diff --git a/core/chains/evm/gas/block_history_estimator_test.go b/core/chains/evm/gas/block_history_estimator_test.go index e3df261f2cf..b754132d7c7 100644 --- a/core/chains/evm/gas/block_history_estimator_test.go +++ b/core/chains/evm/gas/block_history_estimator_test.go @@ -18,6 +18,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" diff --git a/core/chains/evm/gas/rollups/op_l1_oracle.go b/core/chains/evm/gas/rollups/op_l1_oracle.go index cd6f2347953..daf67ded259 100644 --- a/core/chains/evm/gas/rollups/op_l1_oracle.go +++ b/core/chains/evm/gas/rollups/op_l1_oracle.go @@ -26,6 +26,8 @@ import ( ) // Reads L2-specific precompiles and caches the l1GasPrice set by the L2. +// +//nolint:unused // backported from CCIP type optimismL1Oracle struct { services.StateMachine client l1OracleClient diff --git a/core/chains/evm/types/models_test.go b/core/chains/evm/types/models_test.go index c06d683651a..a3f40a8bc2d 100644 --- a/core/chains/evm/types/models_test.go +++ b/core/chains/evm/types/models_test.go @@ -954,7 +954,7 @@ func TestBlock_UnmarshalJSON(t *testing.T) { t.Run("unmarshals geth block", func(t *testing.T) { b := new(evmtypes.Block) err := b.UnmarshalJSON([]byte(gethSampleBlock)) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, int64(15051090), b.Number) assert.Equal(t, "0x45eb0a650b6b0b9fd1ee676b870e43fa7614f1034f7404070327a332faed05c0", b.Hash.Hex()) @@ -966,14 +966,25 @@ func TestBlock_UnmarshalJSON(t *testing.T) { t.Run("handles empty result", func(t *testing.T) { b := new(evmtypes.Block) err := b.UnmarshalJSON([]byte("null")) - assert.Error(t, err) + require.Error(t, err) assert.Equal(t, pkgerrors.Cause(err), evmtypes.ErrMissingBlock) assert.True(t, pkgerrors.Is(err, evmtypes.ErrMissingBlock)) }) t.Run("unmarshals EIP-4844 block", func(t *testing.T) { b := new(evmtypes.Block) err := b.UnmarshalJSON([]byte(eip4844Block)) - assert.NoError(t, err) + require.NoError(t, err) + assert.Equal(t, int64(5300694), b.Number) + assert.Equal(t, "0x3edd900025edab70dde26a52377c3d0a9474c3f540bd0131d58f508711272590", b.Hash.Hex()) + assert.Equal(t, "0x077c1d68b52f8203cb90a71759a09b11c2a6577f97ea1fd4a8686a387fbedac8", b.ParentHash.Hex()) + assert.Equal(t, assets.NewWeiI(96436174005), b.BaseFeePerGas) + assert.Equal(t, int64(1708087260), b.Timestamp.Unix()) + assert.Len(t, b.Transactions, 6) + }) + t.Run("unmarshals EIP-4844 block", func(t *testing.T) { + b := new(evmtypes.Block) + err := b.UnmarshalJSON([]byte(eip4844Block)) + require.NoError(t, err) assert.Equal(t, int64(5300694), b.Number) assert.Equal(t, "0x3edd900025edab70dde26a52377c3d0a9474c3f540bd0131d58f508711272590", b.Hash.Hex()) assert.Equal(t, "0x077c1d68b52f8203cb90a71759a09b11c2a6577f97ea1fd4a8686a387fbedac8", b.ParentHash.Hex()) diff --git a/core/gethwrappers/ccip/generated/mock_lbtc_token_pool/mock_lbtc_token_pool.go b/core/gethwrappers/ccip/generated/mock_lbtc_token_pool/mock_lbtc_token_pool.go new file mode 100644 index 00000000000..8fa1b3da14e --- /dev/null +++ b/core/gethwrappers/ccip/generated/mock_lbtc_token_pool/mock_lbtc_token_pool.go @@ -0,0 +1,3042 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_lbtc_token_pool + +import ( + "errors" + "fmt" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + RemotePoolAddresses [][]byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var MockLBTCTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotTransferToSelf\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"expected\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"actual\",\"type\":\"uint8\"}],\"name\":\"InvalidDecimalArgs\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"}],\"name\":\"InvalidRemoteChainDecimals\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidRemotePoolForChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeProposedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"remoteDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"localDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"remoteAmount\",\"type\":\"uint256\"}],\"name\":\"OverflowDetected\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"RateLimitAdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"addRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"remoteChainSelectorsToRemove\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes[]\",\"name\":\"remotePoolAddresses\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chainsToAdd\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePools\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDecimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_destPoolData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"isRemotePool\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"removeRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b5060405162003a5138038062003a51833981016040819052620000359162000663565b846008858585336000816200005d57604051639b15e16f60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b038481169190911790915581161562000090576200009081620001fe565b50506001600160a01b0385161580620000b057506001600160a01b038116155b80620000c357506001600160a01b038216155b15620000e2576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b03808616608081905290831660c0526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa92505050801562000152575060408051601f3d908101601f191682019092526200014f9181019062000785565b60015b1562000192578060ff168560ff161462000190576040516332ad3e0760e11b815260ff80871660048301528216602482015260440160405180910390fd5b505b60ff841660a052600480546001600160a01b0319166001600160a01b038316179055825115801560e052620001dc57604080516000815260208101909152620001dc908462000278565b505050505080600a9081620001f2919062000841565b5050505050506200095b565b336001600160a01b038216036200022857604051636d6c4ee560e11b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b03838116918217835560015460405192939116917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60e05162000299576040516335f4a7b360e01b815260040160405180910390fd5b60005b825181101562000324576000838281518110620002bd57620002bd6200090d565b60209081029190910101519050620002d7600282620003d5565b156200031a576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200029c565b5060005b8151811015620003d05760008282815181106200034957620003496200090d565b6020026020010151905060006001600160a01b0316816001600160a01b031603620003755750620003c7565b62000382600282620003f5565b15620003c5576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b60010162000328565b505050565b6000620003ec836001600160a01b0384166200040c565b90505b92915050565b6000620003ec836001600160a01b03841662000510565b60008181526001830160205260408120548015620005055760006200043360018362000923565b8554909150600090620004499060019062000923565b9050808214620004b55760008660000182815481106200046d576200046d6200090d565b90600052602060002001549050808760000184815481106200049357620004936200090d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620004c957620004c962000945565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620003ef565b6000915050620003ef565b60008181526001830160205260408120546200055957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003ef565b506000620003ef565b6001600160a01b03811681146200057857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620005bc57620005bc6200057b565b604052919050565b8051620005d18162000562565b919050565b600082601f830112620005e857600080fd5b81516001600160401b038111156200060457620006046200057b565b60206200061a601f8301601f1916820162000591565b82815285828487010111156200062f57600080fd5b60005b838110156200064f57858101830151828201840152820162000632565b506000928101909101919091529392505050565b600080600080600060a086880312156200067c57600080fd5b8551620006898162000562565b602087810151919650906001600160401b0380821115620006a957600080fd5b818901915089601f830112620006be57600080fd5b815181811115620006d357620006d36200057b565b8060051b620006e485820162000591565b918252838101850191858101908d841115620006ff57600080fd5b948601945b838610156200072d57855192506200071c8362000562565b828252948601949086019062000704565b9950620007419250505060408a01620005c4565b95506200075160608a01620005c4565b945060808901519250808311156200076857600080fd5b50506200077888828901620005d6565b9150509295509295909350565b6000602082840312156200079857600080fd5b815160ff81168114620007aa57600080fd5b9392505050565b600181811c90821680620007c657607f821691505b602082108103620007e757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003d0576000816000526020600020601f850160051c81016020861015620008185750805b601f850160051c820191505b81811015620008395782815560010162000824565b505050505050565b81516001600160401b038111156200085d576200085d6200057b565b62000875816200086e8454620007b1565b84620007ed565b602080601f831160018114620008ad5760008415620008945750858301515b600019600386901b1c1916600185901b17855562000839565b600085815260208120601f198616915b82811015620008de57888601518255948401946001909101908401620008bd565b5085821015620008fd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b81810381811115620003ef57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516130a0620009b160003960008181610562015261199f0152600061053c015260006102eb015260008181610252015281816102a7015281816107450152610ba201526130a06000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639a4575b911610104578063c0d78655116100a2578063dc0bd97111610071578063dc0bd9711461053a578063e0351e1314610560578063e8a1da1714610586578063f2fde38b1461059957600080fd5b8063c0d78655146104ec578063c4bffe2b146104ff578063c75eea9c14610514578063cf7401f31461052757600080fd5b8063acfecf91116100de578063acfecf9114610439578063af58d59f1461044c578063b0f479a1146104bb578063b7946580146104d957600080fd5b80639a4575b9146103e4578063a42a7b8b14610404578063a7cd63b71461042457600080fd5b80634c5ef0ed1161017c57806379ba50971161014b57806379ba5097146103985780637d54534e146103a05780638926f54f146103b35780638da5cb5b146103c657600080fd5b80634c5ef0ed1461033f57806354c8a4f31461035257806362ddd3c4146103675780636d3d1a581461037a57600080fd5b8063240028e8116101b8578063240028e81461029757806324f65ee7146102e457806332a7a82214610315578063390775371461031d57600080fd5b806301ffc9a7146101df578063181f5a771461020757806321df0da714610250575b600080fd5b6101f26101ed36600461243d565b6105ac565b60405190151581526020015b60405180910390f35b6102436040518060400160405280601781526020017f4d6f636b4c425443546f6b656e506f6f6c20312e352e3100000000000000000081525081565b6040516101fe91906124e3565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b6101f26102a53660046124f6565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b60405160ff7f00000000000000000000000000000000000000000000000000000000000000001681526020016101fe565b610243610691565b61033061032b36600461252c565b61071f565b604051905181526020016101fe565b6101f261034d366004612585565b610894565b610365610360366004612654565b6108de565b005b610365610375366004612585565b610959565b60095473ffffffffffffffffffffffffffffffffffffffff16610272565b6103656109f6565b6103656103ae3660046124f6565b610ac4565b6101f26103c13660046126c0565b610b45565b60015473ffffffffffffffffffffffffffffffffffffffff16610272565b6103f76103f23660046126db565b610b5c565b6040516101fe9190612716565b6104176104123660046126c0565b610d07565b6040516101fe919061276d565b61042c610e72565b6040516101fe91906127ef565b610365610447366004612585565b610e83565b61045f61045a3660046126c0565b610f9b565b6040516101fe919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610272565b6102436104e73660046126c0565b611070565b6103656104fa3660046124f6565b611120565b6105076111fb565b6040516101fe9190612849565b61045f6105223660046126c0565b6112b3565b6103656105353660046129c8565b611385565b7f0000000000000000000000000000000000000000000000000000000000000000610272565b7f00000000000000000000000000000000000000000000000000000000000000006101f2565b610365610594366004612654565b611409565b6103656105a73660046124f6565b61191b565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf00000000000000000000000000000000000000000000000000000000148061063f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061068b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600a805461069e90612a0d565b80601f01602080910402602001604051908101604052809291908181526020018280546106ca90612a0d565b80156107175780601f106106ec57610100808354040283529160200191610717565b820191906000526020600020905b8154815290600101906020018083116106fa57829003601f168201915b505050505081565b60408051602081019091526000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f1961077a60608501604086016124f6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b1580156107ea57600080fd5b505af11580156107fe573d6000803e3d6000fd5b506108139250505060608301604084016124f6565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0846060013560405161087591815260200190565b60405180910390a3506040805160208101909152606090910135815290565b60006108d683836040516108a9929190612a60565b604080519182900390912067ffffffffffffffff871660009081526007602052919091206005019061192f565b949350505050565b6108e661194a565b6109538484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080880282810182019093528782529093508792508691829185019084908082843760009201919091525061199d92505050565b50505050565b61096161194a565b61096a83610b45565b6109b1576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b6109f18383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b5392505050565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a47576040517f02b543c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560008054909116815560405173ffffffffffffffffffffffffffffffffffffffff909216929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610acc61194a565b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f44676b5284b809a22248eba0da87391d79098be38bb03154be88a58bf4d091749060200160405180910390a150565b600061068b600567ffffffffffffffff841661192f565b60408051808201909152606080825260208201526040517f42966c68000000000000000000000000000000000000000000000000000000008152606083013560048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b158015610bfb57600080fd5b505af1158015610c0f573d6000803e3d6000fd5b5050604051606085013581523392507f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7915060200160405180910390a26040518060400160405280610c6d8460200160208101906104e791906126c0565b8152602001600a8054610c7f90612a0d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cab90612a0d565b8015610cf85780601f10610ccd57610100808354040283529160200191610cf8565b820191906000526020600020905b815481529060010190602001808311610cdb57829003601f168201915b50505050508152509050919050565b67ffffffffffffffff8116600090815260076020526040812060609190610d3090600501611c4d565b90506000815167ffffffffffffffff811115610d4e57610d4e61288b565b604051908082528060200260200182016040528015610d8157816020015b6060815260200190600190039081610d6c5790505b50905060005b8251811015610e6a5760086000848381518110610da657610da6612a70565b602002602001015181526020019081526020016000208054610dc790612a0d565b80601f0160208091040260200160405190810160405280929190818152602001828054610df390612a0d565b8015610e405780601f10610e1557610100808354040283529160200191610e40565b820191906000526020600020905b815481529060010190602001808311610e2357829003601f168201915b5050505050828281518110610e5757610e57612a70565b6020908102919091010152600101610d87565b509392505050565b6060610e7e6002611c4d565b905090565b610e8b61194a565b610e9483610b45565b610ed6576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016109a8565b610f168282604051610ee9929190612a60565b604080519182900390912067ffffffffffffffff8616600090815260076020529190912060050190611c5a565b610f52578282826040517f74f23c7c0000000000000000000000000000000000000000000000000000000081526004016109a893929190612ae8565b8267ffffffffffffffff167f52d00ee4d9bd51b40168f2afc5848837288ce258784ad914278791464b3f4d768383604051610f8e929190612b0c565b60405180910390a2505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261068b90611c66565b67ffffffffffffffff8116600090815260076020526040902060040180546060919061109b90612a0d565b80601f01602080910402602001604051908101604052809291908181526020018280546110c790612a0d565b80156111145780601f106110e957610100808354040283529160200191611114565b820191906000526020600020905b8154815290600101906020018083116110f757829003601f168201915b50505050509050919050565b61112861194a565b73ffffffffffffffffffffffffffffffffffffffff8116611175576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b606060006112096005611c4d565b90506000815167ffffffffffffffff8111156112275761122761288b565b604051908082528060200260200182016040528015611250578160200160208202803683370190505b50905060005b82518110156112ac5782818151811061127157611271612a70565b602002602001015182828151811061128b5761128b612a70565b67ffffffffffffffff90921660209283029190910190910152600101611256565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261068b90611c66565b60095473ffffffffffffffffffffffffffffffffffffffff1633148015906113c5575060015473ffffffffffffffffffffffffffffffffffffffff163314155b156113fe576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016109a8565b6109f1838383611d18565b61141161194a565b60005b838110156115fe57600085858381811061143057611430612a70565b905060200201602081019061144591906126c0565b905061145c600567ffffffffffffffff8316611c5a565b61149e576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016109a8565b67ffffffffffffffff811660009081526007602052604081206114c390600501611c4d565b905060005b815181101561152f576115268282815181106114e6576114e6612a70565b6020026020010151600760008667ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020600501611c5a90919063ffffffff16565b506001016114c8565b5067ffffffffffffffff8216600090815260076020526040812080547fffffffffffffffffffffff0000000000000000000000000000000000000000009081168255600182018390556002820180549091169055600381018290559061159860048301826123d0565b60058201600081816115aa828261240a565b505060405167ffffffffffffffff871681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916945060200192506115ec915050565b60405180910390a15050600101611414565b5060005b8181101561191457600083838381811061161e5761161e612a70565b90506020028101906116309190612b20565b61163990612bec565b905061164a81606001516000611e02565b61165981608001516000611e02565b806040015151600003611698576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516116b09060059067ffffffffffffffff16611f3f565b6116f55780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016109a8565b805167ffffffffffffffff16600090815260076020908152604091829020825160a08082018552606080870180518601516fffffffffffffffffffffffffffffffff90811680865263ffffffff42168689018190528351511515878b0181905284518a0151841686890181905294518b0151841660809889018190528954740100000000000000000000000000000000000000009283027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff7001000000000000000000000000000000008087027fffffffffffffffffffffffff000000000000000000000000000000000000000094851690981788178216929092178d5592810290971760018c01558c519889018d52898e0180518d01518716808b528a8e019590955280515115158a8f018190528151909d01518716988a01899052518d0151909516979098018790526002890180549a9091029990931617179094169590951790925590920290911760038201559082015160048201906118789082612d63565b5060005b8260200151518110156118bc576118b48360000151846020015183815181106118a7576118a7612a70565b6020026020010151611b53565b60010161187c565b507f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c282600001518360400151846060015185608001516040516119029493929190612e7d565b60405180910390a15050600101611602565b5050505050565b61192361194a565b61192c81611f4b565b50565b600081815260018301602052604081205415155b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461199b576040517f2b5c74de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b7f00000000000000000000000000000000000000000000000000000000000000006119f4576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611a8a576000838281518110611a1457611a14612a70565b60200260200101519050611a3281600261200f90919063ffffffff16565b15611a815760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016119f7565b5060005b81518110156109f1576000828281518110611aab57611aab612a70565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611aef5750611b4b565b611afa600282612031565b15611b495760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611a8e565b8051600003611b8e576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805160208083019190912067ffffffffffffffff8416600090815260079092526040909120611bc09060050182611f3f565b611bfa5782826040517f393b8ad20000000000000000000000000000000000000000000000000000000081526004016109a8929190612f16565b6000818152600860205260409020611c128382612d63565b508267ffffffffffffffff167f7d628c9a1796743d365ab521a8b2a4686e419b3269919dc9145ea2ce853b54ea83604051610f8e91906124e3565b6060600061194383612053565b600061194383836120ae565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152611cf482606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642611cd89190612f68565b85608001516fffffffffffffffffffffffffffffffff166121a1565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b611d2183610b45565b611d63576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016109a8565b611d6e826000611e02565b67ffffffffffffffff83166000908152600760205260409020611d9190836121c9565b611d9c816000611e02565b67ffffffffffffffff83166000908152600760205260409020611dc290600201826121c9565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051611df593929190612f7b565b60405180910390a1505050565b815115611ecd5781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580611e58575060408201516fffffffffffffffffffffffffffffffff16155b15611e9157816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016109a89190612ffe565b8015611ec9576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60408201516fffffffffffffffffffffffffffffffff16151580611f06575060208201516fffffffffffffffffffffffffffffffff1615155b15611ec957816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016109a89190612ffe565b6000611943838361236b565b3373ffffffffffffffffffffffffffffffffffffffff821603611f9a576040517fdad89dca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560015460405192939116917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006119438373ffffffffffffffffffffffffffffffffffffffff84166120ae565b60006119438373ffffffffffffffffffffffffffffffffffffffff841661236b565b60608160000180548060200260200160405190810160405280929190818152602001828054801561111457602002820191906000526020600020905b81548152602001906001019080831161208f5750505050509050919050565b600081815260018301602052604081205480156121975760006120d2600183612f68565b85549091506000906120e690600190612f68565b905080821461214b57600086600001828154811061210657612106612a70565b906000526020600020015490508087600001848154811061212957612129612a70565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061215c5761215c61303a565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061068b565b600091505061068b565b60006121c0856121b18486613069565b6121bb9087613080565b6123ba565b95945050505050565b81546000906121f290700100000000000000000000000000000000900463ffffffff1642612f68565b90508015612294576001830154835461223a916fffffffffffffffffffffffffffffffff808216928116918591700100000000000000000000000000000000909104166121a1565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b602082015183546122ba916fffffffffffffffffffffffffffffffff90811691166123ba565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990611df5908490612ffe565b60008181526001830160205260408120546123b25750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561068b565b50600061068b565b60008183106123c95781611943565b5090919050565b5080546123dc90612a0d565b6000825580601f106123ec575050565b601f01602090049060005260206000209081019061192c9190612424565b508054600082559060005260206000209081019061192c91905b5b808211156124395760008155600101612425565b5090565b60006020828403121561244f57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461194357600080fd5b6000815180845260005b818110156124a557602081850181015186830182015201612489565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611943602083018461247f565b60006020828403121561250857600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461194357600080fd5b60006020828403121561253e57600080fd5b813567ffffffffffffffff81111561255557600080fd5b8201610100818503121561194357600080fd5b803567ffffffffffffffff8116811461258057600080fd5b919050565b60008060006040848603121561259a57600080fd5b6125a384612568565b9250602084013567ffffffffffffffff808211156125c057600080fd5b818601915086601f8301126125d457600080fd5b8135818111156125e357600080fd5b8760208285010111156125f557600080fd5b6020830194508093505050509250925092565b60008083601f84011261261a57600080fd5b50813567ffffffffffffffff81111561263257600080fd5b6020830191508360208260051b850101111561264d57600080fd5b9250929050565b6000806000806040858703121561266a57600080fd5b843567ffffffffffffffff8082111561268257600080fd5b61268e88838901612608565b909650945060208701359150808211156126a757600080fd5b506126b487828801612608565b95989497509550505050565b6000602082840312156126d257600080fd5b61194382612568565b6000602082840312156126ed57600080fd5b813567ffffffffffffffff81111561270457600080fd5b820160a0818503121561194357600080fd5b602081526000825160406020840152612732606084018261247f565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160408501526121c0828261247f565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156127e2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526127d085835161247f565b94509285019290850190600101612796565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561283d57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161280b565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561283d57835167ffffffffffffffff1683529284019291840191600101612865565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156128dd576128dd61288b565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561292a5761292a61288b565b604052919050565b80356fffffffffffffffffffffffffffffffff8116811461258057600080fd5b60006060828403121561296457600080fd5b6040516060810181811067ffffffffffffffff821117156129875761298761288b565b6040529050808235801515811461299d57600080fd5b81526129ab60208401612932565b60208201526129bc60408401612932565b60408201525092915050565b600080600060e084860312156129dd57600080fd5b6129e684612568565b92506129f58560208601612952565b9150612a048560808601612952565b90509250925092565b600181811c90821680612a2157607f821691505b602082108103612a5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b67ffffffffffffffff841681526040602082015260006121c0604083018486612a9f565b6020815260006108d6602083018486612a9f565b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee1833603018112612b5457600080fd5b9190910192915050565b600082601f830112612b6f57600080fd5b813567ffffffffffffffff811115612b8957612b8961288b565b612bba60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016128e3565b818152846020838601011115612bcf57600080fd5b816020850160208301376000918101602001919091529392505050565b60006101208236031215612bff57600080fd5b612c076128ba565b612c1083612568565b815260208084013567ffffffffffffffff80821115612c2e57600080fd5b9085019036601f830112612c4157600080fd5b813581811115612c5357612c5361288b565b8060051b612c628582016128e3565b9182528381018501918581019036841115612c7c57600080fd5b86860192505b83831015612cb857823585811115612c9a5760008081fd5b612ca83689838a0101612b5e565b8352509186019190860190612c82565b8087890152505050506040860135925080831115612cd557600080fd5b5050612ce336828601612b5e565b604083015250612cf63660608501612952565b6060820152612d083660c08501612952565b608082015292915050565b601f8211156109f1576000816000526020600020601f850160051c81016020861015612d3c5750805b601f850160051c820191505b81811015612d5b57828155600101612d48565b505050505050565b815167ffffffffffffffff811115612d7d57612d7d61288b565b612d9181612d8b8454612a0d565b84612d13565b602080601f831160018114612de45760008415612dae5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555612d5b565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015612e3157888601518255948401946001909101908401612e12565b5085821015612e6d57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152612ea18184018761247f565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff9081166060870152908701511660808501529150612edf9050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e08301526121c0565b67ffffffffffffffff831681526040602082015260006108d6604083018461247f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561068b5761068b612f39565b67ffffffffffffffff8416815260e08101612fc760208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c08301526108d6565b6060810161068b82848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b808202811582820484141761068b5761068b612f39565b8082018082111561068b5761068b612f3956fea164736f6c6343000818000a", +} + +var MockLBTCTokenPoolABI = MockLBTCTokenPoolMetaData.ABI + +var MockLBTCTokenPoolBin = MockLBTCTokenPoolMetaData.Bin + +func DeployMockLBTCTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address, destPoolData []byte) (common.Address, *types.Transaction, *MockLBTCTokenPool, error) { + parsed, err := MockLBTCTokenPoolMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MockLBTCTokenPoolBin), backend, token, allowlist, rmnProxy, router, destPoolData) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockLBTCTokenPool{address: address, abi: *parsed, MockLBTCTokenPoolCaller: MockLBTCTokenPoolCaller{contract: contract}, MockLBTCTokenPoolTransactor: MockLBTCTokenPoolTransactor{contract: contract}, MockLBTCTokenPoolFilterer: MockLBTCTokenPoolFilterer{contract: contract}}, nil +} + +type MockLBTCTokenPool struct { + address common.Address + abi abi.ABI + MockLBTCTokenPoolCaller + MockLBTCTokenPoolTransactor + MockLBTCTokenPoolFilterer +} + +type MockLBTCTokenPoolCaller struct { + contract *bind.BoundContract +} + +type MockLBTCTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type MockLBTCTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type MockLBTCTokenPoolSession struct { + Contract *MockLBTCTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockLBTCTokenPoolCallerSession struct { + Contract *MockLBTCTokenPoolCaller + CallOpts bind.CallOpts +} + +type MockLBTCTokenPoolTransactorSession struct { + Contract *MockLBTCTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type MockLBTCTokenPoolRaw struct { + Contract *MockLBTCTokenPool +} + +type MockLBTCTokenPoolCallerRaw struct { + Contract *MockLBTCTokenPoolCaller +} + +type MockLBTCTokenPoolTransactorRaw struct { + Contract *MockLBTCTokenPoolTransactor +} + +func NewMockLBTCTokenPool(address common.Address, backend bind.ContractBackend) (*MockLBTCTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(MockLBTCTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindMockLBTCTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockLBTCTokenPool{address: address, abi: abi, MockLBTCTokenPoolCaller: MockLBTCTokenPoolCaller{contract: contract}, MockLBTCTokenPoolTransactor: MockLBTCTokenPoolTransactor{contract: contract}, MockLBTCTokenPoolFilterer: MockLBTCTokenPoolFilterer{contract: contract}}, nil +} + +func NewMockLBTCTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*MockLBTCTokenPoolCaller, error) { + contract, err := bindMockLBTCTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolCaller{contract: contract}, nil +} + +func NewMockLBTCTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*MockLBTCTokenPoolTransactor, error) { + contract, err := bindMockLBTCTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolTransactor{contract: contract}, nil +} + +func NewMockLBTCTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*MockLBTCTokenPoolFilterer, error) { + contract, err := bindMockLBTCTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolFilterer{contract: contract}, nil +} + +func bindMockLBTCTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockLBTCTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockLBTCTokenPool.Contract.MockLBTCTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.MockLBTCTokenPoolTransactor.contract.Transfer(opts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.MockLBTCTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockLBTCTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.contract.Transfer(opts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _MockLBTCTokenPool.Contract.GetAllowList(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _MockLBTCTokenPool.Contract.GetAllowList(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _MockLBTCTokenPool.Contract.GetAllowListEnabled(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _MockLBTCTokenPool.Contract.GetAllowListEnabled(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _MockLBTCTokenPool.Contract.GetCurrentInboundRateLimiterState(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _MockLBTCTokenPool.Contract.GetCurrentInboundRateLimiterState(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _MockLBTCTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _MockLBTCTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetRateLimitAdmin(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetRateLimitAdmin(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetRemotePools(opts *bind.CallOpts, remoteChainSelector uint64) ([][]byte, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getRemotePools", remoteChainSelector) + + if err != nil { + return *new([][]byte), err + } + + out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetRemotePools(remoteChainSelector uint64) ([][]byte, error) { + return _MockLBTCTokenPool.Contract.GetRemotePools(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetRemotePools(remoteChainSelector uint64) ([][]byte, error) { + return _MockLBTCTokenPool.Contract.GetRemotePools(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _MockLBTCTokenPool.Contract.GetRemoteToken(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _MockLBTCTokenPool.Contract.GetRemoteToken(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetRmnProxy() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetRmnProxy(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetRmnProxy(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetRouter() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetRouter(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetRouter(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _MockLBTCTokenPool.Contract.GetSupportedChains(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _MockLBTCTokenPool.Contract.GetSupportedChains(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetToken() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetToken(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetToken() (common.Address, error) { + return _MockLBTCTokenPool.Contract.GetToken(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) GetTokenDecimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "getTokenDecimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) GetTokenDecimals() (uint8, error) { + return _MockLBTCTokenPool.Contract.GetTokenDecimals(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) GetTokenDecimals() (uint8, error) { + return _MockLBTCTokenPool.Contract.GetTokenDecimals(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) IDestPoolData(opts *bind.CallOpts) ([]byte, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "i_destPoolData") + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) IDestPoolData() ([]byte, error) { + return _MockLBTCTokenPool.Contract.IDestPoolData(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) IDestPoolData() ([]byte, error) { + return _MockLBTCTokenPool.Contract.IDestPoolData(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) IsRemotePool(opts *bind.CallOpts, remoteChainSelector uint64, remotePoolAddress []byte) (bool, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "isRemotePool", remoteChainSelector, remotePoolAddress) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) IsRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (bool, error) { + return _MockLBTCTokenPool.Contract.IsRemotePool(&_MockLBTCTokenPool.CallOpts, remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) IsRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (bool, error) { + return _MockLBTCTokenPool.Contract.IsRemotePool(&_MockLBTCTokenPool.CallOpts, remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _MockLBTCTokenPool.Contract.IsSupportedChain(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _MockLBTCTokenPool.Contract.IsSupportedChain(&_MockLBTCTokenPool.CallOpts, remoteChainSelector) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _MockLBTCTokenPool.Contract.IsSupportedToken(&_MockLBTCTokenPool.CallOpts, token) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _MockLBTCTokenPool.Contract.IsSupportedToken(&_MockLBTCTokenPool.CallOpts, token) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) Owner() (common.Address, error) { + return _MockLBTCTokenPool.Contract.Owner(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) Owner() (common.Address, error) { + return _MockLBTCTokenPool.Contract.Owner(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _MockLBTCTokenPool.Contract.SupportsInterface(&_MockLBTCTokenPool.CallOpts, interfaceId) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _MockLBTCTokenPool.Contract.SupportsInterface(&_MockLBTCTokenPool.CallOpts, interfaceId) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _MockLBTCTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) TypeAndVersion() (string, error) { + return _MockLBTCTokenPool.Contract.TypeAndVersion(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _MockLBTCTokenPool.Contract.TypeAndVersion(&_MockLBTCTokenPool.CallOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.AcceptOwnership(&_MockLBTCTokenPool.TransactOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.AcceptOwnership(&_MockLBTCTokenPool.TransactOpts) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) AddRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "addRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) AddRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.AddRemotePool(&_MockLBTCTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) AddRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.AddRemotePool(&_MockLBTCTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.ApplyAllowListUpdates(&_MockLBTCTokenPool.TransactOpts, removes, adds) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.ApplyAllowListUpdates(&_MockLBTCTokenPool.TransactOpts, removes, adds) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, remoteChainSelectorsToRemove []uint64, chainsToAdd []TokenPoolChainUpdate) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "applyChainUpdates", remoteChainSelectorsToRemove, chainsToAdd) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) ApplyChainUpdates(remoteChainSelectorsToRemove []uint64, chainsToAdd []TokenPoolChainUpdate) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.ApplyChainUpdates(&_MockLBTCTokenPool.TransactOpts, remoteChainSelectorsToRemove, chainsToAdd) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) ApplyChainUpdates(remoteChainSelectorsToRemove []uint64, chainsToAdd []TokenPoolChainUpdate) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.ApplyChainUpdates(&_MockLBTCTokenPool.TransactOpts, remoteChainSelectorsToRemove, chainsToAdd) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.LockOrBurn(&_MockLBTCTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.LockOrBurn(&_MockLBTCTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.ReleaseOrMint(&_MockLBTCTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.ReleaseOrMint(&_MockLBTCTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) RemoveRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "removeRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) RemoveRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.RemoveRemotePool(&_MockLBTCTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) RemoveRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.RemoveRemotePool(&_MockLBTCTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.SetChainRateLimiterConfig(&_MockLBTCTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.SetChainRateLimiterConfig(&_MockLBTCTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.SetRateLimitAdmin(&_MockLBTCTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.SetRateLimitAdmin(&_MockLBTCTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.SetRouter(&_MockLBTCTokenPool.TransactOpts, newRouter) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.SetRouter(&_MockLBTCTokenPool.TransactOpts, newRouter) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.TransferOwnership(&_MockLBTCTokenPool.TransactOpts, to) +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MockLBTCTokenPool.Contract.TransferOwnership(&_MockLBTCTokenPool.TransactOpts, to) +} + +type MockLBTCTokenPoolAllowListAddIterator struct { + Event *MockLBTCTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolAllowListAdd) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolAllowListAdd) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*MockLBTCTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolAllowListAddIterator{contract: _MockLBTCTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolAllowListAdd) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*MockLBTCTokenPoolAllowListAdd, error) { + event := new(MockLBTCTokenPoolAllowListAdd) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolAllowListRemoveIterator struct { + Event *MockLBTCTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolAllowListRemove) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolAllowListRemove) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*MockLBTCTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolAllowListRemoveIterator{contract: _MockLBTCTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolAllowListRemove) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*MockLBTCTokenPoolAllowListRemove, error) { + event := new(MockLBTCTokenPoolAllowListRemove) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolBurnedIterator struct { + Event *MockLBTCTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolBurned) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolBurned) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*MockLBTCTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolBurnedIterator{contract: _MockLBTCTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolBurned) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseBurned(log types.Log) (*MockLBTCTokenPoolBurned, error) { + event := new(MockLBTCTokenPoolBurned) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolChainAddedIterator struct { + Event *MockLBTCTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolChainAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolChainAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*MockLBTCTokenPoolChainAddedIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolChainAddedIterator{contract: _MockLBTCTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolChainAdded) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseChainAdded(log types.Log) (*MockLBTCTokenPoolChainAdded, error) { + event := new(MockLBTCTokenPoolChainAdded) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolChainConfiguredIterator struct { + Event *MockLBTCTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolChainConfigured) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolChainConfigured) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*MockLBTCTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolChainConfiguredIterator{contract: _MockLBTCTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolChainConfigured) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseChainConfigured(log types.Log) (*MockLBTCTokenPoolChainConfigured, error) { + event := new(MockLBTCTokenPoolChainConfigured) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolChainRemovedIterator struct { + Event *MockLBTCTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolChainRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolChainRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*MockLBTCTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolChainRemovedIterator{contract: _MockLBTCTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolChainRemoved) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseChainRemoved(log types.Log) (*MockLBTCTokenPoolChainRemoved, error) { + event := new(MockLBTCTokenPoolChainRemoved) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolConfigChangedIterator struct { + Event *MockLBTCTokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolConfigChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolConfigChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*MockLBTCTokenPoolConfigChangedIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolConfigChangedIterator{contract: _MockLBTCTokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolConfigChanged) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseConfigChanged(log types.Log) (*MockLBTCTokenPoolConfigChanged, error) { + event := new(MockLBTCTokenPoolConfigChanged) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolLockedIterator struct { + Event *MockLBTCTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolLocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolLocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*MockLBTCTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolLockedIterator{contract: _MockLBTCTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolLocked) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseLocked(log types.Log) (*MockLBTCTokenPoolLocked, error) { + event := new(MockLBTCTokenPoolLocked) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolMintedIterator struct { + Event *MockLBTCTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolMinted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolMinted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*MockLBTCTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolMintedIterator{contract: _MockLBTCTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolMinted) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseMinted(log types.Log) (*MockLBTCTokenPoolMinted, error) { + event := new(MockLBTCTokenPoolMinted) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolOwnershipTransferRequestedIterator struct { + Event *MockLBTCTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolOwnershipTransferRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolOwnershipTransferRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockLBTCTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolOwnershipTransferRequestedIterator{contract: _MockLBTCTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolOwnershipTransferRequested) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*MockLBTCTokenPoolOwnershipTransferRequested, error) { + event := new(MockLBTCTokenPoolOwnershipTransferRequested) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolOwnershipTransferredIterator struct { + Event *MockLBTCTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockLBTCTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolOwnershipTransferredIterator{contract: _MockLBTCTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolOwnershipTransferred) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*MockLBTCTokenPoolOwnershipTransferred, error) { + event := new(MockLBTCTokenPoolOwnershipTransferred) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolRateLimitAdminSetIterator struct { + Event *MockLBTCTokenPoolRateLimitAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolRateLimitAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRateLimitAdminSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRateLimitAdminSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolRateLimitAdminSetIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolRateLimitAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolRateLimitAdminSet struct { + RateLimitAdmin common.Address + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterRateLimitAdminSet(opts *bind.FilterOpts) (*MockLBTCTokenPoolRateLimitAdminSetIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "RateLimitAdminSet") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolRateLimitAdminSetIterator{contract: _MockLBTCTokenPool.contract, event: "RateLimitAdminSet", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchRateLimitAdminSet(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRateLimitAdminSet) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "RateLimitAdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolRateLimitAdminSet) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RateLimitAdminSet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseRateLimitAdminSet(log types.Log) (*MockLBTCTokenPoolRateLimitAdminSet, error) { + event := new(MockLBTCTokenPoolRateLimitAdminSet) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RateLimitAdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolReleasedIterator struct { + Event *MockLBTCTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolReleased) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolReleased) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*MockLBTCTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolReleasedIterator{contract: _MockLBTCTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolReleased) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseReleased(log types.Log) (*MockLBTCTokenPoolReleased, error) { + event := new(MockLBTCTokenPoolReleased) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolRemotePoolAddedIterator struct { + Event *MockLBTCTokenPoolRemotePoolAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolRemotePoolAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRemotePoolAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRemotePoolAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolRemotePoolAddedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolRemotePoolAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolRemotePoolAdded struct { + RemoteChainSelector uint64 + RemotePoolAddress []byte + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterRemotePoolAdded(opts *bind.FilterOpts, remoteChainSelector []uint64) (*MockLBTCTokenPoolRemotePoolAddedIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "RemotePoolAdded", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolRemotePoolAddedIterator{contract: _MockLBTCTokenPool.contract, event: "RemotePoolAdded", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchRemotePoolAdded(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRemotePoolAdded, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "RemotePoolAdded", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolRemotePoolAdded) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RemotePoolAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseRemotePoolAdded(log types.Log) (*MockLBTCTokenPoolRemotePoolAdded, error) { + event := new(MockLBTCTokenPoolRemotePoolAdded) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RemotePoolAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolRemotePoolRemovedIterator struct { + Event *MockLBTCTokenPoolRemotePoolRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolRemotePoolRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRemotePoolRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRemotePoolRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolRemotePoolRemovedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolRemotePoolRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolRemotePoolRemoved struct { + RemoteChainSelector uint64 + RemotePoolAddress []byte + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterRemotePoolRemoved(opts *bind.FilterOpts, remoteChainSelector []uint64) (*MockLBTCTokenPoolRemotePoolRemovedIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "RemotePoolRemoved", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolRemotePoolRemovedIterator{contract: _MockLBTCTokenPool.contract, event: "RemotePoolRemoved", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchRemotePoolRemoved(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRemotePoolRemoved, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "RemotePoolRemoved", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolRemotePoolRemoved) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RemotePoolRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseRemotePoolRemoved(log types.Log) (*MockLBTCTokenPoolRemotePoolRemoved, error) { + event := new(MockLBTCTokenPoolRemotePoolRemoved) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RemotePoolRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockLBTCTokenPoolRouterUpdatedIterator struct { + Event *MockLBTCTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockLBTCTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRouterUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(MockLBTCTokenPoolRouterUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *MockLBTCTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *MockLBTCTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockLBTCTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*MockLBTCTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &MockLBTCTokenPoolRouterUpdatedIterator{contract: _MockLBTCTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _MockLBTCTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockLBTCTokenPoolRouterUpdated) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*MockLBTCTokenPoolRouterUpdated, error) { + event := new(MockLBTCTokenPoolRouterUpdated) + if err := _MockLBTCTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_MockLBTCTokenPool *MockLBTCTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MockLBTCTokenPool.abi.Events["AllowListAdd"].ID: + return _MockLBTCTokenPool.ParseAllowListAdd(log) + case _MockLBTCTokenPool.abi.Events["AllowListRemove"].ID: + return _MockLBTCTokenPool.ParseAllowListRemove(log) + case _MockLBTCTokenPool.abi.Events["Burned"].ID: + return _MockLBTCTokenPool.ParseBurned(log) + case _MockLBTCTokenPool.abi.Events["ChainAdded"].ID: + return _MockLBTCTokenPool.ParseChainAdded(log) + case _MockLBTCTokenPool.abi.Events["ChainConfigured"].ID: + return _MockLBTCTokenPool.ParseChainConfigured(log) + case _MockLBTCTokenPool.abi.Events["ChainRemoved"].ID: + return _MockLBTCTokenPool.ParseChainRemoved(log) + case _MockLBTCTokenPool.abi.Events["ConfigChanged"].ID: + return _MockLBTCTokenPool.ParseConfigChanged(log) + case _MockLBTCTokenPool.abi.Events["Locked"].ID: + return _MockLBTCTokenPool.ParseLocked(log) + case _MockLBTCTokenPool.abi.Events["Minted"].ID: + return _MockLBTCTokenPool.ParseMinted(log) + case _MockLBTCTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _MockLBTCTokenPool.ParseOwnershipTransferRequested(log) + case _MockLBTCTokenPool.abi.Events["OwnershipTransferred"].ID: + return _MockLBTCTokenPool.ParseOwnershipTransferred(log) + case _MockLBTCTokenPool.abi.Events["RateLimitAdminSet"].ID: + return _MockLBTCTokenPool.ParseRateLimitAdminSet(log) + case _MockLBTCTokenPool.abi.Events["Released"].ID: + return _MockLBTCTokenPool.ParseReleased(log) + case _MockLBTCTokenPool.abi.Events["RemotePoolAdded"].ID: + return _MockLBTCTokenPool.ParseRemotePoolAdded(log) + case _MockLBTCTokenPool.abi.Events["RemotePoolRemoved"].ID: + return _MockLBTCTokenPool.ParseRemotePoolRemoved(log) + case _MockLBTCTokenPool.abi.Events["RouterUpdated"].ID: + return _MockLBTCTokenPool.ParseRouterUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MockLBTCTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (MockLBTCTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (MockLBTCTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (MockLBTCTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (MockLBTCTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (MockLBTCTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (MockLBTCTokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (MockLBTCTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (MockLBTCTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (MockLBTCTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (MockLBTCTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (MockLBTCTokenPoolRateLimitAdminSet) Topic() common.Hash { + return common.HexToHash("0x44676b5284b809a22248eba0da87391d79098be38bb03154be88a58bf4d09174") +} + +func (MockLBTCTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (MockLBTCTokenPoolRemotePoolAdded) Topic() common.Hash { + return common.HexToHash("0x7d628c9a1796743d365ab521a8b2a4686e419b3269919dc9145ea2ce853b54ea") +} + +func (MockLBTCTokenPoolRemotePoolRemoved) Topic() common.Hash { + return common.HexToHash("0x52d00ee4d9bd51b40168f2afc5848837288ce258784ad914278791464b3f4d76") +} + +func (MockLBTCTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (_MockLBTCTokenPool *MockLBTCTokenPool) Address() common.Address { + return _MockLBTCTokenPool.address +} + +type MockLBTCTokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePools(opts *bind.CallOpts, remoteChainSelector uint64) ([][]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + GetTokenDecimals(opts *bind.CallOpts) (uint8, error) + + IDestPoolData(opts *bind.CallOpts) ([]byte, error) + + IsRemotePool(opts *bind.CallOpts, remoteChainSelector uint64, remotePoolAddress []byte) (bool, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AddRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, remoteChainSelectorsToRemove []uint64, chainsToAdd []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + RemoveRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*MockLBTCTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*MockLBTCTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*MockLBTCTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*MockLBTCTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*MockLBTCTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*MockLBTCTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*MockLBTCTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*MockLBTCTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*MockLBTCTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*MockLBTCTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*MockLBTCTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*MockLBTCTokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*MockLBTCTokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*MockLBTCTokenPoolConfigChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*MockLBTCTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*MockLBTCTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*MockLBTCTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*MockLBTCTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockLBTCTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*MockLBTCTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockLBTCTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*MockLBTCTokenPoolOwnershipTransferred, error) + + FilterRateLimitAdminSet(opts *bind.FilterOpts) (*MockLBTCTokenPoolRateLimitAdminSetIterator, error) + + WatchRateLimitAdminSet(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRateLimitAdminSet) (event.Subscription, error) + + ParseRateLimitAdminSet(log types.Log) (*MockLBTCTokenPoolRateLimitAdminSet, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*MockLBTCTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*MockLBTCTokenPoolReleased, error) + + FilterRemotePoolAdded(opts *bind.FilterOpts, remoteChainSelector []uint64) (*MockLBTCTokenPoolRemotePoolAddedIterator, error) + + WatchRemotePoolAdded(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRemotePoolAdded, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolAdded(log types.Log) (*MockLBTCTokenPoolRemotePoolAdded, error) + + FilterRemotePoolRemoved(opts *bind.FilterOpts, remoteChainSelector []uint64) (*MockLBTCTokenPoolRemotePoolRemovedIterator, error) + + WatchRemotePoolRemoved(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRemotePoolRemoved, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolRemoved(log types.Log) (*MockLBTCTokenPoolRemotePoolRemoved, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*MockLBTCTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *MockLBTCTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*MockLBTCTokenPoolRouterUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index 13094fefb1a..f6b08cf46a3 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -7,6 +7,7 @@ import ( "fmt" "log" "strconv" + "strings" "time" "gopkg.in/guregu/null.v4" @@ -14,6 +15,7 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink-common/pkg/types/core" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/ethereum/go-ethereum/common" @@ -41,7 +43,6 @@ import ( llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" datastreamsllo "github.com/smartcontractkit/chainlink-data-streams/llo" - "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" coreconfig "github.com/smartcontractkit/chainlink/v2/core/config" @@ -264,12 +265,12 @@ func (d *Delegate) JobType() job.Type { return job.OffchainReporting2 } -func (d *Delegate) BeforeJobCreated(spec job.Job) { +func (d *Delegate) BeforeJobCreated(_ job.Job) { // This is only called first time the job is created d.isNewlyCreatedJob = true } -func (d *Delegate) AfterJobCreated(spec job.Job) {} -func (d *Delegate) BeforeJobDeleted(spec job.Job) {} +func (d *Delegate) AfterJobCreated(_ job.Job) {} +func (d *Delegate) BeforeJobDeleted(_ job.Job) {} func (d *Delegate) OnDeleteJob(ctx context.Context, jb job.Job) error { // If the job spec is malformed in any way, we report the error but return nil so that // the job deletion itself isn't blocked. @@ -1650,7 +1651,85 @@ func (d *Delegate) newServicesCCIPCommit(ctx context.Context, lggr logger.Sugare MetricsRegisterer: prometheus.WrapRegistererWith(map[string]string{"job_name": jb.Name.ValueOrZero()}, prometheus.DefaultRegisterer), } - return ccipcommit.NewCommitServices(ctx, d.ds, srcProvider, dstProvider, d.legacyChains, jb, lggr, d.pipelineRunner, oracleArgsNoPlugin, d.isNewlyCreatedJob, int64(srcChainID), dstChainID, logError) + priceGetter, err := d.ccipCommitPriceGetter(ctx, lggr, pluginJobSpecConfig, jb) + if err != nil { + return nil, fmt.Errorf("failed to create price getter: %w", err) + } + //nolint:gosec // safe to cast + return ccipcommit.NewCommitServices(ctx, d.ds, srcProvider, dstProvider, priceGetter, jb, lggr, d.pipelineRunner, oracleArgsNoPlugin, d.isNewlyCreatedJob, int64(srcChainID), dstChainID, logError) +} + +func (d *Delegate) ccipCommitPriceGetter(ctx context.Context, lggr logger.SugaredLogger, pluginJobSpecConfig ccipconfig.CommitPluginJobSpecConfig, jb job.Job) (priceGetter ccip.AllTokensPriceGetter, err error) { + spec := jb.OCR2OracleSpec + withPipeline := strings.Trim(pluginJobSpecConfig.TokenPricesUSDPipeline, "\n\t ") != "" + if withPipeline { + priceGetter, err = ccip.NewPipelineGetter(pluginJobSpecConfig.TokenPricesUSDPipeline, d.pipelineRunner, jb.ID, jb.ExternalJobID, jb.Name.ValueOrZero(), lggr) + if err != nil { + return nil, fmt.Errorf("creating pipeline price getter: %w", err) + } + } else { + // Use dynamic price getter. + if pluginJobSpecConfig.PriceGetterConfig == nil { + return nil, errors.New("priceGetterConfig is nil") + } + + // Configure contract readers for all chains specified in the aggregator configurations. + // Some lanes (e.g. Wemix/Kroma) requires other clients than source and destination, since they use feeds from other chains. + aggregatorChainsToContracts := make(map[uint64][]common.Address) + for _, aggCfg := range pluginJobSpecConfig.PriceGetterConfig.AggregatorPrices { + if _, ok := aggregatorChainsToContracts[aggCfg.ChainID]; !ok { + aggregatorChainsToContracts[aggCfg.ChainID] = make([]common.Address, 0) + } + + aggregatorChainsToContracts[aggCfg.ChainID] = append(aggregatorChainsToContracts[aggCfg.ChainID], aggCfg.AggregatorContractAddress) + } + + contractReaders := map[uint64]types.ContractReader{} + + for chainID, aggregatorContracts := range aggregatorChainsToContracts { + relayID := types.RelayID{Network: spec.Relay, ChainID: strconv.FormatUint(chainID, 10)} + relay, rerr := d.RelayGetter.Get(relayID) + if rerr != nil { + return nil, fmt.Errorf("get relay by id=%v: %w", relayID, err) + } + + contractsConfig := make(map[string]evmrelaytypes.ChainContractReader, len(aggregatorContracts)) + for i := range aggregatorContracts { + contractsConfig[fmt.Sprintf("%v_%v", ccip.OffchainAggregator, i)] = evmrelaytypes.ChainContractReader{ + ContractABI: ccip.OffChainAggregatorABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + "decimals": { // CR consumers choose an alias + ChainSpecificName: "decimals", + }, + "latestRoundData": { + ChainSpecificName: "latestRoundData", + }, + }, + } + } + contractReaderConfig := evmrelaytypes.ChainReaderConfig{ + Contracts: contractsConfig, + } + + contractReaderConfigJSONBytes, jerr := json.Marshal(contractReaderConfig) + if jerr != nil { + return nil, fmt.Errorf("marshal contract reader config: %w", jerr) + } + + contractReader, cerr := relay.NewContractReader(ctx, contractReaderConfigJSONBytes) + if cerr != nil { + return nil, fmt.Errorf("new ccip commit contract reader %w", cerr) + } + + contractReaders[chainID] = contractReader + } + + priceGetter, err = ccip.NewDynamicPriceGetter(*pluginJobSpecConfig.PriceGetterConfig, contractReaders) + if err != nil { + return nil, fmt.Errorf("creating dynamic price getter: %w", err) + } + } + return priceGetter, nil } func newCCIPCommitPluginBytes(isSourceProvider bool, sourceStartBlock uint64, destStartBlock uint64) config.CommitPluginConfig { @@ -1834,7 +1913,7 @@ func (d *Delegate) ccipExecGetDstProvider(ctx context.Context, jb job.Job, plugi // PROVIDER BASED ARG CONSTRUCTION // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire - dstConfigBytes, err := newExecPluginConfig(false, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, string(jb.ID)).Encode() + dstConfigBytes, err := newExecPluginConfig(false, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, pluginJobSpecConfig.LBTCConfig, string(jb.ID)).Encode() if err != nil { return nil, err } @@ -1867,7 +1946,7 @@ func (d *Delegate) ccipExecGetDstProvider(ctx context.Context, jb job.Job, plugi func (d *Delegate) ccipExecGetSrcProvider(ctx context.Context, jb job.Job, pluginJobSpecConfig ccipconfig.ExecPluginJobSpecConfig, transmitterID string, dstProvider types.CCIPExecProvider) (srcProvider types.CCIPExecProvider, srcChainID uint64, err error) { spec := jb.OCR2OracleSpec - srcConfigBytes, err := newExecPluginConfig(true, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, string(jb.ID)).Encode() + srcConfigBytes, err := newExecPluginConfig(true, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, pluginJobSpecConfig.LBTCConfig, string(jb.ID)).Encode() if err != nil { return nil, 0, err } @@ -1916,12 +1995,13 @@ func (d *Delegate) ccipExecGetSrcProvider(ctx context.Context, jb job.Job, plugi return } -func newExecPluginConfig(isSourceProvider bool, srcStartBlock uint64, dstStartBlock uint64, usdcConfig ccipconfig.USDCConfig, jobID string) config.ExecPluginConfig { +func newExecPluginConfig(isSourceProvider bool, srcStartBlock uint64, dstStartBlock uint64, usdcConfig ccipconfig.USDCConfig, lbtcConfig ccipconfig.LBTCConfig, jobID string) config.ExecPluginConfig { return config.ExecPluginConfig{ IsSourceProvider: isSourceProvider, SourceStartBlock: srcStartBlock, DestStartBlock: dstStartBlock, USDCConfig: usdcConfig, + LBTCConfig: lbtcConfig, JobID: jobID, } } diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/factory.go b/core/services/ocr2/plugins/ccip/ccipcommit/factory.go index c7a18567d26..784da3e7eab 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/factory.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/factory.go @@ -74,8 +74,11 @@ type reportingPluginAndInfo struct { func (rf *CommitReportingPluginFactory) NewReportingPlugin(ctx context.Context, config types.ReportingPluginConfig) (types.ReportingPlugin, types.ReportingPluginInfo, error) { initialRetryDelay := rf.config.newReportingPluginRetryConfig.InitialDelay maxDelay := rf.config.newReportingPluginRetryConfig.MaxDelay + maxRetries := rf.config.newReportingPluginRetryConfig.MaxRetries - pluginAndInfo, err := ccipcommon.RetryUntilSuccess(rf.NewReportingPluginFn(ctx, config), initialRetryDelay, maxDelay) + pluginAndInfo, err := ccipcommon.RetryUntilSuccess( + rf.NewReportingPluginFn(ctx, config), initialRetryDelay, maxDelay, maxRetries, + ) if err != nil { return nil, types.ReportingPluginInfo{}, err } @@ -86,33 +89,33 @@ func (rf *CommitReportingPluginFactory) NewReportingPlugin(ctx context.Context, // retried via RetryUntilSuccess. NewReportingPlugin must return successfully in order for the Commit plugin to // function, hence why we can only keep retrying it until it succeeds. func (rf *CommitReportingPluginFactory) NewReportingPluginFn(ctx context.Context, config types.ReportingPluginConfig) func() (reportingPluginAndInfo, error) { - return func() (reportingPluginAndInfo, error) { + newReportingPluginFn := func() (reportingPluginAndInfo, error) { destPriceReg, err := rf.config.commitStore.ChangeConfig(ctx, config.OnchainConfig, config.OffchainConfig) if err != nil { - return reportingPluginAndInfo{}, err + return reportingPluginAndInfo{}, fmt.Errorf("commitStore.ChangeConfig error: %w", err) } priceRegEvmAddr, err := ccipcalc.GenericAddrToEvm(destPriceReg) if err != nil { - return reportingPluginAndInfo{}, err + return reportingPluginAndInfo{}, fmt.Errorf("GenericAddrToEvm error: %w", err) } if err = rf.UpdateDynamicReaders(ctx, priceRegEvmAddr); err != nil { - return reportingPluginAndInfo{}, err + return reportingPluginAndInfo{}, fmt.Errorf("UpdateDynamicReaders error: %w", err) } pluginOffChainConfig, err := rf.config.commitStore.OffchainConfig(ctx) if err != nil { - return reportingPluginAndInfo{}, err + return reportingPluginAndInfo{}, fmt.Errorf("commitStore.OffchainConfig error: %w", err) } gasPriceEstimator, err := rf.config.commitStore.GasPriceEstimator(ctx) if err != nil { - return reportingPluginAndInfo{}, err + return reportingPluginAndInfo{}, fmt.Errorf("commitStore.GasPriceEstimator error: %w", err) } err = rf.config.priceService.UpdateDynamicConfig(ctx, gasPriceEstimator, rf.destPriceRegReader) if err != nil { - return reportingPluginAndInfo{}, err + return reportingPluginAndInfo{}, fmt.Errorf("priceService.UpdateDynamicConfig error: %w", err) } lggr := rf.config.lggr.Named("CommitReportingPlugin") @@ -145,4 +148,14 @@ func (rf *CommitReportingPluginFactory) NewReportingPluginFn(ctx context.Context return reportingPluginAndInfo{plugin, pluginInfo}, nil } + + return func() (reportingPluginAndInfo, error) { + result, err := newReportingPluginFn() + if err != nil { + rf.config.lggr.Errorw("NewReportingPlugin failed", "err", err) + rf.config.metricsCollector.NewReportingPluginError() + } + + return result, err + } } diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go b/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go index 44c63ec87e6..d3332435b06 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/logger" + ccip2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" @@ -28,6 +29,8 @@ import ( func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { ctx := tests.Context(t) commitConfig := CommitPluginStaticConfig{} + commitConfig.lggr = logger.TestLogger(t) + commitConfig.metricsCollector = ccip2.NoopMetricsCollector // For this unit test, ensure that there is no delay between retries commitConfig.newReportingPluginRetryConfig = ccipdata.RetryConfig{ diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go index 771fdd322f3..3a6148d1b8a 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go @@ -3,14 +3,9 @@ package ccipcommit import ( "context" "encoding/json" - "fmt" "math/big" - "strings" "time" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" - "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" @@ -27,7 +22,6 @@ import ( db "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" - "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" @@ -40,9 +34,29 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{InitialDelay: time.Second, MaxDelay: 5 * time.Minute} +var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{ + InitialDelay: time.Second, + MaxDelay: 10 * time.Minute, + // Retry for approximately 4hrs (MaxDelay of 10m = 6 times per hour, times 4 hours, plus 10 because the first + // 10 retries only take 20 minutes due to an initial retry of 1s and exponential backoff) + MaxRetries: (6 * 4) + 10, +} -func NewCommitServices(ctx context.Context, ds sqlutil.DataSource, srcProvider commontypes.CCIPCommitProvider, dstProvider commontypes.CCIPCommitProvider, chainSet legacyevm.LegacyChainContainer, jb job.Job, lggr logger.Logger, pr pipeline.Runner, argsNoPlugin libocr2.OCR2OracleArgs, new bool, sourceChainID int64, destChainID int64, logError func(string)) ([]job.ServiceCtx, error) { +func NewCommitServices( + ctx context.Context, + ds sqlutil.DataSource, + srcProvider commontypes.CCIPCommitProvider, + dstProvider commontypes.CCIPCommitProvider, + priceGetter ccip.AllTokensPriceGetter, + jb job.Job, + lggr logger.Logger, + pr pipeline.Runner, + argsNoPlugin libocr2.OCR2OracleArgs, + newInstance bool, + sourceChainID int64, + destChainID int64, + logError func(string), +) ([]job.ServiceCtx, error) { spec := jb.OCR2OracleSpec var pluginConfig ccipconfig.CommitPluginJobSpecConfig @@ -69,45 +83,6 @@ func NewCommitServices(ctx context.Context, ds sqlutil.DataSource, srcProvider c commitStoreReader = ccip.NewProviderProxyCommitStoreReader(srcCommitStore, dstCommitStore) commitLggr := lggr.Named("CCIPCommit").With("sourceChain", sourceChainID, "destChain", destChainID) - var priceGetter pricegetter.AllTokensPriceGetter - withPipeline := strings.Trim(pluginConfig.TokenPricesUSDPipeline, "\n\t ") != "" - if withPipeline { - priceGetter, err = pricegetter.NewPipelineGetter(pluginConfig.TokenPricesUSDPipeline, pr, jb.ID, jb.ExternalJobID, jb.Name.ValueOrZero(), lggr) - if err != nil { - return nil, fmt.Errorf("creating pipeline price getter: %w", err) - } - } else { - // Use dynamic price getter. - if pluginConfig.PriceGetterConfig == nil { - return nil, fmt.Errorf("priceGetterConfig is nil") - } - - // Build price getter clients for all chains specified in the aggregator configurations. - // Some lanes (e.g. Wemix/Kroma) requires other clients than source and destination, since they use feeds from other chains. - priceGetterClients := map[uint64]pricegetter.DynamicPriceGetterClient{} - for _, aggCfg := range pluginConfig.PriceGetterConfig.AggregatorPrices { - chainID := aggCfg.ChainID - // Retrieve the chain. - chain, _, err2 := ccipconfig.GetChainByChainID(chainSet, chainID) - if err2 != nil { - return nil, fmt.Errorf("retrieving chain for chainID %d: %w", chainID, err2) - } - caller := rpclib.NewDynamicLimitedBatchCaller( - lggr, - chain.Client(), - rpclib.DefaultRpcBatchSizeLimit, - rpclib.DefaultRpcBatchBackOffMultiplier, - rpclib.DefaultMaxParallelRpcCalls, - ) - priceGetterClients[chainID] = pricegetter.NewDynamicPriceGetterClient(caller) - } - - priceGetter, err = pricegetter.NewDynamicPriceGetter(*pluginConfig.PriceGetterConfig, priceGetterClients) - if err != nil { - return nil, fmt.Errorf("creating dynamic price getter: %w", err) - } - } - offRampReader, err := dstProvider.NewOffRampReader(ctx, pluginConfig.OffRamp) if err != nil { return nil, err @@ -156,7 +131,7 @@ func NewCommitServices(ctx context.Context, ds sqlutil.DataSource, srcProvider c onRampAddress, ) - orm, err := cciporm.NewObservedORM(ds, lggr) + orm, err := cciporm.NewORM(ds, lggr) if err != nil { return nil, err } @@ -193,7 +168,7 @@ func NewCommitServices(ctx context.Context, ds sqlutil.DataSource, srcProvider c return nil, err } // If this is a brand-new job, then we make use of the start blocks. If not then we're rebooting and log poller will pick up where we left off. - if new { + if newInstance { return []job.ServiceCtx{ oraclelib.NewChainAgnosticBackFilledOracle( lggr, diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go index 55caf88f1c7..97b982b0e2e 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go @@ -461,24 +461,42 @@ func (r *CommitReportingPlugin) selectPriceUpdates(ctx context.Context, now time // The returned latestGasPrice and latestTokenPrices should not contain nil values. func (r *CommitReportingPlugin) calculatePriceUpdates(ctx context.Context, gasPriceObs map[uint64][]*big.Int, tokenPriceObs map[cciptypes.Address][]*big.Int, latestGasPrice map[uint64]update, latestTokenPrices map[cciptypes.Address]update) ([]cciptypes.GasPrice, []cciptypes.TokenPrice, error) { var tokenPriceUpdates []cciptypes.TokenPrice + // Token prices are mostly heartbeat driven. To maximize heartbeat batching, the price inclusion rule is as follows: + // If any token requires heartbeat update, include all token prices in the report. + // Otherwise, only include token prices that exceed deviation threshold. + needTokenHeartbeat := false + for token := range tokenPriceObs { + latestTokenPrice, exists := latestTokenPrices[token] + if !exists || time.Since(latestTokenPrice.timestamp) >= r.offchainConfig.TokenPriceHeartBeat { + r.lggr.Infow("Token requires heartbeat update", "token", token) + needTokenHeartbeat = true + break + } + } + for token, tokenPriceObservations := range tokenPriceObs { medianPrice := ccipcalc.BigIntSortedMiddle(tokenPriceObservations) + if needTokenHeartbeat { + r.lggr.Debugw("Token price update included due to heartbeat", "token", token, "newPrice", medianPrice) + tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ + Token: token, + Value: medianPrice, + }) + continue + } + latestTokenPrice, exists := latestTokenPrices[token] if exists { - tokenPriceUpdatedRecently := time.Since(latestTokenPrice.timestamp) < r.offchainConfig.TokenPriceHeartBeat - tokenPriceNotChanged := !ccipcalc.Deviates(medianPrice, latestTokenPrice.value, int64(r.offchainConfig.TokenPriceDeviationPPB)) - if tokenPriceUpdatedRecently && tokenPriceNotChanged { - r.lggr.Debugw("token price was updated recently, skipping the update", + if ccipcalc.Deviates(medianPrice, latestTokenPrice.value, int64(r.offchainConfig.TokenPriceDeviationPPB)) { + r.lggr.Debugw("Token price update included due to deviation", "token", token, "newPrice", medianPrice, "existingPrice", latestTokenPrice.value) - continue // skip the update if we recently had a price update close to the new value + tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ + Token: token, + Value: medianPrice, + }) } } - - tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ - Token: token, - Value: medianPrice, - }) } // Determinism required. @@ -487,31 +505,49 @@ func (r *CommitReportingPlugin) calculatePriceUpdates(ctx context.Context, gasPr }) var gasPriceUpdate []cciptypes.GasPrice + // Gas prices are mostly heartbeat driven. To maximize heartbeat batching, the price inclusion rule is as follows: + // If any source chain gas price requires heartbeat update, include all gas prices in the report. + // Otherwise, only include gas prices that exceed deviation threshold. + needGasHeartbeat := false + for chainSelector := range gasPriceObs { + latestGasPrice, exists := latestGasPrice[chainSelector] + if !exists || latestGasPrice.value == nil || time.Since(latestGasPrice.timestamp) >= r.offchainConfig.GasPriceHeartBeat { + r.lggr.Infow("Chain gas price requires heartbeat update", "chainSelector", chainSelector) + needGasHeartbeat = true + break + } + } + for chainSelector, gasPriceObservations := range gasPriceObs { newGasPrice, err := r.gasPriceEstimator.Median(ctx, gasPriceObservations) // Compute the median price if err != nil { return nil, nil, fmt.Errorf("failed to calculate median gas price for chain selector %d: %w", chainSelector, err) } - // Default to updating so that we update if there are no prior updates. + if needGasHeartbeat { + r.lggr.Debugw("Gas price update included due to heartbeat", "chainSelector", chainSelector) + gasPriceUpdate = append(gasPriceUpdate, cciptypes.GasPrice{ + DestChainSelector: chainSelector, + Value: newGasPrice, + }) + continue + } + latestGasPrice, exists := latestGasPrice[chainSelector] if exists && latestGasPrice.value != nil { - gasPriceUpdatedRecently := time.Since(latestGasPrice.timestamp) < r.offchainConfig.GasPriceHeartBeat gasPriceDeviated, err := r.gasPriceEstimator.Deviates(ctx, newGasPrice, latestGasPrice.value) if err != nil { return nil, nil, err } - if gasPriceUpdatedRecently && !gasPriceDeviated { - r.lggr.Debugw("gas price was updated recently and not deviated sufficiently, skipping the update", + if gasPriceDeviated { + r.lggr.Debugw("Gas price update included due to deviation", "chainSelector", chainSelector, "newPrice", newGasPrice, "existingPrice", latestGasPrice.value) - continue + gasPriceUpdate = append(gasPriceUpdate, cciptypes.GasPrice{ + DestChainSelector: chainSelector, + Value: newGasPrice, + }) } } - - gasPriceUpdate = append(gasPriceUpdate, cciptypes.GasPrice{ - DestChainSelector: chainSelector, - Value: newGasPrice, - }) } sort.Slice(gasPriceUpdate, func(i, j int) bool { diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go index 93d8de9f892..ecc0c56b982 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go @@ -20,15 +20,13 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/hashutil" "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" mocks2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" @@ -44,7 +42,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" - ccipdbmocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" ) @@ -409,7 +406,9 @@ func TestCommitReportingPlugin_Report(t *testing.T) { evmEstimator := mocks.NewEvmFeeEstimator(t) evmEstimator.On("L1Oracle").Return(nil) - gasPriceEstimator := prices.NewDAGasPriceEstimator(evmEstimator, nil, 2e9, 2e9) // 200% deviation + + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + gasPriceEstimator := prices.NewDAGasPriceEstimator(evmEstimator, nil, 2e9, 2e9, feeEstimatorConfig) // 200% deviation var destTokens []cciptypes.Address for tk := range tc.tokenDecimals { @@ -433,7 +432,7 @@ func TestCommitReportingPlugin_Report(t *testing.T) { })).Return(destDecimals, nil).Maybe() lp := mocks2.NewLogPoller(t) - commitStoreReader, err := v1_2_0.NewCommitStore(logger.TestLogger(t), utils.RandomAddress(), nil, lp) + commitStoreReader, err := v1_2_0.NewCommitStore(logger.TestLogger(t), utils.RandomAddress(), nil, lp, feeEstimatorConfig) assert.NoError(t, err) healthCheck := ccipcachemocks.NewChainHealthcheck(t) @@ -1131,7 +1130,7 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: val1e18(20)}}, }, { - name: "multichain gas prices", + name: "multi-chain gas price updates due to heartbeat", commitObservations: []ccip.CommitObservation{ {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(1)}}, {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(11)}}, @@ -1161,9 +1160,47 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { f: 1, expGasUpdates: []cciptypes.GasPrice{ {DestChainSelector: defaultSourceChainSelector, Value: val1e18(2)}, + {DestChainSelector: defaultSourceChainSelector + 1, Value: val1e18(22)}, {DestChainSelector: defaultSourceChainSelector + 2, Value: val1e18(222)}, }, }, + { + name: "multi-chain gas prices but only one updates due to deviation", + commitObservations: []ccip.CommitObservation{ + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(1)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(11)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 2: val1e18(111)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(2)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(22)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 2: val1e18(222)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(3)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(33)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 2: val1e18(333)}}, + }, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(9), // median deviates + }, + defaultSourceChainSelector + 1: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(20), // median does not deviate + }, + defaultSourceChainSelector + 2: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(220), // median does not deviate + }, + }, + f: 1, + expGasUpdates: []cciptypes.GasPrice{ + {DestChainSelector: defaultSourceChainSelector, Value: val1e18(2)}, + }, + }, { name: "median one token", commitObservations: []ccip.CommitObservation{ @@ -1204,14 +1241,14 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, }, { - name: "token price update skipped because it is close to the latest", + name: "token price update skipped because it does not deviate and are recent", commitObservations: []ccip.CommitObservation{ { - TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(11)}, + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(11), feeToken2: val1e18(11)}, SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, }, { - TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(12)}, + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(12), feeToken2: val1e18(12)}, SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, }, }, @@ -1226,10 +1263,81 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { timestamp: time.Now().Add(-30 * time.Minute), value: val1e18(10), }, + feeToken2: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(10), + }, }, // We expect a gas update because no latest expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, }, + { + name: "multiple token price update due to staleness", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(11), feeToken2: val1e18(11)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(12), feeToken2: val1e18(12)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-90 * time.Minute), + value: val1e18(10), + }, + feeToken2: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(10), + }, + }, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken1, Value: val1e18(12)}, + {Token: feeToken2, Value: val1e18(12)}, + }, + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, + }, + { + name: "multiple token exist but only one updates due to deviation", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(11), feeToken2: val1e18(13)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(12), feeToken2: val1e18(14)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(10), + }, + feeToken2: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(10), + }, + }, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken2, Value: val1e18(14)}, + }, + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, + }, { name: "gas price and token price both included because they are not close to the latest", commitObservations: []ccip.CommitObservation{ @@ -1330,12 +1438,18 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { name: "gas price included because it deviates from latest and token price skipped because it does not deviate", commitObservations: []ccip.CommitObservation{ { - TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, - SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(10)}, + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + defaultSourceChainSelector: val1e18(10), + defaultSourceChainSelector + 1: val1e18(20), + }, }, { - TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, - SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(11)}, + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + defaultSourceChainSelector: val1e18(11), + defaultSourceChainSelector + 1: val1e18(21), + }, }, }, f: 1, @@ -1346,8 +1460,12 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { tokenPriceDeviationPPB: 200e7, latestGasPrice: map[uint64]update{ defaultSourceChainSelector: { - timestamp: time.Now().Add(-90 * time.Minute), - value: val1e18(9), + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(8), + }, + defaultSourceChainSelector + 1: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(21), }, }, latestTokenPrices: map[cciptypes.Address]update{ @@ -1362,11 +1480,11 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { name: "gas price skipped because it does not deviate and token price included because it has not been updated recently", commitObservations: []ccip.CommitObservation{ { - TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(10), feeToken2: val1e18(20)}, SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(10)}, }, { - TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(11), feeToken2: val1e18(21)}, SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(11)}, }, }, @@ -1385,11 +1503,16 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { latestTokenPrices: map[cciptypes.Address]update{ feeToken1: { timestamp: time.Now().Add(-4 * time.Hour), + value: val1e18(11), + }, + feeToken2: { + timestamp: time.Now().Add(-1 * time.Hour), value: val1e18(21), }, }, expTokenUpdates: []cciptypes.TokenPrice{ - {Token: feeToken1, Value: val1e18(21)}, + {Token: feeToken1, Value: val1e18(11)}, + {Token: feeToken2, Value: val1e18(21)}, }, expGasUpdates: nil, }, @@ -1408,6 +1531,7 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { nil, tc.daGasPriceDeviationPPB, tc.execGasPriceDeviationPPB, + ccipdatamocks.NewFeeEstimatorConfigReader(t), ) r := &CommitReportingPlugin{ diff --git a/core/services/ocr2/plugins/ccip/ccipexec/batching.go b/core/services/ocr2/plugins/ccip/ccipexec/batching.go index 866a20c4cde..f1beb035d32 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/batching.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/batching.go @@ -24,6 +24,12 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" ) +// Batching strategies +const ( + BestEffortBatchingStrategyID = uint32(0) + ZKOverflowBatchingStrategyID = uint32(1) +) + type BatchContext struct { report commitReportWithSendRequests inflight []InflightInternalExecutionReport @@ -47,6 +53,7 @@ type BatchContext struct { type BatchingStrategy interface { BuildBatch(ctx context.Context, batchCtx *BatchContext) ([]ccip.ObservedMessage, []messageExecStatus) + GetBatchingStrategyID() uint32 } type BestEffortBatchingStrategy struct{} @@ -58,9 +65,9 @@ type ZKOverflowBatchingStrategy struct { func NewBatchingStrategy(batchingStrategyID uint32, statusChecker statuschecker.CCIPTransactionStatusChecker) (BatchingStrategy, error) { var batchingStrategy BatchingStrategy switch batchingStrategyID { - case 0: + case BestEffortBatchingStrategyID: batchingStrategy = &BestEffortBatchingStrategy{} - case 1: + case ZKOverflowBatchingStrategyID: batchingStrategy = &ZKOverflowBatchingStrategy{ statuschecker: statusChecker, } @@ -70,6 +77,10 @@ func NewBatchingStrategy(batchingStrategyID uint32, statusChecker statuschecker. return batchingStrategy, nil } +func (s *BestEffortBatchingStrategy) GetBatchingStrategyID() uint32 { + return BestEffortBatchingStrategyID +} + // BestEffortBatchingStrategy is a batching strategy that tries to batch as many messages as possible (up to certain limits). func (s *BestEffortBatchingStrategy) BuildBatch( ctx context.Context, @@ -95,6 +106,10 @@ func (s *BestEffortBatchingStrategy) BuildBatch( return batchBuilder.batch, batchBuilder.statuses } +func (bs *ZKOverflowBatchingStrategy) GetBatchingStrategyID() uint32 { + return ZKOverflowBatchingStrategyID +} + // ZKOverflowBatchingStrategy is a batching strategy for ZK chains overflowing under certain conditions. // It is a simple batching strategy that only allows one message to be added to the batch. // TXM is used to perform the ZK check: if the message failed the check, it will be skipped. diff --git a/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go b/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go index 0fd23496974..e57bc3aa86e 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go @@ -850,13 +850,13 @@ func runBatchingStrategyTests(t *testing.T, strategy BatchingStrategy, available seqNrs, execStates := strategy.BuildBatch(context.Background(), batchContext) - runAssertions(t, tc, seqNrs, execStates) + runAssertions(t, tc, seqNrs, execStates, strategy) }) } } // Utility function to run common assertions -func runAssertions(t *testing.T, tc testCase, seqNrs []ccip.ObservedMessage, execStates []messageExecStatus) { +func runAssertions(t *testing.T, tc testCase, seqNrs []ccip.ObservedMessage, execStates []messageExecStatus, strategy BatchingStrategy) { if tc.expectedSeqNrs == nil { assert.Len(t, seqNrs, 0) } else { @@ -868,6 +868,13 @@ func runAssertions(t *testing.T, tc testCase, seqNrs []ccip.ObservedMessage, exe } else { assert.Equal(t, tc.expectedStates, execStates) } + + batchingStratID := strategy.GetBatchingStrategyID() + if strategyType := reflect.TypeOf(strategy); strategyType == reflect.TypeOf(&BestEffortBatchingStrategy{}) { + assert.Equal(t, uint32(0), batchingStratID) + } else { + assert.Equal(t, uint32(1), batchingStratID) + } } func createTestMessage(seqNr uint64, sender cciptypes.Address, nonce uint64, feeToken cciptypes.Address, feeAmount *big.Int, executed bool, data []byte) cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta { diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory.go b/core/services/ocr2/plugins/ccip/ccipexec/factory.go index 646121bdba8..20fe65b81a9 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/factory.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory.go @@ -71,8 +71,11 @@ type reportingPluginAndInfo struct { func (rf *ExecutionReportingPluginFactory) NewReportingPlugin(ctx context.Context, config types.ReportingPluginConfig) (types.ReportingPlugin, types.ReportingPluginInfo, error) { initialRetryDelay := rf.config.newReportingPluginRetryConfig.InitialDelay maxDelay := rf.config.newReportingPluginRetryConfig.MaxDelay + maxRetries := rf.config.newReportingPluginRetryConfig.MaxRetries - pluginAndInfo, err := ccipcommon.RetryUntilSuccess(rf.NewReportingPluginFn(ctx, config), initialRetryDelay, maxDelay) + pluginAndInfo, err := ccipcommon.RetryUntilSuccess( + rf.NewReportingPluginFn(ctx, config), initialRetryDelay, maxDelay, maxRetries, + ) if err != nil { return nil, types.ReportingPluginInfo{}, err } @@ -83,7 +86,7 @@ func (rf *ExecutionReportingPluginFactory) NewReportingPlugin(ctx context.Contex // retried via RetryUntilSuccess. NewReportingPlugin must return successfully in order for the Exec plugin to function, // hence why we can only keep retrying it until it succeeds. func (rf *ExecutionReportingPluginFactory) NewReportingPluginFn(ctx context.Context, config types.ReportingPluginConfig) func() (reportingPluginAndInfo, error) { - return func() (reportingPluginAndInfo, error) { + newReportingPluginFn := func() (reportingPluginAndInfo, error) { destPriceRegistry, destWrappedNative, err := rf.config.offRampReader.ChangeConfig(ctx, config.OnchainConfig, config.OffchainConfig) if err != nil { return reportingPluginAndInfo{}, err @@ -159,4 +162,14 @@ func (rf *ExecutionReportingPluginFactory) NewReportingPluginFn(ctx context.Cont return reportingPluginAndInfo{plugin, pluginInfo}, nil } + + return func() (reportingPluginAndInfo, error) { + result, err := newReportingPluginFn() + if err != nil { + rf.config.lggr.Errorw("NewReportingPlugin failed", "err", err) + rf.config.metricsCollector.NewReportingPluginError() + } + + return result, err + } } diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go index fe5e0ab1e23..a5df4c356ce 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/logger" + ccip2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" @@ -25,6 +26,8 @@ import ( func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { ctx := tests.Context(t) execConfig := ExecutionPluginStaticConfig{} + execConfig.lggr = logger.TestLogger(t) + execConfig.metricsCollector = ccip2.NoopMetricsCollector // For this unit test, ensure that there is no delay between retries execConfig.newReportingPluginRetryConfig = ccipdata.RetryConfig{ diff --git a/core/services/ocr2/plugins/ccip/ccipexec/initializers.go b/core/services/ocr2/plugins/ccip/ccipexec/initializers.go index 7826f6058fe..3ad9c94dc74 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/initializers.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/initializers.go @@ -18,8 +18,6 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" @@ -27,6 +25,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/observability" @@ -43,10 +43,18 @@ var ( // 5s for token data worker timeout is a reasonable default. tokenDataWorkerTimeout = 5 * time.Second // tokenDataWorkerNumWorkers is the number of workers that will be processing token data in parallel. - tokenDataWorkerNumWorkers = 5 + tokenDataWorkerNumWorkers = 10 + // expirationDur is the duration for which the token data will be cached. + expirationDurTokenData = 10 * time.Minute ) -var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{InitialDelay: time.Second, MaxDelay: 5 * time.Minute} +var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{ + InitialDelay: time.Second, + MaxDelay: 10 * time.Minute, + // Retry for approximately 4hrs (MaxDelay of 10m = 6 times per hour, times 4 hours, plus 10 because the first + // 10 retries only take 20 minutes due to an initial retry of 1s and exponential backoff) + MaxRetries: (6 * 4) + 10, +} func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcProvider types.CCIPExecProvider, dstProvider types.CCIPExecProvider, srcChainID int64, dstChainID int64, new bool, argsNoPlugin libocr2.OCR2OracleArgs, logError func(string)) ([]job.ServiceCtx, error) { if jb.OCR2OracleSpec == nil { @@ -115,6 +123,20 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcPro } tokenDataProviders[cciptypes.Address(pluginConfig.USDCConfig.SourceTokenAddress.String())] = usdcReader } + // init lbtc token data provider + if pluginConfig.LBTCConfig.AttestationAPI != "" { + lggr.Infof("LBTC token data provider enabled") + err2 := pluginConfig.LBTCConfig.ValidateLBTCConfig() + if err2 != nil { + return nil, err2 + } + + lbtcReader, err2 := srcProvider.NewTokenDataReader(ctx, ccip.EvmAddrToGeneric(pluginConfig.LBTCConfig.SourceTokenAddress)) + if err2 != nil { + return nil, fmt.Errorf("new lbtc reader: %w", err2) + } + tokenDataProviders[cciptypes.Address(pluginConfig.LBTCConfig.SourceTokenAddress.String())] = lbtcReader + } // Prom wrappers onRampReader = observability.NewObservedOnRampReader(onRampReader, srcChainID, ccip.ExecPluginLabel) @@ -149,7 +171,7 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcPro tokenDataProviders, tokenDataWorkerNumWorkers, tokenDataWorkerTimeout, - 2*tokenDataWorkerTimeout, + expirationDurTokenData, ) wrappedPluginFactory := NewExecutionReportingPluginFactory(ExecutionPluginStaticConfig{ diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go index 4a09cf37b45..2c70cac4978 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go @@ -468,6 +468,19 @@ func (r *ExecutionReportingPlugin) buildReport(ctx context.Context, lggr logger. return encodedReport, nil } +// Returns required number of observations to reach consensus +func (r *ExecutionReportingPlugin) getConsensusThreshold() int { + // Default consensus threshold is F+1 + consensusThreshold := r.F + 1 + if r.batchingStrategy.GetBatchingStrategyID() == ZKOverflowBatchingStrategyID { + // For batching strategy 1, consensus threshold is 2F+1 + // This is because chains that can overflow need to reach consensus during the inflight cache period + // to avoid 2 transmissions round of an overflown message. + consensusThreshold = 2*r.F + 1 + } + return consensusThreshold +} + func (r *ExecutionReportingPlugin) Report(ctx context.Context, timestamp types.ReportTimestamp, query types.Query, observations []types.AttributedObservation) (bool, types.Report, error) { lggr := r.lggr.Named("ExecutionReport") if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { @@ -475,14 +488,16 @@ func (r *ExecutionReportingPlugin) Report(ctx context.Context, timestamp types.R } else if !healthy { return false, nil, ccip.ErrChainIsNotHealthy } + consensusThreshold := r.getConsensusThreshold() + lggr.Infof("Consensus threshold set to: %d", consensusThreshold) + parsableObservations := ccip.GetParsableObservations[ccip.ExecutionObservation](lggr, observations) - // Need at least F+1 observations - if len(parsableObservations) <= r.F { - lggr.Warn("Non-empty observations <= F, need at least F+1 to continue") + if len(parsableObservations) < consensusThreshold { + lggr.Warnf("Insufficient observations: only %d received, but need more than %d to proceed", len(parsableObservations), consensusThreshold) return false, nil, nil } - observedMessages, err := calculateObservedMessagesConsensus(parsableObservations, r.F) + observedMessages, err := calculateObservedMessagesConsensus(parsableObservations, consensusThreshold) if err != nil { return false, nil, err } diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go index ff6371fa2ce..73a1f431399 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go @@ -16,17 +16,18 @@ import ( mapset "github.com/deckarep/golang-set/v2" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/libocr/commontypes" - "github.com/smartcontractkit/libocr/offchainreporting2/types" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2/types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" lpMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" @@ -40,8 +41,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" - - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" ) func TestExecutionReportingPlugin_Observation(t *testing.T) { @@ -232,19 +232,21 @@ func TestExecutionReportingPlugin_Observation(t *testing.T) { func TestExecutionReportingPlugin_Report(t *testing.T) { testCases := []struct { - name string - f int - committedSeqNum uint64 - observations []ccip.ExecutionObservation + name string + f int + batchingStrategyID uint32 + committedSeqNum uint64 + observations []ccip.ExecutionObservation expectingSomeReport bool expectedReport cciptypes.ExecReport expectingSomeErr bool }{ { - name: "not enough observations to form consensus", - f: 5, - committedSeqNum: 5, + name: "not enough observations to form consensus - best effort batching", + f: 5, + batchingStrategyID: 0, + committedSeqNum: 5, observations: []ccip.ExecutionObservation{ {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, @@ -252,6 +254,21 @@ func TestExecutionReportingPlugin_Report(t *testing.T) { expectingSomeErr: false, expectingSomeReport: false, }, + { + name: "not enough observaitons to form consensus - zk batching", + f: 5, + batchingStrategyID: 1, + committedSeqNum: 5, + observations: []ccip.ExecutionObservation{ + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + }, + }, { name: "zero observations", f: 0, @@ -268,6 +285,9 @@ func TestExecutionReportingPlugin_Report(t *testing.T) { p := ExecutionReportingPlugin{} p.lggr = logger.TestLogger(t) p.F = tc.f + bs, err := NewBatchingStrategy(tc.batchingStrategyID, &statuschecker.TxmStatusChecker{}) + require.NoError(t, err) + p.batchingStrategy = bs p.commitStoreReader = ccipdatamocks.NewCommitStoreReader(t) chainHealthcheck := ccipcachemocks.NewChainHealthcheck(t) @@ -281,12 +301,12 @@ func TestExecutionReportingPlugin_Report(t *testing.T) { observations[i] = types.AttributedObservation{Observation: b, Observer: commontypes.OracleID(i + 1)} } - _, _, err := p.Report(ctx, types.ReportTimestamp{}, types.Query{}, observations) + _, _, err2 := p.Report(ctx, types.ReportTimestamp{}, types.Query{}, observations) if tc.expectingSomeErr { - assert.Error(t, err) + assert.Error(t, err2) return } - assert.NoError(t, err) + assert.NoError(t, err2) }) } } @@ -427,8 +447,10 @@ func TestExecutionReportingPlugin_buildReport(t *testing.T) { p.metricsCollector = ccip.NoopMetricsCollector p.commitStoreReader = commitStore + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + lp := lpMocks.NewLogPoller(t) - offRampReader, err := v1_2_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, lp, nil, nil) + offRampReader, err := v1_2_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, lp, nil, nil, feeEstimatorConfig) assert.NoError(t, err) p.offRampReader = offRampReader @@ -1375,7 +1397,9 @@ func Test_prepareTokenExecData(t *testing.T) { } func encodeExecutionReport(t *testing.T, report cciptypes.ExecReport) []byte { - reader, err := v1_2_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, nil, nil, nil) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + reader, err := v1_2_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, nil, nil, nil, feeEstimatorConfig) require.NoError(t, err) ctx := testutils.Context(t) encodedReport, err := reader.EncodeExecutionReport(ctx, report) @@ -1418,3 +1442,36 @@ func TestExecutionReportingPlugin_ensurePriceRegistrySynchronization(t *testing. require.NoError(t, err) require.Equal(t, mockPriceRegistryReader2, p.sourcePriceRegistry) } + +func TestExecutionReportingPlugin_getConsensusThreshold(t *testing.T) { + tests := []struct { + name string + batchingStrategyID uint32 + F int + expectedConsensusThreshold int + }{ + { + name: "zk batching strategy", + batchingStrategyID: uint32(1), + F: 5, + expectedConsensusThreshold: 11, + }, + { + name: "default batching strategy", + batchingStrategyID: uint32(0), + F: 5, + expectedConsensusThreshold: 6, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + p := &ExecutionReportingPlugin{} + p.F = tc.F + bs, err := NewBatchingStrategy(tc.batchingStrategyID, &statuschecker.TxmStatusChecker{}) + require.NoError(t, err) + p.batchingStrategy = bs + require.Equal(t, tc.expectedConsensusThreshold, p.getConsensusThreshold()) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/config/config.go b/core/services/ocr2/plugins/ccip/config/config.go index a24a6edfd13..fbf8d590cfe 100644 --- a/core/services/ocr2/plugins/ccip/config/config.go +++ b/core/services/ocr2/plugins/ccip/config/config.go @@ -108,6 +108,7 @@ func (c *DynamicPriceGetterConfig) Validate() error { type ExecPluginJobSpecConfig struct { SourceStartBlock, DestStartBlock uint64 // Only for first time job add. USDCConfig USDCConfig + LBTCConfig LBTCConfig } type USDCConfig struct { @@ -119,10 +120,19 @@ type USDCConfig struct { AttestationAPIIntervalMilliseconds int } +type LBTCConfig struct { + SourceTokenAddress common.Address + AttestationAPI string + AttestationAPITimeoutSeconds uint + // AttestationAPIIntervalMilliseconds can be set to -1 to disable or 0 to use a default interval. + AttestationAPIIntervalMilliseconds int +} + type ExecPluginConfig struct { SourceStartBlock, DestStartBlock uint64 // Only for first time job add. IsSourceProvider bool USDCConfig USDCConfig + LBTCConfig LBTCConfig JobID string } @@ -136,17 +146,30 @@ func (e ExecPluginConfig) Encode() ([]byte, error) { func (uc *USDCConfig) ValidateUSDCConfig() error { if uc.AttestationAPI == "" { - return errors.New("AttestationAPI is required") + return errors.New("USDCConfig: AttestationAPI is required") } if uc.AttestationAPIIntervalMilliseconds < -1 { - return errors.New("AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval") + return errors.New("USDCConfig: AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval") } if uc.SourceTokenAddress == utils.ZeroAddress { - return errors.New("SourceTokenAddress is required") + return errors.New("USDCConfig: SourceTokenAddress is required") } if uc.SourceMessageTransmitterAddress == utils.ZeroAddress { - return errors.New("SourceMessageTransmitterAddress is required") + return errors.New("USDCConfig: SourceMessageTransmitterAddress is required") } return nil } + +func (lc *LBTCConfig) ValidateLBTCConfig() error { + if lc.AttestationAPI == "" { + return errors.New("LBTCConfig: AttestationAPI is required") + } + if lc.AttestationAPIIntervalMilliseconds < -1 { + return errors.New("LBTCConfig: AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval") + } + if lc.SourceTokenAddress == utils.ZeroAddress { + return errors.New("LBTCConfig: SourceTokenAddress is required") + } + return nil +} diff --git a/core/services/ocr2/plugins/ccip/config/type_and_version.go b/core/services/ocr2/plugins/ccip/config/type_and_version.go index 9d5e1629c11..ecfe8d0c5a7 100644 --- a/core/services/ocr2/plugins/ccip/config/type_and_version.go +++ b/core/services/ocr2/plugins/ccip/config/type_and_version.go @@ -19,6 +19,7 @@ var ( EVM2EVMOffRamp ContractType = "EVM2EVMOffRamp" CommitStore ContractType = "CommitStore" PriceRegistry ContractType = "PriceRegistry" + Unknown ContractType = "Unknown" // 1.0.0 Contracts which have no TypeAndVersion ContractTypes = mapset.NewSet[ContractType]( EVM2EVMOffRamp, EVM2EVMOnRamp, @@ -63,7 +64,13 @@ func TypeAndVersion(addr common.Address, client bind.ContractBackend) (ContractT return ContractType(contractType), *v, nil } +// default version to use when TypeAndVersion is missing. +const defaultVersion = "1.0.0" + func ParseTypeAndVersion(tvStr string) (string, string, error) { + if tvStr == "" { + tvStr = string(Unknown) + " " + defaultVersion + } typeAndVersionValues := strings.Split(tvStr, " ") if len(typeAndVersionValues) < 2 { diff --git a/core/services/ocr2/plugins/ccip/config/type_and_version_test.go b/core/services/ocr2/plugins/ccip/config/type_and_version_test.go new file mode 100644 index 00000000000..807bb59f3be --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/type_and_version_test.go @@ -0,0 +1,50 @@ +package config + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestParseTypeAndVersion(t *testing.T) { + tests := []struct { + name string + input string + expectedType string + expectedVersion string + expectedError string + }{ + { + name: "Valid input", + input: string(EVM2EVMOnRamp) + " 1.2.0", + expectedType: string(EVM2EVMOnRamp), + expectedVersion: "1.2.0", + }, + { + name: "Empty input", + input: "", + expectedType: string(Unknown), + expectedVersion: defaultVersion, + }, + { + name: "Invalid input", + input: "InvalidInput", + expectedError: "invalid type and version InvalidInput", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + actualType, actualVersion, err := ParseTypeAndVersion(tc.input) + + if tc.expectedError != "" { + require.EqualError(t, err, tc.expectedError) + } else { + require.NoError(t, err) + assert.Equal(t, tc.expectedType, actualType) + assert.Equal(t, tc.expectedVersion, actualVersion) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/config.go b/core/services/ocr2/plugins/ccip/estimatorconfig/config.go new file mode 100644 index 00000000000..4737bd33e89 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/config.go @@ -0,0 +1,83 @@ +package estimatorconfig + +import ( + "context" + "math/big" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +// FeeEstimatorConfigProvider implements abstract storage for the DataAvailability settings in onRamp dynamic Config. +// It's implemented to transfer DA config from different entities offRamp, onRamp, commitStore without injecting the +// strong dependency between modules. ConfigProvider fetch ccip.OnRampReader object reads and returns only relevant +// fields for the daGasEstimator from the encapsulated onRampReader. +type FeeEstimatorConfigProvider interface { + SetOnRampReader(reader ccip.OnRampReader) + AddGasPriceInterceptor(GasPriceInterceptor) + ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (modExecGasPrice, modDAGasPrice *big.Int, err error) + GetDataAvailabilityConfig(ctx context.Context) (destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps int64, err error) +} + +type GasPriceInterceptor interface { + ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (modExecGasPrice, modDAGasPrice *big.Int, err error) +} + +type FeeEstimatorConfigService struct { + onRampReader ccip.OnRampReader + gasPriceInterceptors []GasPriceInterceptor +} + +func NewFeeEstimatorConfigService() *FeeEstimatorConfigService { + return &FeeEstimatorConfigService{} +} + +// SetOnRampReader Sets the onRamp reader instance. +// must be called once for each instance. +func (c *FeeEstimatorConfigService) SetOnRampReader(reader ccip.OnRampReader) { + c.onRampReader = reader +} + +// GetDataAvailabilityConfig Returns dynamic config data availability parameters. +// GetDynamicConfig should be cached in the onRamp reader to avoid unnecessary on-chain calls +func (c *FeeEstimatorConfigService) GetDataAvailabilityConfig(ctx context.Context) (destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps int64, err error) { + if c.onRampReader == nil { + return 0, 0, 0, nil + } + + cfg, err := c.onRampReader.GetDynamicConfig(ctx) + if err != nil { + return 0, 0, 0, err + } + + return int64(cfg.DestDataAvailabilityOverheadGas), + int64(cfg.DestGasPerDataAvailabilityByte), + int64(cfg.DestDataAvailabilityMultiplierBps), + err +} + +// AddGasPriceInterceptor adds price interceptors that can modify gas price. +func (c *FeeEstimatorConfigService) AddGasPriceInterceptor(gpi GasPriceInterceptor) { + if gpi != nil { + c.gasPriceInterceptors = append(c.gasPriceInterceptors, gpi) + } +} + +// ModifyGasPriceComponents applies gasPrice interceptors and returns modified gasPrice. +func (c *FeeEstimatorConfigService) ModifyGasPriceComponents(ctx context.Context, gasPrice, daGasPrice *big.Int) (*big.Int, *big.Int, error) { + if len(c.gasPriceInterceptors) == 0 { + return gasPrice, daGasPrice, nil + } + + // values are mutable, it is necessary to copy the values to protect the arguments from modification. + cpGasPrice := new(big.Int).Set(gasPrice) + cpDAGasPrice := new(big.Int).Set(daGasPrice) + + var err error + for _, interceptor := range c.gasPriceInterceptors { + if cpGasPrice, cpDAGasPrice, err = interceptor.ModifyGasPriceComponents(ctx, cpGasPrice, cpDAGasPrice); err != nil { + return nil, nil, err + } + } + + return cpGasPrice, cpDAGasPrice, nil +} diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go b/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go new file mode 100644 index 00000000000..3ecd88ae3bd --- /dev/null +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go @@ -0,0 +1,112 @@ +package estimatorconfig_test + +import ( + "context" + "errors" + "math/big" + "testing" + + "github.com/stretchr/testify/require" + + mocks2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig/mocks" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" +) + +func TestFeeEstimatorConfigService(t *testing.T) { + svc := estimatorconfig.NewFeeEstimatorConfigService() + ctx := context.Background() + + var expectedDestDataAvailabilityOverheadGas int64 = 1 + var expectedDestGasPerDataAvailabilityByte int64 = 2 + var expectedDestDataAvailabilityMultiplierBps int64 = 3 + + onRampReader := mocks.NewOnRampReader(t) + destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps, err := svc.GetDataAvailabilityConfig(ctx) + require.NoError(t, err) // if onRampReader not set, return nil error and 0 values + require.EqualValues(t, 0, destDataAvailabilityOverheadGas) + require.EqualValues(t, 0, destGasPerDataAvailabilityByte) + require.EqualValues(t, 0, destDataAvailabilityMultiplierBps) + svc.SetOnRampReader(onRampReader) + + onRampReader.On("GetDynamicConfig", ctx). + Return(ccip.OnRampDynamicConfig{ + DestDataAvailabilityOverheadGas: uint32(expectedDestDataAvailabilityOverheadGas), + DestGasPerDataAvailabilityByte: uint16(expectedDestGasPerDataAvailabilityByte), + DestDataAvailabilityMultiplierBps: uint16(expectedDestDataAvailabilityMultiplierBps), + }, nil).Once() + + destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps, err = svc.GetDataAvailabilityConfig(ctx) + require.NoError(t, err) + require.Equal(t, expectedDestDataAvailabilityOverheadGas, destDataAvailabilityOverheadGas) + require.Equal(t, expectedDestGasPerDataAvailabilityByte, destGasPerDataAvailabilityByte) + require.Equal(t, expectedDestDataAvailabilityMultiplierBps, destDataAvailabilityMultiplierBps) + + onRampReader.On("GetDynamicConfig", ctx). + Return(ccip.OnRampDynamicConfig{}, errors.New("test")).Once() + _, _, _, err = svc.GetDataAvailabilityConfig(ctx) + require.Error(t, err) +} + +func TestModifyGasPriceComponents(t *testing.T) { + t.Run("success modification", func(t *testing.T) { + svc := estimatorconfig.NewFeeEstimatorConfigService() + ctx := context.Background() + + initialExecGasPrice, initialDaGasPrice := big.NewInt(10), big.NewInt(1) + + gpi1 := mocks2.NewGasPriceInterceptor(t) + svc.AddGasPriceInterceptor(gpi1) + + // change in first interceptor + firstModExecGasPrice, firstModDaGasPrice := big.NewInt(5), big.NewInt(2) + gpi1.On("ModifyGasPriceComponents", ctx, initialExecGasPrice, initialDaGasPrice). + Return(firstModExecGasPrice, firstModDaGasPrice, nil) + + gpi2 := mocks2.NewGasPriceInterceptor(t) + svc.AddGasPriceInterceptor(gpi2) + + // change in second iterceptor + secondModExecGasPrice, secondModDaGasPrice := big.NewInt(50), big.NewInt(20) + gpi2.On("ModifyGasPriceComponents", ctx, firstModExecGasPrice, firstModDaGasPrice). + Return(secondModExecGasPrice, secondModDaGasPrice, nil) + + // has to return second interceptor values + resGasPrice, resDAGasPrice, err := svc.ModifyGasPriceComponents(ctx, initialExecGasPrice, initialDaGasPrice) + require.NoError(t, err) + require.Equal(t, secondModExecGasPrice.Int64(), resGasPrice.Int64()) + require.Equal(t, secondModDaGasPrice.Int64(), resDAGasPrice.Int64()) + }) + + t.Run("error modification", func(t *testing.T) { + svc := estimatorconfig.NewFeeEstimatorConfigService() + ctx := context.Background() + + initialExecGasPrice, initialDaGasPrice := big.NewInt(10), big.NewInt(1) + gpi1 := mocks2.NewGasPriceInterceptor(t) + svc.AddGasPriceInterceptor(gpi1) + gpi1.On("ModifyGasPriceComponents", ctx, initialExecGasPrice, initialDaGasPrice). + Return(nil, nil, errors.New("test")) + + // has to return second interceptor values + _, _, err := svc.ModifyGasPriceComponents(ctx, initialExecGasPrice, initialDaGasPrice) + require.Error(t, err) + }) + + t.Run("without interceptors", func(t *testing.T) { + svc := estimatorconfig.NewFeeEstimatorConfigService() + ctx := context.Background() + + initialExecGasPrice, initialDaGasPrice := big.NewInt(10), big.NewInt(1) + + // has to return second interceptor values + resGasPrice, resDAGasPrice, err := svc.ModifyGasPriceComponents(ctx, initialExecGasPrice, initialDaGasPrice) + require.NoError(t, err) + + // values should not be modified + require.Equal(t, initialExecGasPrice, resGasPrice) + require.Equal(t, initialDaGasPrice, resDAGasPrice) + }) +} diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go new file mode 100644 index 00000000000..359f32e13a5 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go @@ -0,0 +1,82 @@ +package mantle + +import ( + "context" + "fmt" + "math/big" + "strings" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + + evmClient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" +) + +const ( + // tokenRatio is not volatile and can be requested not often. + tokenRatioUpdateInterval = 60 * time.Minute + // tokenRatio fetches the tokenRatio used for Mantle's gas price calculation + tokenRatioMethod = "tokenRatio" + mantleTokenRatioAbiString = `[{"inputs":[],"name":"tokenRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]` +) + +type Interceptor struct { + client evmClient.Client + tokenRatioCallData []byte + tokenRatio *big.Int + tokenRatioLastUpdate time.Time +} + +func NewInterceptor(_ context.Context, client evmClient.Client) (*Interceptor, error) { + // Encode calldata for tokenRatio method + tokenRatioMethodAbi, err := abi.JSON(strings.NewReader(mantleTokenRatioAbiString)) + if err != nil { + return nil, fmt.Errorf("failed to parse GasPriceOracle %s() method ABI for Mantle; %w", tokenRatioMethod, err) + } + tokenRatioCallData, err := tokenRatioMethodAbi.Pack(tokenRatioMethod) + if err != nil { + return nil, fmt.Errorf("failed to parse GasPriceOracle %s() calldata for Mantle; %w", tokenRatioMethod, err) + } + + return &Interceptor{ + client: client, + tokenRatioCallData: tokenRatioCallData, + }, nil +} + +// ModifyGasPriceComponents returns modified gasPrice. +func (i *Interceptor) ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (*big.Int, *big.Int, error) { + if time.Since(i.tokenRatioLastUpdate) > tokenRatioUpdateInterval { + mantleTokenRatio, err := i.getMantleTokenRatio(ctx) + if err != nil { + return nil, nil, err + } + + i.tokenRatio, i.tokenRatioLastUpdate = mantleTokenRatio, time.Now() + } + + // multiply daGasPrice and execGas price by tokenRatio + newExecGasPrice := new(big.Int).Mul(execGasPrice, i.tokenRatio) + newDAGasPrice := new(big.Int).Mul(daGasPrice, i.tokenRatio) + return newExecGasPrice, newDAGasPrice, nil +} + +// getMantleTokenRatio Requests and returns a token ratio value for the Mantle chain. +func (i *Interceptor) getMantleTokenRatio(ctx context.Context) (*big.Int, error) { + // FIXME it's removed from chainlink repo + // precompile := common.HexToAddress(rollups.OPGasOracleAddress) + precompile := common.Address{} + + tokenRatio, err := i.client.CallContract(ctx, ethereum.CallMsg{ + To: &precompile, + Data: i.tokenRatioCallData, + }, nil) + + if err != nil { + return nil, fmt.Errorf("getMantleTokenRatio call failed: %w", err) + } + + return new(big.Int).SetBytes(tokenRatio), nil +} diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go new file mode 100644 index 00000000000..9134d996c27 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go @@ -0,0 +1,96 @@ +package mantle + +import ( + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" +) + +func TestInterceptor(t *testing.T) { + ethClient := mocks.NewClient(t) + ctx := context.Background() + + tokenRatio := big.NewInt(10) + interceptor, err := NewInterceptor(ctx, ethClient) + require.NoError(t, err) + + // request token ratio + ethClient.On("CallContract", ctx, mock.IsType(ethereum.CallMsg{}), mock.IsType(&big.Int{})). + Return(common.BigToHash(tokenRatio).Bytes(), nil).Once() + + modExecGasPrice, modDAGasPrice, err := interceptor.ModifyGasPriceComponents(ctx, big.NewInt(1), big.NewInt(1)) + require.NoError(t, err) + require.Equal(t, int64(10), modExecGasPrice.Int64()) + require.Equal(t, int64(10), modDAGasPrice.Int64()) + + // second call won't invoke eth client + modExecGasPrice, modDAGasPrice, err = interceptor.ModifyGasPriceComponents(ctx, big.NewInt(2), big.NewInt(1)) + require.NoError(t, err) + require.Equal(t, int64(20), modExecGasPrice.Int64()) + require.Equal(t, int64(10), modDAGasPrice.Int64()) +} + +func TestModifyGasPriceComponents(t *testing.T) { + testCases := map[string]struct { + execGasPrice *big.Int + daGasPrice *big.Int + tokenRatio *big.Int + resultExecGasPrice *big.Int + resultDAGasPrice *big.Int + }{ + "regular": { + execGasPrice: big.NewInt(1000), + daGasPrice: big.NewInt(100), + resultExecGasPrice: big.NewInt(2000), + resultDAGasPrice: big.NewInt(200), + tokenRatio: big.NewInt(2), + }, + "zero DAGasPrice": { + execGasPrice: big.NewInt(1000), + daGasPrice: big.NewInt(0), + resultExecGasPrice: big.NewInt(5000), + resultDAGasPrice: big.NewInt(0), + tokenRatio: big.NewInt(5), + }, + "zero ExecGasPrice": { + execGasPrice: big.NewInt(0), + daGasPrice: big.NewInt(10), + resultExecGasPrice: big.NewInt(0), + resultDAGasPrice: big.NewInt(50), + tokenRatio: big.NewInt(5), + }, + "zero token ratio": { + execGasPrice: big.NewInt(15), + daGasPrice: big.NewInt(10), + resultExecGasPrice: big.NewInt(0), + resultDAGasPrice: big.NewInt(0), + tokenRatio: big.NewInt(0), + }, + } + + for tcName, tc := range testCases { + t.Run(tcName, func(t *testing.T) { + ethClient := mocks.NewClient(t) + ctx := context.Background() + + interceptor, err := NewInterceptor(ctx, ethClient) + require.NoError(t, err) + + // request token ratio + ethClient.On("CallContract", ctx, mock.IsType(ethereum.CallMsg{}), mock.IsType(&big.Int{})). + Return(common.BigToHash(tc.tokenRatio).Bytes(), nil).Once() + + modExecGasPrice, modDAGasPrice, err := interceptor.ModifyGasPriceComponents(ctx, tc.execGasPrice, tc.daGasPrice) + require.NoError(t, err) + require.Equal(t, tc.resultExecGasPrice.Int64(), modExecGasPrice.Int64()) + require.Equal(t, tc.resultDAGasPrice.Int64(), modDAGasPrice.Int64()) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/mocks/gas_price_interceptor_mock.go b/core/services/ocr2/plugins/ccip/estimatorconfig/mocks/gas_price_interceptor_mock.go new file mode 100644 index 00000000000..78d7fa7bb35 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/mocks/gas_price_interceptor_mock.go @@ -0,0 +1,106 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + big "math/big" + + mock "github.com/stretchr/testify/mock" +) + +// GasPriceInterceptor is an autogenerated mock type for the GasPriceInterceptor type +type GasPriceInterceptor struct { + mock.Mock +} + +type GasPriceInterceptor_Expecter struct { + mock *mock.Mock +} + +func (_m *GasPriceInterceptor) EXPECT() *GasPriceInterceptor_Expecter { + return &GasPriceInterceptor_Expecter{mock: &_m.Mock} +} + +// ModifyGasPriceComponents provides a mock function with given fields: ctx, execGasPrice, daGasPrice +func (_m *GasPriceInterceptor) ModifyGasPriceComponents(ctx context.Context, execGasPrice *big.Int, daGasPrice *big.Int) (*big.Int, *big.Int, error) { + ret := _m.Called(ctx, execGasPrice, daGasPrice) + + if len(ret) == 0 { + panic("no return value specified for ModifyGasPriceComponents") + } + + var r0 *big.Int + var r1 *big.Int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, *big.Int) (*big.Int, *big.Int, error)); ok { + return rf(ctx, execGasPrice, daGasPrice) + } + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, *big.Int) *big.Int); ok { + r0 = rf(ctx, execGasPrice, daGasPrice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *big.Int, *big.Int) *big.Int); ok { + r1 = rf(ctx, execGasPrice, daGasPrice) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*big.Int) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, *big.Int, *big.Int) error); ok { + r2 = rf(ctx, execGasPrice, daGasPrice) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// GasPriceInterceptor_ModifyGasPriceComponents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyGasPriceComponents' +type GasPriceInterceptor_ModifyGasPriceComponents_Call struct { + *mock.Call +} + +// ModifyGasPriceComponents is a helper method to define mock.On call +// - ctx context.Context +// - execGasPrice *big.Int +// - daGasPrice *big.Int +func (_e *GasPriceInterceptor_Expecter) ModifyGasPriceComponents(ctx interface{}, execGasPrice interface{}, daGasPrice interface{}) *GasPriceInterceptor_ModifyGasPriceComponents_Call { + return &GasPriceInterceptor_ModifyGasPriceComponents_Call{Call: _e.mock.On("ModifyGasPriceComponents", ctx, execGasPrice, daGasPrice)} +} + +func (_c *GasPriceInterceptor_ModifyGasPriceComponents_Call) Run(run func(ctx context.Context, execGasPrice *big.Int, daGasPrice *big.Int)) *GasPriceInterceptor_ModifyGasPriceComponents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int), args[2].(*big.Int)) + }) + return _c +} + +func (_c *GasPriceInterceptor_ModifyGasPriceComponents_Call) Return(modExecGasPrice *big.Int, modDAGasPrice *big.Int, err error) *GasPriceInterceptor_ModifyGasPriceComponents_Call { + _c.Call.Return(modExecGasPrice, modDAGasPrice, err) + return _c +} + +func (_c *GasPriceInterceptor_ModifyGasPriceComponents_Call) RunAndReturn(run func(context.Context, *big.Int, *big.Int) (*big.Int, *big.Int, error)) *GasPriceInterceptor_ModifyGasPriceComponents_Call { + _c.Call.Return(run) + return _c +} + +// NewGasPriceInterceptor creates a new instance of GasPriceInterceptor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewGasPriceInterceptor(t interface { + mock.TestingT + Cleanup(func()) +}) *GasPriceInterceptor { + mock := &GasPriceInterceptor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/exportinternal.go b/core/services/ocr2/plugins/ccip/exportinternal.go index 6b24cba4857..10b802eeabc 100644 --- a/core/services/ocr2/plugins/ccip/exportinternal.go +++ b/core/services/ocr2/plugins/ccip/exportinternal.go @@ -5,14 +5,17 @@ import ( "math/big" "time" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/ethereum/go-ethereum/common" + "github.com/google/uuid" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/internal/gethwrappers2/generated/offchainaggregator" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" @@ -22,8 +25,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) +const OffchainAggregator = "OffchainAggregator" +const DecimalsMethodName = "decimals" +const LatestRoundDataMethodName = "latestRoundData" + func GenericAddrToEvm(addr ccip.Address) (common.Address, error) { return ccipcalc.GenericAddrToEvm(addr) } @@ -38,20 +46,20 @@ func NewEvmPriceRegistry(lp logpoller.LogPoller, ec client.Client, lggr logger.L type VersionFinder = factory.VersionFinder -func NewCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address ccip.Address, ec client.Client, lp logpoller.LogPoller) (ccipdata.CommitStoreReader, error) { - return factory.NewCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp) +func NewCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address ccip.Address, ec client.Client, lp logpoller.LogPoller, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (ccipdata.CommitStoreReader, error) { + return factory.NewCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, feeEstimatorConfig) } -func CloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address ccip.Address, ec client.Client, lp logpoller.LogPoller) error { - return factory.CloseCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp) +func CloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address ccip.Address, ec client.Client, lp logpoller.LogPoller, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) error { + return factory.CloseCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, feeEstimatorConfig) } -func NewOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr ccip.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, registerFilters bool) (ccipdata.OffRampReader, error) { - return factory.NewOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, registerFilters) +func NewOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr ccip.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, registerFilters bool, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (ccipdata.OffRampReader, error) { + return factory.NewOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, registerFilters, feeEstimatorConfig) } -func CloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr ccip.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) error { - return factory.CloseOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice) +func CloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr ccip.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) error { + return factory.CloseOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, feeEstimatorConfig) } func NewEvmVersionFinder() factory.EvmVersionFinder { @@ -72,12 +80,18 @@ type DynamicPriceGetterClient = pricegetter.DynamicPriceGetterClient type DynamicPriceGetter = pricegetter.DynamicPriceGetter +type AllTokensPriceGetter = pricegetter.AllTokensPriceGetter + +func NewPipelineGetter(source string, runner pipeline.Runner, jobID int32, externalJobID uuid.UUID, name string, lggr logger.Logger) (*pricegetter.PipelineGetter, error) { + return pricegetter.NewPipelineGetter(source, runner, jobID, externalJobID, name, lggr) +} + func NewDynamicPriceGetterClient(batchCaller rpclib.EvmBatchCaller) DynamicPriceGetterClient { return pricegetter.NewDynamicPriceGetterClient(batchCaller) } -func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, evmClients map[uint64]DynamicPriceGetterClient) (*DynamicPriceGetter, error) { - return pricegetter.NewDynamicPriceGetter(cfg, evmClients) +func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, contractReaders map[uint64]types.ContractReader) (*DynamicPriceGetter, error) { + return pricegetter.NewDynamicPriceGetter(cfg, contractReaders) } func NewDynamicLimitedBatchCaller( @@ -134,3 +148,5 @@ func NewCommitOffchainConfig( ) ccip.CommitOffchainConfig { return ccipdata.NewCommitOffchainConfig(gasPriceDeviationPPB, gasPriceHeartBeat, tokenPriceDeviationPPB, tokenPriceHeartBeat, inflightCacheExpiry, priceReportingDisabled) } + +const OffChainAggregatorABI = offchainaggregator.OffchainAggregatorABI diff --git a/core/services/ocr2/plugins/ccip/integration_test.go b/core/services/ocr2/plugins/ccip/integration_test.go index b116a470363..6a1aef98d0c 100644 --- a/core/services/ocr2/plugins/ccip/integration_test.go +++ b/core/services/ocr2/plugins/ccip/integration_test.go @@ -108,7 +108,6 @@ func TestIntegration_CCIP(t *testing.T) { require.NoError(t, err) priceGetterConfigJson = string(priceGetterConfigBytes) } - jobParams := ccipTH.SetUpNodesAndJobs(t, tokenPricesUSDPipeline, priceGetterConfigJson, "") // track sequence number and nonce separately since nonce doesn't bump for messages with allowOutOfOrderExecution == true, @@ -696,8 +695,9 @@ func TestReorg(t *testing.T) { require.NoError(t, ccipTH.Dest.Chain.Fork(forkBlock.Hash()), "Error while forking the chain") // Make sure that fork is longer than the canonical chain to enforce switch - noOfBlocks := uint(currentBlock.NumberU64() - forkBlock.NumberU64()) - for i := uint(0); i < noOfBlocks+1; i++ { + //nolint:gosec // not a problem in tests + noOfBlocks := int(currentBlock.NumberU64() - forkBlock.NumberU64()) + for i := 0; i < noOfBlocks+1; i++ { ccipTH.Dest.Chain.Commit() } diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go index c49a0448f96..5f12ae97b8a 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/require" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" @@ -18,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) @@ -56,7 +56,9 @@ func Test_RootsEligibleForExecution(t *testing.T) { BlockHash: utils.RandomBytes32(), BlockNumber: 2, BlockTimestamp: time.Now(), FinalizedBlockNumber: 1, })) - commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp, feeEstimatorConfig) require.NoError(t, err) rootsCache := cache.NewCommitRootsCache(logger.TestLogger(t), commitStore, 10*time.Hour, time.Second) @@ -170,7 +172,9 @@ func Test_RootsEligibleForExecutionWithReorgs(t *testing.T) { BlockHash: utils.RandomBytes32(), BlockNumber: 3, BlockTimestamp: time.Now(), FinalizedBlockNumber: 1, })) - commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp, feeEstimatorConfig) require.NoError(t, err) rootsCache := cache.NewCommitRootsCache(logger.TestLogger(t), commitStore, 10*time.Hour, time.Second) @@ -233,7 +237,9 @@ func Test_BlocksWithTheSameTimestamps(t *testing.T) { BlockHash: utils.RandomBytes32(), BlockNumber: 2, BlockTimestamp: time.Now(), FinalizedBlockNumber: 2, })) - commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp, feeEstimatorConfig) require.NoError(t, err) rootsCache := cache.NewCommitRootsCache(logger.TestLogger(t), commitStore, 10*time.Hour, time.Second) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go index 8372ae47486..138d674f93f 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go @@ -110,14 +110,19 @@ func SelectorToBytes(chainSelector uint64) [16]byte { return b } -// RetryUntilSuccess repeatedly calls fn until it returns a nil error. After each failed call there is an exponential -// backoff applied, between initialDelay and maxDelay. -func RetryUntilSuccess[T any](fn func() (T, error), initialDelay time.Duration, maxDelay time.Duration) (T, error) { +// RetryUntilSuccess repeatedly calls fn until it returns a nil error or retries have been exhausted. After each failed +// call there is an exponential backoff applied, between initialDelay and maxDelay. +func RetryUntilSuccess[T any]( + fn func() (T, error), + initialDelay time.Duration, + maxDelay time.Duration, + maxRetries uint, +) (T, error) { return retry.DoWithData( fn, retry.Delay(initialDelay), retry.MaxDelay(maxDelay), retry.DelayType(retry.BackOffDelay), - retry.UntilSucceeded(), + retry.Attempts(maxRetries), ) } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go index 6f1cdb4a6af..d298eecbbf3 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" ) @@ -145,14 +146,20 @@ func TestRetryUntilSuccess(t *testing.T) { } // Assert that RetryUntilSuccess returns the expected value when fn returns success on the 5th attempt - numCalls, err := RetryUntilSuccess(fn, initialDelay, maxDelay) - assert.Nil(t, err) + numCalls, err := RetryUntilSuccess(fn, initialDelay, maxDelay, 10) + require.NoError(t, err) assert.Equal(t, 5, numCalls) // Assert that RetryUntilSuccess returns the expected value when fn returns success on the 8th attempt numAttempts = 8 numCalls = 0 - numCalls, err = RetryUntilSuccess(fn, initialDelay, maxDelay) - assert.Nil(t, err) + numCalls, err = RetryUntilSuccess(fn, initialDelay, maxDelay, 10) + require.NoError(t, err) assert.Equal(t, 8, numCalls) + + // Assert that RetryUntilSuccess exhausts retries + numAttempts = 8 + numCalls = 0 + numCalls, err = RetryUntilSuccess(fn, initialDelay, maxDelay, 2) + require.Error(t, err) } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go index ceafdf22721..c67c3c15276 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go @@ -13,15 +13,15 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ) func TestTokenPoolFactory(t *testing.T) { - lggr := logger.Test(t) + lggr := logger.TestLogger(t) offRamp := utils.RandomAddress() ctx := context.Background() remoteChainSelector := uint64(2000) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go index 971b507e828..42a7369c7e5 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go @@ -5,7 +5,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go index 0f234bab8a6..30e74d89e36 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go @@ -1,6 +1,7 @@ package ccipdata_test import ( + "context" "math/big" "reflect" "testing" @@ -35,6 +36,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) @@ -179,8 +181,17 @@ func TestCommitStoreReaders(t *testing.T) { lm := new(rollupMocks.L1Oracle) ge.On("L1Oracle").Return(lm) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + feeEstimatorConfig.On( + "ModifyGasPriceComponents", + mock.Anything, + mock.AnythingOfType("*big.Int"), + mock.AnythingOfType("*big.Int"), + ).Return(func(ctx context.Context, x, y *big.Int) (*big.Int, *big.Int, error) { + return x, y, nil + }) maxGasPrice := big.NewInt(1e8) - c12r, err := factory.NewCommitStoreReader(ctx, lggr, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(addr2), ec, lp) + c12r, err := factory.NewCommitStoreReader(ctx, lggr, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(addr2), ec, lp, feeEstimatorConfig) require.NoError(t, err) err = c12r.SetGasEstimator(ctx, ge) require.NoError(t, err) @@ -327,8 +338,10 @@ func TestCommitStoreReaders(t *testing.T) { require.NoError(t, err) assert.Equal(t, commonOffchain, c2) // We should be able to query for gas prices now. + gpe, err := cr.GasPriceEstimator(ctx) require.NoError(t, err) + gp, err := gpe.GetGasPrice(ctx) require.NoError(t, err) assert.True(t, gp.Cmp(big.NewInt(0)) > 0) @@ -370,7 +383,10 @@ func TestNewCommitStoreReader(t *testing.T) { if tc.expectedErr == "" { lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) } - _, err = factory.NewCommitStoreReader(ctx, logger.Test(t), factory.NewEvmVersionFinder(), addr, c, lp) + + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + _, err = factory.NewCommitStoreReader(ctx, logger.Test(t), factory.NewEvmVersionFinder(), addr, c, lp, feeEstimatorConfig) if tc.expectedErr != "" { require.EqualError(t, err, tc.expectedErr) } else { diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go index d9cd523d75e..2d40a526112 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go @@ -21,16 +21,16 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" ) -func NewCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller) (ccipdata.CommitStoreReader, error) { - return initOrCloseCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, false) +func NewCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (ccipdata.CommitStoreReader, error) { + return initOrCloseCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, feeEstimatorConfig, false) } -func CloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller) error { - _, err := initOrCloseCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, true) +func CloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) error { + _, err := initOrCloseCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, feeEstimatorConfig, true) return err } -func initOrCloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, closeReader bool) (ccipdata.CommitStoreReader, error) { +func initOrCloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader, closeReader bool) (ccipdata.CommitStoreReader, error) { contractType, version, err := versionFinder.TypeAndVersion(address, ec) if err != nil { return nil, errors.Wrapf(err, "unable to read type and version") @@ -48,7 +48,7 @@ func initOrCloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versi switch version.String() { case ccipdata.V1_2_0: - cs, err := v1_2_0.NewCommitStore(lggr, evmAddr, ec, lp) + cs, err := v1_2_0.NewCommitStore(lggr, evmAddr, ec, lp, feeEstimatorConfig) if err != nil { return nil, err } @@ -57,7 +57,7 @@ func initOrCloseCommitStoreReader(ctx context.Context, lggr logger.Logger, versi } return cs, cs.RegisterFilters(ctx) case ccipdata.V1_5_0: - cs, err := v1_5_0.NewCommitStore(lggr, evmAddr, ec, lp) + cs, err := v1_5_0.NewCommitStore(lggr, evmAddr, ec, lp, feeEstimatorConfig) if err != nil { return nil, err } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go index cd81a0633ce..d4234bb1a33 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) @@ -27,14 +28,16 @@ func TestCommitStore(t *testing.T) { addr := cciptypes.Address(utils.RandomAddress().String()) lp := mocks2.NewLogPoller(t) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) versionFinder := newMockVersionFinder(ccipconfig.CommitStore, *semver.MustParse(versionStr), nil) - _, err := NewCommitStoreReader(ctx, lggr, versionFinder, addr, nil, lp) + _, err := NewCommitStoreReader(ctx, lggr, versionFinder, addr, nil, lp, feeEstimatorConfig) assert.NoError(t, err) expFilterName := logpoller.FilterName(v1_2_0.ExecReportAccepts, addr) lp.On("UnregisterFilter", mock.Anything, expFilterName).Return(nil) - err = CloseCommitStoreReader(ctx, lggr, versionFinder, addr, nil, lp) + err = CloseCommitStoreReader(ctx, lggr, versionFinder, addr, nil, lp, feeEstimatorConfig) assert.NoError(t, err) } } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go index 136079b5b3e..7a1180a5590 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go @@ -24,16 +24,16 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" ) -func NewOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, registerFilters bool) (ccipdata.OffRampReader, error) { - return initOrCloseOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, false, registerFilters) +func NewOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, registerFilters bool, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (ccipdata.OffRampReader, error) { + return initOrCloseOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, false, registerFilters, feeEstimatorConfig) } -func CloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) error { - _, err := initOrCloseOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, true, false) +func CloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) error { + _, err := initOrCloseOffRampReader(ctx, lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, true, false, feeEstimatorConfig) return err } -func initOrCloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, closeReader bool, registerFilters bool) (ccipdata.OffRampReader, error) { +func initOrCloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, closeReader bool, registerFilters bool, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (ccipdata.OffRampReader, error) { contractType, version, err := versionFinder.TypeAndVersion(addr, destClient) if err != nil { return nil, errors.Wrapf(err, "unable to read type and version") @@ -51,7 +51,7 @@ func initOrCloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFi switch version.String() { case ccipdata.V1_2_0: - offRamp, err := v1_2_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice) + offRamp, err := v1_2_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice, feeEstimatorConfig) if err != nil { return nil, err } @@ -60,7 +60,7 @@ func initOrCloseOffRampReader(ctx context.Context, lggr logger.Logger, versionFi } return offRamp, offRamp.RegisterFilters(ctx) case ccipdata.V1_5_0: - offRamp, err := v1_5_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice) + offRamp, err := v1_5_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice, feeEstimatorConfig) if err != nil { return nil, err } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go index bfb8da5e32c..7640261786f 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go @@ -16,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) @@ -26,6 +27,8 @@ func TestOffRamp(t *testing.T) { addr := cciptypes.Address(utils.RandomAddress().String()) lp := mocks2.NewLogPoller(t) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + expFilterNames := []string{ logpoller.FilterName(v1_2_0.ExecExecutionStateChanges, addr), logpoller.FilterName(v1_2_0.ExecTokenPoolAdded, addr), @@ -34,13 +37,13 @@ func TestOffRamp(t *testing.T) { versionFinder := newMockVersionFinder(ccipconfig.EVM2EVMOffRamp, *semver.MustParse(versionStr), nil) lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Times(len(expFilterNames)) - _, err := NewOffRampReader(ctx, lggr, versionFinder, addr, nil, lp, nil, nil, true) + _, err := NewOffRampReader(ctx, lggr, versionFinder, addr, nil, lp, nil, nil, true, feeEstimatorConfig) assert.NoError(t, err) for _, f := range expFilterNames { lp.On("UnregisterFilter", mock.Anything, f).Return(nil) } - err = CloseOffRampReader(ctx, lggr, versionFinder, addr, nil, lp, nil, nil) + err = CloseOffRampReader(ctx, lggr, versionFinder, addr, nil, lp, nil, nil, feeEstimatorConfig) assert.NoError(t, err) } } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go index 57bf6e2eeb3..85eee70e296 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go @@ -10,7 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/fee_estimator_config.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/fee_estimator_config.go new file mode 100644 index 00000000000..0b4d1ce75ab --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/fee_estimator_config.go @@ -0,0 +1,11 @@ +package ccipdata + +import ( + "context" + "math/big" +) + +type FeeEstimatorConfigReader interface { + GetDataAvailabilityConfig(ctx context.Context) (destDAOverheadGas, destGasPerDAByte, destDAMultiplierBps int64, err error) + ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (modExecGasPrice, modDAGasPrice *big.Int, err error) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/fee_estimator_config_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/fee_estimator_config_mock.go new file mode 100644 index 00000000000..9ce400406d4 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/fee_estimator_config_mock.go @@ -0,0 +1,177 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + big "math/big" + + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// FeeEstimatorConfigReader is an autogenerated mock type for the FeeEstimatorConfigReader type +type FeeEstimatorConfigReader struct { + mock.Mock +} + +type FeeEstimatorConfigReader_Expecter struct { + mock *mock.Mock +} + +func (_m *FeeEstimatorConfigReader) EXPECT() *FeeEstimatorConfigReader_Expecter { + return &FeeEstimatorConfigReader_Expecter{mock: &_m.Mock} +} + +// GetDataAvailabilityConfig provides a mock function with given fields: ctx +func (_m *FeeEstimatorConfigReader) GetDataAvailabilityConfig(ctx context.Context) (int64, int64, int64, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetDataAvailabilityConfig") + } + + var r0 int64 + var r1 int64 + var r2 int64 + var r3 error + if rf, ok := ret.Get(0).(func(context.Context) (int64, int64, int64, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) int64); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(int64) + } + + if rf, ok := ret.Get(1).(func(context.Context) int64); ok { + r1 = rf(ctx) + } else { + r1 = ret.Get(1).(int64) + } + + if rf, ok := ret.Get(2).(func(context.Context) int64); ok { + r2 = rf(ctx) + } else { + r2 = ret.Get(2).(int64) + } + + if rf, ok := ret.Get(3).(func(context.Context) error); ok { + r3 = rf(ctx) + } else { + r3 = ret.Error(3) + } + + return r0, r1, r2, r3 +} + +// FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDataAvailabilityConfig' +type FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call struct { + *mock.Call +} + +// GetDataAvailabilityConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *FeeEstimatorConfigReader_Expecter) GetDataAvailabilityConfig(ctx interface{}) *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call { + return &FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call{Call: _e.mock.On("GetDataAvailabilityConfig", ctx)} +} + +func (_c *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call) Run(run func(ctx context.Context)) *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call) Return(destDAOverheadGas int64, destGasPerDAByte int64, destDAMultiplierBps int64, err error) *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call { + _c.Call.Return(destDAOverheadGas, destGasPerDAByte, destDAMultiplierBps, err) + return _c +} + +func (_c *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call) RunAndReturn(run func(context.Context) (int64, int64, int64, error)) *FeeEstimatorConfigReader_GetDataAvailabilityConfig_Call { + _c.Call.Return(run) + return _c +} + +// ModifyGasPriceComponents provides a mock function with given fields: ctx, execGasPrice, daGasPrice +func (_m *FeeEstimatorConfigReader) ModifyGasPriceComponents(ctx context.Context, execGasPrice *big.Int, daGasPrice *big.Int) (*big.Int, *big.Int, error) { + ret := _m.Called(ctx, execGasPrice, daGasPrice) + + if len(ret) == 0 { + panic("no return value specified for ModifyGasPriceComponents") + } + + var r0 *big.Int + var r1 *big.Int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, *big.Int) (*big.Int, *big.Int, error)); ok { + return rf(ctx, execGasPrice, daGasPrice) + } + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, *big.Int) *big.Int); ok { + r0 = rf(ctx, execGasPrice, daGasPrice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *big.Int, *big.Int) *big.Int); ok { + r1 = rf(ctx, execGasPrice, daGasPrice) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*big.Int) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, *big.Int, *big.Int) error); ok { + r2 = rf(ctx, execGasPrice, daGasPrice) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// FeeEstimatorConfigReader_ModifyGasPriceComponents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyGasPriceComponents' +type FeeEstimatorConfigReader_ModifyGasPriceComponents_Call struct { + *mock.Call +} + +// ModifyGasPriceComponents is a helper method to define mock.On call +// - ctx context.Context +// - execGasPrice *big.Int +// - daGasPrice *big.Int +func (_e *FeeEstimatorConfigReader_Expecter) ModifyGasPriceComponents(ctx interface{}, execGasPrice interface{}, daGasPrice interface{}) *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call { + return &FeeEstimatorConfigReader_ModifyGasPriceComponents_Call{Call: _e.mock.On("ModifyGasPriceComponents", ctx, execGasPrice, daGasPrice)} +} + +func (_c *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call) Run(run func(ctx context.Context, execGasPrice *big.Int, daGasPrice *big.Int)) *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int), args[2].(*big.Int)) + }) + return _c +} + +func (_c *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call) Return(modExecGasPrice *big.Int, modDAGasPrice *big.Int, err error) *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call { + _c.Call.Return(modExecGasPrice, modDAGasPrice, err) + return _c +} + +func (_c *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call) RunAndReturn(run func(context.Context, *big.Int, *big.Int) (*big.Int, *big.Int, error)) *FeeEstimatorConfigReader_ModifyGasPriceComponents_Call { + _c.Call.Return(run) + return _c +} + +// NewFeeEstimatorConfigReader creates a new instance of FeeEstimatorConfigReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewFeeEstimatorConfigReader(t interface { + mock.TestingT + Cleanup(func()) +}) *FeeEstimatorConfigReader { + mock := &FeeEstimatorConfigReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go index 17f9bcfb370..420cd5bf64c 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" @@ -28,10 +27,12 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) @@ -108,7 +109,7 @@ func TestOffRampReaderInit(t *testing.T) { func setupOffRampReaderTH(t *testing.T, version string) offRampReaderTH { ctx := testutils.Context(t) user, bc := ccipdata.NewSimulation(t) - log := logger.Test(t) + log := logger.TestLogger(t) orm := logpoller.NewORM(testutils.SimulatedChainID, pgtest.NewSqlxDB(t), log) lpOpts := logpoller.Opts{ PollPeriod: 100 * time.Millisecond, @@ -139,8 +140,10 @@ func setupOffRampReaderTH(t *testing.T, version string) offRampReaderTH { require.Fail(t, "Unknown version: ", version) } + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + // Create the version-specific reader. - reader, err := factory.NewOffRampReader(ctx, log, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(offRampAddress), bc, lp, nil, nil, true) + reader, err := factory.NewOffRampReader(ctx, log, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(offRampAddress), bc, lp, nil, nil, true, feeEstimatorConfig) require.NoError(t, err) addr, err := reader.Address(ctx) require.NoError(t, err) @@ -311,11 +314,14 @@ func TestNewOffRampReader(t *testing.T) { b, err := utils.ABIEncode(`[{"type":"string"}]`, tc.typeAndVersion) require.NoError(t, err) c := evmclientmocks.NewClient(t) + + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(b, nil) addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) lp := lpmocks.NewLogPoller(t) lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Maybe() - _, err = factory.NewOffRampReader(ctx, logger.Test(t), factory.NewEvmVersionFinder(), addr, c, lp, nil, nil, true) + _, err = factory.NewOffRampReader(ctx, logger.TestLogger(t), factory.NewEvmVersionFinder(), addr, c, lp, nil, nil, true, feeEstimatorConfig) if tc.expectedErr != "" { assert.EqualError(t, err, tc.expectedErr) } else { diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go index 3c82948b892..8655bc98acc 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go @@ -8,7 +8,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go index 0df76873915..06766be81ee 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go @@ -10,9 +10,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/logger" ) func Test_parseLogs(t *testing.T) { @@ -28,7 +27,7 @@ func Test_parseLogs(t *testing.T) { return &log.Index, nil } - parsedEvents, err := ParseLogs[uint](logs, logger.Test(t), parseFn) + parsedEvents, err := ParseLogs[uint](logs, logger.TestLogger(t), parseFn) require.NoError(t, err) assert.Len(t, parsedEvents, 100) @@ -56,7 +55,7 @@ func Test_parseLogs_withErrors(t *testing.T) { return &log.Index, nil } - log, observed := logger.TestObserved(t, zapcore.DebugLevel) + log, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) parsedEvents, err := ParseLogs[uint](logs, log, parseFn) assert.ErrorContains(t, err, fmt.Sprintf("%d logs were not parsed", len(logs)/2)) assert.Nil(t, parsedEvents, "No events are returned if there was an error.") diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go index 41161ee9388..80c5364e18f 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go @@ -2,8 +2,10 @@ package ccipdata import "time" -// RetryConfig configures an initial delay between retries and a max delay between retries +// RetryConfig configures an initial delay between retries, a max delay between retries, and a maximum number of +// times to retry type RetryConfig struct { InitialDelay time.Duration MaxDelay time.Duration + MaxRetries uint } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go index 2d772e3bd0a..78f60653668 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go @@ -53,9 +53,10 @@ type CommitStore struct { commitReportArgs abi.Arguments // Dynamic config - configMu sync.RWMutex - gasPriceEstimator *prices.DAGasPriceEstimator - offchainConfig cciptypes.CommitOffchainConfig + configMu sync.RWMutex + gasPriceEstimator *prices.DAGasPriceEstimator + offchainConfig cciptypes.CommitOffchainConfig + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader } func (c *CommitStore) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { @@ -259,6 +260,7 @@ func (c *CommitStore) ChangeConfig(_ context.Context, onchainConfig []byte, offc c.sourceMaxGasPrice, int64(offchainConfigParsed.ExecGasPriceDeviationPPB), int64(offchainConfigParsed.DAGasPriceDeviationPPB), + c.feeEstimatorConfig, ) c.offchainConfig = ccipdata.NewCommitOffchainConfig( offchainConfigParsed.ExecGasPriceDeviationPPB, @@ -353,7 +355,8 @@ func (c *CommitStore) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, return nil, err } - reportsQuery, err := logpoller.Where( + reportsQuery, err := query.Where( + c.address.String(), logpoller.NewAddressFilter(c.address), logpoller.NewEventSigFilter(c.reportAcceptedSig), query.Timestamp(uint64(ts.Unix()), primitives.Gte), @@ -365,7 +368,7 @@ func (c *CommitStore) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, logs, err := c.lp.FilteredLogs( ctx, - reportsQuery, + reportsQuery.Expressions, query.NewLimitAndSort(query.Limit{}, query.NewSortBySequence(query.Asc)), "GetAcceptedCommitReportsGteTimestamp", ) @@ -433,7 +436,7 @@ func (c *CommitStore) RegisterFilters(ctx context.Context) error { return logpollerutil.RegisterLpFilters(ctx, c.lp, c.filters) } -func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller) (*CommitStore, error) { +func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (*CommitStore, error) { commitStore, err := commit_store_1_2_0.NewCommitStore(addr, ec) if err != nil { return nil, err @@ -466,7 +469,8 @@ func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, l configMu: sync.RWMutex{}, // The fields below are initially empty and set on ChangeConfig method - offchainConfig: cciptypes.CommitOffchainConfig{}, - gasPriceEstimator: nil, + offchainConfig: cciptypes.CommitOffchainConfig{}, + gasPriceEstimator: nil, + feeEstimatorConfig: feeEstimatorConfig, }, nil } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go index e0771f33cb9..4307be0353c 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go @@ -10,13 +10,14 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/config" - "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) func TestCommitReportEncoding(t *testing.T) { @@ -47,7 +48,9 @@ func TestCommitReportEncoding(t *testing.T) { Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, } - c, err := NewCommitStore(logger.Test(t), utils.RandomAddress(), nil, mocks.NewLogPoller(t)) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + c, err := NewCommitStore(logger.TestLogger(t), utils.RandomAddress(), nil, mocks.NewLogPoller(t), feeEstimatorConfig) assert.NoError(t, err) encodedReport, err := c.EncodeCommitReport(ctx, report) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go index e8017016690..881755d3f3c 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go @@ -155,10 +155,11 @@ type OffRamp struct { // Dynamic config // configMu guards all the dynamic config fields. - configMu sync.RWMutex - gasPriceEstimator prices.GasPriceEstimatorExec - offchainConfig cciptypes.ExecOffchainConfig - onchainConfig cciptypes.ExecOnchainConfig + configMu sync.RWMutex + gasPriceEstimator prices.GasPriceEstimatorExec + offchainConfig cciptypes.ExecOffchainConfig + onchainConfig cciptypes.ExecOnchainConfig + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader } func (o *OffRamp) GetStaticConfig(ctx context.Context) (cciptypes.OffRampStaticConfig, error) { @@ -416,7 +417,7 @@ func (o *OffRamp) ChangeConfig(ctx context.Context, onchainConfigBytes []byte, o PermissionLessExecutionThresholdSeconds: time.Second * time.Duration(onchainConfigParsed.PermissionLessExecutionThresholdSeconds), Router: cciptypes.Address(onchainConfigParsed.Router.String()), } - priceEstimator := prices.NewDAGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0, 0) + priceEstimator := prices.NewDAGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0, 0, o.feeEstimatorConfig) o.UpdateDynamicConfig(onchainConfig, offchainConfig, priceEstimator) @@ -614,7 +615,7 @@ func (o *OffRamp) DecodeExecutionReport(ctx context.Context, report []byte) (cci return DecodeExecReport(ctx, o.ExecutionReportArgs, report) } -func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) (*OffRamp, error) { +func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, feeEstimatorConfig ccipdata.FeeEstimatorConfigReader) (*OffRamp, error) { offRamp, err := evm_2_evm_offramp_1_2_0.NewEVM2EVMOffRamp(addr, ec) if err != nil { return nil, err @@ -669,8 +670,9 @@ func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp lo offRamp.Address(), ), // values set on the fly after ChangeConfig is called - gasPriceEstimator: prices.ExecGasPriceEstimator{}, - offchainConfig: cciptypes.ExecOffchainConfig{}, - onchainConfig: cciptypes.ExecOnchainConfig{}, + gasPriceEstimator: prices.ExecGasPriceEstimator{}, + offchainConfig: cciptypes.ExecOffchainConfig{}, + onchainConfig: cciptypes.ExecOnchainConfig{}, + feeEstimatorConfig: feeEstimatorConfig, }, nil } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go index 630b92f67fc..c2983492618 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) @@ -26,7 +26,9 @@ func TestExecutionReportEncodingV120(t *testing.T) { ProofFlagBits: big.NewInt(133), } - offRamp, err := v1_2_0.NewOffRamp(logger.Test(t), utils.RandomAddress(), nil, lpmocks.NewLogPoller(t), nil, nil) + feeEstimatorConfig := mocks.NewFeeEstimatorConfigReader(t) + + offRamp, err := v1_2_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, lpmocks.NewLogPoller(t), nil, nil, feeEstimatorConfig) require.NoError(t, err) ctx := testutils.Context(t) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go index 15c91235b92..a1e7f9e6346 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go @@ -197,7 +197,7 @@ func Test_LogsAreProperlyMarkedAsFinalized(t *testing.T) { lp.On("IndexedLogsTopicRange", mock.Anything, ExecutionStateChangedEvent, offrampAddress, 1, logpoller.EvmWord(minSeqNr), logpoller.EvmWord(maxSeqNr), evmtypes.Confirmations(0)). Return(inputLogs, nil) - offRamp, err := NewOffRamp(logger.Test(t), offrampAddress, evmclimocks.NewClient(t), lp, nil, nil) + offRamp, err := NewOffRamp(logger.Test(t), offrampAddress, evmclimocks.NewClient(t), lp, nil, nil, nil) require.NoError(t, err) logs, err := offRamp.GetExecutionStateChangesBetweenSeqNums(testutils.Context(t), minSeqNr, maxSeqNr, 0) require.NoError(t, err) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go index 52f241a30a6..4ae4eeb0d3e 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go @@ -2,6 +2,7 @@ package v1_2_0 import ( "context" + "errors" "fmt" "strings" @@ -13,7 +14,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/hashutil" "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" @@ -50,16 +50,16 @@ var _ ccipdata.OnRampReader = &OnRamp{} // Significant change in 1.2: // - CCIPSendRequested event signature has changed type OnRamp struct { - onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp - address common.Address - lggr logger.Logger - lp logpoller.LogPoller - leafHasher ccipdata.LeafHasherInterface[[32]byte] - client client.Client - sendRequestedEventSig common.Hash - sendRequestedSeqNumberWord int - filters []logpoller.Filter - cachedSourcePriceRegistryAddress cache.AutoSync[cciptypes.Address] + onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp + address common.Address + lggr logger.Logger + lp logpoller.LogPoller + leafHasher ccipdata.LeafHasherInterface[[32]byte] + client client.Client + sendRequestedEventSig common.Hash + sendRequestedSeqNumberWord int + filters []logpoller.Filter + cachedOnRampDynamicConfig cache.AutoSync[cciptypes.OnRampDynamicConfig] // Static config can be cached, because it's never expected to change. // The only way to change that is through the contract's constructor (redeployment) cachedStaticConfig cache.OnceCtxFunction[evm_2_evm_onramp_1_2_0.EVM2EVMOnRampStaticConfig] @@ -108,7 +108,7 @@ func NewOnRamp(lggr logger.Logger, sourceSelector, destSelector uint64, onRampAd address: onRampAddress, sendRequestedSeqNumberWord: CCIPSendRequestSeqNumIndex, sendRequestedEventSig: CCIPSendRequestEventSig, - cachedSourcePriceRegistryAddress: cache.NewLogpollerEventsBased[cciptypes.Address]( + cachedOnRampDynamicConfig: cache.NewLogpollerEventsBased[cciptypes.OnRampDynamicConfig]( sourceLP, []common.Hash{ConfigSetEventSig}, onRampAddress, @@ -122,38 +122,39 @@ func (o *OnRamp) Address(context.Context) (cciptypes.Address, error) { return cciptypes.Address(o.onRamp.Address().String()), nil } -func (o *OnRamp) GetDynamicConfig(context.Context) (cciptypes.OnRampDynamicConfig, error) { - if o.onRamp == nil { - return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("onramp not initialized") - } - config, err := o.onRamp.GetDynamicConfig(&bind.CallOpts{}) - if err != nil { - return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("get dynamic config v1.2: %w", err) - } - return cciptypes.OnRampDynamicConfig{ - Router: cciptypes.Address(config.Router.String()), - MaxNumberOfTokensPerMsg: config.MaxNumberOfTokensPerMsg, - DestGasOverhead: config.DestGasOverhead, - DestGasPerPayloadByte: config.DestGasPerPayloadByte, - DestDataAvailabilityOverheadGas: config.DestDataAvailabilityOverheadGas, - DestGasPerDataAvailabilityByte: config.DestGasPerDataAvailabilityByte, - DestDataAvailabilityMultiplierBps: config.DestDataAvailabilityMultiplierBps, - PriceRegistry: cciptypes.Address(config.PriceRegistry.String()), - MaxDataBytes: config.MaxDataBytes, - MaxPerMsgGasLimit: config.MaxPerMsgGasLimit, - }, nil -} - -func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { - return o.cachedSourcePriceRegistryAddress.Get(ctx, func(ctx context.Context) (cciptypes.Address, error) { - c, err := o.GetDynamicConfig(ctx) +func (o *OnRamp) GetDynamicConfig(ctx context.Context) (cciptypes.OnRampDynamicConfig, error) { + return o.cachedOnRampDynamicConfig.Get(ctx, func(ctx context.Context) (cciptypes.OnRampDynamicConfig, error) { + if o.onRamp == nil { + return cciptypes.OnRampDynamicConfig{}, errors.New("onramp not initialized") + } + config, err := o.onRamp.GetDynamicConfig(&bind.CallOpts{Context: ctx}) if err != nil { - return "", err + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("get dynamic config v1.2: %w", err) } - return c.PriceRegistry, nil + + return cciptypes.OnRampDynamicConfig{ + Router: cciptypes.Address(config.Router.String()), + MaxNumberOfTokensPerMsg: config.MaxNumberOfTokensPerMsg, + DestGasOverhead: config.DestGasOverhead, + DestGasPerPayloadByte: config.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: config.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: config.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: config.DestDataAvailabilityMultiplierBps, + PriceRegistry: cciptypes.Address(config.PriceRegistry.String()), + MaxDataBytes: config.MaxDataBytes, + MaxPerMsgGasLimit: config.MaxPerMsgGasLimit, + }, nil }) } +func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + c, err := o.GetDynamicConfig(ctx) + if err != nil { + return "", err + } + return c.PriceRegistry, nil +} + func (o *OnRamp) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { logs, err := o.lp.LogsDataWordRange( ctx, diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go index bbdf52e23a4..ec912667ac7 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go @@ -8,12 +8,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ) @@ -21,7 +20,7 @@ func TestLogPollerClient_GetSendRequestsBetweenSeqNumsV1_2_0(t *testing.T) { onRampAddr := utils.RandomAddress() seqNum := uint64(100) limit := uint64(10) - lggr := logger.Test(t) + lggr := logger.TestLogger(t) tests := []struct { name string diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go index 636b37c9100..5818f095ea0 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go @@ -13,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go index fd768d4235c..a403139a015 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go @@ -3,6 +3,8 @@ package v1_5_0 import ( "context" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -41,8 +43,14 @@ func (c *CommitStore) IsDown(ctx context.Context) (bool, error) { return !unPausedAndNotCursed, nil } -func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller) (*CommitStore, error) { - v120, err := v1_2_0.NewCommitStore(lggr, addr, ec, lp) +func NewCommitStore( + lggr logger.Logger, + addr common.Address, + ec client.Client, + lp logpoller.LogPoller, + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader, +) (*CommitStore, error) { + v120, err := v1_2_0.NewCommitStore(lggr, addr, ec, lp, feeEstimatorConfig) if err != nil { return nil, err } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go index 0c45f0d6eac..d5e220c27b1 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go @@ -70,6 +70,7 @@ type OffRamp struct { *v1_2_0.OffRamp offRampV150 evm_2_evm_offramp.EVM2EVMOffRampInterface cachedRateLimitTokens cache.AutoSync[cciptypes.OffRampTokens] + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader } // GetTokens Returns no data as the offRamps no longer have this information. @@ -155,7 +156,7 @@ func (o *OffRamp) ChangeConfig(ctx context.Context, onchainConfigBytes []byte, o PermissionLessExecutionThresholdSeconds: time.Second * time.Duration(onchainConfigParsed.PermissionLessExecutionThresholdSeconds), Router: cciptypes.Address(onchainConfigParsed.Router.String()), } - priceEstimator := prices.NewDAGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0, 0) + priceEstimator := prices.NewDAGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0, 0, o.feeEstimatorConfig) o.UpdateDynamicConfig(onchainConfig, offchainConfig, priceEstimator) @@ -166,8 +167,16 @@ func (o *OffRamp) ChangeConfig(ctx context.Context, onchainConfigBytes []byte, o cciptypes.Address(destWrappedNative.String()), nil } -func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) (*OffRamp, error) { - v120, err := v1_2_0.NewOffRamp(lggr, addr, ec, lp, estimator, destMaxGasPrice) +func NewOffRamp( + lggr logger.Logger, + addr common.Address, + ec client.Client, + lp logpoller.LogPoller, + estimator gas.EvmFeeEstimator, + destMaxGasPrice *big.Int, + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader, +) (*OffRamp, error) { + v120, err := v1_2_0.NewOffRamp(lggr, addr, ec, lp, estimator, destMaxGasPrice, feeEstimatorConfig) if err != nil { return nil, err } @@ -180,8 +189,9 @@ func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp lo v120.ExecutionReportArgs = abihelpers.MustGetMethodInputs("manuallyExecute", abiOffRamp)[:1] return &OffRamp{ - OffRamp: v120, - offRampV150: offRamp, + feeEstimatorConfig: feeEstimatorConfig, + OffRamp: v120, + offRampV150: offRamp, cachedRateLimitTokens: cache.NewLogpollerEventsBased[cciptypes.OffRampTokens]( lp, []common.Hash{RateLimitTokenAddedEvent, RateLimitTokenRemovedEvent}, diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go index da41d116bc8..6329c8af672 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go @@ -2,6 +2,7 @@ package v1_5_0 import ( "context" + "errors" "fmt" "strings" @@ -50,17 +51,17 @@ func init() { var _ ccipdata.OnRampReader = &OnRamp{} type OnRamp struct { - onRamp *evm_2_evm_onramp.EVM2EVMOnRamp - address common.Address - destChainSelectorBytes [16]byte - lggr logger.Logger - lp logpoller.LogPoller - leafHasher ccipdata.LeafHasherInterface[[32]byte] - client client.Client - sendRequestedEventSig common.Hash - sendRequestedSeqNumberWord int - filters []logpoller.Filter - cachedSourcePriceRegistryAddress cache.AutoSync[cciptypes.Address] + onRamp *evm_2_evm_onramp.EVM2EVMOnRamp + address common.Address + destChainSelectorBytes [16]byte + lggr logger.Logger + lp logpoller.LogPoller + leafHasher ccipdata.LeafHasherInterface[[32]byte] + client client.Client + sendRequestedEventSig common.Hash + sendRequestedSeqNumberWord int + filters []logpoller.Filter + cachedOnRampDynamicConfig cache.AutoSync[cciptypes.OnRampDynamicConfig] // Static config can be cached, because it's never expected to change. // The only way to change that is through the contract's constructor (redeployment) cachedStaticConfig cache.OnceCtxFunction[evm_2_evm_onramp.EVM2EVMOnRampStaticConfig] @@ -112,7 +113,7 @@ func NewOnRamp(lggr logger.Logger, sourceSelector, destSelector uint64, onRampAd address: onRampAddress, sendRequestedSeqNumberWord: CCIPSendRequestSeqNumIndex, sendRequestedEventSig: CCIPSendRequestEventSig, - cachedSourcePriceRegistryAddress: cache.NewLogpollerEventsBased[cciptypes.Address]( + cachedOnRampDynamicConfig: cache.NewLogpollerEventsBased[cciptypes.OnRampDynamicConfig]( sourceLP, []common.Hash{ConfigSetEventSig}, onRampAddress, @@ -126,38 +127,39 @@ func (o *OnRamp) Address(context.Context) (cciptypes.Address, error) { return ccipcalc.EvmAddrToGeneric(o.onRamp.Address()), nil } -func (o *OnRamp) GetDynamicConfig(context.Context) (cciptypes.OnRampDynamicConfig, error) { - if o.onRamp == nil { - return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("onramp not initialized") - } - config, err := o.onRamp.GetDynamicConfig(&bind.CallOpts{}) - if err != nil { - return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("get dynamic config v1.5: %w", err) - } - return cciptypes.OnRampDynamicConfig{ - Router: ccipcalc.EvmAddrToGeneric(config.Router), - MaxNumberOfTokensPerMsg: config.MaxNumberOfTokensPerMsg, - DestGasOverhead: config.DestGasOverhead, - DestGasPerPayloadByte: config.DestGasPerPayloadByte, - DestDataAvailabilityOverheadGas: config.DestDataAvailabilityOverheadGas, - DestGasPerDataAvailabilityByte: config.DestGasPerDataAvailabilityByte, - DestDataAvailabilityMultiplierBps: config.DestDataAvailabilityMultiplierBps, - PriceRegistry: ccipcalc.EvmAddrToGeneric(config.PriceRegistry), - MaxDataBytes: config.MaxDataBytes, - MaxPerMsgGasLimit: config.MaxPerMsgGasLimit, - }, nil -} - -func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { - return o.cachedSourcePriceRegistryAddress.Get(ctx, func(ctx context.Context) (cciptypes.Address, error) { - c, err := o.GetDynamicConfig(ctx) +func (o *OnRamp) GetDynamicConfig(ctx context.Context) (cciptypes.OnRampDynamicConfig, error) { + return o.cachedOnRampDynamicConfig.Get(ctx, func(ctx context.Context) (cciptypes.OnRampDynamicConfig, error) { + if o.onRamp == nil { + return cciptypes.OnRampDynamicConfig{}, errors.New("onramp not initialized") + } + config, err := o.onRamp.GetDynamicConfig(&bind.CallOpts{}) if err != nil { - return "", err + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("get dynamic config v1.5: %w", err) } - return c.PriceRegistry, nil + + return cciptypes.OnRampDynamicConfig{ + Router: ccipcalc.EvmAddrToGeneric(config.Router), + MaxNumberOfTokensPerMsg: config.MaxNumberOfTokensPerMsg, + DestGasOverhead: config.DestGasOverhead, + DestGasPerPayloadByte: config.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: config.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: config.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: config.DestDataAvailabilityMultiplierBps, + PriceRegistry: ccipcalc.EvmAddrToGeneric(config.PriceRegistry), + MaxDataBytes: config.MaxDataBytes, + MaxPerMsgGasLimit: config.MaxPerMsgGasLimit, + }, nil }) } +func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + c, err := o.GetDynamicConfig(ctx) + if err != nil { + return "", err + } + return c.PriceRegistry, nil +} + func (o *OnRamp) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { logs, err := o.lp.LogsDataWordRange( ctx, diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go index 277b8fd9003..65fccb7821c 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" @@ -20,6 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" @@ -29,7 +29,7 @@ func TestLogPollerClient_GetSendRequestsBetweenSeqNums1_4_0(t *testing.T) { onRampAddr := utils.RandomAddress() seqNum := uint64(100) limit := uint64(10) - lggr := logger.Test(t) + lggr := logger.TestLogger(t) tests := []struct { name string @@ -72,7 +72,7 @@ func Test_ProperlyRecognizesPerLaneCurses(t *testing.T) { sourceChainSelector := uint64(200) onRampAddress, mockRMN, mockRMNAddress := setupOnRampV1_5_0(t, user, bc) - onRamp, err := NewOnRamp(logger.Test(t), 1, destChainSelector, onRampAddress, mocks.NewLogPoller(t), bc) + onRamp, err := NewOnRamp(logger.TestLogger(t), 1, destChainSelector, onRampAddress, mocks.NewLogPoller(t), bc) require.NoError(t, err) onRamp.cachedStaticConfig = func(ctx context.Context) (evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, error) { @@ -121,7 +121,7 @@ func BenchmarkIsSourceCursedWithCache(b *testing.B) { destChainSelector := uint64(100) onRampAddress, _, _ := setupOnRampV1_5_0(b, user, bc) - onRamp, err := NewOnRamp(logger.Test(b), 1, destChainSelector, onRampAddress, mocks.NewLogPoller(b), bc) + onRamp, err := NewOnRamp(logger.TestLogger(b), 1, destChainSelector, onRampAddress, mocks.NewLogPoller(b), bc) require.NoError(b, err) for i := 0; i < b.N; i++ { diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go index ac4002f53fb..732bbb6be4c 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go @@ -7,20 +7,23 @@ import ( "math/big" "strings" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "go.uber.org/multierr" + "github.com/smartcontractkit/chainlink-common/pkg/types" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/aggregator_v3_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/gethwrappers2/generated/offchainaggregator" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" ) -const decimalsMethodName = "decimals" -const latestRoundDataMethodName = "latestRoundData" +const OffchainAggregator = "OffchainAggregator" +const DecimalsMethodName = "decimals" +const LatestRoundDataMethodName = "latestRoundData" func init() { // Ensure existence of latestRoundData method on the Aggregator contract. @@ -28,8 +31,8 @@ func init() { if err != nil { panic(err) } - ensureMethodOnContract(aggregatorABI, decimalsMethodName) - ensureMethodOnContract(aggregatorABI, latestRoundDataMethodName) + ensureMethodOnContract(aggregatorABI, DecimalsMethodName) + ensureMethodOnContract(aggregatorABI, LatestRoundDataMethodName) } func ensureMethodOnContract(abi abi.ABI, methodName string) { @@ -49,9 +52,9 @@ func NewDynamicPriceGetterClient(batchCaller rpclib.EvmBatchCaller) DynamicPrice } type DynamicPriceGetter struct { - cfg config.DynamicPriceGetterConfig - evmClients map[uint64]DynamicPriceGetterClient - aggregatorAbi abi.ABI + cfg config.DynamicPriceGetterConfig + contractReaders map[uint64]types.ContractReader + aggregatorAbi abi.ABI } func NewDynamicPriceGetterConfig(configJson string) (config.DynamicPriceGetterConfig, error) { @@ -69,7 +72,7 @@ func NewDynamicPriceGetterConfig(configJson string) (config.DynamicPriceGetterCo // NewDynamicPriceGetter build a DynamicPriceGetter from a configuration and a map of chain ID to batch callers. // A batch caller should be provided for all retrieved prices. -func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, evmClients map[uint64]DynamicPriceGetterClient) (*DynamicPriceGetter, error) { +func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, contractReaders map[uint64]types.ContractReader) (*DynamicPriceGetter, error) { if err := cfg.Validate(); err != nil { return nil, fmt.Errorf("validating dynamic price getter config: %w", err) } @@ -77,13 +80,13 @@ func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, evmClients map[u if err != nil { return nil, fmt.Errorf("parsing offchainaggregator abi: %w", err) } - priceGetter := DynamicPriceGetter{cfg, evmClients, aggregatorAbi} + priceGetter := DynamicPriceGetter{cfg, contractReaders, aggregatorAbi} return &priceGetter, nil } // FilterConfiguredTokens implements the PriceGetter interface. // It filters a list of token addresses for only those that have a price resolution rule configured on the PriceGetterConfig -func (d *DynamicPriceGetter) FilterConfiguredTokens(ctx context.Context, tokens []cciptypes.Address) (configured []cciptypes.Address, unconfigured []cciptypes.Address, err error) { +func (d *DynamicPriceGetter) FilterConfiguredTokens(_ context.Context, tokens []cciptypes.Address) (configured []cciptypes.Address, unconfigured []cciptypes.Address, err error) { configured = []cciptypes.Address{} unconfigured = []cciptypes.Address{} for _, tk := range tokens { @@ -103,7 +106,7 @@ func (d *DynamicPriceGetter) FilterConfiguredTokens(ctx context.Context, tokens return configured, unconfigured, nil } -// It returns the prices of all tokens defined in the price getter. +// GetJobSpecTokenPricesUSD returns the prices of all tokens defined in the price getter. func (d *DynamicPriceGetter) GetJobSpecTokenPricesUSD(ctx context.Context) (map[cciptypes.Address]*big.Int, error) { return d.TokenPricesUSD(ctx, d.getAllTokensDefined()) } @@ -144,60 +147,113 @@ func (d *DynamicPriceGetter) performBatchCalls(ctx context.Context, batchCallsPe } // performBatchCall performs a batch call on a given chain to retrieve token prices. -func (d *DynamicPriceGetter) performBatchCall(ctx context.Context, chainID uint64, batchCalls *batchCallsForChain, prices map[cciptypes.Address]*big.Int) error { - // Retrieve the EVM caller for the chain. - client, exists := d.evmClients[chainID] - if !exists { - return fmt.Errorf("evm caller for chain %d not found", chainID) - } - evmCaller := client.BatchCaller - +func (d *DynamicPriceGetter) performBatchCall(ctx context.Context, chainID uint64, batchCalls *batchCallsForChain, prices map[cciptypes.Address]*big.Int) (err error) { nbDecimalCalls := len(batchCalls.decimalCalls) nbLatestRoundDataCalls := len(batchCalls.decimalCalls) + nbCalls := len(batchCalls.decimalCalls) - // Perform batched call (all decimals calls followed by latest round data calls). - calls := make([]rpclib.EvmCall, 0, nbDecimalCalls+nbLatestRoundDataCalls) - calls = append(calls, batchCalls.decimalCalls...) - calls = append(calls, batchCalls.latestRoundDataCalls...) + // Retrieve contract reader for the chain + contractReader := d.contractReaders[chainID] - results, err := evmCaller.BatchCall(ctx, 0, calls) + // Bind contract reader to the contract addresses necessary for the batch calls + bindings := make([]types.BoundContract, 0) + for i, call := range batchCalls.decimalCalls { + bindings = append(bindings, types.BoundContract{ + Address: string(ccipcalc.EvmAddrToGeneric(call.ContractAddress())), + Name: fmt.Sprintf("%v_%v", OffchainAggregator, i), + }) + } + + err = contractReader.Bind(ctx, bindings) if err != nil { - return fmt.Errorf("batch call on chain %d failed: %w", chainID, err) + return fmt.Errorf("binding contracts failed: %w", err) } - // Extract results. - decimals := make([]uint8, 0, nbDecimalCalls) - latestRounds := make([]*big.Int, 0, nbLatestRoundDataCalls) + // Construct request, adding a decimals and latestRound req per contract name + var decimalsReq uint8 + batchGetLatestValuesRequest := make(types.BatchGetLatestValuesRequest) + for i, call := range batchCalls.decimalCalls { + boundContract := types.BoundContract{ + Address: call.ContractAddress().Hex(), + Name: fmt.Sprintf("%v_%v", OffchainAggregator, i), + } + batchGetLatestValuesRequest[boundContract] = append(batchGetLatestValuesRequest[boundContract], types.BatchRead{ + ReadName: call.MethodName(), + ReturnVal: &decimalsReq, + }) + } - for i, res := range results[0:nbDecimalCalls] { - v, err1 := rpclib.ParseOutput[uint8](res, 0) - if err1 != nil { - callSignature := batchCalls.decimalCalls[i].String() - return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err1) + for i, call := range batchCalls.latestRoundDataCalls { + boundContract := types.BoundContract{ + Address: call.ContractAddress().Hex(), + Name: fmt.Sprintf("%v_%v", OffchainAggregator, i), } - decimals = append(decimals, v) + batchGetLatestValuesRequest[boundContract] = append(batchGetLatestValuesRequest[boundContract], types.BatchRead{ + ReadName: call.MethodName(), + ReturnVal: &aggregator_v3_interface.LatestRoundData{}, + }) + } + + // Perform call + result, err2 := contractReader.BatchGetLatestValues(ctx, batchGetLatestValuesRequest) + if err2 != nil { + return fmt.Errorf("BatchGetLatestValues failed %w", err2) } - for i, res := range results[nbDecimalCalls : nbDecimalCalls+nbLatestRoundDataCalls] { - // latestRoundData function has multiple outputs (roundId,answer,startedAt,updatedAt,answeredInRound). - // we want the second one (answer, at idx=1). - v, err1 := rpclib.ParseOutput[*big.Int](res, 1) - if err1 != nil { - callSignature := batchCalls.latestRoundDataCalls[i].String() - return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err1) + // Extract results + // give result the contract name (key ordering not guaranteed to match that of the request) + // and then you get slice of responses + decimalsCR := make([]uint8, 0, nbDecimalCalls) + latestRoundCR := make([]aggregator_v3_interface.LatestRoundData, 0, nbDecimalCalls) + var respErr error + for j := range nbCalls { + boundContract := types.BoundContract{ + Address: batchCalls.decimalCalls[j].ContractAddress().Hex(), + Name: fmt.Sprintf("%v_%v", OffchainAggregator, j), } - latestRounds = append(latestRounds, v) + offchainAggregatorRespSlice := result[boundContract] + + for _, read := range offchainAggregatorRespSlice { + val, readErr := read.GetResult() + if readErr != nil { + respErr = multierr.Append(respErr, fmt.Errorf("error with contract reader readName %v: %w", read.ReadName, readErr)) + continue + } + if read.ReadName == DecimalsMethodName { + decimal, ok := val.(*uint8) + if !ok { + return fmt.Errorf("expected type uint8 for method call %v on contract %v: %w", batchCalls.decimalCalls[j].MethodName(), batchCalls.decimalCalls[j].ContractAddress(), readErr) + } + + decimalsCR = append(decimalsCR, *decimal) + } else if read.ReadName == LatestRoundDataMethodName { + latestRoundDataRes, ok := val.(*aggregator_v3_interface.LatestRoundData) + if !ok { + return fmt.Errorf("expected type latestRoundDataConfig for method call %v on contract %v: %w", batchCalls.latestRoundDataCalls[j].MethodName(), batchCalls.latestRoundDataCalls[j].ContractAddress(), readErr) + } + + latestRoundCR = append(latestRoundCR, *latestRoundDataRes) + } + } + } + if respErr != nil { + return respErr + } + + latestRoundAnswerCR := make([]*big.Int, 0, nbLatestRoundDataCalls) + for i := range nbLatestRoundDataCalls { + latestRoundAnswerCR = append(latestRoundAnswerCR, latestRoundCR[i].Answer) } // Normalize and store prices. for i := range batchCalls.tokenOrder { // Normalize to 1e18. - if decimals[i] < 18 { - latestRounds[i].Mul(latestRounds[i], big.NewInt(0).Exp(big.NewInt(10), big.NewInt(18-int64(decimals[i])), nil)) - } else if decimals[i] > 18 { - latestRounds[i].Div(latestRounds[i], big.NewInt(0).Exp(big.NewInt(10), big.NewInt(int64(decimals[i])-18), nil)) + if decimalsCR[i] < 18 { + latestRoundAnswerCR[i].Mul(latestRoundAnswerCR[i], big.NewInt(0).Exp(big.NewInt(10), big.NewInt(18-int64(decimalsCR[i])), nil)) + } else if decimalsCR[i] > 18 { + latestRoundAnswerCR[i].Div(latestRoundAnswerCR[i], big.NewInt(0).Exp(big.NewInt(10), big.NewInt(int64(decimalsCR[i])-18), nil)) } - prices[ccipcalc.EvmAddrToGeneric(batchCalls.tokenOrder[i])] = latestRounds[i] + prices[ccipcalc.EvmAddrToGeneric(batchCalls.tokenOrder[i])] = latestRoundAnswerCR[i] } return nil } @@ -225,12 +281,12 @@ func (d *DynamicPriceGetter) preparePricesAndBatchCallsPerChain(tokens []cciptyp chainCalls := batchCallsPerChain[aggCfg.ChainID] chainCalls.decimalCalls = append(chainCalls.decimalCalls, rpclib.NewEvmCall( d.aggregatorAbi, - decimalsMethodName, + DecimalsMethodName, aggCfg.AggregatorContractAddress, )) chainCalls.latestRoundDataCalls = append(chainCalls.latestRoundDataCalls, rpclib.NewEvmCall( d.aggregatorAbi, - latestRoundDataMethodName, + LatestRoundDataMethodName, aggCfg.AggregatorContractAddress, )) chainCalls.tokenOrder = append(chainCalls.tokenOrder, tk) diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go index bff4bf16a10..ada59d68573 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go @@ -1,12 +1,15 @@ package pricegetter import ( + "context" + "fmt" "math/big" "testing" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" @@ -16,13 +19,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" ) type testParameters struct { cfg config.DynamicPriceGetterConfig - evmClients map[uint64]DynamicPriceGetterClient + contractReaders map[uint64]types.ContractReader tokens []common.Address expectedTokenPrices map[common.Address]big.Int expectedTokenPricesForAll map[common.Address]big.Int @@ -92,13 +93,13 @@ func TestDynamicPriceGetterWithEmptyInput(t *testing.T) { }, { name: "get_all_tokens_static_only", - param: testGetAllTokensStaticOnly(), + param: testGetAllTokensStaticOnly(t), }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - pg, err := NewDynamicPriceGetter(test.param.cfg, test.param.evmClients) + pg, err := NewDynamicPriceGetter(test.param.cfg, test.param.contractReaders) if test.param.invalidConfigErrorExpected { require.Error(t, err) return @@ -194,11 +195,11 @@ func testParamAggregatorOnly(t *testing.T) testParameters { UpdatedAt: big.NewInt(1715753907), AnsweredInRound: big.NewInt(4000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), - uint64(103): mockClient(t, []uint8{18}, []aggregator_v3_interface.LatestRoundData{round3}), - uint64(104): mockClient(t, []uint8{20}, []aggregator_v3_interface.LatestRoundData{round4}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockCR([]uint8{18}, cfg, []common.Address{TK3}, []aggregator_v3_interface.LatestRoundData{round3}), + uint64(104): mockCR([]uint8{20}, cfg, []common.Address{TK4}, []aggregator_v3_interface.LatestRoundData{round4}), } expectedTokenPrices := map[common.Address]big.Int{ TK1: *multExp(round1.Answer, 10), // expected in 1e18 format. @@ -208,7 +209,7 @@ func testParamAggregatorOnly(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, tokens: []common.Address{TK1, TK2, TK3, TK4}, expectedTokenPrices: expectedTokenPrices, invalidConfigErrorExpected: false, @@ -257,9 +258,9 @@ func testParamAggregatorOnlyMulti(t *testing.T) testParameters { UpdatedAt: big.NewInt(1704897198), AnsweredInRound: big.NewInt(3000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8, 8}, []aggregator_v3_interface.LatestRoundData{round2, round3}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8, 8}, cfg, []common.Address{TK2, TK3}, []aggregator_v3_interface.LatestRoundData{round2, round3}), } expectedTokenPrices := map[common.Address]big.Int{ TK1: *multExp(round1.Answer, 10), @@ -268,7 +269,7 @@ func testParamAggregatorOnlyMulti(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, invalidConfigErrorExpected: false, tokens: []common.Address{TK1, TK2, TK3}, expectedTokenPrices: expectedTokenPrices, @@ -294,7 +295,7 @@ func testParamStaticOnly() testParameters { }, } // Real LINK/USD example from OP. - evmClients := map[uint64]DynamicPriceGetterClient{} + contractReaders := map[uint64]types.ContractReader{} expectedTokenPrices := map[common.Address]big.Int{ TK1: *cfg.StaticPrices[TK1].Price, TK2: *cfg.StaticPrices[TK2].Price, @@ -302,7 +303,7 @@ func testParamStaticOnly() testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, tokens: []common.Address{TK1, TK2, TK3}, expectedTokenPrices: expectedTokenPrices, } @@ -343,9 +344,9 @@ func testParamNoAggregatorForToken(t *testing.T) testParameters { UpdatedAt: big.NewInt(1704897197), AnsweredInRound: big.NewInt(2000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), } expectedTokenPrices := map[common.Address]big.Int{ TK1: *round1.Answer, @@ -355,7 +356,7 @@ func testParamNoAggregatorForToken(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, tokens: []common.Address{TK1, TK2, TK3, TK4}, expectedTokenPrices: expectedTokenPrices, priceResolutionErrorExpected: true, @@ -397,9 +398,9 @@ func testParamAggregatorAndStaticValid(t *testing.T) testParameters { UpdatedAt: big.NewInt(1704897197), AnsweredInRound: big.NewInt(2000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), } expectedTokenPrices := map[common.Address]big.Int{ TK1: *multExp(round1.Answer, 10), @@ -408,7 +409,7 @@ func testParamAggregatorAndStaticValid(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, tokens: []common.Address{TK1, TK2, TK3}, expectedTokenPrices: expectedTokenPrices, } @@ -460,14 +461,14 @@ func testParamAggregatorAndStaticTokenCollision(t *testing.T) testParameters { UpdatedAt: big.NewInt(1704897198), AnsweredInRound: big.NewInt(3000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), - uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockCR([]uint8{8}, cfg, []common.Address{TK3}, []aggregator_v3_interface.LatestRoundData{round3}), } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, tokens: []common.Address{TK1, TK2, TK3}, invalidConfigErrorExpected: true, } @@ -500,17 +501,15 @@ func testParamBatchCallReturnsErr(t *testing.T) testParameters { UpdatedAt: big.NewInt(1704896575), AnsweredInRound: big.NewInt(1000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): { - BatchCaller: mockErrCaller(t), - }, + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockErrCR(), } return testParameters{ - cfg: cfg, - evmClients: evmClients, - tokens: []common.Address{TK1, TK2, TK3}, - evmCallErr: true, + cfg: cfg, + contractReaders: contractReaders, + tokens: []common.Address{TK1, TK2, TK3}, + evmCallErr: true, } } @@ -561,10 +560,10 @@ func testLessInputsThanDefinedPrices(t *testing.T) testParameters { UpdatedAt: big.NewInt(1715743907), AnsweredInRound: big.NewInt(3000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), - uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockCR([]uint8{8}, cfg, []common.Address{TK3}, []aggregator_v3_interface.LatestRoundData{round3}), } expectedTokenPrices := map[common.Address]big.Int{ TK1: *multExp(round1.Answer, 10), @@ -573,7 +572,7 @@ func testLessInputsThanDefinedPrices(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, tokens: []common.Address{TK1, TK2, TK3}, expectedTokenPrices: expectedTokenPrices, } @@ -626,10 +625,11 @@ func testGetAllTokensAggregatorAndStatic(t *testing.T) testParameters { UpdatedAt: big.NewInt(1715743907), AnsweredInRound: big.NewInt(3000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), - uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockCR([]uint8{8}, cfg, []common.Address{TK3}, []aggregator_v3_interface.LatestRoundData{round3}), } expectedTokenPricesForAll := map[common.Address]big.Int{ TK1: *multExp(round1.Answer, 10), @@ -639,8 +639,8 @@ func testGetAllTokensAggregatorAndStatic(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, expectedTokenPricesForAll: expectedTokenPricesForAll, + contractReaders: contractReaders, } } @@ -686,11 +686,12 @@ func testGetAllTokensAggregatorOnly(t *testing.T) testParameters { UpdatedAt: big.NewInt(1715743907), AnsweredInRound: big.NewInt(3000), } - evmClients := map[uint64]DynamicPriceGetterClient{ - uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), - uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), - uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + contractReaders := map[uint64]types.ContractReader{ + uint64(101): mockCR([]uint8{8}, cfg, []common.Address{TK1}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockCR([]uint8{8}, cfg, []common.Address{TK2}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockCR([]uint8{8}, cfg, []common.Address{TK3}, []aggregator_v3_interface.LatestRoundData{round3}), } + expectedTokenPricesForAll := map[common.Address]big.Int{ TK1: *multExp(round1.Answer, 10), TK2: *multExp(round2.Answer, 10), @@ -698,12 +699,12 @@ func testGetAllTokensAggregatorOnly(t *testing.T) testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, expectedTokenPricesForAll: expectedTokenPricesForAll, + contractReaders: contractReaders, } } -func testGetAllTokensStaticOnly() testParameters { +func testGetAllTokensStaticOnly(t *testing.T) testParameters { cfg := config.DynamicPriceGetterConfig{ AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{}, StaticPrices: map[common.Address]config.StaticPriceConfig{ @@ -722,7 +723,7 @@ func testGetAllTokensStaticOnly() testParameters { }, } - evmClients := map[uint64]DynamicPriceGetterClient{} + contractReaders := map[uint64]types.ContractReader{} expectedTokenPricesForAll := map[common.Address]big.Int{ TK1: *cfg.StaticPrices[TK1].Price, TK2: *cfg.StaticPrices[TK2].Price, @@ -730,43 +731,73 @@ func testGetAllTokensStaticOnly() testParameters { } return testParameters{ cfg: cfg, - evmClients: evmClients, + contractReaders: contractReaders, expectedTokenPricesForAll: expectedTokenPricesForAll, } } -func mockClient(t *testing.T, decimals []uint8, rounds []aggregator_v3_interface.LatestRoundData) DynamicPriceGetterClient { - return DynamicPriceGetterClient{ - BatchCaller: mockCaller(t, decimals, rounds), - } -} - -func mockCaller(t *testing.T, decimals []uint8, rounds []aggregator_v3_interface.LatestRoundData) *rpclibmocks.EvmBatchCaller { - caller := rpclibmocks.NewEvmBatchCaller(t) - +func mockCR(decimals []uint8, cfg config.DynamicPriceGetterConfig, addr []common.Address, rounds []aggregator_v3_interface.LatestRoundData) *mockContractReader { // Mock batch calls per chain: all decimals calls then all latestRoundData calls. - dataAndErrs := make([]rpclib.DataAndErr, 0, len(decimals)+len(rounds)) - for _, d := range decimals { - dataAndErrs = append(dataAndErrs, rpclib.DataAndErr{ - Outputs: []any{d}, - }) + bGLVR := make(types.BatchGetLatestValuesResult) + + for i := range len(decimals) { + boundContract := types.BoundContract{ + Address: cfg.AggregatorPrices[addr[i]].AggregatorContractAddress.Hex(), + Name: fmt.Sprintf("%v_%v", OffchainAggregator, i), + } + bGLVR[boundContract] = types.ContractBatchResults{} + } + for i, d := range decimals { + contractName := fmt.Sprintf("%v_%v", OffchainAggregator, i) + readRes := types.BatchReadResult{ + ReadName: DecimalsMethodName, + } + readRes.SetResult(&d, nil) + boundContract := types.BoundContract{ + Address: cfg.AggregatorPrices[addr[i]].AggregatorContractAddress.Hex(), + Name: contractName, + } + bGLVR[boundContract] = append(bGLVR[boundContract], readRes) } - for _, round := range rounds { - dataAndErrs = append(dataAndErrs, rpclib.DataAndErr{ - Outputs: []any{round.RoundId, round.Answer, round.StartedAt, round.UpdatedAt, round.AnsweredInRound}, - }) + + for i, r := range rounds { + contractName := fmt.Sprintf("%v_%v", OffchainAggregator, i) + readRes := types.BatchReadResult{ + ReadName: LatestRoundDataMethodName, + } + readRes.SetResult(&r, nil) + boundContract := types.BoundContract{ + Address: cfg.AggregatorPrices[addr[i]].AggregatorContractAddress.Hex(), + Name: contractName, + } + bGLVR[boundContract] = append(bGLVR[boundContract], readRes) } - caller.On("BatchCall", mock.Anything, uint64(0), mock.Anything).Return(dataAndErrs, nil).Maybe() - return caller + + return &mockContractReader{result: bGLVR} } -func mockErrCaller(t *testing.T) *rpclibmocks.EvmBatchCaller { - caller := rpclibmocks.NewEvmBatchCaller(t) - caller.On("BatchCall", mock.Anything, uint64(0), mock.Anything).Return(nil, assert.AnError).Maybe() - return caller +func mockErrCR() *mockContractReader { + return &mockContractReader{err: assert.AnError} } // multExp returns the result of multiplying x by 10^e. func multExp(x *big.Int, e int64) *big.Int { return big.NewInt(0).Mul(x, big.NewInt(0).Exp(big.NewInt(10), big.NewInt(e), nil)) } + +type mockContractReader struct { + types.UnimplementedContractReader + result types.BatchGetLatestValuesResult + err error +} + +func (m *mockContractReader) Bind(context.Context, []types.BoundContract) error { + return nil +} + +func (m *mockContractReader) BatchGetLatestValues(context.Context, types.BatchGetLatestValuesRequest) (types.BatchGetLatestValuesResult, error) { + if m.err != nil { + return nil, m.err + } + return m.result, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go index 34977eda9f1..b9effffda15 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go @@ -10,8 +10,8 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/parseutil" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go b/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go index 6c4aabb4355..9fac4595464 100644 --- a/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go @@ -280,6 +280,10 @@ func (c EvmCall) String() string { return fmt.Sprintf("%s: %s(%+v)", c.contractAddress.String(), c.methodName, c.args) } +func (c EvmCall) ContractAddress() common.Address { + return c.contractAddress +} + func EVMCallsToString(calls []EvmCall) string { callString := "" for _, call := range calls { diff --git a/core/services/ocr2/plugins/ccip/metrics.go b/core/services/ocr2/plugins/ccip/metrics.go index f481b5d447d..9ec9fde316e 100644 --- a/core/services/ocr2/plugins/ccip/metrics.go +++ b/core/services/ocr2/plugins/ccip/metrics.go @@ -20,6 +20,10 @@ var ( Name: "ccip_sequence_number_counter", Help: "Sequence number of the last message processed by the plugin", }, []string{"plugin", "source", "dest", "ocrPhase"}) + newReportingPluginErrorCounter = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_new_reporting_plugin_error_counter", + Help: "The count of the number of errors when calling NewReportingPlugin", + }, []string{"plugin"}) ) type ocrPhase string @@ -35,6 +39,7 @@ type PluginMetricsCollector interface { NumberOfMessagesBasedOnInterval(phase ocrPhase, seqNrMin, seqNrMax uint64) UnexpiredCommitRoots(count int) SequenceNumber(phase ocrPhase, seqNr uint64) + NewReportingPluginError() } type pluginMetricsCollector struct { @@ -79,6 +84,12 @@ func (p *pluginMetricsCollector) SequenceNumber(phase ocrPhase, seqNr uint64) { Set(float64(seqNr)) } +func (p *pluginMetricsCollector) NewReportingPluginError() { + newReportingPluginErrorCounter. + WithLabelValues(p.pluginName). + Inc() +} + var ( // NoopMetricsCollector is a no-op implementation of PluginMetricsCollector NoopMetricsCollector PluginMetricsCollector = noop{} @@ -97,3 +108,6 @@ func (d noop) UnexpiredCommitRoots(int) { func (d noop) SequenceNumber(ocrPhase, uint64) { } + +func (d noop) NewReportingPluginError() { +} diff --git a/core/services/ocr2/plugins/ccip/observations.go b/core/services/ocr2/plugins/ccip/observations.go index f79d667a550..29fa85021fe 100644 --- a/core/services/ocr2/plugins/ccip/observations.go +++ b/core/services/ocr2/plugins/ccip/observations.go @@ -19,6 +19,10 @@ import ( // Note if a breaking change is introduced to this struct nodes running different versions // will not be able to unmarshal each other's observations. Do not modify unless you // know what you are doing. +// +// IMPORTANT: Both CommitObservation and ExecutionObservation are streamed and processed by Atlas. +// Any change to that struct must be reflected in the Atlas codebase. +// Additionally, you must test if OTI telemetry ingestion works with the new struct on staging environment. type CommitObservation struct { Interval cciptypes.CommitStoreInterval `json:"interval"` TokenPricesUSD map[cciptypes.Address]*big.Int `json:"tokensPerFeeCoin"` @@ -47,6 +51,10 @@ func (o CommitObservation) Marshal() ([]byte, error) { // Note if a breaking change is introduced to this struct nodes running different versions // will not be able to unmarshal each other's observations. Do not modify unless you // know what you are doing. +// +// IMPORTANT: Both CommitObservation and ExecutionObservation are streamed and processed by Atlas. +// Any change to that struct must be reflected in the Atlas codebase. +// Additionally, you must test if OTI telemetry ingestion works with the new struct on staging environment. type ExecutionObservation struct { Messages map[uint64]MsgData `json:"messages"` } diff --git a/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go b/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go index d0093e5d672..04002002f5c 100644 --- a/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go +++ b/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go @@ -5,6 +5,8 @@ import ( "fmt" "math/big" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" @@ -14,11 +16,9 @@ import ( type DAGasPriceEstimator struct { execEstimator GasPriceEstimator l1Oracle rollups.L1Oracle + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader priceEncodingLength uint daDeviationPPB int64 - daOverheadGas int64 - gasPerDAByte int64 - daMultiplier int64 } func NewDAGasPriceEstimator( @@ -26,12 +26,14 @@ func NewDAGasPriceEstimator( maxGasPrice *big.Int, deviationPPB int64, daDeviationPPB int64, + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader, // DA Config Cache updates in the onRamp reader and shares the state ) *DAGasPriceEstimator { return &DAGasPriceEstimator{ execEstimator: NewExecGasPriceEstimator(estimator, maxGasPrice, deviationPPB), l1Oracle: estimator.L1Oracle(), priceEncodingLength: daGasPriceEncodingLength, daDeviationPPB: daDeviationPPB, + feeEstimatorConfig: feeEstimatorConfig, } } @@ -54,7 +56,14 @@ func (g DAGasPriceEstimator) GetGasPrice(ctx context.Context) (*big.Int, error) return nil, err } - if daGasPrice := daGasPriceWei.ToInt(); daGasPrice.Cmp(big.NewInt(0)) > 0 { + daGasPrice := daGasPriceWei.ToInt() + + gasPrice, daGasPrice, err = g.feeEstimatorConfig.ModifyGasPriceComponents(ctx, gasPrice, daGasPrice) + if err != nil { + return nil, fmt.Errorf("gasPrice modification failed: %w", err) + } + + if daGasPrice.Cmp(big.NewInt(0)) > 0 { if daGasPrice.BitLen() > int(g.priceEncodingLength) { return nil, fmt.Errorf("data availability gas price exceeded max range %+v", daGasPrice) } @@ -141,7 +150,10 @@ func (g DAGasPriceEstimator) EstimateMsgCostUSD(ctx context.Context, p *big.Int, // If there is data availability price component, then include data availability cost in fee estimation if daGasPrice.Cmp(big.NewInt(0)) > 0 { - daGasCostUSD := g.estimateDACostUSD(daGasPrice, wrappedNativePrice, msg) + daGasCostUSD, err := g.estimateDACostUSD(daGasPrice, wrappedNativePrice, msg) + if err != nil { + return nil, err + } execCostUSD = new(big.Int).Add(daGasCostUSD, execCostUSD) } return execCostUSD, nil @@ -160,17 +172,22 @@ func (g DAGasPriceEstimator) parseEncodedGasPrice(p *big.Int) (*big.Int, *big.In return daGasPrice, execGasPrice, nil } -func (g DAGasPriceEstimator) estimateDACostUSD(daGasPrice *big.Int, wrappedNativePrice *big.Int, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) *big.Int { +func (g DAGasPriceEstimator) estimateDACostUSD(daGasPrice *big.Int, wrappedNativePrice *big.Int, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error) { var sourceTokenDataLen int for _, tokenData := range msg.SourceTokenData { sourceTokenDataLen += len(tokenData) } + daOverheadGas, gasPerDAByte, daMultiplier, err := g.feeEstimatorConfig.GetDataAvailabilityConfig(context.Background()) + if err != nil { + return nil, err + } + dataLen := evmMessageFixedBytes + len(msg.Data) + len(msg.TokenAmounts)*evmMessageBytesPerToken + sourceTokenDataLen - dataGas := big.NewInt(int64(dataLen)*g.gasPerDAByte + g.daOverheadGas) + dataGas := big.NewInt(int64(dataLen)*gasPerDAByte + daOverheadGas) dataGasEstimate := new(big.Int).Mul(dataGas, daGasPrice) - dataGasEstimate = new(big.Int).Div(new(big.Int).Mul(dataGasEstimate, big.NewInt(g.daMultiplier)), big.NewInt(daMultiplierBase)) + dataGasEstimate = new(big.Int).Div(new(big.Int).Mul(dataGasEstimate, big.NewInt(daMultiplier)), big.NewInt(daMultiplierBase)) - return ccipcalc.CalculateUsdPerUnitGas(dataGasEstimate, wrappedNativePrice) + return ccipcalc.CalculateUsdPerUnitGas(dataGasEstimate, wrappedNativePrice), nil } diff --git a/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go b/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go index 2772042f68d..aadf969eadd 100644 --- a/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go +++ b/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go @@ -2,16 +2,19 @@ package prices import ( "context" + "errors" "math/big" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups/mocks" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) func encodeGasPrice(daPrice, execPrice *big.Int) *big.Int { @@ -22,11 +25,13 @@ func TestDAPriceEstimator_GetGasPrice(t *testing.T) { ctx := context.Background() testCases := []struct { - name string - daGasPrice *big.Int - execGasPrice *big.Int - expPrice *big.Int - expErr bool + name string + daGasPrice *big.Int + execGasPrice *big.Int + expPrice *big.Int + modExecGasPrice *big.Int + modDAGasPrice *big.Int + expErr bool }{ { name: "base", @@ -56,6 +61,31 @@ func TestDAPriceEstimator_GetGasPrice(t *testing.T) { expPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), expErr: false, }, + { + name: "execGasPrice Modified", + daGasPrice: big.NewInt(1e9), + execGasPrice: big.NewInt(0), + modExecGasPrice: big.NewInt(1), + expPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(1)), + expErr: false, + }, + { + name: "daGasPrice Modified", + daGasPrice: big.NewInt(1e9), + execGasPrice: big.NewInt(0), + modDAGasPrice: big.NewInt(1), + expPrice: encodeGasPrice(big.NewInt(1), big.NewInt(0)), + expErr: false, + }, + { + name: "daGasPrice and execGasPrice Modified", + daGasPrice: big.NewInt(1e9), + execGasPrice: big.NewInt(0), + modDAGasPrice: big.NewInt(1), + modExecGasPrice: big.NewInt(2), + expPrice: encodeGasPrice(big.NewInt(1), big.NewInt(2)), + expErr: false, + }, { name: "price out of bounds", daGasPrice: new(big.Int).Lsh(big.NewInt(1), daGasPriceEncodingLength), @@ -73,10 +103,25 @@ func TestDAPriceEstimator_GetGasPrice(t *testing.T) { l1Oracle := mocks.NewL1Oracle(t) l1Oracle.On("GasPrice", ctx).Return(assets.NewWei(tc.daGasPrice), nil) + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + + modRespExecGasPrice := tc.execGasPrice + if tc.modExecGasPrice != nil { + modRespExecGasPrice = tc.modExecGasPrice + } + + modRespDAGasPrice := tc.daGasPrice + if tc.modDAGasPrice != nil { + modRespDAGasPrice = tc.modDAGasPrice + } + feeEstimatorConfig.On("ModifyGasPriceComponents", mock.Anything, tc.execGasPrice, tc.daGasPrice). + Return(modRespExecGasPrice, modRespDAGasPrice, nil) + g := DAGasPriceEstimator{ execEstimator: execEstimator, l1Oracle: l1Oracle, priceEncodingLength: daGasPriceEncodingLength, + feeEstimatorConfig: feeEstimatorConfig, } gasPrice, err := g.GetGasPrice(ctx) @@ -329,14 +374,17 @@ func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { execCostUSD := big.NewInt(100_000) testCases := []struct { - name string - gasPrice *big.Int - wrappedNativePrice *big.Int - msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta - daOverheadGas int64 - gasPerDAByte int64 - daMultiplier int64 - expUSD *big.Int + name string + gasPrice *big.Int + wrappedNativePrice *big.Int + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + daOverheadGas int64 + gasPerDAByte int64 + daMultiplier int64 + expUSD *big.Int + onRampConfig cciptypes.OnRampDynamicConfig + execEstimatorResponse []any + execEstimatorErr error }{ { name: "only DA overhead", @@ -349,10 +397,8 @@ func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { SourceTokenData: [][]byte{}, }, }, - daOverheadGas: 100_000, - gasPerDAByte: 0, - daMultiplier: 10_000, // 1x multiplier - expUSD: new(big.Int).Add(execCostUSD, big.NewInt(100_000e9)), + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(100_000e9)), + execEstimatorResponse: []any{int64(100_000), int64(0), int64(10_000), nil}, }, { name: "include message data gas", @@ -367,10 +413,8 @@ func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { }, }, }, - daOverheadGas: 100_000, - gasPerDAByte: 16, - daMultiplier: 10_000, // 1x multiplier - expUSD: new(big.Int).Add(execCostUSD, big.NewInt(134_208e9)), + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(134_208e9)), + execEstimatorResponse: []any{int64(100_000), int64(16), int64(10_000), nil}, }, { name: "zero DA price", @@ -383,10 +427,7 @@ func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { SourceTokenData: [][]byte{}, }, }, - daOverheadGas: 100_000, - gasPerDAByte: 16, - daMultiplier: 10_000, // 1x multiplier - expUSD: execCostUSD, + expUSD: execCostUSD, }, { name: "double native price", @@ -399,10 +440,8 @@ func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { SourceTokenData: [][]byte{}, }, }, - daOverheadGas: 100_000, - gasPerDAByte: 0, - daMultiplier: 10_000, // 1x multiplier - expUSD: new(big.Int).Add(execCostUSD, big.NewInt(200_000e9)), + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(200_000e9)), + execEstimatorResponse: []any{int64(100_000), int64(0), int64(10_000), nil}, }, { name: "half multiplier", @@ -415,31 +454,68 @@ func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { SourceTokenData: [][]byte{}, }, }, - daOverheadGas: 100_000, - gasPerDAByte: 0, - daMultiplier: 5_000, // 0.5x multiplier - expUSD: new(big.Int).Add(execCostUSD, big.NewInt(50_000e9)), + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(50_000e9)), + execEstimatorResponse: []any{int64(100_000), int64(0), int64(5_000), nil}, + }, + { + name: "onRamp reader error", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + SourceTokenData: [][]byte{}, + }, + }, + execEstimatorResponse: []any{int64(0), int64(0), int64(0), errors.New("some reader error")}, + }, + { + name: "execEstimator error", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + SourceTokenData: [][]byte{}, + }, + }, + execEstimatorErr: errors.New("some estimator error"), }, } for _, tc := range testCases { - execEstimator := NewMockGasPriceEstimator(t) - execEstimator.On("EstimateMsgCostUSD", mock.Anything, mock.Anything, tc.wrappedNativePrice, tc.msg).Return(execCostUSD, nil) - t.Run(tc.name, func(t *testing.T) { ctx := tests.Context(t) + + execEstimator := NewMockGasPriceEstimator(t) + execEstimator.On("EstimateMsgCostUSD", mock.Anything, mock.Anything, tc.wrappedNativePrice, tc.msg). + Return(execCostUSD, tc.execEstimatorErr) + + feeEstimatorConfig := ccipdatamocks.NewFeeEstimatorConfigReader(t) + if len(tc.execEstimatorResponse) > 0 { + feeEstimatorConfig.On("GetDataAvailabilityConfig", mock.Anything). + Return(tc.execEstimatorResponse...) + } + g := DAGasPriceEstimator{ execEstimator: execEstimator, l1Oracle: nil, priceEncodingLength: daGasPriceEncodingLength, - daOverheadGas: tc.daOverheadGas, - gasPerDAByte: tc.gasPerDAByte, - daMultiplier: tc.daMultiplier, + feeEstimatorConfig: feeEstimatorConfig, } costUSD, err := g.EstimateMsgCostUSD(ctx, tc.gasPrice, tc.wrappedNativePrice, tc.msg) - assert.NoError(t, err) - assert.Equal(t, tc.expUSD, costUSD) + + switch { + case len(tc.execEstimatorResponse) == 4 && tc.execEstimatorResponse[3] != nil, + tc.execEstimatorErr != nil: + require.Error(t, err) + default: + require.NoError(t, err) + assert.Equal(t, tc.expUSD, costUSD) + } }) } } diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go index 49a6fbcc4ad..4aac664e33e 100644 --- a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go @@ -3,6 +3,8 @@ package prices import ( "math/big" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/Masterminds/semver/v3" "github.com/pkg/errors" @@ -47,12 +49,13 @@ func NewGasPriceEstimatorForCommitPlugin( maxExecGasPrice *big.Int, daDeviationPPB int64, execDeviationPPB int64, + feeEstimatorConfig ccipdata.FeeEstimatorConfigReader, ) (GasPriceEstimatorCommit, error) { switch commitStoreVersion.String() { case "1.0.0", "1.1.0": return NewExecGasPriceEstimator(estimator, maxExecGasPrice, execDeviationPPB), nil case "1.2.0": - return NewDAGasPriceEstimator(estimator, maxExecGasPrice, execDeviationPPB, daDeviationPPB), nil + return NewDAGasPriceEstimator(estimator, maxExecGasPrice, execDeviationPPB, daDeviationPPB, feeEstimatorConfig), nil default: return nil, errors.Errorf("Invalid commitStore version: %s", commitStoreVersion) } diff --git a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go index 6875bae1419..9238d453966 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go @@ -75,6 +75,8 @@ var ( SourceChainSelector = uint64(11787463284727550157) DestChainID = uint64(1337) DestChainSelector = uint64(3379446385462418246) + + TokenDecimals = uint8(18) ) // Backwards compat, in principle these statuses are version dependent @@ -147,20 +149,20 @@ func (c ExecOffchainConfig) Encode() ([]byte, error) { } func NewExecOffchainConfig( - DestOptimisticConfirmations uint32, - BatchGasLimit uint32, - RelativeBoostPerWaitHour float64, - InflightCacheExpiry config.Duration, - RootSnoozeTime config.Duration, - BatchingStrategyID uint32, + destOptimisticConfirmations uint32, + batchGasLimit uint32, + relativeBoostPerWaitHour float64, + inflightCacheExpiry config.Duration, + rootSnoozeTime config.Duration, + batchingStrategyID uint32, // 0 = Standard, 1 = Out of Order ) ExecOffchainConfig { return ExecOffchainConfig{v1_2_0.JSONExecOffchainConfig{ - DestOptimisticConfirmations: DestOptimisticConfirmations, - BatchGasLimit: BatchGasLimit, - RelativeBoostPerWaitHour: RelativeBoostPerWaitHour, - InflightCacheExpiry: InflightCacheExpiry, - RootSnoozeTime: RootSnoozeTime, - BatchingStrategyID: BatchingStrategyID, + DestOptimisticConfirmations: destOptimisticConfirmations, + BatchGasLimit: batchGasLimit, + RelativeBoostPerWaitHour: relativeBoostPerWaitHour, + InflightCacheExpiry: inflightCacheExpiry, + RootSnoozeTime: rootSnoozeTime, + BatchingStrategyID: batchingStrategyID, }} } diff --git a/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go b/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go index d21c5b12513..b1c3677e497 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go @@ -38,10 +38,10 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" pb "github.com/smartcontractkit/chainlink-protos/orchestrator/feedsmanager" + evmcapabilities "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" v2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" @@ -383,6 +383,7 @@ func setupNodeCCIP( fmt.Sprintf("127.0.0.1:%d", port), } c.Log.Level = &loglevel + c.Feature.CCIP = &trueRef c.Feature.UICSAKeys = &trueRef c.Feature.FeedsManager = &trueRef c.OCR.Enabled = &falseRef @@ -468,7 +469,7 @@ func setupNodeCCIP( Logger: lggr, LoopRegistry: loopRegistry, GRPCOpts: loop.GRPCOpts{}, - CapabilitiesRegistry: coretypes.NewCapabilitiesRegistry(t), + CapabilitiesRegistry: evmcapabilities.NewRegistry(logger.TestLogger(t)), } testCtx := testutils.Context(t) // evm alway enabled for backward compatibility diff --git a/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go b/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go index a520580e614..41fbc76cd7f 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go @@ -180,6 +180,7 @@ type CCIPJobSpecParams struct { DestStartBlock uint64 USDCAttestationAPI string USDCConfig *config.USDCConfig + LBTCConfig *config.LBTCConfig P2PV2Bootstrappers pq.StringArray } @@ -305,6 +306,11 @@ func (params CCIPJobSpecParams) ExecutionJobSpec() (*OCR2TaskJobSpec, error) { ocrSpec.PluginConfig["USDCConfig.SourceMessageTransmitterAddress"] = fmt.Sprintf(`"%s"`, params.USDCConfig.SourceMessageTransmitterAddress) ocrSpec.PluginConfig["USDCConfig.AttestationAPITimeoutSeconds"] = params.USDCConfig.AttestationAPITimeoutSeconds } + if params.LBTCConfig != nil { + ocrSpec.PluginConfig["LBTCConfig.AttestationAPI"] = fmt.Sprintf(`"%s"`, params.LBTCConfig.AttestationAPI) + ocrSpec.PluginConfig["LBTCConfig.SourceTokenAddress"] = fmt.Sprintf(`"%s"`, params.LBTCConfig.SourceTokenAddress) + ocrSpec.PluginConfig["LBTCConfig.AttestationAPITimeoutSeconds"] = params.LBTCConfig.AttestationAPITimeoutSeconds + } return &OCR2TaskJobSpec{ OCR2OracleSpec: ocrSpec, JobType: "offchainreporting2", diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go new file mode 100644 index 00000000000..feb18ee50c1 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go @@ -0,0 +1,1601 @@ +//nolint:revive // helpers for specific version +package testhelpers_1_4_0 + +import ( + "context" + "fmt" + "math" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + burn_mint_token_pool "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + evm_2_evm_offramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + evm_2_evm_onramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_0_0" + lock_release_token_pool "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" +) + +var ( + // Source + SourcePool = "source Link pool" + SourcePriceRegistry = "source PriceRegistry" + OnRamp = "onramp" + OnRampNative = "onramp-native" + SourceRouter = "source router" + + // Dest + OffRamp = "offramp" + DestPool = "dest Link pool" + + Receiver = "receiver" + Sender = "sender" + Link = func(amount int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(amount)) } + HundredLink = Link(100) + LinkUSDValue = func(amount int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(amount)) } + SourceChainID = uint64(1000) + SourceChainSelector = uint64(11787463284727550157) + DestChainID = uint64(1337) + DestChainSelector = uint64(3379446385462418246) +) + +// Backwards compat, in principle these statuses are version dependent +// TODO: Adjust integration tests to be version agnostic using readers +var ( + ExecutionStateSuccess = MessageExecutionState(cciptypes.ExecutionStateSuccess) + ExecutionStateFailure = MessageExecutionState(cciptypes.ExecutionStateFailure) +) + +type MessageExecutionState cciptypes.MessageExecutionState +type CommitOffchainConfig struct { + v1_2_0.JSONCommitOffchainConfig +} + +func (c CommitOffchainConfig) Encode() ([]byte, error) { + return ccipconfig.EncodeOffchainConfig(c.JSONCommitOffchainConfig) +} + +func NewCommitOffchainConfig( + gasPriceHeartBeat config.Duration, + daGasPriceDeviationPPB uint32, + execGasPriceDeviationPPB uint32, + tokenPriceHeartBeat config.Duration, + tokenPriceDeviationPPB uint32, + inflightCacheExpiry config.Duration, + priceReportingDisabled bool, +) CommitOffchainConfig { + return CommitOffchainConfig{v1_2_0.JSONCommitOffchainConfig{ + GasPriceHeartBeat: gasPriceHeartBeat, + DAGasPriceDeviationPPB: daGasPriceDeviationPPB, + ExecGasPriceDeviationPPB: execGasPriceDeviationPPB, + TokenPriceHeartBeat: tokenPriceHeartBeat, + TokenPriceDeviationPPB: tokenPriceDeviationPPB, + InflightCacheExpiry: inflightCacheExpiry, + PriceReportingDisabled: priceReportingDisabled, + }} +} + +type CommitOnchainConfig struct { + ccipdata.CommitOnchainConfig +} + +func NewCommitOnchainConfig( + priceRegistry common.Address, +) CommitOnchainConfig { + return CommitOnchainConfig{ccipdata.CommitOnchainConfig{ + PriceRegistry: priceRegistry, + }} +} + +type ExecOnchainConfig struct { + v1_2_0.ExecOnchainConfig +} + +func NewExecOnchainConfig( + permissionLessExecutionThresholdSeconds uint32, + router common.Address, + priceRegistry common.Address, + maxNumberOfTokensPerMsg uint16, + maxDataBytes uint32, + maxPoolReleaseOrMintGas uint32, +) ExecOnchainConfig { + return ExecOnchainConfig{v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: permissionLessExecutionThresholdSeconds, + Router: router, + PriceRegistry: priceRegistry, + MaxNumberOfTokensPerMsg: maxNumberOfTokensPerMsg, + MaxDataBytes: maxDataBytes, + MaxPoolReleaseOrMintGas: maxPoolReleaseOrMintGas, + }} +} + +type ExecOffchainConfig struct { + v1_2_0.JSONExecOffchainConfig +} + +func (c ExecOffchainConfig) Encode() ([]byte, error) { + return ccipconfig.EncodeOffchainConfig(c.JSONExecOffchainConfig) +} + +func NewExecOffchainConfig( + destOptimisticConfirmations uint32, + batchGasLimit uint32, + relativeBoostPerWaitHour float64, + inflightCacheExpiry config.Duration, + rootSnoozeTime config.Duration, + batchingStrategyID uint32, +) ExecOffchainConfig { + return ExecOffchainConfig{v1_2_0.JSONExecOffchainConfig{ + DestOptimisticConfirmations: destOptimisticConfirmations, + BatchGasLimit: batchGasLimit, + RelativeBoostPerWaitHour: relativeBoostPerWaitHour, + InflightCacheExpiry: inflightCacheExpiry, + RootSnoozeTime: rootSnoozeTime, + BatchingStrategyID: batchingStrategyID, + }} +} + +type MaybeRevertReceiver struct { + Receiver *maybe_revert_message_receiver.MaybeRevertMessageReceiver + Strict bool +} + +type Common struct { + ChainID uint64 + ChainSelector uint64 + User *bind.TransactOpts + Chain *backends.SimulatedBackend + LinkToken *link_token_interface.LinkToken + LinkTokenPool *lock_release_token_pool.LockReleaseTokenPool + CustomToken *link_token_interface.LinkToken + WrappedNative *weth9.WETH9 + WrappedNativePool *lock_release_token_pool_1_0_0.LockReleaseTokenPool + ARM *mock_rmn_contract.MockRMNContract + ARMProxy *rmn_proxy_contract.RMNProxy + PriceRegistry *price_registry_1_2_0.PriceRegistry +} + +type SourceChain struct { + Common + Router *router.Router + OnRamp *evm_2_evm_onramp.EVM2EVMOnRamp +} + +type DestinationChain struct { + Common + + CommitStore *commit_store_1_2_0.CommitStore + Router *router.Router + OffRamp *evm_2_evm_offramp.EVM2EVMOffRamp + Receivers []MaybeRevertReceiver +} + +type OCR2Config struct { + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte +} + +type BalanceAssertion struct { + Name string + Address common.Address + Expected string + Getter func(t *testing.T, addr common.Address) *big.Int + Within string +} + +type BalanceReq struct { + Name string + Addr common.Address + Getter func(t *testing.T, addr common.Address) *big.Int +} + +type CCIPContracts struct { + Source SourceChain + Dest DestinationChain + Oracles []confighelper.OracleIdentityExtra + + commitOCRConfig, execOCRConfig *OCR2Config +} + +func (c *CCIPContracts) DeployNewOffRamp(t *testing.T) { + prevOffRamp := common.HexToAddress("") + if c.Dest.OffRamp != nil { + prevOffRamp = c.Dest.OffRamp.Address() + } + offRampAddress, _, _, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp( + c.Dest.User, + c.Dest.Chain, + evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: c.Dest.CommitStore.Address(), + ChainSelector: c.Dest.ChainSelector, + SourceChainSelector: c.Source.ChainSelector, + OnRamp: c.Source.OnRamp.Address(), + PrevOffRamp: prevOffRamp, + ArmProxy: c.Dest.ARMProxy.Address(), + }, + []common.Address{c.Source.LinkToken.Address()}, // source tokens + []common.Address{c.Dest.LinkTokenPool.Address()}, // pools + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() + + c.Dest.OffRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampAddress, c.Dest.Chain) + require.NoError(t, err) + + c.Dest.Chain.Commit() + c.Source.Chain.Commit() +} + +func (c *CCIPContracts) EnableOffRamp(t *testing.T) { + _, err := c.Dest.Router.ApplyRampUpdates(c.Dest.User, nil, nil, []router.RouterOffRamp{{SourceChainSelector: SourceChainSelector, OffRamp: c.Dest.OffRamp.Address()}}) + require.NoError(t, err) + c.Dest.Chain.Commit() + + onChainConfig := c.CreateDefaultExecOnchainConfig(t) + offChainConfig := c.CreateDefaultExecOffchainConfig(t) + + c.SetupExecOCR2Config(t, onChainConfig, offChainConfig) +} + +func (c *CCIPContracts) EnableCommitStore(t *testing.T) { + onChainConfig := c.CreateDefaultCommitOnchainConfig(t) + offChainConfig := c.CreateDefaultCommitOffchainConfig(t) + + c.SetupCommitOCR2Config(t, onChainConfig, offChainConfig) + + _, err := c.Dest.PriceRegistry.ApplyPriceUpdatersUpdates(c.Dest.User, []common.Address{c.Dest.CommitStore.Address()}, []common.Address{}) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) DeployNewOnRamp(t *testing.T) { + t.Log("Deploying new onRamp") + // find the last onRamp + prevOnRamp := common.HexToAddress("") + if c.Source.OnRamp != nil { + prevOnRamp = c.Source.OnRamp.Address() + } + onRampAddress, _, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + c.Source.User, // user + c.Source.Chain, // client + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: c.Source.LinkToken.Address(), + ChainSelector: c.Source.ChainSelector, + DestChainSelector: c.Dest.ChainSelector, + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: prevOnRamp, + ArmProxy: c.Source.ARM.Address(), // ARM + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: c.Source.Router.Address(), + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: c.Source.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxPerMsgGasLimit: 4_000_000, + }, + []evm_2_evm_onramp.InternalPoolUpdate{ + { + Token: c.Source.LinkToken.Address(), + Pool: c.Source.LinkTokenPool.Address(), + }, + }, + evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: c.Source.LinkToken.Address(), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 9e17, + Enabled: true, + }, + { + Token: c.Source.WrappedNative.Address(), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: c.Source.LinkToken.Address(), + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + DestGasOverhead: 34_000, + DestBytesOverhead: 32, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + c.Source.OnRamp, err = evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, c.Source.Chain) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) EnableOnRamp(t *testing.T) { + t.Log("Setting onRamp on source router") + _, err := c.Source.Router.ApplyRampUpdates(c.Source.User, []router.RouterOnRamp{{DestChainSelector: c.Dest.ChainSelector, OnRamp: c.Source.OnRamp.Address()}}, nil, nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) DeployNewCommitStore(t *testing.T) { + commitStoreAddress, _, _, err := commit_store_1_2_0.DeployCommitStore( + c.Dest.User, // user + c.Dest.Chain, // client + commit_store_1_2_0.CommitStoreStaticConfig{ + ChainSelector: c.Dest.ChainSelector, + SourceChainSelector: c.Source.ChainSelector, + OnRamp: c.Source.OnRamp.Address(), + ArmProxy: c.Dest.ARMProxy.Address(), + }, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() + // since CommitStoreHelper derives from CommitStore, it's safe to instantiate both on same address + c.Dest.CommitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreAddress, c.Dest.Chain) + require.NoError(t, err) +} + +func (c *CCIPContracts) DeployNewPriceRegistry(t *testing.T) { + t.Log("Deploying new Price Registry") + destPricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + c.Dest.User, + c.Dest.Chain, + []common.Address{c.Dest.CommitStore.Address()}, + []common.Address{c.Dest.LinkToken.Address()}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + c.Dest.PriceRegistry, err = price_registry_1_2_0.NewPriceRegistry(destPricesAddress, c.Dest.Chain) + require.NoError(t, err) + + priceUpdates := price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: c.Dest.LinkToken.Address(), + UsdPerToken: big.NewInt(8e18), // 8usd + }, + { + SourceToken: c.Dest.WrappedNative.Address(), + UsdPerToken: big.NewInt(1e18), // 1usd + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ + { + DestChainSelector: c.Source.ChainSelector, + UsdPerUnitGas: big.NewInt(2000e9), // $2000 per eth * 1gwei = 2000e9 + }, + }, + } + _, err = c.Dest.PriceRegistry.UpdatePrices(c.Dest.User, priceUpdates) + require.NoError(t, err) + + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + + t.Logf("New Price Registry deployed at %s", destPricesAddress.String()) +} + +func (c *CCIPContracts) SetNopsOnRamp(t *testing.T, nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) { + tx, err := c.Source.OnRamp.SetNops(c.Source.User, nopsAndWeights) + require.NoError(t, err) + c.Source.Chain.Commit() + _, err = bind.WaitMined(context.Background(), c.Source.Chain, tx) + require.NoError(t, err) +} + +func (c *CCIPContracts) GetSourceLinkBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Source.Chain, c.Source.LinkToken.Address(), addr) +} + +func (c *CCIPContracts) GetDestLinkBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Dest.Chain, c.Dest.LinkToken.Address(), addr) +} + +func (c *CCIPContracts) GetSourceWrappedTokenBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Source.Chain, c.Source.WrappedNative.Address(), addr) +} + +func (c *CCIPContracts) GetDestWrappedTokenBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Dest.Chain, c.Dest.WrappedNative.Address(), addr) +} + +func (c *CCIPContracts) AssertBalances(t *testing.T, bas []BalanceAssertion) { + for _, b := range bas { + actual := b.Getter(t, b.Address) + t.Log("Checking balance for", b.Name, "at", b.Address.Hex(), "got", actual) + require.NotNil(t, actual, "%v getter return nil", b.Name) + if b.Within == "" { + require.Equal(t, b.Expected, actual.String(), "wrong balance for %s got %s want %s", b.Name, actual, b.Expected) + } else { + bi, _ := big.NewInt(0).SetString(b.Expected, 10) + withinI, _ := big.NewInt(0).SetString(b.Within, 10) + high := big.NewInt(0).Add(bi, withinI) + low := big.NewInt(0).Sub(bi, withinI) + require.Equal(t, -1, actual.Cmp(high), "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + require.Equal(t, 1, actual.Cmp(low), "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + } + } +} + +func AccountToAddress(accounts []ocr2types.Account) (addresses []common.Address, err error) { + for _, signer := range accounts { + bytes, err := hexutil.Decode(string(signer)) + if err != nil { + return []common.Address{}, errors.Wrap(err, fmt.Sprintf("given address is not valid %s", signer)) + } + if len(bytes) != 20 { + return []common.Address{}, errors.Errorf("address is not 20 bytes %s", signer) + } + addresses = append(addresses, common.BytesToAddress(bytes)) + } + return addresses, nil +} + +func OnchainPublicKeyToAddress(publicKeys []ocrtypes.OnchainPublicKey) (addresses []common.Address, err error) { + for _, signer := range publicKeys { + if len(signer) != 20 { + return []common.Address{}, errors.Errorf("address is not 20 bytes %s", signer) + } + addresses = append(addresses, common.BytesToAddress(signer)) + } + return addresses, nil +} + +func (c *CCIPContracts) DeriveOCR2Config(t *testing.T, oracles []confighelper.OracleIdentityExtra, rawOnchainConfig []byte, rawOffchainConfig []byte) *OCR2Config { + signers, transmitters, threshold, onchainConfig, offchainConfigVersion, offchainConfig, err := confighelper.ContractSetConfigArgsForTests( + 2*time.Second, // deltaProgress + 1*time.Second, // deltaResend + 1*time.Second, // deltaRound + 500*time.Millisecond, // deltaGrace + 2*time.Second, // deltaStage + 3, + []int{1, 1, 1, 1}, + oracles, + rawOffchainConfig, + nil, + 50*time.Millisecond, // Max duration query + 1*time.Second, // Max duration observation + 100*time.Millisecond, + 100*time.Millisecond, + 100*time.Millisecond, + 1, // faults + rawOnchainConfig, + ) + require.NoError(t, err) + lggr := logger.TestLogger(t) + lggr.Infow("Setting Config on Oracle Contract", + "signers", signers, + "transmitters", transmitters, + "threshold", threshold, + "onchainConfig", onchainConfig, + "encodedConfigVersion", offchainConfigVersion, + ) + signerAddresses, err := OnchainPublicKeyToAddress(signers) + require.NoError(t, err) + transmitterAddresses, err := AccountToAddress(transmitters) + require.NoError(t, err) + + return &OCR2Config{ + Signers: signerAddresses, + Transmitters: transmitterAddresses, + F: threshold, + OnchainConfig: onchainConfig, + OffchainConfigVersion: offchainConfigVersion, + OffchainConfig: offchainConfig, + } +} + +func (c *CCIPContracts) SetupCommitOCR2Config(t *testing.T, commitOnchainConfig, commitOffchainConfig []byte) { + c.commitOCRConfig = c.DeriveOCR2Config(t, c.Oracles, commitOnchainConfig, commitOffchainConfig) + // Set the DON on the commit store + _, err := c.Dest.CommitStore.SetOCR2Config( + c.Dest.User, + c.commitOCRConfig.Signers, + c.commitOCRConfig.Transmitters, + c.commitOCRConfig.F, + c.commitOCRConfig.OnchainConfig, + c.commitOCRConfig.OffchainConfigVersion, + c.commitOCRConfig.OffchainConfig, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) SetupExecOCR2Config(t *testing.T, execOnchainConfig, execOffchainConfig []byte) { + c.execOCRConfig = c.DeriveOCR2Config(t, c.Oracles, execOnchainConfig, execOffchainConfig) + // Same DON on the offramp + _, err := c.Dest.OffRamp.SetOCR2Config( + c.Dest.User, + c.execOCRConfig.Signers, + c.execOCRConfig.Transmitters, + c.execOCRConfig.F, + c.execOCRConfig.OnchainConfig, + c.execOCRConfig.OffchainConfigVersion, + c.execOCRConfig.OffchainConfig, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) SetupOnchainConfig(t *testing.T, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig []byte) int64 { + // Note We do NOT set the payees, payment is done in the OCR2Base implementation + blockBeforeConfig, err := c.Dest.Chain.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + + c.SetupCommitOCR2Config(t, commitOnchainConfig, commitOffchainConfig) + c.SetupExecOCR2Config(t, execOnchainConfig, execOffchainConfig) + + return blockBeforeConfig.Number().Int64() +} + +func (c *CCIPContracts) SetupLockAndMintTokenPool( + sourceTokenAddress common.Address, + wrappedTokenName, + wrappedTokenSymbol string) (common.Address, *burn_mint_erc677.BurnMintERC677, error) { + // Deploy dest token & pool + destTokenAddress, _, _, err := burn_mint_erc677.DeployBurnMintERC677(c.Dest.User, c.Dest.Chain, wrappedTokenName, wrappedTokenSymbol, 18, big.NewInt(0)) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + destToken, err := burn_mint_erc677.NewBurnMintERC677(destTokenAddress, c.Dest.Chain) + if err != nil { + return [20]byte{}, nil, err + } + + destPoolAddress, _, destPool, err := burn_mint_token_pool.DeployBurnMintTokenPool( + c.Dest.User, + c.Dest.Chain, + destTokenAddress, + []common.Address{}, // pool originalSender allowList + c.Dest.ARMProxy.Address(), + c.Dest.Router.Address(), + ) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + _, err = destToken.GrantMintAndBurnRoles(c.Dest.User, destPoolAddress) + if err != nil { + return [20]byte{}, nil, err + } + + _, err = destPool.ApplyChainUpdates(c.Dest.User, + []burn_mint_token_pool.TokenPoolChainUpdate{ + { + RemoteChainSelector: c.Source.ChainSelector, + Allowed: true, + OutboundRateLimiterConfig: burn_mint_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: burn_mint_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + sourcePoolAddress, _, sourcePool, err := lock_release_token_pool.DeployLockReleaseTokenPool( + c.Source.User, + c.Source.Chain, + sourceTokenAddress, + []common.Address{}, // empty allowList at deploy time indicates pool has no original sender restrictions + c.Source.ARMProxy.Address(), + true, + c.Source.Router.Address(), + ) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + // set onRamp as valid caller for source pool + _, err = sourcePool.ApplyChainUpdates(c.Source.User, []lock_release_token_pool.TokenPoolChainUpdate{ + { + RemoteChainSelector: c.Dest.ChainSelector, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + wrappedNativeAddress, err := c.Source.Router.GetWrappedNative(nil) + if err != nil { + return [20]byte{}, nil, err + } + + // native token is used as fee token + _, err = c.Source.PriceRegistry.UpdatePrices(c.Source.User, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: sourceTokenAddress, + UsdPerToken: big.NewInt(5), + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{}, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + _, err = c.Source.PriceRegistry.ApplyFeeTokensUpdates(c.Source.User, []common.Address{wrappedNativeAddress}, nil) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + // add new token pool created above + _, err = c.Source.OnRamp.ApplyPoolUpdates(c.Source.User, nil, []evm_2_evm_onramp.InternalPoolUpdate{ + { + Token: sourceTokenAddress, + Pool: sourcePoolAddress, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + + _, err = c.Dest.OffRamp.ApplyPoolUpdates(c.Dest.User, nil, []evm_2_evm_offramp.InternalPoolUpdate{ + { + Token: sourceTokenAddress, + Pool: destPoolAddress, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + return sourcePoolAddress, destToken, err +} + +func (c *CCIPContracts) SendMessage(t *testing.T, gasLimit, tokenAmount *big.Int, receiverAddr common.Address) { + extraArgs, err := GetEVMExtraArgsV1(gasLimit, false) + require.NoError(t, err) + msg := router.ClientEVM2AnyMessage{ + Receiver: MustEncodeAddress(t, receiverAddr), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: c.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: c.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err := c.Source.Router.GetFee(nil, c.Dest.ChainSelector, msg) + require.NoError(t, err) + // Currently no overhead and 1gwei dest gas price. So fee is simply gasLimit * gasPrice. + // require.Equal(t, new(big.Int).Mul(gasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err = c.Source.LinkToken.Approve(c.Source.User, c.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err) + c.Source.Chain.Commit() + c.SendRequest(t, msg) +} + +func GetBalances(t *testing.T, brs []BalanceReq) (map[string]*big.Int, error) { + m := make(map[string]*big.Int) + for _, br := range brs { + m[br.Name] = br.Getter(t, br.Addr) + if m[br.Name] == nil { + return nil, fmt.Errorf("%v getter return nil", br.Name) + } + } + return m, nil +} + +func MustAddBigInt(a *big.Int, b string) *big.Int { + bi, _ := big.NewInt(0).SetString(b, 10) + return big.NewInt(0).Add(a, bi) +} + +func MustSubBigInt(a *big.Int, b string) *big.Int { + bi, _ := big.NewInt(0).SetString(b, 10) + return big.NewInt(0).Sub(a, bi) +} + +func MustEncodeAddress(t *testing.T, address common.Address) []byte { + bts, err := utils.ABIEncode(`[{"type":"address"}]`, address) + require.NoError(t, err) + return bts +} + +func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destChainID, destChainSelector uint64) CCIPContracts { + sourceChain, sourceUser := testhelpers.SetupChain(t) + destChain, destUser := testhelpers.SetupChain(t) + + armSourceAddress, _, _, err := mock_rmn_contract.DeployMockRMNContract( + sourceUser, + sourceChain.Client(), + ) + require.NoError(t, err) + sourceARM, err := mock_rmn_contract.NewMockRMNContract(armSourceAddress, sourceChain.Client()) + require.NoError(t, err) + armProxySourceAddress, _, _, err := rmn_proxy_contract.DeployRMNProxy( + sourceUser, + sourceChain.Client(), + armSourceAddress, + ) + require.NoError(t, err) + sourceARMProxy, err := rmn_proxy_contract.NewRMNProxy(armProxySourceAddress, sourceChain.Client()) + require.NoError(t, err) + sourceChain.Commit() + + armDestAddress, _, _, err := mock_rmn_contract.DeployMockRMNContract( + destUser, + destChain.Client(), + ) + require.NoError(t, err) + armProxyDestAddress, _, _, err := rmn_proxy_contract.DeployRMNProxy( + destUser, + destChain.Client(), + armDestAddress, + ) + require.NoError(t, err) + destChain.Commit() + destARM, err := mock_rmn_contract.NewMockRMNContract(armDestAddress, destChain.Client()) + require.NoError(t, err) + destARMProxy, err := rmn_proxy_contract.NewRMNProxy(armProxyDestAddress, destChain.Client()) + require.NoError(t, err) + + // Deploy link token and pool on source chain + sourceLinkTokenAddress, _, _, err := link_token_interface.DeployLinkToken(sourceUser, sourceChain.Client()) + require.NoError(t, err) + sourceChain.Commit() + sourceLinkToken, err := link_token_interface.NewLinkToken(sourceLinkTokenAddress, sourceChain.Client()) + require.NoError(t, err) + + // Create router + sourceWeth9addr, _, _, err := weth9.DeployWETH9(sourceUser, sourceChain.Client()) + require.NoError(t, err) + sourceWrapped, err := weth9.NewWETH9(sourceWeth9addr, sourceChain.Client()) + require.NoError(t, err) + + sourceRouterAddress, _, _, err := router.DeployRouter(sourceUser, sourceChain.Client(), sourceWeth9addr, armProxySourceAddress) + require.NoError(t, err) + sourceRouter, err := router.NewRouter(sourceRouterAddress, sourceChain.Client()) + require.NoError(t, err) + sourceChain.Commit() + + sourceWeth9PoolAddress, _, _, err := lock_release_token_pool_1_0_0.DeployLockReleaseTokenPool( + sourceUser, + sourceChain.Client(), + sourceWeth9addr, + []common.Address{}, + armProxySourceAddress, + ) + require.NoError(t, err) + sourceChain.Commit() + + sourceWeth9Pool, err := lock_release_token_pool_1_0_0.NewLockReleaseTokenPool(sourceWeth9PoolAddress, sourceChain.Client()) + require.NoError(t, err) + + sourcePoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + sourceUser, + sourceChain.Client(), + sourceLinkTokenAddress, + []common.Address{}, + armProxySourceAddress, + true, + sourceRouterAddress, + ) + require.NoError(t, err) + sourceChain.Commit() + sourcePool, err := lock_release_token_pool.NewLockReleaseTokenPool(sourcePoolAddress, sourceChain.Client()) + require.NoError(t, err) + + // Deploy custom token pool source + sourceCustomTokenAddress, _, _, err := link_token_interface.DeployLinkToken(sourceUser, sourceChain.Client()) // Just re-use this, it's an ERC20. + require.NoError(t, err) + sourceCustomToken, err := link_token_interface.NewLinkToken(sourceCustomTokenAddress, sourceChain.Client()) + require.NoError(t, err) + destChain.Commit() + + // Deploy custom token pool dest + destCustomTokenAddress, _, _, err := link_token_interface.DeployLinkToken(destUser, destChain.Client()) // Just re-use this, it's an ERC20. + require.NoError(t, err) + destCustomToken, err := link_token_interface.NewLinkToken(destCustomTokenAddress, destChain.Client()) + require.NoError(t, err) + destChain.Commit() + + // Deploy and configure onramp + sourcePricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + sourceUser, + sourceChain.Client(), + nil, + []common.Address{sourceLinkTokenAddress, sourceWeth9addr}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + + srcPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(sourcePricesAddress, sourceChain.Client()) + require.NoError(t, err) + + _, err = srcPriceRegistry.UpdatePrices(sourceUser, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: sourceLinkTokenAddress, + UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(20)), + }, + { + SourceToken: sourceWeth9addr, + UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2000)), + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ + { + DestChainSelector: destChainSelector, + UsdPerUnitGas: big.NewInt(20000e9), + }, + }, + }) + require.NoError(t, err) + + onRampAddress, _, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + sourceUser, // user + sourceChain.Client(), // client + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: sourceLinkTokenAddress, + ChainSelector: sourceChainSelector, + DestChainSelector: destChainSelector, + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: common.HexToAddress(""), + ArmProxy: armProxySourceAddress, // ARM + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: sourceRouterAddress, + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: sourcePricesAddress, + MaxDataBytes: 1e5, + MaxPerMsgGasLimit: 4_000_000, + }, + []evm_2_evm_onramp.InternalPoolUpdate{ + { + Token: sourceLinkTokenAddress, + Pool: sourcePoolAddress, + }, + { + Token: sourceWeth9addr, + Pool: sourceWeth9PoolAddress, + }, + }, + evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: sourceLinkTokenAddress, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 9e17, + Enabled: true, + }, + { + Token: sourceWeth9addr, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: sourceLinkTokenAddress, + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + DestGasOverhead: 34_000, + DestBytesOverhead: 32, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + require.NoError(t, err) + onRamp, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, sourceChain.Client()) + require.NoError(t, err) + _, err = sourcePool.ApplyChainUpdates( + sourceUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: DestChainSelector, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + _, err = sourceWeth9Pool.ApplyRampUpdates(sourceUser, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{{Ramp: onRampAddress, Allowed: true, + RateLimiterConfig: lock_release_token_pool_1_0_0.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{}, + ) + require.NoError(t, err) + sourceChain.Commit() + _, err = sourceRouter.ApplyRampUpdates(sourceUser, []router.RouterOnRamp{{DestChainSelector: destChainSelector, OnRamp: onRampAddress}}, nil, nil) + require.NoError(t, err) + sourceChain.Commit() + + destWethaddr, _, _, err := weth9.DeployWETH9(destUser, destChain.Client()) + require.NoError(t, err) + destWrapped, err := weth9.NewWETH9(destWethaddr, destChain.Client()) + require.NoError(t, err) + + // Create dest router + destRouterAddress, _, _, err := router.DeployRouter(destUser, destChain.Client(), destWethaddr, armProxyDestAddress) + require.NoError(t, err) + destChain.Commit() + destRouter, err := router.NewRouter(destRouterAddress, destChain.Client()) + require.NoError(t, err) + + // Deploy link token and pool on destination chain + destLinkTokenAddress, _, _, err := link_token_interface.DeployLinkToken(destUser, destChain.Client()) + require.NoError(t, err) + destChain.Commit() + destLinkToken, err := link_token_interface.NewLinkToken(destLinkTokenAddress, destChain.Client()) + require.NoError(t, err) + destPoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + destUser, + destChain.Client(), + destLinkTokenAddress, + []common.Address{}, + armProxyDestAddress, + true, + destRouterAddress, + ) + require.NoError(t, err) + destChain.Commit() + destPool, err := lock_release_token_pool.NewLockReleaseTokenPool(destPoolAddress, destChain.Client()) + require.NoError(t, err) + destChain.Commit() + + // Float the offramp pool + o, err := destPool.Owner(nil) + require.NoError(t, err) + require.Equal(t, destUser.From.String(), o.String()) + _, err = destPool.SetRebalancer(destUser, destUser.From) + require.NoError(t, err) + _, err = destLinkToken.Approve(destUser, destPoolAddress, Link(200)) + require.NoError(t, err) + _, err = destPool.ProvideLiquidity(destUser, Link(200)) + require.NoError(t, err) + destChain.Commit() + + destWrappedPoolAddress, _, _, err := lock_release_token_pool_1_0_0.DeployLockReleaseTokenPool( + destUser, + destChain.Client(), + destWethaddr, + []common.Address{}, + armProxyDestAddress, + ) + require.NoError(t, err) + destWrappedPool, err := lock_release_token_pool_1_0_0.NewLockReleaseTokenPool(destWrappedPoolAddress, destChain.Client()) + require.NoError(t, err) + + poolFloatValue := big.NewInt(1e18) + + destUser.Value = poolFloatValue + _, err = destWrapped.Deposit(destUser) + require.NoError(t, err) + destChain.Commit() + destUser.Value = nil + + _, err = destWrapped.Transfer(destUser, destWrappedPool.Address(), poolFloatValue) + require.NoError(t, err) + destChain.Commit() + + // Deploy and configure ge offramp. + destPricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + destUser, + destChain.Client(), + nil, + []common.Address{destLinkTokenAddress}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + destPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(destPricesAddress, destChain.Client()) + require.NoError(t, err) + + // Deploy commit store. + commitStoreAddress, _, _, err := commit_store_1_2_0.DeployCommitStore( + destUser, // user + destChain.Client(), // client + commit_store_1_2_0.CommitStoreStaticConfig{ + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp.Address(), + ArmProxy: destARMProxy.Address(), + }, + ) + require.NoError(t, err) + destChain.Commit() + commitStore, err := commit_store_1_2_0.NewCommitStore(commitStoreAddress, destChain.Client()) + require.NoError(t, err) + + offRampAddress, _, _, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp( + destUser, + destChain.Client(), + evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: commitStore.Address(), + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRampAddress, + PrevOffRamp: common.HexToAddress(""), + ArmProxy: armProxyDestAddress, + }, + []common.Address{sourceLinkTokenAddress, sourceWeth9addr}, + []common.Address{destPoolAddress, destWrappedPool.Address()}, + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + ) + require.NoError(t, err) + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampAddress, destChain.Client()) + require.NoError(t, err) + _, err = destPool.ApplyChainUpdates(destUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: sourceChainSelector, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + + _, err = destWrappedPool.ApplyRampUpdates(destUser, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{}, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{{ + Ramp: offRampAddress, + Allowed: true, + RateLimiterConfig: lock_release_token_pool_1_0_0.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + + destChain.Commit() + _, err = destPriceRegistry.ApplyPriceUpdatersUpdates(destUser, []common.Address{commitStoreAddress}, []common.Address{}) + require.NoError(t, err) + _, err = destRouter.ApplyRampUpdates(destUser, nil, + nil, []router.RouterOffRamp{{SourceChainSelector: sourceChainSelector, OffRamp: offRampAddress}}) + require.NoError(t, err) + + // Deploy 2 revertable (one SS one non-SS) + revertingMessageReceiver1Address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(destUser, destChain.Client(), false) + require.NoError(t, err) + revertingMessageReceiver1, _ := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(revertingMessageReceiver1Address, destChain.Client()) + revertingMessageReceiver2Address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(destUser, destChain.Client(), false) + require.NoError(t, err) + revertingMessageReceiver2, _ := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(revertingMessageReceiver2Address, destChain.Client()) + // Need to commit here, or we will hit the block gas limit when deploying the executor + sourceChain.Commit() + destChain.Commit() + + // Ensure we have at least finality blocks. + for i := 0; i < 50; i++ { + sourceChain.Commit() + destChain.Commit() + } + + source := SourceChain{ + Common: Common{ + ChainID: sourceChainID, + ChainSelector: sourceChainSelector, + User: sourceUser, + // FIXME + //Chain: sourceChain, + LinkToken: sourceLinkToken, + LinkTokenPool: sourcePool, + CustomToken: sourceCustomToken, + ARM: sourceARM, + ARMProxy: sourceARMProxy, + PriceRegistry: srcPriceRegistry, + WrappedNative: sourceWrapped, + WrappedNativePool: sourceWeth9Pool, + }, + Router: sourceRouter, + OnRamp: onRamp, + } + dest := DestinationChain{ + Common: Common{ + ChainID: destChainID, + ChainSelector: destChainSelector, + User: destUser, + // FIXME + //Chain: destChain, + LinkToken: destLinkToken, + LinkTokenPool: destPool, + CustomToken: destCustomToken, + ARM: destARM, + ARMProxy: destARMProxy, + PriceRegistry: destPriceRegistry, + WrappedNative: destWrapped, + WrappedNativePool: destWrappedPool, + }, + CommitStore: commitStore, + Router: destRouter, + OffRamp: offRamp, + Receivers: []MaybeRevertReceiver{{Receiver: revertingMessageReceiver1, Strict: false}, {Receiver: revertingMessageReceiver2, Strict: true}}, + } + + return CCIPContracts{ + Source: source, + Dest: dest, + } +} + +func (c *CCIPContracts) SendRequest(t *testing.T, msg router.ClientEVM2AnyMessage) *types.Transaction { + tx, err := c.Source.Router.CcipSend(c.Source.User, c.Dest.ChainSelector, msg) + require.NoError(t, err) + // FIXME + // testhelpers.ConfirmTxs(t, []*types.Transaction{tx}, c.Source.Chain) + return tx +} + +func (c *CCIPContracts) AssertExecState(t *testing.T, log logpoller.Log, state MessageExecutionState, offRampOpts ...common.Address) { + var offRamp *evm_2_evm_offramp.EVM2EVMOffRamp + var err error + if len(offRampOpts) > 0 { + offRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.OffRamp, "no offRamp configured") + offRamp = c.Dest.OffRamp + } + executionStateChanged, err := offRamp.ParseExecutionStateChanged(log.ToGethLog()) + require.NoError(t, err) + if MessageExecutionState(executionStateChanged.State) != state { + t.Log("Execution failed", hexutil.Encode(executionStateChanged.ReturnData)) + t.Fail() + } +} + +func GetEVMExtraArgsV1(gasLimit *big.Int, strict bool) ([]byte, error) { + EVMV1Tag := []byte{0x97, 0xa6, 0x57, 0xc9} + + encodedArgs, err := utils.ABIEncode(`[{"type":"uint256"},{"type":"bool"}]`, gasLimit, strict) + if err != nil { + return nil, err + } + + return append(EVMV1Tag, encodedArgs...), nil +} + +type ManualExecArgs struct { + SourceChainID, DestChainID uint64 + DestUser *bind.TransactOpts + SourceChain, DestChain bind.ContractBackend + SourceStartBlock *big.Int // the block in/after which failed ccip-send transaction was triggered + DestStartBlock uint64 // the start block for filtering ReportAccepted event (including the failed seq num) + // in destination chain. if not provided to be derived by ApproxDestStartBlock method + DestLatestBlockNum uint64 // current block number in destination + DestDeployedAt uint64 // destination block number for the initial destination contract deployment. + // Can be any number before the tx was reverted in destination chain. Preferably this needs to be set up with + // a value greater than zero to avoid performance issue in locating approximate destination block + SendReqLogIndex uint // log index of the CCIPSendRequested log in source chain + SendReqTxHash string // tx hash of the ccip-send transaction for which execution was reverted + CommitStore string + OnRamp string + OffRamp string + SeqNr uint64 + GasLimit *big.Int +} + +// ApproxDestStartBlock attempts to locate a block in destination chain with timestamp closest to the timestamp of the block +// in source chain in which ccip-send transaction was included +// it uses binary search to locate the block with the closest timestamp +// if the block located has a timestamp greater than the timestamp of mentioned source block +// it just returns the first block found with lesser timestamp of the source block +// providing a value of args.DestDeployedAt ensures better performance by reducing the range of block numbers to be traversed +func (args *ManualExecArgs) ApproxDestStartBlock() error { + sourceBlockHdr, err := args.SourceChain.HeaderByNumber(context.Background(), args.SourceStartBlock) + if err != nil { + return err + } + sendTxTime := sourceBlockHdr.Time + maxBlockNum := args.DestLatestBlockNum + // setting this to an approx value of 1000 considering destination chain would have at least 1000 blocks before the transaction started + minBlockNum := args.DestDeployedAt + closestBlockNum := uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + var closestBlockHdr *types.Header + //nolint:gosec // safe to casts in tests + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + // to reduce the number of RPC calls increase the value of blockOffset + blockOffset := uint64(10) + for { + blockNum := closestBlockHdr.Number.Uint64() + if minBlockNum > maxBlockNum { + break + } + timeDiff := math.Abs(float64(closestBlockHdr.Time - sendTxTime)) + // break if the difference in timestamp is lesser than 1 minute + //nolint:gocritic // tests + if timeDiff < 60 { + break + } else if closestBlockHdr.Time > sendTxTime { + maxBlockNum = blockNum - 1 + } else { + minBlockNum = blockNum + 1 + } + closestBlockNum = uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + //nolint:gosec // safe to casts in tests + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + + for closestBlockHdr.Time > sendTxTime { + closestBlockNum -= blockOffset + if closestBlockNum <= 0 { + return errors.New("approx destination blocknumber not found") + } + //nolint:gosec // safe to casts in tests + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + args.DestStartBlock = closestBlockHdr.Number.Uint64() + fmt.Println("using approx destination start block number", args.DestStartBlock) + return nil +} + +func (args *ManualExecArgs) FindSeqNrFromCCIPSendRequested() (uint64, error) { + var seqNr uint64 + onRampContract, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(args.OnRamp), args.SourceChain) + if err != nil { + return seqNr, err + } + iterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: args.SourceStartBlock.Uint64(), + }) + if err != nil { + return seqNr, err + } + for iterator.Next() { + if iterator.Event.Raw.Index == args.SendReqLogIndex && + iterator.Event.Raw.TxHash.Hex() == args.SendReqTxHash { + seqNr = iterator.Event.Message.SequenceNumber + break + } + } + if seqNr == 0 { + return seqNr, + fmt.Errorf("no CCIPSendRequested logs found for logIndex %d starting from block number %d", args.SendReqLogIndex, args.SourceStartBlock) + } + return seqNr, nil +} + +func (args *ManualExecArgs) ExecuteManually() (*types.Transaction, error) { + if args.SourceChainID == 0 || + args.DestChainID == 0 || + args.DestUser == nil { + return nil, errors.New("chain ids and owners are mandatory for source and dest chain") + } + if !common.IsHexAddress(args.CommitStore) || + !common.IsHexAddress(args.OffRamp) || + !common.IsHexAddress(args.OnRamp) { + return nil, errors.New("contract addresses must be valid hex address") + } + if args.SendReqTxHash == "" { + return nil, errors.New("tx hash of ccip-send request are required") + } + if args.SourceStartBlock == nil { + return nil, errors.New("must provide the value of source block in/after which ccip-send tx was included") + } + if args.SeqNr == 0 { + if args.SendReqLogIndex == 0 { + return nil, errors.New("must provide the value of log index of ccip-send request") + } + // locate seq nr from CCIPSendRequested log + seqNr, err := args.FindSeqNrFromCCIPSendRequested() + if err != nil { + return nil, err + } + args.SeqNr = seqNr + } + commitStore, err := commit_store_1_2_0.NewCommitStore(common.HexToAddress(args.CommitStore), args.DestChain) + if err != nil { + return nil, err + } + if args.DestStartBlock < 1 { + err = args.ApproxDestStartBlock() + if err != nil { + return nil, err + } + } + iterator, err := commitStore.FilterReportAccepted(&bind.FilterOpts{Start: args.DestStartBlock}) + if err != nil { + return nil, err + } + + var commitReport *commit_store_1_2_0.CommitStoreCommitReport + for iterator.Next() { + if iterator.Event.Report.Interval.Min <= args.SeqNr && iterator.Event.Report.Interval.Max >= args.SeqNr { + commitReport = &iterator.Event.Report + fmt.Println("Found root") + break + } + } + if commitReport == nil { + return nil, fmt.Errorf("unable to find seq num %d in commit report", args.SeqNr) + } + + return args.execute(commitReport) +} + +func (args *ManualExecArgs) execute(report *commit_store_1_2_0.CommitStoreCommitReport) (*types.Transaction, error) { + log.Info().Msg("Executing request manually") + seqNr := args.SeqNr + // Build a merkle tree for the report + mctx := hashutil.NewKeccak() + onRampContract, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(common.HexToAddress(args.OnRamp), args.SourceChain) + if err != nil { + return nil, err + } + leafHasher := v1_2_0.NewLeafHasher(args.SourceChainID, args.DestChainID, common.HexToAddress(args.OnRamp), mctx, onRampContract) + if leafHasher == nil { + return nil, errors.New("unable to create leaf hasher") + } + + var leaves [][32]byte + var curr, prove int + var msgs []evm_2_evm_offramp.InternalEVM2EVMMessage + var manualExecGasLimits []*big.Int + var tokenData [][][]byte + sendRequestedIterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: args.SourceStartBlock.Uint64(), + }) + if err != nil { + return nil, err + } + for sendRequestedIterator.Next() { + if sendRequestedIterator.Event.Message.SequenceNumber <= report.Interval.Max && + sendRequestedIterator.Event.Message.SequenceNumber >= report.Interval.Min { + fmt.Println("Found seq num", sendRequestedIterator.Event.Message.SequenceNumber, report.Interval) + hash, err2 := leafHasher.HashLeaf(sendRequestedIterator.Event.Raw) + if err2 != nil { + return nil, err2 + } + leaves = append(leaves, hash) + if sendRequestedIterator.Event.Message.SequenceNumber == seqNr { + fmt.Printf("Found proving %d %+v\n", curr, sendRequestedIterator.Event.Message) + var tokensAndAmounts []evm_2_evm_offramp.ClientEVMTokenAmount + for _, tokenAndAmount := range sendRequestedIterator.Event.Message.TokenAmounts { + tokensAndAmounts = append(tokensAndAmounts, evm_2_evm_offramp.ClientEVMTokenAmount{ + Token: tokenAndAmount.Token, + Amount: tokenAndAmount.Amount, + }) + } + msg := evm_2_evm_offramp.InternalEVM2EVMMessage{ + SourceChainSelector: sendRequestedIterator.Event.Message.SourceChainSelector, + Sender: sendRequestedIterator.Event.Message.Sender, + Receiver: sendRequestedIterator.Event.Message.Receiver, + SequenceNumber: sendRequestedIterator.Event.Message.SequenceNumber, + GasLimit: sendRequestedIterator.Event.Message.GasLimit, + Strict: sendRequestedIterator.Event.Message.Strict, + Nonce: sendRequestedIterator.Event.Message.Nonce, + FeeToken: sendRequestedIterator.Event.Message.FeeToken, + FeeTokenAmount: sendRequestedIterator.Event.Message.FeeTokenAmount, + Data: sendRequestedIterator.Event.Message.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: sendRequestedIterator.Event.Message.SourceTokenData, + MessageId: sendRequestedIterator.Event.Message.MessageId, + } + msgs = append(msgs, msg) + if args.GasLimit != nil { + msg.GasLimit = args.GasLimit + } + manualExecGasLimits = append(manualExecGasLimits, msg.GasLimit) + var msgTokenData [][]byte + for range sendRequestedIterator.Event.Message.TokenAmounts { + msgTokenData = append(msgTokenData, []byte{}) + } + + tokenData = append(tokenData, msgTokenData) + prove = curr + } + curr++ + } + } + sendRequestedIterator.Close() + if msgs == nil { + return nil, fmt.Errorf("unable to find msg with seqNr %d", seqNr) + } + tree, err := merklemulti.NewTree(mctx, leaves) + if err != nil { + return nil, err + } + if tree.Root() != report.MerkleRoot { + return nil, errors.New("root doesn't match") + } + + proof, err := tree.Prove([]int{prove}) + if err != nil { + return nil, err + } + + offRampProof := evm_2_evm_offramp.InternalExecutionReport{ + Messages: msgs, + OffchainTokenData: tokenData, + Proofs: proof.Hashes, + ProofFlagBits: abihelpers.ProofFlagsToBits(proof.SourceFlags), + } + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(common.HexToAddress(args.OffRamp), args.DestChain) + if err != nil { + return nil, err + } + // Execute. + return offRamp.ManuallyExecute(args.DestUser, offRampProof, manualExecGasLimits) +} + +func (c *CCIPContracts) ExecuteMessage( + t *testing.T, + req logpoller.Log, + txHash common.Hash, + destStartBlock uint64, +) uint64 { + t.Log("Executing request manually") + sendReqReceipt, err := c.Source.Chain.TransactionReceipt(context.Background(), txHash) + require.NoError(t, err) + args := ManualExecArgs{ + SourceChainID: c.Source.ChainID, + DestChainID: c.Dest.ChainID, + DestUser: c.Dest.User, + SourceChain: c.Source.Chain, + DestChain: c.Dest.Chain, + SourceStartBlock: sendReqReceipt.BlockNumber, + DestStartBlock: destStartBlock, + // FIXME + //DestLatestBlockNum: c.Dest.Chain.Blockchain().CurrentBlock().Number.Uint64(), + //nolint:gosec // safe to casts in tests + SendReqLogIndex: uint(req.LogIndex), + SendReqTxHash: txHash.String(), + CommitStore: c.Dest.CommitStore.Address().String(), + OnRamp: c.Source.OnRamp.Address().String(), + OffRamp: c.Dest.OffRamp.Address().String(), + } + tx, err := args.ExecuteManually() + require.NoError(t, err) + c.Dest.Chain.Commit() + c.Source.Chain.Commit() + rec, err := c.Dest.Chain.TransactionReceipt(context.Background(), tx.Hash()) + require.NoError(t, err) + require.Equal(t, uint64(1), rec.Status, "manual execution failed") + t.Logf("Manual Execution completed for seqNum %d", args.SeqNr) + return args.SeqNr +} + +func GetBalance(t *testing.T, chain bind.ContractBackend, tokenAddr common.Address, addr common.Address) *big.Int { + token, err := link_token_interface.NewLinkToken(tokenAddr, chain) + require.NoError(t, err) + bal, err := token.BalanceOf(nil, addr) + require.NoError(t, err) + return bal +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go new file mode 100644 index 00000000000..cec58136b5c --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go @@ -0,0 +1,1054 @@ +//nolint:revive // helpers for specific version +package testhelpers_1_4_0 + +import ( + "context" + "encoding/hex" + "fmt" + "math/big" + "net/http" + "net/http/httptest" + "strconv" + "strings" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + types3 "github.com/ethereum/go-ethereum/core/types" + "github.com/google/uuid" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/jmoiron/sqlx" + "github.com/onsi/gomega" + "github.com/pkg/errors" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "k8s.io/utils/pointer" //nolint:staticcheck // tests + + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + types4 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + pb "github.com/smartcontractkit/chainlink-protos/orchestrator/feedsmanager" + + evmcapabilities "github.com/smartcontractkit/chainlink/v2/core/capabilities" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + v2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + evmUtils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/logger/audit" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + feeds2 "github.com/smartcontractkit/chainlink/v2/core/services/feeds" + feedsMocks "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + ksMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" + evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + clutils "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" + "github.com/smartcontractkit/chainlink/v2/plugins" +) + +const ( + execSpecTemplate = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-exec-1" + externalJobID = "67ffad71-d90f-4fe3-b4e4-494924b707fb" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-execution" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + + [pluginConfig.USDCConfig] + AttestationAPI = "http://blah.com" + SourceMessageTransmitterAddress = "%s" + SourceTokenAddress = "%s" + AttestationAPITimeoutSeconds = 10 + ` + commitSpecTemplatePipeline = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-commit-1" + externalJobID = "13c997cf-1a14-4ab7-9068-07ee6d2afa55" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-commit" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + offRamp = "%s" + tokenPricesUSDPipeline = """ + %s + """ + ` + commitSpecTemplateDynamicPriceGetter = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-commit-1" + externalJobID = "13c997cf-1a14-4ab7-9068-07ee6d2afa55" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-commit" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + offRamp = "%s" + priceGetterConfig = """ + %s + """ + ` +) + +type Node struct { + App chainlink.Application + Transmitter common.Address + PaymentReceiver common.Address + KeyBundle ocr2key.KeyBundle +} + +func (node *Node) FindJobIDForContract(t *testing.T, addr common.Address) int32 { + jobs := node.App.JobSpawner().ActiveJobs() + for _, j := range jobs { + if j.Type == job.OffchainReporting2 && j.OCR2OracleSpec.ContractID == addr.Hex() { + return j.ID + } + } + t.Fatalf("Could not find job for contract %s", addr.Hex()) + return 0 +} + +func (node *Node) EventuallyNodeUsesUpdatedPriceRegistry(t *testing.T, ccipContracts CCIPIntegrationTestHarness) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + v1_2_0.UsdPerUnitGasUpdated, + ccipContracts.Dest.PriceRegistry.Address(), + 0, + ) + // err can be transient errors such as sql row set empty + if err != nil { + return false + } + return log != nil + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is not using updated price registry %s", ccipContracts.Dest.PriceRegistry.Address().Hex()) + return log +} + +func (node *Node) EventuallyNodeUsesNewCommitConfig(t *testing.T, ccipContracts CCIPIntegrationTestHarness, commitCfg ccipdata.CommitOnchainConfig) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + evmrelay.OCR2AggregatorLogDecoder.EventSig(), + ccipContracts.Dest.CommitStore.Address(), + 0, + ) + require.NoError(t, err) + var latestCfg ccipdata.CommitOnchainConfig + if log != nil { + latestCfg, err = DecodeCommitOnChainConfig(log.Data) + require.NoError(t, err) + return latestCfg == commitCfg + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is using old cfg") + return log +} + +func (node *Node) EventuallyNodeUsesNewExecConfig(t *testing.T, ccipContracts CCIPIntegrationTestHarness, execCfg v1_2_0.ExecOnchainConfig) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + evmrelay.OCR2AggregatorLogDecoder.EventSig(), + ccipContracts.Dest.OffRamp.Address(), + 0, + ) + require.NoError(t, err) + var latestCfg v1_2_0.ExecOnchainConfig + if log != nil { + latestCfg, err = DecodeExecOnChainConfig(log.Data) + require.NoError(t, err) + return latestCfg == execCfg + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is using old cfg") + return log +} + +//nolint:gosec // safe cast in tests +func (node *Node) EventuallyHasReqSeqNum(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, onRamp common.Address, seqNum int) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Source.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().LogsDataWordRange( + testutils.Context(t), + v1_2_0.CCIPSendRequestEventSig, + onRamp, + v1_2_0.CCIPSendRequestSeqNumIndex, + abihelpers.EvmWord(uint64(seqNum)), + abihelpers.EvmWord(uint64(seqNum)), + 1, + ) + require.NoError(t, err) + t.Log("Send requested", len(lgs)) + if len(lgs) == 1 { + log = lgs[0] + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "eventually has seq num") + return log +} + +//nolint:gosec // safe cast in tests +func (node *Node) EventuallyHasExecutedSeqNums(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, offRamp common.Address, minSeqNum int, maxSeqNum int) []logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var logs []logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().IndexedLogsTopicRange( + testutils.Context(t), + v1_2_0.ExecutionStateChangedEvent, + offRamp, + v1_2_0.ExecutionStateChangedSeqNrIndex, + abihelpers.EvmWord(uint64(minSeqNum)), + abihelpers.EvmWord(uint64(maxSeqNum)), + 1, + ) + require.NoError(t, err) + t.Logf("Have executed logs %d want %d", len(lgs), maxSeqNum-minSeqNum+1) + if len(lgs) == maxSeqNum-minSeqNum+1 { + logs = lgs + t.Logf("Seq Num %d-%d executed", minSeqNum, maxSeqNum) + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "eventually has not executed seq num") + return logs +} + +//nolint:gosec // safe to casts in tests +func (node *Node) ConsistentlySeqNumHasNotBeenExecuted(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, offRamp common.Address, seqNum int) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Consistently(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().IndexedLogsTopicRange( + testutils.Context(t), + v1_2_0.ExecutionStateChangedEvent, + offRamp, + v1_2_0.ExecutionStateChangedSeqNrIndex, + abihelpers.EvmWord(uint64(seqNum)), + abihelpers.EvmWord(uint64(seqNum)), + 1, + ) + require.NoError(t, err) + t.Log("Executed logs", lgs) + if len(lgs) == 1 { + log = lgs[0] + return true + } + return false + }, 10*time.Second, 1*time.Second).Should(gomega.BeFalse(), "seq number got executed") + return log +} + +func (node *Node) AddJob(t *testing.T, spec *integrationtesthelpers.OCR2TaskJobSpec) { + specString, err := spec.String() + require.NoError(t, err) + ccipJob, err := validate.ValidatedOracleSpecToml( + testutils.Context(t), + node.App.GetConfig().OCR2(), + node.App.GetConfig().Insecure(), + specString, + // FIXME Ani + nil, + ) + require.NoError(t, err) + err = node.App.AddJobV2(context.Background(), &ccipJob) + require.NoError(t, err) +} + +func (node *Node) AddBootstrapJob(t *testing.T, spec *integrationtesthelpers.OCR2TaskJobSpec) { + specString, err := spec.String() + require.NoError(t, err) + ccipJob, err := ocrbootstrap.ValidatedBootstrapSpecToml(specString) + require.NoError(t, err) + err = node.App.AddJobV2(context.Background(), &ccipJob) + require.NoError(t, err) +} + +func (node *Node) AddJobsWithSpec(t *testing.T, jobSpec *integrationtesthelpers.OCR2TaskJobSpec) { + // set node specific values + jobSpec.OCR2OracleSpec.OCRKeyBundleID.SetValid(node.KeyBundle.ID()) + jobSpec.OCR2OracleSpec.TransmitterID.SetValid(node.Transmitter.Hex()) + node.AddJob(t, jobSpec) +} + +func setupNodeCCIP( + t *testing.T, + owner *bind.TransactOpts, + port int64, + dbName string, + sourceChain *backends.SimulatedBackend, destChain *backends.SimulatedBackend, + sourceChainID *big.Int, destChainID *big.Int, + bootstrapPeerID string, + bootstrapPort int64, +) (chainlink.Application, string, common.Address, ocr2key.KeyBundle) { + trueRef, falseRef := true, false + + // Do not want to load fixtures as they contain a dummy chainID. + loglevel := configv2.LogLevel(zap.DebugLevel) + config, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, _ *chainlink.Secrets) { + p2pAddresses := []string{ + fmt.Sprintf("127.0.0.1:%d", port), + } + c.Log.Level = &loglevel + c.Feature.CCIP = &trueRef + c.Feature.UICSAKeys = &trueRef + c.Feature.FeedsManager = &trueRef + c.OCR.Enabled = &falseRef + c.OCR.DefaultTransactionQueueDepth = pointer.Uint32(200) + c.OCR2.Enabled = &trueRef + c.Feature.LogPoller = &trueRef + c.P2P.V2.Enabled = &trueRef + + dur, err := config.NewDuration(500 * time.Millisecond) + if err != nil { + panic(err) + } + c.P2P.V2.DeltaDial = &dur + + dur2, err := config.NewDuration(5 * time.Second) + if err != nil { + panic(err) + } + + c.P2P.V2.DeltaReconcile = &dur2 + c.P2P.V2.ListenAddresses = &p2pAddresses + c.P2P.V2.AnnounceAddresses = &p2pAddresses + + c.EVM = []*v2.EVMConfig{createConfigV2Chain(sourceChainID), createConfigV2Chain(destChainID)} + + if bootstrapPeerID != "" { + // Supply the bootstrap IP and port as a V2 peer address + c.P2P.V2.DefaultBootstrappers = &[]commontypes.BootstrapperLocator{ + { + PeerID: bootstrapPeerID, Addrs: []string{ + fmt.Sprintf("127.0.0.1:%d", bootstrapPort), + }, + }, + } + } + }) + + lggr := logger.TestLogger(t) + + // The in-memory geth sim does not let you create a custom ChainID, it will always be 1337. + // In particular this means that if you sign an eip155 tx, the chainID used MUST be 1337 + // and the CHAINID op code will always emit 1337. To work around this to simulate a "multichain" + // test, we fake different chainIDs using the wrapped sim cltest.SimulatedBackend so the RPC + // appears to operate on different chainIDs and we use an EthKeyStoreSim wrapper which always + // signs 1337 see https://github.com/smartcontractkit/chainlink-ccip/blob/a24dd436810250a458d27d8bb3fb78096afeb79c/core/services/ocr2/plugins/ccip/testhelpers/simulated_backend.go#L35 + sourceClient := client.NewSimulatedBackendClient(t, sourceChain.Backend, sourceChainID) + destClient := client.NewSimulatedBackendClient(t, destChain.Backend, destChainID) + csaKeyStore := ksMocks.NewCSA(t) + + key, err := csakey.NewV2() + require.NoError(t, err) + csaKeyStore.On("GetAll").Return([]csakey.KeyV2{key}, nil) + keyStore := NewKsa(db, lggr, csaKeyStore) + + simEthKeyStore := testhelpers.EthKeyStoreSim{ + ETHKS: keyStore.Eth(), + CSAKS: keyStore.CSA(), + } + mailMon := mailbox.NewMonitor("CCIP", lggr.Named("Mailbox")) + evmOpts := chainlink.EVMFactoryConfig{ + ChainOpts: legacyevm.ChainOpts{ + AppConfig: config, + GenEthClient: func(chainID *big.Int) client.Client { + if chainID.String() == sourceChainID.String() { + return sourceClient + } else if chainID.String() == destChainID.String() { + return destClient + } + t.Fatalf("invalid chain ID %v", chainID.String()) + return nil + }, + MailMon: mailMon, + DS: db, + }, + CSAETHKeystore: simEthKeyStore, + } + loopRegistry := plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), config.Tracing(), config.Telemetry(), nil, "") + relayerFactory := chainlink.RelayerFactory{ + Logger: lggr, + LoopRegistry: loopRegistry, + GRPCOpts: loop.GRPCOpts{}, + CapabilitiesRegistry: evmcapabilities.NewRegistry(lggr), + } + testCtx := testutils.Context(t) + // evm alway enabled for backward compatibility + initOps := []chainlink.CoreRelayerChainInitFunc{ + chainlink.InitEVM(testCtx, relayerFactory, evmOpts), + } + + relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) + if err != nil { + t.Fatal(err) + } + + app, err := chainlink.NewApplication(chainlink.ApplicationOpts{ + Config: config, + DS: db, + KeyStore: keyStore, + RelayerChainInteroperators: relayChainInterops, + Logger: lggr, + ExternalInitiatorManager: nil, + CloseLogger: lggr.Sync, + UnrestrictedHTTPClient: &http.Client{}, + RestrictedHTTPClient: &http.Client{}, + AuditLogger: audit.NoopLogger, + MailMon: mailMon, + LoopRegistry: plugins.NewLoopRegistry(lggr, config.Tracing(), config.Telemetry(), nil, ""), + }) + ctx := testutils.Context(t) + require.NoError(t, err) + require.NoError(t, app.GetKeyStore().Unlock(ctx, "password")) + _, err = app.GetKeyStore().P2P().Create(ctx) + require.NoError(t, err) + + p2pIDs, err := app.GetKeyStore().P2P().GetAll() + require.NoError(t, err) + require.Len(t, p2pIDs, 1) + peerID := p2pIDs[0].PeerID() + + _, err = app.GetKeyStore().Eth().Create(testCtx, destChainID) + require.NoError(t, err) + sendingKeys, err := app.GetKeyStore().Eth().EnabledKeysForChain(testCtx, destChainID) + require.NoError(t, err) + require.Len(t, sendingKeys, 1) + transmitter := sendingKeys[0].Address + s, err := app.GetKeyStore().Eth().GetState(testCtx, sendingKeys[0].ID(), destChainID) + require.NoError(t, err) + lggr.Debug(fmt.Sprintf("Transmitter address %s chainID %s", transmitter, s.EVMChainID.String())) + + // Fund the commitTransmitter address with some ETH + n, err := destChain.NonceAt(context.Background(), owner.From, nil) + require.NoError(t, err) + + tx := types3.NewTransaction(n, transmitter, big.NewInt(1000000000000000000), 21000, big.NewInt(1000000000), nil) + signedTx, err := owner.Signer(owner.From, tx) + require.NoError(t, err) + err = destChain.SendTransaction(context.Background(), signedTx) + require.NoError(t, err) + destChain.Commit() + + kb, err := app.GetKeyStore().OCR2().Create(ctx, chaintype.EVM) + require.NoError(t, err) + return app, peerID.Raw(), transmitter, kb +} + +func createConfigV2Chain(chainID *big.Int) *v2.EVMConfig { + // NOTE: For the executor jobs, the default of 500k is insufficient for a 3 message batch + defaultGasLimit := uint64(5000000) + tr := true + + sourceC := v2.Defaults((*evmUtils.Big)(chainID)) + sourceC.GasEstimator.LimitDefault = &defaultGasLimit + fixedPrice := "FixedPrice" + sourceC.GasEstimator.Mode = &fixedPrice + d, _ := config.NewDuration(100 * time.Millisecond) + sourceC.LogPollInterval = &d + fd := uint32(2) + sourceC.FinalityDepth = &fd + return &v2.EVMConfig{ + ChainID: (*evmUtils.Big)(chainID), + Enabled: &tr, + Chain: sourceC, + Nodes: v2.EVMNodes{&v2.Node{}}, + } +} + +type CCIPIntegrationTestHarness struct { + CCIPContracts + Nodes []Node + Bootstrap Node +} + +func SetupCCIPIntegrationTH(t *testing.T, sourceChainID, sourceChainSelector, destChainId, destChainSelector uint64) CCIPIntegrationTestHarness { + return CCIPIntegrationTestHarness{ + CCIPContracts: SetupCCIPContracts(t, sourceChainID, sourceChainSelector, destChainId, destChainSelector), + } +} + +//nolint:testifylint //require is used for assertions in handlers +func (c *CCIPIntegrationTestHarness) CreatePricesPipeline(t *testing.T) (string, *httptest.Server, *httptest.Server) { + linkUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"UsdPerLink": "8000000000000000000"}`)) + require.NoError(t, err) + })) + ethUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"UsdPerETH": "1700000000000000000000"}`)) + require.NoError(t, err) + })) + sourceWrappedNative, err := c.Source.Router.GetWrappedNative(nil) + require.NoError(t, err) + destWrappedNative, err := c.Dest.Router.GetWrappedNative(nil) + require.NoError(t, err) + tokenPricesUSDPipeline := fmt.Sprintf(` +// Price 1 +link [type=http method=GET url="%s"]; +link_parse [type=jsonparse path="UsdPerLink"]; +link->link_parse; +eth [type=http method=GET url="%s"]; +eth_parse [type=jsonparse path="UsdPerETH"]; +eth->eth_parse; +merge [type=merge left="{}" right="{\\\"%s\\\":$(link_parse), \\\"%s\\\":$(eth_parse), \\\"%s\\\":$(eth_parse)}"];`, + linkUSD.URL, ethUSD.URL, c.Dest.LinkToken.Address(), sourceWrappedNative, destWrappedNative) + + return tokenPricesUSDPipeline, linkUSD, ethUSD +} + +func (c *CCIPIntegrationTestHarness) AddAllJobs(t *testing.T, jobParams integrationtesthelpers.CCIPJobSpecParams) { + jobParams.OffRamp = c.Dest.OffRamp.Address() + + commitSpec, err := jobParams.CommitJobSpec() + require.NoError(t, err) + geExecutionSpec, err := jobParams.ExecutionJobSpec() + require.NoError(t, err) + nodes := c.Nodes + for _, node := range nodes { + node.AddJobsWithSpec(t, commitSpec) + node.AddJobsWithSpec(t, geExecutionSpec) + } +} + +func (c *CCIPIntegrationTestHarness) jobSpecProposal(t *testing.T, specTemplate string, f func() (*integrationtesthelpers.OCR2TaskJobSpec, error), feedsManagerId int64, version int32, opts ...any) feeds2.ProposeJobArgs { + spec, err := f() + require.NoError(t, err) + + args := []any{spec.OCR2OracleSpec.ContractID} + args = append(args, opts...) + + return feeds2.ProposeJobArgs{ + FeedsManagerID: feedsManagerId, + RemoteUUID: uuid.New(), + Multiaddrs: nil, + Version: version, + Spec: fmt.Sprintf(specTemplate, args...), + } +} + +func (c *CCIPIntegrationTestHarness) SetupFeedsManager(t *testing.T) { + ctx := testutils.Context(t) + for _, node := range c.Nodes { + f := node.App.GetFeedsService() + + managers, err := f.ListManagers(ctx) + require.NoError(t, err) + if len(managers) > 0 { + // Use at most one feeds manager, don't register if one already exists + continue + } + + secret := utils.RandomBytes32() + pkey, err := crypto.PublicKeyFromHex(hex.EncodeToString(secret[:])) + require.NoError(t, err) + + m := feeds2.RegisterManagerParams{ + Name: "CCIP", + URI: "http://localhost:8080", + PublicKey: *pkey, + } + + _, err = f.RegisterManager(testutils.Context(t), m) + require.NoError(t, err) + + connManager := feedsMocks.NewConnectionsManager(t) + connManager.On("GetClient", mock.Anything).Maybe().Return(NoopFeedsClient{}, nil) + connManager.On("Close").Maybe().Return() + connManager.On("IsConnected", mock.Anything).Maybe().Return(true) + f.Unsafe_SetConnectionsManager(connManager) + } +} + +func (c *CCIPIntegrationTestHarness) ApproveJobSpecs(t *testing.T, jobParams integrationtesthelpers.CCIPJobSpecParams) { + ctx := testutils.Context(t) + + for _, node := range c.Nodes { + f := node.App.GetFeedsService() + managers, err := f.ListManagers(ctx) + require.NoError(t, err) + require.Len(t, managers, 1, "expected exactly one feeds manager") + + execSpec := c.jobSpecProposal( + t, + execSpecTemplate, + jobParams.ExecutionJobSpec, + managers[0].ID, + 1, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + utils.RandomAddress().String(), + utils.RandomAddress().String(), + ) + execID, err := f.ProposeJob(ctx, &execSpec) + require.NoError(t, err) + + err = f.ApproveSpec(ctx, execID, true) + require.NoError(t, err) + + var commitSpec feeds2.ProposeJobArgs + if jobParams.TokenPricesUSDPipeline != "" { + commitSpec = c.jobSpecProposal( + t, + commitSpecTemplatePipeline, + jobParams.CommitJobSpec, + managers[0].ID, + 2, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + jobParams.OffRamp.String(), + jobParams.TokenPricesUSDPipeline, + ) + } else { + commitSpec = c.jobSpecProposal( + t, + commitSpecTemplateDynamicPriceGetter, + jobParams.CommitJobSpec, + managers[0].ID, + 2, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + jobParams.OffRamp.String(), + jobParams.PriceGetterConfig, + ) + } + + commitID, err := f.ProposeJob(ctx, &commitSpec) + require.NoError(t, err) + + err = f.ApproveSpec(ctx, commitID, true) + require.NoError(t, err) + } +} + +func (c *CCIPIntegrationTestHarness) AllNodesHaveReqSeqNum(t *testing.T, seqNum int, onRampOpts ...common.Address) logpoller.Log { + var log logpoller.Log + nodes := c.Nodes + var onRamp common.Address + if len(onRampOpts) > 0 { + onRamp = onRampOpts[0] + } else { + require.NotNil(t, c.Source.OnRamp, "no onramp configured") + onRamp = c.Source.OnRamp.Address() + } + for _, node := range nodes { + log = node.EventuallyHasReqSeqNum(t, c, onRamp, seqNum) + } + return log +} + +func (c *CCIPIntegrationTestHarness) AllNodesHaveExecutedSeqNums(t *testing.T, minSeqNum int, maxSeqNum int, offRampOpts ...common.Address) []logpoller.Log { + var logs []logpoller.Log + nodes := c.Nodes + var offRamp common.Address + + if len(offRampOpts) > 0 { + offRamp = offRampOpts[0] + } else { + require.NotNil(t, c.Dest.OffRamp, "no offramp configured") + offRamp = c.Dest.OffRamp.Address() + } + for _, node := range nodes { + logs = node.EventuallyHasExecutedSeqNums(t, c, offRamp, minSeqNum, maxSeqNum) + } + return logs +} + +func (c *CCIPIntegrationTestHarness) NoNodesHaveExecutedSeqNum(t *testing.T, seqNum int, offRampOpts ...common.Address) logpoller.Log { + var log logpoller.Log + nodes := c.Nodes + var offRamp common.Address + if len(offRampOpts) > 0 { + offRamp = offRampOpts[0] + } else { + require.NotNil(t, c.Dest.OffRamp, "no offramp configured") + offRamp = c.Dest.OffRamp.Address() + } + for _, node := range nodes { + log = node.ConsistentlySeqNumHasNotBeenExecuted(t, c, offRamp, seqNum) + } + return log +} + +func (c *CCIPIntegrationTestHarness) EventuallyCommitReportAccepted(t *testing.T, currentBlock uint64, commitStoreOpts ...common.Address) commit_store_1_2_0.CommitStoreCommitReport { + var commitStore *commit_store_1_2_0.CommitStore + var err error + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + g := gomega.NewGomegaWithT(t) + var report commit_store_1_2_0.CommitStoreCommitReport + g.Eventually(func() bool { + it, err := commitStore.FilterReportAccepted(&bind.FilterOpts{Start: currentBlock}) + g.Expect(err).NotTo(gomega.HaveOccurred(), "Error filtering ReportAccepted event") + g.Expect(it.Next()).To(gomega.BeTrue(), "No ReportAccepted event found") + report = it.Event.Report + if report.MerkleRoot != [32]byte{} { + t.Log("Report Accepted by commitStore") + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "report has not been committed") + return report +} + +func (c *CCIPIntegrationTestHarness) EventuallyExecutionStateChangedToSuccess(t *testing.T, seqNum []uint64, blockNum uint64, offRampOpts ...common.Address) { + var offRamp *evm_2_evm_offramp_1_2_0.EVM2EVMOffRamp + var err error + if len(offRampOpts) > 0 { + offRamp, err = evm_2_evm_offramp_1_2_0.NewEVM2EVMOffRamp(offRampOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.OffRamp, "no offRamp configured") + offRamp = c.Dest.OffRamp + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + it, err := offRamp.FilterExecutionStateChanged(&bind.FilterOpts{Start: blockNum}, seqNum, [][32]byte{}) + require.NoError(t, err) + for it.Next() { + if cciptypes.MessageExecutionState(it.Event.State) == cciptypes.ExecutionStateSuccess { + t.Logf("ExecutionStateChanged event found for seqNum %d", it.Event.SequenceNumber) + return true + } + } + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + return false + }, testutils.WaitTimeout(t), time.Second). + Should(gomega.BeTrue(), "ExecutionStateChanged Event") +} + +//nolint:gosec // safe to casts in tests +func (c *CCIPIntegrationTestHarness) EventuallyReportCommitted(t *testing.T, maxSeqNr int, commitStoreOpts ...common.Address) uint64 { + var commitStore *commit_store_1_2_0.CommitStore + var err error + var committedSeqNum uint64 + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + minSeqNum, err := commitStore.GetExpectedNextSequenceNumber(nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + t.Log("next expected seq num reported", minSeqNum) + committedSeqNum = minSeqNum + return minSeqNum > uint64(maxSeqNr) + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue(), "report has not been committed") + return committedSeqNum +} + +func (c *CCIPIntegrationTestHarness) EventuallySendRequested(t *testing.T, seqNum uint64, onRampOpts ...common.Address) { + var onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp + var err error + if len(onRampOpts) > 0 { + onRamp, err = evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(onRampOpts[0], c.Source.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Source.OnRamp, "no onRamp configured") + onRamp = c.Source.OnRamp + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + it, err := onRamp.FilterCCIPSendRequested(nil) + require.NoError(t, err) + for it.Next() { + if it.Event.Message.SequenceNumber == seqNum { + t.Log("sendRequested generated for", seqNum) + return true + } + } + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + return false + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue(), "sendRequested has not been generated") +} + +//nolint:gosec // safe to cast in tests +func (c *CCIPIntegrationTestHarness) ConsistentlyReportNotCommitted(t *testing.T, maxSeqNr int, commitStoreOpts ...common.Address) { + var commitStore *commit_store_1_2_0.CommitStore + var err error + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + gomega.NewGomegaWithT(t).Consistently(func() bool { + minSeqNum, err := commitStore.GetExpectedNextSequenceNumber(nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + t.Log("min seq num reported", minSeqNum) + return minSeqNum > uint64(maxSeqNr) + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeFalse(), "report has been committed") +} + +func (c *CCIPIntegrationTestHarness) SetupAndStartNodes(ctx context.Context, t *testing.T, bootstrapNodePort int64) (Node, []Node, int64) { + appBootstrap, bootstrapPeerID, bootstrapTransmitter, bootstrapKb := setupNodeCCIP(t, c.Dest.User, bootstrapNodePort, + "bootstrap_ccip", c.Source.Chain, c.Dest.Chain, big.NewInt(0).SetUint64(c.Source.ChainID), + big.NewInt(0).SetUint64(c.Dest.ChainID), "", 0) + var ( + oracles []confighelper.OracleIdentityExtra + nodes []Node + ) + err := appBootstrap.Start(ctx) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, appBootstrap.Stop()) + }) + bootstrapNode := Node{ + App: appBootstrap, + Transmitter: bootstrapTransmitter, + KeyBundle: bootstrapKb, + } + // Set up the minimum 4 oracles all funded with destination ETH + for i := int64(0); i < 4; i++ { + app, peerID, transmitter, kb := setupNodeCCIP( + t, + c.Dest.User, + int64(freeport.GetOne(t)), + fmt.Sprintf("oracle_ccip%d", i), + c.Source.Chain, + c.Dest.Chain, + big.NewInt(0).SetUint64(c.Source.ChainID), + big.NewInt(0).SetUint64(c.Dest.ChainID), + bootstrapPeerID, + bootstrapNodePort, + ) + nodes = append(nodes, Node{ + App: app, + Transmitter: transmitter, + KeyBundle: kb, + }) + offchainPublicKey, _ := hex.DecodeString(strings.TrimPrefix(kb.OnChainPublicKey(), "0x")) + oracles = append(oracles, confighelper.OracleIdentityExtra{ + OracleIdentity: confighelper.OracleIdentity{ + OnchainPublicKey: offchainPublicKey, + TransmitAccount: types4.Account(transmitter.String()), + OffchainPublicKey: kb.OffchainPublicKey(), + PeerID: peerID, + }, + ConfigEncryptionPublicKey: kb.ConfigEncryptionPublicKey(), + }) + err = app.Start(ctx) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, app.Stop()) + }) + } + + c.Oracles = oracles + commitOnchainConfig := c.CreateDefaultCommitOnchainConfig(t) + commitOffchainConfig := c.CreateDefaultCommitOffchainConfig(t) + execOnchainConfig := c.CreateDefaultExecOnchainConfig(t) + execOffchainConfig := c.CreateDefaultExecOffchainConfig(t) + + configBlock := c.SetupOnchainConfig(t, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig) + c.Nodes = nodes + c.Bootstrap = bootstrapNode + return bootstrapNode, nodes, configBlock +} + +func (c *CCIPIntegrationTestHarness) SetUpNodesAndJobs(t *testing.T, pricePipeline string, priceGetterConfig string, usdcAttestationAPI string) integrationtesthelpers.CCIPJobSpecParams { + // setup Jobs + ctx := context.Background() + // Starts nodes and configures them in the OCR contracts. + bootstrapNode, _, configBlock := c.SetupAndStartNodes(ctx, t, int64(freeport.GetOne(t))) + + jobParams := c.NewCCIPJobSpecParams(pricePipeline, priceGetterConfig, configBlock, usdcAttestationAPI) + + // Add the bootstrap job + c.Bootstrap.AddBootstrapJob(t, jobParams.BootstrapJob(c.Dest.CommitStore.Address().Hex())) + c.AddAllJobs(t, jobParams) + + // Replay for bootstrap. + bc, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(c.Dest.ChainID, 10)) + require.NoError(t, err) + require.NoError(t, bc.LogPoller().Replay(context.Background(), configBlock)) + c.Dest.Chain.Commit() + + return jobParams +} + +//nolint:gosec // safe to cast in tests +func (c *CCIPIntegrationTestHarness) NewCCIPJobSpecParams(tokenPricesUSDPipeline string, priceGetterConfig string, configBlock int64, usdcAttestationAPI string) integrationtesthelpers.CCIPJobSpecParams { + return integrationtesthelpers.CCIPJobSpecParams{ + CommitStore: c.Dest.CommitStore.Address(), + OffRamp: c.Dest.OffRamp.Address(), + DestEvmChainId: c.Dest.ChainID, + SourceChainName: "SimulatedSource", + DestChainName: "SimulatedDest", + TokenPricesUSDPipeline: tokenPricesUSDPipeline, + PriceGetterConfig: priceGetterConfig, + DestStartBlock: uint64(configBlock), + USDCAttestationAPI: usdcAttestationAPI, + } +} + +func DecodeCommitOnChainConfig(encoded []byte) (ccipdata.CommitOnchainConfig, error) { + var onchainConfig ccipdata.CommitOnchainConfig + unpacked, err := abihelpers.DecodeOCR2Config(encoded) + if err != nil { + return onchainConfig, err + } + onChainCfg := unpacked.OnchainConfig + onchainConfig, err = abihelpers.DecodeAbiStruct[ccipdata.CommitOnchainConfig](onChainCfg) + if err != nil { + return onchainConfig, err + } + return onchainConfig, nil +} + +func DecodeExecOnChainConfig(encoded []byte) (v1_2_0.ExecOnchainConfig, error) { + var onchainConfig v1_2_0.ExecOnchainConfig + unpacked, err := abihelpers.DecodeOCR2Config(encoded) + if err != nil { + return onchainConfig, errors.Wrap(err, "failed to unpack log data") + } + onChainCfg := unpacked.OnchainConfig + onchainConfig, err = abihelpers.DecodeAbiStruct[v1_2_0.ExecOnchainConfig](onChainCfg) + if err != nil { + return onchainConfig, err + } + return onchainConfig, nil +} + +type ksa struct { + keystore.Master + csa keystore.CSA +} + +func (k *ksa) CSA() keystore.CSA { + return k.csa +} + +func NewKsa(db *sqlx.DB, lggr logger.Logger, csa keystore.CSA) *ksa { + return &ksa{ + Master: keystore.New(db, clutils.FastScryptParams, lggr), + csa: csa, + } +} + +type NoopFeedsClient struct{} + +func (n NoopFeedsClient) ApprovedJob(context.Context, *pb.ApprovedJobRequest) (*pb.ApprovedJobResponse, error) { + return &pb.ApprovedJobResponse{}, nil +} + +func (n NoopFeedsClient) Healthcheck(context.Context, *pb.HealthcheckRequest) (*pb.HealthcheckResponse, error) { + return &pb.HealthcheckResponse{}, nil +} + +func (n NoopFeedsClient) UpdateNode(context.Context, *pb.UpdateNodeRequest) (*pb.UpdateNodeResponse, error) { + return &pb.UpdateNodeResponse{}, nil +} + +func (n NoopFeedsClient) RejectedJob(context.Context, *pb.RejectedJobRequest) (*pb.RejectedJobResponse, error) { + return &pb.RejectedJobResponse{}, nil +} + +func (n NoopFeedsClient) CancelledJob(context.Context, *pb.CancelledJobRequest) (*pb.CancelledJobResponse, error) { + return &pb.CancelledJobResponse{}, nil +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go new file mode 100644 index 00000000000..adfdfd9283e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go @@ -0,0 +1,76 @@ +// Package testhelpers_1_4_0 pkg with set of configs that should be used only within tests suites +// +//nolint:revive // used in tests +package testhelpers_1_4_0 + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" +) + +var PermissionLessExecutionThresholdSeconds = uint32(testhelpers.FirstBlockAge.Seconds()) + +func (c *CCIPContracts) CreateDefaultCommitOnchainConfig(t *testing.T) []byte { + config, err := abihelpers.EncodeAbiStruct(ccipdata.CommitOnchainConfig{ + PriceRegistry: c.Dest.PriceRegistry.Address(), + }) + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultCommitOffchainConfig(t *testing.T) []byte { + return c.createCommitOffchainConfig(t, 10*time.Second, 5*time.Second) +} + +func (c *CCIPContracts) createCommitOffchainConfig(t *testing.T, feeUpdateHearBeat time.Duration, inflightCacheExpiry time.Duration) []byte { + config, err := NewCommitOffchainConfig( + *config.MustNewDuration(feeUpdateHearBeat), + 1, + 1, + *config.MustNewDuration(feeUpdateHearBeat), + 1, + *config.MustNewDuration(inflightCacheExpiry), + false, + ).Encode() + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultExecOnchainConfig(t *testing.T) []byte { + config, err := abihelpers.EncodeAbiStruct(v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: PermissionLessExecutionThresholdSeconds, + Router: c.Dest.Router.Address(), + PriceRegistry: c.Dest.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxNumberOfTokensPerMsg: 5, + MaxPoolReleaseOrMintGas: 200_000, + }) + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultExecOffchainConfig(t *testing.T) []byte { + return c.createExecOffchainConfig(t, 1*time.Minute, 1*time.Minute) +} + +func (c *CCIPContracts) createExecOffchainConfig(t *testing.T, inflightCacheExpiry time.Duration, rootSnoozeTime time.Duration) []byte { + config, err := NewExecOffchainConfig( + 1, + 5_000_000, + 0.07, + *config.MustNewDuration(inflightCacheExpiry), + *config.MustNewDuration(rootSnoozeTime), + uint32(0), + ).Encode() + require.NoError(t, err) + return config +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/bgworker.go b/core/services/ocr2/plugins/ccip/tokendata/bgworker.go index bc5aba557e6..458c2e412cc 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/bgworker.go +++ b/core/services/ocr2/plugins/ccip/tokendata/bgworker.go @@ -58,7 +58,7 @@ func NewBackgroundWorker( return &BackgroundWorker{ tokenDataReaders: tokenDataReaders, numWorkers: numWorkers, - jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*100), + jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*200), resultsCache: cache.New(expirationDur, expirationDur/2), timeoutDur: timeoutDur, stopChan: make(services.StopChan), diff --git a/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go b/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go index 79ec21b1b83..dd303822c79 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go +++ b/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go @@ -12,18 +12,21 @@ import ( ) type IHttpClient interface { - // Get issue a GET request to the given url and return the response body and status code. + // Get issues a GET request to the given url and returns the response body and status code. Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) + + // Post issues a POST request to the given url with the given request data and returns the response body and status code. + Post(ctx context.Context, url string, requestData io.Reader, timeout time.Duration) ([]byte, int, http.Header, error) } type HttpClient struct { } -func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) { +func doRequest(ctx context.Context, url string, requestType string, requestBody io.Reader, timeout time.Duration) ([]byte, int, http.Header, error) { // Use a timeout to guard against attestation API hanging, causing observation timeout and failing to make any progress. timeoutCtx, cancel := context.WithTimeoutCause(ctx, timeout, tokendata.ErrTimeout) defer cancel() - req, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, url, nil) + req, err := http.NewRequestWithContext(timeoutCtx, requestType, url, requestBody) if err != nil { return nil, http.StatusBadRequest, nil, err } @@ -46,3 +49,11 @@ func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) body, err := io.ReadAll(res.Body) return body, res.StatusCode, res.Header, err } + +func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) { + return doRequest(ctx, url, http.MethodGet, nil, timeout) +} + +func (s *HttpClient) Post(ctx context.Context, url string, requestBody io.Reader, timeout time.Duration) ([]byte, int, http.Header, error) { + return doRequest(ctx, url, http.MethodPost, requestBody, timeout) +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go b/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go index d8fb9b1c576..bac36abf7ec 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go +++ b/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go @@ -11,7 +11,7 @@ import ( ) var ( - usdcLatencyBuckets = []float64{ + latencyBuckets = []float64{ float64(10 * time.Millisecond), float64(25 * time.Millisecond), float64(50 * time.Millisecond), @@ -29,7 +29,12 @@ var ( usdcClientHistogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "ccip_usdc_client_request_total", Help: "Latency of calls to the USDC client", - Buckets: usdcLatencyBuckets, + Buckets: latencyBuckets, + }, []string{"status", "success"}) + lbtcClientHistogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "ccip_lbtc_client_request_total", + Help: "Latency of calls to the LBTC client", + Buckets: latencyBuckets, }, []string{"status", "success"}) ) @@ -38,11 +43,16 @@ type ObservedIHttpClient struct { histogram *prometheus.HistogramVec } -// NewObservedIHttpClient Create a new ObservedIHttpClient with the USDC client metric. -func NewObservedIHttpClient(origin IHttpClient) *ObservedIHttpClient { +// NewObservedUsdcIHttpClient Create a new ObservedIHttpClient with the USDC client metric. +func NewObservedUsdcIHttpClient(origin IHttpClient) *ObservedIHttpClient { return NewObservedIHttpClientWithMetric(origin, usdcClientHistogram) } +// NewObservedLbtcIHttpClient Create a new ObservedIHttpClient with the LBTC client metric. +func NewObservedLbtcIHttpClient(origin IHttpClient) *ObservedIHttpClient { + return NewObservedIHttpClientWithMetric(origin, lbtcClientHistogram) +} + func NewObservedIHttpClientWithMetric(origin IHttpClient, histogram *prometheus.HistogramVec) *ObservedIHttpClient { return &ObservedIHttpClient{ IHttpClient: origin, diff --git a/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc.go b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc.go new file mode 100644 index 00000000000..76245ef24a5 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc.go @@ -0,0 +1,275 @@ +package lbtc + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/url" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + "golang.org/x/time/rate" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/http" +) + +const ( + apiVersion = "v1" + attestationPath = "deposits/getByHash" + defaultAttestationTimeout = 5 * time.Second + + // defaultCoolDownDurationSec defines the default time to wait after getting rate limited. + // this value is only used if the 429 response does not contain the Retry-After header + defaultCoolDownDuration = 30 * time.Second + + // defaultRequestInterval defines the rate in requests per second that the attestation API can be called. + // this is set according to the APIs recommended 5 requests per second rate limit. + defaultRequestInterval = 200 * time.Millisecond + + // APIIntervalRateLimitDisabled is a special value to disable the rate limiting. + APIIntervalRateLimitDisabled = -1 + // APIIntervalRateLimitDefault is a special value to select the default rate limit interval. + APIIntervalRateLimitDefault = 0 +) + +type attestationStatus string + +const ( + attestationStatusUnspecified attestationStatus = "NOTARIZATION_STATUS_UNSPECIFIED" + attestationStatusPending attestationStatus = "NOTARIZATION_STATUS_PENDING" + attestationStatusSubmitted attestationStatus = "NOTARIZATION_STATUS_SUBMITTED" + attestationStatusSessionApproved attestationStatus = "NOTARIZATION_STATUS_SESSION_APPROVED" + attestationStatusFailed attestationStatus = "NOTARIZATION_STATUS_FAILED" +) + +var ( + ErrUnknownResponse = errors.New("unexpected response from attestation API") +) + +type TokenDataReader struct { + lggr logger.Logger + httpClient http.IHttpClient + attestationAPI *url.URL + attestationAPITimeout time.Duration + lbtcTokenAddress common.Address + rate *rate.Limiter + + // coolDownUntil defines whether requests are blocked or not. + coolDownUntil time.Time + coolDownMu *sync.RWMutex +} + +type messageAttestationResponse struct { + MessageHash string `json:"message_hash"` + Status attestationStatus `json:"status"` + Attestation string `json:"attestation,omitempty"` // Attestation represented by abi.encode(payload, proof) +} + +type attestationRequest struct { + PayloadHashes []string `json:"messageHash"` +} + +type attestationResponse struct { + Attestations []messageAttestationResponse `json:"attestations"` +} + +type sourceTokenData struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + DestGasAmount uint32 +} + +func (m sourceTokenData) AbiString() string { + return `[{ + "components": [ + {"name": "sourcePoolAddress", "type": "bytes"}, + {"name": "destTokenAddress", "type": "bytes"}, + {"name": "extraData", "type": "bytes"}, + {"name": "destGasAmount", "type": "uint32"} + ], + "type": "tuple" + }]` +} + +func (m sourceTokenData) Validate() error { + if len(m.SourcePoolAddress) == 0 { + return errors.New("sourcePoolAddress must be non-empty") + } + if len(m.DestTokenAddress) == 0 { + return errors.New("destTokenAddress must be non-empty") + } + if len(m.ExtraData) == 0 { + return errors.New("extraData must be non-empty") + } + return nil +} + +var _ tokendata.Reader = &TokenDataReader{} + +func NewLBTCTokenDataReader( + lggr logger.Logger, + lbtcAttestationAPI *url.URL, + lbtcAttestationAPITimeoutSeconds int, + lbtcTokenAddress common.Address, + requestInterval time.Duration, +) *TokenDataReader { + timeout := time.Duration(lbtcAttestationAPITimeoutSeconds) * time.Second + if lbtcAttestationAPITimeoutSeconds == 0 { + timeout = defaultAttestationTimeout + } + + if requestInterval == APIIntervalRateLimitDisabled { + requestInterval = 0 + } else if requestInterval == APIIntervalRateLimitDefault { + requestInterval = defaultRequestInterval + } + + return &TokenDataReader{ + lggr: lggr, + httpClient: http.NewObservedLbtcIHttpClient(&http.HttpClient{}), + attestationAPI: lbtcAttestationAPI, + attestationAPITimeout: timeout, + lbtcTokenAddress: lbtcTokenAddress, + coolDownMu: &sync.RWMutex{}, + rate: rate.NewLimiter(rate.Every(requestInterval), 1), + } +} + +func NewLBTCTokenDataReaderWithHTTPClient( + origin TokenDataReader, + httpClient http.IHttpClient, + lbtcTokenAddress common.Address, + requestInterval time.Duration, +) *TokenDataReader { + return &TokenDataReader{ + lggr: origin.lggr, + httpClient: httpClient, + attestationAPI: origin.attestationAPI, + attestationAPITimeout: origin.attestationAPITimeout, + coolDownMu: origin.coolDownMu, + lbtcTokenAddress: lbtcTokenAddress, + rate: rate.NewLimiter(rate.Every(requestInterval), 1), + } +} + +// ReadTokenData queries the LBTC attestation API. +func (s *TokenDataReader) ReadTokenData(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenIndex int) ([]byte, error) { + if tokenIndex < 0 || tokenIndex >= len(msg.TokenAmounts) { + return nil, errors.New("token index out of bounds") + } + + if s.inCoolDownPeriod() { + // rate limiting cool-down period, we prevent new requests from being sent + return nil, tokendata.ErrRequestsBlocked + } + + if s.rate != nil { + // Wait blocks until it the attestation API can be called or the + // context is Done. + if waitErr := s.rate.Wait(ctx); waitErr != nil { + return nil, fmt.Errorf("lbtc rate limiting error: %w", waitErr) + } + } + + decodedSourceTokenData, err := abihelpers.DecodeAbiStruct[sourceTokenData](msg.SourceTokenData[tokenIndex]) + if err != nil { + return []byte{}, err + } + destTokenData := decodedSourceTokenData.ExtraData + // We don't have better way to determine if the extraData is a payload or sha256(payload) + // Last parameter of the payload struct is 32-bytes nonce (see Lombard's Bridge._deposit(...) method), + // so we can assume that payload always exceeds 32 bytes + if len(destTokenData) != 32 { + s.lggr.Infow("SourceTokenData.extraData size is not 32. This is deposit payload, not sha256(payload). Attestation is disabled onchain", + "destTokenData", hexutil.Encode(destTokenData)) + return destTokenData, nil + } + payloadHash := [32]byte(destTokenData) + + msgID := hexutil.Encode(msg.MessageID[:]) + payloadHashHex := hexutil.Encode(payloadHash[:]) + s.lggr.Infow("Calling attestation API", "messageBodyHash", payloadHashHex, "messageID", msgID) + + attestationResp, err := s.callAttestationAPI(ctx, payloadHash) + if err != nil { + return nil, errors.Wrap(err, "failed calling lbtc attestation API") + } + if len(attestationResp.Attestations) == 0 { + return nil, errors.New("attestation response is empty") + } + if len(attestationResp.Attestations) > 1 { + s.lggr.Warnw("Multiple attestations received, expected one", "attestations", attestationResp.Attestations) + } + var attestation messageAttestationResponse + for _, attestationCandidate := range attestationResp.Attestations { + if attestationCandidate.MessageHash == payloadHashHex { + attestation = attestationCandidate + } + } + if attestation == (messageAttestationResponse{}) { + return nil, fmt.Errorf("requested attestation %s not found in response", payloadHashHex) + } + s.lggr.Infow("Got response from attestation API", "messageID", msgID, + "attestationStatus", attestation.Status, "attestation", attestation) + switch attestation.Status { + case attestationStatusSessionApproved: + payloadAndProof, err := hexutil.Decode(attestation.Attestation) + if err != nil { + return nil, err + } + return payloadAndProof, nil + case attestationStatusPending: + return nil, tokendata.ErrNotReady + case attestationStatusSubmitted: + return nil, tokendata.ErrNotReady + default: + s.lggr.Errorw("Unexpected response from attestation API", "attestation", attestation) + return nil, ErrUnknownResponse + } +} + +func (s *TokenDataReader) callAttestationAPI(ctx context.Context, lbtcMessageHash [32]byte) (attestationResponse, error) { + attestationURL := fmt.Sprintf("%s/bridge/%s/%s", s.attestationAPI.String(), apiVersion, attestationPath) + request := attestationRequest{PayloadHashes: []string{hexutil.Encode(lbtcMessageHash[:])}} + encodedRequest, err := json.Marshal(request) + requestBuffer := bytes.NewBuffer(encodedRequest) + if err != nil { + return attestationResponse{}, err + } + respRaw, _, _, err := s.httpClient.Post(ctx, attestationURL, requestBuffer, s.attestationAPITimeout) + switch { + case errors.Is(err, tokendata.ErrRateLimit): + s.setCoolDownPeriod(defaultCoolDownDuration) + return attestationResponse{}, tokendata.ErrRateLimit + case err != nil: + return attestationResponse{}, err + } + var attestationResp attestationResponse + err = json.Unmarshal(respRaw, &attestationResp) + return attestationResp, err +} + +func (s *TokenDataReader) setCoolDownPeriod(d time.Duration) { + s.coolDownMu.Lock() + s.coolDownUntil = time.Now().Add(d) + s.coolDownMu.Unlock() +} + +func (s *TokenDataReader) inCoolDownPeriod() bool { + s.coolDownMu.RLock() + defer s.coolDownMu.RUnlock() + return time.Now().Before(s.coolDownUntil) +} + +func (s *TokenDataReader) Close() error { + return nil +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go new file mode 100644 index 00000000000..375bb62aaeb --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go @@ -0,0 +1,490 @@ +package lbtc + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "sync" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" +) + +var ( + lbtcMessageHash = "0xbc427abf571a5cfcf7c98799d1f0055f4db25f203f657d30026728a19d16f092" + lbtcMessageAttestation = "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e45c70a5050000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc0000000000000000000000000000000000000000000000000000000000014a34000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc00000000000000000000000062f10ce5b727edf787ea45776bd050308a61150800000000000000000000000000000000000000000000000000000000000003e60000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000040277eeafba008d767c2636d9428f2ebb13ab29ac70337f4fc34b0f5606767cae546f9be3f12160de6d142e5b3c1c3ebd0bf4298662b32b597d0cc5970c7742fc10000000000000000000000000000000000000000000000000000000000000040bbcd60ecc9e06f2effe7c94161219498a1eb435b419387adadb86ec9a52dfb066ce027532517df7216404049d193a25b85c35edfa3e7c5aa4757bfe84887a3980000000000000000000000000000000000000000000000000000000000000040da4a6dc619b5ca2349783cabecc4efdbc910090d3e234d7b8d0430165f8fae532f9a965ceb85c18bb92e059adefa7ce5835850a705761ab9e026d2db4a13ef9a" + payloadAndProof, _ = hexutil.Decode(lbtcMessageAttestation) +) + +func getMockLBTCEndpoint(t *testing.T, response attestationResponse) *httptest.Server { + responseBytes, err := json.Marshal(response) + require.NoError(t, err) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write(responseBytes) + //nolint:testifylint // we need to use require here + require.NoError(t, err) + })) +} + +func TestLBTCReader_callAttestationApi(t *testing.T) { + t.Skipf("Skipping test because it uses the real LBTC attestation API") + attestationURI, err := url.ParseRequestURI("https://bridge-manager.staging.lombard.finance") + require.NoError(t, err) + lggr := logger.TestLogger(t) + lbtcService := NewLBTCTokenDataReader(lggr, attestationURI, 0, common.Address{}, APIIntervalRateLimitDisabled) + + attestation, err := lbtcService.callAttestationAPI(context.Background(), [32]byte(common.FromHex(lbtcMessageHash))) + require.NoError(t, err) + + require.Equal(t, lbtcMessageHash, attestation.Attestations[0].MessageHash) + require.Equal(t, attestationStatusSessionApproved, attestation.Attestations[0].Status) + require.Equal(t, lbtcMessageAttestation, attestation.Attestations[0].Attestation) +} + +func TestLBTCReader_callAttestationApiMock(t *testing.T) { + response := attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusSessionApproved, + Attestation: lbtcMessageAttestation, + }, + }, + } + + ts := getMockLBTCEndpoint(t, response) + defer ts.Close() + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lbtcService := NewLBTCTokenDataReader(lggr, attestationURI, 0, common.Address{}, APIIntervalRateLimitDisabled) + attestation, err := lbtcService.callAttestationAPI(context.Background(), [32]byte(common.FromHex(lbtcMessageHash))) + require.NoError(t, err) + + require.Equal(t, response.Attestations[0].Status, attestation.Attestations[0].Status) + require.Equal(t, response.Attestations[0].Attestation, attestation.Attestations[0].Attestation) +} + +func TestLBTCReader_callAttestationApiMockError(t *testing.T) { + t.Parallel() + + sessionApprovedResponse := attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusSessionApproved, + Attestation: lbtcMessageAttestation, + }, + }, + } + + tests := []struct { + name string + getTs func() *httptest.Server + parentTimeoutSeconds int + customTimeoutSeconds int + expectedError error + }{ + { + name: "server error", + getTs: func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusInternalServerError) + })) + }, + parentTimeoutSeconds: 60, + expectedError: nil, + }, + { + name: "default timeout", + getTs: func() *httptest.Server { + responseBytes, _ := json.Marshal(sessionApprovedResponse) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(defaultAttestationTimeout + time.Second) + _, err := w.Write(responseBytes) + //nolint:testifylint // we need to use require here + require.NoError(t, err) + })) + }, + parentTimeoutSeconds: 60, + expectedError: tokendata.ErrTimeout, + }, + { + name: "custom timeout", + getTs: func() *httptest.Server { + responseBytes, _ := json.Marshal(sessionApprovedResponse) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(2*time.Second + time.Second) + _, err := w.Write(responseBytes) + //nolint:testifylint // we need to use require here + require.NoError(t, err) + })) + }, + parentTimeoutSeconds: 60, + customTimeoutSeconds: 2, + expectedError: tokendata.ErrTimeout, + }, + { + name: "rate limit", + getTs: func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusTooManyRequests) + })) + }, + parentTimeoutSeconds: 60, + expectedError: tokendata.ErrRateLimit, + }, + { + name: "parent context timeout", + getTs: func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(defaultAttestationTimeout + time.Second) + })) + }, + parentTimeoutSeconds: 1, + expectedError: nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ts := test.getTs() + defer ts.Close() + + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lbtcService := NewLBTCTokenDataReader(lggr, attestationURI, test.customTimeoutSeconds, common.Address{}, APIIntervalRateLimitDisabled) + + parentCtx, cancel := context.WithTimeout(context.Background(), time.Duration(test.parentTimeoutSeconds)*time.Second) + defer cancel() + + _, err = lbtcService.callAttestationAPI(parentCtx, [32]byte(common.FromHex(lbtcMessageHash))) + require.Error(t, err) + + if test.expectedError != nil { + require.True(t, errors.Is(err, test.expectedError)) + } + }) + } +} + +func TestLBTCReader_rateLimiting(t *testing.T) { + sessionApprovedResponse := attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusSessionApproved, + Attestation: lbtcMessageAttestation, + }, + }, + } + + testCases := []struct { + name string + requests uint64 + rateConfig time.Duration + testDuration time.Duration + timeout time.Duration + err string + additionalErr string + }{ + { + name: "no rate limit when disabled", + requests: 10, + rateConfig: APIIntervalRateLimitDisabled, + testDuration: 1 * time.Millisecond, + }, + { + name: "yes rate limited with default config", + requests: 5, + rateConfig: APIIntervalRateLimitDefault, + testDuration: 4 * defaultRequestInterval, + }, + { + name: "yes rate limited with config", + requests: 10, + rateConfig: 50 * time.Millisecond, + testDuration: 9 * 50 * time.Millisecond, + }, + { + name: "request timeout", + requests: 5, + rateConfig: 100 * time.Millisecond, + testDuration: 1 * time.Millisecond, + timeout: 1 * time.Millisecond, + err: "lbtc rate limiting error:", + additionalErr: "token data API timed out", + }, + } + + extraData, err := hexutil.Decode(lbtcMessageHash) + require.NoError(t, err) + + srcTokenData, err := abihelpers.EncodeAbiStruct[sourceTokenData](sourceTokenData{ + SourcePoolAddress: utils.RandomAddress().Bytes(), + DestTokenAddress: utils.RandomAddress().Bytes(), + ExtraData: extraData, + }) + require.NoError(t, err) + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + ts := getMockLBTCEndpoint(t, sessionApprovedResponse) + defer ts.Close() + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lbtcService := NewLBTCTokenDataReader(lggr, attestationURI, 0, utils.RandomAddress(), tc.rateConfig) + + ctx := context.Background() + if tc.timeout > 0 { + var cf context.CancelFunc + ctx, cf = context.WithTimeout(ctx, tc.timeout) + defer cf() + } + + trigger := make(chan struct{}) + errorChan := make(chan error, tc.requests) + wg := sync.WaitGroup{} + for i := uint64(0); i < tc.requests; i++ { + wg.Add(1) + go func() { + defer wg.Done() + + <-trigger + _, err := lbtcService.ReadTokenData(ctx, cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SourceTokenData: [][]byte{srcTokenData}, + TokenAmounts: []cciptypes.TokenAmount{{Token: ccipcalc.EvmAddrToGeneric(utils.ZeroAddress), Amount: nil}}, // trigger failure due to wrong address + }, + }, 0) + + errorChan <- err + }() + } + + // Start the test + start := time.Now() + close(trigger) + + // Wait for requests to complete + wg.Wait() + finish := time.Now() + close(errorChan) + + // Collect errors + errorFound := false + for err := range errorChan { + //nolint:gocritic // easier to read using ifElse instead of switch + if tc.err != "" && strings.Contains(err.Error(), tc.err) { + errorFound = true + } else if tc.additionalErr != "" && strings.Contains(err.Error(), tc.additionalErr) { + errorFound = true + } else if err != nil { + require.Fail(t, "unexpected error", err) + } + } + + if tc.err != "" { + assert.True(t, errorFound) + } + assert.WithinDuration(t, start.Add(tc.testDuration), finish, 50*time.Millisecond) + }) + } +} + +func TestLBTCReader_skipApiOnFullPayload(t *testing.T) { + sessionApprovedResponse := attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusSessionApproved, + Attestation: lbtcMessageAttestation, + }, + }, + } + + srcTokenData, err := abihelpers.EncodeAbiStruct[sourceTokenData](sourceTokenData{ + SourcePoolAddress: utils.RandomAddress().Bytes(), + DestTokenAddress: utils.RandomAddress().Bytes(), + ExtraData: []byte(lbtcMessageHash), // more than 32 bytes + }) + require.NoError(t, err) + + ts := getMockLBTCEndpoint(t, sessionApprovedResponse) + defer ts.Close() + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr, logs := logger.TestLoggerObserved(t, zapcore.InfoLevel) + lbtcService := NewLBTCTokenDataReader(lggr, attestationURI, 0, utils.RandomAddress(), APIIntervalRateLimitDefault) + + ctx := context.Background() + + destTokenData, err := lbtcService.ReadTokenData(ctx, cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SourceTokenData: [][]byte{srcTokenData}, + TokenAmounts: []cciptypes.TokenAmount{{Token: ccipcalc.EvmAddrToGeneric(utils.ZeroAddress), Amount: nil}}, // trigger failure due to wrong address + }, + }, 0) + require.NoError(t, err) + require.EqualValues(t, []byte(lbtcMessageHash), destTokenData) + + require.Equal(t, 1, logs.Len()) + require.Contains(t, logs.All()[0].Message, "SourceTokenData.extraData size is not 32. This is deposit payload, not sha256(payload). Attestation is disabled onchain") +} + +func TestLBTCReader_expectedOutput(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + response attestationResponse + expectedReturn []byte + expectedError error + }{ + { + name: "expected payloadAndProof when status SESSION_APPROVED", + response: attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusSessionApproved, + Attestation: lbtcMessageAttestation, + }, + }, + }, + expectedReturn: payloadAndProof, + expectedError: nil, + }, + { + name: "expected ErrNotReady on status PENDING", + response: attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusPending, + Attestation: lbtcMessageAttestation, + }, + }, + }, + expectedReturn: nil, + expectedError: tokendata.ErrNotReady, + }, + { + name: "expected ErrNotReady on status SUBMITTED", + response: attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusSubmitted, + Attestation: lbtcMessageAttestation, + }, + }, + }, + expectedReturn: nil, + expectedError: tokendata.ErrNotReady, + }, + { + name: "expected ErrUnknownResponse on status UNSPECIFIED", + response: attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusUnspecified, + Attestation: lbtcMessageAttestation, + }, + }, + }, + expectedReturn: nil, + expectedError: ErrUnknownResponse, + }, + { + name: "expected ErrUnknownResponse on status FAILED", + response: attestationResponse{ + Attestations: []messageAttestationResponse{ + { + MessageHash: lbtcMessageHash, + Status: attestationStatusFailed, + Attestation: lbtcMessageAttestation, + }, + }, + }, + expectedReturn: nil, + expectedError: ErrUnknownResponse, + }, + } + + extraData, err := hexutil.Decode(lbtcMessageHash) + require.NoError(t, err) + + srcTokenData, err := abihelpers.EncodeAbiStruct[sourceTokenData](sourceTokenData{ + SourcePoolAddress: utils.RandomAddress().Bytes(), + DestTokenAddress: utils.RandomAddress().Bytes(), + ExtraData: extraData, + }) + require.NoError(t, err) + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + ts := getMockLBTCEndpoint(t, tc.response) + defer ts.Close() + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lbtcService := NewLBTCTokenDataReader(lggr, attestationURI, 0, utils.RandomAddress(), APIIntervalRateLimitDefault) + + ctx := context.Background() + + payloadAndProof, err := lbtcService.ReadTokenData(ctx, cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SourceTokenData: [][]byte{srcTokenData}, + TokenAmounts: []cciptypes.TokenAmount{{Token: ccipcalc.EvmAddrToGeneric(utils.ZeroAddress), Amount: nil}}, // trigger failure due to wrong address + }, + }, 0) + + if tc.expectedReturn != nil { + require.EqualValues(t, tc.expectedReturn, payloadAndProof) + } else if tc.expectedError != nil { + require.Contains(t, err.Error(), tc.expectedError.Error()) + } + }) + } +} + +func Test_DecodeSourceTokenData(t *testing.T) { + input, err := hexutil.Decode("0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000249f00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000267d40f64ecc4d95f3e8b2237df5f37b10812c250000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c47e4b3124597fdf8dd07843d4a7052f2ee80c3000000000000000000000000000000000000000000000000000000000000000e45c70a5050000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc0000000000000000000000000000000000000000000000000000000000014a34000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc00000000000000000000000062f10ce5b727edf787ea45776bd050308a61150800000000000000000000000000000000000000000000000000000000000003e6000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000") + require.NoError(t, err) + decoded, err := abihelpers.DecodeAbiStruct[sourceTokenData](input) + require.NoError(t, err) + expected, err := hexutil.Decode("0x5c70a5050000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc0000000000000000000000000000000000000000000000000000000000014a34000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc00000000000000000000000062f10ce5b727edf787ea45776bd050308a61150800000000000000000000000000000000000000000000000000000000000003e60000000000000000000000000000000000000000000000000000000000000006") + require.NoError(t, err) + require.Equal(t, expected, decoded.ExtraData) +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go index aaa6086fbc9..9e27ebcc59e 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go +++ b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go @@ -133,7 +133,7 @@ func NewUSDCTokenDataReader( return &TokenDataReader{ lggr: lggr, usdcReader: usdcReader, - httpClient: http.NewObservedIHttpClient(&http.HttpClient{}), + httpClient: http.NewObservedUsdcIHttpClient(&http.HttpClient{}), attestationApi: usdcAttestationApi, attestationApiTimeout: timeout, usdcTokenAddress: usdcTokenAddress, diff --git a/core/services/relay/evm/ccip.go b/core/services/relay/evm/ccip.go index a06f60c6fd4..9fc6ae8b1a0 100644 --- a/core/services/relay/evm/ccip.go +++ b/core/services/relay/evm/ccip.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" ) @@ -24,16 +25,18 @@ var _ cciptypes.CommitStoreReader = (*IncompleteDestCommitStoreReader)(nil) // IncompleteSourceCommitStoreReader is an implementation of CommitStoreReader with the only valid methods being // GasPriceEstimator, ChangeConfig, and OffchainConfig type IncompleteSourceCommitStoreReader struct { - estimator gas.EvmFeeEstimator - gasPriceEstimator *prices.DAGasPriceEstimator - sourceMaxGasPrice *big.Int - offchainConfig cciptypes.CommitOffchainConfig + estimator gas.EvmFeeEstimator + gasPriceEstimator *prices.DAGasPriceEstimator + sourceMaxGasPrice *big.Int + offchainConfig cciptypes.CommitOffchainConfig + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider } -func NewIncompleteSourceCommitStoreReader(estimator gas.EvmFeeEstimator, sourceMaxGasPrice *big.Int) *IncompleteSourceCommitStoreReader { +func NewIncompleteSourceCommitStoreReader(estimator gas.EvmFeeEstimator, sourceMaxGasPrice *big.Int, feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider) *IncompleteSourceCommitStoreReader { return &IncompleteSourceCommitStoreReader{ - estimator: estimator, - sourceMaxGasPrice: sourceMaxGasPrice, + estimator: estimator, + sourceMaxGasPrice: sourceMaxGasPrice, + feeEstimatorConfig: feeEstimatorConfig, } } @@ -53,6 +56,7 @@ func (i *IncompleteSourceCommitStoreReader) ChangeConfig(ctx context.Context, on i.sourceMaxGasPrice, int64(offchainConfigParsed.ExecGasPriceDeviationPPB), int64(offchainConfigParsed.DAGasPriceDeviationPPB), + i.feeEstimatorConfig, ) i.offchainConfig = ccip.NewCommitOffchainConfig( offchainConfigParsed.ExecGasPriceDeviationPPB, @@ -131,8 +135,16 @@ type IncompleteDestCommitStoreReader struct { cs cciptypes.CommitStoreReader } -func NewIncompleteDestCommitStoreReader(ctx context.Context, lggr logger.Logger, versionFinder ccip.VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller) (*IncompleteDestCommitStoreReader, error) { - cs, err := ccip.NewCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp) +func NewIncompleteDestCommitStoreReader( + ctx context.Context, + lggr logger.Logger, + versionFinder ccip.VersionFinder, + address cciptypes.Address, + ec client.Client, + lp logpoller.LogPoller, + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider, +) (*IncompleteDestCommitStoreReader, error) { + cs, err := ccip.NewCommitStoreReader(ctx, lggr, versionFinder, address, ec, lp, feeEstimatorConfig) if err != nil { return nil, err } diff --git a/core/services/relay/evm/commit_provider.go b/core/services/relay/evm/commit_provider.go index 95d7371ab16..6be639674e2 100644 --- a/core/services/relay/evm/commit_provider.go +++ b/core/services/relay/evm/commit_provider.go @@ -14,24 +14,25 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig" ) var _ commontypes.CCIPCommitProvider = (*SrcCommitProvider)(nil) var _ commontypes.CCIPCommitProvider = (*DstCommitProvider)(nil) type SrcCommitProvider struct { - lggr logger.Logger - startBlock uint64 - client client.Client - lp logpoller.LogPoller - estimator gas.EvmFeeEstimator - maxGasPrice *big.Int + lggr logger.Logger + startBlock uint64 + client client.Client + lp logpoller.LogPoller + estimator gas.EvmFeeEstimator + maxGasPrice *big.Int + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider // these values will be lazily initialized seenOnRampAddress *cciptypes.Address @@ -46,14 +47,16 @@ func NewSrcCommitProvider( lp logpoller.LogPoller, srcEstimator gas.EvmFeeEstimator, maxGasPrice *big.Int, + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider, ) commontypes.CCIPCommitProvider { return &SrcCommitProvider{ - lggr: logger.Named(lggr, "SrcCommitProvider"), - startBlock: startBlock, - client: client, - lp: lp, - estimator: srcEstimator, - maxGasPrice: maxGasPrice, + lggr: logger.Named(lggr, "SrcCommitProvider"), + startBlock: startBlock, + client: client, + lp: lp, + estimator: srcEstimator, + maxGasPrice: maxGasPrice, + feeEstimatorConfig: feeEstimatorConfig, } } @@ -67,6 +70,7 @@ type DstCommitProvider struct { configWatcher *configWatcher gasEstimator gas.EvmFeeEstimator maxGasPrice big.Int + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider // these values will be lazily initialized seenCommitStoreAddress *cciptypes.Address @@ -83,6 +87,7 @@ func NewDstCommitProvider( maxGasPrice big.Int, contractTransmitter contractTransmitter, configWatcher *configWatcher, + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider, ) commontypes.CCIPCommitProvider { return &DstCommitProvider{ lggr: logger.Named(lggr, "DstCommitProvider"), @@ -94,6 +99,7 @@ func NewDstCommitProvider( configWatcher: configWatcher, gasEstimator: gasEstimator, maxGasPrice: maxGasPrice, + feeEstimatorConfig: feeEstimatorConfig, } } @@ -173,13 +179,13 @@ func (p *DstCommitProvider) Close() error { if p.seenCommitStoreAddress == nil { return nil } - return ccip.CloseCommitStoreReader(ctx, p.lggr, versionFinder, *p.seenCommitStoreAddress, p.client, p.lp) + return ccip.CloseCommitStoreReader(ctx, p.lggr, versionFinder, *p.seenCommitStoreAddress, p.client, p.lp, p.feeEstimatorConfig) }) unregisterFuncs = append(unregisterFuncs, func(ctx context.Context) error { if p.seenOffRampAddress == nil { return nil } - return ccip.CloseOffRampReader(ctx, p.lggr, versionFinder, *p.seenOffRampAddress, p.client, p.lp, nil, big.NewInt(0)) + return ccip.CloseOffRampReader(ctx, p.lggr, versionFinder, *p.seenOffRampAddress, p.client, p.lp, nil, big.NewInt(0), p.feeEstimatorConfig) }) var multiErr error @@ -250,7 +256,7 @@ func (p *DstCommitProvider) NewPriceGetter(ctx context.Context) (priceGetter cci } func (p *SrcCommitProvider) NewCommitStoreReader(ctx context.Context, commitStoreAddress cciptypes.Address) (commitStoreReader cciptypes.CommitStoreReader, err error) { - commitStoreReader = NewIncompleteSourceCommitStoreReader(p.estimator, p.maxGasPrice) + commitStoreReader = NewIncompleteSourceCommitStoreReader(p.estimator, p.maxGasPrice, p.feeEstimatorConfig) return } @@ -258,7 +264,7 @@ func (p *DstCommitProvider) NewCommitStoreReader(ctx context.Context, commitStor p.seenCommitStoreAddress = &commitStoreAddress versionFinder := ccip.NewEvmVersionFinder() - commitStoreReader, err = NewIncompleteDestCommitStoreReader(ctx, p.lggr, versionFinder, commitStoreAddress, p.client, p.lp) + commitStoreReader, err = NewIncompleteDestCommitStoreReader(ctx, p.lggr, versionFinder, commitStoreAddress, p.client, p.lp, p.feeEstimatorConfig) return } @@ -268,7 +274,12 @@ func (p *SrcCommitProvider) NewOnRampReader(ctx context.Context, onRampAddress c p.seenDestChainSelector = &destChainSelector versionFinder := ccip.NewEvmVersionFinder() + onRampReader, err = ccip.NewOnRampReader(ctx, p.lggr, versionFinder, sourceChainSelector, destChainSelector, onRampAddress, p.lp, p.client) + if err != nil { + return nil, err + } + p.feeEstimatorConfig.SetOnRampReader(onRampReader) return } @@ -281,7 +292,7 @@ func (p *SrcCommitProvider) NewOffRampReader(ctx context.Context, offRampAddr cc } func (p *DstCommitProvider) NewOffRampReader(ctx context.Context, offRampAddr cciptypes.Address) (offRampReader cciptypes.OffRampReader, err error) { - offRampReader, err = ccip.NewOffRampReader(ctx, p.lggr, p.versionFinder, offRampAddr, p.client, p.lp, p.gasEstimator, &p.maxGasPrice, true) + offRampReader, err = ccip.NewOffRampReader(ctx, p.lggr, p.versionFinder, offRampAddr, p.client, p.lp, p.gasEstimator, &p.maxGasPrice, true, p.feeEstimatorConfig) return } diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index e60dbe1bfdb..cf79d2aea59 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -50,6 +50,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipcommit" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipexec" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle" cciptransmitter "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/transmitter" lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" mercuryconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury/config" @@ -217,7 +219,7 @@ func NewRelayer(ctx context.Context, lggr logger.Logger, chain legacyevm.Chain, relayer := &Relayer{ ds: opts.DS, chain: chain, - lggr: sugared, + lggr: logger.Sugared(sugared), registerer: opts.Registerer, ks: opts.CSAETHKeystore, mercuryPool: opts.MercuryPool, @@ -505,6 +507,183 @@ func (r *Relayer) NewMercuryProvider(ctx context.Context, rargs commontypes.Rela return NewMercuryProvider(cp, r.codec, NewMercuryChainReader(r.chain.HeadTracker()), transmitter, reportCodecV1, reportCodecV2, reportCodecV3, reportCodecV4, lggr), nil } +func chainToUUID(chainID *big.Int) uuid.UUID { + // See https://www.rfc-editor.org/rfc/rfc4122.html#section-4.1.3 for the list of supported versions. + const VersionSHA1 = 5 + var buf bytes.Buffer + buf.WriteString("CCIP:") + buf.Write(chainID.Bytes()) + // We use SHA-256 instead of SHA-1 because the former has better collision resistance. + // The UUID will contain only the first 16 bytes of the hash. + // You can't say which algorithms was used just by looking at the UUID bytes. + return uuid.NewHash(sha256.New(), uuid.NameSpaceOID, buf.Bytes(), VersionSHA1) +} + +// NewCCIPCommitProvider constructs a provider of type CCIPCommitProvider. Since this is happening in the Relayer, +// which lives in a separate process from delegate which is requesting a provider, we need to wire in through pargs +// which *type* (impl) of CCIPCommitProvider should be created. CCIP is currently a special case where the provider has a +// subset of implementations of the complete interface as certain contracts in a CCIP lane are only deployed on the src +// chain or on the dst chain. This results in the two implementations of providers: a src and dst implementation. +func (r *Relayer) NewCCIPCommitProvider(ctx context.Context, rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.CCIPCommitProvider, error) { + versionFinder := ccip.NewEvmVersionFinder() + + var commitPluginConfig ccipconfig.CommitPluginConfig + err := json.Unmarshal(pargs.PluginConfig, &commitPluginConfig) + if err != nil { + return nil, err + } + sourceStartBlock := commitPluginConfig.SourceStartBlock + destStartBlock := commitPluginConfig.DestStartBlock + + feeEstimatorConfig := estimatorconfig.NewFeeEstimatorConfigService() + + // CCIPCommit reads only when source chain is Mantle, then reports to dest chain + // to minimize misconfigure risk, might make sense to wire Mantle only when Commit + Mantle + IsSourceProvider + if r.chain.Config().EVM().ChainID().Uint64() == 5003 || r.chain.Config().EVM().ChainID().Uint64() == 5000 { + if commitPluginConfig.IsSourceProvider { + mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client()) + if iErr != nil { + return nil, iErr + } + feeEstimatorConfig.AddGasPriceInterceptor(mantleInterceptor) + } + } + + // The src chain implementation of this provider does not need a configWatcher or contractTransmitter; + // bail early. + if commitPluginConfig.IsSourceProvider { + return NewSrcCommitProvider( + r.lggr, + sourceStartBlock, + r.chain.Client(), + r.chain.LogPoller(), + r.chain.GasEstimator(), + r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + feeEstimatorConfig, + ), nil + } + + relayOpts := types.NewRelayOpts(rargs) + configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) + if err != nil { + return nil, err + } + address := common.HexToAddress(relayOpts.ContractID) + typ, ver, err := ccipconfig.TypeAndVersion(address, r.chain.Client()) + if err != nil { + return nil, err + } + fn, err := ccipcommit.CommitReportToEthTxMeta(typ, ver) + if err != nil { + return nil, err + } + subjectID := chainToUUID(configWatcher.chain.ID()) + contractTransmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{ + subjectID: &subjectID, + }, OCR2AggregatorTransmissionContractABI, WithReportToEthMetadata(fn), WithRetention(0)) + if err != nil { + return nil, err + } + + return NewDstCommitProvider( + r.lggr, + versionFinder, + destStartBlock, + r.chain.Client(), + r.chain.LogPoller(), + r.chain.GasEstimator(), + *r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + *contractTransmitter, + configWatcher, + feeEstimatorConfig, + ), nil +} + +// NewCCIPExecProvider constructs a provider of type CCIPExecProvider. Since this is happening in the Relayer, +// which lives in a separate process from delegate which is requesting a provider, we need to wire in through pargs +// which *type* (impl) of CCIPExecProvider should be created. CCIP is currently a special case where the provider has a +// subset of implementations of the complete interface as certain contracts in a CCIP lane are only deployed on the src +// chain or on the dst chain. This results in the two implementations of providers: a src and dst implementation. +func (r *Relayer) NewCCIPExecProvider(ctx context.Context, rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.CCIPExecProvider, error) { + versionFinder := ccip.NewEvmVersionFinder() + + var execPluginConfig ccipconfig.ExecPluginConfig + err := json.Unmarshal(pargs.PluginConfig, &execPluginConfig) + if err != nil { + return nil, err + } + + feeEstimatorConfig := estimatorconfig.NewFeeEstimatorConfigService() + + // CCIPExec reads when dest chain is mantle, and uses it to calc boosting in batching + // to minimize misconfigure risk, make sense to wire Mantle only when Exec + Mantle + !IsSourceProvider + if r.chain.Config().EVM().ChainID().Uint64() == 5003 || r.chain.Config().EVM().ChainID().Uint64() == 5000 { + if !execPluginConfig.IsSourceProvider { + mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client()) + if iErr != nil { + return nil, iErr + } + feeEstimatorConfig.AddGasPriceInterceptor(mantleInterceptor) + } + } + + // The src chain implementation of this provider does not need a configWatcher or contractTransmitter; + // bail early. + if execPluginConfig.IsSourceProvider { + return NewSrcExecProvider( + ctx, + r.lggr, + versionFinder, + r.chain.Client(), + r.chain.GasEstimator(), + r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + r.chain.LogPoller(), + execPluginConfig.SourceStartBlock, + execPluginConfig.JobID, + execPluginConfig.USDCConfig, + execPluginConfig.LBTCConfig, + feeEstimatorConfig, + ) + } + + relayOpts := types.NewRelayOpts(rargs) + configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) + if err != nil { + return nil, err + } + address := common.HexToAddress(relayOpts.ContractID) + typ, ver, err := ccipconfig.TypeAndVersion(address, r.chain.Client()) + if err != nil { + return nil, err + } + fn, err := ccipexec.ExecReportToEthTxMeta(ctx, typ, ver) + if err != nil { + return nil, err + } + subjectID := chainToUUID(configWatcher.chain.ID()) + contractTransmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{ + subjectID: &subjectID, + }, OCR2AggregatorTransmissionContractABI, WithReportToEthMetadata(fn), WithRetention(0), WithExcludeSignatures()) + if err != nil { + return nil, err + } + + return NewDstExecProvider( + r.lggr, + versionFinder, + r.chain.Client(), + r.chain.LogPoller(), + execPluginConfig.DestStartBlock, + contractTransmitter, + configWatcher, + r.chain.GasEstimator(), + *r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + feeEstimatorConfig, + r.chain.TxManager(), + cciptypes.Address(rargs.ContractID), + ) +} + func (r *Relayer) NewLLOProvider(ctx context.Context, rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.LLOProvider, error) { relayOpts := types.NewRelayOpts(rargs) var relayConfig types.RelayConfig @@ -949,155 +1128,6 @@ func (r *Relayer) NewAutomationProvider(ctx context.Context, rargs commontypes.R return ocr2keeperRelayer.NewOCR2KeeperProvider(ctx, rargs, pargs) } -func chainToUUID(chainID *big.Int) uuid.UUID { - // See https://www.rfc-editor.org/rfc/rfc4122.html#section-4.1.3 for the list of supported versions. - const VersionSHA1 = 5 - var buf bytes.Buffer - buf.WriteString("CCIP:") - buf.Write(chainID.Bytes()) - // We use SHA-256 instead of SHA-1 because the former has better collision resistance. - // The UUID will contain only the first 16 bytes of the hash. - // You can't say which algorithms was used just by looking at the UUID bytes. - return uuid.NewHash(sha256.New(), uuid.NameSpaceOID, buf.Bytes(), VersionSHA1) -} - -// NewCCIPCommitProvider constructs a provider of type CCIPCommitProvider. Since this is happening in the Relayer, -// which lives in a separate process from delegate which is requesting a provider, we need to wire in through pargs -// which *type* (impl) of CCIPCommitProvider should be created. CCIP is currently a special case where the provider has a -// subset of implementations of the complete interface as certain contracts in a CCIP lane are only deployed on the src -// chain or on the dst chain. This results in the two implementations of providers: a src and dst implementation. -func (r *Relayer) NewCCIPCommitProvider(ctx context.Context, rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.CCIPCommitProvider, error) { - versionFinder := ccip.NewEvmVersionFinder() - - var commitPluginConfig ccipconfig.CommitPluginConfig - err := json.Unmarshal(pargs.PluginConfig, &commitPluginConfig) - if err != nil { - return nil, err - } - sourceStartBlock := commitPluginConfig.SourceStartBlock - destStartBlock := commitPluginConfig.DestStartBlock - - // The src chain implementation of this provider does not need a configWatcher or contractTransmitter; - // bail early. - if commitPluginConfig.IsSourceProvider { - return NewSrcCommitProvider( - r.lggr, - sourceStartBlock, - r.chain.Client(), - r.chain.LogPoller(), - r.chain.GasEstimator(), - r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), - ), nil - } - - relayOpts := types.NewRelayOpts(rargs) - configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) - if err != nil { - return nil, err - } - address := common.HexToAddress(relayOpts.ContractID) - typ, ver, err := ccipconfig.TypeAndVersion(address, r.chain.Client()) - if err != nil { - return nil, err - } - fn, err := ccipcommit.CommitReportToEthTxMeta(typ, ver) - if err != nil { - return nil, err - } - subjectID := chainToUUID(configWatcher.chain.ID()) - contractTransmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{ - subjectID: &subjectID, - }, OCR2AggregatorTransmissionContractABI, WithReportToEthMetadata(fn), WithRetention(0)) - if err != nil { - return nil, err - } - - return NewDstCommitProvider( - r.lggr, - versionFinder, - destStartBlock, - r.chain.Client(), - r.chain.LogPoller(), - r.chain.GasEstimator(), - *r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), - *contractTransmitter, - configWatcher, - ), nil -} - -// NewCCIPExecProvider constructs a provider of type CCIPExecProvider. Since this is happening in the Relayer, -// which lives in a separate process from delegate which is requesting a provider, we need to wire in through pargs -// which *type* (impl) of CCIPExecProvider should be created. CCIP is currently a special case where the provider has a -// subset of implementations of the complete interface as certain contracts in a CCIP lane are only deployed on the src -// chain or on the dst chain. This results in the two implementations of providers: a src and dst implementation. -func (r *Relayer) NewCCIPExecProvider(ctx context.Context, rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.CCIPExecProvider, error) { - versionFinder := ccip.NewEvmVersionFinder() - - var execPluginConfig ccipconfig.ExecPluginConfig - err := json.Unmarshal(pargs.PluginConfig, &execPluginConfig) - if err != nil { - return nil, err - } - - usdcConfig := execPluginConfig.USDCConfig - - // The src chain implementation of this provider does not need a configWatcher or contractTransmitter; - // bail early. - if execPluginConfig.IsSourceProvider { - return NewSrcExecProvider( - ctx, - r.lggr, - versionFinder, - r.chain.Client(), - r.chain.GasEstimator(), - r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), - r.chain.LogPoller(), - execPluginConfig.SourceStartBlock, - execPluginConfig.JobID, - usdcConfig.AttestationAPI, - int(usdcConfig.AttestationAPITimeoutSeconds), - usdcConfig.AttestationAPIIntervalMilliseconds, - usdcConfig.SourceMessageTransmitterAddress, - ) - } - - relayOpts := types.NewRelayOpts(rargs) - configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) - if err != nil { - return nil, err - } - address := common.HexToAddress(relayOpts.ContractID) - typ, ver, err := ccipconfig.TypeAndVersion(address, r.chain.Client()) - if err != nil { - return nil, err - } - fn, err := ccipexec.ExecReportToEthTxMeta(ctx, typ, ver) - if err != nil { - return nil, err - } - subjectID := chainToUUID(configWatcher.chain.ID()) - contractTransmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{ - subjectID: &subjectID, - }, OCR2AggregatorTransmissionContractABI, WithReportToEthMetadata(fn), WithRetention(0)) - if err != nil { - return nil, err - } - - return NewDstExecProvider( - r.lggr, - versionFinder, - r.chain.Client(), - r.chain.LogPoller(), - execPluginConfig.DestStartBlock, - contractTransmitter, - configWatcher, - r.chain.GasEstimator(), - *r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), - r.chain.TxManager(), - cciptypes.Address(rargs.ContractID), - ) -} - var _ commontypes.MedianProvider = (*medianProvider)(nil) type medianProvider struct { diff --git a/core/services/relay/evm/exec_provider.go b/core/services/relay/evm/exec_provider.go index da190d20356..e5b00205caa 100644 --- a/core/services/relay/evm/exec_provider.go +++ b/core/services/relay/evm/exec_provider.go @@ -10,13 +10,14 @@ import ( "go.uber.org/multierr" "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/lbtc" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" @@ -24,22 +25,25 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/usdc" ) type SrcExecProvider struct { - lggr logger.Logger - versionFinder ccip.VersionFinder - client client.Client - lp logpoller.LogPoller - startBlock uint64 - estimator gas.EvmFeeEstimator - maxGasPrice *big.Int - usdcReader *ccip.USDCReaderImpl - usdcAttestationAPI string - usdcAttestationAPITimeoutSeconds int - usdcAttestationAPIIntervalMilliseconds int - usdcSrcMsgTransmitterAddr common.Address + lggr logger.Logger + versionFinder ccip.VersionFinder + client client.Client + lp logpoller.LogPoller + startBlock uint64 + estimator gas.EvmFeeEstimator + maxGasPrice *big.Int + usdcReader *ccip.USDCReaderImpl + usdcConfig config.USDCConfig + lbtcConfig config.LBTCConfig + + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider + + // TODO: Add lbtc reader & api fields // these values are nil and are updated for Close() seenOnRampAddress *cciptypes.Address @@ -57,33 +61,31 @@ func NewSrcExecProvider( lp logpoller.LogPoller, startBlock uint64, jobID string, - usdcAttestationAPI string, - usdcAttestationAPITimeoutSeconds int, - usdcAttestationAPIIntervalMilliseconds int, - usdcSrcMsgTransmitterAddr common.Address, + usdcConfig config.USDCConfig, + lbtcConfig config.LBTCConfig, + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider, ) (commontypes.CCIPExecProvider, error) { var usdcReader *ccip.USDCReaderImpl var err error - if usdcAttestationAPI != "" { - usdcReader, err = ccip.NewUSDCReader(ctx, lggr, jobID, usdcSrcMsgTransmitterAddr, lp, true) + if usdcConfig.AttestationAPI != "" { + usdcReader, err = ccip.NewUSDCReader(ctx, lggr, jobID, usdcConfig.SourceMessageTransmitterAddress, lp, true) if err != nil { return nil, fmt.Errorf("new usdc reader: %w", err) } } return &SrcExecProvider{ - lggr: logger.Named(lggr, "SrcExecProvider"), - versionFinder: versionFinder, - client: client, - estimator: estimator, - maxGasPrice: maxGasPrice, - lp: lp, - startBlock: startBlock, - usdcReader: usdcReader, - usdcAttestationAPI: usdcAttestationAPI, - usdcAttestationAPITimeoutSeconds: usdcAttestationAPITimeoutSeconds, - usdcAttestationAPIIntervalMilliseconds: usdcAttestationAPIIntervalMilliseconds, - usdcSrcMsgTransmitterAddr: usdcSrcMsgTransmitterAddr, + lggr: logger.Named(lggr, "SrcExecProvider"), + versionFinder: versionFinder, + client: client, + estimator: estimator, + maxGasPrice: maxGasPrice, + lp: lp, + startBlock: startBlock, + usdcReader: usdcReader, + usdcConfig: usdcConfig, + lbtcConfig: lbtcConfig, + feeEstimatorConfig: feeEstimatorConfig, }, nil } @@ -113,10 +115,10 @@ func (s *SrcExecProvider) Close() error { return ccip.CloseOnRampReader(ctx, s.lggr, versionFinder, *s.seenSourceChainSelector, *s.seenDestChainSelector, *s.seenOnRampAddress, s.lp, s.client) }) unregisterFuncs = append(unregisterFuncs, func(ctx context.Context) error { - if s.usdcAttestationAPI == "" { + if s.usdcConfig.AttestationAPI == "" { return nil } - return ccip.CloseUSDCReader(ctx, s.lggr, s.lggr.Name(), s.usdcSrcMsgTransmitterAddr, s.lp) + return ccip.CloseUSDCReader(ctx, s.lggr, s.lggr.Name(), s.usdcConfig.SourceMessageTransmitterAddress, s.lp) }) var multiErr error for _, fn := range unregisterFuncs { @@ -166,7 +168,7 @@ func (s *SrcExecProvider) GetTransactionStatus(ctx context.Context, transactionI } func (s *SrcExecProvider) NewCommitStoreReader(ctx context.Context, addr cciptypes.Address) (commitStoreReader cciptypes.CommitStoreReader, err error) { - commitStoreReader = NewIncompleteSourceCommitStoreReader(s.estimator, s.maxGasPrice) + commitStoreReader = NewIncompleteSourceCommitStoreReader(s.estimator, s.maxGasPrice, s.feeEstimatorConfig) return } @@ -179,6 +181,10 @@ func (s *SrcExecProvider) NewOnRampReader(ctx context.Context, onRampAddress cci versionFinder := ccip.NewEvmVersionFinder() onRampReader, err = ccip.NewOnRampReader(ctx, s.lggr, versionFinder, sourceChainSelector, destChainSelector, onRampAddress, s.lp, s.client) + if err != nil { + return nil, err + } + s.feeEstimatorConfig.SetOnRampReader(onRampReader) return } @@ -188,24 +194,42 @@ func (s *SrcExecProvider) NewPriceRegistryReader(ctx context.Context, addr ccipt return } -func (s *SrcExecProvider) NewTokenDataReader(ctx context.Context, tokenAddress cciptypes.Address) (tokenDataReader cciptypes.TokenDataReader, err error) { - attestationURI, err2 := url.ParseRequestURI(s.usdcAttestationAPI) - if err2 != nil { - return nil, fmt.Errorf("failed to parse USDC attestation API: %w", err2) +func (s *SrcExecProvider) NewTokenDataReader(ctx context.Context, tokenAddress cciptypes.Address) (cciptypes.TokenDataReader, error) { + tokenAddr, err := ccip.GenericAddrToEvm(tokenAddress) + if err != nil { + return nil, fmt.Errorf("failed to parse token address: %w", err) } - tokenAddr, err2 := ccip.GenericAddrToEvm(tokenAddress) - if err2 != nil { - return nil, fmt.Errorf("failed to parse token address: %w", err2) + switch tokenAddr { + case s.usdcConfig.SourceTokenAddress: + attestationURI, err := url.ParseRequestURI(s.usdcConfig.AttestationAPI) + if err != nil { + return nil, fmt.Errorf("failed to parse USDC attestation API: %w", err) + } + return usdc.NewUSDCTokenDataReader( + s.lggr, + s.usdcReader, + attestationURI, + //nolint:gosec // integer overflow + int(s.usdcConfig.AttestationAPITimeoutSeconds), + tokenAddr, + time.Duration(s.usdcConfig.AttestationAPIIntervalMilliseconds)*time.Millisecond, + ), nil + case s.lbtcConfig.SourceTokenAddress: + attestationURI, err := url.ParseRequestURI(s.lbtcConfig.AttestationAPI) + if err != nil { + return nil, fmt.Errorf("failed to parse USDC attestation API: %w", err) + } + return lbtc.NewLBTCTokenDataReader( + s.lggr, + attestationURI, + //nolint:gosec // integer overflow + int(s.lbtcConfig.AttestationAPITimeoutSeconds), + tokenAddr, + time.Duration(s.lbtcConfig.AttestationAPIIntervalMilliseconds)*time.Millisecond, + ), nil + default: + return nil, fmt.Errorf("unsupported token address: %s", tokenAddress) } - tokenDataReader = usdc.NewUSDCTokenDataReader( - s.lggr, - s.usdcReader, - attestationURI, - s.usdcAttestationAPITimeoutSeconds, - tokenAddr, - time.Duration(s.usdcAttestationAPIIntervalMilliseconds)*time.Millisecond, - ) - return } func (s *SrcExecProvider) NewTokenPoolBatchedReader(ctx context.Context, offRampAddr cciptypes.Address, sourceChainSelector uint64) (cciptypes.TokenPoolBatchedReader, error) { @@ -239,6 +263,7 @@ type DstExecProvider struct { configWatcher *configWatcher gasEstimator gas.EvmFeeEstimator maxGasPrice big.Int + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider txm txmgr.TxManager offRampAddress cciptypes.Address @@ -256,6 +281,7 @@ func NewDstExecProvider( configWatcher *configWatcher, gasEstimator gas.EvmFeeEstimator, maxGasPrice big.Int, + feeEstimatorConfig estimatorconfig.FeeEstimatorConfigProvider, txm txmgr.TxManager, offRampAddress cciptypes.Address, ) (commontypes.CCIPExecProvider, error) { @@ -269,6 +295,7 @@ func NewDstExecProvider( configWatcher: configWatcher, gasEstimator: gasEstimator, maxGasPrice: maxGasPrice, + feeEstimatorConfig: feeEstimatorConfig, txm: txm, offRampAddress: offRampAddress, }, nil @@ -299,10 +326,10 @@ func (d *DstExecProvider) Close() error { if d.seenCommitStoreAddr == nil { return nil } - return ccip.CloseCommitStoreReader(ctx, d.lggr, versionFinder, *d.seenCommitStoreAddr, d.client, d.lp) + return ccip.CloseCommitStoreReader(ctx, d.lggr, versionFinder, *d.seenCommitStoreAddr, d.client, d.lp, d.feeEstimatorConfig) }) unregisterFuncs = append(unregisterFuncs, func(ctx context.Context) error { - return ccip.CloseOffRampReader(ctx, d.lggr, versionFinder, d.offRampAddress, d.client, d.lp, nil, big.NewInt(0)) + return ccip.CloseOffRampReader(ctx, d.lggr, versionFinder, d.offRampAddress, d.client, d.lp, nil, big.NewInt(0), d.feeEstimatorConfig) }) var multiErr error @@ -350,12 +377,12 @@ func (d *DstExecProvider) NewCommitStoreReader(ctx context.Context, addr cciptyp d.seenCommitStoreAddr = &addr versionFinder := ccip.NewEvmVersionFinder() - commitStoreReader, err = NewIncompleteDestCommitStoreReader(ctx, d.lggr, versionFinder, addr, d.client, d.lp) + commitStoreReader, err = NewIncompleteDestCommitStoreReader(ctx, d.lggr, versionFinder, addr, d.client, d.lp, d.feeEstimatorConfig) return } func (d *DstExecProvider) NewOffRampReader(ctx context.Context, offRampAddress cciptypes.Address) (offRampReader cciptypes.OffRampReader, err error) { - offRampReader, err = ccip.NewOffRampReader(ctx, d.lggr, d.versionFinder, offRampAddress, d.client, d.lp, d.gasEstimator, &d.maxGasPrice, true) + offRampReader, err = ccip.NewOffRampReader(ctx, d.lggr, d.versionFinder, offRampAddress, d.client, d.lp, d.gasEstimator, &d.maxGasPrice, true, d.feeEstimatorConfig) return } diff --git a/core/services/relay/evm/interceptors/mantle/interceptor.go b/core/services/relay/evm/interceptors/mantle/interceptor.go new file mode 100644 index 00000000000..c1520652d67 --- /dev/null +++ b/core/services/relay/evm/interceptors/mantle/interceptor.go @@ -0,0 +1,81 @@ +package mantle + +import ( + "context" + "fmt" + "math/big" + "strings" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + + evmClient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +const ( + // tokenRatio is not volatile and can be requested not often. + tokenRatioUpdateInterval = 60 * time.Minute + // tokenRatio fetches the tokenRatio used for Mantle's gas price calculation + tokenRatioMethod = "tokenRatio" + mantleTokenRatioAbiString = `[{"inputs":[],"name":"tokenRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]` +) + +type Interceptor struct { + client evmClient.Client + tokenRatioCallData []byte + tokenRatio *big.Int + tokenRatioLastUpdate time.Time +} + +func NewInterceptor(_ context.Context, client evmClient.Client) (*Interceptor, error) { + // Encode calldata for tokenRatio method + tokenRatioMethodAbi, err := abi.JSON(strings.NewReader(mantleTokenRatioAbiString)) + if err != nil { + return nil, fmt.Errorf("failed to parse GasPriceOracle %s() method ABI for Mantle; %w", tokenRatioMethod, err) + } + tokenRatioCallData, err := tokenRatioMethodAbi.Pack(tokenRatioMethod) + if err != nil { + return nil, fmt.Errorf("failed to parse GasPriceOracle %s() calldata for Mantle; %w", tokenRatioMethod, err) + } + + return &Interceptor{ + client: client, + tokenRatioCallData: tokenRatioCallData, + }, nil +} + +// ModifyGasPriceComponents returns modified gasPrice. +func (i *Interceptor) ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (*big.Int, *big.Int, error) { + if time.Since(i.tokenRatioLastUpdate) > tokenRatioUpdateInterval { + mantleTokenRatio, err := i.getMantleTokenRatio(ctx) + if err != nil { + return nil, nil, err + } + + i.tokenRatio, i.tokenRatioLastUpdate = mantleTokenRatio, time.Now() + } + + // multiply daGasPrice and execGas price by tokenRatio + newExecGasPrice := new(big.Int).Mul(execGasPrice, i.tokenRatio) + newDAGasPrice := new(big.Int).Mul(daGasPrice, i.tokenRatio) + return newExecGasPrice, newDAGasPrice, nil +} + +// getMantleTokenRatio Requests and returns a token ratio value for the Mantle chain. +func (i *Interceptor) getMantleTokenRatio(ctx context.Context) (*big.Int, error) { + // FIXME it's removed from chainlink repo + // precompile := common.HexToAddress(rollups.OPGasOracleAddress) + precompile := utils.RandomAddress() + tokenRatio, err := i.client.CallContract(ctx, ethereum.CallMsg{ + To: &precompile, + Data: i.tokenRatioCallData, + }, nil) + + if err != nil { + return nil, fmt.Errorf("getMantleTokenRatio call failed: %w", err) + } + + return new(big.Int).SetBytes(tokenRatio), nil +} diff --git a/core/services/relay/evm/interceptors/mantle/interceptor_test.go b/core/services/relay/evm/interceptors/mantle/interceptor_test.go new file mode 100644 index 00000000000..9134d996c27 --- /dev/null +++ b/core/services/relay/evm/interceptors/mantle/interceptor_test.go @@ -0,0 +1,96 @@ +package mantle + +import ( + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" +) + +func TestInterceptor(t *testing.T) { + ethClient := mocks.NewClient(t) + ctx := context.Background() + + tokenRatio := big.NewInt(10) + interceptor, err := NewInterceptor(ctx, ethClient) + require.NoError(t, err) + + // request token ratio + ethClient.On("CallContract", ctx, mock.IsType(ethereum.CallMsg{}), mock.IsType(&big.Int{})). + Return(common.BigToHash(tokenRatio).Bytes(), nil).Once() + + modExecGasPrice, modDAGasPrice, err := interceptor.ModifyGasPriceComponents(ctx, big.NewInt(1), big.NewInt(1)) + require.NoError(t, err) + require.Equal(t, int64(10), modExecGasPrice.Int64()) + require.Equal(t, int64(10), modDAGasPrice.Int64()) + + // second call won't invoke eth client + modExecGasPrice, modDAGasPrice, err = interceptor.ModifyGasPriceComponents(ctx, big.NewInt(2), big.NewInt(1)) + require.NoError(t, err) + require.Equal(t, int64(20), modExecGasPrice.Int64()) + require.Equal(t, int64(10), modDAGasPrice.Int64()) +} + +func TestModifyGasPriceComponents(t *testing.T) { + testCases := map[string]struct { + execGasPrice *big.Int + daGasPrice *big.Int + tokenRatio *big.Int + resultExecGasPrice *big.Int + resultDAGasPrice *big.Int + }{ + "regular": { + execGasPrice: big.NewInt(1000), + daGasPrice: big.NewInt(100), + resultExecGasPrice: big.NewInt(2000), + resultDAGasPrice: big.NewInt(200), + tokenRatio: big.NewInt(2), + }, + "zero DAGasPrice": { + execGasPrice: big.NewInt(1000), + daGasPrice: big.NewInt(0), + resultExecGasPrice: big.NewInt(5000), + resultDAGasPrice: big.NewInt(0), + tokenRatio: big.NewInt(5), + }, + "zero ExecGasPrice": { + execGasPrice: big.NewInt(0), + daGasPrice: big.NewInt(10), + resultExecGasPrice: big.NewInt(0), + resultDAGasPrice: big.NewInt(50), + tokenRatio: big.NewInt(5), + }, + "zero token ratio": { + execGasPrice: big.NewInt(15), + daGasPrice: big.NewInt(10), + resultExecGasPrice: big.NewInt(0), + resultDAGasPrice: big.NewInt(0), + tokenRatio: big.NewInt(0), + }, + } + + for tcName, tc := range testCases { + t.Run(tcName, func(t *testing.T) { + ethClient := mocks.NewClient(t) + ctx := context.Background() + + interceptor, err := NewInterceptor(ctx, ethClient) + require.NoError(t, err) + + // request token ratio + ethClient.On("CallContract", ctx, mock.IsType(ethereum.CallMsg{}), mock.IsType(&big.Int{})). + Return(common.BigToHash(tc.tokenRatio).Bytes(), nil).Once() + + modExecGasPrice, modDAGasPrice, err := interceptor.ModifyGasPriceComponents(ctx, tc.execGasPrice, tc.daGasPrice) + require.NoError(t, err) + require.Equal(t, tc.resultExecGasPrice.Int64(), modExecGasPrice.Int64()) + require.Equal(t, tc.resultDAGasPrice.Int64(), modDAGasPrice.Int64()) + }) + } +} From 6a91c2851de12708c4a7e64a5c1178d63fdd1333 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:22:20 -0800 Subject: [PATCH 33/91] Ccip-4110 migration test (#15854) * remove deployCCIPContracts * deprecate existing add lane * new migration test * first version * more updates * fix tests * more fixes * include in pipeline * enabling test * upgrade chainlink ccip fixing router binding issues in migration * upgrade chainlink ccip fixing router binding issues in migration * review comments * review comments * review comments * fix * fix imports * upgrade ccip * fix --------- Co-authored-by: asoliman --- .github/integration-in-memory-tests.yml | 7 + core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- .../ccip/testhelpers/integration/jobspec.go | 4 +- .../ccip/changeset/accept_ownership_test.go | 2 +- .../changeset/cs_active_candidate_test.go | 3 +- deployment/ccip/changeset/cs_add_lane_test.go | 84 +---- .../ccip/changeset/cs_ccip_home_test.go | 8 +- .../ccip/changeset/cs_chain_contracts.go | 10 +- .../ccip/changeset/cs_chain_contracts_test.go | 10 +- .../ccip/changeset/cs_deploy_chain_test.go | 2 +- .../ccip/changeset/cs_home_chain_test.go | 4 +- .../changeset/cs_update_rmn_config_test.go | 19 +- deployment/ccip/changeset/state_test.go | 2 +- deployment/ccip/changeset/test_environment.go | 165 +++++---- deployment/ccip/changeset/test_params.go | 6 +- deployment/ccip/changeset/v1_5/e2e_test.go | 4 +- deployment/ccip/changeset/view_test.go | 2 +- .../transfer_to_mcms_with_timelock.go | 2 +- deployment/go.mod | 2 +- deployment/go.sum | 4 +- go.mod | 2 +- go.sum | 4 +- .../contracts/ccipreader_test.go | 10 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- .../smoke/ccip/ccip_batching_test.go | 2 +- .../smoke/ccip/ccip_fee_boosting_test.go | 2 +- .../smoke/ccip/ccip_fees_test.go | 2 +- .../smoke/ccip/ccip_gas_price_updates_test.go | 2 +- .../smoke/ccip/ccip_legacy_test.go | 51 --- .../ccip/ccip_message_limitations_test.go | 2 +- .../smoke/ccip/ccip_messaging_test.go | 2 +- .../ccip/ccip_migration_to_v_1_6_test.go | 317 ++++++++++++++++++ .../smoke/ccip/ccip_ooo_execution_test.go | 2 +- integration-tests/smoke/ccip/ccip_rmn_test.go | 2 +- .../ccip/ccip_token_price_updates_test.go | 2 +- .../smoke/ccip/ccip_token_transfer_test.go | 2 +- .../smoke/ccip/ccip_usdc_test.go | 2 +- .../testsetups/ccip/test_helpers.go | 60 ++-- 42 files changed, 551 insertions(+), 273 deletions(-) delete mode 100644 integration-tests/smoke/ccip/ccip_legacy_test.go create mode 100644 integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go diff --git a/.github/integration-in-memory-tests.yml b/.github/integration-in-memory-tests.yml index 9550d74f21f..ef0bf95c596 100644 --- a/.github/integration-in-memory-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -7,6 +7,13 @@ # runner-test-matrix: # START: CCIPv1.6 tests + - id: smoke/ccip/ccip_migration_to_v_1_6_test.go:* + path: integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go.go + test_env_type: in-memory + runs_on: ubuntu-latest + triggers: + - PR Integration CCIP Tests + test_cmd: cd integration-tests/smoke/ccip && go test ccip_migration_to_v_1_6_test.go -timeout 12m -test.parallel=1 -count=1 -json - id: smoke/ccip/ccip_fees_test.go:* path: integration-tests/smoke/ccip/ccip_fees_test.go diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 7d32653538d..b86baf9a203 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -306,7 +306,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 6494f578fdf..7cb29867b3a 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1158,8 +1158,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba h1:gisAer1YxKKui6LhxDgfuZ3OyrHVjHm/oK/0idusFeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= diff --git a/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go b/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go index 41fbc76cd7f..2a70ea0edd6 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go @@ -156,7 +156,7 @@ type JobType string const ( Commit JobType = "commit" Execution JobType = "exec" - Boostrap JobType = "bootstrap" + Bootstrap JobType = "bootstrap" ) func JobName(jobType JobType, source string, destination, version string) string { @@ -329,7 +329,7 @@ func (params CCIPJobSpecParams) BootstrapJob(contractID string) *OCR2TaskJobSpec }, } return &OCR2TaskJobSpec{ - Name: fmt.Sprintf("%s-%s", Boostrap, params.DestChainName), + Name: fmt.Sprintf("%s-%s-%s", Bootstrap, params.SourceChainName, params.DestChainName), JobType: "bootstrap", OCR2OracleSpec: bootstrapSpec, } diff --git a/deployment/ccip/changeset/accept_ownership_test.go b/deployment/ccip/changeset/accept_ownership_test.go index f74556b6600..dc3b0ba33b3 100644 --- a/deployment/ccip/changeset/accept_ownership_test.go +++ b/deployment/ccip/changeset/accept_ownership_test.go @@ -14,7 +14,7 @@ import ( func Test_NewAcceptOwnershipChangeset(t *testing.T) { t.Parallel() - e := NewMemoryEnvironment(t) + e, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(e.Env) require.NoError(t, err) diff --git a/deployment/ccip/changeset/cs_active_candidate_test.go b/deployment/ccip/changeset/cs_active_candidate_test.go index 92e3e825620..6016b06884b 100644 --- a/deployment/ccip/changeset/cs_active_candidate_test.go +++ b/deployment/ccip/changeset/cs_active_candidate_test.go @@ -9,6 +9,7 @@ import ( "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -25,7 +26,7 @@ func Test_ActiveCandidate(t *testing.T) { // We want to have the active instance execute a few messages // and then setup a candidate instance. The candidate instance // should not be able to transmit anything until we make it active. - tenv := NewMemoryEnvironment(t, + tenv, _ := NewMemoryEnvironment(t, WithChains(2), WithNodes(4)) state, err := LoadOnchainState(tenv.Env) diff --git a/deployment/ccip/changeset/cs_add_lane_test.go b/deployment/ccip/changeset/cs_add_lane_test.go index e793c1866d9..4b9f1f8641f 100644 --- a/deployment/ccip/changeset/cs_add_lane_test.go +++ b/deployment/ccip/changeset/cs_add_lane_test.go @@ -1,7 +1,6 @@ package changeset import ( - "math/big" "testing" "github.com/ethereum/go-ethereum/common" @@ -9,98 +8,19 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) func TestAddLanesWithTestRouter(t *testing.T) { t.Parallel() - e := NewMemoryEnvironment(t) + e, _ := NewMemoryEnvironment(t) // Here we have CR + nodes set up, but no CCIP contracts deployed. state, err := LoadOnchainState(e.Env) require.NoError(t, err) selectors := e.Env.AllChainSelectors() chain1, chain2 := selectors[0], selectors[1] - - stateChain1 := state.Chains[chain1] - e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{ - { - Changeset: commoncs.WrapChangeSet(UpdateOnRampsDests), - Config: UpdateOnRampDestsConfig{ - UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{ - chain1: { - chain2: { - IsEnabled: true, - TestRouter: true, - AllowListEnabled: false, - }, - }, - }, - }, - }, - { - Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterPricesCS), - Config: UpdateFeeQuoterPricesConfig{ - PricesByChain: map[uint64]FeeQuoterPriceUpdatePerSource{ - chain1: { - TokenPrices: map[common.Address]*big.Int{ - stateChain1.LinkToken.Address(): DefaultLinkPrice, - stateChain1.Weth9.Address(): DefaultWethPrice, - }, - GasPrices: map[uint64]*big.Int{ - chain2: DefaultGasPrice, - }, - }, - }, - }, - }, - { - Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterDests), - Config: UpdateFeeQuoterDestsConfig{ - UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ - chain1: { - chain2: DefaultFeeQuoterDestChainConfig(), - }, - }, - }, - }, - { - Changeset: commoncs.WrapChangeSet(UpdateOffRampSources), - Config: UpdateOffRampSourcesConfig{ - UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{ - chain2: { - chain1: { - IsEnabled: true, - TestRouter: true, - }, - }, - }, - }, - }, - { - Changeset: commoncs.WrapChangeSet(UpdateRouterRamps), - Config: UpdateRouterRampsConfig{ - TestRouter: true, - UpdatesByChain: map[uint64]RouterUpdates{ - // onRamp update on source chain - chain1: { - OnRampUpdates: map[uint64]bool{ - chain2: true, - }, - }, - // offramp update on dest chain - chain2: { - OffRampUpdates: map[uint64]bool{ - chain1: true, - }, - }, - }, - }, - }, - }) - require.NoError(t, err) + AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, chain1, chain2, true) // Need to keep track of the block number for each chain so that event subscription can be done from that block. startBlocks := make(map[uint64]*uint64) // Send a message from each chain to every other chain. diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go index eb22f05a703..884a501ce48 100644 --- a/deployment/ccip/changeset/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/cs_ccip_home_test.go @@ -38,7 +38,7 @@ func Test_PromoteCandidate(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv := NewMemoryEnvironment(t, + tenv, _ := NewMemoryEnvironment(t, WithChains(2), WithNodes(4)) state, err := LoadOnchainState(tenv.Env) @@ -130,7 +130,7 @@ func Test_SetCandidate(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv := NewMemoryEnvironment(t, + tenv, _ := NewMemoryEnvironment(t, WithChains(2), WithNodes(4)) state, err := LoadOnchainState(tenv.Env) @@ -251,7 +251,7 @@ func Test_RevokeCandidate(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv := NewMemoryEnvironment(t, + tenv, _ := NewMemoryEnvironment(t, WithChains(2), WithNodes(4)) state, err := LoadOnchainState(tenv.Env) @@ -442,7 +442,7 @@ func Test_UpdateChainConfigs(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - tenv := NewMemoryEnvironment(t, WithChains(3)) + tenv, _ := NewMemoryEnvironment(t, WithChains(3)) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) diff --git a/deployment/ccip/changeset/cs_chain_contracts.go b/deployment/ccip/changeset/cs_chain_contracts.go index e87e66e06b5..196de01124b 100644 --- a/deployment/ccip/changeset/cs_chain_contracts.go +++ b/deployment/ccip/changeset/cs_chain_contracts.go @@ -792,8 +792,14 @@ func (cfg UpdateRouterRampsConfig) Validate(e deployment.Environment) error { if chainState.OffRamp == nil { return fmt.Errorf("missing onramp onramp for chain %d", chainSel) } - if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, e.Chains[chainSel].DeployerKey.From, chainState.Timelock.Address(), chainState.Router); err != nil { - return err + if cfg.TestRouter { + if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, e.Chains[chainSel].DeployerKey.From, chainState.Timelock.Address(), chainState.TestRouter); err != nil { + return err + } + } else { + if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, e.Chains[chainSel].DeployerKey.From, chainState.Timelock.Address(), chainState.Router); err != nil { + return err + } } for source := range update.OffRampUpdates { diff --git a/deployment/ccip/changeset/cs_chain_contracts_test.go b/deployment/ccip/changeset/cs_chain_contracts_test.go index adbcc078373..544362a1b1e 100644 --- a/deployment/ccip/changeset/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/cs_chain_contracts_test.go @@ -32,7 +32,7 @@ func TestUpdateOnRampsDests(t *testing.T) { ctx := testcontext.Get(t) // Default env just has 2 chains with all contracts // deployed but no lanes. - tenv := NewMemoryEnvironment(t) + tenv, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) @@ -106,7 +106,7 @@ func TestUpdateOffRampsSources(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv := NewMemoryEnvironment(t) + tenv, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) @@ -176,7 +176,7 @@ func TestUpdateFQDests(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv := NewMemoryEnvironment(t) + tenv, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) @@ -244,7 +244,7 @@ func TestUpdateRouterRamps(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv := NewMemoryEnvironment(t) + tenv, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) @@ -320,7 +320,7 @@ func TestUpdateNonceManagersCS(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - tenv := NewMemoryEnvironment(t) + tenv, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) diff --git a/deployment/ccip/changeset/cs_deploy_chain_test.go b/deployment/ccip/changeset/cs_deploy_chain_test.go index a72b1b1568b..1f77be3ca5a 100644 --- a/deployment/ccip/changeset/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/cs_deploy_chain_test.go @@ -101,7 +101,7 @@ func TestDeployChainContractsChangeset(t *testing.T) { func TestDeployCCIPContracts(t *testing.T) { t.Parallel() - e := NewMemoryEnvironment(t) + e, _ := NewMemoryEnvironment(t) // Deploy all the CCIP contracts. state, err := LoadOnchainState(e.Env) require.NoError(t, err) diff --git a/deployment/ccip/changeset/cs_home_chain_test.go b/deployment/ccip/changeset/cs_home_chain_test.go index e96cd878305..135e60f4eb1 100644 --- a/deployment/ccip/changeset/cs_home_chain_test.go +++ b/deployment/ccip/changeset/cs_home_chain_test.go @@ -62,7 +62,7 @@ func TestDeployHomeChain(t *testing.T) { } func TestRemoveDonsValidate(t *testing.T) { - e := NewMemoryEnvironment(t) + e, _ := NewMemoryEnvironment(t) s, err := LoadOnchainState(e.Env) require.NoError(t, err) homeChain := s.Chains[e.HomeChainSel] @@ -117,7 +117,7 @@ func TestRemoveDonsValidate(t *testing.T) { } func TestRemoveDons(t *testing.T) { - e := NewMemoryEnvironment(t) + e, _ := NewMemoryEnvironment(t) s, err := LoadOnchainState(e.Env) require.NoError(t, err) homeChain := s.Chains[e.HomeChainSel] diff --git a/deployment/ccip/changeset/cs_update_rmn_config_test.go b/deployment/ccip/changeset/cs_update_rmn_config_test.go index e7543e22cb7..093fc9e337d 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config_test.go +++ b/deployment/ccip/changeset/cs_update_rmn_config_test.go @@ -65,7 +65,7 @@ func TestUpdateRMNConfig(t *testing.T) { } func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { - e := NewMemoryEnvironment(t) + e, _ := NewMemoryEnvironment(t) state, err := LoadOnchainState(e.Env) require.NoError(t, err) @@ -220,7 +220,7 @@ func buildRMNRemoteAddressPerChain(e deployment.Environment, state CCIPOnChainSt func TestSetRMNRemoteOnRMNProxy(t *testing.T) { t.Parallel() - e := NewMemoryEnvironment(t, WithNoJobsAndContracts()) + e, _ := NewMemoryEnvironment(t, WithNoJobsAndContracts()) allChains := e.Env.AllChainSelectors() mcmsCfg := make(map[uint64]commontypes.MCMSWithTimelockConfig) var err error @@ -265,6 +265,8 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { CallProxy: state.Chains[chain].CallProxy, } } + envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) + require.NoError(t, err) e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, timelockContractsPerChain, []commonchangeset.ChangesetApplication{ // transfer ownership of RMNProxy to timelock { @@ -274,6 +276,19 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { MinDelay: 0, }, }, + + { + Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), + Config: DeployHomeChainConfig{ + HomeChainSel: e.HomeChainSel, + RMNDynamicConfig: NewTestRMNDynamicConfig(), + RMNStaticConfig: NewTestRMNStaticConfig(), + NodeOperators: NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), + NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ + "NodeOperator": envNodes.NonBootstraps().PeerIDs(), + }, + }, + }, { Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), Config: DeployChainContractsConfig{ diff --git a/deployment/ccip/changeset/state_test.go b/deployment/ccip/changeset/state_test.go index 3587332fff2..f7d06efa66d 100644 --- a/deployment/ccip/changeset/state_test.go +++ b/deployment/ccip/changeset/state_test.go @@ -7,7 +7,7 @@ import ( ) func TestSmokeState(t *testing.T) { - tenv := NewMemoryEnvironment(t, WithChains(3)) + tenv, _ := NewMemoryEnvironment(t, WithChains(3)) state, err := LoadOnchainState(tenv.Env) require.NoError(t, err) _, err = state.View(tenv.Env.AllChainSelectors()) diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/test_environment.go index a1307d9820b..3e23f356857 100644 --- a/deployment/ccip/changeset/test_environment.go +++ b/deployment/ccip/changeset/test_environment.go @@ -42,21 +42,21 @@ type TestConfigs struct { Type EnvType // set by env var CCIP_V16_TEST_ENV, defaults to Memory CreateJob bool // TODO: This should be CreateContracts so the booleans make sense? - CreateJobAndContracts bool - LegacyDeployment bool - Chains int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input - ChainIDs []uint64 // only used in memory mode, for docker mode, this is determined by the integration-test config toml input - NumOfUsersPerChain int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input - Nodes int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input - Bootstraps int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input - IsUSDC bool - IsUSDCAttestationMissing bool - IsMultiCall3 bool - OCRConfigOverride func(CCIPOCRParams) CCIPOCRParams - RMNEnabled bool - NumOfRMNNodes int - LinkPrice *big.Int - WethPrice *big.Int + CreateJobAndContracts bool + PrerequisiteDeploymentOnly bool + Chains int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input + ChainIDs []uint64 // only used in memory mode, for docker mode, this is determined by the integration-test config toml input + NumOfUsersPerChain int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input + Nodes int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input + Bootstraps int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input + IsUSDC bool + IsUSDCAttestationMissing bool + IsMultiCall3 bool + OCRConfigOverride func(CCIPOCRParams) CCIPOCRParams + RMNEnabled bool + NumOfRMNNodes int + LinkPrice *big.Int + WethPrice *big.Int } func (tc *TestConfigs) Validate() error { @@ -106,9 +106,9 @@ func WithMultiCall3() TestOps { } } -func WithLegacyDeployment() TestOps { +func WithPrerequisiteDeployment() TestOps { return func(testCfg *TestConfigs) { - testCfg.LegacyDeployment = true + testCfg.PrerequisiteDeploymentOnly = true } } @@ -183,9 +183,11 @@ func WithBootstraps(numBootstraps int) TestOps { type TestEnvironment interface { SetupJobs(t *testing.T) - StartNodes(t *testing.T, tc *TestConfigs, crConfig deployment.CapabilityRegistryConfig) - StartChains(t *testing.T, tc *TestConfigs) + StartNodes(t *testing.T, crConfig deployment.CapabilityRegistryConfig) + StartChains(t *testing.T) + TestConfigs() *TestConfigs DeployedEnvironment() DeployedEnv + UpdateDeployedEnvironment(env DeployedEnv) MockUSDCAttestationServer(t *testing.T, isUSDCAttestationMissing bool) string } @@ -233,15 +235,25 @@ func (d *DeployedEnv) SetupJobs(t *testing.T) { type MemoryEnvironment struct { DeployedEnv - Chains map[uint64]deployment.Chain + TestConfig *TestConfigs + Chains map[uint64]deployment.Chain +} + +func (m *MemoryEnvironment) TestConfigs() *TestConfigs { + return m.TestConfig } func (m *MemoryEnvironment) DeployedEnvironment() DeployedEnv { return m.DeployedEnv } -func (m *MemoryEnvironment) StartChains(t *testing.T, tc *TestConfigs) { +func (m *MemoryEnvironment) UpdateDeployedEnvironment(env DeployedEnv) { + m.DeployedEnv = env +} + +func (m *MemoryEnvironment) StartChains(t *testing.T) { ctx := testcontext.Get(t) + tc := m.TestConfig var chains map[uint64]deployment.Chain var users map[uint64][]*bind.TransactOpts if len(tc.ChainIDs) > 0 { @@ -273,9 +285,10 @@ func (m *MemoryEnvironment) StartChains(t *testing.T, tc *TestConfigs) { } } -func (m *MemoryEnvironment) StartNodes(t *testing.T, tc *TestConfigs, crConfig deployment.CapabilityRegistryConfig) { +func (m *MemoryEnvironment) StartNodes(t *testing.T, crConfig deployment.CapabilityRegistryConfig) { require.NotNil(t, m.Chains, "start chains first, chains are empty") require.NotNil(t, m.DeployedEnv, "start chains and initiate deployed env first before starting nodes") + tc := m.TestConfig nodes := memory.NewNodes(t, zapcore.InfoLevel, m.Chains, tc.Nodes, tc.Bootstraps, crConfig) ctx := testcontext.Get(t) lggr := logger.Test(t) @@ -298,32 +311,39 @@ func (m *MemoryEnvironment) MockUSDCAttestationServer(t *testing.T, isUSDCAttest } // NewMemoryEnvironment creates an in-memory environment based on the testconfig requested -func NewMemoryEnvironment(t *testing.T, opts ...TestOps) DeployedEnv { +func NewMemoryEnvironment(t *testing.T, opts ...TestOps) (DeployedEnv, TestEnvironment) { testCfg := DefaultTestConfigs() for _, opt := range opts { opt(testCfg) } require.NoError(t, testCfg.Validate(), "invalid test config") - env := &MemoryEnvironment{} - if testCfg.LegacyDeployment { - return NewLegacyEnvironment(t, testCfg, env) + env := &MemoryEnvironment{ + TestConfig: testCfg, + } + if testCfg.PrerequisiteDeploymentOnly { + dEnv := NewEnvironmentWithPrerequisitesContracts(t, env) + env.UpdateDeployedEnvironment(dEnv) + return dEnv, env } if testCfg.CreateJobAndContracts { - return NewEnvironmentWithJobsAndContracts(t, testCfg, env) + dEnv := NewEnvironmentWithJobsAndContracts(t, env) + env.UpdateDeployedEnvironment(dEnv) + return dEnv, env } if testCfg.CreateJob { - return NewEnvironmentWithJobs(t, testCfg, env) + dEnv := NewEnvironmentWithJobs(t, env) + env.UpdateDeployedEnvironment(dEnv) + return dEnv, env } - return NewEnvironment(t, testCfg, env) + dEnv := NewEnvironment(t, env) + env.UpdateDeployedEnvironment(dEnv) + return dEnv, env } -func NewLegacyEnvironment(t *testing.T, tc *TestConfigs, tEnv TestEnvironment) DeployedEnv { +func NewEnvironmentWithPrerequisitesContracts(t *testing.T, tEnv TestEnvironment) DeployedEnv { var err error - tEnv.StartChains(t, tc) - e := tEnv.DeployedEnvironment() - require.NotEmpty(t, e.Env.Chains) - tEnv.StartNodes(t, tc, deployment.CapabilityRegistryConfig{}) - e = tEnv.DeployedEnvironment() + tc := tEnv.TestConfigs() + e := NewEnvironment(t, tEnv) allChains := e.Env.AllChainSelectors() mcmsCfg := make(map[uint64]commontypes.MCMSWithTimelockConfig) @@ -341,6 +361,7 @@ func NewLegacyEnvironment(t *testing.T, tc *TestConfigs, tEnv TestEnvironment) D opts = append(opts, WithMultiCall3Enabled()) } } + // no RMNConfig will ensure that mock RMN is deployed opts = append(opts, WithLegacyDeploymentEnabled(LegacyDeploymentConfig{ PriceRegStalenessThreshold: 60 * 60 * 24 * 14, // two weeks })) @@ -367,40 +388,30 @@ func NewLegacyEnvironment(t *testing.T, tc *TestConfigs, tEnv TestEnvironment) D }, }) require.NoError(t, err) + tEnv.UpdateDeployedEnvironment(e) return e } -func NewEnvironment(t *testing.T, tc *TestConfigs, tEnv TestEnvironment) DeployedEnv { +func NewEnvironment(t *testing.T, tEnv TestEnvironment) DeployedEnv { lggr := logger.Test(t) - tEnv.StartChains(t, tc) + tc := tEnv.TestConfigs() + tEnv.StartChains(t) dEnv := tEnv.DeployedEnvironment() require.NotEmpty(t, dEnv.FeedChainSel) require.NotEmpty(t, dEnv.HomeChainSel) require.NotEmpty(t, dEnv.Env.Chains) ab := deployment.NewMemoryAddressBook() crConfig := DeployTestContracts(t, lggr, ab, dEnv.HomeChainSel, dEnv.FeedChainSel, dEnv.Env.Chains, tc.LinkPrice, tc.WethPrice) - tEnv.StartNodes(t, tc, crConfig) + tEnv.StartNodes(t, crConfig) dEnv = tEnv.DeployedEnvironment() - // TODO: Should use ApplyChangesets here. - envNodes, err := deployment.NodeInfo(dEnv.Env.NodeIDs, dEnv.Env.Offchain) - require.NoError(t, err) dEnv.Env.ExistingAddresses = ab - _, err = deployHomeChain(lggr, dEnv.Env, dEnv.Env.ExistingAddresses, dEnv.Env.Chains[dEnv.HomeChainSel], - NewTestRMNStaticConfig(), - NewTestRMNDynamicConfig(), - NewTestNodeOperator(dEnv.Env.Chains[dEnv.HomeChainSel].DeployerKey.From), - map[string][][32]byte{ - "NodeOperator": envNodes.NonBootstraps().PeerIDs(), - }, - ) - require.NoError(t, err) - return dEnv } -func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv TestEnvironment) DeployedEnv { +func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) DeployedEnv { var err error - e := NewEnvironment(t, tc, tEnv) + tc := tEnv.TestConfigs() + e := NewEnvironment(t, tEnv) allChains := e.Env.AllChainSelectors() mcmsCfg := make(map[uint64]commontypes.MCMSWithTimelockConfig) @@ -441,6 +452,43 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv Test Changeset: commonchangeset.WrapChangeSet(commonchangeset.DeployMCMSWithTimelock), Config: mcmsCfg, }, + }) + require.NoError(t, err) + tEnv.UpdateDeployedEnvironment(e) + e = AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv) + // now we update RMNProxy to point to RMNRemote + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(SetRMNRemoteOnRMNProxy), + Config: SetRMNRemoteOnRMNProxyConfig{ + ChainSelectors: allChains, + }, + }, + }) + require.NoError(t, err) + return e +} + +func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEnvironment) DeployedEnv { + tc := tEnv.TestConfigs() + e := tEnv.DeployedEnvironment() + envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) + require.NoError(t, err) + // Need to deploy prerequisites first so that we can form the USDC config + // no proposals to be made, timelock can be passed as nil here + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), + Config: DeployHomeChainConfig{ + HomeChainSel: e.HomeChainSel, + RMNDynamicConfig: NewTestRMNDynamicConfig(), + RMNStaticConfig: NewTestRMNStaticConfig(), + NodeOperators: NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), + NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ + TestNodeOperator: envNodes.NonBootstraps().PeerIDs(), + }, + }, + }, { Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), Config: DeployChainContractsConfig{ @@ -448,12 +496,6 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv Test HomeChainSelector: e.HomeChainSel, }, }, - { - Changeset: commonchangeset.WrapChangeSet(SetRMNRemoteOnRMNProxy), - Config: SetRMNRemoteOnRMNProxyConfig{ - ChainSelectors: allChains, - }, - }, }) require.NoError(t, err) @@ -600,13 +642,14 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv Test require.NotNil(t, state.Chains[chain].OffRamp) require.NotNil(t, state.Chains[chain].OnRamp) } + tEnv.UpdateDeployedEnvironment(e) return e } // NewEnvironmentWithJobs creates a new CCIP environment // with capreg, fee tokens, feeds, nodes and jobs set up. -func NewEnvironmentWithJobs(t *testing.T, tc *TestConfigs, tEnv TestEnvironment) DeployedEnv { - e := NewEnvironment(t, tc, tEnv) +func NewEnvironmentWithJobs(t *testing.T, tEnv TestEnvironment) DeployedEnv { + e := NewEnvironment(t, tEnv) e.SetupJobs(t) return e } diff --git a/deployment/ccip/changeset/test_params.go b/deployment/ccip/changeset/test_params.go index a76a610a178..90331b50675 100644 --- a/deployment/ccip/changeset/test_params.go +++ b/deployment/ccip/changeset/test_params.go @@ -7,6 +7,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" ) +const ( + TestNodeOperator = "NodeOperator" +) + func NewTestRMNStaticConfig() rmn_home.RMNHomeStaticConfig { return rmn_home.RMNHomeStaticConfig{ Nodes: []rmn_home.RMNHomeNode{}, @@ -25,7 +29,7 @@ func NewTestNodeOperator(admin common.Address) []capabilities_registry.Capabilit return []capabilities_registry.CapabilitiesRegistryNodeOperator{ { Admin: admin, - Name: "NodeOperator", + Name: TestNodeOperator, }, } } diff --git a/deployment/ccip/changeset/v1_5/e2e_test.go b/deployment/ccip/changeset/v1_5/e2e_test.go index 11bb566c641..2019758b179 100644 --- a/deployment/ccip/changeset/v1_5/e2e_test.go +++ b/deployment/ccip/changeset/v1_5/e2e_test.go @@ -15,9 +15,9 @@ import ( // This test only works if the destination chain id is 1337 // Otherwise it shows error for offchain and onchain config digest mismatch func TestE2ELegacy(t *testing.T) { - e := changeset.NewMemoryEnvironment( + e, _ := changeset.NewMemoryEnvironment( t, - changeset.WithLegacyDeployment(), + changeset.WithPrerequisiteDeployment(), changeset.WithChains(3), changeset.WithChainIds([]uint64{chainselectors.GETH_TESTNET.EvmChainID})) state, err := changeset.LoadOnchainState(e.Env) diff --git a/deployment/ccip/changeset/view_test.go b/deployment/ccip/changeset/view_test.go index 35193979849..16d1f8a0dfc 100644 --- a/deployment/ccip/changeset/view_test.go +++ b/deployment/ccip/changeset/view_test.go @@ -8,7 +8,7 @@ import ( func TestSmokeView(t *testing.T) { t.Parallel() - tenv := NewMemoryEnvironment(t, WithChains(3)) + tenv, _ := NewMemoryEnvironment(t, WithChains(3)) _, err := ViewCCIP(tenv.Env) require.NoError(t, err) } diff --git a/deployment/common/changeset/transfer_to_mcms_with_timelock.go b/deployment/common/changeset/transfer_to_mcms_with_timelock.go index ab0883cc9a7..da932a95b01 100644 --- a/deployment/common/changeset/transfer_to_mcms_with_timelock.go +++ b/deployment/common/changeset/transfer_to_mcms_with_timelock.go @@ -40,7 +40,7 @@ func LoadOwnableContract(addr common.Address, client bind.ContractBackend) (comm } owner, err := c.Owner(nil) if err != nil { - return common.Address{}, nil, fmt.Errorf("failed to get owner of contract: %w", err) + return common.Address{}, nil, fmt.Errorf("failed to get owner of contract %s: %w", c.Address(), err) } return owner, c, nil } diff --git a/deployment/go.mod b/deployment/go.mod index 9595794978c..2daefd78f11 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -29,7 +29,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix github.com/smartcontractkit/chain-selectors v1.0.36 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 diff --git a/deployment/go.sum b/deployment/go.sum index 4800155620c..5e7d0ad9ced 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba h1:gisAer1YxKKui6LhxDgfuZ3OyrHVjHm/oK/0idusFeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= diff --git a/go.mod b/go.mod index ccedade99b3..3d4c747034e 100644 --- a/go.mod +++ b/go.mod @@ -78,7 +78,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 diff --git a/go.sum b/go.sum index 6e8c1b4b5f3..44fb07ef951 100644 --- a/go.sum +++ b/go.sum @@ -1150,8 +1150,8 @@ github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3f github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba h1:gisAer1YxKKui6LhxDgfuZ3OyrHVjHm/oK/0idusFeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/contracts/ccipreader_test.go b/integration-tests/contracts/ccipreader_test.go index ace0783365c..b7ea027a568 100644 --- a/integration-tests/contracts/ccipreader_test.go +++ b/integration-tests/contracts/ccipreader_test.go @@ -590,7 +590,7 @@ func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) { t.Parallel() ctx := tests.Context(t) //env := NewMemoryEnvironmentContractsOnly(t, logger.TestLogger(t), 2, 4, nil) - env := changeset.NewMemoryEnvironment(t) + env, _ := changeset.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) @@ -700,7 +700,7 @@ func TestCCIPReader_Nonces(t *testing.T) { func Test_GetChainFeePriceUpdates(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env := changeset.NewMemoryEnvironment(t) + env, _ := changeset.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) @@ -756,7 +756,7 @@ func Test_GetChainFeePriceUpdates(t *testing.T) { func Test_LinkPriceUSD(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env := changeset.NewMemoryEnvironment(t) + env, _ := changeset.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) @@ -791,7 +791,7 @@ func Test_LinkPriceUSD(t *testing.T) { func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env := changeset.NewMemoryEnvironment(t, changeset.WithChains(4)) + env, _ := changeset.NewMemoryEnvironment(t, changeset.WithChains(4)) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) @@ -850,7 +850,7 @@ func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) { func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env := changeset.NewMemoryEnvironment(t) + env, _ := changeset.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index bb1952af8f3..cc161d6b92a 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -46,7 +46,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 2377fe29ce3..52c0922d743 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1408,8 +1408,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba h1:gisAer1YxKKui6LhxDgfuZ3OyrHVjHm/oK/0idusFeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 2c0703ed3b5..fbf204e160d 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -410,7 +410,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 036b3992aaf..0ed3bcbf368 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1397,8 +1397,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba h1:gisAer1YxKKui6LhxDgfuZ3OyrHVjHm/oK/0idusFeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250109124515-ff9d86b874ba/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= diff --git a/integration-tests/smoke/ccip/ccip_batching_test.go b/integration-tests/smoke/ccip/ccip_batching_test.go index 3752faa4e6e..6c204fa45a3 100644 --- a/integration-tests/smoke/ccip/ccip_batching_test.go +++ b/integration-tests/smoke/ccip/ccip_batching_test.go @@ -39,7 +39,7 @@ type batchTestSetup struct { func newBatchTestSetup(t *testing.T) batchTestSetup { // Setup 3 chains, with 2 lanes going to the dest. - e, _ := testsetups.NewIntegrationEnvironment( + e, _, _ := testsetups.NewIntegrationEnvironment( t, changeset.WithMultiCall3(), changeset.WithChains(3), diff --git a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go index 3b0ebf22455..49f603a39f4 100644 --- a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go +++ b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go @@ -34,7 +34,7 @@ var ( ) func Test_CCIPFeeBoosting(t *testing.T) { - e, _ := testsetups.NewIntegrationEnvironment( + e, _, _ := testsetups.NewIntegrationEnvironment( t, changeset.WithOCRConfigOverride(func(params changeset.CCIPOCRParams) changeset.CCIPOCRParams { // Only 1 boost (=OCR round) is enough to cover the fee diff --git a/integration-tests/smoke/ccip/ccip_fees_test.go b/integration-tests/smoke/ccip/ccip_fees_test.go index 57a6bc58d82..d0f9cc71683 100644 --- a/integration-tests/smoke/ccip/ccip_fees_test.go +++ b/integration-tests/smoke/ccip/ccip_fees_test.go @@ -101,7 +101,7 @@ func setupTokens( func Test_CCIPFees(t *testing.T) { t.Parallel() - tenv, _ := testsetups.NewIntegrationEnvironment( + tenv, _, _ := testsetups.NewIntegrationEnvironment( t, changeset.WithMultiCall3(), ) diff --git a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go index 2c1d97f6c12..09023f1d321 100644 --- a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go +++ b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go @@ -26,7 +26,7 @@ func Test_CCIPGasPriceUpdates(t *testing.T) { callOpts := &bind.CallOpts{Context: ctx} var gasPriceExpiry = 5 * time.Second - e, _ := testsetups.NewIntegrationEnvironment(t, + e, _, _ := testsetups.NewIntegrationEnvironment(t, changeset.WithOCRConfigOverride(func(params changeset.CCIPOCRParams) changeset.CCIPOCRParams { params.CommitOffChainConfig.RemoteGasPriceBatchWriteFrequency = *config.MustNewDuration(gasPriceExpiry) return params diff --git a/integration-tests/smoke/ccip/ccip_legacy_test.go b/integration-tests/smoke/ccip/ccip_legacy_test.go deleted file mode 100644 index 2b5b6d77b58..00000000000 --- a/integration-tests/smoke/ccip/ccip_legacy_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package smoke - -import ( - "context" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5" - testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" -) - -// This test does not run in CI, it is only written as an example of how to write a test for the legacy CCIP -func TestE2ELegacy(t *testing.T) { - e, _ := testsetups.NewIntegrationEnvironment(t, changeset.WithLegacyDeployment()) - state, err := changeset.LoadOnchainState(e.Env) - require.NoError(t, err) - allChains := e.Env.AllChainSelectors() - require.Len(t, allChains, 2) - src, dest := allChains[0], allChains[1] - srcChain := e.Env.Chains[src] - destChain := e.Env.Chains[dest] - pairs := []changeset.SourceDestPair{ - {SourceChainSelector: src, DestChainSelector: dest}, - } - e.Env = v1_5.AddLanes(t, e.Env, state, pairs) - // reload state after adding lanes - state, err = changeset.LoadOnchainState(e.Env) - require.NoError(t, err) - sentEvent, err := v1_5.SendRequest(t, e.Env, state, - changeset.WithSourceChain(src), - changeset.WithDestChain(dest), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ - Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), - Data: []byte("hello"), - TokenAmounts: nil, - FeeToken: common.HexToAddress("0x0"), - ExtraArgs: nil, - }), - ) - require.NoError(t, err) - require.NotNil(t, sentEvent) - destStartBlock, err := destChain.Client.HeaderByNumber(context.Background(), nil) - require.NoError(t, err) - v1_5.WaitForCommit(t, srcChain, destChain, state.Chains[dest].CommitStore[src], sentEvent.Message.SequenceNumber) - v1_5.WaitForExecute(t, srcChain, destChain, state.Chains[dest].EVM2EVMOffRamp[src], []uint64{sentEvent.Message.SequenceNumber}, destStartBlock.Number.Uint64()) -} diff --git a/integration-tests/smoke/ccip/ccip_message_limitations_test.go b/integration-tests/smoke/ccip/ccip_message_limitations_test.go index f9299b735d0..2882a34af63 100644 --- a/integration-tests/smoke/ccip/ccip_message_limitations_test.go +++ b/integration-tests/smoke/ccip/ccip_message_limitations_test.go @@ -23,7 +23,7 @@ func Test_CCIPMessageLimitations(t *testing.T) { ctx := testcontext.Get(t) callOpts := &bind.CallOpts{Context: ctx} - testEnv, _ := testsetups.NewIntegrationEnvironment(t) + testEnv, _, _ := testsetups.NewIntegrationEnvironment(t) chains := maps.Keys(testEnv.Env.Chains) onChainState, err := changeset.LoadOnchainState(testEnv.Env) diff --git a/integration-tests/smoke/ccip/ccip_messaging_test.go b/integration-tests/smoke/ccip/ccip_messaging_test.go index 8ee18a31918..f010bab5ee1 100644 --- a/integration-tests/smoke/ccip/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip/ccip_messaging_test.go @@ -47,7 +47,7 @@ type messagingTestCaseOutput struct { func Test_CCIPMessaging(t *testing.T) { // Setup 2 chains and a single lane. ctx := changeset.Context(t) - e, _ := testsetups.NewIntegrationEnvironment(t) + e, _, _ := testsetups.NewIntegrationEnvironment(t) state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) diff --git a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go new file mode 100644 index 00000000000..0559054f2d6 --- /dev/null +++ b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go @@ -0,0 +1,317 @@ +package smoke + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + chainselectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" +) + +func TestMigrateFromV1_5ToV1_6(t *testing.T) { + // Deploy CCIP 1.5 with 3 chains and 4 nodes + 1 bootstrap + // Deploy 1.5 contracts (excluding pools and real RMN, use MockRMN to start, but including MCMS) . + e, _, tEnv := testsetups.NewIntegrationEnvironment( + t, + changeset.WithPrerequisiteDeployment(), + changeset.WithChains(3), + changeset.WithUsersPerChain(2), + // for in-memory test it is important to set the dest chain id as 1337 otherwise the config digest will not match + // between nodes' calculated digest and the digest set on the contract + changeset.WithChainIds([]uint64{chainselectors.GETH_TESTNET.EvmChainID}), + ) + state, err := changeset.LoadOnchainState(e.Env) + require.NoError(t, err) + allChainsExcept1337 := e.Env.AllChainSelectorsExcluding([]uint64{chainselectors.GETH_TESTNET.Selector}) + require.Contains(t, e.Env.AllChainSelectors(), chainselectors.GETH_TESTNET.Selector) + require.Len(t, allChainsExcept1337, 2) + src1, src2, dest := allChainsExcept1337[0], allChainsExcept1337[1], chainselectors.GETH_TESTNET.Selector + pairs := []changeset.SourceDestPair{ + // as mentioned in the comment above, the dest chain id should be 1337 + {SourceChainSelector: src1, DestChainSelector: dest}, + {SourceChainSelector: src2, DestChainSelector: dest}, + } + // wire up all lanes + // deploy onRamp, commit store, offramp , set ocr2config and send corresponding jobs + e.Env = v1_5.AddLanes(t, e.Env, state, pairs) + + // reload state after adding lanes + state, err = changeset.LoadOnchainState(e.Env) + require.NoError(t, err) + tEnv.UpdateDeployedEnvironment(e) + // ensure that all lanes are functional + for _, pair := range pairs { + sentEvent, err := v1_5.SendRequest(t, e.Env, state, + changeset.WithSourceChain(pair.SourceChainSelector), + changeset.WithDestChain(pair.DestChainSelector), + changeset.WithTestRouter(false), + changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[pair.DestChainSelector].Receiver.Address().Bytes(), 32), + Data: []byte("hello"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }), + ) + require.NoError(t, err) + require.NotNil(t, sentEvent) + destChain := e.Env.Chains[pair.DestChainSelector] + destStartBlock, err := destChain.Client.HeaderByNumber(context.Background(), nil) + require.NoError(t, err) + v1_5.WaitForCommit(t, e.Env.Chains[pair.SourceChainSelector], destChain, state.Chains[dest].CommitStore[src1], sentEvent.Message.SequenceNumber) + v1_5.WaitForExecute(t, e.Env.Chains[pair.SourceChainSelector], destChain, state.Chains[dest].EVM2EVMOffRamp[src1], []uint64{sentEvent.Message.SequenceNumber}, destStartBlock.Number.Uint64()) + } + + // now that all 1.5 lanes work transfer ownership of the contracts to MCMS + contractsByChain := make(map[uint64][]common.Address) + for _, chain := range e.Env.AllChainSelectors() { + contractsByChain[chain] = []common.Address{ + state.Chains[chain].Router.Address(), + state.Chains[chain].RMNProxy.Address(), + state.Chains[chain].PriceRegistry.Address(), + state.Chains[chain].TokenAdminRegistry.Address(), + state.Chains[chain].MockRMN.Address(), + } + if state.Chains[chain].EVM2EVMOnRamp != nil { + for _, onRamp := range state.Chains[chain].EVM2EVMOnRamp { + contractsByChain[chain] = append(contractsByChain[chain], onRamp.Address()) + } + } + if state.Chains[chain].EVM2EVMOffRamp != nil { + for _, offRamp := range state.Chains[chain].EVM2EVMOffRamp { + contractsByChain[chain] = append(contractsByChain[chain], offRamp.Address()) + } + } + } + + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), + Config: commonchangeset.TransferToMCMSWithTimelockConfig{ + ContractsByChain: contractsByChain, + MinDelay: 0, + }, + }, + }) + require.NoError(t, err) + // add 1.6 contracts to the environment and send 1.6 jobs + // First we need to deploy Homechain contracts and restart the nodes with updated cap registry + // in this test we have already deployed home chain contracts and the nodes are already running with the deployed cap registry. + e = changeset.AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv) + // Set RMNProxy to point to RMNRemote. + // nonce manager should point to 1.5 ramps + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + // as we have already transferred ownership for RMNProxy to MCMS, it needs to be done via MCMS proposal + Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNRemoteOnRMNProxy), + Config: changeset.SetRMNRemoteOnRMNProxyConfig{ + ChainSelectors: e.Env.AllChainSelectors(), + MCMSConfig: &changeset.MCMSConfig{ + MinDelay: 0, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateNonceManagersCS), + Config: changeset.UpdateNonceManagerConfig{ + // we only have lanes between src1 --> dest + UpdatesByChain: map[uint64]changeset.NonceManagerUpdate{ + src1: { + PreviousRampsArgs: []changeset.PreviousRampCfg{ + { + RemoteChainSelector: dest, + EnableOnRamp: true, + }, + }, + }, + src2: { + PreviousRampsArgs: []changeset.PreviousRampCfg{ + { + RemoteChainSelector: dest, + EnableOnRamp: true, + }, + }, + }, + dest: { + PreviousRampsArgs: []changeset.PreviousRampCfg{ + { + RemoteChainSelector: src1, + EnableOffRamp: true, + }, + { + RemoteChainSelector: src2, + EnableOffRamp: true, + }, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) + state, err = changeset.LoadOnchainState(e.Env) + require.NoError(t, err) + + // Enable a single 1.6 lane with test router + changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, src1, dest, true) + require.GreaterOrEqual(t, len(e.Users[src1]), 2) + startBlocks := make(map[uint64]*uint64) + latesthdr, err := e.Env.Chains[dest].Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + block := latesthdr.Number.Uint64() + startBlocks[dest] = &block + expectedSeqNumExec := make(map[changeset.SourceDestPair][]uint64) + msgSentEvent, err := changeset.DoSendRequest( + t, e.Env, state, + changeset.WithSourceChain(src1), + changeset.WithDestChain(dest), + changeset.WithTestRouter(true), + // Send traffic across single 1.6 lane with a DIFFERENT ( very important to not mess with real sender nonce) sender + // from test router to ensure 1.6 is working. + changeset.WithSender(e.Users[src1][1]), + changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + })) + require.NoError(t, err) + + expectedSeqNumExec[changeset.SourceDestPair{ + SourceChainSelector: src1, + DestChainSelector: dest, + }] = []uint64{msgSentEvent.SequenceNumber} + + // Wait for all exec reports to land + changeset.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + + // send a message from real router, the send requested event should be received in 1.5 onRamp + // the request should get delivered to 1.5 offRamp + sentEventBeforeSwitch, err := v1_5.SendRequest(t, e.Env, state, + changeset.WithSourceChain(src1), + changeset.WithDestChain(dest), + changeset.WithTestRouter(false), + changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }), + ) + require.NoError(t, err) + require.NotNil(t, sentEventBeforeSwitch) + + // now that the 1.6 lane is working, we can enable the real router + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDests), + Config: changeset.UpdateOnRampDestsConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{ + src1: { + dest: { + IsEnabled: true, + TestRouter: false, + AllowListEnabled: false, + }, + }, + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSources), + Config: changeset.UpdateOffRampSourcesConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{ + dest: { + src1: { + IsEnabled: true, + TestRouter: false, + }, + }, + }, + }, + }, + { + // this needs to be MCMS proposal as the router contract is owned by MCMS + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRamps), + Config: changeset.UpdateRouterRampsConfig{ + TestRouter: false, + MCMS: &changeset.MCMSConfig{ + MinDelay: 0, + }, + UpdatesByChain: map[uint64]changeset.RouterUpdates{ + // onRamp update on source chain + src1: { + OnRampUpdates: map[uint64]bool{ + dest: true, + }, + }, + // offramp update on dest chain + dest: { + OffRampUpdates: map[uint64]bool{ + src1: true, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) + + // send a message from real router the send requested event should be received in 1.6 onRamp + // the request should get delivered to 1.6 offRamp + destStartBlock, err := e.Env.Chains[dest].Client.HeaderByNumber(context.Background(), nil) + require.NoError(t, err) + sentEventAfterSwitch, err := changeset.DoSendRequest( + t, e.Env, state, + changeset.WithSourceChain(src1), + changeset.WithDestChain(dest), + changeset.WithTestRouter(false), + changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + })) + require.NoError(t, err) + // verify that before switch message is received in 1.5 offRamp + v1_5.WaitForExecute(t, e.Env.Chains[src1], e.Env.Chains[dest], state.Chains[dest].EVM2EVMOffRamp[src1], + []uint64{sentEventBeforeSwitch.Message.SequenceNumber}, destStartBlock.Number.Uint64()) + + // verify that after switch message is received in 1.6 offRamp + expectedSeqNumExec[changeset.SourceDestPair{ + SourceChainSelector: src1, + DestChainSelector: dest, + }] = []uint64{sentEventAfterSwitch.SequenceNumber} + changeset.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + + // confirm that the other lane src2->dest is still working with v1.5 + sentEventOnOtherLane, err := v1_5.SendRequest(t, e.Env, state, + changeset.WithSourceChain(src2), + changeset.WithDestChain(dest), + changeset.WithTestRouter(false), + changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }), + ) + require.NoError(t, err) + require.NotNil(t, sentEventOnOtherLane) + v1_5.WaitForExecute(t, e.Env.Chains[src2], e.Env.Chains[dest], state.Chains[dest].EVM2EVMOffRamp[src2], + []uint64{sentEventOnOtherLane.Message.SequenceNumber}, destStartBlock.Number.Uint64()) +} diff --git a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go index e3da473984d..272c87e9996 100644 --- a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go +++ b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go @@ -33,7 +33,7 @@ import ( func Test_OutOfOrderExecution(t *testing.T) { lggr := logger.TestLogger(t) ctx := tests.Context(t) - tenv, _ := testsetups.NewIntegrationEnvironment( + tenv, _, _ := testsetups.NewIntegrationEnvironment( t, changeset.WithUSDC(), changeset.WithUSDCAttestationMissing(), diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go index 7036260d130..67f99cd5a7b 100644 --- a/integration-tests/smoke/ccip/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -247,7 +247,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { ctx := testcontext.Get(t) t.Logf("Running RMN test case: %s", tc.name) - envWithRMN, rmnCluster := testsetups.NewIntegrationEnvironment(t, + envWithRMN, rmnCluster, _ := testsetups.NewIntegrationEnvironment(t, changeset.WithRMNEnabled(len(tc.rmnNodes)), ) t.Logf("envWithRmn: %#v", envWithRMN) diff --git a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go index fb7ddc847d4..e54790de24c 100644 --- a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go +++ b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go @@ -28,7 +28,7 @@ func Test_CCIPTokenPriceUpdates(t *testing.T) { callOpts := &bind.CallOpts{Context: ctx} var tokenPriceExpiry = 5 * time.Second - e, _ := testsetups.NewIntegrationEnvironment(t, + e, _, _ := testsetups.NewIntegrationEnvironment(t, changeset.WithOCRConfigOverride(func(params changeset.CCIPOCRParams) changeset.CCIPOCRParams { params.CommitOffChainConfig.TokenPriceBatchWriteFrequency = *config.MustNewDuration(tokenPriceExpiry) return params diff --git a/integration-tests/smoke/ccip/ccip_token_transfer_test.go b/integration-tests/smoke/ccip/ccip_token_transfer_test.go index c5cabfe63e4..7946d6f8c7c 100644 --- a/integration-tests/smoke/ccip/ccip_token_transfer_test.go +++ b/integration-tests/smoke/ccip/ccip_token_transfer_test.go @@ -22,7 +22,7 @@ func TestTokenTransfer(t *testing.T) { lggr := logger.TestLogger(t) ctx := tests.Context(t) - tenv, _ := testsetups.NewIntegrationEnvironment(t, + tenv, _, _ := testsetups.NewIntegrationEnvironment(t, changeset.WithUsersPerChain(3)) e := tenv.Env diff --git a/integration-tests/smoke/ccip/ccip_usdc_test.go b/integration-tests/smoke/ccip/ccip_usdc_test.go index 7bea68a9cbf..33af1570943 100644 --- a/integration-tests/smoke/ccip/ccip_usdc_test.go +++ b/integration-tests/smoke/ccip/ccip_usdc_test.go @@ -32,7 +32,7 @@ import ( func TestUSDCTokenTransfer(t *testing.T) { lggr := logger.TestLogger(t) ctx := tests.Context(t) - tenv, _ := testsetups.NewIntegrationEnvironment(t, + tenv, _, _ := testsetups.NewIntegrationEnvironment(t, changeset.WithUsersPerChain(3), changeset.WithChains(3), changeset.WithUSDC(), diff --git a/integration-tests/testsetups/ccip/test_helpers.go b/integration-tests/testsetups/ccip/test_helpers.go index 6725ac1df9b..889c6b1cdf5 100644 --- a/integration-tests/testsetups/ccip/test_helpers.go +++ b/integration-tests/testsetups/ccip/test_helpers.go @@ -53,17 +53,26 @@ import ( // DeployedLocalDevEnvironment is a helper struct for setting up a local dev environment with docker type DeployedLocalDevEnvironment struct { changeset.DeployedEnv - testEnv *test_env.CLClusterTestEnv - DON *devenv.DON - devEnvTestCfg tc.TestConfig - devEnvCfg *devenv.EnvironmentConfig + testEnv *test_env.CLClusterTestEnv + DON *devenv.DON + GenericTCConfig *changeset.TestConfigs + devEnvTestCfg tc.TestConfig + devEnvCfg *devenv.EnvironmentConfig } func (l *DeployedLocalDevEnvironment) DeployedEnvironment() changeset.DeployedEnv { return l.DeployedEnv } -func (l *DeployedLocalDevEnvironment) StartChains(t *testing.T, _ *changeset.TestConfigs) { +func (l *DeployedLocalDevEnvironment) UpdateDeployedEnvironment(env changeset.DeployedEnv) { + l.DeployedEnv = env +} + +func (l *DeployedLocalDevEnvironment) TestConfigs() *changeset.TestConfigs { + return l.GenericTCConfig +} + +func (l *DeployedLocalDevEnvironment) StartChains(t *testing.T) { lggr := logger.TestLogger(t) ctx := testcontext.Get(t) envConfig, testEnv, cfg := CreateDockerEnv(t) @@ -91,7 +100,7 @@ func (l *DeployedLocalDevEnvironment) StartChains(t *testing.T, _ *changeset.Tes l.DeployedEnv.ReplayBlocks = replayBlocks } -func (l *DeployedLocalDevEnvironment) StartNodes(t *testing.T, _ *changeset.TestConfigs, crConfig deployment.CapabilityRegistryConfig) { +func (l *DeployedLocalDevEnvironment) StartNodes(t *testing.T, crConfig deployment.CapabilityRegistryConfig) { require.NotNil(t, l.testEnv, "docker env is empty, start chains first") require.NotEmpty(t, l.devEnvTestCfg, "integration test config is empty, start chains first") require.NotNil(t, l.devEnvCfg, "dev environment config is empty, start chains first") @@ -143,7 +152,7 @@ func (l *DeployedLocalDevEnvironment) RestartChainlinkNodes(t *testing.T) error // if CCIP_V16_TEST_ENV is set to 'docker', it creates a docker environment with test config provided under testconfig/ccip/ccip.toml // It also creates a RMN cluster if the test config has RMN enabled // It returns the deployed environment and RMN cluster ( in case of RMN enabled) -func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changeset.DeployedEnv, devenv.RMNCluster) { +func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changeset.DeployedEnv, devenv.RMNCluster, changeset.TestEnvironment) { testCfg := changeset.DefaultTestConfigs() for _, opt := range opts { opt(testCfg) @@ -153,17 +162,20 @@ func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changes require.NoError(t, testCfg.Validate(), "invalid test config") switch testCfg.Type { case changeset.Memory: - memEnv := changeset.NewMemoryEnvironment(t, opts...) - return memEnv, devenv.RMNCluster{} + dEnv, memEnv := changeset.NewMemoryEnvironment(t, opts...) + return dEnv, devenv.RMNCluster{}, memEnv case changeset.Docker: - dockerEnv := &DeployedLocalDevEnvironment{} - if testCfg.LegacyDeployment { - deployedEnv := changeset.NewLegacyEnvironment(t, testCfg, dockerEnv) + dockerEnv := &DeployedLocalDevEnvironment{ + GenericTCConfig: testCfg, + } + if testCfg.PrerequisiteDeploymentOnly { + deployedEnv := changeset.NewEnvironmentWithPrerequisitesContracts(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") - return deployedEnv, devenv.RMNCluster{} + dockerEnv.UpdateDeployedEnvironment(deployedEnv) + return deployedEnv, devenv.RMNCluster{}, dockerEnv } if testCfg.RMNEnabled { - deployedEnv := changeset.NewEnvironmentWithJobsAndContracts(t, testCfg, dockerEnv) + deployedEnv := changeset.NewEnvironmentWithJobsAndContracts(t, dockerEnv) l := logging.GetTestLogger(t) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") config := GenerateTestRMNConfig(t, testCfg.NumOfRMNNodes, deployedEnv, MustNetworksToRPCMap(dockerEnv.testEnv.EVMNetworks)) @@ -178,25 +190,29 @@ func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changes dockerEnv.devEnvTestCfg.CCIP.RMNConfig.GetAFN2ProxyVersion(), ) require.NoError(t, err) - return deployedEnv, *rmnCluster + dockerEnv.UpdateDeployedEnvironment(deployedEnv) + return deployedEnv, *rmnCluster, dockerEnv } if testCfg.CreateJobAndContracts { - deployedEnv := changeset.NewEnvironmentWithJobsAndContracts(t, testCfg, dockerEnv) + deployedEnv := changeset.NewEnvironmentWithJobsAndContracts(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") - return deployedEnv, devenv.RMNCluster{} + dockerEnv.UpdateDeployedEnvironment(deployedEnv) + return deployedEnv, devenv.RMNCluster{}, dockerEnv } if testCfg.CreateJob { - deployedEnv := changeset.NewEnvironmentWithJobs(t, testCfg, dockerEnv) + deployedEnv := changeset.NewEnvironmentWithJobs(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") - return deployedEnv, devenv.RMNCluster{} + dockerEnv.UpdateDeployedEnvironment(deployedEnv) + return deployedEnv, devenv.RMNCluster{}, dockerEnv } - deployedEnv := changeset.NewEnvironment(t, testCfg, dockerEnv) + deployedEnv := changeset.NewEnvironment(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") - return deployedEnv, devenv.RMNCluster{} + dockerEnv.UpdateDeployedEnvironment(deployedEnv) + return deployedEnv, devenv.RMNCluster{}, dockerEnv default: require.Failf(t, "Type %s not supported in integration tests choose between %s and %s", string(testCfg.Type), changeset.Memory, changeset.Docker) } - return changeset.DeployedEnv{}, devenv.RMNCluster{} + return changeset.DeployedEnv{}, devenv.RMNCluster{}, nil } func MustNetworksToRPCMap(evmNetworks []*blockchain.EVMNetwork) map[uint64]string { From adf13dc1f11e2321a9b67a483c6f1e0594e77c85 Mon Sep 17 00:00:00 2001 From: HenryNguyen5 <6404866+HenryNguyen5@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:45:03 -0800 Subject: [PATCH 34/91] Keystone in CRIB (#14326) * Add node api wrapper for ergonomic cmd usage * Add streams trigger template * Add mock external adapter for v03 mercury * First pass of streams trigger provisioning * WIP: Add capabilities registry provisioner script * Update nix flake * Fixup provisioning scripts * Change default chainid to be 1337 * Add nil check for balances * Add ability to skip tls verification for local dev * Gently fail on not loading contracts for ocr job deletion * fixup! Change default chainid to be 1337 * Formatting * Change ocr file flag default * Allow for multiple OCR2KB selection in key fetching * Support on/offchain transmitter OCR3 config generation * Properly reset clientmethod on each invocation * Add mercury contract deployment feature * Get oracles to successfully connect to each other * Keep OCR3 and OCR2 config separate * Add goreleaser setup for mock ea * Add support for updating bridges * Add UpdateBridge CLI command * Cleanup comments * Fix typo * Add revert detection and revert reason extraction * Add missing env field to CR struct * Fix CR deployment bugs * Fix trigger capability typo * Add external registry and capability p2p config gen * Add redial support for logging in * Fix capability registration * HACK: Add keystone workflow deployment to streams trigger cmd * Typo * Log ocr3 config more extensively * Set isPublic to false for all-in-one DON * Use nodeapi for deleting ocr3 jobs * Have mock EA return consistent prices every 10 sec * Remove pluginconfig to properly enable trigger * Add additional logging * Fix rebase errors * Shim ksdeploy types * Fix goreleaser config for mock ea * Dont depend on cgo for mock EA * Handle aptos key creation * Tune mercury OCR rounds to be less freq * Use deployments rather than pods * Overhaul node host + url handling * Add dummy encryption public key to nodes * Add missing ctx * Initial multidon support * Fix ingress generation for postprevision * Fix argument ordering * Fix nodelist sorting and evmconfig.workflow configuration * Update tests * Assign keystone workflows to workflow nodes * Expose capabilities on WorkflowDON * Skip bootstrap node for keystone workflows * Refactor nodelists + pubkeys -> nodesets * Skip adding bootstrap nodes to capability registry * Skip bootstrap node for mercury OCR config * Formatting * Fix stale print statement * Bump nodeset size to minimum 5 since > 2F+1 * Use service name for DNS resolution * Update tests * Fix missing / incorrect fields for keystone workflow * Update gomods * Simplify node key handling * Formatting * Add test mocks * Refactor - Use single entrypoint for provisiong keystone in CRIB * Add OCR3 caching * Refactor provisioning flags and improve argument validation in keystone script * Refactor: Remove stale references and fix refactor related bugs * Create artefacts dir if it doesnt exist * Simplify jobspec and bridge handling * Remove unneeded token transfer calls * Refactor: Cleanup logging, add more tx caching * Fix post-rebase errors * Fix OCR3 digest comparison * Remove extra cmd cruft * Remove unused func * Undo transmitter changes * Revert "Add test mocks" This reverts commit 75cafe96a08d6495c8040076a053e3e1a33e4154. * Fix caching * Remove deprecated assertion call * Update gomod * Fix linter warns * Add changeset * Add additional logging around node sets and key fetching * Run gomodtidy * Fix additional lints * Harden API request logic * Readme WIP * Clean up lints, remove old readme * Increase retry interval * Update goreleaser to 2.4.4-pro * Handle non postfix path * Resolve darwin shell hook from git root * Bump streams trigger cap to 1.1.0 * Create toolkit sub-cli * Cleanup toolkit * Reverse URLs for nodelists * Update snapshots * Remove unneeded gosec ignore * Update gomods * Log when we set ocr3 config * Cleanup argument parsing * Fix nodes list parsing * Fix lints + address feedback * Update gomods to point to this branches pseudo version * Update gomods to point to this branches pseudo version * Bump wrappers to 1.1.0 * fix test indentation, quoting * revert bad merge to main; workflow.go, cap_encoder* * linter --------- Co-authored-by: Justin Kaseman Co-authored-by: krehermann <16602512+krehermann@users.noreply.github.com> --- .changeset/loud-birds-remain.md | 5 + core/cmd/bridge_commands.go | 23 + core/cmd/bridge_commands_test.go | 42 ++ core/scripts/common/helpers.go | 16 +- core/scripts/go.mod | 8 +- .../keystone/01_deploy_contracts-sample.sh | 11 - .../keystone/02_deploy_jobspecs-sample.sh | 7 - core/scripts/keystone/03_gen_crib-sample.sh | 6 - .../keystone/04_delete_ocr3_jobs-sample.sh | 3 - ...initialize_capabilities_registry-sample.sh | 8 - core/scripts/keystone/README.md | 91 --- core/scripts/keystone/artefacts/README.md | 1 - core/scripts/keystone/main.go | 8 +- .../keystone/src/01_deploy_contracts_cmd.go | 226 ------- .../keystone/src/01_provision_keystone.go | 217 +++++++ core/scripts/keystone/src/01_toolkit.go | 212 +++++++ core/scripts/keystone/src/01_toolkit_test.go | 49 ++ .../keystone/src/02_deploy_jobspecs_cmd.go | 165 ----- .../src/02_deploy_keystone_workflows.go | 134 ++++ .../src/02_deploy_keystone_workflows_test.go | 21 + .../keystone/src/02_fund_transmitters.go | 52 ++ .../src/02_provision_capabilities_registry.go | 68 +++ .../scripts/keystone/src/02_provision_crib.go | 310 ++++++++++ .../keystone/src/02_provision_crib_test.go | 44 ++ .../src/02_provision_forwarder_contract.go | 33 + .../src/02_provision_ocr3_capability.go | 286 +++++++++ .../src/02_provision_ocr3_capability_test.go | 67 ++ ...02_provision_streams_trigger_capability.go | 522 ++++++++++++++++ ...ovision_streams_trigger_capability_test.go | 57 ++ .../src/03_gen_crib_cluster_overrides_cmd.go | 86 --- .../03_gen_crib_cluster_overrides_cmd_test.go | 19 - .../keystone/src/04_delete_ocr3_jobs_cmd.go | 101 --- ...deploy_initialize_capabilities_registry.go | 82 +-- .../keystone/src/06_deploy_workflows_cmd.go | 71 --- .../keystone/src/07_delete_workflows_cmd.go | 74 --- .../src/88_capabilities_registry_helpers.go | 578 ++++++++++++++++++ .../keystone/src/88_contracts_helpers.go | 192 ++++++ core/scripts/keystone/src/88_gen_jobspecs.go | 91 --- .../keystone/src/88_gen_jobspecs_test.go | 37 -- .../keystone/src/88_gen_ocr3_config.go | 20 - .../keystone/src/88_gen_ocr3_config_test.go | 31 - .../keystone/src/88_jobspecs_helpers.go | 53 ++ core/scripts/keystone/src/88_ocr_helpers.go | 69 +++ core/scripts/keystone/src/99_app.go | 386 +++++++++++- core/scripts/keystone/src/99_crib_client.go | 71 ++- core/scripts/keystone/src/99_fetch_keys.go | 397 ++++++------ core/scripts/keystone/src/99_files.go | 67 +- core/scripts/keystone/src/99_files_test.go | 36 -- core/scripts/keystone/src/99_k8s_client.go | 74 ++- core/scripts/keystone/src/99_nodes.go | 72 --- .../02_deploy_keystone_workflows_test.snap | 57 ++ .../__snapshots__/02_provision_crib_test.snap | 415 +++++++++++++ .../02_provision_ocr3_capability_test.snap | 65 ++ ...ision_streams_trigger_capability_test.snap | 50 ++ ...3_gen_crib_cluster_overrides_cmd_test.snap | 44 -- .../__snapshots__/88_gen_jobspecs_test.snap | 140 ----- .../88_gen_ocr3_config_test.snap | 23 - .../src/external-adapter/.goreleaser.yaml | 49 ++ .../external-adapter/99_external_adapter.go | 154 +++++ .../keystone/src/external-adapter/Dockerfile | 5 + .../keystone/src/testdata/NodeList.txt | 5 - .../keystone/src/testdata/PublicKeys.json | 57 -- .../keystone/src/testdata/node_sets.json | 298 +++++++++ .../scripts/keystone/templates/bootstrap.toml | 9 - .../keystone/templates/crib-overrides.yaml | 41 -- core/scripts/keystone/templates/oracle.toml | 27 - core/services/job/models.go | 2 +- deployment/go.mod | 2 +- integration-tests/go.mod | 4 +- integration-tests/load/go.mod | 6 +- shell.nix | 3 +- tools/goreleaser-config/go.mod | 2 +- 72 files changed, 4851 insertions(+), 1906 deletions(-) create mode 100644 .changeset/loud-birds-remain.md delete mode 100755 core/scripts/keystone/01_deploy_contracts-sample.sh delete mode 100755 core/scripts/keystone/02_deploy_jobspecs-sample.sh delete mode 100755 core/scripts/keystone/03_gen_crib-sample.sh delete mode 100755 core/scripts/keystone/04_delete_ocr3_jobs-sample.sh delete mode 100755 core/scripts/keystone/05_deploy_and_initialize_capabilities_registry-sample.sh delete mode 100644 core/scripts/keystone/README.md delete mode 100644 core/scripts/keystone/artefacts/README.md delete mode 100644 core/scripts/keystone/src/01_deploy_contracts_cmd.go create mode 100644 core/scripts/keystone/src/01_provision_keystone.go create mode 100644 core/scripts/keystone/src/01_toolkit.go create mode 100644 core/scripts/keystone/src/01_toolkit_test.go delete mode 100644 core/scripts/keystone/src/02_deploy_jobspecs_cmd.go create mode 100644 core/scripts/keystone/src/02_deploy_keystone_workflows.go create mode 100644 core/scripts/keystone/src/02_deploy_keystone_workflows_test.go create mode 100644 core/scripts/keystone/src/02_fund_transmitters.go create mode 100644 core/scripts/keystone/src/02_provision_capabilities_registry.go create mode 100644 core/scripts/keystone/src/02_provision_crib.go create mode 100644 core/scripts/keystone/src/02_provision_crib_test.go create mode 100644 core/scripts/keystone/src/02_provision_forwarder_contract.go create mode 100644 core/scripts/keystone/src/02_provision_ocr3_capability.go create mode 100644 core/scripts/keystone/src/02_provision_ocr3_capability_test.go create mode 100644 core/scripts/keystone/src/02_provision_streams_trigger_capability.go create mode 100644 core/scripts/keystone/src/02_provision_streams_trigger_capability_test.go delete mode 100644 core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go delete mode 100644 core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go delete mode 100644 core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go delete mode 100644 core/scripts/keystone/src/06_deploy_workflows_cmd.go delete mode 100644 core/scripts/keystone/src/07_delete_workflows_cmd.go create mode 100644 core/scripts/keystone/src/88_capabilities_registry_helpers.go create mode 100644 core/scripts/keystone/src/88_contracts_helpers.go delete mode 100644 core/scripts/keystone/src/88_gen_jobspecs.go delete mode 100644 core/scripts/keystone/src/88_gen_jobspecs_test.go delete mode 100644 core/scripts/keystone/src/88_gen_ocr3_config.go delete mode 100644 core/scripts/keystone/src/88_gen_ocr3_config_test.go create mode 100644 core/scripts/keystone/src/88_jobspecs_helpers.go create mode 100644 core/scripts/keystone/src/88_ocr_helpers.go delete mode 100644 core/scripts/keystone/src/99_files_test.go delete mode 100644 core/scripts/keystone/src/99_nodes.go create mode 100755 core/scripts/keystone/src/__snapshots__/02_deploy_keystone_workflows_test.snap create mode 100755 core/scripts/keystone/src/__snapshots__/02_provision_crib_test.snap create mode 100755 core/scripts/keystone/src/__snapshots__/02_provision_ocr3_capability_test.snap create mode 100755 core/scripts/keystone/src/__snapshots__/02_provision_streams_trigger_capability_test.snap delete mode 100755 core/scripts/keystone/src/__snapshots__/03_gen_crib_cluster_overrides_cmd_test.snap delete mode 100755 core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap delete mode 100755 core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap create mode 100644 core/scripts/keystone/src/external-adapter/.goreleaser.yaml create mode 100644 core/scripts/keystone/src/external-adapter/99_external_adapter.go create mode 100644 core/scripts/keystone/src/external-adapter/Dockerfile delete mode 100644 core/scripts/keystone/src/testdata/NodeList.txt delete mode 100644 core/scripts/keystone/src/testdata/PublicKeys.json create mode 100644 core/scripts/keystone/src/testdata/node_sets.json delete mode 100644 core/scripts/keystone/templates/bootstrap.toml delete mode 100644 core/scripts/keystone/templates/crib-overrides.yaml delete mode 100644 core/scripts/keystone/templates/oracle.toml diff --git a/.changeset/loud-birds-remain.md b/.changeset/loud-birds-remain.md new file mode 100644 index 00000000000..eb1e8f8a9ca --- /dev/null +++ b/.changeset/loud-birds-remain.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#internal Add unexposed shell cmd for updating a bridge diff --git a/core/cmd/bridge_commands.go b/core/cmd/bridge_commands.go index 398d466c43a..cd314b23218 100644 --- a/core/cmd/bridge_commands.go +++ b/core/cmd/bridge_commands.go @@ -128,6 +128,29 @@ func (s *Shell) CreateBridge(c *cli.Context) (err error) { return s.renderAPIResponse(resp, &BridgePresenter{}) } +func (s *Shell) UpdateBridge(c *cli.Context) (err error) { + if !c.Args().Present() { + return s.errorOut(errors.New("must pass the name of the bridge to be updated")) + } + bridgeName := c.Args().First() + buf, err := getBufferFromJSON(c.Args().Get(1)) + if err != nil { + return s.errorOut(err) + } + + resp, err := s.HTTP.Patch(s.ctx(), "/v2/bridge_types/"+bridgeName, buf) + if err != nil { + return s.errorOut(err) + } + defer func() { + if cerr := resp.Body.Close(); cerr != nil { + err = multierr.Append(err, cerr) + } + }() + + return s.renderAPIResponse(resp, &BridgePresenter{}) +} + // RemoveBridge removes a specific Bridge by name. func (s *Shell) RemoveBridge(c *cli.Context) (err error) { if !c.Args().Present() { diff --git a/core/cmd/bridge_commands_test.go b/core/cmd/bridge_commands_test.go index f05aac52cd9..5523fc09605 100644 --- a/core/cmd/bridge_commands_test.go +++ b/core/cmd/bridge_commands_test.go @@ -3,6 +3,7 @@ package cmd_test import ( "bytes" "flag" + "fmt" "testing" "time" @@ -191,3 +192,44 @@ func TestShell_RemoveBridge(t *testing.T) { assert.Equal(t, bt.URL.String(), p.URL) assert.Equal(t, bt.Confirmations, p.Confirmations) } +func TestShell_UpdateBridge(t *testing.T) { + t.Parallel() + + app := startNewApplicationV2(t, nil) + client, _ := app.NewShellAndRenderer() + name := testutils.RandomizeName("updatebridge") + + bt := &bridges.BridgeType{ + Name: bridges.MustParseBridgeName(name), + URL: cltest.WebURL(t, "https://testing.com/bridges"), + Confirmations: 0, + } + require.NoError(t, app.BridgeORM().CreateBridgeType(testutils.Context(t), bt)) + tests := []struct { + name string + args []string + errored bool + }{ + {"NoArgs", []string{}, true}, + {"OnlyName", []string{name}, true}, + {"ValidUpdate", []string{name, fmt.Sprintf(`{ "name": "%s", "url": "http://localhost:3000/updated" }`, name)}, false}, + {"InvalidJSON", []string{name, `{ "url": "http://localhost:3000/updated"`}, true}, + } + + for _, tt := range tests { + test := tt + t.Run(test.name, func(t *testing.T) { + set := flag.NewFlagSet("bridge", 0) + flagSetApplyFromAction(client.UpdateBridge, set, "") + + require.NoError(t, set.Parse(test.args)) + + c := cli.NewContext(nil, set, nil) + if test.errored { + assert.Error(t, client.UpdateBridge(c)) + } else { + assert.NoError(t, client.UpdateBridge(c)) + } + }) + } +} diff --git a/core/scripts/common/helpers.go b/core/scripts/common/helpers.go index 57c8c15e405..97ca2dd4929 100644 --- a/core/scripts/common/helpers.go +++ b/core/scripts/common/helpers.go @@ -3,10 +3,12 @@ package common import ( "context" "crypto/ecdsa" + "crypto/tls" "encoding/hex" "flag" "fmt" "math/big" + "net/http" "os" "strconv" "strings" @@ -69,11 +71,17 @@ func SetupEnv(overrideNonce bool) Environment { panic("need account key") } - ec, err := ethclient.Dial(ethURL) - PanicErr(err) - - jsonRPCClient, err := rpc.Dial(ethURL) + insecureSkipVerify := os.Getenv("INSECURE_SKIP_VERIFY") == "true" + tr := &http.Transport{ + // User enables this at their own risk! + // #nosec G402 + TLSClientConfig: &tls.Config{InsecureSkipVerify: insecureSkipVerify}, + } + httpClient := &http.Client{Transport: tr} + rpcConfig := rpc.WithHTTPClient(httpClient) + jsonRPCClient, err := rpc.DialOptions(context.Background(), ethURL, rpcConfig) PanicErr(err) + ec := ethclient.NewClient(jsonRPCClient) chainID, err := strconv.ParseInt(chainIDEnv, 10, 64) PanicErr(err) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index b86baf9a203..897962a6454 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -34,6 +34,8 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 + github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 @@ -41,7 +43,9 @@ require ( github.com/umbracle/ethgo v0.1.3 github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 github.com/urfave/cli v1.22.14 + go.uber.org/zap v1.27.0 google.golang.org/protobuf v1.35.1 + gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 k8s.io/client-go v0.31.1 @@ -309,14 +313,12 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect - github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect @@ -381,7 +383,6 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect - go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.11.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect @@ -405,7 +406,6 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect diff --git a/core/scripts/keystone/01_deploy_contracts-sample.sh b/core/scripts/keystone/01_deploy_contracts-sample.sh deleted file mode 100755 index 89e77f4556f..00000000000 --- a/core/scripts/keystone/01_deploy_contracts-sample.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -go run main.go \ - deploy-contracts \ - --ocrfile=ocr_config.json \ - --chainid=11155111 \ - --ethurl=ETH_URL \ - --accountkey=ACCOUNT_KEY \ - --onlysetconfig=false \ - --skipfunding=false \ - --dryrun=false diff --git a/core/scripts/keystone/02_deploy_jobspecs-sample.sh b/core/scripts/keystone/02_deploy_jobspecs-sample.sh deleted file mode 100755 index e99d54e0d3b..00000000000 --- a/core/scripts/keystone/02_deploy_jobspecs-sample.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -go run main.go \ - deploy-jobspecs \ - --chainid=11155111 \ - --p2pport=6690 \ - --onlyreplay=false diff --git a/core/scripts/keystone/03_gen_crib-sample.sh b/core/scripts/keystone/03_gen_crib-sample.sh deleted file mode 100755 index 9193ef4f75b..00000000000 --- a/core/scripts/keystone/03_gen_crib-sample.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -go run main.go \ - generate-crib \ - --chainid=11155111 \ - --outpath=/tmp diff --git a/core/scripts/keystone/04_delete_ocr3_jobs-sample.sh b/core/scripts/keystone/04_delete_ocr3_jobs-sample.sh deleted file mode 100755 index 3f3b50b055c..00000000000 --- a/core/scripts/keystone/04_delete_ocr3_jobs-sample.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -go run main.go delete-ocr3-jobs diff --git a/core/scripts/keystone/05_deploy_and_initialize_capabilities_registry-sample.sh b/core/scripts/keystone/05_deploy_and_initialize_capabilities_registry-sample.sh deleted file mode 100755 index 21c764be0e8..00000000000 --- a/core/scripts/keystone/05_deploy_and_initialize_capabilities_registry-sample.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -go run main.go \ - deploy-and-initialize-capabilities-registry \ - --chainid=11155111 \ - --ethurl=$ETH_URL \ - --accountkey=$ACCOUNT_KEY \ - --craddress=$CR_ADDRESS \ // 0x0d36aAC2Fd9d6d1C1F59251be6A2B337af27C52B diff --git a/core/scripts/keystone/README.md b/core/scripts/keystone/README.md deleted file mode 100644 index f08f738cb78..00000000000 --- a/core/scripts/keystone/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Provisioning a CRIB keystone cluster - -Kudos to Functions team for inspiration. - -This document outlines the steps to provision a CRIB keystone cluster for testing OCR3. - -## Pre-requisites - -### Blockchain Node - -An HTTP URL to a blockchain node, such as a Geth node. This should be the same blockchain node that you used to deploy the chainlink node cluster. - -### Private Key - -A private key to a testing wallet to use for deployment and funding. This wallet should have some native token on the chain you're deploying to. For Sepolia, around 2 ETH should be sufficient. - -The easiest way to set this up is to download [Metamask](https://metamask.io/) and create a new wallet. Once you have created a wallet, you can export the private key by clicking on the three dots next to the wallet name, selecting "Account Details", and then "Show Private Key". - -## Usage - -### Your first deployment - -Using devspace, we can deploy a cluster and provision it via the `keystone` devspace profile. You'll want to follow the instructions in the [CRIB README](../../../crib/README.md) to set up your environment and deploy the cluster. - -**NOTE**: You'll want to deploy using the `keystone` profile, not the default profile file. - -```bash -# From /crib -devspace deploy --profile keystone -``` - -For convenience, setting the TTL to be a much longer value is helpful, otherwise the testnet native tokens that you send to nodes will be lost. You can set this in your crib `.env` file, or interactively via: - -```bash -# From /crib -devspace run ttl ${namespace} 7d -``` - -Everytime the interactive command is run, the TTL is reset. - -### Iterate -Let's say you made some changes to the codebase, and you want to see that reflected within the cluster. Simply redeploy via: -```bash -devspace deploy --profile keystone -``` - -### Restarting from a fresh slate - -If you want to redeploy all resources, then you'll want to do the following: - -```bash -# From /crib -devspace purge --profile keystone # Remove all k8s resources -DEVSPACE_NAMESPACE=crib- crib init # Purge currently leaves some hanging resources, make a new namespace -devspace deploy --profile keysone --clean # Wipe any keystone related persisted data, like artefacts and caches. -``` - -## What does Provisioning a CRIB keystone cluster do? - -### Provision On-Chain Resources - -This will provision on-chain resources, namely: - -1. Deploy the forwarder contract -2. Deploy OCR3 config contract -3. Setting the configuration for the OCR3 contract -4. Funding transmitters with native tokens - -When the on-chain resources are deployed, a json file within `artefacts` will be generated. This file will contain the addresses of the forwarder contract, the OCR3 config contract, and the block number at which the configuration was set. Be careful about deleting this file, as if you lose it, you will need to redeploy the contracts and run through all proceeding steps. - -### Job Spec Deployment - -The next step is to deploy the OCR3 job specs to the chainlink node cluster. This will create a bootstrapping job for the first node of the cluster (determined via alphabetical order) and an OCR job for each other node in the cluster. - -### Update Per-Node TOML Configuration - -While we already have the chainlink node cluster deployed, we need to update the TOML configuration for each node to configure the `ChainWriter`. -After updated TOML configuration overrides are generated per node, the cluster is redeployed such that the updates that effect without wiping the databases. - -## Future Work - -### Keystone workflow deployment -Workflow style job spec deployments are not currently support, but it should be a minor modification to the existing OCR job spec deployment logic - -### Multi-DON support -Multiple DONs are not currently supported -- the devspace profile will need to be expanded so that we have multiple deployments, one per DON. -- network policy / open ports will likely have to be adjusted in the chart - -### Smarter jobspec deployment -Currently, job specs deployment logic is dumb. The scripts don't check if the jobspec to deploy already exists. If you need to redeploy a job spec that has the same name as a currently uploaded one, you'll want to delete the existing job specs via `./04_delete_ocr3_jobs.sh`. diff --git a/core/scripts/keystone/artefacts/README.md b/core/scripts/keystone/artefacts/README.md deleted file mode 100644 index 68f06dbd1c8..00000000000 --- a/core/scripts/keystone/artefacts/README.md +++ /dev/null @@ -1 +0,0 @@ -All generated artefacts will be saved here. \ No newline at end of file diff --git a/core/scripts/keystone/main.go b/core/scripts/keystone/main.go index 3486830ca32..4bd8dea0e5f 100644 --- a/core/scripts/keystone/main.go +++ b/core/scripts/keystone/main.go @@ -15,13 +15,9 @@ type command interface { func main() { commands := []command{ - src.NewDeployContractsCommand(), - src.NewDeployJobSpecsCommand(), - src.NewGenerateCribClusterOverridesCommand(), - src.NewDeleteJobsCommand(), + src.NewProvisionKeystoneCommand(), src.NewDeployAndInitializeCapabilitiesRegistryCommand(), - src.NewDeployWorkflowsCommand(), - src.NewDeleteWorkflowsCommand(), + src.NewToolkit(), } commandsList := func(commands []command) string { diff --git a/core/scripts/keystone/src/01_deploy_contracts_cmd.go b/core/scripts/keystone/src/01_deploy_contracts_cmd.go deleted file mode 100644 index 14c8d989063..00000000000 --- a/core/scripts/keystone/src/01_deploy_contracts_cmd.go +++ /dev/null @@ -1,226 +0,0 @@ -package src - -import ( - "context" - "encoding/json" - "flag" - "fmt" - "math/big" - "os" - "path/filepath" - - "github.com/ethereum/go-ethereum/common" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" - forwarder "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder_1_0_0" - ocr3_capability "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability_1_0_0" -) - -type deployedContracts struct { - OCRContract common.Address `json:"ocrContract"` - ForwarderContract common.Address `json:"forwarderContract"` - // The block number of the transaction that set the config on the OCR3 contract. We use this to replay blocks from this point on - // when we load the OCR3 job specs on the nodes. - SetConfigTxBlock uint64 `json:"setConfigTxBlock"` -} - -type deployContracts struct{} - -func NewDeployContractsCommand() *deployContracts { - return &deployContracts{} -} - -func (g *deployContracts) Name() string { - return "deploy-contracts" -} - -// Run expects the follow environment variables to be set: -// -// 1. Deploys the OCR3 contract -// 2. Deploys the Forwarder contract -// 3. Sets the config on the OCR3 contract -// 4. Writes the deployed contract addresses to a file -// 5. Funds the transmitters -func (g *deployContracts) Run(args []string) { - fs := flag.NewFlagSet(g.Name(), flag.ExitOnError) - ocrConfigFile := fs.String("ocrfile", "config_example.json", "path to OCR config file") - // create flags for all of the env vars then set the env vars to normalize the interface - // this is a bit of a hack but it's the easiest way to make this work - ethUrl := fs.String("ethurl", "", "URL of the Ethereum node") - chainID := fs.Int64("chainid", 11155111, "chain ID of the Ethereum network to deploy to") - accountKey := fs.String("accountkey", "", "private key of the account to deploy from") - skipFunding := fs.Bool("skipfunding", false, "skip funding the transmitters") - onlySetConfig := fs.Bool("onlysetconfig", false, "set the config on the OCR3 contract without deploying the contracts or funding transmitters") - dryRun := fs.Bool("dryrun", false, "dry run, don't actually deploy the contracts and do not fund transmitters") - publicKeys := fs.String("publickeys", "", "Custom public keys json location") - nodeList := fs.String("nodes", "", "Custom node list location") - artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") - - err := fs.Parse(args) - - if err != nil || - *ocrConfigFile == "" || ocrConfigFile == nil || - *ethUrl == "" || ethUrl == nil || - *chainID == 0 || chainID == nil || - *accountKey == "" || accountKey == nil { - fs.Usage() - os.Exit(1) - } - - if *artefactsDir == "" { - *artefactsDir = defaultArtefactsDir - } - if *publicKeys == "" { - *publicKeys = defaultPublicKeys - } - if *nodeList == "" { - *nodeList = defaultNodeList - } - - os.Setenv("ETH_URL", *ethUrl) - os.Setenv("ETH_CHAIN_ID", fmt.Sprintf("%d", *chainID)) - os.Setenv("ACCOUNT_KEY", *accountKey) - - deploy(*nodeList, *publicKeys, *ocrConfigFile, *skipFunding, *dryRun, *onlySetConfig, *artefactsDir) -} - -// deploy does the following: -// 1. Deploys the OCR3 contract -// 2. Deploys the Forwarder contract -// 3. Sets the config on the OCR3 contract -// 4. Writes the deployed contract addresses to a file -// 5. Funds the transmitters -func deploy( - nodeList string, - publicKeys string, - configFile string, - skipFunding bool, - dryRun bool, - onlySetConfig bool, - artefacts string, -) { - env := helpers.SetupEnv(false) - ocrConfig := generateOCR3Config( - nodeList, - configFile, - env.ChainID, - publicKeys, - ) - - if dryRun { - fmt.Println("Dry run, skipping deployment and funding") - return - } - - if onlySetConfig { - fmt.Println("Skipping deployment of contracts and skipping funding transmitters, only setting config") - setOCR3Config(env, ocrConfig, artefacts) - return - } - - if ContractsAlreadyDeployed(artefacts) { - fmt.Println("Contracts already deployed") - return - } - - fmt.Println("Deploying keystone ocr3 contract...") - ocrContract := DeployKeystoneOCR3Capability(env) - fmt.Println("Deploying keystone forwarder contract...") - forwarderContract := DeployForwarder(env) - - fmt.Println("Writing deployed contract addresses to file...") - contracts := deployedContracts{ - OCRContract: ocrContract.Address(), - ForwarderContract: forwarderContract.Address(), - } - jsonBytes, err := json.Marshal(contracts) - PanicErr(err) - - err = os.WriteFile(DeployedContractsFilePath(artefacts), jsonBytes, 0600) - PanicErr(err) - - setOCR3Config(env, ocrConfig, artefacts) - - if skipFunding { - fmt.Println("Skipping funding transmitters") - return - } - fmt.Println("Funding transmitters...") - transmittersStr := []string{} - for _, t := range ocrConfig.Transmitters { - transmittersStr = append(transmittersStr, t.String()) - } - - helpers.FundNodes(env, transmittersStr, big.NewInt(50000000000000000)) // 0.05 ETH -} - -func setOCR3Config( - env helpers.Environment, - ocrConfig changeset.OCR3OnchainConfig, - artefacts string, -) { - loadedContracts, err := LoadDeployedContracts(artefacts) - PanicErr(err) - - ocrContract, err := ocr3_capability.NewOCR3Capability(loadedContracts.OCRContract, env.Ec) - PanicErr(err) - fmt.Println("Setting OCR3 contract config...") - tx, err := ocrContract.SetConfig(env.Owner, - ocrConfig.Signers, - ocrConfig.Transmitters, - ocrConfig.F, - ocrConfig.OnchainConfig, - ocrConfig.OffchainConfigVersion, - ocrConfig.OffchainConfig, - ) - PanicErr(err) - receipt := helpers.ConfirmTXMined(context.Background(), env.Ec, tx, env.ChainID) - - // Write blocknumber of the transaction to the deployed contracts file - loadedContracts.SetConfigTxBlock = receipt.BlockNumber.Uint64() - jsonBytes, err := json.Marshal(loadedContracts) - PanicErr(err) - err = os.WriteFile(DeployedContractsFilePath(artefacts), jsonBytes, 0600) - PanicErr(err) -} - -func LoadDeployedContracts(artefacts string) (deployedContracts, error) { - if !ContractsAlreadyDeployed(artefacts) { - return deployedContracts{}, fmt.Errorf("no deployed contracts found, run deploy first") - } - - jsonBytes, err := os.ReadFile(DeployedContractsFilePath(artefacts)) - if err != nil { - return deployedContracts{}, err - } - - var contracts deployedContracts - err = json.Unmarshal(jsonBytes, &contracts) - return contracts, err -} - -func ContractsAlreadyDeployed(artefacts string) bool { - _, err := os.Stat(DeployedContractsFilePath(artefacts)) - return err == nil -} - -func DeployedContractsFilePath(artefacts string) string { - return filepath.Join(artefacts, deployedContractsJSON) -} - -func DeployForwarder(e helpers.Environment) *forwarder.KeystoneForwarder { - _, tx, contract, err := forwarder.DeployKeystoneForwarder(e.Owner, e.Ec) - PanicErr(err) - helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) - - return contract -} - -func DeployKeystoneOCR3Capability(e helpers.Environment) *ocr3_capability.OCR3Capability { - _, tx, contract, err := ocr3_capability.DeployOCR3Capability(e.Owner, e.Ec) - PanicErr(err) - helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) - - return contract -} diff --git a/core/scripts/keystone/src/01_provision_keystone.go b/core/scripts/keystone/src/01_provision_keystone.go new file mode 100644 index 00000000000..c7a2dd97127 --- /dev/null +++ b/core/scripts/keystone/src/01_provision_keystone.go @@ -0,0 +1,217 @@ +package src + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "strconv" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" +) + +type provisionKeystone struct{} + +func NewProvisionKeystoneCommand() *provisionKeystone { + return &provisionKeystone{} +} + +func (g *provisionKeystone) Name() string { + return "provision-keystone" +} + +func (g *provisionKeystone) Run(args []string) { + fs := flag.NewFlagSet(g.Name(), flag.ExitOnError) + + // common flags + artefactsDir := fs.String("artefacts", defaultArtefactsDir, "Custom artefacts directory location") + nodeSetSize := fs.Int("nodesetsize", 5, "number of nodes in a nodeset") + nodeSetsPath := fs.String("nodesets", defaultNodeSetsPath, "Custom node sets location") + chainID := fs.Int64("chainid", 1337, "chain ID of the Ethereum network to deploy to") + + // preprovisioning flags + preprovison := fs.Bool("preprovision", false, "Preprovision crib") + + // provisioning flags + ethURL := fs.String("ethurl", "", "URL of the Ethereum node") + accountKey := fs.String("accountkey", "", "private key of the account to deploy from") + ocrConfigFile := fs.String("ocrfile", "ocr_config.json", "path to OCR config file") + p2pPort := fs.Int64("p2pport", 6690, "p2p port") + capabilitiesP2PPort := fs.Int64("capabilitiesp2pport", 6691, "p2p port for capabilities") + preprovisionConfigName := fs.String("preprovisionconfig", "crib-preprovision.yaml", "Name of the preprovision config file, stored in the artefacts directory") + postprovisionConfigName := fs.String("postprovisionconfig", "crib-postprovision.yaml", "Name of the postprovision config file, stored in the artefacts directory") + // additional flags + clean := fs.Bool("clean", false, "Clean up resources before provisioning") + + err := fs.Parse(args) + + if err != nil || (!*preprovison && (*ethURL == "" || *accountKey == "")) { + fs.Usage() + os.Exit(1) + } + + if *preprovison { + fmt.Println() + fmt.Println() + fmt.Println("========================") + fmt.Println("Writing Preprovisioning Config") + fmt.Println("========================") + fmt.Println() + fmt.Println() + writePreprovisionConfig(*nodeSetSize, filepath.Join(*artefactsDir, *preprovisionConfigName)) + return + } + + // We always want to start with a clean slate + /// when it comes to nodesets + err = os.RemoveAll(*nodeSetsPath) + PanicErr(err) + fmt.Println("Collecting node sets...") + nodeSets := downloadNodeSets(*chainID, *nodeSetsPath, *nodeSetSize) + + if *clean { + fmt.Println("Cleaning up resources") + for _, node := range nodeSets.Workflow.Nodes { + clearJobs(newNodeAPI(node)) + } + for _, node := range nodeSets.StreamsTrigger.Nodes { + clearJobs(newNodeAPI(node)) + } + os.RemoveAll(*artefactsDir) + } + + // Kinda hacky but it prevents us from refactoring the setupenv function which + // is used in many other places + os.Setenv("ETH_URL", *ethURL) + os.Setenv("ETH_CHAIN_ID", strconv.FormatInt(*chainID, 10)) + os.Setenv("ACCOUNT_KEY", *accountKey) + os.Setenv("INSECURE_SKIP_VERIFY", "true") + env := helpers.SetupEnv(false) + + provisionStreamsDON( + env, + nodeSets.StreamsTrigger, + *chainID, + *p2pPort, + *ocrConfigFile, + *artefactsDir, + ) + + reg := provisionCapabilitiesRegistry( + env, + nodeSets, + *chainID, + *artefactsDir, + ) + + onchainMeta := provisionWorkflowDON( + env, + nodeSets.Workflow, + *chainID, + *p2pPort, + *ocrConfigFile, + *artefactsDir, + reg, + ) + + fmt.Println() + fmt.Println() + fmt.Println("========================") + fmt.Println("Writing Postprovision Config") + fmt.Println("========================") + fmt.Println() + fmt.Println() + + writePostProvisionConfig( + nodeSets, + *chainID, + *capabilitiesP2PPort, + onchainMeta.Forwarder.Address().Hex(), + onchainMeta.CapabilitiesRegistry.Address().Hex(), + filepath.Join(*artefactsDir, *postprovisionConfigName), + ) +} + +func provisionCapabilitiesRegistry( + env helpers.Environment, + nodeSets NodeSets, + chainID int64, + artefactsDir string, +) kcr.CapabilitiesRegistryInterface { + fmt.Println() + fmt.Println() + fmt.Println("========================") + fmt.Println("Provisioning Capabilities Registry DON") + fmt.Println("========================") + fmt.Println() + fmt.Println() + reg := provisionCapabillitiesRegistry( + env, + nodeSets, + chainID, + artefactsDir, + ) + return reg +} + +func provisionStreamsDON( + env helpers.Environment, + nodeSet NodeSet, + chainID int64, + p2pPort int64, + ocrConfigFilePath string, + artefactsDir string, +) { + fmt.Println() + fmt.Println() + fmt.Println("========================") + fmt.Println("Provisioning streams DON") + fmt.Println("========================") + fmt.Println() + fmt.Println() + setupStreamsTrigger( + env, + nodeSet, + chainID, + p2pPort, + ocrConfigFilePath, + artefactsDir, + ) +} + +func provisionWorkflowDON( + env helpers.Environment, + nodeSet NodeSet, + chainID int64, + p2pPort int64, + ocrConfigFile string, + artefactsDir string, + reg kcr.CapabilitiesRegistryInterface, +) (onchainMeta *onchainMeta) { + fmt.Println() + fmt.Println() + fmt.Println("========================") + fmt.Println("Provisioning workflow DON") + fmt.Println("========================") + fmt.Println() + fmt.Println() + deployForwarder(env, artefactsDir) + + onchainMeta, _ = provisionOCR3( + env, + nodeSet, + chainID, + p2pPort, + ocrConfigFile, + artefactsDir, + ) + distributeFunds(nodeSet.NodeKeys, env) + + // We don't technically need the capability registry as a dependency + // as we just use it for a sanity check + // We could remove it so that we can execute provisioning in parallel + deployKeystoneWorkflowsTo(nodeSet, reg) + + return onchainMeta +} diff --git a/core/scripts/keystone/src/01_toolkit.go b/core/scripts/keystone/src/01_toolkit.go new file mode 100644 index 00000000000..6fe896667ce --- /dev/null +++ b/core/scripts/keystone/src/01_toolkit.go @@ -0,0 +1,212 @@ +// This sub CLI acts as a temporary shim for external aptos support + +package src + +import ( + "bufio" + "errors" + "flag" + "fmt" + "net/url" + "os" + "strconv" + "strings" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" +) + +type Toolkit struct{} + +func (t *Toolkit) Name() string { + return "toolkit" +} + +func NewToolkit() *Toolkit { + return &Toolkit{} +} + +func (t *Toolkit) Run(args []string) { + if len(args) < 1 { + fmt.Println("Available commands:") + fmt.Println(" deploy-workflows") + fmt.Println(" deploy-ocr3-contracts") + fmt.Println(" deploy-ocr3-jobspecs") + os.Exit(1) + } + + command := args[0] + cmdArgs := args[1:] + + switch command { + case "get-aptos-keys": + t.AptosKeys(cmdArgs) + case "deploy-workflows": + t.DeployWorkflows(cmdArgs) + case "deploy-ocr3-contracts": + t.ProvisionOCR3Contracts(cmdArgs) + case "deploy-ocr3-jobspecs": + t.DeployOCR3JobSpecs(cmdArgs) + default: + fmt.Printf("Unknown command: %s\n", command) + os.Exit(1) + } +} + +func (t *Toolkit) AptosKeys(args []string) { + fs := flag.NewFlagSet("get-aptos-keys", flag.ExitOnError) + nodesListPath := fs.String("nodes", ".cache/NodesList.txt", "Path to file with list of nodes") + artefacts := fs.String("artefacts", defaultArtefactsDir, "Custom artefacts directory location") + chainID := fs.Int64("chainid", 1337, "Chain ID") + + if err := fs.Parse(args); err != nil { + fs.Usage() + os.Exit(1) + } + + nodes := mustReadNodesList(*nodesListPath) + keys := mustFetchNodeKeys(*chainID, nodes, true) + + mustWriteJSON(*artefacts+"/pubnodekeys.json", keys) +} + +func (t *Toolkit) ProvisionOCR3Contracts(args []string) { + fs := flag.NewFlagSet("deploy-ocr3-contracts", flag.ExitOnError) + ethURL := fs.String("ethurl", "", "URL of the Ethereum node") + accountKey := fs.String("accountkey", "", "Private key of the deployer account") + chainID := fs.Int64("chainid", 1337, "Chain ID") + nodesListPath := fs.String("nodes", ".cache/NodesList.txt", "Path to file with list of nodes") + artefactsDir := fs.String("artefacts", defaultArtefactsDir, "Custom artefacts directory location") + ocrConfigFile := fs.String("ocrfile", "ocr_config.json", "Path to OCR config file") + + if err := fs.Parse(args); err != nil || *ethURL == "" || *accountKey == "" { + fs.Usage() + os.Exit(1) + } + + // Set environment variables required by setupenv + os.Setenv("ETH_URL", *ethURL) + os.Setenv("ETH_CHAIN_ID", strconv.FormatInt(*chainID, 10)) + os.Setenv("ACCOUNT_KEY", *accountKey) + os.Setenv("INSECURE_SKIP_VERIFY", "true") + + env := helpers.SetupEnv(false) + + nodes := mustReadNodesList(*nodesListPath) + nodeKeys := mustFetchNodeKeys(*chainID, nodes, true) + + deployOCR3Contract(nodeKeys, env, *ocrConfigFile, *artefactsDir) +} + +func (t *Toolkit) DeployOCR3JobSpecs(args []string) { + fs := flag.NewFlagSet("deploy-ocr3-jobspecs", flag.ExitOnError) + + ethURL := fs.String("ethurl", "", "URL of the Ethereum node") + accountKey := fs.String("accountkey", "", "Private key of the deployer account") + chainID := fs.Int64("chainid", 1337, "Chain ID") + nodesListPath := fs.String("nodes", ".cache/NodesList.txt", "Path to file with list of nodes") + p2pPort := fs.Int64("p2pport", 6690, "P2P port") + artefactsDir := fs.String("artefacts", defaultArtefactsDir, "Custom artefacts directory location") + + if err := fs.Parse(args); err != nil || *ethURL == "" || *accountKey == "" { + fs.Usage() + os.Exit(1) + } + + os.Setenv("ETH_URL", *ethURL) + os.Setenv("ETH_CHAIN_ID", strconv.FormatInt(*chainID, 10)) + os.Setenv("ACCOUNT_KEY", *accountKey) + os.Setenv("INSECURE_SKIP_VERIFY", "true") + + env := helpers.SetupEnv(false) + + nodes := mustReadNodesList(*nodesListPath) + nodeKeys := mustFetchNodeKeys(*chainID, nodes, true) + o := LoadOnchainMeta(*artefactsDir, env) + + deployOCR3JobSpecs( + nodes, + *chainID, + nodeKeys, + *p2pPort, + o, + ) +} + +func (t *Toolkit) DeployWorkflows(args []string) { + fs := flag.NewFlagSet("deploy-workflows", flag.ExitOnError) + workflowFile := fs.String("workflow", "", "Path to workflow file") + nodesList := fs.String("nodes", ".cache/NodesList.txt", "Path to file with list of nodes") + + if err := fs.Parse(args); err != nil || *workflowFile == "" { + fs.Usage() + os.Exit(1) + } + + nodesWithCreds := mustReadNodesList(*nodesList) + + for _, node := range nodesWithCreds { + api := newNodeAPI(node) + workflowContent, err := os.ReadFile(*workflowFile) + PanicErr(err) + + upsertJob(api, "workflow", string(workflowContent)) + fmt.Println("Workflow deployed successfully") + } +} + +// Reads in a list of nodes from a file, where each line is in the format: +// http://localhost:50100 http://chainlink.core.1:50100 notreal@fakeemail.ch fj293fbBnlQ!f9vNs +func mustReadNodesList(path string) []NodeWithCreds { + fmt.Println("Reading nodes list from", path) + nodesList, err := readLines(path) + helpers.PanicErr(err) + + nodes := make([]NodeWithCreds, 0, len(nodesList)) + for _, r := range nodesList { + rr := strings.TrimSpace(r) + if len(rr) == 0 { + continue + } + s := strings.Split(rr, " ") + if len(s) != 4 { + helpers.PanicErr(errors.New("wrong nodes list format")) + } + + r := SimpleURL{ + Scheme: "http", + Host: s[0], + } + u := SimpleURL{ + Scheme: "http", + Host: s[1], + } + remoteURL, err := url.Parse(u.String()) + PanicErr(err) + nodes = append(nodes, NodeWithCreds{ + URL: u, + RemoteURL: r, + // This is the equivalent of "chainlink.core.1" in our above example + ServiceName: remoteURL.Hostname(), + APILogin: s[2], + APIPassword: s[3], + KeystorePassword: "", + }) + } + + return nodes +} + +func readLines(path string) ([]string, error) { + file, err := os.Open(path) + if err != nil { + return nil, err + } + defer file.Close() + + var lines []string + scanner := bufio.NewScanner(file) + for scanner.Scan() { + lines = append(lines, scanner.Text()) + } + return lines, scanner.Err() +} diff --git a/core/scripts/keystone/src/01_toolkit_test.go b/core/scripts/keystone/src/01_toolkit_test.go new file mode 100644 index 00000000000..6f4a083940e --- /dev/null +++ b/core/scripts/keystone/src/01_toolkit_test.go @@ -0,0 +1,49 @@ +package src + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestMustReadNodesList(t *testing.T) { + t.Run("valid nodes list", func(t *testing.T) { + content := "localhost:50100 chainlink.core.1:50100 user1 pass1\nlocalhost:50101 chainlink.core.2:50101 user2 pass2" + filePath := writeTempFile(t, content) + defer os.Remove(filePath) + + nodes := mustReadNodesList(filePath) + assert.Len(t, nodes, 2) + + assert.Equal(t, "user1", nodes[0].APILogin) + assert.Equal(t, "user2", nodes[1].APILogin) + + assert.Equal(t, "pass1", nodes[0].APIPassword) + assert.Equal(t, "pass2", nodes[1].APIPassword) + + assert.Equal(t, "http://localhost:50100", nodes[0].RemoteURL.String()) + assert.Equal(t, "http://localhost:50101", nodes[1].RemoteURL.String()) + + assert.Equal(t, "chainlink.core.1", nodes[0].ServiceName) + assert.Equal(t, "chainlink.core.2", nodes[1].ServiceName) + + assert.Equal(t, "http://chainlink.core.1:50100", nodes[0].URL.String()) + assert.Equal(t, "http://chainlink.core.2:50101", nodes[1].URL.String()) + }) +} + +func writeTempFile(t *testing.T, content string) string { + file, err := os.CreateTemp("", "nodeslist") + if err != nil { + t.Fatalf("failed to create temp file: %v", err) + } + defer file.Close() + + _, err = file.WriteString(content) + if err != nil { + t.Fatalf("failed to write to temp file: %v", err) + } + + return file.Name() +} diff --git a/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go b/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go deleted file mode 100644 index 275943d6388..00000000000 --- a/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go +++ /dev/null @@ -1,165 +0,0 @@ -package src - -import ( - "bytes" - "errors" - "flag" - "fmt" - "os" - "reflect" - "runtime" - "strings" - - "github.com/urfave/cli" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/cmd" -) - -type deployJobSpecs struct{} - -func NewDeployJobSpecsCommand() *deployJobSpecs { - return &deployJobSpecs{} -} - -func (g *deployJobSpecs) Name() string { - return "deploy-jobspecs" -} - -func (g *deployJobSpecs) Run(args []string) { - fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) - chainID := fs.Int64("chainid", 11155111, "chain id") - p2pPort := fs.Int64("p2pport", 6690, "p2p port") - onlyReplay := fs.Bool("onlyreplay", false, "only replay the block from the OCR3 contract setConfig transaction") - templatesLocation := fs.String("templates", "", "Custom templates location") - nodeList := fs.String("nodes", "", "Custom node list location") - publicKeys := fs.String("publickeys", "", "Custom public keys json location") - artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") - - err := fs.Parse(args) - if err != nil || chainID == nil || *chainID == 0 || p2pPort == nil || *p2pPort == 0 || onlyReplay == nil { - fs.Usage() - os.Exit(1) - } - if *onlyReplay { - fmt.Println("Only replaying OCR3 contract setConfig transaction") - } else { - fmt.Println("Deploying OCR3 job specs") - } - - if *artefactsDir == "" { - *artefactsDir = defaultArtefactsDir - } - if *publicKeys == "" { - *publicKeys = defaultPublicKeys - } - if *nodeList == "" { - *nodeList = defaultNodeList - } - if *templatesLocation == "" { - *templatesLocation = "templates" - } - - nodes := downloadNodeAPICredentials(*nodeList) - deployedContracts, err := LoadDeployedContracts(*artefactsDir) - PanicErr(err) - - jobspecs := genSpecs( - *publicKeys, - *nodeList, - *templatesLocation, - *chainID, *p2pPort, deployedContracts.OCRContract.Hex(), - ) - flattenedSpecs := []hostSpec{jobspecs.bootstrap} - flattenedSpecs = append(flattenedSpecs, jobspecs.oracles...) - - // sanity check arr lengths - if len(nodes) != len(flattenedSpecs) { - PanicErr(errors.New("Mismatched node and job spec lengths")) - } - - for i, n := range nodes { - output := &bytes.Buffer{} - client, app := newApp(n, output) - fmt.Println("Logging in:", n.url) - loginFs := flag.NewFlagSet("test", flag.ContinueOnError) - loginFs.Bool("bypass-version-check", true, "") - loginCtx := cli.NewContext(app, loginFs, nil) - err := client.RemoteLogin(loginCtx) - helpers.PanicErr(err) - output.Reset() - - if !*onlyReplay { - specToDeploy := flattenedSpecs[i].spec.ToString() - specFragment := flattenedSpecs[i].spec[0:1] - fmt.Printf("Deploying jobspec: %s\n... \n", specFragment) - fs := flag.NewFlagSet("test", flag.ExitOnError) - err = fs.Parse([]string{specToDeploy}) - - helpers.PanicErr(err) - err = client.CreateJob(cli.NewContext(app, fs, nil)) - if err != nil { - fmt.Println("Failed to deploy job spec:", specFragment, "Error:", err) - } - output.Reset() - } - - replayFs := flag.NewFlagSet("test", flag.ExitOnError) - flagSetApplyFromAction(client.ReplayFromBlock, replayFs, "") - err = replayFs.Set("block-number", fmt.Sprint(deployedContracts.SetConfigTxBlock)) - helpers.PanicErr(err) - err = replayFs.Set("evm-chain-id", fmt.Sprint(*chainID)) - helpers.PanicErr(err) - - fmt.Printf("Replaying from block: %d\n", deployedContracts.SetConfigTxBlock) - fmt.Printf("EVM Chain ID: %d\n\n", *chainID) - replayCtx := cli.NewContext(app, replayFs, nil) - err = client.ReplayFromBlock(replayCtx) - helpers.PanicErr(err) - } -} - -// flagSetApplyFromAction applies the flags from action to the flagSet. -// -// `parentCommand` will filter the app commands and only applies the flags if the command/subcommand has a parent with that name, if left empty no filtering is done -// -// Taken from: https://github.com/smartcontractkit/chainlink/blob/develop/core/cmd/shell_test.go#L590 -func flagSetApplyFromAction(action interface{}, flagSet *flag.FlagSet, parentCommand string) { - cliApp := cmd.Shell{} - app := cmd.NewApp(&cliApp) - - foundName := parentCommand == "" - actionFuncName := getFuncName(action) - - for _, command := range app.Commands { - flags := recursiveFindFlagsWithName(actionFuncName, command, parentCommand, foundName) - - for _, flag := range flags { - flag.Apply(flagSet) - } - } -} - -func recursiveFindFlagsWithName(actionFuncName string, command cli.Command, parent string, foundName bool) []cli.Flag { - if command.Action != nil { - if actionFuncName == getFuncName(command.Action) && foundName { - return command.Flags - } - } - - for _, subcommand := range command.Subcommands { - if !foundName { - foundName = strings.EqualFold(subcommand.Name, parent) - } - - found := recursiveFindFlagsWithName(actionFuncName, subcommand, parent, foundName) - if found != nil { - return found - } - } - return nil -} - -func getFuncName(i interface{}) string { - return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() -} diff --git a/core/scripts/keystone/src/02_deploy_keystone_workflows.go b/core/scripts/keystone/src/02_deploy_keystone_workflows.go new file mode 100644 index 00000000000..6c6580e21f0 --- /dev/null +++ b/core/scripts/keystone/src/02_deploy_keystone_workflows.go @@ -0,0 +1,134 @@ +package src + +import ( + "bytes" + "fmt" + "text/template" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" +) + +func deployKeystoneWorkflowsTo(nodeSet NodeSet, reg kcr.CapabilitiesRegistryInterface) { + fmt.Println("Deploying Keystone workflow jobs") + caps, err := reg.GetCapabilities(&bind.CallOpts{}) + PanicErr(err) + + streams := NewStreamsTriggerV1Capability() + ocr3 := NewOCR3V1ConsensusCapability() + testnetWrite := NewEthereumGethTestnetV1WriteCapability() + + capSet := NewCapabilitySet(streams, ocr3, testnetWrite) + expectedHashedCIDs := capSet.HashedIDs(reg) + + // Check that the capabilities are registered + for _, c := range caps { + found := false + for _, expected := range expectedHashedCIDs { + if c.HashedId == expected { + found = true + break + } + } + + if !found { + panic(fmt.Sprintf("Capability %s not found in registry", c.HashedId)) + } + } + + feedIDs := []string{} + for _, feed := range feeds { + feedIDs = append(feedIDs, fmt.Sprintf("0x%x", feed.id)) + } + workflowConfig := WorkflowJobSpecConfig{ + JobSpecName: "keystone_workflow", + WorkflowOwnerAddress: "0x1234567890abcdef1234567890abcdef12345678", + FeedIDs: feedIDs, + TargetID: testnetWrite.GetID(), + ConsensusID: ocr3.GetID(), + TriggerID: streams.GetID(), + TargetAddress: "0x1234567890abcdef1234567890abcdef12345678", + } + jobSpecStr := createKeystoneWorkflowJob(workflowConfig) + for _, n := range nodeSet.Nodes[1:] { // skip the bootstrap node + api := newNodeAPI(n) + upsertJob(api, workflowConfig.JobSpecName, jobSpecStr) + } +} + +type WorkflowJobSpecConfig struct { + JobSpecName string + WorkflowOwnerAddress string + FeedIDs []string + TargetID string + ConsensusID string + TriggerID string + TargetAddress string +} + +func createKeystoneWorkflowJob(workflowConfig WorkflowJobSpecConfig) string { + const keystoneWorkflowTemplate = ` +type = "workflow" +schemaVersion = 1 +name = "{{ .JobSpecName }}" +workflow = """ +name: "ccip_kiab1" +owner: '{{ .WorkflowOwnerAddress }}' +triggers: + - id: streams-trigger@1.1.0 + config: + maxFrequencyMs: 10000 + feedIds: +{{- range .FeedIDs }} + - '{{ . }}' +{{- end }} + +consensus: + - id: offchain_reporting@1.0.0 + ref: ccip_feeds + inputs: + observations: + - $(trigger.outputs) + config: + report_id: '0001' + key_id: 'evm' + aggregation_method: data_feeds + aggregation_config: + feeds: +{{- range .FeedIDs }} + '{{ . }}': + deviation: '0.05' + heartbeat: 1800 +{{- end }} + encoder: EVM + encoder_config: + abi: "(bytes32 FeedID, uint224 Price, uint32 Timestamp)[] Reports" + abi: (bytes32 FeedID, uint224 Price, uint32 Timestamp)[] Reports + +targets: + - id: {{ .TargetID }} + inputs: + signed_report: $(ccip_feeds.outputs) + config: + address: '{{ .TargetAddress }}' + deltaStage: 5s + schedule: oneAtATime + +""" +workflowOwner = "{{ .WorkflowOwnerAddress }}" +` + + tmpl, err := template.New("workflow").Parse(keystoneWorkflowTemplate) + + if err != nil { + panic(err) + } + var renderedTemplate bytes.Buffer + err = tmpl.Execute(&renderedTemplate, workflowConfig) + if err != nil { + panic(err) + } + + return renderedTemplate.String() +} diff --git a/core/scripts/keystone/src/02_deploy_keystone_workflows_test.go b/core/scripts/keystone/src/02_deploy_keystone_workflows_test.go new file mode 100644 index 00000000000..bef6a768dce --- /dev/null +++ b/core/scripts/keystone/src/02_deploy_keystone_workflows_test.go @@ -0,0 +1,21 @@ +package src + +import ( + "testing" + + "github.com/gkampitakis/go-snaps/snaps" +) + +func TestCreateKeystoneWorkflowJob(t *testing.T) { + workflowConfig := WorkflowJobSpecConfig{ + JobSpecName: "keystone_workflow", + WorkflowOwnerAddress: "0x1234567890abcdef1234567890abcdef12345678", + FeedIDs: []string{"feed1", "feed2", "feed3"}, + TargetID: "target_id", + TargetAddress: "0xabcdefabcdefabcdefabcdefabcdefabcdef", + } + + output := createKeystoneWorkflowJob(workflowConfig) + + snaps.MatchSnapshot(t, output) +} diff --git a/core/scripts/keystone/src/02_fund_transmitters.go b/core/scripts/keystone/src/02_fund_transmitters.go new file mode 100644 index 00000000000..751a90d22d8 --- /dev/null +++ b/core/scripts/keystone/src/02_fund_transmitters.go @@ -0,0 +1,52 @@ +package src + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" +) + +func distributeFunds(nodeKeys []NodeKeys, env helpers.Environment) { + fmt.Println("Funding transmitters...") + transmittersStr := []string{} + fundingAmount := big.NewInt(500000000000000000) // 0.5 ETH + minThreshold := big.NewInt(50000000000000000) // 0.05 ETH + + for _, n := range nodeKeys { + balance, err := getBalance(n.EthAddress, env) + if err != nil { + fmt.Printf("Error fetching balance for %s: %v\n", n.EthAddress, err) + continue + } + if balance.Cmp(minThreshold) < 0 { + fmt.Printf( + "Transmitter %s has insufficient funds, funding with %s ETH. Current balance: %s, threshold: %s\n", + n.EthAddress, + conversions.WeiToEther(fundingAmount).String(), + conversions.WeiToEther(balance).String(), + conversions.WeiToEther(minThreshold).String(), + ) + transmittersStr = append(transmittersStr, n.EthAddress) + } + } + + if len(transmittersStr) > 0 { + helpers.FundNodes(env, transmittersStr, fundingAmount) + } else { + fmt.Println("All transmitters have sufficient funds.") + } +} + +func getBalance(address string, env helpers.Environment) (*big.Int, error) { + balance, err := env.Ec.BalanceAt(context.Background(), common.HexToAddress(address), nil) + if err != nil { + return nil, err + } + + return balance, nil +} diff --git a/core/scripts/keystone/src/02_provision_capabilities_registry.go b/core/scripts/keystone/src/02_provision_capabilities_registry.go new file mode 100644 index 00000000000..aa0f203f96b --- /dev/null +++ b/core/scripts/keystone/src/02_provision_capabilities_registry.go @@ -0,0 +1,68 @@ +package src + +import ( + "context" + "fmt" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" +) + +func provisionCapabillitiesRegistry(env helpers.Environment, nodeSets NodeSets, chainID int64, artefactsDir string) kcr.CapabilitiesRegistryInterface { + fmt.Printf("Provisioning capabilities registry on chain %d\n", chainID) + ctx := context.Background() + reg := deployCR(ctx, artefactsDir, env) + crProvisioner := NewCapabilityRegistryProvisioner(reg, env) + streamsTriggerCapSet := NewCapabilitySet(NewStreamsTriggerV1Capability()) + workflowCapSet := NewCapabilitySet(NewOCR3V1ConsensusCapability(), NewEthereumGethTestnetV1WriteCapability()) + workflowDON := nodeKeysToDON(nodeSets.Workflow.Name, nodeSets.Workflow.NodeKeys[1:], workflowCapSet) + streamsTriggerDON := nodeKeysToDON(nodeSets.StreamsTrigger.Name, nodeSets.StreamsTrigger.NodeKeys[1:], streamsTriggerCapSet) + + crProvisioner.AddCapabilities(ctx, MergeCapabilitySets(streamsTriggerCapSet, workflowCapSet)) + dons := map[string]DON{workflowDON.Name: workflowDON, streamsTriggerDON.Name: streamsTriggerDON} + nodeOperator := NewNodeOperator(env.Owner.From, "MY_NODE_OPERATOR", dons) + crProvisioner.AddNodeOperator(ctx, nodeOperator) + + crProvisioner.AddNodes(ctx, nodeOperator, nodeSets.Workflow.Name, nodeSets.StreamsTrigger.Name) + + crProvisioner.AddDON(ctx, nodeOperator, nodeSets.Workflow.Name, true, true) + crProvisioner.AddDON(ctx, nodeOperator, nodeSets.StreamsTrigger.Name, true, false) + + return reg +} + +// nodeKeysToDON converts a slice of NodeKeys into a DON struct with the given name and CapabilitySet. +func nodeKeysToDON(donName string, nodeKeys []NodeKeys, capSet CapabilitySet) DON { + peers := []peer{} + for _, n := range nodeKeys { + p := peer{ + PeerID: n.P2PPeerID, + Signer: n.OCR2OnchainPublicKey, + } + peers = append(peers, p) + } + return DON{ + F: 1, + Name: donName, + Peers: peers, + CapabilitySet: capSet, + } +} + +func deployCR(ctx context.Context, artefactsDir string, env helpers.Environment) kcr.CapabilitiesRegistryInterface { + o := LoadOnchainMeta(artefactsDir, env) + // We always redeploy the capabilities registry to ensure it is up to date + // since we don't have diffing logic to determine if it has changed + // if o.CapabilitiesRegistry != nil { + // fmt.Println("CapabilitiesRegistry already deployed, skipping...") + // return o.CapabilitiesRegistry + // } + + _, tx, capabilitiesRegistry, innerErr := kcr.DeployCapabilitiesRegistry(env.Owner, env.Ec) + PanicErr(innerErr) + helpers.ConfirmContractDeployed(ctx, env.Ec, tx, env.ChainID) + + o.CapabilitiesRegistry = capabilitiesRegistry + WriteOnchainMeta(o, artefactsDir) + return capabilitiesRegistry +} diff --git a/core/scripts/keystone/src/02_provision_crib.go b/core/scripts/keystone/src/02_provision_crib.go new file mode 100644 index 00000000000..bf3a31f8b7e --- /dev/null +++ b/core/scripts/keystone/src/02_provision_crib.go @@ -0,0 +1,310 @@ +package src + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + + ocrcommontypes "github.com/smartcontractkit/libocr/commontypes" + "gopkg.in/yaml.v3" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" +) + +type Helm struct { + Helm Chart `yaml:"helm"` +} + +type Chart struct { + HelmValues HelmValues `yaml:"values"` +} + +type HelmValues struct { + Chainlink Chainlink `yaml:"chainlink,omitempty"` + Ingress Ingress `yaml:"ingress,omitempty"` +} + +type Ingress struct { + Hosts []Host `yaml:"hosts,omitempty"` +} + +type Host struct { + Host string `yaml:"host,omitempty"` + HTTP HTTP `yaml:"http,omitempty"` +} + +type HTTP struct { + Paths []Path `yaml:"paths,omitempty"` +} + +type Path struct { + Path string `yaml:"path,omitempty"` + Backend Backend `yaml:"backend,omitempty"` +} + +type Backend struct { + Service Service `yaml:"service,omitempty"` +} + +type Service struct { + Name string `yaml:"name,omitempty"` + Port Port `yaml:"port,omitempty"` +} + +type Port struct { + Number int `yaml:"number,omitempty"` +} + +type Chainlink struct { + Nodes map[string]Node `yaml:"nodes,omitempty"` +} + +type Node struct { + Image string `yaml:"image,omitempty"` + OverridesToml string `yaml:"overridesToml,omitempty"` +} + +func writePreprovisionConfig(nodeSetSize int, outputPath string) { + chart := generatePreprovisionConfig(nodeSetSize) + + writeCribConfig(chart, outputPath) +} + +func writeCribConfig(chart Helm, outputPath string) { + yamlData, err := yaml.Marshal(chart) + helpers.PanicErr(err) + + if outputPath == "-" { + _, err = os.Stdout.Write(yamlData) + helpers.PanicErr(err) + } else { + ensureArtefactsDir(filepath.Dir(outputPath)) + err = os.WriteFile(outputPath, yamlData, 0600) + helpers.PanicErr(err) + } +} + +func generatePreprovisionConfig(nodeSetSize int) Helm { + nodeSets := []string{"ks-wf-", "ks-str-trig-"} + nodes := make(map[string]Node) + nodeNames := []string{} + + for nodeSetIndex, prefix := range nodeSets { + // Bootstrap node + btNodeName := fmt.Sprintf("%d-%sbt-node1", nodeSetIndex, prefix) + nodeNames = append(nodeNames, btNodeName) + nodes[btNodeName] = Node{ + Image: "${runtime.images.app}", + } + + // Other nodes + for i := 2; i <= nodeSetSize; i++ { + nodeName := fmt.Sprintf("%d-%snode%d", nodeSetIndex, prefix, i) + nodeNames = append(nodeNames, nodeName) + nodes[nodeName] = Node{ + Image: "${runtime.images.app}", + } + } + } + + ingress := generateIngress(nodeNames) + + helm := Helm{ + Chart{ + HelmValues: HelmValues{ + Chainlink: Chainlink{ + Nodes: nodes, + }, + Ingress: ingress, + }, + }, + } + + return helm +} + +func writePostProvisionConfig( + nodeSets NodeSets, + chainID int64, + capabilitiesP2PPort int64, + forwarderAddress string, + capabilitiesRegistryAddress string, + outputPath string, +) { + chart := generatePostprovisionConfig( + nodeSets, + chainID, + capabilitiesP2PPort, + forwarderAddress, + capabilitiesRegistryAddress, + ) + + writeCribConfig(chart, outputPath) +} + +func generatePostprovisionConfig( + nodeSets NodeSets, + chainID int64, + capabilitiesP2PPort int64, + forwarderAddress string, + capabillitiesRegistryAddress string, +) Helm { + nodes := make(map[string]Node) + nodeNames := []string{} + var capabilitiesBootstrapper *ocrcommontypes.BootstrapperLocator + + // Build nodes for each NodeSet + for nodeSetIndex, nodeSet := range []NodeSet{nodeSets.Workflow, nodeSets.StreamsTrigger} { + // Bootstrap node + btNodeName := fmt.Sprintf("%d-%sbt-node1", nodeSetIndex, nodeSet.Prefix) + // Note this line ordering is important, + // we assign capabilitiesBootstrapper after we generate overrides so that + // we do not include the bootstrapper config to itself + overridesToml := generateOverridesToml( + chainID, + capabilitiesP2PPort, + capabillitiesRegistryAddress, + "", + "", + capabilitiesBootstrapper, + nodeSet.Name, + ) + nodes[btNodeName] = Node{ + Image: "${runtime.images.app}", + OverridesToml: overridesToml, + } + if nodeSet.Name == WorkflowNodeSetName { + workflowBtNodeKey := nodeSets.Workflow.NodeKeys[0] // First node key as bootstrapper + wfBt, err := ocrcommontypes.NewBootstrapperLocator(workflowBtNodeKey.P2PPeerID, []string{fmt.Sprintf("%s:%d", nodeSets.Workflow.Nodes[0].ServiceName, capabilitiesP2PPort)}) + helpers.PanicErr(err) + capabilitiesBootstrapper = wfBt + } + nodeNames = append(nodeNames, btNodeName) + + // Other nodes + for i, nodeKey := range nodeSet.NodeKeys[1:] { // Start from second key + nodeName := fmt.Sprintf("%d-%snode%d", nodeSetIndex, nodeSet.Prefix, i+2) + nodeNames = append(nodeNames, nodeName) + overridesToml := generateOverridesToml( + chainID, + capabilitiesP2PPort, + capabillitiesRegistryAddress, + nodeKey.EthAddress, + forwarderAddress, + capabilitiesBootstrapper, + nodeSet.Name, + ) + nodes[nodeName] = Node{ + Image: "${runtime.images.app}", + OverridesToml: overridesToml, + } + } + } + + ingress := generateIngress(nodeNames) + + helm := Helm{ + Chart{ + HelmValues: HelmValues{ + Chainlink: Chainlink{ + Nodes: nodes, + }, + Ingress: ingress, + }, + }, + } + + return helm +} + +func generateOverridesToml( + chainID int64, + capabilitiesP2PPort int64, + externalRegistryAddress string, + fromAddress string, + forwarderAddress string, + capabilitiesBootstrapper *ocrcommontypes.BootstrapperLocator, + nodeSetName string, +) string { + evmConfig := &evmcfg.EVMConfig{ + ChainID: big.NewI(chainID), + Nodes: nil, // We have the rpc nodes set globally + } + + conf := chainlink.Config{ + Core: toml.Core{ + Capabilities: toml.Capabilities{ + ExternalRegistry: toml.ExternalRegistry{ + Address: ptr(externalRegistryAddress), + NetworkID: ptr("evm"), + ChainID: ptr(strconv.FormatInt(chainID, 10)), + }, + Peering: toml.P2P{ + V2: toml.P2PV2{ + Enabled: ptr(true), + ListenAddresses: ptr([]string{fmt.Sprintf("0.0.0.0:%d", capabilitiesP2PPort)}), + }, + }, + }, + }, + } + + if capabilitiesBootstrapper != nil { + conf.Core.Capabilities.Peering.V2.DefaultBootstrappers = ptr([]ocrcommontypes.BootstrapperLocator{*capabilitiesBootstrapper}) + + if nodeSetName == WorkflowNodeSetName { + evmConfig.Workflow = evmcfg.Workflow{ + FromAddress: ptr(evmtypes.MustEIP55Address(fromAddress)), + ForwarderAddress: ptr(evmtypes.MustEIP55Address(forwarderAddress)), + } + } + } + + conf.EVM = evmcfg.EVMConfigs{ + evmConfig, + } + + confStr, err := conf.TOMLString() + helpers.PanicErr(err) + + return confStr +} + +// New function to generate Ingress +func generateIngress(nodeNames []string) Ingress { + hosts := make([]Host, 0, len(nodeNames)) + + for _, nodeName := range nodeNames { + host := Host{ + Host: fmt.Sprintf("${DEVSPACE_NAMESPACE}-%s.${DEVSPACE_INGRESS_BASE_DOMAIN}", nodeName), + HTTP: HTTP{ + Paths: []Path{ + { + Path: "/", + Backend: Backend{ + Service: Service{ + Name: "app-" + nodeName, + Port: Port{ + Number: 6688, + }, + }, + }, + }, + }, + }, + } + hosts = append(hosts, host) + } + + return Ingress{ + Hosts: hosts, + } +} + +func ptr[T any](t T) *T { return &t } diff --git a/core/scripts/keystone/src/02_provision_crib_test.go b/core/scripts/keystone/src/02_provision_crib_test.go new file mode 100644 index 00000000000..4e4cbf1efd5 --- /dev/null +++ b/core/scripts/keystone/src/02_provision_crib_test.go @@ -0,0 +1,44 @@ +package src + +import ( + "strings" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/gkampitakis/go-snaps/snaps" + "gopkg.in/yaml.v3" +) + +func TestGeneratePostprovisionConfig(t *testing.T) { + chainID := int64(1337) + capabilitiesP2PPort := int64(6691) + nodeSetsPath := "./testdata/node_sets.json" + nodeSetSize := 5 + forwarderAddress := common.Address([20]byte{0: 1}).Hex() + capabilitiesRegistryAddress := common.Address([20]byte{0: 2}).Hex() + nodeSets := downloadNodeSets(chainID, nodeSetsPath, nodeSetSize) + + chart := generatePostprovisionConfig(nodeSets, chainID, capabilitiesP2PPort, forwarderAddress, capabilitiesRegistryAddress) + + yamlData, err := yaml.Marshal(chart) + if err != nil { + t.Fatalf("Failed to marshal chart: %v", err) + } + + linesStr := strings.Split(string(yamlData), "\n") + snaps.MatchSnapshot(t, strings.Join(linesStr, "\n")) +} + +func TestGeneratePreprovisionConfig(t *testing.T) { + nodeSetSize := 5 + + chart := generatePreprovisionConfig(nodeSetSize) + + yamlData, err := yaml.Marshal(chart) + if err != nil { + t.Fatalf("Failed to marshal chart: %v", err) + } + + linesStr := strings.Split(string(yamlData), "\n") + snaps.MatchSnapshot(t, strings.Join(linesStr, "\n")) +} diff --git a/core/scripts/keystone/src/02_provision_forwarder_contract.go b/core/scripts/keystone/src/02_provision_forwarder_contract.go new file mode 100644 index 00000000000..4cc3d7f70fa --- /dev/null +++ b/core/scripts/keystone/src/02_provision_forwarder_contract.go @@ -0,0 +1,33 @@ +package src + +import ( + "context" + "fmt" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder" +) + +func deployForwarder( + env helpers.Environment, + artefacts string, +) { + o := LoadOnchainMeta(artefacts, env) + if o.Forwarder != nil { + fmt.Println("Forwarder contract already deployed, skipping") + return + } + + fmt.Println("Deploying forwarder contract...") + forwarderContract := DeployForwarder(env) + o.Forwarder = forwarderContract + WriteOnchainMeta(o, artefacts) +} + +func DeployForwarder(e helpers.Environment) *forwarder.KeystoneForwarder { + _, tx, contract, err := forwarder.DeployKeystoneForwarder(e.Owner, e.Ec) + PanicErr(err) + helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) + + return contract +} diff --git a/core/scripts/keystone/src/02_provision_ocr3_capability.go b/core/scripts/keystone/src/02_provision_ocr3_capability.go new file mode 100644 index 00000000000..cd80bf4238b --- /dev/null +++ b/core/scripts/keystone/src/02_provision_ocr3_capability.go @@ -0,0 +1,286 @@ +package src + +import ( + "bytes" + "strconv" + "text/template" + + "context" + "flag" + "fmt" + + "github.com/smartcontractkit/chainlink/deployment" + + ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" +) + +func provisionOCR3( + env helpers.Environment, + nodeSet NodeSet, + chainID int64, + p2pPort int64, + ocrConfigFile string, + artefactsDir string, +) (onchainMeta *onchainMeta, cacheHit bool) { + nodeKeys := nodeSet.NodeKeys + nodes := nodeSet.Nodes + + onchainMeta, cacheHit = deployOCR3Contract( + nodeKeys, + env, + ocrConfigFile, + artefactsDir, + ) + + deployOCR3JobSpecs( + nodes, + chainID, + nodeKeys, + p2pPort, + onchainMeta, + ) + + return +} + +func deployOCR3Contract( + nodeKeys []NodeKeys, + env helpers.Environment, + configFile string, + artefacts string, +) (o *onchainMeta, cacheHit bool) { + o = LoadOnchainMeta(artefacts, env) + ocrConf := generateOCR3Config( + nodeKeys, + configFile, + ) + + if o.OCR3 != nil { + // types.ConfigDigestPrefixKeystoneOCR3Capability + fmt.Println("OCR3 Contract already deployed, checking config...") + latestConfigDigestBytes, err := o.OCR3.LatestConfigDetails(nil) + PanicErr(err) + latestConfigDigest, err := types.BytesToConfigDigest(latestConfigDigestBytes.ConfigDigest[:]) + PanicErr(err) + + cc := ocrConfToContractConfig(ocrConf, latestConfigDigestBytes.ConfigCount) + digester := evm.OCR3CapabilityOffchainConfigDigester{ + ChainID: uint64(env.ChainID), //nolint:gosec // this won't overflow + ContractAddress: o.OCR3.Address(), + } + digest, err := digester.ConfigDigest(context.Background(), cc) + PanicErr(err) + + if digest.Hex() == latestConfigDigest.Hex() { + fmt.Printf("OCR3 Contract already deployed with the same config (digest: %s), skipping...\n", digest.Hex()) + return o, false + } + + fmt.Printf("OCR3 Contract contains a different config, updating...\nOld digest: %s\nNew digest: %s\n", latestConfigDigest.Hex(), digest.Hex()) + setOCRConfig(o, env, ocrConf, artefacts) + return o, true + } + + fmt.Println("Deploying keystone ocr3 contract...") + _, tx, ocrContract, err := ocr3_capability.DeployOCR3Capability(env.Owner, env.Ec) + PanicErr(err) + helpers.ConfirmContractDeployed(context.Background(), env.Ec, tx, env.ChainID) + o.OCR3 = ocrContract + setOCRConfig(o, env, ocrConf, artefacts) + + return o, true +} + +func generateOCR3Config(nodeKeys []NodeKeys, configFile string) ksdeploy.OCR3OnchainConfig { + topLevelCfg := mustReadOCR3Config(configFile) + cfg := topLevelCfg.OracleConfig + secrets := deployment.XXXGenerateTestOCRSecrets() + c, err := ksdeploy.GenerateOCR3Config(cfg, nodeKeysToKsDeployNodeKeys(nodeKeys[1:]), secrets) // skip the bootstrap node + helpers.PanicErr(err) + return c +} + +func setOCRConfig(o *onchainMeta, env helpers.Environment, ocrConf ksdeploy.OCR3OnchainConfig, artefacts string) { + fmt.Println("Setting OCR3 contract config...") + tx, err := o.OCR3.SetConfig(env.Owner, + ocrConf.Signers, + ocrConf.Transmitters, + ocrConf.F, + ocrConf.OnchainConfig, + ocrConf.OffchainConfigVersion, + ocrConf.OffchainConfig, + ) + PanicErr(err) + receipt := helpers.ConfirmTXMined(context.Background(), env.Ec, tx, env.ChainID) + o.SetConfigTxBlock = receipt.BlockNumber.Uint64() + WriteOnchainMeta(o, artefacts) +} + +func deployOCR3JobSpecs( + nodes []NodeWithCreds, + chainID int64, + nodeKeys []NodeKeys, + p2pPort int64, + onchainMeta *onchainMeta, +) { + ocrAddress := onchainMeta.OCR3.Address().Hex() + bootstrapURI := fmt.Sprintf("%s@%s:%d", nodeKeys[0].P2PPeerID, nodes[0].ServiceName, p2pPort) + + var specName string + for i, n := range nodes { + var spec string + + if i == 0 { + bootstrapSpecConfig := BootstrapJobSpecConfig{ + JobSpecName: "ocr3_bootstrap", + OCRConfigContractAddress: ocrAddress, + ChainID: chainID, + } + specName = bootstrapSpecConfig.JobSpecName + spec = createBootstrapJobSpec(bootstrapSpecConfig) + } else { + oc := OracleJobSpecConfig{ + JobSpecName: "ocr3_oracle", + OCRConfigContractAddress: ocrAddress, + OCRKeyBundleID: nodeKeys[i].OCR2BundleID, + BootstrapURI: bootstrapURI, + TransmitterID: nodeKeys[i].EthAddress, + ChainID: chainID, + AptosKeyBundleID: nodeKeys[i].AptosBundleID, + } + specName = oc.JobSpecName + spec = createOracleJobSpec(oc) + } + + api := newNodeAPI(n) + upsertJob(api, specName, spec) + + fmt.Printf("Replaying from block: %d\n", onchainMeta.SetConfigTxBlock) + fmt.Printf("EVM Chain ID: %d\n\n", chainID) + api.withFlags(api.methods.ReplayFromBlock, func(fs *flag.FlagSet) { + err := fs.Set("block-number", strconv.FormatUint(onchainMeta.SetConfigTxBlock, 10)) + helpers.PanicErr(err) + err = fs.Set("evm-chain-id", strconv.FormatInt(chainID, 10)) + helpers.PanicErr(err) + }).mustExec() + } +} + +func mustReadOCR3Config(fileName string) (output ksdeploy.TopLevelConfigSource) { + return mustReadJSON[ksdeploy.TopLevelConfigSource](fileName) +} + +func nodeKeysToKsDeployNodeKeys(nks []NodeKeys) []ksdeploy.NodeKeys { + keys := []ksdeploy.NodeKeys{} + for _, nk := range nks { + keys = append(keys, ksdeploy.NodeKeys{ + EthAddress: nk.EthAddress, + AptosAccount: nk.AptosAccount, + AptosBundleID: nk.AptosBundleID, + AptosOnchainPublicKey: nk.AptosOnchainPublicKey, + P2PPeerID: nk.P2PPeerID, + OCR2BundleID: nk.OCR2BundleID, + OCR2OnchainPublicKey: nk.OCR2OnchainPublicKey, + OCR2OffchainPublicKey: nk.OCR2OffchainPublicKey, + OCR2ConfigPublicKey: nk.OCR2ConfigPublicKey, + CSAPublicKey: nk.CSAPublicKey, + }) + } + return keys +} + +// BootstrapJobSpecConfig holds configuration for the bootstrap job spec +type BootstrapJobSpecConfig struct { + JobSpecName string + OCRConfigContractAddress string + ChainID int64 +} + +// OracleJobSpecConfig holds configuration for the oracle job spec +type OracleJobSpecConfig struct { + JobSpecName string + OCRConfigContractAddress string + OCRKeyBundleID string + BootstrapURI string + TransmitterID string + ChainID int64 + AptosKeyBundleID string +} + +func createBootstrapJobSpec(config BootstrapJobSpecConfig) string { + const bootstrapTemplate = ` +type = "bootstrap" +schemaVersion = 1 +name = "{{ .JobSpecName }}" +contractID = "{{ .OCRConfigContractAddress }}" +relay = "evm" + +[relayConfig] +chainID = "{{ .ChainID }}" +providerType = "ocr3-capability" +` + + tmpl, err := template.New("bootstrap").Parse(bootstrapTemplate) + if err != nil { + panic(err) + } + + var rendered bytes.Buffer + err = tmpl.Execute(&rendered, config) + if err != nil { + panic(err) + } + + return rendered.String() +} + +func createOracleJobSpec(config OracleJobSpecConfig) string { + const oracleTemplate = ` +type = "offchainreporting2" +schemaVersion = 1 +name = "{{ .JobSpecName }}" +contractID = "{{ .OCRConfigContractAddress }}" +ocrKeyBundleID = "{{ .OCRKeyBundleID }}" +p2pv2Bootstrappers = [ + "{{ .BootstrapURI }}", +] +relay = "evm" +pluginType = "plugin" +transmitterID = "{{ .TransmitterID }}" + +[relayConfig] +chainID = "{{ .ChainID }}" + +[pluginConfig] +command = "chainlink-ocr3-capability" +ocrVersion = 3 +pluginName = "ocr-capability" +providerType = "ocr3-capability" +telemetryType = "plugin" + +[onchainSigningStrategy] +strategyName = 'multi-chain' +[onchainSigningStrategy.config] +evm = "{{ .OCRKeyBundleID }}" +aptos = "{{ .AptosKeyBundleID }}" +` + + tmpl, err := template.New("oracle").Parse(oracleTemplate) + if err != nil { + panic(err) + } + + var rendered bytes.Buffer + err = tmpl.Execute(&rendered, config) + if err != nil { + panic(err) + } + + return rendered.String() +} diff --git a/core/scripts/keystone/src/02_provision_ocr3_capability_test.go b/core/scripts/keystone/src/02_provision_ocr3_capability_test.go new file mode 100644 index 00000000000..df4d9a41f5c --- /dev/null +++ b/core/scripts/keystone/src/02_provision_ocr3_capability_test.go @@ -0,0 +1,67 @@ +package src + +import ( + "errors" + "fmt" + "testing" + + "github.com/gkampitakis/go-snaps/match" + "github.com/gkampitakis/go-snaps/snaps" +) + +func TestGenerateOCR3Config(t *testing.T) { + // Generate OCR3 config + nodeSet := downloadNodeSets(1337, "./testdata/node_sets.json", 4) + nodeKeys := nodeSet.Workflow.NodeKeys + config := generateOCR3Config(nodeKeys, "./testdata/SampleConfig.json") + + matchOffchainConfig := match.Custom("OffchainConfig", func(s any) (any, error) { + // coerce the value to a string + s, ok := s.(string) + if !ok { + return nil, errors.New("offchain config is not a string") + } + + // if the string is not empty + if s == "" { + return nil, errors.New("offchain config is empty") + } + + return "", nil + }) + + snaps.MatchJSON(t, config, matchOffchainConfig) +} + +func TestGenSpecs(t *testing.T) { + nodeSetsPath := "./testdata/node_sets.json" + chainID := int64(1337) + p2pPort := int64(6690) + contractAddress := "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" + nodeSet := downloadNodeSets(chainID, nodeSetsPath, 4).Workflow + + // Create Bootstrap Job Spec + bootstrapConfig := BootstrapJobSpecConfig{ + JobSpecName: "ocr3_bootstrap", + OCRConfigContractAddress: contractAddress, + ChainID: chainID, + } + bootstrapSpec := createBootstrapJobSpec(bootstrapConfig) + + // Create Oracle Job Spec + oracleConfig := OracleJobSpecConfig{ + JobSpecName: "ocr3_oracle", + OCRConfigContractAddress: contractAddress, + OCRKeyBundleID: nodeSet.NodeKeys[1].OCR2BundleID, + BootstrapURI: fmt.Sprintf("%s@%s:%d", nodeSet.NodeKeys[0].P2PPeerID, nodeSet.Nodes[0].ServiceName, p2pPort), + TransmitterID: nodeSet.NodeKeys[1].P2PPeerID, + ChainID: chainID, + AptosKeyBundleID: nodeSet.NodeKeys[1].AptosBundleID, + } + oracleSpec := createOracleJobSpec(oracleConfig) + + // Combine Specs + generatedSpecs := fmt.Sprintf("%s\n\n%s", bootstrapSpec, oracleSpec) + + snaps.MatchSnapshot(t, generatedSpecs) +} diff --git a/core/scripts/keystone/src/02_provision_streams_trigger_capability.go b/core/scripts/keystone/src/02_provision_streams_trigger_capability.go new file mode 100644 index 00000000000..f476319362b --- /dev/null +++ b/core/scripts/keystone/src/02_provision_streams_trigger_capability.go @@ -0,0 +1,522 @@ +package src + +// This package deploys "offchainreporting2" job specs, which setup the streams trigger +// for the targeted node set +// See https://github.com/smartcontractkit/chainlink/blob/4d5fc1943bd6a60b49cbc3d263c0aa47dc3cecb7/core/services/ocr2/plugins/mercury/integration_test.go#L92 +// for how to setup the mercury portion of the streams trigger +// You can see how all fields are being used here: https://github.com/smartcontractkit/chainlink/blob/4d5fc1943bd6a60b49cbc3d263c0aa47dc3cecb7/core/services/ocr2/plugins/mercury/helpers_test.go#L314 +// https://github.com/smartcontractkit/infra-k8s/blob/be47098adfb605d79b5bab6aa601bcf443a6c48b/projects/chainlink/files/chainlink-clusters/cl-keystone-cap-one/config.yaml#L1 +// Trigger gets added to the registry here: https://github.com/smartcontractkit/chainlink/blob/4d5fc1943bd6a60b49cbc3d263c0aa47dc3cecb7/core/services/relay/evm/evm.go#L360 +// See integration workflow here: https://github.com/smartcontractkit/chainlink/blob/4d5fc1943bd6a60b49cbc3d263c0aa47dc3cecb7/core/capabilities/integration_tests/workflow.go#L15 +import ( + "bytes" + "context" + "crypto/ed25519" + "encoding/binary" + "encoding/hex" + "encoding/json" + "fmt" + "html/template" + "math" + "math/big" + "time" + + "net/url" + + "github.com/ethereum/go-ethereum/common" + "github.com/shopspring/decimal" + + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + mercurytypes "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" + datastreamsmercury "github.com/smartcontractkit/chainlink-data-streams/mercury" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/v2/core/bridges" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" + + verifierContract "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" + + "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/web/presenters" +) + +type feed struct { + id [32]byte + name string + + // we create a bridge for each feed + bridgeName string + bridgeURL string +} + +func v3FeedID(id [32]byte) [32]byte { + binary.BigEndian.PutUint16(id[:2], 3) + return id +} + +var feeds = []feed{ + { + v3FeedID([32]byte{5: 1}), + "BTC/USD", + "mock-bridge-btc", + "http://external-adapter:4001", + }, + { + v3FeedID([32]byte{5: 2}), + "LINK/USD", + "mock-bridge-link", + "http://external-adapter:4002", + }, + { + v3FeedID([32]byte{5: 3}), + "NATIVE/USD", + "mock-bridge-native", + "http://external-adapter:4003", + }, +} + +// See /core/services/ocr2/plugins/mercury/integration_test.go +func setupStreamsTrigger( + env helpers.Environment, + nodeSet NodeSet, + chainID int64, + p2pPort int64, + ocrConfigFilePath string, + artefactsDir string, +) { + fmt.Printf("Deploying streams trigger for chain %d\n", chainID) + fmt.Printf("Using OCR config file: %s\n", ocrConfigFilePath) + + fmt.Printf("Deploying Mercury V0.3 contracts\n") + verifier := deployMercuryV03Contracts(env, artefactsDir) + + fmt.Printf("Generating Mercury OCR config\n") + ocrConfig := generateMercuryOCR2Config(nodeSet.NodeKeys[1:]) // skip the bootstrap node + + for _, feed := range feeds { + fmt.Println("Configuring feeds...") + fmt.Printf("FeedID: %x\n", feed.id) + fmt.Printf("FeedName: %s\n", feed.name) + fmt.Printf("BridgeName: %s\n", feed.bridgeName) + fmt.Printf("BridgeURL: %s\n", feed.bridgeURL) + + latestConfigDetails, err := verifier.LatestConfigDetails(nil, feed.id) + PanicErr(err) + latestConfigDigest, err := ocrtypes.BytesToConfigDigest(latestConfigDetails.ConfigDigest[:]) + PanicErr(err) + + digester := mercury.NewOffchainConfigDigester( + feed.id, + big.NewInt(chainID), + verifier.Address(), + ocrtypes.ConfigDigestPrefixMercuryV02, + ) + configDigest, err := digester.ConfigDigest( + context.Background(), + mercuryOCRConfigToContractConfig( + ocrConfig, + latestConfigDetails.ConfigCount, + ), + ) + PanicErr(err) + + if configDigest.Hex() == latestConfigDigest.Hex() { + fmt.Printf("Verifier already deployed with the same config (digest: %s), skipping...\n", configDigest.Hex()) + } else { + fmt.Printf("Verifier contains a different config, updating...\nOld digest: %s\nNew digest: %s\n", latestConfigDigest.Hex(), configDigest.Hex()) + tx, err := verifier.SetConfig( + env.Owner, + feed.id, + ocrConfig.Signers, + ocrConfig.Transmitters, + ocrConfig.F, + ocrConfig.OnchainConfig, + ocrConfig.OffchainConfigVersion, + ocrConfig.OffchainConfig, + nil, + ) + helpers.ConfirmTXMined(context.Background(), env.Ec, tx, env.ChainID) + PanicErr(err) + } + + fmt.Printf("Deploying OCR2 job specs for feed %s\n", feed.name) + deployOCR2JobSpecsForFeed(nodeSet, verifier, feed, chainID, p2pPort) + } + + fmt.Println("Finished deploying streams trigger") +} + +func deployMercuryV03Contracts(env helpers.Environment, artefactsDir string) verifierContract.VerifierInterface { + var confirmDeploy = func(tx *types.Transaction, err error) { + helpers.ConfirmContractDeployed(context.Background(), env.Ec, tx, env.ChainID) + PanicErr(err) + } + o := LoadOnchainMeta(artefactsDir, env) + + if o.VerifierProxy != nil { + fmt.Printf("Verifier proxy contract already deployed at %s\n", o.VerifierProxy.Address()) + } else { + fmt.Printf("Deploying verifier proxy contract\n") + _, tx, verifierProxy, err := verifier_proxy.DeployVerifierProxy(env.Owner, env.Ec, common.Address{}) // zero address for access controller disables access control + confirmDeploy(tx, err) + o.VerifierProxy = verifierProxy + WriteOnchainMeta(o, artefactsDir) + } + + if o.Verifier == nil { + fmt.Printf("Deploying verifier contract\n") + _, tx, verifier, err := verifierContract.DeployVerifier(env.Owner, env.Ec, o.VerifierProxy.Address()) + confirmDeploy(tx, err) + o.Verifier = verifier + WriteOnchainMeta(o, artefactsDir) + } else { + fmt.Printf("Verifier contract already deployed at %s\n", o.Verifier.Address().Hex()) + } + + if o.InitializedVerifierAddress != o.Verifier.Address() { + fmt.Printf("Current initialized verifier address (%s) differs from the new verifier address (%s). Initializing verifier.\n", o.InitializedVerifierAddress.Hex(), o.Verifier.Address().Hex()) + tx, err := o.VerifierProxy.InitializeVerifier(env.Owner, o.Verifier.Address()) + receipt := helpers.ConfirmTXMined(context.Background(), env.Ec, tx, env.ChainID) + PanicErr(err) + inited, err := o.VerifierProxy.ParseVerifierInitialized(*receipt.Logs[0]) + PanicErr(err) + o.InitializedVerifierAddress = inited.VerifierAddress + WriteOnchainMeta(o, artefactsDir) + } else { + fmt.Printf("Verifier %s already initialized\n", o.Verifier.Address().Hex()) + } + + return o.Verifier +} + +func deployOCR2JobSpecsForFeed(nodeSet NodeSet, verifier verifierContract.VerifierInterface, feed feed, chainID int64, p2pPort int64) { + // we assign the first node as the bootstrap node + for i, n := range nodeSet.NodeKeys { + // parallel arrays + api := newNodeAPI(nodeSet.Nodes[i]) + jobSpecName := "" + jobSpecStr := "" + + upsertBridge(api, feed.bridgeName, feed.bridgeURL) + + if i == 0 { + // Prepare data for Bootstrap Job + bootstrapData := MercuryV3BootstrapJobSpecData{ + FeedName: feed.name, + VerifierAddress: verifier.Address().Hex(), + FeedID: fmt.Sprintf("%x", feed.id), + ChainID: chainID, + } + + // Create Bootstrap Job + jobSpecName, jobSpecStr = createMercuryV3BootstrapJob(bootstrapData) + } else { + // Prepare data for Mercury V3 Job + mercuryData := MercuryV3JobSpecData{ + FeedName: "feed-" + feed.name, + BootstrapHost: fmt.Sprintf("%s@%s:%d", nodeSet.NodeKeys[0].P2PPeerID, nodeSet.Nodes[0].ServiceName, p2pPort), + VerifierAddress: verifier.Address().Hex(), + Bridge: feed.bridgeName, + NodeCSAKey: n.CSAPublicKey, + FeedID: fmt.Sprintf("%x", feed.id), + LinkFeedID: fmt.Sprintf("%x", feeds[1].id), + NativeFeedID: fmt.Sprintf("%x", feeds[2].id), + OCRKeyBundleID: n.OCR2BundleID, + ChainID: chainID, + } + + // Create Mercury V3 Job + jobSpecName, jobSpecStr = createMercuryV3OracleJob(mercuryData) + } + + upsertJob(api, jobSpecName, jobSpecStr) + } +} + +// Template definitions +const mercuryV3OCR2bootstrapJobTemplate = ` +type = "bootstrap" +relay = "evm" +schemaVersion = 1 +name = "{{ .Name }}" +contractID = "{{ .VerifierAddress }}" +feedID = "0x{{ .FeedID }}" +contractConfigTrackerPollInterval = "1s" + +[relayConfig] +chainID = {{ .ChainID }} +enableTriggerCapability = true +` + +const mercuryV3OCR2OracleJobTemplate = ` +type = "offchainreporting2" +schemaVersion = 1 +name = "{{ .Name }}" +p2pv2Bootstrappers = ["{{ .BootstrapHost }}"] +forwardingAllowed = false +maxTaskDuration = "1s" +contractID = "{{ .VerifierAddress }}" +feedID = "0x{{ .FeedID }}" +contractConfigTrackerPollInterval = "1s" +ocrKeyBundleID = "{{ .OCRKeyBundleID }}" +relay = "evm" +pluginType = "mercury" +transmitterID = "{{ .NodeCSAKey }}" +observationSource = """ + price [type=bridge name="{{ .Bridge }}" timeout="50ms" requestData=""]; + + benchmark_price [type=jsonparse path="result,mid" index=0]; + price -> benchmark_price; + + bid_price [type=jsonparse path="result,bid" index=1]; + price -> bid_price; + + ask_price [type=jsonparse path="result,ask" index=2]; + price -> ask_price; +""" + +[relayConfig] +enableTriggerCapability = true +chainID = "{{ .ChainID }}" +` + +// Data structures +type MercuryV3BootstrapJobSpecData struct { + FeedName string + // Automatically generated from FeedName + Name string + VerifierAddress string + FeedID string + ChainID int64 +} + +type MercuryV3JobSpecData struct { + FeedName string + // Automatically generated from FeedName + Name string + BootstrapHost string + VerifierAddress string + Bridge string + NodeCSAKey string + FeedID string + LinkFeedID string + NativeFeedID string + OCRKeyBundleID string + ChainID int64 +} + +// createMercuryV3BootstrapJob creates a bootstrap job specification using the provided data. +func createMercuryV3BootstrapJob(data MercuryV3BootstrapJobSpecData) (name string, jobSpecStr string) { + name = "boot-" + data.FeedName + data.Name = name + + fmt.Printf("Creating bootstrap job (%s):\nverifier address: %s\nfeed name: %s\nfeed ID: %s\nchain ID: %d\n", + name, data.VerifierAddress, data.FeedName, data.FeedID, data.ChainID) + + tmpl, err := template.New("bootstrapJob").Parse(mercuryV3OCR2bootstrapJobTemplate) + PanicErr(err) + + var buf bytes.Buffer + err = tmpl.Execute(&buf, data) + PanicErr(err) + + jobSpecStr = buf.String() + + return name, jobSpecStr +} + +// createMercuryV3OracleJob creates a Mercury V3 job specification using the provided data. +func createMercuryV3OracleJob(data MercuryV3JobSpecData) (name string, jobSpecStr string) { + name = "mercury-" + data.FeedName + data.Name = name + fmt.Printf("Creating ocr2 job(%s):\nOCR key bundle ID: %s\nverifier address: %s\nbridge: %s\nnodeCSAKey: %s\nfeed name: %s\nfeed ID: %s\nlink feed ID: %s\nnative feed ID: %s\nchain ID: %d\n", + data.Name, data.OCRKeyBundleID, data.VerifierAddress, data.Bridge, data.NodeCSAKey, data.FeedName, data.FeedID, data.LinkFeedID, data.NativeFeedID, data.ChainID) + + tmpl, err := template.New("mercuryV3Job").Parse(mercuryV3OCR2OracleJobTemplate) + PanicErr(err) + + var buf bytes.Buffer + err = tmpl.Execute(&buf, data) + PanicErr(err) + + jobSpecStr = buf.String() + + return data.Name, jobSpecStr +} + +func strToBytes32(str string) [32]byte { + pkBytes, err := hex.DecodeString(str) + helpers.PanicErr(err) + + pkBytesFixed := [ed25519.PublicKeySize]byte{} + n := copy(pkBytesFixed[:], pkBytes) + if n != ed25519.PublicKeySize { + fmt.Printf("wrong num elements copied (%s): %d != 32\n", str, n) + panic("wrong num elements copied") + } + return pkBytesFixed +} + +func upsertBridge(api *nodeAPI, name string, eaURL string) { + u, err := url.Parse(eaURL) + helpers.PanicErr(err) + url := models.WebURL(*u) + // Confirmations and MinimumContractPayment are not used, so we can leave them as 0 + b := bridges.BridgeTypeRequest{ + Name: bridges.MustParseBridgeName(name), + URL: url, + } + payloadb, err := json.Marshal(b) + helpers.PanicErr(err) + payload := string(payloadb) + + bridgeActionType := bridgeAction(api, b) + switch bridgeActionType { + case shouldCreateBridge: + fmt.Printf("Creating bridge (%s): %s\n", name, eaURL) + resp := api.withArg(payload).mustExec(api.methods.CreateBridge) + resource := mustJSON[presenters.BridgeResource](resp) + fmt.Printf("Created bridge: %s %s\n", resource.Name, resource.URL) + case shouldUpdateBridge: + fmt.Println("Updating existing bridge") + api.withArgs(name, payload).mustExec(api.methods.UpdateBridge) + fmt.Println("Updated bridge", name) + case shouldNoChangeBridge: + fmt.Println("No changes needed for bridge", name) + } +} + +// create enum for 3 states: create, update, no change +var ( + shouldCreateBridge = 0 + shouldUpdateBridge = 1 + shouldNoChangeBridge = 2 +) + +func bridgeAction(api *nodeAPI, existingBridge bridges.BridgeTypeRequest) int { + resp, err := api.withArg(existingBridge.Name.String()).exec(api.methods.ShowBridge) + if err != nil { + return shouldCreateBridge + } + + b := mustJSON[presenters.BridgeResource](resp) + fmt.Printf("Found matching bridge: %s with URL: %s\n", b.Name, b.URL) + if b.URL == existingBridge.URL.String() { + return shouldNoChangeBridge + } + return shouldUpdateBridge +} + +func generateMercuryOCR2Config(nca []NodeKeys) MercuryOCR2Config { + ctx := context.Background() + f := uint8(1) + rawOnchainConfig := mercurytypes.OnchainConfig{ + Min: big.NewInt(0), + Max: big.NewInt(math.MaxInt64), + } + + // Values were taken from Data Streams 250ms feeds, given by @austinborn + rawReportingPluginConfig := datastreamsmercury.OffchainConfig{ + ExpirationWindow: 86400, + BaseUSDFee: decimal.NewFromInt(0), + } + + onchainConfig, err := (datastreamsmercury.StandardOnchainConfigCodec{}).Encode(ctx, rawOnchainConfig) + helpers.PanicErr(err) + reportingPluginConfig, err := json.Marshal(rawReportingPluginConfig) + helpers.PanicErr(err) + + onchainPubKeys := []common.Address{} + for _, n := range nca { + onchainPubKeys = append(onchainPubKeys, common.HexToAddress(n.OCR2OnchainPublicKey)) + } + + offchainPubKeysBytes := []ocrtypes.OffchainPublicKey{} + for _, n := range nca { + pkBytesFixed := strToBytes32(n.OCR2OffchainPublicKey) + offchainPubKeysBytes = append(offchainPubKeysBytes, ocrtypes.OffchainPublicKey(pkBytesFixed)) + } + + configPubKeysBytes := []ocrtypes.ConfigEncryptionPublicKey{} + for _, n := range nca { + pkBytesFixed := strToBytes32(n.OCR2ConfigPublicKey) + configPubKeysBytes = append(configPubKeysBytes, ocrtypes.ConfigEncryptionPublicKey(pkBytesFixed)) + } + + identities := []confighelper.OracleIdentityExtra{} + for index := range nca { + transmitterAccount := ocrtypes.Account(nca[index].CSAPublicKey) + + identities = append(identities, confighelper.OracleIdentityExtra{ + OracleIdentity: confighelper.OracleIdentity{ + OnchainPublicKey: onchainPubKeys[index][:], + OffchainPublicKey: offchainPubKeysBytes[index], + PeerID: nca[index].P2PPeerID, + TransmitAccount: transmitterAccount, + }, + ConfigEncryptionPublicKey: configPubKeysBytes[index], + }) + } + + secrets := deployment.XXXGenerateTestOCRSecrets() + // Values were taken from Data Streams 250ms feeds, given by @austinborn + signers, _, _, onchainConfig, offchainConfigVersion, offchainConfig, err := ocr3confighelper.ContractSetConfigArgsDeterministic( + secrets.EphemeralSk, + secrets.SharedSecret, + 10*time.Second, // DeltaProgress + 10*time.Second, // DeltaResend + 400*time.Millisecond, // DeltaInitial + 5*time.Second, // DeltaRound + 0, // DeltaGrace + 1*time.Second, // DeltaCertifiedCommitRequest + 0, // DeltaStage + 25, // rMax + []int{len(identities)}, // S + identities, + reportingPluginConfig, // reportingPluginConfig []byte, + nil, // maxDurationInitialization *time.Duration, + 0, // maxDurationQuery time.Duration, + 250*time.Millisecond, // Max duration observation + 0, // Max duration should accept attested report + 0, // Max duration should transmit accepted report + int(f), // f + onchainConfig, + ) + PanicErr(err) + signerAddresses, err := evm.OnchainPublicKeyToAddress(signers) + PanicErr(err) + + offChainTransmitters := make([][32]byte, len(nca)) + for i, n := range nca { + offChainTransmitters[i] = strToBytes32(n.CSAPublicKey) + } + + config := MercuryOCR2Config{ + Signers: signerAddresses, + Transmitters: offChainTransmitters, + F: f, + OnchainConfig: onchainConfig, + OffchainConfigVersion: offchainConfigVersion, + OffchainConfig: offchainConfig, + } + + return config +} + +type MercuryOCR2Config struct { + Signers []common.Address + Transmitters [][32]byte + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte +} diff --git a/core/scripts/keystone/src/02_provision_streams_trigger_capability_test.go b/core/scripts/keystone/src/02_provision_streams_trigger_capability_test.go new file mode 100644 index 00000000000..3a2234ba4d7 --- /dev/null +++ b/core/scripts/keystone/src/02_provision_streams_trigger_capability_test.go @@ -0,0 +1,57 @@ +package src + +import ( + "fmt" + "net/url" + "testing" + + "github.com/gkampitakis/go-snaps/snaps" +) + +var ( + chainID = int64(123456) + feedID = fmt.Sprintf("%x", [32]byte{0: 1}) + feedName = "BTC/USD" + verifierAddress = fmt.Sprintf("0x%x", [20]byte{0: 7}) +) + +func TestCreateMercuryV3Job(t *testing.T) { + ocrKeyBundleID := "ocr_key_bundle_id" + nodeCSAKey := "node_csa_key" + bridgeName := "bridge_name" + linkFeedID := fmt.Sprintf("%x", [32]byte{0: 2}) + nativeFeedID := fmt.Sprintf("%x", [32]byte{0: 3}) + u, err := url.Parse("https://crib-henry-keystone-node1.main.stage.cldev.sh") + if err != nil { + t.Fatal(err) + } + + jobConfigData := MercuryV3JobSpecData{ + BootstrapHost: u.Hostname(), + VerifierAddress: verifierAddress, + OCRKeyBundleID: ocrKeyBundleID, + NodeCSAKey: nodeCSAKey, + Bridge: bridgeName, + FeedName: feedName, + FeedID: feedID, + LinkFeedID: linkFeedID, + NativeFeedID: nativeFeedID, + ChainID: chainID, + } + _, output := createMercuryV3OracleJob(jobConfigData) + + snaps.MatchSnapshot(t, output) +} + +func TestCreateMercuryBootstrapJob(t *testing.T) { + jobConfigData := MercuryV3BootstrapJobSpecData{ + FeedName: feedName, + FeedID: feedID, + ChainID: chainID, + VerifierAddress: verifierAddress, + } + + _, output := createMercuryV3BootstrapJob(jobConfigData) + + snaps.MatchSnapshot(t, output) +} diff --git a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go b/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go deleted file mode 100644 index 6b98951459e..00000000000 --- a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go +++ /dev/null @@ -1,86 +0,0 @@ -package src - -import ( - "flag" - "os" - "path/filepath" - "strings" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" -) - -type generateCribClusterOverrides struct{} - -func NewGenerateCribClusterOverridesCommand() *generateCribClusterOverrides { - return &generateCribClusterOverrides{} -} - -func (g *generateCribClusterOverrides) Name() string { - return "generate-crib" -} - -func (g *generateCribClusterOverrides) Run(args []string) { - fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) - chainID := fs.Int64("chainid", 11155111, "chain id") - outputPath := fs.String("outpath", "../crib", "the path to output the generated overrides") - publicKeys := fs.String("publickeys", "", "Custom public keys json location") - nodeList := fs.String("nodes", "", "Custom node list location") - artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") - - templatesDir := "templates" - err := fs.Parse(args) - if err != nil || outputPath == nil || *outputPath == "" || chainID == nil || *chainID == 0 { - fs.Usage() - os.Exit(1) - } - - if *artefactsDir == "" { - *artefactsDir = defaultArtefactsDir - } - if *publicKeys == "" { - *publicKeys = defaultPublicKeys - } - if *nodeList == "" { - *nodeList = defaultNodeList - } - - deployedContracts, err := LoadDeployedContracts(*artefactsDir) - helpers.PanicErr(err) - - lines := generateCribConfig(*nodeList, *publicKeys, chainID, templatesDir, deployedContracts.ForwarderContract.Hex()) - - cribOverridesStr := strings.Join(lines, "\n") - err = os.WriteFile(filepath.Join(*outputPath, "crib-cluster-overrides.yaml"), []byte(cribOverridesStr), 0600) - helpers.PanicErr(err) -} - -func generateCribConfig(nodeList string, pubKeysPath string, chainID *int64, templatesDir string, forwarderAddress string) []string { - nca := downloadNodePubKeys(nodeList, *chainID, pubKeysPath) - nodeAddresses := []string{} - - for _, node := range nca[1:] { - nodeAddresses = append(nodeAddresses, node.EthAddress) - } - - lines, err := readLines(filepath.Join(templatesDir, cribOverrideTemplate)) - helpers.PanicErr(err) - lines = replaceCribPlaceholders(lines, forwarderAddress, nodeAddresses) - return lines -} - -func replaceCribPlaceholders( - lines []string, - forwarderAddress string, - nodeFromAddresses []string, -) (output []string) { - for _, l := range lines { - l = strings.Replace(l, "{{ forwarder_address }}", forwarderAddress, 1) - l = strings.Replace(l, "{{ node_2_address }}", nodeFromAddresses[0], 1) - l = strings.Replace(l, "{{ node_3_address }}", nodeFromAddresses[1], 1) - l = strings.Replace(l, "{{ node_4_address }}", nodeFromAddresses[2], 1) - l = strings.Replace(l, "{{ node_5_address }}", nodeFromAddresses[3], 1) - output = append(output, l) - } - - return output -} diff --git a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go b/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go deleted file mode 100644 index 53d43c2342f..00000000000 --- a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package src - -import ( - "strings" - "testing" - - "github.com/gkampitakis/go-snaps/snaps" -) - -func TestGenerateCribConfig(t *testing.T) { - chainID := int64(11155111) - templatesDir := "../templates" - forwarderAddress := "0x1234567890abcdef" - publicKeysPath := "./testdata/PublicKeys.json" - - lines := generateCribConfig(defaultNodeList, publicKeysPath, &chainID, templatesDir, forwarderAddress) - - snaps.MatchSnapshot(t, strings.Join(lines, "\n")) -} diff --git a/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go b/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go deleted file mode 100644 index 136691962dd..00000000000 --- a/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go +++ /dev/null @@ -1,101 +0,0 @@ -package src - -import ( - "bytes" - "encoding/json" - "flag" - "fmt" - "os" - - "github.com/urfave/cli" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" -) - -type deleteJobs struct{} - -type OCRSpec struct { - ContractID string -} - -type BootSpec struct { - ContractID string -} - -type WorkflowSpec struct { - WorkflowID string -} - -type JobSpec struct { - Id string - Name string - BootstrapSpec BootSpec - OffChainReporting2OracleSpec OCRSpec - WorkflowSpec WorkflowSpec -} - -func NewDeleteJobsCommand() *deleteJobs { - return &deleteJobs{} -} - -func (g *deleteJobs) Name() string { - return "delete-ocr3-jobs" -} - -func (g *deleteJobs) Run(args []string) { - fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) - nodeList := fs.String("nodes", "", "Custom node list location") - artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") - - err := fs.Parse(args) - if err != nil { - fs.Usage() - os.Exit(1) - } - - if *artefactsDir == "" { - *artefactsDir = defaultArtefactsDir - } - if *nodeList == "" { - *nodeList = defaultNodeList - } - - deployedContracts, err := LoadDeployedContracts(*artefactsDir) - helpers.PanicErr(err) - nodes := downloadNodeAPICredentials(*nodeList) - - for _, node := range nodes { - output := &bytes.Buffer{} - client, app := newApp(node, output) - - fmt.Println("Logging in:", node.url) - loginFs := flag.NewFlagSet("test", flag.ContinueOnError) - loginFs.Bool("bypass-version-check", true, "") - loginCtx := cli.NewContext(app, loginFs, nil) - err := client.RemoteLogin(loginCtx) - helpers.PanicErr(err) - output.Reset() - - fileFs := flag.NewFlagSet("test", flag.ExitOnError) - err = client.ListJobs(cli.NewContext(app, fileFs, nil)) - helpers.PanicErr(err) - - var parsed []JobSpec - err = json.Unmarshal(output.Bytes(), &parsed) - helpers.PanicErr(err) - - for _, jobSpec := range parsed { - if jobSpec.BootstrapSpec.ContractID == deployedContracts.OCRContract.String() || - jobSpec.OffChainReporting2OracleSpec.ContractID == deployedContracts.OCRContract.String() { - fmt.Println("Deleting OCR3 job ID:", jobSpec.Id, "name:", jobSpec.Name) - set := flag.NewFlagSet("test", flag.ExitOnError) - err = set.Parse([]string{jobSpec.Id}) - helpers.PanicErr(err) - err = client.DeleteJob(cli.NewContext(app, set, nil)) - helpers.PanicErr(err) - } - } - - output.Reset() - } -} diff --git a/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go b/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go index b7fc9df2c88..203c473a4b7 100644 --- a/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go +++ b/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go @@ -2,19 +2,14 @@ package src import ( "context" - "encoding/hex" "flag" "fmt" "log" "os" - "strings" "github.com/ethereum/go-ethereum/common" "google.golang.org/protobuf/proto" - ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" - - capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -30,7 +25,7 @@ type peer struct { } var ( - workflowDonPeers = []peer{ + hardcodedWorkflowDonPeers = []peer{ { PeerID: "12D3KooWQXfwA26jysiKKPXKuHcJtWTbGSwzoJxj4rYtEJyQTnFj", Signer: "0xC44686106b85687F741e1d6182a5e2eD2211a115", @@ -70,74 +65,6 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Name() string { return "deploy-and-initialize-capabilities-registry" } -func peerIDToB(peerID string) ([32]byte, error) { - var peerIDB ragetypes.PeerID - err := peerIDB.UnmarshalText([]byte(peerID)) - if err != nil { - return [32]byte{}, err - } - - return peerIDB, nil -} - -func peers(ps []peer) ([][32]byte, error) { - out := [][32]byte{} - for _, p := range ps { - b, err := peerIDToB(p.PeerID) - if err != nil { - return nil, err - } - - out = append(out, b) - } - - return out, nil -} - -func peerToNode(nopID uint32, p peer) (kcr.CapabilitiesRegistryNodeParams, error) { - peerIDB, err := peerIDToB(p.PeerID) - if err != nil { - return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert peerID: %w", err) - } - - sig := strings.TrimPrefix(p.Signer, "0x") - signerB, err := hex.DecodeString(sig) - if err != nil { - return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert signer: %w", err) - } - - keyStr := strings.TrimPrefix(p.EncryptionPublicKey, "0x") - encKey, err := hex.DecodeString(keyStr) - if err != nil { - return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert encryptionPublicKey: %w", err) - } - - var sigb [32]byte - var encKeyB [32]byte - copy(sigb[:], signerB) - copy(encKeyB[:], encKey) - - return kcr.CapabilitiesRegistryNodeParams{ - NodeOperatorId: nopID, - P2pId: peerIDB, - Signer: sigb, - EncryptionPublicKey: encKeyB, - }, nil -} - -// newCapabilityConfig returns a new capability config with the default config set as empty. -// Override the empty default config with functional options. -func newCapabilityConfig(opts ...func(*values.Map)) *capabilitiespb.CapabilityConfig { - dc := values.EmptyMap() - for _, opt := range opts { - opt(dc) - } - - return &capabilitiespb.CapabilityConfig{ - DefaultConfig: values.ProtoMap(dc), - } -} - // withDefaultConfig returns a function that sets the default config for a capability by merging // the provided map with the existing default config. This is a shallow merge. func withDefaultConfig(m map[string]any) func(*values.Map) { @@ -163,7 +90,7 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { // create flags for all of the env vars then set the env vars to normalize the interface // this is a bit of a hack but it's the easiest way to make this work ethUrl := fs.String("ethurl", "", "URL of the Ethereum node") - chainID := fs.Int64("chainid", 11155111, "chain ID of the Ethereum network to deploy to") + chainID := fs.Int64("chainid", 1337, "chain ID of the Ethereum network to deploy to") accountKey := fs.String("accountkey", "", "private key of the account to deploy from") capabilityRegistryAddress := fs.String("craddress", "", "address of the capability registry") @@ -179,6 +106,7 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { os.Setenv("ETH_URL", *ethUrl) os.Setenv("ETH_CHAIN_ID", fmt.Sprintf("%d", *chainID)) os.Setenv("ACCOUNT_KEY", *accountKey) + os.Setenv("INSECURE_SKIP_VERIFY", "true") env := helpers.SetupEnv(false) @@ -288,7 +216,7 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { nopID := recLog.NodeOperatorId nodes := []kcr.CapabilitiesRegistryNodeParams{} - for _, wfPeer := range workflowDonPeers { + for _, wfPeer := range hardcodedWorkflowDonPeers { n, innerErr := peerToNode(nopID, wfPeer) if innerErr != nil { panic(innerErr) @@ -306,7 +234,7 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { helpers.ConfirmTXMined(ctx, env.Ec, tx, env.ChainID) // workflow DON - ps, err := peers(workflowDonPeers) + ps, err := peers(hardcodedWorkflowDonPeers) if err != nil { panic(err) } diff --git a/core/scripts/keystone/src/06_deploy_workflows_cmd.go b/core/scripts/keystone/src/06_deploy_workflows_cmd.go deleted file mode 100644 index 0ca8e5d4a7b..00000000000 --- a/core/scripts/keystone/src/06_deploy_workflows_cmd.go +++ /dev/null @@ -1,71 +0,0 @@ -package src - -import ( - "bytes" - "errors" - "flag" - "fmt" - "os" - - "github.com/urfave/cli" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" -) - -type deployWorkflows struct{} - -func NewDeployWorkflowsCommand() *deployWorkflows { - return &deployWorkflows{} -} - -func (g *deployWorkflows) Name() string { - return "deploy-workflows" -} - -func (g *deployWorkflows) Run(args []string) { - fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) - workflowFile := fs.String("workflow", "workflow.yml", "path to workflow file") - nodeList := fs.String("nodes", "", "Custom node list location") - err := fs.Parse(args) - if err != nil || workflowFile == nil || *workflowFile == "" { - fs.Usage() - os.Exit(1) - } - if *nodeList == "" { - *nodeList = defaultNodeList - } - fmt.Println("Deploying workflows") - - // use a separate list - nodes := downloadNodeAPICredentials(*nodeList) - - if _, err = os.Stat(*workflowFile); err != nil { - PanicErr(errors.New("toml file does not exist")) - } - - for i, n := range nodes { - if i == 0 { - continue // skip bootstrap node - } - output := &bytes.Buffer{} - client, app := newApp(n, output) - fmt.Println("Logging in:", n.url) - loginFs := flag.NewFlagSet("test", flag.ContinueOnError) - loginFs.Bool("bypass-version-check", true, "") - loginCtx := cli.NewContext(app, loginFs, nil) - err := client.RemoteLogin(loginCtx) - helpers.PanicErr(err) - output.Reset() - - fmt.Printf("Deploying workflow\n... \n") - fs := flag.NewFlagSet("test", flag.ExitOnError) - err = fs.Parse([]string{*workflowFile}) - - helpers.PanicErr(err) - err = client.CreateJob(cli.NewContext(app, fs, nil)) - if err != nil { - fmt.Println("Failed to deploy workflow:", "Error:", err) - } - output.Reset() - } -} diff --git a/core/scripts/keystone/src/07_delete_workflows_cmd.go b/core/scripts/keystone/src/07_delete_workflows_cmd.go deleted file mode 100644 index cccedaf9e70..00000000000 --- a/core/scripts/keystone/src/07_delete_workflows_cmd.go +++ /dev/null @@ -1,74 +0,0 @@ -package src - -import ( - "bytes" - "encoding/json" - "flag" - "fmt" - "os" - - "github.com/urfave/cli" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" -) - -type deleteWorkflows struct{} - -func NewDeleteWorkflowsCommand() *deleteWorkflows { - return &deleteWorkflows{} -} - -func (g *deleteWorkflows) Name() string { - return "delete-workflows" -} - -func (g *deleteWorkflows) Run(args []string) { - fs := flag.NewFlagSet(g.Name(), flag.ExitOnError) - nodeList := fs.String("nodes", "", "Custom node list location") - - err := fs.Parse(args) - if err != nil { - fs.Usage() - os.Exit(1) - } - - if *nodeList == "" { - *nodeList = defaultNodeList - } - - nodes := downloadNodeAPICredentials(*nodeList) - - for _, node := range nodes { - output := &bytes.Buffer{} - client, app := newApp(node, output) - - fmt.Println("Logging in:", node.url) - loginFs := flag.NewFlagSet("test", flag.ContinueOnError) - loginFs.Bool("bypass-version-check", true, "") - loginCtx := cli.NewContext(app, loginFs, nil) - err := client.RemoteLogin(loginCtx) - helpers.PanicErr(err) - output.Reset() - - fileFs := flag.NewFlagSet("test", flag.ExitOnError) - err = client.ListJobs(cli.NewContext(app, fileFs, nil)) - helpers.PanicErr(err) - - var parsed []JobSpec - err = json.Unmarshal(output.Bytes(), &parsed) - helpers.PanicErr(err) - - for _, jobSpec := range parsed { - if jobSpec.WorkflowSpec.WorkflowID != "" { - fmt.Println("Deleting workflow job ID:", jobSpec.Id, "name:", jobSpec.Name) - set := flag.NewFlagSet("test", flag.ExitOnError) - err = set.Parse([]string{jobSpec.Id}) - helpers.PanicErr(err) - err = client.DeleteJob(cli.NewContext(app, set, nil)) - helpers.PanicErr(err) - } - } - - output.Reset() - } -} diff --git a/core/scripts/keystone/src/88_capabilities_registry_helpers.go b/core/scripts/keystone/src/88_capabilities_registry_helpers.go new file mode 100644 index 00000000000..5494375aa4f --- /dev/null +++ b/core/scripts/keystone/src/88_capabilities_registry_helpers.go @@ -0,0 +1,578 @@ +package src + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "log" + "strings" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + gethCommon "github.com/ethereum/go-ethereum/common" + gethTypes "github.com/ethereum/go-ethereum/core/types" + ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" + + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" + "github.com/smartcontractkit/chainlink-common/pkg/values" + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" +) + +type CapabilityRegistryProvisioner struct { + reg kcr.CapabilitiesRegistryInterface + env helpers.Environment +} + +func NewCapabilityRegistryProvisioner(reg kcr.CapabilitiesRegistryInterface, env helpers.Environment) *CapabilityRegistryProvisioner { + return &CapabilityRegistryProvisioner{reg: reg, env: env} +} + +func extractRevertReason(errData string, a abi.ABI) (string, string, error) { + data, err := hex.DecodeString(errData[2:]) + if err != nil { + return "", "", err + } + + for errName, abiError := range a.Errors { + if bytes.Equal(data[:4], abiError.ID.Bytes()[:4]) { + // Found a matching error + v, err := abiError.Unpack(data) + if err != nil { + return "", "", err + } + b, err := json.Marshal(v) + if err != nil { + return "", "", err + } + return errName, string(b), nil + } + } + return "", "", errors.New("revert Reason could not be found for given abistring") +} + +func (c *CapabilityRegistryProvisioner) testCallContract(method string, args ...interface{}) error { + abi := evmtypes.MustGetABI(kcr.CapabilitiesRegistryABI) + data, err := abi.Pack(method, args...) + helpers.PanicErr(err) + cAddress := c.reg.Address() + gasPrice, err := c.env.Ec.SuggestGasPrice(context.Background()) + helpers.PanicErr(err) + + msg := ethereum.CallMsg{ + From: c.env.Owner.From, + To: &cAddress, + Data: data, + Gas: 10_000_000, + GasPrice: gasPrice, + } + _, err = c.env.Ec.CallContract(context.Background(), msg, nil) + if err != nil { + if err.Error() == "execution reverted" { + rpcError, ierr := evmclient.ExtractRPCError(err) + if ierr != nil { + return ierr + } + + reason, abiErr, ierr := extractRevertReason(rpcError.Data.(string), abi) + if ierr != nil { + return ierr + } + + e := fmt.Errorf("failed to call %s: reason: %s reasonargs: %s", method, reason, abiErr) + return e + } + + return err + } + + return nil +} + +// AddCapabilities takes a capability set and provisions it in the registry. +func (c *CapabilityRegistryProvisioner) AddCapabilities(ctx context.Context, capSet CapabilitySet) { + fmt.Printf("Adding capabilities to registry: %s\n", capSet.IDs()) + tx, err := c.reg.AddCapabilities(c.env.Owner, capSet.Capabilities()) + + helpers.PanicErr(err) + helpers.ConfirmTXMined(ctx, c.env.Ec, tx, c.env.ChainID) +} + +// AddNodeOperator takes a node operator and provisions it in the registry. +// +// A node operator is a group of nodes that are all controlled by the same entity. The admin address is the +// address that controls the node operator. +// +// The name is a human-readable name for the node operator. +// +// The node operator is then added to the registry, and the registry will issue an ID for the node operator. +// The ID is then used when adding nodes to the registry such that the registry knows which nodes belong to which +// node operator. +func (c *CapabilityRegistryProvisioner) AddNodeOperator(ctx context.Context, nop *NodeOperator) { + fmt.Printf("Adding NodeOperator to registry: %s\n", nop.Name) + nop.BindToRegistry(c.reg) + + nops, err := c.reg.GetNodeOperators(&bind.CallOpts{}) + if err != nil { + log.Printf("failed to GetNodeOperators: %s", err) + } + for _, n := range nops { + if n.Admin == nop.Admin { + log.Printf("NodeOperator with admin address %s already exists", n.Admin.Hex()) + return + } + } + + tx, err := c.reg.AddNodeOperators(c.env.Owner, []kcr.CapabilitiesRegistryNodeOperator{ + { + Admin: nop.Admin, + Name: nop.Name, + }, + }) + if err != nil { + log.Printf("failed to AddNodeOperators: %s", err) + } + + receipt := helpers.ConfirmTXMined(ctx, c.env.Ec, tx, c.env.ChainID) + nop.SetCapabilityRegistryIssuedID(receipt) +} + +// AddNodes takes a node operators nodes, along with a capability set, then configures the registry such that +// each node is assigned the same capability set. The registry will then know that each node supports each of the +// capabilities in the set. +// +// This is a simplified version of the actual implementation, which is more flexible. The actual implementation +// allows for the ability to add different capability sets to different nodes, _and_ lets you add nodes from different +// node operators to the same capability set. This is not yet implemented here. +// +// Note that the registry must already have the capability set added via `AddCapabilities`, you cannot +// add capabilities that the registry is not yet aware of. +// +// Note that in terms of the provisioning process, this is not the last step. A capability is only active once +// there is a DON servicing it. This is done via `AddDON`. +func (c *CapabilityRegistryProvisioner) AddNodes(ctx context.Context, nop *NodeOperator, donNames ...string) { + fmt.Printf("Adding nodes to registry for NodeOperator %s with DONs: %v\n", nop.Name, donNames) + var params []kcr.CapabilitiesRegistryNodeParams + for _, donName := range donNames { + don, exists := nop.DONs[donName] + if !exists { + log.Fatalf("DON with name %s does not exist in NodeOperator %s", donName, nop.Name) + } + capSet := don.CapabilitySet + for i, peer := range don.Peers { + node, innerErr := peerToNode(nop.id, peer) + if innerErr != nil { + panic(innerErr) + } + node.HashedCapabilityIds = capSet.HashedIDs(c.reg) + node.EncryptionPublicKey = [32]byte{2: byte(i + 1)} + fmt.Printf("Adding node %s to registry with capabilities: %s\n", peer.PeerID, capSet.IDs()) + params = append(params, node) + } + } + + err := c.testCallContract("addNodes", params) + PanicErr(err) + + tx, err := c.reg.AddNodes(c.env.Owner, params) + if err != nil { + log.Printf("failed to AddNodes: %s", err) + } + helpers.ConfirmTXMined(ctx, c.env.Ec, tx, c.env.ChainID) +} + +// AddDON takes a node operator then provisions a DON with the given capabilities. +// +// A DON is a group of nodes that all support the same capability set. This set can be a subset of the +// capabilities that the nodes support. In other words, each node within the node set can support +// a different, possibly overlapping, set of capabilities, but a DON is a subgroup of those nodes that all support +// the same set of capabilities. +// +// A node can belong to multiple DONs, but it must belong to one and only one workflow DON. +// +// A DON can be a capability DON or a workflow DON, or both. +// +// When you want to add solely a workflow DON, you should set `acceptsWorkflows` to true and +// `isPublic` to false. +// This means that the DON can service workflow requests and will not service external capability requests. +// +// If you want to add solely a capability DON, you should set `acceptsWorkflows` to false and `isPublic` to true. This means that the DON +// will service external capability requests and reject workflow requests. +// +// If you want to add a DON that services both capabilities and workflows, you should set both `acceptsWorkflows` and `isPublic` to true. +// +// Another important distinction is that DON can comprise of nodes from different node operators, but for now, we're keeping it simple and restricting it to a single node operator. We also hard code F to 1. +func (c *CapabilityRegistryProvisioner) AddDON(ctx context.Context, nop *NodeOperator, donName string, isPublic bool, acceptsWorkflows bool) { + fmt.Printf("Adding DON %s to registry for NodeOperator %s with isPublic: %t and acceptsWorkflows: %t\n", donName, nop.Name, isPublic, acceptsWorkflows) + don, exists := nop.DONs[donName] + if !exists { + log.Fatalf("DON with name %s does not exist in NodeOperator %s", donName, nop.Name) + } + configs := don.CapabilitySet.Configs(c.reg) + + err := c.testCallContract("addDON", don.MustGetPeerIDs(), configs, isPublic, acceptsWorkflows, don.F) + PanicErr(err) + + tx, err := c.reg.AddDON(c.env.Owner, don.MustGetPeerIDs(), configs, isPublic, acceptsWorkflows, don.F) + + if err != nil { + log.Printf("failed to AddDON: %s", err) + } + helpers.ConfirmTXMined(ctx, c.env.Ec, tx, c.env.ChainID) +} + +/* + * + * Capabilities + * + * + */ +const ( // Taken from https://github.com/smartcontractkit/chainlink/blob/29117850e9be1be1993dbf8f21cf13cbb6af9d24/core/capabilities/integration_tests/keystone_contracts_setup.go#L43 + CapabilityTypeTrigger = uint8(0) + CapabilityTypeAction = uint8(1) + CapabilityTypeConsensus = uint8(2) + CapabilityTypeTarget = uint8(3) +) + +type CapabillityProvisioner interface { + Config() kcr.CapabilitiesRegistryCapabilityConfiguration + Capability() kcr.CapabilitiesRegistryCapability + BindToRegistry(reg kcr.CapabilitiesRegistryInterface) + GetHashedCID() [32]byte +} + +type baseCapability struct { + registry kcr.CapabilitiesRegistryInterface + capability kcr.CapabilitiesRegistryCapability +} + +func (b *baseCapability) BindToRegistry(reg kcr.CapabilitiesRegistryInterface) { + b.registry = reg +} + +func (b *baseCapability) GetHashedCID() [32]byte { + if b.registry == nil { + panic(errors.New("registry not bound to capability, cannot get hashed capability ID")) + } + + return mustHashCapabilityID(b.registry, b.capability) +} + +func (b *baseCapability) GetID() string { + return fmt.Sprintf("%s@%s", b.capability.LabelledName, b.capability.Version) +} + +func (b *baseCapability) config(config *capabilitiespb.CapabilityConfig) kcr.CapabilitiesRegistryCapabilityConfiguration { + configBytes, err := proto.Marshal(config) + if err != nil { + panic(err) + } + + return kcr.CapabilitiesRegistryCapabilityConfiguration{ + Config: configBytes, + CapabilityId: b.GetHashedCID(), + } +} + +func (b *baseCapability) Capability() kcr.CapabilitiesRegistryCapability { + return b.capability +} + +type ConsensusCapability struct { + baseCapability +} + +var _ CapabillityProvisioner = &ConsensusCapability{} + +func (c *ConsensusCapability) Config() kcr.CapabilitiesRegistryCapabilityConfiguration { + // Note that this is hard-coded for now, we'll want to support more flexible configurations in the future + // for configuring consensus once it has more configuration options + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + } + + return c.config(config) +} + +// NewOCR3V1ConsensusCapability returns a new ConsensusCapability for OCR3 +func NewOCR3V1ConsensusCapability() *ConsensusCapability { + return &ConsensusCapability{ + baseCapability{ + capability: kcr.CapabilitiesRegistryCapability{ + LabelledName: "offchain_reporting", + Version: "1.0.0", + CapabilityType: CapabilityTypeConsensus, + }, + }, + } +} + +type TargetCapability struct { + baseCapability +} + +var _ CapabillityProvisioner = &TargetCapability{} + +func (t *TargetCapability) Config() kcr.CapabilitiesRegistryCapabilityConfiguration { + // Note that this is hard-coded for now, we'll want to support more flexible configurations in the future + // for configuring the target. This configuration is also specific to the write target + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTargetConfig{ + RemoteTargetConfig: &capabilitiespb.RemoteTargetConfig{ + RequestHashExcludedAttributes: []string{"signed_report.Signatures"}, + }, + }, + } + + return t.config(config) +} + +func NewEthereumGethTestnetV1WriteCapability() *TargetCapability { + return &TargetCapability{ + baseCapability{ + capability: kcr.CapabilitiesRegistryCapability{ + LabelledName: "write_geth-testnet", + Version: "1.0.0", + CapabilityType: CapabilityTypeTarget, + }, + }, + } +} + +type TriggerCapability struct { + baseCapability +} + +var _ CapabillityProvisioner = &TriggerCapability{} + +func (t *TriggerCapability) Config() kcr.CapabilitiesRegistryCapabilityConfiguration { + // Note that this is hard-coded for now, we'll want to support more flexible configurations in the future + // for configuring the trigger. This configuration is also possibly specific to the streams trigger. + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &capabilitiespb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(20 * time.Second), + RegistrationExpiry: durationpb.New(60 * time.Second), + MinResponsesToAggregate: uint32(1) + 1, // We've hardcoded F + 1 here + }, + }, + } + + return t.config(config) +} + +func NewStreamsTriggerV1Capability() *TriggerCapability { + return &TriggerCapability{ + baseCapability{ + capability: kcr.CapabilitiesRegistryCapability{ + LabelledName: "streams-trigger", + Version: "1.1.0", + CapabilityType: CapabilityTypeTrigger, + }, + }, + } +} + +func mustHashCapabilityID(reg kcr.CapabilitiesRegistryInterface, capability kcr.CapabilitiesRegistryCapability) [32]byte { + hashedCapabilityID, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, capability.LabelledName, capability.Version) + if err != nil { + panic(err) + } + return hashedCapabilityID +} + +/* + * + * Capability Sets + * + * + */ +type CapabilitySet []CapabillityProvisioner + +func NewCapabilitySet(capabilities ...CapabillityProvisioner) CapabilitySet { + if len(capabilities) == 0 { + log.Fatalf("No capabilities provided to NewCapabilitySet") + } + + return capabilities +} + +func MergeCapabilitySets(sets ...CapabilitySet) CapabilitySet { + var merged CapabilitySet + for _, set := range sets { + merged = append(merged, set...) + } + + return merged +} + +func (c *CapabilitySet) Capabilities() []kcr.CapabilitiesRegistryCapability { + definitions := make([]kcr.CapabilitiesRegistryCapability, 0, len(*c)) + for _, cap := range *c { + definitions = append(definitions, cap.Capability()) + } + + return definitions +} + +func (c *CapabilitySet) IDs() []string { + strings := make([]string, 0, len(*c)) + for _, cap := range *c { + strings = append(strings, fmt.Sprintf("%s@%s", cap.Capability().LabelledName, cap.Capability().Version)) + } + + return strings +} + +func (c *CapabilitySet) HashedIDs(reg kcr.CapabilitiesRegistryInterface) [][32]byte { + ids := make([][32]byte, 0, len(*c)) + for _, cap := range *c { + cap.BindToRegistry(reg) + ids = append(ids, cap.GetHashedCID()) + } + + return ids +} + +func (c *CapabilitySet) Configs(reg kcr.CapabilitiesRegistryInterface) []kcr.CapabilitiesRegistryCapabilityConfiguration { + configs := make([]kcr.CapabilitiesRegistryCapabilityConfiguration, 0, len(*c)) + for _, cap := range *c { + cap.BindToRegistry(reg) + configs = append(configs, cap.Config()) + } + + return configs +} + +/* + * + * Node Operator + * + * + */ + +// DON represents a Decentralized Oracle Network with a name, peers, and associated capabilities. +type DON struct { + F uint8 + Name string + Peers []peer + CapabilitySet CapabilitySet +} + +// MustGetPeerIDs retrieves the peer IDs for the DON. It panics if any error occurs. +func (d *DON) MustGetPeerIDs() [][32]byte { + ps, err := peers(d.Peers) + if err != nil { + panic(fmt.Errorf("failed to get peer IDs for DON %s: %w", d.Name, err)) + } + return ps +} + +// NodeOperator represents a node operator with administrative details and multiple DONs. +type NodeOperator struct { + Admin gethCommon.Address + Name string + DONs map[string]DON + + reg kcr.CapabilitiesRegistryInterface + // This ID is generated by the registry when the NodeOperator is added + id uint32 +} + +// NewNodeOperator creates a new NodeOperator with the provided admin address, name, and DONs. +func NewNodeOperator(admin gethCommon.Address, name string, dons map[string]DON) *NodeOperator { + return &NodeOperator{ + Admin: admin, + Name: name, + DONs: dons, + } +} + +func (n *NodeOperator) BindToRegistry(reg kcr.CapabilitiesRegistryInterface) { + n.reg = reg +} + +func (n *NodeOperator) SetCapabilityRegistryIssuedID(receipt *gethTypes.Receipt) uint32 { + if n.reg == nil { + panic(errors.New("registry not bound to node operator, cannot set ID")) + } + // We'll need more complex handling for multiple node operators + // since we'll need to handle log ordering + recLog, err := n.reg.ParseNodeOperatorAdded(*receipt.Logs[0]) + if err != nil { + panic(err) + } + + n.id = recLog.NodeOperatorId + return n.id +} + +func peerIDToB(peerID string) ([32]byte, error) { + var peerIDB ragetypes.PeerID + err := peerIDB.UnmarshalText([]byte(peerID)) + if err != nil { + return [32]byte{}, err + } + + return peerIDB, nil +} + +func peers(ps []peer) ([][32]byte, error) { + out := [][32]byte{} + for _, p := range ps { + b, err := peerIDToB(p.PeerID) + if err != nil { + return nil, err + } + + out = append(out, b) + } + + return out, nil +} + +func peerToNode(nopID uint32, p peer) (kcr.CapabilitiesRegistryNodeParams, error) { + peerIDB, err := peerIDToB(p.PeerID) + if err != nil { + return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert peerID: %w", err) + } + + sig := strings.TrimPrefix(p.Signer, "0x") + signerB, err := hex.DecodeString(sig) + if err != nil { + return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert signer: %w", err) + } + + var sigb [32]byte + copy(sigb[:], signerB) + + return kcr.CapabilitiesRegistryNodeParams{ + NodeOperatorId: nopID, + P2pId: peerIDB, + Signer: sigb, + }, nil +} + +// newCapabilityConfig returns a new capability config with the default config set as empty. +// Override the empty default config with functional options. +func newCapabilityConfig(opts ...func(*values.Map)) *capabilitiespb.CapabilityConfig { + dc := values.EmptyMap() + for _, opt := range opts { + opt(dc) + } + + return &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.ProtoMap(dc), + } +} diff --git a/core/scripts/keystone/src/88_contracts_helpers.go b/core/scripts/keystone/src/88_contracts_helpers.go new file mode 100644 index 00000000000..59bfeb68201 --- /dev/null +++ b/core/scripts/keystone/src/88_contracts_helpers.go @@ -0,0 +1,192 @@ +package src + +import ( + "context" + + "encoding/json" + "fmt" + "os" + "path/filepath" + + "github.com/ethereum/go-ethereum/common" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + capabilities_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability" + verifierContract "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" +) + +var ZeroAddress = common.Address{} + +type OnChainMetaSerialized struct { + OCR common.Address `json:"ocrContract"` + Forwarder common.Address `json:"forwarderContract"` + // The block number of the transaction that set the config on the OCR3 contract. We use this to replay blocks from this point on + // when we load the OCR3 job specs on the nodes. + SetConfigTxBlock uint64 `json:"setConfigTxBlock"` + + CapabilitiesRegistry common.Address `json:"CapabilitiesRegistry"` + Verifier common.Address `json:"VerifierContract"` + VerifierProxy common.Address `json:"VerifierProxy"` + // Stores the address that has been initialized by the proxy, if any + InitializedVerifierAddress common.Address `json:"InitializedVerifierAddress"` +} + +type onchainMeta struct { + OCR3 ocr3_capability.OCR3CapabilityInterface + Forwarder forwarder.KeystoneForwarderInterface + // The block number of the transaction that set the config on the OCR3 contract. We use this to replay blocks from this point on + // when we load the OCR3 job specs on the nodes. + SetConfigTxBlock uint64 + + CapabilitiesRegistry capabilities_registry.CapabilitiesRegistryInterface + Verifier verifierContract.VerifierInterface + VerifierProxy verifier_proxy.VerifierProxyInterface + InitializedVerifierAddress common.Address `json:"InitializedVerifierAddress"` +} + +func WriteOnchainMeta(o *onchainMeta, artefactsDir string) { + ensureArtefactsDir(artefactsDir) + + fmt.Println("Writing deployed contract addresses to file...") + serialzed := OnChainMetaSerialized{} + + if o.OCR3 != nil { + serialzed.OCR = o.OCR3.Address() + } + + if o.Forwarder != nil { + serialzed.Forwarder = o.Forwarder.Address() + } + + serialzed.SetConfigTxBlock = o.SetConfigTxBlock + serialzed.InitializedVerifierAddress = o.InitializedVerifierAddress + + if o.CapabilitiesRegistry != nil { + serialzed.CapabilitiesRegistry = o.CapabilitiesRegistry.Address() + } + + if o.Verifier != nil { + serialzed.Verifier = o.Verifier.Address() + } + + if o.VerifierProxy != nil { + serialzed.VerifierProxy = o.VerifierProxy.Address() + } + + jsonBytes, err := json.Marshal(serialzed) + PanicErr(err) + + err = os.WriteFile(deployedContractsFilePath(artefactsDir), jsonBytes, 0600) + PanicErr(err) +} + +func LoadOnchainMeta(artefactsDir string, env helpers.Environment) *onchainMeta { + hydrated := &onchainMeta{} + if !ContractsAlreadyDeployed(artefactsDir) { + fmt.Printf("No deployed contracts file found at %s\n", deployedContractsFilePath(artefactsDir)) + return hydrated + } + + jsonBytes, err := os.ReadFile(deployedContractsFilePath(artefactsDir)) + if err != nil { + fmt.Printf("Error reading deployed contracts file: %s\n", err) + return hydrated + } + + var s OnChainMetaSerialized + err = json.Unmarshal(jsonBytes, &s) + if err != nil { + return hydrated + } + + hydrated.SetConfigTxBlock = s.SetConfigTxBlock + if s.OCR != ZeroAddress { + if !contractExists(s.OCR, env) { + fmt.Printf("OCR contract at %s does not exist\n", s.OCR.Hex()) + } else { + ocr3, e := ocr3_capability.NewOCR3Capability(s.OCR, env.Ec) + PanicErr(e) + hydrated.OCR3 = ocr3 + } + } + + if s.Forwarder != ZeroAddress { + if !contractExists(s.Forwarder, env) { + fmt.Printf("Forwarder contract at %s does not exist\n", s.Forwarder.Hex()) + } else { + fwdr, e := forwarder.NewKeystoneForwarder(s.Forwarder, env.Ec) + PanicErr(e) + hydrated.Forwarder = fwdr + } + } + + if s.CapabilitiesRegistry != ZeroAddress { + if !contractExists(s.CapabilitiesRegistry, env) { + fmt.Printf("CapabilityRegistry contract at %s does not exist\n", s.CapabilitiesRegistry.Hex()) + } else { + cr, e := capabilities_registry.NewCapabilitiesRegistry(s.CapabilitiesRegistry, env.Ec) + PanicErr(e) + hydrated.CapabilitiesRegistry = cr + } + } + + hydrated.InitializedVerifierAddress = s.InitializedVerifierAddress + + if s.Verifier != ZeroAddress { + if !contractExists(s.Verifier, env) { + fmt.Printf("Verifier contract at %s does not exist\n", s.Verifier.Hex()) + hydrated.InitializedVerifierAddress = ZeroAddress + } else { + verifier, e := verifierContract.NewVerifier(s.Verifier, env.Ec) + PanicErr(e) + hydrated.Verifier = verifier + } + } + + if s.VerifierProxy != ZeroAddress { + if !contractExists(s.VerifierProxy, env) { + fmt.Printf("VerifierProxy contract at %s does not exist\n", s.VerifierProxy.Hex()) + hydrated.InitializedVerifierAddress = ZeroAddress + } else { + verifierProxy, e := verifier_proxy.NewVerifierProxy(s.VerifierProxy, env.Ec) + PanicErr(e) + hydrated.VerifierProxy = verifierProxy + } + } + + blkNum, err := env.Ec.BlockNumber(context.Background()) + PanicErr(err) + + if s.SetConfigTxBlock > blkNum { + fmt.Printf("Stale SetConfigTxBlock: %d, current block number: %d\n", s.SetConfigTxBlock, blkNum) + hydrated.SetConfigTxBlock = 0 + } + + return hydrated +} + +func ContractsAlreadyDeployed(artefactsDir string) bool { + _, err := os.Stat(artefactsDir) + if err != nil { + return false + } + + _, err = os.Stat(deployedContractsFilePath(artefactsDir)) + + return err == nil +} + +func deployedContractsFilePath(artefactsDir string) string { + return filepath.Join(artefactsDir, deployedContractsJSON) +} + +func contractExists(address common.Address, env helpers.Environment) bool { + byteCode, err := env.Ec.CodeAt(context.Background(), address, nil) + if err != nil { + return false + } + return len(byteCode) != 0 +} diff --git a/core/scripts/keystone/src/88_gen_jobspecs.go b/core/scripts/keystone/src/88_gen_jobspecs.go deleted file mode 100644 index e88833c9865..00000000000 --- a/core/scripts/keystone/src/88_gen_jobspecs.go +++ /dev/null @@ -1,91 +0,0 @@ -package src - -import ( - "fmt" - "path/filepath" - "strconv" - "strings" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" -) - -type spec []string - -func (s spec) ToString() string { - return strings.Join(s, "\n") -} - -type hostSpec struct { - spec spec - host string -} - -type donHostSpec struct { - bootstrap hostSpec - oracles []hostSpec -} - -func genSpecs( - pubkeysPath string, - nodeListPath string, - templatesDir string, - chainID int64, - p2pPort int64, - ocrConfigContractAddress string, -) donHostSpec { - nodes := downloadNodeAPICredentials(nodeListPath) - nca := downloadNodePubKeys(nodeListPath, chainID, pubkeysPath) - bootstrapNode := nca[0] - - bootstrapSpecLines, err := readLines(filepath.Join(templatesDir, bootstrapSpecTemplate)) - helpers.PanicErr(err) - bootHost := nodes[0].remoteURL.Hostname() - bootstrapSpecLines = replacePlaceholders( - bootstrapSpecLines, - chainID, p2pPort, - ocrConfigContractAddress, bootHost, - bootstrapNode, bootstrapNode, - ) - bootstrap := hostSpec{bootstrapSpecLines, bootHost} - - oracleSpecLinesTemplate, err := readLines(filepath.Join(templatesDir, oracleSpecTemplate)) - helpers.PanicErr(err) - oracles := []hostSpec{} - for i := 1; i < len(nodes); i++ { - oracleSpecLines := oracleSpecLinesTemplate - oracleSpecLines = replacePlaceholders( - oracleSpecLines, - chainID, p2pPort, - ocrConfigContractAddress, bootHost, - bootstrapNode, nca[i], - ) - oracles = append(oracles, hostSpec{oracleSpecLines, nodes[i].remoteURL.Host}) - } - - return donHostSpec{ - bootstrap: bootstrap, - oracles: oracles, - } -} - -func replacePlaceholders( - lines []string, - - chainID, p2pPort int64, - contractAddress, bootHost string, - boot, node changeset.NodeKeys, -) (output []string) { - chainIDStr := strconv.FormatInt(chainID, 10) - bootstrapper := fmt.Sprintf("%s@%s:%d", boot.P2PPeerID, bootHost, p2pPort) - for _, l := range lines { - l = strings.Replace(l, "{{ chain_id }}", chainIDStr, 1) - l = strings.Replace(l, "{{ ocr_config_contract_address }}", contractAddress, 1) - l = strings.Replace(l, "{{ transmitter_id }}", node.EthAddress, 1) - l = strings.Replace(l, "{{ ocr_key_bundle_id }}", node.OCR2BundleID, 1) - l = strings.Replace(l, "{{ aptos_key_bundle_id }}", node.AptosBundleID, 1) - l = strings.Replace(l, "{{ bootstrapper_p2p_id }}", bootstrapper, 1) - output = append(output, l) - } - return -} diff --git a/core/scripts/keystone/src/88_gen_jobspecs_test.go b/core/scripts/keystone/src/88_gen_jobspecs_test.go deleted file mode 100644 index 7af11646c4e..00000000000 --- a/core/scripts/keystone/src/88_gen_jobspecs_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package src - -import ( - "fmt" - "testing" - - "github.com/gkampitakis/go-snaps/snaps" -) - -func (d *donHostSpec) ToString() string { - var result string - result += "Bootstrap:\n" - result += "Host: " + d.bootstrap.host + "\n" - result += d.bootstrap.spec.ToString() - result += "\n\nOracles:\n" - for i, oracle := range d.oracles { - if i != 0 { - result += "--------------------------------\n" - } - result += fmt.Sprintf("Oracle %d:\n", i) - result += "Host: " + oracle.host + "\n" - result += oracle.spec.ToString() - result += "\n\n" - } - return result -} - -func TestGenSpecs(t *testing.T) { - pubkeysPath := "./testdata/PublicKeys.json" - nodeListPath := "./testdata/NodeList.txt" - chainID := int64(11155111) - p2pPort := int64(6690) - contractAddress := "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" - - specs := genSpecs(pubkeysPath, nodeListPath, "../templates", chainID, p2pPort, contractAddress) - snaps.MatchSnapshot(t, specs.ToString()) -} diff --git a/core/scripts/keystone/src/88_gen_ocr3_config.go b/core/scripts/keystone/src/88_gen_ocr3_config.go deleted file mode 100644 index 94217b07f4e..00000000000 --- a/core/scripts/keystone/src/88_gen_ocr3_config.go +++ /dev/null @@ -1,20 +0,0 @@ -package src - -import ( - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/deployment" - ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" -) - -func mustReadConfig(fileName string) (output ksdeploy.TopLevelConfigSource) { - return mustParseJSON[ksdeploy.TopLevelConfigSource](fileName) -} - -func generateOCR3Config(nodeList string, configFile string, chainID int64, pubKeysPath string) ksdeploy.OCR3OnchainConfig { - topLevelCfg := mustReadConfig(configFile) - cfg := topLevelCfg.OracleConfig - nca := downloadNodePubKeys(nodeList, chainID, pubKeysPath) - c, err := ksdeploy.GenerateOCR3Config(cfg, nca, deployment.XXXGenerateTestOCRSecrets()) - helpers.PanicErr(err) - return c -} diff --git a/core/scripts/keystone/src/88_gen_ocr3_config_test.go b/core/scripts/keystone/src/88_gen_ocr3_config_test.go deleted file mode 100644 index 10cdc07b204..00000000000 --- a/core/scripts/keystone/src/88_gen_ocr3_config_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package src - -import ( - "errors" - "testing" - - "github.com/gkampitakis/go-snaps/match" - "github.com/gkampitakis/go-snaps/snaps" -) - -func TestGenerateOCR3Config(t *testing.T) { - // Generate OCR3 config - config := generateOCR3Config(".cache/NodeList.txt", "./testdata/SampleConfig.json", 11155111, "./testdata/PublicKeys.json") - - matchOffchainConfig := match.Custom("OffchainConfig", func(s any) (any, error) { - // coerce the value to a string - s, ok := s.(string) - if !ok { - return nil, errors.New("offchain config is not a string") - } - - // if the string is not empty - if s == "" { - return nil, errors.New("offchain config is empty") - } - - return "", nil - }) - - snaps.MatchJSON(t, config, matchOffchainConfig) -} diff --git a/core/scripts/keystone/src/88_jobspecs_helpers.go b/core/scripts/keystone/src/88_jobspecs_helpers.go new file mode 100644 index 00000000000..0e6cc3a043a --- /dev/null +++ b/core/scripts/keystone/src/88_jobspecs_helpers.go @@ -0,0 +1,53 @@ +package src + +import ( + "fmt" +) + +type OCRSpec struct { + ContractID string +} + +type BootSpec struct { + ContractID string +} + +type WorkflowSpec struct { + WorkflowID string +} + +type JobSpec struct { + ID string + Name string + BootstrapSpec BootSpec + OffChainReporting2OracleSpec OCRSpec + WorkflowSpec WorkflowSpec +} + +func upsertJob(api *nodeAPI, jobSpecName string, jobSpecStr string) { + jobsResp := api.mustExec(api.methods.ListJobs) + jobs := mustJSON[[]JobSpec](jobsResp) + for _, job := range *jobs { + if job.Name == jobSpecName { + fmt.Printf("Job already exists: %s, replacing..\n", jobSpecName) + api.withArg(job.ID).mustExec(api.methods.DeleteJob) + break + } + } + + fmt.Printf("Deploying jobspec: %s\n", jobSpecName) + _, err := api.withArg(jobSpecStr).exec(api.methods.CreateJob) + if err != nil { + panic(fmt.Sprintf("Failed to deploy job spec: %s Error: %s", jobSpecStr, err)) + } +} + +func clearJobs(api *nodeAPI) { + jobsResp := api.mustExec(api.methods.ListJobs) + jobs := mustJSON[[]JobSpec](jobsResp) + for _, job := range *jobs { + fmt.Printf("Deleting job: %s\n", job.Name) + api.withArg(job.ID).mustExec(api.methods.DeleteJob) + } + fmt.Println("All jobs have been deleted.") +} diff --git a/core/scripts/keystone/src/88_ocr_helpers.go b/core/scripts/keystone/src/88_ocr_helpers.go new file mode 100644 index 00000000000..7cdfd72ca52 --- /dev/null +++ b/core/scripts/keystone/src/88_ocr_helpers.go @@ -0,0 +1,69 @@ +package src + +import ( + "encoding/hex" + + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/libocr/offchainreporting2/types" + + ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" +) + +func ocrConfToContractConfig(ocrConf ksdeploy.OCR3OnchainConfig, configCount uint32) types.ContractConfig { + cc := types.ContractConfig{ + Signers: convertByteSliceToOnchainPublicKeys(ocrConf.Signers), + Transmitters: convertAddressesToAccounts(ocrConf.Transmitters), + F: ocrConf.F, + OnchainConfig: ocrConf.OnchainConfig, + OffchainConfigVersion: ocrConf.OffchainConfigVersion, + OffchainConfig: ocrConf.OffchainConfig, + ConfigCount: uint64(configCount), + } + return cc +} + +func mercuryOCRConfigToContractConfig(ocrConf MercuryOCR2Config, configCount uint32) types.ContractConfig { + cc := types.ContractConfig{ + Signers: convertAddressesToOnchainPublicKeys(ocrConf.Signers), + Transmitters: convertBytes32sToAccounts(ocrConf.Transmitters), + F: ocrConf.F, + OnchainConfig: ocrConf.OnchainConfig, + OffchainConfigVersion: ocrConf.OffchainConfigVersion, + OffchainConfig: ocrConf.OffchainConfig, + ConfigCount: uint64(configCount), + } + + return cc +} + +func convertAddressesToOnchainPublicKeys(addresses []common.Address) []types.OnchainPublicKey { + keys := make([]types.OnchainPublicKey, len(addresses)) + for i, addr := range addresses { + keys[i] = types.OnchainPublicKey(addr.Bytes()) + } + return keys +} + +func convertAddressesToAccounts(addresses []common.Address) []types.Account { + accounts := make([]types.Account, len(addresses)) + for i, addr := range addresses { + accounts[i] = types.Account(addr.Hex()) + } + return accounts +} + +func convertBytes32sToAccounts(bs [][32]byte) []types.Account { + accounts := make([]types.Account, len(bs)) + for i, b := range bs { + accounts[i] = types.Account(hex.EncodeToString(b[:])) + } + return accounts +} + +func convertByteSliceToOnchainPublicKeys(bs [][]byte) []types.OnchainPublicKey { + keys := make([]types.OnchainPublicKey, len(bs)) + for i, b := range bs { + keys[i] = types.OnchainPublicKey(b) + } + return keys +} diff --git a/core/scripts/keystone/src/99_app.go b/core/scripts/keystone/src/99_app.go index 6e59932aa71..29164959bec 100644 --- a/core/scripts/keystone/src/99_app.go +++ b/core/scripts/keystone/src/99_app.go @@ -1,31 +1,389 @@ package src import ( + "bytes" + "context" + "encoding/json" + "errors" "flag" "io" + "net/http" + "net/url" + "reflect" + "runtime" + "strings" + "sync" + "time" "github.com/urfave/cli" + "go.uber.org/zap/zapcore" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + "github.com/smartcontractkit/chainlink/v2/core/cmd" clcmd "github.com/smartcontractkit/chainlink/v2/core/cmd" + "github.com/smartcontractkit/chainlink/v2/core/logger" + clsessions "github.com/smartcontractkit/chainlink/v2/core/sessions" ) -func newApp(n *node, writer io.Writer) (*clcmd.Shell, *cli.App) { +// Package-level cache and mutex +var ( + nodeAPICache = make(map[string]*nodeAPI) + cacheMutex = &sync.Mutex{} +) + +func newApp(n NodeWithCreds, writer io.Writer) (*clcmd.Shell, *cli.App) { + loggingCfg := logger.Config{ + LogLevel: zapcore.InfoLevel, + JsonConsole: true, + } + logger, closeLggr := loggingCfg.New() + u, err := url.Parse(n.RemoteURL.String()) + PanicErr(err) + + clientOpts := clcmd.ClientOpts{RemoteNodeURL: *u, InsecureSkipVerify: true} + sr := clsessions.SessionRequest{Email: n.APILogin, Password: n.APIPassword} + + // Set the log level to error for the HTTP client, we don't care about + // the ssl warnings it emits for CRIB + logger.SetLogLevel(zapcore.ErrorLevel) + cookieAuth := cmd.NewSessionCookieAuthenticator( + clientOpts, + &cmd.MemoryCookieStore{}, + logger, + ) + + http := NewRetryableAuthenticatedHTTPClient(logger, clientOpts, cookieAuth, sr) + // Set the log level back to info for the shell + logger.SetLogLevel(zapcore.InfoLevel) client := &clcmd.Shell{ - Renderer: clcmd.RendererJSON{Writer: writer}, - AppFactory: clcmd.ChainlinkAppFactory{}, - KeyStoreAuthenticator: clcmd.TerminalKeyStoreAuthenticator{Prompter: n}, - FallbackAPIInitializer: clcmd.NewPromptingAPIInitializer(n), - Runner: clcmd.ChainlinkRunner{}, - PromptingSessionRequestBuilder: clcmd.NewPromptingSessionRequestBuilder(n), - ChangePasswordPrompter: clcmd.NewChangePasswordPrompter(), - PasswordPrompter: clcmd.NewPasswordPrompter(), + Logger: logger, + Renderer: clcmd.RendererJSON{Writer: writer}, + AppFactory: clcmd.ChainlinkAppFactory{}, + Runner: clcmd.ChainlinkRunner{}, + HTTP: http, + + CloseLogger: closeLggr, } app := clcmd.NewApp(client) - fs := flag.NewFlagSet("blah", flag.ContinueOnError) - fs.String("remote-node-url", n.url.String(), "") - helpers.PanicErr(app.Before(cli.NewContext(nil, fs, nil))) - // overwrite renderer since it's set to stdout after Before() is called - client.Renderer = clcmd.RendererJSON{Writer: writer} return client, app } + +type nodeAPI struct { + methods *cmd.Shell + app *cli.App + output *bytes.Buffer + fs *flag.FlagSet + clientMethod func(*cli.Context) error + logger logger.Logger +} + +func newNodeAPI(n NodeWithCreds) *nodeAPI { + // Create a unique key for the cache + key := n.RemoteURL.String() + + // Check if the nodeAPI exists in the cache + cacheMutex.Lock() + if api, exists := nodeAPICache[key]; exists { + cacheMutex.Unlock() + return api + } + cacheMutex.Unlock() + + output := &bytes.Buffer{} + methods, app := newApp(n, output) + + api := &nodeAPI{ + output: output, + methods: methods, + app: app, + fs: flag.NewFlagSet("test", flag.ContinueOnError), + logger: methods.Logger.Named("NodeAPI"), + } + + // Store the new nodeAPI in the cache + cacheMutex.Lock() + nodeAPICache[key] = api + cacheMutex.Unlock() + + return api +} + +func (c *nodeAPI) withArg(arg string) *nodeAPI { + err := c.fs.Parse([]string{arg}) + helpers.PanicErr(err) + + return c +} + +func (c *nodeAPI) withArgs(args ...string) *nodeAPI { + err := c.fs.Parse(args) + helpers.PanicErr(err) + + return c +} + +func (c *nodeAPI) withFlags(clientMethod func(*cli.Context) error, applyFlags func(*flag.FlagSet)) *nodeAPI { + flagSetApplyFromAction(clientMethod, c.fs, "") + applyFlags(c.fs) + + c.clientMethod = clientMethod + + return c +} + +func (c *nodeAPI) exec(clientMethod ...func(*cli.Context) error) ([]byte, error) { + if len(clientMethod) > 1 { + PanicErr(errors.New("Only one client method allowed")) + } + + defer c.output.Reset() + defer func() { + c.fs = flag.NewFlagSet("test", flag.ContinueOnError) + c.clientMethod = nil + }() + + if c.clientMethod == nil { + c.clientMethod = clientMethod[0] + } + + retryCount := 3 + for i := 0; i < retryCount; i++ { + c.logger.Tracew("Attempting API request", "attempt", i+1, "maxAttempts", retryCount) + c.output.Reset() + ctx := cli.NewContext(c.app, c.fs, nil) + err := c.clientMethod(ctx) + + if err == nil { + c.logger.Tracew("API request completed successfully", "attempt", i+1) + return c.output.Bytes(), nil + } + + if !strings.Contains(err.Error(), "invalid character '<' looking for beginning of value") { + c.logger.Tracew("API request failed with non-retriable error", + "attempt", i+1, + "err", err, + ) + return nil, err + } + + c.logger.Warnw("Encountered 504 gateway error during API request, retrying", + "attempt", i+1, + "maxAttempts", retryCount, + "err", err, + ) + + if i == retryCount-1 { + c.logger.Error("Failed to complete API request after all retry attempts") + return nil, err + } + + c.logger.Tracew("Waiting before retry attempt", + "attempt", i+1, + "waitTime", "1s", + ) + time.Sleep(3 * time.Second) + } + + return nil, errors.New("API request failed after retries") +} + +func (c *nodeAPI) mustExec(clientMethod ...func(*cli.Context) error) []byte { + bytes, err := c.exec(clientMethod...) + helpers.PanicErr(err) + return bytes +} + +// flagSetApplyFromAction applies the flags from action to the flagSet. +// +// `parentCommand` will filter the app commands and only applies the flags if the command/subcommand has a parent with that name, if left empty no filtering is done +// +// Taken from: https://github.com/smartcontractkit/chainlink/blob/develop/core/cmd/shell_test.go#L590 +func flagSetApplyFromAction(action interface{}, flagSet *flag.FlagSet, parentCommand string) { + cliApp := cmd.Shell{} + app := cmd.NewApp(&cliApp) + + foundName := parentCommand == "" + actionFuncName := getFuncName(action) + + for _, command := range app.Commands { + flags := recursiveFindFlagsWithName(actionFuncName, command, parentCommand, foundName) + + for _, flag := range flags { + flag.Apply(flagSet) + } + } +} + +func recursiveFindFlagsWithName(actionFuncName string, command cli.Command, parent string, foundName bool) []cli.Flag { + if command.Action != nil { + if actionFuncName == getFuncName(command.Action) && foundName { + return command.Flags + } + } + + for _, subcommand := range command.Subcommands { + if !foundName { + foundName = strings.EqualFold(subcommand.Name, parent) + } + + found := recursiveFindFlagsWithName(actionFuncName, subcommand, parent, foundName) + if found != nil { + return found + } + } + return nil +} + +func getFuncName(i interface{}) string { + return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() +} + +func mustJSON[T any](bytes []byte) *T { + typedPayload := new(T) + err := json.Unmarshal(bytes, typedPayload) + if err != nil { + PanicErr(err) + } + return typedPayload +} + +type retryableAuthenticatedHTTPClient struct { + client cmd.HTTPClient + logger logger.Logger +} + +func NewRetryableAuthenticatedHTTPClient(lggr logger.Logger, clientOpts clcmd.ClientOpts, cookieAuth cmd.CookieAuthenticator, sessionRequest clsessions.SessionRequest) cmd.HTTPClient { + return &retryableAuthenticatedHTTPClient{ + client: cmd.NewAuthenticatedHTTPClient(lggr, clientOpts, cookieAuth, sessionRequest), + logger: lggr.Named("RetryableAuthenticatedHTTPClient"), + } +} + +func logBody(body io.Reader) (string, io.Reader) { + if body == nil { + return "", nil + } + + var buf bytes.Buffer + tee := io.TeeReader(body, &buf) + bodyBytes, _ := io.ReadAll(tee) + return string(bodyBytes), bytes.NewReader(buf.Bytes()) +} + +func logResponse(logger logger.Logger, resp *http.Response) { + if resp == nil { + logger.Trace("Response was nil") + return + } + + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + logger.Errorw("Failed to read response body for logging", "err", err) + return + } + // Replace the body so it can be read again by the caller + resp.Body = io.NopCloser(bytes.NewReader(bodyBytes)) + + logger.Tracew("Response details", + "statusCode", resp.StatusCode, + "status", resp.Status, + "headers", resp.Header, + "body", string(bodyBytes), + ) +} + +func (h *retryableAuthenticatedHTTPClient) Get(ctx context.Context, path string, headers ...map[string]string) (*http.Response, error) { + h.logger.Tracew("Making GET request", + "path", path, + "headers", headers, + ) + return h.doRequestWithRetry(ctx, func() (*http.Response, error) { + return h.client.Get(ctx, path, headers...) + }) +} + +func (h *retryableAuthenticatedHTTPClient) Post(ctx context.Context, path string, body io.Reader) (*http.Response, error) { + bodyStr, newBody := logBody(body) + h.logger.Tracew("Making POST request", + "path", path, + "body", bodyStr, + ) + return h.doRequestWithRetry(ctx, func() (*http.Response, error) { + return h.client.Post(ctx, path, newBody) + }) +} + +func (h *retryableAuthenticatedHTTPClient) Put(ctx context.Context, path string, body io.Reader) (*http.Response, error) { + bodyStr, newBody := logBody(body) + h.logger.Tracew("Making PUT request", + "path", path, + "body", bodyStr, + ) + return h.doRequestWithRetry(ctx, func() (*http.Response, error) { + return h.client.Put(ctx, path, newBody) + }) +} + +func (h *retryableAuthenticatedHTTPClient) Patch(ctx context.Context, path string, body io.Reader, headers ...map[string]string) (*http.Response, error) { + bodyStr, newBody := logBody(body) + h.logger.Tracew("Making PATCH request", + "path", path, + "headers", headers, + "body", bodyStr, + ) + return h.doRequestWithRetry(ctx, func() (*http.Response, error) { + return h.client.Patch(ctx, path, newBody, headers...) + }) +} + +func (h *retryableAuthenticatedHTTPClient) Delete(ctx context.Context, path string) (*http.Response, error) { + h.logger.Tracew("Making DELETE request", + "path", path, + ) + return h.doRequestWithRetry(ctx, func() (*http.Response, error) { + return h.client.Delete(ctx, path) + }) +} + +func (h *retryableAuthenticatedHTTPClient) doRequestWithRetry(_ context.Context, req func() (*http.Response, error)) (*http.Response, error) { + retryCount := 3 + for i := 0; i < retryCount; i++ { + h.logger.Tracew("Attempting request", "attempt", i+1, "maxAttempts", retryCount) + + response, err := req() + logResponse(h.logger, response) + + if err == nil || !strings.Contains(err.Error(), "invalid character '<' looking for beginning of value") { + if err != nil { + h.logger.Warn("Request completed with error", + "attempt", i+1, + "err", err, + ) + } else { + h.logger.Tracew("Request completed successfully", + "attempt", i+1, + "statusCode", response.StatusCode, + ) + } + return response, err + } + + h.logger.Warnw("Encountered 504 error during request, retrying", + "attempt", i+1, + "maxAttempts", retryCount, + "err", err, + ) + + if i == retryCount-1 { + h.logger.Error("Failed to complete request after all retry attempts") + return response, err + } + + h.logger.Tracew("Waiting before retry attempt", + "attempt", i+1, + "waitTime", "1s", + ) + time.Sleep(1 * time.Second) + } + return nil, errors.New("request failed after retries") +} diff --git a/core/scripts/keystone/src/99_crib_client.go b/core/scripts/keystone/src/99_crib_client.go index ebf9f9ee955..1a38cafe9bb 100644 --- a/core/scripts/keystone/src/99_crib_client.go +++ b/core/scripts/keystone/src/99_crib_client.go @@ -4,7 +4,7 @@ package src import ( "fmt" - "net/url" + "sort" "strings" ) @@ -12,12 +12,24 @@ type CribClient struct { k8sClient *K8sClient } -type CLNodeCredentials struct { - URL *url.URL - PodName string - Username string - Password string - NodePassword string +// SimpleURL lets us marshal a URL with only the fields we need. +type SimpleURL struct { + Scheme string `json:"scheme"` + Host string `json:"host"` + Path string `json:"path"` +} + +func (s SimpleURL) String() string { + return fmt.Sprintf("%s://%s%s", s.Scheme, s.Host, s.Path) +} + +type NodeWithCreds struct { + URL SimpleURL + RemoteURL SimpleURL + ServiceName string + APILogin string + APIPassword string + KeystorePassword string } func NewCribClient() *CribClient { @@ -27,35 +39,44 @@ func NewCribClient() *CribClient { } } -func (m *CribClient) GetCLNodeCredentials() ([]CLNodeCredentials, error) { - fmt.Println("Getting CL node pods with config maps...") - pods, err := m.k8sClient.GetPodsWithConfigMap() +func (m *CribClient) getCLNodes() ([]NodeWithCreds, error) { + fmt.Println("Getting CL node deployments with config maps...") + deployments, err := m.k8sClient.GetDeploymentsWithConfigMap() if err != nil { return nil, err } - clNodeCredentials := []CLNodeCredentials{} + nodes := []NodeWithCreds{} - for _, pod := range pods { - apiCredentials := pod.ConfigMap.Data["apicredentials"] + for _, deployment := range deployments { + apiCredentials := deployment.ConfigMap.Data["apicredentials"] splitCreds := strings.Split(strings.TrimSpace(apiCredentials), "\n") username := splitCreds[0] password := splitCreds[1] - nodePassword := pod.ConfigMap.Data["node-password"] - url, err := url.Parse("https://" + pod.Host) - if err != nil { - return nil, err + keystorePassword := deployment.ConfigMap.Data["node-password"] + url := SimpleURL{ + Scheme: "https", + Host: deployment.Host, + Path: "", } - clNodeCredential := CLNodeCredentials{ - URL: url, - PodName: pod.Name, - Username: username, - Password: password, - NodePassword: nodePassword, + node := NodeWithCreds{ + // We dont handle both in-cluster and out-of-cluster deployments + // Hence why both URL and RemoteURL are the same + URL: url, + RemoteURL: url, + ServiceName: deployment.ServiceName, + APILogin: username, + APIPassword: password, + KeystorePassword: keystorePassword, } - clNodeCredentials = append(clNodeCredentials, clNodeCredential) + nodes = append(nodes, node) } - return clNodeCredentials, nil + // Sort nodes by URL + sort.Slice(nodes, func(i, j int) bool { + return nodes[i].URL.Host < nodes[j].URL.Host + }) + + return nodes, nil } diff --git a/core/scripts/keystone/src/99_fetch_keys.go b/core/scripts/keystone/src/99_fetch_keys.go index 056769dc714..63e191a1234 100644 --- a/core/scripts/keystone/src/99_fetch_keys.go +++ b/core/scripts/keystone/src/99_fetch_keys.go @@ -1,230 +1,271 @@ package src import ( - "bytes" "encoding/json" "errors" - "flag" "fmt" "os" - "sort" "strings" "github.com/urfave/cli" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func downloadNodePubKeys(nodeList string, chainID int64, pubKeysPath string) []changeset.NodeKeys { - // Check if file exists already, and if so, return the keys - if _, err := os.Stat(pubKeysPath); err == nil { - fmt.Println("Loading existing public keys at:", pubKeysPath) - return mustParseJSON[[]changeset.NodeKeys](pubKeysPath) - } - - nodes := downloadNodeAPICredentials(nodeList) - nodesKeys := mustFetchNodesKeys(chainID, nodes) +// NodeSet represents a set of nodes with associated metadata. +// NodeKeys are indexed by the same order as Nodes. +type NodeSet struct { + Name string + Prefix string + Nodes []NodeWithCreds + NodeKeys []NodeKeys +} - marshalledNodeKeys, err := json.MarshalIndent(nodesKeys, "", " ") - if err != nil { - panic(err) - } - err = os.WriteFile(pubKeysPath, marshalledNodeKeys, 0600) - if err != nil { - panic(err) - } - fmt.Println("Keystone OCR2 public keys have been saved to:", pubKeysPath) +var ( + WorkflowNodeSetName = "workflow" + WorkflowNodeSetPrefix = "ks-wf-" + StreamsTriggerNodeSetName = "streams-trigger" + StreamsTriggerNodeSetPrefix = "ks-str-trig-" +) - return nodesKeys +// NodeSets holds the two NodeSets: Workflow and StreamsTrigger. +type NodeSets struct { + Workflow NodeSet + StreamsTrigger NodeSet } -// downloadNodeAPICredentials downloads the node API credentials, or loads them from disk if they already exist -// -// The nodes are sorted by URL. In the case of crib, the bootstrap node is the first node in the list. -func downloadNodeAPICredentials(nodeListPath string) []*node { - if _, err := os.Stat(nodeListPath); err == nil { - fmt.Println("Loading existing node host list at:", nodeListPath) - nodesList := mustReadNodesList(nodeListPath) - return nodesList +func downloadNodeSets(chainID int64, nodeSetPath string, nodeSetSize int) NodeSets { + if _, err := os.Stat(nodeSetPath); err == nil { + fmt.Println("Loading existing nodesets at:", nodeSetPath) + nodeSets := mustReadJSON[NodeSets](nodeSetPath) + return nodeSets } fmt.Println("Connecting to Kubernetes to fetch node credentials...") crib := NewCribClient() - clNodesWithCreds, err := crib.GetCLNodeCredentials() - - if err != nil { - panic(err) + nodes, err := crib.getCLNodes() + PanicErr(err) + + totalNodes := len(nodes) + // Workflow and StreamsTrigger nodeSets should have the same number of nodes + // hence we need at least 2 * nodeSetSize nodes + requiredNodes := nodeSetSize * 2 + if totalNodes < requiredNodes { + panic(fmt.Errorf("not enough nodes to populate both nodeSets: required %d, got %d", requiredNodes, totalNodes)) } - nodesList := clNodesWithCredsToNodes(clNodesWithCreds) - err = writeNodesList(nodeListPath, nodesList) - if err != nil { - panic(err) - } - if len(nodesList) == 0 { - panic("No nodes found") + nodeSets := NodeSets{ + Workflow: NodeSet{ + Name: WorkflowNodeSetName, + Prefix: WorkflowNodeSetPrefix, + Nodes: nodes[:nodeSetSize], + }, + StreamsTrigger: NodeSet{ + Name: StreamsTriggerNodeSetName, + Prefix: StreamsTriggerNodeSetPrefix, + Nodes: nodes[nodeSetSize : nodeSetSize*2], + }, } - return nodesList + + nodeSets.Workflow.NodeKeys = mustFetchNodeKeys(chainID, nodeSets.Workflow.Nodes, true) + nodeSets.StreamsTrigger.NodeKeys = mustFetchNodeKeys(chainID, nodeSets.StreamsTrigger.Nodes, false) + mustWriteJSON(nodeSetPath, nodeSets) + + return nodeSets } -func clNodesWithCredsToNodes(clNodesWithCreds []CLNodeCredentials) []*node { - nodes := []*node{} - for _, cl := range clNodesWithCreds { - n := node{ - url: cl.URL, - password: cl.Password, - login: cl.Username, - } - nodes = append(nodes, &n) - } +// NodeKeys represents the keys for a single node. +// If there are multiple OCR2KBs or OCR2AptosKBs, only the first one is used. +type NodeKeys struct { + AptosAccount string `json:"AptosAccount"` + EthAddress string `json:"EthAddress"` + P2PPeerID string `json:"P2PPeerID"` + CSAPublicKey string `json:"CSAPublicKey"` + OCR2KBTrimmed + OCR2AptosKBTrimmed +} - // sort nodes by URL - sort.Slice(nodes, func(i, j int) bool { - return nodes[i].url.String() < nodes[j].url.String() - }) - return nodes +// This is an OCR key bundle with the prefixes on each respective key +// trimmed off +type OCR2KBTrimmed struct { + OCR2BundleID string `json:"OCR2BundleID"` // used only in job spec + OCR2OnchainPublicKey string `json:"OCR2OnchainPublicKey"` // ocr2on_evm_ + OCR2OffchainPublicKey string `json:"OCR2OffchainPublicKey"` // ocr2off_evm_ + OCR2ConfigPublicKey string `json:"OCR2ConfigPublicKey"` // ocr2cfg_evm_ } -type ocr2Bundle struct { - ID string `json:"id"` - ChainType string `json:"chainType"` - OnchainPublicKey string `json:"onchainPublicKey"` - OffchainPublicKey string `json:"offchainPublicKey"` - ConfigPublicKey string `json:"configPublicKey"` +// This is an Aptos key bundle with the prefixes on each respective key +// trimmed off +type OCR2AptosKBTrimmed struct { + AptosBundleID string `json:"AptosBundleID"` + AptosOnchainPublicKey string `json:"AptosOnchainPublicKey"` // ocr2on_aptos_ } -func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []changeset.NodeKeys) { - for _, n := range nodes { - output := &bytes.Buffer{} - client, app := newApp(n, output) - - fmt.Println("Logging in:", n.url) - loginFs := flag.NewFlagSet("test", flag.ContinueOnError) - loginFs.Bool("bypass-version-check", true, "") - loginCtx := cli.NewContext(app, loginFs, nil) - err := client.RemoteLogin(loginCtx) - helpers.PanicErr(err) - output.Reset() +func mustFetchNodeKeys(chainID int64, nodes []NodeWithCreds, createAptosKeys bool) []NodeKeys { + nodeKeys := []NodeKeys{} - err = client.ListETHKeys(&cli.Context{ - App: app, - }) - helpers.PanicErr(err) - var ethKeys []presenters.ETHKeyResource - helpers.PanicErr(json.Unmarshal(output.Bytes(), ðKeys)) - ethAddress, err := findFirstGoodEthKeyAddress(chainID, ethKeys) + for _, n := range nodes { + api := newNodeAPI(n) + // Get eth key + fmt.Printf("Fetching ETH keys for node %s\n", n.ServiceName) + eKey := api.mustExec(api.methods.ListETHKeys) + ethKeys := mustJSON[[]presenters.ETHKeyResource](eKey) + ethAddress, err := findFirstGoodEthKeyAddress(chainID, *ethKeys) helpers.PanicErr(err) - output.Reset() - keysClient := cmd.NewAptosKeysClient(client) - err = keysClient.ListKeys(&cli.Context{ - App: app, - }) - helpers.PanicErr(err) - var aptosKeys []presenters.AptosKeyResource - helpers.PanicErr(json.Unmarshal(output.Bytes(), &aptosKeys)) - if len(aptosKeys) != 1 { - helpers.PanicErr(errors.New("node must have single aptos key")) + var aptosAccount string + if createAptosKeys { + aptosAccount = getOrCreateAptosKey(api) } - aptosAccount := aptosKeys[0].Account - output.Reset() - err = client.ListP2PKeys(&cli.Context{ - App: app, - }) - helpers.PanicErr(err) - var p2pKeys []presenters.P2PKeyResource - helpers.PanicErr(json.Unmarshal(output.Bytes(), &p2pKeys)) - if len(p2pKeys) != 1 { + // Get p2p key + fmt.Printf("Fetching P2P key for node %s\n", n.ServiceName) + p2pKeys := api.mustExec(api.methods.ListP2PKeys) + p2pKey := mustJSON[[]presenters.P2PKeyResource](p2pKeys) + if len(*p2pKey) != 1 { helpers.PanicErr(errors.New("node must have single p2p key")) } - peerID := strings.TrimPrefix(p2pKeys[0].PeerID, "p2p_") - output.Reset() + peerID := strings.TrimPrefix((*p2pKey)[0].PeerID, "p2p_") + + // Get OCR2 key bundles for both EVM and Aptos chains + bundles := api.mustExec(api.methods.ListOCR2KeyBundles) + ocr2Bundles := mustJSON[cmd.OCR2KeyBundlePresenters](bundles) + + expectedBundleLen := 1 + + // evm key bundles + fmt.Printf("Fetching OCR2 EVM key bundles for node %s\n", n.ServiceName) + ocr2EvmBundles := getTrimmedEVMOCR2KBs(*ocr2Bundles) + evmBundleLen := len(ocr2EvmBundles) + if evmBundleLen < expectedBundleLen { + fmt.Printf("WARN: node has %d EVM OCR2 bundles when it should have at least %d, creating bundles...\n", evmBundleLen, expectedBundleLen) + for i := evmBundleLen; i < expectedBundleLen; i++ { + cBundle := api.withArg("evm").mustExec(api.methods.CreateOCR2KeyBundle) + createdBundle := mustJSON[cmd.OCR2KeyBundlePresenter](cBundle) + fmt.Printf("Created OCR2 EVM key bundle %s\n", string(cBundle)) + ocr2EvmBundles = append(ocr2EvmBundles, trimmedOCR2KB(*createdBundle)) + } + } - chainType := "evm" + // aptos key bundles + var ocr2AptosBundles []OCR2AptosKBTrimmed + if createAptosKeys { + fmt.Printf("Fetching OCR2 Aptos key bundles for node %s\n", n.ServiceName) + ocr2AptosBundles = createAptosOCR2KB(ocr2Bundles, expectedBundleLen, api) + } - var ocr2Bundles []ocr2Bundle - err = client.ListOCR2KeyBundles(&cli.Context{ - App: app, - }) + fmt.Printf("Fetching CSA keys for node %s\n", n.ServiceName) + csaKeys := api.mustExec(api.methods.ListCSAKeys) + csaKeyResources := mustJSON[[]presenters.CSAKeyResource](csaKeys) + csaPubKey, err := findFirstCSAPublicKey(*csaKeyResources) helpers.PanicErr(err) - helpers.PanicErr(json.Unmarshal(output.Bytes(), &ocr2Bundles)) - ocr2BundleIndex := findOCR2Bundle(ocr2Bundles, chainType) - output.Reset() - if ocr2BundleIndex == -1 { - fmt.Println("WARN: node does not have EVM OCR2 bundle, creating one") - fs := flag.NewFlagSet("test", flag.ContinueOnError) - err = fs.Parse([]string{chainType}) - helpers.PanicErr(err) - ocr2CreateBundleCtx := cli.NewContext(app, fs, nil) - err = client.CreateOCR2KeyBundle(ocr2CreateBundleCtx) - helpers.PanicErr(err) - output.Reset() - - err = client.ListOCR2KeyBundles(&cli.Context{ - App: app, - }) - helpers.PanicErr(err) - helpers.PanicErr(json.Unmarshal(output.Bytes(), &ocr2Bundles)) - ocr2BundleIndex = findOCR2Bundle(ocr2Bundles, chainType) - output.Reset() + + // We can handle multiple OCR bundles in the future + // but for now we only support a single bundle per node + keys := NodeKeys{ + OCR2KBTrimmed: ocr2EvmBundles[0], + EthAddress: ethAddress, + AptosAccount: aptosAccount, + P2PPeerID: peerID, + CSAPublicKey: strings.TrimPrefix(csaPubKey, "csa_"), } + if createAptosKeys { + keys.OCR2AptosKBTrimmed = ocr2AptosBundles[0] + } + + nodeKeys = append(nodeKeys, keys) + } - ocr2Bndl := ocr2Bundles[ocr2BundleIndex] - - aptosBundleIndex := findOCR2Bundle(ocr2Bundles, "aptos") - if aptosBundleIndex == -1 { - chainType2 := "aptos" - fmt.Println("WARN: node does not have Aptos OCR2 bundle, creating one") - fs := flag.NewFlagSet("test", flag.ContinueOnError) - err = fs.Parse([]string{chainType2}) - helpers.PanicErr(err) - ocr2CreateBundleCtx := cli.NewContext(app, fs, nil) - err = client.CreateOCR2KeyBundle(ocr2CreateBundleCtx) - helpers.PanicErr(err) - output.Reset() - - err = client.ListOCR2KeyBundles(&cli.Context{ - App: app, - }) - helpers.PanicErr(err) - helpers.PanicErr(json.Unmarshal(output.Bytes(), &ocr2Bundles)) - aptosBundleIndex = findOCR2Bundle(ocr2Bundles, chainType2) - output.Reset() + return nodeKeys +} + +func trimmedOCR2KB(ocr2Bndl cmd.OCR2KeyBundlePresenter) OCR2KBTrimmed { + return OCR2KBTrimmed{ + OCR2BundleID: ocr2Bndl.ID, + OCR2ConfigPublicKey: strings.TrimPrefix(ocr2Bndl.ConfigPublicKey, "ocr2cfg_evm_"), + OCR2OnchainPublicKey: strings.TrimPrefix(ocr2Bndl.OnchainPublicKey, "ocr2on_evm_"), + OCR2OffchainPublicKey: strings.TrimPrefix(ocr2Bndl.OffChainPublicKey, "ocr2off_evm_"), + } +} + +func trimmedAptosOCR2KB(ocr2Bndl cmd.OCR2KeyBundlePresenter) OCR2AptosKBTrimmed { + return OCR2AptosKBTrimmed{ + AptosBundleID: ocr2Bndl.ID, + AptosOnchainPublicKey: strings.TrimPrefix(ocr2Bndl.OnchainPublicKey, "ocr2on_aptos_"), + } +} + +func createAptosOCR2KB(ocr2Bundles *cmd.OCR2KeyBundlePresenters, expectedBundleLen int, api *nodeAPI) []OCR2AptosKBTrimmed { + ocr2AptosBundles := getTrimmedAptosOCR2KBs(*ocr2Bundles) + aptosBundleLen := len(ocr2AptosBundles) + + if aptosBundleLen < expectedBundleLen { + fmt.Printf("WARN: node has %d Aptos OCR2 bundles when it should have at least %d, creating bundles...\n", aptosBundleLen, expectedBundleLen) + for i := aptosBundleLen; i < expectedBundleLen; i++ { + cBundle := api.withArg("aptos").mustExec(api.methods.CreateOCR2KeyBundle) + createdBundle := mustJSON[cmd.OCR2KeyBundlePresenter](cBundle) + fmt.Println("Created OCR2 Aptos key bundle", string(cBundle)) + ocr2AptosBundles = append(ocr2AptosBundles, trimmedAptosOCR2KB(*createdBundle)) } + } - aptosBundle := ocr2Bundles[aptosBundleIndex] + return ocr2AptosBundles +} - err = client.ListCSAKeys(&cli.Context{ - App: app, - }) +// getOrCreateAptosKey returns the Aptos account of the node. +// +// If the node has no Aptos keys, it creates one and returns the account. +func getOrCreateAptosKey(api *nodeAPI) string { + api.output.Reset() + aKeysClient := cmd.NewAptosKeysClient(api.methods) + err := aKeysClient.ListKeys(&cli.Context{App: api.app}) + helpers.PanicErr(err) + var aptosKeys []presenters.AptosKeyResource + helpers.PanicErr(json.Unmarshal(api.output.Bytes(), &aptosKeys)) + if len(aptosKeys) == 0 { + api.output.Reset() + fmt.Printf("WARN: node has no aptos keys, creating one...\n") + err = aKeysClient.CreateKey(&cli.Context{App: api.app}) helpers.PanicErr(err) - var csaKeys []presenters.CSAKeyResource - helpers.PanicErr(json.Unmarshal(output.Bytes(), &csaKeys)) - csaPubKey, err := findFirstCSAPublicKey(csaKeys) + api.output.Reset() + err = aKeysClient.ListKeys(&cli.Context{App: api.app}) helpers.PanicErr(err) - output.Reset() - - nc := changeset.NodeKeys{ - EthAddress: ethAddress, - AptosAccount: aptosAccount, - P2PPeerID: peerID, - AptosBundleID: aptosBundle.ID, - AptosOnchainPublicKey: strings.TrimPrefix(aptosBundle.OnchainPublicKey, fmt.Sprintf("ocr2on_%s_", "aptos")), - OCR2BundleID: ocr2Bndl.ID, - OCR2ConfigPublicKey: strings.TrimPrefix(ocr2Bndl.ConfigPublicKey, fmt.Sprintf("ocr2cfg_%s_", chainType)), - OCR2OnchainPublicKey: strings.TrimPrefix(ocr2Bndl.OnchainPublicKey, fmt.Sprintf("ocr2on_%s_", chainType)), - OCR2OffchainPublicKey: strings.TrimPrefix(ocr2Bndl.OffchainPublicKey, fmt.Sprintf("ocr2off_%s_", chainType)), - CSAPublicKey: csaPubKey, + helpers.PanicErr(json.Unmarshal(api.output.Bytes(), &aptosKeys)) + api.output.Reset() + } + + if len(aptosKeys) != 1 { + fmt.Printf("Node has %d aptos keys\n", len(aptosKeys)) + PanicErr(errors.New("node must have single aptos key")) + } + + aptosAccount := aptosKeys[0].Account + api.output.Reset() + + return aptosAccount +} + +func getTrimmedAptosOCR2KBs(ocr2Bundles cmd.OCR2KeyBundlePresenters) []OCR2AptosKBTrimmed { + aptosBundles := []OCR2AptosKBTrimmed{} + for _, b := range ocr2Bundles { + if b.ChainType == "aptos" { + aptosBundles = append(aptosBundles, trimmedAptosOCR2KB(b)) } + } + return aptosBundles +} - nca = append(nca, nc) +func getTrimmedEVMOCR2KBs(ocr2Bundles cmd.OCR2KeyBundlePresenters) []OCR2KBTrimmed { + evmBundles := []OCR2KBTrimmed{} + for _, b := range ocr2Bundles { + if b.ChainType == "evm" { + evmBundles = append(evmBundles, trimmedOCR2KB(b)) + } } - return + return evmBundles } func findFirstCSAPublicKey(csaKeyResources []presenters.CSAKeyResource) (string, error) { @@ -234,21 +275,9 @@ func findFirstCSAPublicKey(csaKeyResources []presenters.CSAKeyResource) (string, return "", errors.New("did not find any CSA Key Resources") } -func findOCR2Bundle(ocr2Bundles []ocr2Bundle, chainType string) int { - for i, b := range ocr2Bundles { - if b.ChainType == chainType { - return i - } - } - return -1 -} - func findFirstGoodEthKeyAddress(chainID int64, ethKeys []presenters.ETHKeyResource) (string, error) { for _, ethKey := range ethKeys { if ethKey.EVMChainID.Equal(ubig.NewI(chainID)) && !ethKey.Disabled { - if ethKey.EthBalance.IsZero() { - fmt.Println("WARN: selected ETH address has zero balance", ethKey.Address) - } return ethKey.Address, nil } } diff --git a/core/scripts/keystone/src/99_files.go b/core/scripts/keystone/src/99_files.go index 08ba12e4194..1848ba8fae9 100644 --- a/core/scripts/keystone/src/99_files.go +++ b/core/scripts/keystone/src/99_files.go @@ -1,71 +1,54 @@ package src import ( - "bufio" "encoding/json" "fmt" "io" "os" - - "github.com/smartcontractkit/chainlink/v2/core/utils" ) const ( defaultArtefactsDir = "artefacts" - defaultPublicKeys = ".cache/PublicKeys.json" - defaultNodeList = ".cache/NodeList.txt" + defaultNodeSetsPath = ".cache/node_sets.json" deployedContractsJSON = "deployed_contracts.json" - bootstrapSpecTemplate = "bootstrap.toml" - cribOverrideTemplate = "crib-overrides.yaml" - oracleSpecTemplate = "oracle.toml" ) -func writeLines(lines []string, path string) error { - file, err := os.Create(path) +func mustReadJSON[T any](fileName string) (output T) { + jsonFile, err := os.Open(fileName) if err != nil { - return err - } - wc := utils.NewDeferableWriteCloser(file) - defer wc.Close() - - w := bufio.NewWriter(file) - for _, line := range lines { - fmt.Fprintln(w, line) - } - if err := w.Flush(); err != nil { - return err + panic(fmt.Sprintf("failed to open file at %s: %v", fileName, err)) } - return wc.Close() -} - -func readLines(path string) ([]string, error) { - file, err := os.Open(path) + defer jsonFile.Close() + bytes, err := io.ReadAll(jsonFile) if err != nil { - return nil, err + panic(fmt.Sprintf("failed to read file at %s: %v", fileName, err)) } - defer file.Close() - - var lines []string - scanner := bufio.NewScanner(file) - for scanner.Scan() { - lines = append(lines, scanner.Text()) + err = json.Unmarshal(bytes, &output) + if err != nil { + panic(fmt.Sprintf("failed to unmarshal data: %v", err)) } - return lines, scanner.Err() + return } -func mustParseJSON[T any](fileName string) (output T) { - jsonFile, err := os.Open(fileName) +func mustWriteJSON[T any](fileName string, data T) { + jsonFile, err := os.Create(fileName) if err != nil { - panic(err) + panic(fmt.Sprintf("failed to create file at %s: %v", fileName, err)) } defer jsonFile.Close() - bytes, err := io.ReadAll(jsonFile) + encoder := json.NewEncoder(jsonFile) + encoder.SetIndent("", " ") + err = encoder.Encode(data) if err != nil { - panic(err) + panic(fmt.Sprintf("failed to encode data: %v", err)) } - err = json.Unmarshal(bytes, &output) +} + +func ensureArtefactsDir(artefactsDir string) { + _, err := os.Stat(artefactsDir) if err != nil { - panic(err) + fmt.Println("Creating artefacts directory" + artefactsDir) + err = os.MkdirAll(artefactsDir, 0700) + PanicErr(err) } - return } diff --git a/core/scripts/keystone/src/99_files_test.go b/core/scripts/keystone/src/99_files_test.go deleted file mode 100644 index 83ceb5cd9cc..00000000000 --- a/core/scripts/keystone/src/99_files_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package src - -import ( - "path/filepath" - "strings" - "testing" - - "github.com/stretchr/testify/assert" -) - -func Test_writeLines(t *testing.T) { - type args struct { - lines []string - } - tests := []struct { - name string - args args - }{ - { - name: "write read lines", - args: args{ - lines: []string{"a", "b"}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - pth := filepath.Join(t.TempDir(), strings.ReplaceAll(tt.name, " ", "_")) - err := writeLines(tt.args.lines, pth) - assert.NoError(t, err) - got, err := readLines(pth) - assert.NoError(t, err) - assert.Equal(t, tt.args.lines, got) - }) - } -} diff --git a/core/scripts/keystone/src/99_k8s_client.go b/core/scripts/keystone/src/99_k8s_client.go index 55a0ac82bcb..e4885e53a19 100644 --- a/core/scripts/keystone/src/99_k8s_client.go +++ b/core/scripts/keystone/src/99_k8s_client.go @@ -2,11 +2,13 @@ package src import ( "context" + "errors" "fmt" "log" "sort" "strings" + apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" networkingV1 "k8s.io/api/networking/v1" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -63,32 +65,33 @@ func MustNewK8sClient() *K8sClient { } } -type PodWithConfigMap struct { - v1.Pod - ConfigMap v1.ConfigMap - Host string +type DeploymentWithConfigMap struct { + apps.Deployment + ServiceName string + ConfigMap v1.ConfigMap + Host string } -func (m *K8sClient) GetPodsWithConfigMap() ([]PodWithConfigMap, error) { - pods, err := m.ListPods("app=app") +func (m *K8sClient) GetDeploymentsWithConfigMap() ([]DeploymentWithConfigMap, error) { + deployments, err := m.ListDeployments("app=app") if err != nil { return nil, err } - if len(pods.Items) == 0 { - return nil, fmt.Errorf("no chainlink node crib pods found, is your crib cluster deployed?") + if len(deployments.Items) == 0 { + return nil, errors.New("no deployments found, is your nodeset deployed?") } - podsWithConfigMaps := []PodWithConfigMap{} + deploymentsWithConfigMaps := []DeploymentWithConfigMap{} ingressList, err := m.ListIngresses() if err != nil { return nil, err } if len(ingressList.Items) == 0 { - return nil, fmt.Errorf("no ingress found, is your crib cluster deployed?") + return nil, errors.New("no ingress found, is your nodeset deployed?") } - for _, pod := range pods.Items { - for _, v := range pod.Spec.Volumes { + for _, deployment := range deployments.Items { + for _, v := range deployment.Spec.Template.Spec.Volumes { if v.ConfigMap == nil { continue } @@ -96,53 +99,48 @@ func (m *K8sClient) GetPodsWithConfigMap() ([]PodWithConfigMap, error) { if err != nil { return nil, err } - // - host: crib-henry-keystone-node2.main.stage.cldev.sh - // http: - // paths: - // - backend: - // service: - // name: app-node-2 - // port: - // number: 6688 - // path: /* - // pathType: ImplementationSpecific - instance := pod.Labels["instance"] + instance := deployment.Labels["instance"] var host string + var serviceName string for _, ingress := range ingressList.Items { for _, rule := range ingress.Spec.Rules { for _, path := range rule.HTTP.Paths { if strings.Contains(path.Backend.Service.Name, instance) { host = rule.Host + serviceName = path.Backend.Service.Name } } } } if host == "" { - return nil, fmt.Errorf("could not find host for pod %s", pod.Name) + return nil, fmt.Errorf("could not find host for deployment %s", deployment.Name) } - podWithConfigMap := PodWithConfigMap{ - Host: host, - Pod: pod, - ConfigMap: *cm, + deploymentWithConfigMap := DeploymentWithConfigMap{ + Host: host, + ServiceName: serviceName, + Deployment: deployment, + ConfigMap: *cm, } - podsWithConfigMaps = append(podsWithConfigMaps, podWithConfigMap) + deploymentsWithConfigMaps = append(deploymentsWithConfigMaps, deploymentWithConfigMap) } } - fmt.Printf("Found %d chainlink node crib pods\n", len(podsWithConfigMaps)) - return podsWithConfigMaps, nil + fmt.Printf("Found %d deployments with config maps\n", len(deploymentsWithConfigMaps)) + return deploymentsWithConfigMaps, nil } -// ListPods lists pods for a namespace and selector -func (m *K8sClient) ListPods(selector string) (*v1.PodList, error) { - pods, err := m.ClientSet.CoreV1().Pods(m.namespace).List(context.Background(), metaV1.ListOptions{LabelSelector: selector}) - sort.Slice(pods.Items, func(i, j int) bool { - return pods.Items[i].CreationTimestamp.Before(pods.Items[j].CreationTimestamp.DeepCopy()) +// ListDeployments lists deployments for a namespace +func (m *K8sClient) ListDeployments(selector string) (*apps.DeploymentList, error) { + deployments, err := m.ClientSet.AppsV1().Deployments(m.namespace).List(context.Background(), metaV1.ListOptions{LabelSelector: selector}) + if err != nil { + return nil, err + } + sort.Slice(deployments.Items, func(i, j int) bool { + return deployments.Items[i].CreationTimestamp.Before(deployments.Items[j].CreationTimestamp.DeepCopy()) }) - - return pods.DeepCopy(), err + return deployments.DeepCopy(), nil } // Get a config map diff --git a/core/scripts/keystone/src/99_nodes.go b/core/scripts/keystone/src/99_nodes.go deleted file mode 100644 index 68d3621ce63..00000000000 --- a/core/scripts/keystone/src/99_nodes.go +++ /dev/null @@ -1,72 +0,0 @@ -package src - -import ( - "errors" - "fmt" - "net/url" - "strings" - - helpers "github.com/smartcontractkit/chainlink/core/scripts/common" -) - -type node struct { - url *url.URL - remoteURL *url.URL - login string - password string -} - -func (n node) IsTerminal() bool { - return false -} - -func (n node) PasswordPrompt(p string) string { - return n.password -} - -func (n node) Prompt(p string) string { - return n.login -} - -func writeNodesList(path string, nodes []*node) error { - fmt.Println("Writing nodes list to", path) - var lines []string - for _, n := range nodes { - lines = append(lines, fmt.Sprintf("%s %s %s", n.url.String(), n.login, n.password)) - } - - return writeLines(lines, path) -} - -func mustReadNodesList(path string) []*node { - fmt.Println("Reading nodes list from", path) - nodesList, err := readLines(path) - helpers.PanicErr(err) - - var nodes []*node - var hasBoot bool - for _, r := range nodesList { - rr := strings.TrimSpace(r) - if len(rr) == 0 { - continue - } - s := strings.Split(rr, " ") - if len(s) != 4 { - helpers.PanicErr(errors.New("wrong nodes list format")) - } - if strings.Contains(s[0], "boot") && hasBoot { - helpers.PanicErr(errors.New("the single boot node must come first")) - } - hasBoot = true - url, err := url.Parse(s[0]) - remoteURL, err := url.Parse(s[1]) - helpers.PanicErr(err) - nodes = append(nodes, &node{ - url: url, - remoteURL: remoteURL, - login: s[2], - password: s[3], - }) - } - return nodes -} diff --git a/core/scripts/keystone/src/__snapshots__/02_deploy_keystone_workflows_test.snap b/core/scripts/keystone/src/__snapshots__/02_deploy_keystone_workflows_test.snap new file mode 100755 index 00000000000..8556ca9304c --- /dev/null +++ b/core/scripts/keystone/src/__snapshots__/02_deploy_keystone_workflows_test.snap @@ -0,0 +1,57 @@ + +[TestCreateKeystoneWorkflowJob - 1] + +type = "workflow" +schemaVersion = 1 +name = "keystone_workflow" +workflow = """ +name: "ccip_kiab1" +owner: '0x1234567890abcdef1234567890abcdef12345678' +triggers: + - id: streams-trigger@1.1.0 + config: + maxFrequencyMs: 10000 + feedIds: + - 'feed1' + - 'feed2' + - 'feed3' + +consensus: + - id: offchain_reporting@1.0.0 + ref: ccip_feeds + inputs: + observations: + - $(trigger.outputs) + config: + report_id: '0001' + key_id: 'evm' + aggregation_method: data_feeds + aggregation_config: + feeds: + 'feed1': + deviation: '0.05' + heartbeat: 1800 + 'feed2': + deviation: '0.05' + heartbeat: 1800 + 'feed3': + deviation: '0.05' + heartbeat: 1800 + encoder: EVM + encoder_config: + abi: "(bytes32 FeedID, uint224 Price, uint32 Timestamp)[] Reports" + abi: (bytes32 FeedID, uint224 Price, uint32 Timestamp)[] Reports + +targets: + - id: target_id + inputs: + signed_report: $(ccip_feeds.outputs) + config: + address: '0xabcdefabcdefabcdefabcdefabcdefabcdef' + deltaStage: 5s + schedule: oneAtATime + +""" +workflowOwner = "0x1234567890abcdef1234567890abcdef12345678" + +--- diff --git a/core/scripts/keystone/src/__snapshots__/02_provision_crib_test.snap b/core/scripts/keystone/src/__snapshots__/02_provision_crib_test.snap new file mode 100755 index 00000000000..06532bea727 --- /dev/null +++ b/core/scripts/keystone/src/__snapshots__/02_provision_crib_test.snap @@ -0,0 +1,415 @@ + +[TestGeneratePostprovisionConfig - 1] +helm: + values: + chainlink: + nodes: + 0-ks-wf-bt-node1: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + 0-ks-wf-node2: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + + [EVM.Workflow] + FromAddress = '0x75cf1355cC4Eb358feaBb9e269a4DAEeB6721DBB' + ForwarderAddress = '0x0100000000000000000000000000000000000000' + 0-ks-wf-node3: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + + [EVM.Workflow] + FromAddress = '0xc6dcE30f492CBD223b9946603192f22D86e783ca' + ForwarderAddress = '0x0100000000000000000000000000000000000000' + 0-ks-wf-node4: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + + [EVM.Workflow] + FromAddress = '0x1289d00A6565Afcd6437B09548F6019EF49696d0' + ForwarderAddress = '0x0100000000000000000000000000000000000000' + 0-ks-wf-node5: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + + [EVM.Workflow] + FromAddress = '0x4b92B0aaC39932B7302676F48e78FA91852DC0EE' + ForwarderAddress = '0x0100000000000000000000000000000000000000' + 1-ks-str-trig-bt-node1: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + 1-ks-str-trig-node2: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + 1-ks-str-trig-node3: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + 1-ks-str-trig-node4: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + 1-ks-str-trig-node5: + image: ${runtime.images.app} + overridesToml: | + [Capabilities] + [Capabilities.Peering] + [Capabilities.Peering.V2] + Enabled = true + DefaultBootstrappers = ['12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6691'] + ListenAddresses = ['0.0.0.0:6691'] + + [Capabilities.ExternalRegistry] + Address = '0x0200000000000000000000000000000000000000' + NetworkID = 'evm' + ChainID = '1337' + + [[EVM]] + ChainID = '1337' + Nodes = [] + ingress: + hosts: + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-bt-node1.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-bt-node1 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node2.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node2 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node3.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node3 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node4.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node4 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node5.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node5 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-bt-node1.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-bt-node1 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node2.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node2 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node3.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node3 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node4.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node4 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node5.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node5 + port: + number: 6688 + +--- + +[TestGeneratePreprovisionConfig - 1] +helm: + values: + chainlink: + nodes: + 0-ks-wf-bt-node1: + image: ${runtime.images.app} + 0-ks-wf-node2: + image: ${runtime.images.app} + 0-ks-wf-node3: + image: ${runtime.images.app} + 0-ks-wf-node4: + image: ${runtime.images.app} + 0-ks-wf-node5: + image: ${runtime.images.app} + 1-ks-str-trig-bt-node1: + image: ${runtime.images.app} + 1-ks-str-trig-node2: + image: ${runtime.images.app} + 1-ks-str-trig-node3: + image: ${runtime.images.app} + 1-ks-str-trig-node4: + image: ${runtime.images.app} + 1-ks-str-trig-node5: + image: ${runtime.images.app} + ingress: + hosts: + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-bt-node1.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-bt-node1 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node2.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node2 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node3.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node3 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node4.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node4 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-0-ks-wf-node5.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-0-ks-wf-node5 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-bt-node1.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-bt-node1 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node2.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node2 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node3.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node3 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node4.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node4 + port: + number: 6688 + - host: ${DEVSPACE_NAMESPACE}-1-ks-str-trig-node5.${DEVSPACE_INGRESS_BASE_DOMAIN} + http: + paths: + - path: / + backend: + service: + name: app-1-ks-str-trig-node5 + port: + number: 6688 + +--- diff --git a/core/scripts/keystone/src/__snapshots__/02_provision_ocr3_capability_test.snap b/core/scripts/keystone/src/__snapshots__/02_provision_ocr3_capability_test.snap new file mode 100755 index 00000000000..9d38f78899b --- /dev/null +++ b/core/scripts/keystone/src/__snapshots__/02_provision_ocr3_capability_test.snap @@ -0,0 +1,65 @@ + +[TestGenerateOCR3Config - 1] +{ + "F": 1, + "OffchainConfig": "", + "OffchainConfigVersion": 30, + "OnchainConfig": "0x", + "Signers": [ + "011400321bc7af41a634375526006365a31bf32b4cfa7c0520004ca789105da974eec967758ad32b575741d6cb36c1bb3bcfd87b235502cc1753", + "0114005192c43a68efb7a698c0459ff8591a115da128ee052000169008927a60e6c03e99aac6fa268dabaf4d00e117419861d87836211267361b", + "011400ed613636925af2df6ed8332d95028eabcbe95a3f052000ce86b34de67249f92058f69e47961907ebbf8a71c12123f1d2a7cab4874f6365", + "01140053b5bbc0efa2e2d2770029bab5d5a647a260a72b052000f2cb4932d3ce8c10bf67c60d35372a5ff1578255e25c2a119c2dea70e919567a" + ], + "Transmitters": [ + "0x75cf1355cC4Eb358feaBb9e269a4DAEeB6721DBB", + "0xc6dcE30f492CBD223b9946603192f22D86e783ca", + "0x1289d00A6565Afcd6437B09548F6019EF49696d0", + "0x4b92B0aaC39932B7302676F48e78FA91852DC0EE" + ] +} +--- + +[TestGenSpecs - 1] + +type = "bootstrap" +schemaVersion = 1 +name = "ocr3_bootstrap" +contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" +relay = "evm" + +[relayConfig] +chainID = "1337" +providerType = "ocr3-capability" + + + +type = "offchainreporting2" +schemaVersion = 1 +name = "ocr3_oracle" +contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" +ocrKeyBundleID = "20ccdc97afdf467465590115e3da4e5eb591bf5f43808e81a5d0807cd889b3c7" +p2pv2Bootstrappers = [ + "12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq@app-0-ks-wf-bt-node1:6690", +] +relay = "evm" +pluginType = "plugin" +transmitterID = "12D3KooWHhXyDmHB6D1UQosLXmhczw3zxB3DLYBuq9Unb4iCD4Sc" + +[relayConfig] +chainID = "1337" + +[pluginConfig] +command = "chainlink-ocr3-capability" +ocrVersion = 3 +pluginName = "ocr-capability" +providerType = "ocr3-capability" +telemetryType = "plugin" + +[onchainSigningStrategy] +strategyName = 'multi-chain' +[onchainSigningStrategy.config] +evm = "20ccdc97afdf467465590115e3da4e5eb591bf5f43808e81a5d0807cd889b3c7" +aptos = "ac364cec9fe7d9ea1035fc511e5b2f30900caa6e65ac0501168005d05129e088" + +--- diff --git a/core/scripts/keystone/src/__snapshots__/02_provision_streams_trigger_capability_test.snap b/core/scripts/keystone/src/__snapshots__/02_provision_streams_trigger_capability_test.snap new file mode 100755 index 00000000000..07ac61b7264 --- /dev/null +++ b/core/scripts/keystone/src/__snapshots__/02_provision_streams_trigger_capability_test.snap @@ -0,0 +1,50 @@ + +[TestCreateMercuryV3Job - 1] + +type = "offchainreporting2" +schemaVersion = 1 +name = "mercury-BTC/USD" +p2pv2Bootstrappers = ["crib-henry-keystone-node1.main.stage.cldev.sh"] +forwardingAllowed = false +maxTaskDuration = "1s" +contractID = "0x0700000000000000000000000000000000000000" +feedID = "0x0100000000000000000000000000000000000000000000000000000000000000" +contractConfigTrackerPollInterval = "1s" +ocrKeyBundleID = "ocr_key_bundle_id" +relay = "evm" +pluginType = "mercury" +transmitterID = "node_csa_key" +observationSource = """ + price [type=bridge name="bridge_name" timeout="50ms" requestData=""]; + + benchmark_price [type=jsonparse path="result,mid" index=0]; + price -> benchmark_price; + + bid_price [type=jsonparse path="result,bid" index=1]; + price -> bid_price; + + ask_price [type=jsonparse path="result,ask" index=2]; + price -> ask_price; +""" + +[relayConfig] +enableTriggerCapability = true +chainID = "123456" + +--- + +[TestCreateMercuryBootstrapJob - 1] + +type = "bootstrap" +relay = "evm" +schemaVersion = 1 +name = "boot-BTC/USD" +contractID = "0x0700000000000000000000000000000000000000" +feedID = "0x0100000000000000000000000000000000000000000000000000000000000000" +contractConfigTrackerPollInterval = "1s" + +[relayConfig] +chainID = 123456 +enableTriggerCapability = true + +--- diff --git a/core/scripts/keystone/src/__snapshots__/03_gen_crib_cluster_overrides_cmd_test.snap b/core/scripts/keystone/src/__snapshots__/03_gen_crib_cluster_overrides_cmd_test.snap deleted file mode 100755 index 08b79a9f4f9..00000000000 --- a/core/scripts/keystone/src/__snapshots__/03_gen_crib_cluster_overrides_cmd_test.snap +++ /dev/null @@ -1,44 +0,0 @@ - -[TestGenerateCribConfig - 1] -helm: - values: - chainlink: - nodes: - node1: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - node2: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '0x8B60FDcc9CAC8ea476b31d17011CB204471431d9' - ForwarderAddress = '0x1234567890abcdef' - node3: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '0x6620F516F29979B214e2451498a057FDd3a0A85d' - ForwarderAddress = '0x1234567890abcdef' - node4: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '0xFeB61E22FCf4F9740c9D96b05199F195bd61A7c2' - ForwarderAddress = '0x1234567890abcdef' - node5: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '0x882Fd04D78A7e7D386Dd5b550f19479E5494B0B2' - ForwarderAddress = '0x1234567890abcdef' ---- diff --git a/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap b/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap deleted file mode 100755 index c0c7c7d7e67..00000000000 --- a/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap +++ /dev/null @@ -1,140 +0,0 @@ - -[TestGenSpecs - 1] -Bootstrap: -Host: crib-henry-keystone-node1.main.stage.cldev.sh -type = "bootstrap" -schemaVersion = 1 -name = "Keystone boot" -contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" -relay = "evm" - -[relayConfig] -chainID = "11155111" -providerType = "ocr3-capability" - -Oracles: -Oracle 0: -Host: crib-henry-keystone-node2.main.stage.cldev.sh -type = "offchainreporting2" -schemaVersion = 1 -name = "Keystone" -contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" -ocrKeyBundleID = "b3df4d8748b67731a1112e8b45a764941974f5590c93672eebbc4f3504dd10ed" -p2pv2Bootstrappers = [ - "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ@crib-henry-keystone-node1.main.stage.cldev.sh:6690", -] -relay = "evm" -pluginType = "plugin" -transmitterID = "0x8B60FDcc9CAC8ea476b31d17011CB204471431d9" - -[relayConfig] -chainID = "11155111" - -[pluginConfig] -command = "chainlink-ocr3-capability" -ocrVersion = 3 -pluginName = "ocr-capability" -providerType = "ocr3-capability" -telemetryType = "plugin" - -[onchainSigningStrategy] -strategyName = 'multi-chain' -[onchainSigningStrategy.config] -evm = "b3df4d8748b67731a1112e8b45a764941974f5590c93672eebbc4f3504dd10ed" -aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfb" - --------------------------------- -Oracle 1: -Host: crib-henry-keystone-node3.main.stage.cldev.sh -type = "offchainreporting2" -schemaVersion = 1 -name = "Keystone" -contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" -ocrKeyBundleID = "38459ae37f29f2c1fde0f25972a973322be8cada82acf43f464756836725be97" -p2pv2Bootstrappers = [ - "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ@crib-henry-keystone-node1.main.stage.cldev.sh:6690", -] -relay = "evm" -pluginType = "plugin" -transmitterID = "0x6620F516F29979B214e2451498a057FDd3a0A85d" - -[relayConfig] -chainID = "11155111" - -[pluginConfig] -command = "chainlink-ocr3-capability" -ocrVersion = 3 -pluginName = "ocr-capability" -providerType = "ocr3-capability" -telemetryType = "plugin" - -[onchainSigningStrategy] -strategyName = 'multi-chain' -[onchainSigningStrategy.config] -evm = "38459ae37f29f2c1fde0f25972a973322be8cada82acf43f464756836725be97" -aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfc" - --------------------------------- -Oracle 2: -Host: crib-henry-keystone-node4.main.stage.cldev.sh -type = "offchainreporting2" -schemaVersion = 1 -name = "Keystone" -contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" -ocrKeyBundleID = "b5dbc4c9da983cddde2e3226b85807eb7beaf818694a22576af4d80f352702ed" -p2pv2Bootstrappers = [ - "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ@crib-henry-keystone-node1.main.stage.cldev.sh:6690", -] -relay = "evm" -pluginType = "plugin" -transmitterID = "0xFeB61E22FCf4F9740c9D96b05199F195bd61A7c2" - -[relayConfig] -chainID = "11155111" - -[pluginConfig] -command = "chainlink-ocr3-capability" -ocrVersion = 3 -pluginName = "ocr-capability" -providerType = "ocr3-capability" -telemetryType = "plugin" - -[onchainSigningStrategy] -strategyName = 'multi-chain' -[onchainSigningStrategy.config] -evm = "b5dbc4c9da983cddde2e3226b85807eb7beaf818694a22576af4d80f352702ed" -aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfd" - --------------------------------- -Oracle 3: -Host: crib-henry-keystone-node5.main.stage.cldev.sh -type = "offchainreporting2" -schemaVersion = 1 -name = "Keystone" -contractID = "0xB29934624cAe3765E33115A9530a13f5aEC7fa8A" -ocrKeyBundleID = "260d5c1a618cdf5324509d7db95f5a117511864ebb9e1f709e8969339eb225af" -p2pv2Bootstrappers = [ - "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ@crib-henry-keystone-node1.main.stage.cldev.sh:6690", -] -relay = "evm" -pluginType = "plugin" -transmitterID = "0x882Fd04D78A7e7D386Dd5b550f19479E5494B0B2" - -[relayConfig] -chainID = "11155111" - -[pluginConfig] -command = "chainlink-ocr3-capability" -ocrVersion = 3 -pluginName = "ocr-capability" -providerType = "ocr3-capability" -telemetryType = "plugin" - -[onchainSigningStrategy] -strategyName = 'multi-chain' -[onchainSigningStrategy.config] -evm = "260d5c1a618cdf5324509d7db95f5a117511864ebb9e1f709e8969339eb225af" -aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfe" - - ---- diff --git a/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap b/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap deleted file mode 100755 index eac3cdaff4c..00000000000 --- a/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap +++ /dev/null @@ -1,23 +0,0 @@ - -[TestGenerateOCR3Config - 1] -{ - "F": 1, - "OffchainConfig": "", - "OffchainConfigVersion": 30, - "OnchainConfig": "0x", - "Signers": [ - "011400a2402db8e549f094ea31e1c0edd77623f4ca5b12052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4a", - "0114004af19c802b244d1d085492c3946391c965e10519052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4b", - "01140061925685d2b80b121537341d063c4e57b2f9323c052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4c", - "011400fd97efd53fc20acc098fcd746c04d8d7540d97e0052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4d", - "011400a0b67dc5345a71d02b396147ae2cb75dda63cbe9052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4e" - ], - "Transmitters": [ - "0xF4e7e516146c8567F8E8be0ED1f1A92798628d35", - "0x8B60FDcc9CAC8ea476b31d17011CB204471431d9", - "0x6620F516F29979B214e2451498a057FDd3a0A85d", - "0xFeB61E22FCf4F9740c9D96b05199F195bd61A7c2", - "0x882Fd04D78A7e7D386Dd5b550f19479E5494B0B2" - ] -} ---- diff --git a/core/scripts/keystone/src/external-adapter/.goreleaser.yaml b/core/scripts/keystone/src/external-adapter/.goreleaser.yaml new file mode 100644 index 00000000000..524be367e09 --- /dev/null +++ b/core/scripts/keystone/src/external-adapter/.goreleaser.yaml @@ -0,0 +1,49 @@ +project_name: kiab-mock-external-adapter +version: 2 + +builds: + - targets: + - go_first_class + no_unique_dist_dir: true + binary: kiab-mock-external-adapter + env: + - CGO_ENABLED=0 + +dockers: + - id: linux-arm64 + use: buildx + goos: linux + goarch: arm64 + image_templates: + - "{{ .Env.IMAGE }}" + build_flag_templates: + - --platform=linux/arm64 + + - id: linux-amd64 + use: buildx + goos: linux + goarch: amd64 + image_templates: + - "{{ .Env.IMAGE }}" + build_flag_templates: + - --platform=linux/amd64 +docker_manifests: + - name_template: '{{ .Env.IMAGE }}' + image_templates: + - '{{ .Env.IMAGE }}' +archives: + - format: binary + +release: + disable: true +changelog: + disable: true + +nightly: + version_template: "{{ .ProjectName }}-{{ .ShortCommit }}" + +snapshot: + version_template: "{{ .ProjectName }}-{{ .ShortCommit }}" + +partial: + by: target diff --git a/core/scripts/keystone/src/external-adapter/99_external_adapter.go b/core/scripts/keystone/src/external-adapter/99_external_adapter.go new file mode 100644 index 00000000000..8af035f30fd --- /dev/null +++ b/core/scripts/keystone/src/external-adapter/99_external_adapter.go @@ -0,0 +1,154 @@ +package main + +import ( + "fmt" + "math/rand" + "net" + "net/http" + "net/http/httptest" + "os" + "strconv" + "sync" + "time" +) + +func PanicErr(err error) { + if err != nil { + panic(err) + } +} + +// Price struct encapsulates bid, mid, ask values along with a mutex for synchronization +type Price struct { + mu sync.RWMutex + Bid float64 + Mid float64 + Ask float64 +} + +// Update safely updates the price values within the specified bounds +func (p *Price) Update(step, floor, ceiling float64) { + p.mu.Lock() + defer p.mu.Unlock() + + p.Mid = adjustValue(p.Mid, step, floor, ceiling) + p.Bid = adjustValue(p.Mid, step, floor, p.Mid) + p.Ask = adjustValue(p.Mid, step, p.Mid, ceiling) +} + +// GetSnapshot safely retrieves a copy of the current price values +func (p *Price) GetSnapshot() (bid, mid, ask float64) { + p.mu.RLock() + defer p.mu.RUnlock() + return p.Bid, p.Mid, p.Ask +} + +func main() { + // Get initial values from environment variables or use defaults + btcUsdInitialValue := getInitialValue("BTCUSD_INITIAL_VALUE", 1000.0) + linkInitialValue := getInitialValue("LINK_INITIAL_VALUE", 11.0) + nativeInitialValue := getInitialValue("NATIVE_INITIAL_VALUE", 2400.0) + + pctBounds := 0.3 + + // Start external adapters on different ports + externalAdapter(btcUsdInitialValue, "4001", pctBounds) + externalAdapter(linkInitialValue, "4002", pctBounds) + externalAdapter(nativeInitialValue, "4003", pctBounds) + + // Block main goroutine indefinitely + select {} +} + +// getInitialValue retrieves the initial value from the environment or returns a default +func getInitialValue(envVar string, defaultValue float64) float64 { + valueEnv := os.Getenv(envVar) + if valueEnv == "" { + fmt.Printf("%s not set, using default value: %.4f\n", envVar, defaultValue) + return defaultValue + } + fmt.Printf("%s set to %s\n", envVar, valueEnv) + val, err := strconv.ParseFloat(valueEnv, 64) + PanicErr(err) + return val +} + +// externalAdapter sets up a mock external adapter server for a specific asset +func externalAdapter(initialValue float64, port string, pctBounds float64) *httptest.Server { + // Create a custom listener on the specified port + listener, err := net.Listen("tcp", "0.0.0.0:"+port) + if err != nil { + panic(err) + } + + // Initialize the Price struct + price := &Price{ + Bid: initialValue, + Mid: initialValue, + Ask: initialValue, + } + + step := initialValue * pctBounds / 10 + ceiling := initialValue * (1 + pctBounds) + floor := initialValue * (1 - pctBounds) + + // Perform initial adjustment to set bid and ask + price.Update(step, floor, ceiling) + + // Start a goroutine to periodically update the price + go func() { + ticker := time.NewTicker(10 * time.Second) + defer ticker.Stop() + for range ticker.C { + price.Update(step, floor, ceiling) + fmt.Printf("Updated prices on port %s: bid=%.4f, mid=%.4f, ask=%.4f\n", port, price.Bid, price.Mid, price.Ask) + } + }() + + handler := http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + bid, mid, ask := price.GetSnapshot() + + res.Header().Set("Content-Type", "application/json") + res.WriteHeader(http.StatusOK) + resp := fmt.Sprintf(`{"result": {"bid": %.4f, "mid": %.4f, "ask": %.4f}}`, bid, mid, ask) + if _, err := res.Write([]byte(resp)); err != nil { + fmt.Printf("failed to write response: %v\n", err) + } + }) + + // Create and start the test server + ea := &httptest.Server{ + Listener: listener, + Config: &http.Server{ + Handler: handler, + ReadHeaderTimeout: 5 * time.Second, + }, + } + ea.Start() + + fmt.Printf("Mock external adapter started at %s\n", ea.URL) + fmt.Printf("Initial value: %.4f, Floor: %.4f, Ceiling: %.4f\n", initialValue, floor, ceiling) + return ea +} + +// adjustValue takes a starting value and randomly shifts it up or down by a step. +// It ensures that the value stays within the specified bounds. +func adjustValue(start, step, floor, ceiling float64) float64 { + // Randomly choose to increase or decrease the value + // #nosec G404 + if rand.Intn(2) == 0 { + step = -step + } + + // Apply the step to the starting value + newValue := start + step + + // Ensure the value is within the bounds + if newValue < floor { + newValue = floor + } else if newValue > ceiling { + newValue = ceiling + } + + return newValue +} diff --git a/core/scripts/keystone/src/external-adapter/Dockerfile b/core/scripts/keystone/src/external-adapter/Dockerfile new file mode 100644 index 00000000000..714d9397c34 --- /dev/null +++ b/core/scripts/keystone/src/external-adapter/Dockerfile @@ -0,0 +1,5 @@ +FROM scratch + +COPY ./kiab-mock-external-adapter / + +ENTRYPOINT ["/kiab-mock-external-adapter"] diff --git a/core/scripts/keystone/src/testdata/NodeList.txt b/core/scripts/keystone/src/testdata/NodeList.txt deleted file mode 100644 index 6fb65dded69..00000000000 --- a/core/scripts/keystone/src/testdata/NodeList.txt +++ /dev/null @@ -1,5 +0,0 @@ -https://local-node1 https://crib-henry-keystone-node1.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://local-node2 https://crib-henry-keystone-node2.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://local-node3 https://crib-henry-keystone-node3.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://local-node4 https://crib-henry-keystone-node4.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://local-node5 https://crib-henry-keystone-node5.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs diff --git a/core/scripts/keystone/src/testdata/PublicKeys.json b/core/scripts/keystone/src/testdata/PublicKeys.json deleted file mode 100644 index b29e8290895..00000000000 --- a/core/scripts/keystone/src/testdata/PublicKeys.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - { - "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfa", - "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4a", - "EthAddress": "0xF4e7e516146c8567F8E8be0ED1f1A92798628d35", - "P2PPeerID": "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ", - "OCR2BundleID": "2f92c96da20fbe39c89e59516e3a7473254523316887394e406527c72071d3db", - "OCR2OnchainPublicKey": "a2402db8e549f094ea31e1c0edd77623f4ca5b12", - "OCR2OffchainPublicKey": "3ca9918cd2787de8f9aff91f220f30a5cc54c394f73e173b12c93368bd7072ad", - "OCR2ConfigPublicKey": "19904debd03994fe9ea411cda7a6b2f01f20a3fe803df0fed67aaf00cc99113f", - "CSAPublicKey": "csa_dbae6965bad0b0fa95ecc34a602eee1c0c570ddc29b56502e400d18574b8c3df" - }, - { - "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfb", - "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4b", - "EthAddress": "0x8B60FDcc9CAC8ea476b31d17011CB204471431d9", - "P2PPeerID": "12D3KooWFUjV73ZYkAMhS2cVwte3kXDWD8Ybyx3u9CEDHNoeEhBH", - "OCR2BundleID": "b3df4d8748b67731a1112e8b45a764941974f5590c93672eebbc4f3504dd10ed", - "OCR2OnchainPublicKey": "4af19c802b244d1d085492c3946391c965e10519", - "OCR2OffchainPublicKey": "365b9e1c3c945fc3f51afb25772f0a5a1f1547935a4b5dc89c012f590709fefe", - "OCR2ConfigPublicKey": "15ff12569d11b8ff9f17f8999ea928d03a439f3fb116661cbc4669a0a3192775", - "CSAPublicKey": "csa_c5cc655a9c19b69626519c4a72c44a94a3675daeba9c16cc23e010a7a6dac1be" - }, - { - "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfc", - "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4c", - "EthAddress": "0x6620F516F29979B214e2451498a057FDd3a0A85d", - "P2PPeerID": "12D3KooWRTtH2WWrztD87Do1kXePSmGjyU4r7mZVWThmqTGgdbUC", - "OCR2BundleID": "38459ae37f29f2c1fde0f25972a973322be8cada82acf43f464756836725be97", - "OCR2OnchainPublicKey": "61925685d2b80b121537341d063c4e57b2f9323c", - "OCR2OffchainPublicKey": "7fe2dbd9f9fb96f7dbbe0410e32d435ad67dae6c91410189fe5664cf3057ef10", - "OCR2ConfigPublicKey": "2f02fd80b362e1c7acf91680fd48c062718233acd595a6ae7cbe434e118e6a4f", - "CSAPublicKey": "csa_7407fc90c70895c0fb2bdf385e2e4918364bec1f7a74bad7fdf696bffafbcab8" - }, - { - "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfd", - "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4d", - "EthAddress": "0xFeB61E22FCf4F9740c9D96b05199F195bd61A7c2", - "P2PPeerID": "12D3KooWMTZnZtcVK4EJsjkKsV9qXNoNRSjT62CZi3tKkXGaCsGh", - "OCR2BundleID": "b5dbc4c9da983cddde2e3226b85807eb7beaf818694a22576af4d80f352702ed", - "OCR2OnchainPublicKey": "fd97efd53fc20acc098fcd746c04d8d7540d97e0", - "OCR2OffchainPublicKey": "91b393bb5e6bd6fd9de23845bcd0e0d9b0dd28a1d65d3cfb1fce9f91bd3d8c19", - "OCR2ConfigPublicKey": "09eb53924ff8b33a08b4eae2f3819015314ce6e8864ac4f86e97caafd4181506", - "CSAPublicKey": "csa_ef55caf17eefc2a9d547b5a3978d396bd237c73af99cd849a4758701122e3cba" - }, - { - "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfe", - "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4e", - "EthAddress": "0x882Fd04D78A7e7D386Dd5b550f19479E5494B0B2", - "P2PPeerID": "12D3KooWRsM9yordRQDhLgbErH8WMMGz1bC1J4hR5gAGvMWu8goN", - "OCR2BundleID": "260d5c1a618cdf5324509d7db95f5a117511864ebb9e1f709e8969339eb225af", - "OCR2OnchainPublicKey": "a0b67dc5345a71d02b396147ae2cb75dda63cbe9", - "OCR2OffchainPublicKey": "4f42ef42e5cc351dbbd79c29ef33af25c0250cac84837c1ff997bc111199d07e", - "OCR2ConfigPublicKey": "3b90249731beb9e4f598371f0b96c3babf47bcc62121ebc9c195e3c33e4fd708", - "CSAPublicKey": "csa_1b874ac2d54b966cec5a8358678ca6f030261aabf3372ce9dbea2d4eb9cdab3d" - } -] \ No newline at end of file diff --git a/core/scripts/keystone/src/testdata/node_sets.json b/core/scripts/keystone/src/testdata/node_sets.json new file mode 100644 index 00000000000..b5502a0ed53 --- /dev/null +++ b/core/scripts/keystone/src/testdata/node_sets.json @@ -0,0 +1,298 @@ +{ + "Workflow": { + "Name": "workflow", + "Prefix": "ks-wf-", + "Nodes": [ + { + "URL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-bt-node1.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-bt-node1.local", + "path": "" + }, + "ServiceName": "app-0-ks-wf-bt-node1", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node2.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node2.local", + "path": "" + }, + "ServiceName": "app-0-ks-wf-node2", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node3.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node3.local", + "path": "" + }, + "ServiceName": "app-0-ks-wf-node3", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node4.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node4.local", + "path": "" + }, + "ServiceName": "app-0-ks-wf-node4", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node5.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-0-ks-wf-node5.local", + "path": "" + }, + "ServiceName": "app-0-ks-wf-node5", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + } + ], + "NodeKeys": [ + { + "AptosAccount": "38476e214b5c60e642019b38db9f06ce6c5a9bcb987d2bfbbbe750195aa7e964", + "EthAddress": "0x568C859E34F210a23847acE0D4960dB74f359dC4", + "P2PPeerID": "12D3KooWFSmZaLFF1nu3mzxPKj43F89WgVDqkpvwFUHBfMHSqpVq", + "CSAPublicKey": "981d781740ff79bb181a4c70390bd54e936f2d9211f5b20c708205b481a8efcc", + "OCR2BundleID": "782e4d14d0f53071ab7a45b9085eb99beed3350e7ab72d5edd4429169e5c87ef", + "OCR2OnchainPublicKey": "357ddc6c0fc6510ec67edbb9a63819dcb47f1506", + "OCR2OffchainPublicKey": "822488a7e4583eed41e5ab142dd6be721c2cc0f217ceee0912ff2db2a24e404c", + "OCR2ConfigPublicKey": "c92ae7ff9b1cef97bb875917456bc6b83df5f5a76ad00c914869c7068748f31a", + "AptosBundleID": "d4acd2c80860fd1e49363f08426e7e5efa7fcd57356a8aba408732e975d3e9a6", + "AptosOnchainPublicKey": "48b37d91fd2c2c784759021d421e7e6f98078b4343cf8cab378394aa357a49a2" + }, + { + "AptosAccount": "bd4d7e53622621af04a0100db7720508c41f3dd5fe9e97dd57eb9673d82a385d", + "EthAddress": "0x75cf1355cC4Eb358feaBb9e269a4DAEeB6721DBB", + "P2PPeerID": "12D3KooWHhXyDmHB6D1UQosLXmhczw3zxB3DLYBuq9Unb4iCD4Sc", + "CSAPublicKey": "6a4723752c843c8d91e542af5373b3d123eca05b570a6e910f5d2f28737a26f6", + "OCR2BundleID": "20ccdc97afdf467465590115e3da4e5eb591bf5f43808e81a5d0807cd889b3c7", + "OCR2OnchainPublicKey": "321bc7af41a634375526006365a31bf32b4cfa7c", + "OCR2OffchainPublicKey": "a2b7f0b85be445e2c7317bdff74c41acd9c67b5a35cda94ae31da8a9ef886db2", + "OCR2ConfigPublicKey": "faa4cfefb226ae8e86480e019bd5bbd6405c26e22dcea40d2c6f01e583213e21", + "AptosBundleID": "ac364cec9fe7d9ea1035fc511e5b2f30900caa6e65ac0501168005d05129e088", + "AptosOnchainPublicKey": "4ca789105da974eec967758ad32b575741d6cb36c1bb3bcfd87b235502cc1753" + }, + { + "AptosAccount": "9543634f4a73e4cfb284816b32d7ec6b7ac8d07b841f2c1f714750186cc28a5a", + "EthAddress": "0xc6dcE30f492CBD223b9946603192f22D86e783ca", + "P2PPeerID": "12D3KooWEWK8e627u6S5NuwXTgGLakGpn1vzQjyjp6Regu1pcpFC", + "CSAPublicKey": "a715467dd87ea210d685b82a32f30c781031df00c2c974dc5fad9159a7ba240c", + "OCR2BundleID": "c734a4bf01aabe8152b7d0df0b18111ce9b3fe1ef1bca1d6a580967c8e4afc2d", + "OCR2OnchainPublicKey": "5192c43a68efb7a698c0459ff8591a115da128ee", + "OCR2OffchainPublicKey": "5e68d07f82ea0bf7054560775c2919bc955dd7fa73b2a36391a4dc27cbb18fdb", + "OCR2ConfigPublicKey": "ebd66285a029f443277091bc4b191b13e21a9b806ce379584411277a265c8e5c", + "AptosBundleID": "f1dfc3d44ee349b4349f33ce4c0ec3716142e9be3ae3ba9276c616556f6430bb", + "AptosOnchainPublicKey": "169008927a60e6c03e99aac6fa268dabaf4d00e117419861d87836211267361b" + }, + { + "AptosAccount": "bcd6fdce3fdcd060fed58fe13be522dc3fb0cff138b0f4f4460392f5e6d88728", + "EthAddress": "0x1289d00A6565Afcd6437B09548F6019EF49696d0", + "P2PPeerID": "12D3KooW9uJ981ocDxTJrPVxMEzPcS14WTJSU1YWH5otcpZSqkUd", + "CSAPublicKey": "9db8641f2067bfdf476e375060a0bd97c21da46d9f54c6ff4f990c6aef882478", + "OCR2BundleID": "129377e1aea4f628b2a3274e528a131175ace13e7cc062b048a34f5b4cf7b512", + "OCR2OnchainPublicKey": "ed613636925af2df6ed8332d95028eabcbe95a3f", + "OCR2OffchainPublicKey": "4eb3e2f1d324804d0adf5169bc187425d3e665c29cddf13bd57ec40ee207ce75", + "OCR2ConfigPublicKey": "effd7d3535e1b6596068085b3e19f9577a536aeacbdeea318cbd870ec678334d", + "AptosBundleID": "2e39d555ec0d1e8795167d72d2a53faa5c537762c144f8a569c601f6bcc95d1d", + "AptosOnchainPublicKey": "ce86b34de67249f92058f69e47961907ebbf8a71c12123f1d2a7cab4874f6365" + }, + { + "AptosAccount": "6549063d427778024fc4230154753c1a30eac88a7a8eab1d36014a3db48c39b3", + "EthAddress": "0x4b92B0aaC39932B7302676F48e78FA91852DC0EE", + "P2PPeerID": "12D3KooWJJC2KgoP1oih7cky9B1wL12d5CBqWFKpdfQgfujmHGyz", + "CSAPublicKey": "8c8b473cc37664a21d548477cd268013256d1d70cd9a137bdfd99da7612a93e0", + "OCR2BundleID": "053f21bfd2bbdb65261308af2d0be48593229d644d8b9e3e5dbe36f85399ae6c", + "OCR2OnchainPublicKey": "53b5bbc0efa2e2d2770029bab5d5a647a260a72b", + "OCR2OffchainPublicKey": "eac02c66802acd9cd998b9b45c52b5b36837bfb829b2838cade040e0155c774a", + "OCR2ConfigPublicKey": "43b9d0c7cace05fd17426dad4386857025a71eb08205690dff5f76224e9c7f5c", + "AptosBundleID": "3de7ab03a5b6b7fcfd196c6101d9302c5e6a5221ebd82b1fd9afa9a6bc9b0445", + "AptosOnchainPublicKey": "f2cb4932d3ce8c10bf67c60d35372a5ff1578255e25c2a119c2dea70e919567a" + } + ] + }, + "StreamsTrigger": { + "Name": "streams-trigger", + "Prefix": "ks-str-trig-", + "Nodes": [ + { + "URL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-bt-node1.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-bt-node1.local", + "path": "" + }, + "ServiceName": "app-1-ks-str-trig-bt-node1", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node2.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node2.local", + "path": "" + }, + "ServiceName": "app-1-ks-str-trig-node2", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node3.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node3.local", + "path": "" + }, + "ServiceName": "app-1-ks-str-trig-node3", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node4.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node4.local", + "path": "" + }, + "ServiceName": "app-1-ks-str-trig-node4", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + }, + { + "URL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node5.local", + "path": "" + }, + "RemoteURL": { + "scheme": "https", + "host": "crib-local-1-ks-str-trig-node5.local", + "path": "" + }, + "ServiceName": "app-1-ks-str-trig-node5", + "APILogin": "notreal@fakeemail.ch", + "APIPassword": "fj293fbBnlQ!f9vNs", + "KeystorePassword": "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ" + } + ], + "NodeKeys": [ + { + "AptosAccount": "", + "EthAddress": "0xCE59C33dc0807F194ba2566e093398dc5e459840", + "P2PPeerID": "12D3KooWGQkR76gPL7Qt1aYYHtPdU65zG4h36efLAERMwudHqGK3", + "CSAPublicKey": "b3dcb60fcf807453c95628a1e7970b077b5e2bbefb0b159841c28dc1776574de", + "OCR2BundleID": "ca2e13222b556f34ae5bc9cea72e6e7ce8221bf76e2d8b3d91505facdbbd71d3", + "OCR2OnchainPublicKey": "a4938b0552e830b45d481cca9893f319259d365c", + "OCR2OffchainPublicKey": "221fe1f972f01da727dbd6842daf4d322f7cab5a7e93816688be7a52f4088b86", + "OCR2ConfigPublicKey": "1af18519dfc5a22db640f1f8095bafaaeb987ab4e3e7ec366dfaa92df9a6ee7b", + "AptosBundleID": "", + "AptosOnchainPublicKey": "" + }, + { + "AptosAccount": "", + "EthAddress": "0x898D0206d3b3156b92bD499eDFBAfc476543A21F", + "P2PPeerID": "12D3KooWDN2jTmtrpZMpjFFuQdzxHyUecBE3zPLG4goaWG7H2iDa", + "CSAPublicKey": "bdf13ff3944d59a3e1ea5888f86c0bbfe5eb33e2140188516592bf245d080320", + "OCR2BundleID": "3b5d75124ef0f02efd46c08da4b67d36154eed680d7dafd360d976430fe11a7b", + "OCR2OnchainPublicKey": "3815f48818db64aa8d7b225e229a328826f3d1de", + "OCR2OffchainPublicKey": "ca6f4c20c00fb7af411060cfc226d61d11ce5e3532ebbd15786fe53c32244de3", + "OCR2ConfigPublicKey": "7b4e462c24d9076a8822bd4e2bdbd834fcc7898aabd9862dbcdb7df6686d2b41", + "AptosBundleID": "", + "AptosOnchainPublicKey": "" + }, + { + "AptosAccount": "", + "EthAddress": "0xb26dD9CD1Fc4Df2F84170960E2a36ed4a5ac6bB7", + "P2PPeerID": "12D3KooWJTedkdgDmkAms4pEKDnXX7CXshkxwEcK6hWki519YEqF", + "CSAPublicKey": "e95ded4fc733eac43292dc24d8630101cf0c3f40c3764233a6321077eacd0b90", + "OCR2BundleID": "742b2a8a90e59aeb8bb35313d4078ef3f950a9e42a157b7ee9e9abd8c7d97d94", + "OCR2OnchainPublicKey": "57b41043e9a2b21329be48ccf72943af20b322ff", + "OCR2OffchainPublicKey": "0d90fc04c4c0439c184a06478ec1fed7cedfb799b303a6d68c046d90f077b5bd", + "OCR2ConfigPublicKey": "a73c070b60c9a175ac34cfd5c6c7884e73b5c8d43417be3f00bc43ac0fb67f39", + "AptosBundleID": "", + "AptosOnchainPublicKey": "" + }, + { + "AptosAccount": "", + "EthAddress": "0x50b1bB407F0Ecd71416BfA8a1d703F6115112676", + "P2PPeerID": "12D3KooWS1i3x2r34vYCfYrz2ddWUVYtFGNaZvGNNxqzL4Rysd3V", + "CSAPublicKey": "46b50be4d72b03f1601ade056bc754f194d6418283065970d470f6f3243f0705", + "OCR2BundleID": "1232eb7cdb4145ec8b543b76f17fe59c69aa6df31c827a7553aea3a3d340c637", + "OCR2OnchainPublicKey": "dad1e5d6824d7b64df57e9ca3342e4caf66b2c91", + "OCR2OffchainPublicKey": "8a7e9833bf8a55435c82866dbe5f9a9bac63b9a93c8c55664dffe653ab4145a2", + "OCR2ConfigPublicKey": "48ce76ee5ddd8003ebbd10485a092f8bd237f0f855aca8aba5ccac78b593e62d", + "AptosBundleID": "", + "AptosOnchainPublicKey": "" + }, + { + "AptosAccount": "", + "EthAddress": "0xa2340108BE2c563bB89462b464aCF3f88cCd1584", + "P2PPeerID": "12D3KooWLZFWAhTejyR7WwwQndgNGGiW3XcGKK6nNtWbhdgCG1rC", + "CSAPublicKey": "0837cd5a8544664eaf04f68347bdba4cb7ac6af34488f0a26c65b03fe223d5af", + "OCR2BundleID": "2fcbac5dd48e995772d85c47d2744b0df7b74b71d17001f283318cae43b96add", + "OCR2OnchainPublicKey": "469d3c0c484c6846be1176920f1cbdc8abb6f638", + "OCR2OffchainPublicKey": "21aa97506b74e3bfcbe6eb87f2a6add07898fecbddbcec2447832dc343395499", + "OCR2ConfigPublicKey": "a6b7e8ca4faf6122165928d82354de3f9334cdb47af058f6a983d11473c21b5f", + "AptosBundleID": "", + "AptosOnchainPublicKey": "" + } + ] + } +} diff --git a/core/scripts/keystone/templates/bootstrap.toml b/core/scripts/keystone/templates/bootstrap.toml deleted file mode 100644 index cdd9065caba..00000000000 --- a/core/scripts/keystone/templates/bootstrap.toml +++ /dev/null @@ -1,9 +0,0 @@ -type = "bootstrap" -schemaVersion = 1 -name = "Keystone boot" -contractID = "{{ ocr_config_contract_address }}" -relay = "evm" - -[relayConfig] -chainID = "{{ chain_id }}" -providerType = "ocr3-capability" diff --git a/core/scripts/keystone/templates/crib-overrides.yaml b/core/scripts/keystone/templates/crib-overrides.yaml deleted file mode 100644 index baeaa5fa1d9..00000000000 --- a/core/scripts/keystone/templates/crib-overrides.yaml +++ /dev/null @@ -1,41 +0,0 @@ -helm: - values: - chainlink: - nodes: - node1: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - node2: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '{{ node_2_address }}' - ForwarderAddress = '{{ forwarder_address }}' - node3: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '{{ node_3_address }}' - ForwarderAddress = '{{ forwarder_address }}' - node4: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '{{ node_4_address }}' - ForwarderAddress = '{{ forwarder_address }}' - node5: - image: ${runtime.images.app} - overridesToml: |- - [[EVM]] - ChainID = '11155111' - [EVM.Workflow] - FromAddress = '{{ node_5_address }}' - ForwarderAddress = '{{ forwarder_address }}' diff --git a/core/scripts/keystone/templates/oracle.toml b/core/scripts/keystone/templates/oracle.toml deleted file mode 100644 index 053baa2223b..00000000000 --- a/core/scripts/keystone/templates/oracle.toml +++ /dev/null @@ -1,27 +0,0 @@ -type = "offchainreporting2" -schemaVersion = 1 -name = "Keystone" -contractID = "{{ ocr_config_contract_address }}" -ocrKeyBundleID = "{{ ocr_key_bundle_id }}" -p2pv2Bootstrappers = [ - "{{ bootstrapper_p2p_id }}", -] -relay = "evm" -pluginType = "plugin" -transmitterID = "{{ transmitter_id }}" - -[relayConfig] -chainID = "{{ chain_id }}" - -[pluginConfig] -command = "chainlink-ocr3-capability" -ocrVersion = 3 -pluginName = "ocr-capability" -providerType = "ocr3-capability" -telemetryType = "plugin" - -[onchainSigningStrategy] -strategyName = 'multi-chain' -[onchainSigningStrategy.config] -evm = "{{ ocr_key_bundle_id }}" -aptos = "{{ aptos_key_bundle_id }}" diff --git a/core/services/job/models.go b/core/services/job/models.go index 26d563c7ac8..63e521c5b3b 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -935,7 +935,7 @@ func (w *WorkflowSpec) SDKSpec(ctx context.Context) (sdk.WorkflowSpec, error) { } spec, rawSpec, cid, err := workflowSpecFactory.Spec(ctx, w.Workflow, w.Config) if err != nil { - return sdk.WorkflowSpec{}, err + return sdk.WorkflowSpec{}, fmt.Errorf("spec factory failed: %w", err) } w.sdkWorkflow = &spec w.rawSpec = rawSpec diff --git a/deployment/go.mod b/deployment/go.mod index 2daefd78f11..872c3bd7815 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -9,7 +9,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../ // Using a separate inline `require` here to avoid surrounding line changes // creating potential merge conflicts. -require github.com/smartcontractkit/chainlink/v2 v2.0.0-20241206210521-125d98cdaf66 +require github.com/smartcontractkit/chainlink/v2 v2.0.0-20241212011003-de1a8f5e5b42 require ( github.com/Khan/genqlient v0.7.0 diff --git a/integration-tests/go.mod b/integration-tests/go.mod index cc161d6b92a..f79a1e66a0d 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -12,8 +12,8 @@ replace github.com/smartcontractkit/chainlink/deployment => ../deployment // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20241206210521-125d98cdaf66 - github.com/smartcontractkit/chainlink/v2 v2.0.0-20241206210521-125d98cdaf66 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20241212011003-de1a8f5e5b42 + github.com/smartcontractkit/chainlink/v2 v2.0.0-20241212011003-de1a8f5e5b42 ) require ( diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index fbf204e160d..ab7a58df9e9 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -14,9 +14,9 @@ replace github.com/smartcontractkit/chainlink/integration-tests => ../ // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20241206210521-125d98cdaf66 - github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241206210521-125d98cdaf66 - github.com/smartcontractkit/chainlink/v2 v2.0.0-20241206210521-125d98cdaf66 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20241212011003-de1a8f5e5b42 + github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241212011003-de1a8f5e5b42 + github.com/smartcontractkit/chainlink/v2 v2.0.0-20241212011003-de1a8f5e5b42 ) require ( diff --git a/shell.nix b/shell.nix index 456bbd8a9c1..9860ae78cc5 100644 --- a/shell.nix +++ b/shell.nix @@ -111,11 +111,10 @@ in echo "GORELEASER_KEY must be set in CRIB environments. You can find it in our 1p vault under 'goreleaser-pro-license'." exit 1 fi - ${if stdenv.isDarwin then "source ./nix-darwin-shell-hook.sh" else ""} + ${if stdenv.isDarwin then "source $(git rev-parse --show-toplevel)/nix-darwin-shell-hook.sh" else ""} ''} ''; - GOROOT = "${go}/share/go"; PGDATA = "db"; CL_DATABASE_URL = "postgresql://chainlink:chainlink@localhost:5432/chainlink_test?sslmode=disable"; } diff --git a/tools/goreleaser-config/go.mod b/tools/goreleaser-config/go.mod index f46423b660d..d0e66514869 100644 --- a/tools/goreleaser-config/go.mod +++ b/tools/goreleaser-config/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/tools/goreleaser-config -go 1.23.0 +go 1.22.8 require ( github.com/goreleaser/goreleaser-pro/v2 v2.3.2-pro From 98adf6d1efaf9b8b15c889706fd6d604047275b1 Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 13 Jan 2025 11:33:05 +0000 Subject: [PATCH 35/91] [CRE-47] Add safeurl to protect against SSRF (#15885) --- core/scripts/go.mod | 1 + core/scripts/go.sum | 2 + core/services/gateway/network/httpclient.go | 43 +++++- .../gateway/network/httpclient_test.go | 143 ++++++++++++++++-- deployment/go.mod | 1 + deployment/go.sum | 2 + go.mod | 1 + go.sum | 2 + integration-tests/go.mod | 1 + integration-tests/go.sum | 2 + integration-tests/load/go.mod | 1 + integration-tests/load/go.sum | 2 + 12 files changed, 182 insertions(+), 19 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 897962a6454..ed17147d67e 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -131,6 +131,7 @@ require ( github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dominikbraun/graph v0.23.0 // indirect + github.com/doyensec/safeurl v0.2.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 7cb29867b3a..5af14a2eaa9 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -370,6 +370,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= +github.com/doyensec/safeurl v0.2.1 h1:DY15JorEfQsnpBWhBkVQIkaif2jfxCC14PIuGDsjDVs= +github.com/doyensec/safeurl v0.2.1/go.mod h1:wzSXqC/6Z410qHz23jtBWT+wQ8yTxcY0p8bZH/4EZIg= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= diff --git a/core/services/gateway/network/httpclient.go b/core/services/gateway/network/httpclient.go index 52130c8d069..18f34118300 100644 --- a/core/services/gateway/network/httpclient.go +++ b/core/services/gateway/network/httpclient.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "github.com/doyensec/safeurl" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) @@ -19,6 +21,28 @@ type HTTPClient interface { type HTTPClientConfig struct { MaxResponseBytes uint32 DefaultTimeout time.Duration + BlockedIPs []string + BlockedIPsCIDR []string + AllowedPorts []int + AllowedSchemes []string +} + +var ( + defaultAllowedPorts = []int{80, 443} + defaultAllowedSchemes = []string{"http", "https"} +) + +func (c *HTTPClientConfig) ApplyDefaults() { + if len(c.AllowedPorts) == 0 { + c.AllowedPorts = defaultAllowedPorts + } + + if len(c.AllowedSchemes) == 0 { + c.AllowedSchemes = defaultAllowedSchemes + } + + // safeurl automatically blocks internal IPs so no need + // to set defaults here. } type HTTPRequest struct { @@ -35,7 +59,7 @@ type HTTPResponse struct { } type httpClient struct { - client *http.Client + client *safeurl.WrappedClient config HTTPClientConfig lggr logger.Logger } @@ -43,13 +67,20 @@ type httpClient struct { // NewHTTPClient creates a new NewHTTPClient // As of now, the client does not support TLS configuration but may be extended in the future func NewHTTPClient(config HTTPClientConfig, lggr logger.Logger) (HTTPClient, error) { + config.ApplyDefaults() + safeConfig := safeurl. + GetConfigBuilder(). + SetTimeout(config.DefaultTimeout). + SetAllowedPorts(config.AllowedPorts...). + SetAllowedSchemes(config.AllowedSchemes...). + SetBlockedIPs(config.BlockedIPs...). + SetBlockedIPsCIDR(config.BlockedIPsCIDR...). + Build() + return &httpClient{ config: config, - client: &http.Client{ - Timeout: config.DefaultTimeout, - Transport: http.DefaultTransport, - }, - lggr: lggr, + client: safeurl.Client(safeConfig), + lggr: lggr, }, nil } diff --git a/core/services/gateway/network/httpclient_test.go b/core/services/gateway/network/httpclient_test.go index 2f4cc448ef5..f6e769066a7 100644 --- a/core/services/gateway/network/httpclient_test.go +++ b/core/services/gateway/network/httpclient_test.go @@ -1,16 +1,18 @@ -package network_test +package network import ( "context" "net/http" "net/http/httptest" + "net/url" + "strconv" "testing" "time" + "github.com/doyensec/safeurl" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/gateway/network" ) func TestHTTPClient_Send(t *testing.T) { @@ -18,20 +20,18 @@ func TestHTTPClient_Send(t *testing.T) { // Setup the test environment lggr := logger.Test(t) - config := network.HTTPClientConfig{ + config := HTTPClientConfig{ MaxResponseBytes: 1024, DefaultTimeout: 5 * time.Second, } - client, err := network.NewHTTPClient(config, lggr) - require.NoError(t, err) // Define test cases tests := []struct { name string setupServer func() *httptest.Server - request network.HTTPRequest + request HTTPRequest expectedError error - expectedResp *network.HTTPResponse + expectedResp *HTTPResponse }{ { name: "successful request", @@ -42,7 +42,7 @@ func TestHTTPClient_Send(t *testing.T) { require.NoError(t, err2) })) }, - request: network.HTTPRequest{ + request: HTTPRequest{ Method: "GET", URL: "/", Headers: map[string]string{}, @@ -50,7 +50,7 @@ func TestHTTPClient_Send(t *testing.T) { Timeout: 2 * time.Second, }, expectedError: nil, - expectedResp: &network.HTTPResponse{ + expectedResp: &HTTPResponse{ StatusCode: http.StatusOK, Headers: map[string]string{"Content-Length": "7"}, Body: []byte("success"), @@ -66,7 +66,7 @@ func TestHTTPClient_Send(t *testing.T) { require.NoError(t, err2) })) }, - request: network.HTTPRequest{ + request: HTTPRequest{ Method: "GET", URL: "/", Headers: map[string]string{}, @@ -85,7 +85,7 @@ func TestHTTPClient_Send(t *testing.T) { require.NoError(t, err2) })) }, - request: network.HTTPRequest{ + request: HTTPRequest{ Method: "GET", URL: "/", Headers: map[string]string{}, @@ -93,7 +93,7 @@ func TestHTTPClient_Send(t *testing.T) { Timeout: 2 * time.Second, }, expectedError: nil, - expectedResp: &network.HTTPResponse{ + expectedResp: &HTTPResponse{ StatusCode: http.StatusInternalServerError, Headers: map[string]string{"Content-Length": "5"}, Body: []byte("error"), @@ -108,7 +108,7 @@ func TestHTTPClient_Send(t *testing.T) { require.NoError(t, err2) })) }, - request: network.HTTPRequest{ + request: HTTPRequest{ Method: "GET", URL: "/", Headers: map[string]string{}, @@ -126,6 +126,26 @@ func TestHTTPClient_Send(t *testing.T) { server := tt.setupServer() defer server.Close() + u, err := url.Parse(server.URL) + require.NoError(t, err) + + hostname, port := u.Hostname(), u.Port() + portInt, err := strconv.ParseInt(port, 10, 32) + require.NoError(t, err) + + safeConfig := safeurl. + GetConfigBuilder(). + SetTimeout(config.DefaultTimeout). + SetAllowedIPs(hostname). + SetAllowedPorts(int(portInt)). + Build() + + client := &httpClient{ + config: config, + client: safeurl.Client(safeConfig), + lggr: lggr, + } + tt.request.URL = server.URL + tt.request.URL resp, err := client.Send(context.Background(), tt.request) @@ -145,3 +165,100 @@ func TestHTTPClient_Send(t *testing.T) { }) } } + +func TestHTTPClient_BlocksUnallowed(t *testing.T) { + t.Parallel() + + // Setup the test environment + lggr := logger.Test(t) + config := HTTPClientConfig{ + MaxResponseBytes: 1024, + DefaultTimeout: 5 * time.Second, + } + + client, err := NewHTTPClient(config, lggr) + require.NoError(t, err) + + // Define test cases + tests := []struct { + name string + request HTTPRequest + expectedError string + }{ + { + name: "blocked port", + request: HTTPRequest{ + Method: "GET", + URL: "http://127.0.0.1:8080", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: "port: 8080 not found in allowlist", + }, + { + name: "blocked scheme", + request: HTTPRequest{ + Method: "GET", + URL: "file://127.0.0.1", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: "scheme: file not found in allowlist", + }, + { + name: "explicitly blocked IP", + request: HTTPRequest{ + Method: "GET", + URL: "http://169.254.0.1", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: "ip: 169.254.0.1 not found in allowlist", + }, + { + name: "explicitly blocked IP - internal network", + request: HTTPRequest{ + Method: "GET", + URL: "http://169.254.0.1/endpoint", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: "ip: 169.254.0.1 not found in allowlist", + }, + { + name: "explicitly blocked IP - localhost", + request: HTTPRequest{ + Method: "GET", + URL: "http://127.0.0.1/endpoint", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: "ip: 127.0.0.1 not found in allowlist", + }, + { + name: "explicitly blocked IP - current network", + request: HTTPRequest{ + Method: "GET", + URL: "http://0.0.0.0/endpoint", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: "ip: 0.0.0.0 not found in allowlist", + }, + } + + // Execute test cases + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := client.Send(context.Background(), tt.request) + require.Error(t, err) + require.ErrorContains(t, err, tt.expectedError) + }) + } +} diff --git a/deployment/go.mod b/deployment/go.mod index 872c3bd7815..111539fc2b5 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -177,6 +177,7 @@ require ( github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dominikbraun/graph v0.23.0 // indirect + github.com/doyensec/safeurl v0.2.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 5e7d0ad9ced..fbb668cfe93 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -460,6 +460,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= +github.com/doyensec/safeurl v0.2.1 h1:DY15JorEfQsnpBWhBkVQIkaif2jfxCC14PIuGDsjDVs= +github.com/doyensec/safeurl v0.2.1/go.mod h1:wzSXqC/6Z410qHz23jtBWT+wQ8yTxcY0p8bZH/4EZIg= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= diff --git a/go.mod b/go.mod index 3d4c747034e..49dee03521f 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/deckarep/golang-set/v2 v2.6.0 github.com/dominikbraun/graph v0.23.0 + github.com/doyensec/safeurl v0.2.1 github.com/esote/minmaxheap v1.0.0 github.com/ethereum/go-ethereum v1.14.11 github.com/fatih/color v1.17.0 diff --git a/go.sum b/go.sum index 44fb07ef951..47caf1ff41c 100644 --- a/go.sum +++ b/go.sum @@ -358,6 +358,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= +github.com/doyensec/safeurl v0.2.1 h1:DY15JorEfQsnpBWhBkVQIkaif2jfxCC14PIuGDsjDVs= +github.com/doyensec/safeurl v0.2.1/go.mod h1:wzSXqC/6Z410qHz23jtBWT+wQ8yTxcY0p8bZH/4EZIg= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index f79a1e66a0d..88eeb3e7fe6 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -196,6 +196,7 @@ require ( github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dominikbraun/graph v0.23.0 // indirect + github.com/doyensec/safeurl v0.2.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 52c0922d743..d50ef55c53c 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -464,6 +464,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= +github.com/doyensec/safeurl v0.2.1 h1:DY15JorEfQsnpBWhBkVQIkaif2jfxCC14PIuGDsjDVs= +github.com/doyensec/safeurl v0.2.1/go.mod h1:wzSXqC/6Z410qHz23jtBWT+wQ8yTxcY0p8bZH/4EZIg= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index ab7a58df9e9..f6da8952689 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -166,6 +166,7 @@ require ( github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dominikbraun/graph v0.23.0 // indirect + github.com/doyensec/safeurl v0.2.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 0ed3bcbf368..4f490d077e3 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -456,6 +456,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= +github.com/doyensec/safeurl v0.2.1 h1:DY15JorEfQsnpBWhBkVQIkaif2jfxCC14PIuGDsjDVs= +github.com/doyensec/safeurl v0.2.1/go.mod h1:wzSXqC/6Z410qHz23jtBWT+wQ8yTxcY0p8bZH/4EZIg= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= From 1251ee3a2c7bb6547b1b73a829da0fe04a49c5c5 Mon Sep 17 00:00:00 2001 From: george-dorin <120329946+george-dorin@users.noreply.github.com> Date: Mon, 13 Jan 2025 19:28:02 +0200 Subject: [PATCH 36/91] Refactor secondary transmission (#15358) * Refactor secondary transmission * Add dual transmission ABI * Update dual transmission ABI * Update ABI Add forwarder for secondary transmission * Refactor dual transmitter Add tests * Add missing test file * Add missing file * Fix lint * Fix lint Fix test * Pass txManagerOCR2 to ocr2FeedsDualTransmission * Add dualTransmission meta validation * Implement feedback * Add ContractTransmitter helper function * Add debug logging * Add hint and refund validation * rename file typo --- core/services/job/job_orm_test.go | 93 ++++++++- core/services/job/orm.go | 76 ++++++++ .../plugins/ccip/transmitter/transmitter.go | 6 + core/services/ocrcommon/dual_transmitter.go | 134 +++++++++++++ core/services/ocrcommon/transmitter.go | 94 +++------ core/services/ocrcommon/transmitter_test.go | 1 + .../relay/evm/contract_transmitter.go | 43 ++-- .../relay/evm/contract_transmitter_test.go | 4 + .../relay/evm/dual_contract_transmitter.go | 184 ++++++++++++++++++ .../evm/dual_contract_transmitter_test.go | 164 ++++++++++++++++ core/services/relay/evm/evm.go | 31 ++- 11 files changed, 743 insertions(+), 87 deletions(-) create mode 100644 core/services/ocrcommon/dual_transmitter.go create mode 100644 core/services/relay/evm/dual_contract_transmitter.go create mode 100644 core/services/relay/evm/dual_contract_transmitter_test.go diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index 7a310d6f791..6e7a0b2a034 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -2119,7 +2119,8 @@ func TestORM_CreateJob_OCR2_With_DualTransmission(t *testing.T) { require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "invalid transmitter address in dual transmission config") dtTransmitterAddress := cltest.MustGenerateRandomKey(t) - completeDualTransmissionSpec := fmt.Sprintf(` + + metaNotSliceDualTransmissionSpec := fmt.Sprintf(` enableDualTransmission=true [relayConfig.dualTransmission] contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' @@ -2130,6 +2131,96 @@ func TestORM_CreateJob_OCR2_With_DualTransmission(t *testing.T) { `, dtTransmitterAddress.Address.String()) + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+metaNotSliceDualTransmissionSpec, nil) + require.NoError(t, err) + require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "dual transmission meta value key1 is not a slice") + + hintNotValidDualTransmissionSpec := fmt.Sprintf(` + enableDualTransmission=true + [relayConfig.dualTransmission] + contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' + transmitterAddress = '%s' + [relayConfig.dualTransmission.meta] + hint = ['some-invalid-hint'] + key2 = ['val2','val3'] + `, + dtTransmitterAddress.Address.String()) + + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+hintNotValidDualTransmissionSpec, nil) + require.NoError(t, err) + require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "dual transmission meta.hint value some-invalid-hint should be one of the following [contract_address function_selector logs calldata default_logs]") + + invalidRefundFormatDualTransmissionSpec := fmt.Sprintf(` + enableDualTransmission=true + [relayConfig.dualTransmission] + contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' + transmitterAddress = '%s' + [relayConfig.dualTransmission.meta] + hint = ['calldata','logs'] + refund = ['0x00'] + `, + dtTransmitterAddress.Address.String()) + + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+invalidRefundFormatDualTransmissionSpec, nil) + require.NoError(t, err) + require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "invalid dual transmission refund, format should be

:") + + invalidRefundAddressFormatDualTransmissionSpec := fmt.Sprintf(` + enableDualTransmission=true + [relayConfig.dualTransmission] + contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' + transmitterAddress = '%s' + [relayConfig.dualTransmission.meta] + hint = ['calldata','logs'] + refund = ['0x000:50'] + `, + dtTransmitterAddress.Address.String()) + + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+invalidRefundAddressFormatDualTransmissionSpec, nil) + require.NoError(t, err) + require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "invalid dual transmission refund address, 0x000 is not a valid address") + + invalidRefundPercentFormatDualTransmissionSpec := fmt.Sprintf(` + enableDualTransmission=true + [relayConfig.dualTransmission] + contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' + transmitterAddress = '%s' + [relayConfig.dualTransmission.meta] + hint = ['calldata','logs'] + refund = ['0x0000000000000000000000000000000000000000:A'] + `, + dtTransmitterAddress.Address.String()) + + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+invalidRefundPercentFormatDualTransmissionSpec, nil) + require.NoError(t, err) + require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "invalid dual transmission refund percent, A is not a number") + + invalidRefundPercentTotalFormatDualTransmissionSpec := fmt.Sprintf(` + enableDualTransmission=true + [relayConfig.dualTransmission] + contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' + transmitterAddress = '%s' + [relayConfig.dualTransmission.meta] + hint = ['calldata','logs'] + refund = ['0x0000000000000000000000000000000000000000:50','0x0000000000000000000000000000000000000001:50'] + `, + dtTransmitterAddress.Address.String()) + + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+invalidRefundPercentTotalFormatDualTransmissionSpec, nil) + require.NoError(t, err) + require.ErrorContains(t, jobORM.CreateJob(ctx, &jb), "invalid dual transmission refund percentages, total sum of percentages must be less than 100") + + completeDualTransmissionSpec := fmt.Sprintf(` + enableDualTransmission=true + [relayConfig.dualTransmission] + contractAddress = '0x613a38AC1659769640aaE063C651F48E0250454C' + transmitterAddress = '%s' + [relayConfig.dualTransmission.meta] + key1 = ['val1'] + key2 = ['val2','val3'] + `, + dtTransmitterAddress.Address.String()) + jb, err = ocr2validate.ValidatedOracleSpecToml(testutils.Context(t), config.OCR2(), config.Insecure(), baseJobSpec+completeDualTransmissionSpec, nil) require.NoError(t, err) diff --git a/core/services/job/orm.go b/core/services/job/orm.go index fa64404ec3a..62cc2cd596a 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -7,6 +7,8 @@ import ( "fmt" "reflect" "slices" + "strconv" + "strings" "time" "github.com/ethereum/go-ethereum/common" @@ -326,9 +328,19 @@ func (o *orm) CreateJob(ctx context.Context, jb *Job) error { return errors.New("invalid transmitter address in dual transmission config") } + rawMeta, ok := dualTransmissionConfig["meta"].(map[string]interface{}) + if !ok { + return errors.New("invalid dual transmission meta") + } + + if err = validateDualTransmissionMeta(rawMeta); err != nil { + return err + } + if err = validateKeyStoreMatchForRelay(ctx, jb.OCR2OracleSpec.Relay, tx.keyStore, dtTransmitterAddress); err != nil { return errors.Wrap(err, "unknown dual transmission transmitterAddress") } + } specID, err := tx.insertOCR2OracleSpec(ctx, jb.OCR2OracleSpec) @@ -1669,3 +1681,67 @@ func (r legacyGasStationServerSpecRow) toLegacyGasStationServerSpec() *LegacyGas func (o *orm) loadJobSpecErrors(ctx context.Context, jb *Job) error { return errors.Wrapf(o.ds.SelectContext(ctx, &jb.JobSpecErrors, `SELECT * FROM job_spec_errors WHERE job_id = $1`, jb.ID), "failed to load job spec errors for job %d", jb.ID) } + +func validateDualTransmissionHint(vals []interface{}) error { + accepted := []string{"contract_address", "function_selector", "logs", "calldata", "default_logs"} + for _, v := range vals { + valString, ok := v.(string) + if !ok { + return errors.Errorf("dual transmission meta value %v is not a string", v) + } + if !slices.Contains(accepted, valString) { + return errors.Errorf("dual transmission meta.hint value %s should be one of the following %s", valString, accepted) + } + } + return nil +} + +func validateDualTransmissionRefund(vals []interface{}) error { + totalRefund := 0 + for _, v := range vals { + valString, ok := v.(string) + if !ok { + return errors.Errorf("dual transmission meta value %v is not a string", v) + } + + s := strings.Split(valString, ":") + if len(s) != 2 { + return errors.New("invalid dual transmission refund, format should be
:") + } + if !common.IsHexAddress(s[0]) { + return errors.Errorf("invalid dual transmission refund address, %s is not a valid address", s[0]) + } + percent, err := strconv.Atoi(s[1]) + if err != nil { + return errors.Errorf("invalid dual transmission refund percent, %s is not a number", s[1]) + } + totalRefund += percent + } + + if totalRefund >= 100 { + return errors.New("invalid dual transmission refund percentages, total sum of percentages must be less than 100") + } + return nil +} + +func validateDualTransmissionMeta(meta map[string]interface{}) error { + for k, v := range meta { + metaFieldValues, ok := v.([]interface{}) + if !ok { + return errors.Errorf("dual transmission meta value %s is not a slice", k) + } + if k == "hint" { + if err := validateDualTransmissionHint(metaFieldValues); err != nil { + return err + } + } + + if k == "refund" { + if err := validateDualTransmissionRefund(metaFieldValues); err != nil { + return err + } + } + } + + return nil +} diff --git a/core/services/ocr2/plugins/ccip/transmitter/transmitter.go b/core/services/ocr2/plugins/ccip/transmitter/transmitter.go index 24123d03337..abb023a4251 100644 --- a/core/services/ocr2/plugins/ccip/transmitter/transmitter.go +++ b/core/services/ocr2/plugins/ccip/transmitter/transmitter.go @@ -26,6 +26,8 @@ type txManager interface { type Transmitter interface { CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error FromAddress(context.Context) common.Address + + CreateSecondaryEthTransaction(context.Context, []byte, *txmgr.TxMeta) error } type transmitter struct { @@ -141,3 +143,7 @@ func (t *transmitter) forwarderAddress() common.Address { } return t.effectiveTransmitterAddress } + +func (t *transmitter) CreateSecondaryEthTransaction(ctx context.Context, bytes []byte, meta *txmgr.TxMeta) error { + return errors.New("trying to send a secondary transmission on a non dual transmitter") +} diff --git a/core/services/ocrcommon/dual_transmitter.go b/core/services/ocrcommon/dual_transmitter.go new file mode 100644 index 00000000000..efc60978f19 --- /dev/null +++ b/core/services/ocrcommon/dual_transmitter.go @@ -0,0 +1,134 @@ +package ocrcommon + +import ( + "context" + "math/big" + "net/url" + "slices" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" +) + +type ocr2FeedsDualTransmission struct { + txm txManager + primaryFromAddresses []common.Address + gasLimit uint64 + primaryEffectiveTransmitterAddress common.Address + strategy types.TxStrategy + checker txmgr.TransmitCheckerSpec + chainID *big.Int + keystore roundRobinKeystore + + ocr2Aggregator common.Address + txManagerOCR2 + + secondaryContractAddress common.Address + secondaryFromAddress common.Address + secondaryMeta map[string][]string +} + +func (t *ocr2FeedsDualTransmission) forwarderAddress(ctx context.Context, eoa, ocr2Aggregator common.Address) (common.Address, error) { + // If effectiveTransmitterAddress is in fromAddresses, then forwarders aren't set. + if slices.Contains(t.primaryFromAddresses, t.primaryEffectiveTransmitterAddress) { + return common.Address{}, nil + } + + forwarderAddress, err := t.GetForwarderForEOAOCR2Feeds(ctx, eoa, ocr2Aggregator) + if err != nil { + return common.Address{}, err + } + + // if forwarder address is in fromAddresses, then none of the forwarders are valid + if slices.Contains(t.primaryFromAddresses, forwarderAddress) { + forwarderAddress = common.Address{} + } + + return forwarderAddress, nil +} + +func (t *ocr2FeedsDualTransmission) CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error { + roundRobinFromAddress, err := t.keystore.GetRoundRobinAddress(ctx, t.chainID, t.primaryFromAddresses...) + if err != nil { + return errors.Wrap(err, "skipped OCR transmission, error getting round-robin address") + } + + forwarderAddress, err := t.forwarderAddress(ctx, roundRobinFromAddress, toAddress) + if err != nil { + return err + } + + _, err = t.txm.CreateTransaction(ctx, txmgr.TxRequest{ + FromAddress: roundRobinFromAddress, + ToAddress: toAddress, + EncodedPayload: payload, + FeeLimit: t.gasLimit, + ForwarderAddress: forwarderAddress, + Strategy: t.strategy, + Checker: t.checker, + Meta: txMeta, + }) + + return errors.Wrap(err, "skipped OCR transmission: skipped primary transmission") +} + +func (t *ocr2FeedsDualTransmission) CreateSecondaryEthTransaction(ctx context.Context, payload []byte, txMeta *txmgr.TxMeta) error { + forwarderAddress, err := t.forwarderAddress(ctx, t.secondaryFromAddress, t.secondaryContractAddress) + if err != nil { + return err + } + + if txMeta == nil { + txMeta = &txmgr.TxMeta{} + } + + dualBroadcast := true + dualBroadcastParams := t.urlParams() + + txMeta.DualBroadcast = &dualBroadcast + txMeta.DualBroadcastParams = &dualBroadcastParams + + _, err = t.txm.CreateTransaction(ctx, txmgr.TxRequest{ + FromAddress: t.secondaryFromAddress, + ToAddress: t.secondaryContractAddress, + EncodedPayload: payload, + ForwarderAddress: forwarderAddress, + FeeLimit: t.gasLimit, + Strategy: t.strategy, + Checker: t.checker, + Meta: txMeta, + }) + + return errors.Wrap(err, "skipped secondary transmission") +} + +func (t *ocr2FeedsDualTransmission) FromAddress(ctx context.Context) common.Address { + roundRobinFromAddress, err := t.keystore.GetRoundRobinAddress(ctx, t.chainID, t.primaryFromAddresses...) + if err != nil { + return t.primaryEffectiveTransmitterAddress + } + + forwarderAddress, err := t.GetForwarderForEOAOCR2Feeds(ctx, roundRobinFromAddress, t.ocr2Aggregator) + if errors.Is(err, forwarders.ErrForwarderForEOANotFound) { + // if there are no valid forwarders try to fallback to eoa + return roundRobinFromAddress + } else if err != nil { + return t.primaryEffectiveTransmitterAddress + } + + return forwarderAddress +} + +func (t *ocr2FeedsDualTransmission) urlParams() string { + values := url.Values{} + for k, v := range t.secondaryMeta { + for _, p := range v { + values.Add(k, p) + } + } + return values.Encode() +} diff --git a/core/services/ocrcommon/transmitter.go b/core/services/ocrcommon/transmitter.go index 8121f3778d2..01200bbb7cb 100644 --- a/core/services/ocrcommon/transmitter.go +++ b/core/services/ocrcommon/transmitter.go @@ -2,10 +2,7 @@ package ocrcommon import ( "context" - errors2 "errors" - "fmt" "math/big" - "net/url" "slices" "github.com/ethereum/go-ethereum/common" @@ -28,6 +25,8 @@ type txManager interface { type Transmitter interface { CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error FromAddress(context.Context) common.Address + + CreateSecondaryEthTransaction(context.Context, []byte, *txmgr.TxMeta) error } type transmitter struct { @@ -99,7 +98,24 @@ func NewOCR2FeedsTransmitter( return nil, errors.New("nil keystore provided to transmitter") } - baseTransmitter := &ocr2FeedsTransmitter{ + if dualTransmissionConfig != nil { + return &ocr2FeedsDualTransmission{ + ocr2Aggregator: ocr2Aggregator, + txm: txm, + txManagerOCR2: txm, + primaryFromAddresses: fromAddresses, + gasLimit: gasLimit, + primaryEffectiveTransmitterAddress: effectiveTransmitterAddress, + strategy: strategy, + checker: checker, + chainID: chainID, + keystore: keystore, + secondaryContractAddress: dualTransmissionConfig.ContractAddress, + secondaryFromAddress: dualTransmissionConfig.TransmitterAddress, + secondaryMeta: dualTransmissionConfig.Meta, + }, nil + } + return &ocr2FeedsTransmitter{ ocr2Aggregator: ocr2Aggregator, txManagerOCR2: txm, transmitter: transmitter{ @@ -112,17 +128,7 @@ func NewOCR2FeedsTransmitter( chainID: chainID, keystore: keystore, }, - } - - if dualTransmissionConfig != nil { - return &ocr2FeedsDualTransmission{ - transmitter: *baseTransmitter, - secondaryContractAddress: dualTransmissionConfig.ContractAddress, - secondaryFromAddress: dualTransmissionConfig.TransmitterAddress, - secondaryMeta: dualTransmissionConfig.Meta, - }, nil - } - return baseTransmitter, nil + }, nil } func (t *transmitter) CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error { @@ -144,6 +150,10 @@ func (t *transmitter) CreateEthTransaction(ctx context.Context, toAddress common return errors.Wrap(err, "skipped OCR transmission") } +func (t *transmitter) CreateSecondaryEthTransaction(ctx context.Context, bytes []byte, meta *txmgr.TxMeta) error { + return errors.New("trying to send a secondary transmission on a non dual transmitter") +} + func (t *transmitter) FromAddress(context.Context) common.Address { return t.effectiveTransmitterAddress } @@ -219,56 +229,6 @@ func (t *ocr2FeedsTransmitter) forwarderAddress(ctx context.Context, eoa, ocr2Ag return forwarderAddress, nil } -type ocr2FeedsDualTransmission struct { - transmitter ocr2FeedsTransmitter - - secondaryContractAddress common.Address - secondaryFromAddress common.Address - secondaryMeta map[string][]string -} - -func (t *ocr2FeedsDualTransmission) CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error { - // Primary transmission - errPrimary := t.transmitter.CreateEthTransaction(ctx, toAddress, payload, txMeta) - if errPrimary != nil { - errPrimary = fmt.Errorf("skipped primary transmission: %w", errPrimary) - } - - if txMeta == nil { - txMeta = &txmgr.TxMeta{} - } - - dualBroadcast := true - dualBroadcastParams := t.urlParams() - - txMeta.DualBroadcast = &dualBroadcast - txMeta.DualBroadcastParams = &dualBroadcastParams - - // Secondary transmission - _, errSecondary := t.transmitter.txm.CreateTransaction(ctx, txmgr.TxRequest{ - FromAddress: t.secondaryFromAddress, - ToAddress: t.secondaryContractAddress, - EncodedPayload: payload, - FeeLimit: t.transmitter.gasLimit, - Strategy: t.transmitter.strategy, - Checker: t.transmitter.checker, - Meta: txMeta, - }) - - errSecondary = errors.Wrap(errSecondary, "skipped secondary transmission") - return errors2.Join(errPrimary, errSecondary) -} - -func (t *ocr2FeedsDualTransmission) FromAddress(ctx context.Context) common.Address { - return t.transmitter.FromAddress(ctx) -} - -func (t *ocr2FeedsDualTransmission) urlParams() string { - values := url.Values{} - for k, v := range t.secondaryMeta { - for _, p := range v { - values.Add(k, p) - } - } - return values.Encode() +func (t *ocr2FeedsTransmitter) CreateSecondaryEthTransaction(ctx context.Context, bytes []byte, meta *txmgr.TxMeta) error { + return errors.New("trying to send a secondary transmission on a non dual transmitter") } diff --git a/core/services/ocrcommon/transmitter_test.go b/core/services/ocrcommon/transmitter_test.go index 5f434e59c62..bb91a87d517 100644 --- a/core/services/ocrcommon/transmitter_test.go +++ b/core/services/ocrcommon/transmitter_test.go @@ -241,6 +241,7 @@ func Test_DualTransmitter(t *testing.T) { })).Twice().Return(txmgr.Tx{}, nil) require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) + require.NoError(t, transmitter.CreateSecondaryEthTransaction(testutils.Context(t), payload, nil)) require.True(t, primaryTxConfirmed) require.True(t, secondaryTxConfirmed) diff --git a/core/services/relay/evm/contract_transmitter.go b/core/services/relay/evm/contract_transmitter.go index aead9f6ca8a..248968ec053 100644 --- a/core/services/relay/evm/contract_transmitter.go +++ b/core/services/relay/evm/contract_transmitter.go @@ -34,6 +34,8 @@ var _ ContractTransmitter = &contractTransmitter{} type Transmitter interface { CreateEthTransaction(ctx context.Context, toAddress gethcommon.Address, payload []byte, txMeta *txmgr.TxMeta) error FromAddress(context.Context) gethcommon.Address + + CreateSecondaryEthTransaction(ctx context.Context, payload []byte, txMeta *txmgr.TxMeta) error } type ReportToEthMetadata func([]byte) (*txmgr.TxMeta, error) @@ -42,28 +44,35 @@ func reportToEvmTxMetaNoop([]byte) (*txmgr.TxMeta, error) { return nil, nil } -type OCRTransmitterOption func(transmitter *contractTransmitter) +type transmitterOps struct { + reportToEvmTxMeta ReportToEthMetadata + excludeSigs bool + retention time.Duration + maxLogsKept uint64 +} + +type OCRTransmitterOption func(transmitter *transmitterOps) func WithExcludeSignatures() OCRTransmitterOption { - return func(ct *contractTransmitter) { + return func(ct *transmitterOps) { ct.excludeSigs = true } } func WithRetention(retention time.Duration) OCRTransmitterOption { - return func(ct *contractTransmitter) { + return func(ct *transmitterOps) { ct.retention = retention } } func WithMaxLogsKept(maxLogsKept uint64) OCRTransmitterOption { - return func(ct *contractTransmitter) { + return func(ct *transmitterOps) { ct.maxLogsKept = maxLogsKept } } func WithReportToEthMetadata(reportToEvmTxMeta ReportToEthMetadata) OCRTransmitterOption { - return func(ct *contractTransmitter) { + return func(ct *transmitterOps) { if reportToEvmTxMeta != nil { ct.reportToEvmTxMeta = reportToEvmTxMeta } @@ -79,10 +88,7 @@ type contractTransmitter struct { lp logpoller.LogPoller lggr logger.Logger // Options - reportToEvmTxMeta ReportToEthMetadata - excludeSigs bool - retention time.Duration - maxLogsKept uint64 + transmitterOptions *transmitterOps } func transmitterFilterName(addr common.Address) string { @@ -112,17 +118,19 @@ func NewOCRContractTransmitter( lp: lp, contractReader: caller, lggr: logger.Named(lggr, "OCRContractTransmitter"), - reportToEvmTxMeta: reportToEvmTxMetaNoop, - excludeSigs: false, - retention: 0, - maxLogsKept: 0, + transmitterOptions: &transmitterOps{ + reportToEvmTxMeta: reportToEvmTxMetaNoop, + excludeSigs: false, + retention: 0, + maxLogsKept: 0, + }, } for _, opt := range opts { - opt(newContractTransmitter) + opt(newContractTransmitter.transmitterOptions) } - err := lp.RegisterFilter(ctx, logpoller.Filter{Name: transmitterFilterName(address), EventSigs: []common.Hash{transmitted.ID}, Addresses: []common.Address{address}, Retention: newContractTransmitter.retention, MaxLogsKept: newContractTransmitter.maxLogsKept}) + err := lp.RegisterFilter(ctx, logpoller.Filter{Name: transmitterFilterName(address), EventSigs: []common.Hash{transmitted.ID}, Addresses: []common.Address{address}, Retention: newContractTransmitter.transmitterOptions.retention, MaxLogsKept: newContractTransmitter.transmitterOptions.maxLogsKept}) if err != nil { return nil, err } @@ -142,7 +150,7 @@ func (oc *contractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes. if err != nil { panic("eventTransmit(ev): error in SplitSignature") } - if !oc.excludeSigs { + if !oc.transmitterOptions.excludeSigs { rs = append(rs, r) ss = append(ss, s) vs[i] = v @@ -150,7 +158,7 @@ func (oc *contractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes. } rawReportCtx := evmutil.RawReportContext(reportCtx) - txMeta, err := oc.reportToEvmTxMeta(report) + txMeta, err := oc.transmitterOptions.reportToEvmTxMeta(report) if err != nil { oc.lggr.Warnw("failed to generate tx metadata for report", "err", err) } @@ -163,6 +171,7 @@ func (oc *contractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes. } return errors.Wrap(oc.transmitter.CreateEthTransaction(ctx, oc.contractAddress, payload, txMeta), "failed to send Eth transaction") + } type contractReader interface { diff --git a/core/services/relay/evm/contract_transmitter_test.go b/core/services/relay/evm/contract_transmitter_test.go index 5b9e1ae5981..6106389f326 100644 --- a/core/services/relay/evm/contract_transmitter_test.go +++ b/core/services/relay/evm/contract_transmitter_test.go @@ -34,6 +34,10 @@ type mockTransmitter struct { lastPayload []byte } +func (m *mockTransmitter) CreateSecondaryEthTransaction(ctx context.Context, bytes []byte, meta *txmgr.TxMeta) error { + return nil +} + func (m *mockTransmitter) CreateEthTransaction(ctx context.Context, toAddress gethcommon.Address, payload []byte, _ *txmgr.TxMeta) error { m.lastPayload = payload return nil diff --git a/core/services/relay/evm/dual_contract_transmitter.go b/core/services/relay/evm/dual_contract_transmitter.go new file mode 100644 index 00000000000..86d7d38be2e --- /dev/null +++ b/core/services/relay/evm/dual_contract_transmitter.go @@ -0,0 +1,184 @@ +package evm + +import ( + "context" + "database/sql" + "encoding/hex" + errors2 "errors" + "fmt" + "strings" + "sync" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" +) + +// TODO: Remove when new dual transmitter contracts are merged +var dtABI = `[{"inputs":[{"internalType":"bytes32[3]","name":"reportContext","type":"bytes32[3]"},{"internalType":"bytes","name":"report","type":"bytes"},{"internalType":"bytes32[]","name":"rs","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ss","type":"bytes32[]"},{"internalType":"bytes32","name":"rawVs","type":"bytes32"}],"name":"transmitSecondary","outputs":[],"stateMutability":"nonpayable","type":"function"}]` + +var _ ContractTransmitter = (*dualContractTransmitter)(nil) + +type dualContractTransmitter struct { + contractAddress gethcommon.Address + contractABI abi.ABI + dualTransmissionABI abi.ABI + transmitter Transmitter + transmittedEventSig common.Hash + contractReader contractReader + lp logpoller.LogPoller + lggr logger.Logger + // Options + transmitterOptions *transmitterOps +} + +var dualTransmissionABI = sync.OnceValue(func() abi.ABI { + dualTransmissionABI, err := abi.JSON(strings.NewReader(dtABI)) + if err != nil { + panic(fmt.Errorf("failed to parse dualTransmission ABI: %w", err)) + } + return dualTransmissionABI +}) + +func NewOCRDualContractTransmitter( + ctx context.Context, + address gethcommon.Address, + caller contractReader, + contractABI abi.ABI, + transmitter Transmitter, + lp logpoller.LogPoller, + lggr logger.Logger, + opts ...OCRTransmitterOption, +) (*dualContractTransmitter, error) { + transmitted, ok := contractABI.Events["Transmitted"] + if !ok { + return nil, errors.New("invalid ABI, missing transmitted") + } + + newContractTransmitter := &dualContractTransmitter{ + contractAddress: address, + contractABI: contractABI, + dualTransmissionABI: dualTransmissionABI(), + transmitter: transmitter, + transmittedEventSig: transmitted.ID, + lp: lp, + contractReader: caller, + lggr: logger.Named(lggr, "OCRDualContractTransmitter"), + transmitterOptions: &transmitterOps{ + reportToEvmTxMeta: reportToEvmTxMetaNoop, + excludeSigs: false, + retention: 0, + maxLogsKept: 0, + }, + } + + for _, opt := range opts { + opt(newContractTransmitter.transmitterOptions) + } + + err := lp.RegisterFilter(ctx, logpoller.Filter{Name: transmitterFilterName(address), EventSigs: []common.Hash{transmitted.ID}, Addresses: []common.Address{address}, Retention: newContractTransmitter.transmitterOptions.retention, MaxLogsKept: newContractTransmitter.transmitterOptions.maxLogsKept}) + if err != nil { + return nil, err + } + return newContractTransmitter, nil +} + +// Transmit sends the report to the on-chain smart contract's Transmit method. +func (oc *dualContractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signatures []ocrtypes.AttributedOnchainSignature) error { + var rs [][32]byte + var ss [][32]byte + var vs [32]byte + if len(signatures) > 32 { + return errors.New("too many signatures, maximum is 32") + } + for i, as := range signatures { + r, s, v, err := evmutil.SplitSignature(as.Signature) + if err != nil { + panic("eventTransmit(ev): error in SplitSignature") + } + if !oc.transmitterOptions.excludeSigs { + rs = append(rs, r) + ss = append(ss, s) + vs[i] = v + } + } + rawReportCtx := evmutil.RawReportContext(reportCtx) + + txMeta, err := oc.transmitterOptions.reportToEvmTxMeta(report) + if err != nil { + oc.lggr.Warnw("failed to generate tx metadata for report", "err", err) + } + + oc.lggr.Debugw("Transmitting report", "report", hex.EncodeToString(report), "rawReportCtx", rawReportCtx, "contractAddress", oc.contractAddress, "txMeta", txMeta) + + // Primary transmission + payload, err := oc.contractABI.Pack("transmit", rawReportCtx, []byte(report), rs, ss, vs) + if err != nil { + return errors.Wrap(err, "abi.Pack failed") + } + + transactionErr := errors.Wrap(oc.transmitter.CreateEthTransaction(ctx, oc.contractAddress, payload, txMeta), "failed to send primary Eth transaction") + + oc.lggr.Debugw("Created primary transaction", "error", transactionErr) + + // Secondary transmission + secondaryPayload, err := oc.dualTransmissionABI.Pack("transmitSecondary", rawReportCtx, []byte(report), rs, ss, vs) + if err != nil { + return errors.Wrap(err, "transmitSecondary abi.Pack failed") + } + + err = errors.Wrap(oc.transmitter.CreateSecondaryEthTransaction(ctx, secondaryPayload, txMeta), "failed to send secondary Eth transaction") + oc.lggr.Debugw("Created secondary transaction", "error", err) + return errors2.Join(transactionErr, err) +} + +// LatestConfigDigestAndEpoch retrieves the latest config digest and epoch from the OCR2 contract. +// It is plugin independent, in particular avoids use of the plugin specific generated evm wrappers +// by using the evm client Call directly for functions/events that are part of OCR2Abstract. +func (oc *dualContractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) (ocrtypes.ConfigDigest, uint32, error) { + latestConfigDigestAndEpoch, err := callContract(ctx, oc.contractAddress, oc.contractABI, "latestConfigDigestAndEpoch", nil, oc.contractReader) + if err != nil { + return ocrtypes.ConfigDigest{}, 0, err + } + // Panic on these conversions erroring, would mean a broken contract. + scanLogs := *abi.ConvertType(latestConfigDigestAndEpoch[0], new(bool)).(*bool) + configDigest := *abi.ConvertType(latestConfigDigestAndEpoch[1], new([32]byte)).(*[32]byte) + epoch := *abi.ConvertType(latestConfigDigestAndEpoch[2], new(uint32)).(*uint32) + if !scanLogs { + return configDigest, epoch, nil + } + + // Otherwise, we have to scan for the logs. + latest, err := oc.lp.LatestLogByEventSigWithConfs(ctx, oc.transmittedEventSig, oc.contractAddress, 1) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + // No transmissions yet + return configDigest, 0, nil + } + return ocrtypes.ConfigDigest{}, 0, err + } + return parseTransmitted(latest.Data) +} + +// FromAccount returns the account from which the transmitter invokes the contract +func (oc *dualContractTransmitter) FromAccount(ctx context.Context) (ocrtypes.Account, error) { + return ocrtypes.Account(oc.transmitter.FromAddress(ctx).String()), nil +} + +func (oc *dualContractTransmitter) Start(ctx context.Context) error { return nil } +func (oc *dualContractTransmitter) Close() error { return nil } + +// Has no state/lifecycle so it's always healthy and ready +func (oc *dualContractTransmitter) Ready() error { return nil } +func (oc *dualContractTransmitter) HealthReport() map[string]error { + return map[string]error{oc.Name(): nil} +} +func (oc *dualContractTransmitter) Name() string { return oc.lggr.Name() } diff --git a/core/services/relay/evm/dual_contract_transmitter_test.go b/core/services/relay/evm/dual_contract_transmitter_test.go new file mode 100644 index 00000000000..a5110398159 --- /dev/null +++ b/core/services/relay/evm/dual_contract_transmitter_test.go @@ -0,0 +1,164 @@ +package evm + +import ( + "context" + "encoding/hex" + "strings" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" +) + +var sampleAddressPrimary = testutils.NewAddress() + +type mockDualTransmitter struct { + lastPrimaryPayload []byte + lastSecondaryPayload []byte +} + +func (*mockDualTransmitter) FromAddress(ctx context.Context) gethcommon.Address { + return sampleAddressPrimary +} + +func (m *mockDualTransmitter) CreateEthTransaction(ctx context.Context, toAddress gethcommon.Address, payload []byte, _ *txmgr.TxMeta) error { + m.lastPrimaryPayload = payload + return nil +} + +func (m *mockDualTransmitter) CreateSecondaryEthTransaction(ctx context.Context, payload []byte, _ *txmgr.TxMeta) error { + m.lastSecondaryPayload = payload + return nil +} + +func TestDualContractTransmitter(t *testing.T) { + t.Parallel() + + lggr := logger.TestLogger(t) + c := evmclimocks.NewClient(t) + lp := lpmocks.NewLogPoller(t) + ctx := testutils.Context(t) + // scanLogs = false + digestAndEpochDontScanLogs, _ := hex.DecodeString( + "0000000000000000000000000000000000000000000000000000000000000000" + // false + "000130da6b9315bd59af6b0a3f5463c0d0a39e92eaa34cbcbdbace7b3bfcc776" + // config digest + "0000000000000000000000000000000000000000000000000000000000000002") // epoch + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(digestAndEpochDontScanLogs, nil).Once() + contractABI, _ := abi.JSON(strings.NewReader(ocr2aggregator.OCR2AggregatorMetaData.ABI)) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) + reportToEvmTxMeta := func(b []byte) (*txmgr.TxMeta, error) { + return &txmgr.TxMeta{}, nil + } + ot, err := NewOCRDualContractTransmitter(ctx, gethcommon.Address{}, c, contractABI, &mockDualTransmitter{}, lp, lggr, + WithReportToEthMetadata(reportToEvmTxMeta)) + require.NoError(t, err) + digest, epoch, err := ot.LatestConfigDigestAndEpoch(testutils.Context(t)) + require.NoError(t, err) + assert.Equal(t, "000130da6b9315bd59af6b0a3f5463c0d0a39e92eaa34cbcbdbace7b3bfcc776", hex.EncodeToString(digest[:])) + assert.Equal(t, uint32(2), epoch) + + // scanLogs = true + digestAndEpochScanLogs, _ := hex.DecodeString( + "0000000000000000000000000000000000000000000000000000000000000001" + // true + "000130da6b9315bd59af6b0a3f5463c0d0a39e92eaa34cbcbdbace7b3bfcc776" + // config digest + "0000000000000000000000000000000000000000000000000000000000000002") // epoch + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(digestAndEpochScanLogs, nil).Once() + transmitted2, _ := hex.DecodeString( + "000130da6b9315bd59af6b0a3f5463c0d0a39e92eaa34cbcbdbace7b3bfcc777" + // config digest + "0000000000000000000000000000000000000000000000000000000000000002") // epoch + lp.On("LatestLogByEventSigWithConfs", + mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&logpoller.Log{ + Data: transmitted2, + }, nil) + digest, epoch, err = ot.LatestConfigDigestAndEpoch(testutils.Context(t)) + require.NoError(t, err) + assert.Equal(t, "000130da6b9315bd59af6b0a3f5463c0d0a39e92eaa34cbcbdbace7b3bfcc777", hex.EncodeToString(digest[:])) + assert.Equal(t, uint32(2), epoch) + from, err := ot.FromAccount(tests.Context(t)) + require.NoError(t, err) + assert.Equal(t, sampleAddressPrimary.String(), string(from)) +} + +func Test_dualContractTransmitterNoSignatures_Transmit_SignaturesAreNotTransmitted(t *testing.T) { + t.Parallel() + + transmitter := &mockDualTransmitter{} + + ctx := context.Background() + reportCtx := types.ReportContext{} + report := types.Report{} + var signatures = oneSignature() + + oc := createDualContractTransmitter(ctx, t, transmitter, WithExcludeSignatures()) + + err := oc.Transmit(ctx, reportCtx, report, signatures) + require.NoError(t, err) + + var emptyRs [][32]byte + var emptySs [][32]byte + var emptyVs [32]byte + emptySignaturesPayloadPrimary, err := oc.contractABI.Pack("transmit", evmutil.RawReportContext(reportCtx), []byte(report), emptyRs, emptySs, emptyVs) + require.NoError(t, err) + emptySignaturesPayloadSecondary, err := oc.dualTransmissionABI.Pack("transmitSecondary", evmutil.RawReportContext(reportCtx), []byte(report), emptyRs, emptySs, emptyVs) + require.NoError(t, err) + require.Equal(t, transmitter.lastPrimaryPayload, emptySignaturesPayloadPrimary, "primary payload not equal") + require.Equal(t, transmitter.lastSecondaryPayload, emptySignaturesPayloadSecondary, "secondary payload not equal") +} + +func Test_dualContractTransmitter_Transmit_SignaturesAreTransmitted(t *testing.T) { + t.Parallel() + + transmitter := &mockDualTransmitter{} + + ctx := context.Background() + reportCtx := types.ReportContext{} + report := types.Report{} + var signatures = oneSignature() + + oc := createDualContractTransmitter(ctx, t, transmitter) + + err := oc.Transmit(ctx, reportCtx, report, signatures) + require.NoError(t, err) + + rs, ss, vs := signaturesAsPayload(t, signatures) + withSignaturesPayloadPrimary, err := oc.contractABI.Pack("transmit", evmutil.RawReportContext(reportCtx), []byte(report), rs, ss, vs) + require.NoError(t, err) + withSignaturesPayloadSecondary, err := oc.dualTransmissionABI.Pack("transmitSecondary", evmutil.RawReportContext(reportCtx), []byte(report), rs, ss, vs) + require.NoError(t, err) + require.Equal(t, transmitter.lastPrimaryPayload, withSignaturesPayloadPrimary, "primary payload not equal") + require.Equal(t, transmitter.lastSecondaryPayload, withSignaturesPayloadSecondary, "secondary payload not equal") +} + +func createDualContractTransmitter(ctx context.Context, t *testing.T, transmitter Transmitter, ops ...OCRTransmitterOption) *dualContractTransmitter { + contractABI, err := abi.JSON(strings.NewReader(ocr2aggregator.OCR2AggregatorMetaData.ABI)) + require.NoError(t, err) + lp := lpmocks.NewLogPoller(t) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) + contractTransmitter, err := NewOCRDualContractTransmitter( + ctx, + gethcommon.Address{}, + evmclimocks.NewClient(t), + contractABI, + transmitter, + lp, + logger.TestLogger(t), + ops..., + ) + require.NoError(t, err) + return contractTransmitter +} diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index cf79d2aea59..0a418262988 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -938,6 +938,33 @@ func newOnChainContractTransmitter(ctx context.Context, lggr logger.Logger, rarg ) } +// newOnChainDualContractTransmitter creates a new dual contract transmitter. +func newOnChainDualContractTransmitter(ctx context.Context, lggr logger.Logger, rargs commontypes.RelayArgs, ethKeystore keystore.Eth, configWatcher *configWatcher, opts configTransmitterOpts, transmissionContractABI abi.ABI, ocrTransmitterOpts ...OCRTransmitterOption) (*dualContractTransmitter, error) { + transmitter, err := generateTransmitterFrom(ctx, rargs, ethKeystore, configWatcher, opts) + if err != nil { + return nil, err + } + + return NewOCRDualContractTransmitter( + ctx, + configWatcher.contractAddress, + configWatcher.chain.Client(), + transmissionContractABI, + transmitter, + configWatcher.chain.LogPoller(), + lggr, + ocrTransmitterOpts..., + ) +} + +func NewContractTransmitter(ctx context.Context, lggr logger.Logger, rargs commontypes.RelayArgs, ethKeystore keystore.Eth, configWatcher *configWatcher, opts configTransmitterOpts, transmissionContractABI abi.ABI, dualTransmission bool, ocrTransmitterOpts ...OCRTransmitterOption) (ContractTransmitter, error) { + if dualTransmission { + return newOnChainDualContractTransmitter(ctx, lggr, rargs, ethKeystore, configWatcher, opts, transmissionContractABI, ocrTransmitterOpts...) + } + + return newOnChainContractTransmitter(ctx, lggr, rargs, ethKeystore, configWatcher, opts, transmissionContractABI, ocrTransmitterOpts...) +} + func generateTransmitterFrom(ctx context.Context, rargs commontypes.RelayArgs, ethKeystore keystore.Eth, configWatcher *configWatcher, opts configTransmitterOpts) (Transmitter, error) { var relayConfig types.RelayConfig if err := json.Unmarshal(rargs.RelayConfig, &relayConfig); err != nil { @@ -1075,7 +1102,7 @@ func (r *Relayer) NewMedianProvider(ctx context.Context, rargs commontypes.Relay reportCodec := evmreportcodec.ReportCodec{} - contractTransmitter, err := newOnChainContractTransmitter(ctx, lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{}, OCR2AggregatorTransmissionContractABI) + ct, err := NewContractTransmitter(ctx, lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{}, OCR2AggregatorTransmissionContractABI, relayConfig.EnableDualTransmission) if err != nil { return nil, err } @@ -1089,7 +1116,7 @@ func (r *Relayer) NewMedianProvider(ctx context.Context, rargs commontypes.Relay lggr: lggr.Named("MedianProvider"), configWatcher: configWatcher, reportCodec: reportCodec, - contractTransmitter: contractTransmitter, + contractTransmitter: ct, medianContract: medianContract, } From cf7b1b047442a703c917f5306cb7369fb9663ddc Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Mon, 13 Jan 2025 18:31:40 +0100 Subject: [PATCH 37/91] CCIP-4420 Mantle gas interceptor (#15900) * Fixing gas estimator interceptor for Mantle * Adding extra check for the address presence --- .../interceptors/mantle/interceptor.go | 82 ---------------- .../interceptors/mantle/interceptor_test.go | 96 ------------------- core/services/relay/evm/evm.go | 8 +- .../evm/interceptors/mantle/interceptor.go | 16 ++-- .../interceptors/mantle/interceptor_test.go | 11 ++- 5 files changed, 24 insertions(+), 189 deletions(-) delete mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go delete mode 100644 core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go deleted file mode 100644 index 359f32e13a5..00000000000 --- a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go +++ /dev/null @@ -1,82 +0,0 @@ -package mantle - -import ( - "context" - "fmt" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - - evmClient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" -) - -const ( - // tokenRatio is not volatile and can be requested not often. - tokenRatioUpdateInterval = 60 * time.Minute - // tokenRatio fetches the tokenRatio used for Mantle's gas price calculation - tokenRatioMethod = "tokenRatio" - mantleTokenRatioAbiString = `[{"inputs":[],"name":"tokenRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]` -) - -type Interceptor struct { - client evmClient.Client - tokenRatioCallData []byte - tokenRatio *big.Int - tokenRatioLastUpdate time.Time -} - -func NewInterceptor(_ context.Context, client evmClient.Client) (*Interceptor, error) { - // Encode calldata for tokenRatio method - tokenRatioMethodAbi, err := abi.JSON(strings.NewReader(mantleTokenRatioAbiString)) - if err != nil { - return nil, fmt.Errorf("failed to parse GasPriceOracle %s() method ABI for Mantle; %w", tokenRatioMethod, err) - } - tokenRatioCallData, err := tokenRatioMethodAbi.Pack(tokenRatioMethod) - if err != nil { - return nil, fmt.Errorf("failed to parse GasPriceOracle %s() calldata for Mantle; %w", tokenRatioMethod, err) - } - - return &Interceptor{ - client: client, - tokenRatioCallData: tokenRatioCallData, - }, nil -} - -// ModifyGasPriceComponents returns modified gasPrice. -func (i *Interceptor) ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (*big.Int, *big.Int, error) { - if time.Since(i.tokenRatioLastUpdate) > tokenRatioUpdateInterval { - mantleTokenRatio, err := i.getMantleTokenRatio(ctx) - if err != nil { - return nil, nil, err - } - - i.tokenRatio, i.tokenRatioLastUpdate = mantleTokenRatio, time.Now() - } - - // multiply daGasPrice and execGas price by tokenRatio - newExecGasPrice := new(big.Int).Mul(execGasPrice, i.tokenRatio) - newDAGasPrice := new(big.Int).Mul(daGasPrice, i.tokenRatio) - return newExecGasPrice, newDAGasPrice, nil -} - -// getMantleTokenRatio Requests and returns a token ratio value for the Mantle chain. -func (i *Interceptor) getMantleTokenRatio(ctx context.Context) (*big.Int, error) { - // FIXME it's removed from chainlink repo - // precompile := common.HexToAddress(rollups.OPGasOracleAddress) - precompile := common.Address{} - - tokenRatio, err := i.client.CallContract(ctx, ethereum.CallMsg{ - To: &precompile, - Data: i.tokenRatioCallData, - }, nil) - - if err != nil { - return nil, fmt.Errorf("getMantleTokenRatio call failed: %w", err) - } - - return new(big.Int).SetBytes(tokenRatio), nil -} diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go deleted file mode 100644 index 9134d996c27..00000000000 --- a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package mantle - -import ( - "context" - "math/big" - "testing" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" -) - -func TestInterceptor(t *testing.T) { - ethClient := mocks.NewClient(t) - ctx := context.Background() - - tokenRatio := big.NewInt(10) - interceptor, err := NewInterceptor(ctx, ethClient) - require.NoError(t, err) - - // request token ratio - ethClient.On("CallContract", ctx, mock.IsType(ethereum.CallMsg{}), mock.IsType(&big.Int{})). - Return(common.BigToHash(tokenRatio).Bytes(), nil).Once() - - modExecGasPrice, modDAGasPrice, err := interceptor.ModifyGasPriceComponents(ctx, big.NewInt(1), big.NewInt(1)) - require.NoError(t, err) - require.Equal(t, int64(10), modExecGasPrice.Int64()) - require.Equal(t, int64(10), modDAGasPrice.Int64()) - - // second call won't invoke eth client - modExecGasPrice, modDAGasPrice, err = interceptor.ModifyGasPriceComponents(ctx, big.NewInt(2), big.NewInt(1)) - require.NoError(t, err) - require.Equal(t, int64(20), modExecGasPrice.Int64()) - require.Equal(t, int64(10), modDAGasPrice.Int64()) -} - -func TestModifyGasPriceComponents(t *testing.T) { - testCases := map[string]struct { - execGasPrice *big.Int - daGasPrice *big.Int - tokenRatio *big.Int - resultExecGasPrice *big.Int - resultDAGasPrice *big.Int - }{ - "regular": { - execGasPrice: big.NewInt(1000), - daGasPrice: big.NewInt(100), - resultExecGasPrice: big.NewInt(2000), - resultDAGasPrice: big.NewInt(200), - tokenRatio: big.NewInt(2), - }, - "zero DAGasPrice": { - execGasPrice: big.NewInt(1000), - daGasPrice: big.NewInt(0), - resultExecGasPrice: big.NewInt(5000), - resultDAGasPrice: big.NewInt(0), - tokenRatio: big.NewInt(5), - }, - "zero ExecGasPrice": { - execGasPrice: big.NewInt(0), - daGasPrice: big.NewInt(10), - resultExecGasPrice: big.NewInt(0), - resultDAGasPrice: big.NewInt(50), - tokenRatio: big.NewInt(5), - }, - "zero token ratio": { - execGasPrice: big.NewInt(15), - daGasPrice: big.NewInt(10), - resultExecGasPrice: big.NewInt(0), - resultDAGasPrice: big.NewInt(0), - tokenRatio: big.NewInt(0), - }, - } - - for tcName, tc := range testCases { - t.Run(tcName, func(t *testing.T) { - ethClient := mocks.NewClient(t) - ctx := context.Background() - - interceptor, err := NewInterceptor(ctx, ethClient) - require.NoError(t, err) - - // request token ratio - ethClient.On("CallContract", ctx, mock.IsType(ethereum.CallMsg{}), mock.IsType(&big.Int{})). - Return(common.BigToHash(tc.tokenRatio).Bytes(), nil).Once() - - modExecGasPrice, modDAGasPrice, err := interceptor.ModifyGasPriceComponents(ctx, tc.execGasPrice, tc.daGasPrice) - require.NoError(t, err) - require.Equal(t, tc.resultExecGasPrice.Int64(), modExecGasPrice.Int64()) - require.Equal(t, tc.resultDAGasPrice.Int64(), modDAGasPrice.Int64()) - }) - } -} diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index 0a418262988..ae77ce61e10 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -51,13 +51,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipexec" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle" cciptransmitter "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/transmitter" lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" mercuryconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/functions" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/interceptors/mantle" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" reportcodecv1 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v1/reportcodec" @@ -541,7 +541,8 @@ func (r *Relayer) NewCCIPCommitProvider(ctx context.Context, rargs commontypes.R // to minimize misconfigure risk, might make sense to wire Mantle only when Commit + Mantle + IsSourceProvider if r.chain.Config().EVM().ChainID().Uint64() == 5003 || r.chain.Config().EVM().ChainID().Uint64() == 5000 { if commitPluginConfig.IsSourceProvider { - mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client()) + oracleAddress := r.chain.Config().EVM().GasEstimator().DAOracle().OracleAddress() + mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client(), oracleAddress) if iErr != nil { return nil, iErr } @@ -619,7 +620,8 @@ func (r *Relayer) NewCCIPExecProvider(ctx context.Context, rargs commontypes.Rel // to minimize misconfigure risk, make sense to wire Mantle only when Exec + Mantle + !IsSourceProvider if r.chain.Config().EVM().ChainID().Uint64() == 5003 || r.chain.Config().EVM().ChainID().Uint64() == 5000 { if !execPluginConfig.IsSourceProvider { - mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client()) + oracleAddress := r.chain.Config().EVM().GasEstimator().DAOracle().OracleAddress() + mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client(), oracleAddress) if iErr != nil { return nil, iErr } diff --git a/core/services/relay/evm/interceptors/mantle/interceptor.go b/core/services/relay/evm/interceptors/mantle/interceptor.go index c1520652d67..c6ace3e6cbc 100644 --- a/core/services/relay/evm/interceptors/mantle/interceptor.go +++ b/core/services/relay/evm/interceptors/mantle/interceptor.go @@ -2,6 +2,7 @@ package mantle import ( "context" + "errors" "fmt" "math/big" "strings" @@ -9,9 +10,10 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" evmClient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) const ( @@ -27,9 +29,13 @@ type Interceptor struct { tokenRatioCallData []byte tokenRatio *big.Int tokenRatioLastUpdate time.Time + oracleAddress common.Address } -func NewInterceptor(_ context.Context, client evmClient.Client) (*Interceptor, error) { +func NewInterceptor(_ context.Context, client evmClient.Client, address *evmtypes.EIP55Address) (*Interceptor, error) { + if address == nil { + return nil, errors.New("oracle address is missing") + } // Encode calldata for tokenRatio method tokenRatioMethodAbi, err := abi.JSON(strings.NewReader(mantleTokenRatioAbiString)) if err != nil { @@ -43,6 +49,7 @@ func NewInterceptor(_ context.Context, client evmClient.Client) (*Interceptor, e return &Interceptor{ client: client, tokenRatioCallData: tokenRatioCallData, + oracleAddress: address.Address(), }, nil } @@ -65,11 +72,8 @@ func (i *Interceptor) ModifyGasPriceComponents(ctx context.Context, execGasPrice // getMantleTokenRatio Requests and returns a token ratio value for the Mantle chain. func (i *Interceptor) getMantleTokenRatio(ctx context.Context) (*big.Int, error) { - // FIXME it's removed from chainlink repo - // precompile := common.HexToAddress(rollups.OPGasOracleAddress) - precompile := utils.RandomAddress() tokenRatio, err := i.client.CallContract(ctx, ethereum.CallMsg{ - To: &precompile, + To: &i.oracleAddress, Data: i.tokenRatioCallData, }, nil) diff --git a/core/services/relay/evm/interceptors/mantle/interceptor_test.go b/core/services/relay/evm/interceptors/mantle/interceptor_test.go index 9134d996c27..6fa485de487 100644 --- a/core/services/relay/evm/interceptors/mantle/interceptor_test.go +++ b/core/services/relay/evm/interceptors/mantle/interceptor_test.go @@ -11,14 +11,21 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ) +var randomAddress = types.MustEIP55Address(utils.RandomAddress().String()) + func TestInterceptor(t *testing.T) { ethClient := mocks.NewClient(t) ctx := context.Background() + _, err := NewInterceptor(ctx, ethClient, nil) + require.Error(t, err) + tokenRatio := big.NewInt(10) - interceptor, err := NewInterceptor(ctx, ethClient) + interceptor, err := NewInterceptor(ctx, ethClient, &randomAddress) require.NoError(t, err) // request token ratio @@ -80,7 +87,7 @@ func TestModifyGasPriceComponents(t *testing.T) { ethClient := mocks.NewClient(t) ctx := context.Background() - interceptor, err := NewInterceptor(ctx, ethClient) + interceptor, err := NewInterceptor(ctx, ethClient, &randomAddress) require.NoError(t, err) // request token ratio From e0a5bb716cdf3a590760a76a578a7f790496ad73 Mon Sep 17 00:00:00 2001 From: Street <5597260+MStreet3@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:03:07 -0500 Subject: [PATCH 38/91] feat(keystone): add capabilities and add nops as mcms proposals (#15887) * feat(keystone/changeset): add capabilities and add nops as mcms proposals * wip RegisterDons MCMS enabled * chore(keystone): unit test adding capabilities mcms * chore(keystone): add unit test register nops mcms * fix(keystone): adds unit test on add nops * chore(keystone): adds unit test for mcms add DONs --- .../internal/append_node_capabilities.go | 2 +- .../internal/capability_management.go | 55 ++--- .../keystone/changeset/internal/deploy.go | 117 +++++++++- .../changeset/internal/deploy_test.go | 203 ++++++++++++++++++ .../internal/update_node_capabilities.go | 2 +- 5 files changed, 349 insertions(+), 30 deletions(-) create mode 100644 deployment/keystone/changeset/internal/deploy_test.go diff --git a/deployment/keystone/changeset/internal/append_node_capabilities.go b/deployment/keystone/changeset/internal/append_node_capabilities.go index c6379fd24fd..a87688b5427 100644 --- a/deployment/keystone/changeset/internal/append_node_capabilities.go +++ b/deployment/keystone/changeset/internal/append_node_capabilities.go @@ -49,7 +49,7 @@ func AppendNodeCapabilitiesImpl(lggr logger.Logger, req *AppendNodeCapabilitiesR for _, cap := range req.P2pToCapabilities { capabilities = append(capabilities, cap...) } - op, err := AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS) + op, err := AddCapabilities(lggr, req.ContractSet.CapabilitiesRegistry, req.Chain, capabilities, req.UseMCMS) if err != nil { return nil, fmt.Errorf("failed to add capabilities: %w", err) } diff --git a/deployment/keystone/changeset/internal/capability_management.go b/deployment/keystone/changeset/internal/capability_management.go index d85c3f0dfff..04f5a153482 100644 --- a/deployment/keystone/changeset/internal/capability_management.go +++ b/deployment/keystone/changeset/internal/capability_management.go @@ -13,44 +13,51 @@ import ( ) // AddCapabilities adds the capabilities to the registry -func AddCapabilities(lggr logger.Logger, contractSet *ContractSet, chain deployment.Chain, capabilities []kcr.CapabilitiesRegistryCapability, useMCMS bool) (*timelock.BatchChainOperation, error) { +func AddCapabilities(lggr logger.Logger, registry *kcr.CapabilitiesRegistry, chain deployment.Chain, capabilities []kcr.CapabilitiesRegistryCapability, useMCMS bool) (*timelock.BatchChainOperation, error) { if len(capabilities) == 0 { return nil, nil } - registry := contractSet.CapabilitiesRegistry deduped, err := dedupCapabilities(registry, capabilities) if err != nil { return nil, fmt.Errorf("failed to dedup capabilities: %w", err) } - txOpts := chain.DeployerKey + if useMCMS { - txOpts = deployment.SimTransactOpts() + return addCapabilitiesMCMSProposal(registry, deduped, chain) } - tx, err := registry.AddCapabilities(txOpts, deduped) + + tx, err := registry.AddCapabilities(chain.DeployerKey, deduped) if err != nil { err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to add capabilities: %w", err) } - var batch *timelock.BatchChainOperation - if !useMCMS { - _, err = chain.Confirm(tx) - if err != nil { - return nil, fmt.Errorf("failed to confirm AddCapabilities confirm transaction %s: %w", tx.Hash().String(), err) - } - lggr.Info("registered capabilities", "capabilities", deduped) - } else { - batch = &timelock.BatchChainOperation{ - ChainIdentifier: mcms.ChainIdentifier(chain.Selector), - Batch: []mcms.Operation{ - { - To: registry.Address(), - Data: tx.Data(), - Value: big.NewInt(0), - }, - }, - } + + _, err = chain.Confirm(tx) + if err != nil { + return nil, fmt.Errorf("failed to confirm AddCapabilities confirm transaction %s: %w", tx.Hash().String(), err) } - return batch, nil + lggr.Info("registered capabilities", "capabilities", deduped) + + return nil, nil +} + +func addCapabilitiesMCMSProposal(registry *kcr.CapabilitiesRegistry, caps []kcr.CapabilitiesRegistryCapability, regChain deployment.Chain) (*timelock.BatchChainOperation, error) { + tx, err := registry.AddCapabilities(deployment.SimTransactOpts(), caps) + if err != nil { + err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) + return nil, fmt.Errorf("failed to call AddNodeOperators: %w", err) + } + + return &timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(regChain.Selector), + Batch: []mcms.Operation{ + { + To: registry.Address(), + Data: tx.Data(), + Value: big.NewInt(0), + }, + }, + }, nil } // CapabilityID returns a unique id for the capability diff --git a/deployment/keystone/changeset/internal/deploy.go b/deployment/keystone/changeset/internal/deploy.go index b52d269518d..e785b6dc161 100644 --- a/deployment/keystone/changeset/internal/deploy.go +++ b/deployment/keystone/changeset/internal/deploy.go @@ -416,10 +416,14 @@ type RegisterCapabilitiesRequest struct { Env *deployment.Environment RegistryChainSelector uint64 DonToCapabilities map[string][]capabilities_registry.CapabilitiesRegistryCapability + + // if UseMCMS is true, a batch proposal is returned and no transaction is confirmed on chain. + UseMCMS bool } type RegisterCapabilitiesResponse struct { DonToCapabilities map[string][]RegisteredCapability + Ops *timelock.BatchChainOperation } type RegisteredCapability struct { @@ -492,11 +496,14 @@ func RegisterCapabilities(lggr logger.Logger, req RegisterCapabilitiesRequest) ( lggr.Warn("no new capabilities to register") return &RegisterCapabilitiesResponse{}, nil } - // not using mcms; ignore proposals - _, err = AddCapabilities(lggr, &contracts, registryChain, capabilities, false) + + ops, err := AddCapabilities(lggr, contracts.CapabilitiesRegistry, registryChain, capabilities, req.UseMCMS) if err != nil { return nil, fmt.Errorf("failed to add capabilities: %w", err) } + + resp.Ops = ops + return resp, nil } @@ -504,10 +511,12 @@ type RegisterNOPSRequest struct { Env *deployment.Environment RegistryChainSelector uint64 Nops []capabilities_registry.CapabilitiesRegistryNodeOperator + UseMCMS bool } type RegisterNOPSResponse struct { Nops []*capabilities_registry.CapabilitiesRegistryNodeOperatorAdded + Ops *timelock.BatchChainOperation } func RegisterNOPS(ctx context.Context, lggr logger.Logger, req RegisterNOPSRequest) (*RegisterNOPSResponse, error) { @@ -545,11 +554,23 @@ func RegisterNOPS(ctx context.Context, lggr logger.Logger, req RegisterNOPSReque lggr.Debug("no new node operators to register") return resp, nil } + + if req.UseMCMS { + ops, err := addNOPsMCMSProposal(registry, nops, registryChain) + if err != nil { + return nil, fmt.Errorf("failed to generate proposal to add node operators: %w", err) + } + + resp.Ops = ops + return resp, nil + } + tx, err := registry.AddNodeOperators(registryChain.DeployerKey, nops) if err != nil { err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call AddNodeOperators: %w", err) } + // for some reason that i don't understand, the confirm must be called before the WaitMined or the latter will hang // (at least for a simulated backend chain) _, err = registryChain.Confirm(tx) @@ -575,6 +596,25 @@ func RegisterNOPS(ctx context.Context, lggr logger.Logger, req RegisterNOPSReque return resp, nil } +func addNOPsMCMSProposal(registry *capabilities_registry.CapabilitiesRegistry, nops []capabilities_registry.CapabilitiesRegistryNodeOperator, regChain deployment.Chain) (*timelock.BatchChainOperation, error) { + tx, err := registry.AddNodeOperators(deployment.SimTransactOpts(), nops) + if err != nil { + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + return nil, fmt.Errorf("failed to call AddNodeOperators: %w", err) + } + + return &timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(regChain.Selector), + Batch: []mcms.Operation{ + { + To: registry.Address(), + Data: tx.Data(), + Value: big.NewInt(0), + }, + }, + }, nil +} + func DefaultCapConfig(capType uint8, nNodes int) *capabilitiespb.CapabilityConfig { switch capType { // TODO: use the enum defined in ?? @@ -618,9 +658,11 @@ type RegisterNodesRequest struct { DonToNodes map[string][]deployment.Node DonToCapabilities map[string][]RegisteredCapability Nops []*capabilities_registry.CapabilitiesRegistryNodeOperatorAdded + UseMCMS bool } type RegisterNodesResponse struct { nodeIDToParams map[string]capabilities_registry.CapabilitiesRegistryNodeParams + Ops *timelock.BatchChainOperation } // registerNodes registers the nodes with the registry. it assumes that the deployer key in the Chain @@ -725,6 +767,19 @@ func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNode uniqueNodeParams = append(uniqueNodeParams, v) } lggr.Debugw("unique node params to add", "count", len(uniqueNodeParams), "params", uniqueNodeParams) + + if req.UseMCMS { + ops, err := addNodesMCMSProposal(registry, uniqueNodeParams, registryChain) + if err != nil { + return nil, fmt.Errorf("failed to generate proposal to add nodes: %w", err) + } + + return &RegisterNodesResponse{ + nodeIDToParams: nodeIDToParams, + Ops: ops, + }, nil + } + tx, err := registry.AddNodes(registryChain.DeployerKey, uniqueNodeParams) if err != nil { err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) @@ -758,11 +813,32 @@ func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNode return nil, fmt.Errorf("failed to confirm AddNode confirm transaction %s: %w", tx.Hash().String(), err) } } + return &RegisterNodesResponse{ nodeIDToParams: nodeIDToParams, }, nil } +// addNodesMCMSProposal generates a single call to AddNodes for all the node params at once. +func addNodesMCMSProposal(registry *capabilities_registry.CapabilitiesRegistry, params []capabilities_registry.CapabilitiesRegistryNodeParams, regChain deployment.Chain) (*timelock.BatchChainOperation, error) { + tx, err := registry.AddNodes(deployment.SimTransactOpts(), params) + if err != nil { + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + return nil, fmt.Errorf("failed to simulate call to AddNodes: %w", err) + } + + return &timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(regChain.Selector), + Batch: []mcms.Operation{ + { + To: registry.Address(), + Data: tx.Data(), + Value: big.NewInt(0), + }, + }, + }, nil +} + type DONToRegister struct { Name string F uint8 @@ -776,10 +852,12 @@ type RegisterDonsRequest struct { NodeIDToP2PID map[string][32]byte DonToCapabilities map[string][]RegisteredCapability DonsToRegister []DONToRegister + UseMCMS bool } type RegisterDonsResponse struct { DonInfos map[string]capabilities_registry.CapabilitiesRegistryDONInfo + Ops *timelock.BatchChainOperation } func sortedHash(p2pids [][32]byte) string { @@ -815,6 +893,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes } lggr.Infow("fetched existing DONs...", "len", len(donInfos), "lenByNodesHash", len(existingDONs)) + mcmsOps := make([]mcms.Operation, 0, len(req.DonsToRegister)) for _, don := range req.DonsToRegister { var p2pIds [][32]byte for _, n := range don.Nodes { @@ -832,10 +911,12 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes p2pIdsToDon[p2pSortedHash] = don.Name if _, ok := existingDONs[p2pSortedHash]; ok { - lggr.Debugw("don already exists, ignoring", "don", don, "p2p sorted hash", p2pSortedHash) + lggr.Debugw("don already exists, ignoring", "don", don.Name, "p2p sorted hash", p2pSortedHash) continue } + lggr.Debugw("registering DON", "don", don.Name, "p2p sorted hash", p2pSortedHash) + caps, ok := req.DonToCapabilities[don.Name] if !ok { return nil, fmt.Errorf("capabilities not found for DON %s", don.Name) @@ -858,11 +939,28 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes }) } - tx, err := registry.AddDON(registryChain.DeployerKey, p2pIds, cfgs, true, wfSupported, don.F) + txOpts := registryChain.DeployerKey + if req.UseMCMS { + txOpts = deployment.SimTransactOpts() + } + + tx, err := registry.AddDON(txOpts, p2pIds, cfgs, true, wfSupported, don.F) if err != nil { err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call AddDON for don '%s' p2p2Id hash %s capability %v: %w", don.Name, p2pSortedHash, cfgs, err) } + + if req.UseMCMS { + lggr.Debugw("adding mcms op for DON", "don", don.Name) + op := mcms.Operation{ + To: registry.Address(), + Data: tx.Data(), + Value: big.NewInt(0), + } + mcmsOps = append(mcmsOps, op) + continue + } + _, err = registryChain.Confirm(tx) if err != nil { return nil, fmt.Errorf("failed to confirm AddDON transaction %s for don %s: %w", tx.Hash().String(), don.Name, err) @@ -870,6 +968,16 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes lggr.Debugw("registered DON", "don", don.Name, "p2p sorted hash", p2pSortedHash, "cgs", cfgs, "wfSupported", wfSupported, "f", don.F) addedDons++ } + + if req.UseMCMS { + return &RegisterDonsResponse{ + Ops: &timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(registryChain.Selector), + Batch: mcmsOps, + }, + }, nil + } + lggr.Debugf("Registered all DONs (new=%d), waiting for registry to update", addedDons) // occasionally the registry does not return the expected number of DONS immediately after the txns above @@ -906,6 +1014,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes lggr.Debugw("adding don info to the response (keyed by DON name)", "don", donName) resp.DonInfos[donName] = donInfos[i] } + return &resp, nil } diff --git a/deployment/keystone/changeset/internal/deploy_test.go b/deployment/keystone/changeset/internal/deploy_test.go new file mode 100644 index 00000000000..b8a98207ea0 --- /dev/null +++ b/deployment/keystone/changeset/internal/deploy_test.go @@ -0,0 +1,203 @@ +package internal_test + +import ( + "context" + "testing" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" + kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + + "github.com/stretchr/testify/require" +) + +func Test_RegisterNOPS(t *testing.T) { + var ( + useMCMS bool + lggr = logger.Test(t) + setupResp = kstest.SetupTestRegistry(t, lggr, &kstest.SetupTestRegistryRequest{}) + registry = setupResp.Registry + chain = setupResp.Chain + nops = make([]kcr.CapabilitiesRegistryNodeOperator, 0) + ) + t.Run("success create add NOPs mcms proposal", func(t *testing.T) { + nops = append(nops, kcr.CapabilitiesRegistryNodeOperator{ + Name: "test-nop", + }) + useMCMS = true + env := &deployment.Environment{ + Logger: lggr, + Chains: map[uint64]deployment.Chain{ + chain.Selector: chain, + }, + ExistingAddresses: deployment.NewMemoryAddressBookFromMap(map[uint64]map[string]deployment.TypeAndVersion{ + chain.Selector: { + registry.Address().String(): deployment.TypeAndVersion{ + Type: internal.CapabilitiesRegistry, + Version: deployment.Version1_0_0, + }, + }, + }), + } + resp, err := internal.RegisterNOPS(context.TODO(), lggr, internal.RegisterNOPSRequest{ + Env: env, + RegistryChainSelector: chain.Selector, + Nops: nops, + UseMCMS: useMCMS, + }) + require.NoError(t, err) + require.NotNil(t, resp.Ops) + require.Len(t, resp.Ops.Batch, 1) + }) +} + +func Test_AddCapabilities(t *testing.T) { + var ( + useMCMS bool + lggr = logger.Test(t) + setupResp = kstest.SetupTestRegistry(t, lggr, &kstest.SetupTestRegistryRequest{}) + registry = setupResp.Registry + chain = setupResp.Chain + capabilities = make([]kcr.CapabilitiesRegistryCapability, 0) + ) + + t.Run("successfully create mcms proposal", func(t *testing.T) { + useMCMS = true + capabilities = append(capabilities, kcr.CapabilitiesRegistryCapability{ + LabelledName: "cap1", + Version: "1.0.0", + CapabilityType: 0, + }) + ops, err := internal.AddCapabilities(lggr, registry, chain, capabilities, useMCMS) + require.NoError(t, err) + require.NotNil(t, ops) + require.Len(t, ops.Batch, 1) + }) + + t.Run("does nothing if no capabilities", func(t *testing.T) { + ops, err := internal.AddCapabilities(lggr, registry, chain, nil, useMCMS) + require.NoError(t, err) + require.Nil(t, ops) + }) +} + +func Test_RegisterNodes(t *testing.T) { + var ( + useMCMS bool + lggr = logger.Test(t) + setupResp = kstest.SetupTestRegistry(t, lggr, &kstest.SetupTestRegistryRequest{}) + registry = setupResp.Registry + chain = setupResp.Chain + ) + t.Run("success create add nodes mcms proposal", func(t *testing.T) { + useMCMS = true + env := &deployment.Environment{ + Logger: lggr, + Chains: map[uint64]deployment.Chain{ + chain.Selector: chain, + }, + ExistingAddresses: deployment.NewMemoryAddressBookFromMap(map[uint64]map[string]deployment.TypeAndVersion{ + chain.Selector: { + registry.Address().String(): deployment.TypeAndVersion{ + Type: internal.CapabilitiesRegistry, + Version: deployment.Version1_0_0, + }, + }, + }), + } + resp, err := internal.RegisterNodes(lggr, &internal.RegisterNodesRequest{ + Env: env, + RegistryChainSelector: chain.Selector, + UseMCMS: useMCMS, + }) + require.NoError(t, err) + require.NotNil(t, resp.Ops) + require.Len(t, resp.Ops.Batch, 1) + }) +} + +func Test_RegisterDons(t *testing.T) { + var ( + useMCMS bool + lggr = logger.Test(t) + setupResp = kstest.SetupTestRegistry(t, lggr, &kstest.SetupTestRegistryRequest{}) + registry = setupResp.Registry + chain = setupResp.Chain + ) + t.Run("success create add DONs mcms proposal", func(t *testing.T) { + useMCMS = true + env := &deployment.Environment{ + Logger: lggr, + Chains: map[uint64]deployment.Chain{ + chain.Selector: chain, + }, + ExistingAddresses: deployment.NewMemoryAddressBookFromMap(map[uint64]map[string]deployment.TypeAndVersion{ + chain.Selector: { + registry.Address().String(): deployment.TypeAndVersion{ + Type: internal.CapabilitiesRegistry, + Version: deployment.Version1_0_0, + }, + }, + }), + } + resp, err := internal.RegisterDons(lggr, internal.RegisterDonsRequest{ + Env: env, + RegistryChainSelector: chain.Selector, + DonToCapabilities: map[string][]internal.RegisteredCapability{ + "test-don": {}, + }, + DonsToRegister: []internal.DONToRegister{ + { + Name: "test-don", + F: 2, + }, + }, + UseMCMS: useMCMS, + }) + require.NoError(t, err) + require.NotNil(t, resp.Ops) + require.Len(t, resp.Ops.Batch, 1) + }) + + t.Run("success create add DONs mcms proposal with multiple DONs", func(t *testing.T) { + useMCMS = true + env := &deployment.Environment{ + Logger: lggr, + Chains: map[uint64]deployment.Chain{ + chain.Selector: chain, + }, + ExistingAddresses: deployment.NewMemoryAddressBookFromMap(map[uint64]map[string]deployment.TypeAndVersion{ + chain.Selector: { + registry.Address().String(): deployment.TypeAndVersion{ + Type: internal.CapabilitiesRegistry, + Version: deployment.Version1_0_0, + }, + }, + }), + } + resp, err := internal.RegisterDons(lggr, internal.RegisterDonsRequest{ + Env: env, + RegistryChainSelector: chain.Selector, + DonToCapabilities: map[string][]internal.RegisteredCapability{ + "test-don-1": {}, + "test-don-2": {}, + }, + DonsToRegister: []internal.DONToRegister{ + { + Name: "test-don-1", + F: 2, + }, + { + Name: "test-don-2", + F: 2, + }, + }, + UseMCMS: useMCMS, + }) + require.NoError(t, err) + require.NotNil(t, resp.Ops) + require.Len(t, resp.Ops.Batch, 2) + }) +} diff --git a/deployment/keystone/changeset/internal/update_node_capabilities.go b/deployment/keystone/changeset/internal/update_node_capabilities.go index 23e3d66965c..34fb5346d5c 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities.go @@ -38,7 +38,7 @@ func UpdateNodeCapabilitiesImpl(lggr logger.Logger, req *UpdateNodeCapabilitiesI for _, cap := range req.P2pToCapabilities { capabilities = append(capabilities, cap...) } - op, err := AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS) + op, err := AddCapabilities(lggr, req.ContractSet.CapabilitiesRegistry, req.Chain, capabilities, req.UseMCMS) if err != nil { return nil, fmt.Errorf("failed to add capabilities: %w", err) } From d1a9f8be2f222ea30bdf7182aaa6428bfa605cf7 Mon Sep 17 00:00:00 2001 From: Nour Elrashidy Date: Mon, 13 Jan 2025 19:04:48 +0100 Subject: [PATCH 39/91] Fix LBTC flakey test (#15906) --- core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go index 375bb62aaeb..8a3f02c289e 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go +++ b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go @@ -285,7 +285,9 @@ func TestLBTCReader_rateLimiting(t *testing.T) { }, }, 0) - errorChan <- err + if err != nil { + errorChan <- err + } }() } From 796357b17ca875ba80e157fc08b0da5db4ed1644 Mon Sep 17 00:00:00 2001 From: Graham Goh Date: Tue, 14 Jan 2025 14:08:55 +1100 Subject: [PATCH 40/91] feat(tron): update operator ui (#15899) context: https://github.com/smartcontractkit/operator-ui/pull/99 new version of operator ui supports creating tron chain config in the job distributor page. JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1333 --- .changeset/yellow-brooms-leave.md | 5 +++++ core/web/assets/index.html | 2 +- core/web/assets/index.html.gz | Bin 420 -> 418 bytes ...61321d.js => main.5fed0c0f926fb5542ed6.js} | 4 ++-- ....js.gz => main.5fed0c0f926fb5542ed6.js.gz} | Bin 1198171 -> 1198382 bytes operator_ui/TAG | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/yellow-brooms-leave.md rename core/web/assets/{main.008c37495ba29761321d.js => main.5fed0c0f926fb5542ed6.js} (87%) rename core/web/assets/{main.008c37495ba29761321d.js.gz => main.5fed0c0f926fb5542ed6.js.gz} (86%) diff --git a/.changeset/yellow-brooms-leave.md b/.changeset/yellow-brooms-leave.md new file mode 100644 index 00000000000..638751814bf --- /dev/null +++ b/.changeset/yellow-brooms-leave.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#updated feat:create tron chain config on operator ui diff --git a/core/web/assets/index.html b/core/web/assets/index.html index ae1aac9ede0..b878067d029 100644 --- a/core/web/assets/index.html +++ b/core/web/assets/index.html @@ -1 +1 @@ -Operator UIChainlink
\ No newline at end of file +Operator UIChainlink
\ No newline at end of file diff --git a/core/web/assets/index.html.gz b/core/web/assets/index.html.gz index a65173c97c81ceb7da51eee8443c4d0395a6644d..56e0ad999c6f55527b5b01700b1cf597241ed4ac 100644 GIT binary patch delta 407 zcmV;I0cifD1EK?eABzY8000000t1zjL2DZ^5QYDWD#)q!YU{?K3DV{eD5OvdZFA^x zEX{hSl{AYq-o*dD?AkFD3Z)kbJ(%y!JdJ%5*voN5HAsq`J)a1nvk3*1AD~ner=Pxm zTz}B!EN4jQ^hEePauKaOXTdB^KU0vw1)Rv^dU>oUlMuuqb@dR@y_*?A60!R-Vgccz zo*u0^Nj6gcr3yx;>%c|)L6M*qf9>g|$tcDTKzU{~U+aAjiQ>_HHvqb=$7CZL80X$}wUc5dVujPxXra z41$FqzJ2tZ>%Xw3hiR^!N7R4KYW`5CDZw7i%X-l+p+CGPbcwwBLZhgFZ9NvJmrJW! zywe71MX4qM4YHcUYAEeD8P)MN^n&!~s zSeo@tD`^&KyotYkS=%ub3Z)kbJ(%B{c^dmJu$TRaYLFB=dpZ$9XA=r2KR~G{PCtMD zw7AjcBxgwI^hEeFauKaOXTdB^zfh3D1)Rv^;_$ejOhOPL7u7>Vx11S560!R_Vgccz zo*%6_N;Xpdr3yx;>%c|)PLZG%e{Jct$tcDTKzU{~phNJxp`;Jfi+Uttizbpxm_WjbC41-d=5Bb$k7Bxn3=_},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125M(o,n))void 0!==u&&0>M(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else if(void 0!==u&&0>M(u,n))e[r]=u,e[s]=n,r=s;else break a}}return t}return null}function M(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],A=[],L=1,C=null,I=3,D=!1,N=!1,P=!1;function R(e){for(var t=x(A);null!==t;){if(null===t.callback)T(A);else if(t.startTime<=e)T(A),t.sortIndex=t.expirationTime,k(O,t);else break;t=x(A)}}function j(e){if(P=!1,R(e),!N){if(null!==x(O))N=!0,n(F);else{var t=x(A);null!==t&&r(j,t.startTime-e)}}}function F(e,n){N=!1,P&&(P=!1,i()),D=!0;var o=I;try{for(R(n),C=x(O);null!==C&&(!(C.expirationTime>n)||e&&!a());){var s=C.callback;if(null!==s){C.callback=null,I=C.priorityLevel;var u=s(C.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?C.callback=u:C===x(O)&&T(O),R(n)}else T(O);C=x(O)}if(null!==C)var c=!0;else{var l=x(A);null!==l&&r(j,l.startTime-n),c=!1}return c}finally{C=null,I=o,D=!1}}function Y(e){switch(e){case 1:return -1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0s?(e.sortIndex=u,k(A,e),null===x(O)&&e===x(A)&&(P?i():P=!0,r(j,u-s))):(e.sortIndex=o,k(O,e),N||D||(N=!0,n(F))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=x(O);return n!==C&&null!==C&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,n){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,n=l(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var n=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function b(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function m(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function y(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,n;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n */ var r=n(48764),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}},93379(e,t,n){"use strict";var r,i,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(n){t=null}i[e]=t}return i[e]}),s=[];function u(e){for(var t=-1,n=0;nAp});var r,i,a,o,s,u,c,l=n(67294),f=n.t(l,2),d=n(39814),h=n(5977),p=n(57209),b=n(32316),m=n(95880),g=n(17051),v=n(71381),y=n(81701),w=n(3022),_=n(60323),E=n(87591),S=n(25649),k=n(28902),x=n(71426),T=n(48884),M=n(94184),O=n.n(M),A=n(37703),L=n(73935),C=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){I&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Y?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){I&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;F.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),U=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),er="undefined"!=typeof WeakMap?new WeakMap:new C,ei=function(){function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=B.getInstance(),r=new en(t,n,this);er.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ei.prototype[e]=function(){var t;return(t=er.get(this))[e].apply(t,arguments)}});var ea=void 0!==D.ResizeObserver?D.ResizeObserver:ei;let eo=ea;var es=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a=t||n<0||f&&r>=a}function g(){var e=eb();if(m(e))return v(e);s=setTimeout(g,b(e))}function v(e){return(s=void 0,d&&r)?h(e):(r=i=void 0,o)}function y(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0}function w(){return void 0===s?o:v(eb())}function _(){var e=eb(),n=m(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,t),h(u)}return void 0===s&&(s=setTimeout(g,t)),o}return t=ez(t)||0,ed(n)&&(l=!!n.leading,a=(f="maxWait"in n)?eW(ez(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),_.cancel=y,_.flush=w,_}let eq=eV;var eZ="Expected a function";function eX(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError(eZ);return ed(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),eq(e,t,{leading:r,maxWait:t,trailing:i})}let eJ=eX;var eQ={debounce:eq,throttle:eJ},e1=function(e){return eQ[e]},e0=function(e){return"function"==typeof e},e2=function(){return"undefined"==typeof window},e3=function(e){return e instanceof Element||e instanceof HTMLDocument};function e4(e){return(e4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e6(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function e5(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&l.createElement(tG.Z,{variant:"indeterminate",classes:r}))};tK.propTypes={fetchCount:el().number.isRequired};let tV=(0,b.withStyles)(tW)(tK);var tq=n(5536);let tZ=n.p+"ba8bbf16ebf8e1d05bef.svg";function tX(){return(tX=Object.assign||function(e){for(var t=1;t120){for(var d=Math.floor(u/80),h=u%80,p=[],b=0;b0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack)?(Object.defineProperty(nf(b),"stack",{value:s.stack,writable:!0,configurable:!0}),nl(b)):(Error.captureStackTrace?Error.captureStackTrace(nf(b),n):Object.defineProperty(nf(b),"stack",{value:Error().stack,writable:!0,configurable:!0}),b)}return ns(n,[{key:"toString",value:function(){return nw(this)}},{key:t4.YF,get:function(){return"Object"}}]),n}(nd(Error));function ny(e){return void 0===e||0===e.length?void 0:e}function nw(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),nx=n(10143),nT=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),nM=n(87392),nO=function(){function e(e){var t=new nS.WU(nk.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e,t=this.token;if(t.kind!==nk.EOF)do t=null!==(e=t.next)&&void 0!==e?e:t.next=nC(this,t);while(t.kind===nk.COMMENT)return t},e}();function nA(e){return e===nk.BANG||e===nk.DOLLAR||e===nk.AMP||e===nk.PAREN_L||e===nk.PAREN_R||e===nk.SPREAD||e===nk.COLON||e===nk.EQUALS||e===nk.AT||e===nk.BRACKET_L||e===nk.BRACKET_R||e===nk.BRACE_L||e===nk.PIPE||e===nk.BRACE_R}function nL(e){return isNaN(e)?nk.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function nC(e,t){for(var n=e.source,r=n.body,i=r.length,a=t.end;a31||9===a))return new nS.WU(nk.COMMENT,t,s,n,r,i,o.slice(t+1,s))}function nN(e,t,n,r,i,a){var o=e.body,s=n,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw n_(e,u,"Invalid number, unexpected digit after 0: ".concat(nL(s),"."))}else u=nP(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=nP(e,u,s),s=o.charCodeAt(u)),(69===s||101===s)&&(c=!0,(43===(s=o.charCodeAt(++u))||45===s)&&(s=o.charCodeAt(++u)),u=nP(e,u,s),s=o.charCodeAt(u)),46===s||nU(s))throw n_(e,u,"Invalid number, expected digit but got: ".concat(nL(s),"."));return new nS.WU(c?nk.FLOAT:nk.INT,t,u,r,i,a,o.slice(t,u))}function nP(e,t,n){var r=e.body,i=t,a=n;if(a>=48&&a<=57){do a=r.charCodeAt(++i);while(a>=48&&a<=57)return i}throw n_(e,i,"Invalid number, expected digit but got: ".concat(nL(a),"."))}function nR(e,t,n,r,i){for(var a=e.body,o=t+1,s=o,u=0,c="";o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function nB(e,t,n,r,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new nS.WU(nk.NAME,t,s,n,r,i,a.slice(t,s))}function nU(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}function nH(e,t){return new n$(e,t).parseDocument()}var n$=function(){function e(e,t){var n=(0,nx.T)(e)?e:new nx.H(e);this._lexer=new nO(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(nk.NAME);return{kind:nE.h.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:nE.h.DOCUMENT,definitions:this.many(nk.SOF,this.parseDefinition,nk.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(nk.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else if(this.peek(nk.BRACE_L))return this.parseOperationDefinition();else if(this.peekDescription())return this.parseTypeSystemDefinition();throw this.unexpected()},t.parseOperationDefinition=function(){var e,t=this._lexer.token;if(this.peek(nk.BRACE_L))return{kind:nE.h.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(t)};var n=this.parseOperationType();return this.peek(nk.NAME)&&(e=this.parseName()),{kind:nE.h.OPERATION_DEFINITION,operation:n,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseOperationType=function(){var e=this.expectToken(nk.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(nk.PAREN_L,this.parseVariableDefinition,nk.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:nE.h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(nk.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(nk.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(nk.DOLLAR),{kind:nE.h.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:nE.h.SELECTION_SET,selections:this.many(nk.BRACE_L,this.parseSelection,nk.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(nk.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(nk.COLON)?(e=r,t=this.parseName()):t=r,{kind:nE.h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(nk.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(nk.PAREN_L,t,nk.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:nE.h.ARGUMENT,name:this.parseName(),value:(this.expectToken(nk.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(nk.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(nk.NAME)?{kind:nE.h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:nE.h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return(this.expectKeyword("fragment"),(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)===!0)?{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case nk.BRACKET_L:return this.parseList(e);case nk.BRACE_L:return this.parseObject(e);case nk.INT:return this._lexer.advance(),{kind:nE.h.INT,value:t.value,loc:this.loc(t)};case nk.FLOAT:return this._lexer.advance(),{kind:nE.h.FLOAT,value:t.value,loc:this.loc(t)};case nk.STRING:case nk.BLOCK_STRING:return this.parseStringLiteral();case nk.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:nE.h.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:nE.h.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:nE.h.NULL,loc:this.loc(t)};default:return{kind:nE.h.ENUM,value:t.value,loc:this.loc(t)}}case nk.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:nE.h.STRING,value:e.value,block:e.kind===nk.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseValueLiteral(e)};return{kind:nE.h.LIST,values:this.any(nk.BRACKET_L,r,nk.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseObjectField(e)};return{kind:nE.h.OBJECT,fields:this.any(nk.BRACE_L,r,nk.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(nk.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(nk.AT),{kind:nE.h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return(this.expectOptionalToken(nk.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(nk.BRACKET_R),e={kind:nE.h.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(nk.BANG))?{kind:nE.h.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:nE.h.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(nk.STRING)||this.peek(nk.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);return{kind:nE.h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(nk.COLON);var n=this.parseNamedType();return{kind:nE.h.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if((null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)===!0){var t=[];this.expectOptionalToken(nk.AMP);do t.push(this.parseNamedType());while(this.expectOptionalToken(nk.AMP)||this.peek(nk.NAME))return t}return this.delimitedMany(nk.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)===!0&&this.peek(nk.BRACE_L)&&this._lexer.lookahead().kind===nk.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(nk.BRACE_L,this.parseFieldDefinition,nk.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(nk.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:nE.h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(nk.PAREN_L,this.parseInputValueDef,nk.PAREN_R)},t.parseInputValueDef=function(){var e,t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(nk.COLON);var i=this.parseTypeReference();this.expectOptionalToken(nk.EQUALS)&&(e=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:nE.h.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:e,directives:a,loc:this.loc(t)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:nE.h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(nk.EQUALS)?this.delimitedMany(nk.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:nE.h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseEnumValueDefinition,nk.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:nE.h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseInputValueDef,nk.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:nE.h.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:nE.h.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(nk.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:nE.h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(nk.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==nT[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if((null===(t=this._options)||void 0===t?void 0:t.noLocation)!==!0)return new nS.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw n_(this._lexer.source,t.start,"Expected ".concat(nG(e),", found ").concat(nz(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind===nk.NAME&&t.value===e)this._lexer.advance();else throw n_(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(nz(t),"."))},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===nk.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return n_(this._lexer.source,t.start,"Unexpected ".concat(nz(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do n.push(t.call(this));while(this.expectOptionalToken(e))return n},e}();function nz(e){var t=e.value;return nG(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function nG(e){return nA(e)?'"'.concat(e,'"'):e}var nW=new Map,nK=new Map,nV=!0,nq=!1;function nZ(e){return e.replace(/[\s,]+/g," ").trim()}function nX(e){return nZ(e.source.body.substring(e.start,e.end))}function nJ(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=nX(e.loc),a=nK.get(r);a&&!a.has(i)?nV&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||nK.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)}),(0,t0.pi)((0,t0.pi)({},e),{definitions:n})}function nQ(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function n1(e){var t=nZ(e);if(!nW.has(t)){var n=nH(e,{experimentalFragmentVariables:nq,allowLegacyFragmentVariables:nq});if(!n||"Document"!==n.kind)throw Error("Not a valid GraphQL document.");nW.set(t,nQ(nJ(n)))}return nW.get(t)}function n0(e){for(var t=[],n=1;n, or pass an ApolloClient instance in via options.'):(0,n9.kG)(!!n,32),n}var rp=n(10542),rb=n(53712),rm=n(21436),rg=Object.prototype.hasOwnProperty;function rv(e,t){return void 0===t&&(t=Object.create(null)),ry(rh(t.client),e).useQuery(t)}function ry(e,t){var n=(0,l.useRef)();n.current&&e===n.current.client&&t===n.current.query||(n.current=new rw(e,t,n.current));var r=n.current,i=(0,l.useState)(0),a=(i[0],i[1]);return r.forceUpdate=function(){a(function(e){return e+1})},r}var rw=function(){function e(e,t,n){this.client=e,this.query=t,this.ssrDisabledResult=(0,rp.J)({loading:!0,data:void 0,error:void 0,networkStatus:ru.I.loading}),this.skipStandbyResult=(0,rp.J)({loading:!1,data:void 0,error:void 0,networkStatus:ru.I.ready}),this.toQueryResultCache=new(n7.mr?WeakMap:Map),rd(t,r.Query);var i=n&&n.result,a=i&&i.data;a&&(this.previousData=a)}return e.prototype.forceUpdate=function(){__DEV__&&n9.kG.warn("Calling default no-op implementation of InternalState#forceUpdate")},e.prototype.executeQuery=function(e){var t,n=this;e.query&&Object.assign(this,{query:e.query}),this.watchQueryOptions=this.createWatchQueryOptions(this.queryHookOptions=e);var r=this.observable.reobserveAsConcast(this.getObsQueryOptions());return this.previousData=(null===(t=this.result)||void 0===t?void 0:t.data)||this.previousData,this.result=void 0,this.forceUpdate(),new Promise(function(e){var t;r.subscribe({next:function(e){t=e},error:function(){e(n.toQueryResult(n.observable.getCurrentResult()))},complete:function(){e(n.toQueryResult(t))}})})},e.prototype.useQuery=function(e){var t=this;this.renderPromises=(0,l.useContext)((0,ro.K)()).renderPromises,this.useOptions(e);var n=this.useObservableQuery(),r=rt((0,l.useCallback)(function(){if(t.renderPromises)return function(){};var e=function(){var e=t.result,r=n.getCurrentResult();!(e&&e.loading===r.loading&&e.networkStatus===r.networkStatus&&(0,ri.D)(e.data,r.data))&&t.setResult(r)},r=function(a){var o=n.last;i.unsubscribe();try{n.resetLastResults(),i=n.subscribe(e,r)}finally{n.last=o}if(!rg.call(a,"graphQLErrors"))throw a;var s=t.result;(!s||s&&s.loading||!(0,ri.D)(a,s.error))&&t.setResult({data:s&&s.data,error:a,loading:!1,networkStatus:ru.I.error})},i=n.subscribe(e,r);return function(){return setTimeout(function(){return i.unsubscribe()})}},[n,this.renderPromises,this.client.disableNetworkFetches,]),function(){return t.getCurrentResult()},function(){return t.getCurrentResult()});return this.unsafeHandlePartialRefetch(r),this.toQueryResult(r)},e.prototype.useOptions=function(t){var n,r=this.createWatchQueryOptions(this.queryHookOptions=t),i=this.watchQueryOptions;!(0,ri.D)(r,i)&&(this.watchQueryOptions=r,i&&this.observable&&(this.observable.reobserve(this.getObsQueryOptions()),this.previousData=(null===(n=this.result)||void 0===n?void 0:n.data)||this.previousData,this.result=void 0)),this.onCompleted=t.onCompleted||e.prototype.onCompleted,this.onError=t.onError||e.prototype.onError,(this.renderPromises||this.client.disableNetworkFetches)&&!1===this.queryHookOptions.ssr&&!this.queryHookOptions.skip?this.result=this.ssrDisabledResult:this.queryHookOptions.skip||"standby"===this.watchQueryOptions.fetchPolicy?this.result=this.skipStandbyResult:(this.result===this.ssrDisabledResult||this.result===this.skipStandbyResult)&&(this.result=void 0)},e.prototype.getObsQueryOptions=function(){var e=[],t=this.client.defaultOptions.watchQuery;return t&&e.push(t),this.queryHookOptions.defaultOptions&&e.push(this.queryHookOptions.defaultOptions),e.push((0,rb.o)(this.observable&&this.observable.options,this.watchQueryOptions)),e.reduce(ra.J)},e.prototype.createWatchQueryOptions=function(e){void 0===e&&(e={});var t,n=e.skip,r=Object.assign((e.ssr,e.onCompleted,e.onError,e.defaultOptions,(0,t0._T)(e,["skip","ssr","onCompleted","onError","defaultOptions"])),{query:this.query});if(this.renderPromises&&("network-only"===r.fetchPolicy||"cache-and-network"===r.fetchPolicy)&&(r.fetchPolicy="cache-first"),r.variables||(r.variables={}),n){var i=r.fetchPolicy,a=void 0===i?this.getDefaultFetchPolicy():i,o=r.initialFetchPolicy;Object.assign(r,{initialFetchPolicy:void 0===o?a:o,fetchPolicy:"standby"})}else r.fetchPolicy||(r.fetchPolicy=(null===(t=this.observable)||void 0===t?void 0:t.options.initialFetchPolicy)||this.getDefaultFetchPolicy());return r},e.prototype.getDefaultFetchPolicy=function(){var e,t;return(null===(e=this.queryHookOptions.defaultOptions)||void 0===e?void 0:e.fetchPolicy)||(null===(t=this.client.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first"},e.prototype.onCompleted=function(e){},e.prototype.onError=function(e){},e.prototype.useObservableQuery=function(){var e=this.observable=this.renderPromises&&this.renderPromises.getSSRObservable(this.watchQueryOptions)||this.observable||this.client.watchQuery(this.getObsQueryOptions());this.obsQueryFields=(0,l.useMemo)(function(){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}},[e]);var t=!(!1===this.queryHookOptions.ssr||this.queryHookOptions.skip);return this.renderPromises&&t&&(this.renderPromises.registerSSRObservable(e),e.getCurrentResult().loading&&this.renderPromises.addObservableQueryPromise(e)),e},e.prototype.setResult=function(e){var t=this.result;t&&t.data&&(this.previousData=t.data),this.result=e,this.forceUpdate(),this.handleErrorOrCompleted(e)},e.prototype.handleErrorOrCompleted=function(e){var t=this;if(!e.loading){var n=this.toApolloError(e);Promise.resolve().then(function(){n?t.onError(n):e.data&&t.onCompleted(e.data)}).catch(function(e){__DEV__&&n9.kG.warn(e)})}},e.prototype.toApolloError=function(e){return(0,rm.O)(e.errors)?new rs.cA({graphQLErrors:e.errors}):e.error},e.prototype.getCurrentResult=function(){return this.result||this.handleErrorOrCompleted(this.result=this.observable.getCurrentResult()),this.result},e.prototype.toQueryResult=function(e){var t=this.toQueryResultCache.get(e);if(t)return t;var n=e.data,r=(e.partial,(0,t0._T)(e,["data","partial"]));return this.toQueryResultCache.set(e,t=(0,t0.pi)((0,t0.pi)((0,t0.pi)({data:n},r),this.obsQueryFields),{client:this.client,observable:this.observable,variables:this.observable.variables,called:!this.queryHookOptions.skip,previousData:this.previousData})),!t.error&&(0,rm.O)(e.errors)&&(t.error=new rs.cA({graphQLErrors:e.errors})),t},e.prototype.unsafeHandlePartialRefetch=function(e){e.partial&&this.queryHookOptions.partialRefetch&&!e.loading&&(!e.data||0===Object.keys(e.data).length)&&"cache-only"!==this.observable.options.fetchPolicy&&(Object.assign(e,{loading:!0,networkStatus:ru.I.refetch}),this.observable.refetch())},e}();function r_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return rv(iH,e)},iz=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"50",10),r=i$({variables:{offset:(t-1)*n,limit:n},fetchPolicy:"network-only"}),i=r.data,a=r.loading,o=r.error;return a?l.createElement(iR,null):o?l.createElement(iD,{error:o}):i?l.createElement(iI,{chains:i.chains.results,page:t,pageSize:n,total:i.chains.metadata.total}):null},iG=n(67932),iW=n(8126),iK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function iV(e){if(iq())return Intl.DateTimeFormat.supportedLocalesOf(e)[0]}function iq(){return("undefined"==typeof Intl?"undefined":iK(Intl))==="object"&&"function"==typeof Intl.DateTimeFormat}var iZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iX=function(){function e(e,t){for(var n=0;n=i.length)break;s=i[o++]}else{if((o=i.next()).done)break;s=o.value}var s,u=s;if((void 0===e?"undefined":iZ(e))!=="object")return;e=e[u]}return e}},{key:"put",value:function(){for(var e=arguments.length,t=Array(e),n=0;n=o.length)break;c=o[u++]}else{if((u=o.next()).done)break;c=u.value}var c,l=c;"object"!==iZ(a[l])&&(a[l]={}),a=a[l]}return a[i]=r}}]),e}();let i1=iQ;var i0=new i1;function i2(e,t){if(!iq())return function(e){return e.toString()};var n=i4(e),r=JSON.stringify(t),i=i0.get(String(n),r)||i0.put(String(n),r,new Intl.DateTimeFormat(n,t));return function(e){return i.format(e)}}var i3={};function i4(e){var t=e.toString();return i3[t]?i3[t]:i3[t]=iV(e)}var i6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i5(e){return i8(e)?e:new Date(e)}function i8(e){return e instanceof Date||i9(e)}function i9(e){return(void 0===e?"undefined":i6(e))==="object"&&"function"==typeof e.getTime}var i7=n(54087),ae=n.n(i7);function at(e,t){if(0===e.length)return 0;for(var n=0,r=e.length-1,i=void 0;n<=r;){var a=t(e[i=Math.floor((r+n)/2)]);if(0===a)return i;if(a<0){if((n=i+1)>r)return n}else if((r=i-1)=t.nextUpdateTime)aa(t,this.instances);else break}},scheduleNextTick:function(){var e=this;this.scheduledTick=ae()(function(){e.tick(),e.scheduleNextTick()})},start:function(){this.scheduleNextTick()},stop:function(){ae().cancel(this.scheduledTick)}};function ai(e){var t=an(e.getNextValue(),2),n=t[0],r=t[1];e.setValue(n),e.nextUpdateTime=r}function aa(e,t){ai(e),as(t,e),ao(t,e)}function ao(e,t){var n=au(e,t);e.splice(n,0,t)}function as(e,t){var n=e.indexOf(t);e.splice(n,1)}function au(e,t){var n=t.nextUpdateTime;return at(e,function(e){return e.nextUpdateTime===n?0:e.nextUpdateTime>n?1:-1})}var ac=(0,ec.oneOfType)([(0,ec.shape)({minTime:ec.number,formatAs:ec.string.isRequired}),(0,ec.shape)({test:ec.func,formatAs:ec.string.isRequired}),(0,ec.shape)({minTime:ec.number,format:ec.func.isRequired}),(0,ec.shape)({test:ec.func,format:ec.func.isRequired})]),al=(0,ec.oneOfType)([ec.string,(0,ec.shape)({steps:(0,ec.arrayOf)(ac).isRequired,labels:(0,ec.oneOfType)([ec.string,(0,ec.arrayOf)(ec.string)]).isRequired,round:ec.string})]),af=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function ap(e){var t=e.date,n=e.future,r=e.timeStyle,i=e.round,a=e.minTimeLeft,o=e.tooltip,s=e.component,u=e.container,c=e.wrapperComponent,f=e.wrapperProps,d=e.locale,h=e.locales,p=e.formatVerboseDate,b=e.verboseDateFormat,m=e.updateInterval,g=e.tick,v=ah(e,["date","future","timeStyle","round","minTimeLeft","tooltip","component","container","wrapperComponent","wrapperProps","locale","locales","formatVerboseDate","verboseDateFormat","updateInterval","tick"]),y=(0,l.useMemo)(function(){return d&&(h=[d]),h.concat(iW.Z.getDefaultLocale())},[d,h]),w=(0,l.useMemo)(function(){return new iW.Z(y)},[y]);t=(0,l.useMemo)(function(){return i5(t)},[t]);var _=(0,l.useCallback)(function(){var e=Date.now(),o=void 0;if(n&&e>=t.getTime()&&(e=t.getTime(),o=!0),void 0!==a){var s=t.getTime()-1e3*a;e>s&&(e=s,o=!0)}var u=w.format(t,r,{getTimeToNextUpdate:!0,now:e,future:n,round:i}),c=ad(u,2),l=c[0],f=c[1];return f=o?ag:m||f||6e4,[l,e+f]},[t,n,r,m,i,a,w]),E=(0,l.useRef)();E.current=_;var S=(0,l.useMemo)(_,[]),k=ad(S,2),x=k[0],T=k[1],M=(0,l.useState)(x),O=ad(M,2),A=O[0],L=O[1],C=ad((0,l.useState)(),2),I=C[0],D=C[1],N=(0,l.useRef)();(0,l.useEffect)(function(){if(g)return N.current=ar.add({getNextValue:function(){return E.current()},setValue:L,nextUpdateTime:T}),function(){return N.current.stop()}},[g]),(0,l.useEffect)(function(){if(N.current)N.current.forceUpdate();else{var e=_(),t=ad(e,1)[0];L(t)}},[_]),(0,l.useEffect)(function(){D(!0)},[]);var P=(0,l.useMemo)(function(){if("undefined"!=typeof window)return i2(y,b)},[y,b]),R=(0,l.useMemo)(function(){if("undefined"!=typeof window)return p?p(t):P(t)},[t,p,P]),j=l.createElement(s,af({date:t,verboseDate:I?R:void 0,tooltip:o},v),A),F=c||u;return F?l.createElement(F,af({},f,{verboseDate:I?R:void 0}),j):j}ap.propTypes={date:el().oneOfType([el().instanceOf(Date),el().number]).isRequired,locale:el().string,locales:el().arrayOf(el().string),future:el().bool,timeStyle:al,round:el().string,minTimeLeft:el().number,component:el().elementType.isRequired,tooltip:el().bool.isRequired,formatVerboseDate:el().func,verboseDateFormat:el().object,updateInterval:el().oneOfType([el().number,el().arrayOf(el().shape({threshold:el().number,interval:el().number.isRequired}))]),tick:el().bool,wrapperComponent:el().func,wrapperProps:el().object},ap.defaultProps={locales:[],component:av,tooltip:!0,verboseDateFormat:{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},tick:!0},ap=l.memo(ap);let ab=ap;var am,ag=31536e9;function av(e){var t=e.date,n=e.verboseDate,r=e.tooltip,i=e.children,a=ah(e,["date","verboseDate","tooltip","children"]),o=(0,l.useMemo)(function(){return t.toISOString()},[t]);return l.createElement("time",af({},a,{dateTime:o,title:r?n:void 0}),i)}av.propTypes={date:el().instanceOf(Date).isRequired,verboseDate:el().string,tooltip:el().bool.isRequired,children:el().string.isRequired};var ay=n(30381),aw=n.n(ay),a_=n(31657);function aE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aS(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?new rs.cA({graphQLErrors:i}):void 0;if(u===s.current.mutationId&&!c.ignoreResults){var f={called:!0,loading:!1,data:r,error:l,client:a};s.current.isMounted&&!(0,ri.D)(s.current.result,f)&&o(s.current.result=f)}var d=e.onCompleted||(null===(n=s.current.options)||void 0===n?void 0:n.onCompleted);return null==d||d(t.data,c),t}).catch(function(t){if(u===s.current.mutationId&&s.current.isMounted){var n,r={loading:!1,error:t,data:void 0,called:!0,client:a};(0,ri.D)(s.current.result,r)||o(s.current.result=r)}var i=e.onError||(null===(n=s.current.options)||void 0===n?void 0:n.onError);if(i)return i(t,c),{data:void 0,errors:t};throw t})},[]),c=(0,l.useCallback)(function(){s.current.isMounted&&o({called:!1,loading:!1,client:n})},[]);return(0,l.useEffect)(function(){return s.current.isMounted=!0,function(){s.current.isMounted=!1}},[]),[u,(0,t0.pi)({reset:c},a)]}var os=n(59067),ou=n(28428),oc=n(11186),ol=n(78513);function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var od=function(e){return(0,b.createStyles)({paper:{display:"flex",margin:"".concat(2.5*e.spacing.unit,"px 0"),padding:"".concat(3*e.spacing.unit,"px ").concat(3.5*e.spacing.unit,"px")},content:{flex:1,width:"100%"},actions:of({marginTop:-(1.5*e.spacing.unit),marginLeft:-(4*e.spacing.unit)},e.breakpoints.up("sm"),{marginLeft:0,marginRight:-(1.5*e.spacing.unit)}),itemBlock:{border:"1px solid rgba(224, 224, 224, 1)",borderRadius:e.shape.borderRadius,padding:2*e.spacing.unit,marginTop:e.spacing.unit},itemBlockText:{overflowWrap:"anywhere"}})},oh=(0,b.withStyles)(od)(function(e){var t=e.actions,n=e.children,r=e.classes;return l.createElement(ii.default,{className:r.paper},l.createElement("div",{className:r.content},n),t&&l.createElement("div",{className:r.actions},t))}),op=function(e){var t=e.title;return l.createElement(x.default,{variant:"subtitle2",gutterBottom:!0},t)},ob=function(e){var t=e.children,n=e.value;return l.createElement(x.default,{variant:"body1",noWrap:!0},t||n)},om=(0,b.withStyles)(od)(function(e){var t=e.children,n=e.classes,r=e.value;return l.createElement("div",{className:n.itemBlock},l.createElement(x.default,{variant:"body1",className:n.itemBlockText},t||r))});function og(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]-1}let sq=sV;function sZ(e,t){var n=this.__data__,r=sH(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}let sX=sZ;function sJ(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=cC}let cD=cI;var cN="[object Arguments]",cP="[object Array]",cR="[object Boolean]",cj="[object Date]",cF="[object Error]",cY="[object Function]",cB="[object Map]",cU="[object Number]",cH="[object Object]",c$="[object RegExp]",cz="[object Set]",cG="[object String]",cW="[object WeakMap]",cK="[object ArrayBuffer]",cV="[object DataView]",cq="[object Float64Array]",cZ="[object Int8Array]",cX="[object Int16Array]",cJ="[object Int32Array]",cQ="[object Uint8Array]",c1="[object Uint8ClampedArray]",c0="[object Uint16Array]",c2="[object Uint32Array]",c3={};function c4(e){return eD(e)&&cD(e.length)&&!!c3[eC(e)]}c3["[object Float32Array]"]=c3[cq]=c3[cZ]=c3[cX]=c3[cJ]=c3[cQ]=c3[c1]=c3[c0]=c3[c2]=!0,c3[cN]=c3[cP]=c3[cK]=c3[cR]=c3[cV]=c3[cj]=c3[cF]=c3[cY]=c3[cB]=c3[cU]=c3[cH]=c3[c$]=c3[cz]=c3[cG]=c3[cW]=!1;let c6=c4;function c5(e){return function(t){return e(t)}}let c8=c5;var c9=n(79730),c7=c9.Z&&c9.Z.isTypedArray,le=c7?c8(c7):c6;let lt=le;var ln=Object.prototype.hasOwnProperty;function lr(e,t){var n=cx(e),r=!n&&cS(e),i=!n&&!r&&(0,cT.Z)(e),a=!n&&!r&&!i&<(e),o=n||r||i||a,s=o?cb(e.length,String):[],u=s.length;for(var c in e)(t||ln.call(e,c))&&!(o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||cL(c,u)))&&s.push(c);return s}let li=lr;var la=Object.prototype;function lo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||la)}let ls=lo;var lu=sT(Object.keys,Object);let lc=lu;var ll=Object.prototype.hasOwnProperty;function lf(e){if(!ls(e))return lc(e);var t=[];for(var n in Object(e))ll.call(e,n)&&"constructor"!=n&&t.push(n);return t}let ld=lf;function lh(e){return null!=e&&cD(e.length)&&!ur(e)}let lp=lh;function lb(e){return lp(e)?li(e):ld(e)}let lm=lb;function lg(e,t){return e&&ch(t,lm(t),e)}let lv=lg;function ly(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}let lw=ly;var l_=Object.prototype.hasOwnProperty;function lE(e){if(!ed(e))return lw(e);var t=ls(e),n=[];for(var r in e)"constructor"==r&&(t||!l_.call(e,r))||n.push(r);return n}let lS=lE;function lk(e){return lp(e)?li(e,!0):lS(e)}let lx=lk;function lT(e,t){return e&&ch(t,lx(t),e)}let lM=lT;var lO=n(42896);function lA(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0||(i[n]=e[n]);return i}function hu(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hc=function(e){return Array.isArray(e)&&0===e.length},hl=function(e){return"function"==typeof e},hf=function(e){return null!==e&&"object"==typeof e},hd=function(e){return String(Math.floor(Number(e)))===e},hh=function(e){return"[object String]"===Object.prototype.toString.call(e)},hp=function(e){return 0===l.Children.count(e)},hb=function(e){return hf(e)&&hl(e.then)};function hm(e,t,n,r){void 0===r&&(r=0);for(var i=d8(t);e&&r=0?[]:{}}}return(0===a?e:i)[o[a]]===n?e:(void 0===n?delete i[o[a]]:i[o[a]]=n,0===a&&void 0===n&&delete r[o[a]],r)}function hv(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,a=Object.keys(e);i0?t.map(function(t){return x(t,hm(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]).then(function(e){return e.reduce(function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=hg(e,t[r],n)),e},{})})},[x]),M=(0,l.useCallback)(function(e){return Promise.all([T(e),h.validationSchema?k(e):{},h.validate?S(e):{}]).then(function(e){var t=e[0],n=e[1],r=e[2];return sk.all([t,n,r],{arrayMerge:hL})})},[h.validate,h.validationSchema,T,S,k]),O=hN(function(e){return void 0===e&&(e=_.values),E({type:"SET_ISVALIDATING",payload:!0}),M(e).then(function(e){return v.current&&(E({type:"SET_ISVALIDATING",payload:!1}),sd()(_.errors,e)||E({type:"SET_ERRORS",payload:e})),e})});(0,l.useEffect)(function(){o&&!0===v.current&&sd()(p.current,h.initialValues)&&O(p.current)},[o,O]);var A=(0,l.useCallback)(function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:b.current?b.current:h.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:h.initialTouched||{},i=e&&e.status?e.status:g.current?g.current:h.initialStatus;p.current=t,b.current=n,m.current=r,g.current=i;var a=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(h.onReset){var o=h.onReset(_.values,V);hb(o)?o.then(a):a()}else a()},[h.initialErrors,h.initialStatus,h.initialTouched]);(0,l.useEffect)(function(){!0===v.current&&!sd()(p.current,h.initialValues)&&(c&&(p.current=h.initialValues,A()),o&&O(p.current))},[c,h.initialValues,A,o,O]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(b.current,h.initialErrors)&&(b.current=h.initialErrors||hS,E({type:"SET_ERRORS",payload:h.initialErrors||hS}))},[c,h.initialErrors]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(m.current,h.initialTouched)&&(m.current=h.initialTouched||hk,E({type:"SET_TOUCHED",payload:h.initialTouched||hk}))},[c,h.initialTouched]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(g.current,h.initialStatus)&&(g.current=h.initialStatus,E({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var L=hN(function(e){if(y.current[e]&&hl(y.current[e].validate)){var t=hm(_.values,e),n=y.current[e].validate(t);return hb(n)?(E({type:"SET_ISVALIDATING",payload:!0}),n.then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return h.validationSchema?(E({type:"SET_ISVALIDATING",payload:!0}),k(_.values,e).then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),E({type:"SET_ISVALIDATING",payload:!1})})):Promise.resolve()}),C=(0,l.useCallback)(function(e,t){var n=t.validate;y.current[e]={validate:n}},[]),I=(0,l.useCallback)(function(e){delete y.current[e]},[]),D=hN(function(e,t){return E({type:"SET_TOUCHED",payload:e}),(void 0===t?i:t)?O(_.values):Promise.resolve()}),N=(0,l.useCallback)(function(e){E({type:"SET_ERRORS",payload:e})},[]),P=hN(function(e,t){var r=hl(e)?e(_.values):e;return E({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?O(r):Promise.resolve()}),R=(0,l.useCallback)(function(e,t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),j=hN(function(e,t,r){return E({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?O(hg(_.values,e,t)):Promise.resolve()}),F=(0,l.useCallback)(function(e,t){var n,r=t,i=e;if(!hh(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,s=a.name,u=a.id,c=a.value,l=a.checked,f=(a.outerHTML,a.options),d=a.multiple;r=t||s||u,i=/number|range/.test(o)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(o)?hI(hm(_.values,r),l,c):d?hC(f):c}r&&j(r,i)},[j,_.values]),Y=hN(function(e){if(hh(e))return function(t){return F(t,e)};F(e)}),B=hN(function(e,t,n){return void 0===t&&(t=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?i:n)?O(_.values):Promise.resolve()}),U=(0,l.useCallback)(function(e,t){e.persist&&e.persist();var n,r=e.target,i=r.name,a=r.id;r.outerHTML,B(t||i||a,!0)},[B]),H=hN(function(e){if(hh(e))return function(t){return U(t,e)};U(e)}),$=(0,l.useCallback)(function(e){hl(e)?E({type:"SET_FORMIK_STATE",payload:e}):E({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),z=(0,l.useCallback)(function(e){E({type:"SET_STATUS",payload:e})},[]),G=(0,l.useCallback)(function(e){E({type:"SET_ISSUBMITTING",payload:e})},[]),W=hN(function(){return E({type:"SUBMIT_ATTEMPT"}),O().then(function(e){var t,n=e instanceof Error;if(!n&&0===Object.keys(e).length){try{if(void 0===(t=q()))return}catch(r){throw r}return Promise.resolve(t).then(function(e){return v.current&&E({type:"SUBMIT_SUCCESS"}),e}).catch(function(e){if(v.current)throw E({type:"SUBMIT_FAILURE"}),e})}if(v.current&&(E({type:"SUBMIT_FAILURE"}),n))throw e})}),K=hN(function(e){e&&e.preventDefault&&hl(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&hl(e.stopPropagation)&&e.stopPropagation(),W().catch(function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)})}),V={resetForm:A,validateForm:O,validateField:L,setErrors:N,setFieldError:R,setFieldTouched:B,setFieldValue:j,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,setFormikState:$,submitForm:W},q=hN(function(){return f(_.values,V)}),Z=hN(function(e){e&&e.preventDefault&&hl(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&hl(e.stopPropagation)&&e.stopPropagation(),A()}),X=(0,l.useCallback)(function(e){return{value:hm(_.values,e),error:hm(_.errors,e),touched:!!hm(_.touched,e),initialValue:hm(p.current,e),initialTouched:!!hm(m.current,e),initialError:hm(b.current,e)}},[_.errors,_.touched,_.values]),J=(0,l.useCallback)(function(e){return{setValue:function(t,n){return j(e,t,n)},setTouched:function(t,n){return B(e,t,n)},setError:function(t){return R(e,t)}}},[j,B,R]),Q=(0,l.useCallback)(function(e){var t=hf(e),n=t?e.name:e,r=hm(_.values,n),i={name:n,value:r,onChange:Y,onBlur:H};if(t){var a=e.type,o=e.value,s=e.as,u=e.multiple;"checkbox"===a?void 0===o?i.checked=!!r:(i.checked=!!(Array.isArray(r)&&~r.indexOf(o)),i.value=o):"radio"===a?(i.checked=r===o,i.value=o):"select"===s&&u&&(i.value=i.value||[],i.multiple=!0)}return i},[H,Y,_.values]),ee=(0,l.useMemo)(function(){return!sd()(p.current,_.values)},[p.current,_.values]),et=(0,l.useMemo)(function(){return void 0!==s?ee?_.errors&&0===Object.keys(_.errors).length:!1!==s&&hl(s)?s(h):s:_.errors&&0===Object.keys(_.errors).length},[s,ee,_.errors,h]);return ha({},_,{initialValues:p.current,initialErrors:b.current,initialTouched:m.current,initialStatus:g.current,handleBlur:H,handleChange:Y,handleReset:Z,handleSubmit:K,resetForm:A,setErrors:N,setFormikState:$,setFieldTouched:B,setFieldValue:j,setFieldError:R,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,submitForm:W,validateForm:O,validateField:L,isValid:et,dirty:ee,unregisterField:I,registerField:C,getFieldProps:Q,getFieldMeta:X,getFieldHelpers:J,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function hT(e){var t=hx(e),n=e.component,r=e.children,i=e.render,a=e.innerRef;return(0,l.useImperativeHandle)(a,function(){return t}),(0,l.createElement)(hw,{value:t},n?(0,l.createElement)(n,t):i?i(t):r?hl(r)?r(t):hp(r)?null:l.Children.only(r):null)}function hM(e){var t={};if(e.inner){if(0===e.inner.length)return hg(t,e.path,e.message);for(var n=e.inner,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;hm(t,o.path)||(t=hg(t,o.path,o.message))}}return t}function hO(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r={});var i=hA(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function hA(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map(function(e){return!0===Array.isArray(e)||sR(e)?hA(e):""!==e?e:void 0}):sR(e[r])?t[r]=hA(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function hL(e,t,n){var r=e.slice();return t.forEach(function(t,i){if(void 0===r[i]){var a=!1!==n.clone&&n.isMergeableObject(t);r[i]=a?sk(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=sk(e[i],t,n):-1===e.indexOf(t)&&r.push(t)}),r}function hC(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}function hI(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],i=!1,a=-1;if(Array.isArray(e))r=e,i=(a=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,a).concat(r.slice(a+1)):r}var hD="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function hN(e){var t=(0,l.useRef)(e);return hD(function(){t.current=e}),(0,l.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;re?t:e},0);return Array.from(ha({},e,{length:t+1}))};(function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,a=i.name;(0,i.formik.setFormikState)(function(n){var i="function"==typeof r?r:e,o="function"==typeof t?t:e,s=hg(n.values,a,e(hm(n.values,a))),u=r?i(hm(n.errors,a)):void 0,c=t?o(hm(n.touched,a)):void 0;return hc(u)&&(u=void 0),hc(c)&&(c=void 0),ha({},n,{values:s,errors:r?hg(n.errors,a,u):n.errors,touched:t?hg(n.touched,a,c):n.touched})})},n.push=function(e){return n.updateArrayField(function(t){return[].concat(hU(t),[hi(e)])},!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField(function(n){return hF(n,e,t)},!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField(function(n){return hj(n,e,t)},!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField(function(n){return hY(n,e,t)},function(t){return hY(t,e,null)},function(t){return hY(t,e,null)})},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField(function(n){return hB(n,e,t)},!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField(function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(hu(n)),n.pop=n.pop.bind(hu(n)),n}ho(t,e);var n=t.prototype;return n.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!sd()(hm(e.formik.values,e.name),hm(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(e){var t;return this.updateArrayField(function(n){var r=n?hU(n):[];return t||(t=r[e]),hl(r.splice)&&r.splice(e,1),r},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n},!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=hs(t.formik,["validate","validationSchema"]),s=ha({},e,{form:o,name:a});return n?(0,l.createElement)(n,s):r?r(s):i?"function"==typeof i?i(s):hp(i)?null:l.Children.only(i):null},t})(l.Component).defaultProps={validateOnChange:!0},l.Component,l.Component;var hH=n(24802),h$=n(71209),hz=n(91750),hG=n(11970),hW=n(4689),hK=n(67598),hV=function(){return(hV=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&(n[r[i]]=e[r[i]]);return n}function hZ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form,o=a.isSubmitting,s=a.touched,u=a.errors,c=e.onBlur,l=e.helperText,f=hq(e,["disabled","field","form","onBlur","helperText"]),d=hm(u,i.name),h=hm(s,i.name)&&!!d;return hV(hV({variant:f.variant,error:h,helperText:h?d:l,disabled:null!=t?t:o,onBlur:null!=c?c:function(e){r(null!=e?e:i.name)}},i),f)}function hX(e){var t=e.children,n=hq(e,["children"]);return(0,l.createElement)(iw.Z,hV({},hZ(n)),t)}function hJ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=(e.type,e.onBlur),s=hq(e,["disabled","field","form","type","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function hQ(e){return(0,l.createElement)(hH.Z,hV({},hJ(e)))}function h1(e){var t,n=e.disabled,r=e.field,i=r.onBlur,a=hq(r,["onBlur"]),o=e.form.isSubmitting,s=(e.type,e.onBlur),u=hq(e,["disabled","field","form","type","onBlur"]);return hV(hV({disabled:null!=n?n:o,indeterminate:!Array.isArray(a.value)&&null==a.value,onBlur:null!=s?s:function(e){i(null!=e?e:a.name)}},a),u)}function h0(e){return(0,l.createElement)(h$.Z,hV({},h1(e)))}function h2(e){var t=e.Label,n=hq(e,["Label"]);return(0,l.createElement)(hz.Z,hV({control:(0,l.createElement)(h$.Z,hV({},h1(n)))},t))}function h3(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hq(e,["disabled","field","form","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function h4(e){return(0,l.createElement)(hG.default,hV({},h3(e)))}function h6(e){var t=e.field,n=t.onBlur,r=hq(t,["onBlur"]),i=(e.form,e.onBlur),a=hq(e,["field","form","onBlur"]);return hV(hV({onBlur:null!=i?i:function(e){n(null!=e?e:r.name)}},r),a)}function h5(e){return(0,l.createElement)(hW.Z,hV({},h6(e)))}function h8(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hq(e,["disabled","field","form","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function h9(e){return(0,l.createElement)(hK.default,hV({},h8(e)))}hX.displayName="FormikMaterialUITextField",hQ.displayName="FormikMaterialUISwitch",h0.displayName="FormikMaterialUICheckbox",h2.displayName="FormikMaterialUICheckboxWithLabel",h4.displayName="FormikMaterialUISelect",h5.displayName="FormikMaterialUIRadioGroup",h9.displayName="FormikMaterialUIInputBase";try{a=Map}catch(h7){}try{o=Set}catch(pe){}function pt(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return RegExp(e);if(Array.isArray(e))return e.map(pn);if(a&&e instanceof a)return new Map(Array.from(e.entries()));if(o&&e instanceof o)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var s=t.findIndex(function(t){return t===e[i]});r[i]=s>-1?n[s]:pt(e[i],t,n)}return r}return e}function pn(e){return pt(e,[],[])}let pr=Object.prototype.toString,pi=Error.prototype.toString,pa=RegExp.prototype.toString,po="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ps=/^Symbol\((.*)\)(.*)$/;function pu(e){if(e!=+e)return"NaN";let t=0===e&&1/e<0;return t?"-0":""+e}function pc(e,t=!1){if(null==e||!0===e||!1===e)return""+e;let n=typeof e;if("number"===n)return pu(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return po.call(e).replace(ps,"Symbol($1)");let r=pr.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+pi.call(e)+"]":"RegExp"===r?pa.call(e):null}function pl(e,t){let n=pc(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=pc(this[e],t);return null!==r?r:n},2)}let pf={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType({path:e,type:t,value:n,originalValue:r}){let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${pl(n,!0)}\``+(i?` (cast from the value \`${pl(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},pd={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ph={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},pp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pb={isValue:"${path} field must be ${value}"},pm={noUnknown:"${path} field has unspecified keys: ${unknown}"},pg={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};Object.assign(Object.create(null),{mixed:pf,string:pd,number:ph,date:pp,object:pm,array:pg,boolean:pb});var pv=n(18721),py=n.n(pv);let pw=e=>e&&e.__isYupSchema__;class p_{constructor(e,t){if(this.refs=e,this.refs=e,"function"==typeof t){this.fn=t;return}if(!py()(t,"is"))throw TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every(e=>e===n);this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!pw(r))throw TypeError("conditions must return a schema object");return r.resolve(t)}}let pE=p_;function pS(e){return null==e?[]:[].concat(e)}function pk(){return(pk=Object.assign||function(e){for(var t=1;tpl(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],pS(e).forEach(e=>{pT.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,pT)}}let pM=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function pO(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=pM(t),l=r.length,f=[];if(o=o||[],!l)return o.length?c(new pT(o,a,u)):c(null,a);for(let d=0;d=0||(i[n]=e[n]);return i}function pR(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=pP(t,["value","path","label","options","originalValue","sync"]),{name:l,test:f,params:d,message:h}=e,{parent:p,context:b}=o;function m(e){return pD.isRef(e)?e.getValue(r,p,b):e}function g(e={}){let t=pL()(pN({value:r,originalValue:s,label:a,path:e.path||i},d,e.params),m),n=new pT(pT.formatError(e.message||h,t),r,t.path,e.type||l);return n.params=t,n}let v=pN({path:i,parent:p,type:l,createError:g,resolve:m,options:o,originalValue:s},c);if(!u){try{Promise.resolve(f.call(v,r,v)).then(e=>{pT.isError(e)?n(e):e?n(null,e):n(g())})}catch(y){n(y)}return}let w;try{var _;if(w=f.call(v,r,v),"function"==typeof(null==(_=w)?void 0:_.then))throw Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(E){n(E);return}pT.isError(w)?n(w):w?n(null,w):n(g())}return t.OPTIONS=e,t}pD.prototype.__isYupRef=!0;let pj=e=>e.substr(0,e.length-1).substr(1);function pF(e,t,n,r=n){let i,a,o;return t?((0,pC.forEach)(t,(s,u,c)=>{let l=u?pj(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let f=c?parseInt(l,10):0;if(n&&f>=n.length)throw Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class pY{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let t of this.list)e.push(t);for(let[,n]of this.refs)e.push(n.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){pD.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){pD.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,t){if(this.list.has(e))return!0;let n,r=this.refs.values();for(;!(n=r.next()).done;)if(t(n.value)===e)return!0;return!1}clone(){let e=new pY;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){let n=this.clone();return e.list.forEach(e=>n.add(e)),e.refs.forEach(e=>n.add(e)),t.list.forEach(e=>n.delete(e)),t.refs.forEach(e=>n.delete(e)),n}}function pB(){return(pB=Object.assign||function(e){for(var t=1;t{this.typeError(pf.notType)}),this.type=(null==e?void 0:e.type)||"mixed",this.spec=pB({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=pB({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=pn(pB({},this.spec,e)),t}label(e){var t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone(),r=pB({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n}isType(e){return!!this.spec.nullable&&null===e||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;(t=t.clone()).conditions=[],t=(t=n.reduce((t,n)=>n.resolve(t,e),t)).resolve(e)}return t}cast(e,t={}){let n=this.resolve(pB({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=pl(e),a=pl(r);throw TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". + */ Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var n,r,i,a,o,s=null,u=null,c=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(n){throw setTimeout(c,0),n}},l=Date.now();t.unstable_now=function(){return Date.now()-l},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(c,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var b=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var m=d.now();t.unstable_now=function(){return d.now()-m}}var g=!1,v=null,y=-1,w=5,_=0;a=function(){return t.unstable_now()>=_},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125M(o,n))void 0!==u&&0>M(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else if(void 0!==u&&0>M(u,n))e[r]=u,e[s]=n,r=s;else break a}}return t}return null}function M(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],A=[],L=1,C=null,I=3,D=!1,N=!1,P=!1;function R(e){for(var t=x(A);null!==t;){if(null===t.callback)T(A);else if(t.startTime<=e)T(A),t.sortIndex=t.expirationTime,k(O,t);else break;t=x(A)}}function j(e){if(P=!1,R(e),!N){if(null!==x(O))N=!0,n(F);else{var t=x(A);null!==t&&r(j,t.startTime-e)}}}function F(e,n){N=!1,P&&(P=!1,i()),D=!0;var o=I;try{for(R(n),C=x(O);null!==C&&(!(C.expirationTime>n)||e&&!a());){var s=C.callback;if(null!==s){C.callback=null,I=C.priorityLevel;var u=s(C.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?C.callback=u:C===x(O)&&T(O),R(n)}else T(O);C=x(O)}if(null!==C)var c=!0;else{var l=x(A);null!==l&&r(j,l.startTime-n),c=!1}return c}finally{C=null,I=o,D=!1}}function Y(e){switch(e){case 1:return -1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0s?(e.sortIndex=u,k(A,e),null===x(O)&&e===x(A)&&(P?i():P=!0,r(j,u-s))):(e.sortIndex=o,k(O,e),N||D||(N=!0,n(F))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=x(O);return n!==C&&null!==C&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,n){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,n=l(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var n=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function b(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function m(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function y(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,n;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n */ var r=n(48764),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}},93379(e,t,n){"use strict";var r,i,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(n){t=null}i[e]=t}return i[e]}),s=[];function u(e){for(var t=-1,n=0;nAk});var r,i,a,o,s,u,c,l=n(67294),f=n.t(l,2),d=n(39814),h=n(5977),p=n(57209),b=n(32316),m=n(95880),g=n(17051),v=n(71381),y=n(81701),w=n(3022),_=n(60323),E=n(87591),S=n(25649),k=n(28902),x=n(71426),T=n(48884),M=n(94184),O=n.n(M),A=n(37703),L=n(73935),C=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){I&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Y?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){I&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;F.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),U=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),er="undefined"!=typeof WeakMap?new WeakMap:new C,ei=function(){function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=B.getInstance(),r=new en(t,n,this);er.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ei.prototype[e]=function(){var t;return(t=er.get(this))[e].apply(t,arguments)}});var ea=void 0!==D.ResizeObserver?D.ResizeObserver:ei;let eo=ea;var es=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a=t||n<0||f&&r>=a}function g(){var e=eb();if(m(e))return v(e);s=setTimeout(g,b(e))}function v(e){return(s=void 0,d&&r)?h(e):(r=i=void 0,o)}function y(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0}function w(){return void 0===s?o:v(eb())}function _(){var e=eb(),n=m(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,t),h(u)}return void 0===s&&(s=setTimeout(g,t)),o}return t=ez(t)||0,ed(n)&&(l=!!n.leading,a=(f="maxWait"in n)?eW(ez(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),_.cancel=y,_.flush=w,_}let eq=eV;var eZ="Expected a function";function eX(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError(eZ);return ed(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),eq(e,t,{leading:r,maxWait:t,trailing:i})}let eJ=eX;var eQ={debounce:eq,throttle:eJ},e1=function(e){return eQ[e]},e0=function(e){return"function"==typeof e},e2=function(){return"undefined"==typeof window},e3=function(e){return e instanceof Element||e instanceof HTMLDocument};function e4(e){return(e4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e6(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function e5(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&l.createElement(tG.Z,{variant:"indeterminate",classes:r}))};tK.propTypes={fetchCount:el().number.isRequired};let tV=(0,b.withStyles)(tW)(tK);var tq=n(5536);let tZ=n.p+"ba8bbf16ebf8e1d05bef.svg";function tX(){return(tX=Object.assign||function(e){for(var t=1;t120){for(var d=Math.floor(u/80),h=u%80,p=[],b=0;b0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack)?(Object.defineProperty(nf(b),"stack",{value:s.stack,writable:!0,configurable:!0}),nl(b)):(Error.captureStackTrace?Error.captureStackTrace(nf(b),n):Object.defineProperty(nf(b),"stack",{value:Error().stack,writable:!0,configurable:!0}),b)}return ns(n,[{key:"toString",value:function(){return nw(this)}},{key:t4.YF,get:function(){return"Object"}}]),n}(nd(Error));function ny(e){return void 0===e||0===e.length?void 0:e}function nw(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),nx=n(10143),nT=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),nM=n(87392),nO=function(){function e(e){var t=new nS.WU(nk.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e,t=this.token;if(t.kind!==nk.EOF)do t=null!==(e=t.next)&&void 0!==e?e:t.next=nC(this,t);while(t.kind===nk.COMMENT)return t},e}();function nA(e){return e===nk.BANG||e===nk.DOLLAR||e===nk.AMP||e===nk.PAREN_L||e===nk.PAREN_R||e===nk.SPREAD||e===nk.COLON||e===nk.EQUALS||e===nk.AT||e===nk.BRACKET_L||e===nk.BRACKET_R||e===nk.BRACE_L||e===nk.PIPE||e===nk.BRACE_R}function nL(e){return isNaN(e)?nk.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function nC(e,t){for(var n=e.source,r=n.body,i=r.length,a=t.end;a31||9===a))return new nS.WU(nk.COMMENT,t,s,n,r,i,o.slice(t+1,s))}function nN(e,t,n,r,i,a){var o=e.body,s=n,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw n_(e,u,"Invalid number, unexpected digit after 0: ".concat(nL(s),"."))}else u=nP(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=nP(e,u,s),s=o.charCodeAt(u)),(69===s||101===s)&&(c=!0,(43===(s=o.charCodeAt(++u))||45===s)&&(s=o.charCodeAt(++u)),u=nP(e,u,s),s=o.charCodeAt(u)),46===s||nU(s))throw n_(e,u,"Invalid number, expected digit but got: ".concat(nL(s),"."));return new nS.WU(c?nk.FLOAT:nk.INT,t,u,r,i,a,o.slice(t,u))}function nP(e,t,n){var r=e.body,i=t,a=n;if(a>=48&&a<=57){do a=r.charCodeAt(++i);while(a>=48&&a<=57)return i}throw n_(e,i,"Invalid number, expected digit but got: ".concat(nL(a),"."))}function nR(e,t,n,r,i){for(var a=e.body,o=t+1,s=o,u=0,c="";o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function nB(e,t,n,r,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new nS.WU(nk.NAME,t,s,n,r,i,a.slice(t,s))}function nU(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}function nH(e,t){return new n$(e,t).parseDocument()}var n$=function(){function e(e,t){var n=(0,nx.T)(e)?e:new nx.H(e);this._lexer=new nO(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(nk.NAME);return{kind:nE.h.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:nE.h.DOCUMENT,definitions:this.many(nk.SOF,this.parseDefinition,nk.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(nk.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else if(this.peek(nk.BRACE_L))return this.parseOperationDefinition();else if(this.peekDescription())return this.parseTypeSystemDefinition();throw this.unexpected()},t.parseOperationDefinition=function(){var e,t=this._lexer.token;if(this.peek(nk.BRACE_L))return{kind:nE.h.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(t)};var n=this.parseOperationType();return this.peek(nk.NAME)&&(e=this.parseName()),{kind:nE.h.OPERATION_DEFINITION,operation:n,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseOperationType=function(){var e=this.expectToken(nk.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(nk.PAREN_L,this.parseVariableDefinition,nk.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:nE.h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(nk.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(nk.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(nk.DOLLAR),{kind:nE.h.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:nE.h.SELECTION_SET,selections:this.many(nk.BRACE_L,this.parseSelection,nk.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(nk.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(nk.COLON)?(e=r,t=this.parseName()):t=r,{kind:nE.h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(nk.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(nk.PAREN_L,t,nk.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:nE.h.ARGUMENT,name:this.parseName(),value:(this.expectToken(nk.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(nk.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(nk.NAME)?{kind:nE.h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:nE.h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return(this.expectKeyword("fragment"),(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)===!0)?{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case nk.BRACKET_L:return this.parseList(e);case nk.BRACE_L:return this.parseObject(e);case nk.INT:return this._lexer.advance(),{kind:nE.h.INT,value:t.value,loc:this.loc(t)};case nk.FLOAT:return this._lexer.advance(),{kind:nE.h.FLOAT,value:t.value,loc:this.loc(t)};case nk.STRING:case nk.BLOCK_STRING:return this.parseStringLiteral();case nk.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:nE.h.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:nE.h.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:nE.h.NULL,loc:this.loc(t)};default:return{kind:nE.h.ENUM,value:t.value,loc:this.loc(t)}}case nk.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:nE.h.STRING,value:e.value,block:e.kind===nk.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseValueLiteral(e)};return{kind:nE.h.LIST,values:this.any(nk.BRACKET_L,r,nk.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseObjectField(e)};return{kind:nE.h.OBJECT,fields:this.any(nk.BRACE_L,r,nk.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(nk.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(nk.AT),{kind:nE.h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return(this.expectOptionalToken(nk.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(nk.BRACKET_R),e={kind:nE.h.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(nk.BANG))?{kind:nE.h.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:nE.h.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(nk.STRING)||this.peek(nk.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);return{kind:nE.h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(nk.COLON);var n=this.parseNamedType();return{kind:nE.h.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if((null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)===!0){var t=[];this.expectOptionalToken(nk.AMP);do t.push(this.parseNamedType());while(this.expectOptionalToken(nk.AMP)||this.peek(nk.NAME))return t}return this.delimitedMany(nk.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)===!0&&this.peek(nk.BRACE_L)&&this._lexer.lookahead().kind===nk.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(nk.BRACE_L,this.parseFieldDefinition,nk.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(nk.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:nE.h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(nk.PAREN_L,this.parseInputValueDef,nk.PAREN_R)},t.parseInputValueDef=function(){var e,t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(nk.COLON);var i=this.parseTypeReference();this.expectOptionalToken(nk.EQUALS)&&(e=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:nE.h.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:e,directives:a,loc:this.loc(t)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:nE.h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(nk.EQUALS)?this.delimitedMany(nk.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:nE.h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseEnumValueDefinition,nk.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:nE.h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseInputValueDef,nk.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:nE.h.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:nE.h.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(nk.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:nE.h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(nk.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==nT[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if((null===(t=this._options)||void 0===t?void 0:t.noLocation)!==!0)return new nS.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw n_(this._lexer.source,t.start,"Expected ".concat(nG(e),", found ").concat(nz(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind===nk.NAME&&t.value===e)this._lexer.advance();else throw n_(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(nz(t),"."))},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===nk.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return n_(this._lexer.source,t.start,"Unexpected ".concat(nz(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do n.push(t.call(this));while(this.expectOptionalToken(e))return n},e}();function nz(e){var t=e.value;return nG(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function nG(e){return nA(e)?'"'.concat(e,'"'):e}var nW=new Map,nK=new Map,nV=!0,nq=!1;function nZ(e){return e.replace(/[\s,]+/g," ").trim()}function nX(e){return nZ(e.source.body.substring(e.start,e.end))}function nJ(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=nX(e.loc),a=nK.get(r);a&&!a.has(i)?nV&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||nK.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)}),(0,t0.pi)((0,t0.pi)({},e),{definitions:n})}function nQ(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function n1(e){var t=nZ(e);if(!nW.has(t)){var n=nH(e,{experimentalFragmentVariables:nq,allowLegacyFragmentVariables:nq});if(!n||"Document"!==n.kind)throw Error("Not a valid GraphQL document.");nW.set(t,nQ(nJ(n)))}return nW.get(t)}function n0(e){for(var t=[],n=1;n, or pass an ApolloClient instance in via options.'):(0,n9.kG)(!!n,32),n}var rp=n(10542),rb=n(53712),rm=n(21436),rg=Object.prototype.hasOwnProperty;function rv(e,t){return void 0===t&&(t=Object.create(null)),ry(rh(t.client),e).useQuery(t)}function ry(e,t){var n=(0,l.useRef)();n.current&&e===n.current.client&&t===n.current.query||(n.current=new rw(e,t,n.current));var r=n.current,i=(0,l.useState)(0),a=(i[0],i[1]);return r.forceUpdate=function(){a(function(e){return e+1})},r}var rw=function(){function e(e,t,n){this.client=e,this.query=t,this.ssrDisabledResult=(0,rp.J)({loading:!0,data:void 0,error:void 0,networkStatus:ru.I.loading}),this.skipStandbyResult=(0,rp.J)({loading:!1,data:void 0,error:void 0,networkStatus:ru.I.ready}),this.toQueryResultCache=new(n7.mr?WeakMap:Map),rd(t,r.Query);var i=n&&n.result,a=i&&i.data;a&&(this.previousData=a)}return e.prototype.forceUpdate=function(){__DEV__&&n9.kG.warn("Calling default no-op implementation of InternalState#forceUpdate")},e.prototype.executeQuery=function(e){var t,n=this;e.query&&Object.assign(this,{query:e.query}),this.watchQueryOptions=this.createWatchQueryOptions(this.queryHookOptions=e);var r=this.observable.reobserveAsConcast(this.getObsQueryOptions());return this.previousData=(null===(t=this.result)||void 0===t?void 0:t.data)||this.previousData,this.result=void 0,this.forceUpdate(),new Promise(function(e){var t;r.subscribe({next:function(e){t=e},error:function(){e(n.toQueryResult(n.observable.getCurrentResult()))},complete:function(){e(n.toQueryResult(t))}})})},e.prototype.useQuery=function(e){var t=this;this.renderPromises=(0,l.useContext)((0,ro.K)()).renderPromises,this.useOptions(e);var n=this.useObservableQuery(),r=rt((0,l.useCallback)(function(){if(t.renderPromises)return function(){};var e=function(){var e=t.result,r=n.getCurrentResult();!(e&&e.loading===r.loading&&e.networkStatus===r.networkStatus&&(0,ri.D)(e.data,r.data))&&t.setResult(r)},r=function(a){var o=n.last;i.unsubscribe();try{n.resetLastResults(),i=n.subscribe(e,r)}finally{n.last=o}if(!rg.call(a,"graphQLErrors"))throw a;var s=t.result;(!s||s&&s.loading||!(0,ri.D)(a,s.error))&&t.setResult({data:s&&s.data,error:a,loading:!1,networkStatus:ru.I.error})},i=n.subscribe(e,r);return function(){return setTimeout(function(){return i.unsubscribe()})}},[n,this.renderPromises,this.client.disableNetworkFetches,]),function(){return t.getCurrentResult()},function(){return t.getCurrentResult()});return this.unsafeHandlePartialRefetch(r),this.toQueryResult(r)},e.prototype.useOptions=function(t){var n,r=this.createWatchQueryOptions(this.queryHookOptions=t),i=this.watchQueryOptions;!(0,ri.D)(r,i)&&(this.watchQueryOptions=r,i&&this.observable&&(this.observable.reobserve(this.getObsQueryOptions()),this.previousData=(null===(n=this.result)||void 0===n?void 0:n.data)||this.previousData,this.result=void 0)),this.onCompleted=t.onCompleted||e.prototype.onCompleted,this.onError=t.onError||e.prototype.onError,(this.renderPromises||this.client.disableNetworkFetches)&&!1===this.queryHookOptions.ssr&&!this.queryHookOptions.skip?this.result=this.ssrDisabledResult:this.queryHookOptions.skip||"standby"===this.watchQueryOptions.fetchPolicy?this.result=this.skipStandbyResult:(this.result===this.ssrDisabledResult||this.result===this.skipStandbyResult)&&(this.result=void 0)},e.prototype.getObsQueryOptions=function(){var e=[],t=this.client.defaultOptions.watchQuery;return t&&e.push(t),this.queryHookOptions.defaultOptions&&e.push(this.queryHookOptions.defaultOptions),e.push((0,rb.o)(this.observable&&this.observable.options,this.watchQueryOptions)),e.reduce(ra.J)},e.prototype.createWatchQueryOptions=function(e){void 0===e&&(e={});var t,n=e.skip,r=Object.assign((e.ssr,e.onCompleted,e.onError,e.defaultOptions,(0,t0._T)(e,["skip","ssr","onCompleted","onError","defaultOptions"])),{query:this.query});if(this.renderPromises&&("network-only"===r.fetchPolicy||"cache-and-network"===r.fetchPolicy)&&(r.fetchPolicy="cache-first"),r.variables||(r.variables={}),n){var i=r.fetchPolicy,a=void 0===i?this.getDefaultFetchPolicy():i,o=r.initialFetchPolicy;Object.assign(r,{initialFetchPolicy:void 0===o?a:o,fetchPolicy:"standby"})}else r.fetchPolicy||(r.fetchPolicy=(null===(t=this.observable)||void 0===t?void 0:t.options.initialFetchPolicy)||this.getDefaultFetchPolicy());return r},e.prototype.getDefaultFetchPolicy=function(){var e,t;return(null===(e=this.queryHookOptions.defaultOptions)||void 0===e?void 0:e.fetchPolicy)||(null===(t=this.client.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first"},e.prototype.onCompleted=function(e){},e.prototype.onError=function(e){},e.prototype.useObservableQuery=function(){var e=this.observable=this.renderPromises&&this.renderPromises.getSSRObservable(this.watchQueryOptions)||this.observable||this.client.watchQuery(this.getObsQueryOptions());this.obsQueryFields=(0,l.useMemo)(function(){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}},[e]);var t=!(!1===this.queryHookOptions.ssr||this.queryHookOptions.skip);return this.renderPromises&&t&&(this.renderPromises.registerSSRObservable(e),e.getCurrentResult().loading&&this.renderPromises.addObservableQueryPromise(e)),e},e.prototype.setResult=function(e){var t=this.result;t&&t.data&&(this.previousData=t.data),this.result=e,this.forceUpdate(),this.handleErrorOrCompleted(e)},e.prototype.handleErrorOrCompleted=function(e){var t=this;if(!e.loading){var n=this.toApolloError(e);Promise.resolve().then(function(){n?t.onError(n):e.data&&t.onCompleted(e.data)}).catch(function(e){__DEV__&&n9.kG.warn(e)})}},e.prototype.toApolloError=function(e){return(0,rm.O)(e.errors)?new rs.cA({graphQLErrors:e.errors}):e.error},e.prototype.getCurrentResult=function(){return this.result||this.handleErrorOrCompleted(this.result=this.observable.getCurrentResult()),this.result},e.prototype.toQueryResult=function(e){var t=this.toQueryResultCache.get(e);if(t)return t;var n=e.data,r=(e.partial,(0,t0._T)(e,["data","partial"]));return this.toQueryResultCache.set(e,t=(0,t0.pi)((0,t0.pi)((0,t0.pi)({data:n},r),this.obsQueryFields),{client:this.client,observable:this.observable,variables:this.observable.variables,called:!this.queryHookOptions.skip,previousData:this.previousData})),!t.error&&(0,rm.O)(e.errors)&&(t.error=new rs.cA({graphQLErrors:e.errors})),t},e.prototype.unsafeHandlePartialRefetch=function(e){e.partial&&this.queryHookOptions.partialRefetch&&!e.loading&&(!e.data||0===Object.keys(e.data).length)&&"cache-only"!==this.observable.options.fetchPolicy&&(Object.assign(e,{loading:!0,networkStatus:ru.I.refetch}),this.observable.refetch())},e}();function r_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return rv(iH,e)},iz=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"50",10),r=i$({variables:{offset:(t-1)*n,limit:n},fetchPolicy:"network-only"}),i=r.data,a=r.loading,o=r.error;return a?l.createElement(iR,null):o?l.createElement(iD,{error:o}):i?l.createElement(iI,{chains:i.chains.results,page:t,pageSize:n,total:i.chains.metadata.total}):null},iG=n(67932),iW=n(8126),iK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function iV(e){if(iq())return Intl.DateTimeFormat.supportedLocalesOf(e)[0]}function iq(){return("undefined"==typeof Intl?"undefined":iK(Intl))==="object"&&"function"==typeof Intl.DateTimeFormat}var iZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iX=function(){function e(e,t){for(var n=0;n=i.length)break;s=i[o++]}else{if((o=i.next()).done)break;s=o.value}var s,u=s;if((void 0===e?"undefined":iZ(e))!=="object")return;e=e[u]}return e}},{key:"put",value:function(){for(var e=arguments.length,t=Array(e),n=0;n=o.length)break;c=o[u++]}else{if((u=o.next()).done)break;c=u.value}var c,l=c;"object"!==iZ(a[l])&&(a[l]={}),a=a[l]}return a[i]=r}}]),e}();let i1=iQ;var i0=new i1;function i2(e,t){if(!iq())return function(e){return e.toString()};var n=i4(e),r=JSON.stringify(t),i=i0.get(String(n),r)||i0.put(String(n),r,new Intl.DateTimeFormat(n,t));return function(e){return i.format(e)}}var i3={};function i4(e){var t=e.toString();return i3[t]?i3[t]:i3[t]=iV(e)}var i6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i5(e){return i8(e)?e:new Date(e)}function i8(e){return e instanceof Date||i9(e)}function i9(e){return(void 0===e?"undefined":i6(e))==="object"&&"function"==typeof e.getTime}var i7=n(54087),ae=n.n(i7);function at(e,t){if(0===e.length)return 0;for(var n=0,r=e.length-1,i=void 0;n<=r;){var a=t(e[i=Math.floor((r+n)/2)]);if(0===a)return i;if(a<0){if((n=i+1)>r)return n}else if((r=i-1)=t.nextUpdateTime)aa(t,this.instances);else break}},scheduleNextTick:function(){var e=this;this.scheduledTick=ae()(function(){e.tick(),e.scheduleNextTick()})},start:function(){this.scheduleNextTick()},stop:function(){ae().cancel(this.scheduledTick)}};function ai(e){var t=an(e.getNextValue(),2),n=t[0],r=t[1];e.setValue(n),e.nextUpdateTime=r}function aa(e,t){ai(e),as(t,e),ao(t,e)}function ao(e,t){var n=au(e,t);e.splice(n,0,t)}function as(e,t){var n=e.indexOf(t);e.splice(n,1)}function au(e,t){var n=t.nextUpdateTime;return at(e,function(e){return e.nextUpdateTime===n?0:e.nextUpdateTime>n?1:-1})}var ac=(0,ec.oneOfType)([(0,ec.shape)({minTime:ec.number,formatAs:ec.string.isRequired}),(0,ec.shape)({test:ec.func,formatAs:ec.string.isRequired}),(0,ec.shape)({minTime:ec.number,format:ec.func.isRequired}),(0,ec.shape)({test:ec.func,format:ec.func.isRequired})]),al=(0,ec.oneOfType)([ec.string,(0,ec.shape)({steps:(0,ec.arrayOf)(ac).isRequired,labels:(0,ec.oneOfType)([ec.string,(0,ec.arrayOf)(ec.string)]).isRequired,round:ec.string})]),af=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function ap(e){var t=e.date,n=e.future,r=e.timeStyle,i=e.round,a=e.minTimeLeft,o=e.tooltip,s=e.component,u=e.container,c=e.wrapperComponent,f=e.wrapperProps,d=e.locale,h=e.locales,p=e.formatVerboseDate,b=e.verboseDateFormat,m=e.updateInterval,g=e.tick,v=ah(e,["date","future","timeStyle","round","minTimeLeft","tooltip","component","container","wrapperComponent","wrapperProps","locale","locales","formatVerboseDate","verboseDateFormat","updateInterval","tick"]),y=(0,l.useMemo)(function(){return d&&(h=[d]),h.concat(iW.Z.getDefaultLocale())},[d,h]),w=(0,l.useMemo)(function(){return new iW.Z(y)},[y]);t=(0,l.useMemo)(function(){return i5(t)},[t]);var _=(0,l.useCallback)(function(){var e=Date.now(),o=void 0;if(n&&e>=t.getTime()&&(e=t.getTime(),o=!0),void 0!==a){var s=t.getTime()-1e3*a;e>s&&(e=s,o=!0)}var u=w.format(t,r,{getTimeToNextUpdate:!0,now:e,future:n,round:i}),c=ad(u,2),l=c[0],f=c[1];return f=o?ag:m||f||6e4,[l,e+f]},[t,n,r,m,i,a,w]),E=(0,l.useRef)();E.current=_;var S=(0,l.useMemo)(_,[]),k=ad(S,2),x=k[0],T=k[1],M=(0,l.useState)(x),O=ad(M,2),A=O[0],L=O[1],C=ad((0,l.useState)(),2),I=C[0],D=C[1],N=(0,l.useRef)();(0,l.useEffect)(function(){if(g)return N.current=ar.add({getNextValue:function(){return E.current()},setValue:L,nextUpdateTime:T}),function(){return N.current.stop()}},[g]),(0,l.useEffect)(function(){if(N.current)N.current.forceUpdate();else{var e=_(),t=ad(e,1)[0];L(t)}},[_]),(0,l.useEffect)(function(){D(!0)},[]);var P=(0,l.useMemo)(function(){if("undefined"!=typeof window)return i2(y,b)},[y,b]),R=(0,l.useMemo)(function(){if("undefined"!=typeof window)return p?p(t):P(t)},[t,p,P]),j=l.createElement(s,af({date:t,verboseDate:I?R:void 0,tooltip:o},v),A),F=c||u;return F?l.createElement(F,af({},f,{verboseDate:I?R:void 0}),j):j}ap.propTypes={date:el().oneOfType([el().instanceOf(Date),el().number]).isRequired,locale:el().string,locales:el().arrayOf(el().string),future:el().bool,timeStyle:al,round:el().string,minTimeLeft:el().number,component:el().elementType.isRequired,tooltip:el().bool.isRequired,formatVerboseDate:el().func,verboseDateFormat:el().object,updateInterval:el().oneOfType([el().number,el().arrayOf(el().shape({threshold:el().number,interval:el().number.isRequired}))]),tick:el().bool,wrapperComponent:el().func,wrapperProps:el().object},ap.defaultProps={locales:[],component:av,tooltip:!0,verboseDateFormat:{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},tick:!0},ap=l.memo(ap);let ab=ap;var am,ag=31536e9;function av(e){var t=e.date,n=e.verboseDate,r=e.tooltip,i=e.children,a=ah(e,["date","verboseDate","tooltip","children"]),o=(0,l.useMemo)(function(){return t.toISOString()},[t]);return l.createElement("time",af({},a,{dateTime:o,title:r?n:void 0}),i)}av.propTypes={date:el().instanceOf(Date).isRequired,verboseDate:el().string,tooltip:el().bool.isRequired,children:el().string.isRequired};var ay=n(30381),aw=n.n(ay),a_=n(31657);function aE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aS(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?new rs.cA({graphQLErrors:i}):void 0;if(u===s.current.mutationId&&!c.ignoreResults){var f={called:!0,loading:!1,data:r,error:l,client:a};s.current.isMounted&&!(0,ri.D)(s.current.result,f)&&o(s.current.result=f)}var d=e.onCompleted||(null===(n=s.current.options)||void 0===n?void 0:n.onCompleted);return null==d||d(t.data,c),t}).catch(function(t){if(u===s.current.mutationId&&s.current.isMounted){var n,r={loading:!1,error:t,data:void 0,called:!0,client:a};(0,ri.D)(s.current.result,r)||o(s.current.result=r)}var i=e.onError||(null===(n=s.current.options)||void 0===n?void 0:n.onError);if(i)return i(t,c),{data:void 0,errors:t};throw t})},[]),c=(0,l.useCallback)(function(){s.current.isMounted&&o({called:!1,loading:!1,client:n})},[]);return(0,l.useEffect)(function(){return s.current.isMounted=!0,function(){s.current.isMounted=!1}},[]),[u,(0,t0.pi)({reset:c},a)]}var a4=n(59067),a6=n(28428),a5=n(11186),a8=n(78513);function a9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a7=function(e){return(0,b.createStyles)({paper:{display:"flex",margin:"".concat(2.5*e.spacing.unit,"px 0"),padding:"".concat(3*e.spacing.unit,"px ").concat(3.5*e.spacing.unit,"px")},content:{flex:1,width:"100%"},actions:a9({marginTop:-(1.5*e.spacing.unit),marginLeft:-(4*e.spacing.unit)},e.breakpoints.up("sm"),{marginLeft:0,marginRight:-(1.5*e.spacing.unit)}),itemBlock:{border:"1px solid rgba(224, 224, 224, 1)",borderRadius:e.shape.borderRadius,padding:2*e.spacing.unit,marginTop:e.spacing.unit},itemBlockText:{overflowWrap:"anywhere"}})},oe=(0,b.withStyles)(a7)(function(e){var t=e.actions,n=e.children,r=e.classes;return l.createElement(ii.default,{className:r.paper},l.createElement("div",{className:r.content},n),t&&l.createElement("div",{className:r.actions},t))}),ot=function(e){var t=e.title;return l.createElement(x.default,{variant:"subtitle2",gutterBottom:!0},t)},on=function(e){var t=e.children,n=e.value;return l.createElement(x.default,{variant:"body1",noWrap:!0},t||n)},or=(0,b.withStyles)(a7)(function(e){var t=e.children,n=e.classes,r=e.value;return l.createElement("div",{className:n.itemBlock},l.createElement(x.default,{variant:"body1",className:n.itemBlockText},t||r))});function oi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]-1}let sF=sj;function sY(e,t){var n=this.__data__,r=sC(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}let sB=sY;function sU(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=cw}let cE=c_;var cS="[object Arguments]",ck="[object Array]",cx="[object Boolean]",cT="[object Date]",cM="[object Error]",cO="[object Function]",cA="[object Map]",cL="[object Number]",cC="[object Object]",cI="[object RegExp]",cD="[object Set]",cN="[object String]",cP="[object WeakMap]",cR="[object ArrayBuffer]",cj="[object DataView]",cF="[object Float64Array]",cY="[object Int8Array]",cB="[object Int16Array]",cU="[object Int32Array]",cH="[object Uint8Array]",c$="[object Uint8ClampedArray]",cz="[object Uint16Array]",cG="[object Uint32Array]",cW={};function cK(e){return eD(e)&&cE(e.length)&&!!cW[eC(e)]}cW["[object Float32Array]"]=cW[cF]=cW[cY]=cW[cB]=cW[cU]=cW[cH]=cW[c$]=cW[cz]=cW[cG]=!0,cW[cS]=cW[ck]=cW[cR]=cW[cx]=cW[cj]=cW[cT]=cW[cM]=cW[cO]=cW[cA]=cW[cL]=cW[cC]=cW[cI]=cW[cD]=cW[cN]=cW[cP]=!1;let cV=cK;function cq(e){return function(t){return e(t)}}let cZ=cq;var cX=n(79730),cJ=cX.Z&&cX.Z.isTypedArray,cQ=cJ?cZ(cJ):cV;let c1=cQ;var c0=Object.prototype.hasOwnProperty;function c2(e,t){var n=cp(e),r=!n&&cd(e),i=!n&&!r&&(0,cb.Z)(e),a=!n&&!r&&!i&&c1(e),o=n||r||i||a,s=o?ci(e.length,String):[],u=s.length;for(var c in e)(t||c0.call(e,c))&&!(o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||cy(c,u)))&&s.push(c);return s}let c3=c2;var c4=Object.prototype;function c6(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||c4)}let c5=c6;var c8=sb(Object.keys,Object);let c9=c8;var c7=Object.prototype.hasOwnProperty;function le(e){if(!c5(e))return c9(e);var t=[];for(var n in Object(e))c7.call(e,n)&&"constructor"!=n&&t.push(n);return t}let lt=le;function ln(e){return null!=e&&cE(e.length)&&!s2(e)}let lr=ln;function li(e){return lr(e)?c3(e):lt(e)}let la=li;function lo(e,t){return e&&cn(t,la(t),e)}let ls=lo;function lu(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}let lc=lu;var ll=Object.prototype.hasOwnProperty;function lf(e){if(!ed(e))return lc(e);var t=c5(e),n=[];for(var r in e)"constructor"==r&&(t||!ll.call(e,r))||n.push(r);return n}let ld=lf;function lh(e){return lr(e)?c3(e,!0):ld(e)}let lp=lh;function lb(e,t){return e&&cn(t,lp(t),e)}let lm=lb;var lg=n(42896);function lv(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0||(i[n]=e[n]);return i}function d8(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var d9=function(e){return Array.isArray(e)&&0===e.length},d7=function(e){return"function"==typeof e},he=function(e){return null!==e&&"object"==typeof e},ht=function(e){return String(Math.floor(Number(e)))===e},hn=function(e){return"[object String]"===Object.prototype.toString.call(e)},hr=function(e){return 0===l.Children.count(e)},hi=function(e){return he(e)&&d7(e.then)};function ha(e,t,n,r){void 0===r&&(r=0);for(var i=dZ(t);e&&r=0?[]:{}}}return(0===a?e:i)[o[a]]===n?e:(void 0===n?delete i[o[a]]:i[o[a]]=n,0===a&&void 0===n&&delete r[o[a]],r)}function hs(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,a=Object.keys(e);i0?t.map(function(t){return x(t,ha(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]).then(function(e){return e.reduce(function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ho(e,t[r],n)),e},{})})},[x]),M=(0,l.useCallback)(function(e){return Promise.all([T(e),h.validationSchema?k(e):{},h.validate?S(e):{}]).then(function(e){var t=e[0],n=e[1],r=e[2];return sh.all([t,n,r],{arrayMerge:hy})})},[h.validate,h.validationSchema,T,S,k]),O=hS(function(e){return void 0===e&&(e=_.values),E({type:"SET_ISVALIDATING",payload:!0}),M(e).then(function(e){return v.current&&(E({type:"SET_ISVALIDATING",payload:!1}),st()(_.errors,e)||E({type:"SET_ERRORS",payload:e})),e})});(0,l.useEffect)(function(){o&&!0===v.current&&st()(p.current,h.initialValues)&&O(p.current)},[o,O]);var A=(0,l.useCallback)(function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:b.current?b.current:h.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:h.initialTouched||{},i=e&&e.status?e.status:g.current?g.current:h.initialStatus;p.current=t,b.current=n,m.current=r,g.current=i;var a=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(h.onReset){var o=h.onReset(_.values,V);hi(o)?o.then(a):a()}else a()},[h.initialErrors,h.initialStatus,h.initialTouched]);(0,l.useEffect)(function(){!0===v.current&&!st()(p.current,h.initialValues)&&(c&&(p.current=h.initialValues,A()),o&&O(p.current))},[c,h.initialValues,A,o,O]),(0,l.useEffect)(function(){c&&!0===v.current&&!st()(b.current,h.initialErrors)&&(b.current=h.initialErrors||hd,E({type:"SET_ERRORS",payload:h.initialErrors||hd}))},[c,h.initialErrors]),(0,l.useEffect)(function(){c&&!0===v.current&&!st()(m.current,h.initialTouched)&&(m.current=h.initialTouched||hh,E({type:"SET_TOUCHED",payload:h.initialTouched||hh}))},[c,h.initialTouched]),(0,l.useEffect)(function(){c&&!0===v.current&&!st()(g.current,h.initialStatus)&&(g.current=h.initialStatus,E({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var L=hS(function(e){if(y.current[e]&&d7(y.current[e].validate)){var t=ha(_.values,e),n=y.current[e].validate(t);return hi(n)?(E({type:"SET_ISVALIDATING",payload:!0}),n.then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return h.validationSchema?(E({type:"SET_ISVALIDATING",payload:!0}),k(_.values,e).then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),E({type:"SET_ISVALIDATING",payload:!1})})):Promise.resolve()}),C=(0,l.useCallback)(function(e,t){var n=t.validate;y.current[e]={validate:n}},[]),I=(0,l.useCallback)(function(e){delete y.current[e]},[]),D=hS(function(e,t){return E({type:"SET_TOUCHED",payload:e}),(void 0===t?i:t)?O(_.values):Promise.resolve()}),N=(0,l.useCallback)(function(e){E({type:"SET_ERRORS",payload:e})},[]),P=hS(function(e,t){var r=d7(e)?e(_.values):e;return E({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?O(r):Promise.resolve()}),R=(0,l.useCallback)(function(e,t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),j=hS(function(e,t,r){return E({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?O(ho(_.values,e,t)):Promise.resolve()}),F=(0,l.useCallback)(function(e,t){var n,r=t,i=e;if(!hn(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,s=a.name,u=a.id,c=a.value,l=a.checked,f=(a.outerHTML,a.options),d=a.multiple;r=t||s||u,i=/number|range/.test(o)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(o)?h_(ha(_.values,r),l,c):d?hw(f):c}r&&j(r,i)},[j,_.values]),Y=hS(function(e){if(hn(e))return function(t){return F(t,e)};F(e)}),B=hS(function(e,t,n){return void 0===t&&(t=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?i:n)?O(_.values):Promise.resolve()}),U=(0,l.useCallback)(function(e,t){e.persist&&e.persist();var n,r=e.target,i=r.name,a=r.id;r.outerHTML,B(t||i||a,!0)},[B]),H=hS(function(e){if(hn(e))return function(t){return U(t,e)};U(e)}),$=(0,l.useCallback)(function(e){d7(e)?E({type:"SET_FORMIK_STATE",payload:e}):E({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),z=(0,l.useCallback)(function(e){E({type:"SET_STATUS",payload:e})},[]),G=(0,l.useCallback)(function(e){E({type:"SET_ISSUBMITTING",payload:e})},[]),W=hS(function(){return E({type:"SUBMIT_ATTEMPT"}),O().then(function(e){var t,n=e instanceof Error;if(!n&&0===Object.keys(e).length){try{if(void 0===(t=q()))return}catch(r){throw r}return Promise.resolve(t).then(function(e){return v.current&&E({type:"SUBMIT_SUCCESS"}),e}).catch(function(e){if(v.current)throw E({type:"SUBMIT_FAILURE"}),e})}if(v.current&&(E({type:"SUBMIT_FAILURE"}),n))throw e})}),K=hS(function(e){e&&e.preventDefault&&d7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&d7(e.stopPropagation)&&e.stopPropagation(),W().catch(function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)})}),V={resetForm:A,validateForm:O,validateField:L,setErrors:N,setFieldError:R,setFieldTouched:B,setFieldValue:j,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,setFormikState:$,submitForm:W},q=hS(function(){return f(_.values,V)}),Z=hS(function(e){e&&e.preventDefault&&d7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&d7(e.stopPropagation)&&e.stopPropagation(),A()}),X=(0,l.useCallback)(function(e){return{value:ha(_.values,e),error:ha(_.errors,e),touched:!!ha(_.touched,e),initialValue:ha(p.current,e),initialTouched:!!ha(m.current,e),initialError:ha(b.current,e)}},[_.errors,_.touched,_.values]),J=(0,l.useCallback)(function(e){return{setValue:function(t,n){return j(e,t,n)},setTouched:function(t,n){return B(e,t,n)},setError:function(t){return R(e,t)}}},[j,B,R]),Q=(0,l.useCallback)(function(e){var t=he(e),n=t?e.name:e,r=ha(_.values,n),i={name:n,value:r,onChange:Y,onBlur:H};if(t){var a=e.type,o=e.value,s=e.as,u=e.multiple;"checkbox"===a?void 0===o?i.checked=!!r:(i.checked=!!(Array.isArray(r)&&~r.indexOf(o)),i.value=o):"radio"===a?(i.checked=r===o,i.value=o):"select"===s&&u&&(i.value=i.value||[],i.multiple=!0)}return i},[H,Y,_.values]),ee=(0,l.useMemo)(function(){return!st()(p.current,_.values)},[p.current,_.values]),et=(0,l.useMemo)(function(){return void 0!==s?ee?_.errors&&0===Object.keys(_.errors).length:!1!==s&&d7(s)?s(h):s:_.errors&&0===Object.keys(_.errors).length},[s,ee,_.errors,h]);return d4({},_,{initialValues:p.current,initialErrors:b.current,initialTouched:m.current,initialStatus:g.current,handleBlur:H,handleChange:Y,handleReset:Z,handleSubmit:K,resetForm:A,setErrors:N,setFormikState:$,setFieldTouched:B,setFieldValue:j,setFieldError:R,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,submitForm:W,validateForm:O,validateField:L,isValid:et,dirty:ee,unregisterField:I,registerField:C,getFieldProps:Q,getFieldMeta:X,getFieldHelpers:J,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function hb(e){var t=hp(e),n=e.component,r=e.children,i=e.render,a=e.innerRef;return(0,l.useImperativeHandle)(a,function(){return t}),(0,l.createElement)(hc,{value:t},n?(0,l.createElement)(n,t):i?i(t):r?d7(r)?r(t):hr(r)?null:l.Children.only(r):null)}function hm(e){var t={};if(e.inner){if(0===e.inner.length)return ho(t,e.path,e.message);for(var n=e.inner,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;ha(t,o.path)||(t=ho(t,o.path,o.message))}}return t}function hg(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r={});var i=hv(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function hv(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map(function(e){return!0===Array.isArray(e)||sx(e)?hv(e):""!==e?e:void 0}):sx(e[r])?t[r]=hv(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function hy(e,t,n){var r=e.slice();return t.forEach(function(t,i){if(void 0===r[i]){var a=!1!==n.clone&&n.isMergeableObject(t);r[i]=a?sh(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=sh(e[i],t,n):-1===e.indexOf(t)&&r.push(t)}),r}function hw(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}function h_(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],i=!1,a=-1;if(Array.isArray(e))r=e,i=(a=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,a).concat(r.slice(a+1)):r}var hE="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function hS(e){var t=(0,l.useRef)(e);return hE(function(){t.current=e}),(0,l.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;re?t:e},0);return Array.from(d4({},e,{length:t+1}))};(function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,a=i.name;(0,i.formik.setFormikState)(function(n){var i="function"==typeof r?r:e,o="function"==typeof t?t:e,s=ho(n.values,a,e(ha(n.values,a))),u=r?i(ha(n.errors,a)):void 0,c=t?o(ha(n.touched,a)):void 0;return d9(u)&&(u=void 0),d9(c)&&(c=void 0),d4({},n,{values:s,errors:r?ho(n.errors,a,u):n.errors,touched:t?ho(n.touched,a,c):n.touched})})},n.push=function(e){return n.updateArrayField(function(t){return[].concat(hL(t),[d3(e)])},!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField(function(n){return hM(n,e,t)},!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField(function(n){return hT(n,e,t)},!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField(function(n){return hO(n,e,t)},function(t){return hO(t,e,null)},function(t){return hO(t,e,null)})},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField(function(n){return hA(n,e,t)},!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField(function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(d8(n)),n.pop=n.pop.bind(d8(n)),n}d6(t,e);var n=t.prototype;return n.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!st()(ha(e.formik.values,e.name),ha(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(e){var t;return this.updateArrayField(function(n){var r=n?hL(n):[];return t||(t=r[e]),d7(r.splice)&&r.splice(e,1),r},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n},!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=d5(t.formik,["validate","validationSchema"]),s=d4({},e,{form:o,name:a});return n?(0,l.createElement)(n,s):r?r(s):i?"function"==typeof i?i(s):hr(i)?null:l.Children.only(i):null},t})(l.Component).defaultProps={validateOnChange:!0},l.Component,l.Component;var hC=n(24802),hI=n(71209),hD=n(91750),hN=n(11970),hP=n(4689),hR=n(67598),hj=function(){return(hj=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&(n[r[i]]=e[r[i]]);return n}function hY(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hF(n,["onBlur"]),a=e.form,o=a.isSubmitting,s=a.touched,u=a.errors,c=e.onBlur,l=e.helperText,f=hF(e,["disabled","field","form","onBlur","helperText"]),d=ha(u,i.name),h=ha(s,i.name)&&!!d;return hj(hj({variant:f.variant,error:h,helperText:h?d:l,disabled:null!=t?t:o,onBlur:null!=c?c:function(e){r(null!=e?e:i.name)}},i),f)}function hB(e){var t=e.children,n=hF(e,["children"]);return(0,l.createElement)(iw.Z,hj({},hY(n)),t)}function hU(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hF(n,["onBlur"]),a=e.form.isSubmitting,o=(e.type,e.onBlur),s=hF(e,["disabled","field","form","type","onBlur"]);return hj(hj({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function hH(e){return(0,l.createElement)(hC.Z,hj({},hU(e)))}function h$(e){var t,n=e.disabled,r=e.field,i=r.onBlur,a=hF(r,["onBlur"]),o=e.form.isSubmitting,s=(e.type,e.onBlur),u=hF(e,["disabled","field","form","type","onBlur"]);return hj(hj({disabled:null!=n?n:o,indeterminate:!Array.isArray(a.value)&&null==a.value,onBlur:null!=s?s:function(e){i(null!=e?e:a.name)}},a),u)}function hz(e){return(0,l.createElement)(hI.Z,hj({},h$(e)))}function hG(e){var t=e.Label,n=hF(e,["Label"]);return(0,l.createElement)(hD.Z,hj({control:(0,l.createElement)(hI.Z,hj({},h$(n)))},t))}function hW(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hF(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hF(e,["disabled","field","form","onBlur"]);return hj(hj({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function hK(e){return(0,l.createElement)(hN.default,hj({},hW(e)))}function hV(e){var t=e.field,n=t.onBlur,r=hF(t,["onBlur"]),i=(e.form,e.onBlur),a=hF(e,["field","form","onBlur"]);return hj(hj({onBlur:null!=i?i:function(e){n(null!=e?e:r.name)}},r),a)}function hq(e){return(0,l.createElement)(hP.Z,hj({},hV(e)))}function hZ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hF(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hF(e,["disabled","field","form","onBlur"]);return hj(hj({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function hX(e){return(0,l.createElement)(hR.default,hj({},hZ(e)))}hB.displayName="FormikMaterialUITextField",hH.displayName="FormikMaterialUISwitch",hz.displayName="FormikMaterialUICheckbox",hG.displayName="FormikMaterialUICheckboxWithLabel",hK.displayName="FormikMaterialUISelect",hq.displayName="FormikMaterialUIRadioGroup",hX.displayName="FormikMaterialUIInputBase";try{a=Map}catch(hJ){}try{o=Set}catch(hQ){}function h1(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return RegExp(e);if(Array.isArray(e))return e.map(h0);if(a&&e instanceof a)return new Map(Array.from(e.entries()));if(o&&e instanceof o)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var s=t.findIndex(function(t){return t===e[i]});r[i]=s>-1?n[s]:h1(e[i],t,n)}return r}return e}function h0(e){return h1(e,[],[])}let h2=Object.prototype.toString,h3=Error.prototype.toString,h4=RegExp.prototype.toString,h6="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",h5=/^Symbol\((.*)\)(.*)$/;function h8(e){if(e!=+e)return"NaN";let t=0===e&&1/e<0;return t?"-0":""+e}function h9(e,t=!1){if(null==e||!0===e||!1===e)return""+e;let n=typeof e;if("number"===n)return h8(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return h6.call(e).replace(h5,"Symbol($1)");let r=h2.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+h3.call(e)+"]":"RegExp"===r?h4.call(e):null}function h7(e,t){let n=h9(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=h9(this[e],t);return null!==r?r:n},2)}let pe={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType({path:e,type:t,value:n,originalValue:r}){let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${h7(n,!0)}\``+(i?` (cast from the value \`${h7(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},pt={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},pn={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},pr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pi={isValue:"${path} field must be ${value}"},pa={noUnknown:"${path} field has unspecified keys: ${unknown}"},po={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};Object.assign(Object.create(null),{mixed:pe,string:pt,number:pn,date:pr,object:pa,array:po,boolean:pi});var ps=n(18721),pu=n.n(ps);let pc=e=>e&&e.__isYupSchema__;class pl{constructor(e,t){if(this.refs=e,this.refs=e,"function"==typeof t){this.fn=t;return}if(!pu()(t,"is"))throw TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every(e=>e===n);this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!pc(r))throw TypeError("conditions must return a schema object");return r.resolve(t)}}let pf=pl;function pd(e){return null==e?[]:[].concat(e)}function ph(){return(ph=Object.assign||function(e){for(var t=1;th7(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],pd(e).forEach(e=>{pb.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,pb)}}let pm=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function pg(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=pm(t),l=r.length,f=[];if(o=o||[],!l)return o.length?c(new pb(o,a,u)):c(null,a);for(let d=0;d=0||(i[n]=e[n]);return i}function px(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=pk(t,["value","path","label","options","originalValue","sync"]),{name:l,test:f,params:d,message:h}=e,{parent:p,context:b}=o;function m(e){return pE.isRef(e)?e.getValue(r,p,b):e}function g(e={}){let t=py()(pS({value:r,originalValue:s,label:a,path:e.path||i},d,e.params),m),n=new pb(pb.formatError(e.message||h,t),r,t.path,e.type||l);return n.params=t,n}let v=pS({path:i,parent:p,type:l,createError:g,resolve:m,options:o,originalValue:s},c);if(!u){try{Promise.resolve(f.call(v,r,v)).then(e=>{pb.isError(e)?n(e):e?n(null,e):n(g())})}catch(y){n(y)}return}let w;try{var _;if(w=f.call(v,r,v),"function"==typeof(null==(_=w)?void 0:_.then))throw Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(E){n(E);return}pb.isError(w)?n(w):w?n(null,w):n(g())}return t.OPTIONS=e,t}pE.prototype.__isYupRef=!0;let pT=e=>e.substr(0,e.length-1).substr(1);function pM(e,t,n,r=n){let i,a,o;return t?((0,pw.forEach)(t,(s,u,c)=>{let l=u?pT(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let f=c?parseInt(l,10):0;if(n&&f>=n.length)throw Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class pO{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let t of this.list)e.push(t);for(let[,n]of this.refs)e.push(n.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){pE.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){pE.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,t){if(this.list.has(e))return!0;let n,r=this.refs.values();for(;!(n=r.next()).done;)if(t(n.value)===e)return!0;return!1}clone(){let e=new pO;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){let n=this.clone();return e.list.forEach(e=>n.add(e)),e.refs.forEach(e=>n.add(e)),t.list.forEach(e=>n.delete(e)),t.refs.forEach(e=>n.delete(e)),n}}function pA(){return(pA=Object.assign||function(e){for(var t=1;t{this.typeError(pe.notType)}),this.type=(null==e?void 0:e.type)||"mixed",this.spec=pA({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=pA({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=h0(pA({},this.spec,e)),t}label(e){var t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone(),r=pA({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n}isType(e){return!!this.spec.nullable&&null===e||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;(t=t.clone()).conditions=[],t=(t=n.reduce((t,n)=>n.resolve(t,e),t)).resolve(e)}return t}cast(e,t={}){let n=this.resolve(pA({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=h7(e),a=h7(r);throw TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". attempted value: ${i} -`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((t,n)=>n.call(this,t,e,this),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,pB({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),pO({args:l,value:c,path:i,sync:r,tests:f,endEarly:u},e=>{if(e)return void n(e,c);pO({tests:this.tests,args:l,path:i,sync:r,value:c,endEarly:u},n)})}validate(e,t,n){let r=this.resolve(pB({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise((n,i)=>r._validate(e,t,(e,t)=>{e?i(e):n(t)}))}validateSync(e,t){let n;return this.resolve(pB({},t,{value:e}))._validate(e,pB({},t,{sync:!0}),(e,t)=>{if(e)throw e;n=t}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(pT.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(pT.isError(n))return!1;throw n}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):pn(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=pf.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=pf.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(void 0===(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]}).message&&(t.message=pf.default),"function"!=typeof t.test)throw TypeError("`test` is a required parameters");let n=this.clone(),r=pR(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>e.OPTIONS.name!==t.name||!i&&e.OPTIONS.test!==r.OPTIONS.test),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=pS(e).map(e=>new pD(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push(new pE(r,t)),n}typeError(e){var t=this.clone();return t._typeError=pR({message:e,name:"typeError",test(e){return!!(void 0===e||this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=pf.oneOf){var n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n._whitelistError=pR({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist;return!!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}notOneOf(e,t=pf.notOneOf){var n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n._blacklistError=pR({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist;return!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t)};return r}}for(let pH of(pU.prototype.__isYupSchema__=!0,["validate","validateSync"]))pU.prototype[`${pH}At`]=function(e,t,n={}){let{parent:r,parentPath:i,schema:a}=pF(this,e,t,n.context);return a[pH](r&&r[i],pB({},n,{parent:r,path:e}))};for(let p$ of["equals","is"])pU.prototype[p$]=pU.prototype.oneOf;for(let pz of["not","nope"])pU.prototype[pz]=pU.prototype.notOneOf;pU.prototype.optional=pU.prototype.notRequired;let pG=pU;function pW(){return new pG}pW.prototype=pG.prototype;let pK=e=>null==e;function pV(){return new pq}class pq extends pU{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=pb.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>pK(e)||!0===e})}isFalse(e=pb.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>pK(e)||!1===e})}}pV.prototype=pq.prototype;let pZ=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,pX=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,pJ=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,pQ=e=>pK(e)||e===e.trim(),p1=({}).toString();function p0(){return new p2}class p2 extends pU{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;let t=null!=e&&e.toString?e.toString():e;return t===p1?e:t})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=pd.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pK(t)||t.length===this.resolve(e)}})}min(e,t=pd.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t.length>=this.resolve(e)}})}max(e,t=pd.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return pK(t)||t.length<=this.resolve(e)}})}matches(e,t){let n=!1,r,i;return t&&("object"==typeof t?{excludeEmptyString:n=!1,message:r,name:i}=t:r=t),this.test({name:i||"matches",message:r||pd.matches,params:{regex:e},test:t=>pK(t)||""===t&&n||-1!==t.search(e)})}email(e=pd.email){return this.matches(pZ,{name:"email",message:e,excludeEmptyString:!0})}url(e=pd.url){return this.matches(pX,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=pd.uuid){return this.matches(pJ,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=pd.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:pQ})}lowercase(e=pd.lowercase){return this.transform(e=>pK(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pK(e)||e===e.toLowerCase()})}uppercase(e=pd.uppercase){return this.transform(e=>pK(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pK(e)||e===e.toUpperCase()})}}p0.prototype=p2.prototype;let p3=e=>e!=+e;function p4(){return new p6}class p6 extends pU{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(e){let t=e;if("string"==typeof t){if(""===(t=t.replace(/\s/g,"")))return NaN;t=+t}return this.isType(t)?t:parseFloat(t)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!p3(e)}min(e,t=ph.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t>=this.resolve(e)}})}max(e,t=ph.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pK(t)||t<=this.resolve(e)}})}lessThan(e,t=ph.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return pK(t)||tthis.resolve(e)}})}positive(e=ph.positive){return this.moreThan(0,e)}negative(e=ph.negative){return this.lessThan(0,e)}integer(e=ph.integer){return this.test({name:"integer",message:e,test:e=>pK(e)||Number.isInteger(e)})}truncate(){return this.transform(e=>pK(e)?e:0|e)}round(e){var t,n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(t=>pK(t)?t:Math[e](t))}}p4.prototype=p6.prototype;var p5=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function p8(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=p5.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(void 0===n[8]||""===n[8])&&(void 0===n[9]||""===n[9])?t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7]))}else t=Date.parse?Date.parse(e):NaN;return t}let p9=new Date(""),p7=e=>"[object Date]"===Object.prototype.toString.call(e);function be(){return new bt}class bt extends pU{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=p8(e),isNaN(e)?p9:new Date(e))})})}_typeCheck(e){return p7(e)&&!isNaN(e.getTime())}prepareParam(e,t){let n;if(pD.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=pp.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return pK(e)||e>=this.resolve(n)}})}max(e,t=pp.max){var n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return pK(e)||e<=this.resolve(n)}})}}bt.INVALID_DATE=p9,be.prototype=bt.prototype,be.INVALID_DATE=p9;var bn=n(11865),br=n.n(bn),bi=n(68929),ba=n.n(bi),bo=n(67523),bs=n.n(bo),bu=n(94633),bc=n.n(bu);function bl(e,t=[]){let n=[],r=[];function i(e,i){var a=(0,pC.split)(e)[0];~r.indexOf(a)||r.push(a),~t.indexOf(`${i}-${a}`)||n.push([i,a])}for(let a in e)if(py()(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),pD.isRef(o)&&o.isSibling?i(o.path,a):pw(o)&&"deps"in o&&o.deps.forEach(e=>i(e,a))}return bc().array(r,n).reverse()}function bf(e,t){let n=1/0;return e.some((e,r)=>{var i;if((null==(i=t.path)?void 0:i.indexOf(e))!==-1)return n=r,!0}),n}function bd(e){return(t,n)=>bf(e,t)-bf(e,n)}function bh(){return(bh=Object.assign||function(e){for(var t=1;t"[object Object]"===Object.prototype.toString.call(e);function bb(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}let bm=bd([]);class bg extends pU{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=bm,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}),e&&this.shape(e)})}_typeCheck(e){return bp(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter(e=>-1===this._nodes.indexOf(e))),s={},u=bh({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(let l of o){let f=i[l],d=py()(r,l);if(f){let h,p=r[l];u.path=(t.path?`${t.path}.`:"")+l;let b="spec"in(f=f.resolve({value:p,context:t.context,parent:s}))?f.spec:void 0,m=null==b?void 0:b.strict;if(null==b?void 0:b.strip){c=c||l in r;continue}void 0!==(h=t.__validating&&m?r[l]:f.cast(r[l],u))&&(s[l]=h)}else d&&!a&&(s[l]=r[l]);s[l]!==r[l]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,(e,c)=>{if(e){if(!pT.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!bp(c)){n(r[0]||null,c);return}o=o||c;let l=this._nodes.map(e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];if(s&&"validate"in s){s.validate(c[e],bh({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r);return}r(null)});pO({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)})}clone(e){let t=super.clone(e);return t.fields=bh({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[r,i]of Object.entries(this.fields)){let a=n[r];void 0===a?n[r]=i:a instanceof pU&&i instanceof pU&&(n[r]=i.concat(a))}return t.withMutation(()=>t.shape(n))}getDefaultFromShape(){let e={};return this._nodes.forEach(t=>{let n=this.fields[t];e[t]="default"in n?n.getDefault():void 0}),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);if(n.fields=r,n._sortErrors=bd(Object.keys(r)),t.length){Array.isArray(t[0])||(t=[t]);let i=t.map(([e,t])=>`${e}-${t}`);n._excludedEdges=n._excludedEdges.concat(i)}return n._nodes=bl(r,n._excludedEdges),n}pick(e){let t={};for(let n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation(e=>(e.fields={},e.shape(t)))}omit(e){let t=this.clone(),n=t.fields;for(let r of(t.fields={},e))delete n[r];return t.withMutation(()=>t.shape(n))}from(e,t,n){let r=(0,pC.getter)(e,!0);return this.transform(i=>{if(null==i)return i;let a=i;return py()(i,e)&&(a=bh({},i),n||delete a[e],a[t]=r(i)),a})}noUnknown(e=!0,t=pm.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;let n=bb(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=pm.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>t&&bs()(t,(t,n)=>e(n)))}camelCase(){return this.transformKeys(ba())}snakeCase(){return this.transformKeys(br())}constantCase(){return this.transformKeys(e=>br()(e).toUpperCase())}describe(){let e=super.describe();return e.fields=pL()(this.fields,e=>e.describe()),e}}function bv(e){return new bg(e)}function by(){return(by=Object.assign||function(e){for(var t=1;t{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){let n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1,i=n.map((e,n)=>{let i=this.innerType.cast(e,by({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i});return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,f=null!=t.originalValue?t.originalValue:e;super._validate(e,t,(e,r)=>{if(e){if(!pT.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r)){n(a[0]||null,r);return}f=f||r;let i=Array(r.length);for(let d=0;du.validate(h,b,t)}pO({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!pw(e))throw TypeError("`array.of()` sub-schema must be a valid yup schema not: "+pl(e));return t.innerType=e,t}length(e,t=pg.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pK(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||pg.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||pg.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pK(t)||t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}bw.prototype=b_.prototype;var bE=bv().shape({name:p0().required("Required"),url:p0().required("Required")}),bS=function(e){var t=e.initialValues,n=e.onSubmit,r=e.submitButtonText,i=e.nameDisabled,a=void 0!==i&&i;return l.createElement(hT,{initialValues:t,validationSchema:bE,onSubmit:n},function(e){var t=e.isSubmitting;return l.createElement(l.Fragment,null,l.createElement(hR,{"data-testid":"bridge-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hP,{component:hX,id:"name",name:"name",label:"Name",disabled:a,required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hP,{component:hX,id:"url",name:"url",label:"Bridge URL",placeholder:"https://",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"url-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:7},l.createElement(hP,{component:hX,id:"minimumContractPayment",name:"minimumContractPayment",label:"Minimum Contract Payment",placeholder:"0",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"minimumContractPayment-helper-text"}})),l.createElement(d.Z,{item:!0,xs:7},l.createElement(hP,{component:hX,id:"confirmations",name:"confirmations",label:"Confirmations",placeholder:"0",type:"number",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"confirmations-helper-text"}})))),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},r)))))})},bk=function(e){var t=e.bridge,n=e.onSubmit,r={name:t.name,url:t.url,minimumContractPayment:t.minimumContractPayment,confirmations:t.confirmations};return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:40},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Edit Bridge",action:l.createElement(aA.Z,{component:tz,href:"/bridges/".concat(t.id)},"Cancel")}),l.createElement(aW.Z,null,l.createElement(bS,{nameDisabled:!0,initialValues:r,onSubmit:n,submitButtonText:"Save Bridge"}))))))};function bx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]&&arguments[0],t=e?function(){return l.createElement(x.default,{variant:"body1"},"Loading...")}:function(){return null};return{isLoading:e,LoadingPlaceholder:t}},mc=n(76023);function ml(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=4?[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]:void 0}var mZ={};function mX(e){if(0===e.length||1===e.length)return e;var t=e.join(".");return mZ[t]||(mZ[t]=mq(e)),mZ[t]}function mJ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return mX(e.filter(function(e){return"token"!==e})).reduce(function(e,t){return mK({},e,n[t])},t)}function mQ(e){return e.join(" ")}function m1(e,t){var n=0;return function(r){return n+=1,r.map(function(r,i){return m0({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})})}}function m0(e){var t=e.node,n=e.stylesheet,r=e.style,i=void 0===r?{}:r,a=e.useInlineStyles,o=e.key,s=t.properties,u=t.type,c=t.tagName,f=t.value;if("text"===u)return f;if(c){var d,h=m1(n,a);if(a){var p=Object.keys(n).reduce(function(e,t){return t.split(".").forEach(function(t){e.includes(t)||e.push(t)}),e},[]),b=s.className&&s.className.includes("token")?["token"]:[],m=s.className&&b.concat(s.className.filter(function(e){return!p.includes(e)}));d=mK({},s,{className:mQ(m)||void 0,style:mJ(s.className,Object.assign({},s.style,i),n)})}else d=mK({},s,{className:mQ(s.className)});var g=h(t.children);return l.createElement(c,(0,mV.Z)({key:o},d),g)}}let m2=function(e,t){return -1!==e.listLanguages().indexOf(t)};var m3=/\n/g;function m4(e){return e.match(m3)}function m6(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(e,t){var i=t+n;return l.createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(i):r},"".concat(i,"\n"))})}function m5(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=void 0===r?{float:"left",paddingRight:"10px"}:r,a=e.numberStyle,o=void 0===a?{}:a,s=e.startingLineNumber;return l.createElement("code",{style:Object.assign({},n,i)},m6({lines:t.replace(/\n$/,"").split("\n"),style:o,startingLineNumber:s}))}function m8(e){return"".concat(e.toString().length,".25em")}function m9(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function m7(e,t,n){var r,i={display:"inline-block",minWidth:m8(n),paddingRight:"1em",textAlign:"right",userSelect:"none"};return mK({},i,"function"==typeof e?e(t):e)}function ge(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,a=e.showInlineLineNumbers,o=e.lineProps,s=void 0===o?{}:o,u=e.className,c=void 0===u?[]:u,l=e.showLineNumbers,f=e.wrapLongLines,d="function"==typeof s?s(n):s;if(d.className=c,n&&a){var h=m7(r,n,i);t.unshift(m9(n,h))}return f&l&&(d.style=mK({},d.style,{display:"flex"})),{type:"element",tagName:"span",properties:d,children:t}}function gt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0;r2&&void 0!==arguments[2]?arguments[2]:[];return ge({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:i,lineProps:n,className:a,showLineNumbers:r,wrapLongLines:u})}function b(e,t){if(r&&t&&i){var n=m7(s,t,o);e.unshift(m9(t,n))}return e}function m(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):b(e,n)}for(var g=function(){var e=l[h],t=e.children[0].value;if(m4(t)){var n=t.split("\n");n.forEach(function(t,i){var o=r&&f.length+a,s={type:"text",value:"".concat(t,"\n")};if(0===i){var u=l.slice(d+1,h).concat(ge({children:[s],className:e.properties.className})),c=m(u,o);f.push(c)}else if(i===n.length-1){if(l[h+1]&&l[h+1].children&&l[h+1].children[0]){var p={type:"text",value:"".concat(t)},b=ge({children:[p],className:e.properties.className});l.splice(h+1,0,b)}else{var g=[s],v=m(g,o,e.properties.className);f.push(v)}}else{var y=[s],w=m(y,o,e.properties.className);f.push(w)}}),d=h}h++};h code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var gu=n(98695),gc=n.n(gu);let gl=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apl","applescript","aql","arduino","arff","asciidoc","asm6502","aspnet","autohotkey","autoit","bash","basic","batch","bbcode","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cil","clike","clojure","cmake","coffeescript","concurnas","cpp","crystal","csharp","csp","css-extras","css","cypher","d","dart","dax","dhall","diff","django","dns-zone-file","docker","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","firestore-security-rules","flow","fortran","fsharp","ftl","gcode","gdscript","gedcom","gherkin","git","glsl","gml","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hpkp","hsts","http","ichigojam","icon","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keyman","kotlin","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","lolcode","lua","makefile","markdown","markup-templating","markup","matlab","mel","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nginx","nim","nix","nsis","objectivec","ocaml","opencl","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","properties","protobuf","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","r","racket","reason","regex","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","stan","stylus","swift","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","wiki","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var gf=go(gc(),gs);gf.supportedLanguages=gl;let gd=gf;var gh=n(64566);function gp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gb(){var e=gp(["\n query FetchConfigV2 {\n configv2 {\n user\n effective\n }\n }\n"]);return gb=function(){return e},e}var gm=n0(gb()),gg=function(e){var t=e.children;return l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},t))},gv=function(){return l.createElement(gg,null,"...")},gy=function(e){var t=e.children;return l.createElement(gg,null,t)},gw=function(e){var t=e.loading,n=e.toml,r=e.error,i=void 0===r?"":r,a=e.title,o=e.expanded;if(i)return l.createElement(gy,null,i);if(t)return l.createElement(gv,null);a||(a="TOML");var s={display:"block"};return l.createElement(x.default,null,l.createElement(mP.Z,{defaultExpanded:o},l.createElement(mR.Z,{expandIcon:l.createElement(gh.Z,null)},a),l.createElement(mj.Z,{style:s},l.createElement(gd,{language:"toml",style:gs},n))))},g_=function(){var e=rv(gm,{fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return(null==t?void 0:t.configv2.effective)=="N/A"?l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"TOML Configuration"}),l.createElement(gw,{title:"V2 config dump:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0})))):l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"TOML Configuration"}),l.createElement(gw,{title:"User specified:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0,expanded:!0}),l.createElement(gw,{title:"Effective (with defaults):",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.effective,showHead:!0})))))},gE=n(34823),gS=function(e){return(0,b.createStyles)({cell:{paddingTop:1.5*e.spacing.unit,paddingBottom:1.5*e.spacing.unit}})},gk=(0,b.withStyles)(gS)(function(e){var t=e.classes,n=(0,A.I0)();(0,l.useEffect)(function(){n((0,ty.DQ)())});var r=(0,A.v9)(gE.N,A.wU);return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Node"}),l.createElement(r8.Z,null,l.createElement(r9.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"Version"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.version))),l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"SHA"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.commitSHA))))))}),gx=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,sm:12,md:8},l.createElement(d.Z,{container:!0},l.createElement(g_,null))),l.createElement(d.Z,{item:!0,sm:12,md:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gk,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mN,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mE,null))))))},gT=function(){return l.createElement(gx,null)},gM=function(){return l.createElement(gT,null)},gO=n(44431),gA=1e18,gL=function(e){return new gO.BigNumber(e).dividedBy(gA).toFixed(8)},gC=function(e){var t=e.keys,n=e.chainID,r=e.hideHeaderTitle;return l.createElement(l.Fragment,null,l.createElement(sl.Z,{title:!r&&"Account Balances",subheader:"Chain ID "+n}),l.createElement(aW.Z,null,l.createElement(w.default,{dense:!1,disablePadding:!0},t&&t.map(function(e,r){return l.createElement(l.Fragment,null,l.createElement(_.default,{disableGutters:!0,key:["acc-balance",n.toString(),r.toString()].join("-")},l.createElement(E.Z,{primary:l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(op,{title:"Address"}),l.createElement(ob,{value:e.address})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(op,{title:"Native Token Balance"}),l.createElement(ob,{value:e.ethBalance||"--"})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(op,{title:"LINK Balance"}),l.createElement(ob,{value:e.linkBalance?gL(e.linkBalance):"--"}))))})),r+1s&&l.createElement(gB.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:r.footer},l.createElement(aA.Z,{href:"/runs",component:tz},"View More"))))))});function vt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vn(){var e=vt(["\n ","\n query FetchRecentJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...RecentJobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return vn=function(){return e},e}var vr=5,vi=n0(vn(),g9),va=function(){var e=rv(vi,{variables:{offset:0,limit:vr},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(ve,{data:t,errorMsg:null==r?void 0:r.message,loading:n,maxRunsSize:vr})},vo=function(e){return(0,b.createStyles)({style:{textAlign:"center",padding:2.5*e.spacing.unit,position:"fixed",left:"0",bottom:"0",width:"100%",borderRadius:0},bareAnchor:{color:e.palette.common.black,textDecoration:"none"}})},vs=(0,b.withStyles)(vo)(function(e){var t=e.classes,n=(0,A.v9)(gE.N,A.wU),r=(0,A.I0)();return(0,l.useEffect)(function(){r((0,ty.DQ)())}),l.createElement(ii.default,{className:t.style},l.createElement(x.default,null,"Chainlink Node ",n.version," at commit"," ",l.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/smartcontractkit/chainlink/commit/".concat(n.commitSHA),className:t.bareAnchor},n.commitSHA)))}),vu=function(e){return(0,b.createStyles)({cell:{borderColor:e.palette.divider,borderTop:"1px solid",borderBottom:"none",paddingTop:2*e.spacing.unit,paddingBottom:2*e.spacing.unit,paddingLeft:2*e.spacing.unit},block:{display:"block"},overflowEllipsis:{textOverflow:"ellipsis",overflow:"hidden"}})},vc=(0,b.withStyles)(vu)(function(e){var t=e.classes,n=e.job;return l.createElement(ir.Z,null,l.createElement(r7.default,{scope:"row",className:t.cell},l.createElement(d.Z,{container:!0,spacing:0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(ih,{href:"/jobs/".concat(n.id),classes:{linkContent:t.block}},l.createElement(x.default,{className:t.overflowEllipsis,variant:"body1",component:"span",color:"primary"},n.name||n.id))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,{variant:"body1",color:"textSecondary"},"Created ",l.createElement(aO,{tooltip:!0},n.createdAt))))))});function vl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vf(){var e=vl(["\n fragment RecentJobsPayload_ResultsFields on Job {\n id\n name\n createdAt\n }\n"]);return vf=function(){return e},e}var vd=n0(vf()),vh=function(){return(0,b.createStyles)({cardHeader:{borderBottom:0},table:{tableLayout:"fixed"}})},vp=(0,b.withStyles)(vh)(function(e){var t,n,r=e.classes,i=e.data,a=e.errorMsg,o=e.loading;return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Recent Jobs",className:r.cardHeader}),l.createElement(r8.Z,{className:r.table},l.createElement(r9.Z,null,l.createElement(g$,{visible:o}),l.createElement(gz,{visible:(null===(t=null==i?void 0:i.jobs.results)||void 0===t?void 0:t.length)===0},"No recently created jobs"),l.createElement(gU,{msg:a}),null===(n=null==i?void 0:i.jobs.results)||void 0===n?void 0:n.map(function(e,t){return l.createElement(vc,{job:e,key:t})}))))});function vb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vm(){var e=vb(["\n ","\n query FetchRecentJobs($offset: Int, $limit: Int) {\n jobs(offset: $offset, limit: $limit) {\n results {\n ...RecentJobsPayload_ResultsFields\n }\n }\n }\n"]);return vm=function(){return e},e}var vg=5,vv=n0(vm(),vd),vy=function(){var e=rv(vv,{variables:{offset:0,limit:vg},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(vp,{data:t,errorMsg:null==r?void 0:r.message,loading:n})},vw=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:8},l.createElement(va,null)),l.createElement(d.Z,{item:!0,xs:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gY,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(vy,null))))),l.createElement(vs,null))},v_=function(){return l.createElement(vw,null)},vE=function(){return l.createElement(v_,null)},vS=n(87239),vk=function(e){switch(e){case"DirectRequestSpec":return"Direct Request";case"FluxMonitorSpec":return"Flux Monitor";default:return e.replace(/Spec$/,"")}},vx=n(5022),vT=n(78718),vM=n.n(vT);function vO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1?t-1:0),r=1;r1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&n.map(function(e){return l.createElement(ir.Z,{key:e.id,style:{cursor:"pointer"},onClick:function(){return r.push("/runs/".concat(e.id))}},l.createElement(r7.default,{className:t.idCell,scope:"row"},l.createElement("div",{className:t.runDetails},l.createElement(x.default,{variant:"h5",color:"primary",component:"span"},e.id))),l.createElement(r7.default,{className:t.stampCell},l.createElement(x.default,{variant:"body1",color:"textSecondary",className:t.stamp},"Created ",l.createElement(aO,{tooltip:!0},e.createdAt))),l.createElement(r7.default,{className:t.statusCell,scope:"row"},l.createElement(x.default,{variant:"body1",className:O()(t.status,yh(t,e.status))},e.status.toLowerCase())))})))}),yb=n(16839),ym=n.n(yb);function yg(e){var t=e.replace(/\w+\s*=\s*<([^>]|[\r\n])*>/g,""),n=ym().read(t),r=n.edges();return n.nodes().map(function(e){var t={id:e,parentIds:r.filter(function(t){return t.w===e}).map(function(e){return e.v})};return Object.keys(n.node(e)).length>0&&(t.attributes=n.node(e)),t})}var yv=n(94164),yy=function(e){var t=e.data,n=[];return(null==t?void 0:t.attributes)&&Object.keys(t.attributes).forEach(function(e){var r;n.push(l.createElement("div",{key:e},l.createElement(x.default,{variant:"body1",color:"textSecondary",component:"div"},l.createElement("b",null,e,":")," ",null===(r=t.attributes)||void 0===r?void 0:r[e])))}),l.createElement("div",null,t&&l.createElement(x.default,{variant:"body1",color:"textPrimary"},l.createElement("b",null,t.id)),n)},yw=n(73343),y_=n(3379),yE=n.n(y_);function yS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nwindow.innerWidth?u-r.getBoundingClientRect().width-a:u+a,n=c+r.getBoundingClientRect().height+i>window.innerHeight?c-r.getBoundingClientRect().height-a:c+a,r.style.opacity=String(1),r.style.top="".concat(n,"px"),r.style.left="".concat(t,"px"),r.style.zIndex=String(1)}},h=function(e){var t=document.getElementById("tooltip-d3-chart-".concat(e));t&&(t.style.opacity=String(0),t.style.zIndex=String(-1))};return l.createElement("div",{style:{fontFamily:"sans-serif",fontWeight:"normal"}},l.createElement(yv.kJ,{id:"task-list-graph-d3",data:i,config:s,onMouseOverNode:d,onMouseOutNode:h},"D3 chart"),n.map(function(e){return l.createElement("div",{key:"d3-tooltip-key-".concat(e.id),id:"tooltip-d3-chart-".concat(e.id),style:{position:"absolute",opacity:"0",border:"1px solid rgba(0, 0, 0, 0.1)",padding:yw.r.spacing.unit,background:"white",borderRadius:5,zIndex:-1,inlineSize:"min-content"}},l.createElement(yy,{data:e}))}))};function yL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nyY&&l.createElement("div",{className:t.runDetails},l.createElement(aA.Z,{href:"/jobs/".concat(n.id,"/runs"),component:tz},"View more")))),l.createElement(d.Z,{item:!0,xs:12,sm:6},l.createElement(yF,{observationSource:n.observationSource})))});function yH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:"";try{return vx.parse(e),!0}catch(t){return!1}})}),wW=function(e){var t=e.initialValues,n=e.onSubmit,r=e.onTOMLChange;return l.createElement(hT,{initialValues:t,validationSchema:wG,onSubmit:n},function(e){var t=e.isSubmitting,n=e.values;return r&&r(n.toml),l.createElement(hR,{"data-testid":"job-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"toml",name:"toml",label:"Job Spec (TOML)",required:!0,fullWidth:!0,multiline:!0,rows:10,rowsMax:25,variant:"outlined",autoComplete:"off",FormHelperTextProps:{"data-testid":"toml-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},"Create Job"))))})},wK=n(50109),wV="persistSpec";function wq(e){var t=e.query,n=new URLSearchParams(t).get("definition");return n?(wK.t8(wV,n),{toml:n}):{toml:wK.U2(wV)||""}}var wZ=function(e){var t=e.onSubmit,n=e.onTOMLChange,r=wq({query:(0,h.TH)().search}),i=function(e){var t=e.replace(/[\u200B-\u200D\uFEFF]/g,"");wK.t8("".concat(wV),t),n&&n(t)};return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"New Job"}),l.createElement(aW.Z,null,l.createElement(wW,{initialValues:r,onSubmit:t,onTOMLChange:i})))};function wX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.start,r=void 0===n?6:n,i=t.end,a=void 0===i?4:i;return e.substring(0,r)+"..."+e.substring(e.length-a)}function _M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(_W,e)},_V=function(){var e=_K({fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error,i=e.refetch;return l.createElement(_U,{loading:n,data:t,errorMsg:null==r?void 0:r.message,refetch:i})},_q=function(e){var t=e.csaKey;return l.createElement(ir.Z,{hover:!0},l.createElement(r7.default,null,l.createElement(x.default,{variant:"body1"},t.publicKey," ",l.createElement(_x,{data:t.publicKey}))))};function _Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _X(){var e=_Z(["\n fragment CSAKeysPayload_ResultsFields on CSAKey {\n id\n publicKey\n }\n"]);return _X=function(){return e},e}var _J=n0(_X()),_Q=function(e){var t,n,r,i=e.data,a=e.errorMsg,o=e.loading,s=e.onCreate;return l.createElement(r5.Z,null,l.createElement(sl.Z,{action:(null===(t=null==i?void 0:i.csaKeys.results)||void 0===t?void 0:t.length)===0&&l.createElement(ok.default,{variant:"outlined",color:"primary",onClick:s},"New CSA Key"),title:"CSA Key",subheader:"Manage your CSA Key"}),l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Public Key"))),l.createElement(r9.Z,null,l.createElement(g$,{visible:o}),l.createElement(gz,{visible:(null===(n=null==i?void 0:i.csaKeys.results)||void 0===n?void 0:n.length)===0}),l.createElement(gU,{msg:a}),null===(r=null==i?void 0:i.csaKeys.results)||void 0===r?void 0:r.map(function(e,t){return l.createElement(_q,{csaKey:e,key:t})}))))};function _1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EM,e)};function EA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EJ,e)},E3=function(){return oo(EQ)},E4=function(){return oo(E1)},E6=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(E0,e)};function E5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(SK,e)};function Sq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kV(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}var kq=function(e){var t=e.run,n=l.useMemo(function(){var e=t.inputs,n=t.outputs,r=t.taskRuns,i=kK(t,["inputs","outputs","taskRuns"]),a={};try{a=JSON.parse(e)}catch(o){a={}}return kW(kz({},i),{inputs:a,outputs:n,taskRuns:r})},[t]);return l.createElement(r5.Z,null,l.createElement(aW.Z,null,l.createElement(kH,{object:n})))};function kZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){for(var t=1;t0&&l.createElement(kr,{errors:t.allErrors})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(h.rs,null,l.createElement(h.AW,{path:"".concat(n,"/json")},l.createElement(kq,{run:t})),l.createElement(h.AW,{path:n},t.taskRuns.length>0&&l.createElement(kN,{taskRuns:t.taskRuns,observationSource:t.job.observationSource}))))))))};function k5(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function k8(){var e=k5(["\n ","\n query FetchJobRun($id: ID!) {\n jobRun(id: $id) {\n __typename\n ... on JobRun {\n ...JobRunPayload_Fields\n }\n ... on NotFoundError {\n message\n }\n }\n }\n"]);return k8=function(){return e},e}var k9=n0(k8(),k4),k7=function(){var e=rv(k9,{variables:{id:(0,h.UO)().id}}),t=e.data,n=e.loading,r=e.error;if(n)return l.createElement(iR,null);if(r)return l.createElement(iD,{error:r});var i=null==t?void 0:t.jobRun;switch(null==i?void 0:i.__typename){case"JobRun":return l.createElement(k6,{run:i});case"NotFoundError":return l.createElement(oa,null);default:return null}};function xe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xt(){var e=xe(["\n fragment JobRunsPayload_ResultsFields on JobRun {\n id\n allErrors\n createdAt\n finishedAt\n status\n job {\n id\n }\n }\n"]);return xt=function(){return e},e}var xn=n0(xt()),xr=function(e){var t=e.loading,n=e.data,r=e.page,i=e.pageSize,a=(0,h.k6)(),o=l.useMemo(function(){return null==n?void 0:n.jobRuns.results.map(function(e){var t,n=e.allErrors,r=e.id,i=e.createdAt;return{id:r,createdAt:i,errors:n,finishedAt:e.finishedAt,status:e.status}})},[n]);return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(iy,null,"Job Runs")),t&&l.createElement(iR,null),n&&o&&l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(yp,{runs:o}),l.createElement(it.Z,{component:"div",count:n.jobRuns.metadata.total,rowsPerPage:i,rowsPerPageOptions:[i],page:r-1,onChangePage:function(e,t){a.push("/runs?page=".concat(t+1,"&per=").concat(i))},onChangeRowsPerPage:function(){},backIconButtonProps:{"aria-label":"prev-page"},nextIconButtonProps:{"aria-label":"next-page"}})))))};function xi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xa(){var e=xi(["\n ","\n query FetchJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...JobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return xa=function(){return e},e}var xo=n0(xa(),xn),xs=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"25",10),r=rv(xo,{variables:{offset:(t-1)*n,limit:n},fetchPolicy:"cache-and-network"}),i=r.data,a=r.loading,o=r.error;return o?l.createElement(iD,{error:o}):l.createElement(xr,{loading:a,data:i,page:t,pageSize:n})},xu=function(){var e=(0,h.$B)().path;return l.createElement(h.rs,null,l.createElement(h.AW,{exact:!0,path:e},l.createElement(xs,null)),l.createElement(h.AW,{path:"".concat(e,"/:id")},l.createElement(k7,null)))};function xc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xl(){var e=xc(["\n fragment FetchFeedsManagersPayload_ResultsFields on FeedsManager {\n __typename\n id\n name\n uri\n publicKey\n isConnectionActive\n createdAt\n disabledAt\n }\n query FetchFeedsManagers {\n feedsManagers {\n results {\n ...FetchFeedsManagersPayload_ResultsFields\n }\n }\n }\n"]);return xl=function(){return e},e}var xf=n0(xl()),xd=function(e){return rv(xf,e)},xh=n(47559),xp=n(83165),xb=n(47298),xm=n(81395),xg=function(){return(0,b.createStyles)({root:{display:"flex"},activeIcon:{color:xh.default[500]},inactiveIcon:{color:xp.default[500]},text:{marginLeft:4}})},xv=(0,b.withStyles)(xg)(function(e){var t=e.isActive,n=e.activeText,r=e.inactiveText,i=e.classes;return l.createElement("div",{className:i.root},t?l.createElement(xm.Z,{fontSize:"small",className:i.activeIcon}):l.createElement(xb.Z,{fontSize:"small",className:i.inactiveIcon}),l.createElement(x.default,{variant:"body1",inline:!0,className:i.text},t?n:r))}),xy=(0,b.withStyles)(iu)(function(e){var t=e.jobDistributor,n=e.classes;return l.createElement(ir.Z,{className:n.row,hover:!0},l.createElement(r7.default,{className:n.cell,component:"th",scope:"row"},l.createElement(ih,{className:n.link,href:"/job_distributors/".concat(t.id)},t.name)),l.createElement(r7.default,null,l.createElement(xv,{isActive:t.isConnectionActive,activeText:"Connected",inactiveText:"Disconnected"})),l.createElement(r7.default,null,l.createElement(xv,{isActive:!t.disabledAt,activeText:"Enabled",inactiveText:"Disabled"})),l.createElement(r7.default,null,_T(t.publicKey,{start:6,end:6}),l.createElement(_x,{data:t.publicKey})),l.createElement(r7.default,null,t.uri))}),xw=function(e){var t=e.jobDistributors;return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Distributors")),l.createElement(d.Z,{item:!0,xs:3},l.createElement(d.Z,{container:!0,justify:"flex-end"},l.createElement(d.Z,{item:!0},l.createElement(aA.Z,{variant:"secondary",component:tz,href:"/job_distributors/new"},"New Job Distributor")))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Name"),l.createElement(r7.default,null,"Connection Status"),l.createElement(r7.default,null,"Status"),l.createElement(r7.default,null,"CSA Public Key"),l.createElement(r7.default,null,"RPC URL"))),l.createElement(r9.Z,null,0===t.length&&l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},"Job Distributors have not been registered")),t.map(function(e){return l.createElement(xy,{key:e.id,jobDistributor:e})})))))))},x_=function(){var e,t=xd({fetchPolicy:"cache-and-network"}),n=t.data,r=t.loading,i=t.error;return r?l.createElement(iR,null):i?l.createElement(iD,{error:i}):l.createElement(xw,{jobDistributors:null!==(e=null==n?void 0:n.feedsManagers.results)&&void 0!==e?e:[]})},xE=bv().shape({name:p0().required("Required"),uri:p0().required("Required"),publicKey:p0().required("Required")}),xS=function(e){var t=e.initialValues,n=e.onSubmit;return l.createElement(hT,{initialValues:t,validationSchema:xE,onSubmit:n},function(e){var t=e.isSubmitting,n=e.submitForm;return l.createElement(hR,{"data-testid":"feeds-manager-form"},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"name",name:"name",label:"Name",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:!1,md:6}),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"uri",name:"uri",label:"URI",required:!0,fullWidth:!0,helperText:"Provided by the Job Distributor operator",FormHelperTextProps:{"data-testid":"uri-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"publicKey",name:"publicKey",label:"Public Key",required:!0,fullWidth:!0,helperText:"Provided by the Job Distributor operator",FormHelperTextProps:{"data-testid":"publicKey-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(ok.default,{variant:"contained",color:"primary",disabled:t,onClick:n},"Submit"))))})},xk=function(e){var t=e.data,n=e.onSubmit,r={name:t.name,uri:t.uri,publicKey:t.publicKey};return l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Edit Job Distributor"}),l.createElement(aW.Z,null,l.createElement(xS,{initialValues:r,onSubmit:n})))))};function xx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(xZ,e)},xJ=function(){return(0,b.createStyles)({root:{fontSize:24}})},xQ=(0,b.withStyles)(xJ)(function(e){var t=e.children,n=e.classes;return l.createElement(x.default,{variant:"h2",className:n.root},t)}),x1=n(9290),x0=n(74923);function x2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TT(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function TM(e,t){return Tv(e)||TE(e,t)||TA(e,t)||TS()}function TO(e){return Ty(e)||T_(e)||TA(e)||Tk()}function TA(e,t){if(e){if("string"==typeof e)return Tg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tg(e,t)}}var TL=function(e){return"SN_MAIN"===e||"SN_SEPOLIA"===e},TC=bv().shape({chainID:p0().required("Required"),chainType:p0().required("Required"),accountAddr:p0().required("Required"),accountAddrPubKey:p0().nullable(),adminAddr:p0(),ocr1Multiaddr:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&t},then:p0().required("Required").nullable()}).nullable(),ocr1P2PPeerID:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr1KeyBundleID:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2Multiaddr:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&t},then:p0().required("Required").nullable()}).nullable(),ocr2P2PPeerID:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2KeyBundleID:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2CommitPluginEnabled:pV().required("Required"),ocr2ExecutePluginEnabled:pV().required("Required"),ocr2MedianPluginEnabled:pV().required("Required"),ocr2MercuryPluginEnabled:pV().required("Required"),ocr2ForwarderAddress:p0().nullable()}),TI=function(e){return(0,b.createStyles)({supportedJobOptionsPaper:{padding:2*e.spacing.unit}})},TD=function(e){var t=e.addresses,n=Tx(e,["addresses"]),r=h_(),i=r.values,a=i.chainID,o=i.accountAddr,s=r.setFieldValue,u=TM(l.useState(!1),2),c=u[0],f=u[1],d=l.useRef();l.useEffect(function(){d.current=a},[a]),l.useEffect(function(){a!==d.current&&(s(n.name,""),f(!1))},[a,s,n.name]);var h=function(e){var t=e.target.value;"custom"===t?(f(!0),s(n.name,"")):(f(!1),s(n.name,t))};return l.createElement(l.Fragment,null,!TL(a)&&l.createElement(hP,Tw({},n,{select:!0,value:c?"custom":o,onChange:h}),t.map(function(e){return l.createElement(tE.default,{key:e,value:e},e)})),TL(a)&&l.createElement(hP,{component:hX,id:"accountAddr",name:"accountAddr",label:"Enter your account address",inputProps:{"data-testid":"customAccountAddr-input"},helperText:"The account address used for this chain",required:!0,fullWidth:!0}),TL(a)&&l.createElement("div",null,l.createElement(hP,{component:hX,id:"accountAddrPubKey",name:"accountAddrPubKey",label:"Account Address Public Key",required:!0,fullWidth:!0,helperText:"The public key for your account address",FormHelperTextProps:{"data-testid":"accountAddrPubKey-helper-text"}})))},TN=(0,b.withStyles)(TI)(function(e){var t=e.classes,n=e.editing,r=void 0!==n&&n,i=e.innerRef,a=e.initialValues,o=e.onSubmit,s=e.chains,u=void 0===s?[]:s,c=e.accountsEVM,f=void 0===c?[]:c,h=e.accountsNonEvm,p=e.p2pKeys,b=void 0===p?[]:p,m=e.ocrKeys,g=void 0===m?[]:m,v=e.ocr2Keys,y=void 0===v?[]:v,w=e.showSubmit,_=void 0!==w&&w,E=TO(y).sort(function(e,t){var n,r,i;return e.chainType===t.chainType?e.id.localeCompare(t.id):null!==(i=null===(n=e.chainType)||void 0===n?void 0:n.localeCompare(null!==(r=t.chainType)&&void 0!==r?r:""))&&void 0!==i?i:0});return l.createElement(hT,{innerRef:i,initialValues:a,validationSchema:TC,onSubmit:o},function(e){var n,i,a=e.values,o=[];switch(a.chainType){case Tm.EVM:o=f.filter(function(e){return e.chain.id==a.chainID&&!e.isDisabled}).map(function(e){return e.address});break;case Tm.APTOS:o=null!==(n=null==h?void 0:h.aptosKeys.results.map(function(e){return e.account}))&&void 0!==n?n:[];break;case Tm.SOLANA:o=null!==(i=null==h?void 0:h.solanaKeys.results.map(function(e){return e.id}))&&void 0!==i?i:[];break;default:o=[]}var s=u.filter(function(e){return e.network.toUpperCase()===a.chainType});return l.createElement(hR,{"data-testid":"feeds-manager-form",id:"chain-configuration-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"chainType",name:"chainType",label:"Chain Type",select:!0,required:!0,fullWidth:!0,disabled:r},l.createElement(tE.default,{key:Tm.EVM,value:Tm.EVM},"EVM"),l.createElement(tE.default,{key:Tm.APTOS,value:Tm.APTOS},"APTOS"),l.createElement(tE.default,{key:Tm.SOLANA,value:Tm.SOLANA},"SOLANA"))),l.createElement(d.Z,{item:!0,xs:12,md:6},s.length>0&&!r?l.createElement(hP,{component:hX,id:"chainID",name:"chainID",label:"Chain ID",required:!0,fullWidth:!0,select:!0,disabled:r,inputProps:{"data-testid":"chainID-input"},FormHelperTextProps:{"data-testid":"chainID-helper-text"}},s.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)})):l.createElement(hP,{component:hX,id:"chainID",name:"chainID",label:"Chain ID",required:!0,fullWidth:!0,disabled:r,inputProps:{"data-testid":"chainID-manual-input"},FormHelperTextProps:{"data-testid":"chainID-helper-manual-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},o.length>0?l.createElement(TD,{component:hX,id:"accountAddr",name:"accountAddr",label:"Account Address",inputProps:{"data-testid":"accountAddr-input"},required:!0,fullWidth:!0,select:!0,helperText:"The account address used for this chain",addresses:o,FormHelperTextProps:{"data-testid":"accountAddr-helper-text"}}):l.createElement(hP,{component:hX,id:"accountAddr",name:"accountAddr",label:"Account Address",inputProps:{"data-testid":"accountAddr-manual-input"},required:!0,fullWidth:!0,helperText:"The account address used for this chain",FormHelperTextProps:{"data-testid":"accountAddr-helper-manual-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"adminAddr",name:"adminAddr",label:"Admin Address",fullWidth:!0,helperText:"The address used for LINK payments",FormHelperTextProps:{"data-testid":"adminAddr-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Job Types")),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"fluxMonitorEnabled",type:"checkbox",Label:{label:"Flux Monitor"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr1Enabled",type:"checkbox",Label:{label:"OCR"}}),a.ocr1Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr1IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),a.ocr1IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"ocr1Multiaddr",name:"ocr1Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr1Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr1P2PPeerID",name:"ocr1P2PPeerID",label:"Peer ID",select:!0,required:!0,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1P2PPeerID-helper-text"}},b.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr1KeyBundleID",name:"ocr1KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1KeyBundleID-helper-text"}},g.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)})))))))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr2Enabled",type:"checkbox",Label:{label:"OCR2"}}),a.ocr2Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr2IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr2P2PPeerID",name:"ocr2P2PPeerID",label:"Peer ID",select:!0,required:!a.ocr2IsBootstrap,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2P2PPeerID-helper-text"}},b.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),a.ocr2IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"ocr2Multiaddr",name:"ocr2Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR2 Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr2Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr2KeyBundleID",name:"ocr2KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR2 Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2KeyBundleID-helper-text"}},E.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id," (",e.chainType,")")}))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Plugins")),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2CommitPluginEnabled",type:"checkbox",Label:{label:"Commit"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2ExecutePluginEnabled",type:"checkbox",Label:{label:"Execute"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2RebalancerPluginEnabled",type:"checkbox",Label:{label:"Rebalancer"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2MedianPluginEnabled",type:"checkbox",Label:{label:"Median"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2MercuryPluginEnabled",type:"checkbox",Label:{label:"Mercury"}})),l.createElement(d.Z,{item:!0,xs:12,md:12},l.createElement(hP,{component:hX,id:"ocr2ForwarderAddress",name:"ocr2ForwarderAddress",label:"Forwarder Address (optional)",fullWidth:!0,helperText:"The forwarder address from the Operator Forwarder Contract",FormHelperTextProps:{"data-testid":"ocr2ForwarderAddress-helper-text"}}))))))),_&&l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",size:"large"},"Submit"))))})});function TP(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function TR(){var e=TP(["\n fragment AptosKeysPayload_ResultsFields on AptosKey {\n account\n id\n }\n"]);return TR=function(){return e},e}function Tj(){var e=TP(["\n fragment SolanaKeysPayload_ResultsFields on SolanaKey {\n id\n }\n"]);return Tj=function(){return e},e}function TF(){var e=TP(["\n ","\n ","\n query FetchNonEvmKeys {\n aptosKeys {\n results {\n ...AptosKeysPayload_ResultsFields\n }\n }\n solanaKeys {\n results {\n ...SolanaKeysPayload_ResultsFields\n }\n }\n }\n"]);return TF=function(){return e},e}var TY=n0(TR()),TB=n0(Tj()),TU=n0(TF(),TY,TB),TH=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(TU,e)},T$=function(e){var t=e.onClose,n=e.open,r=e.onSubmit,i=l.useRef(),a=i$({fetchPolicy:"network-only"}).data,o=_K({fetchPolicy:"cache-and-network"}).data,s=TH({fetchPolicy:"cache-and-network"}).data,u=SV({fetchPolicy:"cache-and-network"}).data,c=EO({fetchPolicy:"cache-and-network"}).data,f=E2({fetchPolicy:"cache-and-network"}).data,d={chainID:"",chainType:Tm.EVM,accountAddr:"",adminAddr:"",accountAddrPubKey:"",fluxMonitorEnabled:!1,ocr1Enabled:!1,ocr1IsBootstrap:!1,ocr1Multiaddr:"",ocr1P2PPeerID:"",ocr1KeyBundleID:"",ocr2Enabled:!1,ocr2IsBootstrap:!1,ocr2Multiaddr:"",ocr2P2PPeerID:"",ocr2KeyBundleID:"",ocr2CommitPluginEnabled:!1,ocr2ExecutePluginEnabled:!1,ocr2MedianPluginEnabled:!1,ocr2MercuryPluginEnabled:!1,ocr2RebalancerPluginEnabled:!1,ocr2ForwarderAddress:""},h=a?a.chains.results:[],p=o?o.ethKeys.results:[],b=u?u.p2pKeys.results:[],m=c?c.ocrKeyBundles.results:[],g=f?f.ocr2KeyBundles.results:[];return l.createElement(aD.Z,{onClose:t,open:n,disableBackdropClick:!0},l.createElement(oO.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"New Supported Chain")),l.createElement(oT.Z,null,l.createElement(TN,{innerRef:i,initialValues:d,onSubmit:r,chains:h,accountsEVM:p,accountsNonEvm:s,p2pKeys:b,ocrKeys:m,ocr2Keys:g})),l.createElement(ox.Z,null,l.createElement(ok.default,{onClick:t},"Cancel"),l.createElement(ok.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))},Tz=function(e){var t=e.cfg,n=e.onClose,r=e.open,i=e.onSubmit,a=l.useRef(),o=i$({fetchPolicy:"network-only"}).data,s=_K({fetchPolicy:"cache-and-network"}).data,u=TH({fetchPolicy:"cache-and-network"}).data,c=SV({fetchPolicy:"cache-and-network"}).data,f=EO({fetchPolicy:"cache-and-network"}).data,d=E2({fetchPolicy:"cache-and-network"}).data;if(!t)return null;var h={chainID:t.chainID,chainType:t.chainType,accountAddr:t.accountAddr,adminAddr:t.adminAddr,accountAddrPubKey:t.accountAddrPubKey,fluxMonitorEnabled:t.fluxMonitorJobConfig.enabled,ocr1Enabled:t.ocr1JobConfig.enabled,ocr1IsBootstrap:t.ocr1JobConfig.isBootstrap,ocr1Multiaddr:t.ocr1JobConfig.multiaddr,ocr1P2PPeerID:t.ocr1JobConfig.p2pPeerID,ocr1KeyBundleID:t.ocr1JobConfig.keyBundleID,ocr2Enabled:t.ocr2JobConfig.enabled,ocr2IsBootstrap:t.ocr2JobConfig.isBootstrap,ocr2Multiaddr:t.ocr2JobConfig.multiaddr,ocr2P2PPeerID:t.ocr2JobConfig.p2pPeerID,ocr2KeyBundleID:t.ocr2JobConfig.keyBundleID,ocr2CommitPluginEnabled:t.ocr2JobConfig.plugins.commit,ocr2ExecutePluginEnabled:t.ocr2JobConfig.plugins.execute,ocr2MedianPluginEnabled:t.ocr2JobConfig.plugins.median,ocr2MercuryPluginEnabled:t.ocr2JobConfig.plugins.mercury,ocr2RebalancerPluginEnabled:t.ocr2JobConfig.plugins.rebalancer,ocr2ForwarderAddress:t.ocr2JobConfig.forwarderAddress},p=o?o.chains.results:[],b=s?s.ethKeys.results:[],m=c?c.p2pKeys.results:[],g=f?f.ocrKeyBundles.results:[],v=d?d.ocr2KeyBundles.results:[];return l.createElement(aD.Z,{onClose:n,open:r,disableBackdropClick:!0},l.createElement(oO.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"Edit Supported Chain")),l.createElement(oT.Z,null,l.createElement(TN,{innerRef:a,initialValues:h,onSubmit:i,chains:p,accountsEVM:b,accountsNonEvm:u,p2pKeys:m,ocrKeys:g,ocr2Keys:v,editing:!0})),l.createElement(ox.Z,null,l.createElement(ok.default,{onClick:n},"Cancel"),l.createElement(ok.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))};function TG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);nt.version?e:t})},[o]),g=l.useMemo(function(){return M1(o).sort(function(e,t){return t.version-e.version})},[o]),v=function(e,t,n){switch(e){case"PENDING":return l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"text",color:"secondary",onClick:function(){return b("reject",t)}},"Reject"),m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status&&l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve"),m.id===t&&"DELETED"===n.status&&n.pendingUpdate&&l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("cancel",t)}},"Cancel"),l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs")));case"APPROVED":return l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"contained",onClick:function(){return b("cancel",t)}},"Cancel"),"DELETED"===n.status&&n.pendingUpdate&&l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs"));case"CANCELLED":if(m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status)return l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve");return null;default:return null}};return l.createElement("div",null,g.map(function(e,n){return l.createElement(mP.Z,{defaultExpanded:0===n,key:n},l.createElement(mR.Z,{expandIcon:l.createElement(gh.Z,null)},l.createElement(x.default,{className:t.versionText},"Version ",e.version),l.createElement(Es.Z,{label:e.status,color:"APPROVED"===e.status?"primary":"default",variant:"REJECTED"===e.status||"CANCELLED"===e.status?"outlined":"default"}),l.createElement("div",{className:t.proposedAtContainer},l.createElement(x.default,null,"Proposed ",l.createElement(aO,{tooltip:!0},e.createdAt)))),l.createElement(mj.Z,{className:t.expansionPanelDetails},l.createElement("div",{className:t.actions},l.createElement("div",{className:t.editContainer},0===n&&("PENDING"===e.status||"CANCELLED"===e.status)&&"DELETED"!==s.status&&"REVOKED"!==s.status&&l.createElement(ok.default,{variant:"contained",onClick:function(){return p(!0)}},"Edit")),l.createElement("div",{className:t.actionsContainer},v(e.status,e.id,s))),l.createElement(gd,{language:"toml",style:gs,"data-testid":"codeblock"},e.definition)))}),l.createElement(oC,{open:null!=c,title:c?M6[c.action].title:"",body:c?M6[c.action].body:"",onConfirm:function(){if(c){switch(c.action){case"approve":n(c.id);break;case"cancel":r(c.id);break;case"reject":i(c.id)}f(null)}},cancelButtonText:"Cancel",onCancel:function(){return f(null)}}),l.createElement(Mz,{open:h,onClose:function(){return p(!1)},initialValues:{definition:m.definition,id:m.id},onSubmit:a}))});function M8(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M9(){var e=M8(["\n ","\n fragment JobProposalPayloadFields on JobProposal {\n id\n externalJobID\n remoteUUID\n jobID\n specs {\n ...JobProposal_SpecsFields\n }\n status\n pendingUpdate\n }\n"]);return M9=function(){return e},e}var M7=n0(M9(),M3),Oe=function(e){var t=e.onApprove,n=e.onCancel,r=e.onReject,i=e.onUpdateSpec,a=e.proposal;return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Proposal #",a.id))),l.createElement(MF,{proposal:a}),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(xQ,null,"Specs"))),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(M5,{proposal:a,specs:a.specs,onReject:r,onApprove:t,onCancel:n,onUpdateSpec:i}))))};function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nU,tA:()=>$,KL:()=>H,Iw:()=>V,DQ:()=>W,cB:()=>T,LO:()=>M,t5:()=>k,qt:()=>x,Jc:()=>C,L7:()=>Y,EO:()=>B});var r,i,a=n(66289),o=n(41800),s=n.n(o),u=n(67932);(i=r||(r={})).IN_PROGRESS="in_progress",i.PENDING_INCOMING_CONFIRMATIONS="pending_incoming_confirmations",i.PENDING_CONNECTION="pending_connection",i.PENDING_BRIDGE="pending_bridge",i.PENDING_SLEEP="pending_sleep",i.ERRORED="errored",i.COMPLETED="completed";var c=n(87013),l=n(19084),f=n(34823);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]j,v2:()=>F});var r=n(66289);function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var a="/sessions",o="/sessions",s=function e(t){var n=this;i(this,e),this.api=t,this.createSession=function(e){return n.create(e)},this.destroySession=function(){return n.destroy()},this.create=this.api.createResource(a),this.destroy=this.api.deleteResource(o)};function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var c="/v2/bulk_delete_runs",l=function e(t){var n=this;u(this,e),this.api=t,this.bulkDeleteJobRuns=function(e){return n.destroy(e)},this.destroy=this.api.deleteResource(c)};function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var d="/v2/chains/evm",h="".concat(d,"/:id"),p=function e(t){var n=this;f(this,e),this.api=t,this.getChains=function(){return n.index()},this.createChain=function(e){return n.create(e)},this.destroyChain=function(e){return n.destroy(void 0,{id:e})},this.updateChain=function(e,t){return n.update(t,{id:e})},this.index=this.api.fetchResource(d),this.create=this.api.createResource(d),this.destroy=this.api.deleteResource(h),this.update=this.api.updateResource(h)};function b(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var m="/v2/keys/evm/chain",g=function e(t){var n=this;b(this,e),this.api=t,this.chain=function(e){var t=new URLSearchParams;t.append("address",e.address),t.append("evmChainID",e.evmChainID),null!==e.abandon&&t.append("abandon",String(e.abandon)),null!==e.enabled&&t.append("enabled",String(e.enabled));var r=m+"?"+t.toString();return n.api.createResource(r)()}};function v(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var y="/v2/jobs",w="".concat(y,"/:specId/runs"),_=function e(t){var n=this;v(this,e),this.api=t,this.createJobRunV2=function(e,t){return n.post(t,{specId:e})},this.post=this.api.createResource(w,!0)};function E(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var S="/v2/log",k=function e(t){var n=this;E(this,e),this.api=t,this.getLogConfig=function(){return n.show()},this.updateLogConfig=function(e){return n.update(e)},this.show=this.api.fetchResource(S),this.update=this.api.updateResource(S)};function x(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var T="/v2/nodes",M=function e(t){var n=this;x(this,e),this.api=t,this.getNodes=function(){return n.index()},this.createNode=function(e){return n.create(e)},this.index=this.api.fetchResource(T),this.create=this.api.createResource(T)};function O(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var A="/v2/enroll_webauthn",L=function e(t){var n=this;O(this,e),this.api=t,this.beginKeyRegistration=function(e){return n.create(e)},this.finishKeyRegistration=function(e){return n.put(e)},this.create=this.api.fetchResource(A),this.put=this.api.createResource(A)};function C(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var I="/v2/build_info",D=function e(t){var n=this;C(this,e),this.api=t,this.show=function(){return n.api.GET(I)()}};function N(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var P=function e(t){N(this,e),this.api=t,this.buildInfo=new D(this.api),this.bulkDeleteRuns=new l(this.api),this.chains=new p(this.api),this.logConfig=new k(this.api),this.nodes=new M(this.api),this.jobs=new _(this.api),this.webauthn=new L(this.api),this.evmKeys=new g(this.api)},R=new r.V0({base:void 0}),j=new s(R),F=new P(R)},1398(e,t,n){"use strict";n.d(t,{Z:()=>d});var r=n(67294),i=n(32316),a=n(83638),o=n(94184),s=n.n(o);function u(){return(u=Object.assign||function(e){for(var t=1;tc});var r=n(67294),i=n(32316);function a(){return(a=Object.assign||function(e){for(var t=1;tx,jK:()=>v});var r=n(67294),i=n(37703),a=n(45697),o=n.n(a),s=n(82204),u=n(71426),c=n(94184),l=n.n(c),f=n(32316),d=function(e){var t=e.palette.success||{},n=e.palette.warning||{};return{base:{paddingLeft:5*e.spacing.unit,paddingRight:5*e.spacing.unit},success:{backgroundColor:t.main,color:t.contrastText},error:{backgroundColor:e.palette.error.dark,color:e.palette.error.contrastText},warning:{backgroundColor:n.contrastText,color:n.main}}},h=function(e){var t,n=e.success,r=e.error,i=e.warning,a=e.classes,o=e.className;return n?t=a.success:r?t=a.error:i&&(t=a.warning),l()(a.base,o,t)},p=function(e){return r.createElement(s.Z,{className:h(e),square:!0},r.createElement(u.default,{variant:"body2",color:"inherit",component:"div"},e.children))};p.defaultProps={success:!1,error:!1,warning:!1},p.propTypes={success:o().bool,error:o().bool,warning:o().bool};let b=(0,f.withStyles)(d)(p);var m=function(){return r.createElement(r.Fragment,null,"Unhandled error. Please help us by opening a"," ",r.createElement("a",{href:"https://github.com/smartcontractkit/chainlink/issues/new"},"bug report"))};let g=m;function v(e){return"string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null)}function y(e,t){var n;return n="string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null),r.createElement("p",{key:t},n)}var w=function(e){var t=e.notifications;return r.createElement(b,{error:!0},t.map(y))},_=function(e){var t=e.notifications;return r.createElement(b,{success:!0},t.map(y))},E=function(e){var t=e.errors,n=e.successes;return r.createElement("div",null,(null==t?void 0:t.length)>0&&r.createElement(w,{notifications:t}),n.length>0&&r.createElement(_,{notifications:n}))},S=function(e){return{errors:e.notifications.errors,successes:e.notifications.successes}},k=(0,i.$j)(S)(E);let x=k},9409(e,t,n){"use strict";n.d(t,{ZP:()=>j});var r=n(67294),i=n(37703),a=n(5977),o=n(32316),s=n(1398),u=n(82204),c=n(30060),l=n(71426),f=n(60520),d=n(39814),h=n(57209),p=n(26842),b=n(3950),m=n(5536),g=n(45697),v=n.n(g);let y=n.p+"9f6d832ef97e8493764e.svg";function w(){return(w=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&_.map(function(e,t){return r.createElement(d.Z,{item:!0,xs:12,key:t},r.createElement(u.Z,{raised:!1,className:v.error},r.createElement(c.Z,null,r.createElement(l.default,{variant:"body1",className:v.errorText},(0,b.jK)(e)))))}),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"email",label:"Email",margin:"normal",value:n,onChange:m("email"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"password",label:"Password",type:"password",autoComplete:"password",margin:"normal",value:h,onChange:m("password"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(d.Z,{container:!0,spacing:0,justify:"center"},r.createElement(d.Z,{item:!0},r.createElement(s.Z,{type:"submit",variant:"primary"},"Access Account")))),y&&r.createElement(l.default,{variant:"body1",color:"textSecondary"},"Signing in...")))))))},P=function(e){return{fetching:e.authentication.fetching,authenticated:e.authentication.allowed,errors:e.notifications.errors}},R=(0,i.$j)(P,x({submitSignIn:p.L7}))(N);let j=(0,h.wU)(e)((0,o.withStyles)(D)(R))},16353(e,t,n){"use strict";n.d(t,{ZP:()=>H,rH:()=>U});var r,i=n(37703),a=n(97779),o=n(9541),s=n(19084);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.Mk.RECEIVE_SIGNOUT_SUCCESS:case s.Mk.RECEIVE_SIGNIN_SUCCESS:var n={allowed:t.authenticated};return o.Ks(n),f(c({},e,n),{errors:[]});case s.Mk.RECEIVE_SIGNIN_FAIL:var r={allowed:!1};return o.Ks(r),f(c({},e,r),{errors:[]});case s.Mk.RECEIVE_SIGNIN_ERROR:case s.Mk.RECEIVE_SIGNOUT_ERROR:var i={allowed:!1};return o.Ks(i),f(c({},e,i),{errors:t.errors||[]});default:return e}};let b=p;function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;return t.type?t.type.startsWith(r.REQUEST)?y(g({},e),{count:e.count+1}):t.type.startsWith(r.RECEIVE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type.startsWith(r.RESPONSE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type===s.di.REDIRECT?y(g({},e),{count:0}):e:e};let S=E;function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.MATCH_ROUTE:return M(x({},O),{currentUrl:t.pathname});case s.Ih.NOTIFY_SUCCESS:var n={component:t.component,props:t.props};return M(x({},e),{successes:[n],errors:[]});case s.Ih.NOTIFY_SUCCESS_MSG:return M(x({},e),{successes:[t.msg],errors:[]});case s.Ih.NOTIFY_ERROR:var r=t.error.errors,i=null==r?void 0:r.map(function(e){return L(t,e)});return M(x({},e),{successes:[],errors:i});case s.Ih.NOTIFY_ERROR_MSG:return M(x({},e),{successes:[],errors:[t.msg]});case s.Mk.RECEIVE_SIGNIN_FAIL:return M(x({},e),{successes:[],errors:["Your email or password is incorrect. Please try again"]});default:return e}};function L(e,t){return{component:e.component,props:{msg:t.detail}}}let C=A;function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.REDIRECT:return P(D({},e),{to:t.to});case s.di.MATCH_ROUTE:return P(D({},e),{to:void 0});default:return e}};let F=j;var Y=n(87013),B=(0,a.UY)({authentication:b,fetching:S,notifications:C,redirect:F,buildInfo:Y.Z});B(void 0,{type:"INITIAL_STATE"});var U=i.v9;let H=B},19084(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d;n.d(t,{Ih:()=>i,Mk:()=>a,Y0:()=>s,di:()=>r,jp:()=>o}),n(67294),(u=r||(r={})).REDIRECT="REDIRECT",u.MATCH_ROUTE="MATCH_ROUTE",(c=i||(i={})).NOTIFY_SUCCESS="NOTIFY_SUCCESS",c.NOTIFY_SUCCESS_MSG="NOTIFY_SUCCESS_MSG",c.NOTIFY_ERROR="NOTIFY_ERROR",c.NOTIFY_ERROR_MSG="NOTIFY_ERROR_MSG",(l=a||(a={})).REQUEST_SIGNIN="REQUEST_SIGNIN",l.RECEIVE_SIGNIN_SUCCESS="RECEIVE_SIGNIN_SUCCESS",l.RECEIVE_SIGNIN_FAIL="RECEIVE_SIGNIN_FAIL",l.RECEIVE_SIGNIN_ERROR="RECEIVE_SIGNIN_ERROR",l.RECEIVE_SIGNOUT_SUCCESS="RECEIVE_SIGNOUT_SUCCESS",l.RECEIVE_SIGNOUT_ERROR="RECEIVE_SIGNOUT_ERROR",(f=o||(o={})).RECEIVE_CREATE_ERROR="RECEIVE_CREATE_ERROR",f.RECEIVE_CREATE_SUCCESS="RECEIVE_CREATE_SUCCESS",f.RECEIVE_DELETE_ERROR="RECEIVE_DELETE_ERROR",f.RECEIVE_DELETE_SUCCESS="RECEIVE_DELETE_SUCCESS",f.RECEIVE_UPDATE_ERROR="RECEIVE_UPDATE_ERROR",f.RECEIVE_UPDATE_SUCCESS="RECEIVE_UPDATE_SUCCESS",f.REQUEST_CREATE="REQUEST_CREATE",f.REQUEST_DELETE="REQUEST_DELETE",f.REQUEST_UPDATE="REQUEST_UPDATE",f.UPSERT_CONFIGURATION="UPSERT_CONFIGURATION",f.UPSERT_JOB_RUN="UPSERT_JOB_RUN",f.UPSERT_JOB_RUNS="UPSERT_JOB_RUNS",f.UPSERT_TRANSACTION="UPSERT_TRANSACTION",f.UPSERT_TRANSACTIONS="UPSERT_TRANSACTIONS",f.UPSERT_BUILD_INFO="UPSERT_BUILD_INFO",(d=s||(s={})).FETCH_BUILD_INFO_REQUESTED="FETCH_BUILD_INFO_REQUESTED",d.FETCH_BUILD_INFO_SUCCEEDED="FETCH_BUILD_INFO_SUCCEEDED",d.FETCH_BUILD_INFO_FAILED="FETCH_BUILD_INFO_FAILED"},87013(e,t,n){"use strict";n.d(t,{Y:()=>o,Z:()=>u});var r=n(19084);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return t.type===r.Y0.FETCH_BUILD_INFO_SUCCEEDED?a({},t.buildInfo):e};let u=s},34823(e,t,n){"use strict";n.d(t,{N:()=>r});var r=function(e){return e.buildInfo}},73343(e,t,n){"use strict";n.d(t,{r:()=>u});var r=n(19350),i=n(32316),a=n(59114),o=n(5324),s={props:{MuiGrid:{spacing:3*o.default.unit},MuiCardHeader:{titleTypographyProps:{color:"secondary"}}},palette:{action:{hoverOpacity:.3},primary:{light:"#E5F1FF",main:"#3c40c6",contrastText:"#fff"},secondary:{main:"#3d5170"},success:{light:"#e8faf1",main:r.ek.A700,dark:r.ek[700],contrastText:r.y0.white},warning:{light:"#FFFBF1",main:"#fff6b6",contrastText:"#fad27a"},error:{light:"#ffdada",main:"#f44336",dark:"#d32f2f",contrastText:"#fff"},background:{default:"#f5f6f8",appBar:"#3c40c6"},text:{primary:(0,a.darken)(r.BA.A700,.7),secondary:"#818ea3"},listPendingStatus:{background:"#fef7e5",color:"#fecb4c"},listCompletedStatus:{background:"#e9faf2",color:"#4ed495"}},shape:{borderRadius:o.default.unit},overrides:{MuiButton:{root:{borderRadius:o.default.unit/2,textTransform:"none"},sizeLarge:{padding:void 0,fontSize:void 0,paddingTop:o.default.unit,paddingBottom:o.default.unit,paddingLeft:5*o.default.unit,paddingRight:5*o.default.unit}},MuiTableCell:{body:{fontSize:"1rem"},head:{fontSize:"1rem",fontWeight:400}},MuiCardHeader:{root:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},action:{marginTop:-2,marginRight:0,"& >*":{marginLeft:2*o.default.unit}},subheader:{marginTop:.5*o.default.unit}}},typography:{useNextVariants:!0,fontFamily:"-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif",button:{textTransform:"none",fontSize:"1.2em"},body1:{fontSize:"1.0rem",fontWeight:400,lineHeight:"1.46429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body2:{fontSize:"1.0rem",fontWeight:500,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body1Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"1rem",lineHeight:1.5,letterSpacing:-.4},body2Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"0.875rem",lineHeight:1.5,letterSpacing:-.4},display1:{color:"#818ea3",fontSize:"2.125rem",fontWeight:400,lineHeight:"1.20588em",letterSpacing:-.4},display2:{color:"#818ea3",fontSize:"2.8125rem",fontWeight:400,lineHeight:"1.13333em",marginLeft:"-.02em",letterSpacing:-.4},display3:{color:"#818ea3",fontSize:"3.5rem",fontWeight:400,lineHeight:"1.30357em",marginLeft:"-.02em",letterSpacing:-.4},display4:{fontSize:14,fontWeightLight:300,fontWeightMedium:500,fontWeightRegular:400,letterSpacing:-.4},h1:{color:"rgb(29, 29, 29)",fontSize:"6rem",fontWeight:300,lineHeight:1},h2:{color:"rgb(29, 29, 29)",fontSize:"3.75rem",fontWeight:300,lineHeight:1},h3:{color:"rgb(29, 29, 29)",fontSize:"3rem",fontWeight:400,lineHeight:1.04},h4:{color:"rgb(29, 29, 29)",fontSize:"2.125rem",fontWeight:400,lineHeight:1.17},h5:{color:"rgb(29, 29, 29)",fontSize:"1.5rem",fontWeight:400,lineHeight:1.33,letterSpacing:-.4},h6:{fontSize:"0.8rem",fontWeight:450,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},subheading:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:"1.5em",letterSpacing:-.4},subtitle1:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:1.75,letterSpacing:-.4},subtitle2:{color:"rgb(29, 29, 29)",fontSize:"0.875rem",fontWeight:500,lineHeight:1.57,letterSpacing:-.4}},shadows:["none","0px 1px 3px 0px rgba(0, 0, 0, 0.1),0px 1px 1px 0px rgba(0, 0, 0, 0.04),0px 2px 1px -1px rgba(0, 0, 0, 0.02)","0px 1px 5px 0px rgba(0, 0, 0, 0.1),0px 2px 2px 0px rgba(0, 0, 0, 0.04),0px 3px 1px -2px rgba(0, 0, 0, 0.02)","0px 1px 8px 0px rgba(0, 0, 0, 0.1),0px 3px 4px 0px rgba(0, 0, 0, 0.04),0px 3px 3px -2px rgba(0, 0, 0, 0.02)","0px 2px 4px -1px rgba(0, 0, 0, 0.1),0px 4px 5px 0px rgba(0, 0, 0, 0.04),0px 1px 10px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 5px 8px 0px rgba(0, 0, 0, 0.04),0px 1px 14px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 6px 10px 0px rgba(0, 0, 0, 0.04),0px 1px 18px 0px rgba(0, 0, 0, 0.02)","0px 4px 5px -2px rgba(0, 0, 0, 0.1),0px 7px 10px 1px rgba(0, 0, 0, 0.04),0px 2px 16px 1px rgba(0, 0, 0, 0.02)","0px 5px 5px -3px rgba(0, 0, 0, 0.1),0px 8px 10px 1px rgba(0, 0, 0, 0.04),0px 3px 14px 2px rgba(0, 0, 0, 0.02)","0px 5px 6px -3px rgba(0, 0, 0, 0.1),0px 9px 12px 1px rgba(0, 0, 0, 0.04),0px 3px 16px 2px rgba(0, 0, 0, 0.02)","0px 6px 6px -3px rgba(0, 0, 0, 0.1),0px 10px 14px 1px rgba(0, 0, 0, 0.04),0px 4px 18px 3px rgba(0, 0, 0, 0.02)","0px 6px 7px -4px rgba(0, 0, 0, 0.1),0px 11px 15px 1px rgba(0, 0, 0, 0.04),0px 4px 20px 3px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 12px 17px 2px rgba(0, 0, 0, 0.04),0px 5px 22px 4px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 13px 19px 2px rgba(0, 0, 0, 0.04),0px 5px 24px 4px rgba(0, 0, 0, 0.02)","0px 7px 9px -4px rgba(0, 0, 0, 0.1),0px 14px 21px 2px rgba(0, 0, 0, 0.04),0px 5px 26px 4px rgba(0, 0, 0, 0.02)","0px 8px 9px -5px rgba(0, 0, 0, 0.1),0px 15px 22px 2px rgba(0, 0, 0, 0.04),0px 6px 28px 5px rgba(0, 0, 0, 0.02)","0px 8px 10px -5px rgba(0, 0, 0, 0.1),0px 16px 24px 2px rgba(0, 0, 0, 0.04),0px 6px 30px 5px rgba(0, 0, 0, 0.02)","0px 8px 11px -5px rgba(0, 0, 0, 0.1),0px 17px 26px 2px rgba(0, 0, 0, 0.04),0px 6px 32px 5px rgba(0, 0, 0, 0.02)","0px 9px 11px -5px rgba(0, 0, 0, 0.1),0px 18px 28px 2px rgba(0, 0, 0, 0.04),0px 7px 34px 6px rgba(0, 0, 0, 0.02)","0px 9px 12px -6px rgba(0, 0, 0, 0.1),0px 19px 29px 2px rgba(0, 0, 0, 0.04),0px 7px 36px 6px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 20px 31px 3px rgba(0, 0, 0, 0.04),0px 8px 38px 7px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 21px 33px 3px rgba(0, 0, 0, 0.04),0px 8px 40px 7px rgba(0, 0, 0, 0.02)","0px 10px 14px -6px rgba(0, 0, 0, 0.1),0px 22px 35px 3px rgba(0, 0, 0, 0.04),0px 8px 42px 7px rgba(0, 0, 0, 0.02)","0px 11px 14px -7px rgba(0, 0, 0, 0.1),0px 23px 36px 3px rgba(0, 0, 0, 0.04),0px 9px 44px 8px rgba(0, 0, 0, 0.02)","0px 11px 15px -7px rgba(0, 0, 0, 0.1),0px 24px 38px 3px rgba(0, 0, 0, 0.04),0px 9px 46px 8px rgba(0, 0, 0, 0.02)",]},u=(0,i.createMuiTheme)(s)},66289(e,t,n){"use strict";function r(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i}).apply(null,arguments)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function c(e){return -1!==Function.toString.call(e).indexOf("[native code]")}function l(e,t){return t&&("object"===p(t)||"function"==typeof t)?t:r(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{V0:()=>B,_7:()=>v});var d,h,p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function b(e){var t="function"==typeof Map?new Map:void 0;return(b=function(e){if(null===e||!c(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)})(e)}function m(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function g(e){var t=m();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}var v=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"AuthenticationError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e},],r}return n}(b(Error)),y=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"BadRequestError")).errors=a,r}return n}(b(Error)),w=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnprocessableEntityError")).errors=e,r}return n}(b(Error)),_=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"ServerError")).errors=e,r}return n}(b(Error)),E=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"ConflictError")).errors=a,r}return n}(b(Error)),S=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnknownResponseError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e.statusText},],r}return n}(b(Error));function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e4;return Promise.race([fetch(e,t),new Promise(function(e,t){return setTimeout(function(){return t(Error("timeout"))},n)}),])}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=200&&e.status<300))return[3,2];return[2,e.json()];case 2:if(400!==e.status)return[3,3];return[2,e.json().then(function(e){throw new y(e)})];case 3:if(401!==e.status)return[3,4];throw new v(e);case 4:if(422!==e.status)return[3,6];return[4,$(e)];case 5:throw n=i.sent(),new w(n);case 6:if(409!==e.status)return[3,7];return[2,e.json().then(function(e){throw new E(e)})];case 7:if(!(e.status>=500))return[3,9];return[4,$(e)];case 8:throw r=i.sent(),new _(r);case 9:throw new S(e);case 10:return[2]}})})).apply(this,arguments)}function $(e){return z.apply(this,arguments)}function z(){return(z=j(function(e){return Y(this,function(t){return[2,e.json().then(function(t){return t.errors?t.errors.map(function(t){return{status:e.status,detail:t.detail}}):G(e)}).catch(function(){return G(e)})]})})).apply(this,arguments)}function G(e){return[{status:e.status,detail:e.statusText},]}},50109(e,t,n){"use strict";n.d(t,{LK:()=>o,U2:()=>i,eT:()=>s,t8:()=>a});var r=n(12795);function i(e){return r.ZP.getItem("chainlink.".concat(e))}function a(e,t){r.ZP.setItem("chainlink.".concat(e),t)}function o(e){var t=i(e),n={};if(t)try{return JSON.parse(t)}catch(r){}return n}function s(e,t){a(e,JSON.stringify(t))}},9541(e,t,n){"use strict";n.d(t,{Ks:()=>u,Tp:()=>a,iR:()=>o,pm:()=>s});var r=n(50109),i="persistURL";function a(){return r.U2(i)||""}function o(e){r.t8(i,e)}function s(){return r.LK("authentication")}function u(e){r.eT("authentication",e)}},67121(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.r(t),n.d(t,{default:()=>o}),e=n.hmd(e),i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:e;var i,a=r(i);let o=a},2177(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=!0,i="Invariant failed";function a(e,t){if(!e){if(r)throw Error(i);throw Error(i+": "+(t||""))}}let o=a},11742(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;ru,ZT:()=>i,_T:()=>o,ev:()=>c,mG:()=>s,pi:()=>a});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function s(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){e.done?n(e.value):i(e.value).then(o,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]r})},94927(e,t,n){function r(e,t){if(i("noDeprecation"))return e;var n=!1;function r(){if(!n){if(i("throwDeprecation"))throw Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return r}function i(e){try{if(!n.g.localStorage)return!1}catch(t){return!1}var r=n.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r},42473(e){"use strict";var t=function(){};e.exports=t},84763(e){e.exports=Worker},47529(e){e.exports=n;var t=Object.prototype.hasOwnProperty;function n(){for(var e={},n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7071(e){function t(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},94993(e,t,n){var r=n(18698).default,i=n(66115);function a(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},6015(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},861(e,t,n){var r=n(63405),i=n(79498),a=n(86116),o=n(42281);function s(e){return r(e)||i(e)||a(e)||o()}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},18698(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},86116(e,t,n){var r=n(73897);function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},1644(e,t,n){"use strict";var r,i;function a(e){return!!e&&e<7}n.d(t,{I:()=>r,O:()=>a}),(i=r||(r={}))[i.loading=1]="loading",i[i.setVariables=2]="setVariables",i[i.fetchMore=3]="fetchMore",i[i.refetch=4]="refetch",i[i.poll=6]="poll",i[i.ready=7]="ready",i[i.error=8]="error"},30990(e,t,n){"use strict";n.d(t,{MS:()=>s,YG:()=>a,cA:()=>c,ls:()=>o});var r=n(70655);n(83952);var i=n(13154),a=Symbol();function o(e){return!!e.extensions&&Array.isArray(e.extensions[a])}function s(e){return e.hasOwnProperty("graphQLErrors")}var u=function(e){var t=(0,r.ev)((0,r.ev)((0,r.ev)([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(e){return(0,i.s)(e)&&e.message||"Error message not found."}).join("\n")},c=function(e){function t(n){var r=n.graphQLErrors,i=n.protocolErrors,a=n.clientErrors,o=n.networkError,s=n.errorMessage,c=n.extraInfo,l=e.call(this,s)||this;return l.name="ApolloError",l.graphQLErrors=r||[],l.protocolErrors=i||[],l.clientErrors=a||[],l.networkError=o||null,l.message=s||u(l),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,r.ZT)(t,e),t}(Error)},85317(e,t,n){"use strict";n.d(t,{K:()=>a});var r=n(67294),i=n(30320).aS?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function a(){var e=r.createContext[i];return e||(Object.defineProperty(r.createContext,i,{value:e=r.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},21436(e,t,n){"use strict";n.d(t,{O:()=>i,k:()=>r});var r=Array.isArray;function i(e){return Array.isArray(e)&&e.length>0}},30320(e,t,n){"use strict";n.d(t,{DN:()=>s,JC:()=>l,aS:()=>o,mr:()=>i,sy:()=>a});var r=n(83952),i="function"==typeof WeakMap&&"ReactNative"!==(0,r.wY)(function(){return navigator.product}),a="function"==typeof WeakSet,o="function"==typeof Symbol&&"function"==typeof Symbol.for,s=o&&Symbol.asyncIterator,u="function"==typeof(0,r.wY)(function(){return window.document.createElement}),c=(0,r.wY)(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,l=u&&!c},53712(e,t,n){"use strict";function r(){for(var e=[],t=0;tr})},10542(e,t,n){"use strict";n.d(t,{J:()=>o}),n(83952);var r=n(13154);function i(e){var t=new Set([e]);return t.forEach(function(e){(0,r.s)(e)&&a(e)===e&&Object.getOwnPropertyNames(e).forEach(function(n){(0,r.s)(e[n])&&t.add(e[n])})}),e}function a(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function o(e){return __DEV__&&i(e),e}},14012(e,t,n){"use strict";n.d(t,{J:()=>a});var r=n(70655),i=n(53712);function a(e,t){return(0,i.o)(e,t,t.variables&&{variables:(0,r.pi)((0,r.pi)({},e&&e.variables),t.variables)})}},13154(e,t,n){"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,{s:()=>r})},83952(e,t,n){"use strict";n.d(t,{ej:()=>u,kG:()=>c,wY:()=>h});var r,i=n(70655),a="Invariant Violation",o=Object.setPrototypeOf,s=void 0===o?function(e,t){return e.__proto__=t,e}:o,u=function(e){function t(n){void 0===n&&(n=a);var r=e.call(this,"number"==typeof n?a+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=a,s(r,t.prototype),r}return(0,i.ZT)(t,e),t}(Error);function c(e,t){if(!e)throw new u(t)}var l=["debug","log","warn","error","silent"],f=l.indexOf("log");function d(e){return function(){if(l.indexOf(e)>=f)return(console[e]||console.log).apply(console,arguments)}}function h(e){try{return e()}catch(t){}}(r=c||(c={})).debug=d("debug"),r.log=d("log"),r.warn=d("warn"),r.error=d("error");let p=h(function(){return globalThis})||h(function(){return window})||h(function(){return self})||h(function(){return global})||h(function(){return h.constructor("return this")()});var b="__",m=[b,b].join("DEV");function g(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(p,m,{value:"production"!==h(function(){return"production"}),enumerable:!1,configurable:!0,writable:!0}),p[m]}}let v=g();function y(e){try{return e()}catch(t){}}var w=y(function(){return globalThis})||y(function(){return window})||y(function(){return self})||y(function(){return global})||y(function(){return y.constructor("return this")()}),_=!1;function E(){!w||y(function(){return"production"})||y(function(){return process})||(Object.defineProperty(w,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),_=!0)}function S(){_&&(delete w.process,_=!1)}E();var k=n(10143);function x(){return k.H,S()}function T(){__DEV__?c("boolean"==typeof v,v):c("boolean"==typeof v,39)}x(),T()},4942(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},87462(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},51721(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>i})},63366(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},25821(e,t,n){"use strict";n.d(t,{Z:()=>s});var r=n(45695);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=10,o=2;function s(e){return u(e,[])}function u(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":if(null===e)return"null";return c(e,t);default:return String(e)}}function c(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=d(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:u(i,n)}else if(Array.isArray(e))return f(e,n);return l(e,n)}function l(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>o?"["+h(e)+"]":"{ "+n.map(function(n){var r=u(e[n],t);return n+": "+r}).join(", ")+" }"}function f(e,t){if(0===e.length)return"[]";if(t.length>o)return"[Array]";for(var n=Math.min(a,e.length),r=e.length-n,i=[],s=0;s1&&i.push("... ".concat(r," more items")),"["+i.join(", ")+"]"}function d(e){var t=e[String(r.Z)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}function h(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}},45695(e,t,n){"use strict";n.d(t,{Z:()=>i});var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;let i=r},25217(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw Error(null!=t?t:"Unexpected invariant triggered.")}n.d(t,{Ye:()=>o,WU:()=>s,UG:()=>u});var i=n(45695);function a(e){var t=e.prototype.toJSON;"function"==typeof t||r(0),e.prototype.inspect=t,i.Z&&(e.prototype[i.Z]=t)}var o=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();a(o);var s=function(){function e(e,t,n,r,i,a,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function u(e){return null!=e&&"string"==typeof e.kind}a(s)},87392(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=a(e);if(0!==n)for(var r=1;ro&&i(t[s-1]);)--s;return t.slice(o,s).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||" "===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!r||a||o||n,u="";return s&&!(r&&i)&&(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}n.d(t,{LZ:()=>o,W7:()=>r})},97359(e,t,n){"use strict";n.d(t,{h:()=>r});var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"})},10143(e,t,n){"use strict";n.d(t,{H:()=>c,T:()=>l});var r=n(99763),i=n(25821);function a(e,t){if(!Boolean(e))throw Error(t)}let o=function(e,t){return e instanceof t};function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||a(0,"Body must be a string. Received: ".concat((0,i.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||a(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||a(0,"column in locationOffset is 1-indexed and must be positive.")}return u(e,[{key:r.YF,get:function(){return"Source"}}]),e}();function l(e){return o(e,c)}},99763(e,t,n){"use strict";n.d(t,{YF:()=>r});var r="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"},37452(e){"use strict";e.exports=JSON.parse('{"AElig":"\xc6","AMP":"&","Aacute":"\xc1","Acirc":"\xc2","Agrave":"\xc0","Aring":"\xc5","Atilde":"\xc3","Auml":"\xc4","COPY":"\xa9","Ccedil":"\xc7","ETH":"\xd0","Eacute":"\xc9","Ecirc":"\xca","Egrave":"\xc8","Euml":"\xcb","GT":">","Iacute":"\xcd","Icirc":"\xce","Igrave":"\xcc","Iuml":"\xcf","LT":"<","Ntilde":"\xd1","Oacute":"\xd3","Ocirc":"\xd4","Ograve":"\xd2","Oslash":"\xd8","Otilde":"\xd5","Ouml":"\xd6","QUOT":"\\"","REG":"\xae","THORN":"\xde","Uacute":"\xda","Ucirc":"\xdb","Ugrave":"\xd9","Uuml":"\xdc","Yacute":"\xdd","aacute":"\xe1","acirc":"\xe2","acute":"\xb4","aelig":"\xe6","agrave":"\xe0","amp":"&","aring":"\xe5","atilde":"\xe3","auml":"\xe4","brvbar":"\xa6","ccedil":"\xe7","cedil":"\xb8","cent":"\xa2","copy":"\xa9","curren":"\xa4","deg":"\xb0","divide":"\xf7","eacute":"\xe9","ecirc":"\xea","egrave":"\xe8","eth":"\xf0","euml":"\xeb","frac12":"\xbd","frac14":"\xbc","frac34":"\xbe","gt":">","iacute":"\xed","icirc":"\xee","iexcl":"\xa1","igrave":"\xec","iquest":"\xbf","iuml":"\xef","laquo":"\xab","lt":"<","macr":"\xaf","micro":"\xb5","middot":"\xb7","nbsp":"\xa0","not":"\xac","ntilde":"\xf1","oacute":"\xf3","ocirc":"\xf4","ograve":"\xf2","ordf":"\xaa","ordm":"\xba","oslash":"\xf8","otilde":"\xf5","ouml":"\xf6","para":"\xb6","plusmn":"\xb1","pound":"\xa3","quot":"\\"","raquo":"\xbb","reg":"\xae","sect":"\xa7","shy":"\xad","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","szlig":"\xdf","thorn":"\xfe","times":"\xd7","uacute":"\xfa","ucirc":"\xfb","ugrave":"\xf9","uml":"\xa8","uuml":"\xfc","yacute":"\xfd","yen":"\xa5","yuml":"\xff"}')},93580(e){"use strict";e.exports=JSON.parse('{"0":"�","128":"€","130":"‚","131":"ƒ","132":"„","133":"…","134":"†","135":"‡","136":"ˆ","137":"‰","138":"Š","139":"‹","140":"Œ","142":"Ž","145":"‘","146":"’","147":"“","148":"”","149":"•","150":"–","151":"—","152":"˜","153":"™","154":"š","155":"›","156":"œ","158":"ž","159":"Ÿ"}')},67946(e){"use strict";e.exports=JSON.parse('{"locale":"en","long":{"year":{"previous":"last year","current":"this year","next":"next year","past":{"one":"{0} year ago","other":"{0} years ago"},"future":{"one":"in {0} year","other":"in {0} years"}},"quarter":{"previous":"last quarter","current":"this quarter","next":"next quarter","past":{"one":"{0} quarter ago","other":"{0} quarters ago"},"future":{"one":"in {0} quarter","other":"in {0} quarters"}},"month":{"previous":"last month","current":"this month","next":"next month","past":{"one":"{0} month ago","other":"{0} months ago"},"future":{"one":"in {0} month","other":"in {0} months"}},"week":{"previous":"last week","current":"this week","next":"next week","past":{"one":"{0} week ago","other":"{0} weeks ago"},"future":{"one":"in {0} week","other":"in {0} weeks"}},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":{"one":"{0} hour ago","other":"{0} hours ago"},"future":{"one":"in {0} hour","other":"in {0} hours"}},"minute":{"current":"this minute","past":{"one":"{0} minute ago","other":"{0} minutes ago"},"future":{"one":"in {0} minute","other":"in {0} minutes"}},"second":{"current":"now","past":{"one":"{0} second ago","other":"{0} seconds ago"},"future":{"one":"in {0} second","other":"in {0} seconds"}}},"short":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"narrow":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"now":{"now":{"current":"now","future":"in a moment","past":"just now"}},"mini":{"year":"{0}yr","month":"{0}mo","week":"{0}wk","day":"{0}d","hour":"{0}h","minute":"{0}m","second":"{0}s","now":"now"},"short-time":{"year":"{0} yr.","month":"{0} mo.","week":"{0} wk.","day":{"one":"{0} day","other":"{0} days"},"hour":"{0} hr.","minute":"{0} min.","second":"{0} sec."},"long-time":{"year":{"one":"{0} year","other":"{0} years"},"month":{"one":"{0} month","other":"{0} months"},"week":{"one":"{0} week","other":"{0} weeks"},"day":{"one":"{0} day","other":"{0} days"},"hour":{"one":"{0} hour","other":"{0} hours"},"minute":{"one":"{0} minute","other":"{0} minutes"},"second":{"one":"{0} second","other":"{0} seconds"}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var i=Object.create(null);__webpack_require__.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var o=2&r&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,__webpack_require__.d(i,a),i}})(),__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set(){throw Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="/assets/",__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";var e,t,n,r,i=__webpack_require__(32316),a=__webpack_require__(8126),o=__webpack_require__(5690),s=__webpack_require__(30381),u=__webpack_require__.n(s),c=__webpack_require__(67294),l=__webpack_require__(73935),f=__webpack_require__.n(l),d=__webpack_require__(57209),h=__webpack_require__(37703),p=__webpack_require__(97779),b=__webpack_require__(28500);function m(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}var g=m();g.withExtraArgument=m;let v=g;var y=__webpack_require__(76489);function w(e){return function(t){return function(n){return function(r){n(r);var i=e||document&&document.cookie||"",a=t.getState();if("MATCH_ROUTE"===r.type&&"/signin"!==a.notifications.currentUrl){var o=(0,y.Q)(i);if(o.explorer)try{var s=JSON.parse(o.explorer);if("error"===s.status){var u=_(s.url);n({type:"NOTIFY_ERROR_MSG",msg:u})}}catch(c){n({type:"NOTIFY_ERROR_MSG",msg:"Invalid explorer status"})}}}}}}function _(e){var t="Can't connect to explorer: ".concat(e);return e.match(/^wss?:.+/)?t:"".concat(t,". You must use a websocket.")}var E=__webpack_require__(16353);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ei(e,t){if(e){if("string"==typeof e)return ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,t)}}function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1,i=!1,a=arguments[1],o=a;return new n(function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(s){return n.error(s)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),o()}});i.push(s)},error:function(e){r.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})},t[ed]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw TypeError(t+" is not an object");var r=ep(t,ed);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+" is not an object");return em(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(ec("iterator")&&(r=ep(t,ef)))return new n(function(e){ev(function(){if(!e.closed){for(var n,i=er(r.call(t));!(n=i()).done;){var a=n.value;if(e.next(a),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){ev(function(){if(!e.closed){for(var n=0;n0))return n.connection.key;var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(e){i[e]=t[e]}),"".concat(n.connection.key,"(").concat(eV(i),")")}var a=e;if(t){var o=eV(t);a+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(e){-1===eW.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@".concat(e,"(").concat(eV(n[e]),")"):a+="@".concat(e))}),a},{setStringify:function(e){var t=eV;return eV=e,t}}),eV=function(e){return JSON.stringify(e,eq)};function eq(e,t){return(0,eO.s)(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})),t}function eZ(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r;return ez(n,e.name,e.value,t)}),n}return null}function eX(e){return e.alias?e.alias.value:e.name.value}function eJ(e,t,n){for(var r,i=0,a=t.selections;it.indexOf(i))throw __DEV__?new Q.ej("illegal argument: ".concat(i)):new Q.ej(27)}return e}function tt(e,t){return t?t(e):eT.of()}function tn(e){return"function"==typeof e?new ta(e):e}function tr(e){return e.request.length<=1}var ti=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return(0,en.ZT)(t,e),t}(Error),ta=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return eT.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(tn).reduce(function(e,t){return e.concat(t)})},e.split=function(t,n,r){var i=tn(n),a=tn(r||new e(tt));return new e(tr(i)&&tr(a)?function(e){return t(e)?i.request(e)||eT.of():a.request(e)||eT.of()}:function(e,n){return t(e)?i.request(e,n)||eT.of():a.request(e,n)||eT.of()})},e.execute=function(e,t){return e.request(eM(t.context,e7(te(t))))||eT.of()},e.concat=function(t,n){var r=tn(t);if(tr(r))return __DEV__&&Q.kG.warn(new ti("You are calling concat on a terminating link, which will have no effect",r)),r;var i=tn(n);return new e(tr(i)?function(e){return r.request(e,function(e){return i.request(e)||eT.of()})||eT.of()}:function(e,t){return r.request(e,function(e){return i.request(e,t)||eT.of()})||eT.of()})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(tt)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new Q.ej("request is not implemented"):new Q.ej(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),to=__webpack_require__(25821),ts=__webpack_require__(25217),tu={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tc=Object.freeze({});function tl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tu,r=void 0,i=Array.isArray(e),a=[e],o=-1,s=[],u=void 0,c=void 0,l=void 0,f=[],d=[],h=e;do{var p,b=++o===a.length,m=b&&0!==s.length;if(b){if(c=0===d.length?void 0:f[f.length-1],u=l,l=d.pop(),m){if(i)u=u.slice();else{for(var g={},v=0,y=Object.keys(u);v1)for(var r=new tB,i=1;i=0;--a){var o=i[a],s=isNaN(+o)?{}:[];s[o]=t,t=s}n=r.merge(n,t)}),n}var tW=Object.prototype.hasOwnProperty;function tK(e,t){var n,r,i,a,o;return(0,en.mG)(this,void 0,void 0,function(){var s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;return(0,en.Jh)(this,function(L){switch(L.label){case 0:if(void 0===TextDecoder)throw Error("TextDecoder must be defined in the environment: please import a polyfill.");s=new TextDecoder("utf-8"),u=null===(n=e.headers)||void 0===n?void 0:n.get("content-type"),c="boundary=",l=(null==u?void 0:u.includes(c))?null==u?void 0:u.substring((null==u?void 0:u.indexOf(c))+c.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",f="\r\n--".concat(l),d="",h=tI(e),p=!0,L.label=1;case 1:if(!p)return[3,3];return[4,h.next()];case 2:for(m=(b=L.sent()).value,g=b.done,v="string"==typeof m?m:s.decode(m),y=d.length-f.length+1,p=!g,d+=v,w=d.indexOf(f,y);w>-1;){if(_=void 0,_=(O=[d.slice(0,w),d.slice(w+f.length),])[0],d=O[1],E=_.indexOf("\r\n\r\n"),(k=(S=tV(_.slice(0,E)))["content-type"])&&-1===k.toLowerCase().indexOf("application/json"))throw Error("Unsupported patch content type: application/json is required.");if(x=_.slice(E))try{T=tq(e,x),Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T||"payload"in T?tz(T)?(M={},"payload"in T&&(M=(0,en.pi)({},T.payload)),"errors"in T&&(M=(0,en.pi)((0,en.pi)({},M),{extensions:(0,en.pi)((0,en.pi)({},"extensions"in M?M.extensions:null),((A={})[tN.YG]=T.errors,A))})),null===(r=t.next)||void 0===r||r.call(t,M)):null===(i=t.next)||void 0===i||i.call(t,T):1===Object.keys(T).length&&"hasNext"in T&&!T.hasNext&&(null===(a=t.complete)||void 0===a||a.call(t))}catch(C){tZ(C,t)}w=d.indexOf(f)}return[3,1];case 3:return null===(o=t.complete)||void 0===o||o.call(t),[2]}})})}function tV(e){var t={};return e.split("\n").forEach(function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}}),t}function tq(e,t){e.status>=300&&tD(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function tZ(e,t){var n,r;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(n=t.next)||void 0===n||n.call(t,e.result)),null===(r=t.error)||void 0===r||r.call(t,e))}function tX(e,t,n){tJ(t)(e).then(function(e){var t,r;null===(t=n.next)||void 0===t||t.call(n,e),null===(r=n.complete)||void 0===r||r.call(n)}).catch(function(e){return tZ(e,n)})}function tJ(e){return function(t){return t.text().then(function(e){return tq(t,e)}).then(function(n){return t.status>=300&&tD(t,n,"Response not successful: Received status code ".concat(t.status)),Array.isArray(n)||tW.call(n,"data")||tW.call(n,"errors")||tD(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName,"'.")),n})}}var tQ=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new Q.ej("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new Q.ej(23)},t1=__webpack_require__(87392);function t0(e){return tl(e,{leave:t3})}var t2=80,t3={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return t6(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=t8("(",t6(e.variableDefinitions,", "),")"),i=t6(e.directives," "),a=e.selectionSet;return n||i||r||"query"!==t?t6([t,t6([n,r]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+t8(" = ",r)+t8(" ",t6(i," "))},SelectionSet:function(e){return t5(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,a=e.selectionSet,o=t8("",t,": ")+n,s=o+t8("(",t6(r,", "),")");return s.length>t2&&(s=o+t8("(\n",t9(t6(r,"\n")),"\n)")),t6([s,t6(i," "),a]," ")},Argument:function(e){var t;return e.name+": "+e.value},FragmentSpread:function(e){var t;return"..."+e.name+t8(" ",t6(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return t6(["...",t8("on ",t),t6(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(t8("(",t6(r,", "),")")," ")+"on ".concat(n," ").concat(t8("",t6(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?(0,t1.LZ)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+t6(e.values,", ")+"]"},ObjectValue:function(e){return"{"+t6(e.fields,", ")+"}"},ObjectField:function(e){var t;return e.name+": "+e.value},Directive:function(e){var t;return"@"+e.name+t8("(",t6(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:t4(function(e){var t=e.directives,n=e.operationTypes;return t6(["schema",t6(t," "),t5(n)]," ")}),OperationTypeDefinition:function(e){var t;return e.operation+": "+e.type},ScalarTypeDefinition:t4(function(e){var t;return t6(["scalar",e.name,t6(e.directives," ")]," ")}),ObjectTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),FieldDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+": "+r+t8(" ",t6(i," "))}),InputValueDefinition:t4(function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return t6([t+": "+n,t8("= ",r),t6(i," ")]," ")}),InterfaceTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),UnionTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.types;return t6(["union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")}),EnumTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.values;return t6(["enum",t,t6(n," "),t5(r)]," ")}),EnumValueDefinition:t4(function(e){var t;return t6([e.name,t6(e.directives," ")]," ")}),InputObjectTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["input",t,t6(n," "),t5(r)]," ")}),DirectiveDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+(r?" repeatable":"")+" on "+t6(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return t6(["extend schema",t6(t," "),t5(n)]," ")},ScalarTypeExtension:function(e){var t;return t6(["extend scalar",e.name,t6(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return t6(["extend union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return t6(["extend enum",t,t6(n," "),t5(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["extend input",t,t6(n," "),t5(r)]," ")}};function t4(e){return function(t){return t6([t.description,e(t)],"\n")}}function t6(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function t5(e){return t8("{\n",t9(t6(e,"\n")),"\n}")}function t8(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function t9(e){return t8(" ",e.replace(/\n/g,"\n "))}function t7(e){return -1!==e.indexOf("\n")}function ne(e){return null!=e&&e.some(t7)}var nt,nn,nr,ni={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},na=function(e,t){return t(e)};function no(e,t){for(var n=[],r=2;rObject.create(null),{forEach:nv,slice:ny}=Array.prototype,{hasOwnProperty:nw}=Object.prototype;class n_{constructor(e=!0,t=ng){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nv.call(e,e=>t=t.getChildTrie(e)),nw.call(t,"data")?t.data:t.data=this.makeData(ny.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n=0;--o)t.definitions[o].kind===nL.h.OPERATION_DEFINITION&&++a;var s=nN(e),u=e.some(function(e){return e.remove}),c=function(e){return u&&e&&e.some(s)},l=new Map,f=!1,d={enter:function(e){if(c(e.directives))return f=!0,null}},h=tl(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,a){var o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,a){if(c(e.directives))return f=!0,null;var o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(function(e){return e.kind===nL.h.FIELD&&"__typename"===e.name.value})?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(s(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){p(r(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})})),e},b=new Set;h.definitions.forEach(function(e){e.kind===nL.h.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){b.add(e)}):e.kind!==nL.h.FRAGMENT_DEFINITION||0!==a||r(e.name.value).removed||b.add(e.name.value)}),b.forEach(function(e){p(r(e)).fragmentSpreads.forEach(function(e){b.add(e)})});var m=function(e){return!!(!b.has(e)||r(e).removed)},g={enter:function(e){if(m(e.name.value))return null}};return nD(tl(h,{FragmentSpread:g,FragmentDefinition:g,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(eT);function n4(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return(this.nextFetchPolicy=r,"function"==typeof r)?r.apply(this,arguments):n}}):e.reobserve()}function n6(e){__DEV__&&Q.kG.error("Unhandled error",e.message,e.stack)}function n5(e){__DEV__&&e&&__DEV__&&Q.kG.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function n8(e){return"network-only"===e||"no-cache"===e||"standby"===e}nK(n3);function n9(e){return e.kind===nL.h.FIELD||e.kind===nL.h.FRAGMENT_SPREAD||e.kind===nL.h.INLINE_FRAGMENT}function n7(e){return e.kind===Kind.SCALAR_TYPE_DEFINITION||e.kind===Kind.OBJECT_TYPE_DEFINITION||e.kind===Kind.INTERFACE_TYPE_DEFINITION||e.kind===Kind.UNION_TYPE_DEFINITION||e.kind===Kind.ENUM_TYPE_DEFINITION||e.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function re(e){return e.kind===Kind.SCALAR_TYPE_EXTENSION||e.kind===Kind.OBJECT_TYPE_EXTENSION||e.kind===Kind.INTERFACE_TYPE_EXTENSION||e.kind===Kind.UNION_TYPE_EXTENSION||e.kind===Kind.ENUM_TYPE_EXTENSION||e.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}var rt=function(){return Object.create(null)},rn=Array.prototype,rr=rn.forEach,ri=rn.slice,ra=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=rt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tclass{constructor(){this.id=["slot",rc++,Date.now(),Math.random().toString(36).slice(2),].join(":")}hasValue(){for(let e=rs;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===ru)break;return e!==rs&&(rs.slots[this.id]=t),!0}return rs&&(rs.slots[this.id]=ru),!1}getValue(){if(this.hasValue())return rs.slots[this.id]}withValue(e,t,n,r){let i={__proto__:null,[this.id]:e},a=rs;rs={parent:a,slots:i};try{return t.apply(r,n)}finally{rs=a}}static bind(e){let t=rs;return function(){let n=rs;try{return rs=t,e.apply(this,arguments)}finally{rs=n}}}static noContext(e,t,n){if(!rs)return e.apply(n,t);{let r=rs;try{return rs=null,e.apply(n,t)}finally{rs=r}}}};function rf(e){try{return e()}catch(t){}}let rd="@wry/context:Slot",rh=rf(()=>globalThis)||rf(()=>global)||Object.create(null),rp=rh,rb=rp[rd]||Array[rd]||function(e){try{Object.defineProperty(rp,rd,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(rl()),{bind:rm,noContext:rg}=rb;function rv(){}var ry=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=rv),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),rw=new rb,r_=Object.prototype.hasOwnProperty,rE=void 0===(n=Array.from)?function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t}:n;function rS(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var rk=[],rx=100;function rT(e,t){if(!e)throw Error(t||"assertion failure")}function rM(e,t){var n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function rO(e){switch(e.length){case 0:throw Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function rA(e){return e.slice(0)}var rL=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!rN(this))return rC(this),this.value[0]},e.prototype.recompute=function(e){return rT(!this.recomputing,"already recomputing"),rC(this),rN(this)?rI(this,e):rO(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,rR(this),rS(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),rH(this),rF(this,function(t,n){t.setDirty(),r$(t,e)})},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=rk.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(rE(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),rk.push(this.deps),this.deps=null)},e.count=0,e}();function rC(e){var t=rw.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),rN(e)?rY(t,e):rB(t,e),t}function rI(e,t){return rH(e),rw.withValue(e,rD,[e,t]),rz(e,t)&&rP(e),rO(e.value)}function rD(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(n){e.value[1]=n}e.recomputing=!1}function rN(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function rP(e){e.dirty=!1,!rN(e)&&rj(e)}function rR(e){rF(e,rY)}function rj(e){rF(e,rB)}function rF(e,t){var n=e.parents.size;if(n)for(var r=rE(e.parents),i=0;i0&&e.childValues.forEach(function(t,n){r$(e,n)}),e.forgetDeps(),rT(null===e.dirtyChildren)}function r$(e,t){t.parents.delete(e),e.childValues.delete(t),rU(e,t)}function rz(e,t){if("function"==typeof e.subscribe)try{rS(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(n){return e.setDirty(),!1}return!0}var rG={setDirty:!0,dispose:!0,forget:!0};function rW(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=rw.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(rS(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&r_.call(rG,n)?n:"setDirty";rE(r).forEach(function(e){return e[i]()}),t.delete(e),rS(r)}},r}function rK(){var e=new ra("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}var rV=rK(),rq=new Set;function rZ(e,t){void 0===t&&(t=Object.create(null));var n=new ry(t.max||65536,function(e){return e.dispose()}),r=t.keyArgs,i=t.makeCacheKey||rK(),a=function(){var a=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=n.get(a);o||(n.set(a,o=new rL(e)),o.subscribe=t.subscribe,o.forget=function(){return n.delete(a)});var s=o.recompute(Array.prototype.slice.call(arguments));return n.set(a,o),rq.add(n),rw.hasValue()||(rq.forEach(function(e){return e.clean()}),rq.clear()),s};function o(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function u(e){return n.delete(e)}return Object.defineProperty(a,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))},a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))},a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(a)}var rX=new rb,rJ=new WeakMap;function rQ(e){var t=rJ.get(e);return t||rJ.set(e,t={vars:new Set,dep:rW()}),t}function r1(e){rQ(e).vars.forEach(function(t){return t.forgetCache(e)})}function r0(e){rQ(e).vars.forEach(function(t){return t.attachCache(e)})}function r2(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){rQ(e).dep.dirty(r),r3(e)});var o=Array.from(n);n.clear(),o.forEach(function(t){return t(e)})}}else{var s=rX.getValue();s&&(i(s),rQ(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),rQ(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function r3(e){e.broadcastWatches&&e.broadcastWatches()}var r4=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=tj(t.resolvers,e)}):this.resolvers=tj(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then(function(e){return(0,en.pi)((0,en.pi)({},n),{data:e.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return tb(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return n$(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,en.pi)((0,en.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(e){return(0,en.pi)((0,en.pi)({},t),e.exportedVariables)})]:[2,(0,en.pi)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return tl(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return tc}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:nH(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,a){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),(0,en.mG)(this,void 0,void 0,function(){var o,s,u,c,l,f,d,h,p,b,m;return(0,en.Jh)(this,function(g){return o=e8(e),s=e4(e),u=eL(s),c=this.collectSelectionsToResolve(o,u),f=(l=o.operation)?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=this,h=d.cache,p=d.client,b={fragmentMap:u,context:(0,en.pi)((0,en.pi)({},n),{cache:h,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:f,exportedVariables:{},selectionsToResolve:c,onlyRunForcedResolvers:a},m=!1,[2,this.resolveSelectionSet(o.selectionSet,m,t,b).then(function(e){return{result:e,exportedVariables:b.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c=this;return(0,en.Jh)(this,function(l){return i=r.fragmentMap,a=r.context,o=r.variables,s=[n],u=function(e){return(0,en.mG)(c,void 0,void 0,function(){var u,c;return(0,en.Jh)(this,function(l){return(t||r.selectionsToResolve.has(e))&&td(e,o)?eQ(e)?[2,this.resolveField(e,t,n,r).then(function(t){var n;void 0!==t&&s.push(((n={})[eX(e)]=t,n))})]:(e1(e)?u=e:(u=i[e.name.value],__DEV__?(0,Q.kG)(u,"No fragment named ".concat(e.name.value)):(0,Q.kG)(u,11)),u&&u.typeCondition&&(c=u.typeCondition.name.value,r.fragmentMatcher(n,c,a)))?[2,this.resolveSelectionSet(u.selectionSet,t,n,r).then(function(e){s.push(e)})]:[2]:[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return tF(s)})]})})},e.prototype.resolveField=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c,l,f,d,h=this;return(0,en.Jh)(this,function(p){return n?(i=r.variables,a=e.name.value,o=eX(e),s=a!==o,c=Promise.resolve(u=n[o]||n[a]),(!r.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(l=n.__typename||r.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(d=f[s?a:o])&&(c=Promise.resolve(rX.withValue(this.cache,d,[n,eZ(e,i),r.context,{field:e,fragmentMap:r.fragmentMap},])))),[2,c.then(function(n){if(void 0===n&&(n=u),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)})}),!e.selectionSet||null==n)return n;var i,a,o=null!==(a=null===(i=e.directives)||void 0===i?void 0:i.some(function(e){return"client"===e.name.value}))&&void 0!==a&&a;return Array.isArray(n)?h.resolveSubSelectedArray(e,t||o,n,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t||o,n,r):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map(function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;function i(e){if(!r.has(e)){var a=new Set;r.set(e,a),tl(e,{Directive:function(e,t,r,i,o){"client"===e.name.value&&o.forEach(function(e){n(e)&&n9(e)&&a.add(e)})},FragmentSpread:function(e,r,o,s,u){var c=t[e.name.value];__DEV__?(0,Q.kG)(c,"No fragment named ".concat(e.name.value)):(0,Q.kG)(c,12);var l=i(c);l.size>0&&(u.forEach(function(e){n(e)&&n9(e)&&a.add(e)}),a.add(e),l.forEach(function(e){a.add(e)}))}})}return r.get(e)}return i(e)},e}(),r6=new(t_.mr?WeakMap:Map);function r5(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return r6.set(e,(r6.get(e)+1)%1e15),n.apply(this,arguments)})}function r8(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var r9=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;r6.has(n)||(r6.set(n,0),r5(n,"evict"),r5(n,"modify"),r5(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||nZ.I.loading;return this.variables&&this.networkStatus!==nZ.I.loading&&!(0,nm.D)(this.variables,e.variables)&&(t=nZ.I.setVariables),(0,nm.D)(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){r8(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&(0,nm.D)(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||(0,nm.D)(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():n4(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;r8(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,nZ.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach(function(e){return e.unsubscribe()});var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=(0,en.pi)((0,en.pi)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,nm.D)(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===r6.get(this.cache)&&(0,nm.D)(t,n.variables)&&(0,nm.D)(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,a=new tB,o=(0,tP.O)(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&(0,tP.O)(e.incremental)){var s=tG(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=a.merge(u.result,e.data)}this.graphQLErrors=o,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(r7(e,n.errorPolicy)?this.cache.performTransaction(function(a){if(i.shouldWrite(e,n.variables))a.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:r6.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete){e.data=i.lastDiff.diff.result;return}var o=i.getDiffOptions(n.variables),s=a.diff(o);i.stopped||i.updateWatch(n.variables),i.updateLastDiff(s,o),s.complete&&(e.data=s.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=nZ.I.ready},e.prototype.markError=function(e){return this.networkStatus=nZ.I.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function r7(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!nO(e);return!r&&n&&e.data&&(r=!0),r}var ie=Object.prototype.hasOwnProperty,it=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,a=void 0!==i&&i,o=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(t_.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=a,this.clientAwareness=l,this.localState=f||new r4({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!d,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new Q.ej("QueryManager stopped while query was in flight"):new Q.ej(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,a=e.optimisticResponse,o=e.updateQueries,s=e.refetchQueries,u=void 0===s?[]:s,c=e.awaitRefetchQueries,l=void 0!==c&&c,f=e.update,d=e.onQueryUpdated,h=e.fetchPolicy,p=void 0===h?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":h,b=e.errorPolicy,m=void 0===b?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":b,g=e.keepRootFields,v=e.context;return(0,en.mG)(this,void 0,void 0,function(){var e,t,n,s,c,h;return(0,en.Jh)(this,function(b){switch(b.label){case 0:if(__DEV__?(0,Q.kG)(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):(0,Q.kG)(r,15),__DEV__?(0,Q.kG)("network-only"===p||"no-cache"===p,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):(0,Q.kG)("network-only"===p||"no-cache"===p,16),e=this.generateMutationId(),n=(t=this.transform(r)).document,s=t.hasClientExports,r=this.cache.transformForLink(n),i=this.getVariables(r,i),!s)return[3,2];return[4,this.localState.addExportedVariables(r,i,v)];case 1:i=b.sent(),b.label=2;case 2:return c=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,updateQueries:o,update:f,keepRootFields:g}),this.broadcastQueries(),h=this,[2,new Promise(function(t,n){return nM(h.getObservableFromLink(r,(0,en.pi)((0,en.pi)({},v),{optimisticResponse:a}),i,!1),function(t){if(nO(t)&&"none"===m)throw new tN.cA({graphQLErrors:nA(t)});c&&(c.loading=!1,c.error=null);var n=(0,en.pi)({},t);return"function"==typeof u&&(u=u(n)),"ignore"===m&&nO(n)&&delete n.errors,h.markMutationResult({mutationId:e,result:n,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,update:f,updateQueries:o,awaitRefetchQueries:l,refetchQueries:u,removeOptimistic:a?e:void 0,onQueryUpdated:d,keepRootFields:g})}).subscribe({next:function(e){h.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){c&&(c.loading=!1,c.error=t),a&&h.cache.removeOptimistic(e),h.broadcastQueries(),n(t instanceof tN.cA?t:new tN.cA({networkError:t}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&r7(r,e.errorPolicy)){if(tU(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),tU(r)&&(0,tP.O)(r.incremental)){var o=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),s=void 0;o.result&&(s=tG(o.result,r)),void 0!==s&&(r.data=s,i.push({result:s,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(e,a){var o=e.observableQuery,s=o&&o.queryName;if(s&&ie.call(u,s)){var c,l=u[s],f=n.queries.get(a),d=f.document,h=f.variables,p=t.diff({query:d,variables:h,returnPartialData:!0,optimistic:!1}),b=p.result;if(p.complete&&b){var m=l(b,{mutationResult:r,queryName:d&&e3(d)||void 0,queryVariables:h});m&&i.push({result:m,dataId:"ROOT_QUERY",query:d,variables:h})}}})}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach(function(e){return t.write(e)});var o=e.update,s=!t$(r)||tU(r)&&!r.hasNext;if(o){if(!a){var u=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&("incremental"in(r=(0,en.pi)((0,en.pi)({},r),{data:u.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}s&&o(t,r,{context:e.context,variables:e.variables})}a||e.keepRootFields||!s||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return c.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(c).then(function(){return r})}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(e){try{n.markMutationResult((0,en.pi)((0,en.pi)({},t),{result:{data:r}}),e)}catch(i){__DEV__&&Q.kG.error(i)}},t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),r=nY(n),i=this.localState.clientQuery(n),a=r&&this.localState.serverQuery(r),o={document:n,hasClientExports:tm(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:a,defaultVars:e9(e2(n)),asQuery:(0,en.pi)((0,en.pi)({},n),{definitions:n.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,en.pi)((0,en.pi)({},e),{operation:"query"}):e})})},s=function(e){e&&!t.has(e)&&t.set(e,o)};s(e),s(n),s(i),s(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,en.pi)((0,en.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,en.pi)((0,en.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new r9(this),n=new n3({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?(0,Q.kG)(e.query,"query option is required. You must specify your GraphQL document in the query option."):(0,Q.kG)(e.query,17),__DEV__?(0,Q.kG)("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):(0,Q.kG)("Document"===e.query.kind,18),__DEV__?(0,Q.kG)(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):(0,Q.kG)(!e.returnPartialData,19),__DEV__?(0,Q.kG)(!e.pollInterval,"pollInterval option only supported on watchQuery."):(0,Q.kG)(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Q.ej("Store reset while query was in flight (not completed in link chain)"):new Q.ej(21)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=nZ.I.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach(function(e){"string"==typeof e?r.set(e,!1):eN(e)?r.set(t.transform(e).document,!1):(0,eO.s)(e)&&e.query&&i.add(e)}),this.queries.forEach(function(t,i){var a=t.observableQuery,o=t.document;if(a){if("all"===e){n.set(i,a);return}var s=a.queryName;if("standby"===a.options.fetchPolicy||"active"===e&&!a.hasObservers())return;("active"===e||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}}),i.size&&i.forEach(function(e){var r=nG("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new n3({queryManager:t,queryInfo:i,options:(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"network-only"})});(0,Q.kG)(a.queryId===r),i.setObservableQuery(a),n.set(r,a)}),__DEV__&&r.size&&r.forEach(function(e,t){!e&&__DEV__&&Q.kG.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))}),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(r,i){var a=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==a&&"cache-only"!==a)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,a=e.variables,o=e.context,s=void 0===o?{}:o;n=this.transform(n).document,a=this.getVariables(n,a);var u=function(e){return t.getObservableFromLink(n,s,e).map(function(a){"no-cache"!==r&&(r7(a,i)&&t.cache.write({query:n,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var o=nO(a),s=(0,tN.ls)(a);if(o||s){var u={};throw o&&(u.graphQLErrors=a.errors),s&&(u.protocolErrors=a.extensions[tN.YG]),new tN.cA(u)}return a})};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,a,s).then(u);return new eT(function(e){var t=null;return c.then(function(n){return t=n.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return u(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,a,o=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this,c=u.inFlightLinkObservables,l=u.link,f={query:s,variables:n,operationName:e3(s)||void 0,context:this.prepareContext((0,en.pi)((0,en.pi)({},t),{forceFetch:!r}))};if(t=f.context,r){var d=c.get(s)||new Map;c.set(s,d);var h=nx(n);if(!(a=d.get(h))){var p=new nq([np(l,f)]);d.set(h,a=p),p.beforeNext(function(){d.delete(h)&&d.size<1&&c.delete(s)})}}else a=new nq([np(l,f)])}else a=new nq([eT.of({data:{}})]),t=this.prepareContext(t);var b=this.transform(e).clientQuery;return b&&(a=nM(a,function(e){return o.localState.runResolvers({document:b,remoteResult:e,context:t,variables:n})})),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return nM(this.getObservableFromLink(i,n.context,n.variables),function(a){var o=nA(a),s=o.length>0;if(r>=e.lastRequestId){if(s&&"none"===n.errorPolicy)throw e.markError(new tN.cA({graphQLErrors:o}));e.markResult(a,i,n,t),e.markReady()}var u={data:a.data,loading:!1,networkStatus:nZ.I.ready};return s&&"ignore"!==n.errorPolicy&&(u.errors=o,u.networkStatus=nZ.I.error),u},function(t){var n=(0,tN.MS)(t)?t:new tN.cA({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n})},e.prototype.fetchQueryObservable=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast},e.prototype.fetchConcastWithInfo=function(e,t,n){var r,i,a=this;void 0===n&&(n=nZ.I.loading);var o=this.transform(t.query).document,s=this.getVariables(o,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,d=t.errorPolicy,h=void 0===d?c&&c.errorPolicy||"none":d,p=t.returnPartialData,b=void 0!==p&&p,m=t.notifyOnNetworkStatusChange,g=void 0!==m&&m,v=t.context,y=void 0===v?{}:v,w=Object.assign({},t,{query:o,variables:s,fetchPolicy:f,errorPolicy:h,returnPartialData:b,notifyOnNetworkStatusChange:g,context:y}),_=function(e){w.variables=e;var r=a.fetchQueryByPolicy(u,w,n);return"standby"!==w.fetchPolicy&&r.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),r},E=function(){return a.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,function(e){E(),setTimeout(function(){return r.cancel(e)})}),this.transform(w.query).hasClientExports)r=new nq(this.localState.addExportedVariables(w.query,w.variables,w.context).then(_).then(function(e){return e.sources})),i=!0;else{var S=_(w.variables);i=S.fromLink,r=new nq(S.sources)}return r.promise.then(E,E),{concast:r,fromLink:i}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=void 0!==i&&i,o=e.removeOptimistic,s=void 0===o?a?nG("refetchQueries"):void 0:o,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach(function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})});var l=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof r9&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach(function(e,n){var r,i=e.oq,a=e.lastDiff,o=e.diff;if(u){if(!o){var s=i.queryInfo;s.reset(),o=s.getDiff()}r=u(i,o,a)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)}),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:n});var h=function(){return e.getDiff(a)},p=function(t,n){void 0===n&&(n=e.networkStatus||nZ.I.loading);var o=t.result;!__DEV__||c||(0,nm.D)(o,{})||n5(t.missing);var s=function(e){return eT.of((0,en.pi)({data:e,loading:(0,nZ.O)(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:l,variables:a,onlyRunForcedResolvers:!0}).then(function(e){return s(e.data||void 0)}):"none"===u&&n===nZ.I.refetch&&Array.isArray(t.missing)?s(void 0):s(o)},b="no-cache"===o?0:n===nZ.I.refetch&&"merge"!==s?1:2,m=function(){return r.getResultsFromLink(e,b,{variables:a,context:l,fetchPolicy:o,errorPolicy:u})},g=f&&"number"==typeof d&&d!==n&&(0,nZ.O)(n);switch(o){default:case"cache-first":var v=h();if(v.complete)return{fromLink:!1,sources:[p(v,e.markReady())]};if(c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-and-network":var v=h();if(v.complete||c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[p(h(),e.markReady())]};case"network-only":if(g)return{fromLink:!0,sources:[p(h()),m()]};return{fromLink:!0,sources:[m()]};case"no-cache":if(g)return{fromLink:!0,sources:[p(e.getDiff()),m(),]};return{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new r9(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,en.pi)((0,en.pi)({},t),{clientAwareness:this.clientAwareness})},e}(),ir=__webpack_require__(14012),ii=!1,ia=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.ssrMode,s=void 0!==o&&o,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,d=e.queryDeduplication,h=void 0===d||d,p=e.defaultOptions,b=e.assumeImmutableResults,m=void 0!==b&&b,g=e.resolvers,v=e.typeDefs,y=e.fragmentMatcher,w=e.name,_=e.version,E=e.link;if(E||(E=n?new nh({uri:n,credentials:r,headers:i}):ta.empty()),!a)throw __DEV__?new Q.ej("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Q.ej(9);if(this.link=E,this.cache=a,this.disableNetworkFetches=s||c>0,this.queryDeduplication=h,this.defaultOptions=p||Object.create(null),this.typeDefs=v,c&&setTimeout(function(){return t.disableNetworkFetches=!1},c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ii&&f&&__DEV__&&(ii=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var S=window.navigator,k=S&&S.userAgent,x=void 0;"string"==typeof k&&(k.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":k.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&Q.kG.log("Download the Apollo DevTools for a better development experience: "+x)}this.version=nb,this.localState=new r4({cache:a,client:this,resolvers:g,fragmentMatcher:y}),this.queryManager=new it({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:s,clientAwareness:{name:w,version:_},localState:this.localState,assumeImmutableResults:m,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,ir.J)(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&("network-only"===e.fetchPolicy||"cache-and-network"===e.fetchPolicy)&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,ir.J)(this.defaultOptions.query,e)),__DEV__?(0,Q.kG)("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):(0,Q.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,ir.J)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return np(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach(function(e,t){n.push(t),r.push(e)});var i=Promise.all(r);return i.queries=n,i.results=r,i.catch(function(e){__DEV__&&Q.kG.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))}),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),io=function(){function e(){this.getFragmentDoc=rZ(eA)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(function(){return t=e.update(n)},r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=(0,en._T)(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,a=(0,en._T)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e}(),is=function(e){function t(n,r,i,a){var o,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((o={})[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return(0,en.ZT)(t,e),t}(Error),iu=__webpack_require__(10542),ic=Object.prototype.hasOwnProperty;function il(e){return null==e}function id(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=il(r)?il(i)?void 0:{_id:i}:{id:r}),il(r)&&!il(i)&&(r=i),!il(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var ih={dataIdFromObject:id,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ip(e){return(0,n1.o)(ih,e)}function ib(e){var t=e.canonizeResults;return void 0===t?ih.canonizeResults:t}function im(e,t){return eD(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var ig=/^[_a-z][_0-9a-z]*/i;function iv(e){var t=e.match(ig);return t?t[0]:e}function iy(e,t,n){return!!(0,eO.s)(t)&&((0,tP.k)(t)?t.every(function(t){return iy(e,t,n)}):e.selections.every(function(e){if(eQ(e)&&td(e,n)){var r=eX(e);return ic.call(t,r)&&(!e.selectionSet||iy(e.selectionSet,t[r],n))}return!0}))}function iw(e){return(0,eO.s)(e)&&!eD(e)&&!(0,tP.k)(e)}function i_(){return new tB}function iE(e,t){var n=eL(e4(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var iS=Object.create(null),ik=function(){return iS},ix=Object.create(null),iT=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,iu.J)(eD(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return eD(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return eI(e);if(eD(e))return e;var r=n.policies.identify(e)[0];if(r){var i=eI(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return(0,en.pi)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),ic.call(this.data,e)){var n=this.data[e];if(n&&ic.call(n,t))return n[t]}return"__typename"===t&&ic.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof iL?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return(t&&this.group.depend(e,"__exists"),ic.call(this.data,e))?this.data[e]:this instanceof iL?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;eD(e)&&(e=e.__ref),eD(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){__DEV__?(0,Q.kG)("string"==typeof n,"store.merge expects a string ID"):(0,Q.kG)("string"==typeof n,1);var o=new tB(iI).merge(i,a);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach(function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=iv(e);t===e||r.policies.hasKeyArgs(o.__typename,t)||(s[t]=1),void 0!==o[e]||r instanceof iL||delete o[e]}}),s.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[n]===o.__typename&&delete s.__typename,Object.keys(s).forEach(function(e){return r.group.dirty(n,e)})}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,o=!0,s={DELETE:iS,INVALIDATE:ix,isReference:eD,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||eI(e)}:t,{store:n})}};if(Object.keys(r).forEach(function(u){var c=iv(u),l=r[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var d=f===ik?iS:f((0,iu.J)(l),(0,en.pi)((0,en.pi)({},s),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));d===ix?n.group.dirty(e,u):(d===iS&&(d=void 0),d!==l&&(i[u]=d,a=!0,l=d))}void 0!==l&&(o=!1)}}),a)return this.merge(e,i),o&&(this instanceof iL?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var a=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?((r={})[o]=ik,r):ik)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(ic.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof iL&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(t){ic.call(e.policies.rootTypenamesById,t)||n.push(t)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(n){e&&ic.call(e,n)||t.delete(n)}),e){var n=e.__META,r=(0,en._T)(e,["__META"]);Object.keys(r).forEach(function(e){t.merge(e,r[e])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof iL?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(r){ic.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])});var r=Object.keys(n);if(r.length){for(var i=this;i instanceof iL;)i=i.parent;r.forEach(function(e){return i.delete(e)})}return r},e.prototype.findChildRefIds=function(e){if(!ic.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach(function(e){eD(e)&&(t[e.__ref]=!0),(0,eO.s)(e)&&Object.keys(e).forEach(function(t){var n=e[t];(0,eO.s)(n)&&r.add(n)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),iM=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?rW():null,this.keyMaker=new n_(t_.mr)},e.prototype.depend=function(e,t){if(this.d){this.d(iO(e,t));var n=iv(t);n!==t&&this.d(iO(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(iO(e,t),"__exists"===t?"forget":"setDirty")},e}();function iO(e,t){return t+"#"+e}function iA(e,t){iD(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,a=t.seed,o=e.call(this,n,new iM(i))||this;return o.stump=new iC(o),o.storageTrie=new n_(t_.mr),a&&o.replace(a),o}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(iT||(iT={}));var iL=function(e){function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach(function(n){(0,nm.D)(r[n],i[n])||t.group.dirty(e,n)}):(t.group.dirty(e,"__exists"),Object.keys(i).forEach(function(n){t.group.dirty(e,n)})):t.delete(e)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,en.pi)((0,en.pi)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ic.call(this.data,t)?(0,en.pi)((0,en.pi)({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(iT),iC=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,function(){},new iM(t.group.caching,t.group))||this}return(0,en.ZT)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(iL);function iI(e,t,n){var r=e[n],i=t[n];return(0,nm.D)(r,i)?r:i}function iD(e){return!!(e instanceof iT&&e.group.caching)}function iN(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults,]}var iP=function(){function e(e){var t=this;this.knownResults=new(t_.mr?WeakMap:Map),this.config=(0,n1.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:ib(e)}),this.canon=e.canon||new nk,this.executeSelectionSet=rZ(function(e){var n,r=e.context.canonizeResults,i=iN(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?(0,en.pi)((0,en.pi)({},a),{result:t.canon.admit(a.result)}):a:(iA(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize,keyArgs:iN,makeCacheKey:function(e,t,n,r){if(iD(n.store))return n.store.makeCacheKey(e,eD(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=rZ(function(e){return iA(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(iD(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new nk},e.prototype.diffQueryAgainstStore=function(e){var t,n=e.store,r=e.query,i=e.rootId,a=void 0===i?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;o=(0,en.pi)((0,en.pi)({},e9(e6(r))),o);var d=eI(a),h=this.executeSelectionSet({selectionSet:e8(r).selectionSet,objectOrReference:d,enclosingRef:d,context:(0,en.pi)({store:n,query:r,policies:f,variables:o,varString:nx(o),canonizeResults:l},iE(r,this.config.fragments))});if(h.missing&&(t=[new is(iR(h.missing),h.missing,r,o)],!u))throw t[0];return{result:h.result,complete:!t,missing:t}},e.prototype.isFresh=function(e,t,n,r){if(iD(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t,n=this,r=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(eD(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store.getFieldValue(i,"__typename"),l=[],f=new tB;function d(e,n){var r;return e.missing&&(t=f.merge(t,((r={})[n]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof c&&!u.rootIdsByTypename[c]&&l.push({__typename:c});var h=new Set(r.selections);h.forEach(function(e){var r,p;if(td(e,s)){if(eQ(e)){var b=u.readField({fieldName:e.name.value,field:e,variables:o.variables,from:i},o),m=eX(e);void 0===b?nj.added(e)||(t=f.merge(t,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(eD(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),r))):(0,tP.k)(b)?b=d(n.executeSubSelectedArray({field:e,array:b,enclosingRef:a,context:o}),m):e.selectionSet?null!=b&&(b=d(n.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:b,enclosingRef:eD(b)?b:a,context:o}),m)):o.canonizeResults&&(b=n.canon.pass(b)),void 0!==b&&l.push(((p={})[m]=b,p))}else{var g=eC(e,o.lookupFragment);if(!g&&e.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(e.name.value)):new Q.ej(5);g&&u.fragmentMatches(g,c)&&g.selectionSet.selections.forEach(h.add,h)}}});var p={result:tF(l),missing:t},b=o.canonizeResults?this.canon.admit(p):(0,iu.J)(p);return b.result&&this.knownResults.set(b.result,r),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context,s=new tB;function u(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(e,t){return null===e?null:(0,tP.k)(e)?u(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:o}),t):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:eD(e)?e:a,context:o}),t):(__DEV__&&ij(o.store,r,e),e)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function iR(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(t){return t}}function ij(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach(function(n){(0,eO.s)(n)&&(__DEV__?(0,Q.kG)(!eD(n),"Missing selection set for object of type ".concat(im(e,n)," returned for query field ").concat(t.name.value)):(0,Q.kG)(!eD(n),6),Object.values(n).forEach(r.add,r))})}}function iF(e){var t=nG("stringifyForDisplay");return JSON.stringify(e,function(e,n){return void 0===n?t:n}).split(JSON.stringify(t)).join("")}var iY=Object.create(null);function iB(e){var t=JSON.stringify(e);return iY[t]||(iY[t]=Object.create(null))}function iU(e){var t=iB(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=i$(e,function(e){var i=iW(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&ic.call(t,e[0])&&(i=iW(t,e,iG)),__DEV__?(0,Q.kG)(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):(0,Q.kG)(void 0!==i,2),i});return"".concat(n.typename,":").concat(JSON.stringify(i))})}function iH(e){var t=iB(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=JSON.stringify(i$(e,function(e){var n=e[0],a=n.charAt(0);if("@"===a){if(r&&(0,tP.O)(r.directives)){var o=n.slice(1),s=r.directives.find(function(e){return e.name.value===o}),u=s&&eZ(s,i);return u&&iW(u,e.slice(1))}return}if("$"===a){var c=n.slice(1);if(i&&ic.call(i,c)){var l=e.slice(0);return l[0]=c,iW(i,l)}return}if(t)return iW(t,e)}));return(t||"{}"!==o)&&(a+=":"+o),a})}function i$(e,t){var n=new tB;return iz(e).reduce(function(e,r){var i,a=t(r);if(void 0!==a){for(var o=r.length-1;o>=0;--o)a=((i={})[r[o]]=a,i);e=n.merge(e,a)}return e},Object.create(null))}function iz(e){var t=iB(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach(function(t,i){(0,tP.k)(t)?(iz(t).forEach(function(e){return n.push(r.concat(e))}),r.length=0):(r.push(t),(0,tP.k)(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function iG(e,t){return e[t]}function iW(e,t,n){return n=n||iG,iK(t.reduce(function e(t,r){return(0,tP.k)(t)?t.map(function(t){return e(t,r)}):t&&n(t,r)},e))}function iK(e){return(0,eO.s)(e)?(0,tP.k)(e)?e.map(iK):i$(Object.keys(e).sort(),function(t){return iW(e,t)}):e}function iV(e){return void 0!==e.args?e.args:e.field?eZ(e.field,e.variables):null}eK.setStringify(nx);var iq=function(){},iZ=function(e,t){return t.fieldName},iX=function(e,t,n){return(0,n.mergeObjects)(e,t)},iJ=function(e,t){return t},iQ=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,en.pi)({dataIdFromObject:id},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r,i=this,a=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=(0,en.pi)((0,en.pi)({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var e=i0(arguments,o);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),u=a&&this.getTypePolicy(a),c=u&&u.keyFn||this.config.dataIdFromObject;c;){var l=c((0,en.pi)((0,en.pi)({},e),o),s);if((0,tP.k)(l))c=iU(l);else{r=l;break}}return r=r?String(r):void 0,s.keyObject?[r,s.keyObject]:[r]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=(0,en._T)(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),ic.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]})},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?iX:!1===t?iJ:e.merge}o(r,t.merge),r.keyFn=!1===i?iq:(0,tP.k)(i)?iU(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?iZ:(0,tP.k)(s)?iH(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),o(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||iZ)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?(0,Q.kG)(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):(0,Q.kG)(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(ig);r&&r[0]===e||t.fuzzySubtypes.set(e,RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!ic.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),i=r.fields;Object.assign(n,(0,en._T)(r,["fields"])),Object.assign(n.fields,i)})}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach(function(n){t.updateTypePolicy(e,n)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&0>s.indexOf(t)&&s.push(t)},c=!!(n&&this.fuzzySubtypes.size),l=!1,f=0;f1?a:t}:(r=(0,en.pi)({},i),ic.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Q.kG.warn("Undefined 'from' passed to readField with arguments ".concat(iF(Array.from(e)))),void 0===r.variables&&(r.variables=n),r}function i2(e){return function(t,n){if((0,tP.k)(t)||(0,tP.k)(n))throw __DEV__?new Q.ej("Cannot automatically merge arrays"):new Q.ej(4);if((0,eO.s)(t)&&(0,eO.s)(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(eD(t)&&iw(n))return e.merge(t.__ref,n),t;if(iw(t)&&eD(n))return e.merge(t,n.__ref),n;if(iw(t)&&iw(n))return(0,en.pi)((0,en.pi)({},t),n)}return n}}function i3(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:(0,en.pi)((0,en.pi)({},e),{clientOnly:t,deferred:n})),i}var i4=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,u=e2(r),c=i_();o=(0,en.pi)((0,en.pi)({},e9(u)),o);var l=(0,en.pi)((0,en.pi)({store:e,written:Object.create(null),merge:function(e,t){return c.merge(e,t)},variables:o,varString:nx(o)},iE(r,this.fragments)),{overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:l});if(!eD(f))throw __DEV__?new Q.ej("Could not identify object ".concat(JSON.stringify(i))):new Q.ej(7);return l.incomingById.forEach(function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=eI(r);if(a&&a.map.size){var u=n.applyMerges(a,s,i,l);if(eD(u))return;i=u}if(__DEV__&&!l.overwrite){var c=Object.create(null);o.forEach(function(e){e.selectionSet&&(c[e.name.value]=!0)});var f=function(e){return!0===c[iv(e)]},d=function(e){var t=a&&a.map.get(e);return Boolean(t&&t.info&&t.info.merge)};Object.keys(i).forEach(function(e){f(e)&&!d(e)&&at(s,i,e,l.store)})}e.merge(r,i)}),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=Object.create(null),c=n&&s.rootTypenamesById[n]||eJ(r,i,a.fragmentMap)||n&&a.store.get(n,"__typename");"string"==typeof c&&(u.__typename=c);var l=function(){var e=i0(arguments,u,a.variables);if(eD(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField((0,en.pi)((0,en.pi)({},e),{from:t.storeObject}),a);if(void 0!==n)return n}}return s.readField(e,a)},f=new Set;this.flattenFields(i,r,a,c).forEach(function(e,n){var i,a=r[eX(n)];if(f.add(n),void 0!==a){var d=s.getStoreFieldName({typename:c,fieldName:n.name.value,field:n,variables:e.variables}),h=i5(o,d),p=t.processFieldValue(a,n,n.selectionSet?i3(e,!1,!1):e,h),b=void 0;n.selectionSet&&(eD(p)||iw(p))&&(b=l("__typename",p));var m=s.getMergeFunction(c,n.name.value,b);m?h.info={field:n,typename:c,merge:m}:i7(o,d),u=e.merge(u,((i={})[d]=p,i))}else __DEV__&&!e.clientOnly&&!e.deferred&&!nj.added(n)&&!s.getReadFunction(c,n.name.value)&&__DEV__&&Q.kG.error("Missing field '".concat(eX(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))});try{var d=s.identify(r,{typename:c,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:u,readField:l}),h=d[0],p=d[1];n=n||h,p&&(u=a.merge(u,p))}catch(b){if(!n)throw b}if("string"==typeof n){var m=eI(n),g=a.written[n]||(a.written[n]=[]);if(g.indexOf(i)>=0||(g.push(i),this.reader&&this.reader.isFresh(r,m,i,a)))return m;var v=a.incomingById.get(n);return v?(v.storeObject=a.merge(v.storeObject,u),v.mergeTree=i8(v.mergeTree,o),f.forEach(function(e){return v.fieldNodeSet.add(e)})):a.incomingById.set(n,{storeObject:u,mergeTree:i9(o)?void 0:o,fieldNodeSet:f}),m}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?(0,tP.k)(e)?e.map(function(e,a){var o=i.processFieldValue(e,t,n,i5(r,a));return i7(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?nJ(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=eJ(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new n_(!1);return function e(s,u){var c=o.lookup(s,u.clientOnly,u.deferred);c.visited||(c.visited=!0,s.selections.forEach(function(o){if(td(o,n.variables)){var s=u.clientOnly,c=u.deferred;if(!(s&&c)&&(0,tP.O)(o.directives)&&o.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=eZ(e,n.variables);r&&!1===r.if||(c=!0)}}),eQ(o)){var l=i.get(o);l&&(s=s&&l.clientOnly,c=c&&l.deferred),i.set(o,i3(n,s,c))}else{var f=eC(o,n.lookupFragment);if(!f&&o.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(o.name.value)):new Q.ej(8);f&&a.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,i3(n,s,c))}}}))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a=this;if(e.map.size&&!eD(n)){var o,s,u=!(0,tP.k)(n)&&(eD(t)||iw(t))?t:void 0,c=n;u&&!i&&(i=[eD(u)?u.__ref:u]);var l=function(e,t){return(0,tP.k)(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var n=l(u,t),o=l(c,t);if(void 0!==o){i&&i.push(t);var f=a.applyMerges(e,n,o,r,i);f!==o&&(s=s||new Map).set(t,f),i&&(0,Q.kG)(i.pop()===t)}}),s&&(n=(0,tP.k)(c)?c.slice(0):(0,en.pi)({},c),s.forEach(function(e,t){n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),i6=[];function i5(e,t){var n=e.map;return n.has(t)||n.set(t,i6.pop()||{map:new Map}),n.get(t)}function i8(e,t){if(e===t||!t||i9(t))return e;if(!e||i9(e))return t;var n=e.info&&t.info?(0,en.pi)((0,en.pi)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i=r?new Map:e.map.size?e.map:t.map,a={info:n,map:i};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,n){a.map.set(n,i8(e,t.map.get(n))),o.delete(n)}),o.forEach(function(n){a.map.set(n,i8(t.map.get(n),e.map.get(n)))})}return a}function i9(e){return!e||!(e.info||e.map.size)}function i7(e,t){var n=e.map,r=n.get(t);r&&i9(r)&&(i6.push(r),n.delete(t))}var ae=new Set;function at(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},a=i(e);if(a){var o=i(t);if(!(!o||eD(a)||(0,nm.D)(a,o)||Object.keys(a).every(function(e){return void 0!==r.getFieldValue(o,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=iv(n),c="".concat(s,".").concat(u);if(!ae.has(c)){ae.add(c);var l=[];(0,tP.k)(a)||(0,tP.k)(o)||[a,o].forEach(function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}),__DEV__&&Q.kG.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s," object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(a).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(o).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}var an=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=r2,n.txCount=0,n.config=ip(t),n.addTypename=!!n.config.addTypename,n.policies=new iQ({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return(0,en.ZT)(t,e),t.prototype.init=function(){var e=this.data=new iT.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new i4(this,this.storeReader=new iP({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:ib(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=rZ(function(e,n){return t.broadcastWatch(e,n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(iD(n)){var r=e.optimistic,i=e.id,a=e.variables;return n.makeCacheKey(e.query,e.callback,nx({optimistic:r,id:i,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group,]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(r){if(r instanceof is)return null;throw r}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(ic.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||r0(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&r1(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){nx.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(eD(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){__DEV__&&Q.kG.warn(t)}},t.prototype.evict=function(e){if(!e.id){if(ic.call(e,"id"))return!1;e=(0,en.pi)((0,en.pi)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),nx.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),r1(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,a=void 0===i||i,o=e.removeOptimistic,s=e.onWatchUpdated,u=function(e){var i=n,a=i.data,o=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=a,n.optimisticData=o}},c=new Set;return s&&!this.txCount&&this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e){return c.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,u):!1===a?u(this.data):u(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),s&&c.size?(this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&c.delete(e),n}})),c.size&&c.forEach(function(e){return n.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=nj(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(n){return t.maybeBroadcastWatch(n,e)})},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);(!t||(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),!t.onWatchUpdated||!1!==t.onWatchUpdated.call(this,e,r,n)))&&(n&&(0,nm.D)(n.result,r.result)||e.callback(e.lastDiff=r,n))},t}(io),ar={possibleTypes:{ApproveJobProposalSpecPayload:["ApproveJobProposalSpecSuccess","JobAlreadyExistsError","NotFoundError"],BridgePayload:["Bridge","NotFoundError"],CancelJobProposalSpecPayload:["CancelJobProposalSpecSuccess","NotFoundError"],ChainPayload:["Chain","NotFoundError"],CreateAPITokenPayload:["CreateAPITokenSuccess","InputErrors"],CreateBridgePayload:["CreateBridgeSuccess"],CreateCSAKeyPayload:["CSAKeyExistsError","CreateCSAKeySuccess"],CreateFeedsManagerChainConfigPayload:["CreateFeedsManagerChainConfigSuccess","InputErrors","NotFoundError"],CreateFeedsManagerPayload:["CreateFeedsManagerSuccess","DuplicateFeedsManagerError","InputErrors","NotFoundError","SingleFeedsManagerError"],CreateJobPayload:["CreateJobSuccess","InputErrors"],CreateOCR2KeyBundlePayload:["CreateOCR2KeyBundleSuccess"],CreateOCRKeyBundlePayload:["CreateOCRKeyBundleSuccess"],CreateP2PKeyPayload:["CreateP2PKeySuccess"],DeleteAPITokenPayload:["DeleteAPITokenSuccess","InputErrors"],DeleteBridgePayload:["DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DeleteBridgeSuccess","NotFoundError"],DeleteCSAKeyPayload:["DeleteCSAKeySuccess","NotFoundError"],DeleteFeedsManagerChainConfigPayload:["DeleteFeedsManagerChainConfigSuccess","NotFoundError"],DeleteJobPayload:["DeleteJobSuccess","NotFoundError"],DeleteOCR2KeyBundlePayload:["DeleteOCR2KeyBundleSuccess","NotFoundError"],DeleteOCRKeyBundlePayload:["DeleteOCRKeyBundleSuccess","NotFoundError"],DeleteP2PKeyPayload:["DeleteP2PKeySuccess","NotFoundError"],DeleteVRFKeyPayload:["DeleteVRFKeySuccess","NotFoundError"],DisableFeedsManagerPayload:["DisableFeedsManagerSuccess","NotFoundError"],DismissJobErrorPayload:["DismissJobErrorSuccess","NotFoundError"],EnableFeedsManagerPayload:["EnableFeedsManagerSuccess","NotFoundError"],Error:["CSAKeyExistsError","DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DuplicateFeedsManagerError","InputError","JobAlreadyExistsError","NotFoundError","RunJobCannotRunError","SingleFeedsManagerError"],EthTransactionPayload:["EthTransaction","NotFoundError"],FeaturesPayload:["Features"],FeedsManagerPayload:["FeedsManager","NotFoundError"],GetSQLLoggingPayload:["SQLLogging"],GlobalLogLevelPayload:["GlobalLogLevel"],JobPayload:["Job","NotFoundError"],JobProposalPayload:["JobProposal","NotFoundError"],JobRunPayload:["JobRun","NotFoundError"],JobSpec:["BlockHeaderFeederSpec","BlockhashStoreSpec","BootstrapSpec","CronSpec","DirectRequestSpec","FluxMonitorSpec","GatewaySpec","KeeperSpec","OCR2Spec","OCRSpec","StandardCapabilitiesSpec","StreamSpec","VRFSpec","WebhookSpec","WorkflowSpec"],NodePayload:["Node","NotFoundError"],PaginatedPayload:["BridgesPayload","ChainsPayload","EthTransactionAttemptsPayload","EthTransactionsPayload","JobRunsPayload","JobsPayload","NodesPayload"],RejectJobProposalSpecPayload:["NotFoundError","RejectJobProposalSpecSuccess"],RunJobPayload:["NotFoundError","RunJobCannotRunError","RunJobSuccess"],SetGlobalLogLevelPayload:["InputErrors","SetGlobalLogLevelSuccess"],SetSQLLoggingPayload:["SetSQLLoggingSuccess"],SetServicesLogLevelsPayload:["InputErrors","SetServicesLogLevelsSuccess"],UpdateBridgePayload:["NotFoundError","UpdateBridgeSuccess"],UpdateFeedsManagerChainConfigPayload:["InputErrors","NotFoundError","UpdateFeedsManagerChainConfigSuccess"],UpdateFeedsManagerPayload:["InputErrors","NotFoundError","UpdateFeedsManagerSuccess"],UpdateJobProposalSpecDefinitionPayload:["NotFoundError","UpdateJobProposalSpecDefinitionSuccess"],UpdatePasswordPayload:["InputErrors","UpdatePasswordSuccess"],VRFKeyPayload:["NotFoundError","VRFKeySuccess"]}};let ai=ar;var aa=(r=void 0,location.origin),ao=new nh({uri:"".concat(aa,"/query"),credentials:"include"}),as=new ia({cache:new an({possibleTypes:ai.possibleTypes,dataIdFromObject:function(e){if("Chain"===e.__typename){if(!e.network)throw Error("Due to Chain ID not being unique across chain, ensure network is fetched too");return"Chain:".concat(e.network,":").concat(e.id)}return id(e)}}),link:ao});if(a.Z.locale(o),u().defaultFormat="YYYY-MM-DD h:mm:ss A","undefined"!=typeof document){var au,ac,al=f().hydrate;ac=X,al(c.createElement(et,{client:as},c.createElement(d.zj,null,c.createElement(i.MuiThemeProvider,{theme:J.r},c.createElement(ac,null)))),document.getElementById("root"))}})()})(); \ No newline at end of file +`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((t,n)=>n.call(this,t,e,this),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,pA({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),pg({args:l,value:c,path:i,sync:r,tests:f,endEarly:u},e=>{if(e)return void n(e,c);pg({tests:this.tests,args:l,path:i,sync:r,value:c,endEarly:u},n)})}validate(e,t,n){let r=this.resolve(pA({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise((n,i)=>r._validate(e,t,(e,t)=>{e?i(e):n(t)}))}validateSync(e,t){let n;return this.resolve(pA({},t,{value:e}))._validate(e,pA({},t,{sync:!0}),(e,t)=>{if(e)throw e;n=t}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(pb.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(pb.isError(n))return!1;throw n}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):h0(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=pe.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=pe.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(void 0===(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]}).message&&(t.message=pe.default),"function"!=typeof t.test)throw TypeError("`test` is a required parameters");let n=this.clone(),r=px(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>e.OPTIONS.name!==t.name||!i&&e.OPTIONS.test!==r.OPTIONS.test),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=pd(e).map(e=>new pE(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push(new pf(r,t)),n}typeError(e){var t=this.clone();return t._typeError=px({message:e,name:"typeError",test(e){return!!(void 0===e||this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=pe.oneOf){var n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n._whitelistError=px({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist;return!!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}notOneOf(e,t=pe.notOneOf){var n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n._blacklistError=px({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist;return!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t)};return r}}for(let pC of(pL.prototype.__isYupSchema__=!0,["validate","validateSync"]))pL.prototype[`${pC}At`]=function(e,t,n={}){let{parent:r,parentPath:i,schema:a}=pM(this,e,t,n.context);return a[pC](r&&r[i],pA({},n,{parent:r,path:e}))};for(let pI of["equals","is"])pL.prototype[pI]=pL.prototype.oneOf;for(let pD of["not","nope"])pL.prototype[pD]=pL.prototype.notOneOf;pL.prototype.optional=pL.prototype.notRequired;let pN=pL;function pP(){return new pN}pP.prototype=pN.prototype;let pR=e=>null==e;function pj(){return new pF}class pF extends pL{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=pi.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>pR(e)||!0===e})}isFalse(e=pi.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>pR(e)||!1===e})}}pj.prototype=pF.prototype;let pY=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,pB=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,pU=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,pH=e=>pR(e)||e===e.trim(),p$=({}).toString();function pz(){return new pG}class pG extends pL{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;let t=null!=e&&e.toString?e.toString():e;return t===p$?e:t})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=pt.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pR(t)||t.length===this.resolve(e)}})}min(e,t=pt.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pR(t)||t.length>=this.resolve(e)}})}max(e,t=pt.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return pR(t)||t.length<=this.resolve(e)}})}matches(e,t){let n=!1,r,i;return t&&("object"==typeof t?{excludeEmptyString:n=!1,message:r,name:i}=t:r=t),this.test({name:i||"matches",message:r||pt.matches,params:{regex:e},test:t=>pR(t)||""===t&&n||-1!==t.search(e)})}email(e=pt.email){return this.matches(pY,{name:"email",message:e,excludeEmptyString:!0})}url(e=pt.url){return this.matches(pB,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=pt.uuid){return this.matches(pU,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=pt.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:pH})}lowercase(e=pt.lowercase){return this.transform(e=>pR(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pR(e)||e===e.toLowerCase()})}uppercase(e=pt.uppercase){return this.transform(e=>pR(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pR(e)||e===e.toUpperCase()})}}pz.prototype=pG.prototype;let pW=e=>e!=+e;function pK(){return new pV}class pV extends pL{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(e){let t=e;if("string"==typeof t){if(""===(t=t.replace(/\s/g,"")))return NaN;t=+t}return this.isType(t)?t:parseFloat(t)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!pW(e)}min(e,t=pn.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pR(t)||t>=this.resolve(e)}})}max(e,t=pn.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pR(t)||t<=this.resolve(e)}})}lessThan(e,t=pn.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return pR(t)||tthis.resolve(e)}})}positive(e=pn.positive){return this.moreThan(0,e)}negative(e=pn.negative){return this.lessThan(0,e)}integer(e=pn.integer){return this.test({name:"integer",message:e,test:e=>pR(e)||Number.isInteger(e)})}truncate(){return this.transform(e=>pR(e)?e:0|e)}round(e){var t,n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(t=>pR(t)?t:Math[e](t))}}pK.prototype=pV.prototype;var pq=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function pZ(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=pq.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(void 0===n[8]||""===n[8])&&(void 0===n[9]||""===n[9])?t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7]))}else t=Date.parse?Date.parse(e):NaN;return t}let pX=new Date(""),pJ=e=>"[object Date]"===Object.prototype.toString.call(e);function pQ(){return new p1}class p1 extends pL{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=pZ(e),isNaN(e)?pX:new Date(e))})})}_typeCheck(e){return pJ(e)&&!isNaN(e.getTime())}prepareParam(e,t){let n;if(pE.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=pr.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return pR(e)||e>=this.resolve(n)}})}max(e,t=pr.max){var n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return pR(e)||e<=this.resolve(n)}})}}p1.INVALID_DATE=pX,pQ.prototype=p1.prototype,pQ.INVALID_DATE=pX;var p0=n(11865),p2=n.n(p0),p3=n(68929),p4=n.n(p3),p6=n(67523),p5=n.n(p6),p8=n(94633),p9=n.n(p8);function p7(e,t=[]){let n=[],r=[];function i(e,i){var a=(0,pw.split)(e)[0];~r.indexOf(a)||r.push(a),~t.indexOf(`${i}-${a}`)||n.push([i,a])}for(let a in e)if(pu()(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),pE.isRef(o)&&o.isSibling?i(o.path,a):pc(o)&&"deps"in o&&o.deps.forEach(e=>i(e,a))}return p9().array(r,n).reverse()}function be(e,t){let n=1/0;return e.some((e,r)=>{var i;if((null==(i=t.path)?void 0:i.indexOf(e))!==-1)return n=r,!0}),n}function bt(e){return(t,n)=>be(e,t)-be(e,n)}function bn(){return(bn=Object.assign||function(e){for(var t=1;t"[object Object]"===Object.prototype.toString.call(e);function bi(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}let ba=bt([]);class bo extends pL{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=ba,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}),e&&this.shape(e)})}_typeCheck(e){return br(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter(e=>-1===this._nodes.indexOf(e))),s={},u=bn({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(let l of o){let f=i[l],d=pu()(r,l);if(f){let h,p=r[l];u.path=(t.path?`${t.path}.`:"")+l;let b="spec"in(f=f.resolve({value:p,context:t.context,parent:s}))?f.spec:void 0,m=null==b?void 0:b.strict;if(null==b?void 0:b.strip){c=c||l in r;continue}void 0!==(h=t.__validating&&m?r[l]:f.cast(r[l],u))&&(s[l]=h)}else d&&!a&&(s[l]=r[l]);s[l]!==r[l]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,(e,c)=>{if(e){if(!pb.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!br(c)){n(r[0]||null,c);return}o=o||c;let l=this._nodes.map(e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];if(s&&"validate"in s){s.validate(c[e],bn({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r);return}r(null)});pg({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)})}clone(e){let t=super.clone(e);return t.fields=bn({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[r,i]of Object.entries(this.fields)){let a=n[r];void 0===a?n[r]=i:a instanceof pL&&i instanceof pL&&(n[r]=i.concat(a))}return t.withMutation(()=>t.shape(n))}getDefaultFromShape(){let e={};return this._nodes.forEach(t=>{let n=this.fields[t];e[t]="default"in n?n.getDefault():void 0}),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);if(n.fields=r,n._sortErrors=bt(Object.keys(r)),t.length){Array.isArray(t[0])||(t=[t]);let i=t.map(([e,t])=>`${e}-${t}`);n._excludedEdges=n._excludedEdges.concat(i)}return n._nodes=p7(r,n._excludedEdges),n}pick(e){let t={};for(let n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation(e=>(e.fields={},e.shape(t)))}omit(e){let t=this.clone(),n=t.fields;for(let r of(t.fields={},e))delete n[r];return t.withMutation(()=>t.shape(n))}from(e,t,n){let r=(0,pw.getter)(e,!0);return this.transform(i=>{if(null==i)return i;let a=i;return pu()(i,e)&&(a=bn({},i),n||delete a[e],a[t]=r(i)),a})}noUnknown(e=!0,t=pa.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;let n=bi(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=pa.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>t&&p5()(t,(t,n)=>e(n)))}camelCase(){return this.transformKeys(p4())}snakeCase(){return this.transformKeys(p2())}constantCase(){return this.transformKeys(e=>p2()(e).toUpperCase())}describe(){let e=super.describe();return e.fields=py()(this.fields,e=>e.describe()),e}}function bs(e){return new bo(e)}function bu(){return(bu=Object.assign||function(e){for(var t=1;t{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){let n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1,i=n.map((e,n)=>{let i=this.innerType.cast(e,bu({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i});return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,f=null!=t.originalValue?t.originalValue:e;super._validate(e,t,(e,r)=>{if(e){if(!pb.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r)){n(a[0]||null,r);return}f=f||r;let i=Array(r.length);for(let d=0;du.validate(h,b,t)}pg({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!pc(e))throw TypeError("`array.of()` sub-schema must be a valid yup schema not: "+h7(e));return t.innerType=e,t}length(e,t=po.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pR(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||po.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pR(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||po.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pR(t)||t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}bc.prototype=bl.prototype;var bf=bs().shape({name:pz().required("Required"),url:pz().required("Required")}),bd=function(e){var t=e.initialValues,n=e.onSubmit,r=e.submitButtonText,i=e.nameDisabled,a=void 0!==i&&i;return l.createElement(hb,{initialValues:t,validationSchema:bf,onSubmit:n},function(e){var t=e.isSubmitting;return l.createElement(l.Fragment,null,l.createElement(hx,{"data-testid":"bridge-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hk,{component:hB,id:"name",name:"name",label:"Name",disabled:a,required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hk,{component:hB,id:"url",name:"url",label:"Bridge URL",placeholder:"https://",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"url-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:7},l.createElement(hk,{component:hB,id:"minimumContractPayment",name:"minimumContractPayment",label:"Minimum Contract Payment",placeholder:"0",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"minimumContractPayment-helper-text"}})),l.createElement(d.Z,{item:!0,xs:7},l.createElement(hk,{component:hB,id:"confirmations",name:"confirmations",label:"Confirmations",placeholder:"0",type:"number",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"confirmations-helper-text"}})))),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(of.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},r)))))})},bh=function(e){var t=e.bridge,n=e.onSubmit,r={name:t.name,url:t.url,minimumContractPayment:t.minimumContractPayment,confirmations:t.confirmations};return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:40},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"Edit Bridge",action:l.createElement(o1.Z,{component:tz,href:"/bridges/".concat(t.id)},"Cancel")}),l.createElement(aD.Z,null,l.createElement(bd,{nameDisabled:!0,initialValues:r,onSubmit:n,submitButtonText:"Save Bridge"}))))))};function bp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]&&arguments[0],t=e?function(){return l.createElement(x.default,{variant:"body1"},"Loading...")}:function(){return null};return{isLoading:e,LoadingPlaceholder:t}},b7=n(76023);function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=4?[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]:void 0}var mB={};function mU(e){if(0===e.length||1===e.length)return e;var t=e.join(".");return mB[t]||(mB[t]=mY(e)),mB[t]}function mH(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return mU(e.filter(function(e){return"token"!==e})).reduce(function(e,t){return mj({},e,n[t])},t)}function m$(e){return e.join(" ")}function mz(e,t){var n=0;return function(r){return n+=1,r.map(function(r,i){return mG({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})})}}function mG(e){var t=e.node,n=e.stylesheet,r=e.style,i=void 0===r?{}:r,a=e.useInlineStyles,o=e.key,s=t.properties,u=t.type,c=t.tagName,f=t.value;if("text"===u)return f;if(c){var d,h=mz(n,a);if(a){var p=Object.keys(n).reduce(function(e,t){return t.split(".").forEach(function(t){e.includes(t)||e.push(t)}),e},[]),b=s.className&&s.className.includes("token")?["token"]:[],m=s.className&&b.concat(s.className.filter(function(e){return!p.includes(e)}));d=mj({},s,{className:m$(m)||void 0,style:mH(s.className,Object.assign({},s.style,i),n)})}else d=mj({},s,{className:m$(s.className)});var g=h(t.children);return l.createElement(c,(0,mF.Z)({key:o},d),g)}}let mW=function(e,t){return -1!==e.listLanguages().indexOf(t)};var mK=/\n/g;function mV(e){return e.match(mK)}function mq(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(e,t){var i=t+n;return l.createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(i):r},"".concat(i,"\n"))})}function mZ(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=void 0===r?{float:"left",paddingRight:"10px"}:r,a=e.numberStyle,o=void 0===a?{}:a,s=e.startingLineNumber;return l.createElement("code",{style:Object.assign({},n,i)},mq({lines:t.replace(/\n$/,"").split("\n"),style:o,startingLineNumber:s}))}function mX(e){return"".concat(e.toString().length,".25em")}function mJ(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function mQ(e,t,n){var r,i={display:"inline-block",minWidth:mX(n),paddingRight:"1em",textAlign:"right",userSelect:"none"};return mj({},i,"function"==typeof e?e(t):e)}function m1(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,a=e.showInlineLineNumbers,o=e.lineProps,s=void 0===o?{}:o,u=e.className,c=void 0===u?[]:u,l=e.showLineNumbers,f=e.wrapLongLines,d="function"==typeof s?s(n):s;if(d.className=c,n&&a){var h=mQ(r,n,i);t.unshift(mJ(n,h))}return f&l&&(d.style=mj({},d.style,{display:"flex"})),{type:"element",tagName:"span",properties:d,children:t}}function m0(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0;r2&&void 0!==arguments[2]?arguments[2]:[];return m1({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:i,lineProps:n,className:a,showLineNumbers:r,wrapLongLines:u})}function b(e,t){if(r&&t&&i){var n=mQ(s,t,o);e.unshift(mJ(t,n))}return e}function m(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):b(e,n)}for(var g=function(){var e=l[h],t=e.children[0].value;if(mV(t)){var n=t.split("\n");n.forEach(function(t,i){var o=r&&f.length+a,s={type:"text",value:"".concat(t,"\n")};if(0===i){var u=l.slice(d+1,h).concat(m1({children:[s],className:e.properties.className})),c=m(u,o);f.push(c)}else if(i===n.length-1){if(l[h+1]&&l[h+1].children&&l[h+1].children[0]){var p={type:"text",value:"".concat(t)},b=m1({children:[p],className:e.properties.className});l.splice(h+1,0,b)}else{var g=[s],v=m(g,o,e.properties.className);f.push(v)}}else{var y=[s],w=m(y,o,e.properties.className);f.push(w)}}),d=h}h++};h code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var m9=n(98695),m7=n.n(m9);let ge=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apl","applescript","aql","arduino","arff","asciidoc","asm6502","aspnet","autohotkey","autoit","bash","basic","batch","bbcode","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cil","clike","clojure","cmake","coffeescript","concurnas","cpp","crystal","csharp","csp","css-extras","css","cypher","d","dart","dax","dhall","diff","django","dns-zone-file","docker","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","firestore-security-rules","flow","fortran","fsharp","ftl","gcode","gdscript","gedcom","gherkin","git","glsl","gml","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hpkp","hsts","http","ichigojam","icon","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keyman","kotlin","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","lolcode","lua","makefile","markdown","markup-templating","markup","matlab","mel","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nginx","nim","nix","nsis","objectivec","ocaml","opencl","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","properties","protobuf","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","r","racket","reason","regex","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","stan","stylus","swift","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","wiki","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var gt=m5(m7(),m8);gt.supportedLanguages=ge;let gn=gt;var gr=n(64566);function gi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ga(){var e=gi(["\n query FetchConfigV2 {\n configv2 {\n user\n effective\n }\n }\n"]);return ga=function(){return e},e}var go=n0(ga()),gs=function(e){var t=e.children;return l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},t))},gu=function(){return l.createElement(gs,null,"...")},gc=function(e){var t=e.children;return l.createElement(gs,null,t)},gl=function(e){var t=e.loading,n=e.toml,r=e.error,i=void 0===r?"":r,a=e.title,o=e.expanded;if(i)return l.createElement(gc,null,i);if(t)return l.createElement(gu,null);a||(a="TOML");var s={display:"block"};return l.createElement(x.default,null,l.createElement(mx.Z,{defaultExpanded:o},l.createElement(mT.Z,{expandIcon:l.createElement(gr.Z,null)},a),l.createElement(mM.Z,{style:s},l.createElement(gn,{language:"toml",style:m8},n))))},gf=function(){var e=rv(go,{fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return(null==t?void 0:t.configv2.effective)=="N/A"?l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"TOML Configuration"}),l.createElement(gl,{title:"V2 config dump:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0})))):l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"TOML Configuration"}),l.createElement(gl,{title:"User specified:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0,expanded:!0}),l.createElement(gl,{title:"Effective (with defaults):",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.effective,showHead:!0})))))},gd=n(34823),gh=function(e){return(0,b.createStyles)({cell:{paddingTop:1.5*e.spacing.unit,paddingBottom:1.5*e.spacing.unit}})},gp=(0,b.withStyles)(gh)(function(e){var t=e.classes,n=(0,A.I0)();(0,l.useEffect)(function(){n((0,ty.DQ)())});var r=(0,A.v9)(gd.N,A.wU);return l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"Node"}),l.createElement(r8.Z,null,l.createElement(r9.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"Version"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.version))),l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"SHA"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.commitSHA))))))}),gb=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,sm:12,md:8},l.createElement(d.Z,{container:!0},l.createElement(gf,null))),l.createElement(d.Z,{item:!0,sm:12,md:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gp,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mk,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(md,null))))))},gm=function(){return l.createElement(gb,null)},gg=function(){return l.createElement(gm,null)},gv=n(44431),gy=1e18,gw=function(e){return new gv.BigNumber(e).dividedBy(gy).toFixed(8)},g_=function(e){var t=e.keys,n=e.chainID,r=e.hideHeaderTitle;return l.createElement(l.Fragment,null,l.createElement(o7.Z,{title:!r&&"Account Balances",subheader:"Chain ID "+n}),l.createElement(aD.Z,null,l.createElement(w.default,{dense:!1,disablePadding:!0},t&&t.map(function(e,r){return l.createElement(l.Fragment,null,l.createElement(_.default,{disableGutters:!0,key:["acc-balance",n.toString(),r.toString()].join("-")},l.createElement(E.Z,{primary:l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(ot,{title:"Address"}),l.createElement(on,{value:e.address})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(ot,{title:"Native Token Balance"}),l.createElement(on,{value:e.ethBalance||"--"})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(ot,{title:"LINK Balance"}),l.createElement(on,{value:e.linkBalance?gw(e.linkBalance):"--"}))))})),r+1s&&l.createElement(gL.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:r.footer},l.createElement(o1.Z,{href:"/runs",component:tz},"View More"))))))});function g0(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function g2(){var e=g0(["\n ","\n query FetchRecentJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...RecentJobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return g2=function(){return e},e}var g3=5,g4=n0(g2(),gJ),g6=function(){var e=rv(g4,{variables:{offset:0,limit:g3},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(g1,{data:t,errorMsg:null==r?void 0:r.message,loading:n,maxRunsSize:g3})},g5=function(e){return(0,b.createStyles)({style:{textAlign:"center",padding:2.5*e.spacing.unit,position:"fixed",left:"0",bottom:"0",width:"100%",borderRadius:0},bareAnchor:{color:e.palette.common.black,textDecoration:"none"}})},g8=(0,b.withStyles)(g5)(function(e){var t=e.classes,n=(0,A.v9)(gd.N,A.wU),r=(0,A.I0)();return(0,l.useEffect)(function(){r((0,ty.DQ)())}),l.createElement(ii.default,{className:t.style},l.createElement(x.default,null,"Chainlink Node ",n.version," at commit"," ",l.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/smartcontractkit/chainlink/commit/".concat(n.commitSHA),className:t.bareAnchor},n.commitSHA)))}),g9=function(e){return(0,b.createStyles)({cell:{borderColor:e.palette.divider,borderTop:"1px solid",borderBottom:"none",paddingTop:2*e.spacing.unit,paddingBottom:2*e.spacing.unit,paddingLeft:2*e.spacing.unit},block:{display:"block"},overflowEllipsis:{textOverflow:"ellipsis",overflow:"hidden"}})},g7=(0,b.withStyles)(g9)(function(e){var t=e.classes,n=e.job;return l.createElement(ir.Z,null,l.createElement(r7.default,{scope:"row",className:t.cell},l.createElement(d.Z,{container:!0,spacing:0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(ih,{href:"/jobs/".concat(n.id),classes:{linkContent:t.block}},l.createElement(x.default,{className:t.overflowEllipsis,variant:"body1",component:"span",color:"primary"},n.name||n.id))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,{variant:"body1",color:"textSecondary"},"Created ",l.createElement(aO,{tooltip:!0},n.createdAt))))))});function ve(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vt(){var e=ve(["\n fragment RecentJobsPayload_ResultsFields on Job {\n id\n name\n createdAt\n }\n"]);return vt=function(){return e},e}var vn=n0(vt()),vr=function(){return(0,b.createStyles)({cardHeader:{borderBottom:0},table:{tableLayout:"fixed"}})},vi=(0,b.withStyles)(vr)(function(e){var t,n,r=e.classes,i=e.data,a=e.errorMsg,o=e.loading;return l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"Recent Jobs",className:r.cardHeader}),l.createElement(r8.Z,{className:r.table},l.createElement(r9.Z,null,l.createElement(gD,{visible:o}),l.createElement(gN,{visible:(null===(t=null==i?void 0:i.jobs.results)||void 0===t?void 0:t.length)===0},"No recently created jobs"),l.createElement(gC,{msg:a}),null===(n=null==i?void 0:i.jobs.results)||void 0===n?void 0:n.map(function(e,t){return l.createElement(g7,{job:e,key:t})}))))});function va(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vo(){var e=va(["\n ","\n query FetchRecentJobs($offset: Int, $limit: Int) {\n jobs(offset: $offset, limit: $limit) {\n results {\n ...RecentJobsPayload_ResultsFields\n }\n }\n }\n"]);return vo=function(){return e},e}var vs=5,vu=n0(vo(),vn),vc=function(){var e=rv(vu,{variables:{offset:0,limit:vs},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(vi,{data:t,errorMsg:null==r?void 0:r.message,loading:n})},vl=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:8},l.createElement(g6,null)),l.createElement(d.Z,{item:!0,xs:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gA,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(vc,null))))),l.createElement(g8,null))},vf=function(){return l.createElement(vl,null)},vd=function(){return l.createElement(vf,null)},vh=n(87239),vp=function(e){switch(e){case"DirectRequestSpec":return"Direct Request";case"FluxMonitorSpec":return"Flux Monitor";default:return e.replace(/Spec$/,"")}},vb=n(5022),vm=n(78718),vg=n.n(vm);function vv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1?t-1:0),r=1;r1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&n.map(function(e){return l.createElement(ir.Z,{key:e.id,style:{cursor:"pointer"},onClick:function(){return r.push("/runs/".concat(e.id))}},l.createElement(r7.default,{className:t.idCell,scope:"row"},l.createElement("div",{className:t.runDetails},l.createElement(x.default,{variant:"h5",color:"primary",component:"span"},e.id))),l.createElement(r7.default,{className:t.stampCell},l.createElement(x.default,{variant:"body1",color:"textSecondary",className:t.stamp},"Created ",l.createElement(aO,{tooltip:!0},e.createdAt))),l.createElement(r7.default,{className:t.statusCell,scope:"row"},l.createElement(x.default,{variant:"body1",className:O()(t.status,yr(t,e.status))},e.status.toLowerCase())))})))}),ya=n(16839),yo=n.n(ya);function ys(e){var t=e.replace(/\w+\s*=\s*<([^>]|[\r\n])*>/g,""),n=yo().read(t),r=n.edges();return n.nodes().map(function(e){var t={id:e,parentIds:r.filter(function(t){return t.w===e}).map(function(e){return e.v})};return Object.keys(n.node(e)).length>0&&(t.attributes=n.node(e)),t})}var yu=n(94164),yc=function(e){var t=e.data,n=[];return(null==t?void 0:t.attributes)&&Object.keys(t.attributes).forEach(function(e){var r;n.push(l.createElement("div",{key:e},l.createElement(x.default,{variant:"body1",color:"textSecondary",component:"div"},l.createElement("b",null,e,":")," ",null===(r=t.attributes)||void 0===r?void 0:r[e])))}),l.createElement("div",null,t&&l.createElement(x.default,{variant:"body1",color:"textPrimary"},l.createElement("b",null,t.id)),n)},yl=n(73343),yf=n(3379),yd=n.n(yf);function yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nwindow.innerWidth?u-r.getBoundingClientRect().width-a:u+a,n=c+r.getBoundingClientRect().height+i>window.innerHeight?c-r.getBoundingClientRect().height-a:c+a,r.style.opacity=String(1),r.style.top="".concat(n,"px"),r.style.left="".concat(t,"px"),r.style.zIndex=String(1)}},h=function(e){var t=document.getElementById("tooltip-d3-chart-".concat(e));t&&(t.style.opacity=String(0),t.style.zIndex=String(-1))};return l.createElement("div",{style:{fontFamily:"sans-serif",fontWeight:"normal"}},l.createElement(yu.kJ,{id:"task-list-graph-d3",data:i,config:s,onMouseOverNode:d,onMouseOutNode:h},"D3 chart"),n.map(function(e){return l.createElement("div",{key:"d3-tooltip-key-".concat(e.id),id:"tooltip-d3-chart-".concat(e.id),style:{position:"absolute",opacity:"0",border:"1px solid rgba(0, 0, 0, 0.1)",padding:yl.r.spacing.unit,background:"white",borderRadius:5,zIndex:-1,inlineSize:"min-content"}},l.createElement(yc,{data:e}))}))};function yw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nyA&&l.createElement("div",{className:t.runDetails},l.createElement(o1.Z,{href:"/jobs/".concat(n.id,"/runs"),component:tz},"View more")))),l.createElement(d.Z,{item:!0,xs:12,sm:6},l.createElement(yO,{observationSource:n.observationSource})))});function yI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:"";try{return vb.parse(e),!0}catch(t){return!1}})}),wR=function(e){var t=e.initialValues,n=e.onSubmit,r=e.onTOMLChange;return l.createElement(hb,{initialValues:t,validationSchema:wP,onSubmit:n},function(e){var t=e.isSubmitting,n=e.values;return r&&r(n.toml),l.createElement(hx,{"data-testid":"job-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hB,id:"toml",name:"toml",label:"Job Spec (TOML)",required:!0,fullWidth:!0,multiline:!0,rows:10,rowsMax:25,variant:"outlined",autoComplete:"off",FormHelperTextProps:{"data-testid":"toml-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(of.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},"Create Job"))))})},wj=n(50109),wF="persistSpec";function wY(e){var t=e.query,n=new URLSearchParams(t).get("definition");return n?(wj.t8(wF,n),{toml:n}):{toml:wj.U2(wF)||""}}var wB=function(e){var t=e.onSubmit,n=e.onTOMLChange,r=wY({query:(0,h.TH)().search}),i=function(e){var t=e.replace(/[\u200B-\u200D\uFEFF]/g,"");wj.t8("".concat(wF),t),n&&n(t)};return l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"New Job"}),l.createElement(aD.Z,null,l.createElement(wR,{initialValues:r,onSubmit:t,onTOMLChange:i})))};function wU(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.start,r=void 0===n?6:n,i=t.end,a=void 0===i?4:i;return e.substring(0,r)+"..."+e.substring(e.length-a)}function _w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(_Y,e)},_U=function(){var e=_B({fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error,i=e.refetch;return l.createElement(_N,{loading:n,data:t,errorMsg:null==r?void 0:r.message,refetch:i})},_H=function(e){var t=e.chainKey,n=e.fields;return l.createElement(ir.Z,{hover:!0},n.map(function(e,n){return l.createElement(r7.default,{key:n},l.createElement(x.default,{variant:"body1"},t[e.key]," ",e.copy&&l.createElement(_v,{data:t[e.key]})))}))},_$=function(e){var t,n,r,i=e.schema,a=e.data,o=e.errorMsg,s=e.loading,u=e.onCreate;return l.createElement(r5.Z,null,l.createElement(o7.Z,{action:(null==a?void 0:null===(t=a.results)||void 0===t?void 0:t.length)===0&&l.createElement(of.default,{variant:"outlined",color:"primary",onClick:u},"New Key"),title:"".concat(i.title," Keys"),subheader:"Manage your ".concat(i.title," Keys")}),l.createElement(r8.Z,null,l.createElement(ie.Z,null,i.fields.map(function(e,t){return l.createElement(r7.default,{key:t},e.label)})),l.createElement(r9.Z,null,l.createElement(gD,{visible:s}),l.createElement(gN,{visible:(null==a?void 0:null===(n=a.results)||void 0===n?void 0:n.length)===0}),l.createElement(gC,{msg:o}),null==a?void 0:null===(r=a.results)||void 0===r?void 0:r.map(function(e,t){return l.createElement(_H,{chainKey:e,fields:i.fields,key:t})}))))};function _z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _G(){var e=_z(["\n fragment AptosKeysPayload_ResultsFields on AptosKey {\n account\n id\n }\n"]);return _G=function(){return e},e}function _W(){var e=_z(["\n fragment SolanaKeysPayload_ResultsFields on SolanaKey {\n id\n }\n"]);return _W=function(){return e},e}function _K(){var e=_z(["\n fragment StarknetKeysPayload_ResultsFields on StarkNetKey {\n id\n }\n"]);return _K=function(){return e},e}function _V(){var e=_z(["\n fragment TronKeysPayload_ResultsFields on TronKey {\n id\n }\n"]);return _V=function(){return e},e}function _q(){var e=_z(["\n ","\n ","\n ","\n ","\n query FetchNonEvmKeys {\n aptosKeys {\n results {\n ...AptosKeysPayload_ResultsFields\n }\n }\n solanaKeys {\n results {\n ...SolanaKeysPayload_ResultsFields\n }\n }\n starknetKeys {\n results {\n ...StarknetKeysPayload_ResultsFields\n }\n }\n tronKeys {\n results {\n ...TronKeysPayload_ResultsFields\n }\n }\n }\n"]);return _q=function(){return e},e}var _Z=n0(_G()),_X=n0(_W()),_J=n0(_K()),_Q=n0(_V()),_1=n0(_q(),_Z,_X,_J,_Q),_0=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(_1,e)};function _2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&l.createElement(_$,{loading:r,schema:Et[o]||{title:o,fields:[{label:"Public Key",key:"id",copy:!0}]},data:s,errorMsg:null==i?void 0:i.message,onCreate:a,key:o})}))},Er=function(e){var t=e.csaKey;return l.createElement(ir.Z,{hover:!0},l.createElement(r7.default,null,l.createElement(x.default,{variant:"body1"},t.publicKey," ",l.createElement(_v,{data:t.publicKey}))))};function Ei(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ea(){var e=Ei(["\n fragment CSAKeysPayload_ResultsFields on CSAKey {\n id\n publicKey\n }\n"]);return Ea=function(){return e},e}var Eo=n0(Ea()),Es=function(e){var t,n,r,i=e.data,a=e.errorMsg,o=e.loading,s=e.onCreate;return l.createElement(r5.Z,null,l.createElement(o7.Z,{action:(null===(t=null==i?void 0:i.csaKeys.results)||void 0===t?void 0:t.length)===0&&l.createElement(of.default,{variant:"outlined",color:"primary",onClick:s},"New CSA Key"),title:"CSA Key",subheader:"Manage your CSA Key"}),l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Public Key"))),l.createElement(r9.Z,null,l.createElement(gD,{visible:o}),l.createElement(gN,{visible:(null===(n=null==i?void 0:i.csaKeys.results)||void 0===n?void 0:n.length)===0}),l.createElement(gC,{msg:a}),null===(r=null==i?void 0:i.csaKeys.results)||void 0===r?void 0:r.map(function(e,t){return l.createElement(Er,{csaKey:e,key:t})}))))};function Eu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EG,e)};function EK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(So,e)},Sf=function(){return a3(Ss)},Sd=function(){return a3(Su)},Sh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(Sc,e)};function Sp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(kt,e)};function kr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xn(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}var xr=function(e){var t=e.run,n=l.useMemo(function(){var e=t.inputs,n=t.outputs,r=t.taskRuns,i=xt(t,["inputs","outputs","taskRuns"]),a={};try{a=JSON.parse(e)}catch(o){a={}}return xe(k9({},i),{inputs:a,outputs:n,taskRuns:r})},[t]);return l.createElement(r5.Z,null,l.createElement(aD.Z,null,l.createElement(k5,{object:n})))};function xi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xa(e){for(var t=1;t0&&l.createElement(k_,{errors:t.allErrors})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(h.rs,null,l.createElement(h.AW,{path:"".concat(n,"/json")},l.createElement(xr,{run:t})),l.createElement(h.AW,{path:n},t.taskRuns.length>0&&l.createElement(kJ,{taskRuns:t.taskRuns,observationSource:t.job.observationSource}))))))))};function xp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xb(){var e=xp(["\n ","\n query FetchJobRun($id: ID!) {\n jobRun(id: $id) {\n __typename\n ... on JobRun {\n ...JobRunPayload_Fields\n }\n ... on NotFoundError {\n message\n }\n }\n }\n"]);return xb=function(){return e},e}var xm=n0(xb(),xd),xg=function(){var e=rv(xm,{variables:{id:(0,h.UO)().id}}),t=e.data,n=e.loading,r=e.error;if(n)return l.createElement(iR,null);if(r)return l.createElement(iD,{error:r});var i=null==t?void 0:t.jobRun;switch(null==i?void 0:i.__typename){case"JobRun":return l.createElement(xh,{run:i});case"NotFoundError":return l.createElement(a2,null);default:return null}};function xv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xy(){var e=xv(["\n fragment JobRunsPayload_ResultsFields on JobRun {\n id\n allErrors\n createdAt\n finishedAt\n status\n job {\n id\n }\n }\n"]);return xy=function(){return e},e}var xw=n0(xy()),x_=function(e){var t=e.loading,n=e.data,r=e.page,i=e.pageSize,a=(0,h.k6)(),o=l.useMemo(function(){return null==n?void 0:n.jobRuns.results.map(function(e){var t,n=e.allErrors,r=e.id,i=e.createdAt;return{id:r,createdAt:i,errors:n,finishedAt:e.finishedAt,status:e.status}})},[n]);return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(iy,null,"Job Runs")),t&&l.createElement(iR,null),n&&o&&l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(yi,{runs:o}),l.createElement(it.Z,{component:"div",count:n.jobRuns.metadata.total,rowsPerPage:i,rowsPerPageOptions:[i],page:r-1,onChangePage:function(e,t){a.push("/runs?page=".concat(t+1,"&per=").concat(i))},onChangeRowsPerPage:function(){},backIconButtonProps:{"aria-label":"prev-page"},nextIconButtonProps:{"aria-label":"next-page"}})))))};function xE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xS(){var e=xE(["\n ","\n query FetchJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...JobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return xS=function(){return e},e}var xk=n0(xS(),xw),xx=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"25",10),r=rv(xk,{variables:{offset:(t-1)*n,limit:n},fetchPolicy:"cache-and-network"}),i=r.data,a=r.loading,o=r.error;return o?l.createElement(iD,{error:o}):l.createElement(x_,{loading:a,data:i,page:t,pageSize:n})},xT=function(){var e=(0,h.$B)().path;return l.createElement(h.rs,null,l.createElement(h.AW,{exact:!0,path:e},l.createElement(xx,null)),l.createElement(h.AW,{path:"".concat(e,"/:id")},l.createElement(xg,null)))};function xM(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xO(){var e=xM(["\n fragment FetchFeedsManagersPayload_ResultsFields on FeedsManager {\n __typename\n id\n name\n uri\n publicKey\n isConnectionActive\n createdAt\n disabledAt\n }\n query FetchFeedsManagers {\n feedsManagers {\n results {\n ...FetchFeedsManagersPayload_ResultsFields\n }\n }\n }\n"]);return xO=function(){return e},e}var xA=n0(xO()),xL=function(e){return rv(xA,e)},xC=n(47559),xI=n(83165),xD=n(47298),xN=n(81395),xP=function(){return(0,b.createStyles)({root:{display:"flex"},activeIcon:{color:xC.default[500]},inactiveIcon:{color:xI.default[500]},text:{marginLeft:4}})},xR=(0,b.withStyles)(xP)(function(e){var t=e.isActive,n=e.activeText,r=e.inactiveText,i=e.classes;return l.createElement("div",{className:i.root},t?l.createElement(xN.Z,{fontSize:"small",className:i.activeIcon}):l.createElement(xD.Z,{fontSize:"small",className:i.inactiveIcon}),l.createElement(x.default,{variant:"body1",inline:!0,className:i.text},t?n:r))}),xj=(0,b.withStyles)(iu)(function(e){var t=e.jobDistributor,n=e.classes;return l.createElement(ir.Z,{className:n.row,hover:!0},l.createElement(r7.default,{className:n.cell,component:"th",scope:"row"},l.createElement(ih,{className:n.link,href:"/job_distributors/".concat(t.id)},t.name)),l.createElement(r7.default,null,l.createElement(xR,{isActive:t.isConnectionActive,activeText:"Connected",inactiveText:"Disconnected"})),l.createElement(r7.default,null,l.createElement(xR,{isActive:!t.disabledAt,activeText:"Enabled",inactiveText:"Disabled"})),l.createElement(r7.default,null,_y(t.publicKey,{start:6,end:6}),l.createElement(_v,{data:t.publicKey})),l.createElement(r7.default,null,t.uri))}),xF=function(e){var t=e.jobDistributors;return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Distributors")),l.createElement(d.Z,{item:!0,xs:3},l.createElement(d.Z,{container:!0,justify:"flex-end"},l.createElement(d.Z,{item:!0},l.createElement(o1.Z,{variant:"secondary",component:tz,href:"/job_distributors/new"},"New Job Distributor")))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Name"),l.createElement(r7.default,null,"Connection Status"),l.createElement(r7.default,null,"Status"),l.createElement(r7.default,null,"CSA Public Key"),l.createElement(r7.default,null,"RPC URL"))),l.createElement(r9.Z,null,0===t.length&&l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},"Job Distributors have not been registered")),t.map(function(e){return l.createElement(xj,{key:e.id,jobDistributor:e})})))))))},xY=function(){var e,t=xL({fetchPolicy:"cache-and-network"}),n=t.data,r=t.loading,i=t.error;return r?l.createElement(iR,null):i?l.createElement(iD,{error:i}):l.createElement(xF,{jobDistributors:null!==(e=null==n?void 0:n.feedsManagers.results)&&void 0!==e?e:[]})},xB=bs().shape({name:pz().required("Required"),uri:pz().required("Required"),publicKey:pz().required("Required")}),xU=function(e){var t=e.initialValues,n=e.onSubmit;return l.createElement(hb,{initialValues:t,validationSchema:xB,onSubmit:n},function(e){var t=e.isSubmitting,n=e.submitForm;return l.createElement(hx,{"data-testid":"feeds-manager-form"},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"name",name:"name",label:"Name",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:!1,md:6}),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"uri",name:"uri",label:"URI",required:!0,fullWidth:!0,helperText:"Provided by the Job Distributor operator",FormHelperTextProps:{"data-testid":"uri-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"publicKey",name:"publicKey",label:"Public Key",required:!0,fullWidth:!0,helperText:"Provided by the Job Distributor operator",FormHelperTextProps:{"data-testid":"publicKey-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(of.default,{variant:"contained",color:"primary",disabled:t,onClick:n},"Submit"))))})},xH=function(e){var t=e.data,n=e.onSubmit,r={name:t.name,uri:t.uri,publicKey:t.publicKey};return l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(o7.Z,{title:"Edit Job Distributor"}),l.createElement(aD.Z,null,l.createElement(xU,{initialValues:r,onSubmit:n})))))};function x$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(Ti,e)},To=function(){return(0,b.createStyles)({root:{fontSize:24}})},Ts=(0,b.withStyles)(To)(function(e){var t=e.children,n=e.classes;return l.createElement(x.default,{variant:"h2",className:n.root},t)}),Tu=n(9290),Tc=n(74923);function Tl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tz(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function TG(e,t){return TR(e)||TB(e,t)||TK(e,t)||TU()}function TW(e){return Tj(e)||TY(e)||TK(e)||TH()}function TK(e,t){if(e){if("string"==typeof e)return TP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TP(e,t)}}var TV=function(e){return"STARKNET"===e},Tq=bs().shape({chainID:pz().required("Required"),chainType:pz().required("Required"),accountAddr:pz().required("Required"),accountAddrPubKey:pz().nullable(),adminAddr:pz(),ocr1Multiaddr:pz().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&t},then:pz().required("Required").nullable()}).nullable(),ocr1P2PPeerID:pz().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:pz().required("Required").nullable()}).nullable(),ocr1KeyBundleID:pz().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:pz().required("Required").nullable()}).nullable(),ocr2Multiaddr:pz().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&t},then:pz().required("Required").nullable()}).nullable(),ocr2P2PPeerID:pz().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:pz().required("Required").nullable()}).nullable(),ocr2KeyBundleID:pz().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:pz().required("Required").nullable()}).nullable(),ocr2CommitPluginEnabled:pj().required("Required"),ocr2ExecutePluginEnabled:pj().required("Required"),ocr2MedianPluginEnabled:pj().required("Required"),ocr2MercuryPluginEnabled:pj().required("Required"),ocr2ForwarderAddress:pz().nullable()}),TZ=function(e){return(0,b.createStyles)({supportedJobOptionsPaper:{padding:2*e.spacing.unit}})},TX=function(e){var t=e.addresses,n=T$(e,["addresses"]),r=hl(),i=r.values,a=i.chainID,o=i.chainType,s=i.accountAddr,u=r.setFieldValue,c=TG(l.useState(!1),2),f=c[0],d=c[1],h=l.useRef();l.useEffect(function(){h.current=a},[a]),l.useEffect(function(){a!==h.current&&(u(n.name,""),d(!1))},[a,u,n.name]);var p=function(e){var t=e.target.value;"custom"===t?(d(!0),u(n.name,"")):(d(!1),u(n.name,t))};return l.createElement(l.Fragment,null,!TV(o)&&l.createElement(hk,TF({},n,{select:!0,value:f?"custom":s,onChange:p}),t.map(function(e){return l.createElement(tE.default,{key:e,value:e},e)})),TV(o)&&l.createElement(hk,{component:hB,id:"accountAddr",name:"accountAddr",label:"Enter your account address",inputProps:{"data-testid":"customAccountAddr-input"},helperText:"The account address used for this chain",required:!0,fullWidth:!0}),TV(o)&&l.createElement("div",null,l.createElement(hk,{component:hB,id:"accountAddrPubKey",name:"accountAddrPubKey",label:"Account Address Public Key",required:!0,fullWidth:!0,helperText:"The public key for your account address",FormHelperTextProps:{"data-testid":"accountAddrPubKey-helper-text"}})))},TJ=(0,b.withStyles)(TZ)(function(e){var t=e.classes,n=e.editing,r=void 0!==n&&n,i=e.innerRef,a=e.initialValues,o=e.onSubmit,s=e.chains,u=void 0===s?[]:s,c=e.accountsEVM,f=void 0===c?[]:c,h=e.accountsNonEvm,p=e.p2pKeys,b=void 0===p?[]:p,m=e.ocrKeys,g=void 0===m?[]:m,v=e.ocr2Keys,y=void 0===v?[]:v,w=e.showSubmit,_=void 0!==w&&w,E=TW(y).sort(function(e,t){var n,r,i;return e.chainType===t.chainType?e.id.localeCompare(t.id):null!==(i=null===(n=e.chainType)||void 0===n?void 0:n.localeCompare(null!==(r=t.chainType)&&void 0!==r?r:""))&&void 0!==i?i:0});return l.createElement(hb,{innerRef:i,initialValues:a,validationSchema:Tq,onSubmit:o},function(e){var n,i,a,o=e.values,s=[];switch(o.chainType){case TN.EVM:s=f.filter(function(e){return e.chain.id==o.chainID&&!e.isDisabled}).map(function(e){return e.address});break;case TN.APTOS:s=null!==(n=null==h?void 0:h.aptosKeys.results.map(function(e){return e.account}))&&void 0!==n?n:[];break;case TN.SOLANA:s=null!==(i=null==h?void 0:h.solanaKeys.results.map(function(e){return e.id}))&&void 0!==i?i:[];break;case TN.TRON:s=null!==(a=null==h?void 0:h.tronKeys.results.map(function(e){return e.id}))&&void 0!==a?a:[];break;default:s=[]}var c=u.filter(function(e){return e.network.toUpperCase()===o.chainType});return l.createElement(hx,{"data-testid":"feeds-manager-form",id:"chain-configuration-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"chainType",name:"chainType",label:"Chain Type",select:!0,required:!0,fullWidth:!0,disabled:r},l.createElement(tE.default,{key:TN.EVM,value:TN.EVM},"EVM"),l.createElement(tE.default,{key:TN.APTOS,value:TN.APTOS},"APTOS"),l.createElement(tE.default,{key:TN.SOLANA,value:TN.SOLANA},"SOLANA"),l.createElement(tE.default,{key:TN.TRON,value:TN.TRON},"TRON"))),l.createElement(d.Z,{item:!0,xs:12,md:6},c.length>0&&!r?l.createElement(hk,{component:hB,id:"chainID",name:"chainID",label:"Chain ID",required:!0,fullWidth:!0,select:!0,disabled:r,inputProps:{"data-testid":"chainID-input"},FormHelperTextProps:{"data-testid":"chainID-helper-text"}},c.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)})):l.createElement(hk,{component:hB,id:"chainID",name:"chainID",label:"Chain ID",required:!0,fullWidth:!0,disabled:r,inputProps:{"data-testid":"chainID-manual-input"},FormHelperTextProps:{"data-testid":"chainID-helper-manual-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},s.length>0?l.createElement(TX,{component:hB,id:"accountAddr",name:"accountAddr",label:"Account Address",inputProps:{"data-testid":"accountAddr-input"},required:!0,fullWidth:!0,select:!0,helperText:"The account address used for this chain",addresses:s,FormHelperTextProps:{"data-testid":"accountAddr-helper-text"}}):l.createElement(hk,{component:hB,id:"accountAddr",name:"accountAddr",label:"Account Address",inputProps:{"data-testid":"accountAddr-manual-input"},required:!0,fullWidth:!0,helperText:"The account address used for this chain",FormHelperTextProps:{"data-testid":"accountAddr-helper-manual-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"adminAddr",name:"adminAddr",label:"Admin Address",fullWidth:!0,helperText:"The address used for LINK payments",FormHelperTextProps:{"data-testid":"adminAddr-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Job Types")),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hG,name:"fluxMonitorEnabled",type:"checkbox",Label:{label:"Flux Monitor"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hG,name:"ocr1Enabled",type:"checkbox",Label:{label:"OCR"}}),o.ocr1Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hG,name:"ocr1IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),o.ocr1IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hB,id:"ocr1Multiaddr",name:"ocr1Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr1Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"ocr1P2PPeerID",name:"ocr1P2PPeerID",label:"Peer ID",select:!0,required:!0,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1P2PPeerID-helper-text"}},b.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"ocr1KeyBundleID",name:"ocr1KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1KeyBundleID-helper-text"}},g.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)})))))))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hG,name:"ocr2Enabled",type:"checkbox",Label:{label:"OCR2"}}),o.ocr2Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hG,name:"ocr2IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"ocr2P2PPeerID",name:"ocr2P2PPeerID",label:"Peer ID",select:!0,required:!o.ocr2IsBootstrap,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2P2PPeerID-helper-text"}},b.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),o.ocr2IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hk,{component:hB,id:"ocr2Multiaddr",name:"ocr2Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR2 Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr2Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hk,{component:hB,id:"ocr2KeyBundleID",name:"ocr2KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR2 Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2KeyBundleID-helper-text"}},E.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id," (",e.chainType,")")}))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Plugins")),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hk,{component:hG,name:"ocr2CommitPluginEnabled",type:"checkbox",Label:{label:"Commit"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hk,{component:hG,name:"ocr2ExecutePluginEnabled",type:"checkbox",Label:{label:"Execute"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hk,{component:hG,name:"ocr2RebalancerPluginEnabled",type:"checkbox",Label:{label:"Rebalancer"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hk,{component:hG,name:"ocr2MedianPluginEnabled",type:"checkbox",Label:{label:"Median"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hk,{component:hG,name:"ocr2MercuryPluginEnabled",type:"checkbox",Label:{label:"Mercury"}})),l.createElement(d.Z,{item:!0,xs:12,md:12},l.createElement(hk,{component:hB,id:"ocr2ForwarderAddress",name:"ocr2ForwarderAddress",label:"Forwarder Address (optional)",fullWidth:!0,helperText:"The forwarder address from the Operator Forwarder Contract",FormHelperTextProps:{"data-testid":"ocr2ForwarderAddress-helper-text"}}))))))),_&&l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(of.default,{variant:"contained",color:"primary",type:"submit",size:"large"},"Submit"))))})}),TQ=function(e){var t=e.onClose,n=e.open,r=e.onSubmit,i=l.useRef(),a=i$({fetchPolicy:"network-only"}).data,o=_B({fetchPolicy:"cache-and-network"}).data,s=_0({fetchPolicy:"cache-and-network"}).data,u=kn({fetchPolicy:"cache-and-network"}).data,c=EW({fetchPolicy:"cache-and-network"}).data,f=Sl({fetchPolicy:"cache-and-network"}).data,d={chainID:"",chainType:TN.EVM,accountAddr:"",adminAddr:"",accountAddrPubKey:"",fluxMonitorEnabled:!1,ocr1Enabled:!1,ocr1IsBootstrap:!1,ocr1Multiaddr:"",ocr1P2PPeerID:"",ocr1KeyBundleID:"",ocr2Enabled:!1,ocr2IsBootstrap:!1,ocr2Multiaddr:"",ocr2P2PPeerID:"",ocr2KeyBundleID:"",ocr2CommitPluginEnabled:!1,ocr2ExecutePluginEnabled:!1,ocr2MedianPluginEnabled:!1,ocr2MercuryPluginEnabled:!1,ocr2RebalancerPluginEnabled:!1,ocr2ForwarderAddress:""},h=a?a.chains.results:[],p=o?o.ethKeys.results:[],b=u?u.p2pKeys.results:[],m=c?c.ocrKeyBundles.results:[],g=f?f.ocr2KeyBundles.results:[];return l.createElement(od.Z,{onClose:t,open:n,disableBackdropClick:!0},l.createElement(om.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"New Supported Chain")),l.createElement(op.Z,null,l.createElement(TJ,{innerRef:i,initialValues:d,onSubmit:r,chains:h,accountsEVM:p,accountsNonEvm:s,p2pKeys:b,ocrKeys:m,ocr2Keys:g})),l.createElement(oh.Z,null,l.createElement(of.default,{onClick:t},"Cancel"),l.createElement(of.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))},T1=function(e){var t=e.cfg,n=e.onClose,r=e.open,i=e.onSubmit,a=l.useRef(),o=i$({fetchPolicy:"network-only"}).data,s=_B({fetchPolicy:"cache-and-network"}).data,u=_0({fetchPolicy:"cache-and-network"}).data,c=kn({fetchPolicy:"cache-and-network"}).data,f=EW({fetchPolicy:"cache-and-network"}).data,d=Sl({fetchPolicy:"cache-and-network"}).data;if(!t)return null;var h={chainID:t.chainID,chainType:t.chainType,accountAddr:t.accountAddr,adminAddr:t.adminAddr,accountAddrPubKey:t.accountAddrPubKey,fluxMonitorEnabled:t.fluxMonitorJobConfig.enabled,ocr1Enabled:t.ocr1JobConfig.enabled,ocr1IsBootstrap:t.ocr1JobConfig.isBootstrap,ocr1Multiaddr:t.ocr1JobConfig.multiaddr,ocr1P2PPeerID:t.ocr1JobConfig.p2pPeerID,ocr1KeyBundleID:t.ocr1JobConfig.keyBundleID,ocr2Enabled:t.ocr2JobConfig.enabled,ocr2IsBootstrap:t.ocr2JobConfig.isBootstrap,ocr2Multiaddr:t.ocr2JobConfig.multiaddr,ocr2P2PPeerID:t.ocr2JobConfig.p2pPeerID,ocr2KeyBundleID:t.ocr2JobConfig.keyBundleID,ocr2CommitPluginEnabled:t.ocr2JobConfig.plugins.commit,ocr2ExecutePluginEnabled:t.ocr2JobConfig.plugins.execute,ocr2MedianPluginEnabled:t.ocr2JobConfig.plugins.median,ocr2MercuryPluginEnabled:t.ocr2JobConfig.plugins.mercury,ocr2RebalancerPluginEnabled:t.ocr2JobConfig.plugins.rebalancer,ocr2ForwarderAddress:t.ocr2JobConfig.forwarderAddress},p=o?o.chains.results:[],b=s?s.ethKeys.results:[],m=c?c.p2pKeys.results:[],g=f?f.ocrKeyBundles.results:[],v=d?d.ocr2KeyBundles.results:[];return l.createElement(od.Z,{onClose:n,open:r,disableBackdropClick:!0},l.createElement(om.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"Edit Supported Chain")),l.createElement(op.Z,null,l.createElement(TJ,{innerRef:a,initialValues:h,onSubmit:i,chains:p,accountsEVM:b,accountsNonEvm:u,p2pKeys:m,ocrKeys:g,ocr2Keys:v,editing:!0})),l.createElement(oh.Z,null,l.createElement(of.default,{onClick:n},"Cancel"),l.createElement(of.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))};function T0(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);nt.version?e:t})},[o]),g=l.useMemo(function(){return Oe(o).sort(function(e,t){return t.version-e.version})},[o]),v=function(e,t,n){switch(e){case"PENDING":return l.createElement(l.Fragment,null,l.createElement(of.default,{variant:"text",color:"secondary",onClick:function(){return b("reject",t)}},"Reject"),m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status&&l.createElement(of.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve"),m.id===t&&"DELETED"===n.status&&n.pendingUpdate&&l.createElement(l.Fragment,null,l.createElement(of.default,{variant:"contained",color:"primary",onClick:function(){return b("cancel",t)}},"Cancel"),l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs")));case"APPROVED":return l.createElement(l.Fragment,null,l.createElement(of.default,{variant:"contained",onClick:function(){return b("cancel",t)}},"Cancel"),"DELETED"===n.status&&n.pendingUpdate&&l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs"));case"CANCELLED":if(m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status)return l.createElement(of.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve");return null;default:return null}};return l.createElement("div",null,g.map(function(e,n){return l.createElement(mx.Z,{defaultExpanded:0===n,key:n},l.createElement(mT.Z,{expandIcon:l.createElement(gr.Z,null)},l.createElement(x.default,{className:t.versionText},"Version ",e.version),l.createElement(Ex.Z,{label:e.status,color:"APPROVED"===e.status?"primary":"default",variant:"REJECTED"===e.status||"CANCELLED"===e.status?"outlined":"default"}),l.createElement("div",{className:t.proposedAtContainer},l.createElement(x.default,null,"Proposed ",l.createElement(aO,{tooltip:!0},e.createdAt)))),l.createElement(mM.Z,{className:t.expansionPanelDetails},l.createElement("div",{className:t.actions},l.createElement("div",{className:t.editContainer},0===n&&("PENDING"===e.status||"CANCELLED"===e.status)&&"DELETED"!==s.status&&"REVOKED"!==s.status&&l.createElement(of.default,{variant:"contained",onClick:function(){return p(!0)}},"Edit")),l.createElement("div",{className:t.actionsContainer},v(e.status,e.id,s))),l.createElement(gn,{language:"toml",style:m8,"data-testid":"codeblock"},e.definition)))}),l.createElement(oy,{open:null!=c,title:c?Oa[c.action].title:"",body:c?Oa[c.action].body:"",onConfirm:function(){if(c){switch(c.action){case"approve":n(c.id);break;case"cancel":r(c.id);break;case"reject":i(c.id)}f(null)}},cancelButtonText:"Cancel",onCancel:function(){return f(null)}}),l.createElement(M1,{open:h,onClose:function(){return p(!1)},initialValues:{definition:m.definition,id:m.id},onSubmit:a}))});function Os(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ou(){var e=Os(["\n ","\n fragment JobProposalPayloadFields on JobProposal {\n id\n externalJobID\n remoteUUID\n jobID\n specs {\n ...JobProposal_SpecsFields\n }\n status\n pendingUpdate\n }\n"]);return Ou=function(){return e},e}var Oc=n0(Ou(),Or),Ol=function(e){var t=e.onApprove,n=e.onCancel,r=e.onReject,i=e.onUpdateSpec,a=e.proposal;return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Proposal #",a.id))),l.createElement(MV,{proposal:a}),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(Ts,null,"Specs"))),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(Oo,{proposal:a,specs:a.specs,onReject:r,onApprove:t,onCancel:n,onUpdateSpec:i}))))};function Of(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nB,tA:()=>U,Iw:()=>W,DQ:()=>z,cB:()=>T,LO:()=>M,t5:()=>k,qt:()=>x,Jc:()=>C,L7:()=>F,EO:()=>Y});var r,i,a=n(66289),o=n(41800),s=n.n(o),u=n(67932);(i=r||(r={})).IN_PROGRESS="in_progress",i.PENDING_INCOMING_CONFIRMATIONS="pending_incoming_confirmations",i.PENDING_CONNECTION="pending_connection",i.PENDING_BRIDGE="pending_bridge",i.PENDING_SLEEP="pending_sleep",i.ERRORED="errored",i.COMPLETED="completed";var c=n(87013),l=n(19084),f=n(34823);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]R,v2:()=>j});var r=n(66289);function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var a="/sessions",o="/sessions",s=function e(t){var n=this;i(this,e),this.api=t,this.createSession=function(e){return n.create(e)},this.destroySession=function(){return n.destroy()},this.create=this.api.createResource(a),this.destroy=this.api.deleteResource(o)};function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var c="/v2/bulk_delete_runs",l=function e(t){var n=this;u(this,e),this.api=t,this.bulkDeleteJobRuns=function(e){return n.destroy(e)},this.destroy=this.api.deleteResource(c)};function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var d="/v2/chains/:network",h=function e(t){var n=this;f(this,e),this.api=t,this.getChains=function(e){return n.index(void 0,{network:e})},this.index=this.api.fetchResource(d)};function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var b="/v2/keys/evm/chain",m=function e(t){var n=this;p(this,e),this.api=t,this.chain=function(e){var t=new URLSearchParams;t.append("address",e.address),t.append("evmChainID",e.evmChainID),null!==e.abandon&&t.append("abandon",String(e.abandon)),null!==e.enabled&&t.append("enabled",String(e.enabled));var r=b+"?"+t.toString();return n.api.createResource(r)()}};function g(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var v="/v2/jobs",y="".concat(v,"/:specId/runs"),w=function e(t){var n=this;g(this,e),this.api=t,this.createJobRunV2=function(e,t){return n.post(t,{specId:e})},this.post=this.api.createResource(y,!0)};function _(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var E="/v2/log",S=function e(t){var n=this;_(this,e),this.api=t,this.getLogConfig=function(){return n.show()},this.updateLogConfig=function(e){return n.update(e)},this.show=this.api.fetchResource(E),this.update=this.api.updateResource(E)};function k(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var x="/v2/nodes",T=function e(t){var n=this;k(this,e),this.api=t,this.getNodes=function(){return n.index()},this.createNode=function(e){return n.create(e)},this.index=this.api.fetchResource(x),this.create=this.api.createResource(x)};function M(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var O="/v2/enroll_webauthn",A=function e(t){var n=this;M(this,e),this.api=t,this.beginKeyRegistration=function(e){return n.create(e)},this.finishKeyRegistration=function(e){return n.put(e)},this.create=this.api.fetchResource(O),this.put=this.api.createResource(O)};function L(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var C="/v2/build_info",I=function e(t){var n=this;L(this,e),this.api=t,this.show=function(){return n.api.GET(C)()}};function D(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var N=function e(t){D(this,e),this.api=t,this.buildInfo=new I(this.api),this.bulkDeleteRuns=new l(this.api),this.chains=new h(this.api),this.logConfig=new S(this.api),this.nodes=new T(this.api),this.jobs=new w(this.api),this.webauthn=new A(this.api),this.evmKeys=new m(this.api)},P=new r.V0({base:void 0}),R=new s(P),j=new N(P)},1398(e,t,n){"use strict";n.d(t,{Z:()=>d});var r=n(67294),i=n(32316),a=n(83638),o=n(94184),s=n.n(o);function u(){return(u=Object.assign||function(e){for(var t=1;tc});var r=n(67294),i=n(32316);function a(){return(a=Object.assign||function(e){for(var t=1;tx,jK:()=>v});var r=n(67294),i=n(37703),a=n(45697),o=n.n(a),s=n(82204),u=n(71426),c=n(94184),l=n.n(c),f=n(32316),d=function(e){var t=e.palette.success||{},n=e.palette.warning||{};return{base:{paddingLeft:5*e.spacing.unit,paddingRight:5*e.spacing.unit},success:{backgroundColor:t.main,color:t.contrastText},error:{backgroundColor:e.palette.error.dark,color:e.palette.error.contrastText},warning:{backgroundColor:n.contrastText,color:n.main}}},h=function(e){var t,n=e.success,r=e.error,i=e.warning,a=e.classes,o=e.className;return n?t=a.success:r?t=a.error:i&&(t=a.warning),l()(a.base,o,t)},p=function(e){return r.createElement(s.Z,{className:h(e),square:!0},r.createElement(u.default,{variant:"body2",color:"inherit",component:"div"},e.children))};p.defaultProps={success:!1,error:!1,warning:!1},p.propTypes={success:o().bool,error:o().bool,warning:o().bool};let b=(0,f.withStyles)(d)(p);var m=function(){return r.createElement(r.Fragment,null,"Unhandled error. Please help us by opening a"," ",r.createElement("a",{href:"https://github.com/smartcontractkit/chainlink/issues/new"},"bug report"))};let g=m;function v(e){return"string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null)}function y(e,t){var n;return n="string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null),r.createElement("p",{key:t},n)}var w=function(e){var t=e.notifications;return r.createElement(b,{error:!0},t.map(y))},_=function(e){var t=e.notifications;return r.createElement(b,{success:!0},t.map(y))},E=function(e){var t=e.errors,n=e.successes;return r.createElement("div",null,(null==t?void 0:t.length)>0&&r.createElement(w,{notifications:t}),n.length>0&&r.createElement(_,{notifications:n}))},S=function(e){return{errors:e.notifications.errors,successes:e.notifications.successes}},k=(0,i.$j)(S)(E);let x=k},9409(e,t,n){"use strict";n.d(t,{ZP:()=>j});var r=n(67294),i=n(37703),a=n(5977),o=n(32316),s=n(1398),u=n(82204),c=n(30060),l=n(71426),f=n(60520),d=n(39814),h=n(57209),p=n(26842),b=n(3950),m=n(5536),g=n(45697),v=n.n(g);let y=n.p+"9f6d832ef97e8493764e.svg";function w(){return(w=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&_.map(function(e,t){return r.createElement(d.Z,{item:!0,xs:12,key:t},r.createElement(u.Z,{raised:!1,className:v.error},r.createElement(c.Z,null,r.createElement(l.default,{variant:"body1",className:v.errorText},(0,b.jK)(e)))))}),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"email",label:"Email",margin:"normal",value:n,onChange:m("email"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"password",label:"Password",type:"password",autoComplete:"password",margin:"normal",value:h,onChange:m("password"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(d.Z,{container:!0,spacing:0,justify:"center"},r.createElement(d.Z,{item:!0},r.createElement(s.Z,{type:"submit",variant:"primary"},"Access Account")))),y&&r.createElement(l.default,{variant:"body1",color:"textSecondary"},"Signing in...")))))))},P=function(e){return{fetching:e.authentication.fetching,authenticated:e.authentication.allowed,errors:e.notifications.errors}},R=(0,i.$j)(P,x({submitSignIn:p.L7}))(N);let j=(0,h.wU)(e)((0,o.withStyles)(D)(R))},16353(e,t,n){"use strict";n.d(t,{ZP:()=>H,rH:()=>U});var r,i=n(37703),a=n(97779),o=n(9541),s=n(19084);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.Mk.RECEIVE_SIGNOUT_SUCCESS:case s.Mk.RECEIVE_SIGNIN_SUCCESS:var n={allowed:t.authenticated};return o.Ks(n),f(c({},e,n),{errors:[]});case s.Mk.RECEIVE_SIGNIN_FAIL:var r={allowed:!1};return o.Ks(r),f(c({},e,r),{errors:[]});case s.Mk.RECEIVE_SIGNIN_ERROR:case s.Mk.RECEIVE_SIGNOUT_ERROR:var i={allowed:!1};return o.Ks(i),f(c({},e,i),{errors:t.errors||[]});default:return e}};let b=p;function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;return t.type?t.type.startsWith(r.REQUEST)?y(g({},e),{count:e.count+1}):t.type.startsWith(r.RECEIVE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type.startsWith(r.RESPONSE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type===s.di.REDIRECT?y(g({},e),{count:0}):e:e};let S=E;function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.MATCH_ROUTE:return M(x({},O),{currentUrl:t.pathname});case s.Ih.NOTIFY_SUCCESS:var n={component:t.component,props:t.props};return M(x({},e),{successes:[n],errors:[]});case s.Ih.NOTIFY_SUCCESS_MSG:return M(x({},e),{successes:[t.msg],errors:[]});case s.Ih.NOTIFY_ERROR:var r=t.error.errors,i=null==r?void 0:r.map(function(e){return L(t,e)});return M(x({},e),{successes:[],errors:i});case s.Ih.NOTIFY_ERROR_MSG:return M(x({},e),{successes:[],errors:[t.msg]});case s.Mk.RECEIVE_SIGNIN_FAIL:return M(x({},e),{successes:[],errors:["Your email or password is incorrect. Please try again"]});default:return e}};function L(e,t){return{component:e.component,props:{msg:t.detail}}}let C=A;function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.REDIRECT:return P(D({},e),{to:t.to});case s.di.MATCH_ROUTE:return P(D({},e),{to:void 0});default:return e}};let F=j;var Y=n(87013),B=(0,a.UY)({authentication:b,fetching:S,notifications:C,redirect:F,buildInfo:Y.Z});B(void 0,{type:"INITIAL_STATE"});var U=i.v9;let H=B},19084(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d;n.d(t,{Ih:()=>i,Mk:()=>a,Y0:()=>s,di:()=>r,jp:()=>o}),n(67294),(u=r||(r={})).REDIRECT="REDIRECT",u.MATCH_ROUTE="MATCH_ROUTE",(c=i||(i={})).NOTIFY_SUCCESS="NOTIFY_SUCCESS",c.NOTIFY_SUCCESS_MSG="NOTIFY_SUCCESS_MSG",c.NOTIFY_ERROR="NOTIFY_ERROR",c.NOTIFY_ERROR_MSG="NOTIFY_ERROR_MSG",(l=a||(a={})).REQUEST_SIGNIN="REQUEST_SIGNIN",l.RECEIVE_SIGNIN_SUCCESS="RECEIVE_SIGNIN_SUCCESS",l.RECEIVE_SIGNIN_FAIL="RECEIVE_SIGNIN_FAIL",l.RECEIVE_SIGNIN_ERROR="RECEIVE_SIGNIN_ERROR",l.RECEIVE_SIGNOUT_SUCCESS="RECEIVE_SIGNOUT_SUCCESS",l.RECEIVE_SIGNOUT_ERROR="RECEIVE_SIGNOUT_ERROR",(f=o||(o={})).RECEIVE_CREATE_ERROR="RECEIVE_CREATE_ERROR",f.RECEIVE_CREATE_SUCCESS="RECEIVE_CREATE_SUCCESS",f.RECEIVE_DELETE_ERROR="RECEIVE_DELETE_ERROR",f.RECEIVE_DELETE_SUCCESS="RECEIVE_DELETE_SUCCESS",f.RECEIVE_UPDATE_ERROR="RECEIVE_UPDATE_ERROR",f.RECEIVE_UPDATE_SUCCESS="RECEIVE_UPDATE_SUCCESS",f.REQUEST_CREATE="REQUEST_CREATE",f.REQUEST_DELETE="REQUEST_DELETE",f.REQUEST_UPDATE="REQUEST_UPDATE",f.UPSERT_CONFIGURATION="UPSERT_CONFIGURATION",f.UPSERT_JOB_RUN="UPSERT_JOB_RUN",f.UPSERT_JOB_RUNS="UPSERT_JOB_RUNS",f.UPSERT_TRANSACTION="UPSERT_TRANSACTION",f.UPSERT_TRANSACTIONS="UPSERT_TRANSACTIONS",f.UPSERT_BUILD_INFO="UPSERT_BUILD_INFO",(d=s||(s={})).FETCH_BUILD_INFO_REQUESTED="FETCH_BUILD_INFO_REQUESTED",d.FETCH_BUILD_INFO_SUCCEEDED="FETCH_BUILD_INFO_SUCCEEDED",d.FETCH_BUILD_INFO_FAILED="FETCH_BUILD_INFO_FAILED"},87013(e,t,n){"use strict";n.d(t,{Y:()=>o,Z:()=>u});var r=n(19084);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return t.type===r.Y0.FETCH_BUILD_INFO_SUCCEEDED?a({},t.buildInfo):e};let u=s},34823(e,t,n){"use strict";n.d(t,{N:()=>r});var r=function(e){return e.buildInfo}},73343(e,t,n){"use strict";n.d(t,{r:()=>u});var r=n(19350),i=n(32316),a=n(59114),o=n(5324),s={props:{MuiGrid:{spacing:3*o.default.unit},MuiCardHeader:{titleTypographyProps:{color:"secondary"}}},palette:{action:{hoverOpacity:.3},primary:{light:"#E5F1FF",main:"#3c40c6",contrastText:"#fff"},secondary:{main:"#3d5170"},success:{light:"#e8faf1",main:r.ek.A700,dark:r.ek[700],contrastText:r.y0.white},warning:{light:"#FFFBF1",main:"#fff6b6",contrastText:"#fad27a"},error:{light:"#ffdada",main:"#f44336",dark:"#d32f2f",contrastText:"#fff"},background:{default:"#f5f6f8",appBar:"#3c40c6"},text:{primary:(0,a.darken)(r.BA.A700,.7),secondary:"#818ea3"},listPendingStatus:{background:"#fef7e5",color:"#fecb4c"},listCompletedStatus:{background:"#e9faf2",color:"#4ed495"}},shape:{borderRadius:o.default.unit},overrides:{MuiButton:{root:{borderRadius:o.default.unit/2,textTransform:"none"},sizeLarge:{padding:void 0,fontSize:void 0,paddingTop:o.default.unit,paddingBottom:o.default.unit,paddingLeft:5*o.default.unit,paddingRight:5*o.default.unit}},MuiTableCell:{body:{fontSize:"1rem"},head:{fontSize:"1rem",fontWeight:400}},MuiCardHeader:{root:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},action:{marginTop:-2,marginRight:0,"& >*":{marginLeft:2*o.default.unit}},subheader:{marginTop:.5*o.default.unit}}},typography:{useNextVariants:!0,fontFamily:"-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif",button:{textTransform:"none",fontSize:"1.2em"},body1:{fontSize:"1.0rem",fontWeight:400,lineHeight:"1.46429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body2:{fontSize:"1.0rem",fontWeight:500,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body1Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"1rem",lineHeight:1.5,letterSpacing:-.4},body2Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"0.875rem",lineHeight:1.5,letterSpacing:-.4},display1:{color:"#818ea3",fontSize:"2.125rem",fontWeight:400,lineHeight:"1.20588em",letterSpacing:-.4},display2:{color:"#818ea3",fontSize:"2.8125rem",fontWeight:400,lineHeight:"1.13333em",marginLeft:"-.02em",letterSpacing:-.4},display3:{color:"#818ea3",fontSize:"3.5rem",fontWeight:400,lineHeight:"1.30357em",marginLeft:"-.02em",letterSpacing:-.4},display4:{fontSize:14,fontWeightLight:300,fontWeightMedium:500,fontWeightRegular:400,letterSpacing:-.4},h1:{color:"rgb(29, 29, 29)",fontSize:"6rem",fontWeight:300,lineHeight:1},h2:{color:"rgb(29, 29, 29)",fontSize:"3.75rem",fontWeight:300,lineHeight:1},h3:{color:"rgb(29, 29, 29)",fontSize:"3rem",fontWeight:400,lineHeight:1.04},h4:{color:"rgb(29, 29, 29)",fontSize:"2.125rem",fontWeight:400,lineHeight:1.17},h5:{color:"rgb(29, 29, 29)",fontSize:"1.5rem",fontWeight:400,lineHeight:1.33,letterSpacing:-.4},h6:{fontSize:"0.8rem",fontWeight:450,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},subheading:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:"1.5em",letterSpacing:-.4},subtitle1:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:1.75,letterSpacing:-.4},subtitle2:{color:"rgb(29, 29, 29)",fontSize:"0.875rem",fontWeight:500,lineHeight:1.57,letterSpacing:-.4}},shadows:["none","0px 1px 3px 0px rgba(0, 0, 0, 0.1),0px 1px 1px 0px rgba(0, 0, 0, 0.04),0px 2px 1px -1px rgba(0, 0, 0, 0.02)","0px 1px 5px 0px rgba(0, 0, 0, 0.1),0px 2px 2px 0px rgba(0, 0, 0, 0.04),0px 3px 1px -2px rgba(0, 0, 0, 0.02)","0px 1px 8px 0px rgba(0, 0, 0, 0.1),0px 3px 4px 0px rgba(0, 0, 0, 0.04),0px 3px 3px -2px rgba(0, 0, 0, 0.02)","0px 2px 4px -1px rgba(0, 0, 0, 0.1),0px 4px 5px 0px rgba(0, 0, 0, 0.04),0px 1px 10px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 5px 8px 0px rgba(0, 0, 0, 0.04),0px 1px 14px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 6px 10px 0px rgba(0, 0, 0, 0.04),0px 1px 18px 0px rgba(0, 0, 0, 0.02)","0px 4px 5px -2px rgba(0, 0, 0, 0.1),0px 7px 10px 1px rgba(0, 0, 0, 0.04),0px 2px 16px 1px rgba(0, 0, 0, 0.02)","0px 5px 5px -3px rgba(0, 0, 0, 0.1),0px 8px 10px 1px rgba(0, 0, 0, 0.04),0px 3px 14px 2px rgba(0, 0, 0, 0.02)","0px 5px 6px -3px rgba(0, 0, 0, 0.1),0px 9px 12px 1px rgba(0, 0, 0, 0.04),0px 3px 16px 2px rgba(0, 0, 0, 0.02)","0px 6px 6px -3px rgba(0, 0, 0, 0.1),0px 10px 14px 1px rgba(0, 0, 0, 0.04),0px 4px 18px 3px rgba(0, 0, 0, 0.02)","0px 6px 7px -4px rgba(0, 0, 0, 0.1),0px 11px 15px 1px rgba(0, 0, 0, 0.04),0px 4px 20px 3px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 12px 17px 2px rgba(0, 0, 0, 0.04),0px 5px 22px 4px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 13px 19px 2px rgba(0, 0, 0, 0.04),0px 5px 24px 4px rgba(0, 0, 0, 0.02)","0px 7px 9px -4px rgba(0, 0, 0, 0.1),0px 14px 21px 2px rgba(0, 0, 0, 0.04),0px 5px 26px 4px rgba(0, 0, 0, 0.02)","0px 8px 9px -5px rgba(0, 0, 0, 0.1),0px 15px 22px 2px rgba(0, 0, 0, 0.04),0px 6px 28px 5px rgba(0, 0, 0, 0.02)","0px 8px 10px -5px rgba(0, 0, 0, 0.1),0px 16px 24px 2px rgba(0, 0, 0, 0.04),0px 6px 30px 5px rgba(0, 0, 0, 0.02)","0px 8px 11px -5px rgba(0, 0, 0, 0.1),0px 17px 26px 2px rgba(0, 0, 0, 0.04),0px 6px 32px 5px rgba(0, 0, 0, 0.02)","0px 9px 11px -5px rgba(0, 0, 0, 0.1),0px 18px 28px 2px rgba(0, 0, 0, 0.04),0px 7px 34px 6px rgba(0, 0, 0, 0.02)","0px 9px 12px -6px rgba(0, 0, 0, 0.1),0px 19px 29px 2px rgba(0, 0, 0, 0.04),0px 7px 36px 6px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 20px 31px 3px rgba(0, 0, 0, 0.04),0px 8px 38px 7px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 21px 33px 3px rgba(0, 0, 0, 0.04),0px 8px 40px 7px rgba(0, 0, 0, 0.02)","0px 10px 14px -6px rgba(0, 0, 0, 0.1),0px 22px 35px 3px rgba(0, 0, 0, 0.04),0px 8px 42px 7px rgba(0, 0, 0, 0.02)","0px 11px 14px -7px rgba(0, 0, 0, 0.1),0px 23px 36px 3px rgba(0, 0, 0, 0.04),0px 9px 44px 8px rgba(0, 0, 0, 0.02)","0px 11px 15px -7px rgba(0, 0, 0, 0.1),0px 24px 38px 3px rgba(0, 0, 0, 0.04),0px 9px 46px 8px rgba(0, 0, 0, 0.02)",]},u=(0,i.createMuiTheme)(s)},66289(e,t,n){"use strict";function r(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i}).apply(null,arguments)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function c(e){return -1!==Function.toString.call(e).indexOf("[native code]")}function l(e,t){return t&&("object"===p(t)||"function"==typeof t)?t:r(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{V0:()=>B,_7:()=>v});var d,h,p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function b(e){var t="function"==typeof Map?new Map:void 0;return(b=function(e){if(null===e||!c(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)})(e)}function m(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function g(e){var t=m();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}var v=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"AuthenticationError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e},],r}return n}(b(Error)),y=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"BadRequestError")).errors=a,r}return n}(b(Error)),w=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnprocessableEntityError")).errors=e,r}return n}(b(Error)),_=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"ServerError")).errors=e,r}return n}(b(Error)),E=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"ConflictError")).errors=a,r}return n}(b(Error)),S=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnknownResponseError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e.statusText},],r}return n}(b(Error));function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e4;return Promise.race([fetch(e,t),new Promise(function(e,t){return setTimeout(function(){return t(Error("timeout"))},n)}),])}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=200&&e.status<300))return[3,2];return[2,e.json()];case 2:if(400!==e.status)return[3,3];return[2,e.json().then(function(e){throw new y(e)})];case 3:if(401!==e.status)return[3,4];throw new v(e);case 4:if(422!==e.status)return[3,6];return[4,$(e)];case 5:throw n=i.sent(),new w(n);case 6:if(409!==e.status)return[3,7];return[2,e.json().then(function(e){throw new E(e)})];case 7:if(!(e.status>=500))return[3,9];return[4,$(e)];case 8:throw r=i.sent(),new _(r);case 9:throw new S(e);case 10:return[2]}})})).apply(this,arguments)}function $(e){return z.apply(this,arguments)}function z(){return(z=j(function(e){return Y(this,function(t){return[2,e.json().then(function(t){return t.errors?t.errors.map(function(t){return{status:e.status,detail:t.detail}}):G(e)}).catch(function(){return G(e)})]})})).apply(this,arguments)}function G(e){return[{status:e.status,detail:e.statusText},]}},50109(e,t,n){"use strict";n.d(t,{LK:()=>o,U2:()=>i,eT:()=>s,t8:()=>a});var r=n(12795);function i(e){return r.ZP.getItem("chainlink.".concat(e))}function a(e,t){r.ZP.setItem("chainlink.".concat(e),t)}function o(e){var t=i(e),n={};if(t)try{return JSON.parse(t)}catch(r){}return n}function s(e,t){a(e,JSON.stringify(t))}},9541(e,t,n){"use strict";n.d(t,{Ks:()=>u,Tp:()=>a,iR:()=>o,pm:()=>s});var r=n(50109),i="persistURL";function a(){return r.U2(i)||""}function o(e){r.t8(i,e)}function s(){return r.LK("authentication")}function u(e){r.eT("authentication",e)}},67121(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.r(t),n.d(t,{default:()=>o}),e=n.hmd(e),i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:e;var i,a=r(i);let o=a},2177(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=!0,i="Invariant failed";function a(e,t){if(!e){if(r)throw Error(i);throw Error(i+": "+(t||""))}}let o=a},11742(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;ru,ZT:()=>i,_T:()=>o,ev:()=>c,mG:()=>s,pi:()=>a});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function s(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){e.done?n(e.value):i(e.value).then(o,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]r})},94927(e,t,n){function r(e,t){if(i("noDeprecation"))return e;var n=!1;function r(){if(!n){if(i("throwDeprecation"))throw Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return r}function i(e){try{if(!n.g.localStorage)return!1}catch(t){return!1}var r=n.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r},42473(e){"use strict";var t=function(){};e.exports=t},84763(e){e.exports=Worker},47529(e){e.exports=n;var t=Object.prototype.hasOwnProperty;function n(){for(var e={},n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7071(e){function t(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},94993(e,t,n){var r=n(18698).default,i=n(66115);function a(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},6015(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},861(e,t,n){var r=n(63405),i=n(79498),a=n(86116),o=n(42281);function s(e){return r(e)||i(e)||a(e)||o()}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},18698(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},86116(e,t,n){var r=n(73897);function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},1644(e,t,n){"use strict";var r,i;function a(e){return!!e&&e<7}n.d(t,{I:()=>r,O:()=>a}),(i=r||(r={}))[i.loading=1]="loading",i[i.setVariables=2]="setVariables",i[i.fetchMore=3]="fetchMore",i[i.refetch=4]="refetch",i[i.poll=6]="poll",i[i.ready=7]="ready",i[i.error=8]="error"},30990(e,t,n){"use strict";n.d(t,{MS:()=>s,YG:()=>a,cA:()=>c,ls:()=>o});var r=n(70655);n(83952);var i=n(13154),a=Symbol();function o(e){return!!e.extensions&&Array.isArray(e.extensions[a])}function s(e){return e.hasOwnProperty("graphQLErrors")}var u=function(e){var t=(0,r.ev)((0,r.ev)((0,r.ev)([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(e){return(0,i.s)(e)&&e.message||"Error message not found."}).join("\n")},c=function(e){function t(n){var r=n.graphQLErrors,i=n.protocolErrors,a=n.clientErrors,o=n.networkError,s=n.errorMessage,c=n.extraInfo,l=e.call(this,s)||this;return l.name="ApolloError",l.graphQLErrors=r||[],l.protocolErrors=i||[],l.clientErrors=a||[],l.networkError=o||null,l.message=s||u(l),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,r.ZT)(t,e),t}(Error)},85317(e,t,n){"use strict";n.d(t,{K:()=>a});var r=n(67294),i=n(30320).aS?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function a(){var e=r.createContext[i];return e||(Object.defineProperty(r.createContext,i,{value:e=r.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},21436(e,t,n){"use strict";n.d(t,{O:()=>i,k:()=>r});var r=Array.isArray;function i(e){return Array.isArray(e)&&e.length>0}},30320(e,t,n){"use strict";n.d(t,{DN:()=>s,JC:()=>l,aS:()=>o,mr:()=>i,sy:()=>a});var r=n(83952),i="function"==typeof WeakMap&&"ReactNative"!==(0,r.wY)(function(){return navigator.product}),a="function"==typeof WeakSet,o="function"==typeof Symbol&&"function"==typeof Symbol.for,s=o&&Symbol.asyncIterator,u="function"==typeof(0,r.wY)(function(){return window.document.createElement}),c=(0,r.wY)(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,l=u&&!c},53712(e,t,n){"use strict";function r(){for(var e=[],t=0;tr})},10542(e,t,n){"use strict";n.d(t,{J:()=>o}),n(83952);var r=n(13154);function i(e){var t=new Set([e]);return t.forEach(function(e){(0,r.s)(e)&&a(e)===e&&Object.getOwnPropertyNames(e).forEach(function(n){(0,r.s)(e[n])&&t.add(e[n])})}),e}function a(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function o(e){return __DEV__&&i(e),e}},14012(e,t,n){"use strict";n.d(t,{J:()=>a});var r=n(70655),i=n(53712);function a(e,t){return(0,i.o)(e,t,t.variables&&{variables:(0,r.pi)((0,r.pi)({},e&&e.variables),t.variables)})}},13154(e,t,n){"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,{s:()=>r})},83952(e,t,n){"use strict";n.d(t,{ej:()=>u,kG:()=>c,wY:()=>h});var r,i=n(70655),a="Invariant Violation",o=Object.setPrototypeOf,s=void 0===o?function(e,t){return e.__proto__=t,e}:o,u=function(e){function t(n){void 0===n&&(n=a);var r=e.call(this,"number"==typeof n?a+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=a,s(r,t.prototype),r}return(0,i.ZT)(t,e),t}(Error);function c(e,t){if(!e)throw new u(t)}var l=["debug","log","warn","error","silent"],f=l.indexOf("log");function d(e){return function(){if(l.indexOf(e)>=f)return(console[e]||console.log).apply(console,arguments)}}function h(e){try{return e()}catch(t){}}(r=c||(c={})).debug=d("debug"),r.log=d("log"),r.warn=d("warn"),r.error=d("error");let p=h(function(){return globalThis})||h(function(){return window})||h(function(){return self})||h(function(){return global})||h(function(){return h.constructor("return this")()});var b="__",m=[b,b].join("DEV");function g(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(p,m,{value:"production"!==h(function(){return"production"}),enumerable:!1,configurable:!0,writable:!0}),p[m]}}let v=g();function y(e){try{return e()}catch(t){}}var w=y(function(){return globalThis})||y(function(){return window})||y(function(){return self})||y(function(){return global})||y(function(){return y.constructor("return this")()}),_=!1;function E(){!w||y(function(){return"production"})||y(function(){return process})||(Object.defineProperty(w,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),_=!0)}function S(){_&&(delete w.process,_=!1)}E();var k=n(10143);function x(){return k.H,S()}function T(){__DEV__?c("boolean"==typeof v,v):c("boolean"==typeof v,39)}x(),T()},4942(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},87462(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},51721(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>i})},63366(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},25821(e,t,n){"use strict";n.d(t,{Z:()=>s});var r=n(45695);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=10,o=2;function s(e){return u(e,[])}function u(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":if(null===e)return"null";return c(e,t);default:return String(e)}}function c(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=d(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:u(i,n)}else if(Array.isArray(e))return f(e,n);return l(e,n)}function l(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>o?"["+h(e)+"]":"{ "+n.map(function(n){var r=u(e[n],t);return n+": "+r}).join(", ")+" }"}function f(e,t){if(0===e.length)return"[]";if(t.length>o)return"[Array]";for(var n=Math.min(a,e.length),r=e.length-n,i=[],s=0;s1&&i.push("... ".concat(r," more items")),"["+i.join(", ")+"]"}function d(e){var t=e[String(r.Z)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}function h(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}},45695(e,t,n){"use strict";n.d(t,{Z:()=>i});var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;let i=r},25217(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw Error(null!=t?t:"Unexpected invariant triggered.")}n.d(t,{Ye:()=>o,WU:()=>s,UG:()=>u});var i=n(45695);function a(e){var t=e.prototype.toJSON;"function"==typeof t||r(0),e.prototype.inspect=t,i.Z&&(e.prototype[i.Z]=t)}var o=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();a(o);var s=function(){function e(e,t,n,r,i,a,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function u(e){return null!=e&&"string"==typeof e.kind}a(s)},87392(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=a(e);if(0!==n)for(var r=1;ro&&i(t[s-1]);)--s;return t.slice(o,s).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||" "===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!r||a||o||n,u="";return s&&!(r&&i)&&(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}n.d(t,{LZ:()=>o,W7:()=>r})},97359(e,t,n){"use strict";n.d(t,{h:()=>r});var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"})},10143(e,t,n){"use strict";n.d(t,{H:()=>c,T:()=>l});var r=n(99763),i=n(25821);function a(e,t){if(!Boolean(e))throw Error(t)}let o=function(e,t){return e instanceof t};function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||a(0,"Body must be a string. Received: ".concat((0,i.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||a(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||a(0,"column in locationOffset is 1-indexed and must be positive.")}return u(e,[{key:r.YF,get:function(){return"Source"}}]),e}();function l(e){return o(e,c)}},99763(e,t,n){"use strict";n.d(t,{YF:()=>r});var r="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"},37452(e){"use strict";e.exports=JSON.parse('{"AElig":"\xc6","AMP":"&","Aacute":"\xc1","Acirc":"\xc2","Agrave":"\xc0","Aring":"\xc5","Atilde":"\xc3","Auml":"\xc4","COPY":"\xa9","Ccedil":"\xc7","ETH":"\xd0","Eacute":"\xc9","Ecirc":"\xca","Egrave":"\xc8","Euml":"\xcb","GT":">","Iacute":"\xcd","Icirc":"\xce","Igrave":"\xcc","Iuml":"\xcf","LT":"<","Ntilde":"\xd1","Oacute":"\xd3","Ocirc":"\xd4","Ograve":"\xd2","Oslash":"\xd8","Otilde":"\xd5","Ouml":"\xd6","QUOT":"\\"","REG":"\xae","THORN":"\xde","Uacute":"\xda","Ucirc":"\xdb","Ugrave":"\xd9","Uuml":"\xdc","Yacute":"\xdd","aacute":"\xe1","acirc":"\xe2","acute":"\xb4","aelig":"\xe6","agrave":"\xe0","amp":"&","aring":"\xe5","atilde":"\xe3","auml":"\xe4","brvbar":"\xa6","ccedil":"\xe7","cedil":"\xb8","cent":"\xa2","copy":"\xa9","curren":"\xa4","deg":"\xb0","divide":"\xf7","eacute":"\xe9","ecirc":"\xea","egrave":"\xe8","eth":"\xf0","euml":"\xeb","frac12":"\xbd","frac14":"\xbc","frac34":"\xbe","gt":">","iacute":"\xed","icirc":"\xee","iexcl":"\xa1","igrave":"\xec","iquest":"\xbf","iuml":"\xef","laquo":"\xab","lt":"<","macr":"\xaf","micro":"\xb5","middot":"\xb7","nbsp":"\xa0","not":"\xac","ntilde":"\xf1","oacute":"\xf3","ocirc":"\xf4","ograve":"\xf2","ordf":"\xaa","ordm":"\xba","oslash":"\xf8","otilde":"\xf5","ouml":"\xf6","para":"\xb6","plusmn":"\xb1","pound":"\xa3","quot":"\\"","raquo":"\xbb","reg":"\xae","sect":"\xa7","shy":"\xad","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","szlig":"\xdf","thorn":"\xfe","times":"\xd7","uacute":"\xfa","ucirc":"\xfb","ugrave":"\xf9","uml":"\xa8","uuml":"\xfc","yacute":"\xfd","yen":"\xa5","yuml":"\xff"}')},93580(e){"use strict";e.exports=JSON.parse('{"0":"�","128":"€","130":"‚","131":"ƒ","132":"„","133":"…","134":"†","135":"‡","136":"ˆ","137":"‰","138":"Š","139":"‹","140":"Œ","142":"Ž","145":"‘","146":"’","147":"“","148":"”","149":"•","150":"–","151":"—","152":"˜","153":"™","154":"š","155":"›","156":"œ","158":"ž","159":"Ÿ"}')},67946(e){"use strict";e.exports=JSON.parse('{"locale":"en","long":{"year":{"previous":"last year","current":"this year","next":"next year","past":{"one":"{0} year ago","other":"{0} years ago"},"future":{"one":"in {0} year","other":"in {0} years"}},"quarter":{"previous":"last quarter","current":"this quarter","next":"next quarter","past":{"one":"{0} quarter ago","other":"{0} quarters ago"},"future":{"one":"in {0} quarter","other":"in {0} quarters"}},"month":{"previous":"last month","current":"this month","next":"next month","past":{"one":"{0} month ago","other":"{0} months ago"},"future":{"one":"in {0} month","other":"in {0} months"}},"week":{"previous":"last week","current":"this week","next":"next week","past":{"one":"{0} week ago","other":"{0} weeks ago"},"future":{"one":"in {0} week","other":"in {0} weeks"}},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":{"one":"{0} hour ago","other":"{0} hours ago"},"future":{"one":"in {0} hour","other":"in {0} hours"}},"minute":{"current":"this minute","past":{"one":"{0} minute ago","other":"{0} minutes ago"},"future":{"one":"in {0} minute","other":"in {0} minutes"}},"second":{"current":"now","past":{"one":"{0} second ago","other":"{0} seconds ago"},"future":{"one":"in {0} second","other":"in {0} seconds"}}},"short":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"narrow":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"now":{"now":{"current":"now","future":"in a moment","past":"just now"}},"mini":{"year":"{0}yr","month":"{0}mo","week":"{0}wk","day":"{0}d","hour":"{0}h","minute":"{0}m","second":"{0}s","now":"now"},"short-time":{"year":"{0} yr.","month":"{0} mo.","week":"{0} wk.","day":{"one":"{0} day","other":"{0} days"},"hour":"{0} hr.","minute":"{0} min.","second":"{0} sec."},"long-time":{"year":{"one":"{0} year","other":"{0} years"},"month":{"one":"{0} month","other":"{0} months"},"week":{"one":"{0} week","other":"{0} weeks"},"day":{"one":"{0} day","other":"{0} days"},"hour":{"one":"{0} hour","other":"{0} hours"},"minute":{"one":"{0} minute","other":"{0} minutes"},"second":{"one":"{0} second","other":"{0} seconds"}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var i=Object.create(null);__webpack_require__.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var o=2&r&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,__webpack_require__.d(i,a),i}})(),__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set(){throw Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="/assets/",__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";var e,t,n,r,i=__webpack_require__(32316),a=__webpack_require__(8126),o=__webpack_require__(5690),s=__webpack_require__(30381),u=__webpack_require__.n(s),c=__webpack_require__(67294),l=__webpack_require__(73935),f=__webpack_require__.n(l),d=__webpack_require__(57209),h=__webpack_require__(37703),p=__webpack_require__(97779),b=__webpack_require__(28500);function m(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}var g=m();g.withExtraArgument=m;let v=g;var y=__webpack_require__(76489);function w(e){return function(t){return function(n){return function(r){n(r);var i=e||document&&document.cookie||"",a=t.getState();if("MATCH_ROUTE"===r.type&&"/signin"!==a.notifications.currentUrl){var o=(0,y.Q)(i);if(o.explorer)try{var s=JSON.parse(o.explorer);if("error"===s.status){var u=_(s.url);n({type:"NOTIFY_ERROR_MSG",msg:u})}}catch(c){n({type:"NOTIFY_ERROR_MSG",msg:"Invalid explorer status"})}}}}}}function _(e){var t="Can't connect to explorer: ".concat(e);return e.match(/^wss?:.+/)?t:"".concat(t,". You must use a websocket.")}var E=__webpack_require__(16353);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ei(e,t){if(e){if("string"==typeof e)return ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,t)}}function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1,i=!1,a=arguments[1],o=a;return new n(function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(s){return n.error(s)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),o()}});i.push(s)},error:function(e){r.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})},t[ed]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw TypeError(t+" is not an object");var r=ep(t,ed);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+" is not an object");return em(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(ec("iterator")&&(r=ep(t,ef)))return new n(function(e){ev(function(){if(!e.closed){for(var n,i=er(r.call(t));!(n=i()).done;){var a=n.value;if(e.next(a),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){ev(function(){if(!e.closed){for(var n=0;n0))return n.connection.key;var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(e){i[e]=t[e]}),"".concat(n.connection.key,"(").concat(eV(i),")")}var a=e;if(t){var o=eV(t);a+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(e){-1===eW.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@".concat(e,"(").concat(eV(n[e]),")"):a+="@".concat(e))}),a},{setStringify:function(e){var t=eV;return eV=e,t}}),eV=function(e){return JSON.stringify(e,eq)};function eq(e,t){return(0,eO.s)(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})),t}function eZ(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r;return ez(n,e.name,e.value,t)}),n}return null}function eX(e){return e.alias?e.alias.value:e.name.value}function eJ(e,t,n){for(var r,i=0,a=t.selections;it.indexOf(i))throw __DEV__?new Q.ej("illegal argument: ".concat(i)):new Q.ej(27)}return e}function tt(e,t){return t?t(e):eT.of()}function tn(e){return"function"==typeof e?new ta(e):e}function tr(e){return e.request.length<=1}var ti=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return(0,en.ZT)(t,e),t}(Error),ta=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return eT.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(tn).reduce(function(e,t){return e.concat(t)})},e.split=function(t,n,r){var i=tn(n),a=tn(r||new e(tt));return new e(tr(i)&&tr(a)?function(e){return t(e)?i.request(e)||eT.of():a.request(e)||eT.of()}:function(e,n){return t(e)?i.request(e,n)||eT.of():a.request(e,n)||eT.of()})},e.execute=function(e,t){return e.request(eM(t.context,e7(te(t))))||eT.of()},e.concat=function(t,n){var r=tn(t);if(tr(r))return __DEV__&&Q.kG.warn(new ti("You are calling concat on a terminating link, which will have no effect",r)),r;var i=tn(n);return new e(tr(i)?function(e){return r.request(e,function(e){return i.request(e)||eT.of()})||eT.of()}:function(e,t){return r.request(e,function(e){return i.request(e,t)||eT.of()})||eT.of()})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(tt)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new Q.ej("request is not implemented"):new Q.ej(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),to=__webpack_require__(25821),ts=__webpack_require__(25217),tu={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tc=Object.freeze({});function tl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tu,r=void 0,i=Array.isArray(e),a=[e],o=-1,s=[],u=void 0,c=void 0,l=void 0,f=[],d=[],h=e;do{var p,b=++o===a.length,m=b&&0!==s.length;if(b){if(c=0===d.length?void 0:f[f.length-1],u=l,l=d.pop(),m){if(i)u=u.slice();else{for(var g={},v=0,y=Object.keys(u);v1)for(var r=new tB,i=1;i=0;--a){var o=i[a],s=isNaN(+o)?{}:[];s[o]=t,t=s}n=r.merge(n,t)}),n}var tW=Object.prototype.hasOwnProperty;function tK(e,t){var n,r,i,a,o;return(0,en.mG)(this,void 0,void 0,function(){var s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;return(0,en.Jh)(this,function(L){switch(L.label){case 0:if(void 0===TextDecoder)throw Error("TextDecoder must be defined in the environment: please import a polyfill.");s=new TextDecoder("utf-8"),u=null===(n=e.headers)||void 0===n?void 0:n.get("content-type"),c="boundary=",l=(null==u?void 0:u.includes(c))?null==u?void 0:u.substring((null==u?void 0:u.indexOf(c))+c.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",f="\r\n--".concat(l),d="",h=tI(e),p=!0,L.label=1;case 1:if(!p)return[3,3];return[4,h.next()];case 2:for(m=(b=L.sent()).value,g=b.done,v="string"==typeof m?m:s.decode(m),y=d.length-f.length+1,p=!g,d+=v,w=d.indexOf(f,y);w>-1;){if(_=void 0,_=(O=[d.slice(0,w),d.slice(w+f.length),])[0],d=O[1],E=_.indexOf("\r\n\r\n"),(k=(S=tV(_.slice(0,E)))["content-type"])&&-1===k.toLowerCase().indexOf("application/json"))throw Error("Unsupported patch content type: application/json is required.");if(x=_.slice(E))try{T=tq(e,x),Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T||"payload"in T?tz(T)?(M={},"payload"in T&&(M=(0,en.pi)({},T.payload)),"errors"in T&&(M=(0,en.pi)((0,en.pi)({},M),{extensions:(0,en.pi)((0,en.pi)({},"extensions"in M?M.extensions:null),((A={})[tN.YG]=T.errors,A))})),null===(r=t.next)||void 0===r||r.call(t,M)):null===(i=t.next)||void 0===i||i.call(t,T):1===Object.keys(T).length&&"hasNext"in T&&!T.hasNext&&(null===(a=t.complete)||void 0===a||a.call(t))}catch(C){tZ(C,t)}w=d.indexOf(f)}return[3,1];case 3:return null===(o=t.complete)||void 0===o||o.call(t),[2]}})})}function tV(e){var t={};return e.split("\n").forEach(function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}}),t}function tq(e,t){e.status>=300&&tD(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function tZ(e,t){var n,r;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(n=t.next)||void 0===n||n.call(t,e.result)),null===(r=t.error)||void 0===r||r.call(t,e))}function tX(e,t,n){tJ(t)(e).then(function(e){var t,r;null===(t=n.next)||void 0===t||t.call(n,e),null===(r=n.complete)||void 0===r||r.call(n)}).catch(function(e){return tZ(e,n)})}function tJ(e){return function(t){return t.text().then(function(e){return tq(t,e)}).then(function(n){return t.status>=300&&tD(t,n,"Response not successful: Received status code ".concat(t.status)),Array.isArray(n)||tW.call(n,"data")||tW.call(n,"errors")||tD(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName,"'.")),n})}}var tQ=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new Q.ej("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new Q.ej(23)},t1=__webpack_require__(87392);function t0(e){return tl(e,{leave:t3})}var t2=80,t3={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return t6(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=t8("(",t6(e.variableDefinitions,", "),")"),i=t6(e.directives," "),a=e.selectionSet;return n||i||r||"query"!==t?t6([t,t6([n,r]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+t8(" = ",r)+t8(" ",t6(i," "))},SelectionSet:function(e){return t5(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,a=e.selectionSet,o=t8("",t,": ")+n,s=o+t8("(",t6(r,", "),")");return s.length>t2&&(s=o+t8("(\n",t9(t6(r,"\n")),"\n)")),t6([s,t6(i," "),a]," ")},Argument:function(e){var t;return e.name+": "+e.value},FragmentSpread:function(e){var t;return"..."+e.name+t8(" ",t6(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return t6(["...",t8("on ",t),t6(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(t8("(",t6(r,", "),")")," ")+"on ".concat(n," ").concat(t8("",t6(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?(0,t1.LZ)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+t6(e.values,", ")+"]"},ObjectValue:function(e){return"{"+t6(e.fields,", ")+"}"},ObjectField:function(e){var t;return e.name+": "+e.value},Directive:function(e){var t;return"@"+e.name+t8("(",t6(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:t4(function(e){var t=e.directives,n=e.operationTypes;return t6(["schema",t6(t," "),t5(n)]," ")}),OperationTypeDefinition:function(e){var t;return e.operation+": "+e.type},ScalarTypeDefinition:t4(function(e){var t;return t6(["scalar",e.name,t6(e.directives," ")]," ")}),ObjectTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),FieldDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+": "+r+t8(" ",t6(i," "))}),InputValueDefinition:t4(function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return t6([t+": "+n,t8("= ",r),t6(i," ")]," ")}),InterfaceTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),UnionTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.types;return t6(["union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")}),EnumTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.values;return t6(["enum",t,t6(n," "),t5(r)]," ")}),EnumValueDefinition:t4(function(e){var t;return t6([e.name,t6(e.directives," ")]," ")}),InputObjectTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["input",t,t6(n," "),t5(r)]," ")}),DirectiveDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+(r?" repeatable":"")+" on "+t6(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return t6(["extend schema",t6(t," "),t5(n)]," ")},ScalarTypeExtension:function(e){var t;return t6(["extend scalar",e.name,t6(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return t6(["extend union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return t6(["extend enum",t,t6(n," "),t5(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["extend input",t,t6(n," "),t5(r)]," ")}};function t4(e){return function(t){return t6([t.description,e(t)],"\n")}}function t6(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function t5(e){return t8("{\n",t9(t6(e,"\n")),"\n}")}function t8(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function t9(e){return t8(" ",e.replace(/\n/g,"\n "))}function t7(e){return -1!==e.indexOf("\n")}function ne(e){return null!=e&&e.some(t7)}var nt,nn,nr,ni={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},na=function(e,t){return t(e)};function no(e,t){for(var n=[],r=2;rObject.create(null),{forEach:nv,slice:ny}=Array.prototype,{hasOwnProperty:nw}=Object.prototype;class n_{constructor(e=!0,t=ng){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nv.call(e,e=>t=t.getChildTrie(e)),nw.call(t,"data")?t.data:t.data=this.makeData(ny.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n=0;--o)t.definitions[o].kind===nL.h.OPERATION_DEFINITION&&++a;var s=nN(e),u=e.some(function(e){return e.remove}),c=function(e){return u&&e&&e.some(s)},l=new Map,f=!1,d={enter:function(e){if(c(e.directives))return f=!0,null}},h=tl(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,a){var o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,a){if(c(e.directives))return f=!0,null;var o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(function(e){return e.kind===nL.h.FIELD&&"__typename"===e.name.value})?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(s(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){p(r(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})})),e},b=new Set;h.definitions.forEach(function(e){e.kind===nL.h.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){b.add(e)}):e.kind!==nL.h.FRAGMENT_DEFINITION||0!==a||r(e.name.value).removed||b.add(e.name.value)}),b.forEach(function(e){p(r(e)).fragmentSpreads.forEach(function(e){b.add(e)})});var m=function(e){return!!(!b.has(e)||r(e).removed)},g={enter:function(e){if(m(e.name.value))return null}};return nD(tl(h,{FragmentSpread:g,FragmentDefinition:g,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(eT);function n4(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return(this.nextFetchPolicy=r,"function"==typeof r)?r.apply(this,arguments):n}}):e.reobserve()}function n6(e){__DEV__&&Q.kG.error("Unhandled error",e.message,e.stack)}function n5(e){__DEV__&&e&&__DEV__&&Q.kG.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function n8(e){return"network-only"===e||"no-cache"===e||"standby"===e}nK(n3);function n9(e){return e.kind===nL.h.FIELD||e.kind===nL.h.FRAGMENT_SPREAD||e.kind===nL.h.INLINE_FRAGMENT}function n7(e){return e.kind===Kind.SCALAR_TYPE_DEFINITION||e.kind===Kind.OBJECT_TYPE_DEFINITION||e.kind===Kind.INTERFACE_TYPE_DEFINITION||e.kind===Kind.UNION_TYPE_DEFINITION||e.kind===Kind.ENUM_TYPE_DEFINITION||e.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function re(e){return e.kind===Kind.SCALAR_TYPE_EXTENSION||e.kind===Kind.OBJECT_TYPE_EXTENSION||e.kind===Kind.INTERFACE_TYPE_EXTENSION||e.kind===Kind.UNION_TYPE_EXTENSION||e.kind===Kind.ENUM_TYPE_EXTENSION||e.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}var rt=function(){return Object.create(null)},rn=Array.prototype,rr=rn.forEach,ri=rn.slice,ra=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=rt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tclass{constructor(){this.id=["slot",rc++,Date.now(),Math.random().toString(36).slice(2),].join(":")}hasValue(){for(let e=rs;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===ru)break;return e!==rs&&(rs.slots[this.id]=t),!0}return rs&&(rs.slots[this.id]=ru),!1}getValue(){if(this.hasValue())return rs.slots[this.id]}withValue(e,t,n,r){let i={__proto__:null,[this.id]:e},a=rs;rs={parent:a,slots:i};try{return t.apply(r,n)}finally{rs=a}}static bind(e){let t=rs;return function(){let n=rs;try{return rs=t,e.apply(this,arguments)}finally{rs=n}}}static noContext(e,t,n){if(!rs)return e.apply(n,t);{let r=rs;try{return rs=null,e.apply(n,t)}finally{rs=r}}}};function rf(e){try{return e()}catch(t){}}let rd="@wry/context:Slot",rh=rf(()=>globalThis)||rf(()=>global)||Object.create(null),rp=rh,rb=rp[rd]||Array[rd]||function(e){try{Object.defineProperty(rp,rd,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(rl()),{bind:rm,noContext:rg}=rb;function rv(){}var ry=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=rv),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),rw=new rb,r_=Object.prototype.hasOwnProperty,rE=void 0===(n=Array.from)?function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t}:n;function rS(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var rk=[],rx=100;function rT(e,t){if(!e)throw Error(t||"assertion failure")}function rM(e,t){var n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function rO(e){switch(e.length){case 0:throw Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function rA(e){return e.slice(0)}var rL=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!rN(this))return rC(this),this.value[0]},e.prototype.recompute=function(e){return rT(!this.recomputing,"already recomputing"),rC(this),rN(this)?rI(this,e):rO(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,rR(this),rS(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),rH(this),rF(this,function(t,n){t.setDirty(),r$(t,e)})},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=rk.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(rE(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),rk.push(this.deps),this.deps=null)},e.count=0,e}();function rC(e){var t=rw.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),rN(e)?rY(t,e):rB(t,e),t}function rI(e,t){return rH(e),rw.withValue(e,rD,[e,t]),rz(e,t)&&rP(e),rO(e.value)}function rD(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(n){e.value[1]=n}e.recomputing=!1}function rN(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function rP(e){e.dirty=!1,!rN(e)&&rj(e)}function rR(e){rF(e,rY)}function rj(e){rF(e,rB)}function rF(e,t){var n=e.parents.size;if(n)for(var r=rE(e.parents),i=0;i0&&e.childValues.forEach(function(t,n){r$(e,n)}),e.forgetDeps(),rT(null===e.dirtyChildren)}function r$(e,t){t.parents.delete(e),e.childValues.delete(t),rU(e,t)}function rz(e,t){if("function"==typeof e.subscribe)try{rS(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(n){return e.setDirty(),!1}return!0}var rG={setDirty:!0,dispose:!0,forget:!0};function rW(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=rw.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(rS(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&r_.call(rG,n)?n:"setDirty";rE(r).forEach(function(e){return e[i]()}),t.delete(e),rS(r)}},r}function rK(){var e=new ra("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}var rV=rK(),rq=new Set;function rZ(e,t){void 0===t&&(t=Object.create(null));var n=new ry(t.max||65536,function(e){return e.dispose()}),r=t.keyArgs,i=t.makeCacheKey||rK(),a=function(){var a=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=n.get(a);o||(n.set(a,o=new rL(e)),o.subscribe=t.subscribe,o.forget=function(){return n.delete(a)});var s=o.recompute(Array.prototype.slice.call(arguments));return n.set(a,o),rq.add(n),rw.hasValue()||(rq.forEach(function(e){return e.clean()}),rq.clear()),s};function o(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function u(e){return n.delete(e)}return Object.defineProperty(a,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))},a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))},a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(a)}var rX=new rb,rJ=new WeakMap;function rQ(e){var t=rJ.get(e);return t||rJ.set(e,t={vars:new Set,dep:rW()}),t}function r1(e){rQ(e).vars.forEach(function(t){return t.forgetCache(e)})}function r0(e){rQ(e).vars.forEach(function(t){return t.attachCache(e)})}function r2(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){rQ(e).dep.dirty(r),r3(e)});var o=Array.from(n);n.clear(),o.forEach(function(t){return t(e)})}}else{var s=rX.getValue();s&&(i(s),rQ(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),rQ(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function r3(e){e.broadcastWatches&&e.broadcastWatches()}var r4=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=tj(t.resolvers,e)}):this.resolvers=tj(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then(function(e){return(0,en.pi)((0,en.pi)({},n),{data:e.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return tb(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return n$(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,en.pi)((0,en.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(e){return(0,en.pi)((0,en.pi)({},t),e.exportedVariables)})]:[2,(0,en.pi)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return tl(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return tc}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:nH(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,a){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),(0,en.mG)(this,void 0,void 0,function(){var o,s,u,c,l,f,d,h,p,b,m;return(0,en.Jh)(this,function(g){return o=e8(e),s=e4(e),u=eL(s),c=this.collectSelectionsToResolve(o,u),f=(l=o.operation)?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=this,h=d.cache,p=d.client,b={fragmentMap:u,context:(0,en.pi)((0,en.pi)({},n),{cache:h,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:f,exportedVariables:{},selectionsToResolve:c,onlyRunForcedResolvers:a},m=!1,[2,this.resolveSelectionSet(o.selectionSet,m,t,b).then(function(e){return{result:e,exportedVariables:b.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c=this;return(0,en.Jh)(this,function(l){return i=r.fragmentMap,a=r.context,o=r.variables,s=[n],u=function(e){return(0,en.mG)(c,void 0,void 0,function(){var u,c;return(0,en.Jh)(this,function(l){return(t||r.selectionsToResolve.has(e))&&td(e,o)?eQ(e)?[2,this.resolveField(e,t,n,r).then(function(t){var n;void 0!==t&&s.push(((n={})[eX(e)]=t,n))})]:(e1(e)?u=e:(u=i[e.name.value],__DEV__?(0,Q.kG)(u,"No fragment named ".concat(e.name.value)):(0,Q.kG)(u,11)),u&&u.typeCondition&&(c=u.typeCondition.name.value,r.fragmentMatcher(n,c,a)))?[2,this.resolveSelectionSet(u.selectionSet,t,n,r).then(function(e){s.push(e)})]:[2]:[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return tF(s)})]})})},e.prototype.resolveField=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c,l,f,d,h=this;return(0,en.Jh)(this,function(p){return n?(i=r.variables,a=e.name.value,o=eX(e),s=a!==o,c=Promise.resolve(u=n[o]||n[a]),(!r.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(l=n.__typename||r.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(d=f[s?a:o])&&(c=Promise.resolve(rX.withValue(this.cache,d,[n,eZ(e,i),r.context,{field:e,fragmentMap:r.fragmentMap},])))),[2,c.then(function(n){if(void 0===n&&(n=u),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)})}),!e.selectionSet||null==n)return n;var i,a,o=null!==(a=null===(i=e.directives)||void 0===i?void 0:i.some(function(e){return"client"===e.name.value}))&&void 0!==a&&a;return Array.isArray(n)?h.resolveSubSelectedArray(e,t||o,n,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t||o,n,r):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map(function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;function i(e){if(!r.has(e)){var a=new Set;r.set(e,a),tl(e,{Directive:function(e,t,r,i,o){"client"===e.name.value&&o.forEach(function(e){n(e)&&n9(e)&&a.add(e)})},FragmentSpread:function(e,r,o,s,u){var c=t[e.name.value];__DEV__?(0,Q.kG)(c,"No fragment named ".concat(e.name.value)):(0,Q.kG)(c,12);var l=i(c);l.size>0&&(u.forEach(function(e){n(e)&&n9(e)&&a.add(e)}),a.add(e),l.forEach(function(e){a.add(e)}))}})}return r.get(e)}return i(e)},e}(),r6=new(t_.mr?WeakMap:Map);function r5(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return r6.set(e,(r6.get(e)+1)%1e15),n.apply(this,arguments)})}function r8(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var r9=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;r6.has(n)||(r6.set(n,0),r5(n,"evict"),r5(n,"modify"),r5(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||nZ.I.loading;return this.variables&&this.networkStatus!==nZ.I.loading&&!(0,nm.D)(this.variables,e.variables)&&(t=nZ.I.setVariables),(0,nm.D)(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){r8(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&(0,nm.D)(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||(0,nm.D)(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():n4(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;r8(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,nZ.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach(function(e){return e.unsubscribe()});var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=(0,en.pi)((0,en.pi)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,nm.D)(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===r6.get(this.cache)&&(0,nm.D)(t,n.variables)&&(0,nm.D)(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,a=new tB,o=(0,tP.O)(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&(0,tP.O)(e.incremental)){var s=tG(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=a.merge(u.result,e.data)}this.graphQLErrors=o,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(r7(e,n.errorPolicy)?this.cache.performTransaction(function(a){if(i.shouldWrite(e,n.variables))a.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:r6.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete){e.data=i.lastDiff.diff.result;return}var o=i.getDiffOptions(n.variables),s=a.diff(o);i.stopped||i.updateWatch(n.variables),i.updateLastDiff(s,o),s.complete&&(e.data=s.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=nZ.I.ready},e.prototype.markError=function(e){return this.networkStatus=nZ.I.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function r7(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!nO(e);return!r&&n&&e.data&&(r=!0),r}var ie=Object.prototype.hasOwnProperty,it=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,a=void 0!==i&&i,o=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(t_.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=a,this.clientAwareness=l,this.localState=f||new r4({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!d,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new Q.ej("QueryManager stopped while query was in flight"):new Q.ej(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,a=e.optimisticResponse,o=e.updateQueries,s=e.refetchQueries,u=void 0===s?[]:s,c=e.awaitRefetchQueries,l=void 0!==c&&c,f=e.update,d=e.onQueryUpdated,h=e.fetchPolicy,p=void 0===h?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":h,b=e.errorPolicy,m=void 0===b?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":b,g=e.keepRootFields,v=e.context;return(0,en.mG)(this,void 0,void 0,function(){var e,t,n,s,c,h;return(0,en.Jh)(this,function(b){switch(b.label){case 0:if(__DEV__?(0,Q.kG)(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):(0,Q.kG)(r,15),__DEV__?(0,Q.kG)("network-only"===p||"no-cache"===p,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):(0,Q.kG)("network-only"===p||"no-cache"===p,16),e=this.generateMutationId(),n=(t=this.transform(r)).document,s=t.hasClientExports,r=this.cache.transformForLink(n),i=this.getVariables(r,i),!s)return[3,2];return[4,this.localState.addExportedVariables(r,i,v)];case 1:i=b.sent(),b.label=2;case 2:return c=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,updateQueries:o,update:f,keepRootFields:g}),this.broadcastQueries(),h=this,[2,new Promise(function(t,n){return nM(h.getObservableFromLink(r,(0,en.pi)((0,en.pi)({},v),{optimisticResponse:a}),i,!1),function(t){if(nO(t)&&"none"===m)throw new tN.cA({graphQLErrors:nA(t)});c&&(c.loading=!1,c.error=null);var n=(0,en.pi)({},t);return"function"==typeof u&&(u=u(n)),"ignore"===m&&nO(n)&&delete n.errors,h.markMutationResult({mutationId:e,result:n,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,update:f,updateQueries:o,awaitRefetchQueries:l,refetchQueries:u,removeOptimistic:a?e:void 0,onQueryUpdated:d,keepRootFields:g})}).subscribe({next:function(e){h.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){c&&(c.loading=!1,c.error=t),a&&h.cache.removeOptimistic(e),h.broadcastQueries(),n(t instanceof tN.cA?t:new tN.cA({networkError:t}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&r7(r,e.errorPolicy)){if(tU(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),tU(r)&&(0,tP.O)(r.incremental)){var o=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),s=void 0;o.result&&(s=tG(o.result,r)),void 0!==s&&(r.data=s,i.push({result:s,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(e,a){var o=e.observableQuery,s=o&&o.queryName;if(s&&ie.call(u,s)){var c,l=u[s],f=n.queries.get(a),d=f.document,h=f.variables,p=t.diff({query:d,variables:h,returnPartialData:!0,optimistic:!1}),b=p.result;if(p.complete&&b){var m=l(b,{mutationResult:r,queryName:d&&e3(d)||void 0,queryVariables:h});m&&i.push({result:m,dataId:"ROOT_QUERY",query:d,variables:h})}}})}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach(function(e){return t.write(e)});var o=e.update,s=!t$(r)||tU(r)&&!r.hasNext;if(o){if(!a){var u=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&("incremental"in(r=(0,en.pi)((0,en.pi)({},r),{data:u.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}s&&o(t,r,{context:e.context,variables:e.variables})}a||e.keepRootFields||!s||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return c.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(c).then(function(){return r})}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(e){try{n.markMutationResult((0,en.pi)((0,en.pi)({},t),{result:{data:r}}),e)}catch(i){__DEV__&&Q.kG.error(i)}},t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),r=nY(n),i=this.localState.clientQuery(n),a=r&&this.localState.serverQuery(r),o={document:n,hasClientExports:tm(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:a,defaultVars:e9(e2(n)),asQuery:(0,en.pi)((0,en.pi)({},n),{definitions:n.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,en.pi)((0,en.pi)({},e),{operation:"query"}):e})})},s=function(e){e&&!t.has(e)&&t.set(e,o)};s(e),s(n),s(i),s(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,en.pi)((0,en.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,en.pi)((0,en.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new r9(this),n=new n3({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?(0,Q.kG)(e.query,"query option is required. You must specify your GraphQL document in the query option."):(0,Q.kG)(e.query,17),__DEV__?(0,Q.kG)("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):(0,Q.kG)("Document"===e.query.kind,18),__DEV__?(0,Q.kG)(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):(0,Q.kG)(!e.returnPartialData,19),__DEV__?(0,Q.kG)(!e.pollInterval,"pollInterval option only supported on watchQuery."):(0,Q.kG)(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Q.ej("Store reset while query was in flight (not completed in link chain)"):new Q.ej(21)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=nZ.I.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach(function(e){"string"==typeof e?r.set(e,!1):eN(e)?r.set(t.transform(e).document,!1):(0,eO.s)(e)&&e.query&&i.add(e)}),this.queries.forEach(function(t,i){var a=t.observableQuery,o=t.document;if(a){if("all"===e){n.set(i,a);return}var s=a.queryName;if("standby"===a.options.fetchPolicy||"active"===e&&!a.hasObservers())return;("active"===e||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}}),i.size&&i.forEach(function(e){var r=nG("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new n3({queryManager:t,queryInfo:i,options:(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"network-only"})});(0,Q.kG)(a.queryId===r),i.setObservableQuery(a),n.set(r,a)}),__DEV__&&r.size&&r.forEach(function(e,t){!e&&__DEV__&&Q.kG.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))}),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(r,i){var a=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==a&&"cache-only"!==a)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,a=e.variables,o=e.context,s=void 0===o?{}:o;n=this.transform(n).document,a=this.getVariables(n,a);var u=function(e){return t.getObservableFromLink(n,s,e).map(function(a){"no-cache"!==r&&(r7(a,i)&&t.cache.write({query:n,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var o=nO(a),s=(0,tN.ls)(a);if(o||s){var u={};throw o&&(u.graphQLErrors=a.errors),s&&(u.protocolErrors=a.extensions[tN.YG]),new tN.cA(u)}return a})};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,a,s).then(u);return new eT(function(e){var t=null;return c.then(function(n){return t=n.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return u(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,a,o=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this,c=u.inFlightLinkObservables,l=u.link,f={query:s,variables:n,operationName:e3(s)||void 0,context:this.prepareContext((0,en.pi)((0,en.pi)({},t),{forceFetch:!r}))};if(t=f.context,r){var d=c.get(s)||new Map;c.set(s,d);var h=nx(n);if(!(a=d.get(h))){var p=new nq([np(l,f)]);d.set(h,a=p),p.beforeNext(function(){d.delete(h)&&d.size<1&&c.delete(s)})}}else a=new nq([np(l,f)])}else a=new nq([eT.of({data:{}})]),t=this.prepareContext(t);var b=this.transform(e).clientQuery;return b&&(a=nM(a,function(e){return o.localState.runResolvers({document:b,remoteResult:e,context:t,variables:n})})),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return nM(this.getObservableFromLink(i,n.context,n.variables),function(a){var o=nA(a),s=o.length>0;if(r>=e.lastRequestId){if(s&&"none"===n.errorPolicy)throw e.markError(new tN.cA({graphQLErrors:o}));e.markResult(a,i,n,t),e.markReady()}var u={data:a.data,loading:!1,networkStatus:nZ.I.ready};return s&&"ignore"!==n.errorPolicy&&(u.errors=o,u.networkStatus=nZ.I.error),u},function(t){var n=(0,tN.MS)(t)?t:new tN.cA({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n})},e.prototype.fetchQueryObservable=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast},e.prototype.fetchConcastWithInfo=function(e,t,n){var r,i,a=this;void 0===n&&(n=nZ.I.loading);var o=this.transform(t.query).document,s=this.getVariables(o,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,d=t.errorPolicy,h=void 0===d?c&&c.errorPolicy||"none":d,p=t.returnPartialData,b=void 0!==p&&p,m=t.notifyOnNetworkStatusChange,g=void 0!==m&&m,v=t.context,y=void 0===v?{}:v,w=Object.assign({},t,{query:o,variables:s,fetchPolicy:f,errorPolicy:h,returnPartialData:b,notifyOnNetworkStatusChange:g,context:y}),_=function(e){w.variables=e;var r=a.fetchQueryByPolicy(u,w,n);return"standby"!==w.fetchPolicy&&r.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),r},E=function(){return a.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,function(e){E(),setTimeout(function(){return r.cancel(e)})}),this.transform(w.query).hasClientExports)r=new nq(this.localState.addExportedVariables(w.query,w.variables,w.context).then(_).then(function(e){return e.sources})),i=!0;else{var S=_(w.variables);i=S.fromLink,r=new nq(S.sources)}return r.promise.then(E,E),{concast:r,fromLink:i}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=void 0!==i&&i,o=e.removeOptimistic,s=void 0===o?a?nG("refetchQueries"):void 0:o,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach(function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})});var l=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof r9&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach(function(e,n){var r,i=e.oq,a=e.lastDiff,o=e.diff;if(u){if(!o){var s=i.queryInfo;s.reset(),o=s.getDiff()}r=u(i,o,a)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)}),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:n});var h=function(){return e.getDiff(a)},p=function(t,n){void 0===n&&(n=e.networkStatus||nZ.I.loading);var o=t.result;!__DEV__||c||(0,nm.D)(o,{})||n5(t.missing);var s=function(e){return eT.of((0,en.pi)({data:e,loading:(0,nZ.O)(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:l,variables:a,onlyRunForcedResolvers:!0}).then(function(e){return s(e.data||void 0)}):"none"===u&&n===nZ.I.refetch&&Array.isArray(t.missing)?s(void 0):s(o)},b="no-cache"===o?0:n===nZ.I.refetch&&"merge"!==s?1:2,m=function(){return r.getResultsFromLink(e,b,{variables:a,context:l,fetchPolicy:o,errorPolicy:u})},g=f&&"number"==typeof d&&d!==n&&(0,nZ.O)(n);switch(o){default:case"cache-first":var v=h();if(v.complete)return{fromLink:!1,sources:[p(v,e.markReady())]};if(c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-and-network":var v=h();if(v.complete||c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[p(h(),e.markReady())]};case"network-only":if(g)return{fromLink:!0,sources:[p(h()),m()]};return{fromLink:!0,sources:[m()]};case"no-cache":if(g)return{fromLink:!0,sources:[p(e.getDiff()),m(),]};return{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new r9(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,en.pi)((0,en.pi)({},t),{clientAwareness:this.clientAwareness})},e}(),ir=__webpack_require__(14012),ii=!1,ia=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.ssrMode,s=void 0!==o&&o,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,d=e.queryDeduplication,h=void 0===d||d,p=e.defaultOptions,b=e.assumeImmutableResults,m=void 0!==b&&b,g=e.resolvers,v=e.typeDefs,y=e.fragmentMatcher,w=e.name,_=e.version,E=e.link;if(E||(E=n?new nh({uri:n,credentials:r,headers:i}):ta.empty()),!a)throw __DEV__?new Q.ej("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Q.ej(9);if(this.link=E,this.cache=a,this.disableNetworkFetches=s||c>0,this.queryDeduplication=h,this.defaultOptions=p||Object.create(null),this.typeDefs=v,c&&setTimeout(function(){return t.disableNetworkFetches=!1},c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ii&&f&&__DEV__&&(ii=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var S=window.navigator,k=S&&S.userAgent,x=void 0;"string"==typeof k&&(k.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":k.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&Q.kG.log("Download the Apollo DevTools for a better development experience: "+x)}this.version=nb,this.localState=new r4({cache:a,client:this,resolvers:g,fragmentMatcher:y}),this.queryManager=new it({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:s,clientAwareness:{name:w,version:_},localState:this.localState,assumeImmutableResults:m,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,ir.J)(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&("network-only"===e.fetchPolicy||"cache-and-network"===e.fetchPolicy)&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,ir.J)(this.defaultOptions.query,e)),__DEV__?(0,Q.kG)("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):(0,Q.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,ir.J)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return np(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach(function(e,t){n.push(t),r.push(e)});var i=Promise.all(r);return i.queries=n,i.results=r,i.catch(function(e){__DEV__&&Q.kG.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))}),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),io=function(){function e(){this.getFragmentDoc=rZ(eA)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(function(){return t=e.update(n)},r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=(0,en._T)(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,a=(0,en._T)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e}(),is=function(e){function t(n,r,i,a){var o,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((o={})[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return(0,en.ZT)(t,e),t}(Error),iu=__webpack_require__(10542),ic=Object.prototype.hasOwnProperty;function il(e){return null==e}function id(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=il(r)?il(i)?void 0:{_id:i}:{id:r}),il(r)&&!il(i)&&(r=i),!il(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var ih={dataIdFromObject:id,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ip(e){return(0,n1.o)(ih,e)}function ib(e){var t=e.canonizeResults;return void 0===t?ih.canonizeResults:t}function im(e,t){return eD(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var ig=/^[_a-z][_0-9a-z]*/i;function iv(e){var t=e.match(ig);return t?t[0]:e}function iy(e,t,n){return!!(0,eO.s)(t)&&((0,tP.k)(t)?t.every(function(t){return iy(e,t,n)}):e.selections.every(function(e){if(eQ(e)&&td(e,n)){var r=eX(e);return ic.call(t,r)&&(!e.selectionSet||iy(e.selectionSet,t[r],n))}return!0}))}function iw(e){return(0,eO.s)(e)&&!eD(e)&&!(0,tP.k)(e)}function i_(){return new tB}function iE(e,t){var n=eL(e4(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var iS=Object.create(null),ik=function(){return iS},ix=Object.create(null),iT=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,iu.J)(eD(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return eD(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return eI(e);if(eD(e))return e;var r=n.policies.identify(e)[0];if(r){var i=eI(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return(0,en.pi)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),ic.call(this.data,e)){var n=this.data[e];if(n&&ic.call(n,t))return n[t]}return"__typename"===t&&ic.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof iL?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return(t&&this.group.depend(e,"__exists"),ic.call(this.data,e))?this.data[e]:this instanceof iL?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;eD(e)&&(e=e.__ref),eD(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){__DEV__?(0,Q.kG)("string"==typeof n,"store.merge expects a string ID"):(0,Q.kG)("string"==typeof n,1);var o=new tB(iI).merge(i,a);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach(function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=iv(e);t===e||r.policies.hasKeyArgs(o.__typename,t)||(s[t]=1),void 0!==o[e]||r instanceof iL||delete o[e]}}),s.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[n]===o.__typename&&delete s.__typename,Object.keys(s).forEach(function(e){return r.group.dirty(n,e)})}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,o=!0,s={DELETE:iS,INVALIDATE:ix,isReference:eD,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||eI(e)}:t,{store:n})}};if(Object.keys(r).forEach(function(u){var c=iv(u),l=r[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var d=f===ik?iS:f((0,iu.J)(l),(0,en.pi)((0,en.pi)({},s),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));d===ix?n.group.dirty(e,u):(d===iS&&(d=void 0),d!==l&&(i[u]=d,a=!0,l=d))}void 0!==l&&(o=!1)}}),a)return this.merge(e,i),o&&(this instanceof iL?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var a=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?((r={})[o]=ik,r):ik)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(ic.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof iL&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(t){ic.call(e.policies.rootTypenamesById,t)||n.push(t)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(n){e&&ic.call(e,n)||t.delete(n)}),e){var n=e.__META,r=(0,en._T)(e,["__META"]);Object.keys(r).forEach(function(e){t.merge(e,r[e])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof iL?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(r){ic.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])});var r=Object.keys(n);if(r.length){for(var i=this;i instanceof iL;)i=i.parent;r.forEach(function(e){return i.delete(e)})}return r},e.prototype.findChildRefIds=function(e){if(!ic.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach(function(e){eD(e)&&(t[e.__ref]=!0),(0,eO.s)(e)&&Object.keys(e).forEach(function(t){var n=e[t];(0,eO.s)(n)&&r.add(n)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),iM=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?rW():null,this.keyMaker=new n_(t_.mr)},e.prototype.depend=function(e,t){if(this.d){this.d(iO(e,t));var n=iv(t);n!==t&&this.d(iO(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(iO(e,t),"__exists"===t?"forget":"setDirty")},e}();function iO(e,t){return t+"#"+e}function iA(e,t){iD(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,a=t.seed,o=e.call(this,n,new iM(i))||this;return o.stump=new iC(o),o.storageTrie=new n_(t_.mr),a&&o.replace(a),o}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(iT||(iT={}));var iL=function(e){function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach(function(n){(0,nm.D)(r[n],i[n])||t.group.dirty(e,n)}):(t.group.dirty(e,"__exists"),Object.keys(i).forEach(function(n){t.group.dirty(e,n)})):t.delete(e)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,en.pi)((0,en.pi)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ic.call(this.data,t)?(0,en.pi)((0,en.pi)({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(iT),iC=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,function(){},new iM(t.group.caching,t.group))||this}return(0,en.ZT)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(iL);function iI(e,t,n){var r=e[n],i=t[n];return(0,nm.D)(r,i)?r:i}function iD(e){return!!(e instanceof iT&&e.group.caching)}function iN(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults,]}var iP=function(){function e(e){var t=this;this.knownResults=new(t_.mr?WeakMap:Map),this.config=(0,n1.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:ib(e)}),this.canon=e.canon||new nk,this.executeSelectionSet=rZ(function(e){var n,r=e.context.canonizeResults,i=iN(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?(0,en.pi)((0,en.pi)({},a),{result:t.canon.admit(a.result)}):a:(iA(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize,keyArgs:iN,makeCacheKey:function(e,t,n,r){if(iD(n.store))return n.store.makeCacheKey(e,eD(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=rZ(function(e){return iA(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(iD(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new nk},e.prototype.diffQueryAgainstStore=function(e){var t,n=e.store,r=e.query,i=e.rootId,a=void 0===i?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;o=(0,en.pi)((0,en.pi)({},e9(e6(r))),o);var d=eI(a),h=this.executeSelectionSet({selectionSet:e8(r).selectionSet,objectOrReference:d,enclosingRef:d,context:(0,en.pi)({store:n,query:r,policies:f,variables:o,varString:nx(o),canonizeResults:l},iE(r,this.config.fragments))});if(h.missing&&(t=[new is(iR(h.missing),h.missing,r,o)],!u))throw t[0];return{result:h.result,complete:!t,missing:t}},e.prototype.isFresh=function(e,t,n,r){if(iD(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t,n=this,r=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(eD(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store.getFieldValue(i,"__typename"),l=[],f=new tB;function d(e,n){var r;return e.missing&&(t=f.merge(t,((r={})[n]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof c&&!u.rootIdsByTypename[c]&&l.push({__typename:c});var h=new Set(r.selections);h.forEach(function(e){var r,p;if(td(e,s)){if(eQ(e)){var b=u.readField({fieldName:e.name.value,field:e,variables:o.variables,from:i},o),m=eX(e);void 0===b?nj.added(e)||(t=f.merge(t,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(eD(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),r))):(0,tP.k)(b)?b=d(n.executeSubSelectedArray({field:e,array:b,enclosingRef:a,context:o}),m):e.selectionSet?null!=b&&(b=d(n.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:b,enclosingRef:eD(b)?b:a,context:o}),m)):o.canonizeResults&&(b=n.canon.pass(b)),void 0!==b&&l.push(((p={})[m]=b,p))}else{var g=eC(e,o.lookupFragment);if(!g&&e.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(e.name.value)):new Q.ej(5);g&&u.fragmentMatches(g,c)&&g.selectionSet.selections.forEach(h.add,h)}}});var p={result:tF(l),missing:t},b=o.canonizeResults?this.canon.admit(p):(0,iu.J)(p);return b.result&&this.knownResults.set(b.result,r),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context,s=new tB;function u(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(e,t){return null===e?null:(0,tP.k)(e)?u(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:o}),t):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:eD(e)?e:a,context:o}),t):(__DEV__&&ij(o.store,r,e),e)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function iR(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(t){return t}}function ij(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach(function(n){(0,eO.s)(n)&&(__DEV__?(0,Q.kG)(!eD(n),"Missing selection set for object of type ".concat(im(e,n)," returned for query field ").concat(t.name.value)):(0,Q.kG)(!eD(n),6),Object.values(n).forEach(r.add,r))})}}function iF(e){var t=nG("stringifyForDisplay");return JSON.stringify(e,function(e,n){return void 0===n?t:n}).split(JSON.stringify(t)).join("")}var iY=Object.create(null);function iB(e){var t=JSON.stringify(e);return iY[t]||(iY[t]=Object.create(null))}function iU(e){var t=iB(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=i$(e,function(e){var i=iW(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&ic.call(t,e[0])&&(i=iW(t,e,iG)),__DEV__?(0,Q.kG)(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):(0,Q.kG)(void 0!==i,2),i});return"".concat(n.typename,":").concat(JSON.stringify(i))})}function iH(e){var t=iB(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=JSON.stringify(i$(e,function(e){var n=e[0],a=n.charAt(0);if("@"===a){if(r&&(0,tP.O)(r.directives)){var o=n.slice(1),s=r.directives.find(function(e){return e.name.value===o}),u=s&&eZ(s,i);return u&&iW(u,e.slice(1))}return}if("$"===a){var c=n.slice(1);if(i&&ic.call(i,c)){var l=e.slice(0);return l[0]=c,iW(i,l)}return}if(t)return iW(t,e)}));return(t||"{}"!==o)&&(a+=":"+o),a})}function i$(e,t){var n=new tB;return iz(e).reduce(function(e,r){var i,a=t(r);if(void 0!==a){for(var o=r.length-1;o>=0;--o)a=((i={})[r[o]]=a,i);e=n.merge(e,a)}return e},Object.create(null))}function iz(e){var t=iB(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach(function(t,i){(0,tP.k)(t)?(iz(t).forEach(function(e){return n.push(r.concat(e))}),r.length=0):(r.push(t),(0,tP.k)(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function iG(e,t){return e[t]}function iW(e,t,n){return n=n||iG,iK(t.reduce(function e(t,r){return(0,tP.k)(t)?t.map(function(t){return e(t,r)}):t&&n(t,r)},e))}function iK(e){return(0,eO.s)(e)?(0,tP.k)(e)?e.map(iK):i$(Object.keys(e).sort(),function(t){return iW(e,t)}):e}function iV(e){return void 0!==e.args?e.args:e.field?eZ(e.field,e.variables):null}eK.setStringify(nx);var iq=function(){},iZ=function(e,t){return t.fieldName},iX=function(e,t,n){return(0,n.mergeObjects)(e,t)},iJ=function(e,t){return t},iQ=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,en.pi)({dataIdFromObject:id},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r,i=this,a=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=(0,en.pi)((0,en.pi)({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var e=i0(arguments,o);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),u=a&&this.getTypePolicy(a),c=u&&u.keyFn||this.config.dataIdFromObject;c;){var l=c((0,en.pi)((0,en.pi)({},e),o),s);if((0,tP.k)(l))c=iU(l);else{r=l;break}}return r=r?String(r):void 0,s.keyObject?[r,s.keyObject]:[r]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=(0,en._T)(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),ic.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]})},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?iX:!1===t?iJ:e.merge}o(r,t.merge),r.keyFn=!1===i?iq:(0,tP.k)(i)?iU(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?iZ:(0,tP.k)(s)?iH(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),o(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||iZ)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?(0,Q.kG)(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):(0,Q.kG)(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(ig);r&&r[0]===e||t.fuzzySubtypes.set(e,RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!ic.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),i=r.fields;Object.assign(n,(0,en._T)(r,["fields"])),Object.assign(n.fields,i)})}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach(function(n){t.updateTypePolicy(e,n)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&0>s.indexOf(t)&&s.push(t)},c=!!(n&&this.fuzzySubtypes.size),l=!1,f=0;f1?a:t}:(r=(0,en.pi)({},i),ic.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Q.kG.warn("Undefined 'from' passed to readField with arguments ".concat(iF(Array.from(e)))),void 0===r.variables&&(r.variables=n),r}function i2(e){return function(t,n){if((0,tP.k)(t)||(0,tP.k)(n))throw __DEV__?new Q.ej("Cannot automatically merge arrays"):new Q.ej(4);if((0,eO.s)(t)&&(0,eO.s)(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(eD(t)&&iw(n))return e.merge(t.__ref,n),t;if(iw(t)&&eD(n))return e.merge(t,n.__ref),n;if(iw(t)&&iw(n))return(0,en.pi)((0,en.pi)({},t),n)}return n}}function i3(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:(0,en.pi)((0,en.pi)({},e),{clientOnly:t,deferred:n})),i}var i4=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,u=e2(r),c=i_();o=(0,en.pi)((0,en.pi)({},e9(u)),o);var l=(0,en.pi)((0,en.pi)({store:e,written:Object.create(null),merge:function(e,t){return c.merge(e,t)},variables:o,varString:nx(o)},iE(r,this.fragments)),{overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:l});if(!eD(f))throw __DEV__?new Q.ej("Could not identify object ".concat(JSON.stringify(i))):new Q.ej(7);return l.incomingById.forEach(function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=eI(r);if(a&&a.map.size){var u=n.applyMerges(a,s,i,l);if(eD(u))return;i=u}if(__DEV__&&!l.overwrite){var c=Object.create(null);o.forEach(function(e){e.selectionSet&&(c[e.name.value]=!0)});var f=function(e){return!0===c[iv(e)]},d=function(e){var t=a&&a.map.get(e);return Boolean(t&&t.info&&t.info.merge)};Object.keys(i).forEach(function(e){f(e)&&!d(e)&&at(s,i,e,l.store)})}e.merge(r,i)}),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=Object.create(null),c=n&&s.rootTypenamesById[n]||eJ(r,i,a.fragmentMap)||n&&a.store.get(n,"__typename");"string"==typeof c&&(u.__typename=c);var l=function(){var e=i0(arguments,u,a.variables);if(eD(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField((0,en.pi)((0,en.pi)({},e),{from:t.storeObject}),a);if(void 0!==n)return n}}return s.readField(e,a)},f=new Set;this.flattenFields(i,r,a,c).forEach(function(e,n){var i,a=r[eX(n)];if(f.add(n),void 0!==a){var d=s.getStoreFieldName({typename:c,fieldName:n.name.value,field:n,variables:e.variables}),h=i5(o,d),p=t.processFieldValue(a,n,n.selectionSet?i3(e,!1,!1):e,h),b=void 0;n.selectionSet&&(eD(p)||iw(p))&&(b=l("__typename",p));var m=s.getMergeFunction(c,n.name.value,b);m?h.info={field:n,typename:c,merge:m}:i7(o,d),u=e.merge(u,((i={})[d]=p,i))}else __DEV__&&!e.clientOnly&&!e.deferred&&!nj.added(n)&&!s.getReadFunction(c,n.name.value)&&__DEV__&&Q.kG.error("Missing field '".concat(eX(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))});try{var d=s.identify(r,{typename:c,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:u,readField:l}),h=d[0],p=d[1];n=n||h,p&&(u=a.merge(u,p))}catch(b){if(!n)throw b}if("string"==typeof n){var m=eI(n),g=a.written[n]||(a.written[n]=[]);if(g.indexOf(i)>=0||(g.push(i),this.reader&&this.reader.isFresh(r,m,i,a)))return m;var v=a.incomingById.get(n);return v?(v.storeObject=a.merge(v.storeObject,u),v.mergeTree=i8(v.mergeTree,o),f.forEach(function(e){return v.fieldNodeSet.add(e)})):a.incomingById.set(n,{storeObject:u,mergeTree:i9(o)?void 0:o,fieldNodeSet:f}),m}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?(0,tP.k)(e)?e.map(function(e,a){var o=i.processFieldValue(e,t,n,i5(r,a));return i7(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?nJ(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=eJ(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new n_(!1);return function e(s,u){var c=o.lookup(s,u.clientOnly,u.deferred);c.visited||(c.visited=!0,s.selections.forEach(function(o){if(td(o,n.variables)){var s=u.clientOnly,c=u.deferred;if(!(s&&c)&&(0,tP.O)(o.directives)&&o.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=eZ(e,n.variables);r&&!1===r.if||(c=!0)}}),eQ(o)){var l=i.get(o);l&&(s=s&&l.clientOnly,c=c&&l.deferred),i.set(o,i3(n,s,c))}else{var f=eC(o,n.lookupFragment);if(!f&&o.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(o.name.value)):new Q.ej(8);f&&a.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,i3(n,s,c))}}}))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a=this;if(e.map.size&&!eD(n)){var o,s,u=!(0,tP.k)(n)&&(eD(t)||iw(t))?t:void 0,c=n;u&&!i&&(i=[eD(u)?u.__ref:u]);var l=function(e,t){return(0,tP.k)(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var n=l(u,t),o=l(c,t);if(void 0!==o){i&&i.push(t);var f=a.applyMerges(e,n,o,r,i);f!==o&&(s=s||new Map).set(t,f),i&&(0,Q.kG)(i.pop()===t)}}),s&&(n=(0,tP.k)(c)?c.slice(0):(0,en.pi)({},c),s.forEach(function(e,t){n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),i6=[];function i5(e,t){var n=e.map;return n.has(t)||n.set(t,i6.pop()||{map:new Map}),n.get(t)}function i8(e,t){if(e===t||!t||i9(t))return e;if(!e||i9(e))return t;var n=e.info&&t.info?(0,en.pi)((0,en.pi)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i=r?new Map:e.map.size?e.map:t.map,a={info:n,map:i};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,n){a.map.set(n,i8(e,t.map.get(n))),o.delete(n)}),o.forEach(function(n){a.map.set(n,i8(t.map.get(n),e.map.get(n)))})}return a}function i9(e){return!e||!(e.info||e.map.size)}function i7(e,t){var n=e.map,r=n.get(t);r&&i9(r)&&(i6.push(r),n.delete(t))}var ae=new Set;function at(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},a=i(e);if(a){var o=i(t);if(!(!o||eD(a)||(0,nm.D)(a,o)||Object.keys(a).every(function(e){return void 0!==r.getFieldValue(o,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=iv(n),c="".concat(s,".").concat(u);if(!ae.has(c)){ae.add(c);var l=[];(0,tP.k)(a)||(0,tP.k)(o)||[a,o].forEach(function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}),__DEV__&&Q.kG.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s," object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(a).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(o).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}var an=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=r2,n.txCount=0,n.config=ip(t),n.addTypename=!!n.config.addTypename,n.policies=new iQ({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return(0,en.ZT)(t,e),t.prototype.init=function(){var e=this.data=new iT.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new i4(this,this.storeReader=new iP({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:ib(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=rZ(function(e,n){return t.broadcastWatch(e,n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(iD(n)){var r=e.optimistic,i=e.id,a=e.variables;return n.makeCacheKey(e.query,e.callback,nx({optimistic:r,id:i,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group,]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(r){if(r instanceof is)return null;throw r}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(ic.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||r0(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&r1(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){nx.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(eD(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){__DEV__&&Q.kG.warn(t)}},t.prototype.evict=function(e){if(!e.id){if(ic.call(e,"id"))return!1;e=(0,en.pi)((0,en.pi)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),nx.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),r1(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,a=void 0===i||i,o=e.removeOptimistic,s=e.onWatchUpdated,u=function(e){var i=n,a=i.data,o=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=a,n.optimisticData=o}},c=new Set;return s&&!this.txCount&&this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e){return c.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,u):!1===a?u(this.data):u(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),s&&c.size?(this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&c.delete(e),n}})),c.size&&c.forEach(function(e){return n.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=nj(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(n){return t.maybeBroadcastWatch(n,e)})},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);(!t||(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),!t.onWatchUpdated||!1!==t.onWatchUpdated.call(this,e,r,n)))&&(n&&(0,nm.D)(n.result,r.result)||e.callback(e.lastDiff=r,n))},t}(io),ar={possibleTypes:{ApproveJobProposalSpecPayload:["ApproveJobProposalSpecSuccess","JobAlreadyExistsError","NotFoundError"],BridgePayload:["Bridge","NotFoundError"],CancelJobProposalSpecPayload:["CancelJobProposalSpecSuccess","NotFoundError"],ChainPayload:["Chain","NotFoundError"],CreateAPITokenPayload:["CreateAPITokenSuccess","InputErrors"],CreateBridgePayload:["CreateBridgeSuccess"],CreateCSAKeyPayload:["CSAKeyExistsError","CreateCSAKeySuccess"],CreateFeedsManagerChainConfigPayload:["CreateFeedsManagerChainConfigSuccess","InputErrors","NotFoundError"],CreateFeedsManagerPayload:["CreateFeedsManagerSuccess","DuplicateFeedsManagerError","InputErrors","NotFoundError","SingleFeedsManagerError"],CreateJobPayload:["CreateJobSuccess","InputErrors"],CreateOCR2KeyBundlePayload:["CreateOCR2KeyBundleSuccess"],CreateOCRKeyBundlePayload:["CreateOCRKeyBundleSuccess"],CreateP2PKeyPayload:["CreateP2PKeySuccess"],DeleteAPITokenPayload:["DeleteAPITokenSuccess","InputErrors"],DeleteBridgePayload:["DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DeleteBridgeSuccess","NotFoundError"],DeleteCSAKeyPayload:["DeleteCSAKeySuccess","NotFoundError"],DeleteFeedsManagerChainConfigPayload:["DeleteFeedsManagerChainConfigSuccess","NotFoundError"],DeleteJobPayload:["DeleteJobSuccess","NotFoundError"],DeleteOCR2KeyBundlePayload:["DeleteOCR2KeyBundleSuccess","NotFoundError"],DeleteOCRKeyBundlePayload:["DeleteOCRKeyBundleSuccess","NotFoundError"],DeleteP2PKeyPayload:["DeleteP2PKeySuccess","NotFoundError"],DeleteVRFKeyPayload:["DeleteVRFKeySuccess","NotFoundError"],DisableFeedsManagerPayload:["DisableFeedsManagerSuccess","NotFoundError"],DismissJobErrorPayload:["DismissJobErrorSuccess","NotFoundError"],EnableFeedsManagerPayload:["EnableFeedsManagerSuccess","NotFoundError"],Error:["CSAKeyExistsError","DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DuplicateFeedsManagerError","InputError","JobAlreadyExistsError","NotFoundError","RunJobCannotRunError","SingleFeedsManagerError"],EthTransactionPayload:["EthTransaction","NotFoundError"],FeaturesPayload:["Features"],FeedsManagerPayload:["FeedsManager","NotFoundError"],GetSQLLoggingPayload:["SQLLogging"],GlobalLogLevelPayload:["GlobalLogLevel"],JobPayload:["Job","NotFoundError"],JobProposalPayload:["JobProposal","NotFoundError"],JobRunPayload:["JobRun","NotFoundError"],JobSpec:["BlockHeaderFeederSpec","BlockhashStoreSpec","BootstrapSpec","CronSpec","DirectRequestSpec","FluxMonitorSpec","GatewaySpec","KeeperSpec","OCR2Spec","OCRSpec","StandardCapabilitiesSpec","StreamSpec","VRFSpec","WebhookSpec","WorkflowSpec"],NodePayload:["Node","NotFoundError"],PaginatedPayload:["BridgesPayload","ChainsPayload","EthTransactionAttemptsPayload","EthTransactionsPayload","JobRunsPayload","JobsPayload","NodesPayload"],RejectJobProposalSpecPayload:["NotFoundError","RejectJobProposalSpecSuccess"],RunJobPayload:["NotFoundError","RunJobCannotRunError","RunJobSuccess"],SetGlobalLogLevelPayload:["InputErrors","SetGlobalLogLevelSuccess"],SetSQLLoggingPayload:["SetSQLLoggingSuccess"],SetServicesLogLevelsPayload:["InputErrors","SetServicesLogLevelsSuccess"],UpdateBridgePayload:["NotFoundError","UpdateBridgeSuccess"],UpdateFeedsManagerChainConfigPayload:["InputErrors","NotFoundError","UpdateFeedsManagerChainConfigSuccess"],UpdateFeedsManagerPayload:["InputErrors","NotFoundError","UpdateFeedsManagerSuccess"],UpdateJobProposalSpecDefinitionPayload:["NotFoundError","UpdateJobProposalSpecDefinitionSuccess"],UpdatePasswordPayload:["InputErrors","UpdatePasswordSuccess"],VRFKeyPayload:["NotFoundError","VRFKeySuccess"]}};let ai=ar;var aa=(r=void 0,location.origin),ao=new nh({uri:"".concat(aa,"/query"),credentials:"include"}),as=new ia({cache:new an({possibleTypes:ai.possibleTypes,dataIdFromObject:function(e){if("Chain"===e.__typename){if(!e.network)throw Error("Due to Chain ID not being unique across chain, ensure network is fetched too");return"Chain:".concat(e.network,":").concat(e.id)}return id(e)}}),link:ao});if(a.Z.locale(o),u().defaultFormat="YYYY-MM-DD h:mm:ss A","undefined"!=typeof document){var au,ac,al=f().hydrate;ac=X,al(c.createElement(et,{client:as},c.createElement(d.zj,null,c.createElement(i.MuiThemeProvider,{theme:J.r},c.createElement(ac,null)))),document.getElementById("root"))}})()})(); \ No newline at end of file diff --git a/core/web/assets/main.008c37495ba29761321d.js.gz b/core/web/assets/main.5fed0c0f926fb5542ed6.js.gz similarity index 86% rename from core/web/assets/main.008c37495ba29761321d.js.gz rename to core/web/assets/main.5fed0c0f926fb5542ed6.js.gz index c5cb981d0055351233b5b95ad14604dc0c02467b..e726ba0ead3e4d1a314190a18a787b7a3fc7d06d 100644 GIT binary patch delta 161767 zcmV)6K*+z_kV&qRNq~d_gaU*Egam{Iga(8Mgb0KQgbIWUgbaiYgbuV1EWv--(ZR60_zCiLS!62f7X3u zT65xGKYeOi3;3QMb)K8n1n-ZIyH89D-0|m+pFQiC){L0-oyT1ha>&Nh?lIWyx8R9) zpLV*YwZdneqa)M0B!PwFqho*5dX4u_A3yJ!)`cAzM~|O8dTv@*@IHIqIWnyq%Ine5 z6Vv)cXx_7Dk4)kmkc8*Q!Ej~Jae*73BjQ46jE3U{m`u;q; z{nDMy5}B&iEoiB*qgR3!a3bkv%CCwIhGf~mA7j0zoFjRweQ>q_ovCHLY~+nIm=_hhhDKr#kxPB99~jU|wCm|4-- ztd_|NId(K^t4P!%;(~ukCW%*JVs$rioI7bHJFTk;7zkIkG zd?@fvh3DxA+s@%C>y=%-Mu=O45caoilKCG*?b*&djkuo3*BE~*$?4YOLlsq3DSxAG zPHGFxM!mG8>ZSo@1Ury{-B&z!-+-cH`<1y%cW3EZ+76BLMsX|7TwA!2@&r@kgMCyH zb}x3Xy{?szz;_u;A+aFZsrI@Sq$I4Q(MZdJLouY`Hsraq)L-cmA2Vif?za4s51Nsm zfMc&9706qnlv01QVq)poLhp3xnzbh!b*wiwuAndKRy|=IOZ7>dWpP-y>VcRdyz;$l zUbpIVp%U;WSYL5?Z2e>Bw0yVBsQcef$WUrx{bcXjlZ9S_ZX88q(E1XUr>Ib6K@w@{ z3(wp2GSvlKGIU5UV-=TTe^*fv$(i|-VdP!fJ7amCkc595f0l@8BGS42(I^MY$-d+` zohWS=j_2u$RY+IAZ`6+!bG!!*DCOom+EcZNL(xGhp^CVKBxbp2hPQW?Ug8lK#aIz( zIM&tZ{~m!Ot+v4kR>Jl)gSye!sEUg4{Ph0Xa0hN~xeRZ;&uanYW92U1%x5$G4%yg^ z-czXVPHlg^Gbfvigf)&DKyYx!U4_;qR_-o(MgDS<#Eu8s$HkX9ss6N6t-kJ_a<$K( zrFOGFjR)?#XZc(uaj=~;*t9fFaqII$@X{@JvuXWfVBEW)aNllY9UIlJ@A*`ZL!oo> zuB6!lP!Lc)RE+};uK$bV6_DAzj+HJaxVFto(t3Z!!zutSIPtsK19{BbY~KT0NoQ+m zA+9=brK!C!b`K04FTsCh^mgX3djRhl0#(5sV^cKAc%XYqwCbIe`I9}rbDw^2hp(In z8>6zdn{V%Ol$>CA=sC0^yMWa|%*y(2Hj#@GBpH=9#P!adX(qBWMMk&p!38v#{Sqj4 zC4zremfqO&SY%sDf?g7U`+nH~I;-$ynZlZx4?&mrDJS=}(t`|i@iMm3wX_&C{9Bky ze(DwYp{lD0rlyWAh=&Q>hmC^g~}4^0+&)V+(zA^hCr2GGNvo3^@Zbs!`!MjopGPksed)% zk|a!CiJ!|$VkWYmeu{638wK3iS(_RFqnrfQmD=#P^5<^gizxe*(nfjsuk;PeS2cec zd%2L{_lgJkSLo5lb(lC@EHju1zYQSOVEOj12Gm4CU#*yCO}|ZDW5uL)a?$kL+(lMu ze>D=WBknpOpejnzsA?!C@lBl=6O;Jn!vE?=(1}9VmJ?_ZG18`E^8HOCZP|Y@k{rh6 z5iy&NX_eA1o3Y7vW{jmu&jY9i&TM}|d(z%NiIT-P88=F6K{4${j;*Kfge`iB*|kW2zDN&M0Fi;B9l=h2=2j1uBJq7uZXV-0?Qpq z$X8m->W4x(qne+5iWqr}q;6T5mQy7*XKW7V#WX3N)3JE4jpcD(s*blQ*81R6B!~)B zZ6eu$2CZN;?JL^^_^%W0Kl#?jLCGqs)Egsu<=_z42M%Go)XZz|)f9iqBt-ra8lS^W z*xi@LRRNjVQBJ_+n~crWea_^(1u3Km-@#q}URkeB6l9`2upEph688NIt%~`rYLgNb z`4v||QDcfSvzX*kDG(|9t{^WCTZ{8s)-Vo*pgXLmM}7K-jUF{(P!Ub*h|`!{)Q0uU0X$INJdRky(_eYvGo^1R@%4HM zJ1dyhz{gDBsAmUjJD@$`^anLi+hPk_3Sw8usbCOImN<0rANYS);a>v3l7yo`Cj>^W zkmFduwPiPI394`|*teQc1*O}$RHHr~Rl#?zYQ5ufx3u%Vo0& zHn=J)ZM~~4wQGNzmg<6)^(FO2?Ay%MmLl zmTu$Dg{P6B2T=rz-^Jl|<(z|X29{MS80}O}nu&z#%b0(qFhY$ZAl$r;P+*5A(7I?w z3mwlvc#2{qbJn}nf{5|XkjVy1Vn)^HnM1yU+%*a*O8T@yqhDPU!c`D<#qzZ}^kv$i zVDtyfYr%%o%MOGsUQy~2ccf0MKRpH$pFvF%)P8|wilGDX+2e%fUD4+t7?04=y+}G! zkQm2Ix$}Rs9%#n5wqNW7gbh(2&U%)dg4wQEnpo;sF_}~XBP(Kv9Y_+QRL!uze#{1{ zKQs&2Zg0N`2pc)hFS`wY2@Cy@9`AL`M(X>!7;Bt8-d!g{_3|cWck1PR%|wH+$C%w$ zLh2Lt0ENbSgRrZZ-E`SaUUE)vA_aI05{DM^^=N1@IUn#5SS6h1Sl8>4?L@JL8&j9*nO#4UUM+!-45rw}*F8}DfZ@sM1Dt?wn$7Zh~`;oqR*ejj7 zun6ZeowE0)u*<&nO+JA2fQasTv>Qb1=i>cu(W+k9KVqh&aO|7dJNz_4dAfCfdW3&{ zP$H*0`iZdb^=~dLfc{vrfV8ceVz7{2X_Eo`>BlP7-ctM``=%6_I%j(!)d?>$MRJWA zNH3OX?WqHrgYSfGteWri9)zN`1I^xmq0F!gYSbukIPHm;t&Kq@wAKT$>zc^T+`8<0 zpA)*41`#j$)73ugRGk3E)2a9xaJzqa*_uuV&1U*_Ol|ixLxr+yrP9B%_9FO?bt-d! z;Ra3@Ge0vR>NlHdpeE{DkV{IwX2xO#Lc}$jrI5Q>fD4+&$)#BR+hqFW0O`>}r zCSi4QRhk_U@tyWauqXlmH4shXm}${O(WZgJ2-4|63KmmP9c_J`Zy|1QZIFK;UaeMz zyn%U49rg!i`fL%__XV(O!+2!{%m^_^IiayXh`l@d=>z4Mlv4y<_Q7X=_#)J$__Yio zO8PPA`7o*wR_#JdrX=bI?bwVAL2=$ zT_$5MX+7BTxLwZGXOXlbam-XsdQdiZG_y_Ri0bB{1xiw zOH-FJ--HfKDDwb#vc4nFV6qMN31k5o-uB=)$T$eTz<&_FY$P6OX^VE)T>nz=wX+s} zVx6=|YuuToV6U47gKcoLDVHnI41=MsCSvmj!SHC+&YqqgHkW~qiUND z94*S^=4O~n#XV9NfeSd0#&0_4$YN&Zs|$ANmu%4w8-Gad4u>j=;W}u!tT2C#IdKA% z@f2i8-T)sSfyk@5Xg0YIF}5IF6qA^I%%3PL8Ch7# zpyL?y=YJUQslDyodmw{m!O2%N$VfK-aPQ)=pZk?JL2`Bg1m+7=+bfIp3M6_>^*SVaVP}w7EG&T$GKQ(B znSWy)7So1{zQ_O$ye-<#0`&9`@;Keh-p^qAIqm4Se@eO~AVD%WDx&3uD7 zN|+0C7)0(@)$2*=xs&Q;Y&qA;zT)QOxZvh`X4fC^K2FWS*eNr=(zWX6dU7y+s5JF~ z4~Op+2$pTF(6t)}uHsJ7rWh8PVhSxdxAI{;#h+GolP@`$q-+pr$Bt7rn5ow5m=ghw zr{=J-@)|J&oZu{;Sa(LmdY2W{4n#h}2DjmH95C0cCJ3B7|BEiLfeS3FvJs|P{!{WEL zcLE~8%YUcU+J)cX=D*QyuWwrlHhHFlLnsZioK9ttksTeE^QVgQvPq2$d_OY$sfp#* zsmB(QA2s(`zCA59t5x@tW$g-qI%1>!#%y0sgLWe(xu}1LXD+8xcH#Z)Z|2#%EHWW+ z<2i8weiPtY2B_4eUg9y&EelrsB=$wjG2gTwfE~I(!#!HbNxdScQ>x*GJZ%RW4m#Rw zVH`{{<%B!Vvx7i?$#klw$U_AV$ib_xrXr6BM8MKaa+;_0vQwqWbKhi}v$*IZ6>+FR zrDS&_*^qxp1B3OCdlJ$pibSj-bgqYmh$#H^S8*g7=sN))T(gF$L+}d<%hyoikWBIA zxAY#usMS`$4;pt&-X;+9$QtW$S-SF3dAX{kpHAh8`EhQ0LhE95a(1Wj&b8@!V{5(n zlkrBh(tMZb=(XNSF6t2#u^bv7l}bX$i5w8`n2vw&gXz>eW9nNo9JTKufS@l_2POnv zrayW9cfT9G=hLG=NWUBHPTSkljrG9qM*Bm0H)4IA$os43N}Df&%2bs}zua@^rzW)5 z0}S_SEM+31$siH(3=q-AI_V`tz{=r>4w;l7KH+yXeGKm?7c+9l#29@sC)%s%JQ+nT zq91==DR+bx=C^qh`z>-EK5%)9Zai7w%e}zKrJ1DT0zTObk6Hm*(aB?f7>+ZhxG|L@ z5mO05P*_4^h+1JMvt+@9LS$%_OGjO#!Hi_KMvwa1U~615@$&r^k&ofwNdO-A;BH^e zyK5@&hrB{(&gDJ~U#Ij2Jy{WVSKmLH3yFVBbY}5WJ{l<@Od|G&y!SCmX0^}cL--4s zAf&)cF_K|v5obYA|Ktij;r+i)>oG{m?ahcZ=~-&u?b;t~Z_Wq=42?|eLx|5MFvoe65ehkN%0*xkt^jB&HGzGGjh2Yw+8JTRz-W*NT`<%Ai9|6jW! z>#m5>NYRC511T@_dpK>N#X$|Xl}&&26ovzzAPArj$s#doQel!hM?s^o$y=AUdjZ_! zfj_xcSY`zbgh9-z>DNdeh3R{Agg3-aU@5}oyMGQPa{3vR$Z!9lM81p?dHpX$iTqrq zL{1eY@|z(*UYQ@SOO(i~ncQz&R-bIP zSODe0V*!*0EqgCHD34O2ZLTSgzmjgCjvH{lN;ecBUraP)OiC_pvMSY({*O=%?e*OX z*^m}wL-J>n4R4DZKOr)Syyp-#!J859d-m8krh?um9Zayyw@TLrU+){On^I3I0^%!Y zOp0923upQ^WdoEu@;-_i^Lc-uuu*q6Z)f2}OC~aj1mXQCB?T0?y>+B^3Xp%qQrQB_ zZ&Z@L_053D53ci@CW(wDgCYC$O`1GJZ6m|nAjv&T2gBqc@@{#*&xAKqhx(m5$m~OHVCu(8_VKU{$zhqyg&VmQ@r0TMe+U~o)h_#KgrTwB!3}vC?jwGmU1!V;$!1v zq=~#4Xu@Y5`JKI9N(Epol{rIJkzTSNV)>l~=XS{m1lJuY2UvSG`WDLjwzsxyhGgBg zK3V^_HFw&uY<&xFmUVPI(N-qfzF`wNxSj0{8%o<1lO~eJ&wqbSe-+aU$jW;8{D$zj z4NADxb_d+gLiUOEd=_3O{l@@ve_~*um$DP^Ra0}#*Tt(qN#qQSMy8OQG~$3J$9Ezs zQP5j9gm--t?w7zY&2OfX^V%l%a@P(Oz`|joVn3e@1{p)lHog;U5Qk9i_##+U!$&p^F zb>`YK)FCSF@PZ?|G|2O+t+$Gm>MPfj!7xcufBYQc;NHgL|JrSl5pY!3ajSFv(tO&v zUX6EK!AS8-15IsTlk3&pR*-AYdaLq(f&_FdJcl@#4 zYF=YieW`k|w#W1PFW>(%vWpvM%u z%GH=E?(2W5pLV^*wBfC$k=K|)NP0UyeKEHkt8>lS!}6%Q4ZEsfWxj96XKTiQF<7-i z$_QzpPa*$Z(WfXSKDI-LDIcA}&d|DQRWF$__FPm4n!#M4aa!AS#WFZsIAB>XTJ&ibcotFEer$ z$-jh=v&ia3&M@?vku%PxY~(D)|7O;?;;v#pD|(he-pH@#D#*pVvAEHwPUg8yRMNJ< z#Ifbh;w0Z7KcI?u=iyQFEZ-=2uBXRJ@*C)`=lD;8HWe zlWfRawyR(sUhEFnma-DQ&pRIMiL)W*2Iqfto)mHC3sUnDz@b{0#22@CX1cWvA62u` zDLi-qumntK-N>nteRHrL^NnpF#>v)IAa_G?D)10WAA=dyIu-IZJz#ND6j!hm=+Z~Nw- z=>3A2{l0`##29zJj>{!_paijwEhAPKgJ2@4LD9s&1{T-$a6ryB_An&o4{s3Lc;q@v zP^?XdSfDA%teYE(U8A8|7K=x}W=emYMrrpVz0_3;J!cR2SV;Un(Cx+kU91}ln#~+j z-F5Gxi_6Zi;C6?GNa>SXG9uUHj@-lp$Z9i8dL7l+O|#ik?C?!6>%qW!0lC&f2Hhd= z@<`)izaRI4=`_Dn`Z_8})CXoyizcqaQKDinXNH*W(!7P+atpVnh1_Jh%wSwb zIFZG)+2mb1?;E-8bHs6Zx1(~mBh&3@K@&A$3yxs~87kDg5{PtAM5(#gI^xVUo`vj_ zWFkW|U~>qt%DCB-8~%OJy|${vBK0RTavwzHQtWHo9Y>QHna3fBfqxy4$sNlwdc&eg ziL#!N9B`#Ks$~nTGXk@7)`5Q)Gg1u8S*dv4Y}#z3{U)%2h`}i;kF`BR1IVmas+OWw zoNu+-o6=dVzJ+^Goz7-6gVpVQ47$FX@>Zbru##tZ7yZ$~%Qhfl=wCyqdK^R8qa)CE zpTURcDebZDoO0cz$T`MkMx;odV5xCk7i34~3uCNpZjbrK&Ei4F0Mvih&~h{U`89DS zJ~Fy%v}hJHU-T6e0vqSrX|4-Gbvm`vRGY(O6PXXT7)$SYl}S+H#j=rzE?pD^orjoK z*q4}6?^ofi$}JxY15MJaJcYOkF(0=%GC`4WtcBM9`I`=XX)+9AM6-!9)lV>%S<#Or z;LTi#AjMUM#{>FV-1~pt*`tv3lS*D06=@empe1*N5tKV1AP&)Bcw_5DK!i&4wcg$d zh{&U04N}JbVE*Ln2 zBk%T358qzBi9Fx@K8?JDD4W%J0<+w;gf z0>^;YZ%&|bj0o?Mv-8s<7{A%zuil*Oe}834Uk#JqNAqg` z&m*r-_r8JduMQ4hAH6+NA2OVa1;Vw}BJ#zBuyTkqS$W#CItjd$9lz4w+@ARAZwYfS9aaj*fU+?W7 z!W{HZkGy}2U*JEF9KL;j9C`3p{l5Bf@6G!|Rib`FJMZ3~UzxGmPv%{H-0pJR6~~x7 zZ{r2T+d7#aPFvHPaBR=Q5AS{PF+4kYO>~fKqSAw*Pl%?wn4S9lBNHapv9upR{}Q*0 z-)BIg#I1jsmFGec#f9jd_U{*Erm*_Udn$*PW6LAY5C*c@w@!DMs1bnqOLk?`6GWKx%^2Xx}x3l{AZ5vY9*(ol0&=e zqj!gum#5Y>VaE*Q*<1P+g1#wGN9<*LeWzQ==BimmFbCVe1-phmhJTKpdB6TTerB!{ z-)ptJ)qi#(;V<(6zVn+6O))qAk7Lb~dGUwyS@!U1$Bh<9CkAn=NN$eKuSlv=@Bf8qVf+ z#0UQ7whO4urmK8Cm&TP5E1pN}VZ-!*IpS46TkdJ&v2_e<+dU6;u3hyv-B3Mu)P3P@ zJI4&JPc{~Q;sR`Yef~Fx&Q99v?nwapaaP}2(1CO7ZNge_Y`WLlRc@{IZ^h0hRwRGS z)7pX9+|q}ASO3>YV5_D7xAlLG6t*_>|4sd0f4{Y@|L^3}e2bkW<(1dfw{`XH9sOT- zzpcC9(cSOp?ss(eJG%QF-TjVkZ%4Pcqublj?HSaztJ~Yv?d|IJc6EEZy1iZ9-mY$M zSGTvT+uJp$Qn&X)*MFhwz0mbu=z4$cR?GZon;+}u$A(AKT`~j`^``ewdcq zrscM2xoui*o0i+A<+f?LZCY-dmfNP~wrP3Yw7hOwUSH2w^_8`SW=fMFuCPoT`AMMo zsGhlghPCU*i6~B96HYi}dM=Aa?Kr&b<;Hrm`2q-@X0zSW|2L2T%C(kY7|VZwP6Ius zvZc@S<5|2P5COysy&&3nfiY#h_kx*_kt&^c8QkapR6rh#u8| zOxCo~PsZ2z7yhqa(DfoSBn+~P0~!}yEF6D|Bp;OkODEEc zm0nt8Rs|%$mT8vEd`~7v%=T$=5Di@y^ObZf_$$rGA6mFgf#zQUjuA-;ng$jf3DVLMl0Lj880^)B2$g>OSwB2gsOif$< z<_4FC<_{haNu(QQ^^@BJx>*Sj#K-Umm$l{(HAmDwh=nLi4?l_Vki-cY$1Sw&>m)B} zp7vEA#BogRi6meViFjQnCY#?&%9?gmASbCh2C?|E_|_$g}?qXVp)%lSR;e94iJCwxAE(*<9xXWdein+V;9Rh3`nvXZ|XUk z=q_K-W8R^w7qekzS-iTM%x2~G-;3N{zu!ht$eeXgJ$1(s~cn-XF7bk=XJ7N zdYm7$UKuGu7@gu^^)&5Vu2Rs{mGXk79@!bl&zw}`xO-h71jyG$3O40aERD{^o^hZZQ-*R3zVEg64AVBcRU zTUDfxP26u^D`LKSI?Ep%txw^3fLR+bagz8Hev9@-AW*#;vQIi5lQ;o&k19=6P?}gS zk^tk7Kvgm)wV|RSPzY>*mwPOLz%>$w;jMzHHq29A$Dm-2w0sz>?!XhPJpVZzs>x^} zajm0+lYLYM5LAF_MX$;cO~rqs5u~e-z}Q({jc6hBf`R3AUCF^ljD5@@5NNWXHe&5^ zt>UO*7$6TBOV6aR){oivS{c$>kIc{j`X>iWGoU^5JQl@xL0O(x8;zy@-RCL8q+pKGfYsgEVRP z=+M{)_=Uc;v=CZgRoLJ?0liuy#+Dgh2g{CMVP_o<%+T0M^)avWxtfsDUVmbK)*(1~ zcX*0=L`(ey-m$9RNbfskOQAKt=t_7!wDx!wU0jlU{qQNnh*dlhXG}%~AkM5}zjA)S zYgFMV2l#b#!4hQcQv`n=dDeG;g&@Al@-r1`j?6i|qTwIwZ~efYyM-_ELVu+ld?7^Y zdjTNvIS5vx7v@4I+L}T=bt=e3zsw6dbFodiaOU3Dtk~BMAkI@8s*8sXk2Oj*YJo*7 zLJDobqCUUq(s1an^Bv>ZCJ^lp!matP^+ClzK+0$$x1fgYYchY;<85d)aiXD;H>H#Y zLDwF^aLnGIgV4}lX$9u=KDkv}3$8UYt>r=2a7|n(j!LJ~z*U{X>Or1ABK!D!(Sn{G zzB$}Sv~YHKUL4X2C15lfj&n;2eZ(^3oVU>pHd8t#dnL_P><1QHUUN3IuL^v2TnNgB8yspMWY5nhn!{+)5}^ISX)!c!-OE3{6bV( zx#+s{5Ue={rG*mKLgk}zx%ykp?t`JVsqC0dXDKY^L{+AVCHAvpAr>7xjd841G8Qpr zf$j@b<3JDtGqY;aYDi5azq%`&H^3W3P#tzx`|m)3qF`gl=BvRht^zM{sK zzEZx7`f)AN=Muts?u2|*^3}+hpMV%|AVWeLcGouQX1S>-Hk5MsmJZFp%*~huaSV=j z&ZV?yhQ)u&`6V=HdC8nph7CxZOZiulu+cvRivP9Ks_o6H0x#e6F_rZf$?UN{(#qmSWmyDeREt6vLAx7EGq& zT-0F={ME_Ho5Q`gdgv=H_o%%A9cD{>-k$S0AUwy{Z{NRpQ~#nI)ZVHN)~`>%cxJ$( zExR#YNL@fu@Jq9&gd!#Qe=Z}kXv=6lL|OEB4c6NcvkXE@N{hJ{7M!0sM{^EI?%)d? zv-z}6szJKxH69>1E^6S`k_7W z!zG4YVS?r(L?Zq{vRMsW8E&f!Oe`jy*@6qCxQ=3XOsk8_PKj9DI}bX6RIYW7TMZ0t zJB7V+wU?!Cj0MoxJ1>Fa;OG<>=pW~??u&m}zC~~;i9^1W-m9^(`Jq5ocCPS+xTbEM zAQo2+;MMuh?+%r;r;Y}Ls4AV*6be~5)V;Ug1SL}P?aA9KK++34i&zfAyr(Z>$lyvl zP+fhdSjHvro->4+_`GY6%<>3`oN{g(H6s({ly@4XMg2C%7cMP_QfxRrfEO^o`bU3C z0Wya~a(`keN^0L7nRo6_wN9n>*?Xa-#135vs$Obe9E$PXyy2mO#xb?; zO)BzSE$^Ez%q%Gv%7S!r_c|n}=&gTcb8`J+#F4aFFHtC3Fjird&PN?{#`3w)t7?ws z-|IE#S?Ia5Kw$=W(XC683NwoZ;$R0B`78DZA~E+2{h%ZVE^isvYJ)FcZPMi>*OZX8 z@{1PQfj<6x7$8nw3Ia!WBNc@+%MmZgRrvgKMdOM1Ndd7URyO(&U0f%sY{q|9VfyYo>4mfO;!@LPRTW45lEGoRFPAdV{v>ojo;dG@ z2{~Yc?CA@FFJKkuXW-GQudn;`7fe&C?h0hO0@ADmR2=Ft11}9EtX+`95C&gBxJjhc`4e!m zI-iGcma$o>-LL2o>bhW~i_3fjb;kA2Unu06|Iu}Vf#OMjVwYn)iO*juE&E-tR;~do zdq32#^1QVtu5(Adzx01fe+o?(;X3{#9%il_oZHIk*a86Eb(i&x1alm9eHqh*S`w4kx}&69G*+80ZU8EaoYDP^pE@r01k zF}9^-jJ6T?lNP2GV1K4y*Wdxj_4vXiI^>z0yZ{nfCxBw2NvH!@%NX(09`Fe)To1)#K@TuHdO zgox{}1&<}g>a?sAB`2Qr>*7=0RFxGfr0gN5$;Xj|7D)iHCOAj!y zS%T9l%a9F9o}*An*@#gLoa?y$MAm0q` zGo2R2(VOxgUIu8-3ZUgdGZ}f7gY4OIAp4vt5OZpmtuFFRp(MIzg%x&PB3@!pt&-K5Y)a*10h# za<$HaJkiM|sJ5Lw>F{I=h8X07G1~eWX3$#_6o2Xnh%8?KaXG`s0#N8{SB*o=AIBnS z=84*>!FvC&W4q&a&bQn*TEG{q`f7*D?lbGuNen+5d8K$M-&p7u0|9rRmCxz3AX2G8 z#fL0drzRre`{L)15Y|lm4q@MlR(~las7Tpp2x0r5U;LVp%hl&M1o91rGUa!dT=Wkj z1;)U6^dgso^bae44sAA9D5gf@L0A0PY(i$6WXQq?nhM|hKvRL?e2g0xhWTkg!;s8z z)oajU%4q+w!9MX!X5p{m2J)%=K3tRZroqG@Nqa17K*F}X3HUl|&|aEk83Zg$8;~1_ ztJ@m_7hXd=LjL=hbsErk<1R^AgI*_N`K!QGS2~JfKj~#tQR7z1QS|(IpWTOalnjSS zpGq3`lDp@hY315gsgY8+gJ7yD zY4C09?+-ih$x~!XBc~%$OdhwcvdxkYYs`8d6-aOLKcbrqzOi zs3(cUyQkSKW{$FKn0Yr{jgjcK@m2(dBwd9)v8wXKw#zZ6*8N~2K7_p?qbcyj-!i;!SWmOQ z8XIMi*dR>6o5RJsWYe_pM7`}<#}`|%XicZSXvL7hE4=xA7>ix_N5ocW4Gc=HM|eAD zoKSPlEBI=ODL@NLRI|qLWOK{ZBcc^*!r5~o(Ve2ZWGzaZj@2}SmhLOw)9 zrmQhcl93k}>!u-&m!9_z9!3ej+wWpiZ|Gw(mWP7@_-b0rv_{G_%lM7(DVftvKvIDr zaT7fpItymx0+O1^%RG_L)2-lG>Z34JW33OuO4aIPz)@TVmjd_?Bwg0qu)|Uc$yzpB zZTOu)`PK&Hx=AzKc`shT&KpCW?aj@g2h$!BhhfqWYOdF+Rggo+82Io_9>%CRnYPhvb@n^k64kU#;(`pKvF$ZWj1rHzX?`4oo4y3asI1k;y`-u00oJgMk0of zkayJ(_A<#A^I3zdJ@LpSc(b3>Jv4eteP)Y%?B^zHt|wMdvZBS{hyN)NQf8g;5x&LNUB~^oT znMxdhOu)zz4MZOB%bxM2y3eU%Im^XvJ)I-@Iw059UDLNCp5o0z(l{N0gpk935n}pZ z$AYOhz?Bg1bS!`*ZqQ;CQsOmI_WPKpASh^PoKjwt6eQXZBAr^Ne})qeZ=*3>P(Z#g z+6P%>_QXZuK# z0v;T2IJ4>_&j>Jjs(rv8`cmbH@2F@fDQDRDkkS#>O%u!^p?3^c6pfdAxXa(A$vyA0 z^lM_8f|u&uK6Z(~e*oz*e0a~PZa)j3l`l;}Hh{oaG}#C<=51{P5q2F5e`{k039>s# zKG@#e*bYdV=L0TMCg0NR|1FOKnW)96mnkXK`{A{q#t2|<19+Y z;ZdkRn`sSifA*1&&LkE6>&N*$v_Go{lrWn1WrEAE+C~-}6O)Ub@Gk9sVDuy8r9Y;l zfTVq25`78fIn0|)5h?}}Sh{ADhcFV5gK8hQl-=`WoE=a}W10(k?3Cbh7O%pvDgo*~ z9S#AxX>Ph9lC@;i$bJ6Qm5>Y?XpMwSGnMTBSv`2ce~j3jvrnuymg)%9wLaQfp~KXw z=NWu8&xp}QCip7SRSZ}kfG@*VPfQSM+)8*HKU81(#m@RRNj{oSa`lEX#k|f~dJlUo zOqqIMd)Yo<>P)H@ZkRl|&Ppu@mB38)dQ^47Y9Z%ngkfEC*F&onVtpFxO@~Dm)O{5~ z|6Q8gfANg@bp>@AYKrWd`4dQQSW0y+K^d%ewY5PQ+&%X0^@RZ{aMP#c3qty(%(GUk96`Ro+RM*2Yd zc^`B*yoR*RekCM8r6a?%TD4RRV^_QlbGiXD9M?hGS@Cu5U&KVp7DxSt;u7+~m!*>W)dr$g|gRAMm4orb%oa*PdvEkyj9)-h&MpNFSqZbMZ=`<-GN zKtc#}E!MAxlyL3tT;MQM+lBcTAbhd_(~Ez3m|hr6FFps;o6ZukuMulMmiE(hYJ=W- zVZOtYh2P+>YJDsuzGExu0WR8$L9@BiHjxags|K`Nv$-&OR=`-A#U4u$&mLR9lcd4zsR@i#B;`^;ZmtpZ7bi2<>f4&l=|+fUl13U#)f~* ztb`)X%oK}B=cgEM24x@-5H|qJZ4~vFs2mVo8P45xm;`?9P*u;A=H2EHZUMBIvi`Wo z{FH{@RbVs+QXa8FC6jucDDNcc(kLO;2%`Mt&$LNH1vHgOSIO{VYtA9Xjj(^AJ}QH@ z=gio){Hh%EdUZ#9ggL=Ko;s55m>`4Fu&Y3L3Y*LUO}Ww1b}CQVzOn4HTCJt-r};JN zWceJk-(po`=Yet*qVn(Tv}k`0@nBZH=%Rc%79T8P6HOCXu1xQ9_T`w}B|)8XoTQ5K ziU336ukf0SK1wbPp%Pg{Oa6Zr>mDa5Gy4F3=WoZzH2$FZYU?Slfkra#5)=kR+Bi%< zT6L0qx_!7K=siryZWOSHul+htF&G&G0pJWx1y;R!I$$P;Ek7e%XC*xU0b zCC)W6RUoFP<{+y#Kxuy)&GU~)Z5ngVQq?Hg#Zno2UsM5L@p1FEU|oP|Dd=V4HDT=T zl$;^<88}_Q^;sdFl={ZgFM%#99a%?rN|}R#*_yGUWwwaSzL*iirIt}`Kqd-XM;7KL z1>~X%ByG)71;+Us0#Xdtj}|aF#6GD}?d;BifUHQhVU)C{yy1V~ysO{w5?c=)7D|`r zTwXpd8)oX&&?v1olTqp0X0tf!%_bat0R40dq(aG_Qyo#`Jl1S#asdh2l{lWmC)hMb zv+0*%#xY8w*tJvc9)s%r4I!@2-! zGIOuAQNjlk0eS&`F!sY${Ks~mKo;h>{! zsUYPsbd<*9TsjE-CDW;zA`cZfrc?9FFXV`P;AdJ$n9hv0gU&3#ee^-C1QpO1Q`zB} z{I66>b~i%Pk3P#}I_}AF${HdOYX}`kJ#SQx;jh1nBe3o0vs9aTn>qx)ps;)mWsjUG zGm%?*4>lsT74QRpZ5~w0teSo*X&7;TOs9J3r_=P<{P<{FuBPXuuO!%d1D}gYMnPhv zPs|`?>I;%gI>=Cn=>5#)Po^4Fngny#Vw`0Q%aZzh?8BJ9((Hq_2aTvQ;KJ z)v?}Idf2;Ut&JCocVf)DLHET#QLdH=@gv+XRtcH~1jIXkrX&1dI`z(&`qm6b9W}_S z4Bk4>K^|pXfAakAem8p0r$>R1emB~kwzsDn>w({m_J{Ot#QH%O8~N&aC|M?Le-<@W zd-I*-JV|=)UwFTYhO)qEAm8_zQP^%-V*)Q4jX~wP(Fnt^k%-3Y+KWcx>Iwh|GcL+{ z87&?LjP`yS>j+7Y{LSeK^%JqsFzXOhONO%U|RU8y=Flr zpE!jn17{?OGG;B{x&P0(uZ}+BzB+iKE{xg6C~plWS#XnSpFqcbX5N%;HOHARb@}c; zSL&Btsi*%!SL$y|jx`&huh#$6FkhE%{v&nszcUy9EA!*Dbo1M})bYekr+ARm7x3@5 zQvFwd%U|33|97tKeSK}?ef2)RxbU9;mRx5Z@xFt9m*m2Go{j|+oWegW=-pC|Mf>Up z7K)_LpzJOF$D-?$_iwQ9mHvgrGNmG;Dv78^ymR~Ul3bGX+c^E%Pv7UJfiNoIqCDb# z5C7C45;5R6FbMoHRyLZ@KtR&3;`PlIN&j$vrKk)?bjYMsE)Us=_PDs|EsMJA)Yl#CT}I zZ$=WaKTI+PVvK5=UZ3B4WFqPHk?6C3PZ8L;3|Zt|kEH~s5crh$KDs`AFk*g?fzT{_ zi#E4m0q+?}zYXu`$N^BqRO=X52I#IdmLI*UPYelmdgEj)VJKk06_E79pMXGala&9FfV19PdY_+WIQK1s z1YRXlCU;S5MoN{B5bfkxhKnH=%&Sy-!^OvF($gp=W4%Q5Y5Ex6Q7&vGlVh!NpLsEu zj2*CEV)ELHL@xWTy^zg;OJ*F zLNUlqZI*T|@^mwRHNSUY%@1y@S;mUO!iwn=I8fOU--hSk27VBZsJw;ieIADRRBT}s zqY4>$;M3dotW$`nZb>vI!qU!|k@Wo&m@HM8jD8L#OUc|GkDR9r(1iMb5Rrxb{fQ4& z{k8o}xKguaAGiclE3o`6ZG~V)s5+qwF~b)ObRIriYS7vo z$?zJ!)OhR-8^~y@g4|AjfzHTF6$bd-fdPK}5)6Ryn*C%fB$7#rbO57U$^}c2P)fup z%lIFRWHmZ!42Q2S%jv~qIEjOJe9^unw{iN$FUw8>GAj8G_$$3UVPx&d-oeFY?*s*I zq7bOD$MMK0$yC~4k6vfVa4eYv*T@?J%J-CIx5r5zypGs)G8R35<`G?dN+pZdTW|rZ zc}EFR3cGI^uEa{q(d>^}^o5`V`lVLoqkCKHEl_W=kJC0Q0Tclp@*4p=Ka0E`1515x z&SyyDue8XgENZt&b{B1vyMDB}5KFj#^#hqGGJd_)0z%^H-tx|NmzmLT<4p3wW8@8n z?9&>=MqE6h`rCVdczf4>KXSf(EMV@zt+Y0z*KFuT9uVyfwb=^_dsJ`WJp9FA4tLkt z-9hpooSmoNlS%3DLB!Mr7jAT`Xf;<~XV&J)0Z1KvenTdU`ye*s6pcv1Rz*Eh9d7Bg zN1%yB^!bZJsa~0C3GaXh8OBLrePW#w*+!$4bQrNvB$5w*bluFjGQCfSvl&T$a_jKr zeRyyf_>=M=fJscMfmoz*?-o`d7I|4j zEd!@H5j^34=%z$Df~1)D<|4g}#YK8qco5A3K%hfq(p1EU43yYp({VE*5RX~`Mj@R~ z6Z&(c_0pf9Q)jv!_IY@`cfSAa)#=Im^Fv}9z&J!84;Pmhx+rah>9>K?32n}{ngv0( zdKPZOy$>YaP;rlfsQ!9*MJ6(dyyvh|T!7V~+8o<|ak{Ct!4}4XSZ{3xB;AFz-`d3Z z4-kdqMXR*~`vano?5ywZZUlrga8GP+ZL|ZzCDh+thx$B)-#hJ{t$=WdFR{J5yAE|I zx-jmnL!HFE&1=-g$Ssn|>6e^g7{YaBsEBC&zjLalBJly_>&*!7B_f*K(e#E3MRSxt zK+1!EXZ3@_6F23d>5O^zI_It%5rTrE$fQ=CmgxW)!hjtYZNZ8ldFdU4^Ya?Y`Emyj zI^^=Pp+b1QVv>4@*!XzKCFrr?u*Ch=fLmrvtFLDyO&+2N3J(WK3T$VO4w>H$-~vSU z&}&A~H5();^CHCg$Ur@N=A?6oL=Joi>(E00PMzx zb#(b3=t10a3F;CoVw;D;`Nr?Au`LLgAL7z>n=BtnLJs@0= zYSkPkQmZ&blErj7H4NxDPNq|ji(8g*>2;nG0Pz}o1k(YhC$a?Bn`ydqT;eP(fXoPg zc*!B6;kS;%Gz@&+*M6cS$NTY|!v_1?2H4zVmsaWNG$8eJ|JLU5vjW1fTsA{PL zI4-srK;C*J>m?%=d1>{qx)bKOavhlQ#))FEj(ANbh;!k1s>s z$3UUH9|TLxP{q3H=jst(5kCCdMfjM1!771r;k2N*1lVFr=^b_B z*fH0E&+qh(x?k?NgO`6a86-lU0SC09#P$5q(fa+o{kZ(hT*9Nt;pS`3;iZZ2xZKVy-kLFmLj4ng)V)XtJ2en+S^O8hwH$sIV$pp>UEn#P(cXj%`7Tk z$WT5b7=!)|a9X-fcALWW0ocWwT9l%Kkfyy`PX*(TxC&eDWxCWrC3290!e^nR=?&A7 zih~)+H%~H_L)7?_!FV|QfcN2lN=vaX1>w%m{wd}b{NwWG7W~tHY#F}DmVuxD>)0~z zVTj{Thmr?rbjs1T?>941%l>U6rdC8XOf|{$h&0Lmh77}pG z$;#ij!tmRk(5lG85XjRh-}fbmA*@)1eBV0VdLS1p`BazZ6U4ap^!F<6A;pl;{=4Xy{BB3Aiygh zN|yTkji2d&)S%|P$RH}@Tx#>iE#$A=TFYEjj$10z;<+#T`cbop+VjQwFtg&u z8kep*ea|(twTXjkO}DgvsImTLcitP$=DtbiwpJl_J?;AKJxv!YFg1=2mZ_@+j-E@J znZ7Wi1J{CHo|EQ_W-*!1SO6<_HlhL~-`?9qLtiCRfW_|BG>Y?f@knX?;H(mCC1PNS z;FueiYG;>po}`BYPY!H<_71ElDAdrMt zGs53uDB0cZ?SSxiF8)&SVv1>Tuq!ty?^lc~P@rd&D@G2JtBl|-J9Tg=@4iTiS7$$L zjzDp3OE4k!M`lJ2O#2qTL|3ylAOv{di#+W&w3dyy5HLZ1&8+`ccPO@m*NVj`8Jfe* z=eYR5LF@hL8->B&(Ujh0=v4`xt@h>q`k(H;!GF$Y#$RipIRiO?b*7RH*utHDf()>J+GRFQ#EQh#+oCMrHuG7BPJe}6>9qq1CSSBI4isP!5eicHBPbKe&?T6_U5-fy0 zW1$Z3S6alwi^}5y61Mnh_>gj`-{n_c>5_vGsVO)TgGOamW1|UZt|vu;7v@`{3nI`; zjzK_8aEdN@`||H{0m+JA$a9iGLz?(=mS||73W$dbA`l3HJj7tN5al;tAI*sWFbAlA z!GwRObm&a`B%>E}Jjo};e*(vNWE{L3CXJBOZceX>4sC)B5LrX|MC1}jlE$r0`cih% z)zttL`_?6p7N!C`7KFxSfg=Y|K#TC0c6r1dvZ_u8fk*Lg@^z6gSoyDIF~3MwS1&O% z5BlIGRk5I{m?)tj0x%=v7z0W8Rxq1?(jkT%JdiEXoM4SaIxJ=v8z)=i>hK72F$ zJN`OO%JA*Q$;G$?-*KF{;Mo`9x!X_?Zh% zFZgAg&SsZ^a+pWWQ9I^8C>>D?V-j#HNf}=+j+Tw)=Lpe^(rl(BkbG0cW$4r&Io-T>XWm zqML^dwgDMDb)6#-3Y$PJ16bf}ZMJrI0zz3VLgDir>teuo`fB%LhvwMnfwwBk9rJ#z zO}Gw;))6n`v}1H8(q|VuKBn?E91N2r_5E~J1kcxl%RJ9=p5TOIx|5fGE$y@%^VN3n zby}n>#4u;@DvkMCJ9sIIS2#B+7TxJ4c_K;SD&~*^$wYC>l{pyl6>N817-_{%V?T+r zns!HvI1*dCBTCwxw4&YNFa%oB?yRH`q*YC+_*GWya1$Ihzc_`9EO4mMWKe{u;RC-i zKd|jl1c+6UVN;zyMN{N|1v7&^X&O&VaTZ-%658)a?!Y^61(_&V`6q@NGYC5I%kP24 z5ITwrdK35onLubR`v!#cb>&a6qgpQ*Ojp9CHX~LbsZvuEHdygx08%3fMzYQu7mj-< zk_UCiSwV*K1|Vw$Xs*7FCGIuVB^=>^QeQ`fFS=7XbMd;H%}54+iL}NLrSy|LuMDCf zpHv_=Q@0NlW6J!JE`xyF=?g)$ zh~g?iTExz4Kr_34Itw{CGMqq|DEphX{l(b+qPph!J_pR~BqAy^ggCnp`>>{wt@E?XfY6}>2>Adj?PijHjj~9Up;r535csqgSd9`C zme7Ev0G1l=;D5ipG@r=d{7#vqp|T!N1X{3a>;V2> zXvGR%L6VPu(B&%EC6ci+z0kf{y_kg$DIJX%#t>9h21Oxi<49kn%%wv{Zu6fR8O2O9 zMnAIjI>{JZ;p7^O&5CEmVv)Pp1QW&dAop}gZen$llKU7Tj^Y29M?5uGk9he^J>ua! zJ>prjgc@p&9`T9#%Ia0TFsntCTqB7=RbU#{Y$AQ8c`HnU%Is$}6$?nAe^3o(cAd30+xTzV zVP9u|_;sef!3%mEKNx0Ql9WvJH|NRQ{8q={f5}4xQ~_+HNa$;W&%mva_WdzXN5iONasqXaq3&LM0(IZSCs21E$}828;ya4> zq1r*b57pjQM`#|Ee@!)2$&JCSZ}W-J6tibfY}(Qh2O*z1(zKe&jNXtkr4^meTQg&c2f&=z#wD08fftHu2s_^|C@*>FLB z-_1WsbAnYpaM4d5az1|De2FN5fvKD}f_-dzUdx45dF$_O1` z2vkr+S!gUe>YkcZRT_~-$&B0wWG^7ESHs|7XP3QF*8=a8>nYf#r1?0CN`fWx> za4U}Bj?Q8=3O4kEf)4aA@Y&qPCj%dUS_%l3Dmu4J1S&kOTG8aAM%}7RQ<1(^AuzZA z%dV4TNb<`iqC-PhS}j`lOk|D3azVgSroaL7u!m^CnRjQutlciE8dB!9TSfy5$qQ1x zZ`^Ry<8(j*D0UwVTv-MtWuIKR6V*(-=aIWafb)`i^~h*yy}M1u_TwEF zW62_KeXY-Lxb%n$7*Z5ykp&nR(osAN@4&!=j1V6~%Gq!HnL!4}0}++sEO)dJyypTzH1er0p;4{i+t_Q6+cZZ3l!tpiq}S z283QgaeI5KB;Y+Xc?S)kkl63eQ$I>$uPI2O-&6sE3gsp|8)YUs4@3-qr2oP;bD?LS z$EGUddz)G9+7HoWR%A56P|G6dIK*c8Qi0o9epsi8_2)$~PROnMz680VJ< zOl8M~0Pc_kvw$AjLZ)>?JP<|c)q%}Av-oOU<&RHC;<%;#Giw9g>Obv3Kd^*FvBXP05c{w9#c)N{4Li)*V zXAZ|o`8ydrkUnidN3X!9O&v)qjF>q=X=u-9HX{NCa9+3HqaOpGehLUZj@`N=`rrp( z?XO92Xy)W;r!<4!(l{skA$cX?ii<$IAkgH|8tFo>Nj?jeX_Ene8J`;_)yNWhZs0(V zkuIvCv}{C$wyC5+009u_-m)&cxryQe&uLdsyP7*+J;ozeCn znum!ZHzSa$0{oKS(tBl0Yg$uOOnC$goV1BMMAv6Ud1a^HP0Te+w(}t#L9>*&T$AT;{q zvS+*Do~#No=X|C2TeZI)#CI&8Tm`Yu=mC6B2T3txG&-yS+?vehR%tTZwe~R56f{Uv zMoSoF-CZ~L+Sfq@jMw~(q+{`2a$TNb9(S)6-T*5fms+eXAv(;`H}O-xvHE1-WvVSk zHMI>Vj9ONI-6V-=9+o6zqOXFknEiNw+NR>cNdW2M?)KvFMmdOxoXr1dhvp3^*HKBPp_;j~kHiSw40cr)tt8 zUc;*mke=AY&y36&41VkR9-+tn+$zDBI;K6i1FTd6D=rm(Pc9RG55hLgiPDgk;xUMz z5@SO;LJ*F@PN5cLP=#dHak6HF?iVqh@ElHNfluFP7XQdWChrA4-B&_EdVoA;Yr7Q? z3Vt|$J6l_u0io}nCX4(0p7$~GaEUDbQfxsF=6Sj;eVQhC+XEQKG-a^Wd&-KKS(- zS#+=jG2FVCEA#nlT}3}D=BpcL!a{jVfcZ~<=<4vt<3{1I`cLT+)j3|U*yVL4{pH?o?8B{(28+)RZ(W>>zMwgFzC-u>|jNsrLjAfTkR-;p-;&B zv!~q2MICtaNuJFwB%5qe`njdnk z6GTFKcdOH{T)`D8_LI5Hv}0+`O*+o}BWPG#>@pMb5bRF!z7pt)e(O`5VL~#3&dOfN zQZB1kLcxi^d557lOFxscMUNJ2-dg7y%NBCuoouwMbUU>%a$oyU8zFmwJnF%QOUj&xlMP zQB?_g&5O(Yj-l}cjzyIDEpX(5$c&lahD^-xI?DWY;5+6!Uih@OW#(jo1(L6SQ^qWF z!^kwo{sn``D%SZJYu_wUcW3*C31e}WHRup>AU!tNC)OKF*d(61H9AQrfb$A%#BE>} zd>*eiDfkbk`oKo|3A>n1eIJ~1)vKV{)Ho##NGpg^#3wgj+Ns=sY^@0YwId!=I|JKhq#H~^+y<+wMw17f66g}RZB=p9`s0A>aNwHq<8J--P$;ik?O<0r=qummPgR4EpfVP%lF>u0W>^zgWMVVY(bg zG=e!Hpo1q8FZO+9Qbp#xH#8n>g9|lu?I{oWt5pz(6wJcQslf|>Jczd{+Iit5!U5!w zck&Lr54R4?Pc@do$OK6*>qPjI!WR<);HV!7lY1CadtjiS#1Y%&HcT^jTNreD0^7>c zg>i_y;}FdJY?y;y(O1D_{SwpPEe7GI!Z)7&^sgOdoPHNC!GwC*{f$THPyU4WBkv7; zWa(AgBP#j}5GO357!$T8?A6-d$_ioNPF*;d0?#|X(yW@B~j6_*XXwuDpMTu?c{r2xv6+nU#y`-mm z=FK;A5>q4yVkrQH+EBIZ2SYPR#FIAkHB5!Xi_`wl?z_HeTglMYT+8%E8l=F@TYF$7 zeR}fy^x9trj%fuKr?%yoj@2Lf=EzF=?!X)j`?h0R?h=dhlP1a0@Lt3FCBD5l?K?ic z_e|GK@Lscj2WH@CA|39RShJt>m9)N+cZshrM6WH|!^}#>Z@rDCxLZvbwwv-qmSrVM zrEk5!^nCHo8Ja^kQQBc+JG_gh!N3egnmrhrw)@0|H<}f=rnLbmrSWd^S566AnG*I}Cs60ZFnD4GK2+iaKJ9)WAW`s4UvU^x_Q0P1n^d)3Y?&^nA@Rtzp@>%|W0!i@rGs z5~vg^aE2i?M8nH~ilK%Dnr%8my5I|FtP3xHJk2xh5nbqwV>({n9BP4SJ9Lrhz72q| zpgtd3k$!9s{aM%w_4_Y+>V89mxPjk$nqrta- z&~{6Mv_7WQ`7Tc3V_$Pk&rABA=>z~6r|-hduuP|Kn~sf8)T{s&i)T7Mba4o8y?$U0 zhcM7y0687Zd2!me&7kj^mX)};08Gz@7L59?8TgNF$TGy`JuruMve6U2ADHfFqlvy2 zm~JbpV~)JOH4sz78bCjT8;a^XIADW+1$<)-0IY#pQGbY#wMM4pCBErkEjY1Ym@T&- zn7#)faIa`-VEVo`G=2AXcFOJQku!vszpF!*ZTgPs`Ux!HQQzvrOz?;8#sxN%I#f#a za1S$Kf;$$>9BW`&Uf&$SydT2y@Pj^#`cR`~H-rfYgKn8a_u{Dw>&^Adk^97d@f=w7 z?r>mQZyhUu?FnAnu5J2>Z3{_w5ixTa5~ z3|#<#6Ci5A^rdBuOvn9GP^jyBh{}Nk^24F&!eG0;K$Ngx9bX%2!y0qihz?*44sE)~ zH+4!<$H9gOT+nOFR88}v~buU zZ+h!(mZ&*^{pD&G7x~7jk)-F-rNP0_a)hCMaq0mSVCjTI(*jUf5)?px5V~dn%gm+= zrQ;$utzlwXL(>|DLudtF>hCPgHG`#Tdr&9<*^>LHd}$Nj#S6U&%%KG+u@97oX<6_o zjKAeHpF(@AW#6>Di&IB~@;$&kc%kmWHVt!CvmwoHUbwIV1^`$5leu9OEgOprVH3uk zSPToj9RNNF@Q;$~k^+l=E;2XNJQyvpb+)6K4)nnpX+ycuK_46snqq4%%sIE7c(Cul zMvr@q@6tt1c@v%oK3!x%Zh*6J>6?zf=sU~46_}R)*bTgd5S8zRE-VMU$f5CYw}K(C zJ-Uc_55yMWPM2Ef$QO<|ggG{{Vcadc$if_$#RGpy6gDmv)AmDu-*jNsI6(~=*qm*E zBcjoI6#jC&$ z^hHksm~DZ?Kt!4%z@30Dav+A#O&B$YE;8M>O&76`xJZ!rMCMt7LXx-&Aa5b*=lgV# z<6yaf_-jaE4>csIYDmGCBN{yiU%;ha2r#%K%{OhEE)w8>*hL(dAzcJ1-^XS-<`Dnt zVk}rh03zEQx}mMr^C7?;9i|q3<}`>o7$NDVHIr@V_lZt#%@ob_akPm9!r}H8xM1Eo zjt{9?}L-tA*fy2aFsQ^&zYJ00{#u<5#p z_+UGNyp}`vMc=ZJfPi020o*EYF=Kt-_ssx)@cH6@)U{w%TdwH@w+7yD)CE23w$STa z4su#02lru61 zUO0k(Rf-p?9nrgnY&Bj)s^#{P1QQpz06o~WJlyI$x`_SHw2^$>*vz0AULVn(Ll;>P zd;)6>=_1!|_P##Q6Shwm30WJsvVp$<@_q?ldm&PbcD;x6Y4!SorEd6Yz>bbYk3L;$ z^ayAj`(w#*1ndZDwue~QMQj6u0odC1+Nd9YaeENZrAF|8yO4gg=u+>|8g2=$Y2lwN z$whqSErEXsVQy-85yNXCP=L#_MsyJ`96+2dP!%Asf!+hH9I6;|pxKD)Tci>0KG4D; z0CMC)Hyt-@rjM1R5fJyvQjH)RqlM)A#67(|SWY0b!6$8*Nz+ltLMg_Y&tUrp@} zfm{aq+G!|u3#PW^)lIP_ndjkOO`ieqK)j`?v|OL4l#xZ3L9^5cvyp0OTQZK0xh;DsMrf4;zUBeYck( zF%Tes(p=&veZa8xh%U;)2NBg05Y%JWb(iMA4^`|i&`4V0A!&$z^^|e6%_4ENV}d`V zOFbXmz8ScQh3h%=2^NwS>;vIs0n=awbdl3P0J81kv=8&s0*n{}me*{#A0TQSL9boF z)viR?1Kg%;(}oT$JQHVDh@xgku4us5E{Y(39dVH*f-up!IJJBeq%oGA5TP23LKoJO zD;E@w20-0Ij9}A6VhciiE=s+d(EyGcrVMbS-jFUe?dqX$bQzeoyXZS_UB?PHIUa#! z+p7Qu-tUu`VKAagJ#~R%fojF27A4r4wH%qAMKpzD4ghftFHS+42vmjZ{#&v7{{Q2D zto~DXgz6C60jbewVZ(-Nn^u6kpSK)BeU_lZg4Pym`GjQfB3GqD>{^>!C7#&^BFdJO z6r{QUz64kjpio1Hri3FGnmK}rtL{~U03hbTHs{oPUEel6pvhc8L)4Vo$c8yIB#LF( z$6ncQUE2Zf!$sa0X>2<{(ieApnQe)GN|CTllDMV^G$|msp-&e<$p)bANh}QnS0+l} zgFdths9KK%Sv7hl*$7Eqn^6Ilk?@&=elfCjkc}?|r8h|GELx3L6mq)q6asNUQ*+WZ)tU2mICr z0u#tOrzR*hmq{}a8wzEAWV*q^A;Rymmu@oyK=OZK0lBl1S1${zrcx)^~-ap^Alcyn!qd4^_ieS2h% zMw;gjP>A6>=D_!Etkr?99L@G!5Vp9>0EP;LBDbm0A82*}0P!?`$A$u&8|$K<*-Vj9M z4&YlKt&JS_=9T07=E&D9AEffwM|){M#>Csz>7Y@~$aF0i&6Vun=05sEparaTG+p;GU=y%w8<_sWUOIv4FJQ$5OZ!{#ixUjc zqGM<;`VL4sL&CWVyXAVIg&n$@g$HEr3G40vk+jvU^`3G4eQiCE;zsq zAbll~s&4{+f8hXs(Wq5HwhR)Zg#*&b(AOkiIOtpU0tkmuLZrnYSoTfNZnE@;CfZ7k zlD;_vS!kamg+r7Q`x;#ZH8CJ@pW`g81O?=%CF_Iq|IZjc2Mo-7&$O`*U01a$OB z64Ssu5Yc7ZbdiLqZG*A_EQjbK7+9Bd?!ZI%bdgGsfb^hkd6Wf`UMfgc9aw!(DndJk zK3ya+Ivkobsur4wz?~mloWjuefv0sB=Ex1(V($UbNXG#e@q{^C$JK<9JgDE{+%7GeMOT0s=dTmeY48UqA08wxt zHU7Yo+n`AU34`sSYRp1bJP`QFB5TGazTEy8*faPVaFpwTZKO+bZK>@*h7zBbwr>Ur zECdrInLsy>1ST6Hv7XQ(0Xo??gRX**Jstfy=BYMXfBU##SqA3u~f&68J0+>-FfeApj4I2016!>GnnJ2n=z#%NfLOu?e%V924d`3wfGp9e4R2tojLebuC#@h4x)Tgc;QrAF ze^s;>Eh#J#7|3+d8lb2Kg7^Z99u%h4>jF#-P(374rJZ3P6fb{PA3R439GGj$oakF< ztvOT%!PW*#B?+@>xOw+|)A1Itf4j{~pg|U!Nt%taC^U0)+Vuhc!9R(Yg=MwYDp6}t z`~VeR!H6zuqs-Bt1S~ieVxwWNztMPWe*pi*fWd#Q0UR{j!vBI8p~n^!#R(P1wL@!& zmf1s+{^Il>q74CD@50sB=qkuj`6Wy$$1(j8;Ija&S40s5O-+HTFRr4+9##M;e+uC0 zCQkcgwF|;Y&*}%_7rR#YNcK|in`FAz0`ZG!uL4AHj%#=Heu~qP5UNMwdvS~1e|$AW zeS_l;>Td@HzV8nOD+g60M9`wy!V?Qk^6<|Fk&Byae+YC7*yYe2!3g$80hcBfZ^?uQ z?*xp{UhgUx;qiq5nf?3FH97!55DHM!)PfMa?)zlS9>eN3OJX=T#gk}ng zv9-Zl$F(+))SuC$(NJ@2uv35Rf4itHRPof~(Qp&*k-lzZj)KSj&~)q#RA~=QYYSJR zUd9@kBM=t>t-SHgMiQb|7fu?%fkMw+_U%z(JAFF<8$M94!9lU514e^M9}}S3(Z#7v zLpd;qiDjEZ7)dvHYrAk}1D~JR!0`B>Zvbl5yEyHG1Z@PRjDp(m5=O^J!iXEe5t7~)nc(!pc00g#Xhlo zRBPE?g0zsdb0Xz^Be{Idx z+*%jq0>w{SOORI&z&;iV9xY*8Ss>PJg9ojU@bsZg$GK{b08LW0O$#rOLfCY)Yv|FX zw!`=P=5UDSuQo2fz#KRsuz%X9F+RQ8P!-nXwyCNwELAo4RyL|czW z&UyY@+o(Dtv{AK4%^ZpYBvJ_rf6@=&ejVi-l5lzf8K{t1uzI8x729~`chfjP9vpIz znRV&Xwm<|Kv*pvJE(}!LL$pG)!NLUdD5kIY8jVv(LtG22(JV)ENoVgW>Ux;Po;+gW z2O&veWIIvy42^NNj4k09N}m>PYq6vG6wE`d5nH1P#}eAyNV_p@3scCCf5Gq#EdLzS z2YI6dC}=1Y-f!)JV+N$~1~G%R0O@XmP7k~VFwjXKZ4!KqEP@tzru*X53Xpgnn0}|t z*IU~f{r}43i#T{;^yT2eCiCCtz~Eck`h)GHpu|7aOsek(;B{gECrn`Vw@+=N_}`^{ z1rD9iMJ{qYeC-Dtrpi{|e+Hzcr5F!jZ5EyEMB14x*HmCWaJkdp}Sa6j|#M{>b!ZF?KNOtO;fEnLOWQ79uCyFfQ}jrJYPuX+A=~& zX-<taL0h$2)t=Mjc(z7(I8yr~DAYKj`rsiv%hylR#M^DH*>=I#>0)v?RE zB{{+<5@27g>Vieeev?4JG6kH$pLBeZW_k1y(~H$=r^#D`aJ97c&O`G@LyuWhd(I3gPoz&by<9e~jCqOPEm_P< z6I)cUgva1qS2~lOfJgJZFsFC*OAL7U^AmLRTR;T8aTBt;;+%K2Zg+QQ+6EX^KIfNB zPn9{0pvVPyk_HC*9Y6+mzXO)X<^y93*lcd>f9`gS!JHgFLNNL)g`l%Zgu^9PBseE; zz7Z45SgqzVhSqCqarHD(=`i?Bl1G(@>KUm1Al0+ z(C4Xc2d*6$EcAG)Tb3301`7j-3KV#jqi!pse{Q&0Z0zusaW2m&>Ruf(ah^mNPY=Si zDK2Sk)9VV*IOrK{JC>u2w5Lkj)|%@|wKO{+B+{7(!|5^@=x-h%*>GA87> zXPtf3D7<8T@-ftH+htmFv5bvigb{`7Hr2!$s`l040Jnkx%9c<>Kp8*pT^^o|e|uqi z{$&y65k=9eEo)y8pG*rwdX8P}mZ+$8)kC^5_iBnrxHf5;tQh_+&E ztF^(h^6J35S2g>F=x!%fS=K>BA(jhFrYyZV0vImoZ>dxS4@xr}K&%SF+pSra-+u5~ zO^`tn^P8Hp1=-ZBC)fI$A|G{?e*n`HJCnm8De+a}e@aZ7EWCY8n=JcpXqMj>BcyWHf2>kdQ{72#6h50i1sprG-+EK8y=)nkJ}g;^1ei|umDXAoU<-209|-->e>&zKBi+tHw_ zLz=l)H}#?XsP_=d?dZ(Ie{Dcj-&DPSo9bzD^(ge`jRD|p6ZMT1r(>6$&c^O`?yQvY z=qYYthxt^NO4`1}g}S~~q}IC9;Mz*xynJ#~omHNEW0lwU^LbUCWN~_;z0N*Egy!pO z&qQv_{Eh8!u5HJC;EeK9WXy}3nlV)~|Dnxz8mFcP0j%?IT52!Ce{;xiQ*%z^G(N3P zwid1r z;yjv?xEjOqb%eL3e|{{mALrd$ST;K+k{U>qgrb}ST}zA+O)w=j-b{U%0s%8a>81=` z&oUBs0TyQk-DB~r5^^vsfKB1)EK1q@CSE4PnT#97wB8>wCMz6=9kclaLRA*fy4UAt z84456JCWlRk%re8qk7)4tg^EjF>jJexnQqq{0k=%z(AQBsSZqoi(P z2Hvedq`g{}uVqg=VqQjTA-&F?^K_s?e+-u0{T3$jv&uy7Sby6riTgFMuC2Dse1_Um&&JH$-Tw^WRnGa$vD zosWBW^GG|-Dy^u*&6hA0I1Y0|L^qAvGU>4`+NdVpd#omL#wpt*tj0Z}g)kT1b@#?1 zwo=k*j^7>IF$Cna(DN-eYKQWeGwK1VvjhQ?Cf-=>ya^Twi2MPl*%9c zcW?iFd;7D0qrLq_dvCu_d;0^qrN5Ln&sux?%iC|XPyTZ@+9#?=^V3!sS)RSviUwQq z2)3M*Mo7az@zdU&V@IlYGjL}Bt-28EBz?PiT zy6k-iRz-2zll@qOI#gtR^4!o%^E4`o@FX$}V~kxOD}%`unZ{~*?{2E0wSksRr&S)! zkZodzF@GyDYU|}9OlL_XO|Y=!ak^G9|D%5n=Ku8@F#kO=1(4y%4Mb2-alxa*@JP=L zR`G%mo!A%-)PsmXzyCT(ysMbZdUK)&7Ib+^}|1(BYk)Kjq=fd&PMr2-6(%j*tXWn z1-!>EQ5`lOFo;2}Qu6U!w|3(u%6qKvY;eD35KMjy%kvC=Y7JhZP{B~UE zmVd$M^|;V&W6gT9re>rhn$W|oS=zy(0=5LB)crOx+eEI-bgcBlh?PewF01qq`+**vrMk7a(845-!r8eNeT}A736rEp8`XZcZvcvbGPuQHCdAy{g#h%ET;PbYc)}`H zD_xJdd}V;;D9*RsU;|^EBMLLXPP0aEIe&vV_7bZ}`0tDG^En@|7(m7ksah5jwmUKy zJl1jPMcDb6hx=%5MRDj|8HYZjF!p*TStJ6&BVO(9>O1jj1?~K6jL&fUeSGMbU`h}ae>%K|A$$?5S?yL< z`-llRz%CRT@}ol=%fA6a>yVcM7qQF`TU23OhWyZH1(33Xdhbbj%m>gK59ffG&0(`( z>p>kHO(3~8q{aartXss|+lHS0K?tvU41a#BqWoNY6qVBjNgnh&@ocOeJlHX$+=|2t zIwaqTXLYis9UsFoe{aNDnr52jw%kj+=n|624C{>oo@M1DIDmjFS1m`7vm4*7J7i#Q zuabc^Q2A{eD$)R1BWcW4AepIew*e!1p_cKgnogslQ2X+63rdZQumzNV5IUXh5kv~; z(*KcSK&F($)AAn}sNb#?R=!7JjjtWam@9QCnk_1NX&<2sPf3MLp9ZRb>E+y+MEOB}UO9j*W zTWRP$ftKi7V0o2&v)5Wwz42Bpn+v8ROKUOo#;L+^e-{lSE*ObJhdBapwuFDKPa7~X zC5Iz&9NI@7{8GZX^;{nmKRa> zDFX4e(Fxis3JGno9wZ&1NO0F{mi@eK^bl9whPjIV;wC%l990a8C2gL4VV|ROVMD|g zVCmhdf1=Najq)|Xqu%nG<0dONqMn} zCDP~%SOh(bzDTWMr>gNbD$V>#W6(Uf>P;M7`6j=zw2ie-#+*0f2(-VvMYad@q_u4p ze{b>OQ(8LP28LY_%}26-rFj~jbr|1mZ;?OOTV#a$OC)Sm*IgCFB~7w=Cqb*|DIBUB z$1Kmj6fdIuMR*d8bM@)DIB$HIA2C>saz6nST1UPK3Jf2l|2 zNrYY|0g0_vJ*&s80WfV_Iij303@AsA>{`%b*8~vtvTqrGNg07KU9&li$%`zBr{^%C z$}d^|xu2!UIam>c2oHI?kmogTm+_oTQQDzj_|cFMNz1qLf3p6dR{8x0Irlsq+4y@(7} zq#Y+%wIbI+$+A<#dZex|Oc$AUcB0+gUM2c0=1XX$-}Q_ zM<6XPSF1YtL0CpIu>dU?PO~E9*NB{jym_AGljc_M)Ue>HHFu4W26 zBJ<82Disc?he{t+x%8%Ha&mYyzEmXAMe79AjsvW^z;jXv!U4(l>W`fAL)TMwkLN#valDWIyfq z_YIJ8-qpd(15{dNt=LTE{Ons)?0sH5p`kwz%cA{iWs zDfyNcKPeymcI8Klu&6(J&x_w^f&J3p*1N@dI+aKjQ0$M*J2m;|Cb`z9tM9Gm{fj*N zdVbVXf7&;wk?E{4;i@qxqShKroEJZ?R`ByP{ro~dViDN9AjDcYJX)CV4|~VQ(=3nr zpNivR5$4hC__%jO1MTv{p}amTJgyf$|L*W_=F#4r?@ZAD>xH|!TewK5)HmkA!{Zk( zpTB;-TJ?H{G3gN%sTcXwIJV5*Ug3{>YUcu#e@HI8-QB`NS2Wb#5ibI2!?0uTs&}ZS zyebmFBHO8mtl1=b7)lCSXpu|fa;?0N_If?>CN(al?NYCYZK+CLMdVK_<=-8C`0%$o z=3n+Ex^ej7=yJU}`tF2PIsfi&ALKxqdz1Uk2KC|S&UdVeyLR9z+}?q!j8}2916KvF zf5OcjxT-i&{(A3ky}c@<&Q*nB=FwRaP9wcaS?|M#JG;Fm>AQ9ztD3Gc%)dAW7)l?ZkF-2FaVgxgFcULcLAm^%TT;&EC z=Txu`X-!oLuck^-^DP^6K#^h(0Q^T^f6aI`SH4=Pn7o>iZId*0flYpr3N1f zjpIjNo$0U)$UcdPsOpqgAL;!Gyr-dIJz_#-rX{b`S$DpL1*_$xTGEOB@#T688&+R< zb*>a}ynzh~^X%>_2NvqG52K?kwAkn6#2OD65gFA(UL8{(Uh&@Xagxo#VsX5He@kta zczoPr)#q()vpqqSHh#SVW1|Owz-S!^bjd+=Jftj>aiSDyWisyi#b(N}(;Qd!)&ZjB7}!4P5b< zR|-K_-BG9^r8tFtsxEk?P;%7|-CrogQ}vEl3Yk{@)I!_TB&liJZ>lBYPo2q;c9u;PQ%smmR8GqUJ>b8 z{le|RKwleL&O3DR9zOR1iTaw4jRW3)_!S?oO1TblTqh2Kc ztM_^?EjBs_kt-$8;Qh?2AC-<-SDS6rFZNScL$rEqaq&lwmJ>-9dLu2$sN(paskK*|iE z71M}U!>0IYDbK(NqcFac?x*0k6kQ0*K@DM0vsw_czqc2Dp9ySH@bWM`VinIPxt<;t zM=XL%frBgE-PSvOwY#fV9C8>eo>YOJvVv8{cp8bjdht+me^Wj!mFDK1lTFGxaf(Iz zbV3LOip>cjEG*{JoQ&c^g_D)GPb%vb3O9bQyx!>qM#7?Wu+?hx3E=1r$^QuNS~YXqXgooTX_N=~?^ zGd`VD`xk97e>A;5<5OZ5rr^fL9t}ZzHa+E|!C+{OMz-e;-N9&NvFQoNV+w=Sq17K9 zeVF~lxbvL?$z=;ux5<#59lhkzvG??J4AWU}$dR-mM|R-I#q@+YDde!CzxJ)&-ROTT z&Ih}@(f72ePtW;uN$vi!)mEid#|;1#@<+68yKp}Je?rASi-FB%#C}(w=upR;G8Gh~Az_exzqwBIO|y#u{iGsAxB zSfUSg<;>&G&h*_OB9)`{^xa__9Cf)zeERNi`iOphrJsBB^M-yN)6X6HxuBmPj^G>{ z+`XcN&-C+>e!kMrC;E9!KTqlBIsM$FpC|Nlf1iF1=;s0bJfoi%M{q6=m&aQ^RVdNv zZ`Ys4Av+2D@I9Xrr8oTryf%-9;8|<>BcJ|azTe%2s~Hz?IETiFO@HRoA1BlI`t(O* zJSB2*YVqmMRLJ1=JM7d}5!CcdM{;}z&<%)mSd8~OaIj~Q217I|ZtZ ze`SEM^3@8CoUnptlWAO!H=_k)z+ovkRI1S7*kIbN^>VeE4kX5&8h8#U1Dr_tdz?>K zD>&`bBclaM=$(b&cM%?p)hdM7A94MO*B{Tz=!sGQCOoeTFjlMSxjto;0Tl{+?)s3c zMs(`b;Zq{ZrtTJS6=?d3-QUI`xqU@Hf24OPtV&RA)n%?$Q&-R|9-sPDb)e`2LF(Gl z0!~MKNBI39y!;4tFeJV%|_9 zv`Zx=PZXdf>UJ*Vw_Df(1&Z`_&XZL6I#%t-!1iJ?b-?RHQZuee$dg$4B5UjGFLrmQ zsa~=q)JsDOg_43Nnes{1jO(FtMmI99fXr1rpYo(auqMejjM2PH6QCv2mjPT56Mvng zri^mKSgnL+D{r)L)ZQ6S6q#$X=!7*W{l>|x2KO0H7RpB-yTN^?g8P&wBz#Ryc&fX0 zF!B{)bJC)skmzmm@@T_GbZ~AEA)N0U<>pa&F$m{8St^Bpxg`t7Vm^Qae@C)>Y)?it zlzN6FKc3!<_x6r>W;BPOvD#yve1B1@eOS}Eha})mUh(810ii=Y+etVlUwLC5pv)c8 zz7#BZ&6BT_4ysx9?(k@w9P7zfJ>t#eWgVMU^0{HU*2a3Ayh5atJmra^3QyXq@F`eL zBu`;#mSUjq@(IUp5eL^UwQ6bQtded!vjhG0w?-o{%OyIk*-mEq`#xig8&- z`$ht~Xl${;B4MRaPoBEd4|sB*bmCb@ryr=De!-JxO8%E^rnXcn!3}tlkCXer)z%u5 z!k_RI18=l-FpgnGsB9c%QN{{3YPaadI zizbtB$RP9lz>^Eg^RCGQM}NM>`=5C7j^4j*-U|v^=J|~$Zz<3FP3k`RrGt=9er%~v zp*fKH^Cl&qSY1SWGUz1D6Ps71p4>55;=o;XYOut`v>yzX_;~k|!4ePeelu7S@aX=& zp4{2pO#&SRRmmOvQCI=pG7MvfCxg|hI<50nr;zr3wMu@#wB(1{e}4w%{&BTRerihn z3DSOEt&-oGwBI1j0<@C^U55|u)4ou0p8PUt(IfH*Y|hh31>yow(8hB;H{{W3ao{bf zPh2GfI$)JJb;^5@QXiyFeiSKwo$|9t@#++7T`wvz_9LDU@sfN4@iLFpV-^Buq$n$F zbyYDt1K(C#9un}tbAM73Grc&SMPGYp|6<}jkLVZd-_oVBBL1{ zGYO0GK!Ciymwin5d`gwhd2}*~PMSF)XY+i<=kv*YPEG)x&!q^iX`D*K%x5C>jXs}A z8v)SUQgvs1uFx^_kAEyk6BV4Nd`|Sw{G>}*GGA^9OXlaBICB1_Ljp2C?htm&A8w+^ z`Ku0L$6OKS(0}F$iC?dhb2sYENFcESKk@lXS{9Gwu0Zw}Z2qgN9jU<{!GW3%k&9rSYD3D)HEebB zN0OJCgGP2gYVZj!g&``gwLlC&LvEG%MF1Cej$q2>u^E*_`4}4DK+5BBwsPr^EWAmT*{2fS> z=I@O0{0HjHTR#7ZzW8keStu31zq;bzsN!Gv{5=)3A9qzKZ+bwdQ``aStxz~wBgMV!-I@%UF&xf5N=UH^UG2g7*M98zW z10m1y4oY?wcVOvRxQV4_MF*CiRUKG*HtiyLXUSE#dp7UH-Lu)1xO=v^5_iwex^egH z;}y7jc6tTwo}FBQyJySmarf-}D%?H$a+L^scH9zS&mO7{@&vQb3SREc2dsi0n@!=z zL4SD=xJKmh1eibiV2tb=tF@A~Ym01uOO!*jV?y#*c%2~1%J>|ZL$=d+yf`OsI8jnW zA}l5@I5y*R&ga9`YR>sALU)Ueyw+&K7M@@VE3g*Go8u>QceR4>n6aq0TCHY?jUKn_ zuOb33mmOb$ z3&9MFk6Ha?EWgBNo$=|Unj~+=$*<#T0z%h=bex3jBTuA#+nK_@SC0O1wTf7~j(?B4 zyE-VZV-D^jr;(nqt_oSU2Ee&T9DaQKnI-fyr$mo_0!p0G&w_r==;tH-oYGH8KPmm> z^b^xhNIwPrRP=K~KTG;Kr=KsVPl1|8)PNzSPix)B>=mDp@M`v%E4Br*ugVrNd!Yz zZT6%-OVqVzlOsg(ki7l6-14F}yDQ!8ZJg=M8!wj-OLtPL{z!5-w1sZMQ*#Cav~KpqyblknRrMYiTYve?tM@d- z_xX$@Y_kLIsrE=S#X@lg#*tkTM`69iX9v5xskFRe(Hg}QqMt1}?d%z!J)rttpb7fn zhohst)rUiUGS>T(53@aeGX7wGnC%%8W2GPV{`bhx;oW5CgKZrC?Zbzo)rSwJ@t2A5 z!8Se|t@H`UFIFE8KO7m&?SJZy0hZ3Qm;AdAAM_6&j0rq_;5$Ov&T>+ zo87sJ>7HHi*`3MkPHnip#dXhqxY0c&&T`xUWy%bs$+I7fJrYc{Iy1YN%q}F$4w9>z z`u4chw|9J|7$(ks>JW|hdgIwUsneLfbd*yzYcUj;gvIO)hbYp%A zb2wdyzGBt$kEuNWkb^B4HRxwP`*Al!xHaq9lpsb8znYS3X#+^jNCHl>M=3Mj#ew zZL1cE-RxyFkALzgol3``7(`(a7U}<%+Q%pY#b;c`VG8`i8KY{xmEX<~+%= zTqk}GS2kLKvqhJafGuu~^P7+Puh}B+Y6QR`G4G2ox_>76H=*otSN26jCrO5Sgs!+% z9|en0F?^H*o+FhyXzU(iK6{U1k=@<=d+CXE--v*cJ`HPL@&U_49pU#`ea>`0lxx4>8Ch3igEQ%*goS&SfqViOR4%~V_-fUjIAF~Y z^Y{>m+ke-3W$f1+(-g|wvyS$~>qV(gjon=_pi@{Z!YRR8vQ6L=brOwZ;}Dv2gaPZL zv95%#7w2_i$}kqcJZ1Q;a@HfQ&-Ub$hvf>gSri@PlHxgB;FSa?FPX}E%v57lQc`cA zinu`$v4m~LL+}Uy-rlpL{Y9h~#w10e5?u1@WPiS0fNr1VhuP7_Vf{jQZeWW-FR00f z861kmyydz!Jw@KG0?$^`p$9k(0x!SPyEQwMY%Fd6V+8EMkc7gT~rM= zS*>P2V}u=b=7~dPQqpQ7dM5vTuO7ZWetY-Hn}@Gz_j)rIOr|5@{I>w-h~yPUdgX&} zUVlG-bN}(f2iqT&Sv6fmv+l1RzI^%o<*Obz`YlS`&?EAZQm{I=LZNMzOj)}Ne)an9 z>o*-;D9W&`uK4EQ)vGu6o*uk@eempu?JwivRrT>SF2Td|Ro}n8`{dxk-K)NT3tk_? ztG|DA@bJk40{)e-2c$vj8wEz@9Nh9K&wu37e!J`&2MLQ855J>)9M0|1#Xw=Caz2-72=3B1$u!zkGV|6OMiZ!#bmsviE45kMF*I{qX6F*VllfXrK*iy)_5G zjT}DRM`v1*sXXmj>vmO-?jAgO^YWo^^(hixy}5t?;j33S%(WdTYr~Uev|cYN6Mv4< zg1HOHh-N?tEfy^~-QrAD0xxL-M$d)QEtc};oZV_w%82tK)4iku@~Xk7t5uGXFq7)W?UQ)>4UQ#Lt{o5O!H+VX`+jWO`9*P-Q5a9Wo9XLp3OMYe}}!z zcK2AX-O5%1wyDQ@?H2S{Z@c~;>wn4GdPfFZa2SEj+Quns*EWvXMs4Ga$#TZ?HJcgi ztj5YOqq(6k%(!k#6%_{ic*T2)6|-6`W(GUGBF}4@ovYPiVX%`cGQC1XXRu}aJ?sSM z?IhSBWda4aF*=SLEM*995O%2on1#-Zs?17gT>n5V1E)pY(s(7 zOR=N(OknekPH!wzi?vYij@4SWgSEkq`4*}&gZryyLk*Jz{LiVbVb#OfU7=T$ z^D>Kiq0sqj5hrAl>Wi5%Uc`EAOk#=zqmrnp9^v?}+ma%nWy3WbT{tq>*MDrtn%DZdoX&^QQ8Rp{ zL6sjF?De%(ZMZ8#60zL_^&UJwe)jzJ@q>p?9=?8f{Oj{K$L|iFJUPDi@c7ZeO9&`+WNgpQ>s&y= z)EB(nO=VLM6QJHBPK*%n^Wb&>grU(IU<~n z1u0^%hx#Ro7`MqzCP*DTW5~c(^U5KtG57ASewzZVHJmKh4gFXWad3vP^`#)^>u;hp z4ybYc4wLQf?m#b<24OvC@|kUJpS!!yo3{Yxj6D|{&)r+CPk%grK+v4Xn{iWLN*Sn| z6L~ZKC^JmzyX`&eat-qYJ{Mcpq`n)U)&-ny7f^3(mus-?g%W6go5-8-N&WrF_V={; z?bp5FC99jsQ&!i=b5?)N<9#~BsSHOwq6+O@kLU(z3N9RXc7WPzQsr)*)_Zp@H|m&4 z7II@xZpvv=+kezGf}=^;-Q7N$r@o)Gp2h?4b&tAJGfQ7aMN~>YzfREQ@?vj|{Y9*2 z#w4S)6B^@CCk3tsH?XW*gU&Vykj*hYx_16=PX3)6XTLt(-EA`PO>*ik`rB?V5@`06 zZRKRRa@aMkn{Ka8YT(E11`;@+fgiUUrx115B8`p@)_(cnQ8TZ|)d zxW9y$E`PV&MAwEf*1x$1jM}+L!liW#5UqpUxixe?tHA%WA$1rXeIu|odkwnZ`?utH z%6jtbt5b^CTs{C63HyT^2nQjVR!gA|AGD{x!fjlSD?q!iD}IjRacNAR*F(|W?`Jo( z@+NYOn*3tB$wL1yL?a@l5w+O0RkDx}*Cpp0eSb-*FL`$-Ufwu(ziRH?v zj$%pNdhNPyI+jn;aSk0@WXh5O2CK85k8U?f;ZPS)d}#W%K+8DLs784a7bVa=;#N2I zWlYyH%uga9a_D9p$yxatpIOF3lf2gQkfP62JcK}2Qyx;gS;9kex`?KqqZ!133eBu4 zqksJI>!(jxXlCU8A57;$^R!CJ_$-O`bM%_MT2(CO-x2w>%0WaXVoYYnL>GS6(dtp3 zg2?n)_zZA$uQyJO@po9|$LwqK$>La7(SL5RgiVd{Y_j;G&yDePo$u~`qFA}?@Dr06 zj|}!}$HqhOyZT`HBXVxG{|MzN?B3RFNq@K5uM(pWg8;Z=0&T79>!(mUiO1>9>-^1) zQ|Fo)lA<7&rUrVW#~A?L=;PUbt_<`&I30>-(!n(?JG^&fu*bgxsBZ*N-w;sm+=NOI z%d}ys3hq^eHNHi*t^fiO9b9}1!rY{bYJ~a2x0KS-BW;)Ut_9!@+|*W1fcJC#Du3|= zaH^_9E2N7NkECQ9u;Fc8oU6GMVM*&*sh1og;fWz`EMa8G;teT_oT=rlqzjuplWGri zz+{+I*~W~kKbKC*H_DLu6e?q_e$f(VY~@a++jA64u%9+(J2ILOQ6x%B5duco3A7W9 z?R;RdM_hY$1~xX~2~uO?^Nm!aBY&rEuy=YFKw8F2jnUKHRI5^oJUA0U*uR8@HVvzj z1sto(PBmhJA7%NeZeZMQ==58DnFGrU$>Y1VG6Nripb zKMRIne6LPH26Oxgo{4)HU*LTsJoo{g<%bX8ftb?q3ntnYe}+$^@g3H5V}JZ^&3@}% zL35RbUmNWG|6^l&7cu)Uw-RWI&@mf)5rqK3#99PbOIdby@P*Xgf*py%>%&)#NTGT8 zTK)R8Bf~>k=SSrw(9CrknmU!e`N!LJQ;vFr!_^)5lk`ufPL1po+O!iyotQXInO4sB;feYPCnMvN4;&40w#X{H?OVUGQ*Ie zpm}DDdwDpEGb&ywC5K8{`HCnJQO=9qT`(__FU9X_bqF!0Wz&IVT7TE(bnNgk`&FGH zQDeIDG&;>Xw2qsSu$pFCv%~FFD6+h%NUc^l7n3NO$Vt4tTgo?b(;TCB!U9)(VN42r zVT_CM?Z02M!-7Q-tC!89u{9*c|1rC4N#_)SbW7~j$e}kE@#*G^R~vF;M!N;gMe$J2 zQF=sS==i;O5=!l#n18xqZ0-ncRDGK*VRIAt9b1I5Biyuu390fpD%mW~%kyy*u`11@ zlej3OoN^to_VayqBAQ7-#D1=ypGIXk{-u6=93?<~kAJ+*N}$7%Ko}0F!E_cM6^wI6 z7zZq6MeH`D>ZiiQ5#4{}Q96srCL>PMD1RBv_nYHPunG=N&wt=BUc8JR<9Hf+*b(uy zTnkxbE2@;CFQzi$d%0%mq$>*qdKt%)7}Ur4WH!`uV*)4f$BP_pLFYYI3^O4{7KjDV z3Aobp)28Qi{8aP^i9s@Q#b-&uN~u={oQHW9mJ1fufpPcM$RYR{+l;k?_Ez;(Zh!3WW7X7v_^&*bHB+G9kf-R$rasoC$Dp;2zEW7?ERE`n0ymVLV z_Kx(JU4|dCynGnu$vGHIOv$nk#5_t%md%)TN3LqS#(#<+aLcVs(&1pWlt>Bd;?&qj zarj0>V6Q#_)iH3IWpD6cXel&rL z{H9~9&Nt7wlZ~$8(qTLN6^q-Z<`AMv(hIl+r84AKXT&RGA7fgDlVYK7hL;jnsTeP+ zBz;zQ8Gj;J)nof z6GT#L4jxMg!|@r#CHcnr8F9`Tz(Yd;bPC_G7`U$mbh8y33r;0qu<=MaD**P-Xe_NE zi@jR)%Djq%JJNZW6nNiJY2#o8Tm#0FTn1Z90e^YsjqP?59aE&CHTPJU3P0psXI#F- z=`8yq?WlJ+rv!7BP4UFW)omo?ifm57xBh8%df!(vEpFa&8ARJ z)h=gK!2{Xnd}_7`7dGQlbA!0Kg?ZmxPg$cADcf=3XJCG{W`}b&gTQV_@=)^BY|%(M zkg>!9tr>*tK2vf4)dailM=s=}3pNL8ZGXBZze;u7dZL9tvP+0bIX+v{S%%qAIo=sx zktypwMVHa&p7NrmlGq8rw_t}onbL$L?V@rr1~o#=bhOMl50 znIWcuF(J)f$2F--RXrO{ZWi_tpQ4avwW36Lz`eki+TQKNs$%H+} zIAhd`al8gUj%#Co@ztEg#aR-bL#$}t19pK9M=oCTO(g*B6N@L}Kn@(Qt78CA@HoAM z0B`kE$_6Zkoscb_eoJZK2Oiv#Gk^3=9%BK|uPdOV9e~#G!@IZo5M9q>{wI7x@VX=S zOmgM9y)TNFa-XWbY;H)Juh_$zAiT!f=&&JFVlV$Snv~;c%?5S56=I?`l^4u8THG7! z{Z^ediZ7+eMTQ8}k+DKcN;unC8mkrD7-n^bmab3{qAk9uNhE3-Lsgv>41cJ5z<7XR zV^}Ar@n^Hm5*sZ;Q~JE)NM1h4#~=yna()YNUv&=4WfWT|17ExaQLk)XgH>^XZyLb*F0E(P_a|WeT2Y=TztgBnpk)~t9 zFTp?5v%3w*Hzw!H>q_rxo^+E?x35ZzMLaJ%9AEaW{o6HD#KwUG`wGLN##;M+fV%No zE(4p&W`!yE(gpA3K+_jFNbDhsogLxv>wzF zUSww-QSUqP4#bod(|-+Xl{eFb$K@nfYmRO6SuadINrj|cJW z4bFyE*D$0I?si+}$98v>mtynV&O<_cIEkR-L4_7>odz6I=qv}%I5saZvvFOWsOG$? zC_@3_){MPHA06j`tTZAh04KUtFTaFcZcG5IiUm8%&csu8#$dCdC%9t(M|y-i zM#zy8=$;9LL}}uIi3LT8;(^hq$c$KCvqO(Xj6nI!>Lt{Albx|<3sv91Gi$an_0`j+ zrURw@Y6@#%V}JF%NMbF#qGk|DOhp>)0w870L^LlVDAC=IBJeL8(L>~u_Lk&BM5cu}#%bmfRDf!iVV%_dT5F$4i*all1K!1b~%N~pjws^o(ePj(iI7I)9 zr@Cd0hH(D^oap-jWO>O`-5+|Rz+j6{+Zb72e7cpB7M5~w$F=3A1^jQNdwX>pgc!u& zr6R0Kk8bCq1%$%rqa_CK?(vc0EaWO5EsD7Ak;n&}tL_huU=*A7RtrSBc!vfaO^F-G zkbuun>__zOrhB!2@|mx2SD;?ZU-F5!{6 zK(*oP=xfR59Ea$zCmYdYJ!}H}qR2zm%X-ac(0_;-*dSCamK!NN7V;5J)XZvu>?eKk z3C=d>ahR54Z~={X(xikn1&HkNa~bo9dG`Sp=}Rq#&uz?A;%H$>5U@? zUwZUFj01N1waK>tCVvVTv)k5SUB34FYMK`b7KvO!gwXUX{H2Bgpc zJRID#;@zLJaB9R?+#1vU(-z84H;macNuNl-z1tkQw<^pCOhCnnF6YqYvIVA?3sy*3 z3893{Ey2<1c|3{7Z4UxX&-1$HP>b5`-)`vni)OOC-R$%G|G0Vb%MH+axj9eX6MxJW z_qKHo@#m*u8Rc=9yg7g!_Yrk%@%Z|zuh3mnk1Z~)&v#$i3$n!zx6Ao1E*FGk*y5)f z8bKz2Z1LOm`Cfua;SYIMo%Pt_m+SK$fFkT3IL1M@j3Iv-o(UWD#gE428WJ=9Dk^2- z&&H)PG?romuoJCT(siBcnzqXcUVqEEW@M(>ECTPe5UdRhES_bvsD~7CZGTXw>pKIa zcw5Hz;5OY*98Ekx&mTa?zK%~JYR%RcmFr&20A@*4lPQsKsk($*22c6_-o&qKv>~1OaW=B(s);^d8B5l3{)S0FmDcz z&=>%mbuR3y-4C*b!_i!^^PS6S=sI8eoi-c9&P;^e+4gs1-Qa)i_1MDW-~Ekpeb9CD zFUAK0u4+V?h4fAt?eIN00e^eX!e>47j$3l!LBjej`o325l;rWX*V|LUGlG=_c4Ugj z&D9F+r{EV&fMf-|y$H)!BKLwOyFQiQ*uh`}+iLFSWjXnK@6Khk?)`mC1t<%(&ec1V zu>`cm3PAIt2x8)$dF1k+qO~;jtb;Re!%@86w73&KGu_ zldNw7*045)pKF926kn&OPhSP+CHf>=^gg=7LKeG zIx+6iT%w8=Ztcbwr6S^ubw|M3GDIwyyblwFsA7C2*n47 z(b0AxpqEV7%%(MR7Ju58m(=MoGS*IHa?ak?ZYTY2p^OdMyCWJ;!Fz*EljoO^sGD=1%HgRqRJz!%(T-m|BO`@C@+M}e>b5Fpr>@> z@BeGCaLoiJ+kYNAiQ?AmtmINHzm+Tc8cxgPT)QK3tTk{E9!|?BFM8}WPPab^OD%~2 zCU-7R<8ry1oBzi#F)r;Df<|8MJ?|Bt;dZFAFD7XE&J1;g>3K-|KhT};Rv zXKW`x?9X~2^{)|L{v#wo_IiBaSk}ljp31fx+v2uL?Ahtd` z7R9GYQh!^-y~tDoU*9a;;Hq)}G70S4Wf;@?%%!f~TSLZ7B~h4opaEYua`8>!=N1X* z+})K~e9JS##+uW(CU2ndZ!nW_WhM~`79%Wmd3y%Sx!qKuZtQzf5tzY@M4rQZjIQXe zvK;qeZr51{;oIOe2+y~Awr~?=6(kXzcr%Yq6@Sp_0nE8#*|B`MdrS-WY0QvN4Yu-(@`_Tz*4K^#g6fb_Oc+aH zM=n7(Uv?A{u5D~bo(PAMz%4_+*R*sJt-u^WixNg!L=%TP-=YQKyLVpl+bUw0GVk6U zOn-bgNtDQ6m*N0&ujl+qY?e5b$j^0JLj04?rD*WGzrU9nVY;C4xtGxGTB!%$l=qO=eh;hp zKF@vQ=6ss2J#-@lwZx>T!ONVKxOJ*hK!5URhG9_M`IZ{=jK-H5Ogxf<2V#D58VGZ) z8I?@gWhn|V*i-1ZEXQGNdrZG{r$_bhFogTyKxig}l8rRlaj+MOX3Lio89L}BkdwH7 zIq98>AUY`*QEnx(;O^V$++ITmO=&)8eoaJ4-bM6VaZoZf*lc2n#Ag)!UNnKY(SKWO zT&xw_gCg{bARjmrE@>+kGs5C4L^CJy3qB^A*2iF$bqxywI9e3fbkX9k8%qHvB61#_ z+&fvHBwuSM=lAuKx#HuV)`f8$(92U`9qKF{t;C#F2X%J~z*X=st$|0Nu`+#1CWHU_LM6t9&-pTS+O1RSAQF#g>BW! zV%(sH1v3b93g|;baso`v(Z z{*Dg}aHFx zQAJg^Cx~u|%j8oSw#6|Iro|=m6fguzh@5yh9UUw*k5sg#x$blcP(;fU4MLdV{kUGX zWO7`>KhE+c_hwq7;eX?pSmTWMVSiss_V;H7%z>8ZB+S!iIS7VuVt>twZ~D42RA@*z z_z+_TKPjl|ADw|NM7L|UbrM}N;^j;y(YX_7oldW7azf^vvliBX>OGaOl4_`#z*di| zgbWxV%61urSa$nRiRnzDw^;$A%)=BS{4gOB!tp7+1mpSGTWUH{RVgCN&dP!?XfV!~ z_k+^|Uc%!hIHKmE34c*6qIcpL?oIWg#UcYxK`~G)83;hirhfpu0@0~k(?L1?RjM+Z z(qs~Q<06@Rjfv?@C8zY#7IU0sLN1$UegB%yG>&>9hyK1e>flr9pv$TL*L0RiG|aI? z!yNyA5DzLk{f~&(6kSxUKR6Vxg=Y>tL_9}T2@*?iMaVp!fsRW_?w63{GMK=Dlfr>> zig&qKjY?FgMt>!$&#ul?UI#qMb*MyzI^gD$naBBf*4Z->xd2%}roXYfOzbJ)C%nCY zb8XGQ*^Y9%>v86U#re6E?P(qx0^SZK1|lXA8S8Sip}9s85wjCJx&*%($67ui)j^AC zVWLq^NqQNXqP0ErS|>|jmiP%1jg1mLDrlC?Wk=OW!*44AhJBe`OQ?$j$tTIK4fLO0t^P{>SZul#9pQE%=nd$&CKx}MIt2*j1W_!&)yti>>N+Fw-(Z9# zjN$D}4s$CwpID}Dn>&0Jj{xX^=CbJPPGqAag@J39`B* zBdBe9#as+1R=i(aN(9h)LDW$`A9aK{Bh`y$^&>)Tq{gNn&3?h%$i%%MQ!GK;LyxXAtlU|^MyBAuzRE& z&Z+T^0lHr9sLwi@cO!EhpM=f|Z`u-e!DguUlT3dnYt|u~7OTb{UO{KvOt;r{A5tR9 zWf>=VUzSK-E{F5IBz5>zx+J^fH}gPaDG>CvOp;(J3TCI+l7OI;G0?TIV)Ju5?Xk$l1Mq_V}#_3A>#;Co$%&67cik%Opxq?_F$x%zS*dFL&8OCa4Y0Q54AOL(Gf;dN@IU- zlERbhG{__|ovdOQ5xj_dWXKkQFR@@kZB8(|zM7G(#-Sk{(IjH}3Z6vdj~`HnO?LLf zw;e4u{k!EVm2|V{{(kvdC?6QQQ(SlnSDYy?LSdHhO2FAm)_^WK^uejjyGT-YPT|b6 zu(<*gWymjlQZbwe(v0%pY*4Dte@g`mTw9h=`r$&h;>zX%#QaF|e5FUfyhL?+;- z@@o^J8434bSVStplpg^o_nZQ7_xJg(mlL-{Z0~;ySArxxdC!~EPu_D{@2dm|lc_hu zAjv6GZ+MYhY+=O>rV5aA`1W3xCYCwB;~*Ie7-TCQF!WIHkO&en38d|Xaa!fwC%u5l zY-O9V?A85PO~HcYjmHXBcW8e#rQBkvVuPRRQW6Bj&dZnEELB|;&69{+4@SPgea812 z395U$y4gukK0;FGTUZ|WRJs&l6>3zlZOpZBka-CzRTT(%uh=@`6cDx-pjB8PMS;nS z+fsQipzK#dA-R-WTzeIt4m6l04mx`EY@0lI%~6rCtMy9vo; zE=kF+aamq~QO5aEw5&iq_;wRz5N$&=h=kv-h^D>XKq^F(Z5ur4ZTN zM7BWqTPr2GZ6QqV4l2Z3(YBdSL?JrP-8ch?zLVoJf;f^(2T{@|go6ZF8rubsDT|as zhYFe}aSGUGNiq$zlD-znOpr(qlFde&a4e7WF(Cjx3>YBx2>^c(!-u}Zp=u)fCd6H7 zwQqts#ra`EyrL8MPWUL<@G^E~R-sJtYo$uMPU;AhO71GctRq$`MXIPWnrmyk2J}f~ z;Jowfu5d>3>%&z>04d>BoD2z|=Q`03ph8xrpfw0@p7I2^coL1$JnJlDK(w1n_TvZ!plHn%}opN7K8nfI;8^80CSIDuY75$t&2gFjS z^{Y`Qq6UAdaB4s$ti=TfWgZ7qp)E{u;sdxuycVI(x5Xiu!Lh+q#aJ8St=tG7Z^2oL zY-*-&ku!hkjy~mOwmVf_JBDSA($r+I4TCU!E&40mYSj0z;C&^*4Wrd^a*Mf3rOvlS z-(XS%$;HjSX_jkgv(>Gc8HxYq)0&^K*Re{{QOuPTNSfiKNa}M3m1rWC#6s0Mi~!!} zaLv|xXpS=cYd7Um?5+&sukw7>D6^&1eElFcE6;z@9D)B>_5l=}a@`pQo*3Ohx_ilW z5g1I==tn~G`-%|*URY7oDAy0R<#52PT!3PVCllA8kOh6`as8@v_>g@aF)}y*hMJbR z%v)W1Eb`!`4cEep;_%FyqE2_<{js9Tdno)~@uoCLz1byP00EH)MO0~#Sj;U zq)vYoTt%=2sb%0q`j%Pi?0IkxEo*XHAR`pp@m8ZxYGgQ2HylIbH>Pm5=+9Q>QLuQi;)2cvO@57 z%|4S@)#zdyJLO;13P#%7D|VjXr#ODfc`<+P-_Ve*PvMFcZ=adcLkX=Ry$_l}u+`C4 z2Px$U40P$sS?+kKR`@K>pUm@eIdh4bl|=P5EO}`jQa%sZgJKS3yhF<(eLm4*PFf&pjTX$fkt-a>#4nd#5LFOrj97vwT36v`e&DoX(3o1;(81pt#<7{VgK zg37K!ITo&)Qa#HtR+fp2!01Q`XIg*sZ2Rt9m>YmjW}TZT76o9W>vG}Y`+Mu?D0`T` zA64AS3IT|?A&uo5Qcp0UZstVK8LN(^a(yh(b$1vYjWjT&1M6MJb_7JO6tqv!v1>lW zr%E^*s%RYonl@gdj>?^mo{pT-6yOpU6+FTUf-nWw++jqw%0H@<7eH`Ou9bh&Z(Df< z{l^p)UO3S+Ne|(b$co+sk2>PfCFUb(gs z>eF1uP58L-|M|A_+z(jNSe2LA9jmVWPn$B69Q6jr)!WjWDZ{>Hp2 zt0mpgWqR#(k5V$KoTcZ2womN!IvkGpN#bT+KKTe)T)22Z#3=XqS@3n4Ij+S$%Q%4zt&DJ%<0L6>FWBS zlzv}7)U@Hrg=sZTF3kSPg*iUCFefJ$CT*NtShJIh-fXlvxoBFO;mJj_)i}B6jG;>x zooVCbqDODjy^VHqQZ#=ykQ&3fX1A$J*Y&S&JVKlhUH@lkC2!H~yOb)*G&U#3=H2Fh zZ&CQ`yR@k5Cx(7sboLJ8`@(~}&B*RO@JRF>ZpKBLM#$DNDiFQ#@4_7C+rjr7Q}yQ3`Qr@jde0TnQodx zv(bjvW@l(NIwSqW_@bF$_5KFxza~(h7>BxMpG?2j4|NT}_)mu7%|GGbdGICL`C5lj z9cm|sUu0NN;bW84(SPz}v^jaOIXQ$rXea;pGCjy!L|pY2aMhtbG#djf+0PpJb31Dc ztwv{*C$zH0us?rr$K@39Y&Elu$^U88{1N{!B>96=kU5M|;0>aguP^dYO}%lz~p>*=#E7U&`xo~!^qJ74??SLHVvjxkx)0DFbmoYowER=l^Xb1 zo?WM7R>oRxz)374NF_J5lK>zFCzkZ_4XjdD9)0zRfFLfybq* zYqeko0&wwDQJ@qTjH;?j2r8E~IP_3eZ3@>!-jaWH37#tOSuKZ76gld(slJ1Wh3`xZ zX-7X~dX_t@VeRCvS2TvG{*XD`dItHApt!!PMTW#c&4TW@aV(!5a-Fa&!gmf|8}WL> z4!(u_pSgoloygFClo|T(s|@|GXe|To;iS{=r^@N~i#Yv$x#8)@z2MyG^y5A^YJ;CK zb$yo$mJkVlNgm7zs1k{T@rC>1Aa(AinY<4CKuz^S@YfP2^obw3DXK}_=qP-F!>Tz7 zbJup_DBR!Qi@+Uhag+pq_EB>684~O|L$;dVI!$hNhSVM&!g-VEgLwb6jzBF}^`ved zxMQe%GWh!^E=U;Dt5&3@Bf_f`;0p-C!QLwPTy)ldBvj9YYbjPjyj5(2#5`jO?q7-( z;4iz$2jPuMIxZ@hg@L`{B~L}gI%)~5K&f|2{k{&@nH$iR3|GNab|5}fCln4;b>@d~ zd8uL!@azp$t9aqfpJBu2b_j5hs~4u+Wjw#x@M?6u+%3^ts1-xj2D#~Q^{m*wQGXfu zm)sYB8&|MH_e5++y5h#55P3h4ZnVm}*Tt*|;^Z*3pS$T|NJq>MQ1p|Gr+<;~H2Prp z1Nf(t>AIb5hWAezqm${no9Wu2-8h8gX89Re%|m;rycvlkTgoRt56Ou!f>(>=<+R`R zjfTzWHH9D(aCOpw@w>FFBzA@tX_F4=k{+>tOk!COQI}aVI?*2ny`U4k7Z9d85c=9Y zaGiJ6A|mv# zH_{6O(3WnSq__$WhW!zz4B-(Bf241N;@bd1JUjPuf4u=HlRz)9eG&}Y@TUWRx+Cm= zg>Gx=@1TbR6-%*op|1UX&2zfu*TK*-NB4sv%!+znw1i*Hh6iQ}4zy;xeRH(4#rvMr zrq04O^I~|c9TtzE2nc6kuBeQs{=b}jRH~|z=trOe)FGqdF?|F*+v)UHxE_^2;O7d> zUXe{RSlA-!fkQDKw5$!vl$*J`w2E?jjU%o1xx3K9R|#|-yrz}3v?p!=Ur*j+ z17Kx=dfbrry?zilxx?e2phsdxk4TCzm4V^8SHWVRK(J8xctm=&La+p7f+c2u1dF5> zvDH8K;%5E35k<4zzi;aLmqnKG^u;d^pFMr_?$N_HkDcgWB>GuK-B$4eUn-dyHa9Wo zP`}&JNz`N>bxfT^EpW8cA2bI#iP|i=rIV=3Vi7grxx~_wE4Zd%c2Rv1_6(Q;MR!sDRk)2y`r6bKZW}Kepo169eP^G zoJP319Zm4F3L048ls$y3sE#G+&3LR;u@9nwrW@}iX-$#BE}9AU^GQ(aP1tkQ-$@1N_8Q*AiX zxi_nExa(Y_m4l7T#>CNo#`>|_jQ1UQ@_NiX(2ZT51`!A(`(ZB6nLeJ*>Gk%#yM)X& z?)*T9o;v6nT#yf3Wj@u{6vfQhuHzOz>O{nTOcrj$^w8>$*m2A>HET403o{_pCSu{4 z**VIk$u)*k;H6TpxP{7f-*+9kLQ(2~*;7diL|iUZ2U8)YX~unj;_AY|6*F8Du5wA} zNNXj0Ajn`AZ-JRyKms@jAGOZN${7c_4@T5`O2|85jR7*e)R136jU&^^1f1>()axrO z$~|*0;(-&4se@QJCO*!}j61L+krNO7(ZP!O5YreELmz_plo@ENb>GLS8apbCUiAWP z=FAFzCrr(xa8HzfJK7SSG(f5CaE4PS!cQ+9hB?OqVUD?t!9ngUs`4q)*Ar*5+4z8# z;sa>H3syAC32trSl;>uDe|ZSQvuBJ5gJ*E@2j26B{>WKyDtfxVzvqfX$fO^@Bj_U! z{SgMc20!bT27)F}1D2}z2+IvkhqO;$B7n&f6a+b#_^o21UVDwe$$?yWYPy>YBf zbZ`a~56#hLgC2i!bKMNRGfuc^o4h-O{$#*TUAA2t%$7jx9MJ4O+zGhUelM9os@aeQ zml(Y#iM;QBhfL8v+21d8A-zCJ^tEKPG=YE!(&m(`0&}MarU3a#b;*Zxl<6eS2hG9^ z=@~Od;{e0dM++-A5lOu;KTDY3%j%)QR3rJ=nSomF_JGM&+473SLZ_CWOnh9$l%Q__ zb^=LD0*U2wsOD^fOwxI_)z?(AL@#wtq+-A<){WeMXH87JQ4u#%#IBJ$%qnw{{y4~w z2lo(zQhK&43w5Js`}`oS7Df&XYJ?9%H)DNnU4Vdwd4j zf=W#}SO+C&Oh*TFn2sEk-^u_i28TiEaN~#+&fbd68aFYN%I4VPkZW57=^vU?j9>mTZJ%d3j#J&P#W39gq(ztvHl_ za>kw}SyvRHb-)t`GXY~@ew95154m6mTV@nx-xtM*9ZG_1b=8c>OH@qW9uV4vRp3v| zG3R=xd^_FWk2)AyfHSa^MU_5Xpt z*YTt}VBplVaUzMz#-Vh}!MSSxrd%~jZ*rzOcRwhiVf;t%!n;`Csx}w%WtFVPZ?@f8 z6^<3Rd}Gw{!dpyk0P6kansV_I=c)HB;yD33ESUrUwZsnR#klyIj8`(D@;zQ4_cesIYO2iQWEE90xm%#)mbtd;)Rr*FIf?Ed%I|b(i z0Xk|qDqrOHP>p~yQu?81*YH$4(&u=5cgdVSi@B zDa2{?hSQP5eMhVc&T2u%aMg6|D&`vrJ$hcW)p>Q&qe+{s+-$gaWBZ9pnG$b{^pe`esC}j zN3xn9-;vv{xA>t3PV`HWcTyz4mXSM=HVi$~SYQ_C+dax3L7`-Cj~?7WO^{1TAxg|G zNVD=51j1$K{;bex^-eN>SUbfxJ$GqR$&x2a4oNCmqz_p(p2$RyUs3fK&zy0h>72b{ zOb6(r7j>w@j#Sk#vf$3InNG%2N2YW{U~Vt)QjcR~=1wmRSio%(JLo)n>80PT(liVp z3^nn%f$<{|(A#x#VXL>lpR;L|=-1j}OxC5gSQJg}q@0-^+v6F35v@Z&(c1n>;lOvb z`W-F31|R4BQ56BX6qO>NxhMbJ}2m!-J5!PluhCZ55vyzmqlhOig3h zoJr(PKn!nncjN}w+mP`hv8^UqPVL@y#>FYrx{SgA4$Z}P1mZx#RI9=~AD@|ly7~fN z@<`@x5mj~1B(s%&@Bive(*?XhB<&xlAJG^V5D5Fkt_~lnZY(fU1BCP{II8)~LqYv! zN!6JTs7W)!)I2WNmg?Nc*&SpP&pnlrWRcc?Za?EUotjA)%sdDp z!J=re8L1@li8v~!R!3h_Q2s1)QR>Fl6nqNUg)?zdgG091bAuF{Lol4GWD@#eY^zc1 zE#3H1jEy002}`5|{KVU;@5Xa5{*IwnKq-^)qV{xPXt8=Mu%n21oWOGj?HfovDA;H^ zQ}cn8ri)#F5Ek#*F68db>yi5Io!K^Tij^&k_;Y)(ojvXtzt=Y#_MoQJOMPmqkEdR$ zFodQO7iZJnDqyjW3b;-`l0{5sw)%igcJe^YDJsL8>KRdw;6B2~Q@mQ6`)F6k##3ek zA`WT>*YW`zONT9~9`v?)4AD~gU=V!K#YQgHi5OjfD+HUM<(&INX42CVi^(KWCW$!% zn(7C^H|are|GplJI6Z~8lA@V0=ahHay-9hOB7g_M$Q{fPAT*qydXX0DWaV(j{ak=E z0j9aQbxhE6|6!`Fbh{b_X2rb|#>A7wTXTuT%eRp1#feA)xC2QJCVV*Nh2la7iwdb4 z2_&U|7LXLK$4kw{5r!loDg+!*i7Y@&wlg6wh`B*7__ftlAbbGk zPS}nwm*ddi-={h516G=@w# z<2atd=6bUcPoQ(gbHcSV=iuW^h!$OW#m+H=NQK3J8ZZ`~JKzP~&nabcQ;6RV(d}?W zcE)~T%wn9J1WzHD@)Sb&gdhnJc?gzZv16F(QX&U$R<>3^)0HJn7va=Ue;R{L|-b0hmb?lxC-!bJfDRXLBG+D%V+bK{NgJ5R} z3;TAxb|3F{pEN9#bg3_ettmKiM!}i5BtXB;r4;T5Q+@76SYWeJk0~pwZ-;-d30MOU z1>Er>Xu1B@+dS2SR6Df$8>_o%HNht0$aj|!o$7~J$-M_mu9G{H6+>llG{+YuS6LGN zgJa9#PRdLIM$)!)rg$^W+V|jsn{9n>Xys=nJZB`0FB2P(Tm(Nk4F!SR;Y?374CEMx z=XRo5I$@vfL~8<>vAu@`vekdwt-bC@{gUG)>cl-LpGDQPu>i*vzmb;^+e&lUb?LSM z^LrYww$an3A5(XFselQ|3S$EgEl4>iP4^-xes#j!U;@Y|n8I#xZqI4=|x^7r|%&4DR0-hb=Tpph>XUWtls6kt=pEgX@68wors) z*?P9?ghmK{DOu2R1K@<=WRC7&u=|^hsSTcVGB#~SR0VWW(3N1^RoQ=Hvs8HZg?a4 z96||C&e|+xZH@?^2c}mp3JsfB|1~p|xeze`aS;i{4Pc_LU1!)O3Fy?D`3W94o?}99 zItT+Cn%!c<=8I~M4k20SK(YlkGdURY_)YF7czmo4)ssL`mi&K8Q+XSKpo-Dy+C6V- zD^DNo5#=88uy*P5Q%Ks=l{HkLC@Z-n6ujq6As`%3*!<#~=3X?oEo|-!9^@JZZ-B`H6)TiRon??SKo%l=(f9K+Zu}>3w?M)#-9rz%Q z4Ul9I7ouc`?i3;_hfd5wfs@1;Ki1rqHhxalF`dzLviN^_MM2fh9bN95ODL zdP1Ics;@b=o-*8!BV}G<%J)Cou$ZJtNNc2%VVfkHriGx3Zsg;2aJ)=rWRKs$WoWEt zB-HiM0mpywys;H$ZveMyt}`{z3kn=0ZVL7;xqhNoSd7SA_0^!&-3(kl{^1N;J`R>8w&qd$wrd*-Kqp38&h* zzT~h)T6{v9Vwyo`Jf8(3k$oLu`75MfPrr=x>(MQwUoZY0(yv!v zTKa$W;wI9s7q^mrz5aJezdrme{kog<>&ah8`t{r2(y!~KU$3u|etlP#em!E+uMa}# z^@DhLQj&hX{qoYUA8s!FdisAy`t?+ne%u>4T-_oxeO20l9(yzBw=@%o^ zbLkh8UCD_Rnb$3O1@kxIDGhEQ$@+MuB*^MvS}@_r=TLFkN~AC-TTw}Xg0i2s1ZB4njg7xU z`PTPbU`0IeF*bgsRp*w;mJ*OIXCmjf*Kcs8SxR6b(IO)VwkpN)4t*ajXyhku;t8p>I4 zSEvubZW!G6=@}V%Bqi~Pt%rZ>q=(m^*XqGWa)KF)ZURe8sQ~Zg9m=&UD=s!_xcvIK9(xx^(|K$LTUG9jCalHXFY5o6Ry2 z53YQi^5mNwryL{vUpP+rP}y<1T>ULD{##)Dx4`&sf$>!WW3rq$Lv>2Wt2u=H4Q8QA z)N?luRH7o4sgB6fcea1;F*TEnIrVp(UiviAwKcQdO6>L2OCsOBwAGnUFI4hjm89P6 z5)^Py@di>G6haj&-FWT=Z^FnnI$uLnX;h9eR)Lph#1H4s=o$43141z57X=!95L1!m z%)zdJv{Q6s>FZlU$P{I}=p~0HXrx`X;g)#^;yQ~+Tko{{(o%nC8P~NyV&V#PxLj34 zoMA5F4C_UlVXcTWburO zJ6#+92o9)ktL=Z5?h;t;7Fnvyn!ONPx?KFt4LK{;t3Deivw`0h!+GbZ(>1l#g!*)n zHgNIO+?xl!l&ol3K6v5=xzED6@{DEV+nJ&IgaZOcsmwb}EI6=deDjbnI9j;DoaWU9QyXH-6%ZGAwsHcyZ+q# zm}6()&&z)cKLOVw;Ke{B7sb(^JCt&^O6`CLoSFjQj(>ippwI<349w$rHCMvGztror z2*-4?toLqKMQFiYn?%WEWBmC_Sf(Wj8n1IjAe#qgGDC{2r0B8hGzV{GG?*-EaP?C)}K- z#qqXvx}|VCS-#~n+%%27@hXMAL*p}VLIF;UnHNl-g7d8!B&B}uhhx`QG2T1U5!IRm z%nyIl5&C_pey<{EwaX>67D;2`4vV zGLZ?51hm;}&+Sn2Z+5Y`%l9FKk08Tvq~BH1nUfs1({fIBAP<+Pr~CWWPs`bsQ=Y7> z=)7Ef87X9R3n}FI-ywxuerYM>_$E@w@vVQPkn_K#kav?pp8bWSke6jCWW=P9b0K^@ z7Y}D8DdhRhrI3sNJ5tDnEQNgcw-oYkDdgW$$iJnKS4$xu-%!NJ4fY;+t{=|r^*KsS z+NPNi=Ewes`o6tZ_if)z(#B-r`BT+iNA483qSxMhk=oX_s8N)DItc@NJqv^M7(9P| zHBBaBJa)QfyH7i0d0HcEe0;sIQ4%eBMd(P3G8u&Dn%-C*gG=?N$1iyZP7pyZFRL8m zo`w8kh)_ZjwhLAe&vm)1VZd^h>s^KA3UZb!sAsu?E0ir!BKP!MhbRG69xD)%I|$a1 zXTGBZ@ewY`Q~{@7?CC=|R^nBVfcSrqLX;<*kve81b@Hynl6|du9Kzuba>;WLG@Qp_ zFjsFXR=i%SxJ#yZLk8x@aICzB@qumSg1YE)?=_vSCQMcW+}s%Y2>$4l@uh-L3!@2r zX?AM(pSZuP1My(j7cbsfrgyc-?4tac>A=t_8=FpUqBWAN#yBa>+)E#L1U!GHlQ5Wq zU?wB#Pn1Rpj#vRg24@I%y>d?JX`QG@>h{|8y?J1(F<=Ch$ReTwk8DecE{h7n;K=tT zr!{&ki3TCAxSV)$se%9xs%%g;4UG@sxWN``o9pbN!SGgh05OS)VAnF-x^^3&F3CEK zXkdqgLlxUc3U3|2gw2{tKsA5IRv*SxxeQkd_&LUhb2s30Ig1S9`*LA62ykz=g*%%S007RZ@>Na8&MYaa%m@t;;K4P4^>@QW0y>d zS&|B3OZI55$OJw6m9jBke~=5G>X*f0W@kECUO)iR?w~c$$?}a8XnlXP)$QtJ`P>P# zRty*7G+tYfE;05GbBdpHft)B>X9op?sF`H>()eA^qY7MQEhyN&D=i8sqxfRS zJcz#$EZsqT|GpkL?l2yaJ*|i-8tC6TroO+w#brdi)~Cti+`dqp@&T&D31LHSP3TG7 z&a*Eg)Hu3Er~&!y?=M^9BlK-H2vnQRl3C2cI2bqk8WiaV?WT+pK76vNGFxO# zPSZb+$ud)D<>X3CzNFRi4x?qjjjuUw+%{dtNqzzdx!3NNX8C_N*-}g3KUNHkbkfZR z1A-n>yNSO;yi>s&70KWN(jd%XkzkGVQUrP(VX3el}Kf|}3ncENa+U03pJ8}es^joLB1qXE4`rN>RaZfR;{_ICA(|0&|O=wUA8G@ zYKpPuJ$rwv(cSV375$!o4lRf#j2Q1!w6bP`sOSSa4dJp05NH)6yI1m!z-C7&$&x-w zS`JR$IoaE;xGK93SN3I1Xw-2M-S}QxL%4K1CJEj&E+|cHN>&Md8u(touSD&XfM&Eh z38%D?P`p2D<*`+|dTvqs9o%%(=_&f#u@%$$^I3!oel13o#9vl37^gX9V8-jpny-ihiIHE;?C(o2 zMNxkaX!_xhKS8WVvMiSzixrWp*a^FPQBgew{mFx=!+K~=$z0De zh)B8o)u~;vhP8*d$xG5_ZZKcDa|&@C#VvnFs=1@r}mI4gEQ5y`b|y&$%`=cM;{x{Kn@nQ-(fwAYZ_IZ4-# zYE0cp+DI;g)V*jdy!pb18%i2Cu#gD5##XmR8XOf8QBTm7fjj}f%M*V9 z$b;QOFuetQ1-OXW1q1V5d|ZPEW`5|VV8=3pKzXv3g=(46g(~m_>o}_+ENXB8lei?Q zo%)?~3H?*anoYtMOb4KWN|t|UYg|_w!c$`qJMFlA=&PLos^tZ zF8?K+C&gKv-{ELNdx)q;vqP7qbK!qS8MJu_cFG2%5{?mV4kZQRv?YLHQ`jf~hsuC6 zR43t*)rQ#xq}&XkMtm01jEK!_4|y*UG3SOiBl-CFS-1e^5yzdv@Xy0jp)vNu$til^ zX7)|Xe`$eU1r)ke3AFOCbSJ+`Xnf3Uq0}G@sG6(zG4$lsY4OoR%ER6ky|jNypw5Sf zfbN&KdGRVhof;VPFG(eY0N|V~!gF@+6(88)=W{2h2}uet4*|?WvJyH$h>R!2_Z5T$ zUJ;+yEY~@6sBs><(X)_2Wp)M;2`;h4oC8Wks-d-sXWx2!x(loUJ7PDy3k*$LU&bby}gww&#ee8bs+H1{s4 zY$Q7-rEO%d(J)c^@V6KBBc-0+7$dS!yd-oEh7U z6HdXx76WaDTz?mr)*mkJTciDb_M6YmRst$6GydZ05rStur`&(>=q4RM@Nv>7R9oD) zh)Kq*+iSL(F!(cPsm)19=niba$9tw{MafGndG0K=%j-*?gC-Q2I*V*^|9*C`_{JBg zPoHbZV@>xQ$CoA$nm8*ho}X*`cr)#6fB#Ip^X`muDc~Zx$Rv6N&i1sR@O=U(q*kZKfGNaATI|&xb^mSWiL8N_8jhqI1 zxJpB*L{}c3o20o703%g62gFJ8DWgufHsVn@rN89cyPa=u*IE9`tfYh#gr8x-A=kxh2=T?t3_an08dA4cTc~RSPvssceoX;(;__D}$c4*mWQ9`|Soj~3 z%_bav6~#NY>}InbyOYy-43Vmim`3(LX0w@^k>8wUTYIG+s!)rHP6U$WheRdcIg7(B zImPRp5{xHgrDwWbSE4{cuZvUtu%JnP13!P0IZ-9$(e2;Jj^>~-I5_rR?FuCKjC@Bv zY-yT5B{T9u*AKLOI~?!tzuastKpFTL3{A;P=jCRzY~iB5b?PJvFR~H&!C7{-wG0pT ztKwXWak1%3(`%6kq^5X8tO`RFX0+7INIJSTr+ zGAEbh9(hbIa{1-O;jF~}&IJE^zVK3d9Jvz;t4kZO3DiutZx z(6(wz?89V;)hQ$AVLUzNG1JrltO!{`{E|w~ztZukm;P`WEohL4iFqD=tfVZHO2VS_nvtDI)($E-7J&dh(mSK{-n zgpfD#kun!zwrX_fQZZE$p3!*b!!*0AG`wQnY`d`xKQ@?yCNB)Wve)t=v9?NUIc`nc zv&j`zDxXs4u5JEj)T#UlgSYL^Je8k$7C-j{-l;x22vaSJsjhshT!GhXQAiH=1_J&V zjVNBbQ*V{ns?mZpd6)C;nh}3~m5`&U#CKCVk6kdki{cP1Z)-kH!wDYnb>Ajn4Od?w z@OCS750`)c$6zo}GjxiD*vekN1jLhG+N#lGoj?Nwsesv0Gmt)4lg7-SSv8r_h}Bdy zrg5c_^YjEwB&w;*K5n{|8J9VfD(?z%rw=7e2ik|c_Om+IVGx_Z|tk(l}{b-8K0@(YOnhuL%Ul}4IVt$sVDmvBH< zlZAw%NPqOG{jl4I+HjXG!4L<3IlU;-DT9Y)6vkyph7Wk?|H@C|ap+IgERR54tpYwX zTlh)=FLixy!p-E_MKnuNGkzmKZ~|@6?+!XTS@tm8$a0_`0C_s6&QNv7ZUhYAIGDi? zbIFE=MDRLw;qRRN`0yu4{kRPekqa*GLRKuoZ&BpaqU;}-7Ef1R5aQE+46`N^&zpu5 zd|Y-rW)q*HfMTIl8ZN^0lwR@|aP+2*-DJUjyb1oM6MP?Y?se?NWBf@%VBXnK#KLyv^RA6!=+HQU4nlz~6=ILmg8OXKMPv4d&3% zX^=ENh5>ENJmmbR;p7x+plqZN04I!D=vH|3W-~CqRVlE$D)qe!4|DrV^dmdQzp#_x zA@x_Vxb$K|ee|2T^5K2v0@j2F4;=o5G00gbtJq5~8?eiuW}wr5;3tgJ815IgIGh385SF1&vQVC^W|N$)!-v#&0sNK- zpG)tf3m~=(gLya|vnRIom!X7(0t>+)Xd^raZZK`8G>yHav6%WS#Vazq3G_CgICH_= z3t;Ghhlw6OCmz(pj8wfd3KJbp7-)g9KEhAAtVdPVPK1&geG2@Qp1$WL%&QFu<{KUNfcT(XyB!C*RyLkLpF=8;i* z?1A4Vv6nO)uK*E5=r=lAMG+#?h+#4K5vUWM^Qnq1(*@2FK;s`c{y!M>qppfOImK#X z>M}6I!;MK4qf7k7JrjE{s5l&l{4{{abQZfydLG7qfPUlE81t_%e}YqyxCn$Wi!S~y z=#t_CONR+)BrtYtJ6XEE$AA6Q^-tMzoL=Gs^gRiEZ|bpx&|kqpCNO3aVrt~ZINwR+ zuY%J?f~QvU#|;1aOe!m+zbov;xd+_0nzkF0g#DHvJ8d`40B%z}LsNttU?y0rX^8zw zaeJnJDI9d^Do)wAbHvp^qUY<8UPfX5vI=7A`uXb_o2IidJ15VmA5Pd<&uHv1usCDe z;S6E@%u80T-w+Fb?#5AG**V)I=iVty=>-jAsQY5+HyB)AgdYH|F9b+lvdwYHj*O4q zTpclu!_--Jv}I4z$+E8>%u^#-ML_G&X|5!H=*%f2HUej!vQjbla%gu-z8vP>7mss1 zck?^?xyOTY;)s(XDEdDu;SKWi4zGC?UyJX7@K>YdS@5i#fPRS_}gAwyEaNLA%}j_7g)6~X95 z%MPv$&Q!Z% z%L{Nl!?Qf*y$4m@t&DFVBO4z&%-ZU%fC@b$f9|%(d-)v7v&)DYPt5axtffn7L}>g% zwV#3B4Z_K6Tk9o0)8-*r&tNCL3Vm+^xAnj=G~8g?2xy8&Lx%pA(J?N&Sm#TeudMKw z%)Ok5z@Dg~g}c$nH=gb|>Wc>t)x+ER0H2}@@RTmW&HF`STg~jQPHzDg%1-v{t{LWj ze_r61CdVtvbhV6Zl{`3e6#;)vquC1!I`|OOOFLODjJ6TKV$E5kl$Kh*o;%~ zn$+$$TRNF9ZtBPn9rbYuCB*aCcFQN^f0y5dX&NqT{q{lY(Y8;%`J%=rpX8A*kOKu? z;Tb*PzT+PK4B-K}(F1qqcQ(+q`P6tp9vbIwKh^Ww3n1XXq~A8_COI`Gwa(6}Ufh16 zF;d32bKqv}bl?^nXRO9LH)em12NCSk&s1`FRb_L@(&`GvhmN&a_s*JJ{4a^QLtA-K93a1c#wdybC(j z`cUt?S^^d<ZK8f9&L zze-ckBi}Po4|J%ylSyODMyirPvH~Kp^fKaBqK&#B-;ZGed8m<3CzJ?3e;RG8d$&y( zruljFa5{}aWLL9NVIaITQ^RH1vK#EY?v?GmaFKw)==B1Au4|m83!ZbcQ5y~Q(|hsk z>5HFk+Pd!rr#$Q7{9G#~=r->Ui#QbDx4uca^3irQ3HOEImULD^l2APU@)C;ULPGJF zODJX>4i&z^#r}TfUIGF6f9^F+fZlxKQGc2!VW2!t7eCQUA+_K@!bKX026B0ZHx*Bu zKa*q`ic+jFd-sw@JOB@Sm!`Z%_;Gxt@Z%JPAIB*CxTwXQIg5xy^z(%Ah=N}fVIU-G znc}b$h=~F7L0mAvmx3ERjt7wxwoELb&0JM^$Z@sdO-JaBUU~-=e|b_$VY>8Sk9!3N z6l??CZE*WGUeE4!&=%V#07wUi_19O!dH?G|3QlN{(pb%EBCx^!T5m;d!&Ph~krxDL zQH%b*+pt~tIP33;mGufIr*O{g{pZc6`XW?ZUaNcNdOmCtL_px5U$&BW_1%^bTU5(C z5q1rV+U}5!2&W@#e@ZG;guS%p z7YT}D7{*P|peT^-7S2Au50RUze|EE0((tH8((v?3Ny9zU9h!;Ureqy(mrZ+471(oDSvHvQ=~WO zZd0yTgW%)-P8oi#`!TS5nfq&9!8eN!`R?{%M z-7cgLtR8gFYFfD9O{?3+?)SPDR11xCjDCO65^pV|(>cOts|6h#3_4BLp$;5jM!VDL z;7VH-E{ACij-WqQw~MRMZ?gWh+bx*&X0O+V{;*Z+7*?;}K5AJ;s|`B>#tY*y4YSq9 z*@9!LjS}nu0j+#xw z8VuMA458J-9(6iR#p)Y<3xM1*+E%9rE7t7vaYb7_fTONqw%LmJ2hhWg(P}|0J;Umm z%_FM~J;X_Dw=En|yV>pIG`0pEc<&7?w$dh$2(Z!shy$bF9e=d3{!XtC{jmD2KFnaN zZ}u6yn*AfIZ}iL-w%cg|#F$2_59QiMw*~Dqjb^ir?KFE59w?SEhVp#9+%2kl!8W4%W)op~4U z-aT_KY5dMod3Y$M)URTyV%_2#p3+&O*0WZ^lAP;EiIyjR(rB?m{~u!${>^IRsn1nX z>hT+INgJT&QxmSLAk*a%0BjAoHr++KoA9s9xvCKjkQ+ta=MxLb zWnI_IMBC^v%A~t!SVpgZ)-%k3-!+;*)Aw3NAAd>uZlhzgnvIrWb)Sh~q+WfQn6xv+tn?2t>_>Jk=JvuTk9v;46- z1WLUPyfm>@bj$}7sEbry}L^^4VIKyd}KDb3Dx z*fNIpXYS0Zh3xsRIRY#JBevC5>}&tX=Sja}v@jf?BrL`1xt7rf`9OalHoMUr7@h8< zmx0m{L;)t3#?lZdf0J&{s^iJ!ef_I5|DNe#|5PhbOj0*pF+BwYJ*K6AuqQ$drz}LN zdi3)7t7nhjJbt9wyX4lt5*`*d5bzt5itsZJDXL~VM*UPDzkdDl^;NZgxV}~%Br&h^ z_1hOOp1$~gcb)gHuQOf+0Vw{9I*;ETzk2-Q(N#VD?)qAje^mk}F6*lZhAiDwW*M3P zQoB@<>(eylexjLx{NScSbrTJ2@xE>yg^7puj%rMOy!_A2m7mdBYIjVqiUqKc^SWa+ zvj9I8VPu;GJQdg`k+lf>rD|HHuzF@DjA*a{&JJ#lt#5Ab8I&M$nyVMj%A6f31MN5wHA?I&V_1A)Kq+>l^p@ zIt9tP?!R6ItozvY+5omYqx9aaR}j;7x60<0^36-KPQ%boy$H3)0{(saFlE|15;^+& zm%q&ZS8Bo$yFX%Y{kE(wrt@QaLf3oJ+#I{>!(D0)8&J}PVu>F=Q&IbnY zLdhzRc;J*&vADvH<2WXaB~)VEEs859r=|l(WW7x0c9`izv>)86{XpajZlPoI2U*9f zfa%!SOoIk=c8Z3UG<5-fj5JJL|J!6+`Dp&^bD07_$X3`$HM&MJ(6H#?6@dB0qvy(V ze=z11%J35IG`~FVY!ERp-4*>IMG;^i*Mtyp15KmmmAJU&bjZAo2)POBMnCFg-mO_hBM(o-*eFcF=4z?zpS>B2gw#7-4UjP#~tLIf&TgInpV$@ESEC|A=x zER~ZuWe<6b7P`_3Z`Wt!ZnxCte+b$n+gmouxzoMJzVAhem$04oGIzyCdAjVLZ{ba+ zG~htqs{!)C^-S`IaQr2irOi;H+m?GEnkZs*6LmxvMf~SLIv* zut7Y#*#w`!q~4yrQ;!%YQ-cAn;q=P%${GFQ^vYS9pR{LmC$D!UqgUnfe_#b_7`!rZ zaF$+09GnF}7eL>1au#prti?=jJY|aE0zYxo0ajYf(-{6db1%bHDvnCr)o0%Ju0D%z z$z$bwRaj6MpU6|O`G+}9`9X#HNZHPFdfR3fwaB_rjRe~gd3m`>8y^p6!y z(&LCu#AO@*qVP{DyOVq3uP&a40eD0#WrlQxe^9H}Y_teV2!&W+!Ym_aV<*r$X0xf2 zv!xSgy?)Q?>*Q>Xel*XPGLAcAI8L~#*=*8pX<@5|2v3CQ5xNe6W0Kfm(JE5?AowOd z2=3q4<6$sz=rG7*e^12{Uc2OxgUhils4m>cl@x(Zk;Q*}>7$U8ayAMWMQ;J`K)XxMu|C zhs!8MtCc9G?oJ1g$)(H2svRQHeGz$Ho)VFVN$u4E8p&Nh{_1$h+4nKL*+{{dd zHHB;}b0GhK_{?4^`0lp1D6AYGmz--j4p%8p zArvrv8DeEDkp!Orvq8cJmt&ry?J8vs)7Tp{wA0oWjoIo4UI=`uTU$Dd=^EXkCo=^uN*c0W zw3OXIWL9RH#p5$wVn%}~NFZ%NZ3A4MloAq81MCrd_}Xos90MP$?Z0&xy3}*MiS2=e za5x;g6F~W{#4x@YKt*A%d8brrxosbNHx#jJf4ZU95xSmv=7FhcR6K{72=Ow}&FPP6 zDMj556D5%%f!(w@o3_(~*}(&S#Zq{OMyuemny$UDogwbh)ls}f^@~8SRiac@K_8cT zE;O@4u1k!}sw4$nGmr)@-#2d+tvz1~+abWDaHrgAL7&sX&uxi3m#_^xux^?Vx#b2N zf0nh8J-x8~!LeWjGtkW`&x8$_Zb%6=@y+OnxkE#ecd#Sww;>kBex4Mu!FL46D3~}B zp93OWazZ-p$RXF1zRVlZJbd=(h`)Sh&!CUrI%M!V#6uRFiIxXKLa7R!k!3b0vars% z=zG}j16jDL8eI?QZ0w*xD3gP9rx`b`f4FsSldd~D#zT9SZULt|#9->{ong;$yYd~u z62TgSHv;9k9S)PPM0ccDf~fea26}_>7%SRllg@*MRXkFC3F>}cQ`x&&BqO68&{=ihHcnz+gM7N>@5Ge>jr+{+2b=ze`$>e zc=kL5Qf>NNTL0qWk89(bTJ+wSMKPm}qaz2%c-Ayw?Yp)iE#|j3pWE@?Bx*illg%O5 z4bmOE4#};#$7cckdnBmW$HVa2As1{nV?Uy2E}@laI@e%B*bF>~x&c}AFz&KdE3UlM zusI9b$MY9!$GrFmZU0>enDNk|qqfrz$pF-eG;L?#_IfA82^@PUiox%`v!~(? z$PPA~cpOTde&h8{CuH^LeGUV$Z~Ofw(BKzu^p90}s>io$Ik(S-p&vh*f7nhyzf7sx zU3UO=iEgwLWs2VlfMXkXpKtQ`IW#kG#zZ%Jp)~bY44m9XV_@tHjJpLE=^xr|bg1RE z+N~M|VjTogj@Xx5nZ{F4K2tWOSb7TXbF?t(^+~zDty*Y{Z$8NdBUyu&c7P}LY)$#E zSt?%GWDcKPZvaZLHCaq}e=^zx;)ire=XxsZW?+NHs(WOQ?Y1*?0BT;_(xZ`0xJ0EW zEN=H*cc9E9)4R>U!}e%%$(O#C-5Zj?)|?_Q+zLVyF`nhSH-{8DmvF43yTP$e*5Fw3 zQU90~iGB)s5!)AL2eMTFlL}f&fl6?qW)O=b0ySS=A=d)+u=Sw2e-B40sHkH(;>5rI zKzBi{;*<%Vf;z6;bqR*nu^9&#VKFWZ^dML)Y~EfEEGsbfA!B2opToA(6)u`XtKMCjokhKijf zbVPJ~EEc@$7mJ&7e{u0Xf$E$WM|F;V9aQH?Ms+?b(T~q=o2qSGa!ezqAj=ep!+jyv% zG(^ny2$N7{!TvO&kIXy^TA-Ybk^KfhiL@sf5Nj)zXi z4zS9VIcQ{?e>STy3iSsSW4TGu?7c!oqhnlSq{81tEeAx*d%(k7UCCm4a=e1XJ;;D?8YAu%&h|>so*oCjs$pT9}=ch2d66IfYP< zsg!wAkTOroW;8={I-PyQzsd$2G{6BE`E_Te_R03(f8=kLF8YpNVvAF$V-w;Au%Ctm zgop6LoYRhjt& zx_JRw&Px3mXgUA1h+eHddA4Jqo9A$U_sQ-vS>-9wNZkD7G!i$3Xe4f)m;XXHA3#RO zGF4u1e^T~7EDaRX@yX1aHxKVt2TSYo72UinXuTTPZQq=;NX%e#x|6mlWsii-Y1Yy@ zX~Y^?x5mnW*c$fQ!?R1RUa4qT1{hd(uW{^?s#W4wGN!HCcnUgsW4W*2e6{?=Liert z(l9P>zLvpM75wq7%9W*w9~!#(3J;ItEwOrKe`)bgk$`z$S+y%mW0&Fqn5$d$D+@g3 ze2q$uH=h(naWB`Kx;ow1FvdRu#!_l02UgCJ9TI$n8qI-A2TS9^*ZSp)SB7qs!M7b2 zYZO{k0DFf=uAa8-iPT3Ab!^R-$d4KaWvo=eju6JCFSSuN71AEZQiT@3!`e!jo>fyy ze@m;TN=dy}3t; zU|Cjp88^+<)|R8I(Q3re2KOC*NBe<2FRe#-^ocfPeScGkT%T^#TiF`vOd%vDt? z7W|S6MSm};$^Ok7wrTBDZa=)A%T38r6cLP1mu9?)6bbbRlt5WV~a*f5G;!ZF0(koeFSdf54HP z$15o2zHUKqTk~p%5L(r2XJ;+=G!PG>T9wNxi-<(}~HWTm#VZerh zc)}ggpoR?GxR{My8sd4TJaFf*e=;nQcIJ%n&>^^VLdIdBFoBmaoFsBX%O~$NPFd<+ zBv1*W5Ch&sAcNxYH%@vMIOW8sQ@9OH(l3aihen{^gxZ04@3|A-+>8Bv+z+b3-4$#rDmr44Jj&3@h63=B-ZEF-6oK1zqIi^JNb4 z$juYEd1e}7E;&nMqj+%AHqCwX8CC@Dg)972$DWF+a8{-33F)pzAteBEoGEHO{7S|_z9&n`B97+(_jAci_8J;aV=Ga z%;N-mNKK8QpQ}!byghqPu+2&PG!$_(P(lm5&8Qma8TA5eLwl|_0MC}@)M5DJkwkg{hZ+aa`5sj6y4Rzt@Rf6f?DbdxrHIZm6&JDZrM zSfYsgbKR$oM8aYpODE@_BQDI3HIb!el50I(r1Du$lWe6*o>6=mlmqvzJHg(O?PJ}z z%HjB&DctR6q!81j&&Xl=<-uM|4pUNlz(=|k#!<6o*C5}#T||4rw-QPu5MtJmY@-3C z0y`wMF(xH1euJ6lv5O>j^o=UOx4_jsu&Opu zcBi_bi!9O1(*q=!mSKk%*U6QFMXUvZd}f1IWA7<=e@o9?>U=!2C9q}Y%d11=%l!A` z(ck{Rt-t+$|E6F5&ws8Kmw$VIlPlxj|9N~39?pnZGgmjt;0>z>;F(6sxOP%ybtAxWm%wy&zXt1d;|L3q%$dVX{E&gSVx-C zdQi55f53CvVSs%rPJ-YR1I3$#7SW&WRQGlaH0!K7zFrD}U(W=RjXz-|qjx4AsRPM^ z?ZQ4`t3l4hIlE3AaOwD1EO^&17PA|1F_K|Oe!B<^$p`kY07LSsG8l3;vlIkW z7H0d@F)ZhvHM^EE$oW!%K}y7l85TwWmuw#2N+9I$3)%L3i|sr@Q~(-#*3lJ5|Bhvv=S@tH?GL7V`R zWv~Puh(xCRRQxRB{okpq`VLH*I0FqQe}!(uzUrHo@bij)+cz(REBN-3O(Tg~DPEo} ztka!G_^+p!ieio}FJ}jpD7Co2mpn$UjGZCH`3Y=)ueuJphQIaNvy2WX~t8MtF>w}MJQ zlS?lcO)kBpRu0zgRjMEYJAqaL9@ytNm|#q3j3ggE%F};!-O+{n!U-TE*!hQaePF8r zj?{N<7Y|QiQk49g7W4ScSK_8Qhe@IUD`7#Cz zT|9v$<6U|B0&Qk`8N}r&Y?`yJE#-oUrluw>KvM(F5;tZBjUM$9sBU4aFkKe#8!S#> zDYU^S4}bz{63LdP%6`l!=&+9_xC0l9KvB%u)|UI**!FxN1As51Y6S#4*Gk_Mi=c1K z0WSte&dxaoIfz{2!(M>Be`C)bLnoULsvx=#?J=V|d{9MfbmJ~qEpYn|pt*SA!czaB zf_mV^a!4HJ9x6NjYG&p_qo?=3Zvd{9jU%&h}FJiy*7mZA8`A1-MtGW6iNfgmkLCUeLso7h*Zifo%K;6Z6tY2CC$cxZNj#ymHog9 zA9;|^b3o^TN`kh)ISASY3n})<`42C-LkJ({2jTXbx3+CFd<0-kXGQ*O2}yl`O{;^> z_PY1BZL{;pMjm59FY`fXv7?k;HKHf5S8B2$J2)pqPw5UCKMqolzn+jTp2oQ@!SOMB z!{iwyQ>ryX62?90!Mm;)OkOhBH(1ZQ^hH*mHWCY5`Fo-LtSf zc#U!eFKUC}a6cE*7seG}RZn-GZgeLM=#BmoX~*>vZ3e(Ii(>o|_@;I1+oDAWc($E7 zInbi!H#j?8u%=O&hq_TfUcvP)JIHv~ZCkIP692DUe>LKW2D4$=OS#!ZI2f_Ir#)yEN1V-#UKHGzAFxXPJSKmb0UMEr%EMO3_LNv zfHZ$4e;}e4G9tRlCQ}KE!s@iOrD+eK*044(oOI^HPD=Oh(p(mYAeuQeL|{ZdyjEr3 z`%P>Yl>Cwlj^L`hA6zDOWJ;;Wepd=m4BSzIEv zq(@$gAC>4!+R|9!p^r<6^zYpg(C(C|)L(i5f7>l2M3*2b+gA$xaWR`rnkk6q46|ZF z&&Zx`Q{h%yX?96tkclF$)Unyg@JNdIkkFPQD<0j9mL;3*Y=-6$s&4XROJt%tyrM45ep=Xog;_9NfI$dzX6n9OB*=+eHL2;Nz6PM#3!mLdg2+-SnA!Y7}+z22HNvYh}6N`I2BrNc9LV=E>C^hDmr%HVk;5j^kq?KL|^ z3NB%iU7we!cp0;kyAivOHxRqu-%G!@f0KUCej@4jJSn#wGr8@(5Z6A7i?f8>_PMy+ zcJk}UZ6~ta_CmQ+Qtk(c(kbmmu^lIJB=QGjTLe!^AI{%4vF&yGXSQdLeBCMg^e6ar z&dw7`?=g5$L@2)vg1@f8P0d&=Kr>UV7zln-kRYAVr)-pvutHNVlPq6;8Qw%4e|`a3 zpdRJ^%2TWddWbqqj0#bQic!jRUSz&DXH_$`1NcNtXB8rC3yNoHhPc%+mdsC;X3de# z|Gs^F9qC#A1|4m&PiWbHjopKq|4f4JYwZ?~Dh`iVC4 zhsn+SIor%Xh&}wJxOkP=%)j1ws5V}bLh{3(zmELyCzl`McKQ_Ar_H{me}huKcH1JN z9B>KqAe8iyN1!X0%Wzl3*@y$vi69!{cT8$6MWKt{&jiwlGfG7`$jh%(%Hx@rp63P4 zh{NlN$Qi0arUGZgMa)FSSX1^?e2nyMDI!MtQFBeJLS)cXgpAAsMmjFF3U3W@ClfFu z^B|c+kgRpG&Ei-Zx9CxcfBRgOH;&|3F*f2x&JG4So~|e;~Re;%}r^Ln#PH zG%nPEHxiGt(KqrQCqi&U^%ZeAQpHIPL`8^>)FTn6L)=b9=TLP~HaLg8dSzousGikQ z&*Bgg;!ZM-L}JRN<3;56S{yl|&^n6MWtE~`#A81{=*P-5QQV2#mQ6?S_+Qev`QbYL zf#%PN;}MBZdBHr2e|2A~(dAel*?l-JX=1g^Uv3ra=-Q29!wpouf5fh6f5&2lW~E6Ko8A%ymq;_% z4T%s$S?-9FLs9IH>x=y*TWlU%Jo!gemqabnEe}Udc9kGR=aovUjg(bO#L#57f=B>L zg_L18ML12~rRj*8Jln*GjfvyMopQOHI)WxfKY)ne8arJ%ic=BOOC^C+$}dyUQWaah z#93%xpvqPwAPe=lG&nTY8`*_2WN6tc?dbv%mM zG1KE*Wf0=gCPbf?jW=C-`RUKa8aV0t{IO}>W^aGvsrjs(@t=x_Bp|*kYq0X!aLGOTU zmdwKhKyed#PoUrHy|Vlfl+rL!mEB0*m|dv^C) znEKew7=j1 z@T>|L&+4{y$v%r5w%T182!1jz|5Amr!j-C~W7$&J&(eOE2eH{9A!f;*m_Rk*j{Wl39qR^i%P>yZk2tCD!FPH(e^gd? zES64YR&p*K{%gB>1q=F~Wl`Sv#iGWq3}X&X$s*gO)6?tx(bks!z*#Jyod0p?Z@B!; zxvbN-SXF2>Sc|~Bd(pf6`EM}N0RH@Z?c?608MZCM4TPqcEU&e@2NNisTkD zVvI;U$~J~jZHpvLPOc$U;d8QCV#p@Z5dT1nkX7Kq#IttM!~ygG1`nG3ZlH-xe-Z!| zCT=e2S#v7v-4u>-VHVNZyjk1VkLOp(stge#;h>VScGkGo1#J4icI~0-la0-Zo z(?tRNJ}jS9zygxUwvnD3e;A7y3L?jHKZ7f;4a&%Od`!@$NA_xKK!s(c2L^dpU{|@$ zhSJZbfFRS0#l(wb8{MEuL(99-Ck}@N+C%J{j6jdiV%^=Y8vphYo5uc=74dRAD5`RR~r)U`r(%tvD@i~yjvHG8Vte|3Fg8>ni)*5UN@ zo{`6ZdCr1eK%#DLqGQCoX27P9%621kjczP`WX*Qclu8~*Jjh33G_ElV!xyFNL_Dh< zwvI;|D1W2F*J@bOFDs~qQ2ok4mpiDf>$(e};L1^}GFrkVat-5ZpKrhk{vO@8V(vTL zwmM}H!srpk4s106e_lCSLJV=wmqTbWTA%bHqM1anfr1NyW*{F6&8T812D)BB!L0lx zF!bcqV_#=ePj>h=mZ(;#Bw~sumL1I$dA>b0bTH+lOOGKO_b%(G&Ks#F+S<{>xJi(d zqRvxX)@aeyq>MgvIiN1>Q;2k{7i&Wre4ic#x>UhhImGqz(YP zNsg(8c-F{{G6=qs$D%Z=GEAu<0elUm8E=Fl-f;A2CU8J=qCf;&f;uWSzH-W8*Z3-; z<~yE*S*I;0e^fhd3DBE6Z|$#S?v34pNZE5Is1Ho&${<5(=2ueg0OxBy)4c+6?k6(< zz80i(JW6bVYx&^8;gZ4F2kehY!R)o~DMS3Oe=Qw{_nX=8lYw((7pF<*PJqeDusAR| z>D}XNx5C#Z-Jb_voAeV%866*s1@HRBVj>7Sp-$3Uf8#sH*LX>a;A?y?{R;RRuc|!w zM$y?}GFI3S_>s<-DV1-pe@`pg*K5R;rmwj+u1XWqe1p)Hr^eCBQ{y!~A&%$?@kV(< zOz@EJr=dNWu{)8n?2yhd1iodD;>;pAS1uBd7pQt|3&yk|66{$xe&rIzX-4QW!(Xh_R;iH5F}4B(v9 zlpg{e%ArlUPJMTTb;4-MC#^h9KXX&3u67>3psscf?IIB2Z23^^T9dvaMRLH{Xi|nAPgE3L*;k>Perd< zE61K37m!*tke-XA11Y0Ox&~hX=u%&-2qG+4k$_tNcqFa*5@~m2X zxtKZ$cT!L3PU>+VQnK2I)Rv)^l-n@)m1`8vZp0Uoo)R^Caw`js-W74>LS+g0- zP>ofJ2VXCwZ}=Xjermbx+syq^LQ-?3e~>hwLQ+#V(B#@clW7*Kc0TI{3S=f-B|c2D zDHuKsM54^Q9(fcP9wdNa0Wk#tF%b?Qku{hws5mJmY+GK03A>iZFyTm1e2@qEn(je9 z(CaP@)5$!av?$)>n+_FOgi}46utDsTO%UxEkt~TtEe%SgzC@D?>r&&`lZG@8e>1aJ ztRXEjxzdovEO>v1(WxQL4{R?0Q*}5XAs{;o$Vn8Ttj7=a%V|GPbtZ4PewdAST{-LL_>@e?~7x5TdEJ7Hy$86t{9_R+@iqod;`_47dJ7^AvOdx`mzlQozBZAnO z;Jy{$4z}h?6l59rt?p%TwNL37Re`qnHx>&$x)x<(qm+U!1`0tu@8Az~f7s|WG?*Ig zT_S*)9BXp1Pks|xaEdbpxe5gUtt;CF zqduU35eWx_r{vAnK!oYtf4W!F{&f0-I6o(c_jHhJ=^#b#D5?kFj)@i7n_1kl@SKI$Lji*M^* z)dRyYCvSP{!LMxZ5M!PE9F^{W z95N1rzaKw_5Ok3+cBD@Z`Ig@}5Tfnj9Nwa%Qz5 zM4jKa$5@|3e@NK(hLSE^6=6TN_}zq?yZJ0B3^p3gK<=}Z^u)+ zBG2>6m8oeI&lh3Tf7@j$0qTI%S2!jg4Ved3rjeYSD^Vc6A%BGRjMICPX4oD%!tn!2 z&JHknNKLE0dWtZ8qRG42 z@Sw0!QBu*7f5U$qP7(Y20S_ zxpEdpbB?6u9P+HmpF*U{m?Y5ynJT|%F}(actW_${f4AwMaND~V?_XT9_EQsTwS2Dl}~Ekj*V62QiXyHWYR+Cb&| z@LuJ6JC*O(pGf8VGO6-?#Zy#F(?6Kt!qF@>Wy!g2|S& zj(xnFb?nOq>)2oS>)7qqu|IyIb?kL=9s9!8vA@Lf^}D$EBe9PCUVI(<`0K1=ALVtd zx=!Ysyk57K2@7+9^{F72$$MQD_RG<+u|&HSe=u@iqD$vaRPO8~@HCrn@*K_cBs#nJ z8DmG0^BXRJd&{)S>u$W1CmVPvPkw}#^5m|)lqW^JlqVZ`DNptis}x7WwzgL7L4jBS z`?i0=*VC(m2M?6@b!?dNvg`Irf%Ng+`+e|s`{2``Xdg^EJ5QL4H1GPwqJ_mi_%yK( ze?GZ$wK^|Jp{@7Vagmw-bMP}Mf%=F`rbvln2U5PR?SSFq`iL`*v!0tLB(Xo zcTV7U>63RkW>~_1uZrtyOt4sPwxwfhvLkCmZB|C=2a7srh6r>y?TaiO#OYI-)T6WpTd}x7RtfNcLuU1RALGstFTFU3MCHvRb&<;X-f6Twu z({+8A@vo)xW)6o#lR~yUj7@mQpYS%Cl{<6}XOnS>k5-?2xX6UXyInjHv^X%SL zYP;&kZJp?aU6J4>PB4p_XKeYIe>NG5I*UYYYfO#j!)=ehYQ99Ra zYm~|LS|qxTa-D5$O}4gXeAoMJ64^gb_VhmT{Bq~eI7qY}C{BIVBG3+lQpXL4-4bzw z61Cnd0qE*vBM2G7e2Tz{6Q&X#yDy5yh65In`b%>Wv zu!g3iA@NPE9|U9b@#D#4Ql8Yyu6O;oR;g4T!)K{=Or}5`$LkEShUT8B)oL1|-br9s zVQM2g@SLe$Ex{+ZtEF1KRI3{r@&nHuU{m{7eQ)RK-i}HKtU;I$e+|ufWvbhi)ua|01%TMb&hG>a@?LFOl@pNT@rlwY} zlkF(-4f3!zZk}He~5!pt7El7dOB|nEuufISD(}+Fs;?Q z69BW-Ee>F|`u9-Sf32Xf*7)av!dmSFs71%eV!^w9v1pCN#aM>I`0XON6d%~X0xrd? z%5kY{#a^HaW!$DtJ|b~h<}3s*22-qCFM!q2{0Pl zUGTy-cmJJ|{P~0DZV&+_MV6&$s5^5Y10k)-0nJ|Z`S{vK0Qrr4?;zP6Ae2=ePW;7 ztyJXN*4350aL0L%c#oyO*MT$3bABL{TWo_bERjQcZd_z~?#nc|RGFRKL}m6e`HkGJ zJ%n(&u)zs9&mn#6IRSJOWq?eU8Va_P$;b=IYqyXj815z)*<69@zy7M^>`fu=zR#x!#I*)`uUlUtv)1dTYX44O4I|Ff%*g!!4Cj*8TuG? zj3v63o3W=qfO|Lcy|(^fY%I}CzUR}Aw(0+SsY1&Zqe*Ew2i1>x@BN5ms$W*&%eEhcm?8_DnN1x=?Mi|5IE@{u+5MJygz$4$(+P05j1Jz=7GAIJxZsTBrG1-`+Y^reO?C(ZCoHAvZR0V0X zTq5lao|O)}BZrhg=E#p}oyM^v>-%y_rLRm zU4iv=l1QJlO-I4lX3JbwwnWEu9neBKE`I^<*kL$Q^-lYb)g-z7;|%u5w|rI00TrP; zG&7l;KqkytnJ+3wecTze-KmB;aD}@pY8W%!zXpvOb7$ruo;8&*|DBheFOJ!=kK?l6 z#AQEZ$st5(iF1}Pf=rwCieJ)0AC~|aFLmq?ZapxxWudN(=6zyz0{J!eq`Ap&Y=5vg z$P(6CLcuQ7*h@KBFOkNGYp4^ol0cAAUl*dfR(7mvF1Ow8tg0R`{@fk{(73gAJ<$_) zzJI&npdaP^U9(=t22K)e;Q#2S*?+9c54GuwP@8mstIN$l#H1=vtz7~n|-{`RqrwJ-`mJU0VI#JE>`Oh+W3c}kWT$;43#dtTP z$+bS|+mrWiN_+$tV-*dY8(g|@2bgT~UPJ|2pi$WFvxYS^{p9)>&2Jpv0e=E2ThWu( z@8jpXFxCsW_D70K!p@Bm@t$nP7l>4Xt<=W1W*goEKQ7nNHmB7P`HdqGyxEt-MtIXd1U+7I!m*QH!fa5W8@NyH)zd-O}8zR zcQdgzvi6QG$GI_aB1UzJcz--zzd3n%v|X{^(&nMC|2|(EVXO5yTjwkrD6hPz10NXc zh&@*|Spnnq&nu1BUr^)qb85W)C%p!O&ejV9wVqqwi`r=(K}g<>-ue^Nwy5a!m{738^erDDHlDh`ToXD^QkmW`@e{hL`OYVxwp@6)P zXIVz(NFEibDK!n<@*k?Vb;cG?sj=v8PCLn!_jq6Gv5>lpvkl|6n>;(gh=txx8)*lY zU3`I8L?c%bJjErP6Z;yM zW^U+}a$mTm_~P)N53*p1Fn6O^-g?jWi|yH&t|aQNls3>}d$k+w)tOIt>QBfE zLE%066`G5cz{H5PyeYbX?b?dH`s>~A)i2}4_iK8uJ{$+GzkhPK7Ad0rn#tI5fRNN~ z^m6@H`e{Xxn(ojh_R2CvNs@s|Qswxxz8r5>l_Rjd0l~rQl0c&OG||ekyjfqCk1NV@ z;kjgGIe3DVW%#(h3}3Qk;3AIlk0kfJcS(b3jiP}fhSoaaXZ09Vi9e;19}SXqxvv>c zIoV5nzxD&`#(#NUsN7^NoB)7==CRh{hD6Cq1V6D>yPxh zO0U0w{P-7Y{efDqQR{aDwJQIRAXx=LQd&N1cVoX<-@txz=SSFY?%lQh=1vj&&7Fy6Ood%lB6VbVl5V}h?L}sxJZza@Y{v#H-Brtj{Rm$vfpgrd;86M`^|g% z&3pUJmG+yBz?w&bxG6LyRN~gene~z{7TQ_Z9y%QgYS8nm=1>S^Jfql^NX3;bJc%uS zMd_}VD3;EnPckul!*4=Xl5`zs#&2$(oshbttS-(^-*24F5;cg5Vxv_l0&are6Zbg_ zBB+ddJbzJelQLwq_7seWjdV2dXl3LUOp37M8+-hx&6>O{Xr`bx!*QjM-<43fNcT8nl{acsgahb;i(~RA7*b+RQr2stb_8HRvGa1l_nHY!ZgU% zaPAyrYuM4bx8bDGo1^C8O7Mm~PY2zNs+T>~H|$l1`i2XKbSRO58vY6#p9e&fz7#4t+l8M&AOO5V5 zymTvgsnP#=;HAbmG3V*TS}b_iFBT0!^nU?$lHO|Hy?judTZAt{zXGDgtI83r>w84& z9?`l-wC)kDVw|^)oA}7p&b7zmXRnCi)-R+qUUgzyuXAnOtktwPX4%502z!&K!j9rz zijJ2(R50?gO5cK%m*v=)I)32O^+wJkMZ3GAIc6(Qs}p)!z0nQSa1GRG(VsJVczU8}13aT)|Mnw(1kp4~uIHGs8EIxoGsI6q5xK#t&#n0a^QlUH zfujXW)R@NZ(D4KC1%EqZs7lK5 zJ?-``Qa6PcoH_5LxFN1RJiFYhRIZlDzOe&)C6NTja>^syA(Z>AahP>cX`HU-e&ZQY z+v3PYFP98AhMBsU`0A*vt<~74or{4M55Zt%;svOy=~_Glz%Rm+w0K>QqiuK ztDWKI)F0K+42P#+Q`ERz~f&`E51`<5k01`a@5s={fyM_dh zi$H?M8$p6+_mJT2Ai?vW2on69gal6*BzPu}z!&1;JOK&5D2~q^{W|#Ek&Ms%d5_QC z<8$};+&wiySa-n@u=azu zVG3xxMRRtzjhF(&v{BG|^mGVRW-PhoLw3N=IAPg?2c4K`@_#{9j8T@c7`vjc5ugN_ z`O%od2;VWJ-tH zhqQUx>Ct&SFn@E6)Z|oYQ?(SVz;0%a^!&C8J5VSMUai-mJj_-qs{l&WP82*b7uP9+ z*0)aq9mvC#I*_ka>G6sxJzmo5hoBGnYM{oaf5x+}@iOUI*LZU`ILF5gaE>oO0_XVa zu5pepMR1NU8{r&(+~XX#!#Q66L^#LqNu1*&!#VyC@P9@{T)a-;9M!wudn(1Dl{dc* zwDLxVR%-Xq%00Al53SroD+NuT>apZoRa+0K#Pv?@lawWqoJ3(y)K0y-&Ynmm57*a= z_d6>p$xfnjIrWE5*DReJ$I;BY*))*kq0`L=ZU+@oxr*6Ab*#qk)DCJ-*g^Hgon3LK zOD&`R(iMfKJ6hBlwba4hj}G>}+BVA1vyJLxY@bfnAc&r%gQ$cqcvLlNk%i*>Qlz&GbFq<&XvdYulxQ^e;vI_N~>Ey1A zFkRY{$VZ*r-W*1~IaK%NFt0azQA7bbwt5%hFWW|@qg^Y;`E17uOzi>zUYkIU3SEg8x#^P15v9a9q*jUbG#&UMrSk4#C;%ANJx-s(D zr++3{&+bieV!B@#4%`L@e#6fK1~cEyjOUc(8Qzez-OYcc70;79KlV0pEWSKZK(4i7 zm}@N`bQR-h6$VR`5UdKBP0A@vyjDJI2H6TK;n$iHf30l!9rabu`nlirGRF!GNf8#hgAR`8pu zxsh$kT%84fNb;T)=>ut!b=mbq_QcS`T zl_e8x2XEz+`u|F$c2*r%nl>C!V4*Wmlada=nt+nlNqA8rEn=^57EvpXr?IJinAK1SFj?b&gaQx;(dF1i??u6}VZ}9Ax27aUG zA0G!7?)CK$ryqK#139O#V$d38}A569T!b|tBD zGARdqZfF~hMH`OuS}a|cppkUC!Mp^RRRuE#8nuNE%}7f=;xTE=2exFm)4!dC3>`4Z zc&E+Q-Rz2u4R*!m53odN4u9_05~0~FV2O}Sw9XQtIlUJrZYNG${6yl!yQDbLVB*A7 zND-&v;vykVoE8@+TEC7s(UQf9!+W!Ud$WLhvw(ZEfR!E>&A014F2sSrmi;PH9v97b zN+*lZ@)_HO4^7xhCF8NsyH*bp^{w7d?OJ$u~${Vg4+ zzGC3)KLATSuu@A*ynV==eI`U5%Vo0<8a0v(LaS58(*P46;z`RJbtpFKu-tLGV4|gc zcz^ie;??Q-$zP3Q&6qo!s_gBlp=%$A9R_{ZbH3s(DvgI2_Lrf1U2;eXxT8vAYV85Y zZWoilv4;@78h?pAUUv-8TzYJs&>s8Li%pAAz9nB7hQ^#gi`mvNu`*z>GWgNT;44=K zajvzO%cWd_K-gU^7TO^xQEb2Db~>TwQR21b5?wkdK;D&s=FAxMcTgeIJ~4@GMBM!I zZuY6?8|+gbegw|?>aKCt4@Gd+4;$gE5AXNb+wHMme}AGq_GNO9ea`mShhl5}Brd)t z_SjFw_t-ywojvwXd5?W_kF(z6toJzUJBG1>#k@9x0**LcXsH#Q8s>KC?cH!XsxFO9 zc$GaXD5-Dbl%ud1Hgfwk-$t1AY0Qy~A88CH9Yp3dg}ACcJ-kEzo90`E|4j@aOO7_+ zUDNzhkf^z1dtDKLZ$7rWH2(_Hw#=dJ2iu*#Gk@%A(vxKo{$)zm{1nKVX<7ctk}o&E z6d+%&jUmjNcSo*3{L|)~*DoemUhgDyhOx)Jgh+Xev3GL3+EYlR+SFSp=~6@DAa}<1 z^`!AO@}!ZDu+2a21~z!T0c`O5kAMxTcMTi-UIaGyeIwYQat|Ba4mPO$M6f|U2^+j- zuz!KzhiUGJi&_FU*eMPh{PF9+27kz~!QMS=a1R^Y!v^=T!D`rG_a7j{ZPx$W2yxG9 zXGwD_ek0$wiYK@yye(!*#ZFsyLUp_1Q@1g!YC=RCn&p27$!)W$va8zruOhi^KD~R! zg=eva#M3n6!ddNXWej%qJQIVRp5fQVV}EZxTkqWcBwM&FTLLeoC-Z5?)vbVM z`jb^Y-UCb>wx0n4HVEkT6Wu@qY@h-8XWXO*LDEfn;N1!0FmQ?^4g>oKAPxifjuD4} zT>x=NCR&F$4E%e<;Z}&lApCg{he0Q?_S1>ASn#f2ECxMs5z2_eV0h;{1}{kwkbi?O zLcapY!K=zZjzRYx=wkfRti?VumYf`egF&P_4YCME8U;$Dgliak{DKrt~n z$pckTEH1>|H0ZAt?+4@c)n*4vR;oPeF#dE6XV{NxiSf#_LL1HpFap^5U_^h8#n0<+ zBe5M2eM6$!K?i7Q2kqD{hTj<_h<|Da?pmVSLHBl@28>V-M9$>t*RT7)U#)`v;SQLv(4S_OE5dQQL-&LK8sfGzrZ$} zf;e4Gu4T!!8g}i{XxuIdY=`6+ozNssfJZ>|Gxg1CO%bd6DUZ~BtGAmUzklWJ!S%Pi z-TLq?Z#T#$ZwFgjnG6~t#5r{JEDJSxZ*`}9)I7``Z-W~&&lwCRrUPiA*v&Gz%vd>= zXwXuQH#&m-yh5x~rf|@i`An%)7+N^wMo2+%#9SLX8Yg>t6l6PRs?gN1Q18G6#bT+W zK|@(xFC=+&b@6wcO2{9XJAY`@H5G%)4WfoSIaW2AOT4)h&6(1Y@4w+#x3v<7U6*dw~I7cJo4`W9&hwg;At>Sj@PkbR2g zf$I(fXH0uXSYmb$1LJ!Z?S(@ezrVU{LAl3M9R>&M3mPXjOl^BxGk=oA&jZff74KT$ z>4y(g=n>^N6yt^&P_(WX|f zRJ1E&iQ0De8pn2@T7M;erI!APHlAvXrA;3UtZ=c=Ly(G$%fX<0dV{?i2T!cZm8FRv z8X64X;p^tg%Y@N96AH5MIA*BgsEUE$Vx@ygJR^4JdgFm(_}TA`2M;ZatO zk7UB8jzPEzqv9g%u@@3)o)S=Sz-S3+sk6_K_V}~!60jJ?OMi4pu5ve?n?GTKuyN!e zT8a0-v=@}2yOBe>P6xoDqx6E1$>^0(E=nyMxTbR%SLBMb`6cct=9iQg?F^9*{E+jY zzX2sR(BPd_#dS0|we~7#aA?){DivvJy^X+A4KPQ%wMG919A?rq4wep%bWlPZgQWsC zP;?y_@wxIue}88O{c>;Ux}HuR4-O3^-}pa+!^eYDey@X_A-(l~2B!%$_b3SO5V6qZQK1lO&Vd|5)Ix`RZe0Nd>=1D0)OF-)GPP^n}A=xbtl+6vVE)@ zWe<;sb_eT^TaT~7%vrjlADI8M_}gD>8-F(+Un3=9XW)Jqk40un-U?@EaDE$;^{(TO zhxW|WdP6+b^6b{d0-0L5mP^!eM`JiMbXVE4`|KQ59)f|!k{wD`zd@6T^j=6HnCYtY z6WfC%;(rZlO~BXvx40K%OOE`&4nm)*;p0Yd2$<7sw})6Wxe_V~Gg`T;>UKt_!T*SAJspK0?&r=;d z_@&_u*lgCw<_(%ps8Pz^4j%<3QJoAZRqtHhUtn0R6!+!C@c@f`0s6bz5)Izd-O$b+ z%6|sOXiodk^bjUp(@yMe(wL&AH%nt*ADmg8#X|2;d7=E_{hRlvpWXvU1HI7D;H-Ss zcz=BI{-vey3wo1wt;Kqn-Vl9nMWcYr6EE_XR~U3K{%Bj$;n&A7`-Ju*;5bkx%G=E8 z;p$vq!Po}fnbXxwO{_E9UVlioosLVirLoWRr?tq<{PX(E>1w0OnKxN( z-VfL3J;nr9&_wR3X_CqI`TA^m7IL-;J;B|uPYgC-pBQ|&w@tX6ZNjUc$Ts0&(l&vS zDDbXdECyf2#jAvE!q?)40>2K4!aycb7`!Yf-FdE?73=bjvEFst)+?yQ|0`E(#(%zs z#Gy5NP)$jP$!v*Butr5fE?dI4%_;(~!rsuGn3^31Zj^nFTn47dRM-Pa>=j%6;-kQ> z`s^%hnCXihl{e)scvDh|PRND4*h)YEu!3~K>>%)*c1Wq|%z4ix!6#O_gkTrne@jJC zD%pKfNOmt3k{#Vo;X8hOV!=KY=6||waB|G}MZ;hm2Go3=Y30Cn9R|Nxp99N15SyX~ z3y@}6_CdUv#T)W^na3-`cv_iXZav1C~bLV z-uo$0%TaofYW~O`4pSeDN6-?~I_OerCf=G?WruWzVHf*4*nt!*S&)zb1%D14Se6xk z;lMUs1CgyQzMx?ecwlWsj7$^)CV|m)wq_t=1=Oy@3SxT#jmANs#^7{kT~SVeut~OX z*#;ZiB-LK>bXX!{APqcf9fod8rjCO*cMB25AO09=9rVFRu~pbUkcur9a+3-HD6p#g z!Eb3B+x_6tBQCW_Cbq#0dl(3i~$%funM$OrNdbG}5LXqEwQo>N~ zIl};Zs+bzeH;=L3@tko02o=IcIUWww#ltK2T(4mRm4;+bCWhN37=M#VtsA%EUy>M_ zs6M6}_^L{rj0dJRdg@eKsh9V{_Or6#JJ|847jzr~%RJlKr7#$x2!9f7M zz2>9-LB7%Fx>o^hGzWk2)`MT!-XX?3Z_<->AK;*yA#?z*m8a6c_6O%7Vdqk}?PKqT z+PE~`(Cc92sZkK#SbsAg_942Bm*z4qz0?f#GE6M0AnB?)IAA+A0Jl^{M$adaWcPuuoYC+MKB2)!_%ddTKOhOzHegA0lD}I- z->W~VR}D0%TBJ<$!S4ndR4k%DtJj}AGti*MZdVL6sKf0i^?$vZfd)J5cHKaOJ!`() zAMBMK;$ttcG}u-(G}tTq4!IuUz@+P}*~w&o zWpJfABV2Gpe>iL6;DiwDy}Ee!)||Im{a`dS2UWm{z|1vuQulBW%(kf(A`voY@bpJ* zVbAVY{PipT(|>g<{*(XW6@Q9<=!*a3E>`@wvO$CsaO{Y$sPpB13@c69B3P_z?X_JC z)6cUi``&K?0^0W;Ju--8UwT*QfgY3{(#6wLSl|C+Rg6f8k0rq|&-KJ_L>(;5hr!NV zcLc^3b+IGWniQ$^e2MJz;9gzyRKXVusTh$j0o`t=UVomg3L-1i!xnsD90sr-2mIU$ zC)*(2s2ytx`n^kyCDf3{lW9m3i8L^mhdl)_HQNFWYI$sXKBzl60_TG1^*ln)rdS_5 zgI&%s(46HAWKS$-lOT~Z@WCz7Wua|WseDi$fOpZHZB(FFNT>>@&JWs2ruO|#vUVpC zy_36>On=?~=AFd_5%#WP;QS zJ2LL%07njXNufb@8S8<0ba=WBvg?3{@=p38Ogn2mGN!|9ZMa89PNm|?u>0w{*ux<+ z(^OWiX9srTdAe3?nP=CZ-FEDx5r-g`gK}q1hkue&hG-(58v`?Wd-0x0c#f>2Q^=$Fv8|9WZ1JH0{#sp>CjQ&p^}uip`i>a6No3EVvSzZP~-!u!D7l!(rsjYy}Kd z&H%__|5oG3Q(vFj^jK-2sRI}M{2M{RgdQ;GvH5xh@{IbNZ$VpI>Qgu~<;8?{)_8&Ww|# zyms3qm{tGMK(Ono3`++MH1|RRhyLud3mT7?+4Fu66XTubKV|bj_#7)3gdsv?`C>}O zwJ2UAOxcumc}t`F*(nHisWE8gjm>zVfq$4;#L)NYcWbij%mSCqOhdNNoSD~~(hIk3 zoqpN#)uX;&KKz8{upUX8yx8DVq2uwQfoiPEjX+JK>^Gm0X!ktO`FJ=2Y z9pAkO(T+FWaW2aV+m5m>ke}K8tn*{+0hMxxOm5W5-A+k^5@qn-4PJn`9vxY7K7ZW% zXuV71w7qhhq&|?)ENI#_(DYj2$8w`jN8F+lJj_g3=IA#0;S{z>rwbv=0znr>B!)0g zs8|!=ZDs{N=keT~p6=x)I_6Ui)&hEJ7v?Y0?!r1q*iWtUH)QsDtS7WQGoopq%_4`} zGiiz5$bHSO@%ku@`K0lGbNAza7JrZb8?^|XPeF7msWT;H%A%lB$W)Es*~$?-p(A)k z1wFL~lo*agj8PbuWANQ`_(jwCijgfxrE*uQI@r*XxWd@Tix|b!N@r%BAli$T!s*g7 zM6D(~+MO;~=8Lj0?n z-R$EcpUOv@W)7XpzUiu@&45*UG9`>Yq`n>Dz=q*d4&1;VBF~-pXV^Ql zud(UKzfQ-{>%MvETp<`-rng-MFVQ}zRcP|$0m2s1x}baq@P-x3?T@NR+Ztofif#8D zI0%UR&ZSaF;}ra7I)jsrOMe(!8mt$-IoDtj-==OBOkZ=e4d2t22rT&4B!?tC`7*PY zH|~BdYsPC?W6fUf>kr*t&&PpTIw1inJsdhChy6(H?!GP(@;6Y4r)BRL>&VVlt)iJ- zUJNNY4?4OE?CZ^ytKxvJicQ$pCkC2Mv-`U9S%+<#0>LK)9I>u(pnq$$gN?;Pt7@oP z0Rx##3hdDYwOy9Nqawl}AtLZb)PwD+@o$1y6OtuLgc#}Aoj%^SNq3tE8v(yN;E$n; zv~773)u_h>3E|6rkS`#(OCxKt(~5n&ZRXqUu*n%9u>rsldx@qO*``W?0(nd7IsqO} z?M?uz7nQxSLTsPrIe#T9PXHKck4>kmJOBvS>ck{{clVR@G@hjI(gFvapf51)`iwT! z%a=XmRAREErEVcY#CJl^QE(%cN{)Zz5`t+F4?BT#gVkuD<5O>J_IsIHSrP>oW$LMJ z<}DQk>tA3kI9<6G9MZMmluAf%6;`l7YB)UvQam(0vWUL(WPf+}nSrJ!7SW&9t9!c! znjX{pwP#NaG<^^EtMzAa|1A6EqDHk#WYe~XZATcLPLG6b9XB|2h$7KRDv@lJO08md zsQ5EI&zg-+&(sboRaJaSQ<_LRM5X!)3>Rxh{`hyX#F^_6n{i#7DuQ8Be%bUJjBCvRvc#>)wcfv z%~Q*j$*c{4qb-9@C8W}b^NRv#`+w#F?0Nt`rLmB9S?VP z?VMj}1`0iA#nWhc&QAlY@dq_c7I7fFIi+{w_Q<3ewnt8`^=iKjwo1}lCb*3Zoi5Wu zbbtDIWSi6HNaRD$qe@YbJr4wC=+mDsTyK>7=_#70jA3b;Z;x1`Z-WE8w*2nu%p5wP z{y?5}{pZN(ni_PahG>WKYfiU8moOxH2lDQP!yyklP(e`dS9mza9&GLc8A?_b^4spy zMB5-AQiN!2`5#nS`Hk;f)6jE7Md>B4=YNOulNHtMM^!YnGta$oy0}|v&q_fbr?;sR z9EGXZY@x;pJ!kW_*{sIVOcV8%Zt&VmyTgxYgs4EbX$pl1q6+3BCXynWi;!PwXbu+G zg)EWACORW!g2nHZaw&@RT4Loup2b#1Cg;;-kcyYmk|#^2dCSJ_h{r}jW9$OEC}gZ8WDJ(u=JpFRU4S_~D(n(@(z^cc-7e`~fi%rl0OOM#A)EffxzN zMC)QCOn;O^;`HM^0m7{a5T;*#9s-2vU-yRA>kX~fIcZLlevEWoTrBtmS}dl&i;FKZ zjl}fz-75%wFU(xQ_mE$Kxq?@fF@IM~tM?%;?n7MMhq$;8aZxP9#k3OZTwimYYZT<+ z!?fa;zaZm>fW?7LfRoA zq44G5CX#Ajo<$vFq?VV-yKfVJH2GX;p zpJewFaZ;fNw;}4GD2%|gntzHi(T~_F`>7}s(DFX!LlE(&Ry7qpqAv%bsG>STJ1huA zsO$Pr5rm>cjT`A=F#U_Uwk**w3QJKl6K1-4FN#j#TDoubbE8v8ktedtkRcxSvev%2 zE00FO8ft=K5Tt*qW26T^o2J$K!}4?KGu*&l|( zz_FtO(Ev?nQcT%WX@F-e!mzj%f3o&{KG}14R1A&FhGGU(kpZI9LaBz-StiKwCL1)?Y3e1yS_b4dLoFs`R#(I0rrSJeC@WyfbsCi4e*B# z;OGZAt!JhB9B)>VHu5XTKxg%uNK-tJxGS#1QAAXkF zIDY_Sdm_Ke>wm*dPoLygIb~wWzyHYz`qB5Zu30_BQN+lt%t|xM?;+f)8f9e|>kAsj z8n!G0UC=Pruxy|UY@iE5e?Fy;JbL{M9tG%v80f;GcOd5Vg=e4(`=5z>VLT02|W*!;KKHNYOhS_|B_Y@0RXIzc6$G8h78;X+UQ%&vUmw&k-UZO@3Dl6Ndk!`Wgs?R5SGM((A z18wBP_9y%qv}+Gz0!UA$A1^{xYI~-(oM|Xaz^$~k$S#}NyL`Vecr>zFePv{|tof_T z72%GI-)~)uf<^zn_VTwbEw$@g6MPU>>F@f{lp*qpKziTF?*BWMU6@3#X|vFCSoj!p zaerOh^+k?2G!_S$T-LmQ)@c3YxQK;#QPcJYKWI~fvSL}kr6=psM|O5D_J$vn*a48* z7O#0>wN-n@K)RqYIdeve%*o~0Lbvfs3cl4VDad#wMI-C66kw6MB+)gG zDhs4epe)5-i=mY=2T(TmQA!8fOynvB2!CDK8}`t-CZ^^=a0Q4iTTb9Wim<;^wo9fW zBXZ?J>F~yOhGLIpO#bNN=6;p9pYs1bQ~oEPyTThFJz+EPkEIzryPv_C`FKCw?qa&# zcH%@scXB^;e~gHFKR@mz(Bx#4R1B@VQ86?&P%$*`RSdUNF${hp6~i>CVrVcGLw{3f z7B0laAfaNoD6V2?{W>a!maJlUXU!{S93i-BY9G#y4=)-`4b@ET@a*jT^kd^#Lv>R- zZ@g|CL6B&)V`@i-?~fX9-@>n5Q#)?3@X=@wl6^dV(>T_a=;E|s=*qxu`{z{knisF~ zU-&8fs{ub;_Zmm>$xW?Niq`9zI)6qaRpB10<3`CbsrS<+{K?qsav*mp9N=<^E|la% zStCmg`VKD^7e{&kYH7*N?BXb~idh$jdH|eal$08Qcb>2SLBd}iMim`Nl2)7?5L44o zw5FzZ8L;}NOHk^*ft<4Mju#cg2b3LD@cr3vx1`WYE}>*tuz50t7auqRuQG& zlG6jsS3ac~+zJ$z`IjF(LJ>_kv)ha&kBQ6T`q3lVdNQ6wCN4)ml4+t@XX3KBPNoo( z&%|YZna+VtNSXn?eDr7;O@Dbxl)=gkD;K~0=n)N@K$$pEZ#AdrL9}F8mUZ#&(z!Yy zE4;}v$K8v!x^F;87o+UEUZ9R>7AQrO|DU~g(QXsT`bS?yX8QPpNrmX*D{jW0Vk?O| zk>#;D?(_0E%=wd(=}6bL(x(>?9E#D4iI|>J=?PR+$F;PMWd0ZB8)x&$k%tSiPxW`qysY5X*5SI3Ach?^7HB@T zhIrylZR{J$8Mgf4gnvN##x0TQQHuT3uYaYWLQs#By4dhj4LPpu41v2j$awe1t;zta z(qko8)7wN0l>7EhBHpEELyW>`51g8HYuV}C<|e-)8&J$W99!07`d0$*07g*J=V#CM5JX#d@RLA>bxul&ASBK)A& z2$=|ke@O{KBsbF(4d1>))-JKU4{u+5i2&D_AJ&&vyzI znl$5mT2gmPC3SDPfbJvz@i`@_6XAu({(XN>b}^a*{(pQ(rT=k?fs_lD(fL zLaF3;q10XV zAz8Y_q4i-oh|B9kvb@W9>1KBsxHSD%QB4sn=5r6C4gTZ}Sg@QEYmWUy8#IGRowQo)!@+W}yTvISv0DnASTQotNh&N+`Hz91OXkq#QjX)d( z3CtlHn*H~puzjsTgzY192*P&T9D=ZYLIu62c%*83 zilqsyHPeg}udk~M)upJDAm_KC0TAiQLJLISU(hppE?3kLhZIVPJ!QBELT^Sy*ZZoi zu7B0R;Up4*Zg6)WbxNxW4X^h#`*a zV*eD6kd=eB_C#RWfVjR|jvJtb8AF}~`{x%%fQBSA3F$%5`MHZmNs1w)7@~=g;(yq4 zJJ&Nb2Yq65{t@2=Xpm%>Lxwq;LFGfAd>toWXYh4~uIbk%`FxjrzJ|}&=mroxCf*He z`(@JaoAvb@)G_^F}^{F?srue{{%`G3(AR95>xf27& zxTa8y2pJ>TS*1(jW%y#1q9WMe_kRu8358eAzGKvju}~-qIUQ}oL1~O!D-THC|4)LM z;^hI!U54_9`Qa6q=NBA2&J!9<(R}*HI>;&mb5yFgBiRU2k;hNM_4PG?KIg7TkyfvWofhi%h*t3V)ka?BpvB zys70{)oO+a&e;*qRZ7ITNtIT<%Fy@R$5m+UTSEN=!1bXOwp3k|d zg&7Yu%$AbrTM5aYoCc({*D;7Mw1a(hy`Skc$HiWR&xCp(cbOkm!V7jp5onVdeU&gI zg@;oNCGJOP74t!tBjZ5mLw|&bB0;N?mn^6xH+clj7*Re{DuFJIqzL*9$mdjJQK=A^ z>PZps6d|g>&>n(hKNRpM*7CtHiihv$Fg1Aam>N2GQ8--5h$aJ9%9PP6VpgmQTfy_B znF%y}G|vjgN{nrV&4HTEMq1uK_!|-JVWgT_?!uaW4aHaqj|h*DfPb3gJ+1%sc#b~9 zwwAK-mV|+?FdZMo*A?_R3h0t{Jsa2jh3h)*xMl@4t2W?8)aDrb`*aW~ z8HMuqpP=b<-KO*=iqIS3C2O?srt*%~J2>OzJE2GVzRbD#Y>UVV2v{t zzvj5Wa1++M+DcEgH@Di2ub&4G*$GpcACaQMOCG%lW1p}r6&Um^Wm(?GpAo4hWtqIe z!>N)x|$E%y6E5vz5e!FS@XMXWx38i>EYaz z9nQ@sJDi)(b2>NwNT+jCepEES*-_Da!n2}Ta#nPn^sGQiO;wPfdq9e&R6V^Pa($u- z`%0Imtp{zp5<7)e+b_*hZEt;8V`L@}t6IbIe2eCs#(!|&4{A}8?OQZTV)L=8K{U&^ zX-wXnWOZvuo`;;x4>}C8_A27`mH)hMu^lT|4RH zz(42gCy?sx|;Y3sy!-s*n*k5q-4e`Uw9PSU9hstf z?T_>noy6~jh{9yA;2^yrh3|E_Ht4N2ys~|7P7!crid}C8`C0P*-P{}d)_ig&O)CR! zAAflEU6c7q))KadD6C{mk2f#!Chh-JVufKR78gEUKY=kpf@O^{M`BS35ri~(Zy zGRBNg#K0KKPBCv%7>jw7M-&cY=RJv1R?JYo4a1G2Of@gr*i*Z8g!&EXPCXor8B#Xg zv3R|J`r&QCaFA?T7bfhS?I&oi%a<9T*5d1L@wbwX?Ncyb=KYDUcTG>$7afX zclX(&YOt1N4UqfDeDgI_*9@O*VcLKC`dYHV z`3M56^IeV8pSxW6W*s>|GV`2PiyXS!U1*4eZs$>zS@h&M)_ghuZ;eHnfAtE*q1_u7 zES!5IqKP++B$ZDB-6P9{u+lulJWaN3Smw%T^syTO+(lIfd?aW(O|Z&#&K>sjx^V#; z`j%;$(5w6VCi|snOV6w)LGFK@k=kOP*4NcF=l&kr`45LY!_Oa`^A^d);!2aC_Jksk zcPq}zzW)d_JxNW%YsEB#9FCZ@nM&HcK#UG>3RxP@blxQ8ub@z5ffEpgiSRUbL6mqB%_f-xY&KiTf{h0iqAH#@E)06IvjMJ0B4&SOH;jQ8`@1X_ z=8T0%uN@F(vLG0-N~2BwK%;DzrzP>D*C0b27jsxzHY=1Co{ptiTh%ZYSUVM$Hy=Zp z#R#^Giw1&DC`R$V59{KH)-$6y}gQ4Zy#&Tx)W5;Fi%sH?FG`Cz( zl^20H3&8qwYl_1V>$Y?4*x1)t-p=jZa%~*fWYi-xoH%p-d&{RHQ*U^sMCgk*05gaKXU7MxB?Gm%M((raTkyL|VjF_RuGE#zeq$fL1 zRbzwlmYpZ#uyelKc1vdvFYH#ezXUA3ShU<8}yp$)o00ki>A_+^4` zhg>*QNksxvdAk5qVo{P)*pb;76paCt z)z**d8U&m+J-~sQSg>t$8COg=Gk`wYDTY3pQ0Sw1CQ%$QdtlBX+02|nvT;$eYjX_A zZp<+xyG(!W?>Cab+Gir?cEbZ}U#0R9h*i`VQ_gtGu7vYrm=1#o^`MznOYJ&n>0_ep z|K|ex4i1d-zHF5m*g1zc*lfU6lUU_JjbWv+ll2g{t10?zsk=B(S+ObUjRyxh+`lf{`cf{XLT zFZVOgNxrmE+ZxL#yxq^ei8D7-9c^|BEEsUk;UsHs#~a+tbhMf8Xj9hFW~QUfd`Fwo zjy8XD9c@ZG%BGU!i2*^Oq7V_yOrVlhZ zwP}{5&)YmehQvf6pQpgw0Vz=tBA+k>*>C&u*Yr4vkgsVMdrV->b`Pq66Tp>1Q27mY zP+Aa`pA}jn#8Sv{Z$iCPtf=vHj&P4)p*w%7h!hngP}MpL@AUtKnyR#I8{0%-8~eL4 zHxW%lCsI;kilmHBJxz6VCPL6S9PoJywHQ5`My$-RlHMaBMT@04Z(c;i(phpN2@8)Bw)IlQMcKAqMKhroXR3x$TRYA6)LZ*TX5-Fp?L5Usg{|E$+S&`lCvOt3`&jk> z#s|JFkvD8ZIwo<*m{jY2brBhVSymjh9G)-TyT?Jir-kj@{QY z>@Fm+fh`^rS|aHTFQFrrJDhlaXKGwiYt^@&H^r8#UTcWkv7VK~>hX4oP|5_k_)L`r z`?3lHj`a_V8{6TTXv8iW6v(RTG(5Xa1!-nYk99I@jbzw-h}P-oMEig+Pr-j)@EnqE z&H7LU&2Ti7jP#g?+Sc-!JGV)=CGoPJHBU{=&WSUZ$hicw-~i-M#&YVo_ybi7DXsea z7Tm34$T_1H`$-=iO6Wf8W>U=Q&pIc)Pe<+47p;{Uq9(LcNmV$jr~k{y))@oB@BMc1v4ica&dMYPSQ zaqidw1X_ke2aIe7i_r5Qjhxq?p(X1ecy{vcf!he{oZ&wf2Cq9I#1FX78lCR}BKid* zr1-{JHzA*g%eGNZHyMR)Kl9u(bKbq|W}_&az|bg!S;gQ7dG z;6ag2w912`d-vi&@hA_9?#-XagQ9zx@`WG^>;9e%{r!FSjQ_Y1Jt(@JXZN6BEve!` z!8W14f(HfbD)XSYdhwum@t}C|pm_11sOUj)8(VaDJ6Vfv%G`g7QpdchJkF;nw2#l1 zCo!rP4JL}Ms%tgTew!GD`%cQ(ncTQP;=5D{!GY(xm~16CH@Kt`$qs|PRstS+%WTbKbHNJBF?Z(PL5M?6uFB(lvBB$}HeArY`c*8TnP{(i0%2nn21Dv*Vw zUSXm`v?NV4yofS>12jWpQyrMyYc)en#t@&VArB$lys#+f);X2lEqKcw9z68%fF2@;#)aLd!Er>p(g6J(E9H7xSqz%uwg+iu~_@LHWH@$orlMc7G>=-CuHo zT@+H$?$s8^Ycs;zLLskXcHa`w>ifJy?2<%OGH%;Z;uve0DmJ?(0*i+%+5oseEzo}u zP0=Xs&kq^#m>rA9?2LHKGc7&9jP}SbaFwx(TxA?pRflrl+3v6EGJ+c&8WvjNPh&Y+ zV5$q#E|jAMT=El0yzF8z+O&#mT`WZlX@4YQ7!8$5*l3wq0b9XhRSYW5D_nXkL5X~B zn#kwG3WY_JP9NX0ND8nS^VFLoby|Pw1>mcrg#OjM0L1$^eyATn_W(>RnefIU5HTMM zlqNsC1*Hir{G!5~v0P*{(fy$4OZykFBe!U*E+`yCzB!rGuSJ&fvH}t$9E_AVE?Ce@ zYzBXMe36D@ON(rORgrHnv4fTLzQxKV5Gp@Qg^t{;5V>Zk2Xj0O^pWG*lDmJX(mpvk z?fu+2q$b-zXoZWQc!GGi1m@x~hUyyya2SG>^%-eXxq0=~u^O_*Yt^m0N#z@*mA~tr z)joe-1#T1SKAw3YhLlfQedjjBzH3d1ke0TB7>XVpuCIqWW?z4T7yFXtNyo~WHK$9(|La|S5-M>zZBw7 z(~#g%{UpVs60oSivnHjZBXp!eL?D`EA&Gx(3slrJiVS#7d9lxwlenmosbaW#JY}M%k0dkMjKjzP+jTa_ z!-vI>k;VZ{CNGcvDZXJbKjZomH#Tn(PHD(Xf`tjcNg!kICNLWGZ`ZmtnwzQE#?~VA z4!qeM9N!GZ8;ul(IBF;^gn^!BB8UcaJe?jucvM3fSU|GLgGt=Q^x-=+Fmj|WkggZ0QzC)vZZmb(hyjSeLCu|KFW~?U-Z^+`2cX9g zKEW5Rx!^jbbKIkfX1g5>`RD@<{Rg;+BD{#`O zv=3S)z>)(TxY0mx@V2MU*fkU%vMUh<_JFca%AwA!0^on~6>#w&x6HL8F0D!nfz9k$ z=F*~a9wQ_7sfpg#3Ig^d6GvlOp87DE;KYQExU(RPtya>59OuDWxkH< ziA%mt^$aDKPOif{=^P&(9ltNM&|U@ZBxU%?HG%W`0Umm;O}PDH*pGp#&>5$Y!ve86 zt7v~{raLx3g{`kEhn-KIe&-Mn%Uq@e17;M)_f!Q!Pn zGTGuR_fFj60C$7A48%IDC!LG}c^*TKM~;8wGf<5Z?Vx>p(E0QUsOF5+$E=njud!!Y zGkanH^NgPd1sW_8Jy8H7G7rWX5H&#rCWleWqNjlwgo^-N&3$56G;topP)qTS4QyeA z6s7<6Zj$_XLY#+|3}c*Kf+g2r#F>TYJjAOL@x3}=sk zs%8;bv_y2<3!Yzuvxr3vy?}`t6jUg2II-@)@meZ!$ch_M#u4;YVmm^gza*c?{Uv2h zTOjBV%qY_$j1;>ekz6cFB^N^?xmc(g>iHV#O$%Hc`R&XVZ)d)EJ9DzPGfTLWJ=B7% z7~rneTy1!?y8_=X9=X3M$bx?bCBtj{Il*p&3H$Av7-P?oL01aV8y{V#45F^*iQPnG zHX0VYRr9emd=$?Bs*a&M3t;&r18z83!<*jdSyVDTyShrIH~9{>K)v}h+XD3_6>Ndh ziB`FS_69GCqDLu;db2-|qNq1c9mHf|-QTmJzrXKsbUWyikn8&SkMDoG${H263H=o` zDy*y2g0FY;V!`)f!S`ap_hP|U&6luuncRr3(>EgG7*%@*-crKlBoB%v;2TT8&8yexYtj7i-$a2uRPs| zr)!s|vw6BtrRmDyAO+0GU^QlBz%V1{h@eISkl@_x&2!csZWc+fck}ImBZaVmf@oUQ z4@A|#2HkRONtb{7LA&~j^SBInu-Xx<7@_DQO|0E$r7M63!v_No`VWViOzvUx668U3 z@VF`Rc(BRg*MUvC}u~op;sSpq&z+vB+VQ&#itpD;ehP4eQOoW>CdevzYRGc=8 z$Dat}!fDfCgJ5wIT4JE2G!$)zr|IO$EYP>mOsqE*)Lk7xt96-ZwQdr<*Iin{1%R`U zLA{k4FQI?l(W8MkR$03}8q%V7z@aB1)H{^wf?dzX&kG*WDhE*bxm)A$9#>&FkZ55Q z!-K6gpaE+Q3gMtt#Oy5(C-|Y?KdF5_{Z!sg5_mV%Ct*1MeEMlW{$)G>XJKViemSe$ zkeh%ugZz~uEcA|_UjuZKT(pm~z9Pq-jhVpkGO>TzfVWv=jYNV)=0wga0TUx4YakW^Rm2wlYO#gS#1`C! zK?pWZ)>De*a7rSK!zdK<8eiCab)J@O_>lLoaTan98>n7{KqxfB^3%4kuI_s`XyRQL z9M=A}%y!w;;ktqnzj!5_C@2_ub8IMJT@ruEk&1)@rjC2Xp^BjKDXbzw_^5aj5n9D| z8-CtbNlUiwN(tG`oZ?_H4TExC`9U0V!p1z9C;qLJ-S`(_H+~~L@lR5oIP^YwH`qV00<6ZRN<%rwbbgWWJ%^KP7(L5(6WJcxK$+_Zn&l=93~@+7Nb4){t|em%wDMfR740p)T~m zn_;#0lNxFo?P$G_;ioRMb8Ae!W#NCvne#g)CfK1DT2sKSP1IbT+50Fux+)5BbPY@o z)J6-_1M8MysiSGgV;%JVsRnxJJ2REY2+jjAt@>)~?yocHCNuf5F}j@&zwLs(^T7l{ z${PzbpISpa@uuX2KEswjoDjBMic(n|kH_CB`r_ciFMeTZ8CF68uBigck(PgvR7g+e zNtJ|frd3JTgQYGtY4>+|Z$ZvFWCwNLX{i!bmc_g$_`{veEf?T8m1B<%W^DxQI82>k z#!s-&OR)C=Ex{X*EMvmnV-R^tdgg?5n#V07zEMMO;f97oP@PV&e**4JzWCIeQ&5I; z{{q3vHr&^ZcxIC1X|qm?i;sUvkM<#pnJ~?-8c126W8YLX{?3Pm%L_aenjtLv2o0>^ z6}U7~*CIHm17oSc4em9O&@15HiLYNneM*FY3tN#KlCb3Y3w-nWnTS?$I5tZ!@PYb+ zHyQ;vG-^j~h-yDf9q?j;ht!omP*9~&Mw%|JdFAep!^4EFiiwd{(x#b7=$PHBtac)$F46Sy5uQU|YsDr6R zE(PoXkf2_tNqiz2*hq;67!B3%bwm5Rizo%%Ozcg@alH26_O&wXW^AFnUnDp%y#3P1 zn1+-4-mBB=ePB5BP}YChpwd+vB7Q6zE+Qinr{iNs&+14cj))QJZ9ZBbunKVd0SbW6 z55csSKzH}H1P#KDoIksL7X3k~_`84W);?IlWR=EXVg-}xBKLAl#kbH>RH^qt@Y+~= zs%notcZgT@)rCY))={|Ew8NVE7My{#Rds_VvmHK_Lgk(B%~pTa2p7Mns;}>@sx9=M zim=4RcU5)NWv-fLjnw!wZF_G8wG-c2J=MlmK+-)GQJ~^aa5`0}n52syc|{TGJhg6W zAMmZTMxVnG6HfZRtfMLXUyf0X-xP-F6v6 z*T#gQ+XjJ2JAB}Q{QN3HMH~@^!SUF;eQyUX!&{~=6sBq0efDYE_Ty>Vb_;JC=?SU+ z0J9~nI>hM|GyzFhMUg0<@GL>eV)=Hu#kOBMcO96!Ks$fb#u{o{Qr%+PNnIcaP5zkL z#q{V^*E6PvrciU(4#|9fT76^NtFCVhZ~wH~#xS98O6f?JR)j9^*l)BXIFrT>!me%X zNF_gCqlhFG!C8{8s9N68dqhsgh*wm9hV76BeM##r+s_Z<(oSGp+Clm0U##nR0yZEy z{F4KopW1)Y^F6Z*mSVKD2}TQaRYPq#K#O!|BMJgXR1k=2f#-!}se0s-v)+}6f7u?4 z!u+=?b$vGxeJp6GASHi@h@M-wfH)Z{ zeO|Rid-VJ#o}HX{qly=aDhiCu?D|?&MwPSoDU}*+yYvK|kQ3B~d&E#f?fExQYBVBwgYsW_gD8i{@6C;RI@rZ#HrNFSK+eqa z=mqT?(YmTmjH`UpC8$iMOYxEjh;_k6S$wm4q@L6NCxqxa#Q|*NQufpVz5?041=eqI z%`%uvWo9|9LJ$Sg+?$Cb2FSadTQ-~_Ku=#1t<7)fzn!q_TLr*iHcHV0!b%GSk6) zhc_!^7Vk%rGTMW(GLqY*)ui_qE!uyZ;;`1f0!D7G-+b0otf@H}Z@Z(Z?K9#?ytT8@ zxo#PX%%4!s%t7*g18i;jsU2($1i^n4<2iiqoSybhJBKEX8v%&zj(*VVo)AEIQyH?LkhVf- zHZ)yzXS?2LX=rM?YGb#)v!S7p>8h=bon}jr-`dZ@4^LLG!*(h@;ru(m^$wmHt#@7l ztattptlnAbtfwqL#Qi9_K7^ckomjyUV}&pF*Vd%(Rje5a$Lx)2VN!qh_}N2PUjHeA z8{P?%YC<@E%J<)pf3HPW|E4mhZ~tW&eOo}by?g<-eF3(80k(Yswk-`!-!Wx3-zBU~ zBScg-O5)HAujmt5^AS3e=BtU(*=MSYEd6p@+dm>lq1sVh1b$l)x+->0w#Y^J_7^do!`o&7e!@UcF*3USuh50Le#HVKj9%$wNr{f?cGYX zlM+&O_e%10uk_Q-LFee_&gI$B`{SeIm;%-USg_C;f=14us%+f~>0J{Cdg?ofWAb}v zaV78CN1sHGyies@YN)1)`se4)S)UaZX=tH4JccU{0@_W=KT3c6hC;OmOl_p;bf$~* z2cog@Da5ziIz(Ng^N{TkTrwKJKd)ctHnE7)mZ92KwV21vr_jFyK%h+XXx(dWHa};o zee>y@tfs)^zIK9QfFV@wBFaKJxsI zB@zc~OK_|*4^@9m0v%~6L0+@2oiQ9>Fb2E?ZD~!hAF9fMx0nKN7uGBae3~Sx1&cv& z7le3Lb6gTYZvfg+?CZ5I@Nomo;=uws&soj$Yg2D%O($Lu>WYRkl$N!ED1w%8KMkSJ zk$edF$YuwE4uXs5ks8cBH^2mMR9FR`f5^c{hf@c;Av}M=xS;@YSvN;E8k&wCIAhlW zK{uM34#+3{4+Q8Gjp!&-uF@IZsQ||T)=7wDHjdRmLu4JeI{ZPrCB`z>4C7d}G?Z?K zaSYe8xO(GQ9cn14-#AuD?5Vxj4fh5QpkNo4zBziLb%r@@LD|lZ8z+8Oo}Pa4<2QI3 z;95wwdD(w1L$*SakqqELqzJ@P={zSygN>wEOinEsCuBvXcMwM zC}exkk|yM{5Dv6(MNi|l9SUvx?6~2Ma1F3R4=&S4>U=$%SpI=$<94XlQzag=dkyWs-4sX<+~=k=|HUqtXy{CCIVxjO<{lB&)OjLEY;O?9}{<9_07Luy%{6r zwIaTH1FtT{S0=m>?{+6yQ!MfP3UCMN`)bdU-HjAPZ+b8jWPyPG+9v?LU3nwWrI989v*^vRYi z*?$?GKH|HYFJ!1uTy_LK^Rka9x z&P3Zrex46?1od31b(9aKts{KsbrT>m`O5pr8=NlOpQ#JAWGbp(G~}pPs*8#a$}@k} zK{86v?H+bmNA0UV%^yYR!zyTu_-NUuCyRmAzA8NhX2Ce3ccsYNpy9vbC90{nxtwuG2sGaQXK0(Wk@9qvLnIOExh&hsf8!o=UBwk$!)ysRYCp zpo5X4553vU3C}*X*8qaz*W?-GSuE@_`^1AV$K?WPV&LQ&j!NQr^NAAco z9Y7^U=go^f)-$ugA&O(bTmka9fm#S{Fu;3Q{&7iqF!63wEsNC~m}7?2i?C{&sybOk zr=*<|p`8JmP^{mL4AyULF4liAFjaN7ss^}>cMj2v-Yd;HnrRw>`KHcORcsW(35P=X zZd?E;oXp7gTxZF0z_!BTCM)CvISGD|?Pc#(g=yI?f9k!xJpFuprf|YfuMSDz_0xqL z2#<6Z4p5+Kn!2O`T8(p`YwIo$!|8vEN1jhnLn1^pm8GgxqW?Ta*G+%&;|o`W#!Ap+ z*K}gF!J3-Z&S-gY@PXw52LkfAnpGp_7d0!WS@9O5Q0iEw@+P3yj6i{%Pk0Jq%GJP5 zl`e0hAlq~3umJx$aRS|%J7!3KrY?3e(z~3WBv^ltC4JkGoUkrWqVg=X2$NUNo=R{#$F=b-KO~o|DzYGHcJe);1u@c% zNnwkmn12gW3@9nU+~f_uo>7`8XjV*#dGTt4yb|*@a)mzqM1g;;PAuP=1$!ZEsMxht z#jK+|Jg5-(1O{_tfdTU_0w&%i?GcJ?9QV_kVt8pSt$cJ5E z*=;c&dnM#!Z#2FW4qhqy%BwI|cP6e)u59i5nwnxZ$KPTMujv>PQzdjK@Qc@AT@pu7IjH06s9sW(;x zl}nBSmt~9mlQ%vfc5Tu#figy{!}Rc#WDqw7nkd;8p@gD+preTeC#mSOkW3)t)wdwz zEhQwiFcb7YIZ|Ggk&-}9Ny$ie%k;qtsjHpcrF-eER_TAVz7=WM{T4LrQ5sT7%Ow|I zD1xpjN6l{WAuN#~RU?*ETq4gpUxZ1%EdA0{?y)A$7sX4yr=^u-Pfy|l&geK(`_geo zo`Q~wsr#vrx@1kt<|*{*eW$M;WcK&NZ_%6MOw$ibSTcT<=?d|$41ySNHfi* zp-d6^Hpzc}o5njDd_K#5Cc6Up)X#o`vx$7U$$sJUpL}g+zvAoJM|?-K&XSK2Iw7xo z{pY&699RKnI{8RLr{qhZo@nR``FX6KXc20(c6Z9|KEIJGk1bw#wwt>faEW)-RRQLDd0^`D(&}{65KV}6sd*Q2B ze4ZxqneZaEhx9=n?P@twtcex$Zd~T_cSp@2K)$uUuHtk5!gSC53m$r>h9j-uZcA?r zGH-;rHN|1bWiM(S#VRyr&b#CWD$4<}ay#&*o^L3Bd)ql^A8si~SvLp*gJLYfhjQ!# za0Gu%6cTxe=jt~TC&Wmef8gDoO)T5HF_e0(IlrxK%x`P;nm-;`Y8^G2E!5oHM0LHs zrJ)*4(G*jV|H4-#iqM>*sY6?ZQtJxJH;pCL!A$`?e)H`u?O7^&)jl+K%lgpRBz*|* z&~t6li^{Z(B4mThte+mGkV;I_eH30jZtQ$bP08-1jlIZEn_RxmP?6?RfuJnLdlrV=q*B`SWy@q<0_&I{7Ffc zq%PF=7Q+ecCvzTVZb8P<_dM|0PSGNQ|Dcg{1+)5)YsUJqa9?5B6(b}_4z?4J%MX9@ zOs3Bn5;IL^#)C#C)&bB2*@B1Cg#QKy8#ITfi8Hl*?4p5*bRe8Bfq=eBEX-p zb&b(Dy-})yFToJ;mKY92P#Gasjxj(?yiDAWunvEaSgo^kNul>PU;w=4NZF?5OFJqh?rk)Ffw# zm7FEkpZhHFOxa0cxz5ZAK|@G>K-5$vm^*H5BdEbj0F{hO0+WIZz4E_T_-^D|GaS?) zm0~Ob;PwAej3seg8F~H;02zpLTx+Xt<1uU!k%j{4ItctBK{B~<>~KOR{RDqI<4K5! z4gEAEQ=d=m05Z%S7cJPTSu@RGeLX0eNs2QYD`*+`LnB1VBwFlyI`6fjAZr>L79tHW zTtuq}1xth$`5ESEU@kM1vFX{`7s!J7i;1ORYj?9=%Ke-$ub3|%$&c%T$+^8bFoA5!p3nI<{c%x>szCnMzVzwI_%`IqY%qC4q$|3Uxp$wH>#$MhVa~Y{v5%*OzB$)R#43{=YMImC4Sg#J`}j7Dm>pv- zPtsO;>e-fm#Y)J2N|(pFmM_swC1ho}q-n6rPx6E$BxAiwu*b+8XSIKjNzNy?C+^#^ zOlvlPB6`hxq7NyeJJ#RZX>Y7zgBm@jRMWnWRA)oNGdqlmA&*J`JXso6`vt zOMGGuJo~O0AD50h!M+nJC%BSLf76X$Sw z6B2u>rVl)C%Cf|dJR^U9K@W@p)dq^o*#>PCS!grKH8b0LKNDh2`RvkY;x;u}&}%1C z3_7g|p3ZBFpf1to(hbAj>Z&DaSiivb+-Z-SZShjiWz z!z(AG(qRBHd*cMb0tatg4A5uFU@@-wc<%WCXhVBDHfMW+*Gzvr1@itS`*3c@!?iE` zRxzP^0Ji-ZM^fsAnDThZ2EVAe=95;IC*EA4@cd!K^?Nr3VKhQ#1h#gd$|^c71{^~J zCVoi3e(t~_^75;SjOTT_(2lfFYJw|n9Ju&!BfiuH5KPQ-58M#4`ECHnTxdJs6Cqdd zTgYa(%w})_q6UAR$?U(GX?=z~ykBvjatY!u#HgN}x<7o;)H6-(Xk<3unpY9p-Kg(Y zI7Gj!JUcgcx9QQz&p|jmK|n#zPIipK+1aYsx9ZfFlAWkn{_xnUA48l)7a3^ z1WMg*)^{~DH(ixD(Q0Tw5^UBrG=uM(tt}0Wle7DpoXCG;+QU23)#tC2-O-l4(`w?; z?l#`p*llfZZD2jP9xHo-$5_mf-u$^a(#tAG)J*TA8^0f7GMO{;1u* zj6Z5ujyrQ$1Uo|kR+enPp%>%`4K3e3;Gi@Dipo~OO^IBiHcGEixv$E)F|~s5HDR@t zxEcm{vy}t9K@)7**gy4dj3r3y+EZuj8p;s6AtryjYPI{-l-$`9pq*y!dPma1)rm_8 zvqkWm)Ukv!Ism{5KStfrcu+If3@PqT2%e2zVY&$oem1AU&t|JOcLmQZXG$Wyt*<+P zvMXQ@YDk$|L2%>wHcK(jridaW=$u1s3F`u1gAFyk^MDnd9xMi6cIb@VBUfFLDh(I$ zvWp8RR~9Q2*kcc;;^IX*l3~KsnL|( zL>XLY_QNoJqrKLJWtT5T0fChQ9PZDsd4qpQXswPs_lyjVF)nDZ6u)VwLhqUnDXYBWigg&g@&;!pKMAjeai`m zM^&o%WMM?oxgwoJ(*ik1L&+CQ1xEx?=gUVhpC_n0+N0*eh@`O%wgVxGZlHAN6WxDb z4aN2RnKe}qb&GbBNQN_&Wz^WlozNUfG#sPFbovXK6KfUcL`jR|O_4YHBz{3O1VRF9 z5qbv z%U{*YrY#lE!5M!RYqTPy!1)96DaU`+bzRXIW)wP+u{QklF;Zub#A@1+$6FrC3t7D$g>g-O`7u%2SeYPhn`Oyp7exx1asTZ`#FZ%l8wzdz^Mq5 zikOB|;aZ&PJSG>5vMy-Mv%Y_{n^@Zm8C9~~4J&t-xPPU(i(GO^=AN*~kNf6ES$l3i zE7=4H_d^)!6?F#t#hBKsvVwP#F=ezPu1dL)akXX9@^Dv`Pn<>I)TI#6Hkz12(7r9% zjuYz@2<`{+^f|;dMiOY~>}mmaCDt}3YojhMl=_7M?p?X84IxboTf%?AZ$hHdXFg6r ziL5Eci6SZFT3{2U3<1- z*S`KQ-nH+(=dOMIT)Thv4Z1X!Gyq0D+EZ^tKu_k_X(q0}=!WkW@RDvD^d5Cfu2zl|R2g!-el-H~j2Rxj}y#g6*re z&ED7Y$hM<*+u&z@+WXw^7_oNd7Pg%pY&%KwLlUk8^hOE)nM2d#oO5EV6bkmW45E*k zrNk^Js}6QKfpmZF1(GnlQuscjw4e|`GFB9paK*mK4ZE3*1=r#F+!(~qh*||`lMq0K zweo(&EpZAPvbs-6cWCccUNtI~27$i(8WDK{><^a>0_Z7#cl$o932u}X`gb*J4BoW` zw}GrnRIJd8VH0z6V+m-8Ap^{dq6p5p1GBxC)~0@kbMAle<(yl2&K<2d=Z^o2&$*ND zdCna_*Ex4;g0hnzWM7`_AUl16gN$>{MvN?W$oIO?0}k6uc1iiUm(Icc?~3Fc@60dc z7W8WpA>b`Y&Mp1(uiyrd64V<56bt*$P}=}@u+ApT5e5I)HANUDfmD@Yxg-u=Dmaq8sZ&yuX- zTLp~@VB>P>_SxiCO zmZX2+uuDk_T6&U#K0^wM(ne#jy#IXKrqNVnZ-vwhrYTOxp7SZrvPsT_H2u@|@mc#I zRip4up7KnVR4g^Yz=~5QuN0)(W^jM626PS<1DKgg@izt8C6Hc{obfklP72i}$wogY z5h4dhney~ky2&Ey#k~+Lu(OI$=R0x4)(d|}ypkh!J=sl7-U(&w&j5!RBrQ{0+ePV6)XE=m$%77ws;b_r7Br%Q#f~-#u;+!mKd63+I2p z^6d}An#)**PB_K=ySX>^t@-4RJ2ht=pTR7X8EYC#8k)>l5+C#))D+$sdP{KQpHi#W zzjZd>HQv1gvmP+&`CDtaQ6FxBB}(E)XDELgjYdk!f1W3|Hyhh^MQ{w{<>H-@HEOVO zeH~xv?d^IUfsY?~Jl}?h*QsiJ{jPt`obD4BKVIIuckkZ5YsBpwjYeAoNjojOxossT zu{`%^WLvhC#n#$jH8avo(K_odR2v2Bqu``NSD46v^y?B4LjW=UU zp}&praIi6C8M(QZEzOE|N7g9u0sPwrwl{V+2`<9Knq!V{aBA7kA~3R(5+;)G*qBaX z8l0PX)R$#^(RiO507#KQcF0 z`A6>Nn&~WAf_>PA5Abvf{j-1XjAh&|rQze5LanlMuSxTNp*H0k^?H$U)-G1FA<{_%H(Cn3FV=KB>a1{2nfq%1v8 zfC$V1*@j~*7Xd!Tx8cv!S`FOfNH5=6GiQ2dD6c_?fnQVfZ}b*?e!73w@QggZ^V|@f zdIK-?&<8xd#&CH>ZQrq`D6rh%b%1?mq@V$tP_oH_1QP2_LV98^m!iF1mrx&pf#C;k z;ID6NZ8Ucw6%Vm-DK%%>I%72kE(PA8Pt)Emvs)q~fpZ|>}nS_`Xb zmRGY=sh&ow)oMX1VI?WA^?I|s?p9gdExkg;t$J&7`{5OD2otlhAyn~+6x?ECN8fd^ z?JQiSNuoXw}&i`aQVII#*{T0O}(3np{0 z7!W?U@f7tm^zF^EN-E96WScAANx<8=&Om>jAkFKBEKySvYTGQYEryILsjbCpYp$$qr@Xcnhp<{vTWfV~91TlK z0#@BdN&k6ugxvL_L~(U3R#aJanmGN=?db^~`79XavDq*ZQHdx)Os@z;v

z3G&7LeeRVWOsp9LrdVqbpo_fP>BRSL?|7m*fm&gmJ+wkxh|-a(Ooim=`~nFo9WXIk zt22L~l~~^aAuQw0dTAY>>Y0|R?dM82(oxd5(bPHU-Y)ih(TvIGNFxqFN~`Z!Mt$J8 zHcJ9tM@cY<_4SeJfGHI3s)n2xi-`Dq3s^+5Ana+_$jKVoFaeK zk$m7qa4n%)VU*1f;fR4jF}2>$)E?ByHCVjuJ1mv$` zZ~$OHpTCSA!J2iD;HXHb(Y5CL0Mg#I=4oB3Ixq`DT;AWW4MjYuJ^5_KPc%p4Q-I8S zXh;YcWI_wbvLfb`Fl1mSD2%Ou=Lp+Uyy{VZKp@F9k)VmCWZ}BND;7oCOrf!AiHwML zKC=nT{vc@%Q2wpR6RLg2_IiA90KuqD z;|dk`<*j9(;{Pmg5Rw{|q_tK-i*CLJNk6-D-vgTgSZEzLbi%uAdvHN}F26;4&ai)t z{i;pqeB(ia2qIHwSb2!fzReI3bD>jz7N7VjroE7-a0TR|GiC5Exsg#*YM;~;?UR}p zMiX!Fo}T#L%n7jWL(K4VVmnPLKybFQk8-@D0Ec~NhP_27iN6}E{F+0P0J<-1M;f}& zQcjJ}fGgRrjw{)H!IgXzu4M1egDcriP2xVmmF&iNlJsv+#FhM18CUZ5FM}(8dCPDm z3(z{jkZ}TGuJ&^~!;%h(p}g<(6_iAj4*-FEI9=FSi6Y}DbNf0<6)$?+q)Wxbio*!^ zT>~P%>vX7`(H)?NNGoGFl7X=VsH%BrD8N`TrsmC;0AfKZ42ADCOm0PzA`&A^AEtx? zlr80vEUD)rU6S!8;OH|r^2d08k1ip$e8`{L%>)ELz`_IA)xw|F03)gfE~2Iw-W$~b zLEjXDd?UrEC6AVt+!5B-+2q7-=!5%{EAeKE`C3>oS;)%00!Vge-`4{nS|^W>=^{rn z_`y_?NQjQ9C4ss8$W?dh1ln4)&B^^e4HK=w3^VCOvh|Z5fGohj$ z&kX$cXmm7JZEO%otP=ugeJmWar#!ejb>h*;ZV9;p6Q5fbst1VM0o{GsfDW}KgsEV( zi2|}$?}zF_GvZSg2j27=s|yzJ+y|CEuJelw){_qdWk`}kJr)?r&S@x@&8|2AH4<4K z52`vkv!M_il_pZD@#oHUhP& zMM!cT<(zUf(z?N=*qZv- zvhQm677rJ&kLU_zsP?=)4dykJVKxw)GmhC@x4@v?XKaAMo=6q<_p0ic{F4T8=gDd2 zYp4!TtUx$zeSIzAVSHqrH!e8i!s*Yw3w^VWARvfkp3`cPLzmQrhTxI;9o7vNblx$o zy@8Ldt8@tVnn$C5)4zJfoi3nK1XU8uC6aj4NK*MGNnn}h^@}|)adzAVrpdMq%k*?_ z4$)`ls)jrk;2s{5q}=M6Om)Xp9h0Wh1V;hq++k0z8yCQ{ZJDMCy}G||vR|6E^vrr( zY~+m87W=fmuC6)v_t4INIOG|A{^*>yNG{qH(hW)x$h#GP=Vjl2gqfbCh9?x$5OO$T z(q<}Y^8ztC0HbMXJkxoTl)r*Pk;U}A zY_^gG8xJZtS|rXBY=G-voBLK=W9g`u@6u5(y*Y6Q<&iH_QAlazQOZobvw+dMQwbx( z^1^|$B1t-bWT`wgoKh?~Ikr|MN=NH0NDfCGFO-~qE0d+er_0mR1CwQ7r)XKi*!f1_ zd{ap!DA^>IYL2%jtElh9UQ9aFYA>v%jg<9bCG&K*| z^~+QPGvxDtL>|(FYjdz47*mhoetNz$hPYjbgr7QpAi5gffGc$>@GEEpJQh9HCF1eV zL}daq6-TOY5PufZd?<)G5hwnT1km_keo-Znn@}vm_>~qDr*Y!2g$`Zf@!sl;)MkBy zL^h|A2)0e1w@|zS&zmSTm(j%@--yW(&(iUC+|ElIvSdFfsOOwb*nFe|x5OKwO@-niIHvO$C)ewsj@W>cDHD{jpO`a#9K zo=t<5WI8%@$boh#Qr@qu?wbi%or7uPSCJ1A>2Oyk%pE@ zAX5rNbO}(3X1ph3pwj~_&)3n<7nMl#KIvao>0lJ0&3dCen$V|@%%}Bplc5aYJ_8pB zcPQL|=&je>-rY>QxeAcxzny@J3b683C63{xC-P1$Whp=}>5wTX&6K*^d&xlnbtBh* zTt-w=B4~8TZGLX~0i5WJoA9-z1Rx}!t$@a4L;xWPXb8y1Wz_o^P=`j;pEGC%=akWN zKBHt5s7D3^d>xfJIFttA=hIJ$ECy%I*FQH^2Q<4%rtiKU?x;@Y>Luj+^ifsPC>Kgv z@eW1cel8Ir0Ufrs8_h-qo0TN=AHBVQ@GE})qT}wnx;F^0e+^=}{m>L24K*}fP-pWO z3gEgVk7lSDp{e}u{|YHk7`eKyg3y_c0q3qc{zVeL1Sl<$!UlLc+J}FnGTIx*wY{5t z`X?4cn65tFclEJ>seJ~rOkZ^s<%^>KBpj!YXWlh#Pp72X0C=*bSIU9qQwb>zNeui-K7-hs`+HaFY>suywn+}y zi-@&IsE@qiB2Wo~x4W^`Y7wV>KJcNav*9`oWHB{{3trJn@IQwDv1A>849QkV#vzo7 z=3p3y)S3WpOkml-p5U^bk|Q#WRn7Hmtk?Pz>|-JnaBBU($;V@=~1wjU}ZUOEcW;nNapsYNRhB~H#Xq`7! zU?{IL+cXw#i;k%%QK~n82Y17%GpyMdM26TM-YKsfEfUC)>HRzK^iB0tuXU{}=%|lD z!!Y-~YsbcR4dhUcdkykAnOtP^_DO30#Ci&1V-lpqO?3 z`ZZ|4L_u^WmL6*cq8c@dOPqK_iu5%ra^D_J&cKyQ$npW|jjOiOIb)j3nDG7Brvm1ZOXb z)9FNOWrh*ju5WFBZk8P?KTR0>@mrrUZe&A~w{u|BSGj?w7WY{^GqE_{b%)-=V zYyn2_8U=wZ8RGTzba^R@u_$X+7Heq9R#GkeB9MWEUvw|b@Z7!7xE0!-#Ip6FhJ^=2 zq>OJv?Ak$%h>&W^D|TNGwO0ykgCK&oYJz4B%($RTC1oIg0Jks@?g%z)IHDkSNVG*{ zre@)O#wbxURM9j`v`~aO$b!IHc|mc-*zJhOZ*%ql@l56k9WpqAX@GlCb)+0RQVxui zb0HWZ7u|FA(q^^%{1f;K5~&kcYXByZI_v)kWBW=Hxf6nRnh?HIOVsONiuf=@n}j}O zBUpug==|t^a{@cBUTLXD0c~OhThgUDE9EHY#AbGJ$7mkt%eiwwx&wa`o8Zjt1`*kq z^v0Iby14t;AhRpQzJyc~m8g$Y_x@gWO{PTBGy%~NSwcPJvH}PALZy;^a{Z%cHMw!6 zG{S+Hnyk&z&GJ`$MaN?iza_^x)ixw(>!5`w*(;>u3&@^r$5#_CtUsOgf zDx(*b(TmC`r7{vt`zb#LbD9x4bB@O61K5Ps5j2$V|36yf3|RBm*XiL3_?!fzld{Rl z5kTyH_-R^44xpLkk5eus^Y8D=3Lvtq=H|}UYJa2@UT%1Qzl`L@eS*dXzW=NH=|dRK znO!V@V#aEKyAGGtMSg=?dRIo%G*yR*EZ;Qh_4~Sp5&@>+i1v|8;>q8kg+DdG_>5Xs zem?y~aij7ZVb+==$pqzU5dv}W!}HM-CXqC15gJUrL4|^VTyLk|Ks`^2ya0>G;S{FZ zA~7-o#63xYR)m->j^v{kp)n3+jyl0PNKrn2c{f~&auK14707*hQVC(E24J=n^I}7I z<>=lVyK2Z(cK7$n7=u*^S_42g-E*g&Ws4*40Fwj)6xM5s=oF}$?&J9sY)aq!A65VR zzGj^NpMRhI+r9X^dj9X=-)9$p-`9S4GoGQWCl#}649zgzVAwOrm-7(07a9UALzAF? z8^S-Y6r{Xz4VPf$E`SLjttG;K(?<>otap&uf0?oUmuV6voqvFvChdX-`jL>$e%dW{ zn0!7T0>=p|6k82-usWlbl)!!z3p0I)jk~+C+l&Q^*@X%ltg5))A)fn~OM4TK70N=d zHN*u@r9m#wOSZyvc2Ob{YI~3f?0r*ziT2@c<4v(nKEaKJzX04h(jRlJo(S9IJb&K$ z*5Q00X{0{ZLAN?R3q9W&O>%`1+S%CNYNchazj*!?h61-Yo4e^xE-P=v%_e<+!{jRw z!~W`;^*uKa^chP|{L~$8FLl53wUBdC$)$~4G7@Oa2yHf7TMg(a2rL_0y0Wn0qkcB+DfvGf#k%HN}Vf z`?UrlkhZa-8#G2CT%-bP3P5jl?i2^6^{5E>*9Tl(5Y(nbvGmfOnBayfk33g{t5is& z9EAldae4(U6aTyh2^%16K98eqYiFaem8b3VAs&DA>}b?CS{s=j2n^MjZN(-WZ8c}C;3P0QsMeKWpls&xZU2_+O9_J z5-Nxw3!=edO3aU*s>xe_8#}G7Jcp3@&tsvqeVjlmt=JSl_gkXXKQyyoKzXr#L9>u$zJ-{n5~R6(5{2?B(9hIOUeOL;u(jZVCUaxHg_61wxfzW zWH1LQdyyyPw{e7j{Q8}w-fZOWT=ngS^q^x7w0z~U1&64$6>*oW6p_qZsgt9gv-Lga zM^Dtvxu$pST%a{IQPH{DKg{|=b#z2eZSgCtmN>zF{Yh5eZWLU*3Wx_n=w*bgY-~3m z0X53vp1{-~%e2n@3zQ)M1cHjY6KlD?etPU~?C!2OXh>*(2y$Q6WX5qBJRH9m4=2V^ z$zZMI*4`oZ9Wd(=4)&lngZ1N1?`mAmN~#1dD%o-p%A~i7M{aY#p=6n6;aXUkZ4Oqj z%_T5Dk7beJLi_di_pL^bX#)`sjTS-<0U9l2XR85$Lm*lR*^J=|_oh>G>%vsv2TyC+cjh)pY1#ijdvCWK$FZ%6UC&!IY81_?gJcs8@V8o} z7DR#)w+MhDKxs?O9!#M-8z`ZX1!ZLugu2@?;c)l?Y+u+8+hO~{SHAG2?Fidf+c)zT z^8$W<1;<+XUzG)rTYDd$Gaf~V=*r5u&sX1Lt1X#_r6%Hox z<*j^N+bfuUq{_-}S3T#|4V%1D>>XJI3cZDB>7CRw4mWZlDTkXixP*LCix(B;yJt{< zfg%01nwFOl-1*iC>bd6GqTAhnn5@a8ohSY6yX=Qt#q?-QM7GtY1VK%XrvmYqFePX+Q=CLyUwl&7G9i{-VG2=;8LQHuz59W#_!+ z=De=09?!ob9#MOr4mVVDd+7kuKo3{uArFYnw zjv)gbK4DkuKiukn!kFX@mI@CBoX1UBg2Nt^=vP2Q?}KJ5yWOSvonlX36^gTg9}u4$ zwm*|6aX&^^eu9(X6I?5QJ$n_jPB+pGbN^D!tn4(!nRi>4&|j6S$i=sc@w}GNY|nKs z$y>GTr`&Z-{IMwK%1N{gOBzU(8M}pY_(_t5v?Pn$SSei`!;4g|N77|`BDT0ZrQG#3 z&7~V8+l)GKMQP_;h^s1n@ZhWv=ZjOog?NzTF^Rm;Z}SI*Zsq-dt9){ipV2CbQdZ-q zcyGpGX&sku$}6yAmi$#tDnRUZ^+J5@Ors`GGw{twwRflWpeMm~V?-6R*nUHkudNvxHoiO)#MJ_eJ87cNgD!D@4 z=H_UyqPLo5kgL(CNqv0(#>*ySZ}+Z*CpJn_GtP=GGw$y}h|(2+4_O zQn?o=%Z=+`QGSPpYf~7$@Vey&ag9oH$Q0?ZTvGNST^=01*gM%f_|Y5M^|~=stx(;v zEnAKZ;3!UimM7hAEPX{g*F9A;wmDhv#c~2)0CTg|f4Jj}^hevKi{5wS$VJ6GhGON+ z9ZurtR8D5Qaep8mk~I8c=UKA;7$@X7PS)h%vxnQCV8Q;6XNBZB_sfI$$-~E=z$Mqc zE&q907qvO@HM`?c|H&r+O5E*#`Zv&JBsG}Ozp=%Chu8K3+WvTF=keoDYWx2;+Pmgx zZ9jUt-M<^f!o@Us_~>yPB1~NT`=jwdn-gi&(cdCvwjEY6feYbi-1I5bU|I-nfOr*3 zBayn0H7-^FI*Zx%q*nTwU(#VTGBr4G;_!+@V~}W>_v1*Gq%IMuV+W(=T7(YFdRj=v z)cBu&sZ?bvPm{VQ6wX}?aUvX!QkOh>UhoNo#vMoMc0U?h7+Sdd65!~lAO6BP7IA}Y z4bBQ14#`a@*&;pfJ#@uy2uB|!s3EoQ7q8mobH6V^CxmP)i zM$sm)Wt-7BN~0y*MSMZD5fd*YRDcD=VDj#N!i~V0bRzIOUq_7)F2yWH6LD=#ue*C3 zA#Q{r$GpH!7)OrP{eCXadzS?O;+bL`RD=7B6w-ZbYfyd32AiAUroK z+m^RoSumKoI&lzEZnADS0v6w>6`94hSQFf^@807Jv&a9n(oRqA4wxvvR=tHN=DNFk zlSL&!)~F-$!1bX3r$2}g zMemn!rsM);3v#LIEX19tM9zf-5abHCl(K0C2;Ng-a~zi!lx5Upkk9G^h4RUNLI|C* zWdWB?EHhE?$FK=5Z0e^IchCRH}iX&93~A*^)96|QPIUtF@R zkWa|sXQh0&;`Bq7%irKmUW0}Dgk}OUsUeHV3xur*<6EbOBqC`^9l9F0o{NUy515&T z(E`@D&M~^+(s1>7foD7o9&C=SjS~uwGt5RmFz;S($+`nI08MrJR zpc`DhYa1pHs22pn6@nw!Shgkuq_(p&2i;-iIQh#RK-S+n0_!wOy3O> z(;uf%L_QWXEUsB1wazui4Q%u*vz2TO_7krW(Hh=Ik(@l2WLdROev{s?u6Wn zqUhe{!e)-5=)oDe_x?S+NH+1kK3-n`qK}s+j)U)$okzDKbe`86RI|R;WqGi>zn4a! z`iaPk!{_hz_YRKJ=!MdkY@rbue{NYt$zFg+q>$46A9vrr+WqGBo|jXb*0>pu_FnHj z$1;!hj?>6M27)~kdHHJZ^@}umSpxnS4YQb z^tz~Y@rU31Y47=Qs+d48@kI5We5LyE#jCf_-9PT7(Tjpp1Xqj*4E&3e$z3?o5f>K)N^Au`J)egBtFc5h6aFPtH9a+?uxa@qlLGV1a0 zXsCCwM~2tK_A_ZZ(0{md+s^)-(!@&4zPTe+d-m+f;~lB4MwwjD^u6uoBNB!F8WxLs zzS-+R9SixNxO4QPe=gwfb}P?08n7oY4cw$DUYaItH;q5a^n5EV>N;Eke|#1Xq8uy!S~fTWZ1-p?<6Y#gJfJHp#;v|f*s+Rbe4+{^%&aDu4d&z?NK zbz%Sfvc|LBB14fJx{{S>snT(NHf$!P(br!)k6?KGe|GoZL}}E8U-@JqsC?6h=SjgQ@^Kp;&v^bpz21UnDY}NoNAM_$`Bc5$ zf#=2LTs}R7aA=2be#WQ#89Ytsv`}xKL?qff{th3eQ0|^X24vo|WaRMZknt3rO+BX( ziM~CK(&(#*M6aAurtoY_q44OGGJ$7P$}A$$YbfQ*e~3f}woy~)l0#eS6dHMGN}WP0 z4{fPa=(59Vo>%Ac8E8Fpii18o)U{4wBz|~z2=&6HfkbcjzLot2)E<9#`1U|%gvWOd z70@N`EEUiP?;I+i1K*iiprt=MA4A9F_L)Kxb5j`I#z+136k3>5J$WdQoZG4>j9q?t zr6yBue`W`TmgctQ6gn=~G*Kw^lz%wQxoj^KJF)YF!u+t0r%&;b37HuvoRn8Lc4|!) zoKq&Bq39`gR{@d7_?o)H4j>nNahza7cg;3rhmzE9l3Gf2<~l!6_Vypx8p5I9M!9+`dSnhIva9b785RWoj$_H>9kZuLLafy>PlvYRx|Y~huWDP)EQ7$+P2JK zkW15+84N{fiJ!s1m3%srh2`?;Qr3!3cIC{V>r1C9pt95roxyy$%6Tro#i#kAx|CDk ze-y~N0uz2&5m5EpLbd^y88=;Y3SGq2Y{6Amp{fj?pdYGpHOpX>s>M}be)UW~siEJN zPdoAnYO8+N3uX$PEzV0WNt;0x5bCy)Z=sHb(}B z^~op)oh&Z6}_kUs1@db;(=0SA}-rV$x`^ndqn{%iaVz4L$nXZUj)lm9#X zy@S91C;a^ofB*OR`w{;BAMp3%D2@K@e~Le!VDkThzoDkT$lT8``G14o524b(U_}q1 zqQ4+n4`q4(CH{VlzyB-zEerf_@HdkFZ~j~SEld0#;rAoijQ<>e_wo0Cfxn^ne~X_! z!e;z`Co(%U<1a}0BU$VJj=!PSzsN$6^8XWmLOp-^UuCC1e)8<$<4^8%1T=#Ir3{S$ zVRKzZHx#zbWd!2vqFlgKn&*}1V7lH6VG<)=luE_0jVb=oNmn`SBFm^`P{ndRq4> z>djrvu!YxJqQA$+T$T(@g=SOai$+6qvfB)u)@%g62{ZxI?`nW9wno1E7Ky*6^ddw% zrZ-4esV?OzsYy7z2+$45cag2itWk|$BGJ?QrbhD(tpw$e?$KPz6h*HnFH4TGNCV`5 zPV<`pwbT6OE@EXBHCo|2B=x*p;54swBqoQ*fENKeAo(srRGBqO@Jl&Q3x)?mgBbN9 zIQ#HbX!_xcJLjJ+xjq5q*GN`HCnX%tE?KN)kYwHfIr7C_l0rF#3JaH{n-Lt(1-c0$3c-d)?E zEVI4`!k2e#fW6T6*K2HkwVt{x+jx*!UFRvo{3LLM z_dwEra&k>i!87pW62VbUCi&!?o}6G@BCR8^nLrOzaC&lLRZDFp05rLeLuJFyN-==4 zn7*ZeY*|cGN&p>&PQkZFeVH!TCfZE>^9sLI9v%jphY|Zb&>VoLm$iU@D$itH2eS59 zMzgQ9*;x&y5|kpe=VIK`CY`n@)TQKr_(;T>#E@SiF%XdjQC){L`>GA@HKkCuaS0iO zDs(X2nTko+?@A~i*jxckhdk|a3n1y*+=4;YL&(jXCa+fg$B-6^jEW&7EOewYFb(;? zhiJtRpc-a!KmpcrgobK=5=cVCBZ$Wri)8HB>1`u@g9iC!x4ZElS^KLp8I&2?vfbim zURpnMntheSe1s8Vu1mXxfy7rNJjw;&LKf?F5+~st8LFnUuj*mrLYYeyCvGGBQiAif zDV!Nu`hH-bF9dxz=<`Dbo@KsYZKG$cA7j$+Y#ca_kubkjtCzZeu!h^A@%Ic>B3&U9 z-!XFC(wpa(Q&^<=#dPNz$8~7xO8n5af%RhYY4tD}t}u45E710ph1dwp7S^dq*9) zEF_*DhSNh=w~pML^u_|PdK!W1A4un2MLT;(`zonZ-7t}VBxuJ#b5MA1(q1u50B4wn z+g$1y^ogLUB3ulA$Gz<~kkO{nwtccS^BP}W*-O!Fz{z%xF>ayYn;4#^OpQ71UFG7u z$`FdFeXLu0@hXcRl{}+1q=TdLo&oydoyhUz$KO}Il7qhs8 z-EdxV$`Ncu+R!_yA?H1kAYl=*EUQ$EERFko5?8%{1)l?;+!Dx2ql3faS1*4)*?ar; z@a@U|(YFz~tj^K};FQR7W&#~@Yi5H`tcmEzO2P6C|Fi6|WriW{$2|eSsto+2L}|Wu ztd^*Q_j8HVJos1FRW(d|n-3Cj=ZUNfVbtsVTrQ;j4{RuT=bD~Y<>Z2jo&u@c3r?Q? z;exQelif~(LYrnQ1-V50zFbdpwQIaZ1jO##|ase*RcJZ_TH5MXXLDm=QVhwtKR-G zxYECluX>kL1q7htCGN-j5Nt3>dpQZhW+Yb}+Ys+_U6Y>%`k(c0hN4dzNb96g+*{ce6Hm9P*sA)jg&)J(e ziGPg~@-i9x8YeQmn7o^R({lbl*?y9ccVWVwJ$aIl@4{RKpok{qi!h7x?hS*vXy_%e!+tO z)G|?b9_}RMhwyxpD2tSa-vTmcLZ}D;z-l;Gg1er&RS*tyk<#AxN!&Wsc<*_C$tt)) z%E=R$v^F{#_{e5U874+oxq;r)_FgORmWa+qmNE+nli+eAv1sBg@HaPOI7tTM=FPrJ^3enC6cg451TxxjoNo45gezRLTd$UEYkb|U#4 z0p`zD?_QENtKWXsoXEVVsWH%hp=-b_fB;4;JhBo$*jl=C7uDc4b|S<`)L00Ne4_Ef z7y#MIBT z2d)s&CS4C?IU95WQqhX?59s3w!><;bP1UgJUPifg=q#i2I5N9jLg*Az+^mG2V;Uee z6tr^D`skIr!y?M80@~Ss$XHu+EY=7;0=SihJaD|&YzD`}8SYc>$hFIK;2o9nNK}5} z5GZ*>&&P6c$P5YboWkj`Q-v!l^4!L}TxSTv3xRjfhVl<+TPiA!i%VKAgv%<)2Gg~> z+kJrV>p`+rd~NqrezWw@1L+xfx_L$2xP5XmfvL5)s;Svda|D;0HJOH()!3#-+k^;!l2K9Mtwa!m>Co&2_-3+gY(A!6R*Aa83F)d!7Zi8Kn8>GZU$%W9!%vC8~5a%0l#pIN{FTa5EWE; z$zXGnB?Gr%dwL&#a_U?#1_zh{aW$Y3;0cA;ZjRF9KRG4CxI5-JP z>;<@1*rlXM+>D3@rSMhVui#z)5QkB!zOv<;VasvY@?@>so!NE|ajvDNWzH)^Z}EHE zoufy(dtj0UIuz4S7qc1VwSw)aN+=~MpA(9~Vdf6Eh7x3d#T&J+6;-x)JKaY0;>Lu2 z2mn^%q_cII;g$jgdeM&RqOe@*OHU@6WuQD0{pl-{6!kjb@$Y6z$q0h6tv>Js=~C%z|h+9`gE8+$=*GSP=-YDimn% zCw!!EjpbK*b-J{-d}kK&AL})z%w``RxAdV7ca4Tu?(rCicztLXiOxg@zdofZFn2xj z^`Ir>>#c>Fxl6g@9PAY8HT0D7Ox!lsfhlZp9c}o3OzWC#Kn3N+9Oghu365&&I!zNj zV5#f>4Cwi=f-hpd{4Jq4Bb22~#(ZQL@b4 zg&qU?zXphOdM}n8;i{t~A0tSiHzDBIW0sIwfdCSPy~k~ru{B=%F}6)xSG2XXK6&UJ zye6D~i>GQsiUZ2CyIUzTSR!_-H8E1nj>~XQflR8cZku#I*b+<+I17=PZ6ZcCP|lNL zE-3$}-!};S9-E+q|G1sR>2xunf3Hqbys_#Z!UO0EqyW^b+=EsiWtO|^n03AIK7mlWn3to*(l%K94FX+ zaTdHGAuc0;!WMrE*Tv#@u$jzrvH$nmY5j%LGWQJ_?r2QzI$BU**w}e%R0WY8&)|kl8r1Y8ig0(!gY^a#sH#M)G)T$ zut;mu+4f@L%sIGF!mSmgcvc1nD^w9aORSx2qd@6Dz8m3T|Rh!kgXO3&8KfQV9( ze;Bs+s)b^syYAo#!n2VL<|yebr1Cy=5TNQTfS`%OIsoZa`={13!yfQ|Ly!I%M=t@9 zq?5a-{iQC5L>==xN_<%VVbp;?)6Tsb-oL^ej_v{Ke*^|`fSG(j^3os)JF;hw)ep^s})9V~Ulym*Y`?wb+scFi?hshuWxoP?U4p|wR6^=+R zpjSixjtKI4i&33qLE_DS3rkk7^RM-9@J9I876MG_%2h+bwTJ3G56w>IH=VvI20+o$ zFcA+Q0Xi}tZH=97PDsmgp$S(6-AXtAafnl{wcTL7?5bU}$9D?h5T9ntw=lYfwqp@6G0_>)LZVksMM()HMXB4*q zTl#Y^B8FNnQq*5Vc{MRFq{zP3%2Z?G+sX!QdK;84yloSYU@IF$2u4U{kMeZR&KwUEAq zxk*Ptuf7AcuZa~~tMp-z|E&*aXw`z&54P-%Bd5lD( z&nAxXMQt60iP1uTHl^oT%vY=BIvFu{`xrRi<@URGVX~WK$xXu9vwn{m5d?@L%zVFg zI_A5(dgP0G23Yovp0RQ0-#b1B`8=X!Y8JT@-7{9~s+;abopRQJQSLvSfkw4Q6qHk|uL4u0@&o0Q@{%G)+nE=ag}~FtJJ%mQa##7c zE}JA<+M8;W;0ld|;P`XWf`_wyTy>nm1d6j2ejfpd;egzmjLSSTD z1F8$eo0F@hZleX~H4=lZ!d`KR;Psgg6eNUx@AGPZpqQ4*(x0+Xq?{p;ABYMznJ*CO zvAQU(0KPz)3<5qK;L9p!yNHYl{k~@A=%W29{jxx>R1hWVI{YWFB9fOZFI5WBSF4RU zkZfXn+Z%4JMBU-dZ-;@j6d3PbRdNw)2OPUxd6@kMUsExHbxW)_NSzE4#SRz!V_YO8 zN+PX)q|t^F(({J?2vU%IGmBzVUMaKdM*2~vSrVj7#xeNG35A6rrs=r$HCQ@nX(rVA zwdLyTWMf_=C9UO5Q1rAW%L)vSRp_uZV3GTynWH~~dL8{Fe+(H})uWIR`di{Sy3^lk zz5tSw5MY2+7k{9Mk=tevGU6aB^@BTKt$-hYZ1B*Ij?guMNUMo*12`Z4Nv~EDc}2w>fl!B<(H|5x%3q<) z4a+Pa6=-Hgf550C!2F(^022r`0nbpnR~OU4^v`jbjOAI%hw6@2CMnNG<#-)5H|^Pf zauX-IqE3@SMH}d4i!3resJ>j7fG?Kl1;h@UWY}=}JT3`KdhVr%D1Vna4HI4Q#O0HJ za9KbMmJni<`W{E=-7!Mh5f8IzA|7Oy$-O-cEhX>M=$JR{XjpLLJJ@+c`FVa-p@}%7 zbPA{OHP5fmE*!6Z3dg&Hz$nq#Z}X^sBl5E$MzBsFJeZb~swYENS0bNWIH9cX%QND^ zq~x@BE-vT)^6a;{XI&nq{NWRQrK<@%a9a*AccI(mBFbllEm1_S>FrrUw4}JJokae5<$&+b3c8m-1-KKhYk41^1eNrW;L&>_`2eyNx@%&T7-+>9|d3sa?rvTW_}& z_h>t~!;QAut z4~h)j7Y4Tor3)oxldNxH=Ocb(CThM~MVAYCC)CfbWgMm@CVp_sc_1r)Tdl-u6^pDu z#hw+x4ca8*dpbm8V|L4F3m^e{*^!PWlXN_DKmZQOUGc7SuYKt52hSRzJzc;Z@LdD8 z@yCFOtWX!I8hccq&u8jnyKlMe4nMm27=wV-*)ktE#4$&*@n{ zHzE`VqM&fOitQ&(WOUm~;YHmMLxC7n$GvjqI;acxGz;nPpc;{X-z1l0&qYi;NMzb`_Yv949c3VN7Gx#wA4L?N-Ld zbXrlFQO9Z;EuaEM5@-w>GCo)Rmjo>+oB++bGlr^;I7!iJG8Qa!0d=FsYgSIxf`K!g zYNW_j&M3jqa1;K2g8Uze7EWMfmBP_FLV)2-FseCtHWj*m&{0ygGtEP(ZuE24->X&( zVc~+@blF7ukwVOXmUvP2%l#Nl&|v8i`Xm-qI{Vww2yK|CIde@gWojb8t}*eC;BFVr z&E9nmUZpVSi#P&k4^ThC6a|(=mfe9MSRFz6Wx;afhhUn2lFs#cF*)yC7xTGf99Y?* zvl*yM2u~8i2hNxU1}HQ#-08KT2}@{nS_Vq|6{X^m43vvKZ9NXcQ`E6uu-76P1{QO; z6Sh`hV-N$&L+%*QJ~*>xYJOh={|h)06{o{`Ip_$AsRG#O*! zYNpeXtrBvhI3^uMC$<5F;6x0INj~VqSj-j8&cF;41OF-xBO;I z(MBDAp@|X-kJw;S`^Z@lH66GSDrt8n=wk;%KC(r+Y-U_541B7+ELqVLUh+U5~TH=z6?fWM^w#)Je8Q_Oh+P z-j{~*J^kTPR*m+?5b*s%{_2kh1pqtT&rZ-|TlpMb4C94%CO86Tf|Je7BwdV-#@WSs zU1nU~_R($t2qhKZa!dQT5(^n?Q;OoU1Wv zc8`ub2j!IdL0&}(QC=4+$}8S;jx#Zf1zAXO<0)Rdj}nhJ#|b%iggG;<16Cp#g&x9{WkwJ@+|;G7wQL9?ulxf|0dq!B-eL?{ zSoy6%vdA+wr0Q#Gzs{2uAPge|&Iei(ElCdKEp^_~MZXYJ4==?rA5u5-4Ypcse`o>g zY9&5^#RdI9`AxvQ%lRG!=EY3k9?;Qn5HS2x7DPDg!?=+4pgPetBx+~~%y1XPEK7YU z=x{ot9Gv-3Kl!y|o8sDPcMQ3{0kTu{!>uGq3qz**5RHP+6V4Vl+$hpwE%z949+u&V zQ=DQOeeg@Vx;@X9Yw@8H&D?}rfB6v=h?tS_URC^Vea2x!S=tLkO%u#}Q;O~vZuf$f z2#&NY%E*Mo1Z-5;P^G8x&zFTWfjn%QZdaVfBWoqm4i0)sp zS{YL;cyvnmU`ud320&S$*E?-<8Nk}@oHZ;1&RK_;#*|~-Zr|~Lgn2h9e>rq?N8+b} z!JoDCo0S~ZeRlfs_BmHC`(a;OVKLB?HE1c2(rz~@W>T}{PHY3ErmY-5iiJ z9TaW7ly|$ax5jg&h-#P|%NGeT=wx@%=^!eYrH-1WQ(1CHu2QcxpHB{;F$x9kVyaFl zvD+CgbW{=H47{nWWND8Ge-5B5tDAB;e)w{DoAS5=Dy~a@p`+P%W_d9O8&el=Sqtkb z$`Ne>S;(GYG1TMVpmIf8YhJ@r&<$n9coQRd)Cn?PI?Po7}@P= z6}0x3nig2X56(b?_}d&@+{8&61pKxOk1qD?z5+%Kr{(m%E-qL(Z9ke)c z;bw`&N$@3J?&sBh6`zRdv$lxUAvQ_7oM~)CLEvvl)Lk2T=OwUh6w-U zo~572@?Ldb%tRdYf5n8ueanDf!|zx_X%Yn!2@a^nUCB~eN!L0`a(xwQ?(QJs9`(o4 z&j}a_SHZV{E&wcoTM7UznM0GhYG@?OP^lANRo1{faSwJj1c#NhFd8vkPocZa_Cd<+ z>pB@SAy+&(C1MPU2oH@wjU*@nF3S%TWP_AZ9!Jw$-c$XV;BpJ;1rrO3bW0}-2;cN&{|1)8oXwm1X|5Lx77}~j(F}EJ+w3! z8k$c-{VhJXe`a?}dgZW(sHohN7Tmxs!by-2apAaji$kr@JaSW?$HJZraUyektmlv$ ze4I419=lmz$HLv~b)J1U&n}SR$qU}G3szpU4iGKPD1pP_w7M!;MRl+AI&bDQuc$;V z&O4GMb&-)-brc2hBCGos$QywIuGIBQ7mX}BLNK>If4R^=;VFyD0J>BLig;d5DIkX6 zgUkYPq6Fbt_(mMZ5_s*ZL249w$V+&F%>D`aaJZ$o_1G0pax@HrJ|<9ZhjNOZF5~eH)_KNYa~|a zZFPzDkSg9~%f$;=npk>iTg*LljILLdPp8lzaPaT}6@=?hS+EI5Yk+(X*vKv$>v~h3 zf9KT!Sb`OJ36}?bE&CU)KK~t>YG4sgmfzd_W3TcXh&?Z1H!O&eKHy}3m`-A+eY-@1;zL}oIC?At5E2@M1Al@vK z;c^Y`Rn@2*XM%{VS~Ih;FzwNT_5Ac1f1Bp_PU|6H7s*LEa4p0x!2%i_7FIxoysUt#29puuz6q3lD!OC}8gujH{=Tw*-Bf4p;5 z&TnSLeBO(af!qk4660tgX7`^)5NJ%R58yaB$3wqz^#@F=XBe!dSlT%1`hRQW``~l4NtD?^ZodujcuL#t%mK zqVa<>5=Bnh`$63MhvdQ8B_<1Ae_X~%8r_e`EQ{Xr_w4?CBRRmRXHi7XGvu+z6>ym>IcA2G?KRfA0_Q)Hu;9 zx|1wE%tlkaLz3%+=!fe~U1~zc;PXJH*&#sP?PVvXT6 z?{SjCYzTIHx9c8}$KCG6aZe?{HBHq3?uHs4$*m<{t#X5yr38r2lco42eh#OHw>-2} z?`Vhg)hgX_Q81vMvZbDKwJLQz1mIxT9wLeO(YX;i9-Y#dF@mMj?w_66u(nYu=Pvu| ze%~5E>y^gz9_Ftqe>{3+9=6%nc?JRiuZnf;0;wEi^|j`!Y-ek$+Z8WdOHT;^>U!MD zcz(hO@@lw!Fg1+cs@s!t{+~=}Rm~RjwDXouXz_tgRqVYE>}xKxkctDC4DP7W>UV-`-yisxOTz`h_^YXdw%gahe5P^su7)}Q=pXp$5dSge?gZbf2mdEB*0eU%wQH+ zBW$(OQ2a!HS6hP8TC`;if`hfC{m=TQCH@o(U=N#;5-D2c0~>CEHHd;JB`W$hFvpe{ z7F-#Y9%h9uAw$()(6HNEHGjH2Ag1UknR=rgI>T?+3F~?e5014q&%v_zubr>L%va*y zK)_&K{G@wLf1V4L0^R#+0dVVVFq~TQ) z-2+t+0kmexUH_2PRDm0CS+Q}L41+SGVshTKvDyS@99&1u~LyKA(f@e-wPv0m({!MmzDmxS;46Sfvjh zTwh=J*wy8)75W6KJP#(ktg8Exa8(i$1w>B*wpr0YkR}-%3xa2fQbx%7PKc}51-t0D zafUiCG5m85t08^Q-ZRB#OWMHeqjS%x_1?hbSaxLiuIDnEmMwm*KKojFGCq)+V)zm( z){(k0f0U-XWyH((tb+~)DZbMs#>>uv7is67)-l~9ioSL79zrp|XPu5`$i4%Dn0`xm zzny2>?p1ipU56l>SW5E@v7=S}+u74CB6gG|d2pUeXIpEx9dMxi0%B*Q=dQIx4{ZgH zeJ4u-bCChk+PecR(!jnx#s;u0!L&lxq(Tz0Ll42Wd!gT)kEF$7rEI)$Dlfa(@{=#Tf zwgdEttgRP7qhSNjuUvMknejCjfwqsMUazO;zcUJr36`wu{sf_Z_Iv<{Z`Fjo9-5-i zawLO5{Urkmus@jW39fr0;FAy{0*9D2f2iSEcx~M={JNivv$H*`jmAGb7m(^rY>=^m z!Zi0YXU@xh-ptq5J>s@4&GDPKEt~655jHOHain^u^Kx)U}V6z`Zf17HT z1tV%XTAR@rHgLyRB=F%lzJPih0ZPYj1JtGs13OcDk({*OXT9 ziM4fB33rZMHL^!sFP315GV4aPZu+)}hjD0aItz`thap<{dmBQ9C1QJpTpr?4%o4R1 zB(3f+w~TVjxdeTQ=-iavFLR zNhcVAyQpy_tmJ+U8&9{R&KYj{v#>PQy>{**&o|ve2B7V{j~U=B4{IkN^H0Fk&Tr<- z>O_te4{!)c*hT0r!as{w0Y*vjE7-4+U9nV{?rU=|`kRlk`QWb~>X75oe_eFe&T-LL zuM37QKf*n@r9XzoAs9mMZ7QNx9RzDOGzFZYK9eN5qkA*~B)3nJcog%*tMpT*k6Y-c ztoL>gtIupxaQv?p;`uFa}0TklhAl<=`+dNgnk`u{?X+f^I_DnHAVoH zu^EAbJI<9t&6Rc1@D}@Hf9DHIt*4#akC~vy+3n|oDfd&4hoG<8-*(SXH2skSqRk`j z??UJw-s3{fcYkbqQl@PR?tJS?|LZq$7vJ|9M#N*lvSfBnrf9We{F|d1N6M!uVn$E zVAo{|0tiP=d|L6y6EFNuv)(?yW0T?^x+yl9Pvx^3m7Pw6 z`U0)yW}x^6d0ylx1fDpb-S4CR!s>LH+ayMvtdbz~7^%uj8jB}VpvMGZj4)1Eku4F7 zZK<^RKOjic#uib}e|uKvxX}kcH;kP69hwt>&I&9viLx$8m-%EuuS6RC!-Id&$Vpm} zoHiB302n2M3oK=1`ZRiTcyt`C*M#LQjzeHeW9K<*gi9Zd3D33%ylL2_BFFfKT_zOS z5}fxW=6J}VCaBBx^tAXf1OegYR>`jx^SN}?=6TT zTS~_;LNKgQq^SyvQ@=A-*$0yMnggqRJIk!DZ~!u_CYmf9X-@@Us}hlm%(JBr2UZdb zDz-3+)x6i3Xkf_f)Q~|-d+zka3|LDh;t3I3NkW!-Dis72f~gw_fmH^!Wy37?01{g* zMh+^sRirAKe}rxE0oL8q;EvIy(%3rjU_GBv0dH2YEO~KOuzZf)s$(c)wQKE9^@*+H zNekvRAJK8ot!JEJl7iGEh1^CKnIAtXq-H|BD>&8gaz3ZpmvlKXDX_5ssCYhy%|r&) zLA$2fmjq5tnQ_o8gz7Scdl0gTyTRk;;O{F;x)?+*eUnv2RWeZ0 zAcB#DWe7G~-7eRUL_^Y%8jc<2siDr*vcNZHk!as3<;jhKJTnM~Pv+pwfK3=CKQNr_d6erKU~$oGMFMrL*88yHdSMt5BsCR_fyEmGT5yfQ8m1qh#(L zW&bite+GEG&AZ)rp<+A=4kld_`?N*oYImAtXqz;#B@Clv7!9K|>grQ@$>{aFx3AL4 z=4_KmP9o|?$>ze{A?EI(2}o7PzRQh`2B;3uS%%Jc*FPr#?&0P#xf1Vbk#Gb5ernp@@AzfO ze~{S5*vG1bcWhD7shM5|C1NAXCf)9Y%+%R)a-2XM>}bIYK)wJXBN8ErHpIZ5i>KHm zCL&Rt6#H$BkZ7C?42qlh0ip0_vLB~4R>omn$`I#LS^i@tyZ2B&66cgnXYQG6IGve3 ze>>MMx|_%YCK^R1uF+ls2gr3WBo%NR#Vjs+QYXB7opZ`)r555OYrG({Y$9(C=h>w9 zfpTcyUYgDJ}DIs`|V{cEj{% z+1{UJus^TXQKK&wzz~GXXs)-1%Lx^tXHMN;4iw}4fX5+G2`{-Lbg?2CbH<; zz2hh$$E(%HWO-&dU-JumWpLxz&!Wr4TohM17Y{Crk90bS1|PfK<8C(q7#Z#By!YKk zRGn$*2F&SvEy+*F$Kn2_V@$19f8N0T_~?pGvVL!iH10?#nv!m2vNJH>_SW|H*3<2W z&CCfgjqAy)ShkNr7N94xEYn>hXU}2ACUHSNBxE-`?8#G-yv`0Cw`u6{*CzDJJbs-F zifmWnu>f~)hKmwdgbyToqby||<4ybJa~s^GcDx!3FWAfPK2&kPj|*~Ef43BqrjT}f zU21czRH%a%!d$w%t|byYWE5YMV-(%)gMVda&U-m^9uz$Rc$!5r6yKwtV=Dd( zwr%7Sjp{t(P4M5yPcf8c-RR|1wskX$FeIRHE zo3fj=auPD`B4p|Ni=^y&-S8Id!gMYFF&e}=wG&(Dkb^q3du zZ$;R(wgXiLheK&}n#wOf6KuH4XSdnL@qMyIH0DFqDD_}GpBjte4< z>v8sWyh3-(e?~5y#Wm)-tN=VN)r+h!;W$i4GKGU!Bp}qoT+)357EFr2>ihUz4JccC z2B6eR034J%1G*r6uTc9H+}olDjFUViCl=6fp>j7Fbe1gDr$WtF-070Fh71aKT7_e} zk@w^tA%}jR>F1ift^^NvuSe$zX{QMVS#yX}SB)l{e<*!y>Gru&Ke>cEjp^n6c9UIcsG6y{VLY*(%Y!_B61E-!Ov8cBeK;jJ`QNXqj zm{%%Ne|GHRg#rajDH>%Lz{JSy`H~OSPMgA!=bR<`HHZB=>+J@+1e|>Utwcc=0U%55 zB0^-4wT(WRWJ}<=LpEw*ln+;L6T>2LWwUc1`hVztwz*j;&NYC?0lq|oNj8xe0EW&~ zb+?lH_bYsi009qp1l%CteMiglJk^JIn>}ryEtbTXwt3O^qk(HJK{$=Y$uhG@hB+*6f~XZ^3L% zyf)Ywap>S6?b`Bh`uGiQ@#7$TUOuqQ`Azyd@%#$e+q%k`y@?^}5Z6Cyp>Pbk0^l=i&B~V+!Z9vTWta>$e>X*< zk$I8TFC?UG;mw-EH+ye)k6#@goV?h3`Rd>m{4}hhfi-mT4Dl2$!c(tV29LdO*TKjs zQX3LIFBkJE3cY3!N!m#80IyK@W+eR%LA|~O9v*@4Y4`hsQi4mAiT8d~j_+)Hx4XG1 zp<$~G=Q*l2{5j^wF9Q6oH7JwJwN%=#PwQSD(~v(~vcQ|Xh-CCSnKQ`qs=6)Zj`8kDNG+n9S@V3^jC&RMdMjREq95rX(TC(CZ8yZh4 zdBWZXJZDt_mHe24m^`j0S!iBYouSv(6wb!_V25lQu3`?_^jhJ;taS=-@~D{W0Pb_D zNgAB{(L96a+Fg6f@G54pfA$dfh9|kZVKiBuD%>G-*M-V9+V|bn3a!gltCoqdTAc<~ zN7ZTyA7n~q`YvB zW-b8Jv<3|!@*}^t-EZqozMkJ_aF*CtJ}}+ zt?6w%VlT%8S1|nb=}F`v1vs>13>+bDjlY{~q^<8;=Z^WilE1H3eRE3vu5?9W zv!4*pOfYpEjJ>D*T%7lK&ZeaV_>rE$@y_E!$x61pf%wS>IUS7$;rqDml#v*ByWHSM zCxqXXJ+4i?@0*%qb!JHGO|4f&!ZaZ7u@$I_lU{z*f9)#pTU>)MBSq||Bt*o~*I%or z$csPEe)MB1gyPYnR8NlFZ?`GE8yfDAd=i+Q!&9^Y!x)Vrq;WZEoLuX5Q$McWR#uV% zVsj9DX6^9UOoJt7l)!Hk`h#cz6dG(ghw^Ip!+-@Y?F<-5{$Nw+&2v}>*(hQdk(iDN z>#R6zy1a>uh9l z4dR{;*^dw|H*ZBJl8tjEuy)*l%a`x-@cZ;{f76@Yt{h1jKm(ITTjQabS!Q}b%%9XI zyWOojGHUj>eFZx*kzi795ywh{ox4+hlCue&d#lnPVKo+Db8Y*=6Th2v6OgyB6A}uy zfL1LdrN$7+I3euESb!nIEh8s#j-o}E4vEE;>bD|kwRUlJVvsj%(JM8KxJs3>QMO(x ze`5g;DAwq-fxZB&9;couofjV{f1OuiUk13StE{CN3XZm`V7Ai&V=jpC03*jM;}bUr zgoRQz3YK&;zYq*fljr^hb%IB#v#DmjIt60c>e*%PkCO0a`%LH9PZV;mU!A`}-&UhG z(bOgZ_6=U?`YJg%G2I&F$_Yjb!2$xSe`LV48E9J$XB~wU%to3^QT|_}=#9n<4vz`l>!Z_0Y?m!N*7|M=mL=u~CK!2WEEo1|6ENGhtOUBeiyYhnS=cG|{An*^B6R2fldf4)HL zrv?^CPFnvYq5h}PF$@3~6=AR&4?Id_gFly)x+_qd)k1?#?xUR2Bs^(GOp=U9?8p`l z6!1c7RQ!^e3d4du+IiC7P6*rbjdBEj!=k_oTatVGqh zw(rhc`8O~#)m{=OuFY)kM6YSEe^}d4E*f|*!e1GC>_AQ`Z!EOHaCd@1-q>@LSxk;n z20a+4OU81w;uH2osRt?aae|pFoFqfwQ~5X6FVK%U?{TWCjT`D_JpG)fJiM(nngYcN zn)4UsHA6qS*x_IE0OM--6=m{i)6F1dTtBHX%oxdg*Lfjcmi+LV$vq}xe^28=n*6^h z=f&g(J@%^Ok~1I%b|npIucoB(4Cq}$(~($GWfnZU1TgV3af>vOOS3GihS4OSoYVWW zf>$C+!E?o{-?*!QbI@>+g1<`9!;5P^f9d3#+I+KN1aN}WQ@jYzhl_Nc&Y<5^@3i}U zE}I3XQ{s@5&ew_Q)oI4{e=iWMox$du3+dVTYN~8Z&NI3l=i2Vw*zDjlc#37`-R`*( zW1hRQ%knTA6TaR#n>NwzYs)hljQRqniaQacxO7(XOL@$xZc-%orV8M1O~7ZKa#U1- z35kM*l+Ro1Pa@56TDy%rO@hgOcjZ2FfpfWW$MEidt-);M{!+Wce*uCkSP9YQ66Ss? zEMU-^cwH>n9l4gNo-_#w-zAFLC4y|33m;ocU}5u?%cI_DJQ(IKIHydp4YxV2ZER`B zHSG2?Du9)f-^C!eQoNDbMS4s|dpknN)zu2cXtgxEo)6AWC<-b zD*FX&OW+uHi%QuVf6cPo8R2dXp5vUqj}&-Md>ZH4*6cGT{CQrzEct{^-^zOzuVf(O zj%L^En`Tn$qs7%U7xX7Q3sekbxoOt&ol)_kn9bs30DfbNZB_JYn&fPKlXKXX(2BX+ zg{YWdOJ16T2)gjH_aaem$a3vulbr<4Ub>E9tXz{gc!)sBf6hygNO{8m*Hjo%HC`a% zcl%lbeygOC&2iIJWcuZ}6GNAlLCBNT(1A8nN*aym-r-(Rx!+Qp4xp7##lcT#H2lRC zvs$r7aoJNCzSbUD-5TUjIg_3z7)i)8SB61?_^je3FE4H0Ag;lNx|>yEwc0SlViMJe z5ez5N?S^t#f1hB{T-i{2`xOS+9GLjsE*sG?=m-RQ;>bFfTQ=l(T>@)8)F#+4R0zOc;lF$lQz> zPa{^|$E=~(_GMasAUln&(`iR_b!^1>jR>YBN*w5JE8CAP-nz7t^6=KR_n0u|ZVmeqz~s6< zFDBDL_BPoPa#0Be!J}0 z64%KPgnM=`tL-BV_KBco)>;2qIA7~=9n1{|I!fAO4>hwyf8qrQVRTe5eMw?O9Rm{k z+g~`CwqJ7E;&(w<8-UI7YO(#d@;MerW}{IFY4x`LJ9r1;9&j3f9oShwxJtL&ArrVvxi?KorhD}Q@_@Ub8Twg z?zGX1I~O?IZrsTbM6%*Aimvaqm15H+s^f5@qp2(>bK_AIEge|HrX z1|B5r9_So$?%_5JXaxgflzHJZkdi=Y$*@Mdx0!n-1%y-16kW>=(rs#h zIKN+*nFL&_NH)ug3QVkZw$3c!OQ+ueXN zgSKE6HjgPP4owT>%$7d4Eo{s`4P=x~CYqHeQi4Yy+ z;@bouUw4H7*Ks;UGeB6le=;^El&NlQ*9Djvy6L*uUWBgmy0HFELSm-X(+**Ppph72 zGOkoZPM140hoyhk|z{r?(srL+5_(-^kTr0fZ?=Iwv{ob$NX< zfKtt&9~5c+*a;P_W&$j9;5Y0b2i=~0PEC{OKO59e`4e_x85}&LxR4u zz!Ep7cV1PCOZw^(aEwmpigm7rG)4Widw8r-I$CpiT&?QTBIPY>p6db~HNv}w5M zY;bMpP&=*&T8_9-e_e(Xb2)CX&^9N>MwWS0b-UhUCPQ3HsDi-x7Y8xJ&dw7u^Ncqkp=F`nasW3MBj(XIXnui>;uN>$b)J?zdwR2Yqo35p zGZSv;XY!sZh3IvCA1r6N5o_fjTr&pYcCnUr=}WJ_wP*FqCfL9j zLy9&%w08&mYRfOdGtp?wFna`OcBE~6#hx3%8s{UOBX`c$w1E#aSHft9Yo`4IRm%b!4oAw9~GKL3dtT*HcFgRPTHW1L88z ztCf2tf2C`%Y20z=#k1RecflUx7Qlx3>sJS_Umfh7=v)rfPeS#4U$ANK==tvJ-M1&l zKfl@Yd_w(Phu{2Z@A>gvxn3O{@4bDw`+V=NjPDM>ckhl&dk63K@2>I9yW^8Eb+-AO zep2)I{(QW5aCArOTQk)f-9dutxs^joT{f4AIZm6nDga5x0;4%dXU2D%~V88?=x zgctCHMy!PAEwF9!q-~h#)Hz?S(c5l;Jq%#4Nl+)RYK3Y+!MYN7%` zG~?BP4j^*;6<}#2)QYONQ^0hGsw<61f2kfvD#sYT!9lLMP`#j62?(g*(uO!l?iZOz zi0PG1OCG*R$VMMfF*UuKD%%7D%u@e)4e~9S$zoz4UZ;ZviKAdX0YyR%Jpt}!vLDi% zV6kbjM!XaM>2e(zF$y@R&%hziNoL)>irv;l@2v1%G5UC`%D6iatIY7(Oe=xt| zR>an(CRS=pU&kw*SBcrFWMRPB53o+&tP}ge&FR*~!2{b_7c*^mZV<<`CAmnJYdOKE zS@iWazj>fFhDUPdo@aa(!#tM((vLx`yIOf^$!ZlszU5aLKPUV&<5wd-9j{in_sO4i zgZQw`EWaXrYWy{8wy&T?X|;p3f1P1G1!6wOs~8M($}fo-gp{AHGk)rH*N0f!*WY}` z@zj41IG;WwdfWP_kEUr+U6mEhgno171Bfzu4Zemr!19(bpX!9rVRoLkD;Y2Is~~LX z8EwP#gjWaUl)8AKp#N2F$hATsXInu~w}tC@X`$8JKm)nDuUu0Oe+uWA%hU|4 zVNuqEuQHBdNbrqQlulEb;935%ov3){OflC*NWpA)&4c?V zt20Ccub*sDAOz5}dXQ)re>l*LJ0E~^PpuM}=@aIQhH8k>UN zP#cTC^kg#S$RC)&n^UF)O{;NT@s@S0mI~NR;pH7cI{7uOaehkpNz=cq=7+@htR^yM zj>}~-YTTUg% zHewY`5Sy~2EIU@K2%v&F=9}fke8H(3|BdhaLC1CUGquhD*^0r~8~iysV)y%FNWvdZ zNrw)5s0&gc!&|9KRJ33SRolU#j1mdy+c$n^qph(_+E$;@QGe`U>hWFghNvC(WCy)& zIa7q<8)r-(4U(a;e|}6-+y(qPa!HkcZcGa$c!vTI_FA;8zFvb0)J6@+20xJMV8i)6ch$p~d9*e5_XX+F1`Ccp04`wp@?mXTL0SfRTS z;jUieMDC}`gL*W^2}_e9{~1Rz<=<$ac1y)8-vSR1a0tKdx%Vjkf{Z8;P~7jByW8b& zFyCQp5VvfJFJy_--zT;RtxavbjZm|8A)Xi0ml51~e;ij;ovlC4*t%A-6Da_jYd1}` z$~HD)>ThkJh4m7oWtvma8#zza((IEBEV|p}zj}_^{4G}a5_;)pH~m+e{*9ad(m#px z;G)|tBHU{!63_TvY%+k!^46gEk_|RDi$uhHRE#|-F#lPN<8e$IGem%-<2Z)hE73mS zvOxp1f0p#RLRnDy-J?oTCMoE{Rm;*`vV(ddY6i1z7rV_N{+qjr-|(pSvne6amV^P3 zk&tO)MF_%oHERW)Qu}b{HBJfC+xp%~U0>U%zw<}YYvw@SH8eMy5J{GTKj0UNz%Tj7 zZddOg=nmODd|gN+T$#&St5B7OU=&Vjb3a2wf2}WcEFE{VjInREG^;idoXWqD4Hjm? zTF%w4+%{Wvl2gd)ULpUxO{C zI=bMe>>0TKI~(;+4ajA%3q>?k!|2-FIx}zX>c&vsfFKk$@Jf-HqmG+n6P;t4odr{j ze;>h1&%-ri2oGWeY-;;*?wrOvTR8V>Ll&&e69usTEn&%!rIGHaXu$W{Vxt!! zjwsI5=0=T)kB%DC{>1oyx+Qr-0_cBdKnGy>0fl(AilxXrC(=WOzeW{fX(x9k>~B&A z7(jz7q=r4$=&2QY)+#PMuIY5-okmVKOQ02hXsTcgwP8KKcBH_oRm^|8UGI)Ee+fAl zziF-wJTdHCC|$%awI&p#q2563%&h{MU2aX_mB#&I;o&Y>ZqiqO)r6KgiC}AQ_3URx zhO(~7E&INN6CoCG6ZoFqWTk#^$F7Wv@Js>QNNf&#TB+ZGQLk<-Ku#7YVqu>C-`>8x zzinG-^Q%bOvnshk6g$0~Q|e{4e`zi~Ns}gx-K&n)FGWEXYMN9)(vEBCyYFuXcMz1F zbGrLS8;b-%5SPJV=9y;#m9z&du@_FtNH&pG@>#bgclq>HnlR#Kfyv~_`d4jad1d>f zEZOm+rMAEF@@O@?9e<_B5s^>dQ0cGeHsQYr`Dn?)W1JvRDWIe3!>19^e}C8&f~45g zbMz_oWKEOhn_xYULunDzUlxu@5T5%E&To!{`Uv#Rke4MRO?ZJ~LsxVwCL{)ne~wL& z0?Hx@E8}UYPh8c(50lvvG*LjE@?Y&e81ubHaQyu-s`34hb;hLones_h0)SG)@uhvF zi5^*^y|DLFl|IJmYpx*3`@V-#J$9*&20Xd z*q{DPegzz*L{KRwmu&hGrWL-b#J&lbYN;v^Al+7S#qD~~&YMq{C;JgO0alk``w=Pu zN|%iL5ljIZm)ZLfq5_|$w|)E(cLIN(@+n09Nx~_eO-VE)XsfSqE9?!snMQ$r)sy1f z@=$!~pc5d#sKp-9`=14di)uv~jHYZh-Qhg>_>78iMVJZ8^Atjl^$7NQL%5_{55l}@TF%JInrqVqVU z60(+paisN7ri-ba$cfG5tlsNPK+ICSn5%W^tTh;m1B2)n5HD9;sRBF54s|vd^@W~Z z#Z#uXkll_sX9(vB<_|WIJd)bV^Ao8lsx*H+h3oPqMsP`HtD8Oqj(z-eBGJRyfV#CG z&Jq)-$7Aob8}Dwi9s!-w65Vy=6+$bI^+_fY+xkqm2xQ3iBj^4ewEK+8s)RsWA#F$O zysS8`UW^Ye3jCAsbXdN%0>t@vEW*LECPSP7Py}(DNsQhZXU&>V!AurFLkS<~X8eCc z_!}x?6SphLZT@8)3u15<6lGyil(Uo#W1I>gmeZ6DIE@1M4p<=G)b#iEi=_Sn58Kg z?h>*T`pUQ;R4YfnC+>_I`obS7-KeP4Cm*4#y`v=<3X#~4){(N~LwEc*p?`lw0^uSV z5eHIgL(-svDrW1f2GXK64)Z8Z^rOdLbbKy>R|a5|&IG>iLC$+h;?_OE+=}7uCbdH8 zpoS>~i`D1c_q5(tWsS~iE3E-TXopUmr7k&%Lg$M_2#5^Gci+1u3nNJK@mPomQ9X)> zN^o?_j3;E1Qim{dYu>Y&MV@~}$IEjndZEXzV;?_!QpsdPAo0AVC6P<>-lchOdC&Kj z>b(k-Ct5XexID}!I2emaIhDBd;6$>t8&!cy~1EGI>_q=lxN zVCyKv0a(wwbtAc+>&DNmFs4;Ft?v!Mg8DxV_$ z%eae_=}=H^JqpS#8NHF!)`Pm;f`fekg$JM6kA60&_~0}3;AaDCLJR~MW<434Zs5$a{4K5B?4w#6UPLt zAAC`9*z5q8%k+szJ5?eMK#!p!44Z#W9xE1@`4|4i6vQ+`4dg0bC}IM&AE`{P03(k{rs;o$_=W0JV-}1ua%+@> zgc9una%;EgX}83Z2FaxcOkNR3-X;}M8L@~fBa(BqD|FMWNX!!8X8IH8D%`@GXal2X z6qgs0)I8#($0~CbliTiY0VzNTBY=tZawe5;BOrDV5-&~DOG&YVwtycd`IG3@^?a32 zFi+Jq2hXmRgp_~eD%Ut@6jPt-8ll{ZM7ZmgZo$Kzwow^_6+x@;m*a8y7Lz7P^R1NB zHQ6`=E(xvOp_T{K@~;^4WZfD3z%H5;#NB|CmPj^g;{wTMRJv%0yQ?Ovz&tvXbc@Ef zo6r>V>?Ffuu)Qi{$!^yOSV1R)R_};5xXLzC()b?)?vQ_AGs>vJJdB_e0Ra@urdg9% zGt2R^HWCaGFZNxGPmLLYqMOo_Q8S$*!!)!d}e~&nERF7Ej zQ~nh37>o#rtW+iunL`-<_i~kt-oJf&diLh0(KzyeZ_ygIG$wnk6sQdTk&+j{z1i@LI1Zbr772|0uw}{>o3jm#DcXpicq)saUGURu7^0&Xx6fn|p;}kY#_mRTeR}j<%MCYAKp_nHJH~?1VB= zA}9KzlGS)jKaW;gJr=hNHh!~@rgOU z6<1us6)|-1mn$7bX;<_pIGAIKwkuRgE79KI2)hhc?LpSNYhg<@vB~;CRHwt{Z@BQ~ z5)~3SI*_i=j!HPLGHsT=YlW8o&zEQk5>5f1x3>urBmn{Im)r^xkO(b-RDxlq{9KoG z3lc7Wp(E6tGv|TSjR918$9k&zTujryz=CVn<5(-zn~wh;GU6)vB~~4l#I;90)33kg z+17f6u*t$}v%%>6LopgO+4G3}TZ5YySW;TGddzVxnp#@o*lj&+ul>@Uf zoDUDyd;E2{1$Hu5GO~aDJMVRBdwgVjjAVX)FG7Pk;teI5Nd?w1jd=4b04b0;LIQr( z2M>BGGwAYOav0YW``|&iB4g*iqhTEvZl`U!6JC~{9z-o*pk2cDJknm1?BTaqb=+Ss z5%9k#z?9FsO%Fq_Z&$3&Grp2!O~TspDV|e&(E!z|euwEGDywFo&WM=)1svdme3P+% zGPd2RkB{we8rBoE*)gBYXb5ehjQLdcQ%vsZA_%&#iF076!@IHzhi0_CC$w^uVc^@y z=7a?30M~yp6E_!%wFH$S%n>yb($hW?smQzGahy=W;w)HfJ>5XrlAs)H?{6n{EZ_7& zptqTcM!V|}z*PKS)3JV`fl#Po96r4pj+8;rA9N8XK(N;vqw76W~&B;z%c(J1aohuB~=F?k%5(LnA+LVUTVnt@3gj<%dZ21^oR<2o81 zrzlJRT`{3l+|tUcp_J=Roe`bk5=yjif9dumH_MU-k@wu-mL(D>ib-UrdK4kx9y}lN z+?K+Y#Fb$SLnX}wX0b+Q3pV?Hccv47{b?~Ms&`cMn@VsRjE(E;(iv~0@_S-|`1?bB z)Dq+#bcK14lFR|$R2ExZZNMfK;OMGp={xO9OEPBx?|TVi(#wu*+nmGBUI2{Hf7m@V zXYs9r;FmDs43mgA3jU5JY(?>;9HLpkJ$3Taw zjQ=nx>KMp{!3MtD)yn>TyPpc5a)n{ku4yJy2y>9oQ7eWxuL^VfV?)atCjY$oVe;E| ziVyh41**@NDCx9~`zOh8de~{k?>`;=7)Y4+w8jfN}F?bqv=Ng9eYI|*m7DFdu zEG?(5nA%i;UIW@T45u4>V(hdnm?OgK>jCZfKT?bP^x=Ce;KDW@Ue?yVJArv#5+$YH zC?ihfiI-Tanr>-biPsRnJ328T7Sd7$Qkg5!Jv3#FxYSX6U6u83{f{OY=GUVWS7FjXZdb5yyyGnCB z7S=L925?H}QV(5;uGpmIe@7rY1{-sfr7JAIiKU%cWcVvTMDubR6=WSR;^_)2*pMvU z#$-EL(lsnKXt6a*R%&iTh`lmlXP}gjQjmV?$d^cgHN>2fI*A7P9ebW9 zE7nDI5j0jJ#fDyUe^Ha5Dx|CJjdzJjyC>b;#X^~Ra}s0D;zNKXsn~S86VBmQU%_Fc z*Hvf+_-?1+Q#cIO%`dFkz^PC<4Rdih@CNUJ@C*k^PHzJctX;OTMyY(>G?rU|3s&tY zz7?@Oy~M=osohyIWqP1(V^k$Y>cGRv+Nk5j3^41SH9?$uf7XoG%_u2=Bh%6IH|Ft` zc-*?HA>b>7=X4FnO9PkRj>lVanKp+UAmrSXzZ{P*$yM6u6?|h_as}s#D{`H>>?N@2 zDDH*Il54etVO%>H#t?L9Ne;9zIoGoD29EoV0(NaPYe*PfX3gPmZ^Ub(mRyrk13j&S z=(RmOXhf)5f1Xp5K>*kiI}`++OM-?7HoF(5x@eTG8_FNz8%C08<9R@5%6gSZb9nGd z2y>j>7tf=Z9AswTDlVA{mN;+4T&oq+Ihk;^-`?wNBI_a6*pO>AtK^yGtd|HCawUlo zfUS|G!=tIrpKy|%Mb~yXIZIEFZ{f9wWRtBtQ8ic$e^wH{Al~|%JdY9g10o2CV?`AS z>jYriMw>&2cni;kM|o-2!DGCE)nll$(03osvP)1 zTTd{163E_MvO3*X9}-GbfNNqIV#?UWGw&4=tuU{Z%7T2m&^wk0V3EK#)P4>0csvFm zRRFS7f0L?2PlG}z^=U#fxZei$@~>gHlQ%+i100o$7Cu<6H?EC6GHpf+G5$ty3=P?{ zW1~VSGaHW!X_$meSbKR&X+ehLW$g)uj^(CfOM)CajQ}H(T-q`7p5c*OBaHh8Gz+PU za5f=3jQA|j+$$B)&J4rJ)I`lzsTG;N=V==;e^P;6wFSy=u-^d9SIRmc%hks+K;@Ma zR<7vBx9hMO`kVAf`JTd&ceOK9I!Nw1CPkl?q9lBej*JTwtl&Z>fh)nbqPbglje9Cy z!9Zhqx%IZ_Jh=51*4DYcW7}Q%#AZ|Ko8~>?%;FHtIP=xfy*j&v@{_572HT7kLMeL7 ze^sy!@~&x(OM!cb(yYGQ$Md^%^k>Mf0xf{$$1+m;D6ear5jjK&5n|8Z6hS700pU@ z9Vd^;Wr&zDa8!*bS=u+s5OH%RIqP+T;U3vUako#f4mS*zt)sgdiTlSVHB-;j`&4g4 zoOlhn|9jMl;9y@Y_WLmYH7L*kyBD$mcOYVvSm-lCeLO=5&37ozjEC27IiW1s=2^%z z2gL#NqQ@DKgop(8iW`>k^z7`Ke=fIKesLxNV`pd4@fSzOk7L3ZgmSU$F2V{Y`xR}_ zeE(FEH`O}ByMeIS_jGpNmNSvyiBn9KlNEyHVneeP|c=|KSu|)^d|Yn?aDE!!{l4c3>jtPa3aSe zVL(`uP3Ywo5?;n+m`O`te-}=4S`84An-%O&I(Pz@wrU`buLQ7&E;un8d?o|9w~{kO zArqx1dmsj8GWZwl*Mm#IDzOsO1<}WYZ9yT3_=?r6Nd}vy+1AOUN9WZf!&gsM^y*Rm zXjSF4jZ*sBq8SB)?sJ>rBU7AvHH?SU7Zndgz1!vA9QBfUY=Vp+f7=6$AZirTE0T}L zcThQo+XTFTxvb6t{CdA9OIEIIYQhhu)Q4aJNkn1&-6>*(K2jHES#e&`JkQyAaj{-re=f`Q@e=QbUT?!bR=Sx z^ugi0lj-Qje+JVjm=@LsXG%%lW3p?22uidtBChaA0s@6}B~P*;a-RhD7Edp@g`FU| zCh}90vpq3i=?8z1@P?FJ63ca+tY;42>PmM0Kdb8E=@P69?v?0P1Y==lCw%Lz)Tfk_ zSoV?|!xY6t!8$ty9lWQ=Jqaf?aACZ)nGLY<3hF{Xe>ObJn`j6pIL(24FJhz4fCj<4 zJpmWCho;wefeK=DL>QmEl3c9)eh#gd2KNLADn0eMQKaEZmor_)0p_*A$v>pI78t*{roPk(-^4)_a z&9ksHSPsyFPU2lKevET)FXQE;0qJuH^ffdSNN6KFx;3;P;j zKIX4&$Jv?KOkrz%QE{dCbfIwW9_(lOJv)<#==a%mFrV($oRCO&7HP%5hXy?yBHkNT ze@@+AFcyTU6XJ4=d^bJyxEbmKMv9)O(gE^yAE>w=`rQTPg+h4#fA!AM{d*^1rn#$k z-0#Hj`OZ9WjYVFr@Xl~Zx&q?plOf|$@akmEiiYwa?;@L)k(ULgm)8$<7`?Jntic-Q^9e;pbX3bDHL1>s=qYkJ~7WKaR1FAPo8`GfzN-_XQccfpREkXg860IH`63f0SZp zwd}-x+^-h9U?^-aP)i>K+9@7&8)V?rFWhteT@Cb#hd$PWkE&|mYIhFcWva~gRgY=j zM98T3KdbVT{~pmN!E^00oG*eH4wg>1p#_tJ4F?Y+_&E5v5Ui}|v(8TAh?4n;twv-7cSZ}Brb2{axsXmSe;Br2t{{<@ z)5VImGTgKSrxd?+R(G(}?GTdnww;VrLF-R==00DQ9U2~lYpIX!|4hT(*E7RKypn@* zvxBT;q^^CUMP$CEcZg^fHseWD+Q-TRvks9b455-3fE8%+;i>-#t+tMrcQ#y?{iL?z zzT@u8dgB2^A|k?N2m$hne_(a z!akbg08^7xm93ntu2#-)0e@ZL+CF0|8D#Hn@POtKG+7t)Mzknppn=a=5wTc>bKRb? zRl@cOu1L`T5&GPC^2E$9b6H|cx1O(e8v+mo|{YdPPR#< zU<9O-XmY|xIevlk-pWkRn&Ct#T5f9Eib8kd}qdodMGLc}M8T?9@=>|{^a$8h=6g9()lpOw(E!Q>7nUMh20 z@v7abJSoWG+Y5dW`c{3Q03aiJ?}Fw4gq=S_hVDKVHP(Vv9tU(*3iOs-T1}ilez181 zynl)_2S9Z}bzWA0urX0VoOIv_R57$wK)T7n*X*?`epaBvGk=TsG&cycn(3!BQq}1w3$cpADHk<5#xkKd* zRg)H&R657^ZYPV~J)(9b?)EvL$Y&$|kG7r#Dadc^y@@ ze^!d=j_Y}|fCd;`=bSEfJMK=(-A;Zr+=Ymo+NuclXb9c1E-6g!f$3T<0BP@3Bi~`y z?Q~3ikad}>r3e{!qmp1q-~JBMO^5y1k(03_)kAw=29VtfP;7O2E4Zo?c0ykM@bi<` zFP}YuUmppp^-h$~XT;i=5`U*6a{Ei{f4z|4Q4@Aqix?ev3pDGX>1S0kMAmexskM^^ zBm5G++u?qj@+95#Vq4d?+xkRrD~_sO$H&%+hhYs7WfwDcl3?_UP#%i7FOLc&J2xMe6a0)9`a+8rvU8fC=5Zo^e?*kD z;7ywXuNM0VT8TAz;ARrxtrJ-BDmNs7xQhaSi}QAou3+?!NRh7KM5I4@JdP^xtHUzM zV%w%5#0v%EN+oGeLb6}(4f3T6Jf3Rxi>+WVyW8}Ht&o*YMY@a7V>rW8i=UoOpve+Y;*O+{e?wtDmDR{S z9a|O&@mm57n5hvixN3zMT<^uZoio^F!13Kd&2hRdvRsO-J6u?{n_Q8He<<}d68=S> zH|;&1B2FNJGMI-?^)Wr9&|!}#*Cf!sNox|CMb6INJU@Ms-ePOT>wpNju6QF@DSZn! zes7<9*^_TZtM0bGMAB*f0m7`N<^;xSQrqYQt?U?_#bvO|-X&GRAEgBahfN+j0*(;& zhwJC$*ftpxi7>lo)ej$fxAe5p z3WZmIH0o@0)b%f_Id%`fuB7>N6)XE)rt8r?N@!>m`zHl6%W0f+YVM!eftS%key8s8 zbC(z?{Y4pa^>efAN@1}q;Hh1Y z;6vhasm8a;BFyAMb9;0evy{mmo$^EK9J3f73~PZG^Xz^>+EJHn$qu@@KB+dT(ckGJ zsM>W8v%^wv=gJ%)rdc#E!Q~R>*_B7BW-gCX3rt|_*t(o?2@6muVCKzYsvm{Tf+Kfq ziJSv_7w3bY=4S)Be-Mle-_zcV)?(+mpf_)_3-ExWHXvL989zt&Y^^;LZw^|iTpyxk zHIj!UWv&wQLEEdWJlY61lE&jG=u5XtbauT}YQJvAe~IG6RIa{JuwZPh6+hJ*g zXaXOtD}GL!Q8GfdP~O~(Vn1oOd{obc2c!QndSF|mpU97YCfSP}%SU4?p!;EW+wJjS zS&4s?{KULJj@y7R6UWDQJC39UHKi-T`e{5~7&gk@L@ZXmFHKNZH|?dMXk$;KDkg9R zj{>KhQFjJFe-6D$YfM>8svaMci^X}J-8cXh-=&Bx&;=z7qUmrddet~}xaG}prf)4< zpV+&Qn?0!dbOQTJ+Uz5Cy4ywU6clY~;(6UWcmy4g>WJVBg&9ufjYT$LtF$4RTJ|N$ zL}%ZmoMh5=%?O8{&;GrhFJ0$AB;*V!t%K8j`raqCf3X*<^?>Cbp{X>rvehi=T7_Iu ze@N@p{)a{%`dC`pXR{ffabc3WOQ$U3TTMa1!Cb{)zXC1RJwl?FC~Eo-mX0>X!fy&y z8Yhjto0Bp|eg&&LQPWCFvpQra5_5RD@kZ=E2J^1zT#la6oMOkM-rPsKaBN1ZMqit1 zx-K()f4*$uS${H~0}76{zM41|G#__~1Er5qyR}oQ{)oZEtMoC87Dd)1NW38JqAM}j zX-wGD143QbWtu#CUN)=|QDu`85QZbt*Z|(W65oxxYKZ);g!qoZNY)_?gfbFvWL&3E@_CqNE)`8aH_Vt1YWLbD6-y}rq|N*k=o zH9JqWzn_v@2SgwuHmpk>3;{v{tgIVVsgMDJ%(c7_x9CTjw+%h9Is{;vzSJ!RH9}8M zf3Ot$cgp6UFVZ2Oip>wKJfZsI$(GU!Id4kBv{=YyyiW>bCgq)c{UlpmvL?!;UIcx0l(+#2N=n^`dXGk0sI^P+1$2d4 zj6ZTp+x=RRov?;9_lLWT+=x=v3TGtRN7En zc~B6GLaYVH5YA^F5 zUuDwTgyn=t0o;tdti+ApW=w}5#f%=S(X*^PFTkVDRr?_PS>855IZR>YBwfrX-b-e? z%3AtuYT8WlR5k3dTd9C}rnU6b8{KMUaX%W>)t<*|X-IE~avYV5l$vP_%Uorc-`nfM zQZ>fojw3Z6kB6_3MxR0MJ%c~RSv-^T=7F9!3eYtee?9Pkr%WXhigD-? z4Gdhyvt_!9%05Lwb`GFW;AgUQrLQ66tM)Oubbyj4w3!LkQXs&0-*R9NxJ&+fEuhcv z8#*nClgi)Puob0Ts@trtqh)NNHg&m7^5XrIfA8J^jnB!u_s^d^>t&t#p&F=dWgwG6g{DDlQ9ykePtSok+U0Jk zqjQqSeCnl_s#)B0F(z-qaPTSENsbuK43?M@$a7)Q80zTnpOD!$r z66Zc%u*08gj>81%ZqIsveh>75r=eyQ(NceC{k zFhsB#Y?vc0RSpeT*>!7|GmOBR)Z2n}Q|!g@C{5-#+;=PNlH)u(X~ANio1M zZbi-f&C3EHjs@%&Wt9-+2qgxiZH}(vaf3NZtdbTYnb7&sA{N5$7x+oocOh;gLuqej zaaTDKe?vAI#h@FB#IF*I1Lbw+2uh*;{ED$Xd961?bdyfQZAAf1G`P|Z2lACIoZDtl z|9NOo!8T-uRQw7KXsP!$D;W;t)U;4ll|K!G0}8(IqXj;iZ!-R*iH=Z#8U1g}TZ#gT zBSUiY4j7U-I3y?r``58fxihH?mec4M^6uCrf6(yWlLSo548X7MAwx<%9@F2W+OqAn z<1zasY6;aZQ1+TVwDE7UjRHSuS|JahYPvC!%ccT&VqDr|55v)XrU=?R+6fx98_`F&yQpk-srD>^wP?<4z?a3YD=TCp8imeJ_ z32V#Q3_mqd2JOkUYe!i{?9Zq;oJ3qRZy2>_&K?|tJ1)}CtD$xt zwgDcZ`PN5&=LWGsc!jz7il~p3xOFJ?o-tFwzXbkvKSb)y(PmCWyZfbMewXm3) zeWj84R8&iLJ1Vl>_A$3xD0J(wq_UzduulDRx9dPO*^zLwNb!lb8i1!By+y#@D|zgv=5_w7b?>Cs!Kje zsG2|~ZpBWE7eMi-t+j_2e`^b-&B=VEpC6Ht{q%^8{AU5n&2Y+v1q7Tzv*3L#BA`eW zEaC_WD5eh}Mo5zqwq*TtUM__8Py^V;zMRhMMVJP|Os+d4qTHz{*e=ZR4e@xm*VX1= zS&6z7xS}TpXeeX!e-%VV&5XTDr&x^5*au@cm)9^7N&%mjA~6zl z0X&zNF%nM%>G|`Im+CPR=>a#F)G`tv0aBOsG7`iSj9PgZYSMPMOfH^j@2IxA#L0}ua6Ke+8 z?(`#{o7s@3HP zR0)ofHEoQWcRV)1hSiG5mk^TU zr1$$m?W7iGp+S9^EamQA(0I^Kmfp1=2{$hrk1-Zb#~VnPEWDOo!wU@#N+6#kT(yje z0ODU`S==T%Wl5<*21=`}U2ngcxzzhdX;1CXT`_Kdyz`A#J4^BT>ms|VxBxm^eEhh# z%Ud$TI)K8EV*hPf+z5RHvt3foDZ=??G&#UMYo1LSq8>xmU&6#D|3!bWH++iaOreG# znsOD_tx@M`8FEFSls~Qf@Pn>BQpX;sC}A`|3JW-D8Fr{aV|Eb8R{A*NU`7Y}$b(S; zt%(4CD8j{rQJ)g1x}jwfa#Z2`NrFziT>G}+NOS z5{NhDdrdBE5r_cTtMvg9RJFwlvwbPYm4bo@jrwscmQ?z?mo+yMasjuOs5cT|f4+*4 z>)SFuZDTZ!QmSol`R`H{vdZH;+GIvc0o>wTL2qO`k zB&E5{Rd*<(9O!J$3Pf5p2VbOVSxW7stQ`+5M0T&0HBVUA*F^?mTllXcMmWhx9v?8m z0J4eC>90{43%WXK9w#=;NgAjQX_B7hmWEz-4<}`xZr5a_x zf8nB@QO_72!*MX7WD}F6N@-jAB7r`OU_P{`enRrdBQBL2wLuK?M_H~!^ITA2`ml20?(kGU`<8M;!6_xP;O_RDa-fg7T z8B43z_&!dwzW56G**u0dN8pFLMxU;c;hnxhcz5Y+w~F#u>DO6sbFUPekY(kwPD?e> zW=j=<1=lR0Mp`Y>;%Pp)Vl`{%YPXB@-$*zc3W?I+RSA}=Ra6nn>ZDnTo!5cQNxcw% zmGGz@kMr0xrv+ACLnxf{l{s9|Jxds_#EP)bqmtBswKg$wYlxA9 zt_#J;t)U10;uyKACr0ic@pKI;o*yHBw}vQYr<2BG8m+zXV)JEta1)8(7|*P0oktE> zbd@WU>JyDf(V%QO6#=bwXxWj3PSFURq5k7v0C zi6@TEoC7y^Pu559tW)DI1peD{UCjbAtYhm(1`1IgJ_b3CmC3eC7gT}T2J}RNB=9SM z*c;o|m#*XLGTUlj2zqb@4Xo&Y7xtCtiQUdI8vr*fW@xcd=Ks)vZpgy5+YKQf$=6Y1 zWpO|g170t}fh}c>aEJw2R z7V3a~E!!q+Z?TV8I;>7qiRa}w?w`PAd@GF)sBMVO(I@m087>?W+bReu5%KD z;(m3(Gq?L#Z^jz=>CuOllWPgPlTw}-jDgA@i*rOD(@K9N)A~8%DSr%wKR&J6vPmKC zN`?xtErjHiHt|b39F_q-7>n3ckjefS-3kwRNjgzRWnXv(al&~_Ip;F50hp$YeH9fU zRx;!Sznc~jN``sHMUpW5pi^XmjczsHltXUrkqp|WF>{@Woq;Lh6FQgD_FSi!C z^LxXp7Il9(S>5}05VN8-`X0?i3TE!}T}@5FU%-_j*b3Mel2g;GMcjO+23UkbS;T~P z(3OC=br|CAB9IFZ8Cp+BHm`*0NGbpe;WcdotT7KHm!`AJ>}E;758u1Jg>G6m z$Gq-@2M+|eUTi|d7f22a!pR)BU$YW4$y=FKL)Ng{$qev%G0Vt6cX87?ioI3_@|eS# z)QL_Y)ifsJglsqtM7>GxKLXSKPuHn^y4iorC2+O=>%SVNT<`Mx|2sGPlec$gEhgV~ z<`~NMp5PfL`?u%_JZtZE{7C3j#JMMY6=2)Ayre6ZHA(;l_7f;*vy19VG{g6JJZzlT zj>r5M6s#sx-$djl0AGp6XPrBrSAG<-HHxQJ1`l6G=aJ!Jhjv(V29e9YPB9B>B2It7 zm#8*34B^}18!Fbqnm>k&6-mZ@dFtimu`^5FC8H(0fp%oHpPlE^D#fQewFV-@g^kTg zk1C9}9a-O#EY)yK1y1UXKM(v=UcxVlQYj#?jHIIJfyK&JiM`_X@&2%g_U4&R;$^tw z|7t;n^XEPbTWV?0jFgF;101jJr%WF_&?j3M|EPbIN4m}l zEOu6D%EA0==B}wkR*;cS6%YxLYa6RV+;pUExN8rrNw*J@z}(E$PBlCRhZgDJ5wclu zm;>`hXPU?$*&{B}Y}Q&iIg&OCyrAlvNq0=mDn>6(F0B61U)MLpLR6Vt3vgM*d;ooZ z39r^0G%2z7a=AI@he?e>;y{09_Yk=~g5N?rd)}6Eu!^1XtgN$8%#1D6aK%NpVpS!S zSjRc3qr*b?k5>)U4KGoKpkS&x>&Wg%mY@~MLo_zXgj@chPGda})iSO0U1b_b)m^KtW zxx(X9YI0b`C=R|aWvPhFXQlYKNFf4*Y&^YnjfA&Pwp(6Z(O1>-9j~@kofRirn!n3# ziYi+r^HKQzNt*-AW<-BRud3yf0uJ&w&oQ6Ra{#-I$moZvc~Q0HO8j1sZ#i3?Q&X?_ z9Vqw|&csD;dxE!3b2_zcGFDno!_QDLM9e;U_wuy5pmurZx_QmZa@#ieaIK&AztFy_ zo>XO@o;>-U-dJVvx7&kuN&op5l&6}E6M1DmFGp^In@{#c&`nws^#Hz*#doRnYtYC;24&ClwP@L%+`LCkhbp>vJ^mE3uio|S&+lIZo)uRQJj-e@ zWQUh~;O4=afLr=iwZtnX&<-Qw_hv$6CGt9P91fi8JLv!>;=Hjk()cr(=F_SJttjo;Dcqt8;MPny1V) zC{t9+tax3Wzou8TFooRfqXlu+@2hGVc%QZTJ4MyS@FVZr(kcDEEyD#tp#TM?sPc<{ zqSXz)pK`c9BI5cct2b!6RTrzOsT-bc{9;t`TYy|*DrLrsj3V0 ztKt{yqPoVP3j$DZ(>w4h&^Pb0b5??a>T7XoF2RR`q_%#$)A32uKq8pl`_>IHLhc3Y z7c^1-T#)w^9N@i5V`sI6ikppDEXD(mhZn23Y^r}bp-tbkca@+{L8p%3+OjXZr76E+ zIjvPy^?{dm%9@(QQN-6S{Eo0o`On_D%^y|-4_0#MUH|?I{93*FAz&@8v<+9<`=I}Z zcUfIuSA5miX1A1i+TY;)X1H7ZV!xjjv>9Y9&17Q145&IJaJr~+1P4tj&dwPyOv+dT zu#|srmKgM2mXXn;50a`j=M>HFSy3k=37Q*07@dT$WE#RkuLoHfc?ZvodAO7g&c!pb z$g>-oy)EWfX||W>Hwlt|E+Vd;wU|~49|S-dK-iWPkVyi%G{|yZ)iv<`v63jHngY_X zTHxo9U7^xB7DPJ|I}eR`z#+azM}jiIFpPiM*~g?{m>PpJer(__tS+KmQPcX8s*EdDF7f4ZWoAcy%zv y03UPPz|Z8>gm){-a-vvIh-xla!Q_32VTwlJyF`#z3?PRnp8j96QPU>yNmh>YXs&$^FH zYfk*@r%z350pHW3&U4e6;Qi5Y_laqNJO2Ffvu7RCnh~?U^SEn54%v9xJqEk|7CiCp z(@xj4R`{%QbYxnWB(QLNbZmcGukrrrj7$W}-yO zC}ehx&CChxvo~XhQK4h2(Eu53UCBMI^7sGbid7^GLL>1fF_)tNv zn*t;n8pbqaWT;RB#kx5+3+P8DNg3x+`&@#t6I$OGRA!KZ3^J9oHq5nQT4(nCmk)P? z4+Y+-@H`!1+c{iiy|Sy<2yu%L!v3~RGXI09J==Mw5!Vy>8e@MYIo(=(sG_PWYYR70o?vQxu#YOj z?#1r4*R>K7_%4GfBo;(F)n3tsXmFbEDq~dJrGlbSH73c z>sEa(R07@v>njeAt$*yCmhYAsb^rSb8A?s8pX^=uAdh*Q?R#J=>1-`6 z#8n5bG_^Oz?t!7>CHSw5-p(9$58ypRpendyY>Fls4|Gq7R=u+_f3oLy?$ZzM@Rbu` zV^p?w^X*-Zk`oLMJ%?6g7qA+LSy}(hCUQ}NB%{)XxZb%l%|v#l$msSxxPT_JUjoIh zM9_cA(i?joi)>3t&`Sbv-!B_LXBECIQ&=bCrdXRxGUdC3smKKACe+zTT z55BeaS9{kM32I!tibV1%2Shg_+DcmPZ@ySb`D$%_Z~vRovFLw^Ao;bFD=Aue0}Bgu zXqE)K{<1^UP`4kQuZ9@bCuFO=Rc}Vk zdW(T1pgx@v1o!JkeIA6gP+4MK;8JRa+o)UA5UA2i#&jjMzHmHnm|OLxGwzc*^{+-; zl7z`C@pE}e%tZFnPw`E0qkua*Yf}SYl#`&kQXBqO{@e|G5oNzp+9(hImA+y5sz!ff zFBcO0UhyFR3O)L`4ikrqWd<|hw*jOYEZ_dsfSO3?s}<9%>9?tCteDhJE}DLuyU0rI zuSUXk#9b!@R7FV|RSm@?zNr&qViMn6_+R}9I#KA_asn+PM%r{tzQ1XtE&DG zB4*Puty21BGdB6ojImVdc>vYGnN5FaPulw@QL^|Z<3?#MD5l-Wu@&{f{h?TAk{Yhb z^>IzB5+9gcZo$U+H-r1hqTT^viE018?F7It{`Qx@{D16yYkS)^mhk8IU&!39L#|;) z@;y{otz$c_+c-{br)leY{J;`qqme+BgzUJI{`>o!1AqicNLDiK?9S|bu|l?%e!?C5h-xjh+c}0I!yQK}rU6dj)#2&M8S6^$bU77+ z$4=!rQcVPwRe?EW?|n)ppCW%r9wR}p^C%^%>xdJXj3PmB4@Pn=C2D&`d`%Eo?npwu z(qdLW6v`RZ{Nz)_$YUgR%fhsrDzQ0Zb2u-iN%5SH#e;1ukMmM>yiKvz2cIE9RG?}T z$qqDV1*2(S*(Sh$opArjw>}O^R#~Oq7||;Shqyj)2-~G*UVE>mP$qvN@|V!~9B#ty zzBH~1$jpv%0xsWVY^LsWCg&|kAw~EO?(+A_dUc{86Xk*BU_6nq?_X$D%x_hjl&HwB zxC)9IQpSaVP}c={@hUUV~%8a)r2Z2-Oi;N_3@|*zH?RU9hbYcMJ8@^*W>B6b+$p1X3!@Odey*M&6P1Gm!h-}Eh7^7#l{*DaNEN+l%_mqcn?HQJ`gf$R4aVnON9G)2 zj6UlqvikY+4yb@L2S9636&)1rl=21gr(+m(1HZCad>fr*hIvBwSy{EQNm&Y8(OK=5>SuJ3N8bMKfCH zcn-re6eF3l-l-NujJF3&Hdqofsy@#g@)hK+QAknJrxhCg>Y5O)g0L%=ui2(A(>4X8 zKVV)9Hk@9yA#CxAQkS?Rbz1%DF_`!aYMP+-3oKI%9f;2!Cp7PhJ_o^ggpTe-(wTz9 zIA+S7pLKshGrqm^VmBacfckLOwd54ccE!@fQrn8jq!Jie5ku@ik`Se8hW+(o)>r+Z zS-?(f=S4u+$Z>wzUHD5_=!f)pZ(=r5-w$J~asD{GNe1fWZOn%1<$cXWgRsY#-B&{D z6ZQaw#(IOW>zLhk*lk{NL2n}kcncCo7W4IJ@E(7=2I#U&c727>HSm|-n_611($waq zJecU<%Iv{dj9A)jUv|{jBGNe@@DW%goaTAVj?^?i&bLId#%sqQV;@b2s;!HdeNt_m z#JQo%+wov<vT6umbX63X|NfzliMK0yOO*2x8xtiw(tb`r7u)m63+#`J0;!0@tj zV0M4mMLx!Zn7y$YKCU#3JFgb1hN*84V|J|O_qLdf+A~*H-fs4;Xw=K_wbj&g$_|m# zVFx}7;+VZvji1Hroof8IxcR(E*z5TD-+s;3roU!uUp>Di?C1FT-!9kJu9}}No9izy zS^ZbfIbpBj=YP`~OY!+VJnPJ*SnzF(vcP|1A+0ffRk0Aa?DcbJXwaWRZ`sQJ;bn3z) zoXd2|-kZV>`_?!405$?5Ivdem5V4<&_rFDJdSU;FnUcb>Z({H0(+K71*8S-b_CbG% zoQCuhVc+ZDTv!18v19>hTQ$XCA-&QfefZOhRjR$E_(k?jDKK@;_Cl%?USx{o8a0q^ zEYaFi2Q&xY3ENmT-|1ZlMQaC|y#+&=K?l^RQQ~mg6ERyKgG^|>3u4!Gk(;@7*!Mms zbUh6sUh=1_eb}x#0gR_p@ipLf@v?t8o%UB()30M{yQdi{l-($m{?OWs;6K)`%mIcQ zI9<&A%z&u3x|#-RqP_*Wq~vR6ELI>y-0Es6AqFWYH1_+kH>96FP>xACMbKd%eD;SgLS2eq%OIkp z7lWP;qY7cw4zy%SqFz9*4K4CWuEYLdoZZC_UG$}sOz=do|R^eqTCa7fd2{_y2 z!!hA8@#$Imn_f^Bmq&EQP2+*e?4E4%gIOf7K4Yx z83~_{mqyC&<{Z`w10p;Zk3*CAN!;IQZMbf{&#Uy0ncyH!~Vlze(OesV&aC%mnqB@}Om785@ zmU$pdvxfPiu(9tl>{P}UX<=Ex4UED>C}l>QHGLkeu5uq@Y(cmvCNcS#KT%dPvapgt z$1&*7e=*)Od)vA9KnBf%qfc&DBnz`5vvx^L!#iw6S(u)VvX}>MP>?0qYiW7+3I-Rcc zrc>BW)9KhijT)$R5oT6(h`1k=R~*)&Uxrz}e{o_~-T!Au4#Lgw#1T+*BQC$83-c?f z336CXSpvTFBG&ZNpyOdp<6q=Oev=GBp8W`J`bPa<)bpZpdd2(&K6;U-wz*fG!UZ11 zoGh)+gUEa)Ddw}rnZSlIGr?7ZX$h=eDJ@W~oSM|Sen@dTfAr&6451e5K}ctnfq=DqUg!lX*J9Sme1kbk zmq+Uklj>z`IoHab;^ySI;O4q!*B|m8PR+sCDKo#)wd&`3axi|VH1&ZG z2JaOJmTj%jwHpVn;!e?~7#5jg3N1J{^I<&2pH_C0FFBc{tRHE|jx*Musn+Y569J8< z=CHEz1~CMj;4Ge4cSgjzmlo6yApu91IMfd<8wZ&oZj9dmAhQaXR$65UfiI*59NS4zuRo?!EbQ$-)yxub}R*(JlDY?l!jSOr?SY%j*iRuQ^k4Nq(%n59~u7C#Byub zV++ZTn)@u@o|c-`s{6^Zc7;G4vC)2GwlAkayAhLIR)54ZSJNrG^#1$5&9iq^WJ2P` zbK(;GCcw1}P^n41#ABXY7OeP5?2DLVzG*)IJ9L4Dd$f|1dPPpBRKp8-+BP&Cw6)p7 zIGAM033r@l2Z8>Q=~PXThYB2!gI8ZoMII4|fTfw_G*9bgr%IC-zR5OcanZ*r;!uN1 z$%Z4@kbg-7gY}QQ64EG&M64rpZU%*jDE#$TaV#3>I{_cuu!gBa@Cypd*HGe+O!4J+ z^d7>f)mFd{8bc=U5{P+ZjrF7~UHPcIT-DM~r}EVNxUfB;bul_QyVH2*+H}3Kwch;6 zcq3YAzDIQQTJJO$^@xgC4vmjWB_ZTQ4v2R`M}PRibn2Zm^{p9>+V>DZ&=;x$6M`<& zpFIDY--+Jy>2V;W---67t)1!SM&Ng%g8?0mSWhSN{_45X=8K>*Rb|pI_Z|AF3GH?P z!@U|ynTTl8PlP-NM6|giWL;gE7MBSR*}=!-egUPTwlC~6Y@ z@PA6VBQ!C;&70V7lAG{>%R6-A$pT;Q2Tm@{Bpny<$$og;4A6>Bp7?`soH50XsT_%z zN)Up=5*kC)3Oku43nmmIL#tdm>LLwhB(pVo)Yk@EC8j43AC&@VEze`*Pl0 zQ-MF^720zy_d)nNrMKwGinzP_{?S}WWPhSFi=Xk)NC{yQaWLTBk5MwKeI_5mU&sU@ z1zw7g3`>hR3xfJ5*YFANMV_v@4$J2eD!O+`dNhbQK~e*m!F^MRgH}~eQ+~@uG`VM~ z*1KjS6cxUVu+*8xW$?N^bMe>meFIej1 z@r-zHlG{cymR=B`XyyR!-4|eYCyz14&F;poeWf1yg)s2YpdOlK{8p3`W)%K^t+uSY zB1$7g7nTjAyvpz4w1E}}HQZJ<(SK7I4t#ARHmQSQilC~nN>fq%kA-QB#Mg%>TE$RrYk_o9>(P~i5~k=iLh{t-)M3oO4; zN%}Un0wO=S&TpC|GMe-U?9(@C@({I*40Dqt_blxXl84B<I zlDP*QWjE!c2+*4m0Xd0ki}nqi!+V-?DrDqAkP*q!As19KkLa<3N-CJO<@dHAu$W5( zT1zd=3wd^?y_xhX|LDMs9|B)~ue}t12ZxgF%^hts^9v{>*1Q|KcXQKk?Xa8v9&7cQ z+c&HqX7{(2#i{(sqJMaQ`X{G&zgvpp{XM)O@+W_irQJyWLg+w7-oYK^V!*}6#_32C zc{9+2&)V`kd%ctjz*;JEhO8pJWIx36I}6UOk`V~5J5mm?_GowZMtF^oGl!(tef%?W-uW# zuHp%HkL^>!4Nx3v}NN~E7heW>fgra?OPLw_`xwdH?qbcE1g0W*)4X5b89AaqV2 zNGC80q9s&Fc*w2ctWso=W>$wVY@op?`HL8<&ZWEQXEwJ%y zTYto7tUth^n^Hd|mIGs+86tJ_8Ts9&jb%k?H3y5#&VltXt?=R5)l=zCzo|%hz+>ZOzg;!?mTXgzxi?2Ycddh`GTzoqs1q41GarJ_0yY3zPWb4$n-dw&9~{Ryu_T zF9DW-39TDBHL`CG)?>c04a7Lvx(eiOC{6_)Vorpef{*7syOKK=JbN+tQ7yMbzT@=x zr_+_%Os3OX5!f~ji~LHZjg~k0E=@i?26--dP@d=sV91Sm^8GsMfa=6f&J;|5s(;C2 zT@)sbEgMbTSX3hB49fvqQz)2twce$m5Y49nDSoa>H{G!0!XSo!stW_+)x7Q7f1vjZ zV)pwIP7!0=`8qC_=zi_6s)f1m}=M= zMweIZLBZ_~43W|!cVt9v$dKH|eaLDvNV;v+*zM|SSFyvl!K@1d>jvaT3mJ5Wyu%}n zi~U~Q4W`rlPU-2WBvB8TJuRBJ2}g;F!JHXlxcd#xkROygO|K1n7r zGy^t=0IQ5wSLLREA9QZ4DzQlY$&B0wQMnZR8h6IgWJcz32%_)b1Y|N~Sw?SJG$~Qm zGm-S_k7+x-}Hd^hE-KsQt^e~kZTiw=7{rKX6J@HOU@WtuA4|ZS zxe`H&>k5wt^s~74y?^sZA?YWTyfP}%E{Z@)?g%3&cR)ZKp~3Lx_KScBmFR1uwHpwT zN5Sf+jQzp<$@%H)$a{Hy`ub~+9O3UH{QYYG?KhFP;*rDCH*faOBJV4Y?4P`gyj739 z+dn&cd;KQzeDnJ(@&b>XzdJkHKa9LE3_Wsi`sVa)fKMBXtt z2E2ZA3XNk#c#oW4oE^jX%?5w<=JeqEYg77akaRzqR|lsjCr8lCK{6a_e;xr@&|1yb z)@DG&MHOT}ynjDB`#JLPpGQvKU+iBT!&J>LkDR}Mb$)Pm{7#kIPab)FeDvlp^6;NW zUZ3rM1KnRA9=$$(d#pZi6k0V6lq&@Qj5o(`kFHI5I;II09{p0?d_eZKk{f2hly}!6NW3`{myZX4@<+v+OFnQkQ z3y8OMIzODYrZ?f(o`)aa`{HAGe)^i|AlXEv2Sc9_O?NRn_4`LAOsr#RKY;!vZWX`J zfkcU$Gk+`3g(8Xz(L3$kFUm||^_TZn>KH2}$wvw~bbU;PmOsW0ueRb_6s?3Gx#&UY z{Ey+$>Fc1EG-OWGGH`HXpQKIFLPRuG8jAztdE9=u;{&D}i?K0%Vsq|X1t+zxnf*#Y zdGRp>bT*yp2Zhq|$NiIc`EQNdD$hk-b=LAnM1OMmlR|VwyBGP-9O2bU&PpXmcGt)6 zjw&zDtZTxK8OXD@^eqH^Q=pF6%htwjr;^Q8vx;C2c5nxF4LuD196j@X{dN4zTqnNQ zY0*!MV>233wPT& zW^jG7x$qMgU|SpWzd3St(%NuO0??1M`u2hjoLg@T)_QZxz1FUBYps7Pc0REpVSk?0 z4#d{BKJ0t?zeWPvP5r;6|7)bMy{Z3i>Hqrs?H&DpH=pKP>?|p-yso~ZtMBaU|GN7f z-Tkiaeph$DtGnOT-S6t|cXfNay1iZ9-mY%Xpte2T-kxr6Pq(+H+uPIa?dkURbbEWc zy*=IDowvl z&Gj>=T|Z7lar&BY!XeXhSuASD;bkv3H&$0)0Kv1m+G^_mn@9lVT1zmD<$pk@fu2*@ z(&zc{EZz@@0OEyS5N*D|n6ln`!A!_VmCn2I`#6!z`r3aMkVcR98js1iF=P~?M>Qam zHEr~g@lF1P|Em{tyvPg*gY4pf#zhwk$7Id_&}6G2#sLC(XQT+SShjmfgT{%C1=iLw zL;I~L@`j@G!`GXw=@jNl-G3K?CJu=tnd*-unqHBBmuv$n@wONhp@ss+vkU38)okHRO#0eS4O|QnCY&?&%9?gmASPGh2C?|E_|_pg}?q< zF5Oe5H>Fa%OQE=5E{3ZSC5M&bEmfRWig$mo`2ST(cOzKiK`dVTu+xYd@alTxAy=l8^v5RFL1SDCD zxAYuMbeAvaG4IgTi`g)|gN>PmS*QxDc+gVYf9mdSWaPzrbG+NPd`-z4HB z{IDDN1GWC${A70Z@$c&6-?dL__L(QOYfdV1+}#ck0%UECDl&{(+;tX2txZ)2>(&6# z$rN`!|9eCOpAATN`DW1ZE1+F_=6QeKGm@>vTd>vvjAd4a&67Lnbv4glL;UQs;N{EK z##H?5%i!h9J@_GlmoK;AM{0llvrTuZTZX|c(_!mddlCCO-r2^I-DZcaZ*N1%i(M>f zH8(nJeQ!5fZ&~fVdgA&pcLi?n7ThB3Y$b+hWA3{ngS*3jv8}@8kJSjrFhYNPg3*m% z#xI)q1S1>2j9VKUK|5Gm%bX-QXa_9fkLK5Rne=;a0S3E=#1%O>phF838ynV_--;pqV?0|+WWwW3$$h^FGv2+~zZVC*cfMzoN5!NBsmuH;}N#y;i{2sBwx z8?kn|R&mrY43LM6rDsxD>&I+-qYP=S$Y_mX*ve;!C!!dWuj8KewV!{e<16DrTK_2P z-mxJyeRt`AruqSPgZ{|@)AVWAJdZ^&UQm|j)kb5ffA@IGFe#X0G+=di{+LNNtd9qk z|GkAD9U1!oztFdq7D5ZG3LCs9pjT_e*fQhmVA=62?5x9q85&!uKIU~kR})g&>rc$j zIs~Whj?PezXsMsTJ63=78|i(gY$>$n7hMT&2G${reYc#SF?aF90My2f=Fe!d&P?TT`f~b_KcUmw7>ZF19Hb&fMFY75jhM0mOM~Lv``c!HGu6 zMlG;tMM$9ySk&hiT^bJkb-rU9+XSNhLAW*FwLYjA2uK-C5E}R^&A^=AC%0;I!L??lwLIt=u8AwfQR#FVxT;fFJ;?J%WFMa| zTF~>OH%AAE7S4Z6{cFK#< zQ`FefSIU2vQ9rIl`dmUd&z+F3O1>I7^Aix`4P;12!|vKf-7Gg1#fDN2-_n5@n7J9V zAdbP&&bgEp&9Hbmzk~)YFPU@7umOp4DgR0mHu}3j@xOLjwY^!De1LxsdiKQgSo=Br zU%SRXDp*)#Sb^Of*Hrx&7!d>7wQ1#oZ4Odro*{pp5eS9sszpqp$&t<7QcN2yg&ne-VtBH| zg2{B8i#n`R*(D+FRAZ`t=DI z&kTQfv}HG@3#ki83Vvz!lu)Du|IcMa7Ht`=hbW64Z@_vxVwOQ@Nog_n!h-WN=V;C$ z$sK%wgO*`=+&63FZ;sFPUe{R8;#!osS4wPCu3$d-tB&)ZG;-CLVpW_2SLV^A4>jsT zKe7jYw8XG0OwfFUNW|YsHmiXv!)`xikwkjk~r zajSu$ZM(2nuJ*Fjjj;e4`xhlp93Gzm1O4MX)_pO{w+JpJambg_do?yTKNQHy&K158 z*VL^O#Nx^UyuSGP-I0>^)X`uNRi%@fLLm!>y8rf@phQZ(J$-u(NP1ys5z9fC_w;{7 z3>jQ$hpMa36w9~--gAaf6Q6hNky#!AkyFlXqh@5Hobpbiw5Z?a_`;>-P>K!52k-*s zSN}*UK<1E0?oTX5N$tC1^UnRL)~VD!doQ$<*r6*y)l2P*BQYM%8y+fX977w8<)V2l z(&prt$o_1x)VRDyo|K{C*5Y9O`WsZ&rt4E2*QF;scfy!73Y+?ZMzsB zy{m(o+N2`S)$+di!pxF#p)5!@cdtWoir!i_C)X=R97&t?5{04#V--f}eAF>#ET0R# zs^)0^yHFtb=74t8LXzhZwN5_8Yc4@z?2@|JO}Hu!(y)h1nD za!m@>vNH&LMY~gJFI#01PdF zazicC`H*$Zqy|~c+_*?w$@5k`gY_;kTHxsogn5 z(f-N108F@R^sg=VF^+ssv{Qe%A(TBvPC46{zQ+c9$R+C;5k5FGIr^?>WU>WYyBxIP z%b)AG(-#C^z$(zsz@t@PU-#)Rn5I5BYA&^{Ocj>J9Sj0 z8cXqJrR69ultUl+<*U(NLQh_?7O82A+RD;!`BhbZ+~^2CZ*8@KNwJ=`Zl5h!UYjMJ z!xH@Y*Ji<&{4cpXbJzU8{`zzWu53zfj0C|Gn!31I3g6#4g8p5}&_RTK2nO zty}|G_I{{e<#}sQT<4B@f9aL}6q+u=b^J*@%v?FhUxAT96!Z6PL>%yP__l~&@&!9m zV_E(L=oS&lpSLAzBui~GI_!ZLuaZS3|7ns&%M^KOL1XQkC*^;PwJ(+yGuFO*Qp#BS z;t3(6V{A*w7;Pi&CoN1X!2V3zo&xtP+wzi>-YtET^N*iCtWR&@Wu$Pt?>AM31ns>A zPr`(kUu;lNm)#xxbaC|d98a`mCs7sFEhWeLt6^Ev`_;7!xfRZ5iI$5IDa5S9IMXE- zCm+o`mhCBtPOYV2ekWh(31KH&5Eqx)M)4}w@U$245rd>#x0EWWzvO&{jWh}y8HyyI z;0mg_%8q~JKcjcH&2^eUnWa({*)TVTaOD!LTN!J970rRH{k@a{SRPXovwJMGp_D}k zj{1;^RPoJ;cVvRd6cHG{!RSq-(TD7tjUsoO_`{bbCPqH?k^u2fpF`1)K8~N=gBA-w zz8TzSIxUK$H|0OP4A7nxK+A(>GV&}3*|X(9_Bnr3%1t;IObdcpJHfcp#NLa;~ygBoy;xVq~5~<;NR%Aj*LG8RUUtArugH$V=i)0OjnPm!n+8lnZ zb7N5CYMljnqLV97Z999?;mH;ZF~|pFwDmL0ptmF_{?ri=S-t?`a)yrupwQQ@8i$xa zjzwe8%oDX$gZ2Jl$9Bi`^#m^rhteN;7!oC%){!&U%k+RVM!uCJE{52z2YtL^9R; z^baBh&cJ!}GM9z)4=aB*U0q$Fm>P)(9r5GpDrB}v1}uD_sqnoIG!+=m$GCA}n4bnT z49OhVyapYljP@QI>=Vyq7XB)3A)m_cgLO%78%*?*w9B#vBy7u@fUmO#?WReVLBPVa z0l9&=y1gNA;SIzi^`KU zWH3m2RMN1U44-$Clsz}yX5pP24*o+mypCh=f{0G1;(N>hl>%JUfD}t8m1|d}MoQrhf~lsEE6^YcY~4!oW zVeD-p8?>R~S?O#*u(j};&RBh zZ$(f@(lyuX?*@QYj#w&JgsVyk`Jzi;AWjng8 zr7-q35qp2}j3iz_qJ+&C+mI+>Hx~Y8b8`b^AS{1|^q4a4hvST$KZ-6$Yf?c6=Q2rI zIp!tyYSwe=s38Wr1 z>G+qa_YV|C4Zl0+U{i1CV=|UU{XY0=TFkUY$~4RPt?((C(@j89fgy1dJsdgSMrBTm_c{_zxsqHd?U5QVPjhwwf*Yok02aCgi$F zGu(MEUck;9L!F(it)T6vX`D`{eu_u;GEKuDAl6RYyo$XaRA{9%h2j$(WhZW3#h!UE zFVC&;I`PI;?AZmLLcLu>R9b)-6qkhf4&k&xP zJ~jkX4M2$MXBNfy3^RF(1e1FXnY>G|S~n5*ER~8_%+;n1F5rykceNKp^Cq*oS@3_L z30%n;{29X^D>+|@=yIpw!{mGI`6PHxli-P>341}FE@B2BIYNzDU+LY`3-c+K<49$B zqs1PvB1w&1ugig?x~9r(=2(9dtaLif@?YcpSJ%XW^xgpq61R;+3?3oxsv+!Uk}u}7 z23LFHkx9ruJ4#Z?dU^vu0#`1&gK>Wk0+i$ANW&f|>;f|{Nbvl?27~hIE;-cAt$@@g zYCc&rU#yuAUdAorrHppvy5c3&9Q6b;_h^YqKbsF2^3{HOdJs0eHLrAV?x-z&%W`;P zqnu^LdRssnkCEM9)}X=?$&8DdW(Zk`9|5qtRH#$dO@^Z+W6xlfeoHvy(H%NSJ{mCV zK%uS+FU|&57u8d>7;>B2pe`|WItKd{h>o}x%ZE(MHeOS=^Ig$U7Ma?eanyBSE{I=# zmzP}n4;+7Y6f{Qh9nkzT9)*smCDZBU6;`{6C#Zkm@d&y9)m4>L4bo*QaR4#_BTF<8 zdB87w#+T|or;6n)7rS+Jj^vww+*o%_&yIMCHxEhUbN~`U4*x}n>3&;z@ ze@X8Odd6=m8tNbs5)xVgGoL2m_W{H@5fE2ahTQ?T;!nA5Q$d~`AWaH*u+QPls*gM) z!04*>0e|RAl_S2RqM@XmVdFzeM_4yaFo%TRF<4PFUhd;Af0riryvNe7iD?R6s&@z2 zB?5l~q{r~#J*T?;EPPhJGzHlN0$&^4)tdJ&o zKJwAIq@s88IKPM1XZ3&*M$^7baQRi+$bw^Han@eg4#ykn|g9jf6}ymFz#P9=v~GM(obnC)OQHbp+~KA8oDBW@^>*48EFY#ONXu zd==>`2CNUjmtm`?CI~fdB|MHFsxSRwXMLL_AI&GZdPA9F-efGjhrJf2Og*su>;N!z zCRGc!OrG9krIv$AU?zJ#sybn{kaIM`u&%l5q16hpK8^LJ!y*gnz6zoLE=_-iJY#-c zL7j%0BD-P!1kxLpQk_ds2CH3dZ4d@`kG*?+VZ-Q_$peK+^jnZK62SN%R9)PV41$^B z)9t-tP~{wjWLpD5^jNBAnk~HgDs>gq#$ZvamX4K-Ip9S;JB6~5K9GLi2OSJ z2?r0wZonPPb&$4Ke4YCjF_E&xQNN+MgnaO2sbqB(puxk#mks_8 z8UdS^DEq%1P1`DQv4Kw8mt+19Dt~F$S5}u~ zOkVIIOU5n{Rt11Fu$;LR#Ic`=bs-wj=UX+z*G!`P_9`H*&`R~aGh4P^8H0^QM*Hkr zDtZI(@g{ zxOR6gaG0s>!u$&mK3Rb2#eY0ZFASy^pM&X5XNfq_h_x3>`)NA0L2tb<-{Hx^Z}3;O zJ{A(+u@&_I7wyGhb#A{ka!4QRL3)s;E#KJrn=p01nPi{^hlokB8tAlvd-inT=# zaofI22E6;|=&efmMZR4po--y5mrAW_Tlr2bFK79r)OT0?g1EdgHh*kpB@}69rdUim zKgDn}C2{U3!uf6^~PQ1r!@So0;4&Y zqD&*?5fM=HIMG^Qi2{CD8j{9k$`TA7vXqohOmQAqWzt$tehmpy$fXBOdc@1J)FYnN z0zP329`VX8cvp~jK!1_41(=oA*Kzn(SA9=kP3s^M^6+xEw)1rAq26enir%`eS*wKF zDZ3!nAN6^fL5SNlm(FCMjwqf0hDQ6v%Z(Bm=kVqogC!5uY+o1k{2<~4vMHm~hYqY) z?eb!zWKypa<((uQ8YRRUL6o2TnKo&tfTl9(Dj8mE%{ipF5q~z+M`h6VoEh7eUzLMi zukMJCFemuOQ%BMr6Qo}nb`=OuVUszaDK}c$PUR`vHc5sht?hy0Rxa&>l-=@7vb4Mz7~D*Cdbwc0 zTusqlud-haSI*$3D{t-` z2U)!VN`KpEo_|DY)0lIXsz%8!mde=sq6z?ukDIpz>jF$mK`#rh31fGs)m6VtD>7os z{hh*h{Crkyf`YYIQVbANmJPtuYo(6SG!h)YuK;L3m%mvtY#%I!^iyt@A>t-UctB_~v>%ubKGCobuEe#Q*k&M;YSO@+`-dLb& zm-W0AV|ID|IJ`*)tE=o%{R%O3l}ysB>6Bf1|NYh0kG6C@h4?%nk($!uf80JG){Gdr+KvsX`bZU}t!YT)CXgFwVTPjF-3>~HM zIF}AWf5~*JrpQADj_K6=@(Vd4@B5h+5~eew?VvLYa36h8D?tVH#Z-29CjTpyk_|^_ z`q5*VOvhb0PFX`FVjZCasppOAG5qycaSXN{J(g-SZ&Qch7ZjGSq3n?}WhQb*@4-f- zwgP{Cpv{9ynN`zIB@H9)kLgq|{dAh1m>(Z)%hmLv^pyl#Z{Tw=$tXyS^oi-GjQzpP z`BB?NYdJZ~;3TE=!I%)1zk%RlwikdN2|!<4^w(^Db0-gVmh^Q{Q?|-Pr#jZ#N)LOF zthew&@lK6-H|V|?D9Y6`A%2AW#VSFwfPjB^Cv=1#OsC#CQ{S55sG|mXmBCvFI>@7p z>rbBl&F@6-`Sdst((goj)7H*(b0hFO(ZPTYN30igu#vBxhmvK|_GeL3wKv~s&Xc4U z{-yV;XebMu2J(Hc8HMeZH74+)(dbv68;vjw8;NMVuDxh9uCD=rFyo@Eo6+K-&scvi zJE4N!vecB$)DQeO`&D?BQuowBf-uC4bQtsL)aS~u_~3j$_PQDM2pxv6tv+H8d%Pa1 zM{RMqAB(0BaIo>~n}ViD@BMV2OiJv0NzyS36bT{X^pkH{yh2VE(B{Vi6x1{pmQCv% z3(~?Zv&6wF*oFl_gE;mK$i1Lq6v=-90uf!%P&cEt4O@ekz_jpFd(DDMK5+_D2F^$l zWz1T@^WYzIUmbtOeRcRmT^O^CQQjI%vfw7uK7o$=%)BYxYK}8s>hj&cuhcKQQqTU0 zuGHU_9BVd0U#E^d{spE;8PVpeAFW}#ArTTxbmcOExE}&;(Z7IuE?eLJRJ)tID>y!(7mG^iw@KeEEGwPLD^gU zk3}~r@7-eIEByLe(=zvM7TpqF!?Q(J3&ZQhTTFY`SA0bzrKN&JH z=8_Gg$%yul+1mUs5sn3iupQZGKp!Iyb0B#$(o5+BOW)BEOQQ*xN8G01gnp0=k~EUw z*f>l?_;AN1Bf7PVWEAb11|N7&-bLwGrX|RcRP@`Np)uJvF%A>FIn93{(?0^=HB;5f z=?G&B!_K|E9k4?zB;aLA#~^Q#;J?Xwgu~VxfH7l6Xp92NA(!X;R-BH(bB2XHvu|@v zCLE!YQ?H;u6abHunUsGU{z4{HbnlWh@=|_#Cp`$C2Jtp@XD~y67!NJ@%}62+21&+1 zj8SdV>+yS!OeDQI7CnFVDFQo}0gJqwv6SEx0-y5kN7tthM$8W~5SnFg(dITR;5{Sh zx8abE8~{a3wSjSEfbL3TS)#kj9bFe4ePoZ3AZl>Hs^_MlQJw6pHY5Kale?7lU2{1C z(2i0*q+qH&Lz^ROPG;wVbrDHcR~L-%?;INz^g>cWEeGP zq*VDB(N2zKxEOH3yh^1vTzrfsU5#Qg)=fl@rjOx}a$zHx9BY;P%!|Qf?2vU6lhH6ocHYm8 zflDy80?XghRtRQz|WqtPq+G?k>4f#$#_- zUq;&%E?A0$QXtI<(o zIDBP-&2;|og_W*I$}4;Sag4xM|ANSl`Pt5!Ue469VJ95?7n5V z5-Uwdvp;Il7lIP#ms*vN?rp8NK)uNxPTQ;mPy}?qZw2i9Eb_VxEcLxPpCOIE(j=d< zsMR9bFxnx*UbM9kOSpjb1DPl?exun0LgMM(^3L{_nbB|KO!EF?laPTs)!r z+k1a_JM6t5Ip01OF!$hAS|89GHt-@3i1vos>;;8AsyA>E{$enPyX$Otm^=t)=jr!k zQaXGPF?GR(8{H{d&DGbrwRv&?Qb(WPkjdgch|M@fBT}$cQI}MQTRQC#Xd)4P{^C%o zSEgFRJK#ZvaZ*^1Sf@m`&}bzcL@X4E);HSTk^ryg2e-GLNCL8GwZUmZsr(H){;Nbsa8~pp5=-8js<7R+SNaxdp{v2t&^e5=l znQnwV9-i!99DI9ycKZI}h?oX24iU)1#TAAwN}FN&ZQyi5o3pKELC~q5g}ZS714%bk z+@m0>zaCtZiA*BzIjj^HV0EZA$4-BoZmDgsjj8C1)50a9tTHBHH+`oT{lvd;s}+Gs3%xh$cgt-g2R6j`9acdGLR%esFl= zraUyAG4EdI+;t;DP*4<^)T+}m9Uwy(u;ZdFSP>*Iy%TVLUPn1!?%+WOTs}5b2(MR6 zQV$UuA1}ECT{ak$xZfIZ%ZzFD^^By+Lo`9*VLwTM?d;M4^IHL2fXE(tt5I~r`bo;X z2ys3#P|uz@=^P@F10MkS*wlZLH?P%f{-;Oo6w#udW@-()h{ZMmyYWF?UFe$ez~WhX zH+;2!`J&mpax>a$3I}@36F1wfM$&T<;@vww=%rfFXH%>B>Z5!Q2p6PUHOGn6Dh`ok zF`Z5g13HeA>D1%mj-_0B?WY7lyv82EbinC}EW!0=nl2reI7f+Z+;#fc}XyRw?q`9~hBc~Uu+1eu2yU{}i z+(`7!XpfJxXiI_U$N{43g%=t^C=myDRNOMeOBl2BE*bP#ikN??6l?TpHb_q=YV9n+ z&usvA<*3LXs`q0KK?NZo5VNR!gF^X?V9@wCz#8c~*u?vLqIFa31NPtA`DTT8Etm(kMejs1T?ORuM@ zwDf%6dCAJ;O#)&_niWae8%}PpRI?CSV-i*V#uYc;c3oCQ9>y%5PWgc^L2h6L7vu-l z>DB|eWFhZeg;_FWKHtZX2RN1EcrIC{Zj2E%w*|dra7%yVRUs2e2N0hH`09^4z+@*e zKe45%o`+J^EKWeGI*t>Ns&=39F@lJ!d>~os^EZB`BS?c@@-l-kj&sSwTenocc55wj zRXJ{{Ov}^0?CVF((`jRkFKyhwL=(B>fyHZ$GUvcdYBy?JjqoBJl6 z+ggR#RdauD93Og56ULqv`*|*zV*0{#2?qY%JTuG}4Q(=?699(jd_+aGIRlFt4N{fT z09LSD)9cOKnj@uqg9Avgm56~ofMaf4s_k0RJd!So9XT-H**mb!xP`E#)|2*&h%VDB z0;e<*>#cl;VD)lfdwr!E{-p!o#03+x)*{~O2rPeUbMv1RPM~S=%o>LsR0QeQ<8C5e zp*4Ue%E}UK@HSb8{=6B1oBoOFP(@eQ76F7GIx!YHoftu%LP)740?eIyI=&1`4lB;s z;3`aw<)jLsgLE3Dc{xWf?P-hO-aS8fj-~Dm+0`d4!1k+d6B2Rch<8J z7Xl`zIq=`=ZoQTWS@8`eb8ooL9Jd*`NxgqRd!x|uJDSpAhQ5v9Uuxgjum9mr6#VCW zX8g5w4#;DXs*CC!eFXSi>ySFia}68<6fW1^0KBLEYhi|Z&^GjSLx2ABJVXCtWUuNY z^GMZuK@HLWD(Uw#CL@ReMjBsXHV=FV%=i?N^G!Yd0cq%}>XV@GZBVX>C1-~)3>SYu zq~hJs09u^FHnW>Rg6U~L2>xmwc#v9q5AF=GaslDr;_p`w=;(bw_*eBETUFJ3-CSMG zb4?Yxn&wrC`|Q7eBXW@M3@1_aGit{Sw6N`(<0@MC5o1w2>)q*Xv{(dEaE1}qU;N4{qdwov%-8!9zg`!sxb&_39iW{pIiQ2F7;UP3n5L?Z%7jb&XV^WPytbC zL9PLThzA%l7Gmw@>!Z2rALalxnDFnECYx!`VDv?fC;6oKPvD-8jDvr7%cPN9+Rf=T z(E&!V0U~QipNL$HNYc33PG8D)y0#X8dfmDN(n4X+V?k(KmLhWC@0*0jw8JCr5J0ut z2t0~^ldp@ky~>L$i}_`;wswU9a?lelsml6H#Y9Q^5P%sO#~9ARw?fL44l!iHft-cr z1ZyPHW-+@QUlry9GsS;|d62Di5iD!qld+Mb61Dr8Nj+0ZJX2(8li?^CsZ5*t7q!SYm1>bHww&2?(gSgu^uv>{^ z{)R^(eMGWK`pr*A_gisb!A6(yTDk)Y6@!1)GoW-}a(ONAJX)Pco)0ZPpU zk~$8|Ayi~W^0ygJ?CWc*EdMiO&#Af1OL^77zY+e8@xoJ0?fgq#=-W2<_8{9Fivaup z`I7%5zRX8wV_bizI-T+t5?*qHb0Ey8tRvbJ~`r){GMkv_ZR@d=f8VSkV$sqd$2B6z+L zT;YS-bIueE}&(;{&o1{;G{Y0TGK!ApNpyu!IrvFJ`WDGW&pS22e~ zL?)J6uA#xet6)Lv!bmHA8v99{)l@cG#F5x48&Oi(q!pD7hau34%4Q{nP^oH4#jmoq zhMN$r`Nb(*WPw93CW9ha4Db7u`GJLvB0#K)44Z2IDe50Dm>KLz(|BTvv*_}Q&|WWc zhrfX<$i#o5%0DsGm_g8qUw#iXhS0H8(5BxH$OHmp**730kt=_K9o2flkhT&owHdL( zIhC5Cu)&Hi1CSa?FjaNlxNzJ~EQ|5n{6cj9kN%#Xl7SuAqRJYQwY{%f77zR7~5Y|*F4|n zfSG@tL_}qV5bYKs5SEL-7M)hK4#@!!Ria{wb;Crk(>|Q-z`s-_*&T(a$&d^9E@ItK zjE6TYC5kxM&!9+ACLzzxROXGIN@r<(4>Cun2}AzOPv>=Qn)}Rdou6F=gbo})$Ol+y zHjR9e(%-avo;BDgBGgjO*Hu+(t-|NE_$3GMy+4*p+$ z2N!tf&R!KD^zF^Sf)%_X74}Mluj6Krr-)d*L73Vg$a2Fj$r%J;A-z$_ZJcV4uKpOt zkCdh4LuF@%8hAVrXh*8C19)MfEh+fsNIpWxr(Bmv#>$>Tdq{O-7CxkOG-4RZPgQ^E z7lo*eBR!S4mJS%X%YSBM6f?~j{m9arBx7)elN+!gE1ngLMTW5n>4`}??&*Ns#_A>| z_c1~ogYYqrcxtX5@$#8^#KU=d#It4zHPjqE;uUG2;J2QiN4)CniXxnwM?5v1{09`( zX5|sDHYbmG*T$feY=POsyIxh1OP8c7VQ0(-C3Riw`}Z-uEy znf;9RUjZrf530e;uCv}^oBu`I?CT7_&eS(}L674H!;DLkl8OH2B6*wN>KK25FL{W7 zDu9g?34Lww894XRo<9caXb^Xmn_t&*xa~t+=i6vFo%W~G9kxX-2ZXKluatiWNy!k> zL6V27fE-mbBpv0cj;;}m=M}(Tlgq1se1rj|LrN)nOxX84I2xx7`LGz$ise-#wpm%_>-^{@BpH7ckmWLj&1 zwxIn+*;rj(FYf2ihiwPTh70;`{z;k>GU|bgUhB~`vG|!cc;^_ITx>M zIGbfABU&*nBh?fcMDK(JKNxn&|y z;c3;1CLcBGR%M!s^sRpifx!h>c9SFnl3y+n9T>XOYSFr9B5Nd;&j6M(1rC^pJwyY} zygU14?RHVskTS2`G8$M&UXb#Aw5E=20pBcrMH?k*YIk3%lTl11LedXL|7=@AvSqbSfK3$PfZqj(Sw!N7x#w8-Wr zrX$1+bV%rJyxH2`++i;)Qu5wO%~=ytB%LPJxb4Y6D`e4qi5#&gAN>K)9mx`Ql`=U# zKh4GK>e`>@0|I}C#M398l1Yxr6C$}Buqf?_;<)o*M(^E+y?VIq<8WU+2>JvrJVR#E z_80bkRg3bdQmpT_0zw~9s7oIMLa(8?wXPq9(P^F7%`XVrPx(*SH^UFh~a@0Z?bx1{7Ko4yp)4CxZh@$lBz-FCUd^N7}$EV|A z+|ge0puF(p<0wJPzsL3>hr!!Bd7(ETJ@+ktRV$_q@EIx1nqjeX%`stNg8<@ z8yuNYCxCkt;WV?V`DS$NG8+dBa6KM*xcFL+u3qizI!RC1WjlVuN7|X zG`B5J#OC1 z&gzZ*f5DwiPgR=8EN57s>(M+u1c$$^~_xlmZKE*3KGas)9%{kf0lbG<;B9Za16u zY&YGLRS{2}uk?Pa_Sc1A!{w8!AodwOKwO1>QVbbw?`r_JCbP9&n#@kEJq&+)2o2Jd z(Go`4aM#U4$Y=`Agm9UW9)pxw_Bp9%|6VSMgIpDD*K^3@!$M0r{6|4E=0C1om@P z(V?R>CNTw7M;231b&Tg%EQfz{99jNbxaEmYmwtmCp1A~7J{h2WrozY*m zJrj^K58LdOreNW~8Sy@-r>Jpp$Fs)1A~Cf$z$?~xFM!N{%D=llG52W}Gyf^ISx4?iD%OGCFDszo7VvKZtu;;lDSVrwpL8}g26oHC@3z)H{t zWR6Q4Dkqy4{1x5rgEN0emL**dp&%P)?+zN6NTKn-2Ll+yh^0dcT8aYm{Y4`|6boDw zNOc=6(1spJoqS#;tIr^?iKr3qV2M zAvW9ah#=j%Kfe|D(3>A|6vG>o&yoSjpNZt=L}>WjH7Maq#Q=XT*Rdn!_LreIeHG74 zd7)ZOBE1pZE450sS%q&c-(=#NEip4RrgteLN0S zlOFLJUVZPK+G1mnx;qDh-+I1B=!rkKO7Nv|Iv(5@pb{89q`s33&g&x1>Jxrcb(kXl~74>0Wn2@Cp6oy809ZC9q9*22G z=iPf@Yq9xkr6w!ay;b(r8A%6hz9q2FdJh&?s z1%ACo{U(^v8&#*6t1$m-gXer!+6p(?goW~!0P~;F)zOb9jUw95Kcq|K{Jdasyr7lz z9~LYKHFHnIJGCNs7aaDVh+Pg@WLRe~db- z^%?4{rZRc}O%|af2~g#utYz6Hy;9!7nfBvVilS~X5q{U;r&)#yr;hZ;K~zm~Kh`HPyVa;Ll-+I6=(*th(6X^kW%6h<-(gSW9_20Jnu~pIoZZEF~{NewO z9`FZS54abXprb*8AtRaKwUucwab`gZeY#E*uP{D zYtlL&V;$H+)MJ5s!-R2H${KV4X=Wyb<^N~zUD(^Uk%rN~BJ1S!M{XdNcTsY& zdU9>t#z~rMTgR^-Mxr7nH0ko9#I|&P`+0w61|UI+vYl?b`|a6%5>q4y;xYgRbHfZw zl0NMk2ibuR>lMo27BCB1%im8u~i}=wwc<%s^@nfo%#e{m`ARUYyg_kzR_+yP@9;!j4-LWVzGjM+z z+`TK!AW;ktRRY6JnZ0q7DP)wNIFU18fO0diNS$z(+Sg zXdUuW9y7~yv0oJWRmhKhR>09hv)%|&9&-~~t$9h3z1db$hmxGsx-FqSsa&v>L7ZZ!SmK&*!vH{hwJ0?)iqXn36+ z+b3&`@Y&(IZHIZDenYJIsYd5d*pBy-rh{QWrlt$GVjrVYxWeKYCMiY| zVA2|Q$Xl?O}4DFt48Q!P|DRA@F zHmzhpPyT>j`^&&Ftl;v@wj9H;21DN%S;@dP4RbiK9m8^$Se&0UNlp*%dw9RZx0h!F z$H(`c;kpUl_iWP$oSuJ3hx;Yg>?Z>yZJ^{`;_FM%Ys>a9vr_R}Z=)&hR#S%UraYBp zS&35VTQ4v?U%YdM#?VcacG%bs@A4=xjbPNX&7ontPhEJ^vjW$!wn5@PwQQ?rIYT3G z1w@Wqmp-tJKn2KC%NkOu3J%M{mf2g)@Gs9O$qE9)Zx78|$FzU88sV6h0EB3P<9b{5 zJFZ8yk9OAn)^R;K6s||b2R4qrV|GA58435T>zF&Igsn^o`>hkG^I;e~wE{3B?m2-E z{U2V|_Pfs1HK%^d>KAVl*dzxuJOjruEL-oiHCC6EpE^Whi;ck@JhHnon!?!}q zGAz4CS1hFG8NLJWoZiS7T6B?bpk8P6yKT5`&oVr#XB(d1a|~-(4s62=dd^~Cm_Y)S zLIut+gogC+Vp1{Gu%Krf&X6wn0vhYW3$N!H_J}U@#xZ{!Z(t02fnhszk?Fn-fUuxG zA6n$wp<@KY9$qMu-LnBymN9baBAa1B?a(P_L>GEt8zcPMGdzzjb^5>vhL>l7;q)xi z7>*JGt!21&&ohD{wrAiQmOpTe07e5_;@e6-%Q1$-L11{$su2JKzA(L>V+@@hd<$*2 zdXP52v^sy^qv0&y{reS#lV+8Yl2+P9{1~BTw9xb~eOh6cP%NV+sM=q>4*E2@$Q^#{))w@H} zu-<<d_cPo)f9 z0Du!9YQglSWsMBS{Yy}&>wAdGfdulyq2a<{yS_k_uwWg(H|z~-%xNP!fHgR@=_21) z{s7+$0oUP06oM;kIRFAB90G*#Lby^aKi_{C;-5sImMhBYHEC3{1?}_bB8tF9E{Xmb z0A3n6h8=n^0q`R6rWFt>#2Mz)I1UH&L?|Gbq%3~!v=ZN zTW_<(o&(rlu6A*eZ>$PB=6y0EHz%0R*9I1hC9(x=?>Q zE^@;fCWbXMtYJ8WR^X-n&g!{FurzEB3I!lravzm1ZNj^Fp*Mjsv;ZXzfbuXb3qFPM zx18ovXpglV7`AtL=JcR^4{#4&sC%$Y!(8pzkY+b8Tv!1nz!m>wZWu+&#v()5gmEVp z!$NOOz$XFzQF2{UV9`b9hMLXM5?g;~J3YgJJ~*S^P;PY42gie^*gY5KoLf&k*mq!~ z$GygP=_04R0nesS7g>-S;4EDFhT|^=&T?P{hUGtT11}*&<$IwE%KcZ)8vFb8I_=`V@G#>HaTe&`zx%o-=CAp?J#vkh=W zG+M7BAQA?aVFPqWE?wk`@O*%pjl?!wL^{mhrDu%n(58)g=*WrPvj98}trn|JHoOrL zJ)T1sNm|$*01y#`O_zEKL0{xNgFOP8iAq8KKX!IO>0hf9qz~GL0zG2&RkpRao;<9ImT8Qv#lSLQ1A-qQxXr<6Ij}sWxGe-XJa`Md2gv|TXP}3t z=D>1c#74+5B0{%q!}I9Aux+5tXb!?HrVd8p7jriE?f`SrEv8~|3h7*6>8hFD|7xb*#LT_L> z$Z5HOVFCj8M})wKhVLzWV-)&;3H$~fxUd9~_wx)~JtCcU-jSUEO>CF}d3v z;bP!ItAMp#xS<2=oKy33u&(_9F-{i#)e|3i%4UKC8pj>eT@2i%Z`jV|nQa2f85yP* zj$oDIg=$Ci-a~)38ZRQ%atBC)iHlr-9&B13Zgn1A#Qta4NWN}tX3z|8fN0O5i!2B} zfi;G7k!v@5-vHPOrj1azqpJm5Jlq#rH1)O&Ofw*=R)@K2WH zBEIsLz(0gAH+y&y!)qZ>fXlK*bP+EcK%6d66(F#I-UF>1suFE+L>p2CiWb!vMe=w6@OSz@z2w%Aum&ae$S&D42pv zL;4s<^9<=y&ldzCl2b6!fO1`LX*mE3uje%r*C)~&ha4|*@zG8Y^bqOeMNVm;wroI} zzDJju)*IRh2!m`QA5{|AM1Rs6rMHG3(52pqfR=#4_UR%Qw&MOiQku(nSL`x({ zLznQSr0`)g^a=7VlAg_8J8}rDo#9 z0K&-vrojs6BBy@Da-?Qa@fT(o@y>8Q?~}Azfv0xjumclJOazMR{;#XKOixKIigEFb%A1m zYQ?1%CD=V{IWjzpXbQ(L0dWm4&p?_8RE6vQTe157|K)$I{*gOEb%^bN)M&J@VZ*fz zE5O~)TMnT&tF1o7PjFJ>%sAdNWD8q=lDP$_=X?+cX9lgaxe=d(lG2+=#qHJ z9jSzqfCG~EzEg{T-2iHZ4G910JswmfRsd5naFH zt3RTPT%499UoX!<@P_(Nhr~)tlnvH`CHpVY5qTq0<(ojHE=C|yT)K+^-dtOu@a8qJ zN5*K>^L!J97`|hezIS7-4t(YGY~KZ8i@OY9s6Z%kn;LzyX9oZfujkl*P=Iq|eU=~K zjt@2x-oiztn{9nVg_aF=1VPVsV3FQj-*5!OKLVgE+@<57C~&*B8*Lz5m^wC)ir#`6 zy>y>Y@~xWgm_2I*E3;=0LE3cdrrYMoaGh&GbyGn=*Z1rZ@H`8EfW35|VB)vTD+?Ok z1GVhUO%FVzE<8{xFHjJFxU`>O;;m}*Jk;6&jpp_M4Ce3_b(%=_c(@bTOAqBVw;LO8 z2qJL@@U4&5Mvi;)%JF?;pZ+%o{eA=1%>^; zpk|QBS%zu-E2?$|fnkpR*){(aTa0hw^l^uV>plT&0(Nbt;VOzZJhY zfr%C!LwhlBK++i!&Q;hg*8?r=(Ct~srCBwv1}-^;fsfS-dO^)Xfc=8)EDblTQwO-< z05^d2l|-t(0sMu31N=p!Rt4EINQ@Q^NGC(TC;38iVA%^G97YL|7G|&<7@pl^84L}y zl^P`jV+gX)0Z9snC?)oLbQRQuN#Z`oSy~AS$Wco+0O|iLEG{u3naZ%kg7Vc2B1`g zb_{*GNMdw2G-y;UG!ub4Ke#-Dp&tNG>n@Cu8@9#XCeh@m{UUL{)#zj00U9^~XslXx zM*O#r;$Qrido&OXe+(bEC$JK<9JgDE{+%7GeMOT0s=dTmeYm|!&& zfG9YS8h>EPZP28Fgu(VuHD)0z9tiwoku~EIUv7U4>=}FwILh_FHqs@zw$yeYLy6Bz z+c$y)7J>niOrV=b0+Wr9SWjq?0G;d`L03V@o{s(+^HdwHe|=oA@&LKLZ#W@Ll|Zx+ zXGqUn!VB0xMjn~~)~I+m92lnc7d4FpV4%5lp-z`7rg<9#1JIJAKGYk6<-rI!=6Zjj zW_yMgw6rP#s1iL31`bBW_enE1LV zK!gixEiGreK!}Qvt0RT(G1E(G-a0K>jj90nDh8zyzS%295i03j8tP z&5=Wfsy--xK_nJ{0U`+O$sA<_29uz^1GDEIE-0(le+aeE=-2b6XlXgX!Yv;Z<=((T z>uAsLKokMO5fB{M!YpLi^F!FLM?Ja{E(#EqU~oTebd(m__yJT$Fg7$zP*#A-QNU^e zU=17V!dgWWt;Pb%9!^~tLk|qF0>lzF@XH?BZ9v~b2V{v(ZFmDyWn_%Jzi0({(4D|E zfcr-ye^k+4w4|^|U?9^)Yk;CM1@Q$IJt$18*9Djwpn6E8N;|^=C|>@mK6p+qaA2+} zb7EkjwdPP61iNQ0l_bp8!_9l(8;-Yt{o8F`0u8d*OzPPvi$XI;r(GZ5AN-SeSy)#0 zS|#=x6mO!!D;Uv5ZIm(ki+}~ELTohb^*0)Cf0^)K3>f_HHGqR=TlilPBlOsUqBx=A zxOQj_(K35T(qEkZL$o1)>pi&oJ-P~VRDKDQ%5e;T1o$jK>lIOi*;7;C>Wiyrv4<5v z%3lJwx{1>PS?z*w(z6DE_{FXjK9arE`zD$0dx7}Hv{wNlILEa+dOyYKNC?#<@x8dk ze{Q}SqQ1d#&H7uj!1sfpVCA4{ga}$RTXyAaZeY9SnhP0lOT!BN)N{DB#kh z;w_o*;GKXG+UxCt5guPK$?V^UuF(Mif>3~(rWSXsL;Mqb_ zAT(1@jNLQeIWr2dK~jfOqP20Qg9f4+;_LKROv84Wk_9_i~w#wd8=4-LoOK$Z5; zu(og|>Se5vF#>TB(8?R%Y$PFib>XBD94PeM<-i^#wllB;u;Bys8XOc`I$$)I3@`zz z9bKN;G?b<>Of1_N!brNoTib;*8~FUx28PE6eFIRd-sRZ0~ig_+H$*CJUy zv)HGWk7_NutI%uO3Y%X*q%%;tTWtj^A~f)}JKBmSM(WEJ2*9#&)U&n=wT6R{(E(Bm z%#u2w`De}i^0Ic!*Wp7=T^B>sM@I$M$TdbzG8lqU;J^iDeK`Oz>nKr@dT{Ud=rz3^ zC`ldC9{tA3ec&T(;8%rlCSauyrIW*k^%q8#HY&OUy3|TQB;2gtmqa-bNq@nBq#CwM z7pe9d(YY_14EyVIgMh*9p4)S4U6czHKWQyNUTuPXEEGIi!nU$NtlI_;S|Q=-Lz|9s z)f@qur1mx~yg&+J)6uS>N0-_T-yaymA)3G1xcmacbV6YNdZWhpbhn`@tjTRtRbN=D z_S{?9s1o`9Z)&FM{8KGdhkqkF=lO4Kqw0*%M%5xUb0`jwNF^*tKY;snly6AF=>=q< zLT170ky=!2TIU>^1wu{D}- zETPSfv>Vg5FopaW4Bx==&oO+EH#&fVhC<=});1j@AcZ%G8LS0JcN27a;4OfGP6lX` z;P=QPXn|+CFVCz1iD%RBJ8iz++Scg*S0-P?!3(1=2M;zG|2_u>-`dunY$pXJ{;6hC z13v(-6DFK6fz{tWwSS4?f0yythY8U zeGjsDfntvXZ_%3FqKh~)3&o9;L$ofTNZ;K$qh>+pT*I~N6K6nKsQa8rr}a_z+n&L& z>;pXig~#eVx-^#D@|-N%TjS=_SkVNM)^Y>7G~NZMK!;4g{C@^XfL#)xS(`3qy*h@& zCqv5w)rB(xNg|j}qa~ZKU`ae<3y9DT=u)3304!;Bn0TRGxznIDi=>}G#x4UiwhA_h zuz~Pq0Miql3pjoYb7GflaZwGsd@?C>8WjbdgIbOZabk3|aF#GN5Tk+U3uV~1KgQEd z9n}YU{u9U}IDf@s{g*`gqa>1z5?mK8e$W8T15-=*0WJZQS&lS8v}|dF39Axx8_vJT zhX2VB1R{Z9+y6`pOqkrL@pZ}Dg=NWO-y>-r31-Y>F5uYT3QzlA2T#I#{{nCVG(F27fm?5`4n(&5>b_z<&w|UmQ<4 zevG@6odo1|$P1KLpsVv8{2Kr2N)|Shq@H0m(H9D+rf(y)k)o3MeBQ)H%~GC~=>9d! zw;hUJCE3ReVl1CS+}8i;vjk#+^*y-luF^CAhxG=I`9FG}oo7W%VR*t1MV3@$)CZ@E zS$tj8tbd(h+Gp{y-;NgnjT3I%z}IU$>q7* zzCDXk8RHZjxN>mL$ujb-S=8UZjOMy_l}81534aaQnW*M)Ha1yY9A#BnLa}CDR-I)W zF$ySDjLWrt&~p2y6~?s6bMR((RexCLR*G0tf2z7Y55gpY@R%E+9S|y<^9X$U@hkCJ z$(wpoUK*kX3_2j|U$q z(|;_FUSfK&TJ1G?YY?thnYLL3zpBT|WDz*TtsRDjWhn3E$ksy;)i0F!sg&7j zHPZxWr#dUwxnuwk@K4}bj=HVPDfU6*z8hSoMt>85oXLN`bd-u&h0EfUMQL?Lp5}3$U@XU~e*Tij zrMO?~VWa4`9J+8P;xfclt`lk&DttYZ-uVi3M;IyS!AF`>VNYr24A<; zxz;bv`mpyj-QD32&;YPRSghi2W8n*`KF1Qrpt zD!)Y}r?@LJQ*NA70M8oX{!sLl?90DT^naD?v=w~?=f`R# zhJLlm9?6?8YV;M6e4FSiVq*U%L|+kIrRXc!t4_4|A&+MtDHs55K#{*-mQsXNmhiLaey%z`r|%Cw;q3-MQPO~v`Fgcirbbqrx0Z^iN(fkS#W*swd zb(Xyb2GoY*>?}J1#x#Ezy0*@;=RDO$K>$4Jy=^jan*+W^&K#`EF*sz7ocud&^;Epc7hUgz0=d7VGT>%90k z;&ooOd7X#E>pYVz&SQD=qQ&ccYJF9%RyaY4Pce0!37%%2N6}@ZbqO}(sL&#Im4{!( zV&`jr13ZJSR{8k$?A76a4tsSd*sBIkzsg8)Jo}^__uqe~z1~~|E$iJ!a{onm0mAju z$8nU*ie8qA^xhR@?)Bms{X*C1uF4a-X^~2l)FR?2shfgmrQ>GXuJ*bP}?(cxpnQ=4+QNHGeOi+F=Ebu=z4ZB?%&I!-bGgRib~vk2~&aN zFgJv8>rq=KeYQm#)f9W5)g;b1Wt)W6xKFeY=EA$~-dKb@lTAg(*m6=Hfv7U4P_dtVUDL_j z<(_e9>e@|VQftJZWtUpX(5OS7XroDe7{wP#!734MvfT%410MA8V%P1{2mH({nQJnT=Kh~fF6#bIsb1 zo9OMa!n48snn95GF)Yt>_^H))A-{r^I4(3(XZY>7&@7$N>v5sk`kM7+P0dJ2G@*rC zv$TUn1#AhHs0VFiwuxMu=~!vU5i5UBR9seRA@(!Xx7OtkQA&09;-VKOc@)krdePTt zT9q(K`m|9UWCuE+2q=SF3}!;iZH#$8$pwxWizlpNwbHbh%U3#>i{gCCb!O`098s7K z#+fyO%UO7Aok*-E;eQ~)%;(&MsN`D6kEvP~6Sh0i89dhU=S6t=n1=^wV?}@Q=3NCon;2h z6MAT}3Q_Jjo@>xqE#{O@ugz!o_v2$}Ogpen0HOPwbLiD-Ws5sqzsk5-7rTzEA z?`wPUY6b25dyLO;`+a=u;8%at73>B<1itm_Z^irXVWu~^(ImWvA$$?5S?yL<`-BNN zz%CT(@}pxL%fA6a>yVcM7qLtiTU4Q6h5XoO1(334z4xR%<|eep!#N;kbJ#4{dQi=i z2_)Cn(>TE9x<#yc4L$7$;Z>jE&+k=~U-TYF<#a)k2klNg8}|+$?&*J0Zbjk+4U+G~ zvpTugJ3WPE-iWh$J;N}zwV(#_R&gOntiz7|{#0j91lk8Wn}wmk(P|YGi~hp!|c->1>Z6Qb2+Jj}!wk zr6it~|G+>6*9t2~D6D_mg)M*f!K;f=|oy<1()n`%(ajw z29P62%!g&D^2o8|k-?I+nOnL{E{q1#P?P%|ORGOFCF?BAZ~8h*1=IU`scU_Kmgrkx zd6j*$-&$1t@m7B=n+v8ROKUOo$Em__7Y!pW7>Q$tIRbFDgnzD08!#~?ha++v+b3XG zth4PUGnFhO40+9PLf)Aehfu;Z6axN()_Be2>)AHAg;09D%ZlqwEfAk60`axp3EEwS zgkn8NIzo})uGg$6w~Zd+s@ob@(O=wTJe{M8K{21rvoC+_b95mLhu8wlyE|3%`LI!5 z7t`!K5;hOh?Cd;CBh-8^I*iZaMZ3ZzPCql@>#4(T3`b$TTVbIzqf>{n+iDmJt@7kg zFSDi0`qNAAR)Xnm6XzoRr?ag^UhhIh+N~fgB=IB8e*HO$!rN*Ei~PEcwuoV8g-+Bu;-3mW}!ixSabbih) zj2PLcswm^Ruzngu>8yW!`?lYP_uzGN_#v8R=?tw~8Wd7qZlZ=X`T}M^&!R6swuki8Yg;GY;=?0aI@_j%T@cMj zvVWy<7M^!l+-=SBqOAAD2sf2TSfj4HDu_#(WcBue_Rmu|J~xh8o_#4^MEQ&GV>Hgy zr|05i@o|2_U^R}@fdzWpMVJD+^-85XzdtVZ_5}mXcl>&}cEfY8z#r=h0H0BnP?34cQ@!$c|ccRrOqC|9li*G$=m1 zfsHP-JK1~=M;m*GX~}wblK3p9hYiNM&}2sO1?!2t^o_z-(qYu1ld$##=FWfOPa0_N&cnQj4%1SLjE@oelLRETTJ^0y zvrORBwsJ%{WiTm64m?^>wRkiEM6DcH`rlGUAWYY64rB5nOXBGTOsMipmVX{(X>tMf z!XURphA!lJ&Cq2$Cx)(;eol7rZsTmSn`6t?`Z(TtUxX4T6ysR#sp6P%K?}HKa#w#H zrwj*2$teerHrus6M*5f)a3a>TeJ{{iG3Tk~kGzqovtq_mBh`wz&Wc6HS=C-~u7PG{ zulS%vt@U-@WZK({_V@dll$J{|ys|PrG=##9Vt4`8{xKEUdl`Lv^!5A%MC9daRVP0T z%Sa{`AE9wL&Cd8Wa%Lf9o@e=_xz&IAc@$1dBcc)L>to-vOh@VJM+F{{apw+|3dhmU zls+z%T$}31$??hfN)baB7bQ#!!Ye(b+yqz57gJQYN}|NBV{5X z*it-Nd$rcr*wx|{FCL*Um*O)oUMZ{OYiq-;3smN%h8nB&8oz$ci?3AT5iefL4ftbJ zzL1#V`CQBvo$7neizE8t9THk;D;{hi99A6i;%R@4c3AO{7Z1RM z>-m>d9{*>>GhQ4LMv`r4dip|W9`_=$+l?M*k-o=^d%9fD(gVwLz-L0i4X8?HFojOC zct~}Wtgq-2`#N9&B|)OZZOoSL@29G<8Cc+pcBeY$#WMo-OJ2NCI`9eg(lH3mV6Qkm z1(iD{6!B%mP5S6DFFt=MAN|@I--s}8v0of6 zgJ|=<2DTlb$0}=WW-90Bz@lQG@Zt>({T;EKn*F0V2bxZ)^s?D(TAgGmFP>;+s^5Rzw(4H`y;+<7K>w{1 zD)1*>yi*E%t0L_uTD#Cl|GNax@4R@ceD<5_L8<*w4lPNQmgL`?6YcKZrgN!~@S^Ti zAE(DTG>?}!L#Vo6c=4N3-H%PT2Np|f`w(+nk2g#KtYVr(VXo;1ckh9rgRG1e(w39zZB`f9FNUjC$$1swPcfn=LOxZ_tCYMy#XMRVza95aPp4TP4L%j8 z#Ujk3+39Kj1P8hbc@ z{d~3R_jP}L(kCiXEApv+Y8m~zRW|OcovTzLxq^ZUbUH)ro${)pHY6Q;SG_|iS}X6PyZyd+lj>K}V5#4yw#;}nr?xEkcgOGF|L+~+Z+9n} ze*FIAYP~x7?jx(t`FH>OUJj&jck-awpx&R{`Hp{8AG&tn>TG)lu0HbWL$d={OJ1FA z?!eUrC(2*z|8M_pCD?;%sT+B8o`lm#s}`*P{{5Z(ev|ZFyO32)*XYLICfbC*fB#<7 zSG{?bLkB3~ME~w1>))}AzfJo3-Ts}vvej2#lmQe|bhWCcFjM#UwJHa4uDTdk=Q>&B zR5*W$38bgI`l1x|Xv^>%P^8!c0RPcfuXy!H`RcQZ$*Wgn&?HCvR7>?qDpdRQ`Bz?j zrg41DtFIa?12Re?BC0y#)oXhH9NyE=us$)NGSfX?Jy+WBbPEes_a@anI=erH)8wDg_*FU_-(@`}@i%g}UtH=wu5m4tRe#vBoA7>--_F4yg~%c>nY?$!1}(I9 z+Wz<(8u#n2#>qPGiDm#J2~}2)n?_K@_j&azRs7~UpedC;*-1of4bWY6Tqow(V(EWz zbi%89`}>NibMniWBTrJ-AYWaz^Qsrv-xt)xw#cZeHYH`|WxLSN#Edj5H^sGkQ zHch3E!`%o7XdspEEq<2WN?V!sU?t@OBHve|fhBp&T;+0<9qjI18Uai?*r*rD|0>XO zX{OORh+HWF2X7kjYS?rP|oKF*__?bNTA}qo9UV4y%gHm)BEC)4&LCtDG$idya;rE%q76mVl!xL8Ve3EPF zadE;TxD+_J(y?v5(^r2$8gs~@vv@MCw3HRB(#O-exT_ZrHFv?MGo`ubos&(5^-KK)3AU2JnP(=U8_ zvB|bfPa*MKJRTO0>IuZAkN9-i;V-qe##(E-KAA4Z9RhpNyy<@zIVt++vNZxx;okIg zE0x@BPhaurBWnNWwiudTf8|qR7N+ROW;6ut+4P8yOmk?BMz-e;U2`TAZj&K#gk{ywnw z_oM%@I5+qAqwjxdQ=dNN(|gqJ2U~4bT6Nd}P$7Rr>$VH$(+5=iLp~+`V*0Fe3bE-6 zH9Ze6Anj$7CftER>Lr$;$M8lYA7OL&}>b4!n zmI{qcFPp?y5oY^ANkO6v65ln6@1pRtsQaglUf-|gb83IU+g2~bw{i3Zl7Clvm1JS* zyEU|aYhE3uWl*R8(n`1d`o)i}7mi)O__=xUCRU5GHeQG`H1&J4{a&fdZog3~b3iZF z%rLiOi9XbngN}Q9Q|B0w%E@}_9Jj$ymwUpe&hhkj`uUB1exaWq>E~zqvFOL7ANvFj zufg3jN_c-kKR?mWOZs_BKcDF5G5!2XKlkb94gEZ!pF8w(Nk2c(&$|;ijEBp^=Tn6e zoqE?F!XY~e{4n5CqV%RC@XtINI)HA5d^$3I+uw()5f^YGhsKB{5uXkx(?FXJ_3@O* z#iZm(goPyO?RVHDR}s|otA^zG9-y07a3ACS9-M#XG1>IB@tY2*VV$}c@9!solUN1_ zD_^bPoCzy^q*C8@;NQymZgWPlSXf1mT|Y6VAp z`ed{~3H|dBJS@V4zFLLw`U9>%@%qC>89h}Bz=Y>@0YD@?)uyb{p+aHAJ#CCPaDFXpWv*69NHj}Q@Fb(ED@7j&QrDIiFq!g% zgr-UI4dX8br+Z1EoDNPvkS8R~$0yA}WEiMg(XA&^u!;m&OHqeAmar>tC=uGFk{M6t zN)r~!IuY{QEo^}TMf&=jCky5452_s**j|53k{Db~B(wU9GoE}MiX##r5mu8G`@K~yjRZfel zH7cCLLM~UUy`-j$a$R4ogk~#mv~bkkS3FTR{go%5m5*L`gZqE0 z3hpDGknlAD|A4L?jC@7doV2JYBzoJtJle1k9h~b#2Exgbwj+ zC*hpDOfiN%wjDU;b`5?&Z&9-Aj*x{)|d9ysSM-n%?;=)K>(7ZkM2tyaG)jD{{FnuKv0!f_@l4_nx*Ud9-pVHRdrP7tB&+No&>8^Vq;oj*G@Aa zcQRb961OSUg%W@=@R~Fa(vWeSS6zn>9?-r}a-NJPEqX+rd(C+|sb+s#s)K?yo@==- z&r^$2Zu4B8D4M5qs%jqBXORMt64oh0k&@M4iNnzIqE0E-^`fG&pM%vaj{W=_h?n_X zJ!T z&-k2_#PbCz*o}taqW*uK^SMH_%oVfG?bb#{L$d0s=acz4SO$VvRXhQjqD^gn#^(x+ zGym9HW{7n^l%)eaUyCSRd zX~gCiWKR(3&FC0OSd@nX4DA3(`ad=MkS1{WE{wB`lfW+Y*+{pKjvF z`GXD#$o#NF*fD>&g(9DI2s`GAFo!lzNPM|V)-nIojZh!+9n3wO|GHBQGQZy~2ARLv zAqJU0*&zm*-`Rg52AN-8F9w9FzxT!O8}a)@{N542m*V#a@%yeW_DC)EX{#9` z@qzf}S-XvO6A$aMPMgGsT_wG!a{>t@R^VGc|B05x?{a@vAbSip|4r47)L@U`Kuw3p zMKDjbA?4K?wz~Q6l9!r;M)n|T@Ch%4Au6uq#wxhUAP`PkYgOjI@VTO&o&Tr^S!;H` zb_CU$5UUk3aFeU`c>arqWT!w3KlAyI1OaPfy(=}D+rqZ_6vg#(vVxr3d`{%q+-VDy zj>2;`clm$Z0cq0Q(Z_R}I^*-XOJ8^!$U><&*j=$l6_5Blpkg+pS+Am!%_2TWG1h#j zkLM$-cvkWmiLqwjMrM|Co6TbGvRT+Ia-J32BIjAvg+*u6Ei5`qwnfgfd8f#EHoM-K zZ?@P($g}efggpDuLCMa}I^(c#wO6Rh5UGN5DGhjOlN;HJns{2pN+}E*HAc{X|sn~E(R@PA)IX= z&wbKgc6X7!h`{1TgW&Zm=VlKePMej8U45V{_wypAYnNMn50vXGuR7^z)p4?$OUv`gwr*6u3($VNO3^YTd`|8K05xYW9LF zN|4!0Ws8`B8~51@+S+EH`0S;U@$v1&a8lAIg+eiDyc?qmIrFHZU-|4YHSIp{Kl*we zP0MK33u^*F+0kZi>a#>$dp3DLB)5Oa+po(l*J-o+(#PJ$na;d%Z3$6xC#C9yB!@#= z=o=iAA=5C|NV$mAK6QX~gEjjJ% z2R^%``re@l`tkddle??;$J%794JPkrceTm*z43l_SD)xB?YRGcPIL|4P4?c~`tkq1 ze}A%i|K8C5HqqbP`umfWHsSci>izNi6TP`z-O<6)dG-_k?)`i1{d;`^PjC6`hYlwx z$Fzj5n3752aE^!B(~MK8BDnUaIKyEKF}$;=_DGPi=mVjP` zZj3Ks4yOyzL9BZIF_nMkA9An-!v-xPJ{umSTHp^yVjnKK#TKcG!x#A`4que3g)pgF z#C(w}dBa+*p)G1vDaChRt-3|;)R6%tUb9wbT1k(;?w5L1q0~tf;2c4r^YqMQj*69x;C~0~W@0T=9IrDC&_H zGp}J$8^6L=YgPkO94kghSzn6}D5AwTr^^}L;(V`@Y<#X`p`FC!vR$468Vaop4 zG@}v=w6;}?#BTO7nn!t*PNg?cjGV9ti}e4Ly$?|YiqE)=!z3=ES#QuQs`Dt<^i~cE zqOI5`;)(RdwCjIZ{pJbY{e5hV=;4|zl8&!B)alWhE#`cO>I*EmI}hfwMOR#E!E9+q zVYx8oNtWdr@pHJc(F&X`x|{@Taci94e9V8%7Ux}!05~MZ0}(LSK>sF`{Xv5E7H5j#qa5%YsZ_JEdyM%kK(WaFe*V35KYD+lM?lFQ=XdX()LUUQX(p+9 z0)O#QO2O)7%V(d+t|Vt6H(4g?2*1zjbEXHOT>Ayj$hs06oJl7oEWB&!$R~h7f2 zV`$C^hNgdy#+nkSUYys7DZ^O&@|5AX%2|)JKHHO19+s=fX4x?=DW1axUP*BBlBul6 zOf^;|CG`fXh#M3UOW0;S1djmV;ypV#Sb#6ZNs2@z_~F;ce7gYMKFg1@la0grh49?K z7E7(5CLd>TC>Hb9`kkCs`UQBlk`6tewR3;^@2BK$j%J=Hg>(jUQp1yhXs`jb32*G4J5*~jG@Q6rW zVWcZQ_~!NVHxHgXdbs^jnN`z8H0%EA(aV?5U%u*tci&>B=~_fSQVLe*Rw%U1k|}F< z!LNT_-+TS0qYFhDmer1L4qv@`bN}e@_3OiDKWu*)7q6-hXK@K`op*iz_TJOOhxc}U z{}x<5hP%IieE8_;LjwLz*aOla^^F1}V-9Y4lxOl|zg_l?gM`J4hd)q04(E31VxX|_ z&GEgV?3a(Q^ye>+wu)`0h|-MbFOLp?!qIbQg1HOPrmuhyT6}KF=@wsACGe6aVDwx#-C`+k&e^S2rHm~vGTl!qAg>yHx>|qb z82+-!as-`a8LtI-;r@Pzkuc-pkVqe#^%xH`!U&o#BS{loMr_)AS?%vv7#}lBsq<{c zk^VdGZ??P7`t4S>60l8u)^E3<&-&Z-_gP=o)<4nNg2M=G);3OAyS8!6HfkGZOqMgA zuh~pz=QUP-8O?QVVZ?P?s;JP}haG?KDL~9>wRokovmJR})9hTW7N2$YaYv?Ci0E{- zY`=${;G&%b8>CF2h&Fo1af77{)(yfgRbbPkTkADDJ|Rx&i&6);iph0t@uZRDxdnT~?MyEHHsl{5Tch71qTXU_mQ~m`+N{{##aNGW>*-*nI0sntTTU5a^-&uR2_OWoJ88<2z>vH;lR#%qu+HGPIUJ59~-jfwRRz= z^Ko?23}2~JHe0)O*B<5dywE1H^NT3#flLwyQPR_Cg7?zfI)L z_+$P3$L;TF^E;?}!An**lc%h%k>{-bnv*x1)@j;$L>1b*9?=cb6kIs&?E$sdq{`hq zt@rL+ZqzZ8Eab+X+?3O#wyA3bN0YF>zkN1OeLrbEjZJWHkGfMMOJ7DsR7yU-PSE7? zVsG_>#Ro0ZCmDaOolqZ#8Yysla0AP_HRx=U0NEVVlWXVy=H%bIarSG|{rx5b-z2B* zVHDo>B7tU4*;Y=5D~Davy6N`nqy~Q2ZXkgJ8u($maSBm)Ez;=tV7=LVdi4hzezx6k zF;39(v+b6vBxkGXlAqpgyYk6aT;*=o0tj%+uZGH%EwpukPh zMuP`YY%z|+;rt)cT-1^!_w6>j5tTmjmBP4ROSk4t^> zydH|~em}dRl{b-N)Z`c2O(y*VC`9y0q%@)yyS7Re65_h#e4{TZ^(F7_#LF88?+-0N z>f5KyzBOD)ucKHJw_dxhn~vp^beu!S79W)*0}OvwXFng`Zj!>GE};0(^lbqLK2f6@ z9vag{ zH2oaSAox>gWK|jEPhKBAWucLg`+qQ<3yrfXDdY1bI>^y$_G(qJn14s)*D41QnFuVI z=@WlV_*qA*M{Nos(`Vr`z}5Z!IMv7BVU-`UugxcmLrq2hxy}+c)yK2R;(<2T$J2Gb zzyFB>ZN55aHu!ScuC-0a{n%2U|=t=W=pvtK2K9tHt$#{}A1*Vj*> zbP|u#o7ef98>h}SGbBYpE=>*eMvpT9ywQKhvx8h2==*Rw6wjoCYg%@E|3qg`{s2(l z2%x?ppx(IwNfDN5!%`L8s|ag+i)>v11SC4R{1$|{Nf*@!^M`LKrKLyOF6&(jz#X`$ zt(*Yw=h`mu1aPXVLo1|<5s#!~8?fPRU7V}A60u0@S*ex$cTJZ=+*rcMIK>-M7CC=Y z%UekoHhU)39_WBcH>k3W8CQQUos@5sA@wO###;TNCC=E&ol3XoD3)M9ZO(RNG$Eo$ zl$Ig{jIa}EC+gezz+#WM_Us&NY{HL7jfu}UQuU6Un$F&7T>xnrFEvI__rMV@g&UlS z$m?IiqBjkzkBhPgA%lCw1V7I5GfjWTVBOH^xBMyxmKT!8_iAMZK0a?A5sf`%MMSaZ zit#hJ$7G7#{<3}+48iz*oq`PJ_!B%6_b|T1`$l;113b$QAHoAMrQ;V&v@QM&pGM<5 ztm(%1-J1R0y@KW{3%}OcZ~vE#?LEZozuZcoDMH6=@I@2?1QTl!TrFkU+rxhsQhN(_ zBnqz&Uo|3y=H+Yk>$8pwk7S)6l$Ss=*KKI(RQBc{Z`VyZ>J1K8ci>ObKbbmJI&hfi3QYf-Q|9PMJD5DOl}X;j2_^{COSRX#6Y7 zNOSlEg;1poSsxLRmT@72M9qI`SfIAFrn>r)Wa{%K+#=^Zo5YfU<9mDgSW_RhwnYk< z`2D|mZS|Jvx{UwKGkx68!&#hB@k%KO6p0$sm80k^>(DxGO2TTIY0ZweQ=!Q6rXqW_!nv44(L{ev;_cm1zLA^e z7`+n~xZ(?aQfLc(T#Rr3{hA#YEQ(mYY!;2JAu0Y(*;PwArwF85Vy{LHy}5|bHebBj zkQ+1FEod%^hkB0EBML*uzlkTI)c%R78^-32&_>m_*%CH4kw36SC_BPUJD89vkKt5Z zoR=5lC}LHbM<3&&jBVk9A|=6aCmkOhw^fj}?gcoKv9IG=wkAVU2Fd2osjQiz`-VJ4Pd4?jE-ePFb@Y{D5oc*s zXB4;*jr}0Vb9jHSIMYg&VXJlY&V${c1ePg5eH%{@4Wyp$w1NcNjt=8TVT^E3b=Pv7 zPHKypR~PBDKdvA9CtA#|!Vg(qJ__^X0t_amWLXGe9;GGsnlbB+T-A1s6+z&ZTbZQ8 z!D=ay64u43et_cejf%iteFCau4!1kvR&{--uT}+~MZkYvjQi-fdLj>Pto1RxZAyn+ z@HECJ%6*)lOyDBF=@_f0o9EogMptp^upR!2#cfk_2vH^J1>AyC8S<+$;+1}YF|EQ$ z@mbppFD0x}Fm&@{RK|;+!*phlT>^6uxIMa9<1PW-B%poJzn5 zje`|%4H!>y8Eh>D&mc+9}1T@L99) zTb5)Ef>}INDX+5DN=55N>D57RH>U6r-#qlf(%P9XqmvyG9qE7-*_?vO8;54HR&k0& z`XnGRj53E_blFJa){AnpyxC}DbpsBGR?k{nbg^l(*k^qxrO*0QMxXU%34PWN3wV}a zgAIRT#lf^FHvg+~`Egb})EwfCN0#oXsGx z+lf4sJT+Q0k_Kcfu|R7EF}lx{96&X}uKR%t`RIbpfm)lc$*)o!te$A$59|tJQjX8p zbe3U}D91bF9htK3Q*;@P?inv?Dv5mr_!fWcxGz(hkfdEyPR5`{h?#u0W()RF2Wj+8 z**E&h3j7M1vgF}v)kiN$czSQE$xCYTh1%pV-`3=1-Q){s@|PQ$OxYo4)69iX)XcN| zOPJ4ajdv;8A|u2!;E8GW(=$xa7;)qO(`O+~Y|u<7j0P$wR954f9`yl`ebzcQr(J*5 zhPMTS&X!ErbBr@atr*8^@Z-4F4;C+tSzMea;RVEs=6zrn=y2rX6W>$<2!+@iaUchd z*VQoqD0rM!LV&mWDP<;$VJBpZ$KO&K_<;wvvw4nS-8;r&~Eh_2@` z{~Nv`c-@nGCb{z5-WSD7xlh$zHaCAH%{%t+CJ3*-);nwnmDtOFk0#|fS~Ih5w?a(R zrt*S0M~i!XebB12M)9Q-xyTTK8ZuUBNeO2gOMSJ18{MeR(b5$vLbSy^mN*EMhJeS4}^7@~^T=Z~g%0!*7WDG2(sHs-F)xAO_M zP*x4T`|GFr6cFX9TL7BA`jLz#$=zz_>BOz!>9Bikrsm=ecu_rGfXCYtea-ePwr61l zgm7N$sAhY26dqtv?wK0Jm+*g_cbgYq)4)bnxp)i?&oDsho=KWF*`!xHi|%R^G(<== zS!$eR%jh3!)~B7#I@(!uSF@lYO|#;(i1P9uYS^!J!#ZTTi(f$mK#{X=&Y*Pa@S28o zb&EREbWHdq_=kFSzXAEi0Ql}ZW8MDRcWz^=VgcE%Yk)pyJmli*f?-tUtw6( zSZm*#s2i{4GO(#^R+xe>T>!tbX^bghvz%JW!qPvj9B>p-gY``ZP_6;0fT3LZa%eV| z+707E>p?ByMRwj1^}ZADKulRN-LO`9V|<9ynYO5aD`l9EUSt$MR$4(|wZYR+9n=?W0HmP9Ka*sYet;tei^X6B(FFF%IkI3NWTv>A#?1eq2gxhSzK&C2uk zOhDH6mW^p_+?2zxpN)r!EEGSA84~#}dX2kNE9eONc1j=VtFQL|(?3^`QsQLz; zS+k9)ua26U4wd$+DXfK!)%PNaweX6XK_oF1X|xM~lrJ{OUciZciWxksFw{&K7qdLWpIXBb_ZSd8&=9 zp$8=E4?NW@Ycz!Wci=?d4S0kOe#h1x)S$6_5W4Rkn6n8>#Bc-{8|U~8a(UEir3Yf`5(2L)-lpXi!8I}@A|6mQFK%;g11tc1hzX7XD!2wP2 zXfqa<@W@!8+VFMswPbUSLv-Aijp(yJHUWN7+s zN5rQ$jU0T@44|U&rvd4Ja@dA)Hpy-W<(6ZnpBt*QQ?dJ`f!~khf~)z~YMB={@XKrX zflYs@fL{n8$XoEsI^kDzz_0qV;g?R*amD}}lu>>bry$JUYs;{N{j!;0m5)jN5 zzijIq;?GB68Rc=9yg7s&_c3*C@$>arU!l9EK3kaA=X)US1=+&BUCwuLxgaFN7Vduy zjUW?1w(zdc_YzDBf5@}yyw4V+>+>FhBJ4gm#zD7?AwLSwg$?>*s9&uiG2^eIQY3=2 zs%B`;OT`9YFIugn>pImnZI=_gmUGR>NV8c4-f1CN8yHwT%Vtp@DdgJzpibBJOr&^Q z#`oYhT~{1UJVehQK*zq0&md~e))#-|&Rl*&Pr}Lb4#i6^Le0u~ikZUw{Z@IQTK!RY zuBql1MwFI$92H>akJ{3Wk2Ce-S5evin1m?u+t!C7(4O?!8c7?AwkJr%EDQOdI;t9r z>S)2nJWgjA)uhXzMF|!t$MMNp*tisbA6OFzD?ElNAT3oI?`k!V)J&C@Dhhw*&G88u z1Aw#6^L)4aL3SQ7eEpS+tKBWU{W>guZMI@r?Hehh1MHW)iIYCC-EYX1Pu^&G>&>Kh@!{98o3`-YMyUb6)_U`oevoqIcZX;T|Nc2lSu$ zMNi5+zN+edd3vU>lR%G5^0>L(qW%>8q6&~`K)ug`eoK*i;U+t`$}jX_u!H4m?&4!Q ze6QZy&`f=AvkIh*n&(nSB9?%n-q)DiaJyCAAPlZn;W|;XN`J zl1B+q*{o{!ES<;Lik&FVb29ClK51Cugn`gspx*hYjoZ^yDSiSp&VY z+@(#t-R@fI4Aqf(Kk`JQFbG>^u*4dQ+}w>XN>7TVV$tR{Yz5fD6?wbW4@PvnTM67t1{rDcJu-JT!WEf%ZvzU8nc^ji7o0OETQU88 z?ZtFf`sykoS>dO67(n=;JkM&KfHzbn45$JZo=XUk<@@1<7c3Nh&8Xbt7mk@qf-rqq zQ$rBmwHCnl8dhObf+j<09 zCe2RYE6D9AlXc4a0+q3TfSHbs`66(@3wLd&@893oyy1IAo4N@%-homqKhGNTth({u zRt>eZR$L9#z3+T=8YoZaiVCSJTb&eyh%?1a6gN=lDoU?-#S^L|>zFEOsI1)h44X_) zUI>}r8&C((Q<{JN{wtlh8R3|0ckKj<%SbeH#I^iRE_&%sQ~yf2$8%%~xCnQrDUB1A zth`{ih?^=tg*mymS$RRFfO}b6U=_0b?qxN9I$hGl{;E_4Q_JvTE9$*XOc(SrQ@S`nk;XhK2k{!=N1X*!rhlye9JS###+$0 zCU2ndZ!mw8QDr6(2^J$Pb$NFN%emcDp>FJZQW2QJj6@TM`50Z(ePucB!`v%p6NGPr zvmm_K>Dkgvly#6qbn4ALI#WQW2QcTFWykW1{bO3X=exVsOX(`vKQb(H9gK(y_8}Im zpuj3DcXm`(7AsSvs1ZOmEANud>}XCH=-bhZu=Rhnqa{Ig$S5L=rLdzFK{sD^v>;sD z*p4P59LhP|GW2^*ODEA4m;-3hIU_Bi3x_)2patQ(cV6=AI%1bH@7^6veK$#z=-s9i z2atO`=T~C$#GyofuG13YSGDuvLJ-Vi527ng*HUnYsp>m1IMnxEV!wwoqBx<$Sb2W| zR=t1vdvKpW^UxK5iWJ;IiUz-jhX<(ft=JwEp;rX? zz?pDKTd|lC7GEKH>_qP*KIWu82D7YdC=tMC#Wh`Y_ScQ2fD>`)JUG2~x;ah0)=qyf z?(3(?*QeQog+L8&6nY5+T*80h}IHa5@a2mZz5lVNYlD**9ljKu+BEkcxSzYcT|pb zUg!FgF?U%788Uk(9zKC#!T?1{)f#`;H)fQYa_tc}T{;1K#t0QLduI1?U%wWnNJ@t8w!$%<{rUu}pMwo@yMaf2Eb z%plB>vvB{P))1JDo%D>k14xu`ibfE#_j3K{>=vaNQ#VT2F+EA$>Dimuozla@Js%i< z;6`u6-hB=S8b_T6LZ1v~0zhNKv|$cRLRpfYNf*-5%N$-eG?+0fvw(m0hE&+;Y8F+J--H+>KOD4x9 z{Np@da&N9R8vZ{W6KkCFJ{%ru$>HJLfH}|-orHP%JO{xLPON$HP2W_83JnPdA7ael zCk1u=qlcgi(e0XTokY(V@$yh7(XkU~oldW7azf^*vk}&S>OGaOl4_`#z*dics)P&} zAJbWqPJNAqAbD`BK$BR62kEry#nL;*js5jQB^4-%ihX@FlaE&m-mCy z175=8COD$zkqJ>OqNm~*RA3;E>`f9K^K@OyKQL7^#4>K=pflktr$e}0ok@u* zy$#Bpq;^?}jx~fvsM5O@gL_lGXtBruR8R~QO9ldvvMB(sKy>QPbWl!zm8#5UG?~WU zq)6soV`4g2$r-(}#T;jukjv&--@m4FjiX-3p}#MVI`~vN=yIz6HJxXF5)Jc0qG4YA ze-IBUdi8G+uPJ(6wf^8xyb+!`@DTAFRV7F)!4)C%cm_HyCAnWhlB-|}2TlqH&MUmj z#cEWdLNzK;eRg%G@;cy2u0tg%)B!i2%skG=v(BEA$c^1qV$TRa;q4`yYa0g6c9h#) zPckPg&d-&6iSft~@HUix7>JleWTMN_h87w{M9fa?=o$Fcc%kJJQXRCI7A6|yl%$uD z8Cu&zuXVBlW{ICL(Ho;gj|!S)yIqo0CoxHdkv;(4cI!(~7+HNzN&+M;&K>9&TOpE9 z1@26r@M~98T3Qgkt?kwR<;%#Fajt9T^{VQ^YR;hkoW$f@=kBb3c4YzY<#ohjD>-nE>_gp#2M{)KU!x&$o>B&biP93VX+*Q|WS~y7vXm zs{kCKtQ%$rM3(0`znRL}F%0F&hpf!jfWhEgy$YtwI1Ivdq6mFULwN(S%do-=&-X!G z?Ilaaoipha&2wUZ#4?l-i8kJgX?P6N@HnS3q&d8RIlR#A3o(Zm`5flvx-Vb7dHV9j z35Ytf=#hk`3giiK0g(*(fbtaZ@tmZwW)hkQ$kIikrAs8|6Tw9|{59* zr}{x)q9tTaraC8beP=z4K7fvEg7Jf?Q-DxT5XAyqz1(SktFAK={|!c1!l>WQbeLPg z`NT4H+vGu#=aQR=(u)7Oj*OVP)1@+X1GwejO@o{fDHb3%3-a219wTA9)Vw<$*f+Xg(%X_|kx(pk!&vZ`_&A zN3z}Kk0XD7Tpqxi;#y%A(gbg6VAkB4E^2ev1BYgA3MpZxTr9omlHDWaa88YP4AAv* zM}5}Oyc?P8_#|}Jc+-}!3pPW&pJY1OunyU@ST*+W3OeIvy1l9UkP=ZY%Q(sVYl-CL zayZ{hQiorqOR_tDGY>SD0zqHPBng(nV6gWK`4GH+%CrhV5d}s^@GA@jh~hdGei=lD z5edd32h=EX1V&M-q*9!QOzEJ`i9^wfU}>u#vCD;c3jT~^lt75eO8v(fJUY+@X7s(e4Ps(5OX)XbXG_M#Lw*Zu4Qo(p*1+F@Fq=>woa@Dc~Bj7VC zDzE>R)|AVq524F+s8m+Jlj5`gW`04G9;m!L5)JeXDJNi;ggwQW|^H6rNacL$(Nfi3L+?bAs9R)r{;k4h`vuCK1zD@FXIC{D3-ava=t)?P#&-->uev zsid1l4-d=NLixbZo#N6!F)D<_s}t5zgXM5(T7HBzPuG{Smkb#MxK**-7~Bi|Lku*n-jd@Ir*2Zv3<7G&yTw-ztm=?|bt&{y>o6p%f(goz+yplw{5B}}H&*sEmbYR+ zUJfAF)D5|u3YZmNFvtsp7J?3!c5HqhB}49!{32-Jz+pmJy(D)LnSh(huT6wzB;12x z5vc@IegvRAa0LFOf>R8=74gJSE5Q$W~WfL39F6a^+PZcF98fU;i+ zh2&ChaqU%nI?`a4IOyorv)MuWaPE2pMMFTz6p2I#s`bfWO=CM1)&BqhJbWqAQc z8RtjQvI6zs-{tbm;y^AhfRR!8f^< zSU88hC9eILs$Hf`!?iyXx^bvnmWE8{XiXW*m$<2y%sraO>R&ml6$n<#Q2ygT+%yFt zI-Rldu$jF~`H%PaHTM8w8@`Wevi6Z7fu`WQo4vPHRhJZViy7gQD22%8Cb9*>-&rZi zZ3|&?cTgeTiMGvrA_~!eaqh+$K=hp)ml4E~Tsnx7J|P?=z|z<*fJ|AW6gpJUJc(1l zHcOIeptbb1NM?dWdX#Lp+LU8?oR291@L|9Ju}=Vi7(VnJ4pmdpHzDpyt9=v9Db5cQ z;uW31cfv=>hL^D`vkGOBUn^D8by7#5RB~4lW*xCoDN;q1(MxTAgV%sQsSKQVp4}DB zNq&8}&IlkSyo!?{0rXs_`Vmyf$`rH);VqPF7VXJ3WAI5CW-6B=^7hBebb$kM!mw6V zB{tqwDz)YKlv+SM-T9`P3-=A+wNM}>!eUUe}l5USQSk>?=50iZOJ zS%gSU1UpRxS@urG4xCjlwhUKxKB}mt&^+sFjX1mLi*)={w|1 zx~EThncYrR*N$OXqck-cY{MW-UyJ?3dXLO; zhJWp*T#DV5VfpA{C}ct3d0fALDjhyzU&oBh&A*|hB`)($*B*;J zcxl76@S-?8_hzWm9eBU5sq!8QzgN5&4N`A@1s6a-R5 zKx!E{k-lZtItL!ygNu()46I8^33J%yU0%;eBQr32jQfN+Cv0+cypWI>4~VN!Ld^RX5q0}y0|;O&NeCb6o~ z>s{=We^o0O>ENK)d4iwf_$lYbxPL=Kx;}*~R=j;?N)IKphV(vY2EkTGTOFj7qq%`E zx#OW);j=t{GSAE9%q3=464lqRe=E&`+Pm2j>_Z+Gv`g}DLfWY)QfVo?Cbx-J(Ufz{df*~9exxZ+k;2tdRQ zX)NE6dV&dcGbeh&SamFw>tl(oyQAoT`>_V5bYQ*9*p7h6m4fyOI(E&6cuxuEBNeSf zK-0!c)N#4f(Y>)#ngU$nqJocDK@g_knmdf>PWg|O@&X8s%C&O(Z6~jw|Cpk}cTV(H z(nI(~a_$G`#CKWrOHtg3zLPxkVfi0H(SfraQawLc>iJ#VRsEhTi&w6#g!(jp*KrfR z^2HU+md*Cr5J2!=uu3K47beF$1ughvlH*}d^ zd)=dyjB2^ZeYoWlA(dXvLFQ8v8UO^9F{l$d(L`u5-iCAWk_K1*Dsc%V1ZcCk09nq^ zL_Z?I!Yrwgt$hN+|AQK5kqCBwTeo=YS@g3EbH7(%?l3_d_zd7Az|1;i>PS>XS&}^KpAN8I*IbA;)nDFxC(J{O{ zdV()c9zPlD_q9{w52#iDTHk8g>1DI2YZ^Y7+tW*Ppnt8MUYfJhOVibV^`Vr0Umt4P z==9RG8mE_L|Mb$FoL-vK(@T>!PA{$b>1A&|-kx4It?lUave{~!UUnwXrOVE&aeCRK zcj?|%J3TEL8%T{|UGuxtrR)0Fw;mx*h_3%vX(jK_?N2FHlxb{FjqSVb|JbhfolXQ#7mb7VH!@Y?K* z%tmLdpBjH^CRn|{f%>lr)ThQ!*X+~T*ZNS`5RCs|DBk`T96S$y{)~3M)?rjb?R5C3 z3=1lJY_dA~Po9jorw_KLL+FEc`j0=S2YHK#t9}4nHMB=&V}K?5StEaLXN{57=#2A( zR@NBx2kxYtBA%^gwl(=bjha8=ABH4Wk5awp=he($wSk67JFr)`>h-CDOt_Vff?A>7!FZ)$ttUgo`UFY9{2+jcJ|D{U9O%X{Ho-rS3S*7pMa zqR4mh2NoFXNRi7l;a5!xOtQfq&FGg-k`NyPyTzApk`NVtw+*IIkx)0DG7H)aowER= zH8b$BJjG(*(Qn)~N9E333eKx$h;SvEtz%y8I^I|5zeJ_$_;yvUy&11_?alU7`a@pn z8aystU#kT(5P*xHiUOs$U{qCILQuJ^!J$J{wJBT^c`Mc>c&fl>wH!K8imIsLlg^y}X8^y6M|KI!!1J~wKE zpD}fP+|{VaC0q|YI87cb2&fW?gYkv?;wW|QrE5xYbek z0*6&|6y~nG&7co2a**y1Qz{?SLt^=HU(-x;#g{LX1|yECNr@DR?ML?6Wa=XC^X zxvnR5^S~WL<&(kRKXXCCm|nLcH60ONr2ti2cH&fJ2oWVjAyvIFsvI;C)+ zs&hYt%S#n=fM;*0TEz=*{tO#Fw?lx7T)i;mF5~&_mRF_y)I@&5GTXbe(t8r5gju>Kv7%9(_INq zqYs7-@K2|+O*`9;?w>Zsr?X8r)3u@97(#Nh{EV#T&>kso#v;j<^2yI5a%zm>)gpO0 z?Kgd^VKaJ7A;<(=opfOIrDY|tGqOmVbV!%U)#zPSi zdej^1g#lw?Xl303n{8`?X(PNE)A0qTfR@t8h_p6zvdD_oBjARxI) zK$>Baa++b1-jZg(TgOkL7;27q#5#Zg`xsV}Ic3#{(ZDX;FYDJF`%#avsk`ofT(c;q za0~eg&H!1R5)=vxTSPr@D8_@9wLzJ3Gk2F(QEsnsr1d^`7h3o#fv$tsw33$g)P)5A zI}2z4tSnHE8}h!_j{+xmcpMb;NW|z7NfD+pFg*7vSnM+h7AhZ)NUv51mY__qM2ujO z^dffp=U(2ff48D&cKi3wy8dNqp?`z(HKzkxX9sY6hg|g0P@Vr9paIt5UzVr?2^k$X)$`F;xZ!^5yp zxEgv|$ec#Fx*c8MXB9NCz$tqOSy3HJ(wp&Et70EarkZY`dAt^r04zGrX^b3GF@1Ac zq3vEPjM9eDD3%skLdRy+-VA`nRS!(5&-dpujv zo9%n|37Ko$`GF2Sb?>lmZqSO(yr;-+kxLl|Xrb0~9jQhmZg@Y?* zxF%fXlF*UXO87v3kijh80W-OP1aJ^OYLk(*Gg;<77*X#jA@77W2FUPILw*G{j!Y+0 zaJnZ@udlEu_sqSB2Tm|%4r1Y$_&6(b?!b;jPCW9*M{DLoOk+q4eF)-HW}vOseIKW4 z;;1ls)eE$_GcWv|Fg26HJyGsxOL)=%rMBT5r%r^QUO5bZb4~=poNyb1qug0k^9tZ9}L+}hG9&&}cCY6!!#=Zpx0XK?Wc-t$KO*jaKadUkkt;EF`Z zq#wZ}=p&E(F$TK^KkLGO-!QS`eKunXx{PFoGS{1oNrqubtznpCFfUt<<*AvI9=XnF zBU^Z}l?XF`Vi<-CrqS|rfUaL^lzQTXBt>5xj!XC^s~Q(gb2Fb^mxkMIQfFNi%iaqQ z*4ypDB+{ljI0K4D=6JhBk3YG&Zie0&r`)tn-W@`JGGM1J+pY~}OCWX*Xm$_x0xq@R zOD2$NHe$gg#_vfY@B0x`v`-EX3tdPrP!fG387)nJAs~XZIVG#W-06WSKz>?X@(~?p zI*Ic^voJ$?#*EQ8z%cdE!pcoVQZLNU66W`^dT21!NIrIEpq9HmV6s)VydtsCspTgV zA6GFY=o^5YK+=*xV)-1ZIh!Dpbe`?>HI*#UOPv#`7%+=@ZuIu>(5oh}@RgqEhbudy+Bs%Ze%66A)8f#15{Ii3Ocy%I zo2+b)&mdb+sVN8RpahNS_=t|uv7_=^8GyxL7?ch-j!5C`t=Oz_6GN$Njy;BalkZxH z@qWp6WVNFb&GLi3#A{S6E6Uyu0&&DLR#?1$G9!JN`k7UZPjp1XFNn)G;wd;xKogHq zI@ZN$j#xt*QId{z=Nk;h(EyGbnBpq%Rujb1d-=)-ViQat+(tD&5b=@6C>#dKn?f}? zP`FdmVqpU~O~6aCQ%)^&w0sK7Fb8;0(6eyfP!4}!6`X}Dud2f@)?s%mDKTh;r*d6? zy3Q;J6x=(v19}z+N;ZBiyA-A1N_3Ar)MIA~JLf%dhImJ81LwEQNV9kZgfg1TQIw~X zV7ukrbpa*2uvKCW#At2?CU=}RLxTd4Dy#~6P2cR&zv%cHjD!x%l8uloFV8F3d+9E& z1M*>|6^ByJWTHvd6-8(r@WjDPz!;c+UuRFjLoV3Cju}PS_eC*chms&$UpFK25*3qo z0EBj775F1_%(>Ys-%bw?CkciY;0!Ef5hbVYiuz2%USAk%p12@oO9JU;wwz{;z9_quC8!mwkJELr2Qy@Gx+WqtuI+$67Qgi3C&Cg-w+EXYTH7bTzd zlPignzxw~c-|OU}I^cIO;K{ixDqBdm9Gt6ucU!I+r8hZKox2|t(J=lkc;S7lZ&jO% z`LasZlQ+BWtP019JH9dMc;Ou;Hvskia!tATiSyJ47V(^b9hS_2|3+em^I}|lO(s_| z-CH55?`?u?{JwB+pm@xoi53HYP9y_iLt;$%!LVIwCN)7kH`1F*0+f7X~cgHi;c{ zp1tzYZ`WxW1`vjtc-+AFkqGGRI=QgbJ3P$Uv`X}AZTW_5N^P+yn%qe_Gd;E^kBMj< z0*co5R|*HduPxtycoMsdl?eAhcKY&~Y(UGvZNN72W~!}DVsEyf4Hh^&2)X-o*m>Db z@tN@(*>KO)G=|NYMD7&C@K$$EZg9N~87~vtYLeB=?(Jq=zJgj;Q5e9Xx%?M_IFK;a zsxZ&TXJ(+TzQC6}lDS(%RXs4teC_+cc(Zf~FAz!ld+JAjG=>EP!alL9!-uLHOU%>& zA-xKYYQFGLP`_DHb>;*47H6KtzC<0)W$4c!ULu;a*$*D5pEtC1?0>{ioT-m@=Dv5j|j?1al(U%mIzsOvay0J3_p96N`nK-GzAzSRZL5j^G z7|v8O4gD~-)hPB>ZhR%i#*nv!B~k)@;%(J;;{_Oh$IvUFl*#0*_HP|!XE5qk2}V1_01+e z)RcOuPi^(_%u5x9&{X2$Y}(ZV?nBm50oUnAvW)56Rv)m*P9CT^MP+z1JtOKd+(-C$ zitp6+%f60HPM8gdIH(z1%Li~Q9k!%;(A(+>L`&s^LGVQv8@X7A)3rjd30ls%KV&97 zEwPw?OcG_1m@}ZMeiZyOJqqsM*JBZpjwCsl z@Zp#jiVGbqDx_*8kd#_NXln9Yb8&MV(;9NwAfsx9L=dxXL;!RetXDKEyR z!g(V6+UhzGJ^*tkY$sQ%N$4LQ(h++yyp+an8ph-8mX6f_`Y-X$w8j}LkO;44H7oaXf>~^>!r{nD09t4$#zf!bdQVDgBs-FDPwz4^2Kdv3ntW$CS&Y%&BG3 zWD(zOuRvW4f}J5O?Ay)SeZ1R!(y&m{rM?ulrr^jK1!v-t0R1|bQn(*X^|>2if$dg3 zp{%UF8-KzkU=2JJaL0?F<@#H1`&187ZD{wmR(IQKf=$G+@2(;`(}!5ey$4LLlRJ|Y zLuGL^C$CGcvLyTm$CksLl$ivKq;2U;@#dO!=)nay+xp(f%Fj%A&PWcjm+lHMzoP+b8$E6MF?DBG3Yd_rK^6eM95E12c!c*gXk%iL80{&VhaeXp z#vIey{0*DfZZ*ww#3%jmkRJxIPE6fqA$`CApg1OC;*PAbI2-bN>g2)$%pW@@@$hbX z#DAJ49y>F}I)PVx0~VZ$Y2%M&dyacFiK%;bgb8iC2u2HFaR0tIY@tyCO@hTP%iOVx zT(N^0Tn7}kg(4iw*0WtFG(zx8$%2*}04MCF$SNEGgA7^o;68-q(}jG~JUsM9ULHgZ z4Q9HaO@nt1P5z|o8!+O@Rq?#J*5aQI4}Y}-Z@Yzle&gXgJpR)gwXhVAwE<~tMxbmr zFU!CG6Cl0F4R0i$Lnz_NS(~M-%`xHg!1T&Rp-~g-zhQx{Z2 z0iAj?KfwdXb4=(>2VsCivs-M~d{NEu5R!!sBwJuJlY=2oKIDFaCoi;-dKxIoiho~e zDsLkYR53bTyXVbp<>{jXqTE9s)-HX13P}gLvVjT|Wi6M4g7>@`1cbwKtbCqVQ4GUS zD$Sj&r&F3FMIJ?AJdB*8DBi4i%fw?=srN;gJ^>p#-0X6BE*h_t!=LOlPzyDg$%h)8 zL^DDe&VAwprUo;qlgY33qR`o=3V#&UByt0leN*|YfI#7j&oRhnt7X!UWV4s?)6uhk zMke1n6`q2EM$OWA`%>3*!<#{<3X?oEo|-!9^@P7`y0LVFnNP)~H;eoeJMp;|4!HPW z;?u<5cryr42R?{n10)&5g(%sfJA;VIp%b%E;3RP-kF+qA>%buPsp>*^bN<>Glm;-q|8gq`2I&57LzmyX^nLN4d7PIb!G;7L4kwBO~KwJ*H82cixGK~k}2Mc zV;yUeWo^8}>lvhPa2RUM9#!oW!dIqOM%vM}-F>nnJ@}Qtu-04xWOy@>5>0hoI;+&u zo-JB<_EOi@!l`zyFF9(F7N3x&m}bx!&u4*1Ia)ji`0B=(F*U^ZdVi1RiOw(SOVh}P zA-~22ileb*Zrm84p zQ`LPEHjrkPg=uC+Cg0a0InnFCqIm5Ey(k1ycNB${MPHM*h3qS>k$oLw`D>(K_x>E| z*T*|ZzrOq5kbeF0XMan-zPpX|>$^KizkdARl79XCxAg1Nq+h@Pg`{7<{Vn~vS^D+k zP13J_m8D-Fne^*tA@ur5Jp5jge*N(0OTT`)z4Yte{~hVqJz4r?{Vo0aTl)34^y_cw z*Da-AW+DChp(_1ignBOhVzMhau_E)D%K2{)b;;Fyj;KpfynkRCuDoFJCOo6TEhJgy zwUVqRO0rCpWVQB4vQTBC)a;j+ZLxeaJ`tyvuK7t~uIpQbYQcmfpF_oEE0MyWY(*sj z3d-6$g0ee^#wPzl`Bsw)tcV9b#wNdL)wyM|r39o)`C3^O+0s0hEzRp?OY?oQrMOnM z#KcO!X=svH7Jn-V#nQ4^X?`2AlDrSd8pKMRl}$vRL>7uTj-%FW2lepqj$)-2ij|T= ztVBvcYA0o&1)S{{p^);2pN^2^Z@(N(iJ5Hdr`)w0k9rc;3BXFHGa00E_?pyHO11Cw{W`7{b z4p#I}k=Lx!+skWKWg7)9^ZeC>}hSY39kd;b8f$`oF-z@}V*gc9ra6{*|lw#yX)V zDf$*AP4M4{AxHxUgOA4Sa5(D%HR4I6$q|-&JfG8PDj%UM@cK3B8Si?q4Lp9%{xH=w zl%wFTP#=I@Fu3Q_Gcxi>O5!nF57$YDH=oDq%zrx$ZEYip;aLnFkrc*Ng)zLK1zCn zS--`=FKhIvC*kbMQZu4HV^^St0o&=O5qb&FZd1aaUP+qfDGYDw1X{0aHe2$MU1HZ-MaN0^z>}!hZ{duM-H9)s-_+XLPb&KuF(U9;!sWaN|HF zDpHy1n5-_G-Fr&SBoj{koupSjO>}L;Y=5&7do%Nr$ak-7b?(zkm3&wysW-m@1shbX zfz$?tPy{PCUUl?q3;M8Qnty|&0f1MEp=AQx)w-GT!9W(=M@oVn172f z!+H^BSS!Lz9Zkci&xQ|^f%NM+^+{kPzx$5^v_gaH*ZhS9DEIWfGtQfaA1=^fbHP>K zo{4uY-H~{PTa%e&8~0r?n|FaaTQgfts86S90~b%t zy>;MA$x4>xgC}lq`z%~2&savjof)c6I3RG8%DlhCf&+WTHxCJe5|S^Wrv46khA78HC5h-PL{$<8i@Hp3y6t@(G|Bne>^TF(D}h@5I%i z4^>6uNxBL?O7%LE>B%5(q+WLX(a0l|6`KrI1JgM4?K`_kxR*nORNHR-xp^_i&cL6S z7k&z^L%>UcNG^(_zji3)?0=Nn0}nVg1;CyB^h`ma3vL*g$H{u3gn@sh*J%l^ro~Dj zjs-^wc3|wH@Qmz&4>Wcw;Hg!1%$|aCtr{eye&>f1*HyKKkV0PmZ%85E{Mk~-%iBmHFYhFUeEzo-^3$Y{FaJVP$bW}rDdZWGLOvJ5M_~{S zW0FceyS)_h-^vN1p443wv{cQj@l6 zW`y~vKc>EKZ`4EEcayX+U3&gZwKtJF1Fq<`w^*jOwJT~ArJqj2z~0QmAUy$(UQLsU z7#}%Zv)!j1vVVF}BW!$nv#?PTEqX<0NQ@#Ggcq9LSUm!l=}%8y@(`OKf?PeUa*PKS z@{1ut2}#&4SVO$l)tedyEN8inD=b%#vs^(v%N1OsOo;gZZ0aO%aLK7Et$ABguM#lhVw+@PWs_6FLop83<-F zqW(x}lz-re6(D4AhG5q#7nGjWiHf9dZ(QG71hyIjMo@_?A}a96u9WDis2~iEeQ$bJ zqsNkH5W*%w8 za@AG$0^*72V3)RXK@>Ne&4}{+`Sa(>qfq(v*I$1n%F?BcKRVV6D)rGZn$z+%% zsUWswkM^2O(Q{uZ8}sD{x$voeSuAE&rjykx2oTyGv<5m^y>TYq^luzfKRn#wG9q5<)8uh(KPXQ50M+4yupze=^dxTQ z+doIB@%9Fx2J}N_!oC;G*EO6t_kCT%kAI6VC9b@NO)52c@AiD(xBsquAN}Hd-?yCa zE9U9rEhPX+1T4-z=Kqi8{lAk~H-x_J7J+KJg@uNnkDAW7*LnF8Jf3f`T7ji z8k#rN(7baeZ)~$>Sa+Y{yUxtr2YTc3G;bU^0z&$Y)82stI%<7sVA#pf`r^=H-PFYA zgH!XSCR#T&(YmRL)}3e4`uq~D&wt(oHx=)=V!Tt)%9;tHq94&I2$xNOK&u$pPm)AL%#Ko$ zC0UY|gOhho_NFVY%I?FJeOVJ4b(};uOlW~Yj|&2w8w(g!7K5c+<)OoJlteGHn5rLt;QD$8pvI3g?hKW!;;RrL(fM zfVetydyJ`3MLc%xvZh87`Cf|9Tq~GD$375mKEa@ml-+)&a9uz%G8*e-;v`0XHFJ0< zy%a?`py|UAe}Y(!WPepIIT0%&SFsm%52B)a3i^{rGlv0bB3~7)e$rOCTN(y4_UZ?@ z2~rAsjTMN+)mdm)>L*m$SG!b`&izF%oTZi;c*`EsVDI(klz`OlXOQ}#9)FmTnNAjZ zmO;eHRnw_mv4(YkxXDY>XKt`qy9=6tcW!>mk?QQqWz}*XoPP!n780s!m$vB&l^0em zd7E}i(nK%dK^jrb+zS@Zynw#I5N5>=C?d6%trx_0_nh?pUUyL3`4Wy^h4vbfyC&)S zQH`lPO&iHokh+(RrMFo6a6?Js1{M-w)!6FRNQ2{Hta-W}XVPin5%m;Z8ORgRktYC< z2fK%0dJFgpaDNfA3kK$$_@o98%>B?!!H#7Pf$(H43)M2COI6?r)^S!tSk&MGCUHqp zJN0|#68fi-4V#1=m<~V#m8`nj2G`Yw@Y5KiPJ3_~+15ydch<`SRk^*ts62P!2Y!rY)WxyG! z({ROV!|Vc5ZU<0fJ_~6^#AdcfyqAcWbHkgle0=nTi(ej5+$jwIJUkT|6F;1up@(f| z-?Zv$fnEg^x>5SEyH2>|xqm$<&kE2=B_LX)rzT8go@ zY;#;DBuA*vb`<}U$`|V#snbzBE)ggmQZjnL=z|5-HpQ0l#?qEteW!t{*9m1ooOS&O zk5^FJD~?Ql`Jd*=nWUhT3NYfgW)&0Q?hcz}Oz5|mkl*H$t zaDP5?8WvePW^ss0zBk-YpIEVFOVdP2vD567RJNU+key8j=(%po*&fL^oE=DW?~=+! zvSU)(M)q1h4k!72etdYC9v*svf?xHtgrp?YkEpz3Qgn}4V`PDf6bv1H{-mYbZJaBl z4q-ts&i4cx$;6gf?An_7qa}Lm$)RLqj(-bMd({Sbc*uV9x!FlT#bw4{Tt7naoadA~9^IznM?OyalxoZS7Jo6x zgmrtvRucw)?yR&02?^bU4fuG^^{gm)g(WYXm3DP=$qUegA~R>1E$`pYj+X!Q1?tlm z8uD1P1IO{D34|ujON-~{+CJV~J3l-;7w^0~WpIIxos+9l4+NYK=e9O=Mq>dDTwh^I z=JGin%jb9;ULU zVh-h*?GDqTj~Zf}wA^Ve)-$j>5U0-JAuD?zRV>#L1G*B9-o1=#lZQDqoPU3iW+N=E zk*vAQkZVxPhzCbwejI}0?=G8xzR@7xI!VJ7Bk$Hlh6D(-giP^}ozXY$g3)mEBFl6r zal`RY70nm)c&yuH<{N3JaP$>aIl{tUJ5ssvSL6L(zshSRU#a7-^s%1VQ!;ac9g)kj z=;Lg=oskG;ph87XoE!k7!+*nwtazSX8g^0Cw%Tr2Fxa;slJ;MKbqHyyb-NWig1e!^1Q3hS$oL>UmM$8>sIMdFcd3 zOoJJXX-pnEf$=Jal_k%LoDYX;6jRlHNRFMrIA%*vo)#I7hm6~_kAKM{4jkk~@%hoP ztfc7aLooKRJ^K-PY?W$~d{d8v8I z&cb2?)n(+oV%?gRK8cikb;Pq+8=hPAQp~zaR5s@-QTgQZA*n=_=LWoVzj9t}w@mc> z!I=zqjBYzppd>~pUVo5WQen^8uHSAklvhDaKCa{IuSg;BuwP`ljcV#ooX}YMACm1h z9DNnVd$#O$yP3GtvqcP%sE(ON_CMzHxtft*orR~p(uXS4qM{RlWc49Y$+ymOxFe@{ zy;p+qgsk;Ux9dt2DCl)@st*gA}d`fgMWkL;MKlBanH!N^DuCyAyK}17|dLs!h84?QGdRAJ6Q+mTD-2pAOw3WUJcq- z?TCGt46!<8dHDKJ6bQ!ZmNIx2Y{ethFjSnF+- zyp&&3>G>BrIrGx*uc9Rl5-~B)!;h7eRZ>YWm7l~ZA4F8yS=FPeJ_ey-Zl@Rhq zK2qjF%zsvm4qYjxO2Ts*&wZF?cb$gUteb5&R^i76bI|04!B_T1UL@95X)PzMS$jUc zrb^{=>fE=@|A;!3KVa~-{e`FU3(w-0p1@D4&kn*=i(;xP-zeAM^;#5?!@YrkKS3jk z*Y3<)C$?&|AWh!oe7k0ZUnS&dD)HTvE@BtV?th{U8PuR5Dq6e(D9)WG_f) zTz~2dONVK4OMMx*UD|TX;I>SBS2KxX{wGl^6aE?<@YF_w)GJN$t;>?>I!>SrxQ$aY zjI{bmT~Kqvt}#s##lTB-?k!#Y)GCpf`XY6?X}tCei2sM#bMuu(np3TQJEK={Kvt85 zgri7*^r-!?+lSh4$5#O-{~Xf=y)4oxgMWur6vkyph7Wk?|H4n=N$AhiERQf=ywMloh+spPGqsxkB~g|ossHJ+z1%JNic^W z=8_E!iQskS!ruk^@!?O9`f(c`A{SiVg{)YF-=fH;McLmmEuO8tAjGFRW=*D^H-8JK z__*qJ%qBiX0mVY=G+c)18NK2!;OI@AxXF_JcvJjMr}#eM-0Q@PC-{?uz`V1eOk&py z=4&A7)Cpc==3Se_(4k2J9fS&}9zOZr8FKl4_+cI6)5>Kj;e1YukpV-ujsq9C>uChD zH;u276z6A}EZrEB681M~(91Mtd4Ci93*-=R<1_f*jZ^%&guhGIhdO2+&eZIK8!Vus zvmj}F3*RhvgHDH%P%|NHYPZ*~$+rv_u$M#9??20I_uOGxL-< zaZ!-6bdxjcv*b%?Z8^mkR^Ku@gZ?a&6!WGjym`~5w+KJDD||+f@#r*xZg`6z#H9!4 zyYZ@rPagb*E`5Oi-E)`!Fn=iKPaJsQEgvnur0(<#LRsV2(D(57claZL#)qT<_Lp!H zvsYd>18Df^@ZSi3%e5u|Js;M-2R%EZS1VkNvoQ5>hN0F=_M4(Ci6%@)?$@KR*gaBwjm%o28mWB_h z?*jO(5I$GlM;AbB6$XoNHepX}>#sry3k4Q}LC{8c4%}eYOlcZ>Nn<(lS&CO=b`$7r zKyl`Rg%`lk0}m5Dd`>*5hZ(7Q=M*M7oHEb?V||35@S{r9$c?>4#2ymdagm!$ai6mX z42k3he`rgcA38BA+gG^w|B*fIn zjd8w{$X^F%jRa4v12`UM~k_UtRtXx=qy(fbQV4%HfDd$V$Mn}!Iwk3Q}X4o zi2n3A#*0aQN56=8&`lh%@`R?-C39W+b2AUCiSOslA{r(rMTuvMo?N|ix;NtGVsc%? z%f$*JUP702vRKqcycE|H`&996xvv=~5-hGz2LydR?4`{z>Epb_*1(^^7de zotr%cEf(Cb3=4lHL>5<{)Ok@2+~Y4UYOC;>H(k7eg{_6RugoiNNe@z0xt=4sTtP)J zdKtOFjLtx^?(Gw-FRoY@JQTpEd$XN0XQW5&cB{FL`sU^HXDSnJCz8$`Q?|>FZVb*; zyJD+X;ChBS93Oyrkjjw;`4^W<6M$~v>Ud+fwx|BwQ z#xgIG4D@agPTuWmy~O9*VnsG{*h#NK-UGkIN?9t&_(Gz{s>w{W6=!QSN{zq7!w z86Sh!q;|jA(#hiFwvPPJQ6HC3LOhRMw|qi=`E7rgrs1mAZy&UNw(FB`aZ=-xPx8nY z$bkZ{@r)jD-*JzAg7ARc=z+WQJ0IxU;<539JTxxeey-=Y7eK)OnSR@(o8;7();c?@ zdU5-i#z-08&4HV>*MVDXoUitHGJ*1%2_-_|{u6trhSNHuKKC8J&H5r7a$U z!_X(*C7o$~sQ0**fCbAqX4A8Dz2NC1By)e3-i&^a-X-4vfPZQTdl`Wp#D|CK!|60! z2dVO{>x1L2vKz}|=z#L{k)qxY?&P5VqS%`=8YJKnSj6FY#qYNO>e9o*9VO5B*3L$& z-``1%vbMfkrzz->ADE~II#S)~v@u~LRY@RO0g+gG8FMSqMqLo^$1s6B)X3)(N`!wO zjkeYOv`rXB`FZqkHj6=ISF=*#M0jbYhRd>Lx7c~zYukI_A_0TZ=>`1U)HqF-Jm+?+ zHX7>Z_u|>p7eC&%b>9olc-G@(3?*@>dz7-43x*|@<)0lq!t`VxJU!h zKrYYlX5xwSXOb*KQHm92?_TnV2jF4v(v;T-KOS8x{CI)Fk4Gr{cvXu#a~2Va=;sOJ z5e2^}!azvWGR0vh5EBFDgScRTF9kPt91kKX?3h?Uo4Km;h~sL*n~l*Mz4U($D)OY1 z!gT4u9`_m!DA)zMyWsX+yqfDLi zhO5{}A};aMs@wE9(_bPT`z8`1hMn^+l+-yjJ(z^?cYQh=9O9zicJ% z>iaDrcBqzP5q1rV+U|&s38#M}Y)UFrgne+3VssxFf4%QFpS%vK~W&vFP!~wEq;1}_~`@4xnJmH@oT-j>&X|BckQnJE3!eQ zos3KYwu7tmJkJ z$c+YR?9l{$1uw%3RrFE9HQyBh=@#EPB`x>uRvyOfUG>Tid2^T6vEl_vpzpYHUb>0o z8kaeA2J5NALk(<*onU_yk0qPYeNoVG^Z(-9B08p;oG(90yoeY$wng7>-w?@-EX?5_c(*CHDxd%2;vp{_VE=R$LuIBht zr(QgTTg%P#(r&iN^a}pQcGKkL{{h0fxmjCQ8l}}W`bx_*2H&@=sh79O5Fr7ym)Xe> zE*MqMuo@ks19dBA!{}ify#};uv>Pp>JvEmf$`BkT%7m{|qpRRUQQ+LLAaA$9l0?l3 z4ve(~|L->3{J3iL3`^-4{b`qB$`Bg?;+K8O5IKL-Ae=!gR^N*%NjaFbt?ocYx&-fp ze{>eVNLb@%32XfP7sndE-vMjL`Hxx_!uIwR>Ht#%vDyFqmei)mNI9VGVz*E>vqa&4JQv8J+H6fX(#!9i`bZ`dv2m zR@YLReZ%VXn^=3d)dj5D>~<_@wP*D^O3N|^*qffw>a|)*t7UY0O$&S9x0*_;ZFC1c zY_`|y^kL$xPOE*412=KXyXL@Bnq8ya?&HL^dhI5(+cgIrC=cB_Zka}}XLhjuesh1I zw3}=>w|=-Lsk&E_l=Gwz2!Yt_9UXBORmPAGE|<%jk5D@!4uY2M2>r zlXa*AN0`y>bUL`wmW9h$i_vmeFd% zj)3vPcud1=^>KNcX1~qGY4u_HyHFsA{LMJAGWyRuAB)YnW}e;{5^i zuw%4ZP)pCSdS>(3YC{ik65DMHN7Qb1`#6oQK?mM@1Bq9@Reya~N*y@{o2CruS*yOi|K zV_?Gfjxp%6ewl+d_PaYU5pw$$OwGV(TWnmNCV+%#^apI*y%x-aWei%drTa#6&~6>K zn#Q2l!G-U$bw(iR_6FjG!B2n7=rmzrV0f)QOn0Z%Y{4|P5vQ0&uiHd&q}lBBj+=dB zFlga23BCYH0x-4*vrMqZH{){ukEP zY~WY?+X4!{X&KFdJ22W^1^+-57CttLME(W1n1Rv8*N@ljcbUY4{tk>@PZ=1^{<7IO zTK#kU`#q%o45`=Fb;C@wjSizsy32-T^!n#L!yNcsqX{&9uVsJqk)-c7I!3G6Xc<=b zywNq9ANef_Lm59giytJEVM!>%`ir9s^A0G((l&n}c38Q|S!ENrD!H_Qn(UA(+v*Y) zRkLZ4CA0joIs{6+4ZJk5Rdmb;R(UUjx5;&Tr-o6>xw1I}8*Eguy33|@ZgrN8ruDPc zWk7KavMJ5ZP1rJq_UG>0s)g*uzBvLc0VB56b?j^Z$mdDFX0$LIpd>8C>baKD2l+sM zAU30A4>e=Hrj~}V_KDl+1@UXCffZv!@gr9jxQ8m*s>Zkhn_3M|fudDUP zn``Ak67xD=zkTuI>5K37*ZI@Ub;j!;0L6b%=gHfXSC3yjx~`|c-CS$3PJiIUWqlRF zkfoc-EF+6{?NUXqPt%n9iDm-wquUDAO*F8@`?^gOCLY>5sxkHP@;^6Men#i1-7&!` z7QjNz>rT+j0{m2jk!=$2RA8G#)*|ees%e?R>Y14^qQM3@Q&8n}=Ef!E>NPRPe;rfI zp9&_QpzyU09?{hG{G_D0*nj#usMA-hCS!-%l|Q(?F2Vwti#Xw7`0=9;%8n`KPr zw)y}ft3D`vuNxo2iQ&!k>{jZA%TBIm$TfoCJ---1cd8kI5W%(r`hP~e@=w%xlX?x| zT;*Qhy2m#uNY-`#^*UhP$FA1~u-zM__jbL4n6~>>Hg}Y7UXo23hJNZrs6`g=@3V&~ z)83KD(axWLncXigvpZE~oYxd?0DlN45LJ1vDh~TDF0h5VjqCduj8iD(h%vL*xfgiJ zvUq2kk3B;G;2rIqx_{g4{*m z=!NnejCqAJe1CyE&(l90cb*rDGUw@DMW7NA)$WD!c|ucLc^afdx#xQ;kG<#u=kZ0+ zL`GhMC_FDKqu-=KbTjU*=npB100X%ugov9pjn0GXaPfKUbjY~}2pQ&#ECxC`cWc#+ z&OLt6PQdHjhEIY?*x=9OjQml`NayrZl#z&pRiS%;#ec(F>H~4LL&+_gP`Jr;glY_y za!zFqn)xbYP*fAR4Lnickx{pdrzrbmGBYx9WBM?dE(@1E`B8}0CShQp(>V0k_J~eH zX0;}K&fyS~-Gk~pyp=&z*`|ravYAvqRr`#k;)=1M1NGpO%-O0qk;#_T`s{@$tDH2@~N%9oA_>UrjnSVa1>M9hDXS&L9<4tlfATta zd4EX0%j2eFvvCG%GYm-%jt;A&)t4&|P-0!OorChHtMth(dvb+=4eHs&!u^Uv>gLBg z<(QsiBrCw0lU_z%8Qi_R(oN)*LE%|%6@LJ#ul1?@;a$gQ)UKt z?tTUjlNsDuf8r>4-1v59joUgZjE5^%h#NRQjL9-FR5diVH8h^dj}POO$A_Emcz=8t z-PV_3Jh?-E?r9+N(IfA(Kr<6%9XB_7uKhXMC~MB{de#vV_&FZH-tCV4wf z-ZEVE$>YWj9B}(7F`F3~F*7orI6k(*3;a34LD(8$iyPb6lL~vJP@CNIK{S2qxxk2+ zN(}ca?17Rsv*9ExA-qHb6E2r%JbyJ@b+6WFXlQ(Cxa#94kLyn~G=58XG{=|X8h1w5 zI8IfwScLz^iLV-2@OX$Gj&*R28uASqts>M8+~30k_t7KGzjCh)eC5Wmr+i^uJ7ST8 z)3GkF#_5Wn9O63ohKB{@i!b0S@S$vtosp#6D-c20LhKV6;Xw^qoR@|Do`3jG$gY=~ zjv)fEi-hP~<6~A(C35LkY~=xukk=v#3^E!=CR=DwnenCQ5ZxId#V-*cpNRa5xHy*UHGprd@G8cbjD18Q_XT z$c8Ok{pTO|)U6Ov3DS0Og@30(PVWnq|amB3Us-bG2De8H4RSZ8l zKG_T=Lz_Yb%N&Y7AU?C73BG$EiAu;)+~82a(a;hHTU)Ac`26&;DkVhrEewt;|HcVp zxbu9~MOdpQ@+m>P(L1+ z!x6SM8XD)}Z&g4YsDG}Osp^tS4;O|U$dw(P$mNUHzw3wLc3rQ5da8cl{~nTPjqa7d zUB4EFtRF9BUx4$I2WoPS=LLH~p^f@x^{oMl1>j2#g|O*|eRQ+H@c@(FgtgAT;PI4F`LHuw%# zGIA!4)aQW6);)DCZ|Jx;guculk~{+X=$O5HZqA^O-#BjnRfGpLHWMiigoKh6Iw#9) zP-KqIx$OBk=mA-{tQxitbT($#bP1D#aHo|tEx&bPx_`DeJi!BVmTdvY9$)v&v6TD?z34y{vLDc_0b@@aokI~o6#Tfvo6LqU7V6S3hh_0Zhg3TzIJ$f zumOU=xqgJ>VD)kZQ!ts2QD@*-uklP+scd*7IDd(2PwpliM5y_XWhEj{o<{=!r@{)5 ztT@>xFU;U=1ghbILk6eSi`+g~4M|$7?{&MUt`j=ufER<^eQQqn9S{*rIM_IZA${z3 z&nE8bLHZ2FTh9!7EnvGZ-{>Fe;*3siHwtc_527G>G%=l!e3>w^dtM*v65r^g%9Okn z0)Le@wx4bC_!%@aYsOSJ`;joiRt%iNMx#2{=NQ{1*5V)9Ze*wxwc4#31wtBxagI0; zTbYDSkUo<(C0}7mZfB%0@?}W6jICNv%kMGi1tVR97iNej=4?&*Z)hr3*mMpbJ--jO zt~FUqSTfQC{D*K!=6WXUR%n7@%04znW`D;SIG|Bp+tS0K=`z7dQdr#Sd0t8gfBh_5N z3)6GgDm{`+gOt%7!NHkoQXC$S`RW>Z23UcO2lWFuIYC7o!{G<}g9oYy))S}d;(uwV zYFgFyTnw#aQmQYPhO*SqgK)7hS$jP&j8Hp(jI{%H=!&#?03Y&=XxVjKb1;~ZlbT2M zT!!IPX>$N08MEbSaZ0DF1{zgs`Ei(TQ;5$z{!&u!Wn-##htym|lYC~w}2%72^JQYFVHuS2Xeo_j(9q#@rJzfcKks1=$aCUZhV z4GlSle^t9irr}@JVPd3{J*bmJf#E@-$nYSMmHMQq;;I$-z#?-=z&+X$rR>?J%9Q^- zWBg1FwQ90J-In&$>!CS|S*6RJ5u~rp5-@}39uFL=ufvhqcg*d9*}(%vCx4M(wujh_ zBtUg<5VJ()o`r3&!I%V6)EwvzM16DhXEgAg>Szc)=ml8sa^h5o;{M#TqTrMoZt~v? z-vL}g00qIprNqJNPwu2AmaZ(@A|zU6(OTduDpD?L3~O;H+F9eY{IU>ARI zH76`NW3K$Lbk8W{7Xrd^HeRY0VI z+r3e{HWdCtLE}0+JW001`n91XKY0S`WMwq24TWCv2Y^a9c7Lu7aEJ>OA~}v566{-T zJ)+gI6Z}hX48)`a4hLZ77;Xe#A=o(Z+@NVZ_*$=e`BGE0D!8!2VvQn$2w-pV&{MMz zp4dwChl-8)5(RPNpd1(#;DRtV1EG!bsgUwpB2_5KJG8B&>1j2Ew4`dXl*CCz(-2;w zEBCrEK*#tqEPwxWR(L5yFAQGfxHbqL9>Z8CzL}nT+%w%9tfv8Mp5-IMG#LSEt+WVt1`#QcQ2D|5^}`2g)jrWeN-`y7r- zI!DQX-R&E^M11&byioMFSRi)iYYSuMy=b$=0k;tSDS!M!JyL~Y!7s5;rYw39Rp2ec@8YhJ;_jJ0r0RsdD3T zHu6X$=b7}tT|mCDM9R4{!UM;}l~Z>Vg%YH@pntyS#GS^e3f+siR>GBt0Xwmh zL2~%JOgj)b)zqkycn3|gFYuv+JSiQdy_!lPuzOE2;w$_X;dQC#H&o8;wtr_ zV+;0DcAWO6MG6(_LmYop6s1V>M07i*Zs%mrow;y0+$9=L3Mp& z7D&tkDH}r3J~DHw$KGgm=^YQ8QO7fV8xem~JtTUs(M+PdG7A*OW?OI!JN8BnwjU^T zXL1rvyDYo9G`sYo7$o#Lp8M8|0{jM><9}5dQc&h>AZf$#GnJTQ%9uS$dcuk4%L0Cp znI$&QOhMH1W~pry_D$HPnJYfk6@eGw3U}0zFJmNJ6;n9NjV5R$NFWi?y4@9)t}Ert zqDCkZ^Db5kBjt@5gq0S?04#n>y^ECV%{!o&ZpFdtnLn~_b%iQO(aV{H{Q+)CDSs1V z;;%@22$}AwFv8h4ixR#^9TO8BQ2goAo`a+;bLus?syL*$xauW6tF2AGPT7w|W&bzG zEgIRSbHi1e`9zR_t4lVn?UJV*#(Q#X`nEn#Jo3#b^pquX>|?@4z?dy|30Yncn!{1* z{tmw%Mge^wuxnsIy`&Nru~eLUvkY?b&t0ZN|-~pqPq*@K)e$%E&;@sF#2Z?Rx$YoG(XCXbu25wnU8B zQlG;~?#A~b*UnN-kR;Us6e4#ZrO$?@uHDhuZo|X3g7^TH*qZkfOrJJIgojdXn!(BqFIDeWMDnEpT-Ytg20% z-I=PXJWDj|sUhNo%CN)p>-0)N1Je=>O9!kP`%l0rdNw3J#u`?ni#WJazr8>(6roL=I{h5>f?f|-b`W3cb0eMYJ0Dk%o2b%YtM zhE+2ReWw$JI53hV2!Bp7lGLH)m*&TiUfAij~RjKKSmFfUx;YfVZRCcx>! z{60~xBIhwBQDLz|vi=|!cIXKx9CvnhcQiC>8?L&u^B87ElYh>Pwm36dccX^vZ=i;p z-m4*Rr-r=ziPVs9(`v{*RYOj>_VJ8gT&C2JXXVw9tzSnC*%H-|M}~xF%D{A=I)UZf zH)d}|9pro|(LoCQh&c?6WTzmb`avBz23-&1c|@id@(fopFb*E5p`n_Fm!4P$kR8o9 zFibkPpvkad7=Hn*a@>-$Oy-pjC2%tHD&+IZi|3UmomW1aSI%;|Bnw2meUnzxudWeL z(ZL09MqFJZ2e!n#$Q;sUrpp4^`w4y(!Rd>M0O@yJc!%W8-U+DVyo(smBh6q5bPuUa z*{S$xOz*#2TlF27G)V>uP7B?Lel^gq;O8~_cA#H{*MIQsC7nhB>1eV%8(1Yf4|h|~ z5E3O+T7JO}Dllg;fiHcGTp1!m2L+}gmZ>ktV zoCdfG&jt_=h$xuhmrZB}KwYgXZ<^09*=?4H%&Kz`+MykQp1}<9%}mji)+vmVOzH`^ z8^hwBO8D-@n`XOt@`9%}0plHBfb*E5EA?uv3xA%?nNl)!fTAl`p*J%2YN!Hixa5Me z;gU;&axnI;GX>$g6KEx%dwqt(3C1o7g%rR?S^6)YH@x(oJ0S%Ax_FGJyr~ zu75avfgLlu4C3k(HqF`AmUKZxQ(X}jps9vtsT(tm1c`b9jJB{<=pK#h4Tuw13Qh3I z14RLWMAD_Hc90MUI`pF{ionGploWHewdMUjGW`I2{^850UIW3-GqN}NA{ZER&=-Rv zr*(lr4svhsQ8&c?iSLb|ll2F65Zwpnh<`E~KByx)y0HzY1%~ecHjC#TEcFj+s0&^! zN3KKNL%Bzz4xy~bqrW|GsKKx z6Cp1ytPin#{5J$5`JkSPi@O8r;Xd|X(hT`e_Haq+`I3M68Sa^5$0IzoLvu>nZU+q= zmt0kM5DbpZT4lFXtB}~YLWV;8khicIPhI(tUenxV~sT<%a+n4i!Iw= zABmA$p*I5JThGSQ1|6C1k!zEdB!8L1G$Ak|i2w{a#71AU_527!1H6*;q-tfu8RWB{s?6wU# zNvrKyL|6xgF18y#o1NOK!t`j{_RhA|GyO2xTEXX-h?XQ92et{*sMiicBY%42Lq5+y zI}cP6qy;WO(AH?=ut(0nS;-yOWyAb1+FtY4wy8&tKv`q0$e%7DnGeuub!cs`dvDv+ ztw$#EDcO0I4LXA!rPR6>KY_hc5rORBoDe@HJ81Ga%sl>b>e_gk1 zaC*9+O(TPcdU4!cPU$W>$oMxMQ>~#2`>$HplE4MCN!8D|*~B)lIDfc$%I3I-Xs_zq zbwtgEWPJu&m)Ni<>ysIyUBv`KFM2M`-rSA$?05t1+364Bt(=|QtL<*5wtM#zsqN11 zDLB_saPlcwNWnR~NGm@n`zD(}i^c2{zj&8Yets&i{CxB4C_mqb%FpLgBUYk#qJ9Bc zno7`!UWgjeRhUevT7MK)r>!kTc>uMBwSnqMXE(5ulKs0f7sVk6S`G~nYOxQmQ9JN| z=i3G0xMYGOxauB+R}N_AnCGr&*PES#yR9Quk|ox(rK!%z*J1BstCRjCjRRPS84KlDu~3E)3kAf^dkJ*rS*b8H$d~)l#^!Hd2qP!Afs?G_SdGLR$FZp^ z4u>6Z0$IlfH-AiiS9d68E6`n(M03<}HTl6|Z5$v#s(VFCRqT*c9M5K_QJULgiM}oj z2XMp^?_SBso{dO6y+DV69ITBq5%gw%Y(5xXC5Aa;Mbmws<2{l55#q~DKexqs~;mD|2>aqTs~c#)FZUYD2K zUj90A+e=Yy`ykyZ3HJj8;}mwI1jmUSf&2lPhKnba_ZM$k*z~R5x#^q3Ky|7C`3ZiV zvyUmG_XxZwVlBT3g1@T3O+{NQz%o;>X$XE3B|$b}K-efDVU46*rdhs%D!hp-b^%$S zF5&(vGJmXxYJ@B*Mn%XXVw5zUAH&z?v}(F?2%kvktRkdrLGcVl}?_NMfOo^O{+ox&`cnV+yhEFF0=}34SpvV7bEu| zokN(eb-K-xkQuk=QGxqhmNyHPkz}0X9DiT)#T8uR@+1<<@|6j5u`yQkTRKVxzb%By z;J5PeGU5)(g^q~(C>J@Spg|iOwrEnUZ`qjXNEz`^&GF2yuedMHB7wGE(lE(~lDHb_ zJLy+xgbi6cvM3r!Gv>Qnj2MwLPd1Q+WFp|8?0T037>Mui2pie;P6)FR_q;r`Mt|yY zKE6iL<5ZB1xV}8nMy5EKp(Y8!k$J=;aq!!j_#3h=%7@<&*Qb2c2-&kn=2;RXg5OC; zibzeWY($9SUQ1#_lv*jVysSbzi)8ETijcWC~CNFA|& zR1~hGT=!)fU5w_D-)WPQrq;va1%FktQm)+!HryiRJA@dlJX=X2;73x$RD6$8*@#g; zl6;aNAK5!(DaqcHWn2{VL+lR{;zMYVvV~3pdI%ymi`G#Xy?NFsir$=v|2yTxe{hUW z1)K-6u1w7NSgS>UQXP~e2z{lJsH`M~-dSJh-ExJdrAZZ=+~NfnXffywfq(KtTJD&2 zLsIPB^~K)L7n=nMPydnCB~^=T%fq3PUZp6{S*5auA!*f8!7%BqFcyF^L1XAm9v72! zX*M(_%QiJ)6KZ&Vr&_IM4wK%=Ty|1k%Wpl1T^Dg7EMer;kRFG5bTp&t(}ADE7NXw1S^&o%*?Sfc1^c(N84= ziZkvK393*6J*H2B}VW8tC5U_lIDr0rWI1~eJ*p(A|=VV`&AiJ)4wF!54;Cr>zr%QIHsPKFB8` zmIIQ?W1*Xgn^#hYdxFy2*<~g_5kcuBO;AcE)?zW?1f>&;U!(|1C()hTWmrkd*k#xv z^efn9SXC*mV=~B4g~c-$);)v8L#Uwu%<5@4ZGFqRs$Fxxd_n4h>m>^P8F9-8Q}fkz z?3-g6bC`*GK!1FB;9Wf+eo5r99;gj%i6j7XzD%fQZj?$yTUaf@4fP3LO zg%O~^lhG5YCWQ@axp^7;y;dL&(g4_pW)(ceRusY@QRqf>;2jX8G2~&?5sU=KXlwy{ z`JvC&2%Y^RpI9tZ)iL-Z4S=m=y!jfcX}V9AFl}q=L4UHq`3OkR`Krd-pL_cIMh)Px zs%c!&&mxDecGnt$pVW`PQX{-?mAdX2rV!Y(vdg{Py($?7j~;PP6vDg?pVS}Jmo)L7 zo}}_AHM?nC)vgafY(#ADn?Et%wsqvSt8YKTUEwnU^kgY|? zcXrmnwWSzbb<&OX z3X>?USNI%Ze^z-8GUqF=qds(Oy>fc;0P(Z5UO9C`#7@%WM|_s#1HW*je5>0N59Jdb9NW4D-jf7(( z68GY$dRhaFqbs5xeKGVEg#seS@IHgHu73&U#rj$G zJ_Ur4UMwcPShi6$k~A{>u{s$swLoWp1D#Ujv01Eo+jZ?<0ix45SkhDGxi@eu@PNl5 zsI9j>cQ6Coyk$g`p{{F0RhXZSdxLBvqQ`tRGNM=k)G;Q3>UrvJ=xP^rR8{pL*jqJjRZ2X#M4qNyAFvHL#n7V$M#65Vnub*c zA&eYh%+Qom+*RWxMC11YF-RsQ?tjTHB8u*EzE5y6P&5=^ZW)yf#ZXmiD4bP4hnkw6 zdi3jb>WMDh+7dNtwN%vb)Uu=KJkK|0nhIb|vh--&HScN%?XX5_@V0i;C}|QTq}X98 zt{NmVO^R-Sy*n(3qo|>oq28p%M&hQM8xDRv9DM0;xY|X$TH%qVV&tO95PzBPgbt7C zR%tyDZ20+dCz9(;VZkREIew(h`Gm#dgau|v)D{=DBxQ}Ine-r0lMO$Mk0c8eyJ;4w zCV$qqZ4KJ+V`YEeAmC0jkNpK{PyY4xS|u&WOg@-$;k$a$@aZ| z?RNUL=1-(wYo+yT6RKZpbF~_$;DkB}Z}sn9zcwweUz`0p`n6dW_kTROOwNOS35Fnu zZN}87e0%$Q*3iD*A}$5D7NS_CAkkvT=gL##<;qjzTXI6YBqzi(=?O8#G=7j(?TMV+ zsgza6wFVI|f5@=6AignN~VJpqzFBuASK@=3c8kZd^6fob_jF`OEzIM z4ZI;%T}nhgIWDsFQ%7{-Oy{!;;!Nj|E&>tG6c5FoF=vr^;DLv%l}F*pks4G( z-x;cKu((>`ZdTf!|5ZkOkaUAm=KEy{WWlE>2%YXsSGof{-G7E~HLDA^NvJQ;O*|$0 zxfn!7R%A`L%8ArTIgI*J zhf$w-iMp%3L`_lEl5q?M&rxM-gnhv?*w@xMkZSWg@CQvpHcsze);vjMsMA%3hd?c5 zZ}=8aKe^oYb#T9okaV(ANP0(vq!U#`leZe0oac4b&VMIWL!ro(E7cFX`4m(?3{;`i ze;)ZnG5jv280IRb5L8SqQy;l&bi!cbBsyW!@ME2@XZTbn92<%ci&Vb4cUY|G^_H6M z_MWkbRva~L0sS&dDC7N6qR|?ZTDM;}#g}q`0DKX?q zK?+6i{(k|ZQ$b1)ntljSbvPg)pfjTGT9+P8el1L|PpMPB!HHKda5rXE5O0{-8_<{( zT^t^&HRPMsSDG54_@<_ZC}7lYaC&DP{9KvmRmqgnwzlXE;LJL7b$sCP3=9vM@pV8> zb&=uERKKT&Kq*Z*V>J{|3qTamW+2+oT6N@T!hh8qbl_+n^g$sL7ZCt!UBlv3GabSO zN>Rk#K=mws4fWzi1hF&4Zp)QB z*qAR-nCI9x?5ptlfDkUqLTRyYEEZ~f&C5hbDN(v;C<5`^!tcqjQAzMGxwdzSK+WVB zlYff?_jhguCwit(bqM2jvQk_nztZhsqn?JYc%6CtbS-l<;N``K1zm?VG#6((;{@UT z(p_qL>Unp0Ko1Y`xQquC5;7(OP>;vhQW(3iT18cgwpcx^!gyHKmzso1UD_@f^*{?4 z(`-=nl(^Yy$fb5S`&!tap8p_L&&gl+gny4~2_Jdy6cRp8o{498vHFnaphd0a_`gP8XE)QVFly9|kG+u^m}hmEhfskoXoPap(Tqaeqfq z_|I>@L6Esv7<;cy{$gw1pn-0k8M@CU{{JpRf;TtbgZSmJbU{_K{*jGJJ|so74O^0)UJv1 zymqZC3eo4Yx{aq*A_1zPsjo4ee1AM-9@MEta`I8C1!5cW2UyP-fv4MwIzxv$en83T z0j5Y()4N3TR5p5uNUf6FaZd-0KU;ctqnim9IMyq-?!#eZ|o(6n_d(Sh$#s{I1L_; zR#&`kS3%D`fA|s)M%ce3!SCn+GTnGk!0jGMv<(g`f09cijI1Fd3_abxnwc)CJwR#Qa@CO49LxDrdLKHzv z|16F?BC#M>N^%xz^iU-_n#2;up*ne84WFo!56IOJT^U>uo5_jV@V`cGu?t))%Auc*oQ4{qsg@QZrNn~I5 z*zVn|WBVJdV|(}O*zMM_CqL0T_B6eY?bCH^k1t=3`NfmeI`+8yI=1`ktYf>vI@ZSP zWWLGMb!!<%m~&m9Oyx59qRIk$fotj#?bQI}zC>5fotWI|Nq^u;KH=nVG%u3q%<^Z9 zT}jS6OaS+n8IxE0ZoHJ+8+a+Ve}tEE`>wr|+hx3z+Z%Z)x6RZl#k65tTdVeGk1*2h#g0*7RiA^}3Z%__%k!58i4YYzIHjKG;q>JGZHeH0%1sqCMajfw&L0 ztvffXvyznAdVkx$j*E0#bdhd%?_H$tU8L__r0-p%%ehFm6Yt-)mG%Cm%4X{Q3nnH# zxpNA?6K7y6PRSC|7xFH_aR%SaC76_?nPDBv^NZ?M@Dqm30{|^a%Eib_5== z?H==pMGoAVd@6upasRzK-dO{|qPdxdijB4-T0~7+M&bvHEHpq}WTPG$p$;OhvuK7U zaX)o44w3EHA+jy^kM#_*8elfGz%SNO1?N|z&D|i`>qaBv^Vt^tYa3`6p?&IK>#M3d z$obcjd4Ds9!=X-9eh@o0_P*TV?zY|7&o(ktD=tOe&o<%!si+#yPGkcph-T2`&%1eV z$m}dlTwcRHO>K{mYF8cG=mPKzkgB$(rTk@uIhppBjU`}`0$}K#I(eyfMd#W5>&$l5 zOWHcs3wu1lI7u*zn`dMMxi%T`I`c#wV?@AnVt=9zPt=K#cau2Rp)tnECPgZkuPu2;?>52+QTG%yu$)^f`l)z z(BQrqO&)(n3IStF_~zOj3d_{W=cGHfET_rM>YUP4by$+YIm-ar=EiW-uHVmN`6JU5baRi+H#?!My?wkZknGH)1KnJ>1t_a5(hb>ZIp{7>!IDTv7GCe`O?p_TZTp zhTc%GEfEP#bZYB!pzVSXJ-X6!Y#X}@0x|n6zKaI~XB0Sr0v_5n_=D3=%vqM?oY8+M z_#QoKcm9<vcBFIAcSTz*5(HU|(j6gD_^PE{PY zhkYl6jv_R8=~6?%c5@l|k^9Q)q*Jn%*eOW-HuddX2QE|K()Ooxgz+Rs8FBY9DcuZm zjCt}zcM-d<`^fA-)KOQ*Rd$6i4e6)jD!YnzY3D_C+<;HK#P)fG{GS;2XaoBr}XQZ;6ywnj*I;PP+QMqR=IlXKA`0kN)8wGS< ziew4hsuS>VsQJ(~s8^i%$ml`Bj?sgJXol zM}08TmS`s43&=-1WXe2;(=5f{RHh+tHg`mu&U0b`)UqDL zuxsVtu%2nE`3_;?&IpDBASo$mu3JVoGEYF4LNqrXV&fThB3Syvs<3|%EMvXS3<;zl z18jF@ims4_YMcI_=!F!PipDtWNRkQB&m?q43U#qdj2pvE9PHL1Nk!$6xW<_dNVJ=^Kd9QOv+$%=xKiK9R~whEbB_I{$wSD5dTg>q z<+z8fe#e_C$bu_u)6hv2zkCC}Zq%of#ko~vh~_&lJ6jy{WgmYfWgjPHKcdMYPGf}; zH&B*9lk`eZQKJA?Krvpi%m{8h(3EAVu8rq?YIXtxF!qJH$!=`0IEWI~T2?h1YV2pc zOqWQZ>>b3DRLY`8`F~6C{YpDlHkUh|J*z8A)V@@cX*nmFY<(YL*Vgx!niSB|o}xMI zVS4=t_Hl61j+U` zxFG>369%eSoc~IEIx%B$j-Q>NP53xj}(A{SZbz=6(%|kRFJAnf%Jf@^4Z@whYRgPE+ne|5q z&OpzNG5eT^WeRyJPT8m#hEbD!>phwegB$Q%NBmRnMxSzHY*mIrQ8=jO_K9a`PP5c8 z0yf1kX5oMLD4k+TLGbeK{TLo5pxc*Oisk0zOK6NjmgOd?83(qSB7-p%Yh%c30-t4w z%2c4<4Eu7jelrH=c)Oy%h0Q|(f_=C)%uxGFzRr0{L{@oT2R1O)u^X;xvJwd1FDnte zF9?G7AwlqdB-dX6^!Y+V?bpV);1JkYWw&Dvto8`AKhYw4K4Ydunusrp! zl*cC_8_Lr7aM>_m{M5&-qsnVg)gq2bVmD9_b$Zw&9Mf-2*Sx`%nHTx-3wJMqos%&^ zOM7d9!z(LrxEuABAO(~YI7~s{@HhIDxT=4Z7C1hmIn9y_91=03emB^u+6LIE#*e^G z?c6nXs!;|z)z}C-wR?}9x*c|E|0lvu?WL_jHHw|u<&deT{9-?aoqBTj^1;*caIN~U z1J|mHaIMGpaIJf|);(P79DIrt>wP&i+_!x@ju;4FgA@fUJNNj}sZ~J#d|F`rO&sBF@e`YOaiA%ZktHkMpP! zwkUc9KFvijer5C z;~8wjM19xCGeQh|5Q9gh!Hl^haN^UC6upuJ<^kq$)bv(;Zp{~XxMcAQOk01jM9si( z)p~7zr=g){WVq_n+Rn}s4K*#pRd;r4`@0%y4oZSy2Tl-zq5Pa`RWhi+EGCerZgGf! zKDRQ!*&83vuJ&uS>m@SBW@xTN*)m;Db!a*+ag1wr^Y**uV7+4;%ZMmmWBfwVaGE4) zCL6nfoVUBZTKDN$MJk$Rlm&lS(00gwqRI1+>42J$3#*pCLh~wqDASoJqm>n-0tX`# zkS{Jo^yYn;)55rgS{R`Kpo4LdtQheqNeU7~9ip6T$O?lss>)evsA)@QPltptWIWb1 z{PXuxZa2Hd&98J6rpSZk^7KTnC?qKII!(7@1CS+Y@T;|$)MFC!qmqB<3+bn5D3Eim zS=}DhBD1q@cbl4qvjy|IUGhLE+VyfZQeaNNI=bQm z7w{ zm0Q*{T!<*)z3BC z_xibe{oK8N?p{B)(w(x|{0g)rKY26o0hP#5WHe_YaS07>nDt{ixTO+kvhf8Tc|NQTkRT{TAr!n&p&{FU1VA+Ty0VGn{$qcjlb+?j=JD8A9z3uTFWd)pK1ONAeC+bRMxZ6g z&5vdPlZOfg)>5NUDE%RIh9F+9^pFaET0kL0F7@V65-XtD&ZtmvtU|>Z6{ATriQS|Gg+Ql%$%Na4wqw7p5@#1t$XDO-1Les1<- zb3?P0g{PezUnB#w5Tqui%0ksLY6W^Tccf>xWx4~2(V)NHhBD1pDsKQv)s7cDH5bMjvkVU>sH~D43bDpBEb`NGViX#6UpS^ zzt)TQ&sKj_lAc7xa;gsTmd(6RF&FY@_)r+PnIc@B6_WdFa&Ip8I^ zenzezN`O$v6`@dmF%-%%nrG^29F%D|R6FMxj^F^~FdS4wdkIUw90n2$5EN5oHash9aAP<(a z6U}3fK(fBvLva!=1Q-qsg9E?eX9>W}H-qt-nSr=OccXAnDbP{BkcY-$xH)d_!! z(4^RnhD4T3wH>@wQ0o6Jl=|EN+wI$(ddOX>0VejPpjo}kBXxzZy~(DNpAM|+KDCxjK3 zoPPowUV1k-1Dt*6i%=-XXkiik#4LV*e=-fwnu5{>l%9dn+*hedl&f$oBVa0=E{n7X z)sGenj*-ZnxfI(O(~}YHzO+Aur{Zd8`ZqXavu=rc;#%nv_GZ2=nm|fyYD<4KG77?3 zR+G&sgLx5D6VSoQvDI8GJaq&r)MEHbCtOdWq{bL0rU2aO-3}q+(x6`AuGsSLWLIoC z<#)xF`2&y$E$@zz2raV&5+R*v9TK4x+=~;p5+_>GPb5xQDRF{Kti^(L{bJD?@QWxV zP7F$m6KqBJ6~qZvRVGe!?_mM=uz-75z&$KrrN>3fUhi?i4+N&@SCN15xM*2YCyU4k zDBA@DHAUS_G8QPtHoB0gXLNrWPmKJ+)Z^6P%t52E-b16YxsOKUSM$I0E-9|;)8nAY!&aZdF7|_~)F`(5+4P1I=3b(daoxegZ%Jt0P zl$|B64<9^`-dC}vCr1viTM31a5AV-_w>tyg{6uHKarz8Mz3y4pFBYvCzqm=A0cYjU zfWMB{eM|JZZ%y*HsMc7Nz=-@68W`j+*T5j8`G5@URr~vZ3>1F@2_}+R6yRpJi>**i z9~^0Kv^r{t{Ge(bY5b!PYREMn)Z=*d@yvq99tw=GdgGg;-XCwsKn)}V=imV#@c^Zk zns^70IsHt8EW@L-4;nR=3?jp-;%SK80D^6Z8+F7t>ZodYHbAtL_wSD0U%ouMIQ_eM zqG)p-5AV&HrYe8$T{8-Mp6`6YHmZyU81|QecT;g(8arx4&>o=KwXqvI<^V!_#4+_= zSsGX_eY#F4zXimLO^LO9OSUo$w7Cl{W*URk%7FRG5X37(AYB>wxz=1RmtqA%j=Nec zlq0u7bo&+0A_1|0cx|~vR}Ko1f32Z81%v(pCS=klx+{Nzh+FNu*{7Nt>{G2Dp=a&i zwVt(AM$g*XNY6UG-(zpL$6o$Kd+giv9^0gQ?38b7-(%aq&K}zq_t>L* zJ?p)m^Jr23tVs-t6Xpp^VQM)Rn9mG6>;mW+T2kSB4YTx zt0oRPDmH&w{X(A&3k~>6)H=#&bGorMrz`i_=oYgRe}&IRcO##TM0tm-&73wG#aRJ5~ zg5~v2LgyI!%uC3vjxhF5Pu7J$rl~gd7D~I+xJi&Z?b~|N_#1iB2uIk~$=#?8-ff^Z zIRAeUYJ-crRvVm`Q5&3Zq&E0;uQs@y+Ti(5q&D~~tu}Z^)drj&ruB?pJWr_&o|RV{ zocua!gA-A0@cv$HaIZGFR~y``4OXiSUVaBc+}2#8Lofo{eKk6ZR_EkGcL5gBnXLzS;mF)#`($^ z?DTmq20J;!uZ_pv`m)x!yY(VpxI9||DovK4p=zl0QA4c{-^We5^*Ze)-THht8i&6(&^Y}0BQy@L?povUXBmydpBrf${k_ezd?CC9yz z<6g;8j+(Z$pUAn5w49q^s7*`UmgHWB4vIdM@IX;9In4uAQYAXjwOI zLO?6)#x(WpdE@+l7Qt-m<+ml6?PDq1k`vHq^}%y&!YPQ+)f6I2ZsclLn?!%(_T12P z+yc-EN#cZf2t+^AK(99>vAQ3!NZq%3yY=R)-hTWwZ?`{e@^-kjm8-hLgOo#Og?VL> z|3-DH$E~Bn5!1(LUeKL7CPToL>_@p=sJb4K`_d6Z#$ZrXh;`-=rZ%QtPckEf5)BxP zC@in@RtAp3=$amd`OcY2Y%PB@SUa#e(P-$X??|ibM{ZGFz1}yR3@8}tyJ%?ZlELMT z;)Xjtku{pv;b#fXxxB##_g8-KmDiDd(dnUi&&OR|`R$X}34T-HNN$;-8dg7f9WW_m zZCFc0ACaZGYytPzw@52AeZVHln?>3|<{6rYo;L`c5$PR{rL>Pi?OT5q?YZMRL2q^0 z!fKbLItmZh7c@z%>B{!DqNS;u`;2=l*>}KK4Oxg1q&K{Y7}Y!v^V z_)f^Kmzs{R!fV52f^6SI{h%biGBi7ZJ|CL?jpJT=BYpQ@xEhR13(onG>i`uUJbLDZ zp*PeU)xGTV4$;K1=SqKlG_3?4==9?8mw{a>JGGi}tu0ZfS}gC|Dq+EDlp1@%36_^NgG&Zu7-3S1~e{nd~1aL<0Q z9`5Pb+%fg?rKW1tks0=2>L8Gnq5!|eLoX+Z^OXvQ0f zq}2K6Ncrtk;JJYL#Y=SMUKegW9uVDss*E_)_;I^GnE!bOz4{eu#OH-=OEzP~S4@cn9?d#(oX;yT;CbttLz@ zJ63-xpf$u>TjYOl$P`72!qlDpo(g7!6Tli^4aL`?7Pnx3q`o!7UbQ>$JYRKx>vuII z-uPer?r;48yJul%KyLl7{y@~n_Iqg+aPfB>Z;jF`gp$mhL*W`J zJw?+MMT^&U;c1AJVfv|ylt9twa?p{}dcrbIMmBbBg6DsT2TIYnl5N|)eMJ~y{u1?V zVvI>Gg2QAH;yUWsK!Ojk4jSk;-UR!{W`I?#>f_PCw6OYH`?nhaDhqeiL;b%O{{)L| z?Vr|fH%Lmk8G7$WBc9okwZaYRk8cAyx1C@#FlV~b9pI@_ggoa9WM<`BE|KL8Mi1`om3zE?<)#%OLp*<=vdK|Ma7)SF4X*C8MVy_yU3%tL zj?dnnziD1JPZXk4R+<+VXBY4*R!x)J7w_M_JAL;ez74BQ)%7N-7OQ>*E)#Hicad|g zA)y>peDfobeBv-`i7`s6QmTp_xCF^*d-z`cU@~c5U5E?QX)DBH)>&cA)le z3~RAaEg~;e-@kkP?(E|`U|Ap+3hLif&ztW~PT##S6m~&wlCCvq50e|b?~QmAFnMB9 zw7kNggYie&k_^8dhS|sM7a`N+SaIHZK@Wf5Gt1PtxmOrUQVdk&bXHHfdS2i1&pn9kPqT&xh0kja+tZM}}b zFR(lCCc0uqp%-UgAeRA{mGt?(}@VVoIdY*ZupUwE+v21CHLPDQItq_XA;TotwgdT`zd@UNKPy`Ai|vO zg{LQ!Av6j{QAhyj)UF2Ta~S-5eGU!pkZ+0#EI^83n1{(`mTbuDWgfo@<7tVCBN5~t z^(RD#0kJAXbQ{~P@qKK!Ces#5KFbDCNomWkvfj^#T8`8YR0)RWV37G>GJ=1WV3}pgp$~W|SIfl_pb{8a zXB!%FjgTNij4(k2C?t{rfpe3cbwxQrh3)1Gmv69<>1NtXoDNImYDfW}Schu21+ZfO z=x$Yn$%o&>RtL5JhHn*S0JMK#i-p*vTmTA<`a$@67A1QSK6=EY76Bw1UdM8i4;6B? z++Nf(gR_att44Pu7x^Gy;4A;yaIgGpZ5aznT7k(fsnGFeg{9(|hs+2I4yUrlQzAP$+^vx3-SiXNV3PD4KuvSfm z198&ut6k4;nm~pjAj0@?y8<|v(7H)0o(f`Us`{90;HxS@--;VeUQw(agsfe%6%I>R z7>by#FmX2zdTfxuIO3Iah02|zb#!bDgoh#Y_L`3dhsChXb+3Z9QSYC!)`MU9-f^{g z(WH0ReSj(5G;RZUCp~|ahGx*eh+KLu^*RCe#{{L)@*>~D$d_wDSYyp@U>_pecx5i? zrI(5(Uxr}OiE|d7{u%1OfiGja_=6^aSofF2CV6hS>i*8-ow|nl7lwaZb=Cg4hWeijSADv( z^Z2QT`p@a@Pa5j~1-BpX>^C&je@1WrrJ??NW4=7-zppxOfc?-=U|UsC|9v%Z+?xRo zJwjF4f39k3|CtIe!27CJ9e9>G2&mfOrL=?T$>d;Vc%(U{Oz@&$Fl*uP)OE4{^78E) zeco>O!r?&gUx0s}2!N`Yle&+?aJEgX5UHRy{f9ql3;S}v;;&!vAFf;RU;HPp_#c1h zivQv+R{W&0uVXy{(;cxDb-p}E)JpviR7Fs#Yt6M?3)9axY6t%BTm^LCKYFCOhI!>* zqX%kObzB=y&tQH3w^7q#AwH1=M=aOVpc!{C2LJ<7Ty=lAjxFwDN2v9OGPRyBk(nLb ztBal~_+lXxBlZTM+wJEftO{~hn1>Dc!YB%1KMvWs6;8HcvQaxm|Fs&TD}^RhkiwEF zNa2YT0KCJV0y;I*01Ik$WcmS^JDCQ~1Mu`b)}Hl0s{Jpp%Q+gF)0}~>iRP@ki02H9 zZcB7kYMXzR8Xx2b;FoAlH!83zq)ml?|EQhh&-1AREX7Sz0 zI!LcW7K}UXNzkvY^{MDL^0i?;6$O<_DnsvQ>tcTn1{9_#ty`jOuRnR6 z#LXfJA})s2&Ycbgw+h}wEH|pmWbMUzCguCFs`CoHHTsQJ-WvTKaL<4tqoMvTxo*Hw zX-7l-{S})rL2x~M#t~ep&9>@eJF>7UaT$#Lk&Tclm2(PYzJJU0$o)Um{-5MnsiFSg zaKV4hzp*OVB?ruT0zj`po^hYEEof^?ehQ~h&isje^)))BKY==J^ELD-!cqdR%!bt*8c{!0PD&Xxg7`wp7> zkqd|Z{IiHe)TMadZviphU4Adret(u27&w0rAx6IF0=O0>YlJRBS(mp2-OrwbV3!$# zdePWS1{#Q&Wq`gbAy4y*KOyUgQdEs+_>yeQq=EMAl);l%!pRC*_i5DX@3+nG`sQ*~v z$1+y?PZ^>Ue8hBE=Eyer{tUKB$A+L|At(HD1&%MDn^;rI+uRC#!6LFdUDYp4bi$?@ ztOexM&fzb@?m|0=3_ZzR}#2Mz)}zYC!h!Z-#08LNM4 zc`oHUgY_cN=L#(1+r-U++H1z!@I7UT0KvB=IV54pm)X61>fHTWW+rQyvt}<3)Q4WT z8{kl{oVp>ZJRCSfhyKXy?t#h^vNuqLrKRs^>*&f>t)jVIo)0N84>Etc*6-_6bLFb& zkyX)DH8gcKG!63my7NheZJQ{9PhD`ty1}8UkPg-s3#G20dJO?+zGX$RceTzCaf0GeLrTqaPLv z2;Nf5Lw5YcJKLn**$#i5oFU>H035NGXd304Dx(xAT2j{u@OWxkA*^0R_Qn!uR#4=W zEIk2Wr2M8kw)6nNougBe)VljgI!Gp|l@&P11bvRN9Z=#^zgYGVQ}M}?mAbhIk=%)V zN5XDcsW`#0=en2_@yH6DF_vosoq%{_)8EU?%91KLFH=``vuJ;*C|Um!Yr$aUTF@nH z!GK6ewgd$Ww1m?x(AuGC&v4b<$9sEEH8dR=uKHxBzQ3oTX@}fzJbj{}=@9PMcb>xi zoBWr{f@+t@ByA7d4hNl1dmLNG0H=;CNi@nN5>crH6}wBspXoRc8=c{r7SmZUoE|SZ1 z44e>jD1t6Aw@{&EC=&KvcnAd4;uzJH6DP3ZXUnfG$Ahq%EQP58FuDrK=jr`2pKf2O zVG;<2`)}8Kl+|?Y#C#LmmTuKf^Ws$(yntIH z(}jVX8}QU|%JsrZ2V=M5;~OUkF%1Nr{=^#}rFpd}eXDDKK{XJ1o+8=+27cj3e9jCup8ou5^kv0G73!b}A*6#=P|c zcQrWKUtJTKscCe^s#Xnp<_N2E*v9lxjriPujvOD`s&c`u6b(hbv*KyIJQt^d)wm@m zx^jOV2vAN4+87?$ZAG1-Q;1&eT>@4~cuNPjk%41VJA~E4LsOqN5zmL5N2Q`5eI9b1 zVL*O9_xxeur!UYv1BNASzCEOkz6}oW%JQ3=GYjZ|dgtP->-~uwTUVef6+}9eT{F53 zvVtu6n9IxWBUjcXeD z4zDP=Wc7T1ak`?Ky|{|Ha_)O$$HsQ0GpmF>oZY4>a1<&Mo5#j>frYR((O|oz-d?HEWv2gj71lORUS==R3=tQTaOtAR%rAtw4*W!OG z2l5TNGEzC8EQ3V66qYG9&>|*PS z3u{h4JiQZl`srnPclznu9}wkWdUnTA4yJEQL^((&S{LPD`lB2Yr*G~F5N<_)Fg^Zx z2oR>H_dx5lK8Hfz`i|LL<1h{HN46Pa(dZcC98u*V@d3~!iB91` zf`p9nxiC~Ds<1q0Uilag`Mf2O9=Z~9Z`K(h>yVH#__BZzX|pfOp}_b{|H*%tfMt;* zHU?)_Dwb#CqFhMRQb?GX2hQE8RKWf({?2_T{iRYtFQ%VX+K!(S+wmu2JN~Nx8NqR& zC=?NN20-8} zSn@K)u`DHUkwF{iqV+lF3YLFZOF%_J%GQN&9$jO4Cc2;SlL|Sw4Nw=wfdHl#nK%)> zn60vxi4y@WA7C~F5qoOXGw~mKVi<`!+CgZShLMO=RUJseNLU2iNEU2*(nBy>9e~(S-elS!Do5sQ8EhJ$34@b;cIW? zh$A6E&Vdjfai2l*+6!j#`nzg!XWg`QH(!~2BBld1tKAq&V{J3l}aDaXpCTfEBR#O z+kCR?`4bcL3D6EW2+9|wQW*`R8^=xUl9o3dI>PQvMSd)9&bEJJy5eu&ihMyt@Nvf+ zfU?6cv3tH>>*zUsnIDH)M^ACEtp>e)J;*JMYGZ?z_G8*BbM+i4ZjzVlo8)2Hsrkz5 z!1VV5bCC8#;CGAL1y4ilyXN4P*Wm-k$3ri~@89#^qBjDgnWYOly)`i5Sl$|8D`}UU zd^pB_;COCvb3A`s-yB~GN64yyvJqG^)1P7=eiGWacmU*kqPWWI14d6@6jnI{v1H%> z=!Cua`+3)_uH-196;@^?%<@|Z_p(M=8HjpH0#U=3rJ*SaL=DRZnts&K^aJ_%kUaWK zuD`&e*J%1dL({*>9f(>z{j8zspWi2H_4IEF4}G->+%tcMB{moy^A8Cg^Hl*sJ20gB z*e!z*l*S!sh$u*x1275TpboTKji)sYO>2g$KHh!W*b(d|)5hJ{s&+Q8RqfteK5l3E z*#C(vA8CJBGCmdy*7b|U^a;P%PwDKRlvkiPejNpRLsXzYm74V#HiudEDU_Aqy*-x! zSV1?jrxJfhK!D<5mHMYOh_(WBwH{R{rlTo&Dy~|Q?_)Q-H2oV4OnE7%5>I6j+br>} z2(mqNRZaI*65MdPBAnUWw5YGy2K2(SWVPf_hybNMy}S{2w};q`B#UHzHo4Y28|rbe(AUV!x|pKpKoj_5+xfvb`78@2(mAt{+v1Xl2Z z;xae+O9T`lL)nJSe2ZDDKA-Bz+-6mSHVR<-IdJc46>HWVM}@k=63>SD7oq9f99(U5k=M|F(GfTbGvL`ql&=gjM>Rel!C_ zUJ-vt?;GL%zhT)qBzjGoMZU9SnBm9eU0=kALnD5WDP+z2zM%EflQIbLve5P>J7^O? zS-Gs=kdt-g13f#Jdm{)d^Z-b(#cN(zjcU&Uq)URysWVaxCl_N2-Nq{^{93Q1Fz1yN zkF4K>0E@&WiTqjL(3mUyhBg6}@;~|9<=z0< z37d<5EX?5Weg@~}B*Rw7%u%gF)>^^&pA{lcURKOF<1?IXXYTIQ!5%QP7UATr^)bk0D4j+SQfgqj$&6H*etAp01oU zY4~Wg56M29y>6Z;OLRFX8M-nwJHdYiF})VWtNbtg1pZZkAI`qPaeQ)Jsa4|jx*?Ad z2`1djt~_p(7?b)S3*k@4UKazo3*i8lOLQqEC(45?73e#>SX}nh5X{m7&g`<6TE&dZ zt{MWT7$K!b;GM@2Ac*_R!>A%7NwA8$hpw(DC|*-Dy9}WI$r6;guOX)zctd}z`ZTEg zyu;nV0|(TAFNMaCXJ$yM1kQ!qR8+dk+mw!$ec5h*AN@E zdJXY0tJe@8v3d=~<5jOAHd;vnGFJ6kY^-vneoIalbiU##O=BofTxDN=^a#Z?;S{$S zPaYjt`SqhmB6>2JL^`g03aT{+i>?h0?R+;R8PRs#(}x@gtF^Fw(=vrsCc zY|AB=rKYbg0j)1D?sqD})%6lxImku9wT9A51RFf$>uj{}{wQMSy$pZRJf2@b0YW>M zH+|u2uJpBJRAmQZdPt=QP|-KA^c%_eFT%e(&b}vS9xix&P<_teWd*0UCbxYAG3}@x zq0zv!aL*gq*w>X7Hhrr{D1GCS$m}S^{^{e-lvD`5KF+ebFp9 zH4Fw~*^c?G?^8Iopsg>OjR!c@Xeac>_v%fuvX<%0vDZ)cCAohA#nO-seicM(26UHu zj~hF?8oC@B^X7-Qy3+jcRzXMSmuD>y=r7M&3TmCbIeK@bEA+2|T9-!`uirHJ*$u;V!0 zUwbYwg1YXy?b?^$zT$V>0)Yp;I>^Kx{7XXkA-RnvXxMs@ygW|wa{echyj+)Tt3Lx* z^&i&EyE36NyWRg?0YX`Seo%nWxEbxFbnb>q=UQASx6gkc&J)r(5mJck-^(T0#b^%r zbDc=PUtXFw`s+yZMxr$DSR#m0&QGq|`$s2C_yj-CTc@4lqkZxwMBRe~bRzQ%EWk&M z+yx8L2tI=4Qc+JrnieKAtORhc=B|h23j&Y9HuuD%iEja|>Oz4pk(na-brd`CDVJd8 zXvkxwudjcDhs78>`3)6X6egMn^_O-=$iC62xauC1Qhh%w|a@9@m zGH`P`DyggR=d+m$AqRhPdn{tksWro1tddBpA*g=>;!vu9uxNvb{G9MG7fSRB!e4vl z_)4Y0MQ$jfETA5+Et)`12wN!fO%D(eh+iN z==*<5dQ6Yy`WfPfLc6}J^yhxyPKm^NPaUdjRSk)yYlce7k6#9wR$6+v);(4&Eo*!= zK1JPIfPrw(!p9R#BcV`vUw@Cc$#7#~-Z*>!&a>#GLChmq(U{;)Xd23IRu)cGmkhPoudzE{4?r~TC3Y&Ba1-_6&q0)b@?#BhbCW)0W0l(TE<8-N&xsM0nFHf+u zsN;4%m}{8Z=K|-TRpg-Dg@h>l10xOVU4?BFl?S8GLieeeKluHVPRj{h27ETt&I|}G z>?|h|W!=$gWgWO9(O`$M`fz>SA%Q|{$HCqi9wIA)Xzhx4vOe*6wQR>nb2CCZ@%Mi& zE)5^`NkkIT1HbjTjfQcGKBVZQv5?}#by_!5Gy^qaefAOG`=}RZm_ddannLA$k9-}) zU#IYOif-uFI{ADbf4+gwH|Q3CJI3xUYx`B)@7wkDThubU9ra$S0E+HXv0gRefrXCG znR3G;#VVg2uK&&!M-}~XFBI_z9-)^AY3Q2>-GfzH&p2>Kh) z$Enspdk7r72;#7ojVO^%|D(eM_2FlN_V6N?-tmyclrLm)XcZA-Q|6H7d6Gvn@*m9s zg2fMG0%3Ji`_oX%I@x|FqCJdMQ_GoKlW(CIE8!6_2Ha>;WhPYj@bQ2Aaf%5nWQr{b zJ6vKqK8jC;k)#ad z{IJpB{&mm2Q_wM?E%$$+dN-NhRalnC_cW(D2`OuFJ30qvP(8AAA(JFrl`Z#y$P-09 zglpQ)CSGM%^^LR<<(DhybL7({?YIM6@#cH*12KAXZkzt+i8sG` z`GcVzpA7ZC#>szB|9&UKldq$?Z0o8&aO ztbR~_GfTHQs|F^#>Q$COloNC7+XIu*0j3d#732e2vN8c{4J8wvRKyQBefDq)-LuGD zw0oMyY~O$98opdia-M=CX)}?b2;QE=%kG}71QG9kEojntr2ETlQ=M+6AU#Kc&LLGj8>@>r4PSibpcK`dA`-JWcGI-4CS`&&~7Cr4#qfR;P60q1mdJ zPCPIpD`!O!%$b?WRkU4J6u|@;eq=0`6$ND_&=4bBkm>TD!u5y0iY;RmC1p;`UWlfl z^i_X7S!_L9Y&~6UJzZ>FQmoA4la(hm?c{YyY&fG&5@SvFEr++_pEE|A3Rs$%)*iD( zh-@Pu66DNu_gozZW6@{=KJ?7_-ke($i65qBf3MGsi6|WspGW3!Z>T5eB!15`fv^tY zz~yk!0R@tFxJvb{)xREi?u=qF%gh_x4&;Al$-DP6cjQ^K@x3&yEPO!E9o*NM$8IIQ zI}oj}?B?Kh^Zc5-Ck2KmhBN;2` z-sK`=UuUtcgUF3kV&5QUDCTA0+FoR!BH@k_EKi8Kze{)O{&2)F+v$$&@g3V1cWi%4 z+_Bw~JGTFj9ee(e9lQUK9eenY9eePA9h(HC3p4>1fEf)(`*;u;MaSE@U?i8=(}RT3 zbiBO>dh{&W=M%Z;JK4q`=(0FiItwtBI1~as5dbTZM%>cV>4fN1sUswvG74IiI$6@` zqL@{g11FtQ2xgTyiAcJ-v@i8cU+RCkeW|DVQqSp2J=K?bPG9PozSQ&kB0K&vrBf-4 zPQ!KOAB}nWSXi&zb2Bd=jsBH?rsn4(i3<Q>$KlVO^@O zhUTVEZLgUpdtX~PYM)?@f4Q#b?U2+|=Js_K4JEz&~>4Xc17zk)>60Y96F zxTlj;u1YW0Aa)Y^@ZT4pg2w?B{QFM?RPe8)6Z&t|h5WzV_xxA>@b83E`7h5eko>j0 zAN%{ijvxDb(T}}m<~ZQMzGpHu0@%|!fgx;4_E4>@+i@UzI}SuoozOd+ab>gY8$W3BYmOvoNwSNfdfe?Yg@fY!Og~Swk=rY_q;@ zfeg}PdxXJ$kt&u;RRw?lQ~F5*3`sKIJPlPf!y{Xmw!Xd=Z*U&6E^3#2SL5{Oen6gC zMK+Mkyr9)0o9=d(8iJoud~X)V+cquHg@%WMuDCSd_p4VNea#}itgeHNwOU9MZy0eZ z&m;*f69SwA17JIIOp|RHmg(y5%-3h`46fZQW;pzalX7PoxQlvioCHuOz!p1G)AE|+!oq-hJ+tVYF#_E2rGPwVUIn!Q{?JO62u-|+aeebFGfScG$U zM=1h%H>14l`_C}bu;^I{YEm&kuJtI^rxn6_Dk)@+bDz-F@*FW6{MK{kF-yEN#@&IY&|CeTx>u_EIa zrpTDi1H$@M0D?e$zYYj9nG+UUrCNcXXuS90v?P-G8f1tfwDt?jW`)wilTlqOs~W~a zyeA?=XQO$uXw`%GSD4awJWX8Ks1zaIyI2O!ys1=XRxlQSXX;6R)|73!OjT1|t<ff-k=H%jT`>MP7CS$*@un%MB5 zO5QTOx`IlXp zjckVjg=Y{q(9Cjwz}_SePFx7_Fta8&2(Uh|Z|ni~G?uq@H?y1pj%qThA?lCq8UK9- z!FwbX(~x{|2x+VbkyuD4;vSuUL-6n$CI#grqhFcvg(MC6z*>BW1IwQH28g3(6YJhk zdK0&Qt%T^S+XFW7AhPmhbUDVuz)yVogc@oG-;oTD zn{GdjN-&+oV9$b$yP`(VngY-q#4tFSrn{pCn$g`-1A)HI3w=fU)}NffUP%H|dAop} zV^NY*B%J986pcQVwXYvlH3)rfy8l%*eQd$D(PmtKG2zTm-|YTNg2pv8`yd7xn|-*e z&r*q^*zG-Y2Fa%843drVlHHgiNOo(EAlX%7f4`N4ct008w_6_K{W_740RN({m~zTf zwk4b&!#3%Kr~}P(UA5ap3l9@*|F3iG+1NKO?*4rlYN)0`bB}qt&Ej+iJl#fdx+7B! z%{~S{Y^mn8% z>jlO5yOvBZvw?sN)NCP}USj${lT*h4N&2kK17wIz6ta18%pH&t=D|V=Ly-QqCx1|6Wk&vRnQe4z8;fALn$&Dn)!N1pk&>>LuQ5(G*ZS<~uqj&Q*`eW%vKLF6i(i6cg zGZ6{}kVO-rj0iF{5m=y$=a>fWW2b?WI}J_%74M0s0VsNUTGXmtt|zJS0hY~^8fqZa zr1Rt;XP)%HZ;&wtFX#Kq`Tlag|9Q^$`V(yHg^G)!ZM}?ULNU%&z(5wZcAD*fskioK zYU9ps?L0-Z#MbWRZSA>%yf+ARMI?Iw;{$Jyl{fekNXH}&DHBUyLF`&@uoSjV{)WgR z4ScZM{e9NB@d_!h`@bfK2Y7VOu=9F~ow+1RwL4*ElM+d1a0MN)oc`GLS`*`jTC2Ww z-3hiF^+rS7j`h44T#~m-xVDdf379s7=a4k1pKEg3%WrIpXQHv=Xm~2CtmpmoG!ZVG zH9gYFtkvRS^B``ltrP77!aN0g!E;EuH9dnWXojP{WTZ!9-n(q(mLCWH5-;m%^VG!b z9NROAoJ%kZ_CXG1EGD*tKTx%h(x}ev0J9*%Z8Rzo*uc@DgznR?=~W?r>SZ2+|I)06 zk3ulWlvoOu)t}1z&IMUv8f0*V;9g*fKx?2TqM&g4Wuu`)lr5#0d1#|WIPvoBrz~Ab z-N))CCEx{DwSu#qvfA4iE&9VzlCg|5U6PX90nd=|DUqdggp_q5jfR4Lk2Y?wZP2m)RlcTl0O{cvPvXJq#$v><1| zFxvXFb&NsE9LDzlM;M8S!=VjEw!L}adXI*myxTzw){yZKO?P0az;zrBP4H`DS|v23hS9u|Aud0APmtrhiepjFJy|q8pNEU=AVC%p3}dfE}`y z%l>jX({hA=1ojyf$U;&#H_;(lkfs@KNEyE#nxc`Z_RRKNO;M9EL@2sZyb4UE1QPPgpr{eLmo1ptWPjsK9SE_$GyNqkGt%&3iiJP0HZO8J%`&ec; z5=4nNp%yX8c|rE{$rV}zF2oxS#uV4~%~!W~H4sIdK)(>RZ_Ncwp`f{E!=LCZC2)G} zs~k*!Nh<9vEvzjYd9PMOlaaBLO-_`#QYB+TeS3ySwhzH;Q*%|O$FP3OEAs9fpmIcf zoc3)j;SMOCuE-p>o=1{-{s2kl^^cHb-aWS@^SX>A^ZG%O%q}HdEK;c0P6hADb^ zyTQ+C2;kk|)hjj)SPa-0`Zo}9fCIn*Mjn@1UgLWoq=ph98cQ+4LFd-tlb5#GUtd=} z)8m#?MJZKBD~Js%&3TCZzGu$@*HayYH9cM;L{;knBwWktk5y4L$Cuy*$mKYrkl5UR zj+27ub1H~#bNTZTf9NCx(Fe~jh(0PWh;IFL1ko)~5PkR}h<*`7zX+mV1koi0(I>GS z^I$cUkD8C%Ljgkypn4vT&+|tYapnp$&uwRv6ajo2+Q{L2HnICD>U>*~|0`fn+9!oV z-cusjJt2bKvy5OD1yr}|NIW)3iN{>i(tXTmj|MreGJ`x<8CzA=zT9`Vy{|4p z5(1;2YlT0FOB&dout9L?vFA7A2S7m3j(WnAkbDOy1LBN4-Bs8GU2%S;P@*m4%D zVo-5j?$Tok3gmN>SUx9KC@h*}`skKLQh?2vtKNQ4Cxu=Bo;r-_U(O3aypQ9D`T?}B zz{HXXZ!Ca_X@AX8n*8(@lqRt7^9r*^a*@$k_x!vs`@ex5xkUrsLE#|s&B&at@+{?L z1;j`=7%6WYu%MUN44yr{NW&g~NQ=DxrXt^9Vh1bf{TEg)flzrT6*_XWLgbi%?$2=F z*N3(^O`VCEJu%;v>(qDdr`1kE|i+{hA5&wQEA^s)Y*QXar#ET^2MH2BM zi71jpp!SFCB9p;T&LEzD`WZMME^bL&(5-5f02H==GJ7|wru$=ShSdcTFx$kJbXHY0 zokv7gl{5CF5Qm!Ivv^eP4^liT0gDPeYZ97F7E6i-n6kvUQZ9=&mB%HGyJ@AUhY0ge z?waTQF`imR`=?k>ss?8Jt(x3Y`L*#=>e}c;*G5NbRdLZo)Oz`UGId{c*hK=_s)i)) z!=fTD@8S?58M|rwv>&jI5jxT!A`p@_mqcfB=7dF&0k0`H@|m(@7gaJ<3`dWqO!)MX zWX2m&7#U!@&S$v)u=p|3V7l?- ztvjQ>kq8iO%>(y;z@5&(@y$@&;ZR|SqlV%@EcHn$46i@KlgRHj6ytXRaA5&~H;Ms7%Yv zza(_s5*=2e%9m&_k5sh(iK4x<|5dWB{tQ^wAJ)udc$qeT4NBAIL224m{*VYt)Bg4O zHQ6=c(m)pZa!J-MZ6y5pSE7m4@|y3zP7s?m4`LJ3DUL?a{xu!y``F+1J)rE{fg5?Mr+^40C>mEZQy zPL59A8qlz8SDteejxfoP>c<6dK zst(G63S9^5N{IS|3yS(hnIdVo=%-0Rzi5r523{NK*1m@;_wKyn&)LJR<&a&RR-P?x zPYIESVSg}U6H)jnr*~fQv>2(6B@4Tt(N?k>8ii+q zbxv-7X+-vod{HDmH`~8R!G8PZ9E2T1b57(Gsbmaacx(=+yTt$!^-^N6p}JsLM;Lhi z0A})(1|e?asjFr;30L>F%YO#^X%Ew4FWgHFjS9&w~OD=82vtfDxGoqZEjmAOe%asHM@7SV{p@|?0v6(uWI?0}<>I|=L=kpp5qV&^rj1oj(fH6?6wSf(#l9we3| zZGw9aQI%fR)abY^L3J&;hJEQ8_8)!X<*(KmARopMUfKg_BXs#jjV37pEc9i6!!sJd zjCMwIYlICYaHkUmQOLiMj}$OedJXqU8zvrDp7A>k*5m6Q#RAK8|A2{~sbs3pqEPks z+M5@B*4#^-G02P?PJN^tGNBYWws_N&3RHB1rFj@n#rHbHQTqU9CK?v8Q^xSJpBMvV z*z{94WZ@+EMdR%}2-r=MA5VyX^U#uEjIv9xl(B8&vPA(33{6iP0(h~#2N)lj>kp$^V*apbo%N4%YR;_b|TPT$Tf;ZF8Y z3$lEGyGDJr;nB_te7k7m{-z)c7L*LH@m-AF1{3!CH!;GVBZIEwqBlOePAQb$hS*I+ zW}{)TTQwhB!$Z*wpz0X9vjCP~Jm7|%HoWNs&!Up)IOSC`9q$L&0(IkP7lO2uq(R4g84~Hl~BkRED^p#fcpZnjaQRxRzNm( z(aWP7s{Ax`y*@T7ESO3}B1@hznuIJH&7LK!yxu<)WoN4?+bf_fy*96$kbP;g+zBZy z^$$h1UXcW`V2F2h6rjT013{_j-9c8_Hfcjf}P3t2aXiN1`48S zQ9lrt0~>UTu_Ybu2kq!9&f_BB!E#5iVg#a#G_iK0m979D3?2+T=sg^2GQNk+3XliY z-s7goF6%_WZGfoewN}3&5h!JlKQh8f@t? zT{PH52eoW}uxSO8KiFvJgNk06>PR-)Y^>4zJM8{LRaITtXd}vPf+c{PJM4Zm?6xTe zT+R%;fRifca>J`TF}6ua|4V*Qt$F|2JcVM0`|R?AKszvQ%; zKmJ4*!G))@t3xdawJWf(rm= zAA@=;HC{rU)}w(pR$03}8q%V}fj6`eb z@L+2-Xuw*HLO5t8F?)-{34Z8yPb;6!j*Ht#0`CU;I0$B+&W`t@C*uJ)3oD!Q+j;4R z-1@YC8RV}NVWD&V{2HLU_@aHC_7ypC2bc*AuVR}Gc$+rXh$UELZp8Q7_-@S5{S)>V zY((e}LYLSsgO%rFXV7sb45N%F?Ic&@yTYq+m)vvj$UV3H;MKTlmw34G#kWQm45)(a zanbZT=V$@lm0(VHI?q4<_T%~2$rYEwl*quZ*mTQ zYi~f`}tQ>QQ1KaaEi zIr|e?|9nka|C~_kpHpu1^Mya0C9Hpc-aY@>`=z|~&*5Lk`sXn1Pu+PN^C<6RJhIPO zh%@ZZCxKtgD?f-sj@g(8^Tclp*^N(x-FQoQ;tx`uIB<{MTkIWJK31brB_fGbO5Jw) zllcJqWWJ%!PZB?FiGh(qJTsQd&hKgf=93~@`n#}evW8p`y#yw61$GCQ+I)LRxF&h6hZF~JVpz?uMVZLH>U&CXZR(N$51qpNSapf;MD zE?Bqp3mr`Z9_ygCuI`C znN}uU2bQ|jq}|)$y#+aIpB>a$r=?O*Gc;172`vmAiqR8Cwvn3W;0<1lslDL=tn zFTu_cT7WkoS;mCD#~|{Q^vn+EG>=+De53mA+zAYupgNsm?-bmdJn>h5XGTF8F1$+w zE8B2h*P@w8k|)hNEiOJLJ=%jTX3R9dsv%{4hCNf!_&X04E-&y*Xoj%tL)5eS*Wl7f zU5ntL_Kk%CH@MeCLa%^(C%$p34SDhuJpdjld<%u!cx*4!d2g+=dI*YFF%qqm-{IWEVwL-C6KMZ z#C85-;raTRoUb3@I{!&So&RR9^Y&L2ZtFA4^YM`rs2Jkhs0tZcZMjrx3aVAX)FP7t z_5eswt138-$P4Lrrrm^Yh&%H zsy%U?K3>&V2NFGhSx4bsvmaE{x8Mw{t*RR|nft+0DOBEh?sQd+aPfPp`nv9_+5-2f z2uoaiS5-${=E`Z-NR3a^w)d7_IrZ$-Q*C7VB;8XH1u8y<)2T$oBwhH(D~eF(nRQ$F zfbXO=PPu$>jPJg^rb8>RimM?u5-B$Bm*;2WevR3H`nt=T{Lb;)pN|j>q2ZJO4t9;Ew4F#c5i9{%P8Xr)fR+wvn8W>Q69R zlBz?TOhFTWkaT4fiSh~05)>?!@2FdB6wciynY#_RjMOyL*_7)Rn~4hqp~)XpyO~cO>Fpwg;mi`>jk} zKTJd)2^vaB$sZ!3C)dp~5_-2xDtcEhk&xW1R|xXe73W?gDdScQrfF8cqr`tRM9LR; zPPE~F&j0s+|KETEJrn3eapSMtV*+bdx&tY2!6094utAPyOppYFM`#SPZAgj{6AA@e zs!*s^QGEk#R8g&3Wx55gq;5eZQVA7?huS%=+#JB`*?X6d0-5^{uLmGH35oDmC_houU(T--8nrNQXLG8rrwNgHofuA?P&r zy@%^G`c{98Ut7-LHRCYKD>hbXFVbK4F-!E@ww?BU|vwM`8-G2YiV`jHMNgNtvek_-4=$Fg=A%EzLW_Ij#8JjnM zHnIN-HgBw}VTesfA5RA`Wyyv=kQi@~+Y9hjEZRobof*|+u#1g!u!}H6`(v{>dcpog zw63ZW<0{W|2r855P`o4pVx6;5=HILysps^5g%Dk5*oSRg%AVT5SD=Asf%RKdvkc}^ znOe4^5JZ6__h#ad0rDstxHU^YtO1Hwvsn;CDnHxl{J zO)KvlkrhA$0KQC&^m|b;iQI1t^7m*UDaP6=QB2RX2O}(NMQ^iAD*&E&B*{H$m&l!Q zNR{A+el1xJ_qvo7(rJ||M3(nzS|YDEmk#9JyhPq>d@sv;?UcyNEC#b3{&$Ig%;L33 zQpUbjR7QM>bS-*q(Zbyc4l4UI;NNEY?I%senwk;q?hiC|e@y&`H@BO09veiN`?vx# zp&ux_jy_NWw6JdtRWtwj2?hJ);V1O*m^^$yNA%NYboeWI_zm^nl7}uj?vRHz3O2~Y zHTrKr9`4XDee!UCj<9d&cFzP$s6t&ZBPZC9&c%+UcCU@z5v_40NcI*+ZKkVZ<(^2?*i7Q5g;lX zC2?r_*Yp=z^C3Ey=BtR&*{7<5Ed6Rr+dCphq1sX%1b$l~x-O`Hb)p}Q^^;Eb=-rpA z^G^o{t@Crid;yavpS}U{&hKQ>i@Y+f+UM`l)E@yjA?lW_pYV{0+9^e#_I9b-NePL% zI|cdL*ZNuOpmp@Qb#;F9{^aN+qJT9A7A&y)ppi4EDqFV#dg;Wzp7;*pnC#w}U&*`u zqhrw{@3?qN4b((`QNMm_op)JLp@!zV&11M?->2QA{G-HgC{R1V)P|Z)XSz6lAQ~H= zLVUZeLew=n57{2UC8N>%i|VC5AQo}jB2f2LE#h&rDfF*C5Gd6=TKAfh&d-@@&-~@Q zbD|R!hbpO-SU~Bsd2eF(KjM2ZYneb}v3V$euOacZHJP}7w+9{`z<62{Umv<&%Myu$ zwFNjRP8ODifX(-ta;{>i{ zQT4`&+SgEAzj30H*i*Za8}2RcLBS3zeRKFk>kM;$+Jds39XEFLt~fpYocQXNhAFmd-)-~8v*n-Nl8E8?p+ z@ajr@Wx^ZrZg-kC#S+gi9|yo;M}mSNXa5Z3`=|IC))3ttC2x~S@g4DH7dG4V_2Tbk zHe>njN7t&j0S4j*7}M#D-ok$Lmd>Ynw4iQ(>d_XY_wdMeKH~c`JOar#k?^UDFnqZK z$9xwL=wZP2a-7-A1Gr<84pKpYaiThU=B;FRcTxwB7KdU@5);si{c)O_9@&y5`!Az^ z(?@(?@q`Q&imP404v9tHez$*hc6xMJv77<>(K$PMe{@p8&W-K44l(|WtS>5-hbuk~ z^#3@@EAVb3^!sY^E&1y#+T;$-TKnA=-;qP~u7IHxve8hS(MC>T!qFEQd<5{HA(8=H z9EIqU>fR14Xk!m>3KNyMo)*8u?c@!Zek5UN9ASMRXYO3cVo4h&Ezf|>it?t2xtGAzyjt{SnPTqB{*u-cZB2NR$ zGPR0^`iZ6zI9~u!Mz-E}r&BvP|FFLXU>slK-yqpz0jSw09*#O9hh?gNZc+VYgKQnP z4w0+(=JsT8(A!v4)SyPjGDlID*Kd>C&#XvGyu`0w6rDFLNE81dz6iOY-RNnaX!sRQl z^9jHFh;kLM*rm&xs0w#&IxN7+k8NMKX0{p7$HWy^MtX;H)&%tsvLx?)5_ZAiNmQPN z7Gd(r+3z##yK}FP;qoq)9H$%5k>%-J(QykO`uevttT?c4~Rn)ZY!@ zxWUdqRjk2)TF_vfJ%SK|f5kUbGL}b&kRbj=-D}oNFp20{&cJm*G!d0aUnz)6bkr!3 zCgj5oT2ewO)hp8o2{|v*M89_oBRIHFJGn;1{$)VPV0C+!b?+)~ezxZ+#C6ol^=; z+>s(E*D@4n743M(?&yFRLP|G1$~GqUAV~(C-G!ok4@$_}ea_2m7v~}&@4g2iyOfaB zBvH`uWk`8fL`nitR{HFK)a8zj!X3O@ZU^rsFdn{t2MzZr4XH%#ii^1vbevDkPCknw zku;VgmQ<`J&pMk2alSPDl2qPjO`Og1m;Am+;)Cx&;v>!m+LOVR?F?N79p+Q_AeXvi zP0Hpe^y+=9s~)BH_ml6@o6}U&PYM`Te$j+8_fX~EwKP9Vm{~|ONvEMKBl$KRwk&Bivh z8s2HvzzUXI4U1PBK2_8?x2Usx&}A-{;sWD;qO8EI?FK)m#aX+-t5?^80bm6 zZ^w3kkvxCTy*nRU1NYWYs+IceuF{;{RjL(l)U(tos?{5)zOjL-dUaDn6`Gp|(N#;N!mQ3`j3Z(>4sz z09>oRwK2Z zpY#!LiD6Tuogrf77(K*<@5D_F>+lDO1sl^4!S*-MG<0M7s-_MuoJ%y0?rmP$qbh=h zn5&BrjYPk)n@~eD<^wY@$;Kyty1n!@b*P1CW23QIbkuaoQPVFvYT~oRiq8`3&wZA- zrtGA!9D8a7ph+eV5M5XCXSP#m`W09Sps;dC09$}sQ2yr{-w!=&iv0?tQj7%v0slXW zu^^sKL)V)Ea0hXsY;0Bscm$h7s3Bjv4t%dq5N~enK`_te*qr;FinfB4n`&==)pCb8Ke> z@3|!}VF9@d=`kJ#87ExCKAsW!W?Xa;t4wyNrA~V%@GL**;=3SZ_O6*caa-xBH?X{G zRzmtyvOLzcY>7@HAuG!vO@m!t;$2Kg#(EWF)R8&PY9W)HPi|L#+_xi{)?Q#*yb!}9 zzi5|j;>%_6qBJy7HPzB#9FPl67J_8CV3PVt5VtW=-TrrOc{J#1W=_YDJ<*BTa|ieJ z=(x0O5HNEG$ z6P6|V$usg7^uXwUQC+FHoClz*+of{Y>@_ppdoLA=Px<7~sPhAA+@e=bCm1w-V?3Ev z=6j&3%K&8U~ zc=yKk{WnwU8pa_Ax%TrmC)`S455XoA6n%N8MUP{xz{C#-DAYZ8 z&|ZC0k!JjRWT&Zp7z42dayCc!Il1I^Qh--V1F994q7q{w?VYSLqB6 zKpCNPnOPNobHPZFhxaS$Qzk+5g*ac3Q}?H@ntHCOEsf0PJM%h3JI(4&i9_`3%CmE0 zXNw-4{2YYC69g3W>}1C%oSltob+bx+ZrOdr>9 zCR`Db#v2=X^^}b4U#uqwYe*JYS|MK5paFo1~g^?qf$f4 z%<}zP*Bh`Dvvi6u6zn&kKv);}25jx=od;|Tb${LiqfC3`969QORB1Sfmu-we0&ydM zToCU~Om%&5bG!xdi0EsCt|I=Cp9!~nS<%|$3M~Q`fYrNtcc!U;dH6;Nvpjbe&g$#j z5A5N6G&zt3bLA+&Q$Kzui0bqxw}^!0twO@8B7bUZLg0=jnv9GFx|2}JX+1! zoGru{qKztGi9cPz6NyYZ zl+G3DB%0*NIciF_SSmOo5KLb`f^z|ZY0@4w7ltIwz+gKNq9_@BXeS{N~gJCos}6%o>P6F* zis#^rKaVt8AyVM{0r`~e=(?_dXbfZwoyu4ne)<@Rv&VLw_*_ck0Ho3p-*G%Zg>r%r ztP3I;z$v;@7vfoI%=F`}P}9^CdU5_rp=@I)G&dpQJJeM0bw#z!#zv!r^xy;XK2Suo z7_KZSJz#f4mtXLx^nf68rL3z3WBmYb(|At?9!*4N9O1-4*qKl16#%Ax8pZybN55}9 zJ7CYDX5fq9(sYn;rRzWJ=1(tZ;{AV5{9!CYW? z&-A!SWKl}+;$;zvB^;VG=OOm{o;?d(kGO;BG4TjCyO;Hc4YUOtn+t&55hN864JX32 zIMI1bE*3>y&=>+kVK=dVwi__2q`MoG?k;hTOLP}G2tEvQ z^%=yz7Ih>X7dyRLfL)2Sjq%#3iVLNBX@K)vCTmSd6T#bXkfeZrsPvf!m|p-YV8~O% z=qm=DsZn2p6x>P#Fs^@uHHL;Np$$fkh88hZXuKh5Md0dW(3vezG+D4G6zr8Pn0ONz z`6Qs_E335Q%OG}}#L?)`vWd-SqvuiUk#D|YRh|HZrZ z{g2$WZ=P${zC~Am=7I)FsfN4itqAD~I?_M2IgAv4t03y)26TGU0njz0gdM(M>wt}%f zweD0_#OoRYbe5b_D3u;ujA@#_KCtz(*5T1v>!6#>Pc}P$1JjN6+-$`g?e!1ZXzyM& z+Lasa^@@$Q`@eXjZU4xPw)_G?Q~$LTZyV`HU2u&-rMj?^qAVmVoL zu*(Ugb1sp8gyEIKJQ{@s1ppzkqOh1N_DpWr&1@{V4%g$xAYMw;DxlZ|06wi1_bY0N zo!gMreTut7d$;ncQL;1$2aRKDr^I%PIqpZNYuUI4SuFbg(i1?BM z>ZSm%nVB04K+Oyouwod7aLyf=`@2bP>JK>Q4qwiHxs~VK(Ta2KysU1XHRgDajw~j5a(q9v$L~j&-q)tq0xm2yhrI{VA@!gsJR?s9zpcr4M zlkX)t;JD5thnJGHtY5OX>C}SwGnqm7Aj>1EB6_VLb!fWFrRs9(WWnL$tm0b*4RhcH zGwGwY4W&?eaeDEsBz30z=?`aMZs4t#9^tYITwk=M1^o>vD25%4)${(-**=ZBBYP{PW*}BkI`%u8;yj(?Tu9SB+dnzqKS)k-!F+f(Q_26Ppg{rPnIvcQO`4MenMtzI4@!v0fl;J9 z{X#ccM7_A@f(3S3F>3!Hj@WwPh*xrd#I~Fxrp|+l2t^PqgRdR;)=?0H4~*Z0$bT|6 z%YCGn)ih177!z=hxaI{hUW3M^lylP$5s9f)G~G`qa}iB*DHLc_co?FsMx$9+q9<86 z4e%UD!5?hw)WF{Wj1M*%b%K7dV0Y2>+QyTwpxj_iC!fem&1IrtKd?40b z#v-tT3GUv{+>vL^#`oN*IqmoiW|_=b(^$}0cE*DEpm(6A;NH+1f*b#YTD|_Qweha@ z?j4x*fKkui8vSOqzX_Hou^*kG{B1ZKDhdC2o_w%T+o~#pV<0aVZx5|ujg{-^_*&oJ zs#X#B_>rF%TM!vNQH`hHSDDj)eeB}L%X|0k-P?DysGY;%aI+_Ar!}Z=S+Pkh&pjLt ztbrBhZZ;c@O@+2b`P-mTAJ&ICosO+)jR>$o`P*<~xH;TbkTsjVwY->cAqt53ET=Q! z-Ju%nXsV~b-KS*Gw={v8%HOtY+t_MA=t0{LPH7anbBg9DnDs)vc({dsHzG@+zYTG} z*X*;5++1rQ&5C!1)-d(~{96+bnmZc=7h!D8FvmAIvj+CuH`0?5CX#0lFrC6Qh&%JB zFUt6)P6*PC-HsjC0Uu>>K|cn2+{pZy2bLMSPC%k!v)_UdcCu`gw40WHWNxnVkKD~Q z)mgFxyRZ!(;K>B~H@G){7E!yDnun(fwaU)CCe8ni+LSk|)iAT1MUt_WE4A5O#dpCk zfnhgP*#GoeT~k8Dmvd~p{kqN!@n{#SNLjD^^B)RNLV8`#_RF95#;hH2S$dWLA(#WQ z4aZo_eSCuNg3r`i4cz2NFW*^Hdvb3muR(}`UsIHL^cH-6+E)L6ocw&}IsrO!dv4&O z4|sBe;qr?1J=>Zf-*WudKKAUPf_iL1$tDXDNUYZh>508ug7$hHJ zo?4^PXh14qB`L4>uC2i#tX9<4SX~=O!;+GKRo5)& zKd+9EyPB6Ms;FLGdJ@RMfGj) z`WpH5ZI`L9!Rc9FS>NW0`gWkGdYSq*SJt;#qCVPxx8{lpn|uHpD=UNndfhCjkW7Y+ z5*5~~D=XY$BUD%+q2^W|wVLs=sq^LhjTMsN*(pZ$sT#LA!HQ~xW;L3u z>J>GALOHKD3u+{jbf-*>n=5OqMRUKXO1h|Pc`Lga@4Ag`R`)koNos49sIpltS!Huo zl|awNMwu$>tE-HT>(^TaRW|rA6;%mi-E6YDS5>*Os>&uGrj=E07FBr}f#*>NMG$(8 z@e~7kUWiDf7pX8j($;tkeIi1~#0-$*3=gq?hn+r0-2hmb%GmOqzeB)4>{I}$(6%Pv z1zdSu@#iz_sahfh08-$A5{E7gzhBIm1dJqrQpA`lk&fsL4=1=EESGESDMr3nE;Fxm ze{4+|FvVJp09|C&PN$xGch3`53DgSf?4cFlT$GMXWhx{`7nev->41sRT9pB7L5y^SZWXn$bvR@M1_X zfzD7>E*vYcZ*ZmW4)CS8rY1=vw)J&YaU)QfnF`Q0lC=?Ndx7C4sGe|&REP3^ffvEG zgldIRHUor11_s5{dY`F1(pz-3mB95Rq2i=!!}aw-+$9ke$23j)eoyhqU&Y`UJ;|^& z97jb$jkY!0BZ%?VEU8OXduC23)a7!mFXBn<%4aKnqB$C!0%YDpLju4c6Iwu)6)~rT zAp<)>VQd9FN7$C4RgZiENv4T^1dS~vbJqo4u_%&e3bj>BWJt90sZC(|2RSR=y6yy9 z0xc-MO=p;QTCfZcKQKn|9G$ANppy)u%;d(m0S~1q8O2@4%r?yvM&4$zz#Y?*gVXT_ z(BKR(orn#@O=3mN$Jdi}E4OD*3p-BMU7q%k}U20)E($sgx zmF$+sm2AJ@Nq!IivYf4Gu4Xq{ll zIEFA+dzqbKL5IXp-nY66>U($qJcKpz0fD_gnGdiMhQ?9q_H~pfJ`p88Q7R@@97eF` z7{8o%PINj{_V6CiL!^~497*3;094g1Fce^{7*q4+s}Hdt6^6q18YZ_QNfC}u{!Du5AH0T)qI41SI( zfS_**A<&UxRN|kO7T*!p*V*L6PT+z2lOyqFiuhVsFlorj-5f}Ed(YE-AzCMokLe&= zGx)(&kVuG*sl|c0ywFj%s|4Cw9hl?gk_OS%V1}7=A`SG@4uCAcf4}4x_`R44`2)YX zp+7V5Cu{TsY*m{C66=%zTAv8V>=_+J9wc2OyCvlEO?+WpsxBaI`*inZ1KQUX5T=6B zCiKZ(y%(r+&4^A}?7Nd2tj<|Dcn?_msLro4SWi9-lp%=^^+;eOJEx&sHoKzm+(=}3 zT&U_ywMhTKMM;4Je?~z#EmKOQA@h?Ya@p0E#Ga3Gy!#$O?7o-l1VXKb^+Zh=9&$JhXa{UTK?m#S);{FAo6&NvlM zLsfuc1;T0T>uWI&<00#!cF7qRPJixQ=$Tan0YNPDf>w)cx}+{O1V5SIVU+?c)ePIT zc6%PSu9E@ke=Dv|ropRM-01=;MNlQdTq21#j5w8Nk_47{QN7#+6KC6*W14KsuuNBX zXApgMrfSI5VV=+*aZ+yeOs2YRs+DI>7Oq*1 ziVf|d+F+m7*VQ$9xrBE9(NC@=f|GtBfjHT*&m4Izgu zCaouu)-MsG12CGF#xq^iN%<=%6k7b=gptdSJYQQ_=EWxRFOg?fBlglUZLKoNaP_+xHkKHzA6TWz+=&4T_PU; zL{ug)Q*o#Y2k|E%&4-+b6H($1aR7}E=2uk`xd}xgj4!m9D2*M3Ewt$pkM>r3sMf1Z z64{(eBG@*4(Lm7(yr`qVT!fdqd?O}DJWKyivtF&jm4*KNxlyfZaT#@?46FmctZJ;B ze>#-YtX8FUHzfJ8F12{vg%cBF-FJ+O-{v5Q;jLD)!;eMjElZPs8f+2AYHV-4Oh z;`+`b+SIBBZ|Nn3#MHD^bM+@-V*kD>fAR0}#Qr@sv2&(##2Dq1PSCJ1A>1B+NJ7iR zkSRGLx)>-$Gv1Ri(CLAe%fJPK zZ3;Iadh6Abs{0+p3+qdI|ZCKdMR+mPczVrz*PR{e}oh$2p!#1LFi1!fOFRz{~``w0+g0WVSPLq?!iA&8SSm@4BXp2 z`X>@Yn2tW$bM%pcseJ~rOi#5bG`DM7A*$E5wpIuJcB9#_R)yAq)RXvxe^rK-4dyz# z=>-DYHWej$nkezHwS)l3egy)YS84!L2BvP*uv%@aS%)#hI=+M0c@od%f!inh4J_Yt z3_3;fb(d7Gdw@!R08ocoR^AZq#@^;pG2m`@!|~dY1CndctnPY0i-qlauU=^s#Ye?Z z^BH{F4^+@##DFr^2*MEPe}VgHHpAY57aO7_5U)}w)*1lo{dT%oK zRCWc4E?*S=C+0XkJaupI{$xU`^?@ggd!-y$9+i;Nki@{RWHX4pSuP!^vpLqS!GPp| zy@*(g1p3hJ&wZ6JcstF_MuRx*^MMaUoekG%Ad9In9Po->fd4rJe~2aPpij0!G7f=M zGzY`jr`7~;V*<+t_6siC2{|IuSXCT%fb~juj6F<*0#0Qvd;u_nV2r`;Y&NkWFyvr_ zeUO}MyZ-CfyPA99UoMvu6<_$5$R|w0ISwLbSP*0o>lWbNVTN;y2g=G5X{c=~h}L;) z`G)c;wM}E;wrHD*e-b8ob8z3E*!{`?gUAp&{d?t=t%U+PQoVl%p1z5m>Xo*24IT9` zXc%Umdt(pqpaOCz+qnVx+<+wX^@>P4Sd5vb(go!L@W2B8HP@A?oQMJ>XXt2e;R;d-HzcR6lfm1zyZaq zi`TC~111WhQ?c||GZ59F@maX*{Ol188oO%|9a=z|LWF0CKiA^ectQungWSv3*S2Qm z>Vu)P=}e}!Fz_RqWQZrIi3w_n1S6J7%eFTNliW?|HZrpuz(|bmok1wscCn!OgkNy> zq9~nCv{q&if1<7G=Eg?Rq4LX^u^<2LGUn~7%h(TmL&JZg>3hb`&FmCACsWj_UY=Q) zx`-^m2wtNguq8vhzMd>EVKEk_&B`JTE!j%Sgux*8}a90^1;npsk9aSpzdJe<)K)7zn^E41_y^4I2(Ah#eAb z5t*r3u$MAQ)C^TL%@QpXVGgn&uvS)3Trze$BJ$geJwP;*c|w~Ej$j(#T$UXvn~szX zBV}I-M#y>hoZX~ZEkFMR{(?m6#N`@*Nu`LaUDPp}2l{ehUy|;?-`FNNb-O`C zHYUBXCA2Qi9yZAAO0X{hl|;qrBh^_hRmWsXBux_#4Ur|(LoO?DfX`Jb=_l7edRCJg zS3)D~i>b-lEKEM9{47zKIVv;Q(+oR$q?daafB9NCR|)C$tcswaeE8{ ze=}wmiv<6gMin5vHvv;!IGk79tP_KRh2jVPZ+67NXw7?Ug79$n|#O_SB2G$V;$z>`!32 z&0`}YK-`lQXoZN`;z&NaAsXR8=BVRee}EL_*uCXal*e^mV+ zdzx|afBtj+ALsHP>cxNj|D0d`V^90(&1j0!o>a`PF))KF&u)GI|n9!w3Z0_O%K^5u--vz|7Aw@U#3Zzbp8QunzRcV=tlxJ`)Rk- ze*F2O4;&|`PzGwCgVh{sM64NPo<=YAkG%^ZZ%s zTbuKNq>=ha2i@xAJa9d0gd-P^m@kapFcEty#|4g9GRo|G>+4G3&0!=>cDM7i|ThP_2w24&t(9c12Z87jdKMd+HP)bHj*;e-(2q+LxEcx^_}D=hn2VDe`b@sVe*xT zVSjbZ>aLRo`ivweUg8e7o4DV3TEID}_|ir$88I|wh&Jkt%^GwR1eUc;^0d|1-r16g zF29e7wm@M)SaNlR{kA)pPcVqow`FY<<{nHq$#MzE%oE^bP4UNa zxmH62(l&B*gT^R?i&S7u0qCvHo#Mc>9_1nbdVs47g4%>AmR{Op6Wk!-k>_Y|l?sTI zBe!5BO0S?r?4MU7VFQHC=W(=cY&UD0S=v4y;_)}nj#{y+%l-p8$v3qa15=C!zWm;8}-dbnqal<&7EzHC(m+B zl3Ds2wyxXOOcQwU-B_2#z9L8b#r^VaDQv)=V+1KTa=}g_SYJ;OCgHswd-ihxg*DRz zeooW?tfd{b1j4cll})ZiL)BSdcTzt34)@Wg3YtZTTvIyret$|z-;xlzRSi7zcv*c?A8KwF9x=NJN%jFz)V=d<(w;*7RW>^=Wo{Q+qDeaQN|t8 zpMjJ;&lB?de>g&Z`%Y4=*Rpr6>Q+s9&@l&EzVg_DL)6-exJ#CbNan88$x+YQ>aP8> zE9&MP)4i}S(V7~o=p5~zX7!;uI-;kx_!U-*onXKHB&%-Ka;{xD!~-GpB1Bd?wi}Ru z8f9@$U}}(MS{L3WN)Z48K}Fq(v|QglJ$9NqJ1Y(ve-avk+?O?(aa;-y$IHjViEva> zSSy*ecZfY3%zA`_-LFhx{Wz2R3YW8zDuIiNx15+V$*tm%+Z=ExX{K4Y7M5n4{S|C; z0nE>1S!B4-e*67>vzB4nK!ii1g^)vlMhn^AtU=%qh!#S&S52<;^oW6#P5!mWzivX@ z=Rfiye+kpI)a9l?smq~_QXisic~53M#8Hrp9E7F(>f``R>+5)pKgT&B5|Ees2 z+}iv2obf0^L|0W-*2>J4nJd@Nx2{Wmfsar%Aw9_5+u-9FP6&-~omGOTKB}=4Rx1Ud zpsvx;ZwAi5y=a~Eek}_YNAE!?O(tHO{UzTRp}aO08LKxZ&zRrn5+DT}`oX%c|zuv(riNJu1w+Rk+d&9^2aa73Bp|vu~sNXYx4BbPXE@J zitiioNhCtX{vNRD)TfGMF4Vqpd27K+6wNDGzrZ z-`0hP%5V6hmg>!0G{W&-bqg8HC+(cHhBa|#`_?t_#erHA|MVPx%t?Nvf1H;uxgx8& zX$-Mk6Crq}Dc&d@QnwqurTIi0AfhIyOOVH|e@+51cr5==oPmf1tT|mw1bEH0RSquk z<*jmD+aq8XTEiUcCLB0f9Q5MCTsF&=ShG2F8?9dFg+R*k!`gZLC})pnLs=tOle)w zOTsSwq39NB4(IA<8;rw|>_hQ8`s{~78j!)k5hEc?ODCoEzvyp0dboY755ALl+1anT z*{^G}$BVCsN7SCD!@)Z^kZQvMfeJL3E!sm^2f`h|oO<9058EaNe~?HwdbA1pVp}nb zPflL!{djWH?QW>A71c{#{!SUj&F~wYz$rSVUV$I8l&^A90b;jn7vgJ&jhZsez;`3n(VaGiegS^&(9(G}il+2*aTbwi zUc$fNSQQa<{G^Ob2BBdVCi_8pphmCe+&jFlJHh>lk)?a?(a z&vej+y5-u2f9;$-*S=eN#A9bcSg&KAO;)RTBEh(@ZP_$djf7Oa^Ac}h6JYPkIfH9# zH{6iNu4$~gK*ru)WudtGvw3-%&yUdseziJp-9X!(LU3@~Gg)`r({uO4A4iTeew4(C znrf$6baE1r%WQN?PRHta@nY{scj(SyuQL_quwIjse>%=^CoFwlkxMOaMoPSqMy^n| zxg{E+=&f!Umy~@-mj{P0_D=Q=e)NWRy>1LuD^#~^ z%a)@9e>jSh_2%UIFQbx(a6+nlWTV#&Z4Alz*AAMQ9K{n57RqW2v+a#1mlp<2ng z!$};SN@lhT_XqMJNy86zo+ay#aYBycWKAAEd$|1x9_;^kUPxYWzubtQJbe5KQgS`o z@}HM?QCkpSvpXL3pL_zK#NF|ye*;@aQiBQoe;a#zcx^AB?T>eM9zXu1w*P-)y=#uv z_M@lU{ku^tTuhUPj~=%n!oq!-d>qM|)FC2u{9qKXMHs-W*+L4Y ze}6X8gdy5`aIf=?hd?l@AX`_b6K(8Af5fJ8_A^cNU z2v*o|NNz&O7U=>q;i#Mkw>WUm&^~W-ANYAR=5FwDZO*Az@KmBE-7s3N0dYj>y~<%U ziZ($k+l6G7bhI%=eFDP}Rch-+_p-QD8| zaU%>l<^guXIC8x1_j7UHyDR_@&s5`}8r)~3kl|ZfgX&8**xZB|7u2*bB&vt7X^8q@ zcps|AQLoqQ^gEX&M<gvC$6LNgq532fpf>=i%RU+dmQhncUaJ=rf66BdA#}=? z1wuNp+SGo5P&Q3<^%~4Fk4xE?)oo32ptRxri-Juxsj_)a!B zyh0H_E9J!%rysIh{)TY!8Z6W&G!uwP4Ov7UAnb=QzjbOzB9fNWp{s%Gxo9ZEUh1_4TG+}DrKPx0@nx0{ri>Gfy>$f zy1})(wqf#sdBGs@Y;FqllkLFj2WPZyH~JU)w@nbGlR(up-Yz@}ef=36fIz%z+Su(O?R zZWc8xGv4iPpkh=?a`|die3_%qVOGE{zR_R%YUEgCxeHqh%i>lLRk4vIrXNfa(|41^ z^v7uwkyNvl&sh0w4*9#D|_+Y-aG)O_7krW(HD$*|*=b2WLb*Oev{s>4e;i zqUhe{!WNFA=)oDe_x?RRNH+1g-dzn4Z} z`iaPk!{_hz_YRKJ=!LSEKcW#Ce@$SEA9vrr+WqGBo>x-4*0=?a_FnHj z$2yPpj?>6M27*5mdHHJZ^@}umSSqRXYxD?kOMx|magOR0VwYLaaS)Q&ZZA2D2yynKDQe|wxpFXv^h zZyg=KeRc3{8c7jP-Tdb8@b%vAK^iH6L)|`j_xg1j9W3T^bz|?~-F_N@Q?R=6`qj~K z8oe$mUH#!Vf7*L~oGKyEyLqB|Pd-w8_~O-D=mSUx*?{@vdGuGf=ClXH5RyZvan2x)4L$@AUU zyKkE>98L0h&g-RB`xTeRD^v_Uze{$2-zojXJrY>wDYDMLH2V5$=Mo%`pFDiD-GC>tF5V6j`n_eeyEiY+ zqBMH{aq>7Kf6?y#n<$OC@GGAz1eH(va6KvbL|$&g^4)s^3FcLq!JB07Tp@Bqi_r8_=1=JpYclh=|7KF=p z4i(TP?<^J22k#szpab8TuRu$Gc3y^#$?Y|TCg!Fxx{a6m=_#}@rvkeu63Q5d`Y z@=7sNe{Q&gLQ8Yoata-nYnmw3ddfeX=3KTHs-0N=puivY^7JWQG9e2Cg_H8?#7*9d!*ucqSB|77hvUVqr;uas~Z3f03WbVQ>nEBB-{II}TP0j9VC@;A)=# zwkYMxK;v8}uD;ACsl^XhO zd9@?2;A_?IdcsVhv&DJIC22GG1f;sHfBXOL-~8A38+zye{?G8|Hs1d4 z@b?b>{-5yoL;U^UBiW4q9Dn!m_kV%Eq56M| zuRg+NfBYx1I5gugNckiA)&CuT!&moU5buxu_PP-hqA0$6FDSE7UW^eaqgW{?%b~MKBCh?R$lvF!8*E(^O|$Fe*(v(=(k1A1r5@zA2mp~4_xZ)-DU&S zvp^fvle?N>E3dUgzmJW%EE((y&8El)jfUvkZZq_~W+U)Ppb2>Yt_J98Yvjv!k@#y$ zFG95A{RZjku1mSP)g&Aq1n7p_cag2?tWk|`BGJ?QrbhD(tpw$8-=n#dcND#%yev89 zeaMpQ3g@%lVkpe#y_Hb# zs(05iDC?}Rf$-*C3t%s_{Ph}(U#+Ju%eJ0^qPMMD7l9ATo8FprQTyQaMcW6V=)Zp} zj$Bh(`SD!xI%w1Q!Mcg=J?liTWnN7zJ`W2gRyIr<;w=zo}_|5WFwf1IG| zPrWktwY+m#N^7qE#;>5pg@Q_KDeP2-@83WtDTapYOCUtD8(dz4?1;<&SFqj7?uM)L z$aWdN8rdepbrmVf@n0lMDKB0LN>4pg90fe=olRraV)0 z9Vpsk8O^@ZZf7-^N-&Dho{Mo$n{?W$(3X+|;v*4j5<_{3#6UzAM0Fj~?5j4o*ObDy zO-RTf^g##HovECJ{jP-afyEWjbjZ^#w*Zo^&n-A)J%rNCY4U2-e+>6RnNcx?goTb& z4yK{__Ykd^0#w6H4k*A{e~!>mO#(@Xcm(~=T)BkO-vCWA6V zU$$G~%u5?*PP4Ca;71rC=7zLe7)X3X!lPUOE@ZJ@Cvg%kk)dfi`>LKcE>yTwdEz$0 z4<$HXo57ipr5^_d_Cm0CgFQb~;aTR#)i!$8#xW+1$i{&a7zzBfe_FlNl{LZ+O}uC5 zBQg{+@dG2*ExmbuIfW@2$Mtw8nk2o+c`=`I3Q4}GxyXQ(S`mEJVi4844iG;zvZX@S z+dJyWX(93SFr6NTx^?8@q!$)|)zb)6|3EtLD%#mQ+E=$a)eRH*M}mF~GzWwCChZl| z1aO9FxXq>Jpicx%e-+_sIIeBCfs8hdw(ZQ;ENfzQWiLgy0Vmrv#)O4JY+{&AnHqE2 zyUN9Rl_3;U`&hU1;#C$s$g7Hq>OmC#%tYY;;KF1}sIip$rd-Dx$YI9qI}7cnJKH+| z@s|f5KJ9NK{9owVqsPx6t5CSot(~X+ge60g0I|;c8K797%$&+UZISoGCe)?!@%W-J9Y{>#Ag$;p_La@{j zp2>93A{SD5WV8ngiW2Go&D&cz7Q)i=he6CSz<1KR2`yqji zy_m%%tcLTFQ;uLO(udwL4LQ$|1PP0fWm%v%|;){b)1kfc@4|YY42SLa7NC|cwU1? zy6Wv8Ln!_0_^Nj~RX_kLU*dke56K3TL{7a|e}TND&*Qz`FK@_hvc@I;MfM8&{2;uu z?d-tL_NHYoJxIvg@Lt+~xcx98zqY*hHX$!T5_t(>ca)1PI>)esm%XZBXLBk_%$f#t z{hYmtlla#-Aup4`uW=&Ni^;S3H!b`BlkF!7c^4+^*^?&;`7SI~0E%crz6jU)^bx%I ze|xx_9)jfXt=roYfi2!5dp-VL5(jgna5_bQ@16kgQ62y7W68ze^nU!F;JLE?sX-Ji&ke#|EVjtC%(re=>^H;Vrbtb*T20AQE!LVnB)W#qT)MVt(N>s5C^=1kYj)UAs<&h-|D64T z75}M)QFk8hB;<#%NG(woDGfgbWX^<85deVIaIOSbJ$0%e9C(q^-uFq|%4)p#f4pQB z93dt11en%lM}rvIY$?;k=ud87G_^g~%CjY+vyr7N0?H&f+(;~%c#HhdyZAPV4bk@` zisl<$g1;c|T<0?D`xTsfrkJY?%Guqnv!7qkPPO2)b5ky`9Ox!)z@D$lekk&eIH#RR zUPplWbJe?-q|MK7KWj2F?`dibe{|>?Fbg1o5etv3#1FQf?%YK+xJ{f02@*9C0yCdz zyf6kpwsK39DYYdci`=v7QVu2#r-*^ETFG234G1?QW-S?xB-0+$TZ1N!nHI3VGSb;_ zsZ;i*>Q`UI=h6}1+#Ijh>ratyWNYa^ZmtbGT%QhKPV@iY;FqhWItL4Nf9LNlwA1pR zMPLlAnvpR;dLuN3N+sxDmpBmjxPrWVIPSb(6Rmv?< z#fd|rlamRs*5ayWX2WIGe>_yZKsL1fZJ@Fb z2UEz1I2i!GkRInNP(du1kqV<^fXS{@)^)8-;YcjZR)^MWnFRPmav0^B652cYZ9x~* zxdzP&&7#S?tmxE1!=Wc$d+{{{0K$q}YLSTy2I18V_S`*S00^lx#Vm1f z5|r8taILUQNs+h(5e-V=tGaK&xd0#zqg1_R>o>!ejwtCBMqk45? zLO%omE0O8!x6E)$g#x{3M|DwHF7>G=Z<=YKA`^Y~mA4f2I^pr}hNWZ%LHZE^2@~Wg z|5GZ(wW^IJc4DeD3oz_{#Q@D@zX~g+OM@QQ0B(%49=LtsjJ01cy_RGXDghNCA3bj7 zGHg-5*AlvDe_7M1)dVsU`msIsRlOjIy@LCh+~7SRBa6&}XgMD8`cd4hLpfLxNU$mt zXzwSyq;QSpTY7f7w70xxCh{NaHK)#IA0D^#p-y*=j#uvX7|3{iXatGQL?*vJr7AIZ zJ@fUTCFSd_l^Wiq+zAeLD)kzAN_i%38|wfITUJhrp(Kg8;mHxq@ww!&?N1sOzsy?afDk3i z+@0t#p#N)tNT>H=*%7WeO3E>U6nYT?i9KcssZ|IdQP_Ljb{Sjau^)5Wv~@*WOY6)- z?~pZNe_uRR3sM{~p55I_k--$PORdR~YF1o^YYG%nZFSqE%fXUhdcc{8%q$Zzih+_( zin*ZtpMKvU@Ox~M68__M5~tI}g#NucNy)~le+UntE06+EuW}Dsfs|S9&SUoZ9V@5b zMuBjlaJJsaS1V~fEi=FrGu&7;I=WKGp=Boif0}-V@hrOC4V&OXz2L0Y&*i!=d%u&z z0qaWKbSeOkU=uuxse5{S% zYTVqRD4Lm6NS^PR`{{ z1v$pByF_y9!13D#j^8nGk~s_GT396m`c<|C$1Q*)oWRMTpO6x{e4s#LtH0_~st$)M zVV9PoUbhQYgTfqhxjVfA88U*Yc#N>`e{a-*tsB^9M5p6`MF$2O5@ZCDmN`t~-Go7C{GI>)#RY9jHTh{TF-L%Sak!)mH(Wtx#SFU^HG6oR6qK2`} zhDBOqXWNT~!*g(;gi|YM@vIIGW~d^3mRLX8Muq+{6?axO>Wl^xe~2NI zJES5h86D`&gGpV-0F^|@_PNYZh}G#cZ+&fUT06uarPo(7gObIP1Ui`pRf8r~w{VE7 z*92}XXQ5r?k8CH7taLk1C!gIp684kTU_VvoKtiui=p1!gL_?!IGSc(#VNuT5CNvP; zcXhsC-ee{j6m(9bBCiNbjEjC)e-SSrY(eOBe!g?9HfnhiN@(ezL;KO%=LtZ#q7Aa` zIXcv~5_fhNaU9+DrGCD})^JR;O5P?VjS`dPM56GgbV|<4O1!1uM2ei8(zA6lA)?ge zABO$CYN^=ht~+>w@N8t0IZ8SUX}k|@1ZX-7AZVhp4nTU<`l;>Aum=3lf1|&~(Mv!i z>EteIf2k`XQOEp_5+Bxo7X$w%#<34-xieL^g4%-Liq7nYJg#eSba@9}>?V)PfN>r(? zyAGcU1nZY2Fs#<;uE}@}id~n(A-S$+MR|>KuJ36v8q4V=z;Ei-e{_su&CnucF(okv*`oa;E49a6D6<`o194mH5^uWu1 zOb>NFNedI~%-VXse`tqQ+&bUbIz60RQ zouUQ^I8^W(r=SbZ8!G$GDQnSvLnXg+N?KsxP{}Wxk`_}qRPuKXlrPVHzs8WYkiG=o zq$8nc-vRp9#7eAH_An^_R+fKLE3f5WQ|=ompw0`+^?>zee}J=FwPe=@vLLNIW}?x1 z6UY3b_8W!C(L#SVwdYyPSF7bZ88LVH7&!0c_PuvuvYTYdMZ#ILevcUu1c)NcyuWrj z=DWLkvQ_UGISZVIfnDd0PXHgG+%2aU%2&UqF2D$lqY6K7EU4`A{LfthU$ zs4ft1cCMCh8!I@kkr-?h_KHIUuX8?7kP!O4FROuJe_9$#f67LY3Wh*=AS&2ozCfhM z>Y}&;_yXxN2>5h>FROy>A~GiQ`MpO-Vz%PQYV8%u_HzQ7#9hN zl1LkAf3%~7jJ%;gf)*s-%%a%TSIXkLk$#qGmINu2c?^DXQek0=X*#aG4W3R~n+ae2 z+Di3xvau|ZlGaKlsCrtHWd)AMDs@;I@W}nq@aT_VUdK4eA45)7^( zEP#|G1UO*T)gS0$Dg*Buc(|Okm^ti`h&t|`75-$ zVVUKl0^Q8$514fXgx`}B5CY*#ATyNi(ZzHy{c~IQ0&<57??NhXjpI)JJ@+c`FVa-p^G@9 zbPBuiHP5fmFC3443dg&Hz$nq#Z}X@lfAX^-X0T2lJeZb~swY!dS0bNWIH|1f%RS=3 zq~x@BE-vT)^6a;{=UpDA{NWRQq^l`Ba9IurccIh%hUvegA$zrHNjC1%lH8LC1~A=Y z$01FspOqq`VAyd5t$H0)7^IF&MXl82sw|#bjkS$$m+Df$+cAMqu_sQGFYT`uIAP+z;Aad{%7upiMKrr&BaGxLdL?8J((&8@0XQUg)w|BQ_My8TJZq%(bOCoDb`8YJ z4~^Vc*3}G7Qu?^af+D3sIzlB*w@ZHqQ>Lj@iZV}5Gus6b^xtnnlT z2o-&S&&*JRA~YRw!@q0m{^yl~arEzGT0FDPiL#0z-HFxDWVMny({_kuk#8t^xCx;{^B^#xzE2TtYY zGg9R$IZ7~e+=RcNfB#3Kg_9Ur-QnmRA;9q_nAIF2n+n}O7$~XQndYIpZuWCG-m6v( zVd0A0`?87jBZZs+E%~DCoBJ`kpuyB5^hqqJ4EDFR5!!H3b9hZKel9(^K4UcH080N^A3M0sa}V(9)^9Z*OncK2oy1T2O(~34u*dx`;Vg zippb*Z1e{@fB4MrJ1Pzv75bg0KPX+(W$s=g!f;bETN@Eo%hPR$n-`00iQDmLOti?H zjv`0Si^e1%%B7=-`8%T{m|&6{t%OIsP{(RKCe1XS>Bv+A`A9I{GjfFyzeZbyCSy!o z%XB)jpM=t=j!8!mD!~9=RZ?!WaCgwF1Bcx<15IP%f7^lWbB|VE&6AF>ea}laRhIW# zzulB;@9O!_sa@MNVf3xp60RIGDqOmjQn)tuK)5hwM7S{4M;ucygaHFt^JO}Uq}k5g z)}vGFTay6NKC%NgCMM0OWdWUIRCO^FvdKm5&3Z;rWOsY8sP$OsrWExigP+IJt-qO5 zwDFA)f1`xbW466m=%kYk<~6-r%R<^#lRFFa%=6i|nWMC=u1}b`Eg4MzKsy6DPCuc$ zC9&{+Gx6ysy>6I0kPY>dhPyQ->L-2PG(V6i^;3pg=P|6zj4&BP;q_amKp>fF%i0&n zM`}xc!q|p$tA17$&4jB#TATcES9!w#ZJAeFf8NuSt%;b_GibX$<6`a_y#LB%o?>A_ z2}qIEVNgh(jVOe>-0u@a;#}ym8a+yP#ovn3MC)pO+%eDr4 zUmD8y^ovJXHQF0P!uJdLt3MtT0PJu-JHd!;6?1qoj2AkX;0S^VPBu4_bTK*_XBX>r znQ?jAN526elvIGrF)c(z3VetoLwLq}e~?4~En~9h=EGuGrunEGr#f_4At@}f`EWj( zjMHb?6mfjb^>uEwa@ zJv#0jlvC;_c@-sOd0nV1uXxTm&crMhWFgg!r+Dl-#;?R5vtxDWCkrwmb21~-eT?H=g8u#jE!VJ0WgMX&(-h>e?%)gP3PV2R1!1??AJxIzCJJJ)b@ZmcDNI<+l|k& zYE;?THtLTPa_%T|X4(dmOj?9A*j6a4>SeL89{lAGh|`)w+6`~ z&)ATvx2b(QPg;O5j1D*-XiKytIZ(FLWlIniGkto%K*K@6@lSaW;jjO(D2JS*5E`8fU!W&ciI**fM2&fYeWX*S%;Vg%du{^@5Da>-%Uym9e>@C_-Wwq zXFdI9B}a3gWk24|bM?9(_O%xl13OuRmI5j5cB5h@ElVzA8z?pH<@i~o+*b9&ZJq3( zXzQiC+l{?Bo-0FC!{t~$NQglvyNgZ-QNc`gv^1T{nmclqdae068+? zoZ&=A6A^OYO>HJie?$lXWq(=SmCK34m&4oC#~n~{UGfW^&Av0si#hn1x_HZ4Syxex zXcMRp>R5+0-n*n#m7h`1Lh?|@q7@RmTI$m{DU3VSnuzOAYckrifktuCTkyi@Zda?I zx4*Qsz!ZLP1{TEM<`Cj0PTC;gw_SL2v1iv6aB4U$r#H^*Kk}cRQGfB4=2PmR#fb~I zNGwizFAf}B#k{&|z)p;=!aWEDWHh=dm1AYy^V-2NA6ig%ppqg+cOJyZP>nO?fQK-4PgNl39AImr= z5F}g!-vYV-un2Cc0IXyVP3owjkt{>CPJB~Y1M|e)*x3*QR?@;)#PoLx-DS29Qf?pD z$&fd4C6iMk#$br>&f+66t{6IlBNEzjEG|fdGkunK9Qh&fdRqz=kXj+7xfYzlt zZ+VEJpYRMLTbcKHxO6{>*XA>DDa11hv(3ldgMhBkTuFKwyk?yQTFpMU)eg9hc$`KFIP`M{PxItQkogg9N!U^pbhuWZd=u0;3wN#8W%k`NyFiAgFL=i;Sb5DlK(utD1PO=J>Z)WF)xFZ|yqVLyq7t<@ z??{r=K}HtUSro*JtR7z=PXr3MQh#5DXk^h5g1PO{B?w;=anQ0^KZ9g0;!W7N)_=J3I3eO~c1MyQXSe^=gHRcbi3}~T>-`2|a}z>- z+z@wRq<`_!OQL|6nv2lU5#p&07A-hztZNeg;5M zbX3@cT7OFN`?)b1uEA2i39j@A-w4vrH|-7@wMb9#b3&BA2FP^9++y+-mF(FJ{Ql)F z$lUn6yeep=&xRpLJS3s-nVPes!a;+DmVhpNY?Y+*NUVl-k4;XQRePJ+)G2w93P6j2s+U-K7 zE!L~f(R2BEd3E!$RLL$|E?&UWGsz&8F6GUXynwf=#>4+Bm&QG7QXn%h1v>p<6k(`tR*F)?QJfLAxEAc}cGkjE_ z%Br8qIk_UIj>rZ1NRG)qIV8JY{eL=F^_v=Bn}G7yy?K60=Q5(a zvy~bZb(Uqv^rLt|C*>4UD!JRG^S~VS6-GWL8a$^R%03jlWYQ7vN^YCQCFY~cJAYT@ z{AO0n=e;Ny$c50UF^(2ucK>MviN>_~0Jej3-1IBge!#SOhQVBlrJo}c_tC@)*~p?( zh;+#LO%{=Prl5cp`mIGzDXpq_k|e{%Q*f1)(dMByr9QYDPO`N3ZashvZxxImfc>b_z4(GK){M*S!j|BqWK_6rE+K2uhQ|W=3w3!Sz@7`+o!6HBPjN z?j(y3v(Z$qkmNcc`r>+1*P4(q#5|B`b_h^+d)bMp7rP4nj}j7JWbsiZevD5{b$dyY zjC@7_GX(}3Ui3uyy1b_Rd0xT6(o_jMlgd8w;MWQw_2Iy`B>^#-312g{@Pq}z@6eej**o_d}n#I3Sc(tBq=fvhyfi@K$h>x5je&i-)U@wQH- z=Xf0NLRylMIOzTS?KnG@9%vQWO)wT%F948T4>;PL{d~33_*7&c^nYinY!N71tX73C zdz_@e4Z&{jcHJ%VxZB-0?x`DaOjBQga6^rccU_C_wT&;@?OPFUAVcyO#WJ_pa@zm{Kx;aB3H zK)_*L{G@wL?tdcwEw#+UO+|y`T%*UpL{67Qg}_&!3z0!Z7ELQ~=4p*&^x{<3Nh7Kz zx(B8p0%*-ry8a=nnF2T9uwwHt83AQR#pJv-BIP}MA7P32QRiGGraGmRb!G^dB@;`} zZ#p@H+>Ej^%CRUG(}-zc)HyCYv*IJ_3uGqcd_ITJDSvpU1DcimjCSIAaX~RMuu301 zxW2ybv8&5pD~t(LWgbj;SylHX;i@Jk3do)WVzZ)wAWbqk79`ISrOc4^oe)>A3wF_Q z^9*%fV*2MCW<&a(y=O|!mb5|CN9UgN)q4X|V%d@DyPnHzTDJPNdhKf&$@oB8is4QC zu+G$#p?@~rts`E(XB`YMNb#AjFA;+jft_Tkbpr-NaJ5XNVnb>fg?uZV|DgJjsK6DuZpU-*zB?_6x|Jjgh<76FsyP zJobYu3GgBVq`CKyw=d+Y9?A@7<6t##7o-_}8h=M|MDP;@*qRa-~Ceh*)&McRSp5 zJ%8}YZ1f~4ad;vk2oRoZGE!ybrX4cw43BQ4@s~6%KYK9%#P@2#UJtP- zv>eGG@cohj1=t@<_5{~G5r|0$5rIR@8h_OAEIhaF7=GPPCfM2T)yCo<<^`mB6B}fF zpzxmin#1$5pEvWh4Uf2ONps>RZY$;nRD_)id>pCX>Aaj=fJ=$!_g?>!ptM1~_-8SU zqBO#lz2;)UlC>YQ(N5Vg5`00UG@9k}ibiWEw4<4;1VqGW?F4+>)?yn85?Jg<(SN2| zWx??^smElGa>qG^nbxyk%mYLt(lhAP_RWy51G}=h8W15)z%FwmSjVZ zA{hiDa1}Lygq2*+Vd3d^)IP&ae-@U;deqKcL6INp(zjy^_e8e72Tr=Ah~^##G{xe-bX)$ecVbv zWxlsZSbb)jg5!U+5Vtid6qogRlbO>inq$gSWI_|MrS~N36Z&uub#VhNi5iRz|_J0@DT2DK-Z!^J&v)lItQ}3s455ZWqzwMf#X!;`?L|a7M z--XaWyvBus@BY~GrYQSEt6U($?~g8UlB(O+x%N20Ke!Z`(Ykd-aziN|-l2|#?Y8Hf zHV7!_$8sfcmFSOMFWzQutzd*=-;Gf0kJBg`IHs8msjEg+G}R_y+J6qa2IzUcU&{hi z!EVSDBoL0A{IuectFm|+M@zdzQfG-=y9rXo)4xFkX1#rY$0pT3bW?0HpUP)7Dm$GB z?FHJ*&A{*t`n!LXQc;7-5{SB3mLD z+frHce?X9?jV+?C_kXO-aib4$ZkRdsJ9H-in-zFy66IZxF7wHRUWqjNhX?0WeA?7g);7^l9|w@aQ;NuL;Xr0*Ant#_~C9q)Q)-3D33%yy@7bGROFiT_zRT z5`y<6=6EQeCTPp`?6n1Y@XGciWU0HPt+esTAl5l!jj3cfoqtkLYR>`jx^S;E?@;CDXb1HAcxWyy=Pg5`7UR-Ho`KfBiPRG-*7 zp0r?I^AR2Q-0zGtyrm#DNg!4p#?M(u^rYtyURzh_h!rchj#9iQVaq!m_CPNG&7k?8wb1<D&t!|g=OQIp^NDaph%hXWkYDM53Gf8ypl#1lWM4lO>Lvp5@iTSEJm-$uH z$ila@5m0HqUh~+6xl?F~&Q#N`eaF9^%5;eKf2$xZI6rYlKAOWMEL-#19CCH zy$_T_`vx;GeT^b%Z&rMx0Cew5=%j3xkn>wgshXm3b}kwGs!g`25>i^>$U9oMo3=) zCvdUeI8z&-Mmu4PI3Xw5bwe zZ}*O)gdDF{ACu*ok$lZBh?T*GV?T>77jscuhPn~pQJntyo%_vNE2I?4LIEz&q6rRYk!naR$;a@$+m+gne! zA2tgo#5Arak7C(ACRu=<$g)g#jpUxgj7{Q#d`QS{cG#1Q&M_5# z2H!UFiB5H%^CrY^7&m3?_4M0b?gi$KNZa5DXwPb_P(PMb*2e`2}pOI_&H+ zzo0L2k!NB(FUyO?Rov_KY8ajJfp*?o`$oQSzl3l5g-w68v@-6mpss#;BYAHcO8G&?XoX9 zrUAy%MdtNXx6Af0-Vca`n<>VZmh5aGU`iA?bFhG(^2o-}kaex)4mGvaQnzkjU@$tx@dMF^AK?POtK;1pX?1SiIF>?HOG@EHMpE1i=9Vm7Gw zACrY$rj%3(6H}8nJEIEZ3LhKz2<551v8DQFqwmyz6bug=%J{B}AsWRCAYzMl?u>Q<9{UYgFN=l4Y;xB!IAeR zDmVVjr24^5l0TgIL$)7QLCU)PkSH0 zHe^kGKTf#N$7D#Vu3xb#aFE${2c9CSF{%T_j9i7G)z(Vj#zv3nQQ0LKN9 z#`QRRD_)^HW`84>!QvWoU48%}F4cpqFzGl!1$34y)vH4BE3S0OT0;hfJFUVo z-N<`#jgUh>&-8UoUspneyVs-hgtXIyimW;0sjEhlO@Gurwsia4OfCK8bqgQc-U=|Y zp885V3JMb0f1pJ zRXwca{{4!eFoKd2hb4OfD4DuZkU+o#9)U0jcz=loh4j4J&23d{4{hHz5(eBBT1yS3 zgcSkV4opO-6@@U8JRzDE*AH_6^65s^?UvoH3RC0BdQGNE{W;;qDUD}_+nU`o?Jbxs ziN^-Z5r+;A(yra(Z1lKW*a1y41*nRS0x3lPvcibPsKd~ACn%lPg3{@oLFv>)VM&xS z1%H45!BvU?15L(W2hSVNp6on&mJs$lliA7H>)v_q<*U8dFWj8vc=up;e@~fF+^mM4 zA>ozFts8W;^1YWG2l)VWq>*Rfn-DFAw7lK@c7N~S_~hu#+r8Zv-7b3-*Akk`w6c~6 zH&r)Kv@MfCJi_#CuVYMWrh>8E6fW$*8Gm-ECL_#+6l@s+pkyc{hyq?f_z|3LAq$bj zufj|3)auL!xmmkfGKi8xRZVz}z!k!h{l+JIKfh|QJ#!XmhAD!nNxO~Q06u-6J#4k>A{3Cth43ds{a-vo|qh9pd^&EftPIR{(rwZCUx!LO8|+nhcY{=6|M0 zG%_!W`h|qFEj+F{e6#m<_xRP}!O4rgm#+?9!A~P98dyUY&k%RvBFuWtI(Y28yAEbf zk=BstdAXQRQRy{^jhV?qIC+8c~s7I0QWi7 zBn{5}Y@We=?XERtconl)M}LTW!;{?IFq$k+748s*>%zx2+SlFH3cbr#s}@FBtxf|o zB_XH5FGH7pK9%b5dKqAcjg5HYR2{mJMnhP#CTA_H;iXS);^wio2GbX@n8)X2SzC3^ zLW{szFzhot1%lCMT8_A7WPJ`pL@o&h9js7;t++b!hOv|;WEprj4S(0z?gObMDKDL) z;RO(y)?gt-dF0o&^KCuI*NgiMuCfXP6@)gIi-RJFg}881iGwt=fv^It8}bkGq;ShB zxms=2?)2t)C0=QlkCT&#Y$4)_KF%`vW%>i=!YiC@%D-x(N@IFAmh0s1;kM0BEmoU@ z+J=B_TL~Gl=VJs($A7^C%g!>NPU$ol00xWIbA%~>nJq!$4tNxUt%}i!wa+#n$Kik) zZ#Y2+tCf4z+8Y=2CeRgOwIk~a^S7$2MRjXa&dMJ@%ht|N^k+pqnCFs z=uNK!$@nhwo6dC(FhON!QOOAZ3wi?yTk}gQD2E5t6`d5b8-K);EIAhFVFpn5==QUF zYI+-w*vm1&{I~AW>YJLbq;{%+A=}sxQl+Cu*uQE$*syo1ZtpDj?h`&(R46URV5ZyH z5FR7PqQS{1|H2uo+m-F9XS;X5?;_ioth|^U*qY*pG?i;baP@7j{ddj|Q*)}miR|x^ z^+h8uISg5o>3+@GG7{r%mmB=( zgz&qH$2HdbzG*pDdxrGh)OJ-QOat;BTZO7P>E%b=u73i*#W@HZDPsRlLPQ*W{k6J^ zy!`X*M?a@RC?73q_2kI?cAL?=Vc`zxCqdXbJVhTc%+VM^8kbDtlv=Nw_Hp&JvYHf7 zn}gyrYlp{X8Z0@Z1b(B^A5;rq&|uR!)K|kF1}t#tXTU)72a7^)p2IxIMiIk|#B@wp zkCg&WE`Rz~LfB8SLnbi~z!Zk+$L8LFUl^#*q3=MqTTyXbT+(tO0?rtsreuVMREtvu zu5Rg6=+{W7Y&FhkL$rS0q}n`5)UT450{ZrKLPF^l z(5q#n%orjWCxrbN3vfiZW#mN8QMKsOA+fkp{Zu5a-Y%|949bQ*dZmRCXQ?ta%GOI` zEPvnu#TuP9&=-K!<9ugI=fwxgU+0zBmkBQFCTr=2f}`ykm@Qji&IK_ZVCHz`eBzdX zv{1@N!IEzH3&GGddG2p8CwQbfi)!YZQy`bE<}P!7l!Q0iXFA8eqL6$2&-n}VZC}(b zn%X76KEWehU)>Heru#)XbAs7Iu!6uW8GkVC2HIA_nMWZ5v(e^K)c@BgI;FFcQvg*A zSY|QvaQLIxqxLhPK@%_{pd_Mrjs9g~9n<4vz`l>!Z_0b@m!N&6|M=mP=v3v#!2WEUo1|CGNE)i8U&9!^YhnS=cG|~By9AiUR5?*-xqm?0 zrv?^CPI~_&q5h}PF$@3~6=AR%4?Id_gFly)dMHqv*Fu9%?xUR2B+N7;CP_vlb`%Q- z3V0zkCVnYQg<-)S?L6skCxmVJ`UAqY^$p+Yj!=k~dzlS&61| z?cbfZ%5UIis-q-MT%XzAiJsHov46IqLNxGPgugQO*nyl>(OBq#;jRROys_pex0oEY z401A?oOSCq@Ay>A97e5-sFXc9;x=E4Tn<{|6HG!CU%F$2- zE+h&TQeJPZKZ!IaXze!gGzq5o-5>Xb3*_a-8N)mOwI;KX>r3qn2Y(2z;3Y(xQ<(dA zVFH8Q#Oq=y?#Q`JHPa*{e3mF`hX}G|4t#7afrZUeF1LE8@!*)d;G8lgHry7twy~uH z*Rb2qr~pw;z88buO36lM73ndV?d=F5S63@kqt))QUwW@F(GDcXZJBE#Axj7`DA*Y& zSJ^M%TLRm-TUE-|=zo^wa)i4yc!6{NI#S>{@oAiEU$f6(`18DaS@H>;zLn=LUdcqp z9WAcc7tN&BM~kazF6d9V7pNS_a?z}nJEP)7F`LE70OH1!*sAE&G)ZoKlXF;>(2Kd- zg{+w1OJ16d2)gjH_aaeG$a3uzlbr;?UiuruScN8Wh!BCAoqva*k@AKCj;S!DYP>+j z@AkC>{8qP0HpfL*k?GgtGKQ`#gOn$!p#y!Ulr|dCy~DktO24JZ4q%l~)xl3_H2lRG zvs$r7aoJNCzSbXEof_m&IZV$J%p~NwE5jf`epd04mzTC|5Z7Qsoy{t-T5XtNF*ntS z5lko2?S@L&n15i=oZ0a8_9G06Il%bcE*sG?*a!qh;>d3>w{9r!gwz?!9)zfcz8Y9e z+!b4uiX+*;2yOR)YGe+_J8LmIqxz|_a;d4@C0?<#=?I;C$dO$FmEn?n1QrLR%&W1v zaNsMlVC+ohX@gAU%jT&LlCeS1CL#lU$mi+S8bs-q1%D1h)8)L%+4R1eOqhpw$lQV% zPa{^|$D*Of_F-CoAnTO#*7_QQlkB$EHaMHMvCGlNPWuxg^Q$)Opo4fLU#&LsR(q7K z8P)y)qiCyn>Uln&(`iR_b!^o6jSQwFN*w5JtJ{w)-n#UY^6=Jm^q4U2ZVmquz~s6< zFDB>K@_#j@lX=d;`1OTpn#ujzd(U1JQ$VopTtfC&QFfq*O%v>FL_BPoPa#3Ce!A?~ z8rR7XlzVn9tF0pq@rj^i)|vlVxLoUY9V`tFI!fDPH#IXwf8qrwVRTk7eMn+NZ37bf z+n+diZ@=WUCGLW-HVTzcHKgh7_%5x@O2`sxNPlg6FliQX{0l#~cbp6GZdtkq2|Fj@ zfS)zjn#OTLi$eC?4b#rsVh2TN%Qd}f^v8$nz%BOtJZERr*RRDIHAcJRv>qR@dMVm+ zqK4OevhL7bIjZtj37G@dO;83g^&$k0UnEaRtxoLU-YE)VOS#pjO_zD9qyYT(pcr!Z zI)Bz&p~B5AGq^i-LrMeOCE$q5q7uafp_KxAUI7MK(8GYrF)zFaQWB^w8P;g`7IUwrfO5)V(Y0J4-KGYJ z^ZUhN!InAXYiC(TW1&{RDV#9ft<5{_x=iYK>L)B|i9XFN+iF=SV7D@~G}o;FMbpOY zsZ~it@06GMbdpy>fy^`vZ@7HCDSzj4IAS)9OZph;h~j$KWnZgT<3_dRRioD1D&6{o zN--V=tUwOO)XsS5!N~j~Rx|JFM0n<;1@v_y4E6K@?)3C1JS_&U`V^oXLI&JAIYW<* ztnobN5DJ$=Kp!>eGJ?qIglat83jzw*e4V8Bq;P+N!pam+47HC!l>MzlSbx74w_HF5 zZNV&TZc|honifdTmNB<2V$yRsdsO15LY#vH=N%#mZJhW$zG=~CA{Jhgu!`@O)5boF z+*z36kSlD4TolVKi%UwF%=;2p{7E!)G;IiLF{atBNe*jWUS|d{ zsyXz7As@9t#kGVg2<(4xV8I8#vKn(WMJcV2 zsO#wU$3g~Ak1~Zv=;2{9sWYlzY-XrPX;cIL-vn?6oNn^b*4#-jm!l^&JD}(#vuv(E zLZ;aq9gQGk7&#Ak6E4sdj8kxJS9)toCPA-2x2QZ(U`ZXj0e@pY)qSJBU-Pq3m+E2N zv(hW7`d)X|%on7y^MuSi=S{fLGSP0?fSZ#M%V-}ozrsd!N?P+ePwSpNyIH)^PwHy& zIHpz@L&Nq;40!U_FMo>Qd~y>9P==`0swZ5)JS#vt4-*3vG0==GQOtbW)89~k3E z(PoGC&VXNS`89Yh8VwG!TYwfv+U8gM857Lix6FFs+^bDR=fI*>vHrpSHh=SmFKgg^ zlriFvybGVU60x;;*E-g#z}+^ttP7jj-WM#tyaF+g@>nh zxz0URk=lov9u3xa&^_PrkXI~EhFrrVfWU47dXki_*S@If`rRS6{~h`vZBgr8N=HqC zhvdnHThAk}9$GiNOzG+3EROb7K2+?6jug>4GS@-cX}7~*IIsQIQ^yQc?|cda;tJ2J zm3t(mYk%-*+;REh+3m5r;E!<&U_<@!tAp3C4)#uTDTnGOq3?WOuxan;`R?o8w#{{12YM2kkk1+lrAfD^it zZb6I(w*V=U<~Q+K8=RWfq;qX^4(X1YaEqu5lSi!W14I$8z)z7(*@*uj081O8R@8Sp1+Y7Oy3&Z0>VI;iN{lfY9Q2wC)eCx-fPxARZHR;9zLAN9 zm|p3$l;MknZ1e#YQ`4)dvQ03+EcLh7px=^(EG7oxbvjs(I11(!FeK#A6A*4D`ytH< zR+|=U1pGIuPAO4v2wPQ_yd|%)e7%Om>BXdTTCk~w@Z?nhkxGJ#^2)841GFp+%YQ5G zhuGSDiIp1D*NIB!Rbo~uSs6(71Nf7hDVZf&oe%YfzM@v^kY!#u2$Z?WVH$*-}0-BpA&wX@v9M^j#n#O`{d8M zLwwk0mR}J*HSwA?-&e4rwEDr?&VMkG0x_TCQ4EGT<(I?^Ldwt989#Np>qD&l>u)|| zd+I+3>`xyOy=;BdThp|tuF8sLLO;3k0Yn+ShFC)!V0lWIPxXz^W_F&p8yPS2s~~LX z8EwP#ghvPEl)8AKVEZ43Vim2700(?V;xfd+DQUb&_m41dlsmv=Mp zhDBWyKFT!h;-kI&shS!UA%AD2i$WW>{vJ-+Lm5Ou(w?4Z{z zdx}tUoeZH6+UC=vCiwZUT&<{+Om>$X`i0jV38Sj4cgGV}Heefn8TuX<~<(*k7-A z-G&1Q{agL*Bh>@71yP9tVUxBzHz_J$5&2Hn_OcdMh(e_B%6@@yQtR3WXC?Qxe$yhk zb~V=PE6S#aK1Ml}P-S-ffM0AR^i`Gdi{4dv6(=%`)FQ0ILk-atpy~y@drMEi>mV5H z*-y2knA1z1S%0C|E(KcE3S=VgwW+Pf|41eBf3{UWX+F1$Ccp04^A3tSR*+XSSfRTS z;m%$YMDE{}8}(?63`>(C{~1Rz<=<$ac1y)8-vbX2a0tKdx#uYUf{Z8;P~GoXy4&S% zu-sv65VvfNFJz6>UnjN*t+6(qMyQ#)kk5>Yl0G}xAeV}w!XGef9H>)*UW)DYiMaUA(AWwf50ykfnV~E z-L76gFdVYE`MQuuI5U^ER-q{k!6=-&&GifswST_QxpdscGRD5u+N>HQI3NE)Hdq*j zwUVp%zRbsvAdn1Anqws6kXhAfzwCkkNwTf&kdOC#M;(SYx@4sJo{Rj~$Jf9ONG}_zvN}nYar}z%MoJi##L- zG*EiIK{_D<`!fHyT0MUBXy-8r8hWi5gnzLpaDv_CXB9e(g5LQ#SmM5?H>(v=*YG}r zKop0yxiMqnrDMjlKQaHGZb{zI0Q&D4&;b~JKp|eOVyQCEiHuO;uhGO}K#r(J1?e3_Pkbi^m zo0i%j62tOB=^}oqIiVm8^#Wo!w+a+?r8R*^8uyKbhr48@N#FccQ(EREf~CDRvY#0p z%DSev?E4x{gjm2u;Cp(LmHNURyD~1qoC3a)*c^DZQojSEUfo)OWEQAmVXgv|EN-pD zoj6%R@}8=a51Tdl)2FS{v><*Kn15WItp9A3EPrzCQO?@&gCn;8sg_4etXBL_8XOVv z^evSBlwPI$C%Ha4YhfQ51S$pZsOt99i0nV?3JFqd>)HC8dU7H1$$7Az?NC|-{mb!V zl7Q!R1Ls#;QhWsXX2{Eu6A_-ENa&PaNruE=@f{>ZEl>_f7)u7soVdzc8-J#ekXhq%J;|G&L`dw<(D((YH0boQv^8$_|w+m?D+oivwj+N4Qi_o~(L zQWRvNrbz`P?YNe{`}xh_4uZ0?+xPs@#v(xw#APs;dFC0&I%CrPO!=fL0YE9@_|iVo zM2{@dUfBDoN*`l&a?rT0Du1#D4X$9^ymn~XLmsZhyxQ4gKNaetj_<%gHNaAKuSIh1 zf7a)zFt$Aek`UCtkz^Dp2DxH)Kt>Hkv;7(?=gI`37-3H04#n|E#L(T9-Aq}+z|LsOgB=ki+t)0Pf2^-mW@hNZvT#J$9*&20Xd z*q{DPegzz*L{KRwOqW3W5v3Kbs>Hqtm};pi5Fp)Fa>ea>(9WBWm-_n=IRR9cH2e`N z0Zf-){1Hq63YV<>5uySgr?*i35qAPeAM+_h{YkRK4g%L^iSEuXWU}U?nDEb)dJ>HRcb5nO66FE+m+k=)CIQj66#^0}0RbDA zKm!se0gabw0}@VuF9D-1dRVT#nKg^IltZo^Ym19KJRY-WA=YKRCJWI96Nx?Pr%ET) z73KJ30?~OKQVCg0!8p=-DAUE%PUOU9a#rtkCLm@hUd+|Hbk-V-#eqTe3y7C1u2g{? zWQRH%jQT=Pui`0FTgYz5oHK;;1oH0>?gn zI+5t%Y(U-G4`+!9)Z?*t+KqQNS&x8DX^HMS@(Q7q$ND4_iEVwRTLdy>`;l{B2JJqh zvMM3aR!G|sJ1;Aas~6*givs^7JRO#AtN?L79*c0WtjQ2(02DzSXA+}###yuGV=$8i z&``n$x*7j}5dMbC@flsU+k)lj_t9+9L&Q5Ua7#_9@*9QT1dM@VC)Sw&fh}}AhU9+= zq4ne%LUw@s#z_EpyT=TG5JZt@1jgt7m66c z9WP+=4zZP(_B!JTAm~uO6aDD%XC0qQ;FSRwr89x=dyw;)6K+pHwp05J)_4X-VYL zymx8dTi)}%rFyTcdg0lqq@!d>&Qm(MpmYo9Is`J*|Gx(H1>4r9jHt-zkb8Xj@fR_Fq3U=dd{nRXjs^VEdaanmnmjg{V@aK2%IT-L zl?a$|O&k-ne(*)bVY35VF4HF>?No_406m6^Fl_!Qd8}Aq=AZc+QxMY(HIS=#p@>ab zx}4MiB94iisOe+Ha3bZT1VK96P;hUW(?xo#t|Z(#Sun$Ae55kD0*pK+nWh(i;uoq@ zjae|t$gNQh5=yiS$gSO`r`-}u8YGt*FnL8Bd7D&3WyB(`j7ZMauFy@hA~8#Vo9R!W zt8fdiqYaFnQCwa~QuBzD9;?h%Om4fo1*8BWi~uIq%b8TZiGbKaNW3&nFD1ne+5&!< zk?Xt6bxtQA~ZRYlLzu65*~}x&;q=+D2szRs^lWUyjG+ z8%&xc&9_og*JR@ixFoc8hgu#`%fDjGlXYkC1G{Ka5O)JkS|Zt~jSD23QR$)~?yj1w z0`url(k&X_ZbDPcvy%*u!SFM;40flN#lPIxI=<}%_yS=^Du%^ z1O!kpn`TX7%`C^u+DI@&yx4a!Lfygc&mR%WpCOD7Q)&FUa3D8LEE5_4SZV|mF763ZQ?(8_>Nu5>zWYYQOVNTTJF_R(eEve;L zDub%tsX-0oh$3}Hunm{Aj@=rt1Mz{9c?WO)lxL= zGA*K|*$HK$L{9WaC9Cn6ej2T`dMs`kZ2V>)PcOkx=M34UJ7hop^!(j#YP_89fbiUX zyccFa88QsyE3UYND`M#2FIPH>(yr)Ha4^RdZC9w0R-(PZ5q24@+Jmfj*TR-+Vw3fO zs7{B?-*Dl}B`R5f0w~GoABmn`dm#_;GkO(D# zRDxlq{8X1n3=%E@zL$3l5*>fP3>k5i{1U4UOXAuipXk?L^K5IqLfB;Cwb@{F{=OIu zn(Tb?iESV4t@QZsfi?_jH!~YR+PzDvkI;fF&B=5%sLFv^8P10X>plJ|+yXn9D;e3p z{+;(awLLzvJw`IW7oou%@rDx3qyp=hM!fkIfE36aApyVYg9km88FYVnFFB0siGA=O zT#>PJ-_fv+3%AoY-3c#CPYn2DPU#ae<& z5$1>*3F&DciB#m>@HkGWU~v{Kww`XFY)McKw)Z!aI+kyGFVNe}M5Enx2w*DyujyF7 z(7-5P25PXtn<-okM8IM5fYZZ9V*%RAv6$KE=duvm6u>&7qeXwu4>Kphq)z@bjqGx} z9VC}R%?)CKD)pnnAZyb$g2muh4Y?IarG8fM6YS1}Nv__oSx8up%WtDmLC>@N=1oZf znlA`AP|4SaG@wiM)DN}m_L+LK9!1E~f|%BV4(N4m_G~8+HrTQBrj+TJI7liEpWY2e z${^?ux`-1X_9TD$Jj`WB@sJ_4iEoFUyoc8rFCmqp$c!MwkPgP|EP`e>lJT0!XcYIP zLu@dbm^_ZjXdw3@A--Hw&A=oLM_bMygCz;EaUBhhQxgvp^|0-vsfdu1)F`p zJJSik{RDa>5Mm0`8}~f{QaRmY6)@=y23n2N#=lWDvPbIHeizq zaCFtQ^qm0?Gx5y!r6rlOfcL!wG3jN;wr$Q~XD6??M?_RzYmQ+hjA+2+F+%=)_8;}zP~{4n|L+eJ)_2eH+M@oXROwG+S@ z5Z_p$W619Vb|^_kYH2ZT4M#Dg7(9)-a}7g!wY|1Oi=h*LF_xB7S4?dxK(7I98-~*j zJ~4LM7R(W0_4R;u{2!^sefsdd6>wo24=-!$-krcaFNu;;Z>zFnm`9t&%k9|Jh0bE$`}L|1Im z@&k|^gN-@L(iN89#L~_zGW?bAqj|ZF3bKwD@pOfM6>LbBZey~YEa@7S8noD&B`YTe$KzaGt~F({*>ppHud)) z@(uuhG4x+k1O4hMk6IyMq|_7530bk#1Gzyz5gT-+-R_wB;p+}-z^#BaXdsx2iIus^ zOl(Qi3lOXJF~nY(urp9fNGV7^b>vH=z#3vsNu5N4{Ej`(lNIZtx(FI8kzzxyxu{7{ z71GuA#=FF%-IH$aVxi2uK8Z1B@gcyHRBXC`-3jM#tFPd&(d#NS1AMpB@F^UI>gE^L zY~WO=oQAo$9C(BGKzN1&C8xIm2-Ys!Sff-vZyL+3zy+&z6yJ*2o?c>N_0;aHm@+-k zwlS)bB6Z;5WNp;(Vg{IX&zc}kJ!{76W|S1bk?H998}s-|JZ|095bzbkbGnA(rGd+T zZ^z>;xlEfw4iIu~%3qGhm*gsK^a{Q)ExCeo#TB_uUG@^#bQJeOWy!VL!7#2J3}Xm7 zv?K@Gn4D|bc>~9NM*+LGnKdMgF0LG;=l9yB6UEzhaRAOLKM z9SVZZB|$?3o81djT{Ozp4doB<4I{~awDCNkGiAL>q&YlzC4@Q7?u+M9Ob#+La21zK z1xuW_Vy@MS>6}cs+Hdc5Hj(uZYi!81npN`5a@I?P3b~TR2*B3J(&5om=TA6E&!THP zoSda6$hYuHM6$_No~Rlu1}h0)5N~}>p2vv$0TG16v7(BEbpo($qs^g1yoKj~!lS&j z>)^d zD!?_d3^8SF;+gjfiB_1`N@YR5UFaQ41h7cp8*0A>dORKjkSYLKs!3I%r$Hf<`ZOUK z+;0PW`B$*p$r~ZM0glQ=3m+_h*BjTy9+@_yg&2P$IEIGo*|AX}l$njkg)~e;Cak?Y zrL-W!@v`;=L&tK{u_ZwcokoBWNiOY}dC&03tr5okJ(`77ML3&~9Y%Z>XzrDYXlI7u zWNM;jtJI22-}AJM7^%Rn+5+V_*l&R5D`lOJ zI~i-$9K9<}pLU^1Gk%ZL9dl22qOH|lD=LLEMm-$j(6-)Pu$D3W${+wC{Q3;kiUiT} z@PYGnJa(OXrpsrw6w}hofT;{Ytm0d#m?se0$3*H2$$T4Kxu?N+ff`u8+nskGJaQh4$z=q^4;2$7thU-zM13vB zW%WPvdJ({SxJNdBQQYkltiuh1W$Wm!M&kbQQO(pd^*+@b5hq?l?*ATjA~@I=i~T-~ ze+>#W!0v@Cz#WJfB^LUOP#@0_Lh~KUGvnbkTuvxUws{sZ%|UU%yy$TTBq1V!z2b&t zJUu(Rrps-XUz|z6*x6Zh{Mpg*cT5G;dC;XY}f{s*2jR3ydl}NE8qE|e>eq~ zwcKRUW)LKQ=&(%(yB(MaI@BJ^UP=uevp!7I<#;S&%uUuW2rq}GKBMcJ+;sD*k!wk@ zOwPbjNjbR2$aBdu0`lznZWlcVvTHb`!9jqtq$JjeB%H|cNEi^-WD|P1g@l(e8D`Sb z*M$?ERs)3OW(E6`4xRv}ts02qD*-H`3r@@ipU41z?yclZQOHE;$sUM-nGF63`}N=w zuu7~1bwTv;U|UcKBEDiZYm&jHX|{Fp=+SvK$?(;a6}@_tKU!6JZKIUFvS>!Zp!?ir z_{bFJUJc_R^+m-4QSWy7*GIi%9-AN|$o2puh#JN8isa+*9aN6tHUTeSE~~Quzuxc3 zl9eleo0{;wDfK>BKoU_{e|L%)A&`2%14Vm)69@0w)qp_a+IYaqw#lk=)NFF*iZKDwsM8iwZ4iZ&T59*HILP;3|vSM-V&um~SEkN#L) zT$C3VOS)WUTUMM`G|zK(UR+HC4F!>?_@fA(PLwF$H!@P&PiFdy^Rw&UzfY^JcazNolT ze7aCLcMtY6{hpmkMD)AtI+#y)Yfea{JBzg9-$R2Q4iWDSE2nNR7z;ww32`|_zMGzU z+zfRABSlYC=>Yk<4^-TL5B=_f@EMEFw@-CJMMR4_bY2PStD`W*U2tejvN6T&_+Y%CnRr=vOo zNMw@Zz5#W`=3>L%72gOli;~_ z8O|3$30(7&8E)EvQ;Od@t2#_kX70?(3Q1B3{Wsx!FNhGE&z*(IPV6(mO;n z3!CvID(z$Cfmw&h6NXSp48RIB`S8^Lh*n$2%R3vc%YIbbao=(GWxeqLA`ubcGK2tm z#gXbzfG}f`cn(8!CYQ9XvvZo3q@HZEW|MNF{7;O3*y;E(;^JmR@ffm_O8`x(Yn!es z9*O7xQA}clA0AKJuhXOH!-s8b9*d$1Q@x9#^LDXF^-ZAg!AKVSEl^Ac5lqg`a2&y( zWJZ+Kd)r6<`)Q0E9i-VuGCKup!%p|3&p!jFdwy362`d?IVIR$LfT>BU%2rNRS1V_@ zfWNMPaBZKll?<|XH+Vqv2%4-5dLvqtGSI+htcX~w!ntnG*eYTB1X%Sj&r2a_4Y3eL zf&pnXUR7cEBds`>WR#dN?GCPpV?46kEI#9j7thTldnenZQZNG2Ni;cOE0V2Nr}D!A zS|X$ezcU{?Sz7))L z=SED=n)%Tpv1ikb8(A_OYVHVNfsO>%?1cz?nb0c`ih)C+iQo;~qyzQh_hZlO;wdZ^RwV6zEu|1gA&VUV;R=jGrDo+Y>`1XPyguYcD zC;-Ta-n*bV0Ac6PkfFPeMUAy!mB#^{l>)sbmsS%ekRNQ`0PmmT%mGkcP@R_*AZ$!j z5GNft0#yuc6_9Rn@HKnw3dvsuf*jD7G6OEYO<$d=ZC`b@K21b4o*ykFdS2LnQ0Plb z6KH_MK_oWgursm!K6EB*Dk=3l)1*s2C$geBip?fFVD3J!n0aA4!r&uot@DStZwR2Pe;w{F1o9AdcYc) zuI%8q&H}46_+2;~Llk*3Q^i!u-iW4Zoe|s^1y`QDBn^fEY9xEIl_`xAIK~9nW88A^ zjgq*i>n!f*OJsybG4U;kE6JN0{J4VV?&UMbGunOpSQBI5_7Sm{v0SBp$dII_KMqv6 zNGno_fR@NkPYbefUM?)5izYh&nX4$15aTP`?IO@;#Y{<$bq@3kdIP+bK^g*xU17T& zo6`lrFXwa--`0?a<5;3uQOB4zf^3PKsj|uH@9E7GeqKkFt(9WB<9gmKpaBNgIj4)= zj=Pg`x07EDcOfFDwkm>uJsLu{tV;^hdtkbj3qaaC)yQ|)bvqqXA7owTYAHg--KZoO z(zn0Ebkku!cI0I2NcGSjm;q$B0u)=F-U_bjgq@I=Km7dU)yrp3;MWJjYP}OB^ck@> zro`W=h}`}XdoLt-)P!BuB1Q+^0?j&T`dO6>ku}|FYVD-K2)~4X?{>J~?URPw;(Ede zd<6L0Js%2;YZW~UyNcSF6e*v#DD(AHDnyBOh*G+lHAypX7rR|E&+)Of;$c`rMA^lR zog^6jB9wjYN3$_+^%?xFyH;NrYpq$?QxBT}R*I1%ZO9*?66{OYhwve>pM2=PL}xKc^llaTC} zdxLzblMY+nvgM6xv9n4EvI@(^u+>;RmkB!Hrw<*g$HzN|= zsz;KH*fTQY=NPY*G>-L3^2k$C&7z2-0ijx??1Jz(VHa_K&xg`0mWMNs43DQ;{bDN^ z%%Q<3f>^cc?Y)Z(Y76KJvol(-`)Q33$9ur z2G@J>Zs!bk8E|}eP;;Dai!7I7>kb!|?Iu^`Axb@sgn!ZJO?!u@h!cpQ4CdieeM}E2 zbl4-xH3_tTZ_=8CW|6bA*UwL%q_@~w@j4&^t}EUMR!ZN(jo;hnUiRdh(W<+xFOhUw ze}FKnsX2kMn$$M>Kr1^2XK@+qvUf>U@JDGu!C{k!j({VC{o(pKIkrv4L?XacEyHZ$d z>?VUeDOXQ7tXRFH>zAt<^VsQmh3#x&qOy6-`9fg?cxu-p_>j0BPN2mOdI>#)=2g6$6#XP%TkapB%Te5?$u1~5>YV>!y2M!|brs+qp6ah-nth zOK`b_d3NPds+r59)B+P2JGL%oT*3lW3YdAbnCeGiv*5@bTO#Mc-o^Rgr}^1HE(9aP z_p~>owb*$s=*{cw0zBZT4G332#?R3`TWimM#Os4rD%Xc-S&if&Ntvs}e9-nPD~~q9 zjim873i{IR5}jRdmD;bH@n51iF_o)t6f7BMBExa)D@<^(@3D=n)N3O42Ja|hQFaCN zTBX?k?INXupNdab$0Q+PEF+62#!(Llxz|^!dZ{YNc39dVn!rcvil5VFl#Gxqls7kj zqu5W{Eg#i$;lb#CjULz*=_m5zpGo#&$MVtG3g~{=-FACCSXSa6B|kCmkK;BV%*65W z-Hsz^K~3pOuznhk7lw_p*Aa`A?@JSu)lGXTDB9T5sEP?(!K1(_XVjemkVCK18dDaN zs>jFVVsTz&Hx59>cPU~EbU_J&XgZvKie5EN9d3DZoatN3)+hEZDuf%ubt{NhLE1`b3O!!zy>KVjcAu0zL%gFw)u6KIomA$9F^jMj2 z^`*_cTo`HrxiATfXFOrnhWpHdmJK87Xws)<2UZqm>&YL?lXK4<3wa-ZVCKK!#^`96 zv-MxT%bYBPck}K2*$I$CUOo;Rtk_*=ztHRge6O#wt9RmPiZFoNr_}g6{%(jM+2%eYVA^d0bQXMes2`>?u; zo`Hnv3CqBb5Z%c&ML!^#gh55~_<_-UX2T>C!Rco>#_BYb;Hfpw*Sj6iNO!P3q%dXj znLRYVJjj7>%()MLIC`a#POIJ+#;+p!1!AX2C6wP4IP)`=3_i5Lqgz|PCiL&1gE=C% zBXE-yu_t7*(v(nEYot3yW}f9lwLV!}R9eU}Dkeozet>h0-xbB4u;;+pXLW~yz|;^) z0rPO9KzDdhpW`-MN9>)s0hz-URF9J?UXWoMO9~ReE-7?>jTBoOl~YIiO93Ay{||rARy~fZo0m4LOBd51j4O-V#4b0p*}?i%SDCanVL2gE05>BqD{-T@ z8Pg$1F{8(SYV<5C&kOLVbJacwf0nmRP!3aAIY}2YiuaP)uCkVXo0>M0JXH-l>{cou zo@p)p^hUQ@S=^6Cb+za5S{l+Dq8vx%BBf>;!!lPH=J)pcuvCrlxZ_C8$KzqE?8x8T zsFL%10Su5L>$drTB-adt%38=RAYMG(^dJ7n7I6rF@TGNZ5PIV7GHoq)ujK+2tV5G4 z=uF{YOQu4EU=#8bGf>E?pL$oB@SfHzM;+&`SDY#Q7F7{F6H8_WJ1>}4Lk@{+~nY?)Sgb&0@pydhbfS%2RqJJg zPKph3#7;#D1})EC0Aj#wIAoc2x^iX-J)vH2aZ(Au!B#8kODQ5k+YgY{srwKtwG3!x`OO->zRd(Il znjXWGckU_2dG(F={LIixLzH`?pWNj8iErJuI!KK~fAbj9XDNfAg{ch+_f!MOh_8 zIYNoSXq%(!c-&x)604+zNG5cCw1|c9`vray_HBsU$WYpwS=?2Q#E?x!G3Z7j@vFq* zKzZFcf>NkIzhZ1pUhB;e-K5iha9dG86AiAk!-0Hd3+J{O)PEcrRIm-1Ar-%Z16u06 z%}Ry?IW;X*Rpn2^;DCZJ{AhuX=9`Q^X`&-kU`GE3^OmB3;>eKPyak424h{*5!Txou zQ|?Uag5@+ihP*p=2{gR-BmvVh1MsVR$dFQx$MpB8wrqRtc+7r@T0-@I3zWTP4{iLL zY@@(WnpVgIsG4q!30$~0Pb`Pvj z70lx7K{`rC4=V7p*@OKz8!so-3svWzfKcFc)#lXR-A#rv5e8}FKr`cos8Vi11S=6D zSjAZyMGW;2KCc#w6mlbfPH9?dAXH||U3+qe`1#YHsbZ^wSi;(JHp5R%ltFuP?b=aR z5&JW04kD0su1<%jLVa+06ekha%o|4SnX?DS;Es#*^J=J_hi!m|XukE)-?~9;5ME(! z{^BJmD${beW8V_?ebo3vIiNPQ*o`uC6gul|_{1I~;{-4nf?4f=p z@8g91E%NX%0^>(Q;cdSNH+t-Z&ixz;fDvHLnfND>O7@KYuJD({GEoYU$ew;bL9!bq zh{_MrA^tvfyjJY@9a~@vXyS-=Ab>PVnMX_X_eSDTh1eV)?}ac&8c_jZ_}#@ZHyv5wo{|%?md| zXRrMU@`#zOR?e42UNLyi9#iw!sdY7S3k5v}0ZI%j7)T<2!a=4Z23IK#Agja~4!vHM zuB6j7qRJ`}?4=zU67P0)Y%~V^C@er{_$S7XAUCzS?OIq&&A!sed@8CXyB!tTZu^+q zEfl)-SW;Qh7FehLx!ZLhn(W9xX~1Kkv5Q7Ur7Ez3NiPH<0D97k?@^z~OpYQwo|xr3 zhddW8s?DW;aD}TG>re1$K2@4Set>YGib;(dq!z_R9Oo(fDJo)-WQwQ7bjfLUp@SBA z%4b3*MqGuLk=iKWvpKhaE|NK4ba;#GdD@53z6%xUd(|bMBvefx6Srcg#S5T#)YjU= zi?s#Q=43w7&yUE+etJYk{B12mK|`o9Vy zqh`jwOXMT_3fxxWZ_tEr+NW5I&DeXFsWB2v0Uww4F%onEG?!~K5>Eu^`STB#zA_T& z0oRwPGZG*HR+q^$62udTT6q|1(ssAw?s+KkH6UeK`ZkxKG!mo%8ka>i5?DR`SAiVFj6W=<}hZ=EFAb$tIH9n5*#IK+88(Qcx-|Z@n%@r z_(^%<2cJNpPX>V2qAQU+Ms|+iH`m=`0U2IIf`txUuew1-9!b={#v$m-q^&j-q%|OsEAtc91@AsM7NiEJogZeO8%H6%7 z@t~h9y=y-bZeBJXV=SDGH;^z{crCkz7aAOtKt4&hY8ev&#J|R}xJ`7*l2U~XlvY{0 z-hMN4srQf4p4y+fV%&dt=Nqkdmg4i*MRrwj0d%(b_;GKSw`7KO0EHpN{+qJ65&8&b zyQG{`g!9d4a)5i*JexE`J%+5mgo#c5v;JUj_!P^TLJdJQ`;To>>!Y>^l`+&j1KgX2crO569Iovgo_EIJ|$3fL(3%O zsKWV^1f6)f_HDzF=m4PKhVNUreR8Y6D;W-J!pgk5WaT-So)YDLvxandY{nE$S7Pd@ zlKWT%Ol*0T)4FysauTf;-W(NCbVeK~UF)8J@M}*wrOE9j5O2!&nq1f-5CO1P>jNUF zYKs+S`%;c81qBEj_2XD9sr03n2{;mR0XLU?I1*rgeitFvw`F|V#%MCj%yFl)J%)l8 zqSo@irn!=Ghn<@($*fbX;zvdGL{q9{?wS%juTVk}Mj|*#N^_g5?odWK(Ak_7h_q@B zzDU!ul-fyIJ04hw>|QHtp0KX3iwwlJ@LxrYaFUTcK463aWD}p$U!yV>bam1^PHdQy zG*BIXBt6S54ZZ9hPRc&tFxjN+^Qa=Lm}~_DI!t0qHOheh!bLr!o-sUz<6uI`CMHXj z(zf(P0(}<2d}7zp77l^YGA$x|Eea=xZ%8BzS%XoS@+u%xQ2C@k1&k#6CjE_mUMD74j=+Bp(90aKR~Iuc(2>z8vn5;Xzum#I1u z9syOC$T|`*f9Da0andK2FY!02_KM2*fTl^^8Sgey>x`wQZ)a z(A91i>A#V1HWU)2zpD}~Rja5XmeonK5<9O0o0EDWe=6ZoJs#(=g`Tc#^fZto*-+^o zcPN;`UC-4>yi?MAM>P_mjquHQO15SV7hMF{(5~8og3c z6;BJSyoOLX=PPr#qI;GwT!|H7pGGCA0c&ky|CwbFd-nm@r�-wSrTgYpUivsDkkwsR2d>+qo4H8crojC_??w+iV;8~}}T?qWQ z<+_>$WLU@6j|>!|JbVmt94nJ;moBIRwGHTr1WDi*0I@f=ug_h_)n&HTz7X`_3L03^ ze=qC{(G$C!V>SS8Sj^C3qs;%V1Kp5?YquLhK9aAZ#>(P=CI-A}7&n@!YKnbA?c-(< zrGPyI|4qbifWe5)N$nNV=)b`mGn36vOcAlQCRmPS=`GX&`&zb5*xq6vuXI?Qs1nc1 zaoj(F%lK9rA5hy6oug0aB{Ez%B(_x$Dk9?5Vb?&YQ=N%U$gDB>%CaKR-EJ7E?lN6q z58;=csX-(Z5BaplWA+u7ojnrK184cqmvKH4!~r#zHa`+F0iTy?KN2W^e+{0)pup6m z$eyQ127CYIvpN}Unr2%kj~<;@lMDwNlFmQMADz>Z@(jNJVOz5IEqy4h3yktwRQ?Qx z1S$^>$$`3|AXHpd<--y_wP1hJ)kE31f0iRuIfXbb4{^V`;F;TftT$tg{PgHU%gMEb z-AO4=48}m^kHtBnk7*@;l4<>%@svM?!XKViZP}y{cO^rG*cL+aN}Kp49S+L?AB;t8 zD#&DijBbU8yd<3{qp~kNgE-+lrkrz`*Z@pZ#=eS*5GxsSg5OPx2qnWj<045Ie$Xj0 z!A7^5Z^|Jz_wxCL`O#Q;4t6cLXHvKV%NJ6JwU=9q-1(hhRf{@*oUHEsJBV3P8-0i7 zA_X(|`L3p>;4k1x5o`tQGs&sx)go@bRRb(Sp)6uTJLpP4+&T<#cM-@1hzzYKB%4=4 zbtDylh47lT0oIrYl1tOsWp=Zq-|#A1epYz_8ZaV75 zn*)jP)k^w18w+56%Atn^a!K06aYg{RG=kC}EF{J<%P&azA-c742Xg{RGcCJ%wihR2 zqPZ&c8W5bCBrtd7oyEZrVCplLcc=8hgzs`KQ$_0y?^Q(9GG5WG@Id}~FC_v%!XlZQ z%O4R#M65E^ciNq;f{Bc~M1EyzlFp6C4Vt%oPHMTp!rX&@hulHZ>+a02Lmx!M9Jc2( z=`y#)>54 zzC88v^4OUr?~>6H-atDt+Rx7Oah2lJomvAC;=;z}q(>FT+m5X7NtS9jrUEDR#-9g% zDlg%eM5z=ISVmIO^uS_etHfS$`*?p?M0@j0C-E}e@qe|T!ufNb1+Mgey*@yF06|yh z8DGhN>SZH&+ojq?$IatL`c~;h0C}zeMYPjN}Td}GVO046Y)X`y~`^T#W>V}snLr^eP zopoe)BumhWo%;fOVF&<@6<>kaMjMp7Q$NK|5f-UIFE32-a2x_QRdYh~L3{Tv1+0yke|OWgox zbK~5WK^;Z}+j9~?3B$${$gqvWg!3*tD~>~UFH9SXo?PMaDK$B)ViX78m$Fnu=Ce|K zT%-^ILN=b>x<HVu+Z1^7iFvbwTa&&UN#em*uu?@ZnlN?SG+tRXwT7K0SHzJ-xBY;%~PH?UMfU zFDPBrud^~cryRfODK1w3vAb$_CWyXt z*Hb-HByjT{H65zx-u3uX$i8~lvp>Ik5qMTyJ@726!H^wZ?tz;JYXWZR@2VwUacZ$| z^w;pb>~Bi<-hq1H-yZq;pDdO83AlT2k7V?&Ex)UlA{g>rTiz`WpEnyzzp#48xgO|} z7c^^HPHXdsx`H=DJ#Jrr4b=E8ZBBlC^{P4t=dF3lT!S)2wakiF)%h!WMGI5Ny*^qH zXZ?OxEd%efHh-t6x)^@sU0XV(-?e49ASe`|pcGYp@ej1R!S_=R*GEKL-(>X$O}FY| zRW)_Pv#tF7lvkzv^BIC#-w9NPy!N7KKfJC=)>Nw2Z?lG8XE*YH*Y}ie^$S7#m_OxT zCrwtaGQN76ZL=jS&|Ii*ahhGqA3wi)A^-Y?E;m(mp?+2TVqH|%_;W!33T}D_eg*pG zZFbH|P*8m>PR%9waFEp2Z+ALAX&Oib(|g~#Ax6l(VEuw7>Yoepj)DWcS8435woq}i zF^k1`;PLQc6_-taH7B&`oA#~})G6rH5nNmLWw$itS1hNss;WNl(oR`ZlQ@d_+J)Z{ zb}9eaJGc46ir~RY4!!H&e}P}CH$Mcd#g(?+6cI`r7Q4GEe&(yx$CW zt6%K*(}FgGjHQ`OESLdRhXhU+RgU1GNyXVY1BOW%YXFvi63!BX-pevFdh}jW)#jX{ z`8_M@WF$dzBM76D5SC0sSm^a2D&-&M`Gup5f3=T z_vlDa1{j8aF+2O16s){RvPwiHXOrJ2(Dwy}3~Ox^Lli;Q7R?Jpd8MP@e*5jWhp%5h zeD-XxNiHvwx*j|kk&#ZuV1SDX Date: Tue, 14 Jan 2025 02:13:23 -0800 Subject: [PATCH 41/91] [CAPPL-400] Fix/truncate workflow names #2 (#15896) * fix(workflows/syncer): truncate workflow name * chore: changeset patch * (refactor): Move truncated hashed workflow name into engine. Ensure UTF8 encoding by hex encoding * (refactor): injectable name transform * Bump common to commit 42c3764c171e870bfd91443c6ae82a6e76bc6f1f * Use HashTruncateName in workflow registry syncer handler * Remove comment line * go mod tidy * Changes from review --------- Co-authored-by: Michael Street <5597260+MStreet3@users.noreply.github.com> --- .changeset/wild-planes-mix.md | 5 +++ core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +-- core/services/workflows/engine.go | 37 +++++++++++++---------- core/services/workflows/syncer/handler.go | 24 +++++++++------ deployment/go.mod | 2 +- deployment/go.sum | 4 +-- go.mod | 2 +- go.sum | 4 +-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +-- 13 files changed, 55 insertions(+), 41 deletions(-) create mode 100644 .changeset/wild-planes-mix.md diff --git a/.changeset/wild-planes-mix.md b/.changeset/wild-planes-mix.md new file mode 100644 index 00000000000..1a08c2f9d4d --- /dev/null +++ b/.changeset/wild-planes-mix.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Truncates workflow name before starting engine diff --git a/core/scripts/go.mod b/core/scripts/go.mod index ed17147d67e..b0dd9a49b65 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 5af14a2eaa9..1663d9488fc 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1164,8 +1164,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index 0b35bf4b06f..f6e73bb8bc5 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -1191,22 +1191,23 @@ func (e *Engine) Name() string { } type Config struct { - Workflow sdk.WorkflowSpec - WorkflowID string - WorkflowOwner string - WorkflowName string - Lggr logger.Logger - Registry core.CapabilitiesRegistry - MaxWorkerLimit int - QueueSize int - NewWorkerTimeout time.Duration - MaxExecutionDuration time.Duration - Store store.Store - Config []byte - Binary []byte - SecretsFetcher secretsFetcher - HeartbeatCadence time.Duration - StepTimeout time.Duration + Workflow sdk.WorkflowSpec + WorkflowID string + WorkflowOwner string + WorkflowName string // Full human-readable workflow name. Intended for metrics and logging. + WorkflowNameTransform string // The Workflow Name in an on-chain format, which has requirements of being hex encoded and max 10 bytes + Lggr logger.Logger + Registry core.CapabilitiesRegistry + MaxWorkerLimit int + QueueSize int + NewWorkerTimeout time.Duration + MaxExecutionDuration time.Duration + Store store.Store + Config []byte + Binary []byte + SecretsFetcher secretsFetcher + HeartbeatCadence time.Duration + StepTimeout time.Duration // For testing purposes only maxRetries int @@ -1300,6 +1301,10 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { workflow.hexName = hex.EncodeToString([]byte(cfg.WorkflowName)) workflow.name = cfg.WorkflowName + if len(cfg.WorkflowNameTransform) > 0 { + workflow.hexName = cfg.WorkflowNameTransform + } + engine = &Engine{ cma: cma, logger: cfg.Lggr.Named("WorkflowEngine").With("workflowID", cfg.WorkflowID), diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index bae311c846b..6d0ee7073e9 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -533,16 +533,20 @@ func (h *eventHandler) engineFactoryFn(ctx context.Context, id string, owner str } cfg := workflows.Config{ - Lggr: h.lggr, - Workflow: *sdkSpec, - WorkflowID: id, - WorkflowOwner: owner, // this gets hex encoded in the engine. - WorkflowName: name, - Registry: h.capRegistry, - Store: h.workflowStore, - Config: config, - Binary: binary, - SecretsFetcher: h, + Lggr: h.lggr, + Workflow: *sdkSpec, + WorkflowID: id, + WorkflowOwner: owner, // this gets hex encoded in the engine. + WorkflowName: name, + // Internal workflow names must not exceed 10 bytes for workflow engine and on-chain use. + // A name is used internally that is first hashed to avoid collisions, + // hex encoded to ensure UTF8 encoding, then truncated to 10 bytes. + WorkflowNameTransform: pkgworkflows.HashTruncateName(name), + Registry: h.capRegistry, + Store: h.workflowStore, + Config: config, + Binary: binary, + SecretsFetcher: h, } return workflows.NewEngine(ctx, cfg) } diff --git a/deployment/go.mod b/deployment/go.mod index 111539fc2b5..9f29826759a 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -31,7 +31,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 diff --git a/deployment/go.sum b/deployment/go.sum index fbb668cfe93..fbc06ec3c83 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1390,8 +1390,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/go.mod b/go.mod index 49dee03521f..78f407a76d1 100644 --- a/go.mod +++ b/go.mod @@ -80,7 +80,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index 47caf1ff41c..b60e28a68de 100644 --- a/go.sum +++ b/go.sum @@ -1154,8 +1154,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 88eeb3e7fe6..228a5a41f3e 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -47,7 +47,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index d50ef55c53c..2f24d5e4024 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1414,8 +1414,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index f6da8952689..73a3a4f05da 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -27,7 +27,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 4f490d077e3..c9bf8730f28 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1403,8 +1403,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e h1:8BStiP1F4W8AvjBRga0TYtjvAtkwN8oHYnHJztAlSF4= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108194320-2ebd63bbb16e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= From 6505cb206dfd077bf5369f9892ab5937badba6ca Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Tue, 14 Jan 2025 11:51:37 +0100 Subject: [PATCH 42/91] CCIP-4420 Merging integration tests and scripts (#15902) * Merging integration tests and scripts * Fixing build, adding missing e2e tests * Fixing linter * Bump * Bump * Update integration-tests/ccip-tests/testconfig/README.md Co-authored-by: Balamurali Gopalswami <167726375+b-gopalswami@users.noreply.github.com> --------- Co-authored-by: Balamurali Gopalswami <167726375+b-gopalswami@users.noreply.github.com> --- .github/e2e-tests.yml | 28 + core/scripts/ccip/.example.env | 9 + core/scripts/ccip/ccip-revert-reason/main.go | 71 + .../ccip/ccip-revert-reason/main_test.go | 20 + core/scripts/ccip/debugreceiver/main.go | 120 ++ .../manual-execution/batch_runner/README.md | 22 + .../manual-execution/batch_runner/batchrun.py | 55 + .../scripts/ccip/manual-execution/config.json | 12 + core/scripts/ccip/manual-execution/go.mod | 33 + core/scripts/ccip/manual-execution/go.sum | 107 ++ .../helpers/contractmodels.go | 85 ++ .../helpers/contractwrappers.go | 189 +++ .../manual-execution/helpers/execReport.go | 325 +++++ .../ccip/manual-execution/helpers/utils.go | 47 + core/scripts/ccip/manual-execution/main.go | 451 ++++++ core/scripts/ccip/revert-reason/Makefile | 3 + core/scripts/ccip/revert-reason/README.md | 41 + .../revert-reason/command/revert_reason.go | 42 + .../ccip/revert-reason/command/root.go | 35 + .../ccip/revert-reason/config/config.go | 42 + .../ccip/revert-reason/handler/handler.go | 17 + .../ccip/revert-reason/handler/reason.go | 208 +++ .../ccip/revert-reason/handler/reason_test.go | 68 + core/scripts/ccip/revert-reason/main.go | 9 + core/scripts/ccip/secrets/secrets.go | 16 + core/scripts/ccip/shared/helpers.go | 52 + core/scripts/go.mod | 2 +- .../ccip-load-test-view/component.go | 1 + .../environment/nodeclient/chainlink.go | 5 + integration-tests/.gitignore | 4 + integration-tests/actions/actions.go | 64 + integration-tests/ccip-tests/Makefile | 13 +- integration-tests/ccip-tests/README.md | 11 + .../ccip-tests/actions/ccip_helpers.go | 190 ++- .../ccip-tests/contracts/contract_deployer.go | 118 +- .../ccip-tests/contracts/contract_models.go | 3 + .../ccip-tests/load/ccip_loadgen.go | 21 +- .../ccip-tests/load/ccip_multicall_loadgen.go | 2 +- integration-tests/ccip-tests/load/helper.go | 11 +- .../ccip-tests/smoke/ccip_test.go | 143 +- .../ccip-tests/testconfig/README.md | 29 +- .../ccip-tests/testconfig/ccip.go | 99 +- .../testconfig/override/mainnet.toml | 991 +++++++------- ...net_1.5_B4_native_dataonly_testrouter.toml | 1214 +++++++++++++++++ .../testnet-beta-workinglane.toml | 173 +-- .../testnet-beta-workinglane_native.toml | 191 +-- .../testconfig/tomls/ccip-default.toml | 9 +- .../tomls/ccip1.4-stress/baseline.toml | 35 +- ...btc_mock_deployment_with_32bytes_data.toml | 11 + ..._mock_deployment_with_non32bytes_data.toml | 11 + .../tomls/prod-testnet/load-prod-testnet.toml | 909 ++---------- .../smoke-release-testing_native.toml | 566 ++++---- ...release-testing_token_transfer_native.toml | 490 ++++--- ...g_token_transfer_with_native_feetoken.toml | 540 ++++---- .../ccip-tests/testsetups/ccip.go | 13 +- .../ccip-tests/testsetups/test_env.go | 2 + .../docker/test_env/cl_node_cluster.go | 4 +- integration-tests/docker/test_env/test_env.go | 3 +- integration-tests/testconfig/default.toml | 1 + integration-tests/testconfig/testconfig.go | 11 + .../types/config/node/defaults/ccip.toml | 23 + integration-tests/types/testconfigs.go | 1 - 62 files changed, 5536 insertions(+), 2485 deletions(-) create mode 100644 core/scripts/ccip/.example.env create mode 100644 core/scripts/ccip/ccip-revert-reason/main.go create mode 100644 core/scripts/ccip/ccip-revert-reason/main_test.go create mode 100644 core/scripts/ccip/debugreceiver/main.go create mode 100644 core/scripts/ccip/manual-execution/batch_runner/README.md create mode 100755 core/scripts/ccip/manual-execution/batch_runner/batchrun.py create mode 100644 core/scripts/ccip/manual-execution/config.json create mode 100644 core/scripts/ccip/manual-execution/go.mod create mode 100644 core/scripts/ccip/manual-execution/go.sum create mode 100644 core/scripts/ccip/manual-execution/helpers/contractmodels.go create mode 100644 core/scripts/ccip/manual-execution/helpers/contractwrappers.go create mode 100644 core/scripts/ccip/manual-execution/helpers/execReport.go create mode 100644 core/scripts/ccip/manual-execution/helpers/utils.go create mode 100644 core/scripts/ccip/manual-execution/main.go create mode 100644 core/scripts/ccip/revert-reason/Makefile create mode 100644 core/scripts/ccip/revert-reason/README.md create mode 100644 core/scripts/ccip/revert-reason/command/revert_reason.go create mode 100644 core/scripts/ccip/revert-reason/command/root.go create mode 100644 core/scripts/ccip/revert-reason/config/config.go create mode 100644 core/scripts/ccip/revert-reason/handler/handler.go create mode 100644 core/scripts/ccip/revert-reason/handler/reason.go create mode 100644 core/scripts/ccip/revert-reason/handler/reason_test.go create mode 100644 core/scripts/ccip/revert-reason/main.go create mode 100644 core/scripts/ccip/secrets/secrets.go create mode 100644 core/scripts/ccip/shared/helpers.go create mode 100644 integration-tests/.gitignore create mode 100644 integration-tests/ccip-tests/testconfig/override/mainnet_1.5_B4_native_dataonly_testrouter.toml create mode 100644 integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_32bytes_data.toml create mode 100644 integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_non32bytes_data.toml create mode 100644 integration-tests/types/config/node/defaults/ccip.toml diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index 142c7733533..e5c8b8505f3 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -1124,6 +1124,34 @@ runner-test-matrix: CHAINLINK_USER_TEAM: CCIP test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml + - id: ccip-smoke-lbtc-32bytes-destination-pool-data + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + CHAINLINK_USER_TEAM: CCIP + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_32bytes_data.toml + + - id: ccip-smoke-lbtc-non32bytes-destination-pool-data + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + CHAINLINK_USER_TEAM: CCIP + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_non32bytes_data.toml + - id: ccip-smoke-db-compatibility path: integration-tests/ccip-tests/smoke/ccip_test.go test_env_type: docker diff --git a/core/scripts/ccip/.example.env b/core/scripts/ccip/.example.env new file mode 100644 index 00000000000..72918dcc3e6 --- /dev/null +++ b/core/scripts/ccip/.example.env @@ -0,0 +1,9 @@ +## DO NOT EDIT THIS FILE. PLEASE COPY TO .env AND EDIT THAT FILE INSTEAD +OWNER_KEY=DEF + +RPC_5=wss://rpc.com +RPC_43113=wss://rpc.com +RPC_420=wss://rpc.com +RPC_11155111=wss://rpc.com +RPC_421613=wss://rpc.com +RPC_80001=wss://rpc.com \ No newline at end of file diff --git a/core/scripts/ccip/ccip-revert-reason/main.go b/core/scripts/ccip/ccip-revert-reason/main.go new file mode 100644 index 00000000000..e357086306e --- /dev/null +++ b/core/scripts/ccip/ccip-revert-reason/main.go @@ -0,0 +1,71 @@ +package main + +import ( + "flag" + "fmt" + + "github.com/ethereum/go-ethereum/ethclient" + + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/handler" + "github.com/smartcontractkit/chainlink/core/scripts/ccip/secrets" +) + +var ( + errorCodeString = flag.String("errorCode", "", "Error code string (e.g. 0x08c379a0)") + + chainID = flag.Uint64("chainId", 0, "Chain ID for the transaction (e.g. 420)") + txHash = flag.String("txHash", "", "Transaction hash (e.g. 0x97be8559164442595aba46b5f849c23257905b78e72ee43d9b998b28eee78b84)") + txRequester = flag.String("txRequester", "", "Transaction requester address (e.g. 0xe88ff73814fb891bb0e149f5578796fa41f20242)") + rpcURL = flag.String("rpcURL", "", "RPC URL for the chain (can also be set in env var RPC_)") +) + +func main() { + flag.Usage = func() { + fmt.Println("Usage: go run . [flags]") + fmt.Println("You must provide either an error code string or the transaction details and an RPC URL to decode the error") + flag.PrintDefaults() + } + + flag.Parse() + + if *errorCodeString == "" && (*chainID == 0 || *txHash == "" || *txRequester == "") { + flag.Usage() + return + } + + errorString, err := getErrorString() + if err != nil { + fmt.Printf("Error getting error string: %v\n", err) + return + } + decodedError, err := handler.DecodeErrorStringFromABI(errorString) + if err != nil { + fmt.Printf("Error decoding error string: %v\n", err) + return + } + + fmt.Println(decodedError) +} + +func getErrorString() (string, error) { + if *errorCodeString != "" { + return *errorCodeString, nil + } + + if *rpcURL == "" { + fmt.Printf("RPC URL not provided, looking for RPC_%d env var\n", *chainID) + envRPC := secrets.GetRPC(*chainID) + rpcURL = &envRPC + } + + ec, err := ethclient.Dial(*rpcURL) + if err != nil { + return "", err + } + errString, err := handler.GetErrorForTx(ec, *txHash, *txRequester) + if err != nil { + return "", err + } + + return errString, nil +} diff --git a/core/scripts/ccip/ccip-revert-reason/main_test.go b/core/scripts/ccip/ccip-revert-reason/main_test.go new file mode 100644 index 00000000000..a73a1f7a3ba --- /dev/null +++ b/core/scripts/ccip/ccip-revert-reason/main_test.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "testing" + + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/handler" +) + +func TestRevertReason(t *testing.T) { + errorCodeString := "e1cd55090000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008408c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002645524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + + decodedError, err := handler.DecodeErrorStringFromABI(errorCodeString) + if err != nil { + fmt.Printf("Error decoding error string: %v\n", err) + return + } + + fmt.Println(decodedError) +} diff --git a/core/scripts/ccip/debugreceiver/main.go b/core/scripts/ccip/debugreceiver/main.go new file mode 100644 index 00000000000..db742ed126a --- /dev/null +++ b/core/scripts/ccip/debugreceiver/main.go @@ -0,0 +1,120 @@ +package main + +import ( + "bytes" + "context" + "fmt" + "math/big" + "strings" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/ethclient" +) + +type ccipAny struct { + SourceChainID *big.Int + Sender []byte + Data []byte + Tokens []common.Address + Amounts []*big.Int +} + +func panicErr(err error) { + if err != nil { + panic(err) + } +} + +// ABIEncode is the equivalent of abi.encode. +// See a full set of examples https://github.com/ethereum/go-ethereum/blob/420b78659bef661a83c5c442121b13f13288c09f/accounts/abi/packing_test.go#L31 +func ABIEncode(abiStr string, values ...interface{}) ([]byte, error) { + // Create a dummy method with arguments + inDef := fmt.Sprintf(`[{ "name" : "method", "type": "function", "inputs": %s}]`, abiStr) + inAbi, err := abi.JSON(strings.NewReader(inDef)) + if err != nil { + return nil, err + } + res, err := inAbi.Pack("method", values...) + if err != nil { + return nil, err + } + return res[4:], nil +} + +// ABIDecode is the equivalent of abi.decode. +// See a full set of examples https://github.com/ethereum/go-ethereum/blob/420b78659bef661a83c5c442121b13f13288c09f/accounts/abi/packing_test.go#L31 +func ABIDecode(abiStr string, data []byte) ([]interface{}, error) { + inDef := fmt.Sprintf(`[{ "name" : "method", "type": "function", "outputs": %s}]`, abiStr) + inAbi, err := abi.JSON(strings.NewReader(inDef)) + if err != nil { + return nil, err + } + return inAbi.Unpack("method", data) +} + +func main() { + // User inputs + source, err := ethclient.Dial("TODO goerli URL") + panicErr(err) + dest, err := ethclient.Dial("TODO optimism URL") + panicErr(err) + var ( + requestBlock = int64(7916078) + receiveBlock = int64(2518035) + ccipReceiver = common.HexToAddress("0x9fE056F44510F970d724adA16903ba5D75CC4742") + ) + + log, err := source.FilterLogs(context.Background(), ethereum.FilterQuery{ + FromBlock: big.NewInt(requestBlock), + ToBlock: big.NewInt(requestBlock), + Topics: [][]common.Hash{{common.HexToHash("0x73dfb9df8214728e699dbaaf6ba97aa125afaaba83a5d0de7903062e7c5b3139")}}, // CCIPSendRequested + }) + panicErr(err) + encodedMsg, err := ABIDecode(`[{"components":[ +{"internalType":"uint256","name":"sourceChainId","type":"uint256"}, +{"internalType":"uint64","name":"sequenceNumber","type":"uint64"}, +{"internalType":"address","name":"sender","type":"address"}, +{"internalType":"address","name":"receiver","type":"address"}, +{"internalType":"uint64","name":"nonce","type":"uint64"}, +{"internalType":"bytes","name":"data","type":"bytes"}, +{"internalType":"address[]","name":"tokens","type":"address[]"}, +{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}, +{"internalType":"uint256","name":"gasLimit","type":"uint256"}], +"internalType":"structCCIP.EVM2EVMSubscriptionMessage","name":"message","type":"tuple"}]`, + log[0].Data) + panicErr(err) + send := encodedMsg[0].(struct { + SourceChainID *big.Int `json:"sourceChainId"` + SequenceNumber uint64 `json:"sequenceNumber"` + Sender common.Address `json:"sender"` + Receiver common.Address `json:"receiver"` + Nonce uint64 `json:"nonce"` + Data []uint8 `json:"data"` + Tokens []common.Address `json:"tokens"` + Amounts []*big.Int `json:"amounts"` + GasLimit *big.Int `json:"gasLimit"` + }) + sender, err := ABIEncode(`[{"type":"bytes", "name":"sender"}]`, send.Sender.Bytes()) + panicErr(err) + any2evm, err := ABIEncode(`[{"components":[ +{"internalType":"uint256","name":"sourceChainId","type":"uint256"}, +{"internalType":"bytes","name":"sender","type":"bytes"}, +{"internalType":"bytes","name":"data","type":"bytes"}, +{"internalType":"address[]","name":"tokens","type":"address[]"}, +{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}], +"internalType":"structCCIP.Any2EVMMessage","name":"message","type":"tuple"}]`, + ccipAny{send.SourceChainID, sender, send.Data, send.Tokens, send.Amounts}) + panicErr(err) + a, err := dest.CallContract(context.Background(), ethereum.CallMsg{ + From: common.HexToAddress("0x2b7ab40413da5077e168546ea376920591aee8e7"), // offramp router + To: &ccipReceiver, + Gas: send.GasLimit.Uint64(), + GasPrice: big.NewInt(0), + Data: bytes.Join([][]byte{hexutil.MustDecode("0xa0c6df15"), any2evm}, []byte{}), // ccipReceive selector + AccessList: nil, + }, big.NewInt(receiveBlock)) + fmt.Println(a, err) +} diff --git a/core/scripts/ccip/manual-execution/batch_runner/README.md b/core/scripts/ccip/manual-execution/batch_runner/README.md new file mode 100644 index 00000000000..9a46519b34a --- /dev/null +++ b/core/scripts/ccip/manual-execution/batch_runner/README.md @@ -0,0 +1,22 @@ +# batchrun.py + +This script will run the manual-execution script repeatedly using a CSV file to +supply message IDs and txn hashes. + +## Usage + +Build main.go and copy 'manual-execution' into the same directory as this script. + +Export messages to a file named 'msgs.csv' in the same directory as this script. +CSV file will ignore the first line (header) and each line should have two values separated by a comma. + +The first value is the message ID and the second value is the CCIP send transaction hash. + +Example csv file: +``` +"message_id","transaction_hash" +0x1e221l7db3f193d19353d42e1bcece771e7edar57149a7f30afd31r8aa783e9a,0x03c88qfd30ar54f36a353262a67362838r52029a47h2a31141a0430bda937ba2 +0x1e221l7db3f193d19353d42e1bcece771e7edar57149a7f30afd31r8aa783e9a,0x03c88qfd30ar54f36a353262a67362838r52029a47h2a31141a0430bda937ba2 +0x1e221l7db3f193d19353d42e1bcece771e7edar57149a7f30afd31r8aa783e9a,0x03c88qfd30ar54f36a353262a67362838r52029a47h2a31141a0430bda937ba2 +0x1e221l7db3f193d19353d42e1bcece771e7edar57149a7f30afd31r8aa783e9a,0x03c88qfd30ar54f36a353262a67362838r52029a47h2a31141a0430bda937ba2 +``` diff --git a/core/scripts/ccip/manual-execution/batch_runner/batchrun.py b/core/scripts/ccip/manual-execution/batch_runner/batchrun.py new file mode 100755 index 00000000000..a731914772a --- /dev/null +++ b/core/scripts/ccip/manual-execution/batch_runner/batchrun.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +import subprocess +import os +import tempfile +import json + +binary_name = "./manual-execution" +input_msgs = "msgs.csv" + +# global config +src_rpc = "" +dest_rpc = "" +dest_owner_key = "" +commit_store = "" +off_ramp = "" +on_ramp = "" +dest_start_block = 11063581 # set to block where the messages commit report was written. +gas_limit_override = 2000000 # you can change this or leave it as is. + +lines = open(input_msgs, "r").read().split("\n")[1:] + +for i, pairs in enumerate(lines): + # per msg config + parts = pairs.split(",") + if len(parts) != 2: + if pairs != "": + print("skipping CSV line with unexpected format: %s" % pairs) + continue + + msg_id = parts[0] + ccip_send_tx = parts[1] + + print("[%d/%d] >>> %s %s" % (i, len(lines), ccip_send_tx, msg_id)) + + config = { + "source_chain_tx": ccip_send_tx, + "ccip_msg_id": msg_id, + "src_rpc": src_rpc, + "dest_rpc": dest_rpc, + "dest_owner_key": dest_owner_key, + "commit_store": commit_store, + "off_ramp": off_ramp, + "dest_start_block": dest_start_block, + "gas_limit_override": gas_limit_override + } + json_config = json.dumps(config) + + with open("config.json", 'w') as f: + f.write(json_config) + + try: + subprocess.run([binary_name]) + except subprocess.CalledProcessError as e: + print("called process error: ", e) diff --git a/core/scripts/ccip/manual-execution/config.json b/core/scripts/ccip/manual-execution/config.json new file mode 100644 index 00000000000..8c8832c8487 --- /dev/null +++ b/core/scripts/ccip/manual-execution/config.json @@ -0,0 +1,12 @@ +{ + "src_rpc": "", + "dest_rpc": "", + "dest_owner_key": "", + "commit_store": "0xd2Aa03c8C6E6a8E227223E72f314d4398ABe6eD0", + "off_ramp": "0x60475789dF0d8739cda56aF1D914749A5b48B3f7", + "on_ramp": "0xBb0e1066888F9Ef72824f63fd2067ff469378f6F", + "dest_start_block": 0, + "source_chain_tx": "0x517f6d4742568d531bc9b980bc7f82460a5012fce5dd7c57ec703444f88f5d92", + "ccip_msg_id": "0xba2312c236dd9f83ccd22ff6636fca5af739abb0cdc9824b8f59ec9824a5daf1", + "dest_deployed_at": 3043616 +} \ No newline at end of file diff --git a/core/scripts/ccip/manual-execution/go.mod b/core/scripts/ccip/manual-execution/go.mod new file mode 100644 index 00000000000..91e028c9314 --- /dev/null +++ b/core/scripts/ccip/manual-execution/go.mod @@ -0,0 +1,33 @@ +module manual-execution + +go 1.20 + +require ( + github.com/ethereum/go-ethereum v1.11.3 + github.com/pkg/errors v0.9.1 + github.com/smartcontractkit/chain-selectors v1.0.35 + go.uber.org/multierr v1.1.0 + golang.org/x/crypto v0.1.0 +) + +require ( + github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-ole/go-ole v1.2.1 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/mr-tron/base58 v1.2.0 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/tklauser/go-sysconf v0.3.5 // indirect + github.com/tklauser/numcpus v0.2.2 // indirect + go.uber.org/atomic v1.3.2 // indirect + golang.org/x/sys v0.5.0 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +exclude github.com/sourcegraph/sourcegraph/lib v0.0.0-20221216004406-749998a2ac74 diff --git a/core/scripts/ccip/manual-execution/go.sum b/core/scripts/ccip/manual-execution/go.sum new file mode 100644 index 00000000000..3d4ea701977 --- /dev/null +++ b/core/scripts/ccip/manual-execution/go.sum @@ -0,0 +1,107 @@ +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= +github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= +github.com/ethereum/go-ethereum v1.11.3 h1:uuBkYUJW9aY5JYi3+sqLHz+XWyo5fmn/ab9XcbtVDTU= +github.com/ethereum/go-ethereum v1.11.3/go.mod h1:rBUvAl5cdVrAei9q5lgOU7RSEuPJk1nlBDnS/YSoKQE= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= +github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= +github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/smartcontractkit/chain-selectors v1.0.35 h1:k7iJqChFbH10WFpahjDtDJoYyDz4qRNq6ReIB41M8Tg= +github.com/smartcontractkit/chain-selectors v1.0.35/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= +github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= +github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= +github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/core/scripts/ccip/manual-execution/helpers/contractmodels.go b/core/scripts/ccip/manual-execution/helpers/contractmodels.go new file mode 100644 index 00000000000..000b32dd39a --- /dev/null +++ b/core/scripts/ccip/manual-execution/helpers/contractmodels.go @@ -0,0 +1,85 @@ +package helpers + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" +) + +type CommitStoreReportAccepted struct { + Report ICommitStoreCommitReport + Raw types.Log +} + +type ICommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval ICommitStoreInterval + MerkleRoot [32]byte +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type ICommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + Sender common.Address + Receiver common.Address + SequenceNumber uint64 + GasLimit *big.Int + Strict bool + Nonce uint64 + FeeToken common.Address + FeeTokenAmount *big.Int + Data []byte + TokenAmounts []ClientEVMTokenAmount + SourceTokenData [][]byte + MessageId [32]byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type SendRequestedEvent struct { + Message InternalEVM2EVMMessage + Raw types.Log +} + +type InternalExecutionReport struct { + Messages []InternalEVM2EVMMessage + OffchainTokenData [][][]byte + Proofs [][32]byte + ProofFlagBits *big.Int +} + +type EVM2EVMOffRampExecutionStateChanged struct { + SequenceNumber uint64 + MessageId [32]byte + State uint8 + ReturnData []byte + Raw types.Log +} + +type EVM2EVMOffRampGasLimitOverride struct { + ReceiverExecutionGasLimit *big.Int + TokenGasOverrides []*big.Int +} diff --git a/core/scripts/ccip/manual-execution/helpers/contractwrappers.go b/core/scripts/ccip/manual-execution/helpers/contractwrappers.go new file mode 100644 index 00000000000..027577b9126 --- /dev/null +++ b/core/scripts/ccip/manual-execution/helpers/contractwrappers.go @@ -0,0 +1,189 @@ +package helpers + +import ( + "fmt" + "strings" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/event" +) + +const ( + OffRampABI = "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"internalType\":\"contractIERC20[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"},{\"internalType\":\"contractIPool[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitStoreAlreadyInUse\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMessageId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidSourceChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedIncorrectNonce\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedSenderWithPreviousRampMessageInflight\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getDestinationToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDestinationTokens\",\"outputs\":[{\"internalType\":\"contractIERC20[]\",\"name\":\"destTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"destToken\",\"type\":\"address\"}],\"name\":\"getPoolByDestToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"contractIERC20[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReport\",\"name\":\"report\",\"type\":\"tuple\"},{\"internalType\":\"uint256[]\",\"name\":\"gasLimitOverrides\",\"type\":\"uint256[]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" + CommitStoreABI = "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" + OnRampABI = "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"tokensAndPools\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotSendZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"}],\"name\":\"InvalidNopAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWithdrawParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkBalanceNotSettled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxFeeBalanceReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageGasLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeCalledByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoFeesToPay\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoNopsToPay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"NotAFeeToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdminOrNop\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustSetOriginalSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SourceTokenDataTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyNops\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPSendRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeConfig\",\"type\":\"tuple[]\"}],\"name\":\"FeeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NopPaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nopWeightsTotal\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"NopsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"transferFeeConfig\",\"type\":\"tuple[]\"}],\"name\":\"TokenTransferFeeConfigSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"}],\"name\":\"forwardFromRouter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFeeTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfig\",\"name\":\"feeTokenConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNopFeesJuels\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNops\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"weightsTotal\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenTransferFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"payNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setFeeTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setTokenTransferFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawNonLinkFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" +) + +func DecodeEvents( + ethC *ethclient.Client, + opts *bind.FilterOpts, + address, contractABI, eventName string, + query ...[]interface{}, +) (*bind.BoundContract, chan types.Log, event.Subscription, error) { + contractAddress := common.HexToAddress(address) + abi, err := abi.JSON(strings.NewReader(contractABI)) + if err != nil { + return nil, nil, nil, err + } + boundContract := bind.NewBoundContract(contractAddress, abi, ethC, ethC, ethC) + logs, subs, err := boundContract.FilterLogs(opts, eventName, query...) + if err != nil { + return nil, nil, nil, err + } + return boundContract, logs, subs, err +} + +type logIterator struct { + Raw types.Log + Contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *logIterator) Next() bool { + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *logIterator) Error() error { + return it.fail +} + +func (it *logIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +func FilterCCIPSendRequested(chain *ethclient.Client, opts *bind.FilterOpts, onRampAddr string) (*logIterator, error) { + onRampContract, logs, sub, err := DecodeEvents(chain, opts, onRampAddr, OnRampABI, "CCIPSendRequested") + if err != nil { + return nil, err + } + return &logIterator{ + Contract: onRampContract, + event: "CCIPSendRequested", + logs: logs, + sub: sub, + }, nil +} + +func (it *logIterator) SendRequestedEventFromLog() (*SendRequestedEvent, error) { + event := new(SendRequestedEvent) + err := it.Contract.UnpackLog(event, "CCIPSendRequested", it.Raw) + if err != nil { + return nil, err + } + return event, nil +} + +func (it *logIterator) CommitStoreReportAcceptedFromLog() (*CommitStoreReportAccepted, error) { + event := new(CommitStoreReportAccepted) + err := it.Contract.UnpackLog(event, "ReportAccepted", it.Raw) + if err != nil { + return nil, err + } + return event, nil +} + +func FilterReportAccepted(chain *ethclient.Client, opts *bind.FilterOpts, commitStoreAddr string) (*logIterator, error) { + commitStoreContract, logs, sub, err := DecodeEvents(chain, opts, commitStoreAddr, CommitStoreABI, "ReportAccepted") + if err != nil { + return nil, err + } + return &logIterator{ + Contract: commitStoreContract, + event: "ReportAccepted", + logs: logs, + sub: sub, + }, nil +} + +func FilterExecutionStateChanged( + chain *ethclient.Client, + opts *bind.FilterOpts, + offRampAddr string, + sequenceNumber []uint64, + messageId [][32]byte, +) (int, error) { + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + offRamp, logs, sub, err := DecodeEvents(chain, opts, offRampAddr, OffRampABI, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return 0, err + } + it := &logIterator{ + Contract: offRamp, + event: "ExecutionStateChanged", + logs: logs, + sub: sub, + } + + executionState := -1 + for it.Next() && executionState != 2 { + execStateEvent := new(EVM2EVMOffRampExecutionStateChanged) + err = it.Contract.UnpackLog(execStateEvent, "ExecutionStateChanged", it.Raw) + if err != nil { + return 0, err + } + executionState = int(execStateEvent.State) + } + + if executionState == -1 { + return 0, fmt.Errorf("no ExecutionStateChanged found for seq num %v and msg id %v", sequenceNumber, messageId) + } + return executionState, nil +} + +func ManuallyExecute( + ethC *ethclient.Client, + opts *bind.TransactOpts, + address string, + report InternalExecutionReport, + gasLimitOverrides []*EVM2EVMOffRampGasLimitOverride, +) (*types.Transaction, error) { + offRampContract := common.HexToAddress(address) + abi, err := abi.JSON(strings.NewReader(OffRampABI)) + if err != nil { + return nil, err + } + boundContract := bind.NewBoundContract(offRampContract, abi, ethC, ethC, ethC) + return boundContract.Transact(opts, "manuallyExecute", report, gasLimitOverrides) +} diff --git a/core/scripts/ccip/manual-execution/helpers/execReport.go b/core/scripts/ccip/manual-execution/helpers/execReport.go new file mode 100644 index 00000000000..efb593d2b44 --- /dev/null +++ b/core/scripts/ccip/manual-execution/helpers/execReport.go @@ -0,0 +1,325 @@ +package helpers + +import ( + "bytes" + "fmt" + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" + "golang.org/x/crypto/sha3" +) + +// Hash contains all supported hash formats. +// Add additional hash types e.g. [20]byte as needed here. +type Hash interface { + [32]byte +} + +type Ctx[H Hash] interface { + Hash(l []byte) H + HashInternal(a, b H) H + ZeroHash() H +} + +type keccakCtx struct { + InternalDomainSeparator [32]byte +} + +func NewKeccakCtx() Ctx[[32]byte] { + return keccakCtx{ + InternalDomainSeparator: [32]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, + } +} + +// Hash hashes a byte array with Keccak256 +func (k keccakCtx) Hash(l []byte) [32]byte { + // Note this Keccak256 cannot error https://github.com/golang/crypto/blob/master/sha3/sha3.go#L126 + // if we start supporting hashing algos which do, we can change this API to include an error. + return Keccak256Fixed(l) +} + +// HashInternal orders two [32]byte values and prepends them with +// a separator before hashing them. +func (k keccakCtx) HashInternal(a, b [32]byte) [32]byte { + if bytes.Compare(a[:], b[:]) < 0 { + return k.Hash(append(k.InternalDomainSeparator[:], append(a[:], b[:]...)...)) + } + return k.Hash(append(k.InternalDomainSeparator[:], append(b[:], a[:]...)...)) +} + +// ZeroHash returns the zero hash: 0xFF..FF +// We use bytes32 0xFF..FF for zeroHash in the CCIP research spec, this needs to match. +// This value is chosen since it is unlikely to be the result of a hash, and cannot match any internal node preimage. +func (k keccakCtx) ZeroHash() [32]byte { + var zeroes [32]byte + for i := 0; i < 32; i++ { + zeroes[i] = 0xFF + } + return zeroes +} + +var ( + LeafDomainSeparator = [1]byte{0x00} +) + +type LeafHasher struct { + geABI abi.ABI + metaDataHash [32]byte + ctx Ctx[[32]byte] +} + +func (t *LeafHasher) HashLeaf(log types.Log) ([32]byte, error) { + event, err := t.ParseEVM2EVMLog(log) + if err != nil { + return [32]byte{}, err + } + encodedTokens, err := ABIEncode(`[{"components": [{"name": "token","type": "address"}, {"name": "amount", "type": "uint256"}],"type": "tuple[]"}]`, event.Message.TokenAmounts) + if err != nil { + return [32]byte{}, err + } + + bytesArray, err := abi.NewType("bytes[]", "bytes[]", nil) + if err != nil { + return [32]byte{}, err + } + + encodedSourceTokenData, err := abi.Arguments{abi.Argument{Type: bytesArray}}.PackValues([]interface{}{event.Message.SourceTokenData}) + if err != nil { + return [32]byte{}, err + } + + packedFixedSizeValues, err := ABIEncode( + `[ +{"name": "sender", "type":"address"}, +{"name": "receiver", "type":"address"}, +{"name": "sequenceNumber", "type":"uint64"}, +{"name": "gasLimit", "type":"uint256"}, +{"name": "strict", "type":"bool"}, +{"name": "nonce", "type":"uint64"}, +{"name": "feeToken","type": "address"}, +{"name": "feeTokenAmount","type": "uint256"} +]`, + event.Message.Sender, + event.Message.Receiver, + event.Message.SequenceNumber, + event.Message.GasLimit, + event.Message.Strict, + event.Message.Nonce, + event.Message.FeeToken, + event.Message.FeeTokenAmount, + ) + if err != nil { + return [32]byte{}, err + } + fixedSizeValuesHash := t.ctx.Hash(packedFixedSizeValues) + + packedValues, err := ABIEncode( + `[ +{"name": "leafDomainSeparator","type":"bytes1"}, +{"name": "metadataHash", "type":"bytes32"}, +{"name": "fixedSizeValuesHash", "type":"bytes32"}, +{"name": "dataHash", "type":"bytes32"}, +{"name": "tokenAmountsHash", "type":"bytes32"}, +{"name": "sourceTokenDataHash", "type":"bytes32"} +]`, + LeafDomainSeparator, + t.metaDataHash, + fixedSizeValuesHash, + t.ctx.Hash(event.Message.Data), + t.ctx.Hash(encodedTokens), + t.ctx.Hash(encodedSourceTokenData), + ) + if err != nil { + return [32]byte{}, err + } + return t.ctx.Hash(packedValues), nil +} + +func (t *LeafHasher) ParseEVM2EVMLog(log types.Log) (*SendRequestedEvent, error) { + event := new(SendRequestedEvent) + err := bind.NewBoundContract(common.Address{}, t.geABI, nil, nil, nil).UnpackLog(event, "CCIPSendRequested", log) + return event, err +} + +func NewLeafHasher(sourceChainId uint64, destChainId uint64, onRampId common.Address, ctx Ctx[[32]byte]) *LeafHasher { + geABI, _ := abi.JSON(strings.NewReader(OnRampABI)) + return &LeafHasher{ + geABI: geABI, + metaDataHash: getMetaDataHash(ctx, ctx.Hash([]byte("EVM2EVMMessageHashV2")), sourceChainId, onRampId, destChainId), + ctx: ctx, + } +} + +func Keccak256Fixed(in []byte) [32]byte { + hash := sha3.NewLegacyKeccak256() + // Note this Keccak256 cannot error https://github.com/golang/crypto/blob/master/sha3/sha3.go#L126 + // if we start supporting hashing algos which do, we can change this API to include an error. + hash.Write(in) + var h [32]byte + copy(h[:], hash.Sum(nil)) + return h +} + +func getMetaDataHash[H Hash](ctx Ctx[H], prefix [32]byte, sourceChainId uint64, onRampId common.Address, destChainId uint64) H { + paddedOnRamp := onRampId.Hash() + return ctx.Hash(ConcatBytes(prefix[:], + math.U256Bytes(big.NewInt(0).SetUint64(sourceChainId)), + math.U256Bytes(big.NewInt(0).SetUint64(destChainId)), paddedOnRamp[:])) +} + +// ConcatBytes appends a bunch of byte arrays into a single byte array +func ConcatBytes(bufs ...[]byte) []byte { + return bytes.Join(bufs, []byte{}) +} + +// ABIEncode is the equivalent of abi.encode. +// See a full set of examples https://github.com/ethereum/go-ethereum/blob/420b78659bef661a83c5c442121b13f13288c09f/accounts/abi/packing_test.go#L31 +func ABIEncode(abiStr string, values ...interface{}) ([]byte, error) { + // Create a dummy method with arguments + inDef := fmt.Sprintf(`[{ "name" : "method", "type": "function", "inputs": %s}]`, abiStr) + inAbi, err := abi.JSON(strings.NewReader(inDef)) + if err != nil { + return nil, err + } + res, err := inAbi.Pack("method", values...) + if err != nil { + return nil, err + } + return res[4:], nil +} + +const ( + SourceFromHashes = true + SourceFromProof = false +) + +type Proof[H Hash] struct { + Hashes []H `json:"hashes"` + SourceFlags []bool `json:"source_flags"` +} + +type singleLayerProof[H Hash] struct { + nextIndices []int + subProof []H + sourceFlags []bool +} + +type Tree[H Hash] struct { + layers [][]H +} + +func NewTree[H Hash](ctx Ctx[H], leafHashes []H) (*Tree[H], error) { + if len(leafHashes) == 0 { + return nil, errors.New("Cannot construct a tree without leaves") + } + var layer = make([]H, len(leafHashes)) + copy(layer, leafHashes) + var layers = [][]H{layer} + var curr int + for len(layer) > 1 { + paddedLayer, nextLayer := computeNextLayer(ctx, layer) + layers[curr] = paddedLayer + curr++ + layers = append(layers, nextLayer) + layer = nextLayer + } + return &Tree[H]{ + layers: layers, + }, nil +} + +// Revive appears confused with the generics "receiver name t should be consistent with previous receiver name p for invalid-type" +// +//revive:disable:receiver-naming +func (t *Tree[H]) String() string { + b := strings.Builder{} + for _, layer := range t.layers { + b.WriteString(fmt.Sprintf("%v", layer)) + } + return b.String() +} + +func (t *Tree[H]) Root() H { + return t.layers[len(t.layers)-1][0] +} + +func (t *Tree[H]) Prove(indices []int) Proof[H] { + var proof Proof[H] + for _, layer := range t.layers[:len(t.layers)-1] { + res := proveSingleLayer(layer, indices) + indices = res.nextIndices + proof.Hashes = append(proof.Hashes, res.subProof...) + proof.SourceFlags = append(proof.SourceFlags, res.sourceFlags...) + } + return proof +} + +func computeNextLayer[H Hash](ctx Ctx[H], layer []H) ([]H, []H) { + if len(layer) == 1 { + return layer, layer + } + if len(layer)%2 != 0 { + layer = append(layer, ctx.ZeroHash()) + } + var nextLayer []H + for i := 0; i < len(layer); i += 2 { + nextLayer = append(nextLayer, ctx.HashInternal(layer[i], layer[i+1])) + } + return layer, nextLayer +} + +func parentIndex(idx int) int { + return idx / 2 +} + +func siblingIndex(idx int) int { + return idx ^ 1 +} + +func proveSingleLayer[H Hash](layer []H, indices []int) singleLayerProof[H] { + var ( + authIndices []int + nextIndices []int + sourceFlags []bool + ) + j := 0 + for j < len(indices) { + x := indices[j] + nextIndices = append(nextIndices, parentIndex(x)) + if j+1 < len(indices) && indices[j+1] == siblingIndex(x) { + j++ + sourceFlags = append(sourceFlags, SourceFromHashes) + } else { + authIndices = append(authIndices, siblingIndex(x)) + sourceFlags = append(sourceFlags, SourceFromProof) + } + j++ + } + var subProof []H + for _, i := range authIndices { + subProof = append(subProof, layer[i]) + } + return singleLayerProof[H]{ + nextIndices: nextIndices, + subProof: subProof, + sourceFlags: sourceFlags, + } +} + +// ProofFlagsToBits transforms a list of boolean proof flags to a *big.Int +// encoded number. +func ProofFlagsToBits(proofFlags []bool) *big.Int { + encodedFlags := big.NewInt(0) + for i := 0; i < len(proofFlags); i++ { + if proofFlags[i] { + encodedFlags.SetBit(encodedFlags, i, 1) + } + } + return encodedFlags +} diff --git a/core/scripts/ccip/manual-execution/helpers/utils.go b/core/scripts/ccip/manual-execution/helpers/utils.go new file mode 100644 index 00000000000..ac04fc70f0e --- /dev/null +++ b/core/scripts/ccip/manual-execution/helpers/utils.go @@ -0,0 +1,47 @@ +package helpers + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" +) + +func VerifyAddress(addr string) error { + if addr == "" { + return fmt.Errorf("address is blank") + } + if !common.IsHexAddress(addr) { + return fmt.Errorf("address %s is invalid", addr) + } + return nil +} + +func WaitForSuccessfulTxReceipt(client ethereum.TransactionReader, hash common.Hash) error { + ticker := time.NewTicker(5 * time.Second) + defer ticker.Stop() + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) + defer cancel() + for { + select { + case <-ticker.C: + log.Println("[MINING] waiting for tx to be mined...") + receipt, _ := client.TransactionReceipt(context.Background(), hash) + if receipt != nil { + if receipt.Status == types.ReceiptStatusFailed { + return fmt.Errorf("[MINING] ERROR tx reverted %s", hash.Hex()) + } + if receipt.Status == types.ReceiptStatusSuccessful { + log.Println("[MINING] tx mined %s successful", hash.Hex()) + return nil + } + } + case <-ctx.Done(): + return fmt.Errorf("tx not confirmed within time") + } + } +} diff --git a/core/scripts/ccip/manual-execution/main.go b/core/scripts/ccip/manual-execution/main.go new file mode 100644 index 00000000000..35f5de954ed --- /dev/null +++ b/core/scripts/ccip/manual-execution/main.go @@ -0,0 +1,451 @@ +package main + +import ( + "context" + "encoding/hex" + "encoding/json" + "flag" + "fmt" + "log" + "math" + "math/big" + "os" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "go.uber.org/multierr" + + chainselectors "github.com/smartcontractkit/chain-selectors" + + "manual-execution/helpers" +) + +const NumberOfBlocks = 20000 + +// Config represents configuration fields +type Config struct { + SrcNodeURL string `json:"src_rpc"` + DestNodeURL string `json:"dest_rpc"` + DestOwner string `json:"dest_owner_key"` + CommitStore string `json:"commit_store"` + OffRamp string `json:"off_ramp"` + DestStartBlock uint64 `json:"dest_start_block"` + SourceChainTx string `json:"source_chain_tx"` + CCIPMsgID string `json:"ccip_msg_id"` + DestDeployedAt uint64 `json:"dest_deployed_at"` + GasLimitOverride uint64 `json:"gas_limit_override"` +} + +type execArgs struct { + cfg Config + seqNum uint64 + msgID [32]byte + sourceChain *ethclient.Client + sourceChainId *big.Int + destChain *ethclient.Client + destUser *bind.TransactOpts + destChainId *big.Int + srcStartBlock *big.Int + destStartBlock uint64 + destLatestBlock uint64 + OnRamp common.Address + tokenGasOverrides []*big.Int +} + +func main() { + configPath := flag.String("configFile", "./config.json", "config for manually executing a failed ccip message "+ + "which has been successfully committed but failed to get executed") + flag.Parse() + + if *configPath == "" { + log.Println("config json is required") + os.Exit(1) + } + cData, err := os.ReadFile(*configPath) + if err != nil { + log.Println("unable to read the json at ", *configPath, "error - ", err) + os.Exit(1) + } + var cfg Config + err = json.Unmarshal(cData, &cfg) + if err != nil { + log.Println("unable to marshal the json at ", *configPath, "error - ", err, `sample json +{ + "src_rpc": "", + "dest_rpc": "", + "dest_owner_key": "", + "commit_store": "", + "off_ramp": "", + "dest_start_block": "", + "ccip_send_tx": "", + "source_start_block": "", + "dest_deployed_at": 0, + "gas_limit_override": 0, +}`) + os.Exit(1) + } + // mandatory fields check + err = cfg.verifyConfig() + if err != nil { + log.Println("config validation failed: \n", err) + os.Exit(1) + } + args := &execArgs{cfg: cfg} + err = args.populateValues() + if err != nil { + log.Println("error instantiating manual execution args ", err) + os.Exit(1) + } + err = args.execute() + if err != nil { + log.Println("manual execution was not successful - ", err) + os.Exit(1) + } +} + +func (cfg Config) verifyConfig() error { + var allErr error + if cfg.SrcNodeURL == "" { + allErr = multierr.Append(allErr, fmt.Errorf("must set src_rpc - source chain rpc\n")) + } + if cfg.DestNodeURL == "" { + allErr = multierr.Append(allErr, fmt.Errorf("must set dest_rpc - destination chain rpc\n")) + } + if cfg.DestOwner == "" { + allErr = multierr.Append(allErr, fmt.Errorf("must set dest_owner_key - destination user private key\n")) + } + if cfg.SourceChainTx == "" { + allErr = multierr.Append(allErr, fmt.Errorf("must set source_chain_tx - txHash of ccip-send request\n")) + } + + if cfg.DestStartBlock == 0 && cfg.DestDeployedAt == 0 { + allErr = multierr.Append(allErr, fmt.Errorf(`must set either of - +dest_deployed_at - the block number before destination contracts were deployed; +dest_start_block - the block number from which events will be filtered at destination chain. +`)) + } + if cfg.GasLimitOverride == 0 { + allErr = multierr.Append(allErr, fmt.Errorf("must set gas_limit_override - new value of gas limit for ccip-send request\n")) + } + err := helpers.VerifyAddress(cfg.CommitStore) + if err != nil { + allErr = multierr.Append(allErr, fmt.Errorf("check the commit_store address - %v\n", err)) + } + err = helpers.VerifyAddress(cfg.OffRamp) + if err != nil { + allErr = multierr.Append(allErr, fmt.Errorf("check the off_ramp address - %v\n", err)) + } + + return allErr +} + +func (args *execArgs) populateValues() error { + var err error + cfg := args.cfg + args.sourceChain, err = ethclient.Dial(cfg.SrcNodeURL) + if err != nil { + return err + } + args.sourceChainId, err = args.sourceChain.ChainID(context.Background()) + if err != nil { + return err + } + + args.destChain, err = ethclient.Dial(cfg.DestNodeURL) + if err != nil { + return err + } + args.destChainId, err = args.destChain.ChainID(context.Background()) + if err != nil { + return err + } + ownerKey, err := crypto.HexToECDSA(cfg.DestOwner) + if err != nil { + return err + } + + args.destUser, err = bind.NewKeyedTransactorWithChainID(ownerKey, args.destChainId) + if err != nil { + return err + } + log.Println("--- Owner address---/n", args.destUser.From.Hex()) + + var txReceipt *types.Receipt + txReceipt, err = args.sourceChain.TransactionReceipt(context.Background(), common.HexToHash(cfg.SourceChainTx)) + if err != nil { + return err + } + args.srcStartBlock = big.NewInt(0).Sub(txReceipt.BlockNumber, big.NewInt(NumberOfBlocks)) + args.destLatestBlock, err = args.destChain.BlockNumber(context.Background()) + if err != nil { + return err + } + + err = args.seqNumFromCCIPSendRequested(txReceipt.Logs) + if err != nil { + return err + } + if args.cfg.DestStartBlock < 1 { + err = args.approxDestStartBlock() + if err != nil { + return err + } + } else { + args.destStartBlock = args.cfg.DestStartBlock + } + return nil +} + +func (args *execArgs) execute() error { + iterator, err := helpers.FilterReportAccepted(args.destChain, &bind.FilterOpts{Start: args.destStartBlock}, args.cfg.CommitStore) + if err != nil { + return err + } + + var commitReport *helpers.ICommitStoreCommitReport + for iterator.Next() { + eventReport, err := iterator.CommitStoreReportAcceptedFromLog() + if err != nil { + return err + } + + if eventReport.Report.Interval.Min <= args.seqNum && eventReport.Report.Interval.Max >= args.seqNum { + commitReport = &eventReport.Report + log.Println("Found root") + break + } + } + if commitReport == nil { + return fmt.Errorf("unable to find seq num %d in commit report", args.seqNum) + } + log.Println("Executing request manually") + seqNr := args.seqNum + // Build a merkle tree for the report + mctx := helpers.NewKeccakCtx() + leafHasher := helpers.NewLeafHasher( + GetCCIPChainSelector(args.sourceChainId.Uint64()), + GetCCIPChainSelector(args.destChainId.Uint64()), + args.OnRamp, + mctx, + ) + + var leaves [][32]byte + var curr, prove int + var tokenData [][][]byte + var msgs []helpers.InternalEVM2EVMMessage + + sendRequestedIterator, err := helpers.FilterCCIPSendRequested(args.sourceChain, &bind.FilterOpts{ + Start: args.srcStartBlock.Uint64(), + }, args.OnRamp.Hex()) + if err != nil { + return err + } + + for sendRequestedIterator.Next() { + event, err := sendRequestedIterator.SendRequestedEventFromLog() + if err != nil { + return err + } + if event.Message.SequenceNumber <= commitReport.Interval.Max && + event.Message.SequenceNumber >= commitReport.Interval.Min { + log.Println("Found seq num in commit report", event.Message.SequenceNumber, commitReport.Interval) + hash, err := leafHasher.HashLeaf(sendRequestedIterator.Raw) + if err != nil { + return err + } + leaves = append(leaves, hash) + if event.Message.SequenceNumber == seqNr && event.Message.MessageId == args.msgID { + log.Printf("Found proving %d %+v\n\n", curr, event.Message) + msgs = append(msgs, event.Message) + + var msgTokenData [][]byte + for range event.Message.TokenAmounts { + msgTokenData = append(msgTokenData, []byte{}) + } + + tokenData = append(tokenData, msgTokenData) + prove = curr + } + curr++ + } + } + + sendRequestedIterator.Close() + if len(msgs) == 0 { + return fmt.Errorf("unable to find msg with seqNr %d", seqNr) + } + + expectedNumberOfLeaves := int(commitReport.Interval.Max) - int(commitReport.Interval.Min) + 1 + if len(leaves) != expectedNumberOfLeaves { + return fmt.Errorf("not enough leaves gather to build a commit root - want %d got %d. Please set NumberOfBlocks const to a higher value", expectedNumberOfLeaves, len(leaves)) + } + + tree, err := helpers.NewTree(mctx, leaves) + if err != nil { + return err + } + if tree.Root() != commitReport.MerkleRoot { + return fmt.Errorf("root doesn't match. cannot execute") + } + + proof := tree.Prove([]int{prove}) + offRampProof := helpers.InternalExecutionReport{ + Messages: msgs, + Proofs: proof.Hashes, + OffchainTokenData: tokenData, + ProofFlagBits: helpers.ProofFlagsToBits(proof.SourceFlags), + } + + gasLimitOverrides := make([]*helpers.EVM2EVMOffRampGasLimitOverride, len(offRampProof.Messages)) + + for range offRampProof.Messages { + evm2evmOffRampGasLimitOverride := &helpers.EVM2EVMOffRampGasLimitOverride{ + ReceiverExecutionGasLimit: big.NewInt(int64(args.cfg.GasLimitOverride)), + TokenGasOverrides: args.tokenGasOverrides, + } + gasLimitOverrides = append(gasLimitOverrides, evm2evmOffRampGasLimitOverride) + } + + // GasLimit may need to be raised if the TX is reverting. Must be set to a value larger than the GasLimitOverride. + // args.destUser.GasLimit = 5000000 + tx, err := helpers.ManuallyExecute(args.destChain, args.destUser, args.cfg.OffRamp, offRampProof, gasLimitOverrides) + if err != nil { + return err + } + // wait for tx confirmation + err = helpers.WaitForSuccessfulTxReceipt(args.destChain, tx.Hash()) + if err != nil { + log.Println("Failures may be due to insufficient gas, try increasing args.destUser.GasLimit.") + return err + } + + // check if the message got successfully delivered + changed, err := helpers.FilterExecutionStateChanged(args.destChain, &bind.FilterOpts{ + Start: args.destStartBlock, + }, args.cfg.OffRamp, []uint64{args.seqNum}, [][32]byte{args.msgID}) + if err != nil { + return err + } + if changed != 2 { + return fmt.Errorf("manual execution did not result in ExecutionStateChanged as success") + } + return nil +} + +func (args *execArgs) seqNumFromCCIPSendRequested(logs []*types.Log) error { + abi, err := abi.JSON(strings.NewReader(helpers.OnRampABI)) + if err != nil { + return err + } + var topic0 common.Hash + for name, abiEvent := range abi.Events { + if name == "CCIPSendRequested" { + topic0 = abiEvent.ID + break + } + } + if topic0 == (common.Hash{}) { + return fmt.Errorf("no CCIPSendRequested event found in ABI") + } + var sendRequestedLogs []types.Log + for _, sendReqLog := range logs { + if sendReqLog.Topics[0] == topic0 && sendReqLog.TxHash == common.HexToHash(args.cfg.SourceChainTx) { + args.OnRamp = sendReqLog.Address + sendRequestedLogs = append(sendRequestedLogs, *sendReqLog) + } + } + + if len(sendRequestedLogs) == 0 { + return fmt.Errorf("no CCIPSendRequested logs found for in txReceipt for txhash %s", args.cfg.SourceChainTx) + } + onRampContract := bind.NewBoundContract(args.OnRamp, abi, args.sourceChain, args.sourceChain, args.sourceChain) + + for _, sendReqLog := range sendRequestedLogs { + var event helpers.SendRequestedEvent + + err = onRampContract.UnpackLog(&event, "CCIPSendRequested", sendReqLog) + if err != nil { + return err + } + + if args.cfg.CCIPMsgID != "" && + "0x"+hex.EncodeToString(event.Message.MessageId[:]) != args.cfg.CCIPMsgID { + continue + } + + args.seqNum = event.Message.SequenceNumber + args.msgID = event.Message.MessageId + return nil + } + + return fmt.Errorf("send request not found in logs") +} + +func (args *execArgs) approxDestStartBlock() error { + sourceBlockHdr, err := args.sourceChain.HeaderByNumber(context.Background(), args.srcStartBlock) + if err != nil { + return err + } + sendTxTime := sourceBlockHdr.Time + maxBlockNum := args.destLatestBlock + // setting this to an approx value of 1000 considering destination chain would have at least 1000 blocks before the transaction started + minBlockNum := args.cfg.DestDeployedAt + closestBlockNum := uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + var closestBlockHdr *types.Header + closestBlockHdr, err = args.destChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + // to reduce the number of RPC calls increase the value of blockOffset + blockOffset := uint64(10) + for { + blockNum := closestBlockHdr.Number.Uint64() + if minBlockNum > maxBlockNum { + break + } + timeDiff := math.Abs(float64(closestBlockHdr.Time - sendTxTime)) + // break if the difference in timestamp is lesser than 1 minute + if timeDiff < 60 { + break + } else if closestBlockHdr.Time > sendTxTime { + maxBlockNum = blockNum - 1 + } else { + minBlockNum = blockNum + 1 + } + closestBlockNum = uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + closestBlockHdr, err = args.destChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + + for { + if closestBlockHdr.Time <= sendTxTime { + break + } + closestBlockNum = closestBlockNum - blockOffset + if closestBlockNum <= 0 { + return fmt.Errorf("approx destination blocknumber not found") + } + closestBlockHdr, err = args.destChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + args.destStartBlock = closestBlockHdr.Number.Uint64() + log.Printf("using approx destination start block number %d for filtering event", args.destStartBlock) + return nil +} + +func GetCCIPChainSelector(chainId uint64) uint64 { + selector, err := chainselectors.SelectorFromChainId(chainId) + if err != nil { + panic(fmt.Sprintf("no chain selector for %d", chainId)) + } + return selector +} diff --git a/core/scripts/ccip/revert-reason/Makefile b/core/scripts/ccip/revert-reason/Makefile new file mode 100644 index 00000000000..e52d2b27f72 --- /dev/null +++ b/core/scripts/ccip/revert-reason/Makefile @@ -0,0 +1,3 @@ +# Build the CLI binary +build: + go build -o bin/ccip-revert-reason . diff --git a/core/scripts/ccip/revert-reason/README.md b/core/scripts/ccip/revert-reason/README.md new file mode 100644 index 00000000000..9a3aa128526 --- /dev/null +++ b/core/scripts/ccip/revert-reason/README.md @@ -0,0 +1,41 @@ +## Setup + +Before starting: + +1. Create `.env` file based on the example `.env.example` next to the CLI binary. + +2. If you plan to resolve revert reasons from a transaction hash, you will need: + 1. An EVM chain endpoint URL + 2. A from address + +The endpoint URL can be a locally running node (archive mode), or an externally hosted one like +[alchemy](https://www.alchemy.com/). + + + +To see all available commands, run the following: +```bash +go run main.go --help +``` + + +## Usage + +Decoding an error code string (offline): + +```bash +> ./ccip-revert-reason reason --from-error "0x4e487b710000000000000000000000000000000000000000000000000000000000000032" +2022/12/05 15:18:33 Using config file .env +Decoded error: Assertion failure +If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).% +``` + + +Resolving from a transaction hash (`NODE_URL` and `FROM_ADDRESS` env vars need to be defined) + +```bash +> ./ccip-revert-reason reason "0x4e487b710000000000000" +2022/12/05 15:18:33 Using config file .env +Decoded error: Assertion failure +If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).% +``` \ No newline at end of file diff --git a/core/scripts/ccip/revert-reason/command/revert_reason.go b/core/scripts/ccip/revert-reason/command/revert_reason.go new file mode 100644 index 00000000000..7258eaba719 --- /dev/null +++ b/core/scripts/ccip/revert-reason/command/revert_reason.go @@ -0,0 +1,42 @@ +package command + +import ( + "fmt" + "log" + + "github.com/spf13/cobra" + + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/config" + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/handler" +) + +// RevertReasonCmd takes in a failed tx hash and tries to give you the reason +var RevertReasonCmd = &cobra.Command{ + Use: "reason ", + Short: "Revert reason for failed TX.", + Long: `Given a failed TX tries to find the revert reason. args = tx hex address`, + Args: cobra.ExactArgs(1), + Run: func(cmd *cobra.Command, args []string) { + cfg := config.New() + baseHandler := handler.NewBaseHandler(cfg) + + decodeFromError, err := cmd.Flags().GetBool("from-error") + if err != nil { + log.Fatal("failed to get withdraw flag: ", err) + } + + if decodeFromError { + result, err := baseHandler.RevertReasonFromErrorCodeString(args[0]) + if err != nil { + log.Fatal("failed to decode error code string: ", err) + } + fmt.Print(result) + } else { + result, err := baseHandler.RevertReasonFromTx(args[0]) + if err != nil { + log.Fatal("failed to decode error code string: ", err) + } + fmt.Print(result) + } + }, +} diff --git a/core/scripts/ccip/revert-reason/command/root.go b/core/scripts/ccip/revert-reason/command/root.go new file mode 100644 index 00000000000..31578fc46f1 --- /dev/null +++ b/core/scripts/ccip/revert-reason/command/root.go @@ -0,0 +1,35 @@ +package command + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +var configFile string + +// RootCmd represents the base command when called without any subcommands +var RootCmd = &cobra.Command{ + Use: "ccip-revert-reason", + Short: "ChainLink CLI tool to resolve CCIP revert reasons", + Long: `ccip-revert-reason is a CLI for running the CCIP revert reason resolution commands.`, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the RootCmd. +func Execute() { + if err := RootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} + +func init() { + RootCmd.PersistentFlags().StringVar(&configFile, "config", "", "config file (default is .env)") + _ = viper.BindPFlag("config", RootCmd.PersistentFlags().Lookup("config")) + + RootCmd.AddCommand(RevertReasonCmd) + RevertReasonCmd.Flags().Bool("from-error", false, "Whether to decode an error string instead of transaction hash") +} diff --git a/core/scripts/ccip/revert-reason/config/config.go b/core/scripts/ccip/revert-reason/config/config.go new file mode 100644 index 00000000000..014f44906c4 --- /dev/null +++ b/core/scripts/ccip/revert-reason/config/config.go @@ -0,0 +1,42 @@ +package config + +import ( + "log" + + "github.com/spf13/viper" +) + +// Config represents configuration fields +type Config struct { + NodeURL string `mapstructure:"NODE_URL"` + FromAddress string `mapstructure:"FROM_ADDRESS"` +} + +// New creates a new config +func New() *Config { + var cfg Config + configFile := viper.GetString("config") + if configFile != "" { + // Use config file from the flag. + viper.SetConfigFile(configFile) + } else { + viper.SetConfigFile(".env") + } + viper.AutomaticEnv() + if err := viper.ReadInConfig(); err != nil { + log.Fatal("failed to read config: ", err) + } + if err := viper.Unmarshal(&cfg); err != nil { + log.Fatal("failed to unmarshal config: ", err) + } + if err := cfg.Validate(); err != nil { + log.Fatal("failed to validate config: ", err) + } + + return &cfg +} + +// Validate validates the given config +func (c *Config) Validate() error { + return nil +} diff --git a/core/scripts/ccip/revert-reason/handler/handler.go b/core/scripts/ccip/revert-reason/handler/handler.go new file mode 100644 index 00000000000..e1ea13396c9 --- /dev/null +++ b/core/scripts/ccip/revert-reason/handler/handler.go @@ -0,0 +1,17 @@ +package handler + +import ( + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/config" +) + +// BaseHandler is the common handler with a common logic +type BaseHandler struct { + cfg *config.Config +} + +// NewBaseHandler is the constructor of baseHandler +func NewBaseHandler(cfg *config.Config) *BaseHandler { + return &BaseHandler{ + cfg: cfg, + } +} diff --git a/core/scripts/ccip/revert-reason/handler/reason.go b/core/scripts/ccip/revert-reason/handler/reason.go new file mode 100644 index 00000000000..ee354aca928 --- /dev/null +++ b/core/scripts/ccip/revert-reason/handler/reason.go @@ -0,0 +1,208 @@ +package handler + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "fmt" + "strings" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" +) + +// RevertReasonFromErrorCodeString attempts to decode an error code string +func (h *BaseHandler) RevertReasonFromErrorCodeString(errorCodeString string) (string, error) { + errorCodeString = strings.TrimPrefix(errorCodeString, "0x") + return DecodeErrorStringFromABI(errorCodeString) +} + +// RevertReasonFromTx attempts to fetch more info on failed TX +func (h *BaseHandler) RevertReasonFromTx(txHash string) (string, error) { + // Need a node URL + // NOTE: this node needs to run in archive mode + ethURL := h.cfg.NodeURL + if ethURL == "" { + panicErr(errors.New("you must define ETH_NODE env variable")) + } + requester := h.cfg.FromAddress + + ec, err := ethclient.Dial(ethURL) + panicErr(err) + errorString, _ := GetErrorForTx(ec, txHash, requester) + + return DecodeErrorStringFromABI(errorString) +} + +func DecodeErrorStringFromABI(errorString string) (string, error) { + contractABIs := getAllABIs() + + // Sanitize error string + errorString = strings.TrimPrefix(errorString, "Reverted ") + errorString = strings.TrimPrefix(errorString, "0x") + + data, err := hex.DecodeString(errorString) + if err != nil { + return "", errors.Wrap(err, "error decoding error string") + } + + for _, contractABI := range contractABIs { + parsedAbi, err2 := abi.JSON(strings.NewReader(contractABI)) + if err2 != nil { + return "", errors.Wrap(err2, "error loading ABI") + } + + for errorName, abiError := range parsedAbi.Errors { + if bytes.Equal(data[:4], abiError.ID.Bytes()[:4]) { + // Found a matching error + v, err3 := abiError.Unpack(data) + if err3 != nil { + return "", errors.Wrap(err3, "error unpacking data") + } + + // If exec error, the actual error is within the revert reason + if errorName == "ExecutionError" || errorName == "TokenRateLimitError" || errorName == "TokenHandlingError" || errorName == "ReceiverError" { + // Get the inner type, which is `bytes` + fmt.Printf("Error is \"%v\" \ninner error: ", errorName) + errorBytes := v.([]interface{})[0].([]byte) + if len(errorBytes) < 4 { + return "[reverted without error code]", nil + } + return DecodeErrorStringFromABI(hex.EncodeToString(errorBytes)) + } + return fmt.Sprintf("error is \"%v\" args %v\n", errorName, v), nil + } + } + } + + if len(errorString) > 8 && errorString[:8] == "4e487b71" { + fmt.Println("Assertion failure") + indicator := errorString[len(errorString)-2:] + switch indicator { + case "01": + return "If you call assert with an argument that evaluates to false.", nil + case "11": + return "If an arithmetic operation results in underflow or overflow outside of an unchecked { ... } block.", nil + case "12": + return "If you divide or modulo by zero (e.g. 5 / 0 or 23 modulo 0).", nil + case "21": + return "If you convert a value that is too big or negative into an enum type.", nil + case "31": + return "If you call .pop() on an empty array.", nil + case "32": + return "If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).", nil + case "41": + return "If you allocate too much memory or create an array that is too large.", nil + case "51": + return "If you call a zero-initialized variable of internal function type.", nil + default: + return fmt.Sprintf("This is a revert produced by an assertion failure. Exact code not found \"%s\"", indicator), nil + } + } + + stringErr, err := abi.UnpackRevert(data) + if err == nil { + return "string error: " + stringErr, nil + } + + return "", errors.Errorf(`cannot match error with contract ABI. Error code "%s"`, errorString) +} + +func getAllABIs() []string { + return []string{ + rmn_contract.RMNContractABI, + lock_release_token_pool_1_4_0.LockReleaseTokenPoolABI, + burn_mint_token_pool_1_2_0.BurnMintTokenPoolABI, + usdc_token_pool_1_4_0.USDCTokenPoolABI, + burn_mint_erc677.BurnMintERC677ABI, + erc20.ERC20ABI, + lock_release_token_pool.LockReleaseTokenPoolABI, + burn_mint_token_pool.BurnMintTokenPoolABI, + usdc_token_pool.USDCTokenPoolABI, + commit_store.CommitStoreABI, + token_admin_registry.TokenAdminRegistryABI, + fee_quoter.FeeQuoterABI, + evm_2_evm_onramp.EVM2EVMOnRampABI, + evm_2_evm_offramp.EVM2EVMOffRampABI, + router.RouterABI, + onramp.OnRampABI, + offramp.OffRampABI, + maybe_revert_message_receiver.MaybeRevertMessageReceiverABI, + } +} + +func GetErrorForTx(client *ethclient.Client, txHash string, requester string) (string, error) { + tx, _, err := client.TransactionByHash(context.Background(), common.HexToHash(txHash)) + if err != nil { + return "", errors.Wrap(err, "error getting transaction from hash") + } + re, err := client.TransactionReceipt(context.Background(), common.HexToHash(txHash)) + if err != nil { + return "", errors.Wrap(err, "error getting transaction receipt") + } + + call := ethereum.CallMsg{ + From: common.HexToAddress(requester), + To: tx.To(), + Data: tx.Data(), + Value: tx.Value(), + Gas: tx.Gas(), + GasPrice: tx.GasPrice(), + } + _, err = client.CallContract(context.Background(), call, re.BlockNumber) + if err == nil { + panic("no error calling contract") + } + + return parseError(err) +} + +func parseError(txError error) (string, error) { + b, err := json.Marshal(txError) + if err != nil { + return "", err + } + var callErr struct { + Code int + Data string `json:"data"` + Message string `json:"message"` + } + if json.Unmarshal(b, &callErr) != nil { + return "", err + } + + if callErr.Data == "" && strings.Contains(callErr.Message, "missing trie node") { + return "", errors.Errorf("please use an archive node") + } + + return callErr.Data, nil +} + +func panicErr(err error) { + if err != nil { + panic(err) + } +} diff --git a/core/scripts/ccip/revert-reason/handler/reason_test.go b/core/scripts/ccip/revert-reason/handler/reason_test.go new file mode 100644 index 00000000000..4a9363550ce --- /dev/null +++ b/core/scripts/ccip/revert-reason/handler/reason_test.go @@ -0,0 +1,68 @@ +package handler + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/config" +) + +func Test_RevertReasonFromTx(t *testing.T) { + type fields struct { + cfg *config.Config + } + type args struct { + txHash string + } + var tests []struct { + name string + fields fields + args args + expected string + } // TODO: Add test cases. + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + h := &BaseHandler{ + cfg: tt.fields.cfg, + } + got, err := h.RevertReasonFromTx(tt.args.txHash) + require.NoError(t, err) + require.Equal(t, tt.expected, got) + }) + } +} + +func Test_RevertReasonFromErrorCodeString(t *testing.T) { + type fields struct { + cfg *config.Config + } + type args struct { + errorCodeString string + } + tests := []struct { + name string + fields fields + args args + expected string + }{ + { + name: "decode error string", + fields: fields{cfg: &config.Config{}}, + args: args{ + errorCodeString: "0x4e487b710000000000000000000000000000000000000000000000000000000000000032", + }, + expected: "If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + h := &BaseHandler{ + cfg: tt.fields.cfg, + } + got, err := h.RevertReasonFromErrorCodeString(tt.args.errorCodeString) + require.NoError(t, err) + require.Equal(t, tt.expected, got) + }) + } +} diff --git a/core/scripts/ccip/revert-reason/main.go b/core/scripts/ccip/revert-reason/main.go new file mode 100644 index 00000000000..1eac8b66baa --- /dev/null +++ b/core/scripts/ccip/revert-reason/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "github.com/smartcontractkit/chainlink/core/scripts/ccip/revert-reason/command" +) + +func main() { + command.Execute() +} diff --git a/core/scripts/ccip/secrets/secrets.go b/core/scripts/ccip/secrets/secrets.go new file mode 100644 index 00000000000..e47f644b37e --- /dev/null +++ b/core/scripts/ccip/secrets/secrets.go @@ -0,0 +1,16 @@ +package secrets + +import ( + "fmt" + "os" + "strconv" +) + +func GetRPC(chainID uint64) string { + envVariable := "RPC_" + strconv.FormatUint(chainID, 10) + rpc := os.Getenv(envVariable) + if rpc != "" { + return rpc + } + panic(fmt.Errorf("RPC not found. Please set the environment variable for chain %d e.g. RPC_420=https://rpc.420.com", chainID)) +} diff --git a/core/scripts/ccip/shared/helpers.go b/core/scripts/ccip/shared/helpers.go new file mode 100644 index 00000000000..8aa8b9ab222 --- /dev/null +++ b/core/scripts/ccip/shared/helpers.go @@ -0,0 +1,52 @@ +package shared + +import ( + "context" + "testing" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/stretchr/testify/require" + + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +const RetryTiming = 5 * time.Second +const CrossChainTimout = 5 * time.Minute +const TxInclusionTimout = 3 * time.Minute + +// WaitForMined wait for a tx to be included on chain. It will panic when +// the tx is reverted/successful based on the shouldSucceed parameter. +func WaitForMined(lggr logger.Logger, client ethereum.TransactionReader, hash common.Hash, shouldSucceed bool) error { + maxIterations := TxInclusionTimout / RetryTiming + for i := 0; i < int(maxIterations); i++ { + lggr.Info("[MINING] waiting for tx to be mined...") + receipt, _ := client.TransactionReceipt(context.Background(), hash) + + if receipt != nil { + if shouldSucceed && receipt.Status == 0 { + lggr.Infof("[MINING] ERROR tx reverted %s", hash.Hex()) + panic(receipt) + } else if !shouldSucceed && receipt.Status != 0 { + lggr.Infof("[MINING] ERROR expected tx to revert %s", hash.Hex()) + panic(receipt) + } + lggr.Infof("[MINING] tx mined %s successful %t", hash.Hex(), shouldSucceed) + return nil + } + + time.Sleep(RetryTiming) + } + return errors.New("No tx found within the given timeout") +} + +func RequireNoError(t *testing.T, err error) { + if err != nil { + jErr, _ := evmclient.ExtractRPCError(err) + t.Log(jErr) + } + require.NoError(t, err) +} diff --git a/core/scripts/go.mod b/core/scripts/go.mod index b0dd9a49b65..1a566539391 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -30,6 +30,7 @@ require ( github.com/montanaflynn/stats v0.7.1 github.com/olekukonko/tablewriter v0.0.5 github.com/pelletier/go-toml/v2 v2.2.3 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 @@ -285,7 +286,6 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pressly/goose/v3 v3.21.1 // indirect diff --git a/dashboard-lib/ccip-load-test-view/component.go b/dashboard-lib/ccip-load-test-view/component.go index 790ea6e9a9d..700a0a51077 100644 --- a/dashboard-lib/ccip-load-test-view/component.go +++ b/dashboard-lib/ccip-load-test-view/component.go @@ -310,6 +310,7 @@ func reqRespRow(p Props) []dashboard.Option { return []dashboard.Option{ dashboard.Row( "Requests/Responses", + row.Collapse(), row.WithStat( "Stats", stat.DataSource(p.LokiDataSource), diff --git a/deployment/environment/nodeclient/chainlink.go b/deployment/environment/nodeclient/chainlink.go index 52aee76cd98..0fb3eca2659 100644 --- a/deployment/environment/nodeclient/chainlink.go +++ b/deployment/environment/nodeclient/chainlink.go @@ -94,6 +94,11 @@ func (c *ChainlinkClient) URL() string { return c.Config.URL } +func (c *ChainlinkClient) WithRetryCount(retryCount int) *ChainlinkClient { + c.APIClient.SetRetryCount(retryCount) + return c +} + // Health returns all statuses health info func (c *ChainlinkClient) Health() (*HealthResponse, *http.Response, error) { respBody := &HealthResponse{} diff --git a/integration-tests/.gitignore b/integration-tests/.gitignore new file mode 100644 index 00000000000..43803dd8728 --- /dev/null +++ b/integration-tests/.gitignore @@ -0,0 +1,4 @@ +vendor +# secret files in config +**/**/network_config.toml +**/**/secrets.toml \ No newline at end of file diff --git a/integration-tests/actions/actions.go b/integration-tests/actions/actions.go index 53283967976..5a3f0b6c70b 100644 --- a/integration-tests/actions/actions.go +++ b/integration-tests/actions/actions.go @@ -4,6 +4,7 @@ package actions import ( "context" "crypto/ecdsa" + "encoding/json" "fmt" "math" "math/big" @@ -13,6 +14,7 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/pelletier/go-toml/v2" geth "github.com/ethereum/go-ethereum" @@ -697,6 +699,45 @@ func ConfigureOCRv2AggregatorContracts( return nil } +// ReturnFunds attempts to return all the funds from the chainlink nodes to the network's default address +// all from a remote, k8s style environment +// Remove this once ccip-tests are moved to seth client +func ReturnFunds(lggr zerolog.Logger, chainlinkNodes []*nodeclient.ChainlinkK8sClient, blockchainClient blockchain.EVMClient) error { + if blockchainClient == nil { + return errors.New("blockchain client is nil, unable to return funds from chainlink nodes") + } + lggr.Info().Msg("Attempting to return Chainlink node funds to default network wallets") + if blockchainClient.NetworkSimulated() { + lggr.Info().Str("Network Name", blockchainClient.GetNetworkName()). + Msg("Network is a simulated network. Skipping fund return.") + return nil + } + + for _, chainlinkNode := range chainlinkNodes { + fundedKeys, err := chainlinkNode.ExportEVMKeysForChain(blockchainClient.GetChainID().String()) + if err != nil { + return err + } + for _, key := range fundedKeys { + keyToDecrypt, err := json.Marshal(key) + if err != nil { + return err + } + // This can take up a good bit of RAM and time. When running on the remote-test-runner, this can lead to OOM + // issues. So we avoid running in parallel; slower, but safer. + decryptedKey, err := keystore.DecryptKey(keyToDecrypt, nodeclient.ChainlinkKeyPassword) + if err != nil { + return err + } + err = blockchainClient.ReturnFunds(decryptedKey.PrivateKey) + if err != nil { + lggr.Error().Err(err).Str("Address", fundedKeys[0].Address).Msg("Error returning funds from Chainlink node") + } + } + } + return blockchainClient.WaitForEvents() +} + // TeardownSuite tears down networks/clients and environment and creates a logs folder for failed tests in the // specified path. Can also accept a testreporter (if one was used) to log further results func TeardownSuite( @@ -707,6 +748,7 @@ func TeardownSuite( optionalTestReporter testreporters.TestReporter, // Optionally pass in a test reporter to log further metrics failingLogLevel zapcore.Level, // Examines logs after the test, and fails the test if any Chainlink logs are found at or above provided level grafnaUrlProvider testreporters.GrafanaURLProvider, + evmClients ...blockchain.EVMClient, ) error { l := logging.GetTestLogger(t) if err := testreporters.WriteTeardownLogs(t, env, optionalTestReporter, failingLogLevel, grafnaUrlProvider); err != nil { @@ -730,6 +772,28 @@ func TeardownSuite( } else { l.Info().Msg("Successfully returned funds from chainlink nodes to default network wallets") } + // The following is needed for tests using EVMClient, + // Remove this once ccip-tests are moved to seth client + for _, c := range evmClients { + if c != nil && chainlinkNodes != nil && len(chainlinkNodes) > 0 { + if err := ReturnFunds(l, chainlinkNodes, c); err != nil { + // This printed line is required for tests that use real funds to propagate the failure + // out to the system running the test. Do not remove + fmt.Println(environment.FAILED_FUND_RETURN) + l.Error().Err(err).Str("Namespace", env.Cfg.Namespace). + Msg("Error attempting to return funds from chainlink nodes to network's default wallet. " + + "Environment is left running so you can try manually!") + } + } else { + l.Info().Msg("Successfully returned funds from chainlink nodes to default network wallets") + } + if c != nil { + err := c.Close() + if err != nil { + return err + } + } + } return env.Shutdown() } diff --git a/integration-tests/ccip-tests/Makefile b/integration-tests/ccip-tests/Makefile index 2702c36b027..4aebd4c4608 100644 --- a/integration-tests/ccip-tests/Makefile +++ b/integration-tests/ccip-tests/Makefile @@ -1,5 +1,5 @@ ## To Override the default config: -# example usage: make set_config override_toml=../config/config.toml network_config_toml=../config/network.toml +# example usage: make set_config override_toml=../config/config.toml .PHONY: set_config set_config: if [ -s "$(override_toml)" ]; then \ @@ -12,10 +12,6 @@ set_config: echo "No override config found, using default config"; \ echo > ./testconfig/override/.env; \ fi - if [ -s "$(network_config_toml)" ]; then \ - echo "Overriding network config with $(network_config_toml)"; \ - echo "export BASE64_NETWORK_CONFIG=$$(base64 -i $(network_config_toml))" >> ./testconfig/override/.env; \ - fi @echo "Checking for test secrets file in ~/.testsecrets..."; @if [ ! -f ~/.testsecrets ]; then \ @@ -71,3 +67,10 @@ test_smoke_ccip_default: set_config .PHONY: build_ccip_image build_ccip_image: docker build -f ../../core/chainlink.Dockerfile --build-arg COMMIT_SHA=$(git rev-parse HEAD) --build-arg CHAINLINK_USER=chainlink -t $(image):$(tag) ../../ + +# image: the name for the chainlink image being built, example: image=chainlink +# tag: the tag for the chainlink image being built, example: tag=latest +# example usage: make build_ccip_image image=chainlink-ccip tag=latest +.PHONY: build_ccip_debug_image +build_ccip_debug_image: + docker build -f ../../core/chainlink.debug.Dockerfile --build-arg COMMIT_SHA=$(git rev-parse HEAD) --build-arg CHAINLINK_USER=chainlink -t $(image):$(tag) ../../ diff --git a/integration-tests/ccip-tests/README.md b/integration-tests/ccip-tests/README.md index a4255928949..855cfcde699 100644 --- a/integration-tests/ccip-tests/README.md +++ b/integration-tests/ccip-tests/README.md @@ -34,6 +34,16 @@ For example, if you want to override the `Network` input in test and want to run export BASE64_CONFIG_OVERRIDE=$(base64 -i ./testconfig/override/mainnet.toml) ``` +3. Secrets - You also need to set some secrets. This is a mandatory step needed to run the tests. Please refer to [.testsecrets.example](./examples/.testsecrets.example) for the list of secrets and instruction how to set them up. + - The chainlink image is a required secret for all tests + - If you are running tests in live networks like testnet and mainnet, you need to set the secrets (rpc urls and private keys) for the respective networks. + +**Please note that the secrets should NOT be checked in to the repo and should be kept locally.** + +======= + export BASE64_CONFIG_OVERRIDE=$(base64 -i ./testconfig/override/mainnet.toml) + ``` + 3. Secrets - You also need to set some secrets. This is a mandatory step needed to run the tests. Please refer to [.testsecrets.example](./examples/.testsecrets.example) for the list of secrets and instruction how to set them up. - The chainlink image and tag are required secrets for all the tests. - If you are running tests in live networks like testnet and mainnet, you need to set the secrets (rpc urls and private keys) for the respective networks. @@ -50,6 +60,7 @@ You can run this command to ignore any changes to the file. git update-index --skip-worktree ``` +>>>>>>> v2.17.0 ## Running the Tests There are two ways to run the tests: diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index 492ee2fd0fa..56a06021db2 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -4,6 +4,7 @@ import ( "context" crypto_rand "crypto/rand" "encoding/base64" + "encoding/hex" "encoding/json" "fmt" "math/big" @@ -31,8 +32,6 @@ import ( "golang.org/x/exp/rand" "golang.org/x/sync/errgroup" - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" - chainselectors "github.com/smartcontractkit/chain-selectors" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -44,6 +43,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver" "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/reorg" "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts/laneconfig" @@ -61,6 +61,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipexec" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" @@ -87,6 +89,7 @@ const ( // DefaultResubscriptionTimeout denotes the max backoff duration for resubscription for various watch events // if the subscription keeps failing even after this duration, the test will fail DefaultResubscriptionTimeout = 2 * time.Hour + LBTCValidDestPoolData = "9b11457aa29d65e4940b67b7da16bd370d29bf6a3247a28066f93ac407b8b811" ) // TODO: These should be refactored along with the default CCIP test setup to use optional config functions @@ -175,6 +178,8 @@ type CCIPCommon struct { MulticallContract common.Address ExistingDeployment bool USDCMockDeployment *bool + LBTCMockDeployment *bool + LBTCDestPoolDataAs32Bytes *bool TokenMessenger *common.Address TokenTransmitter *contracts.TokenTransmitter IsConnectionRestoredRecently *atomic.Bool @@ -723,6 +728,10 @@ func (ccipModule *CCIPCommon) IsUSDCDeployment() bool { return pointer.GetBool(ccipModule.USDCMockDeployment) } +func (ccipModule *CCIPCommon) IsLBTCDeployment() bool { + return pointer.GetBool(ccipModule.LBTCMockDeployment) +} + func (ccipModule *CCIPCommon) WriteLaneConfig(conf *laneconfig.LaneConfig) { var btAddresses, btpAddresses []string priceAggrs := make(map[string]string) @@ -733,17 +742,16 @@ func (ccipModule *CCIPCommon) WriteLaneConfig(conf *laneconfig.LaneConfig) { for k, v := range ccipModule.PriceAggregators { priceAggrs[k.Hex()] = v.ContractAddress.Hex() } - conf.CommonContracts = laneconfig.CommonContracts{ - FeeToken: ccipModule.FeeToken.Address(), - BridgeTokens: btAddresses, - BridgeTokenPools: btpAddresses, - ARM: ccipModule.RMNContract.Hex(), - Router: ccipModule.Router.Address(), - PriceRegistry: ccipModule.PriceRegistry.Address(), - PriceAggregators: priceAggrs, - WrappedNative: ccipModule.WrappedNative.Hex(), - Multicall: ccipModule.MulticallContract.Hex(), - } + conf.CommonContracts.FeeToken = ccipModule.FeeToken.Address() + conf.CommonContracts.BridgeTokens = btAddresses + conf.CommonContracts.BridgeTokenPools = btpAddresses + conf.CommonContracts.ARM = ccipModule.RMNContract.Hex() + conf.CommonContracts.Router = ccipModule.Router.Address() + conf.CommonContracts.PriceRegistry = ccipModule.PriceRegistry.Address() + conf.CommonContracts.PriceAggregators = priceAggrs + conf.CommonContracts.WrappedNative = ccipModule.WrappedNative.Hex() + conf.CommonContracts.Multicall = ccipModule.MulticallContract.Hex() + if ccipModule.TokenAdminRegistry != nil { conf.CommonContracts.TokenAdminRegistry = ccipModule.TokenAdminRegistry.Address() } @@ -883,7 +891,6 @@ func (ccipModule *CCIPCommon) DeployContracts( // deploy bridge token. for i := len(ccipModule.BridgeTokens); i < noOfTokens; i++ { var token *contracts.ERC20Token - if len(tokenDeployerFns) != noOfTokens { if ccipModule.IsUSDCDeployment() && i == 0 { // if it's USDC deployment, we deploy the burn mint token 677 with decimal 6 and cast it to ERC20Token @@ -929,6 +936,16 @@ func (ccipModule *CCIPCommon) DeployContracts( if err != nil { return fmt.Errorf("granting minter role to token transmitter shouldn't fail %w", err) } + } else if ccipModule.IsLBTCDeployment() && i == 0 { + // if it's LBTC deployment, we deploy the burn mint token 677 with decimal 8 and cast it to ERC20Token + lbtcToken, err := ccipModule.tokenDeployer.DeployCustomBurnMintERC677Token("Lombard LBTC", "LBTC", uint8(8), new(big.Int).Mul(big.NewInt(1e6), big.NewInt(1e18))) + if err != nil { + return fmt.Errorf("deploying bridge lbtc token contract shouldn't fail %w", err) + } + token, err = ccipModule.tokenDeployer.NewERC20TokenContract(lbtcToken.ContractAddress) + if err != nil { + return fmt.Errorf("getting new bridge lbtc token contract shouldn't fail %w", err) + } } else { // otherwise we deploy link token and cast it to ERC20Token linkToken, err := ccipModule.tokenDeployer.DeployLinkTokenContract() @@ -993,6 +1010,43 @@ func (ccipModule *CCIPCommon) DeployContracts( } ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, usdcPool) + } else if ccipModule.IsLBTCDeployment() && i == 0 { + if ccipModule.RMNContract == nil { + return errors.New("RMNContract is not initialized") + } + rmnContract := *ccipModule.RMNContract + + destPoolData, err := hex.DecodeString(LBTCValidDestPoolData) // valid 32 bytes should call attestation api + if err != nil { + return errors.Wrapf(err, "decoding dest pool data shouldn't fail") + } + if !pointer.GetBool(ccipModule.LBTCDestPoolDataAs32Bytes) { + // non 32 bytes data should not call attestation api and instead consider it as deposit payload. + // lombard has both attested and non-attested flow + destPoolData = []byte{0x12, 0x34, 0x56, 0x78} + } + lbtcPool, err := ccipModule.tokenDeployer.DeployMockLBTCTokenPoolContract(token.Address(), rmnContract, ccipModule.Router.Instance.Address(), destPoolData) + if err != nil { + return errors.Wrapf(err, "deploying mock lbtc bridge token pool shouldn't fail") + } + lbtcInstance, err := burn_mint_erc677.NewBurnMintERC677(token.ContractAddress, ccipModule.ChainClient.Backend()) + if err != nil { + return errors.Wrapf(err, "failed to get dest usdc token instance") + } + opts, err := ccipModule.tokenDeployer.Client().TransactionOpts(token.OwnerWallet) + if err != nil { + return errors.Wrapf(err, "failed to get transaction opts") + } + tx, err := lbtcInstance.GrantMintAndBurnRoles(opts, common.HexToAddress(lbtcPool.Address())) + if err != nil { + return errors.Wrapf(err, "granting minter role to owner shouldn't fail") + } + err = ccipModule.tokenDeployer.Client().ProcessTransaction(tx) + if err != nil { + return errors.Wrapf(err, "failed to process grant mint role") + } + + ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, lbtcPool) } else { // deploy lock release token pool in case of non-usdc deployment btp, err := ccipModule.tokenDeployer.DeployLockReleaseTokenPoolContract(token.Address(), *ccipModule.RMNContract, ccipModule.Router.Instance.Address()) @@ -1291,6 +1345,8 @@ func DefaultCCIPModule( ExistingDeployment: pointer.GetBool(testGroupConf.ExistingDeployment), MulticallEnabled: pointer.GetBool(testGroupConf.MulticallInOneTx), USDCMockDeployment: testGroupConf.USDCMockDeployment, + LBTCMockDeployment: testGroupConf.LBTCMockDeployment, + LBTCDestPoolDataAs32Bytes: testGroupConf.LBTCDestPoolDataAs32Bytes, NoOfTokensNeedingDynamicPrice: pointer.GetInt(testGroupConf.TokenConfig.NoOfTokensWithDynamicPrice), poolFunds: testhelpers.Link(5), gasUpdateWatcherMu: &sync.Mutex{}, @@ -1652,7 +1708,10 @@ func (sourceCCIP *SourceCCIPModule) IsRequestTriggeredWithinTimeframe(timeframe // IsPastRequestTriggeredWithinTimeframe determines the average block time and calculates the block numbers // within the specified timeframe. It then uses FilterCCIPSendRequested to identify the past events. -func (sourceCCIP *SourceCCIPModule) IsPastRequestTriggeredWithinTimeframe(ctx context.Context, timeframe *commonconfig.Duration) (*time.Time, error) { +func (sourceCCIP *SourceCCIPModule) IsPastRequestTriggeredWithinTimeframe( + ctx context.Context, + timeframe *commonconfig.Duration, +) (*types.Log, error) { if timeframe == nil { return nil, nil } @@ -1683,17 +1742,21 @@ func (sourceCCIP *SourceCCIPModule) IsPastRequestTriggeredWithinTimeframe(ctx co return nil, fmt.Errorf("error while filtering CCIP send requested starting block number: %d. Error: %w", filterFromBlock, err) } defer func() { - _ = iterator.Close() + iterErr := iterator.Close() + if iterErr != nil { + sourceCCIP.Common.Logger.Error().Err(iterErr).Msg("Error closing iterator") + } }() - if iterator.Next() { - hdr, err := sourceCCIP.Common.ChainClient.HeaderByNumber(context.Background(), new(big.Int).SetUint64(iterator.Event.Raw.BlockNumber)) - if err != nil { - return nil, fmt.Errorf("error getting header for block: %d, Error: %w", iterator.Event.Raw.BlockNumber, err) + lastBlockNumber := uint64(0) + var latestEvent *types.Log + for iterator.Next() { + blockNum := iterator.Event.Raw.BlockNumber + if blockNum > lastBlockNumber { + lastBlockNumber = blockNum + latestEvent = &iterator.Event.Raw } - return pointer.ToTime(hdr.Timestamp), nil } - - return nil, nil + return latestEvent, nil } func (sourceCCIP *SourceCCIPModule) AssertEventCCIPSendRequested( @@ -3211,7 +3274,7 @@ func (lane *CCIPLane) ValidateRequestByTxHash(txHash common.Hash, opts validatio reqStats = append(reqStats, req.RequestStat) } - if opts.phaseExpectedToFail == testreporters.CCIPSendRe && opts.timeout != 0 { + if (opts.phaseExpectedToFail == testreporters.CCIPSendRe || opts.expectAnyPhaseToFail) && opts.timeout != 0 { timeout = opts.timeout } msgLogs, ccipSendReqGenAt, err := lane.Source.AssertEventCCIPSendRequested( @@ -3239,6 +3302,10 @@ func (lane *CCIPLane) ValidateRequestByTxHash(txHash common.Hash, opts validatio return fmt.Errorf("could not find request stat for seq number %d", seqNumber) } + if opts.expectAnyPhaseToFail && opts.timeout != 0 { + timeout = opts.timeout + } + if opts.phaseExpectedToFail == testreporters.Commit && opts.timeout != 0 { timeout = opts.timeout } @@ -3278,6 +3345,10 @@ func (lane *CCIPLane) ValidateRequestByTxHash(txHash common.Hash, opts validatio return phaseErr } } + if opts.expectAnyPhaseToFail { + return errors.New("expected at least any one phase to fail but no phase got failed") + } + return nil } @@ -3727,6 +3798,21 @@ func (lane *CCIPLane) DeployNewCCIPLane( AttestationAPITimeoutSeconds: 5, } } + if !lane.Source.Common.ExistingDeployment && lane.Source.Common.IsLBTCDeployment() { + api := "" + if killgrave != nil { + api = killgrave.InternalEndpoint + } + if env.MockServer != nil { + api = env.MockServer.Config.ClusterURL + } + // Only one LBTC allowed per chain + jobParams.LBTCConfig = &config.LBTCConfig{ + SourceTokenAddress: common.HexToAddress(lane.Source.Common.BridgeTokens[0].Address()), + AttestationAPI: api, + AttestationAPITimeoutSeconds: 5, + } + } if !bootstrapAdded.Load() { bootstrapAdded.Store(true) err := CreateBootstrapJob(jobParams, bootstrapCommit, bootstrapExec) @@ -3854,12 +3940,13 @@ func SetOCR2Config( if len(execNodes) > 0 { nodes = execNodes } + + // Use out of order batching strategy if we expect to be sending out of order messages + batchingStrategyID := ccipexec.BestEffortBatchingStrategyID + if pointer.GetBool(testConf.AllowOutOfOrder) { + batchingStrategyID = ccipexec.ZKOverflowBatchingStrategyID + } if destCCIP.OffRamp != nil { - // Use out of order batching strategy if we expect to be sending out of order messages - batchingStrategyID := uint32(0) - if pointer.GetBool(testConf.AllowOutOfOrder) { - batchingStrategyID = uint32(1) - } execOffchainCfg, err := contracts.NewExecOffchainConfig( 1, BatchGasLimit, @@ -4121,6 +4208,7 @@ func (c *CCIPTestEnv) ConnectToExistingNodes(envConfig *testconfig.Common) error if err != nil { return fmt.Errorf("failed to create chainlink client: %w for node %d config %v", err, i+1, cfg) } + clClient.ChainlinkClient.WithRetryCount(3) c.CLNodes = append(c.CLNodes, clClient) c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{}) } @@ -4134,7 +4222,7 @@ func (c *CCIPTestEnv) ConnectToDeployedNodes() error { for _, chainlinkNode := range c.LocalCluster.ClCluster.Nodes { c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{}) c.CLNodes = append(c.CLNodes, &nodeclient.ChainlinkK8sClient{ - ChainlinkClient: chainlinkNode.API, + ChainlinkClient: chainlinkNode.API.WithRetryCount(3), }) } } else { @@ -4422,6 +4510,48 @@ func SetMockServerWithUSDCAttestation( return nil } +// SetMockServerWithLBTCAttestation responds with a mock attestation for any msgHash +// The path is set with regex to match any path that starts with /v1/attestations +func SetMockServerWithLBTCAttestation( + killGrave *ctftestenv.Killgrave, + mockserver *ctfClient.MockserverClient, +) error { + path := "/bridge/v1/deposits/getByHash" + type attestation struct { + Status string `json:"status"` + Attestation string `json:"attestation"` + MessageHash string `json:"message_hash"` + } + response := struct { + Attestations []attestation `json:"attestations"` + }{ + Attestations: []attestation{ + { + MessageHash: "0x" + LBTCValidDestPoolData, // sample hash + Status: "NOTARIZATION_STATUS_SESSION_APPROVED", + Attestation: "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e45c70a5050000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc0000000000000000000000000000000000000000000000000000000000014a34000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc00000000000000000000000062f10ce5b727edf787ea45776bd050308a61150800000000000000000000000000000000000000000000000000000000000003e60000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000040277eeafba008d767c2636d9428f2ebb13ab29ac70337f4fc34b0f5606767cae546f9be3f12160de6d142e5b3c1c3ebd0bf4298662b32b597d0cc5970c7742fc10000000000000000000000000000000000000000000000000000000000000040bbcd60ecc9e06f2effe7c94161219498a1eb435b419387adadb86ec9a52dfb066ce027532517df7216404049d193a25b85c35edfa3e7c5aa4757bfe84887a3980000000000000000000000000000000000000000000000000000000000000040da4a6dc619b5ca2349783cabecc4efdbc910090d3e234d7b8d0430165f8fae532f9a965ceb85c18bb92e059adefa7ce5835850a705761ab9e026d2db4a13ef9a", + }, + }, + } + if killGrave == nil && mockserver == nil { + return errors.New("both killgrave and mockserver are nil") + } + log.Info().Str("path", path).Msg("setting attestation-api response for any msgHash") + if killGrave != nil { + err := killGrave.SetAnyValueResponse(path, []string{http.MethodPost}, response) + if err != nil { + return fmt.Errorf("failed to set killgrave server value: %w", err) + } + } + if mockserver != nil { + err := mockserver.SetAnyValueResponse(path, response) + if err != nil { + return fmt.Errorf("failed to set mockserver value: %w URL = %s", err, fmt.Sprintf("%s/%s/.*", mockserver.LocalURL(), path)) + } + } + return nil +} + // SetMockserverWithTokenPriceValue sets the mock responses in mockserver that are read by chainlink nodes // to simulate different price feed value. // it keeps updating the response every 15 seconds to simulate price feed updates diff --git a/integration-tests/ccip-tests/contracts/contract_deployer.go b/integration-tests/ccip-tests/contracts/contract_deployer.go index 0aaec8f66a0..f564ab6244c 100644 --- a/integration-tests/ccip-tests/contracts/contract_deployer.go +++ b/integration-tests/ccip-tests/contracts/contract_deployer.go @@ -21,9 +21,8 @@ import ( ocrconfighelper2 "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" - "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" "github.com/smartcontractkit/chainlink/integration-tests/contracts" @@ -37,6 +36,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_lbtc_token_pool" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_messenger" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter" @@ -241,6 +241,43 @@ func (e *CCIPContractsDeployer) DeployBurnMintERC677(ownerMintingAmount *big.Int return token, err } +func (e *CCIPContractsDeployer) DeployCustomBurnMintERC677Token(name, symbol string, decimals uint8, ownerMintingAmount *big.Int) (*ERC677Token, error) { + address, _, instance, err := e.evmClient.DeployContract("Burn Mint ERC 677", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return burn_mint_erc677.DeployBurnMintERC677(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), name, symbol, decimals, new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e9))) + }) + if err != nil { + return nil, err + } + + token := &ERC677Token{ + client: e.evmClient, + logger: e.logger, + ContractAddress: *address, + instance: instance.(*burn_mint_erc677.BurnMintERC677), + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + } + if ownerMintingAmount != nil { + // grant minter role to owner and mint tokens + err = token.GrantMintRole(common.HexToAddress(e.evmClient.GetDefaultWallet().Address())) + if err != nil { + return token, fmt.Errorf("granting minter role to owner shouldn't fail %w", err) + } + err = e.evmClient.WaitForEvents() + if err != nil { + return token, fmt.Errorf("error in waiting for granting mint role %w", err) + } + err = token.Mint(common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), ownerMintingAmount) + if err != nil { + return token, fmt.Errorf("minting tokens shouldn't fail %w", err) + } + } + return token, err +} + func (e *CCIPContractsDeployer) DeployERC20TokenContract(deployerFn blockchain.ContractDeployer) (*ERC20Token, error) { address, _, _, err := e.evmClient.DeployContract("Custom ERC20 Token", deployerFn) if err != nil { @@ -488,6 +525,81 @@ func (e *CCIPContractsDeployer) DeployUSDCTokenPoolContract(tokenAddr string, to } } +func (e *CCIPContractsDeployer) NewMockLBTCTokenPoolContract(addr common.Address) ( + *TokenPool, + error, +) { + version := VersionMap[TokenPoolContract] + e.logger.Info().Str("Version", version.String()).Msg("New Mock LBTC Token Pool") + switch version { + case Latest: + pool, err := mock_lbtc_token_pool.NewMockLBTCTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Mock LBTC Token Pool"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + poolInterface, err := token_pool.NewTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &TokenPool{ + client: e.evmClient, + logger: e.logger, + Instance: &TokenPoolWrapper{ + Latest: &LatestPool{ + PoolInterface: poolInterface, + MockLBTCPool: pool, + }, + }, + EthAddress: addr, + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployMockLBTCTokenPoolContract(tokenAddr string, rmnProxy common.Address, router common.Address, destPoolData []byte) ( + *TokenPool, + error, +) { + e.logger.Println("In DeployMockLBTCTokenPoolContract") + version := VersionMap[TokenPoolContract] + e.logger.Debug().Str("Token", tokenAddr).Msg("Deploying Mock LBTC token pool") + token := common.HexToAddress(tokenAddr) + switch version { + case Latest: + address, _, _, err := e.evmClient.DeployContract("Mock LBTC Token Pool", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return mock_lbtc_token_pool.DeployMockLBTCTokenPool( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + token, + []common.Address{}, + rmnProxy, + router, + destPoolData, + ) + }) + + if err != nil { + return nil, err + } + return e.NewMockLBTCTokenPoolContract(*address) + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr string, rmnProxy common.Address, router common.Address) ( *TokenPool, error, @@ -505,7 +617,7 @@ func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr str auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), token, - 18, + testhelpers.TokenDecimals, []common.Address{}, rmnProxy, true, diff --git a/integration-tests/ccip-tests/contracts/contract_models.go b/integration-tests/ccip-tests/contracts/contract_models.go index 86aafefce62..01245daa966 100644 --- a/integration-tests/ccip-tests/contracts/contract_models.go +++ b/integration-tests/ccip-tests/contracts/contract_models.go @@ -18,6 +18,7 @@ import ( "golang.org/x/exp/rand" "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_lbtc_token_pool" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" @@ -404,6 +405,7 @@ type LatestPool struct { PoolInterface *token_pool.TokenPool LockReleasePool *lock_release_token_pool.LockReleaseTokenPool USDCPool *usdc_token_pool.USDCTokenPool + MockLBTCPool *mock_lbtc_token_pool.MockLBTCTokenPool } type V1_4_0Pool struct { @@ -485,6 +487,7 @@ func (w TokenPoolWrapper) ApplyChainUpdates(opts *bind.TransactOpts, update []to for i, u := range update { V1_4_0Updates[i] = token_pool_1_4_0.TokenPoolChainUpdate{ RemoteChainSelector: u.RemoteChainSelector, + Allowed: true, InboundRateLimiterConfig: token_pool_1_4_0.RateLimiterConfig{ IsEnabled: u.InboundRateLimiterConfig.IsEnabled, Capacity: u.InboundRateLimiterConfig.Capacity, diff --git a/integration-tests/ccip-tests/load/ccip_loadgen.go b/integration-tests/ccip-tests/load/ccip_loadgen.go index d562cce88b2..198db0ef94b 100644 --- a/integration-tests/ccip-tests/load/ccip_loadgen.go +++ b/integration-tests/ccip-tests/load/ccip_loadgen.go @@ -10,28 +10,27 @@ import ( "testing" "time" - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - "github.com/AlekSi/pointer" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" - chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/stretchr/testify/require" "go.uber.org/atomic" + chain_selectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" - - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" ) // CCIPLaneOptimized is a light-weight version of CCIPLane, It only contains elements which are used during load triggering and validation @@ -198,6 +197,7 @@ func (c *CCIPE2ELoad) CCIPMsg() (router.ClientEVM2AnyMessage, *testreporters.Req extraArgs []byte err error ) + // v1.5.0 and later starts using V2 extra args matchErr := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ contracts.OnRampContract: contracts.V1_5_0, }) @@ -225,13 +225,20 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response { res := &wasp.Response{} sourceCCIP := c.Lane.Source var recentRequestFoundAt *time.Time + var latestEvent *types.Log var err error // Use IsPastRequestTriggeredWithinTimeframe to check for any historical CCIP send request events // within the specified timeframe for the first message. Subsequently, use the watcher method to monitor // and detect any new events as they occur. if c.CurrentMsgSerialNo.Load() == int64(1) { - recentRequestFoundAt, err = sourceCCIP.IsPastRequestTriggeredWithinTimeframe(testcontext.Get(c.t), c.SkipRequestIfAnotherRequestTriggeredWithin) + latestEvent, err = sourceCCIP.IsPastRequestTriggeredWithinTimeframe(testcontext.Get(c.t), c.SkipRequestIfAnotherRequestTriggeredWithin) require.NoError(c.t, err, "error while filtering past requests") + if latestEvent != nil { + //nolint:gosec // safe to cast + hdr, err := sourceCCIP.Common.ChainClient.HeaderByNumber(context.Background(), big.NewInt(int64(latestEvent.BlockNumber))) + require.NoError(c.t, err, "error while getting header by block number") + recentRequestFoundAt = pointer.ToTime(hdr.Timestamp) + } } else { recentRequestFoundAt = sourceCCIP.IsRequestTriggeredWithinTimeframe(c.SkipRequestIfAnotherRequestTriggeredWithin) } diff --git a/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go b/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go index 04fcffaa4b1..39e5388244e 100644 --- a/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go +++ b/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go @@ -91,7 +91,7 @@ func NewMultiCallLoadGenerator(testCfg *testsetups.CCIPTestConfig, lanes []*acti testCfg.Test, lane, testCfg.TestGroupInput.PhaseTimeout.Duration(), 100000, testCfg.TestGroupInput.LoadProfile.MsgProfile, 0, - testCfg.TestGroupInput.LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin, + testCfg.TestGroupInput.SkipRequestIfAnotherRequestTriggeredWithin, ) ccipLoad.BeforeAllCall() m.E2ELoads[fmt.Sprintf("%s-%s", lane.SourceNetworkName, lane.DestNetworkName)] = ccipLoad diff --git a/integration-tests/ccip-tests/load/helper.go b/integration-tests/ccip-tests/load/helper.go index 34860c8871c..f89aadc2483 100644 --- a/integration-tests/ccip-tests/load/helper.go +++ b/integration-tests/ccip-tests/load/helper.go @@ -112,8 +112,15 @@ func (l *LoadArgs) scheduleForDest(destNetworkName string) []*wasp.Segment { // if found, use that frequency for the destination network // otherwise, use the default frequency if l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination != nil { + l.lggr.Debug(). + Interface("FrequencyByDestination", l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination). + Msg("LoadProfile provided") for networkName, freq := range l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination { - if strings.Contains(destNetworkName, networkName) { + l.lggr.Debug().Str("Destination", destNetworkName).Str("NetworkName", networkName).Msg("Checking frequency for destination") + if strings.EqualFold(destNetworkName, networkName) { + l.lggr.Info().Str("Destination", destNetworkName). + Ints64("RequestPerUnitTime", freq.RequestPerUnitTime). + Msg("Using frequency for destination") return WaspSchedule( freq.RequestPerUnitTime, l.TestCfg.TestGroupInput.LoadProfile.TestDuration, @@ -269,7 +276,7 @@ func (l *LoadArgs) TriggerLoadByLane() { ccipLoad := NewCCIPLoad( l.TestCfg.Test, lane, l.TestCfg.TestGroupInput.PhaseTimeout.Duration(), 100000, l.TestCfg.TestGroupInput.LoadProfile.MsgProfile, sendMaxData, - l.TestCfg.TestGroupInput.LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin, + l.TestCfg.TestGroupInput.SkipRequestIfAnotherRequestTriggeredWithin, ) ccipLoad.BeforeAllCall() // if it's not multicall set the tokens to nil to free up some space, diff --git a/integration-tests/ccip-tests/smoke/ccip_test.go b/integration-tests/ccip-tests/smoke/ccip_test.go index a74d404db18..344b920f852 100644 --- a/integration-tests/ccip-tests/smoke/ccip_test.go +++ b/integration-tests/ccip-tests/smoke/ccip_test.go @@ -4,16 +4,17 @@ import ( "fmt" "math" "math/big" + "strings" "testing" "time" - "github.com/rs/zerolog" - "github.com/stretchr/testify/assert" - "github.com/AlekSi/pointer" - "github.com/stretchr/testify/require" + "github.com/ethereum/go-ethereum/core/types" + "github.com/rs/zerolog" + "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" @@ -21,10 +22,14 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" ) type testDefinition struct { @@ -245,7 +250,10 @@ func TestSmokeCCIPRateLimit(t *testing.T) { tc.lane.Source.Common.ChainClient.GetDefaultWallet(), src.Common.Router.Address(), src.TransferAmount[0]), ) require.NoError(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) - failedTx, _, _, err := tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + failedTx, _, _, err := tc.lane.Source.SendRequest( + tc.lane.Dest.ReceiverDapp.EthAddress, + big.NewInt(actions.DefaultDestinationGasLimit), + ) require.NoError(t, err) require.Error(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) errReason, v, err := tc.lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) @@ -886,7 +894,7 @@ func TestSmokeCCIPReorgBelowFinality(t *testing.T) { // Test creates above finality reorg at destination and // expects ccip transactions in-flight and the one initiated after reorg -// doesn't go through and verifies f+1 nodes is able to detect reorg. +// doesn't go through and verifies f+1 nodes are able to detect reorg. // Note: LogPollInterval interval is set as 1s to detect the reorg immediately func TestSmokeCCIPReorgAboveFinalityAtDestination(t *testing.T) { utils.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CCIP-4401") @@ -898,7 +906,7 @@ func TestSmokeCCIPReorgAboveFinalityAtDestination(t *testing.T) { // Test creates above finality reorg at destination and // expects ccip transactions in-flight doesn't go through, the transaction initiated after reorg -// shouldn't even get initiated and verifies f+1 nodes is able to detect reorg. +// shouldn't even get initiated and verifies f+1 nodes are able to detect reorg. // Note: LogPollInterval interval is set as 1s to detect the reorg immediately func TestSmokeCCIPReorgAboveFinalityAtSource(t *testing.T) { utils.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CCIP-4401") @@ -908,6 +916,123 @@ func TestSmokeCCIPReorgAboveFinalityAtSource(t *testing.T) { }) } +// TestSmokeCCIPForGivenNetworkPairs is designed specifically for scheduled mainnet testing. This test checks for recent +// transaction and skip the lanes accordingly. This test also has capability to take override input on network pairs and phase timeout. +func TestSmokeCCIPForGivenNetworkPairs(t *testing.T) { + t.Parallel() + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + // override network pairs + var temp []testsetups.NetworkPair + overrideNetworkPairs, err := osutil.GetEnv("OVERRIDE_NETWORK_PAIRS") + require.NoError(t, err, "Error getting OVERRIDE_NETWORK_PAIRS environment variable") + if overrideNetworkPairs != "" { + networkPairs := strings.Split(overrideNetworkPairs, ";") + for _, networkPair := range networkPairs { + // check for any malformed inputs + if !strings.Contains(networkPair, ",") || len(strings.Split(networkPair, ",")) != 2 { + log.Error().Msgf("malformed OVERRIDE_NETWORK_PAIRS environment variable for network pair: %s ", networkPair) + return + } + networkPair = strings.ToUpper(strings.ReplaceAll(networkPair, "_", " ")) + for _, network := range TestCfg.NetworkPairs { + if strings.Contains(networkPair, strings.ToUpper(network.NetworkA.Name)) && strings.Contains(networkPair, strings.ToUpper(network.NetworkB.Name)) { + temp = append(temp, network) + break + } + } + } + log.Info().Int("Pairs", len(temp)).Msg("Number of lanes overridden in the test") + log.Info().Interface("Lanes", networkPairs).Msg("Lanes under test") + TestCfg.NetworkPairs = temp + } + + // phase timeout override + phaseTimeout, err := osutil.GetEnv("OVERRIDE_PHASE_TIMEOUT") + require.NoError(t, err, "Error getting OVERRIDE_PHASE_TIMEOUT environment variable") + if phaseTimeout != "" { + configDuration, err := config.ParseDuration(phaseTimeout) + require.NoError(t, err, "Error parsing phase timeout value") + TestCfg.TestGroupInput.PhaseTimeout = &configDuration + log.Info().Float64("Timeout in minutes", configDuration.Duration().Minutes()).Msg("Phase timeout is overridden") + } + + gasLimit := big.NewInt(*TestCfg.TestGroupInput.MsgDetails.DestGasLimit) + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + log.Error().Msg("No lanes found") + return + } + + t.Cleanup(func() { + // If we are running a test that is a token transfer, we need to verify the balance. + // skip the balance check for existing deployment, there can be multiple external requests in progress for existing deployments + // other than token transfer initiated by the test, which can affect the balance check + // therefore we check the balance only for the ccip environment created by the test + if TestCfg.TestGroupInput.MsgDetails.IsTokenTransfer() && + !pointer.GetBool(TestCfg.TestGroupInput.USDCMockDeployment) && + !pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment) { + setUpOutput.Balance.Verify(t) + } + require.NoError(t, setUpOutput.TearDown(), "error in tear down step") + }) + + var tests []testDefinition + lookBackDuration := TestCfg.TestGroupInput.SkipRequestIfAnotherRequestTriggeredWithin + var recentTxFound *types.Log + + addLanesToTest := func(lane *actions.CCIPLane) { + // Create test definitions for given lane if no previous request has been triggered within the specified timeframe. + // By default, the timeframe is set to nil. To define a timeframe, assign a duration to the variable + // SkipRequestIfAnotherRequestTriggeredWithin. + if lookBackDuration != nil { + recentTxFound, err = lane.Source.IsPastRequestTriggeredWithinTimeframe(lane.Context, lookBackDuration) + require.NoError(t, err, "error while finding recent request for lane network %s to network %s", + lane.SourceNetworkName, lane.DestNetworkName) + } + if recentTxFound == nil { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.SourceNetworkName, lane.DestNetworkName), + lane: lane, + }) + } else { + log.Info(). + Str("TX", recentTxFound.TxHash.Hex()). + Uint64("Block Number", recentTxFound.BlockNumber). + Str("Source", lane.SourceNetworkName). + Str("Dest", lane.DestNetworkName). + Msgf("Lane Skipped. Recent request found within %v minutes.", lookBackDuration.Duration().Minutes()) + } + } + for _, lane := range setUpOutput.Lanes { + addLanesToTest(lane.ForwardLane) + if lane.ReverseLane != nil { + recentTxFound = nil + addLanesToTest(lane.ReverseLane) + } + } + + // Execute tests. + log.Info().Int("Total Lanes", len(tests)).Msg("Starting CCIP test") + for _, test := range tests { + tc := test + t.Run(tc.testName, func(t *testing.T) { + t.Parallel() + tc.lane.Test = t + log.Info(). + Str("Source", tc.lane.SourceNetworkName). + Str("Destination", tc.lane.DestNetworkName). + Msgf("Starting lane %s -> %s", tc.lane.SourceNetworkName, tc.lane.DestNetworkName) + + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, gasLimit) + require.NoError(t, err, "error sending requests") + tc.lane.ValidateRequests() + }) + } +} + // performAboveFinalityReorgAndValidate is to perform the above finality reorg test func performAboveFinalityReorgAndValidate(t *testing.T, network string) { t.Helper() @@ -952,7 +1077,7 @@ func performAboveFinalityReorgAndValidate(t *testing.T, network string) { require.NoError(t, err) for _, d := range resp.Data { if d.Attributes.Name == logPollerName && d.Attributes.Output == "finality violated" && d.Attributes.Status == "failing" { - log.Debug().Msg("Finality violated is detected by node") + log.Debug().Str("Node", node.ChainlinkClient.URL()).Msg("Finality violated is detected by node") nodesDetectedViolation[node.ChainlinkClient.URL()] = true } } diff --git a/integration-tests/ccip-tests/testconfig/README.md b/integration-tests/ccip-tests/testconfig/README.md index d614ed62ea4..9a9fa5129b1 100644 --- a/integration-tests/ccip-tests/testconfig/README.md +++ b/integration-tests/ccip-tests/testconfig/README.md @@ -10,7 +10,7 @@ The test config is read in following order: - The config mentioned in this file will override the default config. - Example override file - [override.toml.example](./examples/override.toml.example) - If there are sensitive details like private keys, credentials in test config, they can be specified in a separate dotenv file as env vars - - The `~/.testsecrets` file in home directory is automatically loaded and should have all test secrets as env vars + - The `~/.testsecrets` file in home directory is automatically loaded and should have all test secrets as env vars. Learn more about it [here](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md#test-secrets) - Example secret file - [.testsecrets.example](./examples/.testsecrets.example) ## CCIP.ContractVersions @@ -110,7 +110,7 @@ Or, DataFile = '' ``` -## CCIP.Env +## CCIP.Env Specifies the environment details for the test to be run on. Mandatory fields are: @@ -119,14 +119,7 @@ Mandatory fields are: - **NewCLCluster**: [CCIP.Env.NewCLCluster](#ccipenvnewclcluster) - This is mandatory if the test needs to deploy Chainlink nodes. - **ExistingCLCluster**: [CCIP.Env.ExistingCLCluster](#ccipenvexistingclcluster) - This is mandatory if the test needs to run on existing Chainlink nodes to deploy ccip jobs. -Test needs network/chain details to be set through configuration. This configuration is mandatory for running the tests. -you have option to set the network details in two ways: - -1. Using [CCIP.Env.Networks](#ccipenvnetworks) -2. Using a separate network config file - - - refer to the example - [network_config.toml.example](./examples/network_config.toml.example) - - once all necessary values are set, encode the toml file content in base64 format, - - set the base64'ed string content in `BASE64_NETWORK_CONFIG` environment variable. +Test needs network/chain details to be set through configuration. Set network urls in ~/.testsecrets [see docs](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md#test-secrets). ### CCIP.Env.Networks @@ -146,7 +139,7 @@ If the network is not present in known_networks, then the network details can be #### CCIP.Env.Network.EVMNetworks -Specifies the network config to be used while creating blockchain EVMClient for test. +Specifies the network config to be used while creating blockchain EVMClient for test. It is a map of network name to EVMNetworks where key is network name specified under `CCIP.Env.Networks.selected_networks` and value is `EVMNetwork`. The EVMNetwork is imported from [EVMNetwork](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/blockchain/config.go#L43) in chainlink-testing-framework. @@ -638,6 +631,13 @@ Specifies the OCR parameters for the execute job. This is only valid if the test Specifies the value for the `InflightExpiry` in commit job's offchain config. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). +### CCIP.Groups.[testgroup].SkipRequestIfAnotherRequestTriggeredWithin + +If there is CCIP Send requested event present within this duration, the test will skip sending another +request during load run or avoid sending request in smoke test in that lane. For Example, +if `SkipRequestIfAnotherRequestTriggeredWithin` is set to `40m`, and a request is triggered at 0th second, the test will skip sending another request for another 40m. +This particular field is used to avoid sending transaction when there is traffic already in that lane. + ### CCIP.Groups.[testgroup].OffRampConfig Specifies the offramp configuration for the execution job. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). @@ -717,11 +717,6 @@ Specifies the duration network delay used for `NetworkChaos` experiment. This is If there are multiple chaos experiments, this specifies the duration to wait between each chaos experiment. This is only valid if the test is run on k8s and not on [existing deployments](#ccipgroupstestgroupexistingdeployment). -#### CCIP.Groups.[testgroup].LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin - -If a request is triggered within this duration, the test will skip sending another request during load run. For Example, if `SkipRequestIfAnotherRequestTriggeredWithin` is set to `40m`, and a request is triggered at 0th second, the test will skip sending another request for another 40m. -This particular field is used to avoid sending multiple requests in a short duration during load run. - #### CCIP.Groups.[testgroup].LoadProfile.OptimizeSpace This is used internally to optimize memory usage during load run. If set to true, after the initial lane set up is over the test will discard the lane config to save memory. @@ -802,4 +797,4 @@ DataLength = 10000 MsgType = 'Data' DestGasLimit = 2500000 DataLength = 10000 -``` \ No newline at end of file +``` diff --git a/integration-tests/ccip-tests/testconfig/ccip.go b/integration-tests/ccip-tests/testconfig/ccip.go index 0a53ee18732..c77b2c3a33e 100644 --- a/integration-tests/ccip-tests/testconfig/ccip.go +++ b/integration-tests/ccip-tests/testconfig/ccip.go @@ -1,6 +1,7 @@ package testconfig import ( + "errors" "fmt" "math/big" "os" @@ -211,19 +212,18 @@ type LoadFrequency struct { } type LoadProfile struct { - MsgProfile *MsgProfile `toml:",omitempty"` - FrequencyByDestination map[string]*LoadFrequency `toml:",omitempty"` - RequestPerUnitTime []int64 `toml:",omitempty"` - TimeUnit *config.Duration `toml:",omitempty"` - StepDuration []*config.Duration `toml:",omitempty"` - TestDuration *config.Duration `toml:",omitempty"` - NetworkChaosDelay *config.Duration `toml:",omitempty"` - WaitBetweenChaosDuringLoad *config.Duration `toml:",omitempty"` - SkipRequestIfAnotherRequestTriggeredWithin *config.Duration `toml:",omitempty"` - OptimizeSpace *bool `toml:",omitempty"` - FailOnFirstErrorInLoad *bool `toml:",omitempty"` - SendMaxDataInEveryMsgCount *int64 `toml:",omitempty"` - TestRunName string `toml:",omitempty"` + MsgProfile *MsgProfile `toml:",omitempty"` + FrequencyByDestination map[string]*LoadFrequency `toml:",omitempty"` + RequestPerUnitTime []int64 `toml:",omitempty"` + TimeUnit *config.Duration `toml:",omitempty"` + StepDuration []*config.Duration `toml:",omitempty"` + TestDuration *config.Duration `toml:",omitempty"` + NetworkChaosDelay *config.Duration `toml:",omitempty"` + WaitBetweenChaosDuringLoad *config.Duration `toml:",omitempty"` + OptimizeSpace *bool `toml:",omitempty"` + FailOnFirstErrorInLoad *bool `toml:",omitempty"` + SendMaxDataInEveryMsgCount *int64 `toml:",omitempty"` + TestRunName string `toml:",omitempty"` } func (l *LoadProfile) Validate() error { @@ -242,9 +242,6 @@ func (l *LoadProfile) Validate() error { if l.TestDuration == nil || l.TestDuration.Duration().Minutes() == 0 { return fmt.Errorf("test duration should be set") } - if l.SkipRequestIfAnotherRequestTriggeredWithin != nil && l.TimeUnit.Duration() < l.SkipRequestIfAnotherRequestTriggeredWithin.Duration() { - return fmt.Errorf("SkipRequestIfAnotherRequestTriggeredWithin should be set below the TimeUnit duration") - } return nil } @@ -265,35 +262,38 @@ func (gp *ReorgProfile) Validate() error { // CCIPTestGroupConfig defines configuration input to change how a particular CCIP test group should run type CCIPTestGroupConfig struct { - Type string `toml:",omitempty"` - KeepEnvAlive *bool `toml:",omitempty"` - BiDirectionalLane *bool `toml:",omitempty"` - CommitAndExecuteOnSameDON *bool `toml:",omitempty"` - AllowOutOfOrder *bool `toml:",omitempty"` // To set out of order execution globally - NoOfCommitNodes int `toml:",omitempty"` - MsgDetails *MsgDetails `toml:",omitempty"` - TokenConfig *TokenConfig `toml:",omitempty"` - MulticallInOneTx *bool `toml:",omitempty"` - NoOfSendsInMulticall int `toml:",omitempty"` - PhaseTimeout *config.Duration `toml:",omitempty"` - LocalCluster *bool `toml:",omitempty"` - ExistingDeployment *bool `toml:",omitempty"` - ReuseContracts *bool `toml:",omitempty"` - NodeFunding float64 `toml:",omitempty"` - NetworkPairs []string `toml:",omitempty"` - DenselyConnectedNetworkChainIds []string `toml:",omitempty"` - NoOfNetworks int `toml:",omitempty"` - NoOfRoutersPerPair int `toml:",omitempty"` - MaxNoOfLanes int `toml:",omitempty"` - ChaosDuration *config.Duration `toml:",omitempty"` - USDCMockDeployment *bool `toml:",omitempty"` - CommitOCRParams *contracts.OffChainAggregatorV2Config `toml:",omitempty"` - ExecOCRParams *contracts.OffChainAggregatorV2Config `toml:",omitempty"` - OffRampConfig *OffRampConfig `toml:",omitempty"` - CommitInflightExpiry *config.Duration `toml:",omitempty"` - StoreLaneConfig *bool `toml:",omitempty"` - LoadProfile *LoadProfile `toml:",omitempty"` - ReorgProfile *ReorgProfile `toml:",omitempty"` + Type string `toml:",omitempty"` + KeepEnvAlive *bool `toml:",omitempty"` + BiDirectionalLane *bool `toml:",omitempty"` + CommitAndExecuteOnSameDON *bool `toml:",omitempty"` + AllowOutOfOrder *bool `toml:",omitempty"` // To set out of order execution globally + NoOfCommitNodes int `toml:",omitempty"` + MsgDetails *MsgDetails `toml:",omitempty"` + TokenConfig *TokenConfig `toml:",omitempty"` + MulticallInOneTx *bool `toml:",omitempty"` + NoOfSendsInMulticall int `toml:",omitempty"` + PhaseTimeout *config.Duration `toml:",omitempty"` + LocalCluster *bool `toml:",omitempty"` + ExistingDeployment *bool `toml:",omitempty"` + ReuseContracts *bool `toml:",omitempty"` + NodeFunding float64 `toml:",omitempty"` + NetworkPairs []string `toml:",omitempty"` + DenselyConnectedNetworkChainIDs []string `toml:",omitempty"` + NoOfNetworks int `toml:",omitempty"` + NoOfRoutersPerPair int `toml:",omitempty"` + MaxNoOfLanes int `toml:",omitempty"` + ChaosDuration *config.Duration `toml:",omitempty"` + USDCMockDeployment *bool `toml:",omitempty"` + LBTCMockDeployment *bool `toml:",omitempty"` + LBTCDestPoolDataAs32Bytes *bool `toml:",omitempty"` + CommitOCRParams *contracts.OffChainAggregatorV2Config `toml:",omitempty"` + ExecOCRParams *contracts.OffChainAggregatorV2Config `toml:",omitempty"` + OffRampConfig *OffRampConfig `toml:",omitempty"` + CommitInflightExpiry *config.Duration `toml:",omitempty"` + StoreLaneConfig *bool `toml:",omitempty"` + LoadProfile *LoadProfile `toml:",omitempty"` + ReorgProfile *ReorgProfile `toml:",omitempty"` + SkipRequestIfAnotherRequestTriggeredWithin *config.Duration `toml:",omitempty"` } func (c *CCIPTestGroupConfig) Validate() error { @@ -310,6 +310,11 @@ func (c *CCIPTestGroupConfig) Validate() error { return fmt.Errorf("test run name should be set if existing deployment is true and test is running in k8s") } } + if c.ReorgProfile != nil { + if err := c.ReorgProfile.Validate(); err != nil { + return err + } + } } err := c.MsgDetails.Validate() if err != nil { @@ -336,6 +341,10 @@ func (c *CCIPTestGroupConfig) Validate() error { return fmt.Errorf("number of sends in multisend should be greater than 0 if multisend is true") } } + if c.SkipRequestIfAnotherRequestTriggeredWithin != nil && c.LoadProfile != nil && + c.LoadProfile.TimeUnit.Duration() < c.SkipRequestIfAnotherRequestTriggeredWithin.Duration() { + return errors.New("SkipRequestIfAnotherRequestTriggeredWithin should be set below the load TimeUnit duration") + } return nil } diff --git a/integration-tests/ccip-tests/testconfig/override/mainnet.toml b/integration-tests/ccip-tests/testconfig/override/mainnet.toml index f723411eafc..cb83da28cb3 100644 --- a/integration-tests/ccip-tests/testconfig/override/mainnet.toml +++ b/integration-tests/ccip-tests/testconfig/override/mainnet.toml @@ -1,10 +1,10 @@ [CCIP] [CCIP.ContractVersions] -PriceRegistry = '1.2.0' -OffRamp = '1.2.0' -OnRamp = '1.2.0' -TokenPool = '1.4.0' -CommitStore = '1.2.0' +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +TokenPool = 'latest' +CommitStore = 'latest' [CCIP.Deployments] Data = """ @@ -19,114 +19,114 @@ Data = """ "wrapped_native": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", "src_contracts": { "Avalanche Mainnet": { - "on_ramp": "0x05B723f3db92430FbE4395fD03E40Cc7e9D17988", + "on_ramp": "0xe80cC83B895ada027b722b78949b296Bd1fC5639", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0x79f3ABeCe5A3AFFf32D47F4CFe45e7b65c9a2D91", + "on_ramp": "0x14bF7b1Ca6b843f386bfDfa76BFd439919b9378D", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x77b60F85b25fD501E3ddED6C1fe7bF565C08A22A", + "on_ramp": "0xc1b6287A3292d6469F2D8545877E40A2f75CA9a6", "deployed_at": 0 }, "Blast Mainnet": { - "on_ramp": "0x54480425E9e24138fdF1644a1F70007F25abfB46", + "on_ramp": "0xc5490997680a39A1b4684ce2b668AE8A2eBEC7ee", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xCe11020D56e5FDbfE46D9FC3021641FfbBB5AdEE", + "on_ramp": "0x67761742ac8A21Ec4D76CA18cbd701e5A6F3Bef3", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0x1216DC856Af47a833254a280A038185F51C1B5c4", + "on_ramp": "0xc7d6B885d8A4286E6311F79227430b7862311cd3", "deployed_at": 0 }, "Metis Andromeda": { - "on_ramp": "0x5b23A0a103fC9028363B3BC3577e8Bd45B8E819F", + "on_ramp": "0xF1e73c37CDa8E47768De2246AEf5eFD4d76330ae", "deployed_at": 0 }, "Mode Mainnet": { - "on_ramp": "0x3920BF474BB50fffb4B77c1e6e66F65210D1D722", + "on_ramp": "0xd236ea4DDE7de1e594021764E2f6Cd8e8cD7F047", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0xC09b72E8128620C40D89649019d995Cc79f030C3", + "on_ramp": "0xAFECc7b67c6a8e606e94ce4e2F70D83C2206C2cb", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x122F05F49e90508F089eE8D0d868d1a4f3E5a809", + "on_ramp": "0x6087d6C33946670232DF09Fe93eECbaEa3D6864d", "deployed_at": 0 }, "WeMix Mainnet": { - "on_ramp": "0x66a0046ac9FA104eB38B04cfF391CcD0122E6FbC", + "on_ramp": "0x52e51f245e600C6A87Ef2090d607D2a0eAedA1a6", "deployed_at": 0 }, "ZKSync Mainnet": { - "on_ramp": "0x2C1016053d9873270d71613cA321aE97Fc89201d", + "on_ramp": "0xd67F6713Fa4448548c984a9a7DCFBD13B0fB78D6", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Mainnet": { - "off_ramp": "0xe0109912157d5B75ea8b3181123Cf32c73bc9920", - "commit_store": "0xDaa61b8Cd85977820f92d1e749E1D9F55Da6CCEA", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x95095007d5Cc3E7517A1A03c9e228adA5D0bc376", + "commit_store": "0x46679C9E93B7312A9191A9aD12A73b0c86A33623", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0xB1b705c2315fced1B38baE463BE7DDef531e47fA", - "commit_store": "0x310cECbFf14Ad0307EfF762F461a487C1abb90bf", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x16B9709F8A23B9EB922E8Dde7EaB1Ede7C79F663", + "commit_store": "0x6c3fD63b9BdE38C414530727a5De858ca023cFc4", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0xdB19F77F87661f9be0F557cf9a1ebeCf7D8F206c", - "commit_store": "0x6e37f4c82d9A31cc42B445874dd3c3De97AB553f", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xb62178f8198905D0Fa6d640Bdb188E4E8143Ac4b", + "commit_store": "0x8F60C335a5d2BEC6B32867d3C05C377E88640AaF", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Blast Mainnet": { - "off_ramp": "0x449C59F4Ef3b1802DD054dd7837Eb2Ca91aFAB84", - "commit_store": "0x1E0e8B01693A248b3Aa1e5aca36336F9022Ceac0", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x40314FeC27C5FCc7AaA05e618802A3fEA8E23Ae3", + "commit_store": "0xe7C1904E00BAf5Ca61926da0d1d2B036f14A3ad8", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0x542ba1902044069330e8c5b36A84EC503863722f", - "commit_store": "0x060331fEdA35691e54876D957B4F9e3b8Cb47d20", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x91e46cc5590A4B9182e47f40006140A7077Dec31", + "commit_store": "0x86be76A0FA2bD3ECB69330cBb4fd1f62c48F43E3", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0x0C00414D9dcDB2DA7BF8AF26aE2deb617f09e756", - "commit_store": "0x1d464cd86c5C8358d56281aB31d2213534CCEA13", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xeE53872d1C695933B34cE0a11B58613CBBf37e20", + "commit_store": "0x5D88518a198b99F096d2893092a568A97F60B8d4", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Metis Andromeda": { - "off_ramp": "0xeF8dEb0c01f7389AD4ae05DAB30120dba915D53c", - "commit_store": "0xE594a09Aa8bCb55188758826A160615B95A6F3fE", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xF1A4DE22FF792b0457306C39f4CB5822Ab47bdAE", + "commit_store": "0x7F20F4374f8d99201F22434ad59f96bE898A9E0B", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Mode Mainnet": { - "off_ramp": "0xEDE7ADACFbD27DBEBbE2d6C3BaDf12a634a72Faa", - "commit_store": "0x032B209a6B7a00336047505b55a4cBFBd29eE2c1", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xa964355d8eBa62E9b043Eb27eEe6d999Ecc69429", + "commit_store": "0x72C3cdA94eCAC06f7605301dd7144815C2F05A03", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xeeed4D86F3E0e6d32A6Ad29d8De6A0Dc91963A5f", - "commit_store": "0xbbB563c4d98020b9c0f3Cc34c2C0Ef9676806E35", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x27a971D482335d0f8d1917451390734f7372A4a3", + "commit_store": "0x6642E640321e1Ad01eef2fC2ad5427D84A2Ee269", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x9bDA7c8DCda4E39aFeB483cc0B7E3C1f6E0D5AB1", - "commit_store": "0x63a0AeaadAe851b990bBD9dc41f5C1B08b32026d", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xcabc2D71dC3172a154A5A34cD706B050e0ef9b6f", + "commit_store": "0x78B15A57889200F246fc52790c4F3DfC37d82Aa2", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "WeMix Mainnet": { - "off_ramp": "0xEEf5Fb4c4953F9cA9ab1f25cE590776AfFc2c455", - "commit_store": "0xD268286A277095a9C3C90205110831a84505881c", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x893c14bA328A49336a188F972f997C0d7286B8E4", + "commit_store": "0xc986D260b096E8708D82063309fB98734481A045", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "ZKSync Mainnet": { - "off_ramp": "0x50Fc0de671c775301e1Bdf19C17E778D0f978f6F", - "commit_store": "0x87732C2647168818ED49268EdA8A98C2e62ed744", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x052CF0c46375287255c71B179b10a7BFFD97502F", + "commit_store": "0xE19E9765857A2371d849FDd26D62D2463fb7a0a9", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -135,82 +135,82 @@ Data = """ "fee_token": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", "arm": "0x4f6Ec25f06A114ADD3154DC17fb637F750AdaA31", "router": "0xF4c7E640EdA248ef95972845a62bdC74237805dB", - "price_registry": "0x2d3b38E0a4DFFDad2A613f7760bE1683F272eA18", + "price_registry": "0xfA4edD04eaAcDB07c8D73621bc1790eC50D8c489", "wrapped_native": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x98f51B041e493fc4d72B8BD33218480bA0c66DDF", + "on_ramp": "0x4e910c8Bbe88DaDF90baa6c1B7850DbeA32c5B29", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0x8eaae6462816CB4957184c48B86afA7642D8Bf2B", + "on_ramp": "0xe6e161d55019AA5960DcF0Af9bB6e4d574C69F99", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x268fb4311D2c6CB2bbA01CCA9AC073Fb3bfd1C7c", + "on_ramp": "0x139D4108C23e66745Eda4ab47c25C83494b7C14d", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xD0701FcC7818c31935331B02Eb21e91eC71a1704", + "on_ramp": "0xe8784c29c583C52FA89144b9e5DD91Df2a1C2587", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0xBd0B9317F6AaA1085993F7b4CD468dE7A6428722", + "on_ramp": "0x38fd0DF16F6fD0a2C3Ec6615c73e50F5d027b8bA", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x8629008887E073260c5434D6CaCFc83C3001d211", + "on_ramp": "0x3e3b4Fba004E7824219e79aE9f676d9D41A216Fa", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x97500490d9126f34cf9aA0126d64623E170319Ef", + "on_ramp": "0x5570a4E979d7460F13b84075ACEF69FAc73914b1", "deployed_at": 0 }, "WeMix Mainnet": { - "on_ramp": "0x9b1ed9De069Be4d50957464b359f98eD0Bf34dd5", + "on_ramp": "0x1DA12512f852DAaba7883340A4074FfB73FA8f21", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x770b1375F86E7a9bf30DBe3F97bea67193dC9135", - "commit_store": "0x23E2b34Ce8e12c53f8a39AD4b3FFCa845f8E617C", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x508Ea280D46E4796Ce0f1Acf8BEDa610c4238dB3", + "commit_store": "0x20bEde74Da64C9aE47FFDf4B87613752CD13bE5D", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x83F53Fc798FEbfFbdF84830AD403b9989187a06C", - "commit_store": "0xD8ceCE2D7794385E00Ce3EF94550E732b0A0B959", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x6CDAa2711BdF0B719911BF00588A79FA97bf9264", + "commit_store": "0x4c05E7AB694C602De3135e025aEc7F7de06E80F7", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0x4d6A796Bc85dcDF41ce9AaEB50B094C6b589748f", - "commit_store": "0xc4C4358FA01a04D6c6FE3b96a351946d4c2715C2", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x37879EBFCb807f8C397fCe2f42DC0F5329AD6823", + "commit_store": "0xDe615EEaD232BEECF6c9b71c293A387B97814E8D", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0x5B833BD6456c604Eb396C0fBa477aD49e82B1A2a", - "commit_store": "0x23E23958D220B774680f91c2c91a6f2B2f610d7e", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xE5F21F43937199D4D57876A83077b3923F68EB76", + "commit_store": "0xf0F791901854fAb16adeBd60F0639b960B6ea0CF", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0xDE7ebf1Dc753D916A9fbEC4ae521Ee74EC2d0B5f", - "commit_store": "0x2dbc917b4DD455532015949c3103B64fcDB891b2", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x1181A59FF0BAEd1E0EA77e919185cB8C3D5D3125", + "commit_store": "0x60b2Bc7858D6296D8c4370E35a930E5ddF13085E", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xb68A3EE8bD0A09eE221cf1859Dd5a4d5765188Fe", - "commit_store": "0x83DCeeCf822981F9F8552925eEfd88CAc1905dEA", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x376C0AFC9E64efE0d9202E1F02c3d7f9Dc15e404", + "commit_store": "0xF8728f8Cd9C809287e6a97B71A2cdfD2c3C034cE", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x19250aBE66B88F214d02B6f3BF80F4118290C619", - "commit_store": "0x87A0935cE6254dB1252bBac90d1D07D04846aDCA", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xFf49E35626Eba28Bee1d251782AB75A6cEd91c45", + "commit_store": "0xee2570De22C0D07d0FaBC1169dC5EcA342B838Da", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "WeMix Mainnet": { - "off_ramp": "0x317dE8bc5c3292E494b6496586696d4966A922B0", - "commit_store": "0x97Fbf3d6DEac16adC721aE9187CeEa1e610aC7Af", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xFA5CF1bBFe0Ba5c01e60513EF8960945A99B78A4", + "commit_store": "0x671c83B1Ebe798bfC625E99Be0FF7C48F6E4C491", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -219,100 +219,100 @@ Data = """ "fee_token": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", "arm": "0x56491A98199aD2e687Ea9D0cFB7b4AC57B4980Fc", "router": "0x34B03Cb9086d7D758AC55af71584F81A598759FE", - "price_registry": "0x18C3D917D55Bc1784a3d4729AA3e2C1ecd662fFd", + "price_registry": "0xd64aAbD70A71d9f0A00B99F6EFc1626aA2dD43C7", "wrapped_native": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x2788b46BAcFF49BD89562e6bA5c5FBbbE5Fa92F7", + "on_ramp": "0x5577c19bD183e39a007ce4CE236f1D91e9132D5c", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0x6aa72a998859eF93356c6521B72155D355D0Cfd2", + "on_ramp": "0x43F00dBf0Aa61A099c674A74FBdCb93786564950", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x70bC7f7a6D936b289bBF5c0E19ECE35B437E2e36", + "on_ramp": "0xdABb6De5eC48dd2fcF28ac85CbEFe3F19E03F1BD", "deployed_at": 0 }, "Blast Mainnet": { - "on_ramp": "0x02082b23D35d2670B8a636A431F3C30AF9d21e07", + "on_ramp": "0x0b7Bfe549F26AF4B6aA5246CB3FD96C8a5c23a68", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0x0Bf40b034872D0b364f3DCec04C7434a4Da1C8d9", + "on_ramp": "0x35C724666ba31632A56Bad4390eb69f206ab60C7", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0xAc9fE4179816077674d769698306CE6A7C6A1096", + "on_ramp": "0x83AC865c2E18f2CDc1d10126987FfC465e11c0DF", "deployed_at": 0 }, "Mode Mainnet": { - "on_ramp": "0x4A83dA46c148AB5941a379b4cA49f42d14281C78", + "on_ramp": "0x9d4d125788A548C2f69fAC7f8C3A64FA21d18C9e", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x4FEB11A454C9E8038A8d0aDF599Fe7612ce114bA", + "on_ramp": "0x3A3649852A518ab180f41f28288c6c9184563616", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x6bD4754D86fc87FE5b463D368f26a3587a08347c", + "on_ramp": "0x1C88e3Fd2B0a8735D1b19A77AA6e2333555BB95c", "deployed_at": 0 }, "WeMix Mainnet": { - "on_ramp": "0x1467fF8f249f5bc604119Af26a47035886f856BE", + "on_ramp": "0x9BaFC5E78C0051c7Bcd1EF37FF02fcBd31B37a72", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x3DA330fd8Ef10d93cFB7D4f8ecE7BC1F10811feC", - "commit_store": "0x86D55Ff492cfBBAf0c0D42D4EE615144E78b3D02", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x2A9C65afF39758CeAa24dBD1ACd1BeB3618e6780", + "commit_store": "0x99C7C97Ed175A3f0BFd4f52526E7B1310bB3fc16", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0x37a6fa55fe61061Ae97bF7314Ae270eCF71c5ED3", - "commit_store": "0x1f558F6dcf0224Ef1F78A24814FED548B9602c80", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xc69a550470bEbC5c3Be98A4C3dD26C6AdD90C64b", + "commit_store": "0x49FeF2978569E8061a7CA5cC676d46970613e9D0", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0x574c697deab06B805D8780898B3F136a1F4892Dc", - "commit_store": "0x002B164b1dcf4E92F352DC625A01Be0E890EdEea", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x133672C0F0067573254dd7C8C9818a37d6208610", + "commit_store": "0xEc44EFcf3E0aC801C742e444B130918a5a3A87E9", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Blast Mainnet": { - "off_ramp": "0x6500EDFBD27d34b7B69D0D45865ddaC4A1ceafE1", - "commit_store": "0x3A328B3fA852409415c15271442EFE4c77C04992", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x38cA434FE65D540942A36c84FdFD4B7C7a9a4612", + "commit_store": "0xF70409dC69Bc50aA30b001d45C7F9E2C706Ad387", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0x181Bb1E97b0bDD1D85E741ad0943552D3682cc35", - "commit_store": "0x3fF27A34fF0FA77921C3438e67f58da1a83e9Ce1", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xF616733641D420207b8F30db9C4cE39684768991", + "commit_store": "0x7aa39A9c9D539b5E7388872a193b3447D34bf11F", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0xBE9b0cc569E970dAb953d336c670fc6b7c856c19", - "commit_store": "0xEe89CC6C2236d3b99C2D9c0b3b911690F757FadF", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x53AF5cE4534C39582E6a5E3fD77946E0c3BFe870", + "commit_store": "0xe7a0Ffc182E2330d19fF79adEEC637094c02dcA3", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Mode Mainnet": { - "off_ramp": "0x6C702159daA4DEbae32E294c584B1EaF2356cB1A", - "commit_store": "0x73C8d1E9e240331E3345c6fBe6CDFC71B742B69C", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xFc2278eBc27B9d205e3DC9F1b88D6D863D71190D", + "commit_store": "0x92eeb265F465Aff3AE708117ba7aE35279227845", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xE7E080C8d62d595a223C577C7C8d1f75d9A5E664", - "commit_store": "0xF4d53346bDb6d393C74B0B72Aa7D6689a3eAad79", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x3c5E62cdFD08e23a0961ff2A3155CaBb96cbc89D", + "commit_store": "0xDC39E05264D0C17eD16F2Db363364B127Cf56d75", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x26af2046Da85d7f6712D5edCa81B9E3b2e7A60Ab", - "commit_store": "0x4C1dA405a789AC2853A69D8290B8B9b47a0374F8", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x21159ebdA3E6A2437bCD6ef39853042ACC436D2D", + "commit_store": "0x018Bb120265672C699969a9e2193755d4CF1ca16", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "WeMix Mainnet": { - "off_ramp": "0xC027C5AEb230008c243Be463A73571e581F94c13", - "commit_store": "0x2EB426C8C54D740d1FC856eB3Ff96feA03957978", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x512CA54a0F6447AC41c07Da3336DFcA042D88A7B", + "commit_store": "0xae79C737801b04ECA277d50FDeaC4006C3725F62", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -321,91 +321,91 @@ Data = """ "fee_token": "0x4200000000000000000000000000000000000006", "arm": "0x91cB19E7c4Ba9B08CF544cDc9143042150B007C3", "router": "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD", - "price_registry": "0x1bA15c57c8b74cD32443D7583E7f6d7c638aCf46", + "price_registry": "0x6337a58D4BD7Ba691B66341779e8f87d4679923a", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x1E5Ca70d1e7A1B26061125738a880BBeA42FeB21", + "on_ramp": "0x9D0ffA76C7F82C34Be313b5bFc6d42A72dA8CA69", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0xBE5a9E336D9614024B4Fa10D8112671fc9A42d96", + "on_ramp": "0x4be6E0F97EA849FF80773af7a317356E6c646FD7", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0xdd4Fb402d41Beb0eEeF6CfB1bf445f50bDC8c981", + "on_ramp": "0xE5FD5A0ec3657Ad58E875518e73F6264E00Eb754", "deployed_at": 0 }, "Blast Mainnet": { - "on_ramp": "0xCCC32e2794EaD73f0a0a514Ac1c78D048968ab81", + "on_ramp": "0x9A59832b85217C20b17a990A45BD5d0F3de36266", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xDEA286dc0E01Cb4755650A6CF8d1076b454eA1cb", + "on_ramp": "0x56b30A0Dcd8dc87Ec08b80FA09502bAB801fa78e", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0xcDD0e963E0708a4E936202396983E458cFA4A363", + "on_ramp": "0xDcFB24AEbcB9Edfb6746a045DDcae402381F984B", "deployed_at": 0 }, "Mode Mainnet": { - "on_ramp": "0x626aCCbDDD73532df1caEDb5628Fdc40C5f429Ba", + "on_ramp": "0xEB50Fc6F57AAc6bf060A2Dfc6479fED592e6e184", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0xd952FEAcDd5919Cc5E9454b53bF45d4E73dD6457", + "on_ramp": "0x362E6bE957c18e268ad91046CA6b47EB09AD98C1", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x3DB8Bea142e41cA3633890d0e5640F99a895D6A5", + "on_ramp": "0xd3Bde678BB706Cf727A512515C254BcF021dD203", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x8531E63aE9279a1f0D09eba566CD1b092b95f3D5", - "commit_store": "0x327E13f54c7871a2416006B33B4822eAAD357916", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x7D38c6363d5E4DFD500a691Bc34878b383F58d93", + "commit_store": "0x17891fe60a577c5E1e4a4Ddd78E642428A56039f", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0x8345F2fF67e5A65e85dc955DE1414832608E00aD", - "commit_store": "0xd0b13be4c53A6262b47C5DDd36F0257aa714F562", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x61C3f6d72c80A3D1790b213c4cB58c3d4aaFccDF", + "commit_store": "0x700C6715734111a6D1Cf414F46D85627b298B5dd", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x48a51f5D38BE630Ddd6417Ea2D9052B8efc91a18", - "commit_store": "0xF97127e77252284EC9D4bc13C247c9D1A99F72B0", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x45d524b6Fe99C005C52C65c578dc0e02d9751083", + "commit_store": "0x1ccD0D49e283789a73E882B0ED4B5b1163675c3C", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Blast Mainnet": { - "off_ramp": "0x15F54FDd37ccC8E5a0b64633C95Ef8209Fd86401", - "commit_store": "0x52b5b4f3Cc50E38f736f23897f192430E131ccB8", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x941F0E2E0556aCf60fE0f09972f599d9F8916F01", + "commit_store": "0x575F920e3ef294EA80efB1A4C815EF4B8a67878F", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0xEC0cFe335a4d53dBA70CB650Ab56eEc32788F0BB", - "commit_store": "0x0ae3c2c7FB789bd05A450CD3075D11f6c2Ca4F77", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xCA04169671A81E4fB8768cfaD46c347ae65371F1", + "commit_store": "0xb40659aACb709D1D54c80FC0d38b15705358Ce0B", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0xA24D3Bc3A59798a57AF58f69c89DC1C8aFD78F18", - "commit_store": "0x672dbdC3aF7eE37436fe101531D33266D85F33c9", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x300977dBA924af14E166B31F4926892B1f310661", + "commit_store": "0x932D6D5c6647e6495Ed3473ff0F4e31a6056D837", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Mode Mainnet": { - "off_ramp": "0xFC30bFe46b11D4E25C6f7492fd064A70FbF18848", - "commit_store": "0xaeDBe55633F74A291F0A43Daa0Fd719615b78363", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x639Dc04368006544eba7CbC959f3e4361bfEAB0d", + "commit_store": "0x2D3FC7f8b03718157359266ac06AF6373aFee2f1", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xf50c0d2a8B6Db60f1D93E60f03d0413D56153E4F", - "commit_store": "0x16f72C15165f7C9d74c12fDF188E399d4d3724e4", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x18095fbD53184A50C2BB3929a6c62Ca328732062", + "commit_store": "0xa8FA8aE51dB9661e7D1c21141d967d07110036cb", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x75F29f058b31106F99caFdc17c9b26ADfcC7b5D7", - "commit_store": "0xb719616E732581B570232DfB13Ca49D27667Af9f", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x74d574D11977fC8D40f8590C419504cbE178ADB7", + "commit_store": "0x565f70396Ff82C23d25Dd3E57A9A66367dccdF3B", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -418,42 +418,42 @@ Data = """ "wrapped_native": "0x4300000000000000000000000000000000000004", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x42E1f5f5ACCe6e4971D9B9468D7A9Abed8D69DdD", + "on_ramp": "0x28f7E57cEE31241B4B8B72e6b710c4dC2e9bEb28", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0x9c98d7aE731b0A53bedffBc1a12d9d43501Ea464", + "on_ramp": "0x01D1A2Ed2053e410177f8E762aF635ee78b7a581", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x955f139225F5d7021EB911ED2787a795f71E5eb6", + "on_ramp": "0xAbBC1fC0C919ecFb0220e90749111e0619abf79A", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xBD9bf9AA79adF083BB7100848Eb15F4e8282E27e", + "on_ramp": "0xEa8112530cA10945C2aA976f8F615582Af9B70fa", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x01A38cd2da195C704bA192fCCDddd8986cb7EdE9", - "commit_store": "0xab6D69db1C1E9B97a26eB3983b0878AdeD248200", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x8e4E966a3f6b3aB56185800a2afFe75CCf7B4DfD", + "commit_store": "0x4a577dC79BfeF5C84a55EF6Df30400083F16AE8d", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0xabC7Dffb2590c44a201EC7532382e1fc01Cd9eEb", - "commit_store": "0xA3086bf1D609d8e8028E8339e4aa4362C7da339D", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x9A9f3714b517231869b97F3b49E2ba1009499d9b", + "commit_store": "0xAB0eCFDE9E681B1CD04D6C5536BafdBada180716", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0x0406F8f66C10Da99ff518bc2242e0Ec486a2c787", - "commit_store": "0xc6A97d753a3001e0B893e5FA2b0ec3d623af6C20", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x5837622b622D3c88Faf5491324575f5c0BB40001", + "commit_store": "0x9fAE0d8F4A15Fb96B999aad81a1C0e39deFDF49e", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0x4e0092bBC8EfAb6Eca295caB66986193b90a1Bb9", - "commit_store": "0xd7cA96B58EE33FdB3aa1392c30eD02645b1F28e2", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xFf094AC08B0AA8Ab3d29e034a51199a0ddE3d8C8", + "commit_store": "0x544f068b14e4FAc004579f158ccCE14225264c71", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -466,15 +466,15 @@ Data = """ "wrapped_native": "0x2021B12D8138e2D63cF0895eccABC0DFc92416c6", "src_contracts": { "Ethereum Mainnet": { - "on_ramp": "0x27C96A8a2f70a8408aD6c620717a3bDaA54bb10b", + "on_ramp": "0xc319484eF6cdA3a7f4D470e660b343FB569e9A1e", "deployed_at": 0 } }, "dest_contracts": { "Ethereum Mainnet": { - "off_ramp": "0x90902C0AEE857F3A42f2beBEa38724cE7b7a0cff", - "commit_store": "0x25adA90B241143DD5Df04Fb06C1fF6E7f7624ad9", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x1B12D218280DD1767304A00070101a91f7A61470", + "commit_store": "0x8Ad3FEFf222e2200CbC79cC3AdbaE3b64a37d1F8", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -483,127 +483,127 @@ Data = """ "fee_token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "arm": "0xdCD48419bD5Cd9d1b097695F2af4Ee125aADF84F", "router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D", - "price_registry": "0x020082A7a9c2510e1921116001152DEE4da81985", + "price_registry": "0x8c9b2Efb7c64C394119270bfecE7f54763b958Ad", "wrapped_native": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x925228D7B82d883Dde340A55Fe8e6dA56244A22C", + "on_ramp": "0x69eCC4E2D8ea56E2d0a05bF57f4Fd6aEE7f2c284", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0x3df8dAe2d123081c4D5E946E655F7c109B9Dd630", + "on_ramp": "0xaFd31C0C78785aDF53E4c185670bfd5376249d8A", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0x91D25A56Db77aD5147437d8B83Eb563D46eBFa69", + "on_ramp": "0x948306C220Ac325fa9392A6E601042A3CD0b480d", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0xe2c2AB221AA0b957805f229d2AA57fBE2f4dADf7", + "on_ramp": "0xb8a882f3B88bd52D1Ff56A873bfDB84b70431937", "deployed_at": 0 }, "Blast Mainnet": { - "on_ramp": "0x4545F9a17DA50110632C14704a15d893BF9CBD27", + "on_ramp": "0x6751cA96b769129dFE6eB8E349c310deCEDb4e36", "deployed_at": 0 }, "Celo": { - "on_ramp": "0xEd5bE9508ae56531cc0EDe6A3bD588Eb9E2e3cfa", + "on_ramp": "0x741599d9a5a1bfC40A22f530fbCd85E2718e9F90", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0xF538dA6c673A30338269655f4e019B71ba58CFd4", + "on_ramp": "0xf50B9A46C394bD98491ce163d420222d8030F6F0", "deployed_at": 0 }, "Metis Andromeda": { - "on_ramp": "0xa5ef33B57dD8B653F9A9EA7114f46376d18264aC", + "on_ramp": "0x75d536eED32f4c8Bb39F4B0c992163f5BA49B84e", "deployed_at": 0 }, "Mode Mainnet": { - "on_ramp": "0x466a078d17e3706a9414ACc48029EE9Bae4C9b65", + "on_ramp": "0xeA6d4a24B262aB3e61a8A62f018A30beCD086f82", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x86B47d8411006874eEf8E4584BdFD7be8e5549d1", + "on_ramp": "0x3455D8E039736944e66e19eAc77a42e8077B07bf", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x35F0ca9Be776E4B38659944c257bDd0ba75F1B8B", + "on_ramp": "0x15a9D79d6b3485F70bF82bC49dDD1fcB37A7149c", "deployed_at": 0 }, "WeMix Mainnet": { - "on_ramp": "0xCbE7e5DA76dC99Ac317adF6d99137005FDA4E2C4", + "on_ramp": "0xdEFeADd30D5BFD403d86245b43e39a73d76423cC", "deployed_at": 0 }, "ZKSync Mainnet": { - "on_ramp": "0xD54C93A99CBCb8D865E13DA321B540171795A89f", + "on_ramp": "0x9B14AE850653dD0E30fBC93ab7f77D0d638a365B", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0xeFC4a18af59398FF23bfe7325F2401aD44286F4d", - "commit_store": "0x9B2EEd6A1e16cB50Ed4c876D2dD69468B21b7749", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xdf615eF8D4C64d0ED8Fd7824BBEd2f6a10245aC9", + "commit_store": "0xf7B343A17445F175f2Dd9f5CB29BAf0a8dE75ed3", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0x569940e02D4425eac61A7601632eC00d69f75c17", - "commit_store": "0x2aa101BF99CaeF7fc1355D4c493a1fe187A007cE", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xd98E80C79a15E4dbaF4C40B6cCDF690fe619BFBb", + "commit_store": "0xA9f9bF2b643348c0884f2eBA4F712E833DA9a2b8", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x7Afe7088aff57173565F4b034167643AA8b9171c", - "commit_store": "0x87c55D48DF6EF7B08153Ab079e76bFEcbb793D75", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x66d84fedED0e51aeB47ceD1BB2fc0221Ae8D7C12", + "commit_store": "0x9B9Ec8E26955c034828bBD78E22ab258d983dCdb", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0xdf85c8381954694E74abD07488f452b4c2Cddfb3", - "commit_store": "0x8DC27D621c41a32140e22E2a4dAf1259639BAe04", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x6B4B6359Dd5B47Cdb030E5921456D2a0625a9EbD", + "commit_store": "0xDaC3A82Cc5e7C137bF28e6EF4F68f29D66205ffe", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Blast Mainnet": { - "off_ramp": "0x1a904DbbaDdE629a1460e2F6E2E485Ce06Ed7599", - "commit_store": "0x3CB2A81bb8a188C5353CdFa9994ed8666556FC53", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xF4468E56179e6EF59d6f5B133D9355AAD91Ea9ae", + "commit_store": "0x52275dC17f9eD92230C8C4d57fD36d128701f694", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Celo": { - "off_ramp": "0xd5083684eE92dDeA117636ae5E2F1cb7fE4dfd46", - "commit_store": "0x831097033C88c82a7F1897b168Aa88cC44540C8f", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x794aE32b63b8a82a6e2Ec5017bbC6bfbddA5ce96", + "commit_store": "0x95deB0c4bB9168202d50E874865f9A1842b82D64", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0xE93ec2A57e38C8541c893348cCafEAB01F7D47d4", - "commit_store": "0x118a9389960F86390A4F14ce4C95D6ff076C6bFC", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x70C705ff3eCAA04c8c61d581a59a168a1c49c2ec", + "commit_store": "0x9D93D536Ced80871Bf3DA5Bb47bAedE62c794f8A", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Metis Andromeda": { - "off_ramp": "0xCe6364dBe64D2789D916180131fAda2ABFF702E8", - "commit_store": "0x3d8a95adA63D406ee8232562AbD83CEdb0B90466", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x330349112e13232131Da51f9f3b153d825f65e61", + "commit_store": "0x0f89C7c0586536B618e0469402e1c8234bc52959", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Mode Mainnet": { - "off_ramp": "0xE8af3b68eDfFf65Ce48648009982380701f09B92", - "commit_store": "0x76264869a3eBF51a59FCa5ABa84ee2867c7F190e", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xb57D52F7Cb7BBD19a117585bbaf712108E56dd8f", + "commit_store": "0x01346721418045A6c07b71052e452eF8615e9084", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xB095900fB91db00E6abD247A5A5AD1cee3F20BF7", - "commit_store": "0x4af4B497c998007eF83ad130318eB2b925a79dc8", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x562a2025E60AA19Aa03Ea41D70ea1FD3286d1D3B", + "commit_store": "0x83F3DA5aa2C7534d694B0acde7624573c830250D", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x0af338F0E314c7551bcE0EF516d46d855b0Ee395", - "commit_store": "0xD37a60E8C36E802D2E1a6321832Ee85556Beeb76", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x718672076D6d51E4c76142B37bC99E4945d704a3", + "commit_store": "0x57b548C9c213EA2bcf60193E3D7fd2d2b53Fb9b3", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "WeMix Mainnet": { - "off_ramp": "0x3a129e6C18b23d18BA9E6Aa14Dc2e79d1f91c6c5", - "commit_store": "0x31f6ab382DDeb9A316Ab61C3945a5292a50a89AB", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xc1EcCE580B2C96f4fd202fB7c2a259ECe19a1bF2", + "commit_store": "0xA4755Cd68CA2092447c8c842659a2931f9110320", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "ZKSync Mainnet": { - "off_ramp": "0xb368c8946D9fa5A497cDe1Dff7213f9CdfD143Bf", - "commit_store": "0xa4d264470a67D9f6682EE12Bdc9c35Df44e3F194", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x6868FefbEFDc2B2FB75E6ED216dB1BeC02563D69", + "commit_store": "0x0d26BaE784c8986502E072F4e73B6168e2052045", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -616,69 +616,69 @@ Data = """ "wrapped_native": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x7A36511202f54a8A3Bc62Cc1df24bd391f7c9864", + "on_ramp": "0x140E6D5ba903F684944Dd27369d767DdEf958c9B", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0x732753869bc6bB07Ec81A403F926bbF6fC2FeaE2", + "on_ramp": "0xB707a6D1d32CE99D5c669DeE71D30d25a066D32c", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0xD5d33bc0BF395B39514B7f9f8F66ebc9D8e650Cb", + "on_ramp": "0xb485634dd2E545091722b9d4843d3644addf97e3", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x400eFb50480a73FEc02b115b53F0Ec6EcFf03C67", + "on_ramp": "0xAAb6D9fc00aAc37373206e91789CcDE1E851b3E4", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0x0F246651F1c2275B4E14d8ae166D1fd3Af05c405", + "on_ramp": "0x014ABcfDbCe9F67d0Df34574664a6C0A241Ec03A", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x391516732884d3F8Eec3301C19b819E6e6044C17", + "on_ramp": "0x9379b446fcA75CA57834a4dA33f64ae317Be05e4", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x566c7A2Cb557c36082301B97E998721D14E4bF7d", + "on_ramp": "0xD7a49AfEA62E77Ad6BEB2ed64673026271aae188", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x1bee1FD97824288a36B725f9CF20E07A67d5113b", - "commit_store": "0xB3a48e8664C5dE26822ae44577b100b717C36a54", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x2C1539696E29012806a15Bcd9845Ed1278a9fd63", + "commit_store": "0x5b1762a6023157edaf2c46c818f447B1940765D6", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0x633c19cCD7A818770f7BF59eB9C5AB632CDbc4D5", - "commit_store": "0xbbC073fb2D424eA45A571cc4dd91745E45d0aC73", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xe596D90EF0AEe10257109AC8394a85F8944bF6D0", + "commit_store": "0xd6Dc07804AE06f575C28094F99aCdDC1535904e7", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x4D90524de5783257fd64d1a20689a5b9Bad25de0", - "commit_store": "0xAae8De9f1B7e2FFF0563c2BBf0c69593BD517b52", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x972a85d7ba0209F1896992B2687cC728cf769e50", + "commit_store": "0x5FB18729651f1EDA5ed5ac67594FD94Fa3DBcd29", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0x9118303DE7f4342F9B057f6EC1Be282aa543D99C", - "commit_store": "0xa75f463b8a1d8bf7694Ac13E02938894F45eFbaA", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xbeEDd1C5C13C5886c3d600e94Ff9e82C04A53C38", + "commit_store": "0x392304E3cb636f75Dc95340672F3b8A2359d5Ebc", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0xFF61E57A2eE83FA262006C2DaF0D5fB2b36F3070", - "commit_store": "0xF433De9A293553c133E2dB90e226c2F2911f435C", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x658d9ae41A9c291De423d3B4B6C064f6dD0e7Ed2", + "commit_store": "0xd23391fCBb8a41b971f90bC6e95CC8beaD885221", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0x9D3aA479525a5BcE776dD83769e9F9b5B4dD4193", - "commit_store": "0x2B721632693A8BbABa3bA5F125C8cD33D66F28F7", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xd84E2316634ab6516Ecc829E2367633bfB3e4B6D", + "commit_store": "0x9d432DaF8aF8803baF6Cf560CF0f115c7D7b7f16", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x9714098CDdAc380D4443293C55B6CBf6D6bbDbEb", - "commit_store": "0x4338f204C7698eE678d6c44117503f812ca1FA69", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x6d6a4a60E0E23dbea089c0fEbbA9c5912f02bc57", + "commit_store": "0x9CBe49E232aEF27B9d98aC752354879efd7b1E70", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -691,15 +691,15 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000001", "src_contracts": { "WeMix Mainnet": { - "on_ramp": "0x3C5Ab46fA1dB1dECD854224654313a69bf9fcAD3", + "on_ramp": "0xf3baf38136b55F656CC5fdd4417EB6C160877104", "deployed_at": 0 } }, "dest_contracts": { "WeMix Mainnet": { - "off_ramp": "0x2B555774B3D1dcbcd76efb7751F3c5FbCFABC5C4", - "commit_store": "0x213124614aAf31eBCE7c612A12aac5f8aAD77DE4", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xcB154Bb4ed63FC30C416Dd16A2d1C64D8DE8DfD5", + "commit_store": "0x6091D319080D06e1b656F83Ff001DAc124C55613", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -712,24 +712,24 @@ Data = """ "wrapped_native": "0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x87353b87A373E1551D27EDacDaC1644741c6499F", + "on_ramp": "0x8d3039fE2400151c06Ae84a18CAf38dD9b6Ce58b", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xE43f9eD3146d76E627C2504E5140005027992De6", + "on_ramp": "0xdF5394c57A0570ECe45DE0c0fA2e722A672B9198", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x2cc33de75dAFDb3F8F4f24244a9C420374e2C001", - "commit_store": "0x67fE38dB73be154a1f1a63221F898B9d5EE4eF63", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xc6bA5a79991b3775F28259BA551b30eCb0b6D499", + "commit_store": "0xb81b0EE9675879a2Dcaa70CCC3b2c2D38fa404b0", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0xc2B1A8c931582D041ba5fF30AEB9fA828B30754d", - "commit_store": "0x90073Ea7A1Ee4Fe5d638B4216Bc60479Eba52001", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x1fd37Bf813D0723BEF614bC93d9D2Ce1AcB3228f", + "commit_store": "0x7C1efda9F744a2B4f88b924B03C6d6B53E3E390F", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -742,51 +742,51 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x65Ad802d80aD6a96C5a4bc9e57E16099de99Dc7F", + "on_ramp": "0xb2e694efcDa0aeB81700019c3047F92fC3bb520E", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0x8C5149ff7Cfd99dd561caE9B7abFAA0Ef79eAbeC", + "on_ramp": "0xeb7E8c40E95Cd31666359AaeB1F2CccaAB935643", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x71dB32eF442c29d8cbf72a9AFcb1Ef12B35b0BF4", + "on_ramp": "0x347A070EA1B04bc2b4A8f14320688C277022C90e", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xbD5F9C193a7fEF5D578C55Ddfe4d08d6BCc15648", + "on_ramp": "0x7d2aF78868993a5a86676BA639eC0412709707D9", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x659303e8d4306D3ea8676FB034d56FB6f37E19d9", + "on_ramp": "0x7AB4329D19A0255DA90Ee8dbAA60f8f0cB7950C1", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x8d3E1b15ebC96cec1ffc092cEcAeA6c1DD00aF9b", - "commit_store": "0x1f1DEa0210aE346A20E270a1C3355d99b0B949D2", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x0Cb870C12013c2d5743585F85b298e129cE57203", + "commit_store": "0x682Af2Cfaa5aE554eF222728fF7C7168232e2Ea5", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x7a57670Fa0Cf1Bc2665a1Ae0f5031b9f5a43dD3a", - "commit_store": "0x18ffb74D94175d00D8bB67B70737dE2cE45eed07", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xdfA601DA2163Ca2C77Eb32126E6B7A97024f6181", + "commit_store": "0xb88F947C85b1c6B1E2A0C22792BA58C40c07a644", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0xEfa90cE6289A2777cd5B8fb991B2D0Be44cA5067", - "commit_store": "0xACa5f0942Bb7fF297A7c25E8364373702D81bb3f", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x30612D8fb7EcD05ECb863560BA8806d88e8BbFAF", + "commit_store": "0xf84d023CCFF8b74e565117cBc034859D06EA1976", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0xdF8f09AB4DfB49dEC8a0B8b7f1B7F4134252D3e9", - "commit_store": "0x8Ae635d264f20f1dbC0dea03712C194AdbeF50D1", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xb1caBa234721b8F12C545B3dC25B3F87f6a9c91B", + "commit_store": "0x67Ff921DA5d0B61a9b05BDFa92d9f5f992d7861a", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xE4D6AAF678b986D3E6B7A85FA33d0519716a5525", - "commit_store": "0xBF80E30c8c013Ec0d05e2a959CF8000407C813EC", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x4adcD1FB4ec76A3c9960E048f81C19A51B2eAC49", + "commit_store": "0x7B58aF65DFD717fC0d044D860c8f9A85Ca6813D6", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -795,91 +795,91 @@ Data = """ "fee_token": "0x4200000000000000000000000000000000000006", "arm": "0x1c51b6D5BFcFB7ee82C80949DFD146dB157a7E49", "router": "0x3206695CaE29952f4b0c22a169725a865bc8Ce0f", - "price_registry": "0x9270AAA75F4B9038f4c25fEc665B02a150a90361", + "price_registry": "0xb52545aECE8C73A97E52a146757EC15b90Ed8488", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x0C9BE7Cfd12c735E5aaE047C1dCB845d54E518C3", + "on_ramp": "0x6bA81b83091A23e8F2AA173B2b939fAf9E320DfB", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0xD0D3E757bFBce7ae1881DDD7F6d798DDcE588445", + "on_ramp": "0xB9D655Ad5ba80036725d6c753Fa6AF0454cBF630", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0xa3c9544B82846C45BE37593d5d9ACffbE61BF3A6", + "on_ramp": "0xfC51a4CF925f202d86c6092cda879689d2C17201", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x0b1760A8112183303c5526C6b24569fd3A274f3B", + "on_ramp": "0xfE11cfC957cCa331192EAC60040b442303CcA0a9", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0x55183Db1d2aE0b63e4c92A64bEF2CBfc2032B127", + "on_ramp": "0xE4C51Dc01A4E0aB14c7a7a2ed1655E9CF8A3E698", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0x14aA3CC03583aA557DBca4ce72288Cc5F37DDE34", + "on_ramp": "0x604a9dda2e27D56cfCe457E437a61f4ED0De9dE6", "deployed_at": 0 }, "Mode Mainnet": { - "on_ramp": "0x034eA573B049210315110f7eA11c9618E32F08Ae", + "on_ramp": "0xc6d9Cb39e34D83d21A021504024887A0e96D4e94", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x6B57145e322c877E7D91Ed8E31266eB5c02F7EfC", + "on_ramp": "0x9c725164b60E3f6d4d5b7A2841C63E9FD0988805", "deployed_at": 0 }, "WeMix Mainnet": { - "on_ramp": "0x82e9f4C5ec4a84E310d60D462a12042E5cbA0954", + "on_ramp": "0x6Dbc8D4e5556FD0B82bB0D67c94D0fA1cd288AbD", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0xaC8C94242aa8234Bf89682aBcDDf805AE8cff61D", - "commit_store": "0x55028780918330FD00a34a61D9a7Efd3f43ca845", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xEB3d6956BCf7b1E29634C8cd182fC9FA740Bce34", + "commit_store": "0x6569761680DaC4Bf940244E3cF198A069E34E91F", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0x8dc6490A6204dF846BaBE809cB695ba17Df1F9B1", - "commit_store": "0xA190660787B6B183Dd82B243eA10e609327c7308", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xF8E38B4503418659F791F2135c4912F85BFB7988", + "commit_store": "0x23CAc55aDDF28179A999858720E9Fe686372083A", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0xE14501F2838F2fA1Ceb52E78ABdA289EcE1705EA", - "commit_store": "0xa8DD25B29787527Df283211C24Ac72B17150A696", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x51f37b538aD2Bcb9Eaf884859BF7C5Ec58AEc885", + "commit_store": "0xF472FEb09544Bf991773f4B94fe3F03e458d1b8d", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0xBAE6560eCa9B77Cb047158C783e36F7735C86037", - "commit_store": "0x6168aDF58e1Ad446BaD45c6275Bef60Ef4FFBAb8", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x519ee6B83f57df95486aeA6E26819cb7b4B8ee99", + "commit_store": "0xCfdF2b21D9777E2B0a221F6b6D8fe176461f058e", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0xd2D98Be6a1C241e86C807e51cED6ABb51d044203", - "commit_store": "0x4d75A5cE454b264b187BeE9e189aF1564a68408D", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x9979c2dfEcA9051Cf7f08274d978984B2dB12C60", + "commit_store": "0x9358663E8f89df8EFE2346a3c4c1D65d03300576", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0x4358640A2419119DBe0933b5F2c288c3EB2c082C", - "commit_store": "0x44d1a05ef6e54a3CB35a1497303bA272f15f45ed", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x01449040D92D75c58FaDc9Bc1c0eadc70C550484", + "commit_store": "0xb63230DfcE291DA76FD946EFbc966549F9300347", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Mode Mainnet": { - "off_ramp": "0xDf9717d724828537902Fb0c3B7C56c641463Fa38", - "commit_store": "0x8aEFF283381914E07Fc371601D59648ab6D2C0B1", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x5a4BEeafd345264360E6894a6bc5F54a70814E68", + "commit_store": "0x4E94a327A38E6F3509a5639dCF933CfF6DE93FFD", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x7c6221880A1D62506b1A08Dab3Bf695A49AcDD22", - "commit_store": "0x0684076EE3595221861C50cDb9Cb66402Ec11Cb9", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x4BA0A3bD1E2b70b2fe165A53219e7eF6376849a4", + "commit_store": "0xA0f02e1F9C641C9610f688be84F889fE518b36e3", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "WeMix Mainnet": { - "off_ramp": "0x3e5B3b7559D39563a74434157b31781322dA712D", - "commit_store": "0x7954372FF6f80908e5A2dC2a19d796A1005f91D2", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x2f40dCCb74d8B2dd7af065232a06778f2D019375", + "commit_store": "0xd1111a601BAb64a6428426095206A43710CaE932", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -892,78 +892,78 @@ Data = """ "wrapped_native": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0xD16D025330Edb91259EEA8ed499daCd39087c295", + "on_ramp": "0x13263aC754d1e29430930672E3C0019f2BC44Ba2", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0x5FA30697e90eB30954895c45b028F7C0dDD39b12", + "on_ramp": "0x56cb9Cd82553Bd8157e6504020c38f6DA4971717", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0xF5b5A2fC11BF46B1669C3B19d98B19C79109Dca9", + "on_ramp": "0x164507757F7d5Ab35C6af44EeEB099F5be29Da57", "deployed_at": 0 }, "Base Mainnet": { - "on_ramp": "0x20B028A2e0F6CCe3A11f3CE5F2B8986F932e89b4", + "on_ramp": "0xD26A4E0c664E72e3c29E634867191cB1cb9AF570", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0xFd77c53AA4eF0E3C01f5Ac012BF7Cc7A3ECf5168", + "on_ramp": "0x1DAcBae00c779913e6E9fc1A3323FbA4847ba53C", "deployed_at": 0 }, "Gnosis Mainnet": { - "on_ramp": "0x4616621704C81801A56D29c961F9395ee153d46C", + "on_ramp": "0xcc4A8CFd756895d91B476Dd5461286b300914aBf", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x3111cfbF5e84B5D9BD952dd8e957f4Ca75f728Cf", + "on_ramp": "0x868B71490B36674B3B9006fa8711C6fA26A26631", "deployed_at": 0 }, "WeMix Mainnet": { - "on_ramp": "0x5060eF647a1F66BE6eE27FAe3046faf8D53CeB2d", + "on_ramp": "0x9363330c6d807a1393c1fd35893c64d26931CDe6", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0xa8a9eDa2867c2E0CE0d5ECe273961F1EcC3CC25B", - "commit_store": "0xbD4480658dca8496a65046dfD1BDD44EF897Bdb5", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x60f2788225CeE4a94f8E7589931d5A14Cbc4367d", + "commit_store": "0x4DEc80ED383171EC54699B22B869bE098d3cBac9", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0xB9e3680639c9F0C4e0b02FD81C445094426244Ae", - "commit_store": "0x8c63d4e67f7c4af6FEd2f56A34fB4e01CB807CFF", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x35c1Bb5A9c2F3fa8f8dFF470a6bE7d362CeA1ef3", + "commit_store": "0xB3324b80f50a31b12c0C733560D3aA2a32dc5C33", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x592773924741F0Da889a0dfdab71171Dd11E054C", - "commit_store": "0xEC4d35E1A85f770f4D93BA43a462c9d87Ef7017e", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xE58074f8F56E23836f088Ac8b4f3882c1b4CAcbb", + "commit_store": "0x2110a5f138364d788FDF54eCBa25C1688181cb00", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Base Mainnet": { - "off_ramp": "0xD0FA7DE2D18A0c59D3fD7dfC7aB4e913C6Aa7b68", - "commit_store": "0xF88053B9DAC8Dd3039a4eFa8639159aaa3F2D4Cb", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xF4a9Dbb7f3FBa02e3a244B464e459C32B63857F1", + "commit_store": "0x936A0C8635D7087a2D22494762e9a697C3C3D545", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0x45320085fF051361D301eC1044318213A5387A15", - "commit_store": "0x4Dc771B5ef21ef60c33e2987E092345f2b63aE08", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xa06e68a11d5694316Cc819f2FFD02663e3314C7C", + "commit_store": "0xB73d668B26817659E9f48F16b780480B4401cFcE", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Gnosis Mainnet": { - "off_ramp": "0x0A04eC196454825d361886cf4FA113A948164Ef8", - "commit_store": "0x74b72633b63A8f4374a12DB6F609305BC5a1b2d5", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x9e2e4e397226f347d11D3fF8469d0c3FFa750C3B", + "commit_store": "0x75faF05ec32C9dA97E99Eb6fb18b5087DecAAa82", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0xBa754ecd3CFA7E9093F688EAc3860cf9D07Fc0AC", - "commit_store": "0x04C0D5302E3D8Ca0A0019141a52a23B59cdb70e4", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x805c292775Be43b10Cc744ea7E81d9939a08cEa4", + "commit_store": "0x52faD8fb48451AA555c0f59accA1dC7C69B9681B", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "WeMix Mainnet": { - "off_ramp": "0xd7c877ea02310Cce9278D9A048Aa1Bb9aF72F00d", - "commit_store": "0x92A1C927E8E10Ab6A40E5A5154e2300D278d1a67", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xd357Bee1Ff4B1cce7dc0d953a9E5613476781732", + "commit_store": "0x784F81E5c2960a7c7e714D6BA383f0d14e93eD65", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -976,69 +976,69 @@ Data = """ "wrapped_native": "0x7D72b22a74A216Af4a002a1095C8C707d6eC1C5f", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x9aBfd6f4C865610692AB6fb1Be862575809fFabf", + "on_ramp": "0xA89c8E2b85a6BeC901C29107E9B640Ff256fc762", "deployed_at": 0 }, "Avalanche Mainnet": { - "on_ramp": "0xbE0Cfae74677F8dd16a246a3a5c8cbB1973118f4", + "on_ramp": "0xEe41778FdE32C19f8f7E0C780838b1cb76bf8aEA", "deployed_at": 0 }, "BSC Mainnet": { - "on_ramp": "0x56657ec4D15C71f7F3C17ba2b21C853A24Dc5381", + "on_ramp": "0x4A62c842f06AC261c93bb5805289c613f55e2Aeb", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0x190bcE84CF2d500B878966F4Cf98a50d78f2675E", + "on_ramp": "0x6c6Dd4fCa5A7B2F11AA3057AB573DD8878C76C5e", "deployed_at": 0 }, "Kroma Mainnet": { - "on_ramp": "0x47E9AE0A815C94836202E696748A5d5476aD8735", + "on_ramp": "0x19e7aD9B0cb28E4604f91376eE2f7dFF0E66318a", "deployed_at": 0 }, "Optimism Mainnet": { - "on_ramp": "0x70f3b0FD7e6a4B9B623e9AB859604A9EE03e48BD", + "on_ramp": "0x96c4e2B1b2c949F570D5992272B7722a3a1d1709", "deployed_at": 0 }, "Polygon Mainnet": { - "on_ramp": "0x777058C1e1dcE4eB8001F38631a1cd9450816e5a", + "on_ramp": "0x728C5d58f6079744E1e41BDAE16200f6c3725954", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0x2ba68a395B72a6E3498D312efeD755ed2f3CF223", - "commit_store": "0xdAeC234DA83F68707Bb8AcB2ee6a01a5FD4c2391", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x007b0D0e63B5939E64286F4C4afB2D52c6114025", + "commit_store": "0x4D8BaDA9006A6C1cd724ae6F2E343640a0D9706d", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Avalanche Mainnet": { - "off_ramp": "0xFac907F9a1087B846Faa75A14C5d34A8639233d8", - "commit_store": "0xF2812063446c7deD2CA306c67A68364BdDcbEfc5", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x8Ef00c4B45f7B3D895150F0C5D978AC6949Af174", + "commit_store": "0xF580F5ba66Eec295B8bE3Ea613985b6CEc65D7C8", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "BSC Mainnet": { - "off_ramp": "0x6ec9ca4Cba62cA17c55F05ad2000B46192f02035", - "commit_store": "0x84534BE763366a69710E119c100832955795B34B", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x90fC76fBd6B82eAe27b34e136271b94788237738", + "commit_store": "0xda174CA3c585b260fc5c347c88cA5946Ce0f46E8", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0xF92Fa796F5307b029c65CA26f322a6D86f211194", - "commit_store": "0xbeC110FF43D52be2066B06525304A9924E16b73b", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x76DE34244b92aB9F4e9D550269Ef1CAdE0d1A2E9", + "commit_store": "0xcbCFFD854a2d033019B98f5583FcD5caDc2bb802", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Kroma Mainnet": { - "off_ramp": "0xF886d8DC64E544af4835cbf91e5678A54D95B80e", - "commit_store": "0x8794C9534658fdCC44f2FF6645Bf31cf9F6d2d5D", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x64F833f1347fd8Ac6b07a08adCc844FFeB8dF928", + "commit_store": "0xf79eA7f1D70640A7a8A309465ca29b35D4103c11", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Optimism Mainnet": { - "off_ramp": "0x87220D01DF0fF27149B47227897074653788fd23", - "commit_store": "0xF8dD2be2C6FA43e48A17146380CbEBBB4291807b", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xd76783CF6A98C95F5927b4b98D5E1Efb78CFc563", + "commit_store": "0x3837A341afE24A451d868966114A39715e91C6f6", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Polygon Mainnet": { - "off_ramp": "0x8f0229804513A9Bc00c1308414AB279Dbc718ae1", - "commit_store": "0x3A85D1b8641d83a87957C6ECF1b62151213e0842", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xe22ef88FccfE6C304Fd245005e959837C86B52F6", + "commit_store": "0x98Ebd40E2535D404fFB361A85bf6b82D64Bda151", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } }, @@ -1051,24 +1051,24 @@ Data = """ "wrapped_native": "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91", "src_contracts": { "Arbitrum Mainnet": { - "on_ramp": "0x9033687a0f03012e015f8f8f2a59da57531d2B43", + "on_ramp": "0x66EcB7c8c122d74f19Fc28b275f213Ef8991B7AB", "deployed_at": 0 }, "Ethereum Mainnet": { - "on_ramp": "0x3B80Fe300c9A611abA0496e2543B66Ff7bD4B9e9", + "on_ramp": "0xD1B33FAd3fF7a793EE39473f865630e3b6371086", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Mainnet": { - "off_ramp": "0xF0a08aC528668D4fe8C4cF235a8B82cbf242Fa9d", - "commit_store": "0x5a3C9b21b03E4eBcccb57D296e7ff54102F04424", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0xd448c815C421fFBd770C2d3B9a9cBa4E33E3885c", + "commit_store": "0xC64f4b53eDb629B3293eE806D9b2aCBd1dDE4e13", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" }, "Ethereum Mainnet": { - "off_ramp": "0x7c887B97F9Bba9355EC10e2bA949AdB491Ef44Fd", - "commit_store": "0xA42bf0c8794FA8853Ec0F1B24a489972e8CF4C30", - "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + "off_ramp": "0x6BACb854483Ffe310F5Ac08879868E96AE0DC000", + "commit_store": "0x117D1015FD2CBaa32A1fe0e0C913fc02B4D5f115", + "receiver_dapp": "0xB509c046e1182c7B36d2D9733554BC268716803C" } } } @@ -1081,52 +1081,80 @@ TTL = '8h' [CCIP.Env.Network] selected_networks = [ - 'ARBITRUM_MAINNET', - 'AVALANCHE_MAINNET', - 'BSC_MAINNET', - 'BASE_MAINNET', - 'ETHEREUM_MAINNET', - 'KROMA_MAINNET', - 'OPTIMISM_MAINNET', - 'POLYGON_MAINNET', - 'WEMIX_MAINNET', - ] + 'ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET', + 'BASE_MAINNET', + 'BLAST_MAINNET', + 'BSC_MAINNET', + 'CELO_MAINNET', + 'ETHEREUM_MAINNET', + 'GNOSIS_MAINNET', + 'KROMA_MAINNET', + 'METIS_ANDROMEDA', + 'MODE_MAINNET', + 'OPTIMISM_MAINNET', + 'POLYGON_MAINNET', + 'WEMIX_MAINNET', + 'ZKSYNC_MAINNET', +] [CCIP.Groups.load] NetworkPairs = [ - 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', - 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', - 'ETHEREUM_MAINNET,POLYGON_MAINNET', - 'ETHEREUM_MAINNET,BSC_MAINNET', - 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', - 'ETHEREUM_MAINNET,BASE_MAINNET', - 'ETHEREUM_MAINNET,WEMIX_MAINNET', - 'AVALANCHE_MAINNET,POLYGON_MAINNET', - 'BASE_MAINNET,OPTIMISM_MAINNET', - 'BASE_MAINNET,ARBITRUM_MAINNET', - 'AVALANCHE_MAINNET,BSC_MAINNET', - 'BSC_MAINNET,POLYGON_MAINNET', - 'OPTIMISM_MAINNET,POLYGON_MAINNET', - 'BASE_MAINNET,BSC_MAINNET', - 'POLYGON_MAINNET,ARBITRUM_MAINNET', # added as batch 1 - 'ARBITRUM_MAINNET,BSC_MAINNET', # added as batch 1 - 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', # added as batch 1 - 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', # added as batch 2 - 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', # added as batch 2 - 'BASE_MAINNET,POLYGON_MAINNET', # added as batch 2 - 'BSC_MAINNET,OPTIMISM_MAINNET', # added as batch 2 - 'AVALANCHE_MAINNET,BASE_MAINNET', # added as batch 2 - 'WEMIX_MAINNET,KROMA_MAINNET', - 'BSC_MAINNET,WEMIX_MAINNET', # added as batch 2 - 'AVALANCHE_MAINNET,WEMIX_MAINNET', # added as batch 2 - 'POLYGON_MAINNET,WEMIX_MAINNET', # added as batch 2 - 'WEMIX_MAINNET,ARBITRUM_MAINNET', # added as batch 2 - 'OPTIMISM_MAINNET,WEMIX_MAINNET' # added as batch 2 + 'ARBITRUM_MAINNET,BSC_MAINNET', + 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET,BASE_MAINNET', + 'AVALANCHE_MAINNET,BSC_MAINNET', + 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,POLYGON_MAINNET', + 'AVALANCHE_MAINNET,WEMIX_MAINNET', + 'BASE_MAINNET,ARBITRUM_MAINNET', + 'BASE_MAINNET,BSC_MAINNET', + 'BASE_MAINNET,OPTIMISM_MAINNET', + 'BASE_MAINNET,POLYGON_MAINNET', + 'BLAST_MAINNET,ARBITRUM_MAINNET', + 'BLAST_MAINNET,BASE_MAINNET', + 'BLAST_MAINNET,BSC_MAINNET', + 'BSC_MAINNET,OPTIMISM_MAINNET', + 'BSC_MAINNET,POLYGON_MAINNET', + 'BSC_MAINNET,WEMIX_MAINNET', + 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', + 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', + 'ETHEREUM_MAINNET,BASE_MAINNET', + 'ETHEREUM_MAINNET,BLAST_MAINNET', + 'ETHEREUM_MAINNET,BSC_MAINNET', + 'ETHEREUM_MAINNET,CELO_MAINNET', + 'ETHEREUM_MAINNET,GNOSIS_MAINNET', + 'ETHEREUM_MAINNET,METIS_ANDROMEDA', + 'ETHEREUM_MAINNET,MODE_MAINNET', + 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', + 'ETHEREUM_MAINNET,POLYGON_MAINNET', + 'ETHEREUM_MAINNET,WEMIX_MAINNET', + 'ETHEREUM_MAINNET,ZKSYNC_MAINNET', + 'GNOSIS_MAINNET,ARBITRUM_MAINNET', + 'GNOSIS_MAINNET,AVALANCHE_MAINNET', + 'GNOSIS_MAINNET,BASE_MAINNET', + 'GNOSIS_MAINNET,BSC_MAINNET', + 'GNOSIS_MAINNET,OPTIMISM_MAINNET', + 'GNOSIS_MAINNET,POLYGON_MAINNET', + 'METIS_ANDROMEDA,ARBITRUM_MAINNET', + 'MODE_MAINNET,ARBITRUM_MAINNET', + 'MODE_MAINNET,BASE_MAINNET', + 'MODE_MAINNET,BSC_MAINNET', + 'MODE_MAINNET,OPTIMISM_MAINNET', + 'OPTIMISM_MAINNET,POLYGON_MAINNET', + 'OPTIMISM_MAINNET,WEMIX_MAINNET', + 'POLYGON_MAINNET,ARBITRUM_MAINNET', + 'POLYGON_MAINNET,WEMIX_MAINNET', + 'WEMIX_MAINNET,ARBITRUM_MAINNET', + 'WEMIX_MAINNET,KROMA_MAINNET', + 'ZKSYNC_MAINNET,ARBITRUM_MAINNET' ] BiDirectionalLane = true -PhaseTimeout = '30m' +PhaseTimeout = '20m' ExistingDeployment = true +SkipRequestIfAnotherRequestTriggeredWithin = '40m' [CCIP.Groups.load.TokenConfig] NoOfTokensPerChain = 1 @@ -1137,7 +1165,7 @@ TimeUnit = '1h' TestDuration = '5h' TestRunName = 'Soak_test_mainnet' FailOnFirstErrorInLoad = true -SkipRequestIfAnotherRequestTriggeredWithin = '40m' + [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] MsgType = 'Data' @@ -1149,34 +1177,55 @@ AmountPerToken = 1 [CCIP.Groups.smoke] # these are all the valid network pairs NetworkPairs = [ - 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', - 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', - 'ETHEREUM_MAINNET,POLYGON_MAINNET', - 'ETHEREUM_MAINNET,BSC_MAINNET', - 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', - 'ETHEREUM_MAINNET,BASE_MAINNET', - 'ETHEREUM_MAINNET,WEMIX_MAINNET', - 'AVALANCHE_MAINNET,POLYGON_MAINNET', - 'BASE_MAINNET,OPTIMISM_MAINNET', - 'BASE_MAINNET,ARBITRUM_MAINNET', - 'AVALANCHE_MAINNET,BSC_MAINNET', - 'BSC_MAINNET,POLYGON_MAINNET', - 'OPTIMISM_MAINNET,POLYGON_MAINNET', - 'BASE_MAINNET,BSC_MAINNET', - 'POLYGON_MAINNET,ARBITRUM_MAINNET', # added as batch 1 - 'ARBITRUM_MAINNET,BSC_MAINNET', # added as batch 1 - 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', # added as batch 1 - 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', # added as batch 2 - 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', # added as batch 2 - 'BASE_MAINNET,POLYGON_MAINNET', # added as batch 2 - 'BSC_MAINNET,OPTIMISM_MAINNET', # added as batch 2 - 'AVALANCHE_MAINNET,BASE_MAINNET', # added as batch 2 - 'WEMIX_MAINNET,KROMA_MAINNET', - 'BSC_MAINNET,WEMIX_MAINNET', # added as batch 2 - 'AVALANCHE_MAINNET,WEMIX_MAINNET', # added as batch 2 - 'POLYGON_MAINNET,WEMIX_MAINNET', # added as batch 2 - 'WEMIX_MAINNET,ARBITRUM_MAINNET', # added as batch 2 - 'OPTIMISM_MAINNET,WEMIX_MAINNET' # added as batch 2 + 'ARBITRUM_MAINNET,BSC_MAINNET', + 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET,BASE_MAINNET', + 'AVALANCHE_MAINNET,BSC_MAINNET', + 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,POLYGON_MAINNET', + 'AVALANCHE_MAINNET,WEMIX_MAINNET', + 'BASE_MAINNET,ARBITRUM_MAINNET', + 'BASE_MAINNET,BSC_MAINNET', + 'BASE_MAINNET,OPTIMISM_MAINNET', + 'BASE_MAINNET,POLYGON_MAINNET', + 'BLAST_MAINNET,ARBITRUM_MAINNET', + 'BLAST_MAINNET,BASE_MAINNET', + 'BLAST_MAINNET,BSC_MAINNET', + 'BSC_MAINNET,OPTIMISM_MAINNET', + 'BSC_MAINNET,POLYGON_MAINNET', + 'BSC_MAINNET,WEMIX_MAINNET', + 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', + 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', + 'ETHEREUM_MAINNET,BASE_MAINNET', + 'ETHEREUM_MAINNET,BLAST_MAINNET', + 'ETHEREUM_MAINNET,BSC_MAINNET', + 'ETHEREUM_MAINNET,CELO_MAINNET', + 'ETHEREUM_MAINNET,GNOSIS_MAINNET', + 'ETHEREUM_MAINNET,METIS_ANDROMEDA', + 'ETHEREUM_MAINNET,MODE_MAINNET', + 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', + 'ETHEREUM_MAINNET,POLYGON_MAINNET', + 'ETHEREUM_MAINNET,WEMIX_MAINNET', + 'ETHEREUM_MAINNET,ZKSYNC_MAINNET', + 'GNOSIS_MAINNET,ARBITRUM_MAINNET', + 'GNOSIS_MAINNET,AVALANCHE_MAINNET', + 'GNOSIS_MAINNET,BASE_MAINNET', + 'GNOSIS_MAINNET,BSC_MAINNET', + 'GNOSIS_MAINNET,OPTIMISM_MAINNET', + 'GNOSIS_MAINNET,POLYGON_MAINNET', + 'METIS_ANDROMEDA,ARBITRUM_MAINNET', + 'MODE_MAINNET,ARBITRUM_MAINNET', + 'MODE_MAINNET,BASE_MAINNET', + 'MODE_MAINNET,BSC_MAINNET', + 'MODE_MAINNET,OPTIMISM_MAINNET', + 'OPTIMISM_MAINNET,POLYGON_MAINNET', + 'OPTIMISM_MAINNET,WEMIX_MAINNET', + 'POLYGON_MAINNET,ARBITRUM_MAINNET', + 'POLYGON_MAINNET,WEMIX_MAINNET', + 'WEMIX_MAINNET,ARBITRUM_MAINNET', + 'WEMIX_MAINNET,KROMA_MAINNET', + 'ZKSYNC_MAINNET,ARBITRUM_MAINNET' ] BiDirectionalLane = true @@ -1184,7 +1233,7 @@ PhaseTimeout = '20m' LocalCluster = false ExistingDeployment = true ReuseContracts = true - +SkipRequestIfAnotherRequestTriggeredWithin = '24h' [CCIP.Groups.smoke.TokenConfig] NoOfTokensPerChain = 1 diff --git a/integration-tests/ccip-tests/testconfig/override/mainnet_1.5_B4_native_dataonly_testrouter.toml b/integration-tests/ccip-tests/testconfig/override/mainnet_1.5_B4_native_dataonly_testrouter.toml new file mode 100644 index 00000000000..8f2a6401f0c --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/override/mainnet_1.5_B4_native_dataonly_testrouter.toml @@ -0,0 +1,1214 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +TokenPool = 'latest' +CommitStore = 'latest' + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Mainnet": { + "is_mock_arm": true, + "fee_token": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + "arm": "0xC2C5E22a2d9715ed5C5BCC4D8eFf5966cf260744", + "router": "0x33340200b7893fc478Eb2558FfC7B100E5B3869c", + "price_registry": "0x3971cfEf12c4CC6eD14D65B39C9EC6C740C19A40", + "wrapped_native": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "src_contracts": { + "Avalanche Mainnet": { + "on_ramp": "0xe80cC83B895ada027b722b78949b296Bd1fC5639", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xc1b6287A3292d6469F2D8545877E40A2f75CA9a6", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x14bF7b1Ca6b843f386bfDfa76BFd439919b9378D", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x67761742ac8A21Ec4D76CA18cbd701e5A6F3Bef3", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xc7d6B885d8A4286E6311F79227430b7862311cd3", + "deployed_at": 0 + }, + "Metis Andromeda": { + "on_ramp": "0xF1e73c37CDa8E47768De2246AEf5eFD4d76330ae", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0xd236ea4DDE7de1e594021764E2f6Cd8e8cD7F047", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0xAFECc7b67c6a8e606e94ce4e2F70D83C2206C2cb", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x6087d6C33946670232DF09Fe93eECbaEa3D6864d", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Mainnet": { + "off_ramp": "0x95095007d5Cc3E7517A1A03c9e228adA5D0bc376", + "commit_store": "0x46679C9E93B7312A9191A9aD12A73b0c86A33623", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0xb62178f8198905D0Fa6d640Bdb188E4E8143Ac4b", + "commit_store": "0x8F60C335a5d2BEC6B32867d3C05C377E88640AaF", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0x16B9709F8A23B9EB922E8Dde7EaB1Ede7C79F663", + "commit_store": "0x6c3fD63b9BdE38C414530727a5De858ca023cFc4", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0x91e46cc5590A4B9182e47f40006140A7077Dec31", + "commit_store": "0x86be76A0FA2bD3ECB69330cBb4fd1f62c48F43E3", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0xeE53872d1C695933B34cE0a11B58613CBBf37e20", + "commit_store": "0x5D88518a198b99F096d2893092a568A97F60B8d4", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Metis Andromeda": { + "off_ramp": "0xF1A4DE22FF792b0457306C39f4CB5822Ab47bdAE", + "commit_store": "0x7F20F4374f8d99201F22434ad59f96bE898A9E0B", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Mode Mainnet": { + "off_ramp": "0xa964355d8eBa62E9b043Eb27eEe6d999Ecc69429", + "commit_store": "0x72C3cdA94eCAC06f7605301dd7144815C2F05A03", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x27a971D482335d0f8d1917451390734f7372A4a3", + "commit_store": "0x6642E640321e1Ad01eef2fC2ad5427D84A2Ee269", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0xcabc2D71dC3172a154A5A34cD706B050e0ef9b6f", + "commit_store": "0x78B15A57889200F246fc52790c4F3DfC37d82Aa2", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Avalanche Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0x4f6Ec25f06A114ADD3154DC17fb637F750AdaA31", + "router": "0xC485fDa586037F8a312C2492419C9ce25cF7FDD8", + "price_registry": "0x718b6f7454531F6CBdB9eC08F87C8663A7c4FAC2", + "wrapped_native": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x4e910c8Bbe88DaDF90baa6c1B7850DbeA32c5B29", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x139D4108C23e66745Eda4ab47c25C83494b7C14d", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xe6e161d55019AA5960DcF0Af9bB6e4d574C69F99", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xe8784c29c583C52FA89144b9e5DD91Df2a1C2587", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0x38fd0DF16F6fD0a2C3Ec6615c73e50F5d027b8bA", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x3e3b4Fba004E7824219e79aE9f676d9D41A216Fa", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x5570a4E979d7460F13b84075ACEF69FAc73914b1", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x508Ea280D46E4796Ce0f1Acf8BEDa610c4238dB3", + "commit_store": "0x20bEde74Da64C9aE47FFDf4B87613752CD13bE5D", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0x37879EBFCb807f8C397fCe2f42DC0F5329AD6823", + "commit_store": "0xDe615EEaD232BEECF6c9b71c293A387B97814E8D", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0x6CDAa2711BdF0B719911BF00588A79FA97bf9264", + "commit_store": "0x4c05E7AB694C602De3135e025aEc7F7de06E80F7", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0xE5F21F43937199D4D57876A83077b3923F68EB76", + "commit_store": "0xf0F791901854fAb16adeBd60F0639b960B6ea0CF", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0x1181A59FF0BAEd1E0EA77e919185cB8C3D5D3125", + "commit_store": "0x60b2Bc7858D6296D8c4370E35a930E5ddF13085E", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x376C0AFC9E64efE0d9202E1F02c3d7f9Dc15e404", + "commit_store": "0xF8728f8Cd9C809287e6a97B71A2cdfD2c3C034cE", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0xFf49E35626Eba28Bee1d251782AB75A6cEd91c45", + "commit_store": "0xee2570De22C0D07d0FaBC1169dC5EcA342B838Da", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Base Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "bridge_tokens": [ + "0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196" + ], + "bridge_tokens_pools": [ + "0x1568A4131760231712E59778DAB9EFE67911f4ff" + ], + "arm": "0x91cB19E7c4Ba9B08CF544cDc9143042150B007C3", + "router": "0xcd06f191359cfA6DB55F7D38134C9f89a2D5Ba56", + "price_registry": "0xC792246cF4f41100CA3c67cbF3888D5Cf8FED50B", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x9D0ffA76C7F82C34Be313b5bFc6d42A72dA8CA69", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x4be6E0F97EA849FF80773af7a317356E6c646FD7", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xE5FD5A0ec3657Ad58E875518e73F6264E00Eb754", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x56b30A0Dcd8dc87Ec08b80FA09502bAB801fa78e", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xDcFB24AEbcB9Edfb6746a045DDcae402381F984B", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0xEB50Fc6F57AAc6bf060A2Dfc6479fED592e6e184", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x362E6bE957c18e268ad91046CA6b47EB09AD98C1", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0xd3Bde678BB706Cf727A512515C254BcF021dD203", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x7D38c6363d5E4DFD500a691Bc34878b383F58d93", + "commit_store": "0x17891fe60a577c5E1e4a4Ddd78E642428A56039f", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Avalanche Mainnet": { + "off_ramp": "0x61C3f6d72c80A3D1790b213c4cB58c3d4aaFccDF", + "commit_store": "0x700C6715734111a6D1Cf414F46D85627b298B5dd", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0x45d524b6Fe99C005C52C65c578dc0e02d9751083", + "commit_store": "0x1ccD0D49e283789a73E882B0ED4B5b1163675c3C", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0xCA04169671A81E4fB8768cfaD46c347ae65371F1", + "commit_store": "0xb40659aACb709D1D54c80FC0d38b15705358Ce0B", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0x300977dBA924af14E166B31F4926892B1f310661", + "commit_store": "0x932D6D5c6647e6495Ed3473ff0F4e31a6056D837", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Mode Mainnet": { + "off_ramp": "0x639Dc04368006544eba7CbC959f3e4361bfEAB0d", + "commit_store": "0x2D3FC7f8b03718157359266ac06AF6373aFee2f1", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x18095fbD53184A50C2BB3929a6c62Ca328732062", + "commit_store": "0xa8FA8aE51dB9661e7D1c21141d967d07110036cb", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0x74d574D11977fC8D40f8590C419504cbE178ADB7", + "commit_store": "0x565f70396Ff82C23d25Dd3E57A9A66367dccdF3B", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "BSC Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0x56491A98199aD2e687Ea9D0cFB7b4AC57B4980Fc", + "router": "0x641Fb431CD2dA50fF40e7E0272d2B1e58c1ff236", + "price_registry": "0x2A92BCecd6e702702864E134821FD2DE73C3e180", + "wrapped_native": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x5577c19bD183e39a007ce4CE236f1D91e9132D5c", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x43F00dBf0Aa61A099c674A74FBdCb93786564950", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xdABb6De5eC48dd2fcF28ac85CbEFe3F19E03F1BD", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x35C724666ba31632A56Bad4390eb69f206ab60C7", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0x83AC865c2E18f2CDc1d10126987FfC465e11c0DF", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0x9d4d125788A548C2f69fAC7f8C3A64FA21d18C9e", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x3A3649852A518ab180f41f28288c6c9184563616", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x1C88e3Fd2B0a8735D1b19A77AA6e2333555BB95c", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x2A9C65afF39758CeAa24dBD1ACd1BeB3618e6780", + "commit_store": "0x99C7C97Ed175A3f0BFd4f52526E7B1310bB3fc16", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Avalanche Mainnet": { + "off_ramp": "0xc69a550470bEbC5c3Be98A4C3dD26C6AdD90C64b", + "commit_store": "0x49FeF2978569E8061a7CA5cC676d46970613e9D0", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0x133672C0F0067573254dd7C8C9818a37d6208610", + "commit_store": "0xEc44EFcf3E0aC801C742e444B130918a5a3A87E9", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0xF616733641D420207b8F30db9C4cE39684768991", + "commit_store": "0x7aa39A9c9D539b5E7388872a193b3447D34bf11F", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0x53AF5cE4534C39582E6a5E3fD77946E0c3BFe870", + "commit_store": "0xe7a0Ffc182E2330d19fF79adEEC637094c02dcA3", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Mode Mainnet": { + "off_ramp": "0xFc2278eBc27B9d205e3DC9F1b88D6D863D71190D", + "commit_store": "0x92eeb265F465Aff3AE708117ba7aE35279227845", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x3c5E62cdFD08e23a0961ff2A3155CaBb96cbc89D", + "commit_store": "0xDC39E05264D0C17eD16F2Db363364B127Cf56d75", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0x21159ebdA3E6A2437bCD6ef39853042ACC436D2D", + "commit_store": "0x018Bb120265672C699969a9e2193755d4CF1ca16", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Blast Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0xfb83C9eE574f456F5d68Da2643b1122675681B3c", + "router": "0x12e0B8E349C6fb7E6E40713E8125C3cF1127ea8C", + "price_registry": "0x4f66d9e65af0d3DC27897E29f571f933291bb07c", + "wrapped_native": "", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0xBD9bf9AA79adF083BB7100848Eb15F4e8282E27e", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x1a904DbbaDdE629a1460e2F6E2E485Ce06Ed7599", + "commit_store": "0x3CB2A81bb8a188C5353CdFa9994ed8666556FC53", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Celo": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "bridge_tokens": [ + "0xd07294e6E917e07dfDcee882dd1e2565085C2ae0" + ], + "bridge_tokens_pools": [ + "0x11825e5d99234bAB7ad1f3972fF6E55eBf3D6E20" + ], + "arm": "0xAFB3e62dD82E7648C64eFe2450D7c3B76DB24e1B", + "router": "0xfB48f15480926A4ADf9116Dca468bDd2EE6C5F62", + "price_registry": "0xD9FcEEA20dBB3Dfb91763B301819C9666429DC26", + "wrapped_native": "0x2021B12D8138e2D63cF0895eccABC0DFc92416c6", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x27C96A8a2f70a8408aD6c620717a3bDaA54bb10b", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0xd5083684eE92dDeA117636ae5E2F1cb7fE4dfd46", + "commit_store": "0x831097033C88c82a7F1897b168Aa88cC44540C8f", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Ethereum Mainnet": { + "is_mock_arm": true, + "fee_token": "0x514910771AF9Ca656af840dff83E8264EcF986CA", + "bridge_tokens": [ + "0x514910771AF9Ca656af840dff83E8264EcF986CA" + ], + "bridge_tokens_pools": [ + "0xC2291992A08eBFDfedfE248F2CCD34Da63570DF4" + ], + "arm": "0xdCD48419bD5Cd9d1b097695F2af4Ee125aADF84F", + "router": "0x8C6d31FC27770Ebcc5593c9D10adB9211181ed46", + "price_registry": "0xEd1a8c49bbD5618fa6CC952C509557F816d2D4F5", + "wrapped_native": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x69eCC4E2D8ea56E2d0a05bF57f4Fd6aEE7f2c284", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0xaFd31C0C78785aDF53E4c185670bfd5376249d8A", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xb8a882f3B88bd52D1Ff56A873bfDB84b70431937", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x948306C220Ac325fa9392A6E601042A3CD0b480d", + "deployed_at": 0 + }, + "Blast Mainnet": { + "on_ramp": "0x4545F9a17DA50110632C14704a15d893BF9CBD27", + "deployed_at": 0 + }, + "Celo": { + "on_ramp": "0xEd5bE9508ae56531cc0EDe6A3bD588Eb9E2e3cfa", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xf50B9A46C394bD98491ce163d420222d8030F6F0", + "deployed_at": 0 + }, + "linea-mainnet": { + "on_ramp": "0x626189C882A80fF0D036d8D9f6447555e81F78E9", + "deployed_at": 0 + }, + "Metis Andromeda": { + "on_ramp": "0x75d536eED32f4c8Bb39F4B0c992163f5BA49B84e", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0xeA6d4a24B262aB3e61a8A62f018A30beCD086f82", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x3455D8E039736944e66e19eAc77a42e8077B07bf", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x15a9D79d6b3485F70bF82bC49dDD1fcB37A7149c", + "deployed_at": 0 + }, + "scroll-mainnet": { + "on_ramp": "0x362A221C3cfd7F992DFE221687323F0BA9BA8187", + "deployed_at": 0 + }, + "wemix-mainnet": { + "on_ramp": "0xCbE7e5DA76dC99Ac317adF6d99137005FDA4E2C4", + "deployed_at": 0 + }, + "zksync-mainnet": { + "on_ramp": "0xD54C93A99CBCb8D865E13DA321B540171795A89f", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xdf615eF8D4C64d0ED8Fd7824BBEd2f6a10245aC9", + "commit_store": "0xf7B343A17445F175f2Dd9f5CB29BAf0a8dE75ed3", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Avalanche Mainnet": { + "off_ramp": "0xd98E80C79a15E4dbaF4C40B6cCDF690fe619BFBb", + "commit_store": "0xA9f9bF2b643348c0884f2eBA4F712E833DA9a2b8", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0x6B4B6359Dd5B47Cdb030E5921456D2a0625a9EbD", + "commit_store": "0xDaC3A82Cc5e7C137bF28e6EF4F68f29D66205ffe", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0x66d84fedED0e51aeB47ceD1BB2fc0221Ae8D7C12", + "commit_store": "0x9B9Ec8E26955c034828bBD78E22ab258d983dCdb", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Blast Mainnet": { + "off_ramp": "0x4e0092bBC8EfAb6Eca295caB66986193b90a1Bb9", + "commit_store": "0xd7cA96B58EE33FdB3aa1392c30eD02645b1F28e2", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Celo": { + "off_ramp": "0x90902C0AEE857F3A42f2beBEa38724cE7b7a0cff", + "commit_store": "0x25adA90B241143DD5Df04Fb06C1fF6E7f7624ad9", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0x70C705ff3eCAA04c8c61d581a59a168a1c49c2ec", + "commit_store": "0x9D93D536Ced80871Bf3DA5Bb47bAedE62c794f8A", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "linea-mainnet": { + "off_ramp": "0x418dcbCf229897d0CCf1B8B464Db06C23879FBB4", + "commit_store": "0x9f592c28590595F3F78a8881E8Dbb9984ed705cD", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Metis Andromeda": { + "off_ramp": "0x330349112e13232131Da51f9f3b153d825f65e61", + "commit_store": "0x0f89C7c0586536B618e0469402e1c8234bc52959", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Mode Mainnet": { + "off_ramp": "0xb57D52F7Cb7BBD19a117585bbaf712108E56dd8f", + "commit_store": "0x01346721418045A6c07b71052e452eF8615e9084", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x562a2025E60AA19Aa03Ea41D70ea1FD3286d1D3B", + "commit_store": "0x83F3DA5aa2C7534d694B0acde7624573c830250D", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0x718672076D6d51E4c76142B37bC99E4945d704a3", + "commit_store": "0x57b548C9c213EA2bcf60193E3D7fd2d2b53Fb9b3", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "scroll-mainnet": { + "off_ramp": "0x26a10137A54F4Ea01D20758Ac5AdBf9326340Fc3", + "commit_store": "0x57d6cD9CD44770C807b2763Dbe4CFDA0113dd114", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "wemix-mainnet": { + "off_ramp": "0xF92Fa796F5307b029c65CA26f322a6D86f211194", + "commit_store": "0xbeC110FF43D52be2066B06525304A9924E16b73b", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "zksync-mainnet": { + "off_ramp": "0x7c887B97F9Bba9355EC10e2bA949AdB491Ef44Fd", + "commit_store": "0xA42bf0c8794FA8853Ec0F1B24a489972e8CF4C30", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Gnosis Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0x0000000000000000000000000000000000000000", + "arm": "0x2ab5ff904CFFdD37f19cC34597cF425916F2DAcA", + "router": "0xe6A934D3754797bCe4375368F5f12b94DBc19Fcc", + "price_registry": "0x03aF5C79b0D49C040413FdA1e7B2cAa54a0fa5F4", + "wrapped_native": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x140E6D5ba903F684944Dd27369d767DdEf958c9B", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0xB707a6D1d32CE99D5c669DeE71D30d25a066D32c", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xAAb6D9fc00aAc37373206e91789CcDE1E851b3E4", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xb485634dd2E545091722b9d4843d3644addf97e3", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x014ABcfDbCe9F67d0Df34574664a6C0A241Ec03A", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x9379b446fcA75CA57834a4dA33f64ae317Be05e4", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0xD7a49AfEA62E77Ad6BEB2ed64673026271aae188", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x2C1539696E29012806a15Bcd9845Ed1278a9fd63", + "commit_store": "0x5b1762a6023157edaf2c46c818f447B1940765D6", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Avalanche Mainnet": { + "off_ramp": "0xe596D90EF0AEe10257109AC8394a85F8944bF6D0", + "commit_store": "0xd6Dc07804AE06f575C28094F99aCdDC1535904e7", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0xbeEDd1C5C13C5886c3d600e94Ff9e82C04A53C38", + "commit_store": "0x392304E3cb636f75Dc95340672F3b8A2359d5Ebc", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0x972a85d7ba0209F1896992B2687cC728cf769e50", + "commit_store": "0x5FB18729651f1EDA5ed5ac67594FD94Fa3DBcd29", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0x658d9ae41A9c291De423d3B4B6C064f6dD0e7Ed2", + "commit_store": "0xd23391fCBb8a41b971f90bC6e95CC8beaD885221", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0xd84E2316634ab6516Ecc829E2367633bfB3e4B6D", + "commit_store": "0x9d432DaF8aF8803baF6Cf560CF0f115c7D7b7f16", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0x6d6a4a60E0E23dbea089c0fEbbA9c5912f02bc57", + "commit_store": "0x9CBe49E232aEF27B9d98aC752354879efd7b1E70", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "kroma-mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "bridge_tokens": [ + "0xC1F6f7622ad37C3f46cDF6F8AA0344ADE80BF450" + ], + "bridge_tokens_pools": [ + "0xd9547B702673c61c84bb2dF6FDf6D2F5309fE536" + ], + "arm": "0xB59779d3364BC6d71168245f9ebb96469E5a5a98", + "router": "0xE93E8B0d1b1CEB44350C8758ed1E2799CCee31aB", + "price_registry": "0x8155B4710e7bbC90924E957104F94Afd4f95Eca2", + "wrapped_native": "", + "src_contracts": { + "wemix-mainnet": { + "on_ramp": "0x3C5Ab46fA1dB1dECD854224654313a69bf9fcAD3", + "deployed_at": 0 + } + }, + "dest_contracts": { + "wemix-mainnet": { + "off_ramp": "0xF886d8DC64E544af4835cbf91e5678A54D95B80e", + "commit_store": "0x8794C9534658fdCC44f2FF6645Bf31cf9F6d2d5D", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "linea-mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0xB75C45986892fDBFe1e4Ef9f2e83Fd65471300f3", + "router": "0xcACf1F067BF807B77AE8cadE8854236BbA67C8a7", + "price_registry": "0x3B9e77E257A9C8b5F53e88dB87874188fB558460", + "wrapped_native": "", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x69AbB6043BBEA2467f41CCD0144d1b3b4ECd20f4", + "deployed_at": 0 + }, + "scroll-mainnet": { + "on_ramp": "0x30ebb71dAa827bEAE71EE325A77Ca47dAED7Ec9B", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x656e2aA127Cb15815a90Ef70c6AA7Ed449D689ce", + "commit_store": "0xD8850C39D6785d9DdA555b7d81df50609c73c495", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "scroll-mainnet": { + "off_ramp": "0xa3Ea5eB15711041fd28950438b5a682392b54e6C", + "commit_store": "0x9d75617B79cB12e7c3085b2DA38fa47aaD23f0bA", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Metis Andromeda": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0xC4BFAc3D31C524A4958c5d5d1e68394d8DEbbE69", + "router": "0x4c6811BE5f08D9E748C85FDB0050DE49B21F77c9", + "price_registry": "0x2C4A017f587574b3d6EEBF6463aE6824Dc43C365", + "wrapped_native": "", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x8d3039fE2400151c06Ae84a18CAf38dD9b6Ce58b", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xdF5394c57A0570ECe45DE0c0fA2e722A672B9198", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xc6bA5a79991b3775F28259BA551b30eCb0b6D499", + "commit_store": "0xb81b0EE9675879a2Dcaa70CCC3b2c2D38fa404b0", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0x1fd37Bf813D0723BEF614bC93d9D2Ce1AcB3228f", + "commit_store": "0x7C1efda9F744a2B4f88b924B03C6d6B53E3E390F", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Mode Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0x77EAF440c5d24e25D1834CBBF623bFd83b8b5dA1", + "router": "0x4F45E0061fecADa52F0d2F0328b7cA7bD6261fB5", + "price_registry": "0x0708505E66DA43B34BB0C429e0F1fE5bfC3A73cd", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0xb2e694efcDa0aeB81700019c3047F92fC3bb520E", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x347A070EA1B04bc2b4A8f14320688C277022C90e", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xeb7E8c40E95Cd31666359AaeB1F2CccaAB935643", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x7d2aF78868993a5a86676BA639eC0412709707D9", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x7AB4329D19A0255DA90Ee8dbAA60f8f0cB7950C1", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x0Cb870C12013c2d5743585F85b298e129cE57203", + "commit_store": "0x682Af2Cfaa5aE554eF222728fF7C7168232e2Ea5", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0x30612D8fb7EcD05ECb863560BA8806d88e8BbFAF", + "commit_store": "0xf84d023CCFF8b74e565117cBc034859D06EA1976", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0xdfA601DA2163Ca2C77Eb32126E6B7A97024f6181", + "commit_store": "0xb88F947C85b1c6B1E2A0C22792BA58C40c07a644", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0xb1caBa234721b8F12C545B3dC25B3F87f6a9c91B", + "commit_store": "0x67Ff921DA5d0B61a9b05BDFa92d9f5f992d7861a", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x4adcD1FB4ec76A3c9960E048f81C19A51B2eAC49", + "commit_store": "0x7B58aF65DFD717fC0d044D860c8f9A85Ca6813D6", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Optimism Mainnet": { + "is_mock_arm": true, + "fee_token": "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6", + "bridge_tokens": [ + "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6" + ], + "bridge_tokens_pools": [ + "0x841b32B5309ba30cFbf4534667fC3D99EdF05B7A" + ], + "arm": "0x1c51b6D5BFcFB7ee82C80949DFD146dB157a7E49", + "router": "0x0E6137E72CC322b0f3b7eD172f7BD7b5Ac798d05", + "price_registry": "0xF1cB3E957D7271Ac788010b2e6146E6ceF8FB9BA", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x6bA81b83091A23e8F2AA173B2b939fAf9E320DfB", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0xB9D655Ad5ba80036725d6c753Fa6AF0454cBF630", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xfE11cfC957cCa331192EAC60040b442303CcA0a9", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xfC51a4CF925f202d86c6092cda879689d2C17201", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xE4C51Dc01A4E0aB14c7a7a2ed1655E9CF8A3E698", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0x604a9dda2e27D56cfCe457E437a61f4ED0De9dE6", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0xc6d9Cb39e34D83d21A021504024887A0e96D4e94", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x9c725164b60E3f6d4d5b7A2841C63E9FD0988805", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xEB3d6956BCf7b1E29634C8cd182fC9FA740Bce34", + "commit_store": "0x6569761680DaC4Bf940244E3cF198A069E34E91F", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Avalanche Mainnet": { + "off_ramp": "0xF8E38B4503418659F791F2135c4912F85BFB7988", + "commit_store": "0x23CAc55aDDF28179A999858720E9Fe686372083A", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0x519ee6B83f57df95486aeA6E26819cb7b4B8ee99", + "commit_store": "0xCfdF2b21D9777E2B0a221F6b6D8fe176461f058e", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0x51f37b538aD2Bcb9Eaf884859BF7C5Ec58AEc885", + "commit_store": "0xF472FEb09544Bf991773f4B94fe3F03e458d1b8d", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0x9979c2dfEcA9051Cf7f08274d978984B2dB12C60", + "commit_store": "0x9358663E8f89df8EFE2346a3c4c1D65d03300576", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0x01449040D92D75c58FaDc9Bc1c0eadc70C550484", + "commit_store": "0xb63230DfcE291DA76FD946EFbc966549F9300347", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Mode Mainnet": { + "off_ramp": "0x5a4BEeafd345264360E6894a6bc5F54a70814E68", + "commit_store": "0x4E94a327A38E6F3509a5639dCF933CfF6DE93FFD", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Polygon Mainnet": { + "off_ramp": "0x4BA0A3bD1E2b70b2fe165A53219e7eF6376849a4", + "commit_store": "0xA0f02e1F9C641C9610f688be84F889fE518b36e3", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "Polygon Mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "bridge_tokens": [ + "0xb0897686c545045aFc77CF20eC7A532E3120E0F1" + ], + "bridge_tokens_pools": [ + "0x086892015567fb8764d02c6845C85C25C8FcA389" + ], + "arm": "0x569a295a09634Ac9414c3efe4E8931986d68F937", + "router": "0x10ea937A855268E5336F78B262B4d82ad1Cb84BC", + "price_registry": "0xd6D571B37B26Ee1b99FDFa097034Ea4B9E3b76BA", + "wrapped_native": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x13263aC754d1e29430930672E3C0019f2BC44Ba2", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x56cb9Cd82553Bd8157e6504020c38f6DA4971717", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xD26A4E0c664E72e3c29E634867191cB1cb9AF570", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x164507757F7d5Ab35C6af44EeEB099F5be29Da57", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x1DAcBae00c779913e6E9fc1A3323FbA4847ba53C", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xcc4A8CFd756895d91B476Dd5461286b300914aBf", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x868B71490B36674B3B9006fa8711C6fA26A26631", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x60f2788225CeE4a94f8E7589931d5A14Cbc4367d", + "commit_store": "0x4DEc80ED383171EC54699B22B869bE098d3cBac9", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Avalanche Mainnet": { + "off_ramp": "0x35c1Bb5A9c2F3fa8f8dFF470a6bE7d362CeA1ef3", + "commit_store": "0xB3324b80f50a31b12c0C733560D3aA2a32dc5C33", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Base Mainnet": { + "off_ramp": "0xF4a9Dbb7f3FBa02e3a244B464e459C32B63857F1", + "commit_store": "0x936A0C8635D7087a2D22494762e9a697C3C3D545", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "BSC Mainnet": { + "off_ramp": "0xE58074f8F56E23836f088Ac8b4f3882c1b4CAcbb", + "commit_store": "0x2110a5f138364d788FDF54eCBa25C1688181cb00", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Ethereum Mainnet": { + "off_ramp": "0xa06e68a11d5694316Cc819f2FFD02663e3314C7C", + "commit_store": "0xB73d668B26817659E9f48F16b780480B4401cFcE", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Gnosis Mainnet": { + "off_ramp": "0x9e2e4e397226f347d11D3fF8469d0c3FFa750C3B", + "commit_store": "0x75faF05ec32C9dA97E99Eb6fb18b5087DecAAa82", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "Optimism Mainnet": { + "off_ramp": "0x805c292775Be43b10Cc744ea7E81d9939a08cEa4", + "commit_store": "0x52faD8fb48451AA555c0f59accA1dC7C69B9681B", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "scroll-mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0x323BFa80a6941C419fB6397698dA816A382CAe53", + "router": "0x9bE7a66B3Dec08e111E038Dc34bD7F1AF5cEedA5", + "price_registry": "0xd587D08b62CDE7897DA37fB1915F7F6b1D749d96", + "wrapped_native": "", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x28cCF73F7982c1786b84e243FFbD47F4fB8ae43d", + "deployed_at": 0 + }, + "linea-mainnet": { + "on_ramp": "0x05d472b114D57E6035089A58Fa997A7940D29a23", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x77601F272dd2d6481Ac3a13942075388097245Fb", + "commit_store": "0x1c338D27F36452358611936fc8418849910B1C59", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "linea-mainnet": { + "off_ramp": "0x5834e1C639418A4973391126576f550A6996836a", + "commit_store": "0x3BD2d806e9cBD3440cb74626BE819d337b70F7De", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "wemix-mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "bridge_tokens": [ + "0x80f1FcdC96B55e459BF52b998aBBE2c364935d69" + ], + "bridge_tokens_pools": [ + "0x80282dF25600c08Bde7560f6c1E509366c1BfBFC" + ], + "arm": "0x07aaC8B69A62dB5bd3d244091916EbF2fac17b76", + "router": "0x7798b795Fde864f4Cd1b124a38Ba9619B7F8A442", + "price_registry": "0x252863688762aD86868D3d3076233Eacd80c7055", + "wrapped_native": "0x7D72b22a74A216Af4a002a1095C8C707d6eC1C5f", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x190bcE84CF2d500B878966F4Cf98a50d78f2675E", + "deployed_at": 0 + }, + "kroma-mainnet": { + "on_ramp": "0x47E9AE0A815C94836202E696748A5d5476aD8735", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x3a129e6C18b23d18BA9E6Aa14Dc2e79d1f91c6c5", + "commit_store": "0x31f6ab382DDeb9A316Ab61C3945a5292a50a89AB", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + }, + "kroma-mainnet": { + "off_ramp": "0x2B555774B3D1dcbcd76efb7751F3c5FbCFABC5C4", + "commit_store": "0x213124614aAf31eBCE7c612A12aac5f8aAD77DE4", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + }, + "zksync-mainnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "", + "arm": "0x2438AF3167c8f8db49215B96A9A5F5131C4B9718", + "router": "0x748Fd769d81F5D94752bf8B0875E9301d0ba71bB", + "price_registry": "0xa0C6E00a9Fa10A04989c237dF6dfDCe2AaceE4A3", + "wrapped_native": "", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x3B80Fe300c9A611abA0496e2543B66Ff7bD4B9e9", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0xb368c8946D9fa5A497cDe1Dff7213f9CdfD143Bf", + "commit_store": "0xa4d264470a67D9f6682EE12Bdc9c35Df44e3F194", + "receiver_dapp": "0x09e4897E068A5Fc4fc22D86867FC1906E6cde563" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET', + 'BASE_MAINNET', +# 'BLAST_MAINNET', + 'BSC_MAINNET', +# 'CELO_MAINNET', + 'ETHEREUM_MAINNET', + 'GNOSIS_MAINNET', +# 'KROMA_MAINNET', +# 'METIS_ANDROMEDA', + 'MODE_MAINNET', + 'OPTIMISM_MAINNET', + 'POLYGON_MAINNET', +# 'WEMIX_MAINNET', +# 'ZKSYNC_MAINNET', +] + + +[CCIP.Groups.smoke] +# these are all the valid network pairs +NetworkPairs = [ +# 'WEMIX_MAINNET,ARBITRUM_MAINNET', +# 'WEMIX_MAINNET,AVALANCHE_MAINNET', +# 'WEMIX_MAINNET,BSC_MAINNET', +# 'WEMIX_MAINNET,OPTIMISM_MAINNET', +# 'WEMIX_MAINNET,ETHEREUM_MAINNET', +# 'WEMIX_MAINNET,POLYGON_MAINNET', +# 'WEMIX_MAINNET,KROMA_MAINNET', +# 'ZKSYNC_MAINNET,ETHEREUM_MAINNET', +# 'CELO_MAINNET,ETHEREUM_MAINNET', + + 'ARBITRUM_MAINNET,BSC_MAINNET', + 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET,BASE_MAINNET', + 'AVALANCHE_MAINNET,BSC_MAINNET', + 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,POLYGON_MAINNET', +# 'AVALANCHE_MAINNET,WEMIX_MAINNET', + 'BASE_MAINNET,ARBITRUM_MAINNET', + 'BASE_MAINNET,BSC_MAINNET', + 'BASE_MAINNET,OPTIMISM_MAINNET', + 'BASE_MAINNET,POLYGON_MAINNET', +# 'BLAST_MAINNET,ARBITRUM_MAINNET', +# 'BLAST_MAINNET,BASE_MAINNET', +# 'BLAST_MAINNET,BSC_MAINNET', + 'BSC_MAINNET,OPTIMISM_MAINNET', + 'BSC_MAINNET,POLYGON_MAINNET', +# 'BSC_MAINNET,WEMIX_MAINNET', + 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', + 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', + 'ETHEREUM_MAINNET,BASE_MAINNET', +# 'ETHEREUM_MAINNET,BLAST_MAINNET', + 'ETHEREUM_MAINNET,BSC_MAINNET', +# 'ETHEREUM_MAINNET,CELO_MAINNET', + 'ETHEREUM_MAINNET,GNOSIS_MAINNET', +# 'ETHEREUM_MAINNET,METIS_ANDROMEDA', + 'ETHEREUM_MAINNET,MODE_MAINNET', + 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', + 'ETHEREUM_MAINNET,POLYGON_MAINNET', +# 'ETHEREUM_MAINNET,WEMIX_MAINNET', +# 'ETHEREUM_MAINNET,ZKSYNC_MAINNET', + 'GNOSIS_MAINNET,ARBITRUM_MAINNET', + 'GNOSIS_MAINNET,AVALANCHE_MAINNET', + 'GNOSIS_MAINNET,BASE_MAINNET', + 'GNOSIS_MAINNET,BSC_MAINNET', + 'GNOSIS_MAINNET,OPTIMISM_MAINNET', + 'GNOSIS_MAINNET,POLYGON_MAINNET', +# 'METIS_ANDROMEDA,ARBITRUM_MAINNET', + 'MODE_MAINNET,ARBITRUM_MAINNET', + 'MODE_MAINNET,BASE_MAINNET', + 'MODE_MAINNET,BSC_MAINNET', + 'MODE_MAINNET,OPTIMISM_MAINNET', + 'OPTIMISM_MAINNET,POLYGON_MAINNET', +# 'OPTIMISM_MAINNET,WEMIX_MAINNET', + 'POLYGON_MAINNET,ARBITRUM_MAINNET', +# 'POLYGON_MAINNET,WEMIX_MAINNET', +# 'WEMIX_MAINNET,ARBITRUM_MAINNET', +# 'WEMIX_MAINNET,KROMA_MAINNET', +# 'ZKSYNC_MAINNET,ARBITRUM_MAINNET' +] + +BiDirectionalLane = true +PhaseTimeout = '20m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true +SkipRequestIfAnotherRequestTriggeredWithin = '24h' + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 +CCIPOwnerTokens = true + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 + +[CCIP.Groups.load] +NetworkPairs = [ + 'ARBITRUM_MAINNET,BSC_MAINNET', + 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET,BASE_MAINNET', + 'AVALANCHE_MAINNET,BSC_MAINNET', + 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', + 'AVALANCHE_MAINNET,POLYGON_MAINNET', + 'BASE_MAINNET,ARBITRUM_MAINNET', + 'BASE_MAINNET,BSC_MAINNET', + 'BASE_MAINNET,OPTIMISM_MAINNET', + 'BASE_MAINNET,POLYGON_MAINNET', + 'BSC_MAINNET,OPTIMISM_MAINNET', + 'BSC_MAINNET,POLYGON_MAINNET', + 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', + 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', + 'ETHEREUM_MAINNET,BASE_MAINNET', + 'ETHEREUM_MAINNET,BSC_MAINNET', + 'ETHEREUM_MAINNET,GNOSIS_MAINNET', + 'ETHEREUM_MAINNET,MODE_MAINNET', + 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', + 'ETHEREUM_MAINNET,POLYGON_MAINNET', + 'GNOSIS_MAINNET,ARBITRUM_MAINNET', + 'GNOSIS_MAINNET,AVALANCHE_MAINNET', + 'GNOSIS_MAINNET,BASE_MAINNET', + 'GNOSIS_MAINNET,BSC_MAINNET', + 'GNOSIS_MAINNET,OPTIMISM_MAINNET', + 'GNOSIS_MAINNET,POLYGON_MAINNET', + 'MODE_MAINNET,ARBITRUM_MAINNET', + 'MODE_MAINNET,BASE_MAINNET', + 'MODE_MAINNET,BSC_MAINNET', + 'MODE_MAINNET,OPTIMISM_MAINNET', + 'OPTIMISM_MAINNET,POLYGON_MAINNET', + 'POLYGON_MAINNET,ARBITRUM_MAINNET', +] + +BiDirectionalLane = true +PhaseTimeout = '50m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true + +[CCIP.Groups.load.TokenConfig] +NoOfTokensPerChain = 1 + +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '30m' +TestDuration = '2h' +TestRunName = 'SoakTest_mainnet_test_router' +FailOnFirstErrorInLoad = false + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml index 592cb046ad3..5b3c1c26c79 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml @@ -13,41 +13,29 @@ Data = """ "Arbitrum Sepolia": { "is_mock_arm": true, "fee_token": "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", - "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", - "price_registry": "0x25d997d8618e1299418b3D905E40bC353ec89F61", + "arm": "0x5261Eac6b2A158b1eafed0144B4894f41b67b01f", + "router": "0x32C3C32B1b3858e45AFc53e1D0D4607463d47d1C", + "price_registry": "0x845A8190d31602fD0862467880468339E04d885b", "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", "src_contracts": { - "Base Sepolia": { - "on_ramp": "0x6BD0f1efA261Ea84DB219c1284b538A65E530ea1", - "deployed_at": 29428386 + "Avalanche Fuji": { + "on_ramp": "0x59f2492ebDfdD3E99b9198A2313AB0A4113014c8", + "deployed_at": 85949437 }, "Optimism Sepolia": { - "on_ramp": "0x94cd0d171eF08924F0008305e5Bb90b0fC1b61AB", - "deployed_at": 13945916 - }, - "Sepolia Testnet": { - "on_ramp": "0x44225eb3B73B1b52Dd2ecD258F9b63418eC6Bf79", - "deployed_at": 13730868 + "on_ramp": "0x3FF2852A4597E6Ac363340Cadbf1666C4246b4B9", + "deployed_at": 87452680 } }, "dest_contracts": { - "Base Sepolia": { - "off_ramp": "0x21560B4ACAEdb8AA2Dd935618F15da43197bdc12", - "commit_store": "0x27B882c393151ADD910F3557849AF0bb09c7d5A6", + "Avalanche Fuji": { + "off_ramp": "0x1b3841f8923195F1E438B471D0415bBE8b3c133D", + "commit_store": "0x55F4a33AC60D994c2F1A3b400Fc2C40140CF50D9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", - "commit_store": "0x1f1160Ac7828B647A85c9a6b3A58A232C59D67Ab", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, - "Sepolia Testnet": { - "off_ramp": "0xc136114F379b812345bb7e467ECDdb6D0c87De8b", - "commit_store": "0x42b3EbEA14F6CB803e3C7df84392Efb85CE90168", + "off_ramp": "0x695C84498573AEE9A2Be410Aaf7C275535A337D7", + "commit_store": "0xCBDdCEaE1d51F9C40640fa17fb7a2FeEB51DB702", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -55,47 +43,20 @@ Data = """ "Avalanche Fuji": { "is_mock_arm": true, "fee_token": "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0xD4A51dC0F5C680A8A18eA4Ec3A2f25C6db9424B7", - "router": "0xa62e685aDFF45f38eC94378513D128F168964E99", - "price_registry": "0xdbeA1a10AC6a2B729bF128aE9281Ed420dbE7113", + "arm": "0xd550342aE3f8d5D3D38509900034C8b01f556f0e", + "router": "0x13b766d0fe3e01fa5b02b378DF31724dD5368B37", + "price_registry": "0xAEc164EDF7Be32c6d38565BD09c24DAAA5b5887f", "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", "src_contracts": { - "BSC Testnet": { - "on_ramp": "0xe4f1F7750352f1c37C15C4A314554d6A79d7d146", - "deployed_at": 31437550 - } - }, - "dest_contracts": { - "BSC Testnet": { - "off_ramp": "0x796D720ea9D4326ff356eadE13b123B267C03C80", - "commit_store": "0xaDb37cFd91fa9b6Df1DaAcbAfB4cDFF41e06c956", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - } - } - }, - "BSC Testnet": { - "is_mock_arm": true, - "fee_token": "0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0xbBF534D89d9640e3886db25FE1ffE603Fe160D75", - "router": "0x9CdA5b77eA23459eBaf2e3092c570a6B5605850A", - "price_registry": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", - "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", - "src_contracts": { - "Avalanche Fuji": { - "on_ramp": "0x0B4F541a7fcE5c251993Bc19D5A40B661e0463f5", - "deployed_at": 39097639 + "Arbitrum Sepolia": { + "on_ramp": "0x2Df17a22794499963EC0DDD43699B1020fdDD4d3", + "deployed_at": 36151865 } }, "dest_contracts": { - "Avalanche Fuji": { - "off_ramp": "0x41E59DCdDec18d7f79DA5F76Ce567d2c5e301E6B", - "commit_store": "0x9487C01D4b3Ae1c9Ac8740A07f3862D646548A14", + "Arbitrum Sepolia": { + "off_ramp": "0xFFBf82f59e5A7E1f92CE3565A6d6C835dEA19D1A", + "commit_store": "0x79357546378F29Ffcf3B7f3492Ee2Bcb9dB4d847", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -103,29 +64,17 @@ Data = """ "Base Sepolia": { "is_mock_arm": true, "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, "arm": "0x866faB92E04bAE5EDa238A9cbFf1e56E09508Ade", "router": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", "price_registry": "0xD886E2286Fd1073df82462ea1822119600Af80b6", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", - "deployed_at": 8133125 - }, "Optimism Sepolia": { "on_ramp": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", "deployed_at": 11607777 } }, "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0x34433469A4d6c8b1B0a1a7B91a5C5C2Dd74c67Fb", - "commit_store": "0xFEE7c8E229F538a98437b9A7D0Dd8fCd8A1Ab569", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, "Optimism Sepolia": { "off_ramp": "0x0f30449bcCaCCaA7221B3f7C3304c4AaD68068E8", "commit_store": "0x17a5746c9cf7eAf23533F060F395B2E38eb976ea", @@ -136,75 +85,30 @@ Data = """ "Optimism Sepolia": { "is_mock_arm": true, "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", - "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", - "price_registry": "0x3B80b7Ef5c00Eb892CBe72800C028C47AD6380EF", + "arm": "0xb665817485727D670dABD0F03A155401778C26ea", + "router": "0xF66f5c1417159eb38F622006eDE421BbF5262905", + "price_registry": "0x2dF2c61821A7BCcC851B15ee26BB06307d3bEE2d", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x622CB640F52bFfA68b78b2BD12c1940Ca4899621", - "deployed_at": 8020540 + "on_ramp": "0x21ce68614782BF139bF21d7D2566A0d900c8638C", + "deployed_at": 18379535 }, "Base Sepolia": { "on_ramp": "0x12c164d0778E215873A062cEE2814507417339cB", "deployed_at": 13590651 - }, - "Sepolia Testnet": { - "on_ramp": "0x0c2c8D4266C98f1b9333D5E1a42f3f775A0005d4", - "deployed_at": 8020948 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x37004c1245a2D5541377e87cA29699492a4114D5", - "commit_store": "0x51158Ca439feA9E809Bc063CfA6701747b05254e", + "off_ramp": "0xbeBD1F1f92a739810C102E5E5dc844E7efDbd747", + "commit_store": "0x39DEf7c3E3F2306012B96C1a4Cb1D574CA912CCa", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { "off_ramp": "0xB3F3f362FbeD49fA0086B434051C822B55BaADbD", "commit_store": "0xD4995B99c484CCABc868b26c0B2C2Ef10ecde3d7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, - "Sepolia Testnet": { - "off_ramp": "0x80C2aa80F202FeFdFEEF80f516cFd89768c54057", - "commit_store": "0xc1fE981A040D679511ccb9139ca107aCA67520ef", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - } - } - }, - "Sepolia Testnet": { - "is_mock_arm": true, - "fee_token": "0x779877A7B0D9E8603169DdbD7836e478b4624789", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0x9912a7389382ff55f85A29C9378B38F7B992c4aE", - "router": "0x1E1F3d8Ac7Df65fCcFcc52dbF03929cEE95430ac", - "price_registry": "0x4358e81f88bB27222779c1BC85003A11A1c66f6F", - "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", - "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0x420a7B5ABB8CF27A70E1906F797e24509B11093D", - "deployed_at": 5275652 - }, - "Optimism Sepolia": { - "on_ramp": "0xEb4EBC1930bA81416A48a59142D89722163D85ae", - "deployed_at": 5281150 - } - }, - "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0x224D1eB3aB2b7F23b66f093F9cBBC68dA77a1986", - "commit_store": "0x35c54cF12FF9B29dBa60dc23EdD1de0F13CC7fc5", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, - "Optimism Sepolia": { - "off_ramp": "0xF21d01D6Ef822FBC56FC6c8F23f74fE3A0cb39aa", - "commit_store": "0x7F6AF440Bcc54f70Fd8AC2E534d37196c0bA1A38", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } } @@ -219,10 +123,8 @@ TTL = '8h' selected_networks = [ 'ARBITRUM_SEPOLIA', 'AVALANCHE_FUJI', - 'BASE_SEPOLIA', - 'BSC_TESTNET', +# 'BASE_SEPOLIA', 'OPTIMISM_SEPOLIA', - 'SEPOLIA' ] @@ -230,12 +132,14 @@ selected_networks = [ [CCIP.Groups.smoke] # these are all the valid network pairs NetworkPairs = [ - 'BSC_TESTNET,AVALANCHE_FUJI', - 'SEPOLIA,ARBITRUM_SEPOLIA', - 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' +# 'ARBITRUM_SEPOLIA,AVALANCHE_FUJI', + 'ARBITRUM_SEPOLIA,OPTIMISM_SEPOLIA', + 'OPTIMISM_SEPOLIA,ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', +# 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' ] -BiDirectionalLane = true +BiDirectionalLane = false PhaseTimeout = '40m' LocalCluster = false ExistingDeployment = true @@ -255,8 +159,7 @@ AmountPerToken = 1 [CCIP.Groups.load] NetworkPairs = [ - 'AVALANCHE_FUJI,BSC_TESTNET', - 'SEPOLIA,ARBITRUM_SEPOLIA', + 'ARBITRUM_SEPOLIA,AVALANCHE_FUJI', 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' ] @@ -272,7 +175,7 @@ NoOfTokensPerChain = 1 RequestPerUnitTime = [1] TimeUnit = '6m' TestDuration = '3h' -TestRunName = 'BetaSoakTest_CCIPV1dot5' +TestRunName = 'BetaSoakTest_CCIPV1dot5dot4' FailOnFirstErrorInLoad = true [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] diff --git a/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml index fcc063c7659..f3a43550d98 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml @@ -11,129 +11,73 @@ Data = """ { "lane_configs": { "Arbitrum Sepolia": { - "is_native_fee_token": true, "is_mock_arm": true, + "is_native_fee_token": true, "fee_token": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", - "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", - "price_registry": "0x25d997d8618e1299418b3D905E40bC353ec89F61", + "arm": "0x5261Eac6b2A158b1eafed0144B4894f41b67b01f", + "router": "0x32C3C32B1b3858e45AFc53e1D0D4607463d47d1C", + "price_registry": "0x845A8190d31602fD0862467880468339E04d885b", "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", "src_contracts": { - "Base Sepolia": { - "on_ramp": "0x6BD0f1efA261Ea84DB219c1284b538A65E530ea1", - "deployed_at": 29428386 + "Avalanche Fuji": { + "on_ramp": "0x59f2492ebDfdD3E99b9198A2313AB0A4113014c8", + "deployed_at": 85949437 }, "Optimism Sepolia": { - "on_ramp": "0x94cd0d171eF08924F0008305e5Bb90b0fC1b61AB", - "deployed_at": 13945916 - }, - "Sepolia Testnet": { - "on_ramp": "0x44225eb3B73B1b52Dd2ecD258F9b63418eC6Bf79", - "deployed_at": 13730868 + "on_ramp": "0x3FF2852A4597E6Ac363340Cadbf1666C4246b4B9", + "deployed_at": 87452680 } }, "dest_contracts": { - "Base Sepolia": { - "off_ramp": "0x21560B4ACAEdb8AA2Dd935618F15da43197bdc12", - "commit_store": "0x27B882c393151ADD910F3557849AF0bb09c7d5A6", + "Avalanche Fuji": { + "off_ramp": "0x1b3841f8923195F1E438B471D0415bBE8b3c133D", + "commit_store": "0x55F4a33AC60D994c2F1A3b400Fc2C40140CF50D9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", - "commit_store": "0x1f1160Ac7828B647A85c9a6b3A58A232C59D67Ab", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, - "Sepolia Testnet": { - "off_ramp": "0xc136114F379b812345bb7e467ECDdb6D0c87De8b", - "commit_store": "0x42b3EbEA14F6CB803e3C7df84392Efb85CE90168", + "off_ramp": "0x695C84498573AEE9A2Be410Aaf7C275535A337D7", + "commit_store": "0xCBDdCEaE1d51F9C40640fa17fb7a2FeEB51DB702", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } }, "Avalanche Fuji": { - "is_native_fee_token": true, "is_mock_arm": true, + "is_native_fee_token": true, "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", - "bridge_tokens": [ - "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846" - ], - "bridge_tokens_pools": [ - "0x156943ae87AaF63eA9272902Cb05407ec7bc9464" - ], - "price_aggregators": null, - "arm": "0xD4A51dC0F5C680A8A18eA4Ec3A2f25C6db9424B7", - "router": "0xa62e685aDFF45f38eC94378513D128F168964E99", - "price_registry": "0xdbeA1a10AC6a2B729bF128aE9281Ed420dbE7113", + "arm": "0xd550342aE3f8d5D3D38509900034C8b01f556f0e", + "router": "0x13b766d0fe3e01fa5b02b378DF31724dD5368B37", + "price_registry": "0xAEc164EDF7Be32c6d38565BD09c24DAAA5b5887f", "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", "src_contracts": { - "BSC Testnet": { - "on_ramp": "0xe4f1F7750352f1c37C15C4A314554d6A79d7d146", - "deployed_at": 31437550 - } - }, - "dest_contracts": { - "BSC Testnet": { - "off_ramp": "0x796D720ea9D4326ff356eadE13b123B267C03C80", - "commit_store": "0xaDb37cFd91fa9b6Df1DaAcbAfB4cDFF41e06c956", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - } - } - }, - "BSC Testnet": { - "is_native_fee_token": true, - "is_mock_arm": true, - "fee_token": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0xbBF534D89d9640e3886db25FE1ffE603Fe160D75", - "router": "0x9CdA5b77eA23459eBaf2e3092c570a6B5605850A", - "price_registry": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", - "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", - "src_contracts": { - "Avalanche Fuji": { - "on_ramp": "0x0B4F541a7fcE5c251993Bc19D5A40B661e0463f5", - "deployed_at": 39097639 + "Arbitrum Sepolia": { + "on_ramp": "0x2Df17a22794499963EC0DDD43699B1020fdDD4d3", + "deployed_at": 36151865 } }, "dest_contracts": { - "Avalanche Fuji": { - "off_ramp": "0x41E59DCdDec18d7f79DA5F76Ce567d2c5e301E6B", - "commit_store": "0x9487C01D4b3Ae1c9Ac8740A07f3862D646548A14", + "Arbitrum Sepolia": { + "off_ramp": "0xFFBf82f59e5A7E1f92CE3565A6d6C835dEA19D1A", + "commit_store": "0x79357546378F29Ffcf3B7f3492Ee2Bcb9dB4d847", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } }, "Base Sepolia": { - "is_native_fee_token": true, "is_mock_arm": true, + "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000006", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, "arm": "0x866faB92E04bAE5EDa238A9cbFf1e56E09508Ade", "router": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", "price_registry": "0xD886E2286Fd1073df82462ea1822119600Af80b6", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", - "deployed_at": 8133125 - }, "Optimism Sepolia": { "on_ramp": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", "deployed_at": 11607777 } }, "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0x34433469A4d6c8b1B0a1a7B91a5C5C2Dd74c67Fb", - "commit_store": "0xFEE7c8E229F538a98437b9A7D0Dd8fCd8A1Ab569", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, "Optimism Sepolia": { "off_ramp": "0x0f30449bcCaCCaA7221B3f7C3304c4AaD68068E8", "commit_store": "0x17a5746c9cf7eAf23533F060F395B2E38eb976ea", @@ -142,79 +86,33 @@ Data = """ } }, "Optimism Sepolia": { - "is_native_fee_token": true, "is_mock_arm": true, + "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000006", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", - "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", - "price_registry": "0x3B80b7Ef5c00Eb892CBe72800C028C47AD6380EF", + "arm": "0xb665817485727D670dABD0F03A155401778C26ea", + "router": "0xF66f5c1417159eb38F622006eDE421BbF5262905", + "price_registry": "0x2dF2c61821A7BCcC851B15ee26BB06307d3bEE2d", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x622CB640F52bFfA68b78b2BD12c1940Ca4899621", - "deployed_at": 8020540 + "on_ramp": "0x21ce68614782BF139bF21d7D2566A0d900c8638C", + "deployed_at": 18379535 }, "Base Sepolia": { "on_ramp": "0x12c164d0778E215873A062cEE2814507417339cB", "deployed_at": 13590651 - }, - "Sepolia Testnet": { - "on_ramp": "0x0c2c8D4266C98f1b9333D5E1a42f3f775A0005d4", - "deployed_at": 8020948 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x37004c1245a2D5541377e87cA29699492a4114D5", - "commit_store": "0x51158Ca439feA9E809Bc063CfA6701747b05254e", + "off_ramp": "0xbeBD1F1f92a739810C102E5E5dc844E7efDbd747", + "commit_store": "0x39DEf7c3E3F2306012B96C1a4Cb1D574CA912CCa", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { "off_ramp": "0xB3F3f362FbeD49fA0086B434051C822B55BaADbD", "commit_store": "0xD4995B99c484CCABc868b26c0B2C2Ef10ecde3d7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, - "Sepolia Testnet": { - "off_ramp": "0x80C2aa80F202FeFdFEEF80f516cFd89768c54057", - "commit_store": "0xc1fE981A040D679511ccb9139ca107aCA67520ef", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - } - } - }, - "Sepolia Testnet": { - "is_native_fee_token": true, - "is_mock_arm": true, - "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", - "bridge_tokens": null, - "bridge_tokens_pools": null, - "price_aggregators": null, - "arm": "0x9912a7389382ff55f85A29C9378B38F7B992c4aE", - "router": "0x1E1F3d8Ac7Df65fCcFcc52dbF03929cEE95430ac", - "price_registry": "0x4358e81f88bB27222779c1BC85003A11A1c66f6F", - "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", - "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0x420a7B5ABB8CF27A70E1906F797e24509B11093D", - "deployed_at": 5275652 - }, - "Optimism Sepolia": { - "on_ramp": "0xEb4EBC1930bA81416A48a59142D89722163D85ae", - "deployed_at": 5281150 - } - }, - "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0x224D1eB3aB2b7F23b66f093F9cBBC68dA77a1986", - "commit_store": "0x35c54cF12FF9B29dBa60dc23EdD1de0F13CC7fc5", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" - }, - "Optimism Sepolia": { - "off_ramp": "0xF21d01D6Ef822FBC56FC6c8F23f74fE3A0cb39aa", - "commit_store": "0x7F6AF440Bcc54f70Fd8AC2E534d37196c0bA1A38", - "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } } @@ -229,26 +127,24 @@ TTL = '8h' selected_networks = [ 'ARBITRUM_SEPOLIA', 'AVALANCHE_FUJI', - 'BASE_SEPOLIA', - 'BSC_TESTNET', + # 'BASE_SEPOLIA', 'OPTIMISM_SEPOLIA', - 'SEPOLIA', ] -[CCIP.Env.NewCLCluster.Common.ChainlinkImage] -version = "sha-17ce920" [CCIP.Groups.smoke] # these are all the valid network pairs NetworkPairs = [ - 'AVALANCHE_FUJI,BSC_TESTNET', - 'SEPOLIA,ARBITRUM_SEPOLIA', - 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', + # 'ARBITRUM_SEPOLIA,AVALANCHE_FUJI', + 'ARBITRUM_SEPOLIA,OPTIMISM_SEPOLIA', + 'OPTIMISM_SEPOLIA,ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', + # 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' ] -BiDirectionalLane = true -PhaseTimeout = '30m' +BiDirectionalLane = false +PhaseTimeout = '40m' LocalCluster = false ExistingDeployment = true ReuseContracts = true @@ -267,8 +163,7 @@ AmountPerToken = 1 [CCIP.Groups.load] NetworkPairs = [ - 'AVALANCHE_FUJI,BSC_TESTNET', - 'SEPOLIA,ARBITRUM_SEPOLIA', + 'ARBITRUM_SEPOLIA,AVALANCHE_FUJI', 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' ] @@ -284,7 +179,7 @@ NoOfTokensPerChain = 1 RequestPerUnitTime = [1] TimeUnit = '6m' TestDuration = '3h' -TestRunName = 'BetaSoakTest_V2.14.0-1.5.1' +TestRunName = 'BetaSoakTest_CCIPV1dot5dot4' FailOnFirstErrorInLoad = true [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml index 89858a94ddb..41367c45fb0 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml @@ -218,6 +218,10 @@ BlockHistorySize = 200 EIP1559FeeCapBufferBlocks = 0 """ +# Run by default using latest version from `ccip-develop` branch, override this value to use a specific version +[CCIP.Env.NewCLCluster.Common.ChainlinkImage] +version = "ccip-develop" + # the following configs are specific to each test type, smoke, load , chaos, etc... [CCIP.Groups] [CCIP.Groups.smoke] @@ -228,9 +232,8 @@ EIP1559FeeCapBufferBlocks = 0 KeepEnvAlive = false # if true, the test will not tear down the test environment after the test is finished CommitAndExecuteOnSameDON = true # if true, and the test is building the env from scratch, same chainlink nodes will be used for Commit and Execution jobs. -AllowOutOfOrder = false # if true, all the lanes will allow out of order execution and it -# overrides settings from lane_config. To allow out of order execution per lane, then send "allow_out_of_order":true, similar to is_native_fee_token variable. # Otherwise Commit and execution jobs will be set up in different nodes based on the number of nodes specified in NoOfCommitNodes and CCIP.Env.NewCLCluster.NoOfNodes +AllowOutOfOrder = false # if true, all lanes will set all transactions to allow out of order execution. This setting overrides individual settings from lane_config. To allow out of order execution per lane, then send "allow_out_of_order":true, similar to is_native_fee_token variable. BiDirectionalLane = true # True uses both the lanes. If bidirectional is false only one way lane is set up. NoOfCommitNodes = 5 # no of chainlink nodes with Commit job PhaseTimeout = '10m' # Duration to wait for the each phase validation(SendRequested, Commit, RMN Blessing, Execution) to time-out. @@ -361,7 +364,7 @@ CCIPOwnerTokens = false # if true, the test will use deploy the tokens by the CC # Uncomment the following if you want to run your tests with updated OCR params # otherwise test will use default OCR params from - -# https://github.com/smartcontractkit/chainlink/blob/develop/integration-tests/ccip-tests/contracts/contract_deployer.go#L729-L751 +# https://github.com/smartcontractkit/ccip/blob/ccip-develop/integration-tests/ccip-tests/contracts/contract_deployer.go#L729-L751 ## OCR Params #CommitInflightExpiry = '2m' #ExecInflightExpiry = '2m' diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml index d48c0b0f797..d78cd125958 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml @@ -1,5 +1,5 @@ ## Baseline performance test on simulated environment (with chaos) -## 40 chains / 400 lanes +## 30 chains / 300 lanes ## historyDepth 200 / finalityDepth 200 ## block_time = 1s ## throughput 1msg / 5s @@ -7,8 +7,15 @@ ## ## make test_load_ccip testimage=.dkr.ecr..amazonaws.com/chainlink-ccip-tests:ccip-develop \ ## testname=TestLoadCCIPStableRequestTriggeringWithNetworkChaos \ -## override_toml=./testconfig/tomls/ccip-1.4-stress/baseline.toml \ -## secret_toml=./testconfig/tomls/secrets.toml +## override_toml=./testconfig/tomls/ccip-1.4-stress/baseline.toml + +## Adjust this value depending on what you want to test. +# Using releases and git tag requires changing the image name to the correct one in `~/.testsecrets`, e.g. +# E2E_TEST_CHAINLINK_IMAGE="public.ecr.aws/w0i8p0z9/chainlink-ccip" +# If you want to use a specific commit or a branch you need to switch to the internal ECR in `~/.testsecrets` +# E2E_TEST_CHAINLINK_IMAGE=".dkr.ecr..amazonaws.com/chainlink-ccip" +[CCIP.Env.NewCLCluster.Common.ChainlinkImage] +version = "2.14.0-ccip1.5.0" [CCIP] [CCIP.ContractVersions] @@ -19,10 +26,10 @@ TokenPool = '1.4.0' CommitStore = '1.2.0' [CCIP.Env] -TTL = '8h' +TTL = '10h' [CCIP.Env.Network] -selected_networks= ['PRIVATE-CHAIN-1', 'PRIVATE-CHAIN-2'] +selected_networks = ['PRIVATE-CHAIN-1', 'PRIVATE-CHAIN-2'] [CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-1] evm_name = 'private-chain-1' @@ -66,7 +73,7 @@ block_time = 1 [CCIP.Env.NewCLCluster] NoOfNodes = 17 NodeMemory = '10Gi' -NodeCPU = '6' +NodeCPU = '4' DBMemory = '16Gi' DBCPU = '4' DBStorageClass = 'gp3' @@ -124,6 +131,8 @@ DeltaReconcile = '5s' """ CommonChainConfigTOML = """ +LogPollInterval = '1s' + [HeadTracker] HistoryDepth = 200 @@ -139,9 +148,9 @@ KeepEnvAlive = true NoOfCommitNodes = 16 PhaseTimeout = '40m' NodeFunding = 1000.0 -NoOfRoutersPerPair = 2 -NoOfNetworks = 40 -MaxNoOfLanes = 400 +NoOfRoutersPerPair = 1 +NoOfNetworks = 30 +MaxNoOfLanes = 300 [CCIP.Groups.load.OffRampConfig] BatchGasLimit = 11000000 @@ -150,11 +159,11 @@ BatchGasLimit = 11000000 TimeoutForPriceUpdate = '15m' NoOfTokensPerChain = 10 NoOfTokensWithDynamicPrice = 10 -DynamicPriceUpdateInterval ='15s' +DynamicPriceUpdateInterval = '15s' CCIPOwnerTokens = true [CCIP.Groups.load.LoadProfile] -TestDuration = '4h' +TestDuration = '6h' TimeUnit = '5s' RequestPerUnitTime = [1] OptimizeSpace = true @@ -162,7 +171,7 @@ NetworkChaosDelay = '100ms' # to represent 20%, 60%, 15%, 5% of the total messages [CCIP.Groups.load.LoadProfile.MsgProfile] -Frequencies = [4,12,3,1] +Frequencies = [4, 12, 3, 1] [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] MsgType = 'Token' @@ -186,4 +195,4 @@ DataLength = 10000 [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] MsgType = 'Data' DestGasLimit = 2500000 -DataLength = 10000 +DataLength = 10000 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_32bytes_data.toml b/integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_32bytes_data.toml new file mode 100644 index 00000000000..6f755456932 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_32bytes_data.toml @@ -0,0 +1,11 @@ +[CCIP] +[CCIP.Groups] +[CCIP.Groups.smoke] +LBTCMockDeployment = true +LBTCDestPoolDataAs32Bytes = true + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 + +[CCIP.Groups.smoke.MsgDetails] +NoOfTokens = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_non32bytes_data.toml b/integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_non32bytes_data.toml new file mode 100644 index 00000000000..21210acbaf6 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/lbtc_mock_deployment_with_non32bytes_data.toml @@ -0,0 +1,11 @@ +[CCIP] +[CCIP.Groups] +[CCIP.Groups.smoke] +LBTCMockDeployment = true +LBTCDestPoolDataAs32Bytes = false + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 + +[CCIP.Groups.smoke.MsgDetails] +NoOfTokens = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml index f13965d5e67..c6902eaf490 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml @@ -1,898 +1,169 @@ [CCIP] [CCIP.ContractVersions] -PriceRegistry = '1.2.0' -OffRamp = '1.2.0' -OnRamp = '1.2.0' -TokenPool = '1.4.0' -CommitStore = '1.2.0' +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +CommitStore = 'latest' +TokenPool = 'latest' [CCIP.Deployments] Data = """ { "lane_configs": { - "Arbitrum Sepolia": { - "is_native_fee_token": true, - "fee_token": "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x5EF7a726Fd21Fd9D77D34E3C56cfDD8691F7F0ac", - "router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", - "price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", - "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", - "src_contracts": { - "Avalanche Fuji": { - "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", - "deployed_at": 33999325 - }, - "Base Sepolia": { - "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", - "deployed_at": 9199926 - }, - "Gnosis Chiado": { - "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", - "deployed_at": 42809650 - }, - "Optimism Sepolia": { - "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", - "deployed_at": 35180131 - }, - "Sepolia Testnet": { - "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", - "deployed_at": 35180131 - }, - "WeMix Testnet": { - "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", - "deployed_at": 18816676 - } - }, - "dest_contracts": { - "Avalanche Fuji": { - "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", - "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Base Sepolia": { - "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", - "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", - "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Optimism Sepolia": { - "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", - "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Sepolia Testnet": { - "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", - "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "WeMix Testnet": { - "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", - "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, "Avalanche Fuji": { - "fee_token": "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x0ea0D7B2b78DD3A926fC76d6875a287F0AEB158F", + "is_native_fee_token": true, + "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "arm": "0x7e28DD790214139798446A121cFe950B51304684", "router": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", "price_registry": "0x19e157E5fb1DAec1aE4BaB113fdf077F980704AA", "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", - "deployed_at": 31888860 - }, - "BSC Testnet": { - "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", - "deployed_at": 33214865 - }, "Base Sepolia": { - "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", - "deployed_at": 31235262 - }, - "Gnosis Chiado": { - "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", - "deployed_at": 32817266 + "on_ramp": "0x0aEc1AC9F6D0c21332d7a66dDF1Fbcb32cF3B0B3", + "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", - "deployed_at": 30396804 - }, - "Polygon Amoy": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", - "deployed_at": 31982368 + "on_ramp": "0x2a9EFdc9F93D9b822129038EFCa4B63Adf3f7FB5", + "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", - "deployed_at": 33214865 - }, - "WeMix Testnet": { - "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", - "deployed_at": 30436465 + "on_ramp": "0x75b9a75Ee1fFef6BE7c4F842a041De7c6153CF4E", + "deployed_at": 0 } }, "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", - "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "BSC Testnet": { - "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", - "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, "Base Sepolia": { - "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", - "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", - "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0xf8de9d5924CFD28e31a53B63B4903436D9818d69", + "commit_store": "0xDD7CfECE1bb4e8aC2E8b8281CFE1D44247119471", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", - "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Polygon Amoy": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Sepolia Testnet": { - "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", - "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "WeMix Testnet": { - "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", - "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "BSC Testnet": { - "is_native_fee_token": true, - "fee_token": "0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0xF9a21B587111e7E8745Fb8b13750014f19DB0014", - "router": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", - "price_registry": "0xCCDf022c9d31DC26Ebab4FB92432724a5b79809a", - "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", - "src_contracts": { - "Avalanche Fuji": { - "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", - "deployed_at": 40500000 - }, - "Base Sepolia": { - "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", - "deployed_at": 37115558 - }, - "Gnosis Chiado": { - "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", - "deployed_at": 40228352 - }, - "Polygon Amoy": { - "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", - "deployed_at": 39572254 - }, - "Sepolia Testnet": { - "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", - "deployed_at": 38150066 - }, - "WeMix Testnet": { - "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", - "deployed_at": 38184995 - } - }, - "dest_contracts": { - "Avalanche Fuji": { - "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", - "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Base Sepolia": { - "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", - "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", - "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Polygon Amoy": { - "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", - "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x1DF9D94C6916918C935E60d2Cb4Ed265Bf778005", + "commit_store": "0xE7eeBE5882609d28C015d0A89DE1ba4f506F4a03", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", - "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "WeMix Testnet": { - "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", - "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x01e3D835b4C4697D7F81B9d7Abc89A6E478E4a2f", + "commit_store": "0x4EC313c1Eb620432f42FB5f4Df27f8A566523c1C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } }, "Base Sepolia": { "is_native_fee_token": true, - "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x5aA82cA372782d6CC33AA4C830Df2a91017A7e1b", + "fee_token": "0x4200000000000000000000000000000000000006", + "arm": "0x7827dD0481EE18DB646bD250d20A8eA43da52146", "router": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", "price_registry": "0x4D20536e60832bE579Cd38E89Dc03d11E1741FbA", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", - "deployed_at": 5146539 - }, "Avalanche Fuji": { - "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", - "deployed_at": 7810235 - }, - "BSC Testnet": { - "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", - "deployed_at": 5144127 - }, - "Gnosis Chiado": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", - "deployed_at": 9817141 + "on_ramp": "0x212e8Fd9cCC330ab54E8141FA7d33967eF1eDafF", + "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", - "deployed_at": 5147649 + "on_ramp": "0x2945D35F428CE564F5455AD0AF28BDFCa67e76Ab", + "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", - "deployed_at": 7810235 - }, - "ethereum-testnet-sepolia-mode-1": { - "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", - "deployed_at": 10409731 + "on_ramp": "0x29A1F4ecE9246F0042A9062FB89803fA8B1830cB", + "deployed_at": 0 } }, "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", - "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, "Avalanche Fuji": { - "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", - "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "BSC Testnet": { - "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", - "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x3Ab3a3d35cAC95FfcFCcc127eF01eA8D87b0A64e", + "commit_store": "0x51313B8C068B5227fa7364E6eCB1382Fb751976F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", - "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x8718d1cc138421Dbc1B489CB7884FF68DE7ad867", + "commit_store": "0x3291D453c880E5b59EEd04E600c85268Cd378b7f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", - "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "ethereum-testnet-sepolia-mode-1": { - "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", - "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "Gnosis Chiado": { - "is_native_fee_token": true, - "fee_token": "0xDCA67FD8324990792C0bfaE95903B8A64097754F", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0xb6f1Fe2CDE891eFd5Efd2A563C4C2F2549163718", - "router": "0x19b1bac554111517831ACadc0FD119D23Bb14391", - "price_registry": "0x2F4ACd1f8986c6B1788159C4c9a5fC3fceCCE363", - "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", - "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", - "deployed_at": 9718588 - }, - "Avalanche Fuji": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", - "deployed_at": 9718676 - }, - "BSC Testnet": { - "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", - "deployed_at": 9718302 - }, - "Base Sepolia": { - "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", - "deployed_at": 9718513 - }, - "Optimism Sepolia": { - "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", - "deployed_at": 9718420 - }, - "Polygon Amoy": { - "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", - "deployed_at": 9718194 - }, - "Sepolia Testnet": { - "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", - "deployed_at": 8487681 - } - }, - "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", - "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Avalanche Fuji": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "BSC Testnet": { - "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", - "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Base Sepolia": { - "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", - "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Optimism Sepolia": { - "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", - "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Polygon Amoy": { - "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", - "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Sepolia Testnet": { - "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", - "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "Kroma Sepolia": { - "is_native_fee_token": true, - "fee_token": "0xa75cCA5b404ec6F4BB6EC4853D177FE7057085c8", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x1E4e4e0d6f6631A45C616F71a1A5cF208DB9eCDe", - "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", - "price_registry": "0xa1ed3A3aA29166C9c8448654A8cA6b7916BC8379", - "wrapped_native": "0x4200000000000000000000000000000000000001", - "src_contracts": { - "WeMix Testnet": { - "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", - "deployed_at": 10290904 - } - }, - "dest_contracts": { - "WeMix Testnet": { - "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", - "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x0ecA23Ef70B828fEDd0A84d2692cB0527B52396A", + "commit_store": "0xA7F84Ec616F8e9Fa593339944E76bda90A9737fE", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } }, "Optimism Sepolia": { "is_native_fee_token": true, - "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0xf06Ff5D2084295909119ca541E93635E7D582FFc", + "fee_token": "0x4200000000000000000000000000000000000006", + "arm": "0xF51366F72184E22cF4a7a8362508DB0d3370392d", "router": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", "price_registry": "0x782a7Ba95215f2F7c3dD4C153cbB2Ae3Ec2d3215", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", - "deployed_at": 10841494 - }, "Avalanche Fuji": { - "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", - "deployed_at": 8677537 + "on_ramp": "0x91a144F570ABA7FB7079Fb187A267390E0cc7367", + "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", - "deployed_at": 7130524 - }, - "Gnosis Chiado": { - "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", - "deployed_at": 11799783 - }, - "Polygon Amoy": { - "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", - "deployed_at": 10813146 + "on_ramp": "0x6D22953cdEf8B0C9F0976Cfa52c33B198fEc5881", + "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", - "deployed_at": 12165583 - }, - "WeMix Testnet": { - "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", - "deployed_at": 8733017 + "on_ramp": "0x54b32C2aCb4451c6cF66bcbd856d8A7Cc2263531", + "deployed_at": 0 } }, "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", - "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, "Avalanche Fuji": { - "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", - "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0xCb2266c2118b1f30D15CBeB3a885531ABaA1b556", + "commit_store": "0x5Ded92E2CF71a8fF7644a67850F061c38B31BfB4", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", - "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", - "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Polygon Amoy": { - "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", - "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x960c62A491C30d0a60fD74a59d35B9C02697AdaA", + "commit_store": "0x06963745B3839B998288D1a46a46Ec25991A3D5E", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", - "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "WeMix Testnet": { - "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", - "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "Polygon Amoy": { - "is_native_fee_token": true, - "fee_token": "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x50b023c5b33AEe5Adef15C2E95C2fEC690a52fa1", - "router": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", - "price_registry": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", - "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", - "src_contracts": { - "Avalanche Fuji": { - "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", - "deployed_at": 6004551 - }, - "BSC Testnet": { - "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", - "deployed_at": 6005330 - }, - "Gnosis Chiado": { - "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", - "deployed_at": 6897885 - }, - "Optimism Sepolia": { - "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", - "deployed_at": 6004902 - }, - "Sepolia Testnet": { - "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", - "deployed_at": 6004056 - }, - "WeMix Testnet": { - "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", - "deployed_at": 6005611 - } - }, - "dest_contracts": { - "Avalanche Fuji": { - "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", - "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "BSC Testnet": { - "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", - "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", - "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Optimism Sepolia": { - "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", - "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Sepolia Testnet": { - "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", - "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "WeMix Testnet": { - "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", - "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x2aF9B10A5972D0c36f4d8F85773052c104E319B2", + "commit_store": "0x82FCF55b9e9bAb3066c2863F12a02bBc2Ba33F2F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } }, "Sepolia Testnet": { "is_native_fee_token": true, - "fee_token": "0x779877A7B0D9E8603169DdbD7836e478b4624789", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0xB4d360459F32Dd641Ef5A6985fFbAC5c4e5521aA", + "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "arm": "0x27Da8735d8d1402cEc072C234759fbbB4dABBC4A", "router": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", "price_registry": "0x9EF7D57a4ea30b9e37794E55b0C75F2A70275dCc", "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", - "deployed_at": 5737506 - }, "Avalanche Fuji": { - "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", - "deployed_at": 5944649 - }, - "BSC Testnet": { - "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", - "deployed_at": 5383500 + "on_ramp": "0x12492154714fBD28F28219f6fc4315d19de1025B", + "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", - "deployed_at": 5619657 - }, - "Gnosis Chiado": { - "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", - "deployed_at": 5386355 + "on_ramp": "0x8F35B097022135E0F46831f798a240Cc8c4b0B01", + "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", - "deployed_at": 5937506 - }, - "Polygon Amoy": { - "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", - "deployed_at": 5723315 - }, - "WeMix Testnet": { - "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", - "deployed_at": 5393931 - }, - "celo-testnet-alfajores": { - "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", - "deployed_at": 5704643 - }, - "ethereum-testnet-sepolia-blast-1": { - "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", - "deployed_at": 6040848 - }, - "ethereum-testnet-sepolia-metis-1": { - "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", - "deployed_at": 6002793 - }, - "ethereum-testnet-sepolia-mode-1": { - "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", - "deployed_at": 5970819 + "on_ramp": "0xACDfd7a98d853FA3914047Cd46e7f5D53BBC9FbB", + "deployed_at": 0 } }, "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", - "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, "Avalanche Fuji": { - "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", - "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "BSC Testnet": { - "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", - "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x1DEBa99dC8e2A77832461BD386d83D9FCb133137", + "commit_store": "0x139E06b6dBB1a0C41A1686C091795879c943765A", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", - "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Gnosis Chiado": { - "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", - "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0x662738DC7DE4f7eC63d9f73Cdf9BeA5A58DdcC15", + "commit_store": "0x1e46bAC486Dd878cD57B62845530A52343e39693", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", - "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Polygon Amoy": { - "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", - "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "WeMix Testnet": { - "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", - "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "celo-testnet-alfajores": { - "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", - "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "ethereum-testnet-sepolia-blast-1": { - "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", - "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "ethereum-testnet-sepolia-metis-1": { - "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", - "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "ethereum-testnet-sepolia-mode-1": { - "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", - "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "WeMix Testnet": { - "is_native_fee_token": true, - "fee_token": "0x3580c7A817cCD41f7e02143BFa411D4EeAE78093", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x46fF31494651593973D9b38a872ED5B06f45A693", - "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", - "price_registry": "0x89D17571DB7C9540eeB36760E3c749C8fb984569", - "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", - "src_contracts": { - "Arbitrum Sepolia": { - "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", - "deployed_at": 51216113 - }, - "Avalanche Fuji": { - "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", - "deployed_at": 51214769 - }, - "BSC Testnet": { - "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", - "deployed_at": 51213771 - }, - "Kroma Sepolia": { - "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", - "deployed_at": 51239062 - }, - "Optimism Sepolia": { - "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", - "deployed_at": 51216748 - }, - "Polygon Amoy": { - "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", - "deployed_at": 55378685 - }, - "Sepolia Testnet": { - "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", - "deployed_at": 51239309 - } - }, - "dest_contracts": { - "Arbitrum Sepolia": { - "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", - "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Avalanche Fuji": { - "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", - "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "BSC Testnet": { - "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", - "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Kroma Sepolia": { - "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", - "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Optimism Sepolia": { - "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", - "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Polygon Amoy": { - "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", - "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Sepolia Testnet": { - "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", - "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "celo-testnet-alfajores": { - "is_native_fee_token": true, - "fee_token": "0x32E08557B14FaD8908025619797221281D439071", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0xbE8FD4b84ca8CC2cFAeeEf8dc1388E44860eeEeb", - "router": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", - "price_registry": "0x8F048206D11B2c69b8963E2EBd5968D141e022f4", - "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", - "src_contracts": { - "Sepolia Testnet": { - "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", - "deployed_at": 23561364 - } - }, - "dest_contracts": { - "Sepolia Testnet": { - "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", - "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "ethereum-testnet-sepolia-blast-1": { - "is_native_fee_token": true, - "fee_token": "0x02c359ebf98fc8BF793F970F9B8302bb373BdF32", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", - "router": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", - "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", - "wrapped_native": "0x4200000000000000000000000000000000000023", - "src_contracts": { - "Sepolia Testnet": { - "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", - "deployed_at": 6429339 - } - }, - "dest_contracts": { - "Sepolia Testnet": { - "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", - "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "ethereum-testnet-sepolia-metis-1": { - "is_native_fee_token": true, - "fee_token": "0x9870D6a0e05F867EAAe696e106741843F7fD116D", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", - "router": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", - "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", - "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", - "src_contracts": { - "Sepolia Testnet": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", - "deployed_at": 858864 - } - }, - "dest_contracts": { - "Sepolia Testnet": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - } - } - }, - "ethereum-testnet-sepolia-mode-1": { - "is_native_fee_token": true, - "fee_token": "0x925a4bfE64AE2bFAC8a02b35F78e60C29743755d", - "bridge_tokens": [ - ], - "bridge_tokens_pools": [ - ], - "price_aggregators": null, - "arm": "0x11545812A8d64e4A3A0Ec36b6F70D87b42Ce4a01", - "router": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", - "price_registry": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", - "wrapped_native": "0x4200000000000000000000000000000000000006", - "src_contracts": { - "Base Sepolia": { - "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", - "deployed_at": 14359909 - }, - "Sepolia Testnet": { - "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", - "deployed_at": 14359680 - } - }, - "dest_contracts": { - "Base Sepolia": { - "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", - "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" - }, - "Sepolia Testnet": { - "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", - "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", - "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + "off_ramp": "0xbfa6f6AAE31acB3A285e80026d6475C1a50d1d0F", + "commit_store": "0xB5FbA97Dc61ec68771a92a15360d9C32c9d054E7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } } @@ -901,26 +172,20 @@ Data = """ """ [CCIP.Env] -TTL = '8h' +TTL = '2h' [CCIP.Env.Network] selected_networks = [ - 'ARBITRUM_SEPOLIA', - 'AVALANCHE_FUJI', - 'OPTIMISM_SEPOLIA', - 'BASE_SEPOLIA', - 'BSC_TESTNET', - 'WEMIX_TESTNET', - 'SEPOLIA', - 'POLYGON_AMOY', - 'KROMA_SEPOLIA', - 'BLAST_SEPOLIA' + 'AVALANCHE_FUJI', + 'OPTIMISM_SEPOLIA', + 'BASE_SEPOLIA', + 'SEPOLIA', ] [CCIP.Groups.load] NetworkPairs = [ - 'AVALANCHE_FUJI,SEPOLIA', - 'OPTIMISM_SEPOLIA,BASE_SEPOLIA' + 'AVALANCHE_FUJI,SEPOLIA', + 'OPTIMISM_SEPOLIA,BASE_SEPOLIA' ] BiDirectionalLane = true @@ -929,15 +194,21 @@ ExistingDeployment = true NoOfTokensPerChain = 1 +# 1msg/5sec = 12msg/min [CCIP.Groups.load.LoadProfile] -RequestPerUnitTime = [1] -TimeUnit = '5s' +RequestPerUnitTime = [12] +TimeUnit = '1m' TestDuration = '1h' TestRunName = 'ccip-prod-testnet-stress' +# There is slower exec rounds in Sepolia/Ethereum, therefore reducing the frequency +# 1msg/12sec = 5msg/min +[CCIP.Groups.load.LoadProfile.FrequencyByDestination.sepolia-testnet] +RequestPerUnitTime = [5] + # to represent 20%, 60%, 15%, 5% of the total messages [CCIP.Groups.load.LoadProfile.MsgProfile] -Frequencies = [4,12,3,1] +Frequencies = [4, 12, 3, 1] [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] MsgType = 'Token' diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml index 24e7cbc9c88..6281274eacf 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml @@ -14,71 +14,74 @@ Data = """ "Arbitrum Sepolia": { "is_native_fee_token": true, "fee_token": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", - "bridge_tokens": [ - "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D" - ], - "bridge_tokens_pools": [ - "0x99685281Ec520a003F1A726A5a8078c2124c1477" - ], "arm": "0xbcBDf0aDEDC9a33ED5338Bdb4B6F7CE664DC2e8B", "router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", "price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "on_ramp": "0x20C8c9F13C6AA402F2545AD15fB7a9CdE9108618", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "on_ramp": "0xF1623862e4c9f9Fba1Ac0181C4fF53B4f958F065", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "on_ramp": "0xEfe02eB139D2A82e38184d28E3b65bb176F26ebD", + "deployed_at": 0 + }, + "Metis Sepolia": { + "on_ramp": "0x46a79a6a4B07FD3FC14ea8299A99FE29576776E2", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "on_ramp": "0x0B0c08Bb2fA2EbDe25817009ee39eA1ad9bCaC58", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "on_ramp": "0x64d78F20aD987c7D52FdCB8FB0777bD00de53210", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "on_ramp": "0x2F3Daf77A663603826c7750E956b6555DE6f8250", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", - "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "off_ramp": "0x7245a5947E2F32B66aF74F4dAF91718ea19afaDf", + "commit_store": "0x490AC77BbB26f4FFf876Ded07bCAE6DBe685be98", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", - "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "off_ramp": "0xF2aB55Ed448A6fAD75013900568B6a927f52e5e0", + "commit_store": "0x833E5995A7422120f445f9B8dD1b9BD1037c68E5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", - "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "off_ramp": "0xc1Cb31493fB2386aDC1Ea01F935F2bd8a8dCA388", + "commit_store": "0xe21896657A65c8959F16E1c3Ee5713E85d9EA020", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Metis Sepolia": { + "off_ramp": "0xc47143147Fd62A09618C695c7C03714aCe8db1Cf", + "commit_store": "0x2F42e7B22eE5885158916624Ff00608f4C82313D", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", - "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "off_ramp": "0x4a7E91EF68758aaC66AeD656267bbCD0f9b6c019", + "commit_store": "0xb0A09D6A15FF7A0142DF3F62b2C4D1e11D763Ed0", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", - "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "off_ramp": "0xBed6e9131916d724418C8a6FE810F727302a5c00", + "commit_store": "0xdDb61B6bDa1B46d88f556440fABFe219F6da4F3a", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", - "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "off_ramp": "0x11d486E92d291704D1E25cDbAeee687237247826", + "commit_store": "0xece9353095aC79Db9DD5bf2022690Fa6BffeBCAc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -86,89 +89,83 @@ Data = """ "Avalanche Fuji": { "is_native_fee_token": true, "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", - "bridge_tokens": [ - "0xD21341536c5cF5EB1bcb58f6723cE26e8D8E90e4" - ], - "bridge_tokens_pools": [ - "0xEC1062cbDf4fBf31B3A6Aac62B6F6F123bb70E12" - ], "arm": "0x7e28DD790214139798446A121cFe950B51304684", "router": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", "price_registry": "0x19e157E5fb1DAec1aE4BaB113fdf077F980704AA", "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "on_ramp": "0xa9946BA30DAeC98745755e4410d6e8E894Edc53B", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "on_ramp": "0x906BC7D10947A94ba0252e8C2E34868A466c03ED", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "on_ramp": "0x0aEc1AC9F6D0c21332d7a66dDF1Fbcb32cF3B0B3", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "on_ramp": "0x3dda45E731EC1db18B95651d1AF1868aa878468D", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "on_ramp": "0x2a9EFdc9F93D9b822129038EFCa4B63Adf3f7FB5", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "on_ramp": "0xA82b9ACAcFA6FaB1FD721e7a748A30E3001351F9", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "on_ramp": "0x75b9a75Ee1fFef6BE7c4F842a041De7c6153CF4E", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "on_ramp": "0x1ff99E67986E83bb5BA34143BaA2735853e5738c", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", - "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "off_ramp": "0xd88CBA0612f2Ce611BF6d073A94C8FD7E70B4fBd", + "commit_store": "0x9b8279E352bC167F714eef96A4C436bE996643cE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", - "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "off_ramp": "0x9c40A73F5C7454BB7C178AFa56Ee30bFB2DCf7E6", + "commit_store": "0xE5611af1d63340b711B0468a976651Fb79B17870", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", - "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "off_ramp": "0xf8de9d5924CFD28e31a53B63B4903436D9818d69", + "commit_store": "0xDD7CfECE1bb4e8aC2E8b8281CFE1D44247119471", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", - "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "off_ramp": "0x3F5035039C23cDAF032C64c084Dc70F811E62ddD", + "commit_store": "0xf5B0245c7B9e15f0cB0B85FF2B6799a45D61CbaA", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", - "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "off_ramp": "0x1DF9D94C6916918C935E60d2Cb4Ed265Bf778005", + "commit_store": "0xE7eeBE5882609d28C015d0A89DE1ba4f506F4a03", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "off_ramp": "0xbeD7F478Ef5627FB2B891fDA29Ca0131f6796D9D", + "commit_store": "0x27a319f58c01380056c86938798aCEAA1AC529e2", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", - "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "off_ramp": "0x01e3D835b4C4697D7F81B9d7Abc89A6E478E4a2f", + "commit_store": "0x4EC313c1Eb620432f42FB5f4Df27f8A566523c1C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", - "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "off_ramp": "0x15CcAbf0e3484D4872e25b883163D8cB724d4832", + "commit_store": "0x859f3477B7b4ECc19aDD8cCb19740932F21bD76b", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -176,71 +173,74 @@ Data = """ "BSC Testnet": { "is_native_fee_token": true, "fee_token": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", - "bridge_tokens": [ - "0xbFA2ACd33ED6EEc0ed3Cc06bF1ac38d22b36B9e9" - ], - "bridge_tokens_pools": [ - "0x31eDe84776DA37e2404eE88d71c234e92cB672e5" - ], "arm": "0x7D899D26F2E94fFcd4b440C3008B0C6BEfcD3cca", "router": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", "price_registry": "0xCCDf022c9d31DC26Ebab4FB92432724a5b79809a", "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "on_ramp": "0x2A6f8Ed2e7b222163ef6EcC2327171B479399ab2", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "on_ramp": "0x97856Bf888F6eEDBBd322B28133BCcF9CA9038f6", + "deployed_at": 0 + }, + "Blast Sepolia": { + "on_ramp": "0xd0049BfFc8e2689Df9236FfA393Ccbf7eae4FbbC", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "on_ramp": "0x98dEa9e498F2A7aF6c74C915c88A17FbA09b73C2", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "on_ramp": "0x363EB789fE31F08547a847D8C38d9b55C7Cf1903", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "on_ramp": "0xC1C6438D60AbE9bF4b1F10460184CE9bD312e328", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "on_ramp": "0xbc85704EDb79ea84E9D3C18965F7f6A16B0a0440", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", - "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "off_ramp": "0x95b66acfaaDF122f4EccE52C0aD4Fd997DD1150C", + "commit_store": "0x3af04b1c1e79A6B8A4577Bb47EC33eD2E66AeB47", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", - "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "off_ramp": "0x0a5147e1Ac38C79c77031194ef64C8B5353F6EE9", + "commit_store": "0x103864D60b33a479EA7D0e23a37e0ce07198f0A9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Blast Sepolia": { + "off_ramp": "0xe1e8473218acCB82FBc24Ccd3C5D2dF166cd04f3", + "commit_store": "0x020B047A5Ca88fDB1ad3bAD9A082760fC7F770b6", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", - "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "off_ramp": "0x1F7FEBCBb10420E039C333A60A444c1a442d826C", + "commit_store": "0x23Ae763a64D39d6038431a64Bbc4A670C89d82b9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", - "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "off_ramp": "0xAAe325adbc9C5a28e4e94Fef170D55de2CA9aA01", + "commit_store": "0xD173Df3A1b23ec42eA5C4669b9c956Bef230efd1", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", - "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "off_ramp": "0xB513523aee87f838e78b32d2Bacaaf2e94D9f0f9", + "commit_store": "0x21A49164890576504C1f1c4DC9442c42C98771D7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", - "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "off_ramp": "0xc985571900DCa62387f93F882AB550472531f5DB", + "commit_store": "0xac5DACfAb1a512E33c49EFE42502863FC1a4BAB3", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -248,80 +248,74 @@ Data = """ "Base Sepolia": { "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000006", - "bridge_tokens": [ - "0x88A2d74F47a237a62e7A51cdDa67270CE381555e" - ], - "bridge_tokens_pools": [ - "0x875207858c691F192C606068f417dCf666b2EC6B" - ], "arm": "0x7827dD0481EE18DB646bD250d20A8eA43da52146", "router": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", "price_registry": "0x4D20536e60832bE579Cd38E89Dc03d11E1741FbA", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "on_ramp": "0xb52eF669d3fCeBee1f31418Facc02a16A6F6B0e5", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "on_ramp": "0x212e8Fd9cCC330ab54E8141FA7d33967eF1eDafF", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "on_ramp": "0xd54B44811AE99a18Cb95B4704ba04a65C0163751", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "on_ramp": "0xdd0Ee1F20E93a93634AAcE56105E19423881Df56", "deployed_at": 0 }, "Mode Sepolia": { - "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "on_ramp": "0xc59689dFDEF9D953cEFbb58912b304bb38408476", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "on_ramp": "0x2945D35F428CE564F5455AD0AF28BDFCa67e76Ab", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "on_ramp": "0x29A1F4ecE9246F0042A9062FB89803fA8B1830cB", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", - "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "off_ramp": "0x814E735c5DD19240c85E2513DD926Bc3a39f7140", + "commit_store": "0xFc24B204bfA5C65eD8e2Fc02fDe4FeCb62eA8Ac5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", - "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "off_ramp": "0x3Ab3a3d35cAC95FfcFCcc127eF01eA8D87b0A64e", + "commit_store": "0x51313B8C068B5227fa7364E6eCB1382Fb751976F", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", - "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "off_ramp": "0x827CF69409307Cd4c979e652894C297ad5124ab7", + "commit_store": "0x547eBe6077305c3fdF8dA66c66cc14b0779CE00C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "off_ramp": "0x8bB08Bc19771C69E739a2078894523b3DC05a05e", + "commit_store": "0xf163Da63bDB8b9C355d41C755E03125988650109", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Mode Sepolia": { - "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", - "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "off_ramp": "0x11E16c71D76E43acbcb496A70966380d905B1E32", + "commit_store": "0xEe19f039FaE3EF0F94971f0B7B187223D952ac13", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", - "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "off_ramp": "0x8718d1cc138421Dbc1B489CB7884FF68DE7ad867", + "commit_store": "0x3291D453c880E5b59EEd04E600c85268Cd378b7f", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", - "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "off_ramp": "0x0ecA23Ef70B828fEDd0A84d2692cB0527B52396A", + "commit_store": "0xA7F84Ec616F8e9Fa593339944E76bda90A9737fE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -329,26 +323,29 @@ Data = """ "Blast Sepolia": { "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000023", - "bridge_tokens": [ - "0x8D122C3e8ce9C8B62b87d3551bDfD8C259Bb0771" - ], - "bridge_tokens_pools": [ - "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6" - ], "arm": "0x09c1Ed4b112Fb33e594F2aACfEF407e2F14d7F9b", "router": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", "wrapped_native": "0x4200000000000000000000000000000000000023", "src_contracts": { + "BSC Testnet": { + "on_ramp": "0x6eA6f63b689b5597A0C06a5Eb8DcDFD86383857A", + "deployed_at": 0 + }, "Sepolia Testnet": { - "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "on_ramp": "0x154aDEF773a848da8229D81De73a7b0844400ebd", "deployed_at": 0 } }, "dest_contracts": { + "BSC Testnet": { + "off_ramp": "0xd9dE4aCD27E814bfe70CA33d2A4d079e740626Bd", + "commit_store": "0xe8fF7e22c54f76F453d6072A9d3a12B1D9AbA137", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, "Sepolia Testnet": { - "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", - "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "off_ramp": "0x46DD4e3e2b8a18409646F1C15bf3799a481e67f6", + "commit_store": "0x8250f9E992dda66791dd8b5d356B867ae53382cF", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -356,26 +353,20 @@ Data = """ "Celo Alfajores": { "is_native_fee_token": true, "fee_token": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", - "bridge_tokens": [ - "0x7e503dd1dAF90117A1b79953321043d9E6815C72" - ], - "bridge_tokens_pools": [ - "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b" - ], "arm": "0xEbe35aA4F5e707485484c992AF2069a457b9bBB1", "router": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", "price_registry": "0x8F048206D11B2c69b8963E2EBd5968D141e022f4", "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", "src_contracts": { "Sepolia Testnet": { - "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "on_ramp": "0x68A4f57A499563192C606a898BAf503A43fcDB4D", "deployed_at": 0 } }, "dest_contracts": { "Sepolia Testnet": { - "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", - "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "off_ramp": "0xF6dB68333D14f6a0c1123cc420ea60980aEDA0Eb", + "commit_store": "0x8f9B63c40891CdF7d1C795625d4260a29bE2bBa0", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -383,80 +374,74 @@ Data = """ "Gnosis Chiado": { "is_native_fee_token": true, "fee_token": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", - "bridge_tokens": [ - "0xA189971a2c5AcA0DFC5Ee7a2C44a2Ae27b3CF389" - ], - "bridge_tokens_pools": [ - "0xF9a21B587111e7E8745Fb8b13750014f19DB0014" - ], "arm": "0xfE4fB161D870D0F672Ed9C5A898569603f77983F", "router": "0x19b1bac554111517831ACadc0FD119D23Bb14391", "price_registry": "0x2F4ACd1f8986c6B1788159C4c9a5fC3fceCCE363", "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "on_ramp": "0x94967Ea06C6543Aaba5B90C52B655003ef82e521", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "on_ramp": "0x4f3576585e7fCCE5Fc502Bcf3CAdaD22E1194834", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "on_ramp": "0xB2642B54580140C375c9024e273C575a5f53d02d", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "on_ramp": "0x0E9504907be794620229C196F82CB062A66B7480", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "on_ramp": "0xeb86B5b6f5C66eCb58e4Cf98E607b238126505DC", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "on_ramp": "0xd86F5DF82A2500137Ddeef963028d60E3b5A354D", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "on_ramp": "0x03691D63C687D09368360e957AFB2F7B4d1651d4", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", - "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "off_ramp": "0x3633Cce99186217d4C7ed64FD455d218b8Cd5D4c", + "commit_store": "0x6e096286548451828c97F1B3E49C402a4934F39a", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "off_ramp": "0x5E4DB2A3c965B9B2A850a75697Bb6a00b4e35ac5", + "commit_store": "0x2489c5a802fE63943f7E3185A0362327B55DDF67", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", - "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "off_ramp": "0x2BA72Ba392C08750328635E36757A2c29a9165CA", + "commit_store": "0x08ebd7Cf4ABDC819c74cB45CbA4e291728538D7C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", - "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "off_ramp": "0x269D28B25Ee081ae5340e2BFE99850E92F1cd522", + "commit_store": "0x8dC9329BD221C89c4989d98c38Ff2Cc3dF92d14b", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", - "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "off_ramp": "0xd93B571ae9CaF43d70b2b53fFD55e035Db641e31", + "commit_store": "0x42C1093b9DdE8d0CD58859C610dc239B66bE26de", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", - "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "off_ramp": "0x87F9b8382611ACD01d5696a1f5b05B888e55B0Cc", + "commit_store": "0x29AC46227908d31A9BdDe82c0A4a6c52D802f145", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", - "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "off_ramp": "0x9aa734100C425309091dAE18154e0356B82d477a", + "commit_store": "0x7cDd533B82f4c32FAE7f551C37b1490909817C45", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -464,26 +449,20 @@ Data = """ "Kroma Sepolia": { "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000001", - "bridge_tokens": [ - "0x6AC3e353D1DDda24d5A5416024d6E436b8817A4e" - ], - "bridge_tokens_pools": [ - "0x0eE8add19554C7bb1920A183Ed47b4FAB9Eb7601" - ], "arm": "0x08f9Af992368FAc58C936A2c5eBc9092894CEa9b", "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", "price_registry": "0xa1ed3A3aA29166C9c8448654A8cA6b7916BC8379", "wrapped_native": "0x4200000000000000000000000000000000000001", "src_contracts": { "WeMix Testnet": { - "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "on_ramp": "0xa81418c332d3E04338B058Ab39b1baf53029F638", "deployed_at": 0 } }, "dest_contracts": { "WeMix Testnet": { - "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", - "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "off_ramp": "0x42Dde725C4f05C237a00B582Bb7457e208d3A17C", + "commit_store": "0xb116E9a90534354dA59CF93a87c1E9711c0Aaa2c", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -491,26 +470,29 @@ Data = """ "Metis Sepolia": { "is_native_fee_token": true, "fee_token": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", - "bridge_tokens": [ - "0x20Aa09AAb761e2E600d65c6929A9fd1E59821D3f" - ], - "bridge_tokens_pools": [ - "0xdE8451E952Eb43350614839cCAA84f7C8701a09C" - ], "arm": "0xf0607A9BDdB5F54dB59ACaA0837aFec2D1c95df6", "router": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x2eb69889cc979c0Be120813FcE2f1558efF4ceB5", + "deployed_at": 0 + }, "Sepolia Testnet": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "on_ramp": "0xE0dFc15C0CDf607b2088D0B641E00eA0B418124C", "deployed_at": 0 } }, "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x839b5dEA3e084790F580E9DfCE8CCfDf49c5835e", + "commit_store": "0xdF38C8aD34C379165f98A75a6894790bB5a16b1D", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, "Sepolia Testnet": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "off_ramp": "0x72130De9A85e9C61151253aFF8801Bb3242A00a9", + "commit_store": "0x8F6D64280C379F680Ff0c3278f340D72a465FAAc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -518,35 +500,29 @@ Data = """ "Mode Sepolia": { "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000006", - "bridge_tokens": [ - "0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5" - ], - "bridge_tokens_pools": [ - "0x20bBc874bE3Cd94C3E4689EDD5D89dD1cE8Cb7C4" - ], "arm": "0x9eC8a0AbC75ce08978FAf67958482461bCd93B18", "router": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", "price_registry": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Base Sepolia": { - "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "on_ramp": "0x48ACE2319f643584B77C21476a6c664D7F13a107", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "on_ramp": "0xb821885731414497d705dc56325f18AA33e612dC", "deployed_at": 0 } }, "dest_contracts": { "Base Sepolia": { - "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", - "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "off_ramp": "0xC6b69Fa9eeBc55e64eBc68371Fbd41ff73756F17", + "commit_store": "0xaA6691EA9110409a29C2E665174b4b2fe694cE67", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", - "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "off_ramp": "0x35dE2C381a2fF8a26c8ae94145be3A9cA8C83600", + "commit_store": "0xE7e60DAee094416b8ab2083047a893c4c4290c48", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -554,80 +530,74 @@ Data = """ "Optimism Sepolia": { "is_native_fee_token": true, "fee_token": "0x4200000000000000000000000000000000000006", - "bridge_tokens": [ - "0x8aF4204e30565DF93352fE8E1De78925F6664dA7" - ], - "bridge_tokens_pools": [ - "0x3Cc9364260D80F09ccAC1eE6B07366dB598900E6" - ], "arm": "0xF51366F72184E22cF4a7a8362508DB0d3370392d", "router": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", "price_registry": "0x782a7Ba95215f2F7c3dD4C153cbB2Ae3Ec2d3215", "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "on_ramp": "0x6B36c9CD74E760088817a047C3460dEdFfe9a11A", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "on_ramp": "0x91a144F570ABA7FB7079Fb187A267390E0cc7367", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "on_ramp": "0x6D22953cdEf8B0C9F0976Cfa52c33B198fEc5881", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "on_ramp": "0xec7D9A84A6d4556056975BE50Cdc97bAa9313632", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "on_ramp": "0x9E09C2A7D6B9F88c62f0E2Af4cd62dF3F4c326F1", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "on_ramp": "0x54b32C2aCb4451c6cF66bcbd856d8A7Cc2263531", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "on_ramp": "0xB9Ef21C04d8340b223e9C1d7a09f332609c70300", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", - "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "off_ramp": "0xF35e2d1457749374453e44B06268aD3f78b133b3", + "commit_store": "0x4bd755d86E25dD4093CAa5639CfDab81571259CA", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", - "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "off_ramp": "0xCb2266c2118b1f30D15CBeB3a885531ABaA1b556", + "commit_store": "0x5Ded92E2CF71a8fF7644a67850F061c38B31BfB4", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", - "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "off_ramp": "0x960c62A491C30d0a60fD74a59d35B9C02697AdaA", + "commit_store": "0x06963745B3839B998288D1a46a46Ec25991A3D5E", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", - "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "off_ramp": "0x7d6721c2E85560F0A233255D3d332AcF6f850d96", + "commit_store": "0xaC00661cAB5161d9B4746DFb7A028d97981aB2c5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", - "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "off_ramp": "0x4cEeFa55AF23dFD27Cf926e8eFB1D1bCcD24526E", + "commit_store": "0xaD3943BdECbf4ae7d6E51aB0FD06bbC604bB7b95", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", - "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "off_ramp": "0x2aF9B10A5972D0c36f4d8F85773052c104E319B2", + "commit_store": "0x82FCF55b9e9bAb3066c2863F12a02bBc2Ba33F2F", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", - "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "off_ramp": "0x0FA15Bc42D4999d964CBf0161489Bd392DEE834e", + "commit_store": "0x37760F99a5b91884C9D89a06408f532aEbb0e674", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -635,71 +605,65 @@ Data = """ "Polygon Amoy": { "is_native_fee_token": true, "fee_token": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", - "bridge_tokens": [ - "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4" - ], - "bridge_tokens_pools": [ - "0x3064fB3EA546EE09A63AB3bD93E83D8B8525C636" - ], "arm": "0x8b88C39D2875157aB4CE4AD3814409523d539ee1", "router": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", "price_registry": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "on_ramp": "0xad6A94CFB51e7DE30FD21F417E4cBf70D3AdaD30", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "on_ramp": "0x28EC0a9C90360F55C2a9DaD5901b074C257904ca", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "on_ramp": "0x9DF611536f124278Ce968c476BDb10A66E54ecfE", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "on_ramp": "0x600f00aef9b8ED8EDBd7284B5F04a1932c3408aF", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "on_ramp": "0x719Aef2C63376AdeCD62D2b59D54682aFBde914a", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "on_ramp": "0x7D6c93E49E46cc983a677c283EAb27CbbC94e3C4", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", - "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "off_ramp": "0xAc56Df7F5fbde0DeeB1C0d397A150EDD5EE68625", + "commit_store": "0x8AF56D1c76B8c8CeE451a0a654D130e4050B993e", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", - "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "off_ramp": "0x40Ba47ea59D80DDd35E3a997AA520FBa0553dddc", + "commit_store": "0x8afe532517b39bA109d1A768E1Ad8b5C6485abF5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", - "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "off_ramp": "0x7B968B2aDFd31765dAAD80d66c83F9D7006BFFd5", + "commit_store": "0xBc70551B5624BaF8cdCB84136198561C9cf5C176", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", - "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "off_ramp": "0xAA755Ef570986feEb6522377077e549e3013843E", + "commit_store": "0x5C7827EcE6a51AdaC36ef71aC01706deb1C7130d", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", - "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "off_ramp": "0x7Ad494C173f5845c6B4028a06cDcC6d3108bc960", + "commit_store": "0x104A1c8b05D37fE732094595Fe696AFc7EAB8668", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", - "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "off_ramp": "0xa85481273f8C112e96ED7476202F06D6131cf069", + "commit_store": "0x9FdF1D555e37dB09B0d151FEa53c134C88C4DeFd", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -707,134 +671,128 @@ Data = """ "Sepolia Testnet": { "is_native_fee_token": true, "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", - "bridge_tokens": [ - "0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05" - ], - "bridge_tokens_pools": [ - "0x38d1ef9619Cd40cf5482C045660Ae7C82Ada062c" - ], "arm": "0x27Da8735d8d1402cEc072C234759fbbB4dABBC4A", "router": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", "price_registry": "0x9EF7D57a4ea30b9e37794E55b0C75F2A70275dCc", "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "on_ramp": "0xBc09627e58989Ba8F1eDA775e486467d2A00944F", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "on_ramp": "0x12492154714fBD28F28219f6fc4315d19de1025B", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "on_ramp": "0x7a75b3818412fe0028590feE8270ba9E3fd01DBe", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "on_ramp": "0x8F35B097022135E0F46831f798a240Cc8c4b0B01", "deployed_at": 0 }, "Blast Sepolia": { - "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "on_ramp": "0x4ADA60556dA05FcF53a79359e37a3E13FebA22Bf", "deployed_at": 0 }, "Celo Alfajores": { - "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "on_ramp": "0x1163D1F7D75eEb1C4f4c6912d3cF9642027aFD30", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "on_ramp": "0x831A7DbE6af8601427A0ADa89b642d4b59007eED", "deployed_at": 0 }, "Metis Sepolia": { - "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "on_ramp": "0xabB5A4f99DFEb4a3912e8Acc0660A008c76dA8c3", "deployed_at": 0 }, "Mode Sepolia": { - "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "on_ramp": "0x2Eb0842925fb7aA6045e951e98e8b4b3aFFaBB54", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "on_ramp": "0xACDfd7a98d853FA3914047Cd46e7f5D53BBC9FbB", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "on_ramp": "0xf9765c80F6448e6d4d02BeF4a6b4152131A2F513", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "on_ramp": "0xd72c3c132B76F5D232C37dF3bF8f04392D552e0F", "deployed_at": 0 }, "ZKSync Sepolia": { - "on_ramp": "0x1Acb3A885feA37bdA30AB99b99327b14391f500F", + "on_ramp": "0xA2865E4f36760f5fa5c8F958336120f2DF0d974b", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", - "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "off_ramp": "0xD2f5edfD4561d6E7599F6c6888Bd353cAFd0c55E", + "commit_store": "0x240420BC6bCDc067e668c7492D69fe06B3CF80cE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", - "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "off_ramp": "0x1DEBa99dC8e2A77832461BD386d83D9FCb133137", + "commit_store": "0x139E06b6dBB1a0C41A1686C091795879c943765A", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", - "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "off_ramp": "0x04305BD9D9CA6730517f79c3D9c6828BC2D25Ecb", + "commit_store": "0x32edD59840CD9e474A280cf1707439F2Bd5872d4", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", - "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "off_ramp": "0x662738DC7DE4f7eC63d9f73Cdf9BeA5A58DdcC15", + "commit_store": "0x1e46bAC486Dd878cD57B62845530A52343e39693", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Blast Sepolia": { - "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", - "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "off_ramp": "0x049A424cF894709f044bc70177F8F6b792adc3F6", + "commit_store": "0x496fE96E440Fc683478a08Df92A1c5E23E412b1C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Celo Alfajores": { - "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", - "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "off_ramp": "0x4F146d34Be5E273e576ef158Bd7070eC22708D20", + "commit_store": "0xEeB665281c7ab51d25423898f730Ab078c69dd42", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", - "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "off_ramp": "0xB424365EEEEA58A36C7EC858f926f4e8275dDEb3", + "commit_store": "0xE95c2135e3330E953BB49068d32Fcba368Acd456", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Metis Sepolia": { - "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", - "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "off_ramp": "0x46DE6201c258f5948135cd0262f91e48Cb8e3828", + "commit_store": "0x3A27Fd059A4eF0e96B0643283A44a56A8d6CF34A", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Mode Sepolia": { - "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", - "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "off_ramp": "0x052E52fdd48719A6084366eA184FC44cb8C25DC2", + "commit_store": "0xBBb9baA314eB023E3F9291Aaf4107B6708341B50", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", - "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "off_ramp": "0xbfa6f6AAE31acB3A285e80026d6475C1a50d1d0F", + "commit_store": "0xB5FbA97Dc61ec68771a92a15360d9C32c9d054E7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", - "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "off_ramp": "0xC3e550B6aaFA5539df8bbCc5B0991e587f438e75", + "commit_store": "0xd57866D97ca26dfaE34088a3EeE4657BAFaac5f9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", - "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "off_ramp": "0x445F41C6aa7e910021786e860d7cfe3E7fcC6640", + "commit_store": "0x307dDE3c696E399b5837456FbCe03b1Ad76D46E3", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "ZKSync Sepolia": { - "off_ramp": "0xBaABd4166C892a1081a26535875A8fA3f22937b2", - "commit_store": "0xfda2e83F4D3f42B7629134ecD6E4b29FB8A7A07B", + "off_ramp": "0x9f5dC467A5c97068A1c2987486B8b768275627eD", + "commit_store": "0x6e4601DA99a046e4bde60d051568E3E1F35E3097", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -842,80 +800,74 @@ Data = """ "WeMix Testnet": { "is_native_fee_token": true, "fee_token": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", - "bridge_tokens": [ - "0xF4E4057FbBc86915F4b2d63EEFFe641C03294ffc" - ], - "bridge_tokens_pools": [ - "0x82A92B2863F93Be70D20660088Ec060720bA2fdb" - ], "arm": "0x8f6cb63eD5e379722580DFF0A051C140C64F9619", "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", "price_registry": "0x89D17571DB7C9540eeB36760E3c749C8fb984569", "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "on_ramp": "0xa5Be8C619F61505548992D9820c5c485b030C7B0", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "on_ramp": "0x7802B6804bbE7486229ac6D3519f0057c50b40a9", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "on_ramp": "0xd25B8c70CB43022Bdc3aC417E2Cf5159294d95A1", "deployed_at": 0 }, "Kroma Sepolia": { - "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "on_ramp": "0x1De2Ca07eEee7F524Fe5edA6C8FFFb79F67b05E9", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "on_ramp": "0xB37607C6BD4562F32967dE87D14663D59e3f655d", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "on_ramp": "0x0c972752F9aC3255cE45b440f9bBC6500676c4e6", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "on_ramp": "0x1CD55c65f85681Dfae47c62e6D93340D25006BbB", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", - "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "off_ramp": "0xB5492C8A71130B486fAD1091Db683584767A3957", + "commit_store": "0x1e151ED27E2F48EcFBd5b4374d0fc4869e07c397", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", - "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "off_ramp": "0x60536c757c2BBf72cC68A1933F7e336d03Bb68fe", + "commit_store": "0x2fF725556A04b47eB40BbA11d9F51e8fbbee9F07", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", - "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "off_ramp": "0xb858077FbE1E55cD7a9092Eb6d5403e068c14EAf", + "commit_store": "0x0EF13C7c95C27A9EA477363a26a09Cff44ba38F9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Kroma Sepolia": { - "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", - "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "off_ramp": "0x78d8154e1216F4791086bFa078Aaf07dcD2bD3C6", + "commit_store": "0xe67AAfbE6025e730Cf47a414BEFf2106FF231dB1", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", - "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "off_ramp": "0x995Fc17FC12b67f75D3cBf3bC71BD9af65671E78", + "commit_store": "0xD0825e3D8e61b67a06A93426749d38bCF73Ddb02", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", - "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "off_ramp": "0xd7b5B4F8FF7a87cC92f7B3058365862859d9E057", + "commit_store": "0xa8f2bb4e831caA5E2794AaD014030E378208d4Bc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", - "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "off_ramp": "0xa7E2F97Be7798327A49CACD022f33c0E7EfD4897", + "commit_store": "0x6fe69eE4eC9FD768193a40129A3Ba3dF140b2208", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -929,14 +881,14 @@ Data = """ "wrapped_native": "0x4317b2eCD41851173175005783322D29E9bAee9E", "src_contracts": { "Sepolia Testnet": { - "on_ramp": "0x79a9a5e9e318e8e109776569574814bbf935125a", + "on_ramp": "0xC38536521fde8556351aB7C4D3ea23b64AFbBbab", "deployed_at": 0 } }, "dest_contracts": { "Sepolia Testnet": { - "off_ramp": "0x18FF69051479796175852578725Fc74F58E963F8", - "commit_store": "0xF694b4FD7889480dca3CD41244e8e3395a9EFBa0", + "off_ramp": "0x19Ea9A42cd3682928aF19990dDb3904250D00a1D", + "commit_store": "0x20BF9037927bFadaF028D43ae07d1afccfB8fa85", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -1006,7 +958,7 @@ NetworkPairs = [ 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', 'BASE_SEPOLIA,GNOSIS_CHIADO', - 'KROMA_SEPOLIA,WEMIX_TESTNET', +# 'KROMA_SEPOLIA,WEMIX_TESTNET', 'OPTIMISM_SEPOLIA,POLYGON_AMOY', 'OPTIMISM_SEPOLIA,WEMIX_TESTNET', diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml index b1549377fda..17372a68681 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml @@ -26,59 +26,68 @@ Data = """ "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "on_ramp": "0x20C8c9F13C6AA402F2545AD15fB7a9CdE9108618", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "on_ramp": "0xF1623862e4c9f9Fba1Ac0181C4fF53B4f958F065", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "on_ramp": "0xEfe02eB139D2A82e38184d28E3b65bb176F26ebD", + "deployed_at": 0 + }, + "Metis Sepolia": { + "on_ramp": "0x46a79a6a4B07FD3FC14ea8299A99FE29576776E2", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "on_ramp": "0x0B0c08Bb2fA2EbDe25817009ee39eA1ad9bCaC58", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "on_ramp": "0x64d78F20aD987c7D52FdCB8FB0777bD00de53210", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "on_ramp": "0x2F3Daf77A663603826c7750E956b6555DE6f8250", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", - "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "off_ramp": "0x7245a5947E2F32B66aF74F4dAF91718ea19afaDf", + "commit_store": "0x490AC77BbB26f4FFf876Ded07bCAE6DBe685be98", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", - "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "off_ramp": "0xF2aB55Ed448A6fAD75013900568B6a927f52e5e0", + "commit_store": "0x833E5995A7422120f445f9B8dD1b9BD1037c68E5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", - "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "off_ramp": "0xc1Cb31493fB2386aDC1Ea01F935F2bd8a8dCA388", + "commit_store": "0xe21896657A65c8959F16E1c3Ee5713E85d9EA020", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Metis Sepolia": { + "off_ramp": "0xc47143147Fd62A09618C695c7C03714aCe8db1Cf", + "commit_store": "0x2F42e7B22eE5885158916624Ff00608f4C82313D", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", - "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "off_ramp": "0x4a7E91EF68758aaC66AeD656267bbCD0f9b6c019", + "commit_store": "0xb0A09D6A15FF7A0142DF3F62b2C4D1e11D763Ed0", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", - "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "off_ramp": "0xBed6e9131916d724418C8a6FE810F727302a5c00", + "commit_store": "0xdDb61B6bDa1B46d88f556440fABFe219F6da4F3a", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", - "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "off_ramp": "0x11d486E92d291704D1E25cDbAeee687237247826", + "commit_store": "0xece9353095aC79Db9DD5bf2022690Fa6BffeBCAc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -98,77 +107,77 @@ Data = """ "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "on_ramp": "0xa9946BA30DAeC98745755e4410d6e8E894Edc53B", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "on_ramp": "0x906BC7D10947A94ba0252e8C2E34868A466c03ED", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "on_ramp": "0x0aEc1AC9F6D0c21332d7a66dDF1Fbcb32cF3B0B3", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "on_ramp": "0x3dda45E731EC1db18B95651d1AF1868aa878468D", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "on_ramp": "0x2a9EFdc9F93D9b822129038EFCa4B63Adf3f7FB5", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "on_ramp": "0xA82b9ACAcFA6FaB1FD721e7a748A30E3001351F9", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "on_ramp": "0x75b9a75Ee1fFef6BE7c4F842a041De7c6153CF4E", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "on_ramp": "0x1ff99E67986E83bb5BA34143BaA2735853e5738c", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", - "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "off_ramp": "0xd88CBA0612f2Ce611BF6d073A94C8FD7E70B4fBd", + "commit_store": "0x9b8279E352bC167F714eef96A4C436bE996643cE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", - "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "off_ramp": "0x9c40A73F5C7454BB7C178AFa56Ee30bFB2DCf7E6", + "commit_store": "0xE5611af1d63340b711B0468a976651Fb79B17870", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", - "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "off_ramp": "0xf8de9d5924CFD28e31a53B63B4903436D9818d69", + "commit_store": "0xDD7CfECE1bb4e8aC2E8b8281CFE1D44247119471", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", - "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "off_ramp": "0x3F5035039C23cDAF032C64c084Dc70F811E62ddD", + "commit_store": "0xf5B0245c7B9e15f0cB0B85FF2B6799a45D61CbaA", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", - "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "off_ramp": "0x1DF9D94C6916918C935E60d2Cb4Ed265Bf778005", + "commit_store": "0xE7eeBE5882609d28C015d0A89DE1ba4f506F4a03", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "off_ramp": "0xbeD7F478Ef5627FB2B891fDA29Ca0131f6796D9D", + "commit_store": "0x27a319f58c01380056c86938798aCEAA1AC529e2", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", - "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "off_ramp": "0x01e3D835b4C4697D7F81B9d7Abc89A6E478E4a2f", + "commit_store": "0x4EC313c1Eb620432f42FB5f4Df27f8A566523c1C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", - "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "off_ramp": "0x15CcAbf0e3484D4872e25b883163D8cB724d4832", + "commit_store": "0x859f3477B7b4ECc19aDD8cCb19740932F21bD76b", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -188,59 +197,68 @@ Data = """ "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "on_ramp": "0x2A6f8Ed2e7b222163ef6EcC2327171B479399ab2", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "on_ramp": "0x97856Bf888F6eEDBBd322B28133BCcF9CA9038f6", + "deployed_at": 0 + }, + "Blast Sepolia": { + "on_ramp": "0xd0049BfFc8e2689Df9236FfA393Ccbf7eae4FbbC", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "on_ramp": "0x98dEa9e498F2A7aF6c74C915c88A17FbA09b73C2", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "on_ramp": "0x363EB789fE31F08547a847D8C38d9b55C7Cf1903", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "on_ramp": "0xC1C6438D60AbE9bF4b1F10460184CE9bD312e328", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "on_ramp": "0xbc85704EDb79ea84E9D3C18965F7f6A16B0a0440", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", - "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "off_ramp": "0x95b66acfaaDF122f4EccE52C0aD4Fd997DD1150C", + "commit_store": "0x3af04b1c1e79A6B8A4577Bb47EC33eD2E66AeB47", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", - "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "off_ramp": "0x0a5147e1Ac38C79c77031194ef64C8B5353F6EE9", + "commit_store": "0x103864D60b33a479EA7D0e23a37e0ce07198f0A9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Blast Sepolia": { + "off_ramp": "0xe1e8473218acCB82FBc24Ccd3C5D2dF166cd04f3", + "commit_store": "0x020B047A5Ca88fDB1ad3bAD9A082760fC7F770b6", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", - "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "off_ramp": "0x1F7FEBCBb10420E039C333A60A444c1a442d826C", + "commit_store": "0x23Ae763a64D39d6038431a64Bbc4A670C89d82b9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", - "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "off_ramp": "0xAAe325adbc9C5a28e4e94Fef170D55de2CA9aA01", + "commit_store": "0xD173Df3A1b23ec42eA5C4669b9c956Bef230efd1", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", - "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "off_ramp": "0xB513523aee87f838e78b32d2Bacaaf2e94D9f0f9", + "commit_store": "0x21A49164890576504C1f1c4DC9442c42C98771D7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", - "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "off_ramp": "0xc985571900DCa62387f93F882AB550472531f5DB", + "commit_store": "0xac5DACfAb1a512E33c49EFE42502863FC1a4BAB3", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -260,68 +278,68 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "on_ramp": "0xb52eF669d3fCeBee1f31418Facc02a16A6F6B0e5", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "on_ramp": "0x212e8Fd9cCC330ab54E8141FA7d33967eF1eDafF", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "on_ramp": "0xd54B44811AE99a18Cb95B4704ba04a65C0163751", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "on_ramp": "0xdd0Ee1F20E93a93634AAcE56105E19423881Df56", "deployed_at": 0 }, "Mode Sepolia": { - "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "on_ramp": "0xc59689dFDEF9D953cEFbb58912b304bb38408476", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "on_ramp": "0x2945D35F428CE564F5455AD0AF28BDFCa67e76Ab", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "on_ramp": "0x29A1F4ecE9246F0042A9062FB89803fA8B1830cB", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", - "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "off_ramp": "0x814E735c5DD19240c85E2513DD926Bc3a39f7140", + "commit_store": "0xFc24B204bfA5C65eD8e2Fc02fDe4FeCb62eA8Ac5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", - "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "off_ramp": "0x3Ab3a3d35cAC95FfcFCcc127eF01eA8D87b0A64e", + "commit_store": "0x51313B8C068B5227fa7364E6eCB1382Fb751976F", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", - "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "off_ramp": "0x827CF69409307Cd4c979e652894C297ad5124ab7", + "commit_store": "0x547eBe6077305c3fdF8dA66c66cc14b0779CE00C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "off_ramp": "0x8bB08Bc19771C69E739a2078894523b3DC05a05e", + "commit_store": "0xf163Da63bDB8b9C355d41C755E03125988650109", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Mode Sepolia": { - "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", - "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "off_ramp": "0x11E16c71D76E43acbcb496A70966380d905B1E32", + "commit_store": "0xEe19f039FaE3EF0F94971f0B7B187223D952ac13", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", - "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "off_ramp": "0x8718d1cc138421Dbc1B489CB7884FF68DE7ad867", + "commit_store": "0x3291D453c880E5b59EEd04E600c85268Cd378b7f", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", - "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "off_ramp": "0x0ecA23Ef70B828fEDd0A84d2692cB0527B52396A", + "commit_store": "0xA7F84Ec616F8e9Fa593339944E76bda90A9737fE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -340,15 +358,24 @@ Data = """ "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", "wrapped_native": "0x4200000000000000000000000000000000000023", "src_contracts": { + "BSC Testnet": { + "on_ramp": "0x6eA6f63b689b5597A0C06a5Eb8DcDFD86383857A", + "deployed_at": 0 + }, "Sepolia Testnet": { - "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "on_ramp": "0x154aDEF773a848da8229D81De73a7b0844400ebd", "deployed_at": 0 } }, "dest_contracts": { + "BSC Testnet": { + "off_ramp": "0xd9dE4aCD27E814bfe70CA33d2A4d079e740626Bd", + "commit_store": "0xe8fF7e22c54f76F453d6072A9d3a12B1D9AbA137", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, "Sepolia Testnet": { - "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", - "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "off_ramp": "0x46DD4e3e2b8a18409646F1C15bf3799a481e67f6", + "commit_store": "0x8250f9E992dda66791dd8b5d356B867ae53382cF", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -368,14 +395,14 @@ Data = """ "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", "src_contracts": { "Sepolia Testnet": { - "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "on_ramp": "0x68A4f57A499563192C606a898BAf503A43fcDB4D", "deployed_at": 0 } }, "dest_contracts": { "Sepolia Testnet": { - "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", - "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "off_ramp": "0xF6dB68333D14f6a0c1123cc420ea60980aEDA0Eb", + "commit_store": "0x8f9B63c40891CdF7d1C795625d4260a29bE2bBa0", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -395,68 +422,68 @@ Data = """ "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "on_ramp": "0x94967Ea06C6543Aaba5B90C52B655003ef82e521", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "on_ramp": "0x4f3576585e7fCCE5Fc502Bcf3CAdaD22E1194834", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "on_ramp": "0xB2642B54580140C375c9024e273C575a5f53d02d", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "on_ramp": "0x0E9504907be794620229C196F82CB062A66B7480", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "on_ramp": "0xeb86B5b6f5C66eCb58e4Cf98E607b238126505DC", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "on_ramp": "0xd86F5DF82A2500137Ddeef963028d60E3b5A354D", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "on_ramp": "0x03691D63C687D09368360e957AFB2F7B4d1651d4", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", - "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "off_ramp": "0x3633Cce99186217d4C7ed64FD455d218b8Cd5D4c", + "commit_store": "0x6e096286548451828c97F1B3E49C402a4934F39a", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "off_ramp": "0x5E4DB2A3c965B9B2A850a75697Bb6a00b4e35ac5", + "commit_store": "0x2489c5a802fE63943f7E3185A0362327B55DDF67", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", - "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "off_ramp": "0x2BA72Ba392C08750328635E36757A2c29a9165CA", + "commit_store": "0x08ebd7Cf4ABDC819c74cB45CbA4e291728538D7C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", - "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "off_ramp": "0x269D28B25Ee081ae5340e2BFE99850E92F1cd522", + "commit_store": "0x8dC9329BD221C89c4989d98c38Ff2Cc3dF92d14b", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", - "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "off_ramp": "0xd93B571ae9CaF43d70b2b53fFD55e035Db641e31", + "commit_store": "0x42C1093b9DdE8d0CD58859C610dc239B66bE26de", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", - "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "off_ramp": "0x87F9b8382611ACD01d5696a1f5b05B888e55B0Cc", + "commit_store": "0x29AC46227908d31A9BdDe82c0A4a6c52D802f145", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", - "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "off_ramp": "0x9aa734100C425309091dAE18154e0356B82d477a", + "commit_store": "0x7cDd533B82f4c32FAE7f551C37b1490909817C45", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -476,14 +503,14 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000001", "src_contracts": { "WeMix Testnet": { - "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "on_ramp": "0xa81418c332d3E04338B058Ab39b1baf53029F638", "deployed_at": 0 } }, "dest_contracts": { "WeMix Testnet": { - "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", - "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "off_ramp": "0x42Dde725C4f05C237a00B582Bb7457e208d3A17C", + "commit_store": "0xb116E9a90534354dA59CF93a87c1E9711c0Aaa2c", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -502,15 +529,24 @@ Data = """ "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x2eb69889cc979c0Be120813FcE2f1558efF4ceB5", + "deployed_at": 0 + }, "Sepolia Testnet": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "on_ramp": "0xE0dFc15C0CDf607b2088D0B641E00eA0B418124C", "deployed_at": 0 } }, "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x839b5dEA3e084790F580E9DfCE8CCfDf49c5835e", + "commit_store": "0xdF38C8aD34C379165f98A75a6894790bB5a16b1D", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, "Sepolia Testnet": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "off_ramp": "0x72130De9A85e9C61151253aFF8801Bb3242A00a9", + "commit_store": "0x8F6D64280C379F680Ff0c3278f340D72a465FAAc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -530,23 +566,23 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Base Sepolia": { - "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "on_ramp": "0x48ACE2319f643584B77C21476a6c664D7F13a107", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "on_ramp": "0xb821885731414497d705dc56325f18AA33e612dC", "deployed_at": 0 } }, "dest_contracts": { "Base Sepolia": { - "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", - "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "off_ramp": "0xC6b69Fa9eeBc55e64eBc68371Fbd41ff73756F17", + "commit_store": "0xaA6691EA9110409a29C2E665174b4b2fe694cE67", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", - "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "off_ramp": "0x35dE2C381a2fF8a26c8ae94145be3A9cA8C83600", + "commit_store": "0xE7e60DAee094416b8ab2083047a893c4c4290c48", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -566,68 +602,68 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "on_ramp": "0x6B36c9CD74E760088817a047C3460dEdFfe9a11A", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "on_ramp": "0x91a144F570ABA7FB7079Fb187A267390E0cc7367", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "on_ramp": "0x6D22953cdEf8B0C9F0976Cfa52c33B198fEc5881", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "on_ramp": "0xec7D9A84A6d4556056975BE50Cdc97bAa9313632", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "on_ramp": "0x9E09C2A7D6B9F88c62f0E2Af4cd62dF3F4c326F1", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "on_ramp": "0x54b32C2aCb4451c6cF66bcbd856d8A7Cc2263531", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "on_ramp": "0xB9Ef21C04d8340b223e9C1d7a09f332609c70300", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", - "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "off_ramp": "0xF35e2d1457749374453e44B06268aD3f78b133b3", + "commit_store": "0x4bd755d86E25dD4093CAa5639CfDab81571259CA", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", - "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "off_ramp": "0xCb2266c2118b1f30D15CBeB3a885531ABaA1b556", + "commit_store": "0x5Ded92E2CF71a8fF7644a67850F061c38B31BfB4", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", - "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "off_ramp": "0x960c62A491C30d0a60fD74a59d35B9C02697AdaA", + "commit_store": "0x06963745B3839B998288D1a46a46Ec25991A3D5E", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", - "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "off_ramp": "0x7d6721c2E85560F0A233255D3d332AcF6f850d96", + "commit_store": "0xaC00661cAB5161d9B4746DFb7A028d97981aB2c5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", - "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "off_ramp": "0x4cEeFa55AF23dFD27Cf926e8eFB1D1bCcD24526E", + "commit_store": "0xaD3943BdECbf4ae7d6E51aB0FD06bbC604bB7b95", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", - "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "off_ramp": "0x2aF9B10A5972D0c36f4d8F85773052c104E319B2", + "commit_store": "0x82FCF55b9e9bAb3066c2863F12a02bBc2Ba33F2F", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", - "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "off_ramp": "0x0FA15Bc42D4999d964CBf0161489Bd392DEE834e", + "commit_store": "0x37760F99a5b91884C9D89a06408f532aEbb0e674", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -647,59 +683,59 @@ Data = """ "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "on_ramp": "0xad6A94CFB51e7DE30FD21F417E4cBf70D3AdaD30", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "on_ramp": "0x28EC0a9C90360F55C2a9DaD5901b074C257904ca", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "on_ramp": "0x9DF611536f124278Ce968c476BDb10A66E54ecfE", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "on_ramp": "0x600f00aef9b8ED8EDBd7284B5F04a1932c3408aF", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "on_ramp": "0x719Aef2C63376AdeCD62D2b59D54682aFBde914a", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "on_ramp": "0x7D6c93E49E46cc983a677c283EAb27CbbC94e3C4", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", - "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "off_ramp": "0xAc56Df7F5fbde0DeeB1C0d397A150EDD5EE68625", + "commit_store": "0x8AF56D1c76B8c8CeE451a0a654D130e4050B993e", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", - "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "off_ramp": "0x40Ba47ea59D80DDd35E3a997AA520FBa0553dddc", + "commit_store": "0x8afe532517b39bA109d1A768E1Ad8b5C6485abF5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", - "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "off_ramp": "0x7B968B2aDFd31765dAAD80d66c83F9D7006BFFd5", + "commit_store": "0xBc70551B5624BaF8cdCB84136198561C9cf5C176", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", - "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "off_ramp": "0xAA755Ef570986feEb6522377077e549e3013843E", + "commit_store": "0x5C7827EcE6a51AdaC36ef71aC01706deb1C7130d", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", - "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "off_ramp": "0x7Ad494C173f5845c6B4028a06cDcC6d3108bc960", + "commit_store": "0x104A1c8b05D37fE732094595Fe696AFc7EAB8668", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", - "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "off_ramp": "0xa85481273f8C112e96ED7476202F06D6131cf069", + "commit_store": "0x9FdF1D555e37dB09B0d151FEa53c134C88C4DeFd", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -719,122 +755,122 @@ Data = """ "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "on_ramp": "0xBc09627e58989Ba8F1eDA775e486467d2A00944F", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "on_ramp": "0x12492154714fBD28F28219f6fc4315d19de1025B", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "on_ramp": "0x7a75b3818412fe0028590feE8270ba9E3fd01DBe", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "on_ramp": "0x8F35B097022135E0F46831f798a240Cc8c4b0B01", "deployed_at": 0 }, "Blast Sepolia": { - "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "on_ramp": "0x4ADA60556dA05FcF53a79359e37a3E13FebA22Bf", "deployed_at": 0 }, "Celo Alfajores": { - "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "on_ramp": "0x1163D1F7D75eEb1C4f4c6912d3cF9642027aFD30", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "on_ramp": "0x831A7DbE6af8601427A0ADa89b642d4b59007eED", "deployed_at": 0 }, "Metis Sepolia": { - "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "on_ramp": "0xabB5A4f99DFEb4a3912e8Acc0660A008c76dA8c3", "deployed_at": 0 }, "Mode Sepolia": { - "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "on_ramp": "0x2Eb0842925fb7aA6045e951e98e8b4b3aFFaBB54", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "on_ramp": "0xACDfd7a98d853FA3914047Cd46e7f5D53BBC9FbB", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "on_ramp": "0xf9765c80F6448e6d4d02BeF4a6b4152131A2F513", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "on_ramp": "0xd72c3c132B76F5D232C37dF3bF8f04392D552e0F", "deployed_at": 0 }, "ZKSync Sepolia": { - "on_ramp": "0x1Acb3A885feA37bdA30AB99b99327b14391f500F", + "on_ramp": "0xA2865E4f36760f5fa5c8F958336120f2DF0d974b", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", - "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "off_ramp": "0xD2f5edfD4561d6E7599F6c6888Bd353cAFd0c55E", + "commit_store": "0x240420BC6bCDc067e668c7492D69fe06B3CF80cE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", - "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "off_ramp": "0x1DEBa99dC8e2A77832461BD386d83D9FCb133137", + "commit_store": "0x139E06b6dBB1a0C41A1686C091795879c943765A", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", - "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "off_ramp": "0x04305BD9D9CA6730517f79c3D9c6828BC2D25Ecb", + "commit_store": "0x32edD59840CD9e474A280cf1707439F2Bd5872d4", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", - "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "off_ramp": "0x662738DC7DE4f7eC63d9f73Cdf9BeA5A58DdcC15", + "commit_store": "0x1e46bAC486Dd878cD57B62845530A52343e39693", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Blast Sepolia": { - "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", - "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "off_ramp": "0x049A424cF894709f044bc70177F8F6b792adc3F6", + "commit_store": "0x496fE96E440Fc683478a08Df92A1c5E23E412b1C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Celo Alfajores": { - "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", - "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "off_ramp": "0x4F146d34Be5E273e576ef158Bd7070eC22708D20", + "commit_store": "0xEeB665281c7ab51d25423898f730Ab078c69dd42", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", - "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "off_ramp": "0xB424365EEEEA58A36C7EC858f926f4e8275dDEb3", + "commit_store": "0xE95c2135e3330E953BB49068d32Fcba368Acd456", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Metis Sepolia": { - "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", - "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "off_ramp": "0x46DE6201c258f5948135cd0262f91e48Cb8e3828", + "commit_store": "0x3A27Fd059A4eF0e96B0643283A44a56A8d6CF34A", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Mode Sepolia": { - "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", - "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "off_ramp": "0x052E52fdd48719A6084366eA184FC44cb8C25DC2", + "commit_store": "0xBBb9baA314eB023E3F9291Aaf4107B6708341B50", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", - "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "off_ramp": "0xbfa6f6AAE31acB3A285e80026d6475C1a50d1d0F", + "commit_store": "0xB5FbA97Dc61ec68771a92a15360d9C32c9d054E7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", - "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "off_ramp": "0xC3e550B6aaFA5539df8bbCc5B0991e587f438e75", + "commit_store": "0xd57866D97ca26dfaE34088a3EeE4657BAFaac5f9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", - "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "off_ramp": "0x445F41C6aa7e910021786e860d7cfe3E7fcC6640", + "commit_store": "0x307dDE3c696E399b5837456FbCe03b1Ad76D46E3", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "ZKSync Sepolia": { - "off_ramp": "0xBaABd4166C892a1081a26535875A8fA3f22937b2", - "commit_store": "0xfda2e83F4D3f42B7629134ecD6E4b29FB8A7A07B", + "off_ramp": "0x9f5dC467A5c97068A1c2987486B8b768275627eD", + "commit_store": "0x6e4601DA99a046e4bde60d051568E3E1F35E3097", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -854,68 +890,68 @@ Data = """ "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "on_ramp": "0xa5Be8C619F61505548992D9820c5c485b030C7B0", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "on_ramp": "0x7802B6804bbE7486229ac6D3519f0057c50b40a9", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "on_ramp": "0xd25B8c70CB43022Bdc3aC417E2Cf5159294d95A1", "deployed_at": 0 }, "Kroma Sepolia": { - "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "on_ramp": "0x1De2Ca07eEee7F524Fe5edA6C8FFFb79F67b05E9", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "on_ramp": "0xB37607C6BD4562F32967dE87D14663D59e3f655d", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "on_ramp": "0x0c972752F9aC3255cE45b440f9bBC6500676c4e6", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "on_ramp": "0x1CD55c65f85681Dfae47c62e6D93340D25006BbB", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", - "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "off_ramp": "0xB5492C8A71130B486fAD1091Db683584767A3957", + "commit_store": "0x1e151ED27E2F48EcFBd5b4374d0fc4869e07c397", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", - "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "off_ramp": "0x60536c757c2BBf72cC68A1933F7e336d03Bb68fe", + "commit_store": "0x2fF725556A04b47eB40BbA11d9F51e8fbbee9F07", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", - "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "off_ramp": "0xb858077FbE1E55cD7a9092Eb6d5403e068c14EAf", + "commit_store": "0x0EF13C7c95C27A9EA477363a26a09Cff44ba38F9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Kroma Sepolia": { - "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", - "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "off_ramp": "0x78d8154e1216F4791086bFa078Aaf07dcD2bD3C6", + "commit_store": "0xe67AAfbE6025e730Cf47a414BEFf2106FF231dB1", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", - "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "off_ramp": "0x995Fc17FC12b67f75D3cBf3bC71BD9af65671E78", + "commit_store": "0xD0825e3D8e61b67a06A93426749d38bCF73Ddb02", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", - "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "off_ramp": "0xd7b5B4F8FF7a87cC92f7B3058365862859d9E057", + "commit_store": "0xa8f2bb4e831caA5E2794AaD014030E378208d4Bc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", - "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "off_ramp": "0xa7E2F97Be7798327A49CACD022f33c0E7EfD4897", + "commit_store": "0x6fe69eE4eC9FD768193a40129A3Ba3dF140b2208", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -923,20 +959,26 @@ Data = """ "ZKSync Sepolia": { "is_native_fee_token": true, "fee_token": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "bridge_tokens": [ + "0xFf6d0c1518A8104611f482eb2801CaF4f13c9dEb" + ], + "bridge_tokens_pools": [ + "0xA16cfA090aA6888AE8Beb92F8bfD316DD05767C9" + ], "arm": "0x926b4f90610Aa448f27c8e0Fd0afa4A17B7305F9", "router": "0xA1fdA8aa9A8C4b945C45aD30647b01f07D7A0B16", "price_registry": "0x648B6BB09bE1C5766C8AC578B9B4aC8497eA671F", "wrapped_native": "0x4317b2eCD41851173175005783322D29E9bAee9E", "src_contracts": { "Sepolia Testnet": { - "on_ramp": "0x79a9a5e9e318e8e109776569574814bbf935125a", + "on_ramp": "0xC38536521fde8556351aB7C4D3ea23b64AFbBbab", "deployed_at": 0 } }, "dest_contracts": { "Sepolia Testnet": { - "off_ramp": "0x18FF69051479796175852578725Fc74F58E963F8", - "commit_store": "0xF694b4FD7889480dca3CD41244e8e3395a9EFBa0", + "off_ramp": "0x19Ea9A42cd3682928aF19990dDb3904250D00a1D", + "commit_store": "0x20BF9037927bFadaF028D43ae07d1afccfB8fa85", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -976,7 +1018,7 @@ NetworkPairs = [ 'SEPOLIA,ARBITRUM_SEPOLIA', 'SEPOLIA,BASE_SEPOLIA', 'SEPOLIA,BLAST_SEPOLIA', - 'SEPOLIA,MODE_SEPOLIA', +# 'SEPOLIA,MODE_SEPOLIA', 'SEPOLIA,OPTIMISM_SEPOLIA', 'SEPOLIA,POLYGON_AMOY', 'SEPOLIA,WEMIX_TESTNET', @@ -1002,7 +1044,7 @@ NetworkPairs = [ 'ARBITRUM_SEPOLIA,WEMIX_TESTNET', 'ARBITRUM_SEPOLIA,GNOSIS_CHIADO', - 'BASE_SEPOLIA,MODE_SEPOLIA', +# 'BASE_SEPOLIA,MODE_SEPOLIA', 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', 'BASE_SEPOLIA,GNOSIS_CHIADO', diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml index 6a6aa205fce..9c22063f11d 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml @@ -26,59 +26,68 @@ Data = """ "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "on_ramp": "0x20C8c9F13C6AA402F2545AD15fB7a9CdE9108618", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "on_ramp": "0xF1623862e4c9f9Fba1Ac0181C4fF53B4f958F065", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "on_ramp": "0xEfe02eB139D2A82e38184d28E3b65bb176F26ebD", + "deployed_at": 0 + }, + "Metis Sepolia": { + "on_ramp": "0x46a79a6a4B07FD3FC14ea8299A99FE29576776E2", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "on_ramp": "0x0B0c08Bb2fA2EbDe25817009ee39eA1ad9bCaC58", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "on_ramp": "0x64d78F20aD987c7D52FdCB8FB0777bD00de53210", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "on_ramp": "0x2F3Daf77A663603826c7750E956b6555DE6f8250", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", - "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "off_ramp": "0x7245a5947E2F32B66aF74F4dAF91718ea19afaDf", + "commit_store": "0x490AC77BbB26f4FFf876Ded07bCAE6DBe685be98", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", - "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "off_ramp": "0xF2aB55Ed448A6fAD75013900568B6a927f52e5e0", + "commit_store": "0x833E5995A7422120f445f9B8dD1b9BD1037c68E5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", - "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "off_ramp": "0xc1Cb31493fB2386aDC1Ea01F935F2bd8a8dCA388", + "commit_store": "0xe21896657A65c8959F16E1c3Ee5713E85d9EA020", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Metis Sepolia": { + "off_ramp": "0xc47143147Fd62A09618C695c7C03714aCe8db1Cf", + "commit_store": "0x2F42e7B22eE5885158916624Ff00608f4C82313D", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", - "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "off_ramp": "0x4a7E91EF68758aaC66AeD656267bbCD0f9b6c019", + "commit_store": "0xb0A09D6A15FF7A0142DF3F62b2C4D1e11D763Ed0", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", - "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "off_ramp": "0xBed6e9131916d724418C8a6FE810F727302a5c00", + "commit_store": "0xdDb61B6bDa1B46d88f556440fABFe219F6da4F3a", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", - "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "off_ramp": "0x11d486E92d291704D1E25cDbAeee687237247826", + "commit_store": "0xece9353095aC79Db9DD5bf2022690Fa6BffeBCAc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -98,77 +107,77 @@ Data = """ "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "on_ramp": "0xa9946BA30DAeC98745755e4410d6e8E894Edc53B", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "on_ramp": "0x906BC7D10947A94ba0252e8C2E34868A466c03ED", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "on_ramp": "0x0aEc1AC9F6D0c21332d7a66dDF1Fbcb32cF3B0B3", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "on_ramp": "0x3dda45E731EC1db18B95651d1AF1868aa878468D", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "on_ramp": "0x2a9EFdc9F93D9b822129038EFCa4B63Adf3f7FB5", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "on_ramp": "0xA82b9ACAcFA6FaB1FD721e7a748A30E3001351F9", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "on_ramp": "0x75b9a75Ee1fFef6BE7c4F842a041De7c6153CF4E", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "on_ramp": "0x1ff99E67986E83bb5BA34143BaA2735853e5738c", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", - "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "off_ramp": "0xd88CBA0612f2Ce611BF6d073A94C8FD7E70B4fBd", + "commit_store": "0x9b8279E352bC167F714eef96A4C436bE996643cE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", - "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "off_ramp": "0x9c40A73F5C7454BB7C178AFa56Ee30bFB2DCf7E6", + "commit_store": "0xE5611af1d63340b711B0468a976651Fb79B17870", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", - "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "off_ramp": "0xf8de9d5924CFD28e31a53B63B4903436D9818d69", + "commit_store": "0xDD7CfECE1bb4e8aC2E8b8281CFE1D44247119471", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", - "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "off_ramp": "0x3F5035039C23cDAF032C64c084Dc70F811E62ddD", + "commit_store": "0xf5B0245c7B9e15f0cB0B85FF2B6799a45D61CbaA", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", - "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "off_ramp": "0x1DF9D94C6916918C935E60d2Cb4Ed265Bf778005", + "commit_store": "0xE7eeBE5882609d28C015d0A89DE1ba4f506F4a03", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "off_ramp": "0xbeD7F478Ef5627FB2B891fDA29Ca0131f6796D9D", + "commit_store": "0x27a319f58c01380056c86938798aCEAA1AC529e2", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", - "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "off_ramp": "0x01e3D835b4C4697D7F81B9d7Abc89A6E478E4a2f", + "commit_store": "0x4EC313c1Eb620432f42FB5f4Df27f8A566523c1C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", - "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "off_ramp": "0x15CcAbf0e3484D4872e25b883163D8cB724d4832", + "commit_store": "0x859f3477B7b4ECc19aDD8cCb19740932F21bD76b", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -188,59 +197,68 @@ Data = """ "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "on_ramp": "0x2A6f8Ed2e7b222163ef6EcC2327171B479399ab2", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "on_ramp": "0x97856Bf888F6eEDBBd322B28133BCcF9CA9038f6", + "deployed_at": 0 + }, + "Blast Sepolia": { + "on_ramp": "0xd0049BfFc8e2689Df9236FfA393Ccbf7eae4FbbC", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "on_ramp": "0x98dEa9e498F2A7aF6c74C915c88A17FbA09b73C2", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "on_ramp": "0x363EB789fE31F08547a847D8C38d9b55C7Cf1903", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "on_ramp": "0xC1C6438D60AbE9bF4b1F10460184CE9bD312e328", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "on_ramp": "0xbc85704EDb79ea84E9D3C18965F7f6A16B0a0440", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", - "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "off_ramp": "0x95b66acfaaDF122f4EccE52C0aD4Fd997DD1150C", + "commit_store": "0x3af04b1c1e79A6B8A4577Bb47EC33eD2E66AeB47", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", - "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "off_ramp": "0x0a5147e1Ac38C79c77031194ef64C8B5353F6EE9", + "commit_store": "0x103864D60b33a479EA7D0e23a37e0ce07198f0A9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Blast Sepolia": { + "off_ramp": "0xe1e8473218acCB82FBc24Ccd3C5D2dF166cd04f3", + "commit_store": "0x020B047A5Ca88fDB1ad3bAD9A082760fC7F770b6", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", - "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "off_ramp": "0x1F7FEBCBb10420E039C333A60A444c1a442d826C", + "commit_store": "0x23Ae763a64D39d6038431a64Bbc4A670C89d82b9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", - "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "off_ramp": "0xAAe325adbc9C5a28e4e94Fef170D55de2CA9aA01", + "commit_store": "0xD173Df3A1b23ec42eA5C4669b9c956Bef230efd1", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", - "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "off_ramp": "0xB513523aee87f838e78b32d2Bacaaf2e94D9f0f9", + "commit_store": "0x21A49164890576504C1f1c4DC9442c42C98771D7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", - "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "off_ramp": "0xc985571900DCa62387f93F882AB550472531f5DB", + "commit_store": "0xac5DACfAb1a512E33c49EFE42502863FC1a4BAB3", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -260,68 +278,68 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "on_ramp": "0xb52eF669d3fCeBee1f31418Facc02a16A6F6B0e5", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "on_ramp": "0x212e8Fd9cCC330ab54E8141FA7d33967eF1eDafF", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "on_ramp": "0xd54B44811AE99a18Cb95B4704ba04a65C0163751", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "on_ramp": "0xdd0Ee1F20E93a93634AAcE56105E19423881Df56", "deployed_at": 0 }, "Mode Sepolia": { - "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "on_ramp": "0xc59689dFDEF9D953cEFbb58912b304bb38408476", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "on_ramp": "0x2945D35F428CE564F5455AD0AF28BDFCa67e76Ab", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "on_ramp": "0x29A1F4ecE9246F0042A9062FB89803fA8B1830cB", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", - "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "off_ramp": "0x814E735c5DD19240c85E2513DD926Bc3a39f7140", + "commit_store": "0xFc24B204bfA5C65eD8e2Fc02fDe4FeCb62eA8Ac5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", - "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "off_ramp": "0x3Ab3a3d35cAC95FfcFCcc127eF01eA8D87b0A64e", + "commit_store": "0x51313B8C068B5227fa7364E6eCB1382Fb751976F", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", - "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "off_ramp": "0x827CF69409307Cd4c979e652894C297ad5124ab7", + "commit_store": "0x547eBe6077305c3fdF8dA66c66cc14b0779CE00C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "off_ramp": "0x8bB08Bc19771C69E739a2078894523b3DC05a05e", + "commit_store": "0xf163Da63bDB8b9C355d41C755E03125988650109", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Mode Sepolia": { - "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", - "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "off_ramp": "0x11E16c71D76E43acbcb496A70966380d905B1E32", + "commit_store": "0xEe19f039FaE3EF0F94971f0B7B187223D952ac13", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", - "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "off_ramp": "0x8718d1cc138421Dbc1B489CB7884FF68DE7ad867", + "commit_store": "0x3291D453c880E5b59EEd04E600c85268Cd378b7f", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", - "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "off_ramp": "0x0ecA23Ef70B828fEDd0A84d2692cB0527B52396A", + "commit_store": "0xA7F84Ec616F8e9Fa593339944E76bda90A9737fE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -340,15 +358,24 @@ Data = """ "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", "wrapped_native": "0x4200000000000000000000000000000000000023", "src_contracts": { + "BSC Testnet": { + "on_ramp": "0x6eA6f63b689b5597A0C06a5Eb8DcDFD86383857A", + "deployed_at": 0 + }, "Sepolia Testnet": { - "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "on_ramp": "0x154aDEF773a848da8229D81De73a7b0844400ebd", "deployed_at": 0 } }, "dest_contracts": { + "BSC Testnet": { + "off_ramp": "0xd9dE4aCD27E814bfe70CA33d2A4d079e740626Bd", + "commit_store": "0xe8fF7e22c54f76F453d6072A9d3a12B1D9AbA137", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, "Sepolia Testnet": { - "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", - "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "off_ramp": "0x46DD4e3e2b8a18409646F1C15bf3799a481e67f6", + "commit_store": "0x8250f9E992dda66791dd8b5d356B867ae53382cF", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -368,14 +395,14 @@ Data = """ "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", "src_contracts": { "Sepolia Testnet": { - "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "on_ramp": "0x68A4f57A499563192C606a898BAf503A43fcDB4D", "deployed_at": 0 } }, "dest_contracts": { "Sepolia Testnet": { - "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", - "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "off_ramp": "0xF6dB68333D14f6a0c1123cc420ea60980aEDA0Eb", + "commit_store": "0x8f9B63c40891CdF7d1C795625d4260a29bE2bBa0", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -395,68 +422,68 @@ Data = """ "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "on_ramp": "0x94967Ea06C6543Aaba5B90C52B655003ef82e521", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "on_ramp": "0x4f3576585e7fCCE5Fc502Bcf3CAdaD22E1194834", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "on_ramp": "0xB2642B54580140C375c9024e273C575a5f53d02d", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "on_ramp": "0x0E9504907be794620229C196F82CB062A66B7480", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "on_ramp": "0xeb86B5b6f5C66eCb58e4Cf98E607b238126505DC", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "on_ramp": "0xd86F5DF82A2500137Ddeef963028d60E3b5A354D", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "on_ramp": "0x03691D63C687D09368360e957AFB2F7B4d1651d4", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", - "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "off_ramp": "0x3633Cce99186217d4C7ed64FD455d218b8Cd5D4c", + "commit_store": "0x6e096286548451828c97F1B3E49C402a4934F39a", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", - "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "off_ramp": "0x5E4DB2A3c965B9B2A850a75697Bb6a00b4e35ac5", + "commit_store": "0x2489c5a802fE63943f7E3185A0362327B55DDF67", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", - "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "off_ramp": "0x2BA72Ba392C08750328635E36757A2c29a9165CA", + "commit_store": "0x08ebd7Cf4ABDC819c74cB45CbA4e291728538D7C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", - "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "off_ramp": "0x269D28B25Ee081ae5340e2BFE99850E92F1cd522", + "commit_store": "0x8dC9329BD221C89c4989d98c38Ff2Cc3dF92d14b", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", - "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "off_ramp": "0xd93B571ae9CaF43d70b2b53fFD55e035Db641e31", + "commit_store": "0x42C1093b9DdE8d0CD58859C610dc239B66bE26de", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", - "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "off_ramp": "0x87F9b8382611ACD01d5696a1f5b05B888e55B0Cc", + "commit_store": "0x29AC46227908d31A9BdDe82c0A4a6c52D802f145", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", - "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "off_ramp": "0x9aa734100C425309091dAE18154e0356B82d477a", + "commit_store": "0x7cDd533B82f4c32FAE7f551C37b1490909817C45", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -476,14 +503,14 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000001", "src_contracts": { "WeMix Testnet": { - "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "on_ramp": "0xa81418c332d3E04338B058Ab39b1baf53029F638", "deployed_at": 0 } }, "dest_contracts": { "WeMix Testnet": { - "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", - "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "off_ramp": "0x42Dde725C4f05C237a00B582Bb7457e208d3A17C", + "commit_store": "0xb116E9a90534354dA59CF93a87c1E9711c0Aaa2c", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -502,15 +529,24 @@ Data = """ "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x2eb69889cc979c0Be120813FcE2f1558efF4ceB5", + "deployed_at": 0 + }, "Sepolia Testnet": { - "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "on_ramp": "0xE0dFc15C0CDf607b2088D0B641E00eA0B418124C", "deployed_at": 0 } }, "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x839b5dEA3e084790F580E9DfCE8CCfDf49c5835e", + "commit_store": "0xdF38C8aD34C379165f98A75a6894790bB5a16b1D", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, "Sepolia Testnet": { - "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", - "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "off_ramp": "0x72130De9A85e9C61151253aFF8801Bb3242A00a9", + "commit_store": "0x8F6D64280C379F680Ff0c3278f340D72a465FAAc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -530,23 +566,23 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Base Sepolia": { - "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "on_ramp": "0x48ACE2319f643584B77C21476a6c664D7F13a107", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "on_ramp": "0xb821885731414497d705dc56325f18AA33e612dC", "deployed_at": 0 } }, "dest_contracts": { "Base Sepolia": { - "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", - "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "off_ramp": "0xC6b69Fa9eeBc55e64eBc68371Fbd41ff73756F17", + "commit_store": "0xaA6691EA9110409a29C2E665174b4b2fe694cE67", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", - "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "off_ramp": "0x35dE2C381a2fF8a26c8ae94145be3A9cA8C83600", + "commit_store": "0xE7e60DAee094416b8ab2083047a893c4c4290c48", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -566,68 +602,68 @@ Data = """ "wrapped_native": "0x4200000000000000000000000000000000000006", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "on_ramp": "0x6B36c9CD74E760088817a047C3460dEdFfe9a11A", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "on_ramp": "0x91a144F570ABA7FB7079Fb187A267390E0cc7367", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "on_ramp": "0x6D22953cdEf8B0C9F0976Cfa52c33B198fEc5881", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "on_ramp": "0xec7D9A84A6d4556056975BE50Cdc97bAa9313632", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "on_ramp": "0x9E09C2A7D6B9F88c62f0E2Af4cd62dF3F4c326F1", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "on_ramp": "0x54b32C2aCb4451c6cF66bcbd856d8A7Cc2263531", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "on_ramp": "0xB9Ef21C04d8340b223e9C1d7a09f332609c70300", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", - "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "off_ramp": "0xF35e2d1457749374453e44B06268aD3f78b133b3", + "commit_store": "0x4bd755d86E25dD4093CAa5639CfDab81571259CA", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", - "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "off_ramp": "0xCb2266c2118b1f30D15CBeB3a885531ABaA1b556", + "commit_store": "0x5Ded92E2CF71a8fF7644a67850F061c38B31BfB4", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", - "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "off_ramp": "0x960c62A491C30d0a60fD74a59d35B9C02697AdaA", + "commit_store": "0x06963745B3839B998288D1a46a46Ec25991A3D5E", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", - "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "off_ramp": "0x7d6721c2E85560F0A233255D3d332AcF6f850d96", + "commit_store": "0xaC00661cAB5161d9B4746DFb7A028d97981aB2c5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", - "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "off_ramp": "0x4cEeFa55AF23dFD27Cf926e8eFB1D1bCcD24526E", + "commit_store": "0xaD3943BdECbf4ae7d6E51aB0FD06bbC604bB7b95", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", - "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "off_ramp": "0x2aF9B10A5972D0c36f4d8F85773052c104E319B2", + "commit_store": "0x82FCF55b9e9bAb3066c2863F12a02bBc2Ba33F2F", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", - "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "off_ramp": "0x0FA15Bc42D4999d964CBf0161489Bd392DEE834e", + "commit_store": "0x37760F99a5b91884C9D89a06408f532aEbb0e674", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -647,59 +683,59 @@ Data = """ "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", "src_contracts": { "Avalanche Fuji": { - "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "on_ramp": "0xad6A94CFB51e7DE30FD21F417E4cBf70D3AdaD30", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "on_ramp": "0x28EC0a9C90360F55C2a9DaD5901b074C257904ca", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "on_ramp": "0x9DF611536f124278Ce968c476BDb10A66E54ecfE", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "on_ramp": "0x600f00aef9b8ED8EDBd7284B5F04a1932c3408aF", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "on_ramp": "0x719Aef2C63376AdeCD62D2b59D54682aFBde914a", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "on_ramp": "0x7D6c93E49E46cc983a677c283EAb27CbbC94e3C4", "deployed_at": 0 } }, "dest_contracts": { "Avalanche Fuji": { - "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", - "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "off_ramp": "0xAc56Df7F5fbde0DeeB1C0d397A150EDD5EE68625", + "commit_store": "0x8AF56D1c76B8c8CeE451a0a654D130e4050B993e", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", - "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "off_ramp": "0x40Ba47ea59D80DDd35E3a997AA520FBa0553dddc", + "commit_store": "0x8afe532517b39bA109d1A768E1Ad8b5C6485abF5", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", - "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "off_ramp": "0x7B968B2aDFd31765dAAD80d66c83F9D7006BFFd5", + "commit_store": "0xBc70551B5624BaF8cdCB84136198561C9cf5C176", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", - "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "off_ramp": "0xAA755Ef570986feEb6522377077e549e3013843E", + "commit_store": "0x5C7827EcE6a51AdaC36ef71aC01706deb1C7130d", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", - "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "off_ramp": "0x7Ad494C173f5845c6B4028a06cDcC6d3108bc960", + "commit_store": "0x104A1c8b05D37fE732094595Fe696AFc7EAB8668", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", - "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "off_ramp": "0xa85481273f8C112e96ED7476202F06D6131cf069", + "commit_store": "0x9FdF1D555e37dB09B0d151FEa53c134C88C4DeFd", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -719,122 +755,122 @@ Data = """ "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "on_ramp": "0xBc09627e58989Ba8F1eDA775e486467d2A00944F", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "on_ramp": "0x12492154714fBD28F28219f6fc4315d19de1025B", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "on_ramp": "0x7a75b3818412fe0028590feE8270ba9E3fd01DBe", "deployed_at": 0 }, "Base Sepolia": { - "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "on_ramp": "0x8F35B097022135E0F46831f798a240Cc8c4b0B01", "deployed_at": 0 }, "Blast Sepolia": { - "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "on_ramp": "0x4ADA60556dA05FcF53a79359e37a3E13FebA22Bf", "deployed_at": 0 }, "Celo Alfajores": { - "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "on_ramp": "0x1163D1F7D75eEb1C4f4c6912d3cF9642027aFD30", "deployed_at": 0 }, "Gnosis Chiado": { - "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "on_ramp": "0x831A7DbE6af8601427A0ADa89b642d4b59007eED", "deployed_at": 0 }, "Metis Sepolia": { - "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "on_ramp": "0xabB5A4f99DFEb4a3912e8Acc0660A008c76dA8c3", "deployed_at": 0 }, "Mode Sepolia": { - "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "on_ramp": "0x2Eb0842925fb7aA6045e951e98e8b4b3aFFaBB54", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "on_ramp": "0xACDfd7a98d853FA3914047Cd46e7f5D53BBC9FbB", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "on_ramp": "0xf9765c80F6448e6d4d02BeF4a6b4152131A2F513", "deployed_at": 0 }, "WeMix Testnet": { - "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "on_ramp": "0xd72c3c132B76F5D232C37dF3bF8f04392D552e0F", "deployed_at": 0 }, "ZKSync Sepolia": { - "on_ramp": "0x1Acb3A885feA37bdA30AB99b99327b14391f500F", + "on_ramp": "0xA2865E4f36760f5fa5c8F958336120f2DF0d974b", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", - "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "off_ramp": "0xD2f5edfD4561d6E7599F6c6888Bd353cAFd0c55E", + "commit_store": "0x240420BC6bCDc067e668c7492D69fe06B3CF80cE", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", - "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "off_ramp": "0x1DEBa99dC8e2A77832461BD386d83D9FCb133137", + "commit_store": "0x139E06b6dBB1a0C41A1686C091795879c943765A", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", - "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "off_ramp": "0x04305BD9D9CA6730517f79c3D9c6828BC2D25Ecb", + "commit_store": "0x32edD59840CD9e474A280cf1707439F2Bd5872d4", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Base Sepolia": { - "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", - "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "off_ramp": "0x662738DC7DE4f7eC63d9f73Cdf9BeA5A58DdcC15", + "commit_store": "0x1e46bAC486Dd878cD57B62845530A52343e39693", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Blast Sepolia": { - "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", - "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "off_ramp": "0x049A424cF894709f044bc70177F8F6b792adc3F6", + "commit_store": "0x496fE96E440Fc683478a08Df92A1c5E23E412b1C", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Celo Alfajores": { - "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", - "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "off_ramp": "0x4F146d34Be5E273e576ef158Bd7070eC22708D20", + "commit_store": "0xEeB665281c7ab51d25423898f730Ab078c69dd42", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Gnosis Chiado": { - "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", - "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "off_ramp": "0xB424365EEEEA58A36C7EC858f926f4e8275dDEb3", + "commit_store": "0xE95c2135e3330E953BB49068d32Fcba368Acd456", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Metis Sepolia": { - "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", - "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "off_ramp": "0x46DE6201c258f5948135cd0262f91e48Cb8e3828", + "commit_store": "0x3A27Fd059A4eF0e96B0643283A44a56A8d6CF34A", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Mode Sepolia": { - "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", - "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "off_ramp": "0x052E52fdd48719A6084366eA184FC44cb8C25DC2", + "commit_store": "0xBBb9baA314eB023E3F9291Aaf4107B6708341B50", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", - "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "off_ramp": "0xbfa6f6AAE31acB3A285e80026d6475C1a50d1d0F", + "commit_store": "0xB5FbA97Dc61ec68771a92a15360d9C32c9d054E7", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", - "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "off_ramp": "0xC3e550B6aaFA5539df8bbCc5B0991e587f438e75", + "commit_store": "0xd57866D97ca26dfaE34088a3EeE4657BAFaac5f9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "WeMix Testnet": { - "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", - "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "off_ramp": "0x445F41C6aa7e910021786e860d7cfe3E7fcC6640", + "commit_store": "0x307dDE3c696E399b5837456FbCe03b1Ad76D46E3", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "ZKSync Sepolia": { - "off_ramp": "0xBaABd4166C892a1081a26535875A8fA3f22937b2", - "commit_store": "0xfda2e83F4D3f42B7629134ecD6E4b29FB8A7A07B", + "off_ramp": "0x9f5dC467A5c97068A1c2987486B8b768275627eD", + "commit_store": "0x6e4601DA99a046e4bde60d051568E3E1F35E3097", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -854,68 +890,68 @@ Data = """ "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", "src_contracts": { "Arbitrum Sepolia": { - "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "on_ramp": "0xa5Be8C619F61505548992D9820c5c485b030C7B0", "deployed_at": 0 }, "Avalanche Fuji": { - "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "on_ramp": "0x7802B6804bbE7486229ac6D3519f0057c50b40a9", "deployed_at": 0 }, "BSC Testnet": { - "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "on_ramp": "0xd25B8c70CB43022Bdc3aC417E2Cf5159294d95A1", "deployed_at": 0 }, "Kroma Sepolia": { - "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "on_ramp": "0x1De2Ca07eEee7F524Fe5edA6C8FFFb79F67b05E9", "deployed_at": 0 }, "Optimism Sepolia": { - "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "on_ramp": "0xB37607C6BD4562F32967dE87D14663D59e3f655d", "deployed_at": 0 }, "Polygon Amoy": { - "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "on_ramp": "0x0c972752F9aC3255cE45b440f9bBC6500676c4e6", "deployed_at": 0 }, "Sepolia Testnet": { - "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "on_ramp": "0x1CD55c65f85681Dfae47c62e6D93340D25006BbB", "deployed_at": 0 } }, "dest_contracts": { "Arbitrum Sepolia": { - "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", - "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "off_ramp": "0xB5492C8A71130B486fAD1091Db683584767A3957", + "commit_store": "0x1e151ED27E2F48EcFBd5b4374d0fc4869e07c397", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Avalanche Fuji": { - "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", - "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "off_ramp": "0x60536c757c2BBf72cC68A1933F7e336d03Bb68fe", + "commit_store": "0x2fF725556A04b47eB40BbA11d9F51e8fbbee9F07", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "BSC Testnet": { - "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", - "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "off_ramp": "0xb858077FbE1E55cD7a9092Eb6d5403e068c14EAf", + "commit_store": "0x0EF13C7c95C27A9EA477363a26a09Cff44ba38F9", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Kroma Sepolia": { - "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", - "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "off_ramp": "0x78d8154e1216F4791086bFa078Aaf07dcD2bD3C6", + "commit_store": "0xe67AAfbE6025e730Cf47a414BEFf2106FF231dB1", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Optimism Sepolia": { - "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", - "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "off_ramp": "0x995Fc17FC12b67f75D3cBf3bC71BD9af65671E78", + "commit_store": "0xD0825e3D8e61b67a06A93426749d38bCF73Ddb02", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Polygon Amoy": { - "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", - "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "off_ramp": "0xd7b5B4F8FF7a87cC92f7B3058365862859d9E057", + "commit_store": "0xa8f2bb4e831caA5E2794AaD014030E378208d4Bc", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" }, "Sepolia Testnet": { - "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", - "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "off_ramp": "0xa7E2F97Be7798327A49CACD022f33c0E7EfD4897", + "commit_store": "0x6fe69eE4eC9FD768193a40129A3Ba3dF140b2208", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -923,20 +959,26 @@ Data = """ "ZKSync Sepolia": { "is_native_fee_token": true, "fee_token": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "bridge_tokens": [ + "0xFf6d0c1518A8104611f482eb2801CaF4f13c9dEb" + ], + "bridge_tokens_pools": [ + "0xA16cfA090aA6888AE8Beb92F8bfD316DD05767C9" + ], "arm": "0x926b4f90610Aa448f27c8e0Fd0afa4A17B7305F9", "router": "0xA1fdA8aa9A8C4b945C45aD30647b01f07D7A0B16", "price_registry": "0x648B6BB09bE1C5766C8AC578B9B4aC8497eA671F", "wrapped_native": "0x4317b2eCD41851173175005783322D29E9bAee9E", "src_contracts": { "Sepolia Testnet": { - "on_ramp": "0x79a9a5e9e318e8e109776569574814bbf935125a", + "on_ramp": "0xC38536521fde8556351aB7C4D3ea23b64AFbBbab", "deployed_at": 0 } }, "dest_contracts": { "Sepolia Testnet": { - "off_ramp": "0x18FF69051479796175852578725Fc74F58E963F8", - "commit_store": "0xF694b4FD7889480dca3CD41244e8e3395a9EFBa0", + "off_ramp": "0x19Ea9A42cd3682928aF19990dDb3904250D00a1D", + "commit_store": "0x20BF9037927bFadaF028D43ae07d1afccfB8fa85", "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" } } @@ -969,30 +1011,54 @@ selected_networks = [ [CCIP.Groups.load] NetworkPairs = [ - 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', - 'AVALANCHE_FUJI,BASE_SEPOLIA', - 'AVALANCHE_FUJI,OPTIMISM_SEPOLIA', - 'AVALANCHE_FUJI,POLYGON_AMOY', - 'AVALANCHE_FUJI,GNOSIS_CHIADO', + 'SEPOLIA,AVALANCHE_FUJI', +# 'SEPOLIA,BSC_TESTNET', + 'SEPOLIA,CELO_ALFAJORES', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'SEPOLIA,BASE_SEPOLIA', + 'SEPOLIA,BLAST_SEPOLIA', + 'SEPOLIA,MODE_SEPOLIA', + 'SEPOLIA,OPTIMISM_SEPOLIA', + 'SEPOLIA,POLYGON_AMOY', + 'SEPOLIA,WEMIX_TESTNET', + 'SEPOLIA,GNOSIS_CHIADO', + 'SEPOLIA,METIS_SEPOLIA', + 'SEPOLIA,ZKSYNC_SEPOLIA', + +# 'AVALANCHE_FUJI,BSC_TESTNET', +# 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', +# 'AVALANCHE_FUJI,BASE_SEPOLIA', +# 'AVALANCHE_FUJI,OPTIMISM_SEPOLIA', +# 'AVALANCHE_FUJI,POLYGON_AMOY', +# 'AVALANCHE_FUJI,WEMIX_TESTNET', +# 'AVALANCHE_FUJI,GNOSIS_CHIADO', + +# 'BSC_TESTNET,BASE_SEPOLIA', +# 'BSC_TESTNET,POLYGON_AMOY', +# 'BSC_TESTNET,WEMIX_TESTNET', +# 'BSC_TESTNET,GNOSIS_CHIADO', + 'ARBITRUM_SEPOLIA,BASE_SEPOLIA', 'ARBITRUM_SEPOLIA,OPTIMISM_SEPOLIA', - 'ARBITRUM_SEPOLIA,SEPOLIA', + 'ARBITRUM_SEPOLIA,WEMIX_TESTNET', 'ARBITRUM_SEPOLIA,GNOSIS_CHIADO', + 'BASE_SEPOLIA,MODE_SEPOLIA', 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', 'BASE_SEPOLIA,GNOSIS_CHIADO', - 'SEPOLIA,MODE_SEPOLIA', - 'SEPOLIA,CELO_ALFAJORES', - 'SEPOLIA,METIS_SEPOLIA', - 'SEPOLIA,BLAST_SEPOLIA', - 'SEPOLIA,ZKSYNC_SEPOLIA', - 'KROMA_SEPOLIA,WEMIX_TESTNET', + + # 'KROMA_SEPOLIA,WEMIX_TESTNET', + + 'OPTIMISM_SEPOLIA,POLYGON_AMOY', + 'OPTIMISM_SEPOLIA,WEMIX_TESTNET', 'OPTIMISM_SEPOLIA,GNOSIS_CHIADO', - 'BSC_TESTNET,GNOSIS_CHIADO', + + 'POLYGON_AMOY,WEMIX_TESTNET', + 'POLYGON_AMOY,GNOSIS_CHIADO', ] BiDirectionalLane = true -PhaseTimeout = '20m' +PhaseTimeout = '45m' ExistingDeployment = true [CCIP.Groups.load.TokenConfig] @@ -1006,7 +1072,7 @@ TestRunName = 'SoakTest_prod_testnet' FailOnFirstErrorInLoad = true [[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] -MsgType = 'Data' +MsgType = 'DataWithToken' DestGasLimit = 0 DataLength = 100 NoOfTokens = 1 diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index fbfbc4c1ccd..be736dca1db 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -308,8 +308,8 @@ func (c *CCIPTestConfig) SetNetworkPairs(lggr zerolog.Logger) error { var newNetworkPairs []NetworkPair denselyConnectedNetworks := make(map[string]struct{}) // if densely connected networks are provided, choose all the network pairs containing the networks mentioned in the list for DenselyConnectedNetworkChainIds - if len(c.TestGroupInput.DenselyConnectedNetworkChainIds) > 0 { - for _, n := range c.TestGroupInput.DenselyConnectedNetworkChainIds { + if len(c.TestGroupInput.DenselyConnectedNetworkChainIDs) > 0 { + for _, n := range c.TestGroupInput.DenselyConnectedNetworkChainIDs { denselyConnectedNetworks[n] = struct{}{} } for _, pair := range c.NetworkPairs { @@ -1155,7 +1155,14 @@ func CCIPDefaultTestSetUp( // we need to set it only once for all the lanes as the attestation path uses regex to match the path for // all messages across all lanes err = actions.SetMockServerWithUSDCAttestation(killgrave, setUpArgs.Env.MockServer, false) - require.NoError(t, err, "failed to set up mock server for attestation") + require.NoError(t, err, "failed to set up mock server for USDC attestation") + } + if pointer.GetBool(setUpArgs.Cfg.TestGroupInput.LBTCMockDeployment) { + // if it's a new LBTC deployment, set up mock server for attestation, + // we need to set it only once for all the lanes as the attestation path uses regex to match the path for + // all messages across all lanes + err = actions.SetMockServerWithLBTCAttestation(killgrave, setUpArgs.Env.MockServer) + require.NoError(t, err, "failed to set up mock server for LBTC attestation") } } // deploy all lane specific contracts diff --git a/integration-tests/ccip-tests/testsetups/test_env.go b/integration-tests/ccip-tests/testsetups/test_env.go index 3c3406a3e5a..3feb8abe9a9 100644 --- a/integration-tests/ccip-tests/testsetups/test_env.go +++ b/integration-tests/ccip-tests/testsetups/test_env.go @@ -240,6 +240,7 @@ func ChainlinkChart( return chainlink.New(0, clProps) } clProps["replicas"] = pointer.GetInt(testInputs.EnvInput.NewCLCluster.NoOfNodes) + _, tomlStr, err := SetNodeConfig( nets, testInputs.EnvInput.NewCLCluster.Common.BaseConfigTOML, @@ -293,6 +294,7 @@ func DeployLocalCluster( require.NoError(t, err, "failed to get default chain config: %w", err) } else { chainConfig.ChainID = int(network.ChainID) + eth1 := ctf_config_types.EthereumVersion_Eth1 geth := ctf_config_types.ExecutionLayer_Geth diff --git a/integration-tests/docker/test_env/cl_node_cluster.go b/integration-tests/docker/test_env/cl_node_cluster.go index 596d1ae270b..369038def57 100644 --- a/integration-tests/docker/test_env/cl_node_cluster.go +++ b/integration-tests/docker/test_env/cl_node_cluster.go @@ -16,9 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" ) -var ( - ErrGetNodeCSAKeys = "failed get CL node CSA keys" -) +var ErrGetNodeCSAKeys = "failed get CL node CSA keys" type ClCluster struct { Nodes []*ClNode `json:"nodes"` diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index a37b7f813a7..06caea59919 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -2,6 +2,7 @@ package test_env import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -193,7 +194,7 @@ func (te *CLClusterTestEnv) Cleanup(opts CleanupOpts) error { } if te.ClCluster == nil || len(te.ClCluster.Nodes) == 0 { - return fmt.Errorf("chainlink nodes are nil, unable cleanup chainlink nodes") + return errors.New("chainlink nodes are nil, unable to cleanup chainlink nodes") } te.logWhetherAllContainersAreRunning() diff --git a/integration-tests/testconfig/default.toml b/integration-tests/testconfig/default.toml index 8180b40ae21..792ee36607a 100644 --- a/integration-tests/testconfig/default.toml +++ b/integration-tests/testconfig/default.toml @@ -356,6 +356,7 @@ gas_price_estimation_enabled = true # how many last blocks to use, when estimating gas for a transaction gas_price_estimation_blocks = 100 # priority of the transaction, can be "fast", "standard" or "slow" (the higher the priority, the higher adjustment factor will be used for gas estimation) [default: "standard"] + gas_price_estimation_tx_priority = "standard" diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index 19e3f0b7ada..3ec61f42607 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -599,6 +599,17 @@ func (c *TestConfig) readNetworkConfiguration() error { c.PrivateEthereumNetwork.EthereumChainConfig.GenerateGenesisTimestamp() } + for _, network := range networks.MustGetSelectedNetworkConfig(c.Network) { + for _, key := range network.PrivateKeys { + address, err := conversions.PrivateKeyHexToAddress(key) + if err != nil { + return errors.Wrapf(err, "error converting private key to address") + } + c.PrivateEthereumNetwork.EthereumChainConfig.AddressesToFund = append( + c.PrivateEthereumNetwork.EthereumChainConfig.AddressesToFund, address.Hex(), + ) + } + } return nil } diff --git a/integration-tests/types/config/node/defaults/ccip.toml b/integration-tests/types/config/node/defaults/ccip.toml new file mode 100644 index 00000000000..13081a2ca1f --- /dev/null +++ b/integration-tests/types/config/node/defaults/ccip.toml @@ -0,0 +1,23 @@ +[Feature] +LogPoller = true +CCIP = true + +[Database] +MaxIdleConns = 50 +MaxOpenConns = 50 + +[OCR2] +Enabled = true +DefaultTransactionQueueDepth = 0 + +[OCR] +Enabled = false +DefaultTransactionQueueDepth = 0 + +[P2P] +[P2P.V2] +Enabled = true +ListenAddresses = ['0.0.0.0:6690'] +AnnounceAddresses = ['0.0.0.0:6690'] +DeltaDial = '500ms' +DeltaReconcile = '5s' \ No newline at end of file diff --git a/integration-tests/types/testconfigs.go b/integration-tests/types/testconfigs.go index 7a72e9a1dfa..16f7253a2e3 100644 --- a/integration-tests/types/testconfigs.go +++ b/integration-tests/types/testconfigs.go @@ -3,7 +3,6 @@ package types import ( ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" - tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) From 1d77b7f80829c92a3657eb46e0192a6755e6295b Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Tue, 14 Jan 2025 13:07:35 +0100 Subject: [PATCH 43/91] bump foundry to stable (#15916) --- .github/actions/install-solidity-foundry/action.yml | 4 ++-- contracts/GNUmakefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/install-solidity-foundry/action.yml b/.github/actions/install-solidity-foundry/action.yml index aabd874826e..70e425335d9 100644 --- a/.github/actions/install-solidity-foundry/action.yml +++ b/.github/actions/install-solidity-foundry/action.yml @@ -17,7 +17,7 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} run: | - foundry_version=$(grep -Eo "foundryup --version [^ ]+" GNUmakefile | awk '{print $3}') + foundry_version=$(grep -Eo "foundryup --install [^ ]+" GNUmakefile | awk '{print $3}') if [ -z "$foundry_version" ]; then echo "::error::Foundry version not found in GNUmakefile" exit 1 @@ -26,6 +26,6 @@ runs: echo "foundry-version=$foundry_version" >> $GITHUB_OUTPUT - name: Install Foundry - uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0 + uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.3.1 with: version: ${{ steps.extract-foundry-version.outputs.foundry-version }} diff --git a/contracts/GNUmakefile b/contracts/GNUmakefile index e9d87385b52..0844b6eb5bc 100644 --- a/contracts/GNUmakefile +++ b/contracts/GNUmakefile @@ -43,7 +43,7 @@ mockery: $(mockery) ## Install mockery. .PHONY: foundry foundry: ## Install foundry. - foundryup --version nightly-aa69ed1e46dd61fbf9d73399396a4db4dd527431 + foundryup --install v0.3.0 .PHONY: foundry-refresh foundry-refresh: foundry From ccd5c298a9a87ce5be72881be84a7fdf37c34807 Mon Sep 17 00:00:00 2001 From: joaoluisam Date: Tue, 14 Jan 2025 13:15:20 +0000 Subject: [PATCH 44/91] Add botanix configs (#15878) * add botanix testnet config * Add botanix testnet config docs --- .../config/toml/defaults/Botanix_Testnet.toml | 12 ++ docs/CONFIG.md | 104 ++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 core/chains/evm/config/toml/defaults/Botanix_Testnet.toml diff --git a/core/chains/evm/config/toml/defaults/Botanix_Testnet.toml b/core/chains/evm/config/toml/defaults/Botanix_Testnet.toml new file mode 100644 index 00000000000..570f360c878 --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Botanix_Testnet.toml @@ -0,0 +1,12 @@ +ChainID = '3636' +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true + +[GasEstimator.BlockHistory] +BlockHistorySize = 4 +TransactionPercentile = 50 + +[HeadTracker] +FinalityTagBypass = false diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 6f50a7ab16e..9e93c6d2e77 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -6578,6 +6578,110 @@ GasLimitDefault = 400000

+
Botanix Testnet (3636)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 50 +FinalityTagEnabled = true +LogBackfillBatchSize = 1000 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 4 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 50 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = false +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+
Fantom Testnet (4002)

```toml From 6860107babc6e0041815935bfd91f64cf74c11a4 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Tue, 14 Jan 2025 14:29:20 +0100 Subject: [PATCH 45/91] Adding missing property to the fallback.toml file (#15917) * Adding missing property to the fallback.toml file * Adding missing property to the fallback.toml file --- ccip/config/evm/fallback.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ccip/config/evm/fallback.toml b/ccip/config/evm/fallback.toml index c1f963a33ff..fe02f62b433 100644 --- a/ccip/config/evm/fallback.toml +++ b/ccip/config/evm/fallback.toml @@ -6,7 +6,6 @@ FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' LogKeepBlocksDepth = 100000 -# CCIP uses paging when removing logs to avoid pushing too much pressure on the database LogPrunePageSize = 10000 BackupLogPollerBlockDelay = 100 MinContractPayment = '.00001 link' @@ -20,6 +19,7 @@ NoNewFinalizedHeadsThreshold = '0' LogBroadcasterEnabled = true [Transactions] +Enabled = true ForwardersEnabled = false MaxInFlight = 16 MaxQueued = 250 @@ -67,6 +67,7 @@ MaxBufferSize = 3 SamplingInterval = '1s' FinalityTagBypass = true MaxAllowedFinalityDepth = 10000 +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 From 967c03c47d294bde64a3e77f911a2ef4168c32a5 Mon Sep 17 00:00:00 2001 From: Gabriel Paradiso Date: Tue, 14 Jan 2025 15:32:08 +0100 Subject: [PATCH 46/91] [CRE-45] Check for duplicated cache modules (#15901) * fix: check for duplicated cache modules * chore: return error and log duplicated module id as error level * chore: log with warn level --- core/capabilities/compute/cache.go | 9 +++- core/capabilities/compute/cache_test.go | 61 +++++++++++++++++++++-- core/capabilities/compute/compute.go | 5 +- core/capabilities/compute/compute_test.go | 4 +- 4 files changed, 71 insertions(+), 8 deletions(-) diff --git a/core/capabilities/compute/cache.go b/core/capabilities/compute/cache.go index dbcc42c1606..e15678a6e6d 100644 --- a/core/capabilities/compute/cache.go +++ b/core/capabilities/compute/cache.go @@ -1,6 +1,7 @@ package compute import ( + "fmt" "sync" "time" @@ -82,12 +83,18 @@ func (mc *moduleCache) reapLoop() { } } -func (mc *moduleCache) add(id string, mod *module) { +func (mc *moduleCache) add(id string, mod *module) error { mc.mu.Lock() defer mc.mu.Unlock() + + if mc.m[id] != nil { + return fmt.Errorf("module with id %q already exists in cache", id) + } + mod.lastFetchedAt = mc.clock.Now() mc.m[id] = mod moduleCacheAddition.Inc() + return nil } func (mc *moduleCache) get(id string) (*module, bool) { diff --git a/core/capabilities/compute/cache_test.go b/core/capabilities/compute/cache_test.go index ad075f493b5..fb55eba285b 100644 --- a/core/capabilities/compute/cache_test.go +++ b/core/capabilities/compute/cache_test.go @@ -1,6 +1,7 @@ package compute import ( + "fmt" "testing" "time" @@ -16,8 +17,8 @@ import ( ) const ( - binaryLocation = "test/simple/cmd/testmodule.wasm" - binaryCmd = "core/capabilities/compute/test/simple/cmd" + simpleBinaryLocation = "test/simple/cmd/testmodule.wasm" + simpleBinaryCmd = "core/capabilities/compute/test/simple/cmd" ) // Verify that cache evicts an expired module. @@ -34,7 +35,7 @@ func TestCache(t *testing.T) { cache.start() defer cache.close() - binary := wasmtest.CreateTestBinary(binaryCmd, binaryLocation, false, t) + binary := wasmtest.CreateTestBinary(simpleBinaryCmd, simpleBinaryLocation, false, t) hmod, err := host.NewModule(&host.ModuleConfig{ Logger: logger.TestLogger(t), IsUncompressed: true, @@ -74,7 +75,7 @@ func TestCache_EvictAfterSize(t *testing.T) { cache.start() defer cache.close() - binary := wasmtest.CreateTestBinary(binaryCmd, binaryLocation, false, t) + binary := wasmtest.CreateTestBinary(simpleBinaryCmd, simpleBinaryLocation, false, t) hmod, err := host.NewModule(&host.ModuleConfig{ Logger: logger.TestLogger(t), IsUncompressed: true, @@ -103,3 +104,55 @@ func TestCache_EvictAfterSize(t *testing.T) { _, ok = cache.get(id) assert.True(t, ok) } + +func TestCache_AddDuplicatedModule(t *testing.T) { + t.Parallel() + clock := clockwork.NewFakeClock() + tick := 1 * time.Second + timeout := 1 * time.Second + reapTicker := make(chan time.Time) + + cache := newModuleCache(clock, tick, timeout, 0) + cache.onReaper = make(chan struct{}, 1) + cache.reapTicker = reapTicker + cache.start() + defer cache.close() + + simpleBinary := wasmtest.CreateTestBinary(simpleBinaryCmd, simpleBinaryLocation, false, t) + shmod, err := host.NewModule(&host.ModuleConfig{ + Logger: logger.TestLogger(t), + IsUncompressed: true, + }, simpleBinary) + require.NoError(t, err) + + // we will use the same id for both modules, but should only be associated to the simple module + duplicatedID := uuid.New().String() + smod := &module{ + module: shmod, + } + err = cache.add(duplicatedID, smod) + require.NoError(t, err) + + got, ok := cache.get(duplicatedID) + assert.True(t, ok) + assert.Equal(t, got, smod) + + // Adding a different module but with the same id should not overwrite the existing module + fetchBinary := wasmtest.CreateTestBinary(fetchBinaryCmd, fetchBinaryLocation, false, t) + fhmod, err := host.NewModule(&host.ModuleConfig{ + Logger: logger.TestLogger(t), + IsUncompressed: true, + }, fetchBinary) + require.NoError(t, err) + + fmod := &module{ + module: fhmod, + } + err = cache.add(duplicatedID, fmod) + require.ErrorContains(t, err, fmt.Sprintf("module with id %q already exists in cache", duplicatedID)) + + // validate that the module is still the same + got, ok = cache.get(duplicatedID) + assert.True(t, ok) + assert.Equal(t, got, smod) +} diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index 156c5154c99..4508d47534e 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -197,7 +197,10 @@ func (c *Compute) initModule(id string, cfg *host.ModuleConfig, binary []byte, r computeWASMInit.WithLabelValues(requestMetadata.WorkflowID, requestMetadata.ReferenceID).Observe(float64(initDuration)) m := &module{module: mod} - c.modules.add(id, m) + err = c.modules.add(id, m) + if err != nil { + c.log.Warnf("failed to add module to cache: %s", err.Error()) + } return m, nil } diff --git a/core/capabilities/compute/compute_test.go b/core/capabilities/compute/compute_test.go index 3e5f501fa61..98c8223409d 100644 --- a/core/capabilities/compute/compute_test.go +++ b/core/capabilities/compute/compute_test.go @@ -91,7 +91,7 @@ func TestComputeExecuteMissingConfig(t *testing.T) { th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(tests.Context(t))) - binary := wasmtest.CreateTestBinary(binaryCmd, binaryLocation, true, t) + binary := wasmtest.CreateTestBinary(simpleBinaryCmd, simpleBinaryLocation, true, t) config, err := values.WrapMap(map[string]any{ "binary": binary, @@ -134,7 +134,7 @@ func TestComputeExecute(t *testing.T) { require.NoError(t, th.compute.Start(tests.Context(t))) - binary := wasmtest.CreateTestBinary(binaryCmd, binaryLocation, true, t) + binary := wasmtest.CreateTestBinary(simpleBinaryCmd, simpleBinaryLocation, true, t) config, err := values.WrapMap(map[string]any{ "config": []byte(""), From 774d02662e807f823ebaa2753296361911238ef9 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 14 Jan 2025 09:40:14 -0500 Subject: [PATCH 47/91] [TT-1922] Updates flakeguard to fix PR run issue (#15910) * Updates flakeguard to fix PR run issue * Fix commit --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 0b3adb95fe7..27cce2f15c8 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -132,7 +132,7 @@ jobs: - name: Install flakeguard if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@96581547bab07e3982df522dd4343c998619ca77 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -300,7 +300,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@96581547bab07e3982df522dd4343c998619ca77 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -356,7 +356,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@96581547bab07e3982df522dd4343c998619ca77 # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results From 4ed5fdc73f45f365ccb553ba17810fb87a7fe457 Mon Sep 17 00:00:00 2001 From: Cedric Date: Tue, 14 Jan 2025 15:39:00 +0000 Subject: [PATCH 48/91] [CAPPL-438] SSRF follow-ups (#15905) * [CAPPL-438] SSRF follow-ups - Block redirects - Check various encoding formats * Set go:debug * More tests --- core/services/gateway/network/httpclient.go | 11 + .../gateway/network/httpclient_test.go | 277 +++++++++++++----- 2 files changed, 213 insertions(+), 75 deletions(-) diff --git a/core/services/gateway/network/httpclient.go b/core/services/gateway/network/httpclient.go index 18f34118300..21de0b8b9f4 100644 --- a/core/services/gateway/network/httpclient.go +++ b/core/services/gateway/network/httpclient.go @@ -3,6 +3,7 @@ package network import ( "bytes" "context" + "errors" "io" "net/http" "strings" @@ -25,6 +26,9 @@ type HTTPClientConfig struct { BlockedIPsCIDR []string AllowedPorts []int AllowedSchemes []string + + // for testing + allowedIPs []string } var ( @@ -71,10 +75,13 @@ func NewHTTPClient(config HTTPClientConfig, lggr logger.Logger) (HTTPClient, err safeConfig := safeurl. GetConfigBuilder(). SetTimeout(config.DefaultTimeout). + SetAllowedIPs(config.allowedIPs...). SetAllowedPorts(config.AllowedPorts...). SetAllowedSchemes(config.AllowedSchemes...). SetBlockedIPs(config.BlockedIPs...). SetBlockedIPsCIDR(config.BlockedIPsCIDR...). + SetCheckRedirect(disableRedirects). + EnableDebugLogging(true). Build() return &httpClient{ @@ -84,6 +91,10 @@ func NewHTTPClient(config HTTPClientConfig, lggr logger.Logger) (HTTPClient, err }, nil } +func disableRedirects(req *http.Request, via []*http.Request) error { + return errors.New("redirects are not allowed") +} + func (c *httpClient) Send(ctx context.Context, req HTTPRequest) (*HTTPResponse, error) { timeoutCtx, cancel := context.WithTimeout(ctx, req.Timeout) defer cancel() diff --git a/core/services/gateway/network/httpclient_test.go b/core/services/gateway/network/httpclient_test.go index f6e769066a7..d6ccdbdce11 100644 --- a/core/services/gateway/network/httpclient_test.go +++ b/core/services/gateway/network/httpclient_test.go @@ -1,7 +1,9 @@ +//go:debug netdns=go package network import ( "context" + "errors" "net/http" "net/http/httptest" "net/url" @@ -9,7 +11,6 @@ import ( "testing" "time" - "github.com/doyensec/safeurl" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -20,11 +21,6 @@ func TestHTTPClient_Send(t *testing.T) { // Setup the test environment lggr := logger.Test(t) - config := HTTPClientConfig{ - MaxResponseBytes: 1024, - DefaultTimeout: 5 * time.Second, - } - // Define test cases tests := []struct { name string @@ -118,6 +114,29 @@ func TestHTTPClient_Send(t *testing.T) { expectedError: &http.MaxBytesError{}, expectedResp: nil, }, + { + name: "redirects are blocked", + setupServer: func() *httptest.Server { + count := 0 + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + count++ + if count <= 1 { + http.Redirect(w, r, "/", http.StatusMovedPermanently) + } else { + w.WriteHeader(http.StatusOK) + } + count++ + })) + }, + request: HTTPRequest{ + Method: "GET", + URL: "/", + Headers: map[string]string{}, + Body: nil, + Timeout: 2 * time.Second, + }, + expectedError: errors.New("redirects are not allowed"), + }, } // Execute test cases @@ -133,19 +152,16 @@ func TestHTTPClient_Send(t *testing.T) { portInt, err := strconv.ParseInt(port, 10, 32) require.NoError(t, err) - safeConfig := safeurl. - GetConfigBuilder(). - SetTimeout(config.DefaultTimeout). - SetAllowedIPs(hostname). - SetAllowedPorts(int(portInt)). - Build() - - client := &httpClient{ - config: config, - client: safeurl.Client(safeConfig), - lggr: lggr, + config := HTTPClientConfig{ + MaxResponseBytes: 1024, + DefaultTimeout: 5 * time.Second, + allowedIPs: []string{hostname}, + AllowedPorts: []int{int(portInt)}, } + client, err := NewHTTPClient(config, lggr) + require.NoError(t, err) + tt.request.URL = server.URL + tt.request.URL resp, err := client.Send(context.Background(), tt.request) @@ -166,97 +182,208 @@ func TestHTTPClient_Send(t *testing.T) { } } +// IMPORTANT: The behaviour of Go's network stack is heavily dependent on the platform; +// this means that the errors returned can change depending on whether the tests are +// run on osx or on linux. func TestHTTPClient_BlocksUnallowed(t *testing.T) { t.Parallel() // Setup the test environment lggr := logger.Test(t) - config := HTTPClientConfig{ - MaxResponseBytes: 1024, - DefaultTimeout: 5 * time.Second, - } - - client, err := NewHTTPClient(config, lggr) - require.NoError(t, err) - // Define test cases tests := []struct { name string - request HTTPRequest + url string expectedError string + blockPort bool }{ { - name: "blocked port", - request: HTTPRequest{ - Method: "GET", - URL: "http://127.0.0.1:8080", - Headers: map[string]string{}, - Body: nil, - Timeout: 2 * time.Second, - }, + name: "blocked port", + url: "http://177.0.0.1:8080", expectedError: "port: 8080 not found in allowlist", + blockPort: true, }, { - name: "blocked scheme", - request: HTTPRequest{ - Method: "GET", - URL: "file://127.0.0.1", - Headers: map[string]string{}, - Body: nil, - Timeout: 2 * time.Second, - }, + name: "blocked scheme", + url: "file://127.0.0.1", expectedError: "scheme: file not found in allowlist", }, { - name: "explicitly blocked IP", - request: HTTPRequest{ - Method: "GET", - URL: "http://169.254.0.1", - Headers: map[string]string{}, - Body: nil, - Timeout: 2 * time.Second, - }, + name: "explicitly blocked IP", + url: "http://169.254.0.1", expectedError: "ip: 169.254.0.1 not found in allowlist", }, { - name: "explicitly blocked IP - internal network", - request: HTTPRequest{ - Method: "GET", - URL: "http://169.254.0.1/endpoint", - Headers: map[string]string{}, - Body: nil, - Timeout: 2 * time.Second, - }, + name: "explicitly blocked IP - internal network", + url: "http://169.254.0.1", expectedError: "ip: 169.254.0.1 not found in allowlist", }, { - name: "explicitly blocked IP - localhost", - request: HTTPRequest{ - Method: "GET", - URL: "http://127.0.0.1/endpoint", - Headers: map[string]string{}, - Body: nil, - Timeout: 2 * time.Second, - }, + name: "explicitly blocked IP - loopback", + url: "http://127.0.0.1", expectedError: "ip: 127.0.0.1 not found in allowlist", }, { - name: "explicitly blocked IP - current network", - request: HTTPRequest{ - Method: "GET", - URL: "http://0.0.0.0/endpoint", - Headers: map[string]string{}, - Body: nil, - Timeout: 2 * time.Second, - }, + name: "explicitly blocked IP - loopback without scheme", + url: "127.0.0.1", + expectedError: "host: is not valid", + }, + { + name: "explicitly blocked IP - loopback", + url: "https://⑫7.0.0.1", + expectedError: "ip: 127.0.0.1 not found in allowlist", + }, + { + name: "explicitly blocked IP - loopback shortened", + url: "https://127.1", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback shortened", + url: "https://127.0.1", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback hex encoded with separators", + url: `https://0x7F.0x00.0x00.0x01`, + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback octal encoded", + url: `https://0177.0000.0000.0001`, + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback binary encoded", + url: `https://01111111.00000000.00000000.00000001`, + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback - dword no escape", + url: "https://2130706433", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback - dword with overflow no escape", + url: "https://45080379393", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - loopback - ipv6", + url: `https://[::1]`, + expectedError: "ipv6 blocked", + }, + { + name: "explicitly blocked IP - loopback ipv6 mapped ipv4", + url: `https://[::FFF:7F00:0001]`, + expectedError: "ipv6 blocked", + }, + { + name: "explicitly blocked IP - loopback ipv6 mapped ipv4", + url: `https://[::FFFF:127.0.0.1]`, + expectedError: "ip: 127.0.0.1 not found in allowlist", + }, + { + name: "explicitly blocked IP - loopback long-form", + url: `https://[0000:0000:0000:0000:0000:0000:0000:0001]`, + expectedError: "ipv6 blocked", + }, + { + name: "explicitly blocked IP - current network", + url: "http://0.0.0.0/endpoint", expectedError: "ip: 0.0.0.0 not found in allowlist", }, + { + name: "explicitly blocked IP - current network - octal", + url: "http://0000.0000.0000.0001", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - current network - hex", + url: "http://0x00.0x00.0x00.0x01", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - current network - binary", + url: "http://00000000.00000000.00000000.00000001", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - current network - shortened", + url: "http://1", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - current network - shortened", + url: "http://0.1", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - current network - shortened", + url: "http://0.0.1", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - dword", + url: "http://42949672961", + expectedError: "no such host", + }, + { + name: "explicitly blocked IP - ipv6 mapped", + url: "http://[::FFFF:0000:0001]", + expectedError: "ip: 0.0.0.1 not found in allowlist", + }, + { + name: "explicitly blocked IP - ipv6 mapped", + url: "http://[::FFFF:0.0.0.1]", + expectedError: "ip: 0.0.0.1 not found in allowlist", + }, } // Execute test cases for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - _, err := client.Send(context.Background(), tt.request) + testURL, err := url.Parse(tt.url) + require.NoError(t, err) + + if testURL.Port() == "" { + // Setup a test server so the request succeeds if we don't block it, then modify the URL to add the port to it. + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + })) + defer server.Close() + + u, ierr := url.Parse(server.URL) + require.NoError(t, ierr) + + testURL.Host = testURL.Hostname() + ":" + u.Port() + } + + portInt, err := strconv.ParseInt(testURL.Port(), 10, 64) + require.NoError(t, err) + + allowedPorts := []int{} + if !tt.blockPort { + allowedPorts = []int{int(portInt)} + } + + config := HTTPClientConfig{ + MaxResponseBytes: 1024, + DefaultTimeout: 5 * time.Second, + AllowedPorts: allowedPorts, + } + + client, err := NewHTTPClient(config, lggr) + require.NoError(t, err) + + require.NoError(t, err) + _, err = client.Send(context.Background(), HTTPRequest{ + Method: "GET", + URL: testURL.String(), + Headers: map[string]string{}, + Body: nil, + Timeout: 1 * time.Second, + }) require.Error(t, err) require.ErrorContains(t, err, tt.expectedError) }) From a219f35758681b4f5a4b7627ff103e56bb1c651b Mon Sep 17 00:00:00 2001 From: Njegos Railic Date: Tue, 14 Jan 2025 17:41:13 +0100 Subject: [PATCH 49/91] Migrating the Soak Tests workflow to GAP v2 (#15920) --- .github/workflows/on-demand-ocr-soak-test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/on-demand-ocr-soak-test.yml b/.github/workflows/on-demand-ocr-soak-test.yml index a9a8c3c2a2f..8db718700c8 100644 --- a/.github/workflows/on-demand-ocr-soak-test.yml +++ b/.github/workflows/on-demand-ocr-soak-test.yml @@ -39,11 +39,11 @@ on: description: Team to run the tests for (e.g. BIX, CCIP) required: true type: string - + jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0d4a2b2b009c87b5c366d0b97f7a8d7de2f60760 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@80366cb090f714f9842da4ced1102f4a0e805f20 with: test_path: .github/e2e-tests.yml test_ids: ${{ inputs.testToRun}} @@ -58,7 +58,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -66,10 +65,12 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} SLACK_CHANNEL: ${{ secrets.QA_SLACK_CHANNEL }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} From 16eeb3b5de6526f4a53bad2d38be581506cdbfd1 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 14 Jan 2025 13:16:39 -0500 Subject: [PATCH 50/91] Support flexible schemas for LLO (#15493) --- .changeset/thick-vans-tickle.md | 5 + core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/llo/codecs.go | 1 + core/services/llo/evm/fees.go | 3 +- core/services/llo/evm/fees_test.go | 23 +- .../report_codec_evm_abi_encode_unpacked.go | 256 ++++++ ...port_codec_evm_abi_encode_unpacked_test.go | 780 ++++++++++++++++++ core/services/llo/keyring.go | 4 +- .../services/llo/mercurytransmitter/server.go | 18 +- core/services/ocr2/delegate.go | 2 +- .../services/ocr2/plugins/llo/helpers_test.go | 51 +- .../ocr2/plugins/llo/integration_test.go | 532 +++++++++++- core/services/relay/evm/codec/encoder.go | 2 +- core/services/streams/delegate.go | 6 +- core/services/streams/delegate_test.go | 4 +- deployment/go.mod | 2 +- deployment/go.sum | 4 +- go.mod | 2 +- go.sum | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- 24 files changed, 1671 insertions(+), 46 deletions(-) create mode 100644 .changeset/thick-vans-tickle.md create mode 100644 core/services/llo/evm/report_codec_evm_abi_encode_unpacked.go create mode 100644 core/services/llo/evm/report_codec_evm_abi_encode_unpacked_test.go diff --git a/.changeset/thick-vans-tickle.md b/.changeset/thick-vans-tickle.md new file mode 100644 index 00000000000..a719bf8905b --- /dev/null +++ b/.changeset/thick-vans-tickle.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Add support for flexible schemas #added diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 1a566539391..9eccf5cd5a0 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -35,7 +35,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 1663d9488fc..47a3a61ba0c 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1168,8 +1168,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/core/services/llo/codecs.go b/core/services/llo/codecs.go index f9c5b7b3380..050a1945873 100644 --- a/core/services/llo/codecs.go +++ b/core/services/llo/codecs.go @@ -14,6 +14,7 @@ func NewReportCodecs(lggr logger.Logger, donID uint32) map[llotypes.ReportFormat codecs[llotypes.ReportFormatJSON] = llo.JSONReportCodec{} codecs[llotypes.ReportFormatEVMPremiumLegacy] = evm.NewReportCodecPremiumLegacy(lggr, donID) + codecs[llotypes.ReportFormatEVMABIEncodeUnpacked] = evm.NewReportCodecEVMABIEncodeUnpacked(lggr, donID) return codecs } diff --git a/core/services/llo/evm/fees.go b/core/services/llo/evm/fees.go index b74d68b08d2..a6ff7a31178 100644 --- a/core/services/llo/evm/fees.go +++ b/core/services/llo/evm/fees.go @@ -16,8 +16,9 @@ const Precision int32 = 18 // CalculateFee outputs a fee in wei according to the formula: baseUSDFee / tokenPriceInUSD func CalculateFee(tokenPriceInUSD decimal.Decimal, baseUSDFee decimal.Decimal) *big.Int { - if tokenPriceInUSD.IsZero() || baseUSDFee.IsZero() { + if baseUSDFee.IsZero() || baseUSDFee.IsNegative() || tokenPriceInUSD.IsZero() || tokenPriceInUSD.IsNegative() { // zero fee if token price or base fee is zero + // if either fee should somehow be negative, also, return zero return big.NewInt(0) } diff --git a/core/services/llo/evm/fees_test.go b/core/services/llo/evm/fees_test.go index 33888de14ec..4f3fedbaedc 100644 --- a/core/services/llo/evm/fees_test.go +++ b/core/services/llo/evm/fees_test.go @@ -38,8 +38,27 @@ func Test_Fees(t *testing.T) { t.Run("with base fee == 0", func(t *testing.T) { tokenPriceInUSD := decimal.NewFromInt32(123) - BaseUSDFee = decimal.NewFromInt32(0) - fee := CalculateFee(tokenPriceInUSD, BaseUSDFee) + baseUSDFee := decimal.NewFromInt32(0) + fee := CalculateFee(tokenPriceInUSD, baseUSDFee) + assert.Equal(t, big.NewInt(0), fee) + }) + + t.Run("negative fee rounds up to zero", func(t *testing.T) { + tokenPriceInUSD := decimal.NewFromInt32(-123) + baseUSDFee := decimal.NewFromInt32(1) + fee := CalculateFee(tokenPriceInUSD, baseUSDFee) + assert.Equal(t, big.NewInt(0), fee) + + tokenPriceInUSD = decimal.NewFromInt32(123) + baseUSDFee = decimal.NewFromInt32(-1) + fee = CalculateFee(tokenPriceInUSD, baseUSDFee) + assert.Equal(t, big.NewInt(0), fee) + + // Multiple negative values also return a zero fee since negative + // prices are always nonsensical + tokenPriceInUSD = decimal.NewFromInt32(-123) + baseUSDFee = decimal.NewFromInt32(-1) + fee = CalculateFee(tokenPriceInUSD, baseUSDFee) assert.Equal(t, big.NewInt(0), fee) }) diff --git a/core/services/llo/evm/report_codec_evm_abi_encode_unpacked.go b/core/services/llo/evm/report_codec_evm_abi_encode_unpacked.go new file mode 100644 index 00000000000..309675aea77 --- /dev/null +++ b/core/services/llo/evm/report_codec_evm_abi_encode_unpacked.go @@ -0,0 +1,256 @@ +package evm + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/shopspring/decimal" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + "github.com/smartcontractkit/chainlink-data-streams/llo" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +var ( + _ llo.ReportCodec = ReportCodecEVMABIEncodeUnpacked{} + + zero = big.NewInt(0) +) + +type ReportCodecEVMABIEncodeUnpacked struct { + logger.Logger + donID uint32 +} + +func NewReportCodecEVMABIEncodeUnpacked(lggr logger.Logger, donID uint32) ReportCodecEVMABIEncodeUnpacked { + return ReportCodecEVMABIEncodeUnpacked{logger.Sugared(lggr).Named("ReportCodecEVMABIEncodeUnpacked"), donID} +} + +// Opts format remains unchanged +type ReportFormatEVMABIEncodeOpts struct { + // BaseUSDFee is the cost on-chain of verifying a report + BaseUSDFee decimal.Decimal `json:"baseUSDFee"` + // Expiration window is the length of time in seconds the report is valid + // for, from the observation timestamp + ExpirationWindow uint32 `json:"expirationWindow"` + // FeedID is for compatibility with existing on-chain verifiers + FeedID common.Hash `json:"feedID"` + // ABI defines the encoding of the payload. Each element maps to exactly + // one stream (although sub-arrays may be specified for streams that + // produce a composite data type). + // + // EXAMPLE + // + // [{"streamID":123,"multiplier":"10000","type":"uint192"}, ...] + // + // See definition of ABIEncoder struct for more details. + // + // The total number of streams must be 2+n, where n is the number of + // top-level elements in this ABI array (stream 0 is always the native + // token price and stream 1 is the link token price). + ABI []ABIEncoder `json:"abi"` +} + +func (r *ReportFormatEVMABIEncodeOpts) Decode(opts []byte) error { + return json.Unmarshal(opts, r) +} + +func (r *ReportFormatEVMABIEncodeOpts) Encode() ([]byte, error) { + return json.Marshal(r) +} + +type BaseReportFields struct { + FeedID common.Hash + ValidFromTimestamp uint32 + Timestamp uint32 + NativeFee *big.Int + LinkFee *big.Int + ExpiresAt uint32 +} + +func (r ReportCodecEVMABIEncodeUnpacked) Encode(ctx context.Context, report llo.Report, cd llotypes.ChannelDefinition) ([]byte, error) { + if report.Specimen { + return nil, errors.New("ReportCodecEVMABIEncodeUnpacked does not support encoding specimen reports") + } + if len(report.Values) < 2 { + return nil, fmt.Errorf("ReportCodecEVMABIEncodeUnpacked requires at least 2 values (NativePrice, LinkPrice, ...); got report.Values: %v", report.Values) + } + nativePrice, err := extractPrice(report.Values[0]) + if err != nil { + return nil, fmt.Errorf("ReportCodecEVMABIEncodeUnpacked failed to extract native price: %w", err) + } + linkPrice, err := extractPrice(report.Values[1]) + if err != nil { + return nil, fmt.Errorf("ReportCodecEVMABIEncodeUnpacked failed to extract link price: %w", err) + } + + // NOTE: It seems suboptimal to have to parse the opts on every encode but + // not sure how to avoid it. Should be negligible performance hit as long + // as Opts is small. + opts := ReportFormatEVMABIEncodeOpts{} + if err = (&opts).Decode(cd.Opts); err != nil { + return nil, fmt.Errorf("failed to decode opts; got: '%s'; %w", cd.Opts, err) + } + + rf := BaseReportFields{ + FeedID: opts.FeedID, + ValidFromTimestamp: report.ValidAfterSeconds + 1, + Timestamp: report.ObservationTimestampSeconds, + NativeFee: CalculateFee(nativePrice, opts.BaseUSDFee), + LinkFee: CalculateFee(linkPrice, opts.BaseUSDFee), + ExpiresAt: report.ObservationTimestampSeconds + opts.ExpirationWindow, + } + + header, err := r.buildHeader(ctx, rf) + if err != nil { + return nil, fmt.Errorf("failed to build base report; %w", err) + } + + payload, err := r.buildPayload(ctx, opts.ABI, report.Values[2:]) + if err != nil { + return nil, fmt.Errorf("failed to build payload; %w", err) + } + + return append(header, payload...), nil +} + +// BaseSchema represents the fixed base schema that remains unchanged for all +// EVMABIEncodeUnpacked reports. +// +// An arbitrary payload will be appended to this. +var BaseSchema = getBaseSchema() + +func getBaseSchema() abi.Arguments { + mustNewType := func(t string) abi.Type { + result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) + if err != nil { + panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) + } + return result + } + return abi.Arguments([]abi.Argument{ + {Name: "feedId", Type: mustNewType("bytes32")}, + {Name: "validFromTimestamp", Type: mustNewType("uint32")}, + {Name: "observationsTimestamp", Type: mustNewType("uint32")}, + {Name: "nativeFee", Type: mustNewType("uint192")}, + {Name: "linkFee", Type: mustNewType("uint192")}, + {Name: "expiresAt", Type: mustNewType("uint32")}, + }) +} + +func (r ReportCodecEVMABIEncodeUnpacked) buildHeader(ctx context.Context, rf BaseReportFields) ([]byte, error) { + var merr error + if rf.LinkFee == nil { + merr = errors.Join(merr, errors.New("linkFee may not be nil")) + } else if rf.LinkFee.Cmp(zero) < 0 { + merr = errors.Join(merr, fmt.Errorf("linkFee may not be negative (got: %s)", rf.LinkFee)) + } + if rf.NativeFee == nil { + merr = errors.Join(merr, errors.New("nativeFee may not be nil")) + } else if rf.NativeFee.Cmp(zero) < 0 { + merr = errors.Join(merr, fmt.Errorf("nativeFee may not be negative (got: %s)", rf.NativeFee)) + } + if merr != nil { + return nil, merr + } + b, err := BaseSchema.Pack(rf.FeedID, rf.ValidFromTimestamp, rf.Timestamp, rf.NativeFee, rf.LinkFee, rf.ExpiresAt) + if err != nil { + return nil, fmt.Errorf("failed to pack base report blob; %w", err) + } + return b, nil +} + +func (r ReportCodecEVMABIEncodeUnpacked) buildPayload(ctx context.Context, encoders []ABIEncoder, values []llo.StreamValue) (payload []byte, merr error) { + if len(encoders) != len(values) { + return nil, fmt.Errorf("ABI and values length mismatch; ABI: %d, Values: %d", len(encoders), len(values)) + } + + for i, encoder := range encoders { + b, err := encoder.Encode(ctx, values[i]) + if err != nil { + var vStr []byte + if values[i] == nil { + vStr = []byte("") + } else { + var marshalErr error + vStr, marshalErr = values[i].MarshalText() + if marshalErr != nil { + vStr = []byte(fmt.Sprintf("%v(failed to marshal: %s)", values[i], marshalErr)) + } + } + merr = errors.Join(merr, fmt.Errorf("failed to encode stream value %s at index %d with abi %q; %w", string(vStr), i, encoder.Type, err)) + continue + } + payload = append(payload, b...) + } + + return payload, merr +} + +// An ABIEncoder encodes exactly one stream value into a byte slice +type ABIEncoder struct { + // StreamID is the ID of the stream that this encoder is responsible for. + // MANDATORY + StreamID llotypes.StreamID `json:"streamID"` + // Type is the ABI type of the stream value. E.g. "uint192", "int256", "bool", "string" etc. + // MANDATORY + Type string `json:"type"` + // Multiplier, if provided, will be multiplied with the stream value before + // encoding. + // OPTIONAL + Multiplier *ubig.Big `json:"multiplier"` +} + +// getNormalizedMultiplier returns the multiplier as a decimal.Decimal, defaulting +// to 1 if the multiplier is nil. +// +// Negative multipliers are ok and will work as expected, flipping the sign of +// the value. +func (a ABIEncoder) getNormalizedMultiplier() (multiplier decimal.Decimal) { + if a.Multiplier == nil { + multiplier = decimal.NewFromInt(1) + } else { + multiplier = decimal.NewFromBigInt(a.Multiplier.ToInt(), 0) + } + return +} + +func (a ABIEncoder) applyMultiplier(d decimal.Decimal) *big.Int { + return d.Mul(a.getNormalizedMultiplier()).BigInt() +} + +func (a ABIEncoder) Encode(ctx context.Context, sv llo.StreamValue) ([]byte, error) { + var encode interface{} + switch sv := sv.(type) { + case *llo.Decimal: + if sv == nil { + return nil, fmt.Errorf("expected non-nil *Decimal; got: %v", sv) + } + encode = a.applyMultiplier(sv.Decimal()) + default: + return nil, fmt.Errorf("unhandled type; supported types are: *llo.Decimal; got: %T", sv) + } + evmEncoderConfig := fmt.Sprintf(`[{"Name":"streamValue","Type":"%s"}]`, a.Type) + + codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ + "evm": {TypeABI: evmEncoderConfig}, + }} + c, err := codec.NewCodec(codecConfig) + if err != nil { + return nil, fmt.Errorf("failed to create codec; %w", err) + } + + result, err := c.Encode(ctx, map[string]any{"streamValue": encode}, "evm") + if err != nil { + return nil, fmt.Errorf("failed to encode stream value %v with ABI type %q; %w", sv, a.Type, err) + } + return result, nil +} diff --git a/core/services/llo/evm/report_codec_evm_abi_encode_unpacked_test.go b/core/services/llo/evm/report_codec_evm_abi_encode_unpacked_test.go new file mode 100644 index 00000000000..b16d52bb3c4 --- /dev/null +++ b/core/services/llo/evm/report_codec_evm_abi_encode_unpacked_test.go @@ -0,0 +1,780 @@ +package evm + +import ( + "encoding/hex" + "fmt" + "math" + "math/big" + "math/rand/v2" + "reflect" + "strings" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "github.com/shopspring/decimal" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2/types" + + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-data-streams/llo" +) + +// AllTrue returns false if any element in the array is false. +func AllTrue(arr []bool) bool { + for _, v := range arr { + if !v { + return false + } + } + return true +} + +func TestReportFormatEVMABIEncodeOpts_Decode_Encode_properties(t *testing.T) { + properties := gopter.NewProperties(nil) + + runTest := func(opts ReportFormatEVMABIEncodeOpts) bool { + encoded, err := opts.Encode() + require.NoError(t, err) + + decoded := ReportFormatEVMABIEncodeOpts{} + err = decoded.Decode(encoded) + require.NoError(t, err) + + return decoded.BaseUSDFee.Equal(opts.BaseUSDFee) && decoded.ExpirationWindow == opts.ExpirationWindow && decoded.FeedID == opts.FeedID && assert.Equal(t, opts.ABI, decoded.ABI) + } + properties.Property("Encodes values", prop.ForAll( + runTest, + gen.StrictStruct(reflect.TypeOf(&ReportFormatEVMABIEncodeOpts{}), map[string]gopter.Gen{ + "BaseUSDFee": genBaseUSDFee(), + "ExpirationWindow": genExpirationWindow(), + "FeedID": genFeedID(), + "ABI": genABI(), + }))) + + properties.TestingRun(t) +} + +func genABI() gopter.Gen { + return gen.SliceOf(genABIEncoder()) +} + +func genABIEncoder() gopter.Gen { + return gen.StrictStruct(reflect.TypeOf(&ABIEncoder{}), map[string]gopter.Gen{ + "StreamID": gen.UInt32().Map(func(i uint32) llotypes.StreamID { return i }), + "Multiplier": genMultiplier(), + "Type": gen.AnyString(), + }) +} + +func TestReportCodecEVMABIEncodeUnpacked_Encode_properties(t *testing.T) { + ctx := tests.Context(t) + codec := ReportCodecEVMABIEncodeUnpacked{} + + properties := gopter.NewProperties(nil) + + linkQuoteStreamID := rand.Uint32() + ethQuoteStreamID := rand.Uint32() + dexBasedAssetDecimalStreamID := rand.Uint32() + benchmarkPriceStreamID := rand.Uint32() + baseMarketDepthStreamID := rand.Uint32() + quoteMarketDepthStreamID := rand.Uint32() + marketStatusStreamID := rand.Uint32() + binanceFundingRateStreamID := rand.Uint32() + binanceFundingTimeStreamID := rand.Uint32() + binanceFundingIntervalHoursStreamID := rand.Uint32() + deribitFundingRateStreamID := rand.Uint32() + deribitFundingTimeStreamID := rand.Uint32() + deribitFundingIntervalHoursStreamID := rand.Uint32() + + t.Run("DEX-based asset schema example", func(t *testing.T) { + expectedDEXBasedAssetSchema := abi.Arguments([]abi.Argument{ + {Name: "feedId", Type: mustNewABIType("bytes32")}, + {Name: "validFromTimestamp", Type: mustNewABIType("uint32")}, + {Name: "observationsTimestamp", Type: mustNewABIType("uint32")}, + {Name: "nativeFee", Type: mustNewABIType("uint192")}, + {Name: "linkFee", Type: mustNewABIType("uint192")}, + {Name: "expiresAt", Type: mustNewABIType("uint32")}, + {Name: "price", Type: mustNewABIType("int192")}, + {Name: "baseMarketDepth", Type: mustNewABIType("int192")}, + {Name: "quoteMarketDepth", Type: mustNewABIType("int192")}, + }) + runTest := func(sampleFeedID common.Hash, sampleObservationsTimestamp, sampleValidAfterSeconds, sampleExpirationWindow uint32, priceMultiplier, marketDepthMultiplier *ubig.Big, sampleBaseUSDFee, sampleLinkBenchmarkPrice, sampleNativeBenchmarkPrice, sampleDexBasedAssetPrice, sampleBaseMarketDepth, sampleQuoteMarketDepth decimal.Decimal) bool { + report := llo.Report{ + ConfigDigest: types.ConfigDigest{0x01}, + SeqNr: 0x02, + ChannelID: llotypes.ChannelID(0x03), + ValidAfterSeconds: sampleValidAfterSeconds, + ObservationTimestampSeconds: sampleObservationsTimestamp, + Values: []llo.StreamValue{ + &llo.Quote{Bid: decimal.NewFromFloat(6.1), Benchmark: sampleLinkBenchmarkPrice, Ask: decimal.NewFromFloat(8.2332)}, // Link price + &llo.Quote{Bid: decimal.NewFromFloat(9.4), Benchmark: sampleNativeBenchmarkPrice, Ask: decimal.NewFromFloat(11.33)}, // Native price + llo.ToDecimal(sampleDexBasedAssetPrice), // DEX-based asset price + llo.ToDecimal(sampleBaseMarketDepth), // Base market depth + llo.ToDecimal(sampleQuoteMarketDepth), // Quote market depth + }, + Specimen: false, + } + + opts := ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: sampleBaseUSDFee, + ExpirationWindow: sampleExpirationWindow, + FeedID: sampleFeedID, + ABI: []ABIEncoder{ + // benchmark price + ABIEncoder{ + StreamID: dexBasedAssetDecimalStreamID, + Type: "int192", + Multiplier: priceMultiplier, // TODO: Default multiplier? + }, + // base market depth + ABIEncoder{ + StreamID: baseMarketDepthStreamID, + Type: "int192", + Multiplier: marketDepthMultiplier, + }, + // quote market depth + ABIEncoder{ + StreamID: quoteMarketDepthStreamID, + Type: "int192", + Multiplier: marketDepthMultiplier, + }, + }, + } + serializedOpts, err := opts.Encode() + require.NoError(t, err) + + cd := llotypes.ChannelDefinition{ + ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + Streams: []llotypes.Stream{ + { + StreamID: linkQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: ethQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: dexBasedAssetDecimalStreamID, + Aggregator: llotypes.AggregatorQuote, + }, + { + StreamID: baseMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: quoteMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + }, + Opts: serializedOpts, + } + + encoded, err := codec.Encode(ctx, report, cd) + require.NoError(t, err) + + values, err := expectedDEXBasedAssetSchema.Unpack(encoded) + require.NoError(t, err) + + require.Len(t, values, len(expectedDEXBasedAssetSchema)) + + expectedLinkFee := CalculateFee(sampleLinkBenchmarkPrice, sampleBaseUSDFee) + expectedNativeFee := CalculateFee(sampleNativeBenchmarkPrice, sampleBaseUSDFee) + + // doesn't crash if values are nil + for i := range report.Values { + report.Values[i] = nil + } + _, err = codec.Encode(ctx, report, cd) + require.Error(t, err) + + return AllTrue([]bool{ + assert.Equal(t, sampleFeedID, (common.Hash)(values[0].([32]byte))), //nolint:testifylint // false positive // feedId + assert.Equal(t, sampleValidAfterSeconds+1, values[1].(uint32)), // validFromTimestamp + assert.Equal(t, sampleObservationsTimestamp, values[2].(uint32)), // observationsTimestamp + assert.Equal(t, expectedLinkFee.String(), values[3].(*big.Int).String()), // linkFee + assert.Equal(t, expectedNativeFee.String(), values[4].(*big.Int).String()), // nativeFee + assert.Equal(t, sampleObservationsTimestamp+sampleExpirationWindow, values[5].(uint32)), // expiresAt + assert.Equal(t, sampleDexBasedAssetPrice.Mul(decimal.NewFromBigInt(priceMultiplier.ToInt(), 0)).BigInt(), values[6].(*big.Int)), // price + assert.Equal(t, sampleBaseMarketDepth.Mul(decimal.NewFromBigInt(marketDepthMultiplier.ToInt(), 0)).BigInt(), values[7].(*big.Int)), // baseMarketDepth + assert.Equal(t, sampleQuoteMarketDepth.Mul(decimal.NewFromBigInt(marketDepthMultiplier.ToInt(), 0)).BigInt(), values[8].(*big.Int)), // quoteMarketDepth + }) + } + + properties.Property("Encodes values", prop.ForAll( + runTest, + genFeedID(), + genObservationsTimestamp(), + genValidAfterSeconds(), + genExpirationWindow(), + genPriceMultiplier(), + genMarketDepthMultiplier(), + genBaseUSDFee(), + genLinkBenchmarkPrice(), + genNativeBenchmarkPrice(), + genBenchmarkPrice(), + genBaseMarketDepth(), + genQuoteMarketDepth(), + )) + + properties.TestingRun(t) + }) + + t.Run("Market status schema", func(t *testing.T) { + expectedRWASchema := abi.Arguments([]abi.Argument{ + {Name: "feedId", Type: mustNewABIType("bytes32")}, + {Name: "validFromTimestamp", Type: mustNewABIType("uint32")}, + {Name: "observationsTimestamp", Type: mustNewABIType("uint32")}, + {Name: "nativeFee", Type: mustNewABIType("uint192")}, + {Name: "linkFee", Type: mustNewABIType("uint192")}, + {Name: "expiresAt", Type: mustNewABIType("uint32")}, + {Name: "marketStatus", Type: mustNewABIType("uint32")}, + }) + + runTest := func(sampleFeedID common.Hash, sampleObservationsTimestamp, sampleValidAfterSeconds, sampleExpirationWindow uint32, sampleBaseUSDFee, sampleLinkBenchmarkPrice, sampleNativeBenchmarkPrice, sampleMarketStatus decimal.Decimal) bool { + report := llo.Report{ + ConfigDigest: types.ConfigDigest{0x01}, + SeqNr: 0x02, + ChannelID: llotypes.ChannelID(0x03), + ValidAfterSeconds: sampleValidAfterSeconds, + ObservationTimestampSeconds: sampleObservationsTimestamp, + Values: []llo.StreamValue{ + &llo.Quote{Bid: decimal.NewFromFloat(6.1), Benchmark: sampleLinkBenchmarkPrice, Ask: decimal.NewFromFloat(8.2332)}, // Link price + &llo.Quote{Bid: decimal.NewFromFloat(9.4), Benchmark: sampleNativeBenchmarkPrice, Ask: decimal.NewFromFloat(11.33)}, // Native price + llo.ToDecimal(sampleMarketStatus), // DEX-based asset price + }, + Specimen: false, + } + + opts := ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: sampleBaseUSDFee, + ExpirationWindow: sampleExpirationWindow, + FeedID: sampleFeedID, + ABI: []ABIEncoder{ + // market status + ABIEncoder{ + StreamID: marketStatusStreamID, + Type: "uint32", + }, + }, + } + serializedOpts, err := opts.Encode() + require.NoError(t, err) + + cd := llotypes.ChannelDefinition{ + // ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + ReportFormat: llotypes.ReportFormat(4), // FIXME: When chainlink-common is fixed + Streams: []llotypes.Stream{ + { + StreamID: linkQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: ethQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: dexBasedAssetDecimalStreamID, + Aggregator: llotypes.AggregatorQuote, + }, + { + StreamID: baseMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: quoteMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + }, + Opts: serializedOpts, + } + + encoded, err := codec.Encode(ctx, report, cd) + require.NoError(t, err) + + values, err := expectedRWASchema.Unpack(encoded) + require.NoError(t, err) + + require.Len(t, values, len(expectedRWASchema)) + + expectedLinkFee := CalculateFee(sampleLinkBenchmarkPrice, sampleBaseUSDFee) + expectedNativeFee := CalculateFee(sampleNativeBenchmarkPrice, sampleBaseUSDFee) + + // doesn't crash if values are nil + for i := range report.Values { + report.Values[i] = nil + } + _, err = codec.Encode(ctx, report, cd) + require.Error(t, err) + + return AllTrue([]bool{ + assert.Equal(t, sampleFeedID, (common.Hash)(values[0].([32]byte))), //nolint:testifylint // false positive // feedId + assert.Equal(t, sampleValidAfterSeconds+1, values[1].(uint32)), // validFromTimestamp + assert.Equal(t, sampleObservationsTimestamp, values[2].(uint32)), // observationsTimestamp + assert.Equal(t, expectedLinkFee.String(), values[3].(*big.Int).String()), // linkFee + assert.Equal(t, expectedNativeFee.String(), values[4].(*big.Int).String()), // nativeFee + assert.Equal(t, sampleObservationsTimestamp+sampleExpirationWindow, values[5].(uint32)), // expiresAt + assert.Equal(t, uint32(sampleMarketStatus.BigInt().Int64()), values[6].(uint32)), //nolint:gosec // G115 // market status + }) + } + + properties.Property("Encodes values", prop.ForAll( + runTest, + genFeedID(), + genObservationsTimestamp(), + genValidAfterSeconds(), + genExpirationWindow(), + genBaseUSDFee(), + genLinkBenchmarkPrice(), + genNativeBenchmarkPrice(), + genMarketStatus(), + )) + + properties.TestingRun(t) + }) + + t.Run("benchmark price schema example", func(t *testing.T) { + expectedDEXBasedAssetSchema := abi.Arguments([]abi.Argument{ + {Name: "feedId", Type: mustNewABIType("bytes32")}, + {Name: "validFromTimestamp", Type: mustNewABIType("uint32")}, + {Name: "observationsTimestamp", Type: mustNewABIType("uint32")}, + {Name: "nativeFee", Type: mustNewABIType("uint192")}, + {Name: "linkFee", Type: mustNewABIType("uint192")}, + {Name: "expiresAt", Type: mustNewABIType("uint32")}, + {Name: "price", Type: mustNewABIType("int192")}, + }) + runTest := func(sampleFeedID common.Hash, sampleObservationsTimestamp, sampleValidAfterSeconds, sampleExpirationWindow uint32, priceMultiplier, marketDepthMultiplier *ubig.Big, sampleBaseUSDFee, sampleLinkBenchmarkPrice, sampleNativeBenchmarkPrice, sampleBenchmarkPrice decimal.Decimal) bool { + report := llo.Report{ + ConfigDigest: types.ConfigDigest{0x01}, + SeqNr: 0x02, + ChannelID: llotypes.ChannelID(0x03), + ValidAfterSeconds: sampleValidAfterSeconds, + ObservationTimestampSeconds: sampleObservationsTimestamp, + Values: []llo.StreamValue{ + &llo.Quote{Bid: decimal.NewFromFloat(6.1), Benchmark: sampleLinkBenchmarkPrice, Ask: decimal.NewFromFloat(8.2332)}, // Link price + &llo.Quote{Bid: decimal.NewFromFloat(9.4), Benchmark: sampleNativeBenchmarkPrice, Ask: decimal.NewFromFloat(11.33)}, // Native price + llo.ToDecimal(sampleBenchmarkPrice), // price + }, + Specimen: false, + } + + opts := ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: sampleBaseUSDFee, + ExpirationWindow: sampleExpirationWindow, + FeedID: sampleFeedID, + ABI: []ABIEncoder{ + // benchmark price + ABIEncoder{ + StreamID: dexBasedAssetDecimalStreamID, + Type: "int192", + Multiplier: priceMultiplier, // TODO: Default multiplier? + }, + }, + } + serializedOpts, err := opts.Encode() + require.NoError(t, err) + + cd := llotypes.ChannelDefinition{ + ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + Streams: []llotypes.Stream{ + { + StreamID: linkQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: ethQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: benchmarkPriceStreamID, + Aggregator: llotypes.AggregatorQuote, + }, + }, + Opts: serializedOpts, + } + + encoded, err := codec.Encode(ctx, report, cd) + require.NoError(t, err) + + values, err := expectedDEXBasedAssetSchema.Unpack(encoded) + require.NoError(t, err) + + require.Len(t, values, len(expectedDEXBasedAssetSchema)) + + expectedLinkFee := CalculateFee(sampleLinkBenchmarkPrice, sampleBaseUSDFee) + expectedNativeFee := CalculateFee(sampleNativeBenchmarkPrice, sampleBaseUSDFee) + + // doesn't crash if values are nil + for i := range report.Values { + report.Values[i] = nil + } + _, err = codec.Encode(ctx, report, cd) + require.Error(t, err) + + return AllTrue([]bool{ + assert.Equal(t, sampleFeedID, (common.Hash)(values[0].([32]byte))), //nolint:testifylint // false positive // feedId + assert.Equal(t, sampleValidAfterSeconds+1, values[1].(uint32)), // validFromTimestamp + assert.Equal(t, sampleObservationsTimestamp, values[2].(uint32)), // observationsTimestamp + assert.Equal(t, expectedLinkFee.String(), values[3].(*big.Int).String()), // linkFee + assert.Equal(t, expectedNativeFee.String(), values[4].(*big.Int).String()), // nativeFee + assert.Equal(t, sampleObservationsTimestamp+sampleExpirationWindow, values[5].(uint32)), // expiresAt + assert.Equal(t, sampleBenchmarkPrice.Mul(decimal.NewFromBigInt(priceMultiplier.ToInt(), 0)).BigInt(), values[6].(*big.Int)), // price + }) + } + + properties.Property("Encodes values", prop.ForAll( + runTest, + genFeedID(), + genObservationsTimestamp(), + genValidAfterSeconds(), + genExpirationWindow(), + genPriceMultiplier(), + genMarketDepthMultiplier(), + genBaseUSDFee(), + genLinkBenchmarkPrice(), + genNativeBenchmarkPrice(), + genBenchmarkPrice(), + )) + + properties.TestingRun(t) + }) + + t.Run("funding rate schema example", func(t *testing.T) { + expectedFundingRateSchema := abi.Arguments([]abi.Argument{ + {Name: "feedId", Type: mustNewABIType("bytes32")}, + {Name: "validFromTimestamp", Type: mustNewABIType("uint32")}, + {Name: "observationsTimestamp", Type: mustNewABIType("uint32")}, + {Name: "nativeFee", Type: mustNewABIType("uint192")}, + {Name: "linkFee", Type: mustNewABIType("uint192")}, + {Name: "expiresAt", Type: mustNewABIType("uint32")}, + {Name: "binanceFundingRate", Type: mustNewABIType("int192")}, + {Name: "binanceFundingTime", Type: mustNewABIType("uint32")}, + {Name: "binanceFundingIntervalHours", Type: mustNewABIType("uint32")}, + {Name: "deribitFundingRate", Type: mustNewABIType("int192")}, + {Name: "deribitFundingTime", Type: mustNewABIType("uint32")}, + {Name: "deribitFundingIntervalHours", Type: mustNewABIType("uint32")}, + }) + + runTest := func(sampleFeedID common.Hash, sampleObservationsTimestamp, sampleValidAfterSeconds, sampleExpirationWindow uint32, sampleBaseUSDFee, sampleLinkBenchmarkPrice, sampleNativeBenchmarkPrice, sampleBinanceFundingRate, sampleBinanceFundingTime, sampleBinanceFundingIntervalHours, sampleDeribitFundingRate, sampleDeribitFundingTime, sampleDeribitFundingIntervalHours decimal.Decimal) bool { + report := llo.Report{ + ConfigDigest: types.ConfigDigest{0x01}, + SeqNr: 0x02, + ChannelID: llotypes.ChannelID(0x03), + ValidAfterSeconds: sampleValidAfterSeconds, + ObservationTimestampSeconds: sampleObservationsTimestamp, + Values: []llo.StreamValue{ + &llo.Quote{Bid: decimal.NewFromFloat(6.1), Benchmark: sampleLinkBenchmarkPrice, Ask: decimal.NewFromFloat(8.2332)}, // Link price + &llo.Quote{Bid: decimal.NewFromFloat(9.4), Benchmark: sampleNativeBenchmarkPrice, Ask: decimal.NewFromFloat(11.33)}, // Native price + llo.ToDecimal(sampleBinanceFundingRate), // Binance funding rate + llo.ToDecimal(sampleBinanceFundingTime), // Binance funding time + llo.ToDecimal(sampleBinanceFundingIntervalHours), // Binance funding interval hours + llo.ToDecimal(sampleDeribitFundingRate), // Deribit funding rate + llo.ToDecimal(sampleDeribitFundingTime), // Deribit funding time + llo.ToDecimal(sampleDeribitFundingIntervalHours), // Deribit funding interval hours + }, + Specimen: false, + } + + opts := ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: sampleBaseUSDFee, + ExpirationWindow: sampleExpirationWindow, + FeedID: sampleFeedID, + ABI: []ABIEncoder{ + ABIEncoder{StreamID: binanceFundingRateStreamID, Type: "int192"}, + ABIEncoder{StreamID: binanceFundingTimeStreamID, Type: "uint32"}, + ABIEncoder{StreamID: binanceFundingIntervalHoursStreamID, Type: "uint32"}, + ABIEncoder{StreamID: deribitFundingRateStreamID, Type: "int192"}, + ABIEncoder{StreamID: deribitFundingTimeStreamID, Type: "uint32"}, + ABIEncoder{StreamID: deribitFundingIntervalHoursStreamID, Type: "uint32"}, + }, + } + serializedOpts, err := opts.Encode() + require.NoError(t, err) + + cd := llotypes.ChannelDefinition{ + // ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + ReportFormat: llotypes.ReportFormat(4), // FIXME: When chainlink-common is fixed + Streams: []llotypes.Stream{ + { + StreamID: linkQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: ethQuoteStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: dexBasedAssetDecimalStreamID, + Aggregator: llotypes.AggregatorQuote, + }, + { + StreamID: baseMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: quoteMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + }, + Opts: serializedOpts, + } + + encoded, err := codec.Encode(ctx, report, cd) + require.NoError(t, err) + + values, err := expectedFundingRateSchema.Unpack(encoded) + require.NoError(t, err) + + require.Len(t, values, len(expectedFundingRateSchema)) + + expectedLinkFee := CalculateFee(sampleLinkBenchmarkPrice, sampleBaseUSDFee) + expectedNativeFee := CalculateFee(sampleNativeBenchmarkPrice, sampleBaseUSDFee) + + // doesn't crash if values are nil + for i := range report.Values { + report.Values[i] = nil + } + _, err = codec.Encode(ctx, report, cd) + require.Error(t, err) + + return AllTrue([]bool{ + assert.Equal(t, sampleFeedID, (common.Hash)(values[0].([32]byte))), //nolint:testifylint // false positive // feedId + assert.Equal(t, sampleValidAfterSeconds+1, values[1].(uint32)), // validFromTimestamp + assert.Equal(t, sampleObservationsTimestamp, values[2].(uint32)), // observationsTimestamp + assert.Equal(t, expectedLinkFee.String(), values[3].(*big.Int).String()), // linkFee + assert.Equal(t, expectedNativeFee.String(), values[4].(*big.Int).String()), // nativeFee + assert.Equal(t, sampleObservationsTimestamp+sampleExpirationWindow, values[5].(uint32)), // expiresAt + assert.Equal(t, sampleBinanceFundingRate.BigInt().String(), values[6].(*big.Int).String()), // binanceFundingRate + assert.Equal(t, uint32(sampleBinanceFundingTime.BigInt().Int64()), values[7].(uint32)), //nolint:gosec // G115 // binanceFundingTime + assert.Equal(t, uint32(sampleBinanceFundingIntervalHours.BigInt().Int64()), values[8].(uint32)), //nolint:gosec // G115 // binanceFundingIntervalHours + assert.Equal(t, sampleDeribitFundingRate.BigInt().String(), values[9].(*big.Int).String()), // deribitFundingRate + assert.Equal(t, uint32(sampleDeribitFundingTime.BigInt().Int64()), values[10].(uint32)), //nolint:gosec // G115 // deribitFundingTime + assert.Equal(t, uint32(sampleDeribitFundingIntervalHours.BigInt().Int64()), values[11].(uint32)), //nolint:gosec // G115 // deribitFundingIntervalHours + }) + } + + properties.Property("Encodes values", prop.ForAll( + runTest, + genFeedID(), + genObservationsTimestamp(), + genValidAfterSeconds(), + genExpirationWindow(), + genBaseUSDFee(), + genLinkBenchmarkPrice(), + genNativeBenchmarkPrice(), + genFundingRate(), + genFundingTime(), + genFundingIntervalHours(), + genFundingRate(), + genFundingTime(), + genFundingIntervalHours(), + )) + + properties.TestingRun(t) + }) +} + +func TestReportCodecEVMABIEncodeUnpacked_Encode(t *testing.T) { + t.Run("ABI and values length mismatch error", func(t *testing.T) { + // TODO + }) +} + +func genFeedID() gopter.Gen { + return func(p *gopter.GenParameters) *gopter.GenResult { + var feedID common.Hash + p.Rng.Read(feedID[:]) + return gopter.NewGenResult(feedID, gopter.NoShrinker) + } +} + +func genObservationsTimestamp() gopter.Gen { + return gen.UInt32() +} + +func genValidAfterSeconds() gopter.Gen { + return gen.UInt32() +} + +func genExpirationWindow() gopter.Gen { + return gen.UInt32() +} + +func genPriceMultiplier() gopter.Gen { + return genMultiplier() +} + +func genMarketDepthMultiplier() gopter.Gen { + return genMultiplier() +} + +func genMultiplier() gopter.Gen { + return gen.UInt32().Map(func(i uint32) *ubig.Big { + return ubig.NewI(int64(i)) + }) +} + +func genDecimal() gopter.Gen { + return gen.Float32Range(-2e32, 2e32).Map(decimal.NewFromFloat32) +} + +func genBaseUSDFee() gopter.Gen { + return genDecimal() +} + +func genLinkBenchmarkPrice() gopter.Gen { + return genDecimal() +} + +func genNativeBenchmarkPrice() gopter.Gen { + return genDecimal() +} + +func genBenchmarkPrice() gopter.Gen { + return genDecimal() +} + +func genBaseMarketDepth() gopter.Gen { + return genDecimal() +} + +func genQuoteMarketDepth() gopter.Gen { + return genDecimal() +} + +func genMarketStatus() gopter.Gen { + return gen.UInt32().Map(func(i uint32) decimal.Decimal { + return decimal.NewFromInt(int64(i)) + }) +} + +func genFundingRate() gopter.Gen { + return genDecimal() +} + +func genFundingTime() gopter.Gen { + // Unix epochs + return gen.UInt32Range(1500000000, 2000000000).Map(func(i uint32) decimal.Decimal { + return decimal.NewFromInt(int64(i)) + }) +} + +func genFundingIntervalHours() gopter.Gen { + return gen.UInt32().Map(func(i uint32) decimal.Decimal { + return decimal.NewFromInt(int64(i)) + }) +} + +func mustNewABIType(t string) abi.Type { + result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) + if err != nil { + panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) + } + return result +} + +func Test_ABIEncoder_Encode(t *testing.T) { + t.Run("encodes decimals", func(t *testing.T) { + tcs := []struct { + name string + sv llo.StreamValue + abiType string + multiplier *big.Int + errStr string + expected string + }{ + { + name: "overflow int8", + sv: llo.ToDecimal(decimal.NewFromFloat32(123456789.123456789)), + abiType: "int8", + errStr: "invalid type: cannot fit 123456790 into int8", + }, + { + name: "successful int8", + sv: llo.ToDecimal(decimal.NewFromFloat32(123.456)), + abiType: "int8", + expected: padLeft32Byte(fmt.Sprintf("%x", 123)), + }, + { + name: "negative multiplied int8", + sv: llo.ToDecimal(decimal.NewFromFloat32(1.11)), + multiplier: big.NewInt(-100), + abiType: "int8", + expected: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91", + }, + { + name: "negative uint32", + sv: llo.ToDecimal(decimal.NewFromFloat32(-123.456)), + abiType: "uint32", + errStr: "invalid type: cannot fit -123 into uint32", + }, + { + name: "successful uint32", + sv: llo.ToDecimal(decimal.NewFromFloat32(123456.456)), + abiType: "uint32", + expected: padLeft32Byte(fmt.Sprintf("%x", 123456)), + }, + { + name: "multiplied uint32", + sv: llo.ToDecimal(decimal.NewFromFloat32(123.456)), + multiplier: big.NewInt(100), + abiType: "uint32", + expected: padLeft32Byte(fmt.Sprintf("%x", 12345)), + }, + { + name: "negative multiplied int32", + sv: llo.ToDecimal(decimal.NewFromFloat32(123.456)), + multiplier: big.NewInt(-100), + abiType: "int32", + expected: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfc7", + }, + { + name: "overflowing multiplied int32", + sv: llo.ToDecimal(decimal.NewFromInt(math.MaxInt32)), + multiplier: big.NewInt(2), + abiType: "int32", + errStr: "invalid type: cannot fit 4294967294 into int32", + }, + { + name: "successful int192", + sv: llo.ToDecimal(decimal.NewFromFloat32(123456.789123)), + abiType: "int192", + multiplier: big.NewInt(1e18), + expected: "000000000000000000000000000000000000000000001a249b2292e49d8f0000", + }, + } + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + enc := ABIEncoder{ + Type: tc.abiType, + Multiplier: (*ubig.Big)(tc.multiplier), + } + encoded, err := enc.Encode(tests.Context(t), tc.sv) + if tc.errStr != "" { + require.Error(t, err) + assert.Contains(t, err.Error(), tc.errStr) + } else { + require.NoError(t, err) + require.Equal(t, tc.expected, hex.EncodeToString(encoded)) + } + }) + } + }) +} + +func padLeft32Byte(str string) string { + if len(str) >= 64 { + return str + } + padding := strings.Repeat("0", 64-len(str)) + return padding + str +} diff --git a/core/services/llo/keyring.go b/core/services/llo/keyring.go index d4bf615711c..443aa1968ba 100644 --- a/core/services/llo/keyring.go +++ b/core/services/llo/keyring.go @@ -80,7 +80,7 @@ func (okr *onchainKeyring) MaxSignatureLength() (n int) { func (okr *onchainKeyring) Sign(digest types.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[llotypes.ReportInfo]) (signature []byte, err error) { switch r.Info.ReportFormat { - case llotypes.ReportFormatEVMPremiumLegacy: + case llotypes.ReportFormatEVMPremiumLegacy, llotypes.ReportFormatEVMABIEncodeUnpacked: rf := r.Info.ReportFormat if key, exists := okr.keys[rf]; exists { // NOTE: Must use legacy Sign method for compatibility with v0.3 report verification @@ -101,7 +101,7 @@ func (okr *onchainKeyring) Sign(digest types.ConfigDigest, seqNr uint64, r ocr3t func (okr *onchainKeyring) Verify(key types.OnchainPublicKey, digest types.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[llotypes.ReportInfo], signature []byte) bool { switch r.Info.ReportFormat { - case llotypes.ReportFormatEVMPremiumLegacy: + case llotypes.ReportFormatEVMPremiumLegacy, llotypes.ReportFormatEVMABIEncodeUnpacked: rf := r.Info.ReportFormat if verifier, exists := okr.keys[rf]; exists { // NOTE: Must use legacy Verify method for compatibility with v0.3 report verification diff --git a/core/services/llo/mercurytransmitter/server.go b/core/services/llo/mercurytransmitter/server.go index 3ce2b0a4b4a..769b5e99cda 100644 --- a/core/services/llo/mercurytransmitter/server.go +++ b/core/services/llo/mercurytransmitter/server.go @@ -253,12 +253,18 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, donI defer cancelFn() return s.transmit(ctx, t) }(ctx) + + lggr := s.lggr.With("transmission", t, "response", res, "transmissionHash", fmt.Sprintf("%x", t.Hash())) + if req != nil { + lggr = s.lggr.With("req.Payload", req.Payload, "req.ReportFormat", req.ReportFormat) + } + if ctx.Err() != nil { // only canceled on transmitter close so we can exit return false } else if err != nil { s.transmitConnectionErrorCount.Inc() - s.lggr.Errorw("Transmit report failed", "err", err, "req.Payload", req.Payload, "req.ReportFormat", req.ReportFormat, "transmission", t) + lggr.Errorw("Transmit report failed", "err", err) if ok := s.q.Push(t); !ok { s.lggr.Error("Failed to push report to transmit queue; queue is closed") return false @@ -276,7 +282,7 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, donI b.Reset() if res.Error == "" { s.transmitSuccessCount.Inc() - s.lggr.Debugw("Transmit report success", "req.ReportFormat", req.ReportFormat, "req.Payload", req.Payload, "transmission", t, "response", res) + lggr.Debug("Transmit report success") } else { // We don't need to retry here because the mercury server // has confirmed it received the report. We only need to retry @@ -285,17 +291,17 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, donI case DuplicateReport: s.transmitSuccessCount.Inc() s.transmitDuplicateCount.Inc() - s.lggr.Debugw("Transmit report success; duplicate report", "req.ReportFormat", req.ReportFormat, "req.Payload", req.Payload, "transmission", t, "response", res) + lggr.Debug("Transmit report success; duplicate report") default: promTransmitServerErrorCount.WithLabelValues(donIDStr, s.url, strconv.FormatInt(int64(res.Code), 10)).Inc() - s.lggr.Errorw("Transmit report failed; mercury server returned error", "req.ReportFormat", req.ReportFormat, "req.Payload", req.Payload, "response", res, "transmission", t, "err", res.Error, "code", res.Code) + lggr.Errorw("Transmit report failed; mercury server returned error", "err", res.Error, "code", res.Code) } } select { case s.deleteQueue <- t.Hash(): default: - s.lggr.Criticalw("Delete queue is full", "transmission", t, "transmissionHash", fmt.Sprintf("%x", t.Hash())) + lggr.Criticalw("Delete queue is full") } return true }() @@ -309,7 +315,7 @@ func (s *server) transmit(ctx context.Context, t *Transmission) (*pb.TransmitReq switch t.Report.Info.ReportFormat { case llotypes.ReportFormatJSON: payload, err = s.jsonPacker.Pack(t.ConfigDigest, t.SeqNr, t.Report.Report, t.Sigs) - case llotypes.ReportFormatEVMPremiumLegacy: + case llotypes.ReportFormatEVMPremiumLegacy, llotypes.ReportFormatEVMABIEncodeUnpacked: payload, err = s.evmPremiumLegacyPacker.Pack(t.ConfigDigest, t.SeqNr, t.Report.Report, t.Sigs) default: return nil, nil, fmt.Errorf("Transmit failed; don't know how to Pack unsupported report format: %q", t.Report.Info.ReportFormat) diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index f6b08cf46a3..888cbfa5778 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -1009,7 +1009,7 @@ func (d *Delegate) newServicesLLO( // Also re-use EVM keys for signing the retirement report. This isn't // required, just seems easiest since it's the only key type available for // now. - for _, rf := range []llotypes.ReportFormat{llotypes.ReportFormatJSON, llotypes.ReportFormatEVMPremiumLegacy, llotypes.ReportFormatRetirement} { + for _, rf := range []llotypes.ReportFormat{llotypes.ReportFormatJSON, llotypes.ReportFormatEVMPremiumLegacy, llotypes.ReportFormatRetirement, llotypes.ReportFormatEVMABIEncodeUnpacked} { if _, exists := kbm[rf]; !exists { // Use the first if unspecified kbs, err3 := d.ks.GetAllOfType("evm") diff --git a/core/services/ocr2/plugins/llo/helpers_test.go b/core/services/ocr2/plugins/llo/helpers_test.go index 9cd8742ffa8..947b66ca8ed 100644 --- a/core/services/ocr2/plugins/llo/helpers_test.go +++ b/core/services/ocr2/plugins/llo/helpers_test.go @@ -232,6 +232,29 @@ observationSource = """ )) } +func addStreamSpec( + t *testing.T, + node Node, + name string, + streamID *uint32, + observationSource string, +) (id int32) { + optionalStreamID := "" + if streamID != nil { + optionalStreamID = fmt.Sprintf("streamID = %d\n", *streamID) + } + specTOML := fmt.Sprintf(` +type = "stream" +schemaVersion = 1 +name = "%s" +%s +observationSource = """ +%s +""" +`, name, optionalStreamID, observationSource) + return node.AddStreamJob(t, specTOML) +} + func addQuoteStreamJob( t *testing.T, node Node, @@ -331,7 +354,7 @@ transmitterID = "%x" )) } -func createBridge(t *testing.T, name string, i int, p decimal.Decimal, borm bridges.ORM) (bridgeName string) { +func createSingleDecimalBridge(t *testing.T, name string, i int, p decimal.Decimal, borm bridges.ORM) (bridgeName string) { ctx := testutils.Context(t) bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { b, err := io.ReadAll(req.Body) @@ -355,6 +378,24 @@ func createBridge(t *testing.T, name string, i int, p decimal.Decimal, borm brid return bridgeName } +func createBridge(t *testing.T, bridgeName string, resultJSON string, borm bridges.ORM) { + ctx := testutils.Context(t) + bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + res.WriteHeader(http.StatusOK) + resp := fmt.Sprintf(`{"result": %s}`, resultJSON) + _, err := res.Write([]byte(resp)) + if err != nil { + t.Fatalf("failed to write response: %v", err) + } + })) + t.Cleanup(bridge.Close) + u, _ := url.Parse(bridge.URL) + require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ + Name: bridges.BridgeName(bridgeName), + URL: models.WebURL(*u), + })) +} + func addOCRJobsEVMPremiumLegacy( t *testing.T, streams []Stream, @@ -386,7 +427,7 @@ func addOCRJobsEVMPremiumLegacy( name = "linkprice" } name = fmt.Sprintf("%s-%d-%d", name, strm.id, j) - bmBridge := createBridge(t, name, i, strm.baseBenchmarkPrice, node.App.BridgeORM()) + bmBridge := createSingleDecimalBridge(t, name, i, strm.baseBenchmarkPrice, node.App.BridgeORM()) jobID := addSingleDecimalStreamJob( t, node, @@ -395,9 +436,9 @@ func addOCRJobsEVMPremiumLegacy( ) jobIDs[i][strm.id] = jobID } else { - bmBridge := createBridge(t, fmt.Sprintf("benchmarkprice-%d-%d", strm.id, j), i, strm.baseBenchmarkPrice, node.App.BridgeORM()) - bidBridge := createBridge(t, fmt.Sprintf("bid-%d-%d", strm.id, j), i, strm.baseBid, node.App.BridgeORM()) - askBridge := createBridge(t, fmt.Sprintf("ask-%d-%d", strm.id, j), i, strm.baseAsk, node.App.BridgeORM()) + bmBridge := createSingleDecimalBridge(t, fmt.Sprintf("benchmarkprice-%d-%d", strm.id, j), i, strm.baseBenchmarkPrice, node.App.BridgeORM()) + bidBridge := createSingleDecimalBridge(t, fmt.Sprintf("bid-%d-%d", strm.id, j), i, strm.baseBid, node.App.BridgeORM()) + askBridge := createSingleDecimalBridge(t, fmt.Sprintf("ask-%d-%d", strm.id, j), i, strm.baseAsk, node.App.BridgeORM()) jobID := addQuoteStreamJob( t, node, diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index 0491c29b39c..90a41886761 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -14,6 +14,7 @@ import ( "time" "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" gethtypes "github.com/ethereum/go-ethereum/core/types" @@ -33,6 +34,8 @@ import ( llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" datastreamsllo "github.com/smartcontractkit/chainlink-data-streams/llo" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" @@ -336,33 +339,36 @@ func promoteStagingConfig(t *testing.T, donID uint32, steve *bind.TransactOpts, backend.Commit() } -func TestIntegration_LLO(t *testing.T) { +func TestIntegration_LLO_evm_premium_legacy(t *testing.T) { t.Parallel() + testStartTimeStamp := time.Now() multiplier := decimal.New(1, 18) expirationWindow := time.Hour / time.Second + const salt = 100 + clientCSAKeys := make([]csakey.KeyV2, nNodes) clientPubKeys := make([]ed25519.PublicKey, nNodes) for i := 0; i < nNodes; i++ { - k := big.NewInt(int64(i)) + k := big.NewInt(int64(salt + i)) key := csakey.MustNewV2XXXTestingOnly(k) clientCSAKeys[i] = key clientPubKeys[i] = key.PublicKey } - steve, backend, configurator, configuratorAddress, verifier, _, verifierProxy, _, configStore, configStoreAddress, legacyVerifier, legacyVerifierAddr, _, _ := setupBlockchain(t) + steve, backend, _, _, verifier, _, verifierProxy, _, configStore, configStoreAddress, legacyVerifier, legacyVerifierAddr, _, _ := setupBlockchain(t) fromBlock := 1 // Setup bootstrap - bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) + bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 1)) bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} t.Run("using legacy verifier configuration contract, produces reports in v0.3 format", func(t *testing.T) { reqs := make(chan request, 100000) - serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) + serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 2)) serverPubKey := serverKey.PublicKey srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) @@ -548,10 +554,516 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi } }) }) +} + +func TestIntegration_LLO_evm_abi_encode_unpacked(t *testing.T) { + t.Parallel() + + testStartTimeStamp := time.Now() + expirationWindow := uint32(3600) + + const salt = 200 + + clientCSAKeys := make([]csakey.KeyV2, nNodes) + clientPubKeys := make([]ed25519.PublicKey, nNodes) + for i := 0; i < nNodes; i++ { + k := big.NewInt(int64(salt + i)) + key := csakey.MustNewV2XXXTestingOnly(k) + clientCSAKeys[i] = key + clientPubKeys[i] = key.PublicKey + } + + steve, backend, configurator, configuratorAddress, _, _, _, _, configStore, configStoreAddress, _, _, _, _ := setupBlockchain(t) + fromBlock := 1 + + // Setup bootstrap + bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 1)) + bootstrapNodePort := freeport.GetOne(t) + appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) + bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} + + t.Run("generates reports using go ReportFormatEVMABIEncodeUnpacked format", func(t *testing.T) { + reqs := make(chan request, 100000) + serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 2)) + serverPubKey := serverKey.PublicKey + srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) + + serverURL := startMercuryServer(t, srv, clientPubKeys) + + donID := uint32(888333) + streams := []Stream{ethStream, linkStream} + streamMap := make(map[uint32]Stream) + for _, strm := range streams { + streamMap[strm.id] = strm + } + + // Setup oracle nodes + oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams) + + chainID := testutils.SimulatedChainID + relayType := "evm" + relayConfig := fmt.Sprintf(` +chainID = "%s" +fromBlock = %d +lloDonID = %d +lloConfigMode = "bluegreen" +`, chainID, fromBlock, donID) + addBootstrapJob(t, bootstrapNode, configuratorAddress, "job-4", relayType, relayConfig) + + dexBasedAssetPriceStreamID := uint32(1) + marketStatusStreamID := uint32(2) + baseMarketDepthStreamID := uint32(3) + quoteMarketDepthStreamID := uint32(4) + benchmarkPriceStreamID := uint32(5) + binanceFundingRateStreamID := uint32(6) + binanceFundingTimeStreamID := uint32(7) + binanceFundingIntervalHoursStreamID := uint32(8) + deribitFundingRateStreamID := uint32(9) + deribitFundingTimeStreamID := uint32(10) + deribitFundingIntervalHoursStreamID := uint32(11) + + mustEncodeOpts := func(opts *lloevm.ReportFormatEVMABIEncodeOpts) []byte { + encoded, err := json.Marshal(opts) + require.NoError(t, err) + return encoded + } + + standardMultiplier := ubig.NewI(1e18) + + dexBasedAssetFeedID := utils.NewHash() + rwaFeedID := utils.NewHash() + benchmarkPriceFeedID := utils.NewHash() + fundingRateFeedID := utils.NewHash() + // Channel definitions + channelDefinitions := llotypes.ChannelDefinitions{ + // Sample DEX-based asset schema + 1: { + ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + Streams: []llotypes.Stream{ + { + StreamID: ethStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: linkStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: dexBasedAssetPriceStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: baseMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: quoteMarketDepthStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + }, + Opts: mustEncodeOpts(&lloevm.ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: decimal.NewFromFloat32(0.1), + ExpirationWindow: expirationWindow, + FeedID: dexBasedAssetFeedID, + ABI: []lloevm.ABIEncoder{ + lloevm.ABIEncoder{ + StreamID: dexBasedAssetPriceStreamID, + Type: "int192", + Multiplier: standardMultiplier, + }, + lloevm.ABIEncoder{ + StreamID: baseMarketDepthStreamID, + Type: "int192", + }, + lloevm.ABIEncoder{ + StreamID: quoteMarketDepthStreamID, + Type: "int192", + }, + }, + }), + }, + // Sample RWA schema + 2: { + ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + Streams: []llotypes.Stream{ + { + StreamID: ethStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: linkStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: marketStatusStreamID, + Aggregator: llotypes.AggregatorMode, + }, + }, + Opts: mustEncodeOpts(&lloevm.ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: decimal.NewFromFloat32(0.1), + ExpirationWindow: expirationWindow, + FeedID: rwaFeedID, + ABI: []lloevm.ABIEncoder{ + { + StreamID: marketStatusStreamID, + Type: "uint32", + }, + }, + }), + }, + // Sample Benchmark price schema + 3: { + ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + Streams: []llotypes.Stream{ + { + StreamID: ethStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: linkStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: benchmarkPriceStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + }, + Opts: mustEncodeOpts(&lloevm.ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: decimal.NewFromFloat32(0.1), + ExpirationWindow: expirationWindow, + FeedID: benchmarkPriceFeedID, + ABI: []lloevm.ABIEncoder{ + { + StreamID: benchmarkPriceStreamID, + Type: "int192", + Multiplier: standardMultiplier, + }, + }, + }), + }, + // Sample funding rate scheam + 4: { + ReportFormat: llotypes.ReportFormatEVMABIEncodeUnpacked, + Streams: []llotypes.Stream{ + { + StreamID: ethStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: linkStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: binanceFundingRateStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: binanceFundingTimeStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: binanceFundingIntervalHoursStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: deribitFundingRateStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: deribitFundingTimeStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: deribitFundingIntervalHoursStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + }, + Opts: mustEncodeOpts(&lloevm.ReportFormatEVMABIEncodeOpts{ + BaseUSDFee: decimal.NewFromFloat32(0.1), + ExpirationWindow: expirationWindow, + FeedID: fundingRateFeedID, + ABI: []lloevm.ABIEncoder{ + { + StreamID: binanceFundingRateStreamID, + Type: "int192", + }, + { + StreamID: binanceFundingTimeStreamID, + Type: "int192", + }, + { + StreamID: binanceFundingIntervalHoursStreamID, + Type: "int192", + }, + { + StreamID: deribitFundingRateStreamID, + Type: "int192", + }, + { + StreamID: deribitFundingTimeStreamID, + Type: "int192", + }, + { + StreamID: deribitFundingIntervalHoursStreamID, + Type: "int192", + }, + }, + }), + }, + } + url, sha := newChannelDefinitionsServer(t, channelDefinitions) + + // Set channel definitions + _, err := configStore.SetChannelDefinitions(steve, donID, url, sha) + require.NoError(t, err) + backend.Commit() + + pluginConfig := fmt.Sprintf(`servers = { "%s" = "%x" } +donID = %d +channelDefinitionsContractAddress = "0x%x" +channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, configStoreAddress, fromBlock) + + bridgeName := "superbridge" + + resultJSON := `{ + "benchmarkPrice": "2976.39", + "baseMarketDepth": "1000.1212", + "quoteMarketDepth": "998.5431", + "marketStatus": "1", + "binanceFundingRate": "1234.5678", + "binanceFundingTime": "1630000000", + "binanceFundingIntervalHours": "8", + "deribitFundingRate": "5432.2345", + "deribitFundingTime": "1630000000", + "deribitFundingIntervalHours": "8" +}` + + dexBasedAssetPipeline := fmt.Sprintf(` +dp [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + +bp_parse [type=jsonparse path="result,benchmarkPrice"]; +base_market_depth_parse [type=jsonparse path="result,baseMarketDepth"]; +quote_market_depth_parse [type=jsonparse path="result,quoteMarketDepth"]; + +bp_decimal [type=multiply times=1 streamID=%d]; +base_market_depth_decimal [type=multiply times=1 streamID=%d]; +quote_market_depth_decimal [type=multiply times=1 streamID=%d]; + +dp -> bp_parse -> bp_decimal; +dp -> base_market_depth_parse -> base_market_depth_decimal; +dp -> quote_market_depth_parse -> quote_market_depth_decimal; +`, bridgeName, dexBasedAssetPriceStreamID, baseMarketDepthStreamID, quoteMarketDepthStreamID) + + rwaPipeline := fmt.Sprintf(` +dp [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + +market_status_parse [type=jsonparse path="result,marketStatus"]; +market_status_decimal [type=multiply times=1 streamID=%d]; + +dp -> market_status_parse -> market_status_decimal; +`, bridgeName, marketStatusStreamID) + + benchmarkPricePipeline := fmt.Sprintf(` +dp [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + +bp_parse [type=jsonparse path="result,benchmarkPrice"]; +bp_decimal [type=multiply times=1 streamID=%d]; + +dp -> bp_parse -> bp_decimal; +`, bridgeName, benchmarkPriceStreamID) + + fundingRatePipeline := fmt.Sprintf(` +dp [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + +binance_funding_rate_parse [type=jsonparse path="result,binanceFundingRate"]; +binance_funding_rate_decimal [type=multiply times=1 streamID=%d]; + +binance_funding_time_parse [type=jsonparse path="result,binanceFundingTime"]; +binance_funding_time_decimal [type=multiply times=1 streamID=%d]; + +binance_funding_interval_hours_parse [type=jsonparse path="result,binanceFundingIntervalHours"]; +binance_funding_interval_hours_decimal [type=multiply times=1 streamID=%d]; + +deribit_funding_rate_parse [type=jsonparse path="result,deribitFundingRate"]; +deribit_funding_rate_decimal [type=multiply times=1 streamID=%d]; + +deribit_funding_time_parse [type=jsonparse path="result,deribitFundingTime"]; +deribit_funding_time_decimal [type=multiply times=1 streamID=%d]; + +deribit_funding_interval_hours_parse [type=jsonparse path="result,deribitFundingIntervalHours"]; +deribit_funding_interval_hours_decimal [type=multiply times=1 streamID=%d]; + +dp -> binance_funding_rate_parse -> binance_funding_rate_decimal; +dp -> binance_funding_time_parse -> binance_funding_time_decimal; +dp -> binance_funding_interval_hours_parse -> binance_funding_interval_hours_decimal; +dp -> deribit_funding_rate_parse -> deribit_funding_rate_decimal; +dp -> deribit_funding_time_parse -> deribit_funding_time_decimal; +dp -> deribit_funding_interval_hours_parse -> deribit_funding_interval_hours_decimal; +`, bridgeName, binanceFundingRateStreamID, binanceFundingTimeStreamID, binanceFundingIntervalHoursStreamID, deribitFundingRateStreamID, deribitFundingTimeStreamID, deribitFundingIntervalHoursStreamID) + + for i, node := range nodes { + // superBridge returns a JSON with everything you want in it, + // stream specs can just pick the individual fields they need + createBridge(t, bridgeName, resultJSON, node.App.BridgeORM()) + addStreamSpec(t, node, "dexBasedAssetPipeline", nil, dexBasedAssetPipeline) + addStreamSpec(t, node, "rwaPipeline", nil, rwaPipeline) + addStreamSpec(t, node, "benchmarkPricePipeline", nil, benchmarkPricePipeline) + addStreamSpec(t, node, "fundingRatePipeline", nil, fundingRatePipeline) + addLLOJob( + t, + node, + configuratorAddress, + bootstrapPeerID, + bootstrapNodePort, + clientPubKeys[i], + "llo-evm-abi-encode-unpacked-test", + pluginConfig, + relayType, + relayConfig, + ) + } + + // Set config on configurator + digest := setProductionConfig( + t, donID, steve, backend, configurator, configuratorAddress, nodes, oracles, + ) + + // NOTE: Wait for one of each type of report + feedIDs := map[[32]byte]struct{}{ + dexBasedAssetFeedID: {}, + rwaFeedID: {}, + benchmarkPriceFeedID: {}, + fundingRateFeedID: {}, + } + + for req := range reqs { + v := make(map[string]interface{}) + err := mercury.PayloadTypes.UnpackIntoMap(v, req.req.Payload) + require.NoError(t, err) + report, exists := v["report"] + if !exists { + t.Fatalf("expected payload %#v to contain 'report'", v) + } + reportCtx, exists := v["reportContext"] + if !exists { + t.Fatalf("expected payload %#v to contain 'reportContext'", v) + } + + // Check the report context + assert.Equal(t, [32]byte(digest), reportCtx.([3][32]uint8)[0]) // config digest + assert.Equal(t, "000000000000000000000000000000000000000000000000000d8e0d00000001", fmt.Sprintf("%x", reportCtx.([3][32]uint8)[2])) // extra hash + + reportElems := make(map[string]interface{}) + err = lloevm.BaseSchema.UnpackIntoMap(reportElems, report.([]byte)) + require.NoError(t, err) + + feedID := reportElems["feedId"].([32]uint8) + delete(feedIDs, feedID) + + // Check headers + assert.GreaterOrEqual(t, reportElems["validFromTimestamp"].(uint32), uint32(testStartTimeStamp.Unix())) //nolint:gosec // G115 + assert.GreaterOrEqual(t, int(reportElems["observationsTimestamp"].(uint32)), int(testStartTimeStamp.Unix())) + // Zero fees since both eth/link stream specs are missing, don't + // care about billing for purposes of this test + assert.Equal(t, "0", reportElems["nativeFee"].(*big.Int).String()) + assert.Equal(t, "0", reportElems["linkFee"].(*big.Int).String()) + assert.Equal(t, reportElems["observationsTimestamp"].(uint32)+expirationWindow, reportElems["expiresAt"].(uint32)) + + // Check payload values + payload := report.([]byte)[192:] + switch hex.EncodeToString(feedID[:]) { + case hex.EncodeToString(dexBasedAssetFeedID[:]): + require.Len(t, payload, 96) + args := abi.Arguments([]abi.Argument{ + {Name: "benchmarkPrice", Type: mustNewType("int192")}, + {Name: "baseMarketDepth", Type: mustNewType("int192")}, + {Name: "quoteMarketDepth", Type: mustNewType("int192")}, + }) + v := make(map[string]interface{}) + err := args.UnpackIntoMap(v, payload) + require.NoError(t, err) + + assert.Equal(t, "2976390000000000000000", v["benchmarkPrice"].(*big.Int).String()) + assert.Equal(t, "1000", v["baseMarketDepth"].(*big.Int).String()) + assert.Equal(t, "998", v["quoteMarketDepth"].(*big.Int).String()) + case hex.EncodeToString(rwaFeedID[:]): + require.Len(t, payload, 32) + args := abi.Arguments([]abi.Argument{ + {Name: "marketStatus", Type: mustNewType("uint32")}, + }) + v := make(map[string]interface{}) + err := args.UnpackIntoMap(v, payload) + require.NoError(t, err) + + assert.Equal(t, uint32(1), v["marketStatus"].(uint32)) + case hex.EncodeToString(benchmarkPriceFeedID[:]): + require.Len(t, payload, 32) + args := abi.Arguments([]abi.Argument{ + {Name: "benchmarkPrice", Type: mustNewType("int192")}, + }) + v := make(map[string]interface{}) + err := args.UnpackIntoMap(v, payload) + require.NoError(t, err) + + assert.Equal(t, "2976390000000000000000", v["benchmarkPrice"].(*big.Int).String()) + case hex.EncodeToString(fundingRateFeedID[:]): + require.Len(t, payload, 192) + args := abi.Arguments([]abi.Argument{ + {Name: "binanceFundingRate", Type: mustNewType("int192")}, + {Name: "binanceFundingTime", Type: mustNewType("int192")}, + {Name: "binanceFundingIntervalHours", Type: mustNewType("int192")}, + {Name: "deribitFundingRate", Type: mustNewType("int192")}, + {Name: "deribitFundingTime", Type: mustNewType("int192")}, + {Name: "deribitFundingIntervalHours", Type: mustNewType("int192")}, + }) + v := make(map[string]interface{}) + err := args.UnpackIntoMap(v, payload) + require.NoError(t, err) + + assert.Equal(t, "1234", v["binanceFundingRate"].(*big.Int).String()) + assert.Equal(t, "1630000000", v["binanceFundingTime"].(*big.Int).String()) + assert.Equal(t, "8", v["binanceFundingIntervalHours"].(*big.Int).String()) + assert.Equal(t, "5432", v["deribitFundingRate"].(*big.Int).String()) + assert.Equal(t, "1630000000", v["deribitFundingTime"].(*big.Int).String()) + assert.Equal(t, "8", v["deribitFundingIntervalHours"].(*big.Int).String()) + default: + t.Fatalf("unexpected feedID: %x", feedID) + } + + if len(feedIDs) == 0 { + break + } + } + }) +} + +func TestIntegration_LLO_blue_green_lifecycle(t *testing.T) { + t.Parallel() + + clientCSAKeys := make([]csakey.KeyV2, nNodes) + clientPubKeys := make([]ed25519.PublicKey, nNodes) + + const salt = 300 + + for i := 0; i < nNodes; i++ { + k := big.NewInt(int64(salt + i)) + key := csakey.MustNewV2XXXTestingOnly(k) + clientCSAKeys[i] = key + clientPubKeys[i] = key.PublicKey + } + + steve, backend, configurator, configuratorAddress, _, _, _, _, configStore, configStoreAddress, _, _, _, _ := setupBlockchain(t) + fromBlock := 1 + + // Setup bootstrap + bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 1)) + bootstrapNodePort := freeport.GetOne(t) + appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) + bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} t.Run("Blue/Green lifecycle (using JSON report format)", func(t *testing.T) { reqs := make(chan request, 100000) - serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-2)) + serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 2)) serverPubKey := serverKey.PublicKey srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) @@ -871,3 +1383,11 @@ func newChannelDefinitionsServer(t *testing.T, channelDefinitions llotypes.Chann t.Cleanup(channelDefinitionsServer.Close) return channelDefinitionsServer.URL, channelDefinitionsSHA } + +func mustNewType(t string) abi.Type { + result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) + if err != nil { + panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) + } + return result +} diff --git a/core/services/relay/evm/codec/encoder.go b/core/services/relay/evm/codec/encoder.go index 18ad32831c2..47671520bf5 100644 --- a/core/services/relay/evm/codec/encoder.go +++ b/core/services/relay/evm/codec/encoder.go @@ -21,7 +21,7 @@ func (e *encoder) Encode(_ context.Context, item any, itemType string) (res []by defer func() { if r := recover(); r != nil { res = nil - err = fmt.Errorf("%w: cannot encode type", commontypes.ErrInvalidType) + err = fmt.Errorf("%w: cannot encode type; %v", commontypes.ErrInvalidType, r) } }() info, ok := e.Definitions[itemType] diff --git a/core/services/streams/delegate.go b/core/services/streams/delegate.go index 2f62a7bf1f4..092d1941831 100644 --- a/core/services/streams/delegate.go +++ b/core/services/streams/delegate.go @@ -43,11 +43,7 @@ func (d *Delegate) BeforeJobDeleted(jb job.Job) {} func (d *Delegate) OnDeleteJob(context.Context, job.Job) error { return nil } func (d *Delegate) ServicesForSpec(ctx context.Context, jb job.Job) (services []job.ServiceCtx, err error) { - if jb.StreamID == nil { - return nil, errors.New("streamID is required to be present for stream specs") - } - id := *jb.StreamID - lggr := d.lggr.Named(fmt.Sprintf("%d", id)).With("streamID", id) + lggr := d.lggr.Named(fmt.Sprintf("Job.%d", jb.ID)).With("jobID", jb.ID) rrs := ocrcommon.NewResultRunSaver(d.runner, lggr, d.cfg.MaxSuccessfulRuns(), d.cfg.ResultWriteQueueDepth()) services = append(services, rrs, &StreamService{ diff --git a/core/services/streams/delegate_test.go b/core/services/streams/delegate_test.go index dfd3da8ca07..4d14c31b11b 100644 --- a/core/services/streams/delegate_test.go +++ b/core/services/streams/delegate_test.go @@ -35,9 +35,9 @@ func Test_Delegate(t *testing.T) { t.Run("ServicesForSpec", func(t *testing.T) { jb := job.Job{PipelineSpec: &pipeline.Spec{ID: 1}} - t.Run("errors if job is missing streamID", func(t *testing.T) { + t.Run("no error if job is missing streamID", func(t *testing.T) { _, err := d.ServicesForSpec(testutils.Context(t), jb) - assert.EqualError(t, err, "streamID is required to be present for stream specs") + require.NoError(t, err) }) jb.StreamID = ptr(uint32(42)) t.Run("returns services", func(t *testing.T) { diff --git a/deployment/go.mod b/deployment/go.mod index 9f29826759a..89c11b336ef 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -415,7 +415,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index fbc06ec3c83..933721417a4 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/go.mod b/go.mod index 78f407a76d1..bb9a8f6884f 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 diff --git a/go.sum b/go.sum index b60e28a68de..701ec6ec08c 100644 --- a/go.sum +++ b/go.sum @@ -1158,8 +1158,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 228a5a41f3e..10748184fe4 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -430,7 +430,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 2f24d5e4024..b79a6020857 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1418,8 +1418,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 73a3a4f05da..3d311cbb94f 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -413,7 +413,7 @@ require ( github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index c9bf8730f28..159fe3b94cb 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1407,8 +1407,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3/go.mod h1:AS6zY2BkcRwfiGzNabGbHhfrLSrXrcI/GmjnT4jQ5/s= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= From 8cab05aa80df9ddaa48ba02d802fa18317004f8a Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:35:44 -0800 Subject: [PATCH 51/91] Ccip-4691 : Enable multiple plugin type in SetCandidate, PromoteCandidate Changesets (#15895) * remove deployCCIPContracts * deprecate existing add lane * changes * updates * fix lint * updates * Updates * changes * add ocr param validation * add a test * additional checks * fixes * review comments --- .../scripts/native_solc_compile_all_shared | 1 + .../shared/generated/erc677/erc677.go | 866 ++++++++++++++++++ ...rapper-dependency-versions-do-not-edit.txt | 1 + core/gethwrappers/shared/go_generate.go | 1 + .../changeset/cs_active_candidate_test.go | 40 +- deployment/ccip/changeset/cs_ccip_home.go | 519 +++++++---- .../ccip/changeset/cs_ccip_home_test.go | 151 +-- .../ccip/changeset/cs_update_rmn_config.go | 15 +- .../changeset/cs_update_rmn_config_test.go | 6 +- .../changeset/internal/deploy_home_chain.go | 40 +- deployment/ccip/changeset/state.go | 33 +- deployment/ccip/changeset/test_environment.go | 51 +- deployment/ccip/changeset/test_helpers.go | 4 - deployment/environment/devenv/don.go | 3 +- integration-tests/smoke/ccip/ccip_rmn_test.go | 6 +- 15 files changed, 1431 insertions(+), 306 deletions(-) create mode 100644 core/gethwrappers/shared/generated/erc677/erc677.go diff --git a/contracts/scripts/native_solc_compile_all_shared b/contracts/scripts/native_solc_compile_all_shared index 58f24fdaa22..1b251db7d9b 100755 --- a/contracts/scripts/native_solc_compile_all_shared +++ b/contracts/scripts/native_solc_compile_all_shared @@ -35,6 +35,7 @@ compileContract() { compileContract interfaces/AggregatorV3Interface compileContract interfaces/ITypeAndVersion +compileContract token/ERC677/ERC677 compileContract token/ERC677/BurnMintERC677 compileContract token/ERC677/LinkToken compileContract token/ERC20/BurnMintERC20 diff --git a/core/gethwrappers/shared/generated/erc677/erc677.go b/core/gethwrappers/shared/generated/erc677/erc677.go new file mode 100644 index 00000000000..189687e123d --- /dev/null +++ b/core/gethwrappers/shared/generated/erc677/erc677.go @@ -0,0 +1,866 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package erc677 + +import ( + "errors" + "fmt" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ERC677MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"symbol\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferAndCall\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"success\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b50604051620010ae380380620010ae833981016040819052620000349162000123565b818160036200004483826200021c565b5060046200005382826200021c565b5050505050620002e8565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008657600080fd5b81516001600160401b0380821115620000a357620000a36200005e565b604051601f8301601f19908116603f01168101908282118183101715620000ce57620000ce6200005e565b81604052838152602092508683858801011115620000eb57600080fd5b600091505b838210156200010f5785820183015181830184015290820190620000f0565b600093810190920192909252949350505050565b600080604083850312156200013757600080fd5b82516001600160401b03808211156200014f57600080fd5b6200015d8683870162000074565b935060208501519150808211156200017457600080fd5b50620001838582860162000074565b9150509250929050565b600181811c90821680620001a257607f821691505b602082108103620001c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021757600081815260208120601f850160051c81016020861015620001f25750805b601f850160051c820191505b818110156200021357828155600101620001fe565b5050505b505050565b81516001600160401b038111156200023857620002386200005e565b62000250816200024984546200018d565b84620001c9565b602080601f8311600181146200028857600084156200026f5750858301515b600019600386901b1c1916600185901b17855562000213565b600085815260208120601f198616915b82811015620002b95788860151825594840194600190910190840162000298565b5085821015620002d85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610db680620002f86000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80634000aea011610081578063a457c2d71161005b578063a457c2d7146101b2578063a9059cbb146101c5578063dd62ed3e146101d857600080fd5b80634000aea01461016157806370a082311461017457806395d89b41146101aa57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e161021e565b6040516100ee9190610aae565b60405180910390f35b61010a610105366004610af1565b6102b0565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a366004610b1b565b6102ca565b604051601281526020016100ee565b61010a61015c366004610af1565b6102ee565b61010a61016f366004610b86565b61033a565b61011e610182366004610c6f565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6100e161045e565b61010a6101c0366004610af1565b61046d565b61010a6101d3366004610af1565b610543565b61011e6101e6366004610c8a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b60606003805461022d90610cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461025990610cbd565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b5050505050905090565b6000336102be818585610551565b60019150505b92915050565b6000336102d8858285610704565b6102e38585856107db565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906102be9082908690610335908790610d10565b610551565b60006103468484610543565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1685856040516103a6929190610d4a565b60405180910390a373ffffffffffffffffffffffffffffffffffffffff84163b15610454576040517fa4c0ed3600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063a4c0ed369061042190339087908790600401610d6b565b600060405180830381600087803b15801561043b57600080fd5b505af115801561044f573d6000803e3d6000fd5b505050505b5060019392505050565b60606004805461022d90610cbd565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102e38286868403610551565b6000336102be8185856107db565b73ffffffffffffffffffffffffffffffffffffffff83166105f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161052d565b73ffffffffffffffffffffffffffffffffffffffff8216610696576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161052d565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107d557818110156107c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161052d565b6107d58484848403610551565b50505050565b73ffffffffffffffffffffffffffffffffffffffff831661087e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161052d565b73ffffffffffffffffffffffffffffffffffffffff8216610921576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161052d565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054818110156109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161052d565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36107d5565b6000815180845260005b81811015610a7057602081850181015186830182015201610a54565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610ac16020830184610a4a565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610aec57600080fd5b919050565b60008060408385031215610b0457600080fd5b610b0d83610ac8565b946020939093013593505050565b600080600060608486031215610b3057600080fd5b610b3984610ac8565b9250610b4760208501610ac8565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600060608486031215610b9b57600080fd5b610ba484610ac8565b925060208401359150604084013567ffffffffffffffff80821115610bc857600080fd5b818601915086601f830112610bdc57600080fd5b813581811115610bee57610bee610b57565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610c3457610c34610b57565b81604052828152896020848701011115610c4d57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b600060208284031215610c8157600080fd5b610ac182610ac8565b60008060408385031215610c9d57600080fd5b610ca683610ac8565b9150610cb460208401610ac8565b90509250929050565b600181811c90821680610cd157607f821691505b602082108103610d0a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b808201808211156102c4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b828152604060208201526000610d636040830184610a4a565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000610da06060830184610a4a565b9594505050505056fea164736f6c6343000813000a", +} + +var ERC677ABI = ERC677MetaData.ABI + +var ERC677Bin = ERC677MetaData.Bin + +func DeployERC677(auth *bind.TransactOpts, backend bind.ContractBackend, name string, symbol string) (common.Address, *types.Transaction, *ERC677, error) { + parsed, err := ERC677MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC677Bin), backend, name, symbol) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC677{address: address, abi: *parsed, ERC677Caller: ERC677Caller{contract: contract}, ERC677Transactor: ERC677Transactor{contract: contract}, ERC677Filterer: ERC677Filterer{contract: contract}}, nil +} + +type ERC677 struct { + address common.Address + abi abi.ABI + ERC677Caller + ERC677Transactor + ERC677Filterer +} + +type ERC677Caller struct { + contract *bind.BoundContract +} + +type ERC677Transactor struct { + contract *bind.BoundContract +} + +type ERC677Filterer struct { + contract *bind.BoundContract +} + +type ERC677Session struct { + Contract *ERC677 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ERC677CallerSession struct { + Contract *ERC677Caller + CallOpts bind.CallOpts +} + +type ERC677TransactorSession struct { + Contract *ERC677Transactor + TransactOpts bind.TransactOpts +} + +type ERC677Raw struct { + Contract *ERC677 +} + +type ERC677CallerRaw struct { + Contract *ERC677Caller +} + +type ERC677TransactorRaw struct { + Contract *ERC677Transactor +} + +func NewERC677(address common.Address, backend bind.ContractBackend) (*ERC677, error) { + abi, err := abi.JSON(strings.NewReader(ERC677ABI)) + if err != nil { + return nil, err + } + contract, err := bindERC677(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC677{address: address, abi: abi, ERC677Caller: ERC677Caller{contract: contract}, ERC677Transactor: ERC677Transactor{contract: contract}, ERC677Filterer: ERC677Filterer{contract: contract}}, nil +} + +func NewERC677Caller(address common.Address, caller bind.ContractCaller) (*ERC677Caller, error) { + contract, err := bindERC677(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC677Caller{contract: contract}, nil +} + +func NewERC677Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC677Transactor, error) { + contract, err := bindERC677(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC677Transactor{contract: contract}, nil +} + +func NewERC677Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC677Filterer, error) { + contract, err := bindERC677(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC677Filterer{contract: contract}, nil +} + +func bindERC677(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ERC677MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ERC677 *ERC677Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC677.Contract.ERC677Caller.contract.Call(opts, result, method, params...) +} + +func (_ERC677 *ERC677Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC677.Contract.ERC677Transactor.contract.Transfer(opts) +} + +func (_ERC677 *ERC677Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC677.Contract.ERC677Transactor.contract.Transact(opts, method, params...) +} + +func (_ERC677 *ERC677CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC677.Contract.contract.Call(opts, result, method, params...) +} + +func (_ERC677 *ERC677TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC677.Contract.contract.Transfer(opts) +} + +func (_ERC677 *ERC677TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC677.Contract.contract.Transact(opts, method, params...) +} + +func (_ERC677 *ERC677Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC677.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ERC677 *ERC677Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC677.Contract.Allowance(&_ERC677.CallOpts, owner, spender) +} + +func (_ERC677 *ERC677CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC677.Contract.Allowance(&_ERC677.CallOpts, owner, spender) +} + +func (_ERC677 *ERC677Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC677.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ERC677 *ERC677Session) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC677.Contract.BalanceOf(&_ERC677.CallOpts, account) +} + +func (_ERC677 *ERC677CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC677.Contract.BalanceOf(&_ERC677.CallOpts, account) +} + +func (_ERC677 *ERC677Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _ERC677.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_ERC677 *ERC677Session) Decimals() (uint8, error) { + return _ERC677.Contract.Decimals(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677CallerSession) Decimals() (uint8, error) { + return _ERC677.Contract.Decimals(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC677.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_ERC677 *ERC677Session) Name() (string, error) { + return _ERC677.Contract.Name(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677CallerSession) Name() (string, error) { + return _ERC677.Contract.Name(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC677.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_ERC677 *ERC677Session) Symbol() (string, error) { + return _ERC677.Contract.Symbol(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677CallerSession) Symbol() (string, error) { + return _ERC677.Contract.Symbol(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC677.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ERC677 *ERC677Session) TotalSupply() (*big.Int, error) { + return _ERC677.Contract.TotalSupply(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677CallerSession) TotalSupply() (*big.Int, error) { + return _ERC677.Contract.TotalSupply(&_ERC677.CallOpts) +} + +func (_ERC677 *ERC677Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.contract.Transact(opts, "approve", spender, amount) +} + +func (_ERC677 *ERC677Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.Approve(&_ERC677.TransactOpts, spender, amount) +} + +func (_ERC677 *ERC677TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.Approve(&_ERC677.TransactOpts, spender, amount) +} + +func (_ERC677 *ERC677Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC677.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +func (_ERC677 *ERC677Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.DecreaseAllowance(&_ERC677.TransactOpts, spender, subtractedValue) +} + +func (_ERC677 *ERC677TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.DecreaseAllowance(&_ERC677.TransactOpts, spender, subtractedValue) +} + +func (_ERC677 *ERC677Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC677.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +func (_ERC677 *ERC677Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.IncreaseAllowance(&_ERC677.TransactOpts, spender, addedValue) +} + +func (_ERC677 *ERC677TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.IncreaseAllowance(&_ERC677.TransactOpts, spender, addedValue) +} + +func (_ERC677 *ERC677Transactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.contract.Transact(opts, "transfer", to, amount) +} + +func (_ERC677 *ERC677Session) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.Transfer(&_ERC677.TransactOpts, to, amount) +} + +func (_ERC677 *ERC677TransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.Transfer(&_ERC677.TransactOpts, to, amount) +} + +func (_ERC677 *ERC677Transactor) TransferAndCall(opts *bind.TransactOpts, to common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _ERC677.contract.Transact(opts, "transferAndCall", to, amount, data) +} + +func (_ERC677 *ERC677Session) TransferAndCall(to common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _ERC677.Contract.TransferAndCall(&_ERC677.TransactOpts, to, amount, data) +} + +func (_ERC677 *ERC677TransactorSession) TransferAndCall(to common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _ERC677.Contract.TransferAndCall(&_ERC677.TransactOpts, to, amount, data) +} + +func (_ERC677 *ERC677Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.contract.Transact(opts, "transferFrom", from, to, amount) +} + +func (_ERC677 *ERC677Session) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.TransferFrom(&_ERC677.TransactOpts, from, to, amount) +} + +func (_ERC677 *ERC677TransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC677.Contract.TransferFrom(&_ERC677.TransactOpts, from, to, amount) +} + +type ERC677ApprovalIterator struct { + Event *ERC677Approval + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ERC677ApprovalIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC677Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(ERC677Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *ERC677ApprovalIterator) Error() error { + return it.fail +} + +func (it *ERC677ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ERC677Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log +} + +func (_ERC677 *ERC677Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC677ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC677.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC677ApprovalIterator{contract: _ERC677.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +func (_ERC677 *ERC677Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC677Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC677.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ERC677Approval) + if err := _ERC677.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_ERC677 *ERC677Filterer) ParseApproval(log types.Log) (*ERC677Approval, error) { + event := new(ERC677Approval) + if err := _ERC677.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ERC677TransferIterator struct { + Event *ERC677Transfer + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ERC677TransferIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC677Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(ERC677Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *ERC677TransferIterator) Error() error { + return it.fail +} + +func (it *ERC677TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ERC677Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log +} + +func (_ERC677 *ERC677Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC677TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC677.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC677TransferIterator{contract: _ERC677.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +func (_ERC677 *ERC677Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC677Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC677.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ERC677Transfer) + if err := _ERC677.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_ERC677 *ERC677Filterer) ParseTransfer(log types.Log) (*ERC677Transfer, error) { + event := new(ERC677Transfer) + if err := _ERC677.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ERC677Transfer0Iterator struct { + Event *ERC677Transfer0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ERC677Transfer0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC677Transfer0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(ERC677Transfer0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *ERC677Transfer0Iterator) Error() error { + return it.fail +} + +func (it *ERC677Transfer0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ERC677Transfer0 struct { + From common.Address + To common.Address + Value *big.Int + Data []byte + Raw types.Log +} + +func (_ERC677 *ERC677Filterer) FilterTransfer0(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC677Transfer0Iterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC677.contract.FilterLogs(opts, "Transfer0", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC677Transfer0Iterator{contract: _ERC677.contract, event: "Transfer0", logs: logs, sub: sub}, nil +} + +func (_ERC677 *ERC677Filterer) WatchTransfer0(opts *bind.WatchOpts, sink chan<- *ERC677Transfer0, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC677.contract.WatchLogs(opts, "Transfer0", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ERC677Transfer0) + if err := _ERC677.contract.UnpackLog(event, "Transfer0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_ERC677 *ERC677Filterer) ParseTransfer0(log types.Log) (*ERC677Transfer0, error) { + event := new(ERC677Transfer0) + if err := _ERC677.contract.UnpackLog(event, "Transfer0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_ERC677 *ERC677) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ERC677.abi.Events["Approval"].ID: + return _ERC677.ParseApproval(log) + case _ERC677.abi.Events["Transfer"].ID: + return _ERC677.ParseTransfer(log) + case _ERC677.abi.Events["Transfer0"].ID: + return _ERC677.ParseTransfer0(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ERC677Approval) Topic() common.Hash { + return common.HexToHash("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") +} + +func (ERC677Transfer) Topic() common.Hash { + return common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") +} + +func (ERC677Transfer0) Topic() common.Hash { + return common.HexToHash("0xe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16") +} + +func (_ERC677 *ERC677) Address() common.Address { + return _ERC677.address +} + +type ERC677Interface interface { + Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) + + BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) + + Decimals(opts *bind.CallOpts) (uint8, error) + + Name(opts *bind.CallOpts) (string, error) + + Symbol(opts *bind.CallOpts) (string, error) + + TotalSupply(opts *bind.CallOpts) (*big.Int, error) + + Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) + + DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) + + IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) + + Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) + + TransferAndCall(opts *bind.TransactOpts, to common.Address, amount *big.Int, data []byte) (*types.Transaction, error) + + TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) + + FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC677ApprovalIterator, error) + + WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC677Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) + + ParseApproval(log types.Log) (*ERC677Approval, error) + + FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC677TransferIterator, error) + + WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC677Transfer, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseTransfer(log types.Log) (*ERC677Transfer, error) + + FilterTransfer0(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC677Transfer0Iterator, error) + + WatchTransfer0(opts *bind.WatchOpts, sink chan<- *ERC677Transfer0, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseTransfer0(log types.Log) (*ERC677Transfer0, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 9b7ba5f8832..0e49e7b25e7 100644 --- a/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -4,6 +4,7 @@ burn_mint_erc20: ../../../contracts/solc/shared/BurnMintERC20/BurnMintERC20.sol/ burn_mint_erc677: ../../../contracts/solc/shared/BurnMintERC677/BurnMintERC677.sol/BurnMintERC677.abi.json ../../../contracts/solc/shared/BurnMintERC677/BurnMintERC677.sol/BurnMintERC677.bin c510542f105686f93e6287a66a6466c10cd576781063fc787ef365b4a47f5cb8 chain_reader_tester: ../../../contracts/solc/shared/ChainReaderTester/ChainReaderTester.sol/ChainReaderTester.abi.json ../../../contracts/solc/shared/ChainReaderTester/ChainReaderTester.sol/ChainReaderTester.bin 876c55e8d2556dc9cc953c786ae72b0430cb2c992f84573a2aae9680068f293d erc20: ../../../contracts/solc/vendor/ERC20/ERC20.sol/ERC20.abi.json ../../../contracts/solc/vendor/ERC20/ERC20.sol/ERC20.bin 9a5e3f7ec9fea385eeba374d184d6b83784304f537a90f6b81827c732d0b37c4 +erc677: ../../../contracts/solc/shared/ERC677/ERC677.sol/ERC677.abi.json ../../../contracts/solc/shared/ERC677/ERC677.sol/ERC677.bin 0fba0204e8f677754b5dc4747c35d575abb20f33a2c15a3ca3650f314c8c5b6c link_token: ../../../contracts/solc/shared/LinkToken/LinkToken.sol/LinkToken.abi.json ../../../contracts/solc/shared/LinkToken/LinkToken.sol/LinkToken.bin 9d1c648233822b70b03bf4fdb1af4cffaead8f1391dd149a79b3072defbd0c62 log_emitter: ../../../contracts/solc/shared/LogEmitter/LogEmitter.sol/LogEmitter.abi.json ../../../contracts/solc/shared/LogEmitter/LogEmitter.sol/LogEmitter.bin f884ed34204f82dcd1ea8f20db1b24d410bf23ab2687d56968d2c670e98277dd mock_v3_aggregator_contract: ../../../contracts/solc/shared/MockV3Aggregator/MockV3Aggregator.sol/MockV3Aggregator.abi.json ../../../contracts/solc/shared/MockV3Aggregator/MockV3Aggregator.sol/MockV3Aggregator.bin 76796e0faffb2981d49082d94f2f2c9ec87d8ad960b022993d0681f9c81a832d diff --git a/core/gethwrappers/shared/go_generate.go b/core/gethwrappers/shared/go_generate.go index 0881e1b31e3..30ca631178d 100644 --- a/core/gethwrappers/shared/go_generate.go +++ b/core/gethwrappers/shared/go_generate.go @@ -3,6 +3,7 @@ package gethwrappers //go:generate go run ../generation/wrap.go shared BurnMintERC677 burn_mint_erc677 +//go:generate go run ../generation/wrap.go shared ERC677 erc677 //go:generate go run ../generation/wrap.go shared LinkToken link_token //go:generate go run ../generation/wrap.go shared BurnMintERC20 burn_mint_erc20 //go:generate go run ../generation/wrap.go shared WERC20Mock werc20_mock diff --git a/deployment/ccip/changeset/cs_active_candidate_test.go b/deployment/ccip/changeset/cs_active_candidate_test.go index 6016b06884b..7c50fbc77d0 100644 --- a/deployment/ccip/changeset/cs_active_candidate_test.go +++ b/deployment/ccip/changeset/cs_active_candidate_test.go @@ -196,38 +196,24 @@ func Test_ActiveCandidate(t *testing.T) { SetCandidateConfigBase: SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, - // NOTE: this is technically not a new chain, but needed for validation. - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams( - tenv.FeedChainSel, - tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), - nil, - ), - }, - PluginType: types.PluginTypeCCIPCommit, MCMS: &MCMSConfig{ MinDelay: 0, }, }, - }, - }, - { - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ - HomeChainSelector: tenv.HomeChainSel, - FeedChainSelector: tenv.FeedChainSel, - // NOTE: this is technically not a new chain, but needed for validation. - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams( - tenv.FeedChainSel, - tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), - nil, - ), + PluginInfo: []SetCandidatePluginInfo{ + { + // NOTE: this is technically not a new chain, but needed for validation. + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, false), + }, + PluginType: types.PluginTypeCCIPCommit, }, - PluginType: types.PluginTypeCCIPExec, - MCMS: &MCMSConfig{ - MinDelay: 0, + { + // NOTE: this is technically not a new chain, but needed for validation. + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, false, true), + }, + PluginType: types.PluginTypeCCIPExec, }, }, }, diff --git a/deployment/ccip/changeset/cs_ccip_home.go b/deployment/ccip/changeset/cs_ccip_home.go index 7d3327a31f2..12f488d1cfd 100644 --- a/deployment/ccip/changeset/cs_ccip_home.go +++ b/deployment/ccip/changeset/cs_ccip_home.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-ccip/chainconfig" "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" @@ -35,29 +36,137 @@ import ( var ( _ deployment.ChangeSet[AddDonAndSetCandidateChangesetConfig] = AddDonAndSetCandidateChangeset - _ deployment.ChangeSet[PromoteCandidatesChangesetConfig] = PromoteAllCandidatesChangeset + _ deployment.ChangeSet[PromoteCandidateChangesetConfig] = PromoteCandidateChangeset _ deployment.ChangeSet[SetCandidateChangesetConfig] = SetCandidateChangeset _ deployment.ChangeSet[RevokeCandidateChangesetConfig] = RevokeCandidateChangeset _ deployment.ChangeSet[UpdateChainConfigConfig] = UpdateChainConfig ) +type tokenInfo interface { + Address() common.Address + Symbol(opts *bind.CallOpts) (string, error) + Decimals(opts *bind.CallOpts) (uint8, error) +} + +func findTokenInfo(tokens []tokenInfo, address common.Address) (string, uint8, error) { + for _, token := range tokens { + if token.Address() == address { + tokenSymbol, err := token.Symbol(nil) + if err != nil { + return "", 0, fmt.Errorf("fetch token symbol for token %s: %w", address, err) + } + tokenDecimals, err := token.Decimals(nil) + if err != nil { + return "", 0, fmt.Errorf("fetch token decimals for token %s: %w", address, err) + } + return tokenSymbol, tokenDecimals, nil + } + } + return "", 0, fmt.Errorf("token %s not found in available tokens", address) +} + +func validateCommitOffchainConfig(c *pluginconfig.CommitOffchainConfig, selector uint64, feedChainSel uint64, state CCIPOnChainState) error { + if err := c.Validate(); err != nil { + return fmt.Errorf("invalid commit off-chain config: %w", err) + } + for tokenAddr, tokenConfig := range c.TokenInfo { + tokenUnknownAddr, err := ccipocr3.NewUnknownAddressFromHex(string(tokenAddr)) + if err != nil { + return fmt.Errorf("invalid token address %s: %w", tokenAddr, err) + } + + aggregatorAddr := common.HexToAddress(string(tokenConfig.AggregatorAddress)) + token := common.HexToAddress(tokenUnknownAddr.String()) + tokenInfos := make([]tokenInfo, 0) + onchainState := state.Chains[selector] + for _, tk := range onchainState.BurnMintTokens677 { + tokenInfos = append(tokenInfos, tk) + } + for _, tk := range onchainState.ERC20Tokens { + tokenInfos = append(tokenInfos, tk) + } + for _, tk := range onchainState.ERC677Tokens { + tokenInfos = append(tokenInfos, tk) + } + tokenInfos = append(tokenInfos, onchainState.LinkToken) + tokenInfos = append(tokenInfos, onchainState.Weth9) + symbol, decimal, err := findTokenInfo(tokenInfos, token) + if err != nil { + return err + } + if decimal != tokenConfig.Decimals { + return fmt.Errorf("token %s -address %s has %d decimals in provided token config, expected %d", + symbol, token.String(), tokenConfig.Decimals, decimal) + } + feedChainState := state.Chains[feedChainSel] + aggregatorInState := feedChainState.USDFeeds[TokenSymbol(symbol)] + if aggregatorAddr == (common.Address{}) { + return fmt.Errorf("token %s -address %s has no aggregator in provided token config", symbol, token.String()) + } + if aggregatorInState == nil { + return fmt.Errorf("token %s -address %s has no aggregator in state,"+ + " but the aggregator %s is provided in token config", symbol, token.String(), aggregatorAddr.String()) + } + if aggregatorAddr != aggregatorInState.Address() { + return fmt.Errorf("token %s -address %s has aggregator %s in provided token config, expected %s", + symbol, token.String(), aggregatorAddr.String(), aggregatorInState.Address().String()) + } + } + return nil +} + +func validateUSDCConfig(usdcConfig *pluginconfig.USDCCCTPObserverConfig, state CCIPOnChainState) error { + for sel, token := range usdcConfig.Tokens { + onchainState, ok := state.Chains[uint64(sel)] + if !ok { + return fmt.Errorf("chain %d does not exist in state but provided in USDCCCTPObserverConfig", sel) + } + if onchainState.USDCTokenPool == nil { + return fmt.Errorf("chain %d does not have USDC token pool deployed", sel) + } + if common.HexToAddress(token.SourcePoolAddress) != onchainState.USDCTokenPool.Address() { + return fmt.Errorf("chain %d has USDC token pool deployed at %s, "+ + "but SourcePoolAddress %s is provided in USDCCCTPObserverConfig", + sel, onchainState.USDCTokenPool.Address().String(), token.SourcePoolAddress) + } + } + return nil +} + type CCIPOCRParams struct { OCRParameters commontypes.OCRParameters // Note contains pointers to Arb feeds for prices - CommitOffChainConfig pluginconfig.CommitOffchainConfig - // Note ontains USDC config - ExecuteOffChainConfig pluginconfig.ExecuteOffchainConfig + CommitOffChainConfig *pluginconfig.CommitOffchainConfig + // Note contains USDC config + ExecuteOffChainConfig *pluginconfig.ExecuteOffchainConfig } -func (c CCIPOCRParams) Validate() error { +func (c CCIPOCRParams) Validate(selector uint64, feedChainSel uint64, state CCIPOnChainState) error { if err := c.OCRParameters.Validate(); err != nil { return fmt.Errorf("invalid OCR parameters: %w", err) } - if err := c.CommitOffChainConfig.Validate(); err != nil { - return fmt.Errorf("invalid commit off-chain config: %w", err) + if c.CommitOffChainConfig == nil && c.ExecuteOffChainConfig == nil { + return errors.New("at least one of CommitOffChainConfig or ExecuteOffChainConfig must be set") + } + if c.CommitOffChainConfig != nil { + if err := validateCommitOffchainConfig(c.CommitOffChainConfig, selector, feedChainSel, state); err != nil { + return fmt.Errorf("invalid commit off-chain config: %w", err) + } } - if err := c.ExecuteOffChainConfig.Validate(); err != nil { - return fmt.Errorf("invalid execute off-chain config: %w", err) + if c.ExecuteOffChainConfig != nil { + if err := c.ExecuteOffChainConfig.Validate(); err != nil { + return fmt.Errorf("invalid execute off-chain config: %w", err) + } + for _, observerConfig := range c.ExecuteOffChainConfig.TokenDataObservers { + switch observerConfig.Type { + case pluginconfig.USDCCCTPHandlerType: + if err := validateUSDCConfig(observerConfig.USDCCCTPObserverConfig, state); err != nil { + return fmt.Errorf("invalid USDC config: %w", err) + } + default: + return fmt.Errorf("unknown token observer config type: %s", observerConfig.Type) + } + } } return nil } @@ -68,8 +177,10 @@ func DefaultOCRParams( feedChainSel uint64, tokenInfo map[ccipocr3.UnknownEncodedAddress]pluginconfig.TokenInfo, tokenDataObservers []pluginconfig.TokenDataObserverConfig, + commit bool, + exec bool, ) CCIPOCRParams { - return CCIPOCRParams{ + params := CCIPOCRParams{ OCRParameters: commontypes.OCRParameters{ DeltaProgress: internal.DeltaProgress, DeltaResend: internal.DeltaResend, @@ -84,7 +195,9 @@ func DefaultOCRParams( MaxDurationShouldAcceptAttestedReport: internal.MaxDurationShouldAcceptAttestedReport, MaxDurationShouldTransmitAcceptedReport: internal.MaxDurationShouldTransmitAcceptedReport, }, - ExecuteOffChainConfig: pluginconfig.ExecuteOffchainConfig{ + } + if exec { + params.ExecuteOffChainConfig = &pluginconfig.ExecuteOffchainConfig{ BatchGasLimit: internal.BatchGasLimit, RelativeBoostPerWaitHour: internal.RelativeBoostPerWaitHour, InflightCacheExpiry: *config.MustNewDuration(internal.InflightCacheExpiry), @@ -92,8 +205,10 @@ func DefaultOCRParams( MessageVisibilityInterval: *config.MustNewDuration(internal.FirstBlockAge), BatchingStrategyID: internal.BatchingStrategyID, TokenDataObservers: tokenDataObservers, - }, - CommitOffChainConfig: pluginconfig.CommitOffchainConfig{ + } + } + if commit { + params.CommitOffChainConfig = &pluginconfig.CommitOffchainConfig{ RemoteGasPriceBatchWriteFrequency: *config.MustNewDuration(internal.RemoteGasPriceBatchWriteFrequency), TokenPriceBatchWriteFrequency: *config.MustNewDuration(internal.TokenPriceBatchWriteFrequency), TokenInfo: tokenInfo, @@ -104,25 +219,29 @@ func DefaultOCRParams( RMNSignaturesTimeout: 30 * time.Minute, MaxMerkleTreeSize: merklemulti.MaxNumberTreeLeaves, SignObservationPrefix: "chainlink ccip 1.6 rmn observation", - }, + } } + return params } -type PromoteCandidatesChangesetConfig struct { - HomeChainSelector uint64 - +type PromoteCandidatePluginInfo struct { // RemoteChainSelectors is the chain selector of the DONs that we want to promote the candidate config of. // Note that each (chain, ccip capability version) pair has a unique DON ID. RemoteChainSelectors []uint64 + PluginType types.PluginType +} + +type PromoteCandidateChangesetConfig struct { + HomeChainSelector uint64 - PluginType types.PluginType + PluginInfo []PromoteCandidatePluginInfo // MCMS is optional MCMS configuration, if provided the changeset will generate an MCMS proposal. // If nil, the changeset will execute the commands directly using the deployer key // of the provided environment. MCMS *MCMSConfig } -func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([]uint32, error) { +func (p PromoteCandidateChangesetConfig) Validate(e deployment.Environment) (map[uint64]uint32, error) { state, err := LoadOnchainState(e) if err != nil { return nil, err @@ -138,49 +257,50 @@ func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([] return nil, err } - if p.PluginType != types.PluginTypeCCIPCommit && - p.PluginType != types.PluginTypeCCIPExec { - return nil, errors.New("PluginType must be set to either CCIPCommit or CCIPExec") - } - - var donIDs []uint32 - for _, chainSelector := range p.RemoteChainSelectors { - if err := deployment.IsValidChainSelector(chainSelector); err != nil { - return nil, fmt.Errorf("don chain selector invalid: %w", err) - } - chainState, exists := state.Chains[chainSelector] - if !exists { - return nil, fmt.Errorf("chain %d does not exist", chainSelector) - } - if chainState.OffRamp == nil { - // should not be possible, but a defensive check. - return nil, errors.New("OffRamp contract does not exist") - } - - donID, err := internal.DonIDForChain( - state.Chains[p.HomeChainSelector].CapabilityRegistry, - state.Chains[p.HomeChainSelector].CCIPHome, - chainSelector, - ) - if err != nil { - return nil, fmt.Errorf("fetch don id for chain: %w", err) + donIDs := make(map[uint64]uint32) + for _, plugin := range p.PluginInfo { + if plugin.PluginType != types.PluginTypeCCIPCommit && + plugin.PluginType != types.PluginTypeCCIPExec { + return nil, errors.New("PluginType must be set to either CCIPCommit or CCIPExec") } - if donID == 0 { - return nil, fmt.Errorf("don doesn't exist in CR for chain %d", chainSelector) - } - // Check that candidate digest and active digest are not both zero - this is enforced onchain. - pluginConfigs, err := state.Chains[p.HomeChainSelector].CCIPHome.GetAllConfigs(&bind.CallOpts{ - Context: e.GetContext(), - }, donID, uint8(p.PluginType)) - if err != nil { - return nil, fmt.Errorf("fetching %s configs from cciphome: %w", p.PluginType.String(), err) - } - - if pluginConfigs.ActiveConfig.ConfigDigest == [32]byte{} && - pluginConfigs.CandidateConfig.ConfigDigest == [32]byte{} { - return nil, fmt.Errorf("%s active and candidate config digests are both zero", p.PluginType.String()) + for _, chainSelector := range plugin.RemoteChainSelectors { + if err := deployment.IsValidChainSelector(chainSelector); err != nil { + return nil, fmt.Errorf("don chain selector invalid: %w", err) + } + chainState, exists := state.Chains[chainSelector] + if !exists { + return nil, fmt.Errorf("chain %d does not exist", chainSelector) + } + if chainState.OffRamp == nil { + // should not be possible, but a defensive check. + return nil, errors.New("OffRamp contract does not exist") + } + + donID, err := internal.DonIDForChain( + state.Chains[p.HomeChainSelector].CapabilityRegistry, + state.Chains[p.HomeChainSelector].CCIPHome, + chainSelector, + ) + if err != nil { + return nil, fmt.Errorf("fetch don id for chain: %w", err) + } + if donID == 0 { + return nil, fmt.Errorf("don doesn't exist in CR for chain %d", chainSelector) + } + // Check that candidate digest and active digest are not both zero - this is enforced onchain. + pluginConfigs, err := state.Chains[p.HomeChainSelector].CCIPHome.GetAllConfigs(&bind.CallOpts{ + Context: e.GetContext(), + }, donID, uint8(plugin.PluginType)) + if err != nil { + return nil, fmt.Errorf("fetching %s configs from cciphome: %w", plugin.PluginType.String(), err) + } + + if pluginConfigs.ActiveConfig.ConfigDigest == [32]byte{} && + pluginConfigs.CandidateConfig.ConfigDigest == [32]byte{} { + return nil, fmt.Errorf("%s active and candidate config digests are both zero", plugin.PluginType.String()) + } + donIDs[chainSelector] = donID } - donIDs = append(donIDs, donID) } if len(e.NodeIDs) == 0 { return nil, errors.New("NodeIDs must be set") @@ -195,14 +315,16 @@ func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([] return donIDs, nil } -// PromoteAllCandidatesChangeset generates a proposal to call promoteCandidate on the CCIPHome through CapReg. +// PromoteCandidateChangeset generates a proposal to call promoteCandidate on the CCIPHome through CapReg. // Note that a DON must exist prior to being able to use this changeset effectively, // i.e AddDonAndSetCandidateChangeset must be called first. // This can also be used to promote a 0x0 candidate config to be the active, effectively shutting down the DON. // At that point you can call the RemoveDON changeset to remove the DON entirely from the capability registry. -func PromoteAllCandidatesChangeset( +// PromoteCandidateChangeset is NOT idempotent, once candidate config is promoted to active, if it's called again, +// It might promote empty candidate config to active, which is not desired. +func PromoteCandidateChangeset( e deployment.Environment, - cfg PromoteCandidatesChangesetConfig, + cfg PromoteCandidateChangesetConfig, ) (deployment.ChangesetOutput, error) { donIDs, err := cfg.Validate(e) if err != nil { @@ -226,21 +348,23 @@ func PromoteAllCandidatesChangeset( homeChain := e.Chains[cfg.HomeChainSelector] var ops []mcms.Operation - for _, donID := range donIDs { - promoteCandidateOps, err := promoteAllCandidatesForChainOps( - txOpts, - homeChain, - state.Chains[cfg.HomeChainSelector].CapabilityRegistry, - state.Chains[cfg.HomeChainSelector].CCIPHome, - nodes.NonBootstraps(), - donID, - cfg.PluginType, - cfg.MCMS != nil, - ) - if err != nil { - return deployment.ChangesetOutput{}, fmt.Errorf("generating promote candidate ops: %w", err) + for _, plugin := range cfg.PluginInfo { + for _, donID := range donIDs { + promoteCandidateOps, err := promoteCandidateForChainOps( + txOpts, + homeChain, + state.Chains[cfg.HomeChainSelector].CapabilityRegistry, + state.Chains[cfg.HomeChainSelector].CCIPHome, + nodes.NonBootstraps(), + donID, + plugin.PluginType, + cfg.MCMS != nil, + ) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("generating promote candidate ops: %w", err) + } + ops = append(ops, promoteCandidateOps) } - ops = append(ops, promoteCandidateOps) } // Disabled MCMS means that we already executed the txes, so just return early w/out the proposals. @@ -259,7 +383,7 @@ func PromoteAllCandidatesChangeset( ChainIdentifier: mcms.ChainIdentifier(cfg.HomeChainSelector), Batch: ops, }}, - "promoteCandidate for commit and execution", + "promoteCandidate", cfg.MCMS.MinDelay, ) if err != nil { @@ -272,6 +396,60 @@ func PromoteAllCandidatesChangeset( }, nil } +type SetCandidatePluginInfo struct { + // OCRConfigPerRemoteChainSelector is the chain selector of the chain where the DON will be added. + OCRConfigPerRemoteChainSelector map[uint64]CCIPOCRParams + PluginType types.PluginType +} + +func (p SetCandidatePluginInfo) String() string { + allchains := maps.Keys(p.OCRConfigPerRemoteChainSelector) + return fmt.Sprintf("PluginType: %s, Chains: %v", p.PluginType.String(), allchains) +} + +func (p SetCandidatePluginInfo) Validate(state CCIPOnChainState, homeChain uint64, feedChain uint64) error { + if p.PluginType != types.PluginTypeCCIPCommit && + p.PluginType != types.PluginTypeCCIPExec { + return errors.New("PluginType must be set to either CCIPCommit or CCIPExec") + } + for chainSelector, params := range p.OCRConfigPerRemoteChainSelector { + _, ok := state.Chains[chainSelector] + if !ok { + return fmt.Errorf("chain %d does not exist in state", chainSelector) + } + if err := deployment.IsValidChainSelector(chainSelector); err != nil { + return fmt.Errorf("don chain selector invalid: %w", err) + } + if state.Chains[chainSelector].OffRamp == nil { + // should not be possible, but a defensive check. + return fmt.Errorf("OffRamp contract does not exist on don chain selector %d", chainSelector) + } + if p.PluginType == types.PluginTypeCCIPCommit && params.CommitOffChainConfig == nil { + return errors.New("commit off-chain config must be set") + } + if p.PluginType == types.PluginTypeCCIPExec && params.ExecuteOffChainConfig == nil { + return errors.New("execute off-chain config must be set") + } + + chainConfig, err := state.Chains[homeChain].CCIPHome.GetChainConfig(nil, chainSelector) + if err != nil { + return fmt.Errorf("get all chain configs: %w", err) + } + // FChain should never be zero if a chain config is set in CCIPHome + if chainConfig.FChain == 0 { + return fmt.Errorf("chain config not set up for new chain %d", chainSelector) + } + if len(chainConfig.Readers) == 0 { + return errors.New("readers must be set") + } + err = params.Validate(chainSelector, feedChain, state) + if err != nil { + return fmt.Errorf("invalid ccip ocr params: %w", err) + } + } + return nil +} + // SetCandidateConfigBase is a common base config struct for AddDonAndSetCandidateChangesetConfig and SetCandidateChangesetConfig. // This is extracted to deduplicate most of the validation logic. // Remaining validation logic is done in the specific config structs that inherit from this. @@ -279,13 +457,6 @@ type SetCandidateConfigBase struct { HomeChainSelector uint64 FeedChainSelector uint64 - // OCRConfigPerRemoteChainSelector is the chain selector of the chain where the DON will be added. - OCRConfigPerRemoteChainSelector map[uint64]CCIPOCRParams - - // Only set one plugin at a time. TODO - // come back and allow both. - PluginType types.PluginType - // MCMS is optional MCMS configuration, if provided the changeset will generate an MCMS proposal. // If nil, the changeset will execute the commands directly using the deployer key // of the provided environment. @@ -307,39 +478,6 @@ func (s SetCandidateConfigBase) Validate(e deployment.Environment, state CCIPOnC return err } - for chainSelector, params := range s.OCRConfigPerRemoteChainSelector { - if err := deployment.IsValidChainSelector(chainSelector); err != nil { - return fmt.Errorf("don chain selector invalid: %w", err) - } - if state.Chains[chainSelector].OffRamp == nil { - // should not be possible, but a defensive check. - return fmt.Errorf("OffRamp contract does not exist on don chain selector %d", chainSelector) - } - if s.PluginType != types.PluginTypeCCIPCommit && - s.PluginType != types.PluginTypeCCIPExec { - return errors.New("PluginType must be set to either CCIPCommit or CCIPExec") - } - - // no donID check since this config is used for both adding a new DON and updating an existing one. - // see AddDonAndSetCandidateChangesetConfig.Validate and SetCandidateChangesetConfig.Validate - // for these checks. - // check that chain config is set up for the new chain - chainConfig, err := state.Chains[s.HomeChainSelector].CCIPHome.GetChainConfig(nil, chainSelector) - if err != nil { - return fmt.Errorf("get all chain configs: %w", err) - } - // FChain should never be zero if a chain config is set in CCIPHome - if chainConfig.FChain == 0 { - return fmt.Errorf("chain config not set up for new chain %d", chainSelector) - } - err = params.Validate() - if err != nil { - return fmt.Errorf("invalid ccip ocr params: %w", err) - } - - // TODO: validate token config in the commit config, if commit is the plugin. - // TODO: validate gas config in the chain config in cciphome for this RemoteChainSelectors. - } if len(e.NodeIDs) == 0 { return errors.New("nodeIDs must be set") } @@ -362,15 +500,21 @@ func (s SetCandidateConfigBase) Validate(e deployment.Environment, state CCIPOnC // In particular, we check to make sure we don't already have a DON for the chain. type AddDonAndSetCandidateChangesetConfig struct { SetCandidateConfigBase + + // Only set one plugin at a time while you are adding the DON for the first time. + // For subsequent SetCandidate call use SetCandidateChangeset as that fetches the already added DONID and sets the candidate. + PluginInfo SetCandidatePluginInfo } func (a AddDonAndSetCandidateChangesetConfig) Validate(e deployment.Environment, state CCIPOnChainState) error { - err := a.SetCandidateConfigBase.Validate(e, state) - if err != nil { + if err := a.SetCandidateConfigBase.Validate(e, state); err != nil { return err } - for chainSelector := range a.OCRConfigPerRemoteChainSelector { + if err := a.PluginInfo.Validate(state, a.HomeChainSelector, a.FeedChainSelector); err != nil { + return fmt.Errorf("validate plugin info %s: %w", a.PluginInfo.String(), err) + } + for chainSelector := range a.PluginInfo.OCRConfigPerRemoteChainSelector { // check if a DON already exists for this chain donID, err := internal.DonIDForChain( state.Chains[a.HomeChainSelector].CapabilityRegistry, @@ -380,6 +524,7 @@ func (a AddDonAndSetCandidateChangesetConfig) Validate(e deployment.Environment, if err != nil { return fmt.Errorf("fetch don id for chain: %w", err) } + // if don already exists use SetCandidateChangeset instead if donID != 0 { return fmt.Errorf("don already exists in CR for chain %d, it has id %d", chainSelector, donID) } @@ -392,12 +537,14 @@ func (a AddDonAndSetCandidateChangesetConfig) Validate(e deployment.Environment, // and sets the plugin config as candidateConfig for the don. // // This is the first step to creating a CCIP DON and must be executed before any -// other changesets (SetCandidateChangeset, PromoteAllCandidatesChangeset) +// other changesets (SetCandidateChangeset, PromoteCandidateChangeset) // can be executed. // // Note that these operations must be done together because the createDON call // in the capability registry calls the capability config contract, so we must // provide suitable calldata for CCIPHome. +// AddDonAndSetCandidateChangeset is not idempotent, if AddDON is called more than once for the same chain, +// it will throw an error because the DON would already exist for that chain. func AddDonAndSetCandidateChangeset( e deployment.Environment, cfg AddDonAndSetCandidateChangesetConfig, @@ -422,7 +569,8 @@ func AddDonAndSetCandidateChangeset( txOpts = deployment.SimTransactOpts() } var donOps []mcms.Operation - for chainSelector, params := range cfg.OCRConfigPerRemoteChainSelector { + + for chainSelector, params := range cfg.PluginInfo.OCRConfigPerRemoteChainSelector { newDONArgs, err := internal.BuildOCR3ConfigForCCIPHome( e.OCRSecrets, state.Chains[chainSelector].OffRamp, @@ -442,9 +590,10 @@ func AddDonAndSetCandidateChangeset( return deployment.ChangesetOutput{}, err } - pluginOCR3Config, ok := newDONArgs[cfg.PluginType] + pluginOCR3Config, ok := newDONArgs[cfg.PluginInfo.PluginType] if !ok { - return deployment.ChangesetOutput{}, errors.New("missing commit plugin in ocr3Configs") + return deployment.ChangesetOutput{}, fmt.Errorf("missing plugin %s in ocr3Configs", + cfg.PluginInfo.PluginType.String()) } expectedDonID := latestDon.Id + 1 @@ -477,7 +626,7 @@ func AddDonAndSetCandidateChangeset( ChainIdentifier: mcms.ChainIdentifier(cfg.HomeChainSelector), Batch: donOps, }}, - "addDON on new Chain && setCandidate for plugin "+cfg.PluginType.String(), + "addDON on new Chain && setCandidate for plugin "+cfg.PluginInfo.PluginType.String(), cfg.MCMS.MinDelay, ) if err != nil { @@ -526,7 +675,8 @@ func newDonWithCandidateOp( nodes.DefaultF(), ) if err != nil { - return mcms.Operation{}, fmt.Errorf("could not generate add don tx w/ commit config: %w", err) + return mcms.Operation{}, fmt.Errorf("could not generate add don tx w/ %s config: %w", + types.PluginType(pluginConfig.PluginType).String(), err) } if !mcmsEnabled { _, err = deployment.ConfirmIfNoError(homeChain, addDonTx, err) @@ -544,6 +694,8 @@ func newDonWithCandidateOp( type SetCandidateChangesetConfig struct { SetCandidateConfigBase + + PluginInfo []SetCandidatePluginInfo } func (s SetCandidateChangesetConfig) Validate(e deployment.Environment, state CCIPOnChainState) (map[uint64]uint32, error) { @@ -553,21 +705,26 @@ func (s SetCandidateChangesetConfig) Validate(e deployment.Environment, state CC } chainToDonIDs := make(map[uint64]uint32) - for chainSelector := range s.OCRConfigPerRemoteChainSelector { - donID, err := internal.DonIDForChain( - state.Chains[s.HomeChainSelector].CapabilityRegistry, - state.Chains[s.HomeChainSelector].CCIPHome, - chainSelector, - ) - if err != nil { - return nil, fmt.Errorf("fetch don id for chain: %w", err) + for _, plugin := range s.PluginInfo { + if err := plugin.Validate(state, s.HomeChainSelector, s.FeedChainSelector); err != nil { + return nil, fmt.Errorf("validate plugin info %s: %w", plugin.String(), err) } - if donID == 0 { - return nil, fmt.Errorf("don doesn't exist in CR for chain %d", chainSelector) + for chainSelector := range plugin.OCRConfigPerRemoteChainSelector { + donID, err := internal.DonIDForChain( + state.Chains[s.HomeChainSelector].CapabilityRegistry, + state.Chains[s.HomeChainSelector].CCIPHome, + chainSelector, + ) + if err != nil { + return nil, fmt.Errorf("fetch don id for chain: %w", err) + } + // if don doesn't exist use AddDonAndSetCandidateChangeset instead + if donID == 0 { + return nil, fmt.Errorf("don doesn't exist in CR for chain %d", chainSelector) + } + chainToDonIDs[chainSelector] = donID } - chainToDonIDs[chainSelector] = donID } - return chainToDonIDs, nil } @@ -597,41 +754,44 @@ func SetCandidateChangeset( txOpts = deployment.SimTransactOpts() } var setCandidateOps []mcms.Operation - for chainSelector, params := range cfg.OCRConfigPerRemoteChainSelector { - newDONArgs, err := internal.BuildOCR3ConfigForCCIPHome( - e.OCRSecrets, - state.Chains[chainSelector].OffRamp, - e.Chains[chainSelector], - nodes.NonBootstraps(), - state.Chains[cfg.HomeChainSelector].RMNHome.Address(), - params.OCRParameters, - params.CommitOffChainConfig, - params.ExecuteOffChainConfig, - ) - if err != nil { - return deployment.ChangesetOutput{}, err - } - - config, ok := newDONArgs[cfg.PluginType] - if !ok { - return deployment.ChangesetOutput{}, fmt.Errorf("missing %s plugin in ocr3Configs", cfg.PluginType.String()) - } - - setCandidateMCMSOps, err := setCandidateOnExistingDon( - txOpts, - e.Chains[cfg.HomeChainSelector], - state.Chains[cfg.HomeChainSelector].CapabilityRegistry, - nodes.NonBootstraps(), - chainToDonIDs[chainSelector], - config, - cfg.MCMS != nil, - ) - if err != nil { - return deployment.ChangesetOutput{}, err + pluginInfos := make([]string, 0) + for _, plugin := range cfg.PluginInfo { + pluginInfos = append(pluginInfos, plugin.String()) + for chainSelector, params := range plugin.OCRConfigPerRemoteChainSelector { + newDONArgs, err := internal.BuildOCR3ConfigForCCIPHome( + e.OCRSecrets, + state.Chains[chainSelector].OffRamp, + e.Chains[chainSelector], + nodes.NonBootstraps(), + state.Chains[cfg.HomeChainSelector].RMNHome.Address(), + params.OCRParameters, + params.CommitOffChainConfig, + params.ExecuteOffChainConfig, + ) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + config, ok := newDONArgs[plugin.PluginType] + if !ok { + return deployment.ChangesetOutput{}, fmt.Errorf("missing %s plugin in ocr3Configs", plugin.PluginType.String()) + } + + setCandidateMCMSOps, err := setCandidateOnExistingDon( + txOpts, + e.Chains[cfg.HomeChainSelector], + state.Chains[cfg.HomeChainSelector].CapabilityRegistry, + nodes.NonBootstraps(), + chainToDonIDs[chainSelector], + config, + cfg.MCMS != nil, + ) + if err != nil { + return deployment.ChangesetOutput{}, err + } + setCandidateOps = append(setCandidateOps, setCandidateMCMSOps...) } - setCandidateOps = append(setCandidateOps, setCandidateMCMSOps...) } - if cfg.MCMS == nil { return deployment.ChangesetOutput{}, nil } @@ -647,7 +807,7 @@ func SetCandidateChangeset( ChainIdentifier: mcms.ChainIdentifier(cfg.HomeChainSelector), Batch: setCandidateOps, }}, - fmt.Sprintf("SetCandidate for %s plugin", cfg.PluginType.String()), + fmt.Sprintf("SetCandidate for plugin details %v", pluginInfos), cfg.MCMS.MinDelay, ) if err != nil { @@ -764,7 +924,8 @@ func promoteCandidateOp( nodes.DefaultF(), ) if err != nil { - return mcms.Operation{}, fmt.Errorf("error creating updateDon op for donID(%d) and plugin type (%d): %w", donID, pluginType, err) + return mcms.Operation{}, fmt.Errorf("error creating updateDon op for donID(%d) and plugin type (%s): %w", + donID, types.PluginType(pluginType).String(), err) } if !mcmsEnabled { _, err = deployment.ConfirmIfNoError(homeChain, updateDonTx, err) @@ -780,8 +941,8 @@ func promoteCandidateOp( }, nil } -// promoteAllCandidatesForChainOps promotes the candidate commit and exec configs to active by calling promoteCandidateAndRevokeActive on CCIPHome through the UpdateDON call on CapReg contract -func promoteAllCandidatesForChainOps( +// promoteCandidateForChainOps promotes the candidate commit and exec configs to active by calling promoteCandidateAndRevokeActive on CCIPHome through the UpdateDON call on CapReg contract +func promoteCandidateForChainOps( txOpts *bind.TransactOpts, homeChain deployment.Chain, capReg *capabilities_registry.CapabilitiesRegistry, @@ -794,7 +955,11 @@ func promoteAllCandidatesForChainOps( if donID == 0 { return mcms.Operation{}, errors.New("donID is zero") } - + digest, err := ccipHome.GetCandidateDigest(nil, donID, uint8(pluginType)) + if err != nil { + return mcms.Operation{}, err + } + fmt.Println("Promoting candidate for plugin", pluginType.String(), "with digest", digest) updatePluginOp, err := promoteCandidateOp( txOpts, homeChain, diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go index 884a501ce48..cde4d9919bb 100644 --- a/deployment/ccip/changeset/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/cs_ccip_home_test.go @@ -2,7 +2,9 @@ package changeset import ( "math/big" + "regexp" "testing" + "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/stretchr/testify/assert" @@ -12,6 +14,7 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -22,6 +25,62 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) +func TestInvalidOCR3Params(t *testing.T) { + e, _ := NewMemoryEnvironment(t, + WithPrerequisiteDeployment()) + chain1 := e.Env.AllChainSelectors()[0] + envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) + require.NoError(t, err) + // Need to deploy prerequisites first so that we can form the USDC config + // no proposals to be made, timelock can be passed as nil here + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), + Config: DeployHomeChainConfig{ + HomeChainSel: e.HomeChainSel, + RMNDynamicConfig: NewTestRMNDynamicConfig(), + RMNStaticConfig: NewTestRMNStaticConfig(), + NodeOperators: NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), + NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ + TestNodeOperator: envNodes.NonBootstraps().PeerIDs(), + }, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), + Config: DeployChainContractsConfig{ + ChainSelectors: []uint64{chain1}, + HomeChainSelector: e.HomeChainSel, + }, + }, + }) + require.NoError(t, err) + + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + nodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) + require.NoError(t, err) + params := DefaultOCRParams(e.FeedChainSel, nil, nil, true, true) + // tweak params to have invalid config + // make DeltaRound greater than DeltaProgress + params.OCRParameters.DeltaRound = params.OCRParameters.DeltaProgress + time.Duration(1) + _, err = internal.BuildOCR3ConfigForCCIPHome( + e.Env.OCRSecrets, + state.Chains[chain1].OffRamp, + e.Env.Chains[chain1], + nodes.NonBootstraps(), + state.Chains[e.HomeChainSel].RMNHome.Address(), + params.OCRParameters, + params.CommitOffChainConfig, + params.ExecuteOffChainConfig, + ) + require.Errorf(t, err, "expected error") + pattern := `DeltaRound \(\d+\.\d+s\) must be less than DeltaProgress \(\d+s\)` + matched, err1 := regexp.MatchString(pattern, err.Error()) + require.NoError(t, err1) + require.True(t, matched) +} + func Test_PromoteCandidate(t *testing.T) { for _, tc := range []struct { name string @@ -87,12 +146,16 @@ func Test_PromoteCandidate(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset), - Config: PromoteCandidatesChangesetConfig{ - HomeChainSelector: tenv.HomeChainSel, - RemoteChainSelectors: []uint64{dest}, - MCMS: mcmsConfig, - PluginType: types.PluginTypeCCIPCommit, + Changeset: commonchangeset.WrapChangeSet(PromoteCandidateChangeset), + Config: PromoteCandidateChangesetConfig{ + HomeChainSelector: tenv.HomeChainSel, + PluginInfo: []PromoteCandidatePluginInfo{ + { + RemoteChainSelectors: []uint64{dest}, + PluginType: types.PluginTypeCCIPCommit, + }, + }, + MCMS: mcmsConfig, }, }, }) @@ -183,33 +246,21 @@ func Test_SetCandidate(t *testing.T) { SetCandidateConfigBase: SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams( - tenv.FeedChainSel, - tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), - nil, - ), - }, - PluginType: types.PluginTypeCCIPCommit, - MCMS: mcmsConfig, + MCMS: mcmsConfig, }, - }, - }, - { - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ - HomeChainSelector: tenv.HomeChainSel, - FeedChainSelector: tenv.FeedChainSel, - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams( - tenv.FeedChainSel, - tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), - nil, - ), + PluginInfo: []SetCandidatePluginInfo{ + { + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, false), + }, + PluginType: types.PluginTypeCCIPCommit, + }, + { + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, false, true), + }, + PluginType: types.PluginTypeCCIPExec, }, - PluginType: types.PluginTypeCCIPExec, - MCMS: mcmsConfig, }, }, }, @@ -304,33 +355,21 @@ func Test_RevokeCandidate(t *testing.T) { SetCandidateConfigBase: SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams( - tenv.FeedChainSel, - tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), - nil, - ), - }, - PluginType: types.PluginTypeCCIPCommit, - MCMS: mcmsConfig, + MCMS: mcmsConfig, }, - }, - }, - { - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ - HomeChainSelector: tenv.HomeChainSel, - FeedChainSelector: tenv.FeedChainSel, - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams( - tenv.FeedChainSel, - tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), - nil, - ), + PluginInfo: []SetCandidatePluginInfo{ + { + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, true), + }, + PluginType: types.PluginTypeCCIPCommit, + }, + { + OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ + dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, true), + }, + PluginType: types.PluginTypeCCIPExec, }, - PluginType: types.PluginTypeCCIPExec, - MCMS: mcmsConfig, }, }, }, diff --git a/deployment/ccip/changeset/cs_update_rmn_config.go b/deployment/ccip/changeset/cs_update_rmn_config.go index 309f10c8311..e52ca407b5d 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/cs_update_rmn_config.go @@ -20,6 +20,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) +var ( + _ deployment.ChangeSet[SetRMNRemoteOnRMNProxyConfig] = SetRMNRemoteOnRMNProxy + _ deployment.ChangeSet[SetRMNHomeCandidateConfig] = SetRMNHomeCandidateConfigChangeset + _ deployment.ChangeSet[PromoteRMNHomeCandidateConfig] = PromoteCandidateConfigChangeset + _ deployment.ChangeSet[SetRMNRemoteConfig] = SetRMNRemoteConfigChangeset +) + type SetRMNRemoteOnRMNProxyConfig struct { ChainSelectors []uint64 MCMSConfig *MCMSConfig @@ -252,12 +259,12 @@ func (c PromoteRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { return nil } -// NewSetRMNHomeCandidateConfigChangeset creates a changeset to set the RMNHome candidate config +// SetRMNHomeCandidateConfigChangeset creates a changeset to set the RMNHome candidate config // DigestToOverride is the digest of the current candidate config that the new config will override // StaticConfig contains the list of nodes with their peerIDs (found in their rageproxy keystore) and offchain public keys (found in the RMN keystore) // DynamicConfig contains the list of source chains with their chain selectors, f value and the bitmap of the nodes that are oberver for each source chain // The bitmap is a 256 bit array where each bit represents a node. If the bit matching the index of the node in the static config is set it means that the node is an observer -func NewSetRMNHomeCandidateConfigChangeset(e deployment.Environment, config SetRMNHomeCandidateConfig) (deployment.ChangesetOutput, error) { +func SetRMNHomeCandidateConfigChangeset(e deployment.Environment, config SetRMNHomeCandidateConfig) (deployment.ChangesetOutput, error) { state, err := LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) @@ -325,7 +332,7 @@ func NewSetRMNHomeCandidateConfigChangeset(e deployment.Environment, config SetR }, nil } -func NewPromoteCandidateConfigChangeset(e deployment.Environment, config PromoteRMNHomeCandidateConfig) (deployment.ChangesetOutput, error) { +func PromoteCandidateConfigChangeset(e deployment.Environment, config PromoteRMNHomeCandidateConfig) (deployment.ChangesetOutput, error) { state, err := LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) @@ -481,7 +488,7 @@ func (c SetRMNRemoteConfig) Validate() error { return nil } -func NewSetRMNRemoteConfigChangeset(e deployment.Environment, config SetRMNRemoteConfig) (deployment.ChangesetOutput, error) { +func SetRMNRemoteConfigChangeset(e deployment.Environment, config SetRMNRemoteConfig) (deployment.ChangesetOutput, error) { state, err := LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) diff --git a/deployment/ccip/changeset/cs_update_rmn_config_test.go b/deployment/ccip/changeset/cs_update_rmn_config_test.go index 093fc9e337d..fdccf36af07 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config_test.go +++ b/deployment/ccip/changeset/cs_update_rmn_config_test.go @@ -127,7 +127,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(NewSetRMNHomeCandidateConfigChangeset), + Changeset: commonchangeset.WrapChangeSet(SetRMNHomeCandidateConfigChangeset), Config: setRMNHomeCandidateConfig, }, }) @@ -153,7 +153,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(NewPromoteCandidateConfigChangeset), + Changeset: commonchangeset.WrapChangeSet(PromoteCandidateConfigChangeset), Config: promoteConfig, }, }) @@ -187,7 +187,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(NewSetRMNRemoteConfigChangeset), + Changeset: commonchangeset.WrapChangeSet(SetRMNRemoteConfigChangeset), Config: setRemoteConfig, }, }) diff --git a/deployment/ccip/changeset/internal/deploy_home_chain.go b/deployment/ccip/changeset/internal/deploy_home_chain.go index ec5b879be0c..fe9aa14e5dd 100644 --- a/deployment/ccip/changeset/internal/deploy_home_chain.go +++ b/deployment/ccip/changeset/internal/deploy_home_chain.go @@ -2,14 +2,17 @@ package internal import ( "context" + "errors" "fmt" "time" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" @@ -173,7 +176,8 @@ func BuildSetOCR3ConfigArgs( // we expect only an active config and no candidate config. if ocrConfig.ActiveConfig.ConfigDigest == [32]byte{} || ocrConfig.CandidateConfig.ConfigDigest != [32]byte{} { - return nil, fmt.Errorf("invalid OCR3 config state, expected active config and no candidate config, donID: %d", donID) + return nil, fmt.Errorf("invalid OCR3 config state, expected active config and no candidate config, donID: %d, activeConfig: %v, candidateConfig: %v", + donID, hexutil.Encode(ocrConfig.ActiveConfig.ConfigDigest[:]), hexutil.Encode(ocrConfig.CandidateConfig.ConfigDigest[:])) } activeConfig := ocrConfig.ActiveConfig @@ -203,8 +207,8 @@ func BuildOCR3ConfigForCCIPHome( nodes deployment.Nodes, rmnHomeAddress common.Address, ocrParams types2.OCRParameters, - commitOffchainCfg pluginconfig.CommitOffchainConfig, - execOffchainCfg pluginconfig.ExecuteOffchainConfig, + commitOffchainCfg *pluginconfig.CommitOffchainConfig, + execOffchainCfg *pluginconfig.ExecuteOffchainConfig, ) (map[types.PluginType]ccip_home.CCIPHomeOCR3Config, error) { p2pIDs := nodes.PeerIDs() // Get OCR3 Config from helper @@ -228,10 +232,20 @@ func BuildOCR3ConfigForCCIPHome( // Add DON on capability registry contract ocr3Configs := make(map[types.PluginType]ccip_home.CCIPHomeOCR3Config) - for _, pluginType := range []types.PluginType{types.PluginTypeCCIPCommit, types.PluginTypeCCIPExec} { + pluginTypes := make([]types.PluginType, 0) + if commitOffchainCfg != nil { + pluginTypes = append(pluginTypes, types.PluginTypeCCIPCommit) + } + if execOffchainCfg != nil { + pluginTypes = append(pluginTypes, types.PluginTypeCCIPExec) + } + for _, pluginType := range pluginTypes { var encodedOffchainConfig []byte var err2 error if pluginType == types.PluginTypeCCIPCommit { + if commitOffchainCfg == nil { + return nil, errors.New("commitOffchainCfg is nil") + } encodedOffchainConfig, err2 = pluginconfig.EncodeCommitOffchainConfig(pluginconfig.CommitOffchainConfig{ RemoteGasPriceBatchWriteFrequency: commitOffchainCfg.RemoteGasPriceBatchWriteFrequency, TokenPriceBatchWriteFrequency: commitOffchainCfg.TokenPriceBatchWriteFrequency, @@ -245,6 +259,9 @@ func BuildOCR3ConfigForCCIPHome( RMNSignaturesTimeout: commitOffchainCfg.RMNSignaturesTimeout, }) } else { + if execOffchainCfg == nil { + return nil, errors.New("execOffchainCfg is nil") + } encodedOffchainConfig, err2 = pluginconfig.EncodeExecuteOffchainConfig(pluginconfig.ExecuteOffchainConfig{ BatchGasLimit: execOffchainCfg.BatchGasLimit, RelativeBoostPerWaitHour: execOffchainCfg.RelativeBoostPerWaitHour, @@ -258,7 +275,7 @@ func BuildOCR3ConfigForCCIPHome( if err2 != nil { return nil, err2 } - signers, transmitters, configF, _, offchainConfigVersion, offchainConfig, err2 := ocr3confighelper.ContractSetConfigArgsDeterministic( + signers, transmitters, configF, onchainConfig, offchainConfigVersion, offchainConfig, err2 := ocr3confighelper.ContractSetConfigArgsDeterministic( ocrSecrets.EphemeralSk, ocrSecrets.SharedSecret, ocrParams.DeltaProgress, @@ -297,7 +314,18 @@ func BuildOCR3ConfigForCCIPHome( } transmittersBytes[i] = parsed } - + // validate ocr3 params correctness + _, err := ocr3confighelper.PublicConfigFromContractConfig(false, ocrtypes.ContractConfig{ + Signers: signers, + Transmitters: transmitters, + F: configF, + OnchainConfig: onchainConfig, + OffchainConfigVersion: offchainConfigVersion, + OffchainConfig: offchainConfig, + }) + if err != nil { + return nil, fmt.Errorf("failed to validate ocr3 params: %w", err) + } var ocrNodes []ccip_home.CCIPHomeOCR3Node for i := range nodes { ocrNodes = append(ocrNodes, ccip_home.CCIPHomeOCR3Node{ diff --git a/deployment/ccip/changeset/state.go b/deployment/ccip/changeset/state.go index aa07168a6d2..e5b8577cd43 100644 --- a/deployment/ccip/changeset/state.go +++ b/deployment/ccip/changeset/state.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc677" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_messenger" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter" @@ -85,6 +86,8 @@ var ( // Pools BurnMintToken deployment.ContractType = "BurnMintToken" + ERC20Token deployment.ContractType = "ERC20Token" + ERC677Token deployment.ContractType = "ERC677Token" BurnMintTokenPool deployment.ContractType = "BurnMintTokenPool" USDCToken deployment.ContractType = "USDCToken" USDCTokenMessenger deployment.ContractType = "USDCTokenMessenger" @@ -109,8 +112,8 @@ type CCIPChainState struct { RMNRemote *rmn_remote.RMNRemote // Map between token Descriptor (e.g. LinkSymbol, WethSymbol) // and the respective token contract - // This is more of an illustration of how we'll have tokens, and it might need some work later to work properly. - // Not all tokens will be burn and mint tokens. + ERC20Tokens map[TokenSymbol]*erc20.ERC20 + ERC677Tokens map[TokenSymbol]*erc677.ERC677 BurnMintTokens677 map[TokenSymbol]*burn_mint_erc677.BurnMintERC677 BurnMintTokenPools map[TokenSymbol]*burn_mint_token_pool.BurnMintTokenPool // Map between token Symbol (e.g. LinkSymbol, WethSymbol) @@ -600,6 +603,32 @@ func LoadChainState(chain deployment.Chain, addresses map[string]deployment.Type return state, fmt.Errorf("failed to get token symbol of token at %s: %w", address, err) } state.BurnMintTokens677[TokenSymbol(symbol)] = tok + case deployment.NewTypeAndVersion(ERC20Token, deployment.Version1_0_0).String(): + tok, err := erc20.NewERC20(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + if state.ERC20Tokens == nil { + state.ERC20Tokens = make(map[TokenSymbol]*erc20.ERC20) + } + symbol, err := tok.Symbol(nil) + if err != nil { + return state, fmt.Errorf("failed to get token symbol of token at %s: %w", address, err) + } + state.ERC20Tokens[TokenSymbol(symbol)] = tok + case deployment.NewTypeAndVersion(ERC677Token, deployment.Version1_0_0).String(): + tok, err := erc677.NewERC677(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + if state.ERC677Tokens == nil { + state.ERC677Tokens = make(map[TokenSymbol]*erc677.ERC677) + } + symbol, err := tok.Symbol(nil) + if err != nil { + return state, fmt.Errorf("failed to get token symbol of token at %s: %w", address, err) + } + state.ERC677Tokens[TokenSymbol(symbol)] = tok // legacy addresses below case deployment.NewTypeAndVersion(OnRamp, deployment.Version1_5_0).String(): onRampC, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(address), chain.Client) diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/test_environment.go index 3e23f356857..fc1c232f367 100644 --- a/deployment/ccip/changeset/test_environment.go +++ b/deployment/ccip/changeset/test_environment.go @@ -541,7 +541,7 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn CallProxy: state.Chains[chain].CallProxy, } tokenInfo := tokenConfig.GetTokenInfo(e.Env.Logger, state.Chains[chain].LinkToken, state.Chains[chain].Weth9) - ocrParams := DefaultOCRParams(e.FeedChainSel, tokenInfo, tokenDataProviders) + ocrParams := DefaultOCRParams(e.FeedChainSel, tokenInfo, tokenDataProviders, true, true) if tc.OCRConfigOverride != nil { ocrParams = tc.OCRConfigOverride(ocrParams) } @@ -570,9 +570,11 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn // Add the DONs and candidate commit OCR instances for the chain. Changeset: commonchangeset.WrapChangeSet(AddDonAndSetCandidateChangeset), Config: AddDonAndSetCandidateChangesetConfig{ - SetCandidateConfigBase{ - HomeChainSelector: e.HomeChainSel, - FeedChainSelector: e.FeedChainSel, + SetCandidateConfigBase: SetCandidateConfigBase{ + HomeChainSelector: e.HomeChainSel, + FeedChainSelector: e.FeedChainSel, + }, + PluginInfo: SetCandidatePluginInfo{ OCRConfigPerRemoteChainSelector: ocrConfigs, PluginType: types.PluginTypeCCIPCommit, }, @@ -582,30 +584,33 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn // Add the exec OCR instances for the new chains. Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase{ - HomeChainSelector: e.HomeChainSel, - FeedChainSelector: e.FeedChainSel, - OCRConfigPerRemoteChainSelector: ocrConfigs, - PluginType: types.PluginTypeCCIPExec, + SetCandidateConfigBase: SetCandidateConfigBase{ + HomeChainSelector: e.HomeChainSel, + FeedChainSelector: e.FeedChainSel, + }, + PluginInfo: []SetCandidatePluginInfo{ + { + OCRConfigPerRemoteChainSelector: ocrConfigs, + PluginType: types.PluginTypeCCIPExec, + }, }, }, }, { // Promote everything - Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset), - Config: PromoteCandidatesChangesetConfig{ - HomeChainSelector: e.HomeChainSel, - RemoteChainSelectors: allChains, - PluginType: types.PluginTypeCCIPCommit, - }, - }, - { - // Promote everything - Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset), - Config: PromoteCandidatesChangesetConfig{ - HomeChainSelector: e.HomeChainSel, - RemoteChainSelectors: allChains, - PluginType: types.PluginTypeCCIPExec, + Changeset: commonchangeset.WrapChangeSet(PromoteCandidateChangeset), + Config: PromoteCandidateChangesetConfig{ + HomeChainSelector: e.HomeChainSel, + PluginInfo: []PromoteCandidatePluginInfo{ + { + PluginType: types.PluginTypeCCIPCommit, + RemoteChainSelectors: allChains, + }, + { + PluginType: types.PluginTypeCCIPExec, + RemoteChainSelectors: allChains, + }, + }, }, }, { diff --git a/deployment/ccip/changeset/test_helpers.go b/deployment/ccip/changeset/test_helpers.go index 03c3ffb175d..e0edbc93e12 100644 --- a/deployment/ccip/changeset/test_helpers.go +++ b/deployment/ccip/changeset/test_helpers.go @@ -516,10 +516,6 @@ var ( LinkSymbol: MockLinkAggregatorDescription, WethSymbol: MockWETHAggregatorDescription, } - MockSymbolToDecimals = map[TokenSymbol]uint8{ - LinkSymbol: LinkDecimals, - WethSymbol: WethDecimals, - } ) func DeployFeeds( diff --git a/deployment/environment/devenv/don.go b/deployment/environment/devenv/don.go index a132fe72a2f..a8912254d1d 100644 --- a/deployment/environment/devenv/don.go +++ b/deployment/environment/devenv/don.go @@ -15,6 +15,7 @@ import ( "github.com/sethvargo/go-retry" nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" + clclient "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" "github.com/smartcontractkit/chainlink/deployment/environment/web/sdk/client" @@ -169,7 +170,7 @@ type Node struct { NodeId string // node id returned by job distributor after node is registered with it JDId string // job distributor id returned by node after Job distributor is created in node Name string // name of the node - AccountAddr map[uint64]string // chain selector to node's account address mapping for supported chains + AccountAddr map[uint64]string // chain id to node's account address mapping for supported chains gqlClient client.Client // graphql client to interact with the node restClient *clclient.ChainlinkClient // rest client to interact with the node labels []*ptypes.Label // labels with which the node is registered with the job distributor diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go index 67f99cd5a7b..c655caa9f08 100644 --- a/integration-tests/smoke/ccip/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -275,7 +275,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { candidateDigest, err := homeChainState.RMNHome.GetCandidateDigest(&bind.CallOpts{Context: ctx}) require.NoError(t, err) - _, err = changeset.NewSetRMNHomeCandidateConfigChangeset(envWithRMN.Env, changeset.SetRMNHomeCandidateConfig{ + _, err = changeset.SetRMNHomeCandidateConfigChangeset(envWithRMN.Env, changeset.SetRMNHomeCandidateConfig{ HomeChainSelector: envWithRMN.HomeChainSel, RMNStaticConfig: staticConfig, RMNDynamicConfig: dynamicConfig, @@ -289,7 +289,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { t.Logf("RMNHome candidateDigest after setting new candidate: %x", candidateDigest[:]) t.Logf("Promoting RMNHome candidate with candidateDigest: %x", candidateDigest[:]) - _, err = changeset.NewPromoteCandidateConfigChangeset(envWithRMN.Env, changeset.PromoteRMNHomeCandidateConfig{ + _, err = changeset.PromoteCandidateConfigChangeset(envWithRMN.Env, changeset.PromoteRMNHomeCandidateConfig{ HomeChainSelector: envWithRMN.HomeChainSel, DigestToPromote: candidateDigest, }) @@ -314,7 +314,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { } } - _, err = changeset.NewSetRMNRemoteConfigChangeset(envWithRMN.Env, changeset.SetRMNRemoteConfig{ + _, err = changeset.SetRMNRemoteConfigChangeset(envWithRMN.Env, changeset.SetRMNRemoteConfig{ HomeChainSelector: envWithRMN.HomeChainSel, RMNRemoteConfigs: rmnRemoteConfig, }) From 1e25959ce48e463bed3b653ec489ef09beb7cb46 Mon Sep 17 00:00:00 2001 From: Lei Date: Tue, 14 Jan 2025 12:36:52 -0800 Subject: [PATCH 52/91] cosmetic updates on workflow registry deployment (#15874) * cosmetic updates on workflow registry deployment * Trigger re-deploy --------- Co-authored-by: Justin Kaseman --- .../keystone/changeset/workflowregistry/deploy.go | 2 +- .../changeset/workflowregistry/deploy_test.go | 4 ++-- .../update_authorized_addresses_test.go | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deployment/keystone/changeset/workflowregistry/deploy.go b/deployment/keystone/changeset/workflowregistry/deploy.go index bb88918594c..3bead5cdc6c 100644 --- a/deployment/keystone/changeset/workflowregistry/deploy.go +++ b/deployment/keystone/changeset/workflowregistry/deploy.go @@ -18,7 +18,7 @@ func Deploy(env deployment.Environment, registrySelector uint64) (deployment.Cha ab := deployment.NewMemoryAddressBook() wrResp, err := deployWorkflowRegistry(chain, ab) if err != nil { - return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy CapabilitiesRegistry: %w", err) + return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy WorkflowRegistry: %w", err) } lggr.Infof("Deployed %s chain selector %d addr %s", wrResp.Tv.String(), chain.Selector, wrResp.Address.String()) diff --git a/deployment/keystone/changeset/workflowregistry/deploy_test.go b/deployment/keystone/changeset/workflowregistry/deploy_test.go index ec40646b378..733f47d6a15 100644 --- a/deployment/keystone/changeset/workflowregistry/deploy_test.go +++ b/deployment/keystone/changeset/workflowregistry/deploy_test.go @@ -26,12 +26,12 @@ func Test_Deploy(t *testing.T) { resp, err := Deploy(env, registrySel) require.NoError(t, err) require.NotNil(t, resp) - // OCR3 should be deployed on chain 0 + // workflow registry should be deployed on chain 0 addrs, err := resp.AddressBook.AddressesForChain(registrySel) require.NoError(t, err) require.Len(t, addrs, 1) - // nothing on chain 1 + // assert nothing on chain 1 require.NotEqual(t, registrySel, env.AllChainSelectors()[1]) oaddrs, _ := resp.AddressBook.AddressesForChain(env.AllChainSelectors()[1]) assert.Empty(t, oaddrs) diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go index ed650ed52c6..20dbf9895d4 100644 --- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go @@ -27,10 +27,10 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { resp := workflowregistry.SetupTestWorkflowRegistry(t, lggr, chainSel) registry := resp.Registry - dons, err := registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) + authorizedAddresses, err := registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) require.NoError(t, err) - assert.Empty(t, dons) + assert.Empty(t, authorizedAddresses) env := deployment.Environment{ Logger: lggr, @@ -51,11 +51,11 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { ) require.NoError(t, err) - dons, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) + authorizedAddresses, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) require.NoError(t, err) - assert.Len(t, dons, 1) - assert.Equal(t, dons[0], common.HexToAddress(addr)) + assert.Len(t, authorizedAddresses, 1) + assert.Equal(t, authorizedAddresses[0], common.HexToAddress(addr)) _, err = workflowregistry.UpdateAuthorizedAddresses( env, @@ -67,10 +67,10 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { ) require.NoError(t, err) - dons, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) + authorizedAddresses, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) require.NoError(t, err) - assert.Empty(t, dons) + assert.Empty(t, authorizedAddresses) } func Test_UpdateAuthorizedAddresses_WithMCMS(t *testing.T) { From c96c31ff6e9225186a946d19bcb35aaa27e291a2 Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:40:56 -0500 Subject: [PATCH 53/91] Allow certain labels on a PR to exempt it from going stale (#15922) --- .github/workflows/stale.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b2ed7ff36a2..5972519426a 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,7 +2,7 @@ # A PR with more than 60 days of inactivity will be marked as stale # A PR that's stale for more than 7 days will be automatically closed # Issues are exempt from auto marking as stale but issues with manually added 'stale' label are eligible for auto closure after 7 days. -# PRs with assignees are exempt from auto stale marking, it's the responsibility of the assignee to get the PR progressed either with review/merge or closure. +# PRs with `exempt-pr-labels` or assignees are exempt from auto stale marking, it's the responsibility of the assignee to get the PR progressed either with review/merge or closure. name: Manage stale Issues and PRs on: @@ -11,16 +11,17 @@ on: jobs: stale: - runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - - uses: actions/stale@v9.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - exempt-all-pr-assignees: true - stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' - days-before-issue-stale: -1 # disables marking issues as stale automatically. Issues can still be marked as stale manually, in which the closure policy applies. + - uses: actions/stale@v9.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + exempt-all-pr-assignees: true + stale-pr-message: "This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days." + days-before-issue-stale: -1 # disables marking issues as stale automatically. Issues can still be marked as stale manually, in which the closure policy applies. + # Comma separated list of labels that exempt issues from being considered stale. + exempt-pr-labels: "stale-exempt" From 547d2ed7ec6069111ef002e37e9d287882156683 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 14 Jan 2025 20:14:48 -0600 Subject: [PATCH 54/91] common/types: remove unused (#15926) --- common/types/receipt.go | 14 -------------- common/types/test_utils.go | 16 ---------------- 2 files changed, 30 deletions(-) delete mode 100644 common/types/receipt.go delete mode 100644 common/types/test_utils.go diff --git a/common/types/receipt.go b/common/types/receipt.go deleted file mode 100644 index 01d5a72def5..00000000000 --- a/common/types/receipt.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -import "math/big" - -type Receipt[TX_HASH Hashable, BLOCK_HASH Hashable] interface { - GetStatus() uint64 - GetTxHash() TX_HASH - GetBlockNumber() *big.Int - IsZero() bool - IsUnmined() bool - GetFeeUsed() uint64 - GetTransactionIndex() uint - GetBlockHash() BLOCK_HASH -} diff --git a/common/types/test_utils.go b/common/types/test_utils.go deleted file mode 100644 index 40560f7866c..00000000000 --- a/common/types/test_utils.go +++ /dev/null @@ -1,16 +0,0 @@ -package types - -import ( - "math" - "math/big" - "math/rand" -) - -func RandomID() ID { - id := rand.Int63n(math.MaxInt32) + 10000 - return big.NewInt(id) -} - -func NewIDFromInt(id int64) ID { - return big.NewInt(id) -} From 186fda8dc3c4bae8abc436efc0e64d44b86b7628 Mon Sep 17 00:00:00 2001 From: Calvin <78729586+calvwang9@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:55:03 +1100 Subject: [PATCH 55/91] Fix missing tron handler and tests (#15932) * fix missing tron handlers * add changeset * fix test error and linting * fix test --- .changeset/sharp-llamas-compete.md | 5 +++++ core/cmd/shell_local.go | 3 +++ core/services/feeds/service_test.go | 16 ++++++++++++++++ core/services/keystore/ocr2_test.go | 20 ++++++++++++++++---- core/web/auth/auth_test.go | 1 + 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .changeset/sharp-llamas-compete.md diff --git a/.changeset/sharp-llamas-compete.md b/.changeset/sharp-llamas-compete.md new file mode 100644 index 00000000000..76808dbdda4 --- /dev/null +++ b/.changeset/sharp-llamas-compete.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#bugfix Fix missing Tron handler diff --git a/core/cmd/shell_local.go b/core/cmd/shell_local.go index ed71c5be369..07b593ac978 100644 --- a/core/cmd/shell_local.go +++ b/core/cmd/shell_local.go @@ -434,6 +434,9 @@ func (s *Shell) runNode(c *cli.Context) error { if s.Config.AptosEnabled() { enabledChains = append(enabledChains, chaintype.Aptos) } + if s.Config.TronEnabled() { + enabledChains = append(enabledChains, chaintype.Tron) + } err2 := app.GetKeyStore().OCR2().EnsureKeys(rootCtx, enabledChains...) if err2 != nil { return errors.Wrap(err2, "failed to ensure ocr key") diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index d449d585401..2277a160e7f 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -588,6 +588,12 @@ func Test_Service_CreateChainConfig(t *testing.T) { expectedID: int64(1), expectedChainType: proto.ChainType_CHAIN_TYPE_APTOS, }, + { + name: "Tron Chain Type", + chainType: feeds.ChainTypeTron, + expectedID: int64(1), + expectedChainType: proto.ChainType_CHAIN_TYPE_TRON, + }, } for _, tt := range tests { @@ -755,6 +761,11 @@ func Test_Service_UpdateChainConfig(t *testing.T) { chainType: feeds.ChainTypeAptos, expectedChainType: proto.ChainType_CHAIN_TYPE_APTOS, }, + { + name: "Tron Chain Type", + chainType: feeds.ChainTypeTron, + expectedChainType: proto.ChainType_CHAIN_TYPE_TRON, + }, } for _, tt := range tests { @@ -1722,6 +1733,11 @@ func Test_Service_SyncNodeInfo(t *testing.T) { chainType: feeds.ChainTypeAptos, protoType: proto.ChainType_CHAIN_TYPE_APTOS, }, + { + name: "Tron Chain Type", + chainType: feeds.ChainTypeTron, + protoType: proto.ChainType_CHAIN_TYPE_TRON, + }, } for _, tt := range tests { diff --git a/core/services/keystore/ocr2_test.go b/core/services/keystore/ocr2_test.go index 7288b86d1d1..027133294e1 100644 --- a/core/services/keystore/ocr2_test.go +++ b/core/services/keystore/ocr2_test.go @@ -192,9 +192,21 @@ func Test_OCR2KeyStore_E2E(t *testing.T) { assert.NoError(t, err) require.Equal(t, 3, len(keys)) - straknetKeys, err := ks.GetAllOfType(chaintype.StarkNet) - assert.NoError(t, err) - require.Equal(t, 1, len(straknetKeys)) - require.Equal(t, straknetKeys[0].ChainType(), chaintype.StarkNet) + starknetKeys, err := ks.GetAllOfType(chaintype.StarkNet) + require.NoError(t, err) + require.Len(t, starknetKeys, 1) + require.Equal(t, chaintype.StarkNet, starknetKeys[0].ChainType()) + + err = ks.EnsureKeys(ctx, chaintype.Tron) + require.NoError(t, err) + + keys, err = ks.GetAll() + require.NoError(t, err) + require.Len(t, keys, 4) + + tronKeys, err := ks.GetAllOfType(chaintype.Tron) + require.NoError(t, err) + require.Len(t, tronKeys, 1) + require.Equal(t, chaintype.Tron, tronKeys[0].ChainType()) }) } diff --git a/core/web/auth/auth_test.go b/core/web/auth/auth_test.go index df869a8b1a3..4af1f91f9da 100644 --- a/core/web/auth/auth_test.go +++ b/core/web/auth/auth_test.go @@ -291,6 +291,7 @@ var routesRolesMap = [...]routeRules{ {"POST", "/v2/keys/cosmos/import", false, false, false}, {"POST", "/v2/keys/starknet/import", false, false, false}, {"POST", "/v2/keys/aptos/import", false, false, false}, + {"POST", "/v2/keys/tron/import", false, false, false}, {"POST", "/v2/keys/solana/export/MOCK", false, false, false}, {"POST", "/v2/keys/cosmos/export/MOCK", false, false, false}, {"POST", "/v2/keys/starknet/export/MOCK", false, false, false}, From a181663d3dddd2a0f8dd6e50cd6ded45ecfbe046 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 15 Jan 2025 03:29:14 -0600 Subject: [PATCH 56/91] common/client: rm package; move QueryTimeout const (#15929) --- common/client/timeout.go | 5 --- core/chains/evm/client/evm_client.go | 7 ++-- core/chains/evm/client/helpers_test.go | 6 +-- .../evm/client/rpc_client_internal_test.go | 6 +-- core/chains/evm/client/rpc_client_test.go | 39 +++++++++---------- core/chains/evm/gas/fee_history_estimator.go | 6 +-- .../evm/gas/rollups/arbitrum_l1_oracle.go | 6 +-- .../gas/rollups/custom_calldata_da_oracle.go | 4 +- core/chains/evm/gas/rollups/op_l1_oracle.go | 4 +- .../evm/gas/rollups/zkSync_l1_oracle.go | 4 +- .../evm/gas/suggested_price_estimator.go | 4 +- 11 files changed, 43 insertions(+), 48 deletions(-) delete mode 100644 common/client/timeout.go diff --git a/common/client/timeout.go b/common/client/timeout.go deleted file mode 100644 index 0827b812962..00000000000 --- a/common/client/timeout.go +++ /dev/null @@ -1,5 +0,0 @@ -package client - -import "time" - -const QueryTimeout = 10 * time.Second diff --git a/core/chains/evm/client/evm_client.go b/core/chains/evm/client/evm_client.go index bf985bdfa28..5dbf67014da 100644 --- a/core/chains/evm/client/evm_client.go +++ b/core/chains/evm/client/evm_client.go @@ -8,12 +8,13 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" ) +const QueryTimeout = 10 * time.Second + func NewEvmClient(cfg evmconfig.NodePool, chainCfg multinode.ChainConfig, clientErrors evmconfig.ClientErrors, lggr logger.Logger, chainID *big.Int, nodes []*toml.Node, chainType chaintype.ChainType) (Client, error) { var primaries []multinode.Node[*big.Int, *RPCClient] var sendonlys []multinode.SendOnlyNode[*big.Int, *RPCClient] @@ -42,8 +43,8 @@ func NewEvmClient(cfg evmconfig.NodePool, chainCfg multinode.ChainConfig, client func getRPCTimeouts(chainType chaintype.ChainType) (largePayload, defaultTimeout time.Duration) { if chaintype.ChainHedera == chainType { - return 30 * time.Second, commonclient.QueryTimeout + return 30 * time.Second, QueryTimeout } - return commonclient.QueryTimeout, commonclient.QueryTimeout + return QueryTimeout, QueryTimeout } diff --git a/core/chains/evm/client/helpers_test.go b/core/chains/evm/client/helpers_test.go index 2a68870e2e5..71cdd25b8d2 100644 --- a/core/chains/evm/client/helpers_test.go +++ b/core/chains/evm/client/helpers_test.go @@ -11,10 +11,10 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" + client "github.com/smartcontractkit/chainlink-solana/pkg/solana/client/multinode" "github.com/smartcontractkit/chainlink-framework/multinode" "github.com/smartcontractkit/chainlink-framework/multinode/mocks" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -152,7 +152,7 @@ func NewChainClientWithTestNode( nodePoolCfg := TestNodePoolConfig{ NodeFinalizedBlockPollInterval: 1 * time.Second, } - rpc := NewRPCClient(nodePoolCfg, lggr, parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := NewRPCClient(nodePoolCfg, lggr, parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") n := multinode.NewNode[*big.Int, *evmtypes.Head, *RPCClient]( nodeCfg, mocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, parsed, rpcHTTPURL, "eth-primary-node-0", id, chainID, 1, rpc, "EVM") @@ -163,7 +163,7 @@ func NewChainClientWithTestNode( if u.Scheme != "http" && u.Scheme != "https" { return nil, pkgerrors.Errorf("sendonly ethereum rpc url scheme must be http(s): %s", u.String()) } - rpc := NewRPCClient(nodePoolCfg, lggr, nil, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, multinode.Secondary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := NewRPCClient(nodePoolCfg, lggr, nil, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, multinode.Secondary, client.QueryTimeout, client.QueryTimeout, "") s := multinode.NewSendOnlyNode[*big.Int, *RPCClient]( lggr, u, fmt.Sprintf("eth-sendonly-%d", i), chainID, rpc) sendonlys[i] = s diff --git a/core/chains/evm/client/rpc_client_internal_test.go b/core/chains/evm/client/rpc_client_internal_test.go index ec1a89886cd..92ea189c151 100644 --- a/core/chains/evm/client/rpc_client_internal_test.go +++ b/core/chains/evm/client/rpc_client_internal_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + client "github.com/smartcontractkit/chainlink-solana/pkg/solana/client/multinode" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -74,13 +74,13 @@ func TestRPCClient_MakeLogsValid(t *testing.T) { } for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - rpc := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") log, err := rpc.makeLogValid(ethtypes.Log{TxIndex: tc.TxIndex, Index: tc.LogIndex}) // non sei should return as is require.NoError(t, err) require.Equal(t, tc.TxIndex, log.TxIndex) require.Equal(t, tc.LogIndex, log.Index) - seiRPC := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + seiRPC := NewRPCClient(TestNodePoolConfig{}, logger.TestLogger(t), nil, nil, "eth-primary-rpc-0", 0, nil, multinode.Primary, client.QueryTimeout, client.QueryTimeout, chaintype.ChainSei) log, err = seiRPC.makeLogValid(ethtypes.Log{TxIndex: tc.TxIndex, Index: tc.LogIndex}) if tc.ExpectedError != nil { require.EqualError(t, err, tc.ExpectedError.Error()) diff --git a/core/chains/evm/client/rpc_client_test.go b/core/chains/evm/client/rpc_client_test.go index 6fc02d3b2c1..9b68e744e7d 100644 --- a/core/chains/evm/client/rpc_client_test.go +++ b/core/chains/evm/client/rpc_client_test.go @@ -26,7 +26,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-framework/multinode" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" @@ -92,7 +91,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("WS and HTTP URL cannot be both empty", func(t *testing.T) { // ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing observedLggr := logger.Test(t) - rpcClient := client.NewRPCClient(nodePoolCfgHeadPolling, observedLggr, nil, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpcClient := client.NewRPCClient(nodePoolCfgHeadPolling, observedLggr, nil, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") require.Equal(t, errors.New("cannot dial rpc client when both ws and http info are missing"), rpcClient.Dial(ctx)) }) @@ -100,7 +99,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) // set to default values @@ -149,7 +148,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -192,7 +191,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) latest, highestUserObservations := rpc.GetInterceptedChainInfo() @@ -231,7 +230,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) var wg sync.WaitGroup @@ -254,7 +253,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Block's chain ID matched configured", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch, sub, err := rpc.SubscribeToHeads(tests.Context(t)) @@ -270,7 +269,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(nodePoolCfgWSSub, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, _, err := rpc.SubscribeToHeads(ctx) @@ -280,7 +279,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Closed rpc client should remove existing SubscribeToHeads subscription with WS", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -292,7 +291,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -304,7 +303,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -315,7 +314,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Subscription error is properly wrapper", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) _, sub, err := rpc.SubscribeToHeads(ctx) @@ -345,7 +344,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { t.Run("Failed SubscribeFilterLogs when WSURL is empty", func(t *testing.T) { // ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing observedLggr := logger.Test(t) - rpcClient := client.NewRPCClient(nodePoolCfg, observedLggr, nil, &url.URL{}, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpcClient := client.NewRPCClient(nodePoolCfg, observedLggr, nil, &url.URL{}, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") require.Nil(t, rpcClient.Dial(ctx)) _, err := rpcClient.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -357,7 +356,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(nodePoolCfg, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -374,7 +373,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { return resp }) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) sub, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -403,7 +402,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { return }) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, chaintype.ChainSei) defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch := make(chan types.Log) @@ -498,7 +497,7 @@ func TestRPCClientFilterLogs(t *testing.T) { return }) wsURL := server.WSURL() - seiRPC := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainSei) + seiRPC := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, multinode.Primary, client.QueryTimeout, client.QueryTimeout, chaintype.ChainSei) defer seiRPC.Close() require.NoError(t, seiRPC.Dial(ctx)) logs, err := seiRPC.FilterLogs(ctx, ethereum.FilterQuery{}) @@ -508,7 +507,7 @@ func TestRPCClientFilterLogs(t *testing.T) { } // non sei should return index as is - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainID, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) logs, err = rpc.FilterLogs(ctx, ethereum.FilterQuery{}) @@ -557,7 +556,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(nodePoolCfg, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) defer rpc.Close() server.Head.Store(&evmtypes.Head{Number: 128}) @@ -749,7 +748,7 @@ func TestAstarCustomFinality(t *testing.T) { const expectedFinalizedBlockNumber = int64(4) const expectedFinalizedBlockHash = "0x7441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d22804" - rpcClient := client.NewRPCClient(nodePoolCfg, logger.Test(t), wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar) + rpcClient := client.NewRPCClient(nodePoolCfg, logger.Test(t), wsURL, nil, "rpc", 1, chainId, multinode.Primary, client.QueryTimeout, client.QueryTimeout, chaintype.ChainAstar) defer rpcClient.Close() err := rpcClient.Dial(tests.Context(t)) require.NoError(t, err) diff --git a/core/chains/evm/gas/fee_history_estimator.go b/core/chains/evm/gas/fee_history_estimator.go index 211528a1a7d..1e76e99c95e 100644 --- a/core/chains/evm/gas/fee_history_estimator.go +++ b/core/chains/evm/gas/fee_history_estimator.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" @@ -177,7 +177,7 @@ func (f *FeeHistoryEstimator) GetLegacyGas(ctx context.Context, _ []byte, gasLim // RefreshGasPrice will use eth_gasPrice to fetch and cache the latest gas price from the RPC. func (f *FeeHistoryEstimator) RefreshGasPrice() (*assets.Wei, error) { - ctx, cancel := f.stopCh.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := f.stopCh.CtxWithTimeout(client.QueryTimeout) defer cancel() gasPrice, err := f.client.SuggestGasPrice(ctx) @@ -231,7 +231,7 @@ func (f *FeeHistoryEstimator) GetDynamicFee(ctx context.Context, maxPrice *asset // the highest percentile we're willing to pay. A buffer is added on top of the latest baseFee to catch fluctuations in the next // blocks. On Ethereum the increase is baseFee * 1.125 per block, however in some chains that may vary. func (f *FeeHistoryEstimator) RefreshDynamicPrice() error { - ctx, cancel := f.stopCh.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := f.stopCh.CtxWithTimeout(client.QueryTimeout) defer cancel() // RewardPercentile will be used for maxPriorityFeePerGas estimations and connectivityPercentile to set the highest threshold for bumping. diff --git a/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go b/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go index 3182d920178..be0508649f9 100644 --- a/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go +++ b/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go @@ -15,8 +15,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -155,7 +155,7 @@ func (o *arbitrumL1Oracle) refresh() { } func (o *arbitrumL1Oracle) refreshWithError() error { - ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(client.QueryTimeout) defer cancel() price, err := o.fetchL1GasPrice(ctx) @@ -221,7 +221,7 @@ func (o *arbitrumL1Oracle) GasPrice(_ context.Context) (l1GasPrice *assets.Wei, // https://github.com/OffchainLabs/nitro/blob/f7645453cfc77bf3e3644ea1ac031eff629df325/contracts/src/precompiles/ArbGasInfo.sol#L69 func (o *arbitrumL1Oracle) GetPricesInArbGas() (perL2Tx uint32, perL1CalldataUnit uint32, err error) { - ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(client.QueryTimeout) defer cancel() precompile := common.HexToAddress(ArbGasInfoAddress) b, err := o.client.CallContract(ctx, ethereum.CallMsg{ diff --git a/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go b/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go index 2ed6408fd0c..7ac71d42f7a 100644 --- a/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go +++ b/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go @@ -15,8 +15,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" @@ -125,7 +125,7 @@ func (o *customCalldataDAOracle) refresh() { } func (o *customCalldataDAOracle) refreshWithError() error { - ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(client.QueryTimeout) defer cancel() price, err := o.getCustomCalldataGasPrice(ctx) diff --git a/core/chains/evm/gas/rollups/op_l1_oracle.go b/core/chains/evm/gas/rollups/op_l1_oracle.go index daf67ded259..431b57dd019 100644 --- a/core/chains/evm/gas/rollups/op_l1_oracle.go +++ b/core/chains/evm/gas/rollups/op_l1_oracle.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" @@ -235,7 +235,7 @@ func (o *optimismL1Oracle) refresh() { } func (o *optimismL1Oracle) refreshWithError() error { - ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(client.QueryTimeout) defer cancel() price, err := o.GetDAGasPrice(ctx) diff --git a/core/chains/evm/gas/rollups/zkSync_l1_oracle.go b/core/chains/evm/gas/rollups/zkSync_l1_oracle.go index 6edfb8cd28b..a9502e2b3af 100644 --- a/core/chains/evm/gas/rollups/zkSync_l1_oracle.go +++ b/core/chains/evm/gas/rollups/zkSync_l1_oracle.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/utils" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -124,7 +124,7 @@ func (o *zkSyncL1Oracle) refresh() (t *time.Timer) { func (o *zkSyncL1Oracle) refreshWithError() (t *time.Timer, err error) { t = time.NewTimer(utils.WithJitter(o.pollPeriod)) - ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(client.QueryTimeout) defer cancel() price, err := o.CalculateL1GasPrice(ctx) diff --git a/core/chains/evm/gas/suggested_price_estimator.go b/core/chains/evm/gas/suggested_price_estimator.go index 5035f76a947..0f8c23195d3 100644 --- a/core/chains/evm/gas/suggested_price_estimator.go +++ b/core/chains/evm/gas/suggested_price_estimator.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" @@ -124,7 +124,7 @@ func (o *SuggestedPriceEstimator) run() { func (o *SuggestedPriceEstimator) refreshPrice() { var res hexutil.Big - ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(client.QueryTimeout) defer cancel() if err := o.client.CallContext(ctx, &res, "eth_gasPrice"); err != nil { From 0b9bcaeb2bb5c9c95cc2a9d2859f2c04f25a72fc Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 15 Jan 2025 03:30:02 -0600 Subject: [PATCH 57/91] common: remove package internal (#15930) --- common/headtracker/head_listener.go | 8 +++++-- common/internal/utils/utils.go | 35 ----------------------------- common/txmgr/confirmer.go | 15 ++++++------- common/txmgr/txmgr.go | 18 +++++++++++---- 4 files changed, 27 insertions(+), 49 deletions(-) delete mode 100644 common/internal/utils/utils.go diff --git a/common/headtracker/head_listener.go b/common/headtracker/head_listener.go index 5f967706e04..de7bad6f21b 100644 --- a/common/headtracker/head_listener.go +++ b/common/headtracker/head_listener.go @@ -7,6 +7,7 @@ import ( "sync/atomic" "time" + "github.com/jpillora/backoff" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -14,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" - "github.com/smartcontractkit/chainlink/v2/common/internal/utils" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -200,7 +200,11 @@ func (hl *headListener[HTH, S, ID, BLOCK_HASH]) receiveHeaders(ctx context.Conte } func (hl *headListener[HTH, S, ID, BLOCK_HASH]) subscribe(ctx context.Context) bool { - subscribeRetryBackoff := utils.NewRedialBackoff() + subscribeRetryBackoff := backoff.Backoff{ + Min: 1 * time.Second, + Max: 15 * time.Second, + Jitter: true, + } chainId := hl.client.ConfiguredChainID() diff --git a/common/internal/utils/utils.go b/common/internal/utils/utils.go deleted file mode 100644 index aeaad34a142..00000000000 --- a/common/internal/utils/utils.go +++ /dev/null @@ -1,35 +0,0 @@ -package utils - -import ( - "cmp" - "slices" - "time" - - "github.com/jpillora/backoff" - "golang.org/x/exp/constraints" -) - -// NewRedialBackoff is a standard backoff to use for redialling or reconnecting to -// unreachable network endpoints -func NewRedialBackoff() backoff.Backoff { - return backoff.Backoff{ - Min: 1 * time.Second, - Max: 15 * time.Second, - Jitter: true, - } -} - -// MinFunc returns the minimum value of the given element array with respect -// to the given key function. In the event U is not a compound type (e.g a -// struct) an identity function can be provided. -func MinFunc[U any, T constraints.Ordered](elems []U, f func(U) T) T { - var min T - if len(elems) == 0 { - return min - } - - e := slices.MinFunc(elems, func(a, b U) int { - return cmp.Compare(f(a), f(b)) - }) - return f(e) -} diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index 7b5a90e70a6..54905340cbb 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -24,7 +24,6 @@ import ( commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" - iutils "github.com/smartcontractkit/chainlink/v2/common/internal/utils" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -881,14 +880,14 @@ func observeUntilTxConfirmed[ // Since a tx can have many attempts, we take the number of blocks to confirm as the block number // of the receipt minus the block number of the first ever broadcast for this transaction. - broadcastBefore := iutils.MinFunc(attempt.Tx.TxAttempts, func(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) int64 { - if attempt.BroadcastBeforeBlockNum != nil { - return *attempt.BroadcastBeforeBlockNum + var minBroadcastBefore int64 + for _, a := range attempt.Tx.TxAttempts { + if b := a.BroadcastBeforeBlockNum; b != nil && *b < minBroadcastBefore { + minBroadcastBefore = *b } - return 0 - }) - if broadcastBefore > 0 { - blocksElapsed := head.BlockNumber() - broadcastBefore + } + if minBroadcastBefore > 0 { + blocksElapsed := head.BlockNumber() - minBroadcastBefore promBlocksUntilTxConfirmed. WithLabelValues(chainID.String()). Observe(float64(blocksElapsed)) diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index 3776f62254c..55498911b85 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -9,6 +9,7 @@ import ( "time" "github.com/google/uuid" + "github.com/jpillora/backoff" nullv4 "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -18,7 +19,6 @@ import ( feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/headtracker" - iutils "github.com/smartcontractkit/chainlink/v2/common/internal/utils" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -359,7 +359,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop() go func() { defer wg.Done() // Retry indefinitely on failure - backoff := iutils.NewRedialBackoff() + backoff := newRedialBackoff() for { select { case <-time.After(backoff.Duration()): @@ -378,7 +378,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop() go func() { defer wg.Done() // Retry indefinitely on failure - backoff := iutils.NewRedialBackoff() + backoff := newRedialBackoff() for { select { case <-time.After(backoff.Duration()): @@ -397,7 +397,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop() go func() { defer wg.Done() // Retry indefinitely on failure - backoff := iutils.NewRedialBackoff() + backoff := newRedialBackoff() for { select { case <-time.After(backoff.Duration()): @@ -798,3 +798,13 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) pruneQueue return tx, nil } + +// newRedialBackoff is a standard backoff to use for redialling or reconnecting to +// unreachable network endpoints +func newRedialBackoff() backoff.Backoff { + return backoff.Backoff{ + Min: 1 * time.Second, + Max: 15 * time.Second, + Jitter: true, + } +} From 8d5d5173eacd941a256cc9a74447db0c0a1793eb Mon Sep 17 00:00:00 2001 From: dimitris Date: Wed, 15 Jan 2025 12:41:23 +0200 Subject: [PATCH 58/91] CCIPv1.6 Bootstraper - Fix peer group dialer (#15934) * fix peer group dialer * lint fix --- .../ccip/oraclecreator/bootstrap.go | 119 ++++++++++-------- .../ccip/oraclecreator/bootstrap_test.go | 39 ++++-- 2 files changed, 91 insertions(+), 67 deletions(-) diff --git a/core/capabilities/ccip/oraclecreator/bootstrap.go b/core/capabilities/ccip/oraclecreator/bootstrap.go index 40b3727640d..4f9f44a9cf0 100644 --- a/core/capabilities/ccip/oraclecreator/bootstrap.go +++ b/core/capabilities/ccip/oraclecreator/bootstrap.go @@ -240,8 +240,8 @@ type peerGroupDialer struct { oraclePeerIDs []ragep2ptypes.PeerID commitConfigDigest [32]byte - activePeerGroups []networking.PeerGroup - activeConfigDigests []cciptypes.Bytes32 + activePeerGroups []networking.PeerGroup + activeEndpointConfigDigests []cciptypes.Bytes32 syncInterval time.Duration @@ -250,8 +250,9 @@ type peerGroupDialer struct { } type syncAction struct { - actionType actionType - configDigest cciptypes.Bytes32 + actionType actionType + endpointConfigDigest cciptypes.Bytes32 + rmnHomeConfigDigest cciptypes.Bytes32 } type actionType string @@ -329,21 +330,31 @@ func (d *peerGroupDialer) Close() error { // Pure function for calculating sync actions func calculateSyncActions( - currentConfigDigests []cciptypes.Bytes32, - activeConfigDigest cciptypes.Bytes32, - candidateConfigDigest cciptypes.Bytes32, + commitConfigDigest cciptypes.Bytes32, + currentEndpointConfigDigests []cciptypes.Bytes32, + activeRmnHomeConfigDigest cciptypes.Bytes32, + candidateRmnHomeConfigDigest cciptypes.Bytes32, ) []syncAction { current := mapset.NewSet[cciptypes.Bytes32]() - for _, digest := range currentConfigDigests { + for _, digest := range currentEndpointConfigDigests { current.Add(digest) } + endpointDigestToRmnHomeDigest := make(map[cciptypes.Bytes32]cciptypes.Bytes32, 2) + desired := mapset.NewSet[cciptypes.Bytes32]() - if !activeConfigDigest.IsEmpty() { - desired.Add(activeConfigDigest) + if !activeRmnHomeConfigDigest.IsEmpty() { + endpointDigest := writePrefix(ocr2types.ConfigDigestPrefixCCIPMultiRoleRMNCombo, + sha256.Sum256(append(commitConfigDigest[:], activeRmnHomeConfigDigest[:]...))) + desired.Add(endpointDigest) + endpointDigestToRmnHomeDigest[endpointDigest] = activeRmnHomeConfigDigest } - if !candidateConfigDigest.IsEmpty() { - desired.Add(candidateConfigDigest) + + if !candidateRmnHomeConfigDigest.IsEmpty() { + endpointDigest := writePrefix(ocr2types.ConfigDigestPrefixCCIPMultiRoleRMNCombo, + sha256.Sum256(append(commitConfigDigest[:], candidateRmnHomeConfigDigest[:]...))) + desired.Add(endpointDigest) + endpointDigestToRmnHomeDigest[endpointDigest] = candidateRmnHomeConfigDigest } closeCount := current.Difference(desired).Cardinality() @@ -353,16 +364,18 @@ func calculateSyncActions( // Configs to close: in current but not in desired for digest := range current.Difference(desired).Iterator().C { actions = append(actions, syncAction{ - actionType: ActionClose, - configDigest: digest, + actionType: ActionClose, + rmnHomeConfigDigest: endpointDigestToRmnHomeDigest[digest], + endpointConfigDigest: digest, }) } // Configs to create: in desired but not in current for digest := range desired.Difference(current).Iterator().C { actions = append(actions, syncAction{ - actionType: ActionCreate, - configDigest: digest, + actionType: ActionCreate, + rmnHomeConfigDigest: endpointDigestToRmnHomeDigest[digest], + endpointConfigDigest: digest, }) } @@ -373,17 +386,18 @@ func (d *peerGroupDialer) sync() { d.mu.Lock() defer d.mu.Unlock() - activeDigest, candidateDigest := d.rmnHomeReader.GetAllConfigDigests() + activeRmnHomeDigest, candidateRmnHomeDigest := d.rmnHomeReader.GetAllConfigDigests() lggr := logger2.With( d.lggr, "method", "sync", - "activeDigest", activeDigest, - "candidateDigest", candidateDigest, - "activeConfigDigests", d.activeConfigDigests, + "activeRmnHomeDigest", activeRmnHomeDigest.String(), + "candidateRmnHomeDigest", candidateRmnHomeDigest.String(), + "activeEndpointConfigDigests", fmt.Sprintf("%s", d.activeEndpointConfigDigests), ) - actions := calculateSyncActions(d.activeConfigDigests, activeDigest, candidateDigest) + actions := calculateSyncActions( + d.commitConfigDigest, d.activeEndpointConfigDigests, activeRmnHomeDigest, candidateRmnHomeDigest) if len(actions) == 0 { lggr.Debugw("No peer group actions needed") return @@ -393,14 +407,18 @@ func (d *peerGroupDialer) sync() { // Handle each action for _, action := range actions { + actionLggr := logger2.With(lggr, + "action", action.actionType, + "endpointConfigDigest", action.endpointConfigDigest, + "rmnHomeConfigDigest", action.rmnHomeConfigDigest) + switch action.actionType { case ActionClose: - d.closePeerGroup(action.configDigest) + d.closePeerGroup(action.endpointConfigDigest) + actionLggr.Infow("Peer group closed successfully") case ActionCreate: - if err := d.createPeerGroup(action.configDigest); err != nil { - lggr.Errorw("Failed to create peer group", - "configDigest", action.configDigest, - "err", err) + if err := d.createPeerGroup(action.endpointConfigDigest, action.rmnHomeConfigDigest); err != nil { + actionLggr.Errorw("Failed to create peer group", "err", err) // Consider closing all groups on error d.closeExistingPeerGroups() return @@ -410,53 +428,43 @@ func (d *peerGroupDialer) sync() { } // Helper function to close specific peer group -func (d *peerGroupDialer) closePeerGroup(configDigest cciptypes.Bytes32) { - for i, digest := range d.activeConfigDigests { - if digest == configDigest { +func (d *peerGroupDialer) closePeerGroup(endpointConfigDigest cciptypes.Bytes32) { + lggr := d.lggr.With("genericEndpointConfigDigest", endpointConfigDigest.String()) + + for i, digest := range d.activeEndpointConfigDigests { + if digest == endpointConfigDigest { if err := d.activePeerGroups[i].Close(); err != nil { - d.lggr.Warnw("Failed to close peer group", - "configDigest", configDigest, - "err", err) + lggr.Warnw("Failed to close peer group", "err", err) } else { - d.lggr.Infow("Closed peer group successfully", - "configDigest", configDigest) + d.lggr.Infow("Closed peer group successfully") } + // Remove from active groups and digests d.activePeerGroups = append(d.activePeerGroups[:i], d.activePeerGroups[i+1:]...) - d.activeConfigDigests = append(d.activeConfigDigests[:i], d.activeConfigDigests[i+1:]...) + d.activeEndpointConfigDigests = append( + d.activeEndpointConfigDigests[:i], d.activeEndpointConfigDigests[i+1:]...) return } } } -func (d *peerGroupDialer) createPeerGroup(rmnHomeConfigDigest cciptypes.Bytes32) error { +func (d *peerGroupDialer) createPeerGroup( + endpointConfigDigest cciptypes.Bytes32, + rmnHomeConfigDigest cciptypes.Bytes32, +) error { rmnNodesInfo, err := d.rmnHomeReader.GetRMNNodesInfo(rmnHomeConfigDigest) if err != nil { return fmt.Errorf("get RMN nodes info: %w", err) } - // Create generic endpoint config digest by hashing commit config digest and rmn home config digest - h := sha256.Sum256(append(d.commitConfigDigest[:], rmnHomeConfigDigest[:]...)) - genericEndpointConfigDigest := writePrefix(ocr2types.ConfigDigestPrefixCCIPMultiRoleRMNCombo, h) - - // Combine oracle peer IDs with RMN node peer IDs - peerIDs := make([]string, 0, len(d.oraclePeerIDs)+len(rmnNodesInfo)) - for _, p := range d.oraclePeerIDs { - peerIDs = append(peerIDs, p.String()) - } - for _, n := range rmnNodesInfo { - peerIDs = append(peerIDs, n.PeerID.String()) - } - lggr := d.lggr.With( - "genericEndpointConfigDigest", genericEndpointConfigDigest.String(), - "peerIDs", peerIDs, - "bootstrappers", d.bootstrapLocators, + "genericEndpointConfigDigest", endpointConfigDigest.String(), + "rmnHomeConfigDigest", rmnHomeConfigDigest.String(), ) lggr.Infow("Creating new peer group") peerGroup, err := d.peerGroupCreator.Create(peergroup.CreateOpts{ - CommitConfigDigest: cciptypes.Bytes32(d.commitConfigDigest), + CommitConfigDigest: d.commitConfigDigest, RMNHomeConfigDigest: rmnHomeConfigDigest, OraclePeerIDs: d.oraclePeerIDs, RMNNodes: rmnNodesInfo, @@ -464,10 +472,11 @@ func (d *peerGroupDialer) createPeerGroup(rmnHomeConfigDigest cciptypes.Bytes32) if err != nil { return fmt.Errorf("new peer group: %w", err) } + lggr.Infow("Created new peer group successfully") d.activePeerGroups = append(d.activePeerGroups, peerGroup.PeerGroup) - d.activeConfigDigests = append(d.activeConfigDigests, genericEndpointConfigDigest) + d.activeEndpointConfigDigests = append(d.activeEndpointConfigDigests, endpointConfigDigest) return nil } @@ -483,7 +492,7 @@ func (d *peerGroupDialer) closeExistingPeerGroups() { } d.activePeerGroups = []networking.PeerGroup{} - d.activeConfigDigests = []cciptypes.Bytes32{} + d.activeEndpointConfigDigests = []cciptypes.Bytes32{} } func writePrefix(prefix ocr2types.ConfigDigestPrefix, hash cciptypes.Bytes32) cciptypes.Bytes32 { diff --git a/core/capabilities/ccip/oraclecreator/bootstrap_test.go b/core/capabilities/ccip/oraclecreator/bootstrap_test.go index 1b1cc9dc0d2..95887cc2684 100644 --- a/core/capabilities/ccip/oraclecreator/bootstrap_test.go +++ b/core/capabilities/ccip/oraclecreator/bootstrap_test.go @@ -2,9 +2,11 @@ package oraclecreator import ( "bytes" + "crypto/sha256" "sort" "testing" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/require" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" @@ -31,7 +33,7 @@ func TestCalculateSyncActions(t *testing.T) { activeDigest: cciptypes.Bytes32{1}, candidateDigest: cciptypes.Bytes32{}, // empty expectedActions: []syncAction{ - {actionType: ActionClose, configDigest: cciptypes.Bytes32{2}}, + {actionType: ActionClose, endpointConfigDigest: cciptypes.Bytes32{2}}, }, }, { @@ -40,7 +42,7 @@ func TestCalculateSyncActions(t *testing.T) { activeDigest: cciptypes.Bytes32{1}, candidateDigest: cciptypes.Bytes32{2}, expectedActions: []syncAction{ - {actionType: ActionCreate, configDigest: cciptypes.Bytes32{2}}, + {actionType: ActionCreate, endpointConfigDigest: cciptypes.Bytes32{2}}, }, }, { @@ -49,8 +51,8 @@ func TestCalculateSyncActions(t *testing.T) { activeDigest: cciptypes.Bytes32{}, candidateDigest: cciptypes.Bytes32{}, expectedActions: []syncAction{ - {actionType: ActionClose, configDigest: cciptypes.Bytes32{1}}, - {actionType: ActionClose, configDigest: cciptypes.Bytes32{2}}, + {actionType: ActionClose, endpointConfigDigest: cciptypes.Bytes32{1}}, + {actionType: ActionClose, endpointConfigDigest: cciptypes.Bytes32{2}}, }, }, { @@ -59,18 +61,27 @@ func TestCalculateSyncActions(t *testing.T) { activeDigest: cciptypes.Bytes32{3}, candidateDigest: cciptypes.Bytes32{4}, expectedActions: []syncAction{ - {actionType: ActionClose, configDigest: cciptypes.Bytes32{1}}, - {actionType: ActionClose, configDigest: cciptypes.Bytes32{2}}, - {actionType: ActionCreate, configDigest: cciptypes.Bytes32{3}}, - {actionType: ActionCreate, configDigest: cciptypes.Bytes32{4}}, + {actionType: ActionClose, endpointConfigDigest: cciptypes.Bytes32{1}}, + {actionType: ActionClose, endpointConfigDigest: cciptypes.Bytes32{2}}, + {actionType: ActionCreate, endpointConfigDigest: cciptypes.Bytes32{3}}, + {actionType: ActionCreate, endpointConfigDigest: cciptypes.Bytes32{4}}, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + commitConfigDigest := cciptypes.Bytes32{1} + + currentDigests := make([]cciptypes.Bytes32, len(tt.currentDigests)) + for i, d := range tt.currentDigests { + currentDigests[i] = writePrefix(ocr2types.ConfigDigestPrefixCCIPMultiRoleRMNCombo, + sha256.Sum256(append(commitConfigDigest[:], d[:]...))) + } + actions := calculateSyncActions( - tt.currentDigests, + commitConfigDigest, + currentDigests, tt.activeDigest, tt.candidateDigest, ) @@ -82,18 +93,22 @@ func TestCalculateSyncActions(t *testing.T) { if actions[i].actionType != actions[j].actionType { return actions[i].actionType < actions[j].actionType } - return bytes.Compare(actions[i].configDigest[:], actions[j].configDigest[:]) < 0 + return bytes.Compare(actions[i].endpointConfigDigest[:], actions[j].endpointConfigDigest[:]) < 0 }) sort.Slice(tt.expectedActions, func(i, j int) bool { if tt.expectedActions[i].actionType != tt.expectedActions[j].actionType { return tt.expectedActions[i].actionType < tt.expectedActions[j].actionType } - return bytes.Compare(tt.expectedActions[i].configDigest[:], tt.expectedActions[j].configDigest[:]) < 0 + return bytes.Compare(tt.expectedActions[i].endpointConfigDigest[:], tt.expectedActions[j].endpointConfigDigest[:]) < 0 }) for i := range actions { require.Equal(t, tt.expectedActions[i].actionType, actions[i].actionType) - require.Equal(t, tt.expectedActions[i].configDigest, actions[i].configDigest) + + expEndpointConfigDigest := writePrefix(ocr2types.ConfigDigestPrefixCCIPMultiRoleRMNCombo, + sha256.Sum256(append(commitConfigDigest[:], tt.expectedActions[i].endpointConfigDigest[:]...))) + + require.Equal(t, expEndpointConfigDigest, actions[i].endpointConfigDigest) } }) } From fed9c2cec183feccb5ef8889eaf5dcf90da32350 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 15 Jan 2025 04:58:55 -0600 Subject: [PATCH 59/91] common/types: move ChainStatusWithID and rename to NetworkChainStatus (#15928) --- common/types/chain.go | 9 ------- .../mocks/relayer_chain_interoperators.go | 3 +-- .../chainlink/relayer_chain_interoperators.go | 15 +++++++---- core/web/chains_controller.go | 5 ++-- core/web/loader/chain.go | 11 ++++---- core/web/loader/getters.go | 10 +++---- core/web/loader/loader_test.go | 26 +++++++++---------- core/web/presenters/chain.go | 8 +++--- core/web/resolver/chain.go | 16 ++++++------ core/web/resolver/query.go | 18 ++++++------- 10 files changed, 57 insertions(+), 64 deletions(-) diff --git a/common/types/chain.go b/common/types/chain.go index bf4654142a8..35b3b0ca3f7 100644 --- a/common/types/chain.go +++ b/common/types/chain.go @@ -2,8 +2,6 @@ package types import ( "fmt" - - "github.com/smartcontractkit/chainlink-common/pkg/types" ) // Sequence represents the base type, for any chain's sequence object. @@ -16,10 +14,3 @@ type Sequence interface { // ID represents the base type, for any chain's ID. // It should be convertible to a string, that can uniquely identify this chain type ID fmt.Stringer - -// ChainStatusWithID compose of ChainStatus and RelayID. This is useful for -// storing the Network associated with the ChainStatus. -type ChainStatusWithID struct { - types.ChainStatus - types.RelayID -} diff --git a/core/services/chainlink/mocks/relayer_chain_interoperators.go b/core/services/chainlink/mocks/relayer_chain_interoperators.go index bc30ede77ee..8d943243188 100644 --- a/core/services/chainlink/mocks/relayer_chain_interoperators.go +++ b/core/services/chainlink/mocks/relayer_chain_interoperators.go @@ -4,7 +4,6 @@ import ( "context" "slices" - commonTypes "github.com/smartcontractkit/chainlink/v2/common/types" services2 "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -70,6 +69,6 @@ func (f *FakeRelayerChainInteroperators) ChainStatus(ctx context.Context, id typ panic("unimplemented") } -func (f *FakeRelayerChainInteroperators) ChainStatuses(ctx context.Context, offset, limit int) ([]commonTypes.ChainStatusWithID, int, error) { +func (f *FakeRelayerChainInteroperators) ChainStatuses(ctx context.Context, offset, limit int) ([]chainlink.NetworkChainStatus, int, error) { panic("unimplemented") } diff --git a/core/services/chainlink/relayer_chain_interoperators.go b/core/services/chainlink/relayer_chain_interoperators.go index 6242af51935..f8d6de99c8f 100644 --- a/core/services/chainlink/relayer_chain_interoperators.go +++ b/core/services/chainlink/relayer_chain_interoperators.go @@ -14,7 +14,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay" - commonTypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/services" @@ -52,9 +51,15 @@ type LegacyChainer interface { LegacyCosmosChains() LegacyCosmosContainer } +// NetworkChainStatus is a ChainStatus from a particlar Network. +type NetworkChainStatus struct { + Network string + types.ChainStatus +} + type ChainStatuser interface { ChainStatus(ctx context.Context, id types.RelayID) (types.ChainStatus, error) - ChainStatuses(ctx context.Context, offset, limit int) ([]commonTypes.ChainStatusWithID, int, error) + ChainStatuses(ctx context.Context, offset, limit int) ([]NetworkChainStatus, int, error) } // NodesStatuser is an interface for node configuration and state. @@ -279,9 +284,9 @@ func (rs *CoreRelayerChainInteroperators) ChainStatus(ctx context.Context, id ty return lr.GetChainStatus(ctx) } -func (rs *CoreRelayerChainInteroperators) ChainStatuses(ctx context.Context, offset, limit int) ([]commonTypes.ChainStatusWithID, int, error) { +func (rs *CoreRelayerChainInteroperators) ChainStatuses(ctx context.Context, offset, limit int) ([]NetworkChainStatus, int, error) { var ( - stats []commonTypes.ChainStatusWithID + stats []NetworkChainStatus totalErr error ) rs.mu.Lock() @@ -301,7 +306,7 @@ func (rs *CoreRelayerChainInteroperators) ChainStatuses(ctx context.Context, off totalErr = errors.Join(totalErr, err) continue } - stats = append(stats, commonTypes.ChainStatusWithID{ChainStatus: stat, RelayID: rid}) + stats = append(stats, NetworkChainStatus{ChainStatus: stat, Network: rid.Network}) } if totalErr != nil { diff --git a/core/web/chains_controller.go b/core/web/chains_controller.go index a99cbf4ca4b..473bf3c490c 100644 --- a/core/web/chains_controller.go +++ b/core/web/chains_controller.go @@ -8,7 +8,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types" - commonTypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -33,7 +32,7 @@ func (e errChainDisabled) Error() string { type chainsController struct { chainStats chainlink.RelayerChainInteroperators - newResource func(commonTypes.ChainStatusWithID) presenters.ChainResource + newResource func(chainlink.NetworkChainStatus) presenters.ChainResource lggr logger.Logger auditLogger audit.AuditLogger } @@ -71,7 +70,7 @@ func (cc *chainsController) Index(c *gin.Context, size, page, offset int) { func (cc *chainsController) Show(c *gin.Context) { relayID := types.RelayID{Network: c.Param("network"), ChainID: c.Param("ID")} chain, err := cc.chainStats.ChainStatus(c.Request.Context(), relayID) - status := commonTypes.ChainStatusWithID{ChainStatus: chain, RelayID: relayID} + status := chainlink.NetworkChainStatus{ChainStatus: chain, Network: relayID.Network} if err != nil { jsonAPIError(c, http.StatusBadRequest, err) return diff --git a/core/web/loader/chain.go b/core/web/loader/chain.go index 0c66f55da4b..35b38f2c1ec 100644 --- a/core/web/loader/chain.go +++ b/core/web/loader/chain.go @@ -8,7 +8,6 @@ import ( commonTypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) @@ -28,7 +27,7 @@ func (b *chainBatcher) loadByIDs(ctx context.Context, keys dataloader.Keys) []*d keyOrder[key.String()] = ix } - var cs []types.ChainStatusWithID + var cs []chainlink.NetworkChainStatus relayersMap, err := b.app.GetRelayers().GetIDToRelayerMap() if err != nil { return []*dataloader.Result{{Data: nil, Error: err}} @@ -41,9 +40,9 @@ func (b *chainBatcher) loadByIDs(ctx context.Context, keys dataloader.Keys) []*d } if slices.Contains(chainIDs, s.ID) { - cs = append(cs, types.ChainStatusWithID{ + cs = append(cs, chainlink.NetworkChainStatus{ ChainStatus: s, - RelayID: k, + Network: k.Network, }) } } @@ -94,9 +93,9 @@ func (b *chainBatcher) loadByRelayIDs(ctx context.Context, keys dataloader.Keys) continue } - results = append(results, &dataloader.Result{Data: types.ChainStatusWithID{ + results = append(results, &dataloader.Result{Data: chainlink.NetworkChainStatus{ ChainStatus: status, - RelayID: relay, + Network: relay.Network, }, Error: err}) } diff --git a/core/web/loader/getters.go b/core/web/loader/getters.go index fef84b5eabd..e38a5a1459e 100644 --- a/core/web/loader/getters.go +++ b/core/web/loader/getters.go @@ -7,9 +7,9 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - commonTypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/feeds" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" @@ -21,7 +21,7 @@ var ErrInvalidType = errors.New("invalid type") // GetChainByID fetches the chain by it's id. // Deprecated: use GetChainByRelayID. -func GetChainByID(ctx context.Context, id string) (*commonTypes.ChainStatusWithID, error) { +func GetChainByID(ctx context.Context, id string) (*chainlink.NetworkChainStatus, error) { ldr := For(ctx) thunk := ldr.ChainsByIDLoader.Load(ctx, dataloader.StringKey(id)) @@ -30,7 +30,7 @@ func GetChainByID(ctx context.Context, id string) (*commonTypes.ChainStatusWithI return nil, err } - chain, ok := result.(commonTypes.ChainStatusWithID) + chain, ok := result.(chainlink.NetworkChainStatus) if !ok { return nil, ErrInvalidType } @@ -39,7 +39,7 @@ func GetChainByID(ctx context.Context, id string) (*commonTypes.ChainStatusWithI } // GetChainByRelayID fetches the chain by it's relayId. -func GetChainByRelayID(ctx context.Context, id string) (*commonTypes.ChainStatusWithID, error) { +func GetChainByRelayID(ctx context.Context, id string) (*chainlink.NetworkChainStatus, error) { ldr := For(ctx) thunk := ldr.ChainsByRelayIDLoader.Load(ctx, dataloader.StringKey(id)) @@ -48,7 +48,7 @@ func GetChainByRelayID(ctx context.Context, id string) (*commonTypes.ChainStatus return nil, err } - chain, ok := result.(commonTypes.ChainStatusWithID) + chain, ok := result.(chainlink.NetworkChainStatus) if !ok { return nil, ErrInvalidType } diff --git a/core/web/loader/loader_test.go b/core/web/loader/loader_test.go index 953c0ff9319..a48b6ceb4b2 100644 --- a/core/web/loader/loader_test.go +++ b/core/web/loader/loader_test.go @@ -13,12 +13,12 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" evmtxmgrmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks" evmutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/relay" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" @@ -73,17 +73,17 @@ func TestLoader_Chains(t *testing.T) { assert.Len(t, results, 3) require.NoError(t, err) - want2 := types.ChainStatusWithID{ + want2 := chainlink.NetworkChainStatus{ ChainStatus: commontypes.ChainStatus{ID: "2", Enabled: true, Config: config2}, - RelayID: commontypes.RelayID{Network: relay.NetworkEVM, ChainID: "2"}, + Network: relay.NetworkEVM, } - assert.Equal(t, want2, results[0].Data.(types.ChainStatusWithID)) + assert.Equal(t, want2, results[0].Data.(chainlink.NetworkChainStatus)) - want1 := types.ChainStatusWithID{ + want1 := chainlink.NetworkChainStatus{ ChainStatus: commontypes.ChainStatus{ID: "1", Enabled: true, Config: config1}, - RelayID: commontypes.RelayID{Network: relay.NetworkEVM, ChainID: "1"}, + Network: relay.NetworkEVM, } - assert.Equal(t, want1, results[1].Data.(types.ChainStatusWithID)) + assert.Equal(t, want1, results[1].Data.(chainlink.NetworkChainStatus)) assert.Nil(t, results[2].Data) assert.Error(t, results[2].Error) assert.ErrorIs(t, results[2].Error, chains.ErrNotFound) @@ -148,15 +148,15 @@ func TestLoader_ChainsRelayID_HandleDuplicateIDAcrossNetworks(t *testing.T) { require.NoError(t, err) - assert.Equal(t, types.ChainStatusWithID{ + assert.Equal(t, chainlink.NetworkChainStatus{ ChainStatus: commontypes.ChainStatus{ID: "2", Enabled: true, Config: config2}, - RelayID: evm2, - }, results[0].Data.(types.ChainStatusWithID)) + Network: evm2.Network, + }, results[0].Data.(chainlink.NetworkChainStatus)) - assert.Equal(t, types.ChainStatusWithID{ + assert.Equal(t, chainlink.NetworkChainStatus{ ChainStatus: commontypes.ChainStatus{ID: "1", Enabled: true, Config: config1}, - RelayID: evm1, - }, results[1].Data.(types.ChainStatusWithID)) + Network: evm1.Network, + }, results[1].Data.(chainlink.NetworkChainStatus)) assert.Nil(t, results[2].Data) require.Error(t, results[2].Error) require.ErrorIs(t, results[2].Error, chains.ErrNotFound) diff --git a/core/web/presenters/chain.go b/core/web/presenters/chain.go index 280f7a7f8d4..d5a51e4509a 100644 --- a/core/web/presenters/chain.go +++ b/core/web/presenters/chain.go @@ -2,7 +2,7 @@ package presenters import ( "github.com/smartcontractkit/chainlink-common/pkg/types" - commonTypes "github.com/smartcontractkit/chainlink/v2/common/types" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) type ChainResource struct { @@ -18,10 +18,10 @@ func (r ChainResource) GetName() string { } // NewChainResource returns a new ChainResource for chain. -func NewChainResource(chain commonTypes.ChainStatusWithID) ChainResource { +func NewChainResource(chain chainlink.NetworkChainStatus) ChainResource { return ChainResource{ - JAID: NewJAID(chain.RelayID.ChainID), - Network: chain.RelayID.Network, + JAID: NewJAID(chain.ID), + Network: chain.Network, Config: chain.Config, Enabled: chain.Enabled, } diff --git a/core/web/resolver/chain.go b/core/web/resolver/chain.go index 9e06c5a6308..0e8f3c35ea9 100644 --- a/core/web/resolver/chain.go +++ b/core/web/resolver/chain.go @@ -3,19 +3,19 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/common/types" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) // ChainResolver resolves the Chain type. type ChainResolver struct { - chain types.ChainStatusWithID + chain chainlink.NetworkChainStatus } -func NewChain(chain types.ChainStatusWithID) *ChainResolver { +func NewChain(chain chainlink.NetworkChainStatus) *ChainResolver { return &ChainResolver{chain: chain} } -func NewChains(chains []types.ChainStatusWithID) []*ChainResolver { +func NewChains(chains []chainlink.NetworkChainStatus) []*ChainResolver { var resolvers []*ChainResolver for _, c := range chains { resolvers = append(resolvers, NewChain(c)) @@ -45,11 +45,11 @@ func (r *ChainResolver) Network() string { } type ChainPayloadResolver struct { - chain types.ChainStatusWithID + chain chainlink.NetworkChainStatus NotFoundErrorUnionType } -func NewChainPayload(chain types.ChainStatusWithID, err error) *ChainPayloadResolver { +func NewChainPayload(chain chainlink.NetworkChainStatus, err error) *ChainPayloadResolver { e := NotFoundErrorUnionType{err: err, message: "chain not found", isExpectedErrorFn: nil} return &ChainPayloadResolver{chain: chain, NotFoundErrorUnionType: e} @@ -64,11 +64,11 @@ func (r *ChainPayloadResolver) ToChain() (*ChainResolver, bool) { } type ChainsPayloadResolver struct { - chains []types.ChainStatusWithID + chains []chainlink.NetworkChainStatus total int32 } -func NewChainsPayload(chains []types.ChainStatusWithID, total int32) *ChainsPayloadResolver { +func NewChainsPayload(chains []chainlink.NetworkChainStatus, total int32) *ChainsPayloadResolver { return &ChainsPayloadResolver{chains: chains, total: total} } diff --git a/core/web/resolver/query.go b/core/web/resolver/query.go index 6348b805b3a..67bad52c111 100644 --- a/core/web/resolver/query.go +++ b/core/web/resolver/query.go @@ -11,8 +11,8 @@ import ( "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - commonTypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" @@ -80,7 +80,7 @@ func (r *Resolver) Chain(ctx context.Context, id, err := loader.GetChainByID(ctx, string(args.ID)) if err != nil { if errors.Is(err, chains.ErrNotFound) { - return NewChainPayload(commonTypes.ChainStatusWithID{}, chains.ErrNotFound), nil + return NewChainPayload(chainlink.NetworkChainStatus{}, chains.ErrNotFound), nil } return nil, err } @@ -91,7 +91,7 @@ func (r *Resolver) Chain(ctx context.Context, id, err := loader.GetChainByRelayID(ctx, relayID.Name()) if err != nil { if errors.Is(err, chains.ErrNotFound) { - return NewChainPayload(commonTypes.ChainStatusWithID{}, chains.ErrNotFound), nil + return NewChainPayload(chainlink.NetworkChainStatus{}, chains.ErrNotFound), nil } return nil, err } @@ -111,21 +111,21 @@ func (r *Resolver) Chains(ctx context.Context, args struct { offset := pageOffset(args.Offset) limit := pageLimit(args.Limit) - var chains []commonTypes.ChainStatusWithID relayersMap, err := r.App.GetRelayers().GetIDToRelayerMap() if err != nil { return nil, err } + chains := make([]chainlink.NetworkChainStatus, 0, len(relayersMap)) for k, v := range relayersMap { s, err := v.GetChainStatus(ctx) if err != nil { return nil, err } - chains = append(chains, commonTypes.ChainStatusWithID{ + chains = append(chains, chainlink.NetworkChainStatus{ ChainStatus: s, - RelayID: k, + Network: k.Network, }) } @@ -136,10 +136,10 @@ func (r *Resolver) Chains(ctx context.Context, args struct { } // bound the chain results - if offset >= len(chains) { + if offset >= count { return nil, fmt.Errorf("offset %d out of range", offset) } - end := len(chains) + end := count if limit > 0 && offset+limit < end { end = offset + limit } @@ -148,7 +148,7 @@ func (r *Resolver) Chains(ctx context.Context, args struct { return NewChainsPayload(chains[offset:end], int32(count)), nil } -func sortByNetworkAndID(chains []commonTypes.ChainStatusWithID) { +func sortByNetworkAndID(chains []chainlink.NetworkChainStatus) { sort.SliceStable(chains, func(i, j int) bool { if chains[i].Network == chains[j].Network { return chains[i].ID < chains[j].ID From 5314b4127404aa2f402cd396c3088923136ac9d0 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Wed, 15 Jan 2025 12:39:18 +0100 Subject: [PATCH 60/91] CCIP-4761 EIP-7623 support (#15904) * init eip-7623 support * only pass required args into _getTokenTransferCost * only pass required items into _parseEVMExtraArgsFromBytes * better names * add vals offchain * changeset * Update feequoter.go * fix lint * [Bot] Update changeset file with jira issues * fix typo rm () * fix typo --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> --- contracts/.changeset/little-frogs-roll.md | 10 + contracts/gas-snapshots/ccip.gas-snapshot | 200 +++++++++--------- contracts/src/v0.8/ccip/FeeQuoter.sol | 131 +++++++----- .../feeQuoter/FeeQuoter.getValidatedFee.t.sol | 30 +-- ...FeeQuoter.parseEVMExtraArgsFromBytes.t.sol | 12 +- .../ccip/test/feeQuoter/FeeQuoterSetup.t.sol | 12 +- .../ccip/test/helpers/FeeQuoterHelper.sol | 26 ++- core/capabilities/ccip/ccipevm/gas_helpers.go | 14 +- .../ccip/generated/fee_quoter/fee_quoter.go | 18 +- ...rapper-dependency-versions-do-not-edit.txt | 2 +- .../ccip/changeset/cs_chain_contracts.go | 4 +- deployment/ccip/changeset/test_assertions.go | 4 +- deployment/ccip/view/v1_6/feequoter.go | 8 +- 13 files changed, 277 insertions(+), 194 deletions(-) create mode 100644 contracts/.changeset/little-frogs-roll.md diff --git a/contracts/.changeset/little-frogs-roll.md b/contracts/.changeset/little-frogs-roll.md new file mode 100644 index 00000000000..f8883bf7f42 --- /dev/null +++ b/contracts/.changeset/little-frogs-roll.md @@ -0,0 +1,10 @@ +--- +'@chainlink/contracts': patch +--- + +#internal add EIP-7623 support + + +PR issue: CCIP-4761 + +Solidity Review issue: CCIP-3966 \ No newline at end of file diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index afc2768185f..942e75dc516 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -6,7 +6,7 @@ BurnMintTokenPool_releaseOrMint:test_PoolMint() (gas: 102527) BurnMintWithLockReleaseFlagTokenPool_lockOrBurn:test_LockOrBurn_CorrectReturnData() (gas: 237292) BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 239012) BurnWithFromMintTokenPool_lockOrBurn:test_Setup() (gas: 24169) -CCIPClientExample_sanity:test_ImmutableExamples() (gas: 2072849) +CCIPClientExample_sanity:test_ImmutableExamples() (gas: 2073613) CCIPHome__validateConfig:test__validateConfig() (gas: 300016) CCIPHome__validateConfig:test__validateConfigLessTransmittersThanSigners() (gas: 332965) CCIPHome__validateConfig:test__validateConfigSmallerFChain() (gas: 459322) @@ -24,7 +24,7 @@ CCIPHome_setCandidate:test_setCandidate() (gas: 1365392) CCIPHome_supportsInterface:test_supportsInterface() (gas: 9885) DefensiveExampleTest:test_HappyPath() (gas: 200517) DefensiveExampleTest:test_Recovery() (gas: 424996) -E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1490237) +E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1490723) ERC165CheckerReverting_supportsInterfaceReverting:test__supportsInterfaceReverting() (gas: 10445) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96964) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49797) @@ -59,39 +59,39 @@ FactoryBurnMintERC20_increaseApproval:test_IncreaseApproval() (gas: 44421) FactoryBurnMintERC20_mint:test_BasicMint() (gas: 149826) FactoryBurnMintERC20_supportsInterface:test_SupportsInterface() (gas: 11539) FactoryBurnMintERC20_transfer:test_Transfer() (gas: 42505) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates() (gas: 141541) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput() (gas: 12536) -FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates() (gas: 162691) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens() (gas: 54793) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken() (gas: 45276) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12380) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig() (gas: 88736) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13218) -FeeQuoter_constructor:test_Setup() (gas: 5039899) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates() (gas: 149177) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput() (gas: 12493) +FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates() (gas: 162480) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens() (gas: 54881) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken() (gas: 45364) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12468) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig() (gas: 88604) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13196) +FeeQuoter_constructor:test_Setup() (gas: 5034079) FeeQuoter_convertTokenAmount:test_ConvertTokenAmount() (gas: 68417) -FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost() (gas: 96377) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost() (gas: 21075) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector() (gas: 14836) +FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost() (gas: 98963) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost() (gas: 21527) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector() (gas: 14904) FeeQuoter_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices() (gas: 73123) -FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled() (gas: 111926) -FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice() (gas: 109013) -FeeQuoter_getTokenPrice:test_GetTokenPriceFromFeed() (gas: 68180) -FeeQuoter_getTokenPrice:test_GetTokenPrice_LocalMoreRecent() (gas: 33568) +FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled() (gas: 113611) +FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice() (gas: 110698) +FeeQuoter_getTokenPrice:test_GetTokenPriceFromFeed() (gas: 68158) +FeeQuoter_getTokenPrice:test_GetTokenPrice_LocalMoreRecent() (gas: 33546) FeeQuoter_getTokenPrices:test_GetTokenPrices() (gas: 78534) -FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee() (gas: 37322) -FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee() (gas: 35101) -FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas() (gas: 28149) -FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee() (gas: 96077) -FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee() (gas: 20587) -FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas() (gas: 27978) -FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas() (gas: 27979) -FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee() (gas: 40537) -FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults() (gas: 29706) -FeeQuoter_getValidatedFee:test_EmptyMessage() (gas: 83608) -FeeQuoter_getValidatedFee:test_HighGasMessage() (gas: 240058) -FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer() (gas: 143671) -FeeQuoter_getValidatedFee:test_SingleTokenMessage() (gas: 115178) -FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier() (gas: 63919) +FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee() (gas: 34575) +FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee() (gas: 32354) +FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas() (gas: 25402) +FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee() (gas: 91665) +FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee() (gas: 17863) +FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas() (gas: 25231) +FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas() (gas: 25232) +FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee() (gas: 37790) +FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults() (gas: 26926) +FeeQuoter_getValidatedFee:test_EmptyMessage() (gas: 84794) +FeeQuoter_getValidatedFee:test_HighGasMessage() (gas: 242730) +FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer() (gas: 143322) +FeeQuoter_getValidatedFee:test_SingleTokenMessage() (gas: 114915) +FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier() (gas: 66086) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice() (gas: 58905) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed() (gas: 65115) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals() (gas: 1897724) @@ -102,30 +102,30 @@ FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecim FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value() (gas: 1897534) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod() (gas: 65233) FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken() (gas: 61854) -FeeQuoter_onReport:test_OnReport_SkipPriceUpdateWhenStaleUpdateReceived() (gas: 52631) -FeeQuoter_onReport:test_onReport() (gas: 89096) -FeeQuoter_onReport:test_onReport_withKeystoneForwarderContract() (gas: 122724) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsDefault() (gas: 17207) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV1() (gas: 18283) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV2() (gas: 18391) -FeeQuoter_processMessageArgs:test_processMessageArgs_WitEVMExtraArgsV2() (gas: 28669) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithConvertedTokenAmount() (gas: 30001) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithCorrectPoolReturnData() (gas: 76624) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithEVMExtraArgsV1() (gas: 28300) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithEmptyEVMExtraArgs() (gas: 26158) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithLinkTokenAmount() (gas: 19641) +FeeQuoter_onReport:test_OnReport_SkipPriceUpdateWhenStaleUpdateReceived() (gas: 52565) +FeeQuoter_onReport:test_onReport() (gas: 88942) +FeeQuoter_onReport:test_onReport_withKeystoneForwarderContract() (gas: 122570) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsDefault() (gas: 17113) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV1() (gas: 16202) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV2() (gas: 16306) +FeeQuoter_processMessageArgs:test_processMessageArgs_WitEVMExtraArgsV2() (gas: 27978) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithConvertedTokenAmount() (gas: 32012) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithCorrectPoolReturnData() (gas: 76591) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithEVMExtraArgsV1() (gas: 27609) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithEmptyEVMExtraArgs() (gas: 25468) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithLinkTokenAmount() (gas: 21652) FeeQuoter_supportsInterface:test_SupportsInterface() (gas: 13264) FeeQuoter_updatePrices:test_OnlyGasPrice() (gas: 23912) -FeeQuoter_updatePrices:test_OnlyTokenPrice() (gas: 28761) -FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller() (gas: 74821) -FeeQuoter_updatePrices:test_UpdateMultiplePrices() (gas: 146024) -FeeQuoter_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 52517) -FeeQuoter_updateTokenPriceFeeds:test_FeedUnset() (gas: 66506) -FeeQuoter_updateTokenPriceFeeds:test_MultipleFeedUpdate() (gas: 93647) -FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate() (gas: 53215) +FeeQuoter_updatePrices:test_OnlyTokenPrice() (gas: 28739) +FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller() (gas: 74768) +FeeQuoter_updatePrices:test_UpdateMultiplePrices() (gas: 145958) +FeeQuoter_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 52495) +FeeQuoter_updateTokenPriceFeeds:test_FeedUnset() (gas: 66418) +FeeQuoter_updateTokenPriceFeeds:test_MultipleFeedUpdate() (gas: 93559) +FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate() (gas: 53171) FeeQuoter_updateTokenPriceFeeds:test_ZeroFeeds() (gas: 12471) -FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress() (gas: 6789) -FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress() (gas: 6514) +FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress() (gas: 6767) +FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress() (gas: 6492) HybridLockReleaseUSDCTokenPool_TransferLiquidity:test_transferLiquidity() (gas: 167013) HybridLockReleaseUSDCTokenPool_lockOrBurn:test_PrimaryMechanism() (gas: 130356) HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism() (gas: 140104) @@ -157,22 +157,22 @@ MultiAggregateRateLimiter_constructor:test_Constructor() (gas: 2102740) MultiAggregateRateLimiter_constructor:test_ConstructorNoAuthorizedCallers() (gas: 1986594) MultiAggregateRateLimiter_getTokenBucket:test_GetTokenBucket() (gas: 30888) MultiAggregateRateLimiter_getTokenBucket:test_Refill() (gas: 48378) -MultiAggregateRateLimiter_getTokenValue:test_GetTokenValue() (gas: 17616) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDifferentTokensOnDifferentChains() (gas: 211462) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDisabledRateLimitToken() (gas: 58832) +MultiAggregateRateLimiter_getTokenValue:test_GetTokenValue() (gas: 17594) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDifferentTokensOnDifferentChains() (gas: 211396) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDisabledRateLimitToken() (gas: 58810) MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithNoTokens() (gas: 17918) MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitDisabled() (gas: 45460) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitReset() (gas: 77765) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokens() (gas: 50967) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokensOnDifferentChains() (gas: 310077) -MultiAggregateRateLimiter_onOutboundMessage:test_RateLimitValueDifferentLanes() (gas: 51611) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitReset() (gas: 77677) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokens() (gas: 50923) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokensOnDifferentChains() (gas: 309989) +MultiAggregateRateLimiter_onOutboundMessage:test_RateLimitValueDifferentLanes() (gas: 51567) MultiAggregateRateLimiter_onOutboundMessage:test_ValidateMessageWithNoTokens() (gas: 19379) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains() (gas: 211014) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken() (gas: 60544) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains() (gas: 210948) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken() (gas: 60522) MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitDisabled() (gas: 47112) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitReset() (gas: 78506) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokens() (gas: 52677) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains() (gas: 309835) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitReset() (gas: 78418) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokens() (gas: 52633) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains() (gas: 309747) MultiAggregateRateLimiter_setFeeQuoter:test_Owner() (gas: 19146) MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensMultipleChains() (gas: 281364) MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensSingleChain() (gas: 255770) @@ -202,10 +202,10 @@ NonceManager_getIncrementedOutboundNonce:test_getIncrementedOutboundNonce() (gas NonceManager_getIncrementedOutboundNonce:test_incrementInboundNonce() (gas: 38746) NonceManager_getIncrementedOutboundNonce:test_incrementInboundNonce_SkippedIncorrectNonce() (gas: 23739) NonceManager_getIncrementedOutboundNonce:test_incrementNoncesInboundAndOutbound() (gas: 71886) -NonceManager_getOutboundNonce:test_getOutboundNonce_Upgrade() (gas: 105254) -NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceNewSenderStartsAtZero() (gas: 166086) -NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceStartsAtV1Nonce() (gas: 195806) -NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeSenderNoncesReadsPreviousRamp() (gas: 140101) +NonceManager_getOutboundNonce:test_getOutboundNonce_Upgrade() (gas: 104563) +NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceNewSenderStartsAtZero() (gas: 165406) +NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceStartsAtV1Nonce() (gas: 194435) +NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeSenderNoncesReadsPreviousRamp() (gas: 142134) OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains() (gas: 626140) OffRamp_applySourceChainConfigUpdates:test_AddNewChain() (gas: 166441) OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates() (gas: 16671) @@ -224,8 +224,8 @@ OffRamp_commit:test_PriceSequenceNumberCleared() (gas: 355397) OffRamp_commit:test_ReportAndPriceUpdate() (gas: 164209) OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 141051) OffRamp_commit:test_RootWithRMNDisabled() (gas: 153873) -OffRamp_commit:test_StaleReportWithRoot() (gas: 232101) -OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot() (gas: 206722) +OffRamp_commit:test_StaleReportWithRoot() (gas: 232057) +OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot() (gas: 206700) OffRamp_constructor:test_Constructor() (gas: 6311247) OffRamp_execute:test_LargeBatch() (gas: 3373860) OffRamp_execute:test_MultipleReports() (gas: 291458) @@ -274,33 +274,33 @@ OffRamp_trialExecute:test_trialExecute_RevertsWhen_NoEnoughGasForCallSigAndSende OffRamp_trialExecute:test_trialExecute_RevertsWhen_NoGasForCallExactCheckAndSenderIsGasEstimator() (gas: 29539) OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 131932) OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 281327) -OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy() (gas: 244294) +OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy() (gas: 244845) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates() (gas: 325979) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 17190) OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates() (gas: 65874) OnRamp_constructor:test_Constructor() (gas: 2672129) -OnRamp_forwardFromRouter:test_ForwardFromRouter() (gas: 145362) -OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2() (gas: 146196) -OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue() (gas: 115375) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145760) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 144036) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 146001) -OnRamp_forwardFromRouter:test_ForwardFromRouter_ConfigurableSourceRouter() (gas: 140639) -OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered() (gas: 186473) -OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce() (gas: 212828) -OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 147007) -OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception() (gas: 274726) -OnRamp_getFee:test_EmptyMessage() (gas: 99005) -OnRamp_getFee:test_GetFeeOfZeroForTokenMessage() (gas: 86961) -OnRamp_getFee:test_SingleTokenMessage() (gas: 114125) +OnRamp_forwardFromRouter:test_ForwardFromRouter() (gas: 144671) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2() (gas: 145505) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue() (gas: 114684) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145069) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 143346) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 145310) +OnRamp_forwardFromRouter:test_ForwardFromRouter_ConfigurableSourceRouter() (gas: 142650) +OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered() (gas: 184400) +OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce() (gas: 210755) +OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 146316) +OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception() (gas: 274013) +OnRamp_getFee:test_EmptyMessage() (gas: 99565) +OnRamp_getFee:test_GetFeeOfZeroForTokenMessage() (gas: 89015) +OnRamp_getFee:test_SingleTokenMessage() (gas: 114859) OnRamp_getTokenPool:test_GetTokenPool() (gas: 35382) OnRamp_setDynamicConfig:test_setDynamicConfig() (gas: 56650) OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens() (gas: 125835) -PingPong_ccipReceive:test_CcipReceive() (gas: 165845) +PingPong_ccipReceive:test_CcipReceive() (gas: 165996) PingPong_setOutOfOrderExecution:test_OutOfOrderExecution() (gas: 20350) PingPong_setPaused:test_Pausing() (gas: 17738) -PingPong_startPingPong:test_StartPingPong_With_OOO() (gas: 144996) -PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered() (gas: 170649) +PingPong_startPingPong:test_StartPingPong_With_OOO() (gas: 145147) +PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered() (gas: 170800) RMNHome_getConfigDigests:test_getConfigDigests() (gas: 1081176) RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive() (gas: 1086556) RMNHome_revokeCandidate:test_revokeCandidate() (gas: 28085) @@ -330,20 +330,20 @@ RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetC RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner() (gas: 129941) Router_applyRampUpdates:test_applyRampUpdates_OffRampUpdatesWithRouting() (gas: 10413055) Router_applyRampUpdates:test_applyRampUpdates_OnRampDisable() (gas: 56445) -Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 124459) -Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 211890) +Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 124610) +Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 212051) Router_ccipSend:test_InvalidMsgValue() (gas: 27856) -Router_ccipSend:test_NativeFeeToken() (gas: 184996) -Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 62458) -Router_ccipSend:test_NativeFeeTokenOverpay() (gas: 186413) -Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 54550) -Router_ccipSend:test_NonLinkFeeToken() (gas: 219583) -Router_ccipSend:test_WrappedNativeFeeToken() (gas: 187235) -Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 133616) -Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 221091) +Router_ccipSend:test_NativeFeeToken() (gas: 185287) +Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 62598) +Router_ccipSend:test_NativeFeeTokenOverpay() (gas: 186704) +Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 54690) +Router_ccipSend:test_NonLinkFeeToken() (gas: 219712) +Router_ccipSend:test_WrappedNativeFeeToken() (gas: 187526) +Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 133767) +Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 221252) Router_constructor:test_Constructor() (gas: 13148) Router_getArmProxy:test_getArmProxy() (gas: 10573) -Router_getFee:test_GetFeeSupportedChain() (gas: 52021) +Router_getFee:test_GetFeeSupportedChain() (gas: 52161) Router_recoverTokens:test_RecoverTokens() (gas: 52668) Router_routeMessage:test_routeMessage_AutoExec() (gas: 38071) Router_routeMessage:test_routeMessage_ExecutionEvent() (gas: 153593) diff --git a/contracts/src/v0.8/ccip/FeeQuoter.sol b/contracts/src/v0.8/ccip/FeeQuoter.sol index 8275999af9e..40972df1c0b 100644 --- a/contracts/src/v0.8/ccip/FeeQuoter.sol +++ b/contracts/src/v0.8/ccip/FeeQuoter.sol @@ -91,24 +91,26 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, /// @dev Struct to hold the fee & validation configs for a destination chain. struct DestChainConfig { - bool isEnabled; // ──────────────────────────╮ Whether this destination chain is enabled. - uint16 maxNumberOfTokensPerMsg; // │ Maximum number of distinct ERC20 tokens transferred per message. - uint32 maxDataBytes; // │ Maximum data payload size in bytes. - uint32 maxPerMsgGasLimit; // │ Maximum gas limit for messages targeting EVMs. - uint32 destGasOverhead; // │ Gas charged on top of the gasLimit to cover destination chain costs. - uint16 destGasPerPayloadByte; // │ Destination chain gas charged each byte of `data` payload. - uint32 destDataAvailabilityOverheadGas; // │ Data availability gas charged for overhead costs e.g. for OCR. - uint16 destGasPerDataAvailabilityByte; // │ Gas units charged per byte of message data that needs availability. - uint16 destDataAvailabilityMultiplierBps; // │ Multiplier for data availability gas, multiples of bps, or 0.0001. + bool isEnabled; // ─────────────────────────╮ Whether this destination chain is enabled. + uint16 maxNumberOfTokensPerMsg; // │ Maximum number of distinct ERC20 tokens transferred per message. + uint32 maxDataBytes; // │ Maximum data payload size in bytes. + uint32 maxPerMsgGasLimit; // │ Maximum gas limit for messages targeting EVMs. + uint32 destGasOverhead; // │ Gas charged on top of the gasLimit to cover destination chain costs. + uint8 destGasPerPayloadByteBase; // │ Default dest-chain gas charged each byte of `data` payload. + uint8 destGasPerPayloadByteHigh; // │ High dest-chain gas charged each byte of `data` payload, used to account for eip-7623. + uint16 destGasPerPayloadByteThreshold; // │ The value at which the billing switches from destGasPerPayloadByteBase to destGasPerPayloadByteHigh. + uint32 destDataAvailabilityOverheadGas; // │ Data availability gas charged for overhead costs e.g. for OCR. + uint16 destGasPerDataAvailabilityByte; // │ Gas units charged per byte of message data that needs availability. + uint16 destDataAvailabilityMultiplierBps; //│ Multiplier for data availability gas, multiples of bps, or 0.0001. + bytes4 chainFamilySelector; // │ Selector that identifies the destination chain's family. Used to determine the correct validations to perform for the dest chain. + bool enforceOutOfOrder; // ─────────────────╯ Whether to enforce the allowOutOfOrderExecution extraArg value to be true. // The following three properties are defaults, they can be overridden by setting the TokenTransferFeeConfig for a token. - uint16 defaultTokenFeeUSDCents; // │ Default token fee charged per token transfer. - uint32 defaultTokenDestGasOverhead; // ──────╯ Default gas charged to execute a token transfer on the destination chain. - uint32 defaultTxGasLimit; //──────────╮ Default gas limit for a tx. - uint64 gasMultiplierWeiPerEth; // │ Multiplier for gas costs, 1e18 based so 11e17 = 10% extra cost. - uint32 networkFeeUSDCents; // │ Flat network fee to charge for messages, multiples of 0.01 USD. - uint32 gasPriceStalenessThreshold; // │ The amount of time a gas price can be stale before it is considered invalid (0 means disabled). - bool enforceOutOfOrder; // │ Whether to enforce the allowOutOfOrderExecution extraArg value to be true. - bytes4 chainFamilySelector; // ───────╯ Selector that identifies the destination chain's family. Used to determine the correct validations to perform for the dest chain. + uint16 defaultTokenFeeUSDCents; // ────╮ Default token fee charged per token transfer. + uint32 defaultTokenDestGasOverhead; // │ Default gas charged to execute a token transfer on the destination chain. + uint32 defaultTxGasLimit; // │ Default gas limit for a tx. + uint64 gasMultiplierWeiPerEth; // │ Multiplier for gas costs, 1e18 based so 11e17 = 10% extra cost. + uint32 gasPriceStalenessThreshold; // │ The amount of time a gas price can be stale before it is considered invalid (0 means disabled). + uint32 networkFeeUSDCents; // ─────────╯ Flat network fee to charge for messages, multiples of 0.01 USD. } /// @dev Struct to hold the configs and its destination chain selector. Same as DestChainConfig but with the @@ -563,25 +565,33 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, // If message-only and no token transfers, a flat network fee is charged. // If there are token transfers, premiumFee is calculated from token transfer fee. // If there are both token transfers and message, premiumFee is only calculated from token transfer fee. - uint256 premiumFee = 0; + uint256 premiumFeeUSDWei = 0; uint32 tokenTransferGas = 0; uint32 tokenTransferBytesOverhead = 0; if (numberOfTokens > 0) { - (premiumFee, tokenTransferGas, tokenTransferBytesOverhead) = - _getTokenTransferCost(destChainConfig, destChainSelector, message.feeToken, feeTokenPrice, message.tokenAmounts); + (premiumFeeUSDWei, tokenTransferGas, tokenTransferBytesOverhead) = _getTokenTransferCost( + destChainConfig.defaultTokenFeeUSDCents, + destChainConfig.defaultTokenDestGasOverhead, + destChainSelector, + message.feeToken, + feeTokenPrice, + message.tokenAmounts + ); } else { // Convert USD cents with 2 decimals to 18 decimals. - premiumFee = uint256(destChainConfig.networkFeeUSDCents) * 1e16; + premiumFeeUSDWei = uint256(destChainConfig.networkFeeUSDCents) * 1e16; } + // Apply the premium multiplier for the fee token, making it 36 decimals + premiumFeeUSDWei *= s_premiumMultiplierWeiPerEth[message.feeToken]; // Calculate data availability cost in USD with 36 decimals. Data availability cost exists on rollups that need to // post transaction calldata onto another storage layer, e.g. Eth mainnet, incurring additional storage gas costs. - uint256 dataAvailabilityCost = 0; + uint256 dataAvailabilityCostUSD36Decimals = 0; // Only calculate data availability cost if data availability multiplier is non-zero. // The multiplier should be set to 0 if destination chain does not charge data availability cost. if (destChainConfig.destDataAvailabilityMultiplierBps > 0) { - dataAvailabilityCost = _getDataAvailabilityCost( + dataAvailabilityCostUSD36Decimals = _getDataAvailabilityCost( destChainConfig, // Parse the data availability gas price stored in the higher-order 112 bits of the encoded gas price. uint112(packedGasPrice >> Internal.GAS_PRICE_BITS), @@ -591,25 +601,42 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, ); } - // Calculate execution gas fee on destination chain in USD with 36 decimals. - // We add the message gas limit, the overhead gas, the gas of passing message data to receiver, and token transfer - // gas together. We then multiply this gas total with the gas multiplier and gas price, converting it into USD with - // 36 decimals. uint112(packedGasPrice) = executionGasPrice - - // NOTE: Fee logic is currently only supported for EVM-Chains, and the gas price is assumed to be in wei. - // fee logic for other chains should be implemented in the future. - uint256 executionCost = uint112(packedGasPrice) - * ( - destChainConfig.destGasOverhead - + ((message.data.length + tokenTransferBytesOverhead) * destChainConfig.destGasPerPayloadByte) + tokenTransferGas - + _parseEVMExtraArgsFromBytes(message.extraArgs, destChainConfig).gasLimit - ) * destChainConfig.gasMultiplierWeiPerEth; - - // Calculate number of fee tokens to charge. + // Calculate the calldata, taking into account EIP-7623. We charge destGasPerPayloadByteBase for the calldata cost + // up to destGasPerPayloadByteThreshold, even when the total calldata length exceeds the threshold. This is safe + // because we also charge for execution gas on top of this. When correct values are chosen, the execution gas we + // charge is always higher than the difference between the base and high calldata costs for the first + // destGasPerPayloadByteThreshold bytes. Since we don't pay for execution gas in EIP-7623, this execution gas is + // effectively used to cover the higher calldata costs for the first destGasPerPayloadByteThreshold bytes. + // The threshold should be adjusted based on expected execution cost and, potentially, to discourage large payloads. + // Example: 16 base, 40 high, 100k execution cost. 100k/(40-16) = max 4.16kb as the threshold. Take 4kb threshold. + // Calldata length = 5000 + // Our calculations: 1000 * 40 + 4000 * 16 = 104k calldata cost + 100k execution cost = 204k calculated cost. + // Actual cost: 5000 * 40 = 200k + // The difference is 4k in favour of CCIP. The lower the threshold, the more premium is charged for large payloads. + uint256 calldataLength = message.data.length + tokenTransferBytesOverhead; + uint256 destCallDataCost = calldataLength * destChainConfig.destGasPerPayloadByteBase; + if (calldataLength > destChainConfig.destGasPerPayloadByteThreshold) { + destCallDataCost = destChainConfig.destGasPerPayloadByteBase * destChainConfig.destGasPerPayloadByteThreshold + + (calldataLength - destChainConfig.destGasPerPayloadByteThreshold) * destChainConfig.destGasPerPayloadByteHigh; + } + + // We add the destination chain CCIP overhead (commit, exec), the token transfer gas, the calldata cost and the msg + // gas limit to get the total gas the tx costs to execute on the destination chain. + uint256 totalDestChainGas = destChainConfig.destGasOverhead + tokenTransferGas + destCallDataCost + + _parseEVMExtraArgsFromBytes( + message.extraArgs, + destChainConfig.defaultTxGasLimit, + destChainConfig.maxPerMsgGasLimit, + destChainConfig.enforceOutOfOrder + ).gasLimit; + // Total USD fee is in 36 decimals, feeTokenPrice is in 18 decimals USD for 1e18 smallest token denominations. - // Result of the division is the number of smallest token denominations. - return ((premiumFee * s_premiumMultiplierWeiPerEth[message.feeToken]) + executionCost + dataAvailabilityCost) - / feeTokenPrice; + // The result is the fee in the feeTokens smallest denominations (e.g. wei for ETH). + // uint112(packedGasPrice) = executionGasPrice + return ( + totalDestChainGas * uint112(packedGasPrice) * destChainConfig.gasMultiplierWeiPerEth + premiumFeeUSDWei + + dataAvailabilityCostUSD36Decimals + ) / feeTokenPrice; } /// @notice Sets the fee configuration for a token. @@ -650,7 +677,8 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, /// @dev Assumes that tokenAmounts are validated to be listed tokens elsewhere. /// @dev Splitting one token transfer into multiple transfers is discouraged, as it will result in a transferFee /// equal or greater than the same amount aggregated/de-duped. - /// @param destChainConfig the config configured for the destination chain selector. + /// @param defaultTokenFeeUSDCents the default token fee in USD cents. + /// @param defaultTokenDestGasOverhead the default token destination gas overhead. /// @param destChainSelector the destination chain selector. /// @param feeToken address of the feeToken. /// @param feeTokenPrice price of feeToken in USD with 18 decimals. @@ -659,7 +687,8 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, /// @return tokenTransferGas total execution gas of the token transfers. /// @return tokenTransferBytesOverhead additional token transfer data passed to destination, e.g. USDC attestation. function _getTokenTransferCost( - DestChainConfig memory destChainConfig, + uint256 defaultTokenFeeUSDCents, + uint32 defaultTokenDestGasOverhead, uint64 destChainSelector, address feeToken, uint224 feeTokenPrice, @@ -673,8 +702,8 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, // If the token has no specific overrides configured, we use the global defaults. if (!transferFeeConfig.isEnabled) { - tokenTransferFeeUSDWei += uint256(destChainConfig.defaultTokenFeeUSDCents) * 1e16; - tokenTransferGas += destChainConfig.defaultTokenDestGasOverhead; + tokenTransferFeeUSDWei += defaultTokenFeeUSDCents * 1e16; + tokenTransferGas += defaultTokenDestGasOverhead; tokenTransferBytesOverhead += Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES; continue; } @@ -856,21 +885,21 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, /// @dev Convert the extra args bytes into a struct with validations against the dest chain config. /// @param extraArgs The extra args bytes. - /// @param destChainConfig Dest chain config to validate against. /// @return evmExtraArgs The EVMExtraArgs struct (latest version). function _parseEVMExtraArgsFromBytes( bytes calldata extraArgs, - DestChainConfig memory destChainConfig + uint32 defaultTxGasLimit, + uint256 maxPerMsgGasLimit, + bool enforceOutOfOrder ) internal pure returns (Client.EVMExtraArgsV2 memory) { - Client.EVMExtraArgsV2 memory evmExtraArgs = - _parseUnvalidatedEVMExtraArgsFromBytes(extraArgs, destChainConfig.defaultTxGasLimit); + Client.EVMExtraArgsV2 memory evmExtraArgs = _parseUnvalidatedEVMExtraArgsFromBytes(extraArgs, defaultTxGasLimit); - if (evmExtraArgs.gasLimit > uint256(destChainConfig.maxPerMsgGasLimit)) revert MessageGasLimitTooHigh(); + if (evmExtraArgs.gasLimit > maxPerMsgGasLimit) revert MessageGasLimitTooHigh(); // If the chain enforces out of order execution, the extra args must allow it, otherwise revert. We cannot assume // the user intended to use OOO on any chain that requires it as it may lead to unexpected behavior. Therefore we // revert instead of assuming the user intended to use OOO. - if (destChainConfig.enforceOutOfOrder && !evmExtraArgs.allowOutOfOrderExecution) { + if (enforceOutOfOrder && !evmExtraArgs.allowOutOfOrderExecution) { revert ExtraArgOutOfOrderExecutionMustBeTrue(); } diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol index 54832a30783..40db39dcb87 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol @@ -24,8 +24,8 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD; - uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); - uint256 messageFeeUSD = (_configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth); + uint256 gasFeeUSD = gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS; + uint256 messageFeeUSD = _configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth; uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, 0 ); @@ -49,8 +49,8 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD; - uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); - uint256 messageFeeUSD = (_configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth); + uint256 gasFeeUSD = gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS; + uint256 messageFeeUSD = _configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth; uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD) / s_feeTokenPrice; assertEq(totalPriceInFeeToken, feeAmount); @@ -75,9 +75,13 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); - uint256 gasUsed = customGasLimit + DEST_GAS_OVERHEAD + customDataSize * DEST_GAS_PER_PAYLOAD_BYTE; - uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); - uint256 messageFeeUSD = (_configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth); + + uint256 callDataCostHigh = (customDataSize - DEST_GAS_PER_PAYLOAD_BYTE_THRESHOLD) * DEST_GAS_PER_PAYLOAD_BYTE_HIGH + + DEST_GAS_PER_PAYLOAD_BYTE_THRESHOLD * DEST_GAS_PER_PAYLOAD_BYTE_BASE; + + uint256 gasUsed = customGasLimit + DEST_GAS_OVERHEAD + callDataCostHigh; + uint256 gasFeeUSD = gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS; + uint256 messageFeeUSD = _configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth; uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, 0 ); @@ -103,12 +107,12 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); - uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD + tokenBytesOverhead * DEST_GAS_PER_PAYLOAD_BYTE + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD + tokenBytesOverhead * DEST_GAS_PER_PAYLOAD_BYTE_BASE + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token).destGasOverhead; - uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 gasFeeUSD = gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS; (uint256 transferFeeUSD,,) = s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, feeTokenPrices[i], message.tokenAmounts); - uint256 messageFeeUSD = (transferFeeUSD * s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken)); + uint256 messageFeeUSD = transferFeeUSD * s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken); uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, @@ -159,12 +163,12 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { { uint256 gasUsed = customGasLimit + DEST_GAS_OVERHEAD - + (message.data.length + tokenTransferBytesOverhead) * DEST_GAS_PER_PAYLOAD_BYTE + tokenGasOverhead; + + (message.data.length + tokenTransferBytesOverhead) * DEST_GAS_PER_PAYLOAD_BYTE_BASE + tokenGasOverhead; - gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + gasFeeUSD = gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS; } - uint256 messageFeeUSD = (transferFeeUSD * premiumMultiplierWeiPerEth); + uint256 messageFeeUSD = transferFeeUSD * premiumMultiplierWeiPerEth; uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( DEST_CHAIN_SELECTOR, diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol index 874bd20cbf8..5e41f4ee223 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol @@ -20,7 +20,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: false}); vm.assertEq( - abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig)), + abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, DEST_CHAIN_SELECTOR)), abi.encode(expectedOutputArgs) ); } @@ -31,7 +31,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); vm.assertEq( - abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig)), abi.encode(inputArgs) + abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, DEST_CHAIN_SELECTOR)), abi.encode(inputArgs) ); } @@ -40,7 +40,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { Client.EVMExtraArgsV2({gasLimit: s_destChainConfig.defaultTxGasLimit, allowOutOfOrderExecution: false}); vm.assertEq( - abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes("", s_destChainConfig)), abi.encode(expectedOutputArgs) + abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes("", DEST_CHAIN_SELECTOR)), abi.encode(expectedOutputArgs) ); } @@ -54,7 +54,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { inputExtraArgs[0] = bytes1(uint8(0)); vm.expectRevert(FeeQuoter.InvalidExtraArgsTag.selector); - s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, DEST_CHAIN_SELECTOR); } function test_RevertWhen_EVMExtraArgsEnforceOutOfOrder() public { @@ -64,7 +64,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { s_destChainConfig.enforceOutOfOrder = true; vm.expectRevert(FeeQuoter.ExtraArgOutOfOrderExecutionMustBeTrue.selector); - s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, DEST_CHAIN_SELECTOR, true); } function test_RevertWhen_EVMExtraArgsGasLimitTooHigh() public { @@ -73,6 +73,6 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); vm.expectRevert(FeeQuoter.MessageGasLimitTooHigh.selector); - s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, DEST_CHAIN_SELECTOR); } } diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol index e001ccd47cf..006e3251467 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol @@ -24,7 +24,9 @@ contract FeeQuoterSetup is TokenSetup { // OnRamp uint96 internal constant MAX_MSG_FEES_JUELS = 1_000e18; uint32 internal constant DEST_GAS_OVERHEAD = 300_000; - uint16 internal constant DEST_GAS_PER_PAYLOAD_BYTE = 16; + uint8 internal constant DEST_GAS_PER_PAYLOAD_BYTE_BASE = 16; + uint8 internal constant DEST_GAS_PER_PAYLOAD_BYTE_HIGH = 40; + uint16 internal constant DEST_GAS_PER_PAYLOAD_BYTE_THRESHOLD = 3000; uint16 internal constant DEFAULT_TOKEN_FEE_USD_CENTS = 50; uint32 internal constant DEFAULT_TOKEN_BYTES_OVERHEAD = 32; @@ -260,7 +262,9 @@ contract FeeQuoterSetup is TokenSetup { isEnabled: true, maxNumberOfTokensPerMsg: MAX_TOKENS_LENGTH, destGasOverhead: DEST_GAS_OVERHEAD, - destGasPerPayloadByte: DEST_GAS_PER_PAYLOAD_BYTE, + destGasPerPayloadByteBase: DEST_GAS_PER_PAYLOAD_BYTE_BASE, + destGasPerPayloadByteHigh: DEST_GAS_PER_PAYLOAD_BYTE_HIGH, + destGasPerPayloadByteThreshold: DEST_GAS_PER_PAYLOAD_BYTE_THRESHOLD, destDataAvailabilityOverheadGas: DEST_DATA_AVAILABILITY_OVERHEAD_GAS, destGasPerDataAvailabilityByte: DEST_GAS_PER_DATA_AVAILABILITY_BYTE, destDataAvailabilityMultiplierBps: DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS, @@ -309,7 +313,9 @@ contract FeeQuoterSetup is TokenSetup { assertEq(a.maxDataBytes, b.maxDataBytes); assertEq(a.maxPerMsgGasLimit, b.maxPerMsgGasLimit); assertEq(a.destGasOverhead, b.destGasOverhead); - assertEq(a.destGasPerPayloadByte, b.destGasPerPayloadByte); + assertEq(a.destGasPerPayloadByteBase, b.destGasPerPayloadByteBase); + assertEq(a.destGasPerPayloadByteHigh, b.destGasPerPayloadByteHigh); + assertEq(a.destGasPerPayloadByteThreshold, b.destGasPerPayloadByteThreshold); assertEq(a.destDataAvailabilityOverheadGas, b.destDataAvailabilityOverheadGas); assertEq(a.destGasPerDataAvailabilityByte, b.destGasPerDataAvailabilityByte); assertEq(a.destDataAvailabilityMultiplierBps, b.destDataAvailabilityMultiplierBps); diff --git a/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol b/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol index ff8f9b6c042..acee4dfda2f 100644 --- a/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol +++ b/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol @@ -48,7 +48,12 @@ contract FeeQuoterHelper is FeeQuoter { Client.EVMTokenAmount[] calldata tokenAmounts ) external view returns (uint256, uint32, uint32) { return _getTokenTransferCost( - s_destChainConfigs[destChainSelector], destChainSelector, feeToken, feeTokenPrice, tokenAmounts + s_destChainConfigs[destChainSelector].defaultTokenFeeUSDCents, + s_destChainConfigs[destChainSelector].defaultTokenDestGasOverhead, + destChainSelector, + feeToken, + feeTokenPrice, + tokenAmounts ); } @@ -56,14 +61,25 @@ contract FeeQuoterHelper is FeeQuoter { bytes calldata extraArgs, uint64 destChainSelector ) external view returns (Client.EVMExtraArgsV2 memory) { - return _parseEVMExtraArgsFromBytes(extraArgs, s_destChainConfigs[destChainSelector]); + return _parseEVMExtraArgsFromBytes( + extraArgs, + s_destChainConfigs[destChainSelector].defaultTxGasLimit, + s_destChainConfigs[destChainSelector].maxPerMsgGasLimit, + s_destChainConfigs[destChainSelector].enforceOutOfOrder + ); } function parseEVMExtraArgsFromBytes( bytes calldata extraArgs, - DestChainConfig memory destChainConfig - ) external pure returns (Client.EVMExtraArgsV2 memory) { - return _parseEVMExtraArgsFromBytes(extraArgs, destChainConfig); + uint64 destChainSelector, + bool enforceOutOfOrder + ) external view returns (Client.EVMExtraArgsV2 memory) { + return _parseEVMExtraArgsFromBytes( + extraArgs, + s_destChainConfigs[destChainSelector].defaultTxGasLimit, + s_destChainConfigs[destChainSelector].maxPerMsgGasLimit, + enforceOutOfOrder + ); } function validateDestFamilyAddress(bytes4 chainFamilySelector, bytes memory destAddress) external pure { diff --git a/core/capabilities/ccip/ccipevm/gas_helpers.go b/core/capabilities/ccip/ccipevm/gas_helpers.go index 2706650f48e..838c78f8fb8 100644 --- a/core/capabilities/ccip/ccipevm/gas_helpers.go +++ b/core/capabilities/ccip/ccipevm/gas_helpers.go @@ -4,13 +4,17 @@ import ( "fmt" "math" + "github.com/pkg/errors" + cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" ) const ( EvmAddressLengthBytes = 20 EvmWordBytes = 32 - CalldataGasPerByte = 16 + CalldataGasPerByteBase = 16 + CalldataGasPerByteHigh = 40 + CalldataGasPerByteThreshold = 3000 TokenAdminRegistryWarmupCost = 2_500 TokenAdminRegistryPoolLookupGas = 100 + // WARM_ACCESS_COST TokenAdminRegistry 700 + // CALL cost for TokenAdminRegistry @@ -44,7 +48,7 @@ func (gp EstimateProvider) CalculateMerkleTreeGas(numRequests int) uint64 { return 0 } merkleProofBytes := (math.Ceil(math.Log2(float64(numRequests))))*32 + (1+2)*32 // only ever one outer root hash - return uint64(merkleProofBytes * CalldataGasPerByte) + return uint64(merkleProofBytes * CalldataGasPerByteBase) } // return the size of bytes for msg tokens @@ -86,7 +90,11 @@ func (gp EstimateProvider) CalculateMessageMaxGasWithError(msg cciptypes.Message bytesForMsgTokens(numTokens) + dataLength - messageCallDataGas := uint64(messageBytes * CalldataGasPerByte) + if messageBytes < 0 { + return 0, errors.New("message bytes cannot be negative") + } + + messageCallDataGas := uint64(messageBytes) * CalldataGasPerByteBase // Rate limiter only limits value in tokens. It's not called if there are no // tokens in the message. The same goes for the admin registry, it's only loaded diff --git a/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go b/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go index 550e82ea272..c2804d46a32 100644 --- a/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go +++ b/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go @@ -54,18 +54,20 @@ type FeeQuoterDestChainConfig struct { MaxDataBytes uint32 MaxPerMsgGasLimit uint32 DestGasOverhead uint32 - DestGasPerPayloadByte uint16 + DestGasPerPayloadByteBase uint8 + DestGasPerPayloadByteHigh uint8 + DestGasPerPayloadByteThreshold uint16 DestDataAvailabilityOverheadGas uint32 DestGasPerDataAvailabilityByte uint16 DestDataAvailabilityMultiplierBps uint16 + ChainFamilySelector [4]byte + EnforceOutOfOrder bool DefaultTokenFeeUSDCents uint16 DefaultTokenDestGasOverhead uint32 DefaultTxGasLimit uint32 GasMultiplierWeiPerEth uint64 - NetworkFeeUSDCents uint32 GasPriceStalenessThreshold uint32 - EnforceOutOfOrder bool - ChainFamilySelector [4]byte + NetworkFeeUSDCents uint32 } type FeeQuoterDestChainConfigArgs struct { @@ -156,8 +158,8 @@ type KeystoneFeedsPermissionHandlerPermission struct { } var FeeQuoterMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"priceUpdaters\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]},{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"FEE_BASE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"KEYSTONE_PRICE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyAuthorizedCallerUpdates\",\"inputs\":[{\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\",\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"components\":[{\"name\":\"addedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"removedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyDestChainConfigUpdates\",\"inputs\":[{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyFeeTokensUpdates\",\"inputs\":[{\"name\":\"feeTokensToRemove\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokensToAdd\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyPremiumMultiplierWeiPerEthUpdates\",\"inputs\":[{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyTokenTransferFeeConfigUpdates\",\"inputs\":[{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"tokensToUseDefaultFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigRemoveArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"convertTokenAmount\",\"inputs\":[{\"name\":\"fromToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"fromTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toToken\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAllAuthorizedCallers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestinationChainGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeTokens\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPremiumMultiplierWeiPerEth\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStaticConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenAndGasPrices\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"tokenPrice\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"gasPriceValue\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPriceFeedConfig\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrices\",\"inputs\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenTransferFeeConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedFee\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structClient.EVM2AnyMessage\",\"components\":[{\"name\":\"receiver\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onReport\",\"inputs\":[{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processMessageArgs\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"onRampTokenTransfers\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.EVM2AnyTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destTokenAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"destExecData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"sourceTokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"isOutOfOrderExecution\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"convertedExtraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destExecDataPerToken\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setReportPermissions\",\"inputs\":[{\"name\":\"permissions\",\"type\":\"tuple[]\",\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission[]\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updatePrices\",\"inputs\":[{\"name\":\"priceUpdates\",\"type\":\"tuple\",\"internalType\":\"structInternal.PriceUpdates\",\"components\":[{\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"usdPerToken\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]},{\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.GasPriceUpdate[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"usdPerUnitGas\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateTokenPriceFeeds\",\"inputs\":[{\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AuthorizedCallerAdded\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AuthorizedCallerRemoved\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainAdded\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenAdded\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenRemoved\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PremiumMultiplierWeiPerEthUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PriceFeedPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"priceFeedConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ReportPermissionSet\",\"inputs\":[{\"name\":\"reportId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"permission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigDeleted\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerUnitGasUpdated\",\"inputs\":[{\"name\":\"destChain\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DataFeedValueOutOfUint224Range\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DestinationChainNotEnabled\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ExtraArgOutOfOrderExecutionMustBeTrue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FeeTokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidDestBytesOverhead\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidEVMAddress\",\"inputs\":[{\"name\":\"encodedAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidExtraArgsTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidFeeRange\",\"inputs\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStaticConfig\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageFeeTooHigh\",\"inputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MessageGasLimitTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageTooLarge\",\"inputs\":[{\"name\":\"maxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actualSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReportForwarderUnauthorized\",\"inputs\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"}]},{\"type\":\"error\",\"name\":\"SourceTokenDataTooLarge\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"StaleGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timePassed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"TokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnsupportedNumberOfTokens\",\"inputs\":[{\"name\":\"numberOfTokens\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ZeroAddressNotAllowed\",\"inputs\":[]}]", - Bin: "0x60e060405234610fed57617375803803806100198161125f565b9283398101908082036101208112610fed57606013610fed5761003a611221565b81516001600160601b0381168103610fed57815261005a60208301611284565b906020810191825261006e60408401611298565b6040820190815260608401516001600160401b038111610fed57856100949186016112c0565b60808501519094906001600160401b038111610fed57866100b69183016112c0565b60a08201519096906001600160401b038111610fed5782019181601f84011215610fed5782516100ed6100e8826112a9565b61125f565b9360208086848152019260071b82010190848211610fed57602001915b8183106111a65750505060c08101516001600160401b038111610fed5781019782601f8a011215610fed578851986101446100e88b6112a9565b996020808c838152019160051b83010191858311610fed5760208101915b838310611044575050505060e08201516001600160401b038111610fed5782019183601f84011215610fed57825161019c6100e8826112a9565b9360208086848152019260061b82010190868211610fed57602001915b81831061100857505050610100810151906001600160401b038211610fed570183601f82011215610fed578051906101f36100e8836112a9565b946020610240818886815201940283010191818311610fed57602001925b828410610e5157505050503315610e4057600180546001600160a01b031916331790556020986102408a61125f565b97600089526000368137610252611240565b998a52888b8b015260005b89518110156102c4576001906001600160a01b0361027b828d61134b565b51168d61028782611537565b610294575b50500161025d565b7fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758091604051908152a1388d61028c565b508a985089519660005b885181101561033f576001600160a01b036102e9828b61134b565b511690811561032e577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8c836103206001956114bf565b50604051908152a1016102ce565b6342bcdf7f60e11b60005260046000fd5b5089959697508860018060a01b03835116158015610e2e575b8015610e1f575b610e0e5791516001600160a01b031660a05290516001600160601b03166080525163ffffffff1660c0526103928461125f565b9360008552600036813760005b855181101561040e576001906103c76001600160a01b036103c0838a61134b565b51166113cc565b6103d2575b0161039f565b818060a01b036103e2828961134b565b51167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26103cc565b508694508560005b84518110156104855760019061043e6001600160a01b03610437838961134b565b51166114fe565b610449575b01610416565b818060a01b03610459828861134b565b51167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2610443565b508593508460005b855181101561054757806104a36001928861134b565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf606087858060a01b03845116930151836000526007895260406000209060ff878060a01b038251169283898060a01b03198254161781558b8301908151604082549501948460a81b8651151560a81b16918560a01b9060a01b169061ffff60a01b19161717905560405193845251168a8301525115156040820152a20161048d565b50828460005b8451811015610ab957610560818661134b565b51836001600160401b03610574848961134b565b5151169101519080158015610aa6575b8015610a86575b8015610a68575b610a54579081600193926000526009865263ffffffff60e01b846040600020015460381b161560001461090957807f525e3d4e0c31cef19cf9426af8d2c0ddd2d576359ca26bed92aac5fadda4626560405180610702868291909161020061022082019380511515835261ffff602082015116602084015263ffffffff604082015116604084015263ffffffff606082015116606084015263ffffffff608082015116608084015261ffff60a08201511660a084015263ffffffff60c08201511660c084015261ffff60e08201511660e084015261ffff6101008201511661010084015261ffff6101208201511661012084015263ffffffff6101408201511661014084015263ffffffff6101608201511661016084015260018060401b036101808201511661018084015263ffffffff6101a0820151166101a084015263ffffffff6101c0820151166101c08401526101e081015115156101e08401528163ffffffff60e01b91015116910152565b0390a25b600052600985528260406000208251151581549062ffff008986015160081b169166ffffffff000000604087015160181b166affffffff00000000000000606088015160381b16906effffffff0000000000000000000000608089015160581b169361ffff60781b60a08a015160781b169163ffffffff60881b60c08b015160881b169061ffff60a81b60e08c015160a81b169361ffff60b81b6101008d015160b81b16968c61012061ffff60c81b91015160c81b16988d61014063ffffffff60d81b91015160d81b169a63ffffffff60d81b199861ffff60c81b199761ffff60b81b199661ffff60a81b199563ffffffff60881b199461ffff60781b19936effffffff0000000000000000000000199260ff6affffffff000000000000001992169066ffffffffffffff1916171617161716171617161716171617161717178155019063ffffffff80610160830151161663ffffffff198354161782556101808101519082546fffffffff0000000000000000000000006101a083015160601b169063ffffffff60801b6101c084015160801b16916101e0840151151560a01b9363ffffffff60a81b9061020063ffffffff60a81b91015160381c16169463ffffffff60a81b199260ff60a01b19916401000000008b60601b03908d1b16906401000000008b60a01b03191617161716179060ff60a01b16171790550161054d565b807f283b699f411baff8f1c29fe49f32a828c8151596244b8e7e4c164edd6569a83560405180610a4c868291909161020061022082019380511515835261ffff602082015116602084015263ffffffff604082015116604084015263ffffffff606082015116606084015263ffffffff608082015116608084015261ffff60a08201511660a084015263ffffffff60c08201511660c084015261ffff60e08201511660e084015261ffff6101008201511661010084015261ffff6101208201511661012084015263ffffffff6101408201511661014084015263ffffffff6101608201511661016084015260018060401b036101808201511661018084015263ffffffff6101a0820151166101a084015263ffffffff6101c0820151166101c08401526101e081015115156101e08401528163ffffffff60e01b91015116910152565b0390a2610706565b63c35aa79d60e01b60005260045260246000fd5b5063ffffffff6101608301511663ffffffff60608401511610610592565b506102008201516001600160e01b031916630a04b54b60e21b141561058b565b5063ffffffff6101608301511615610584565b508260005b8151811015610b3e576001906001600160a01b03610adc828561134b565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d86848060401b0381610b12868961134b565b510151168360005260088252604060002081878060401b0319825416179055604051908152a201610abe565b50506001610b4b8361125f565b9160008352600091610e09575b81925b8151841015610d4757610b6e848361134b565b5180516001600160401b0316929086019190845b8784518051831015610d365782610b989161134b565b51015184516001600160a01b0390610bb190849061134b565b5151169063ffffffff8151168a82019063ffffffff8251169081811015610d21575050608082019063ffffffff8251168c8110610d0a57507f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b560c08d8098979563ffffffff600198968f8f9761ffff6040838b879552600a89528181208f808f9160a01b0316825289522091838751169784891685198554161784558482519285549560408b019469ffff0000000000000000865160401b169b60608101986dffffffff000000000000000000008a5160501b169060a08d8860701b905160701b1693019e8f60ff60901b9051151560901b169460ff60901b199267ffffffff000000008a60701b19928c1b169060016401000000009060701b0319161716171617171790556040519a8b5251169089015251166040870152511660608501525116608083015251151560a0820152a301909150610b82565b6312766e0160e11b8b52600485905260245260448afd5b6305a7b3d160e11b8b52600452602452604489fd5b505050925093600191500192610b5b565b905083825b8251811015610dca576001906001600160401b03610d6a828661134b565b515116828060a01b0384610d7e848861134b565b5101511690808752600a855260408720848060a01b038316885285528660408120557f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b8780a301610d4c565b604051615da990816115cc82396080518181816104d4015261312d015260a05181818161051701526130c4015260c05181818161053e0152613ddc0152f35b610b58565b63d794ef9560e01b60005260046000fd5b5063ffffffff8251161561035f565b5080516001600160601b031615610358565b639b15e16f60e01b60005260046000fd5b8382036102408112610fed57610220610e68611240565b91610e7287611328565b8352601f190112610fed576040519161022083016001600160401b03811184821017610ff257604052610ea76020870161131b565b8352610eb56040870161133c565b6020840152610ec660608701611298565b6040840152610ed760808701611298565b6060840152610ee860a08701611298565b6080840152610ef960c0870161133c565b60a0840152610f0a60e08701611298565b60c0840152610f1c610100870161133c565b60e0840152610f2e610120870161133c565b610100840152610f41610140870161133c565b610120840152610f546101608701611298565b610140840152610f676101808701611298565b610160840152610f7a6101a08701611328565b610180840152610f8d6101c08701611298565b6101a0840152610fa06101e08701611298565b6101c0840152610fb3610200870161131b565b6101e0840152610220860151916001600160e01b031983168303610fed578360209361020061024096015283820152815201930192610211565b600080fd5b634e487b7160e01b600052604160045260246000fd5b604083880312610fed57602060409161101f611240565b61102886611284565b8152611035838701611328565b838201528152019201916101b9565b82516001600160401b038111610fed5782016040818903601f190112610fed5761106c611240565b9061107960208201611328565b825260408101516001600160401b038111610fed57602091010188601f82011215610fed5780516110ac6100e8826112a9565b91602060e08185858152019302820101908b8211610fed57602001915b8183106110e85750505091816020938480940152815201920191610162565b828c0360e08112610fed5760c06110fd611240565b9161110786611284565b8352601f190112610fed576040519160c08301916001600160401b03831184841017610ff25760e093602093604052611141848801611298565b815261114f60408801611298565b8482015261115f6060880161133c565b604082015261117060808801611298565b606082015261118160a08801611298565b608082015261119260c0880161131b565b60a0820152838201528152019201916110c9565b82850360808112610fed5760606111bb611240565b916111c586611284565b8352601f190112610fed576111d8611221565b916111e560208601611284565b835260408501519160ff83168303610fed578360209384608096015261120d6060880161131b565b60408201528382015281520192019161010a565b60405190606082016001600160401b03811183821017610ff257604052565b60408051919082016001600160401b03811183821017610ff257604052565b6040519190601f01601f191682016001600160401b03811183821017610ff257604052565b51906001600160a01b0382168203610fed57565b519063ffffffff82168203610fed57565b6001600160401b038111610ff25760051b60200190565b9080601f83011215610fed5781516112da6100e8826112a9565b9260208085848152019260051b820101928311610fed57602001905b8282106113035750505090565b6020809161131084611284565b8152019101906112f6565b51908115158203610fed57565b51906001600160401b0382168203610fed57565b519061ffff82168203610fed57565b805182101561135f5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b805482101561135f5760005260206000200190600090565b805480156113b65760001901906113a48282611375565b8154906000199060031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6000818152600c6020526040902054801561148d57600019810181811161147757600b5460001981019190821161147757818103611426575b505050611412600b61138d565b600052600c60205260006040812055600190565b61145f61143761144893600b611375565b90549060031b1c928392600b611375565b819391549060031b91821b91600019901b19161790565b9055600052600c602052604060002055388080611405565b634e487b7160e01b600052601160045260246000fd5b5050600090565b80549068010000000000000000821015610ff257816114489160016114bb94018155611375565b9055565b806000526003602052604060002054156000146114f8576114e1816002611494565b600254906000526003602052604060002055600190565b50600090565b80600052600c602052604060002054156000146114f85761152081600b611494565b600b5490600052600c602052604060002055600190565b600081815260036020526040902054801561148d5760001981018181116114775760025460001981019190821161147757808203611591575b50505061157d600261138d565b600052600360205260006040812055600190565b6115b36115a2611448936002611375565b90549060031b1c9283926002611375565b9055600052600360205260406000205538808061157056fe6080604052600436101561001257600080fd5b60003560e01c806241e5be1461020657806301ffc9a714610201578063061877e3146101fc57806306285c69146101f7578063181f5a77146101f25780632451a627146101ed578063325c868e146101e85780633937306f146101e357806341ed29e7146101de578063430d138c146101d957806345ac924d146101d45780634ab35b0b146101cf578063514e8cff146101ca5780636cb5f3dd146101c55780636def4ce7146101c0578063770e2dc4146101bb57806379ba5097146101b65780637afac322146101b1578063805f2132146101ac57806382b49eb0146101a75780638da5cb5b146101a257806391a2749a1461019d578063a69c64c014610198578063bf78e03f14610193578063cdc73d511461018e578063d02641a014610189578063d63d3af214610184578063d8694ccd1461017f578063f2fde38b1461017a578063fbe3f778146101755763ffdb4b371461017057600080fd5b612bf2565b612ab9565b6129ba565b61258d565b612553565b6124d7565b612442565b612357565b612280565b6121b0565b61215e565b611fcc565b611c8b565b611b1a565b6119ca565b61176f565b611600565b61129a565b6111ab565b611140565b61103b565b610edb565b610c44565b610885565b61084b565b6107aa565b6106d9565b61047a565b610407565b6102c5565b61023b565b73ffffffffffffffffffffffffffffffffffffffff81160361022957565b600080fd5b35906102398261020b565b565b346102295760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602061029060043561027b8161020b565b6024356044359161028b8361020b565b612da7565b604051908152f35b35907fffffffff000000000000000000000000000000000000000000000000000000008216820361022957565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576004357fffffffff0000000000000000000000000000000000000000000000000000000081168103610229577fffffffff00000000000000000000000000000000000000000000000000000000602091167f805f21320000000000000000000000000000000000000000000000000000000081149081156103dd575b81156103b3575b8115610389575b506040519015158152f35b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150143861037e565b7f181f5a770000000000000000000000000000000000000000000000000000000081149150610377565b7f9b645f410000000000000000000000000000000000000000000000000000000081149150610370565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff6004356104578161020b565b166000526008602052602067ffffffffffffffff60406000205416604051908152f35b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576104b1612df0565b5060606040516104c0816105a5565b63ffffffff6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169182815273ffffffffffffffffffffffffffffffffffffffff60406020830192827f00000000000000000000000000000000000000000000000000000000000000001684520191837f00000000000000000000000000000000000000000000000000000000000000001683526040519485525116602084015251166040820152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176105c157604052565b610576565b60a0810190811067ffffffffffffffff8211176105c157604052565b6040810190811067ffffffffffffffff8211176105c157604052565b60c0810190811067ffffffffffffffff8211176105c157604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105c157604052565b6040519061023960408361061a565b604051906102396102208361061a565b919082519283825260005b8481106106c45750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b80602080928401015182828601015201610685565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610756604080519061071a818361061a565b601382527f46656551756f74657220312e362e302d6465760000000000000000000000000060208301525191829160208352602083019061067a565b0390f35b602060408183019282815284518094520192019060005b81811061077e5750505090565b825173ffffffffffffffffffffffffffffffffffffffff16845260209384019390920191600101610771565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760405180602060025491828152019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9060005b81811061083557610756856108298187038261061a565b6040519182918261075a565b8254845260209093019260019283019201610812565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602060405160248152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957806004019060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8236030112610229576108ff614180565b6109098280612e0f565b4263ffffffff1692915060005b818110610ae35750506024019061092d8284612e0f565b92905060005b83811061093c57005b8061095b610956600193610950868a612e0f565b90612e92565b612f07565b7fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e67ffffffffffffffff610aaa610a876020850194610a796109b987517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6109e86109c461065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092168252565b63ffffffff8c166020820152610a23610a09845167ffffffffffffffff1690565b67ffffffffffffffff166000526005602052604060002090565b815160209092015160e01b7fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5167ffffffffffffffff1690565b93517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610933565b80610afc610af76001936109508980612e0f565b612ed0565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff610bde610a876020850194610bc4610b6687517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b610b716109c461065b565b63ffffffff8d166020820152610a23610b9e845173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526006602052604060002090565b5173ffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610916565b67ffffffffffffffff81116105c15760051b60200190565b8015150361022957565b359061023982610c2f565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590610c9f82610c17565b90610cad604051928361061a565b828252602460a06020840194028201019036821161022957602401925b818410610cdc57610cda83612f2c565b005b60a0843603126102295760405190610cf3826105c6565b8435610cfe8161020b565b825260208501357fffffffffffffffffffff00000000000000000000000000000000000000000000811681036102295760208301526040850135907fffff000000000000000000000000000000000000000000000000000000000000821682036102295782602092604060a0950152610d796060880161022e565b6060820152610d8a60808801610c39565b6080820152815201930192610cca565b6004359067ffffffffffffffff8216820361022957565b6024359067ffffffffffffffff8216820361022957565b359067ffffffffffffffff8216820361022957565b9181601f840112156102295782359167ffffffffffffffff8311610229576020838186019501011161022957565b9181601f840112156102295782359167ffffffffffffffff8311610229576020808501948460051b01011161022957565b929091610e5d9284521515602084015260806040840152608083019061067a565b906060818303910152815180825260208201916020808360051b8301019401926000915b838310610e9057505050505090565b9091929394602080610ecc837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660019603018752895161067a565b97019301930191939290610e81565b346102295760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610f12610d9a565b60243590610f1f8261020b565b60443560643567ffffffffffffffff811161022957610f42903690600401610ddd565b60849391933567ffffffffffffffff811161022957610f65903690600401610e0b565b9160a4359567ffffffffffffffff871161022957366023880112156102295786600401359567ffffffffffffffff8711610229573660248860061b8a01011161022957610756986024610fb99901966130b8565b9060409492945194859485610e3c565b602060408183019282815284518094520192019060005b818110610fed5750505090565b9091926020604082611030600194885163ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b019401929101610fe0565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295761108a903690600401610e0b565b61109381610c17565b916110a1604051938461061a565b8183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06110ce83610c17565b0160005b81811061112957505060005b8281101561111b576001906110ff6110fa8260051b8501613208565b613d7b565b61110982876130a4565b5261111481866130a4565b50016110de565b604051806107568682610fc9565b6020906111346131ef565b828288010152016110d2565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760206111856004356111808161020b565b6140d1565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295767ffffffffffffffff6111eb610d9a565b6111f36131ef565b5016600052600560205260406000206040519061120f826105e2565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116825260e01c6020820152604051809161075682604081019263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b359061ffff8216820361022957565b359063ffffffff8216820361022957565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295736602382011215610229578060040135906112f582610c17565b90611303604051928361061a565b82825260246102406020840194028201019036821161022957602401925b81841061133157610cda8361324c565b8336036102408112610229576102207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06040519261136e846105e2565b61137788610dc8565b84520112610229576102409160209161138e61066a565b611399848901610c39565b81526113a76040890161127a565b848201526113b760608901611289565b60408201526113c860808901611289565b60608201526113d960a08901611289565b60808201526113ea60c0890161127a565b60a08201526113fb60e08901611289565b60c082015261140d610100890161127a565b60e082015261141f610120890161127a565b610100820152611432610140890161127a565b6101208201526114456101608901611289565b6101408201526114586101808901611289565b61016082015261146b6101a08901610dc8565b61018082015261147e6101c08901611289565b6101a08201526114916101e08901611289565b6101c08201526114a46102008901610c39565b6101e08201526114b76102208901610298565b61020082015283820152815201930192611321565b61023990929192610200806102208301956114e984825115159052565b60208181015161ffff169085015260408181015163ffffffff169085015260608181015163ffffffff169085015260808181015163ffffffff169085015260a08181015161ffff169085015260c08181015163ffffffff169085015260e08181015161ffff16908501526101008181015161ffff16908501526101208181015161ffff16908501526101408181015163ffffffff16908501526101608181015163ffffffff16908501526101808181015167ffffffffffffffff16908501526101a08181015163ffffffff16908501526101c08181015163ffffffff16908501526101e08181015115159085015201517fffffffff0000000000000000000000000000000000000000000000000000000016910152565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576107566116d36116ce611640610d9a565b600061020061164d61066a565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a0820152826101c0820152826101e0820152015267ffffffffffffffff166000526009602052604060002090565b6134bc565b604051918291826114cc565b81601f82011215610229578035906116f682610c17565b92611704604051948561061a565b82845260208085019360061b8301019181831161022957602001925b82841061172e575050505090565b6040848303126102295760206040918251611748816105e2565b61175187610dc8565b8152828701356117608161020b565b83820152815201930192611720565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957366023820112156102295780600401356117c981610c17565b916117d7604051938461061a565b8183526024602084019260051b820101903682116102295760248101925b828410611826576024358567ffffffffffffffff821161022957611820610cda9236906004016116df565b90613638565b833567ffffffffffffffff811161022957820160407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82360301126102295760405190611872826105e2565b61187e60248201610dc8565b8252604481013567ffffffffffffffff811161022957602491010136601f820112156102295780356118af81610c17565b916118bd604051938461061a565b818352602060e081850193028201019036821161022957602001915b8183106118f857505050918160209384809401528152019301926117f5565b82360360e081126102295760c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060405192611933846105e2565b863561193e8161020b565b845201126102295760e091602091604051611958816105fe565b611963848801611289565b815261197160408801611289565b848201526119816060880161127a565b604082015261199260808801611289565b60608201526119a360a08801611289565b608082015260c08701356119b681610c2f565b60a0820152838201528152019201916118d9565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760005473ffffffffffffffffffffffffffffffffffffffff81163303611a89577fffffffffffffffffffffffff00000000000000000000000000000000000000006001549133828416176001551660005573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b9080601f83011215610229578135611aca81610c17565b92611ad8604051948561061a565b81845260208085019260051b82010192831161022957602001905b828210611b005750505090565b602080918335611b0f8161020b565b815201910190611af3565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957611b69903690600401611ab3565b60243567ffffffffffffffff811161022957611b89903690600401611ab3565b90611b926141c4565b60005b8151811015611c0e5780611bb6611bb1610bc4600194866130a4565b61599e565b611bc1575b01611b95565b73ffffffffffffffffffffffffffffffffffffffff611be3610bc483866130a4565b167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a2611bbb565b8260005b8151811015610cda5780611c33611c2e610bc4600194866130a4565b6159bf565b611c3e575b01611c12565b73ffffffffffffffffffffffffffffffffffffffff611c60610bc483866130a4565b167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2611c38565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957611cda903690600401610ddd565b6024359167ffffffffffffffff831161022957611d33611d2b611d11611d07611d3b963690600401610ddd565b9490953691613931565b90604082015190605e604a84015160601c93015191929190565b919033614e61565b810190613996565b60005b8151811015610cda57611da0611d9b611d75611d5a84866130a4565b515173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b613a55565b611db4611db06040830151151590565b1590565b611f765790611e29611dcc6020600194015160ff1690565b611e23611e026020611dde86896130a4565b5101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b90614f40565b611e446040611e3884876130a4565b51015163ffffffff1690565b63ffffffff611e6f611e66611e5f610b9e611d5a888b6130a4565b5460e01c90565b63ffffffff1690565b911610611f7057611ed2611e886040611e3885886130a4565b611ec2611e9361065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff851681529163ffffffff166020830152565b610a23610b9e611d5a86896130a4565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff611f15611d5a85886130a4565b611f66611f276040611e38888b6130a4565b60405193849316958390929163ffffffff6020917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff604085019616845216910152565b0390a25b01611d3e565b50611f6a565b611fc8611f86611d5a84866130a4565b7f06439c6b0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b6000fd5b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295761075661207f612009610d9a565b67ffffffffffffffff6024359161201f8361020b565b600060a060405161202f816105fe565b828152826020820152826040820152826060820152826080820152015216600052600a60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b6120fb6120f260405192612092846105fe565b5463ffffffff8116845263ffffffff8160201c16602085015261ffff8160401c1660408501526120d96120cc8263ffffffff9060501c1690565b63ffffffff166060860152565b63ffffffff607082901c16608085015260901c60ff1690565b151560a0830152565b6040519182918291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc823603011261022957604051612229816105e2565b816004013567ffffffffffffffff81116102295761224d9060043691850101611ab3565b8152602482013567ffffffffffffffff811161022957610cda9260046122769236920101611ab3565b6020820152613af2565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295736602382011215610229578060040135906122db82610c17565b906122e9604051928361061a565b8282526024602083019360061b8201019036821161022957602401925b81841061231657610cda83613c92565b6040843603126102295760206040918251612330816105e2565b863561233b8161020b565b8152612348838801610dc8565b83820152815201930192612306565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff6004356123a78161020b565b6123af612df0565b50166000526007602052610756604060002060ff604051916123d0836105a5565b5473ffffffffffffffffffffffffffffffffffffffff81168352818160a01c16602084015260a81c161515604082015260405191829182919091604080606083019473ffffffffffffffffffffffffffffffffffffffff815116845260ff602082015116602085015201511515910152565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957604051806020600b54918281520190600b6000527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db99060005b8181106124c157610756856108298187038261061a565b82548452602090930192600192830192016124aa565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760406125176004356110fa8161020b565b6125518251809263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565bf35b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602060405160128152f35b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576125c4610d9a565b6024359067ffffffffffffffff821161022957816004019060a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8436030112610229576126296116ce8267ffffffffffffffff166000526009602052604060002090565b91612637611db08451151590565b61298257606484019061267b611db061264f84613208565b73ffffffffffffffffffffffffffffffffffffffff166000526001600b01602052604060002054151590565b61293457604485019361268e8583612e0f565b94905060248701966126c16126a38986613ecb565b9050876126ba6126b38880613ecb565b3691613931565b918661526a565b6126cd61118086613208565b966126e96126e36101c086015163ffffffff1690565b8461532a565b92600080891561290c57505090612717918961270e6127078a613208565b9389612e0f565b93909288615477565b9591955b60009861ffff61273161010089015161ffff1690565b166128a5575b5088612888896128888a8f8f9861287a61285461284e8f6107569f6128959f6101807bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9f61288d9f936dffffffffffffffffffffffffffff61282a61284195612823896128009f6128419f60846128156128319a63ffffffff6128009f85826128068a6128006127f960a06127ef61280d9861281d9f6127e589916127df60808a015163ffffffff1690565b9b613ecb565b9290501690613f1c565b93015161ffff1690565b61ffff1690565b90612d5b565b9116613f1c565b911690613f1c565b950190613ecb565b90615795565b5190613f1c565b9116612d5b565b93015167ffffffffffffffff1690565b67ffffffffffffffff1690565b96613208565b73ffffffffffffffffffffffffffffffffffffffff166000526008602052604060002090565b5467ffffffffffffffff1690565b613f1c565b911690612d6e565b6040519081529081906020820190565b8597929a9950928181999594889d9897936128d289956dffffffffffffffffffffffffffff9060701c1690565b6dffffffffffffffffffffffffffff16916128ed8b86613ecb565b90506128f993876156f4565b9a9b9398965091509293979a959a612737565b915095915061292e612929611e666101a088015163ffffffff1690565b612d14565b9561271b565b611fc861294083613208565b7f2502348c0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b7f99ac52f20000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff821660045260246000fd5b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff600435612a0a8161020b565b612a126141c4565b16338114612a8457807fffffffffffffffffffffffff0000000000000000000000000000000000000000600054161760005573ffffffffffffffffffffffffffffffffffffffff600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b60ff81160361022957565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590612b1482610c17565b90612b22604051928361061a565b8282526024602083019360071b8201019036821161022957602401925b818410612b4f57610cda83613f29565b833603608081126102295760607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060405192612b8a846105e2565b8735612b958161020b565b8452011261022957608091602091604051612baf816105a5565b83880135612bbc8161020b565b81526040880135612bcc81612aae565b848201526060880135612bde81610c2f565b604082015283820152815201930192612b3f565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957600435612c2d8161020b565b612c35610db1565b9067ffffffffffffffff82169182600052600960205260ff6040600020541615612cb757612c65612c86926140d1565b92600052600960205263ffffffff60016040600020015460801c169061532a565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152f35b827f99ac52f20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90662386f26fc10000820291808304662386f26fc100001490151715612d3657565b612ce5565b90655af3107a4000820291808304655af3107a40001490151715612d3657565b81810292918115918404141715612d3657565b8115612d78570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b612de6612de0612ded94937bffffffffffffffffffffffffffffffffffffffffffffffffffffffff612dd981956140d1565b1690612d5b565b926140d1565b1690612d6e565b90565b60405190612dfd826105a5565b60006040838281528260208201520152565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610229570180359067ffffffffffffffff821161022957602001918160061b3603831361022957565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015612ea25760061b0190565b612e63565b35907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216820361022957565b60408136031261022957612eff602060405192612eec846105e2565b8035612ef78161020b565b845201612ea7565b602082015290565b60408136031261022957612eff602060405192612f23846105e2565b612ef781610dc8565b90612f356141c4565b60005b825181101561309f5780612f4e600192856130a4565b517f32a4ba3fa3351b11ad555d4c8ec70a744e8705607077a946807030d64b6ab1a360a073ffffffffffffffffffffffffffffffffffffffff83511692606081019373ffffffffffffffffffffffffffffffffffffffff80865116957fffff00000000000000000000000000000000000000000000000000000000000061300660208601947fffffffffffffffffffff00000000000000000000000000000000000000000000865116604088019a848c51169261583d565b977fffffffffffffffffffff000000000000000000000000000000000000000000006080870195613072875115158c600052600460205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b8560405198511688525116602087015251166040850152511660608301525115156080820152a201612f38565b509050565b8051821015612ea25760209160051b010190565b989592919097949693977f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff821673ffffffffffffffffffffffffffffffffffffffff8216146000146131df575050965b6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168089116131ae5750916131936131a194926131a7969463ffffffff8060016131898f67ffffffffffffffff166000526009602052604060002090565b01541616916142e8565b9660208801511515996144b0565b926146c4565b9293929190565b887f6a92a4830000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b916131e992612da7565b9661311e565b604051906131fc826105e2565b60006020838281520152565b35612ded8161020b565b9060405161321f816105e2565b91547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116835260e01c6020830152565b906132556141c4565b60005b825181101561309f5761326b81846130a4565b51602061328a61327b84876130a4565b515167ffffffffffffffff1690565b9101519067ffffffffffffffff81168015801561349d575b8015613424575b80156133f6575b6133be5791613384826001959461333461330f886132e56133899867ffffffffffffffff166000526009602052604060002090565b015460381b7fffffffff000000000000000000000000000000000000000000000000000000001690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b61338f577f525e3d4e0c31cef19cf9426af8d2c0ddd2d576359ca26bed92aac5fadda462656040518061336787826114cc565b0390a267ffffffffffffffff166000526009602052604060002090565b614712565b01613258565b7f283b699f411baff8f1c29fe49f32a828c8151596244b8e7e4c164edd6569a8356040518061336787826114cc565b7fc35aa79d0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff821660045260246000fd5b5061016083015163ffffffff1663ffffffff61341c611e66606087015163ffffffff1690565b9116116132b0565b507f2812d52c000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000006134956102008601517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614156132a9565b5063ffffffff6134b561016085015163ffffffff1690565b16156132a2565b9061023961360e60016134cd61066a565b9461358b61357d82546134e96134e38260ff1690565b15158a52565b61ffff600882901c1660208a015263ffffffff601882901c1660408a015263ffffffff603882901c1660608a015263ffffffff605882901c1660808a015261ffff607882901c1660a08a015263ffffffff608882901c1660c08a015261ffff60a882901c1660e08a015261ffff60b882901c166101008a015261ffff60c882901c166101208a015260d81c63ffffffff1690565b63ffffffff16610140880152565b015463ffffffff811661016086015267ffffffffffffffff602082901c1661018086015263ffffffff606082901c166101a086015263ffffffff608082901c166101c08601526135e660a082901c60ff1615156101e0870152565b60381b7fffffffff000000000000000000000000000000000000000000000000000000001690565b7fffffffff0000000000000000000000000000000000000000000000000000000016610200840152565b906136416141c4565b6000915b80518310156138725761365883826130a4565b519061366c825167ffffffffffffffff1690565b946020600093019367ffffffffffffffff8716935b8551805182101561385d57613698826020926130a4565b5101516136a9611d5a8389516130a4565b8151602083015163ffffffff908116911681811015613824575050608082015163ffffffff16602081106137d6575090867f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b573ffffffffffffffffffffffffffffffffffffffff84613765858f6001999861373b6137609267ffffffffffffffff16600052600a602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b614cd7565b6137cd60405192839216958291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b0390a301613681565b7f24ecdc020000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff90911660045263ffffffff1660245260446000fd5b7f0b4f67a20000000000000000000000000000000000000000000000000000000060005263ffffffff9081166004521660245260446000fd5b50509550925092600191500191929092613645565b50905060005b815181101561392d578061389161327b600193856130a4565b67ffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff6138da60206138be86896130a4565b51015173ffffffffffffffffffffffffffffffffffffffff1690565b60006138fe8261373b8767ffffffffffffffff16600052600a602052604060002090565b551691167f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b600080a301613878565b5050565b92919267ffffffffffffffff82116105c15760405191613979601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0166020018461061a565b829481845281830111610229578281602093846000960137010152565b6020818303126102295780359067ffffffffffffffff8211610229570181601f82011215610229578035906139ca82610c17565b926139d8604051948561061a565b8284526020606081860194028301019181831161022957602001925b828410613a02575050505090565b606084830312610229576020606091604051613a1d816105a5565b8635613a288161020b565b8152613a35838801612ea7565b83820152613a4560408801611289565b60408201528152019301926139f4565b90604051613a62816105a5565b604060ff82945473ffffffffffffffffffffffffffffffffffffffff81168452818160a01c16602085015260a81c161515910152565b90610239604051613aa8816105fe565b925463ffffffff8082168552602082811c821690860152604082811c61ffff1690860152605082901c81166060860152607082901c16608085015260901c60ff16151560a0840152565b613afa6141c4565b60208101519160005b8351811015613bae5780613b1c610bc4600193876130a4565b613b58613b5373ffffffffffffffffffffffffffffffffffffffff83165b73ffffffffffffffffffffffffffffffffffffffff1690565b615cd5565b613b64575b5001613b03565b60405173ffffffffffffffffffffffffffffffffffffffff9190911681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758090602090a138613b5d565b5091505160005b815181101561392d57613bcb610bc482846130a4565b9073ffffffffffffffffffffffffffffffffffffffff821615613c68577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef613c5f83613c37613c32613b3a60019773ffffffffffffffffffffffffffffffffffffffff1690565b615c5c565b5060405173ffffffffffffffffffffffffffffffffffffffff90911681529081906020820190565b0390a101613bb5565b7f8579befe0000000000000000000000000000000000000000000000000000000060005260046000fd5b613c9a6141c4565b60005b815181101561392d578073ffffffffffffffffffffffffffffffffffffffff613cc8600193856130a4565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d613d6567ffffffffffffffff6020613d0486896130a4565b51015116836000526008602052604060002067ffffffffffffffff82167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556040519182918291909167ffffffffffffffff6020820193169052565b0390a201613c9d565b91908203918211612d3657565b613d836131ef565b50613db6613db18273ffffffffffffffffffffffffffffffffffffffff166000526006602052604060002090565b613212565b6020810191613dd5613dcf611e66855163ffffffff1690565b42613d6e565b63ffffffff7f00000000000000000000000000000000000000000000000000000000000000001611613e8a57611d9b613e2e9173ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b613e3e611db06040830151151590565b8015613e90575b613e8a57613e52906150e1565b9163ffffffff613e7a611e66613e6f602087015163ffffffff1690565b935163ffffffff1690565b911610613e85575090565b905090565b50905090565b5073ffffffffffffffffffffffffffffffffffffffff613ec4825173ffffffffffffffffffffffffffffffffffffffff1690565b1615613e45565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610229570180359067ffffffffffffffff82116102295760200191813603831361022957565b91908201809211612d3657565b90613f326141c4565b60005b825181101561309f5780613f4b600192856130a4565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf6140c8602073ffffffffffffffffffffffffffffffffffffffff8451169301518360005260076020526040600020613ff773ffffffffffffffffffffffffffffffffffffffff835116829073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b602082015181547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1660a09190911b74ff000000000000000000000000000000000000000016177fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff75ff0000000000000000000000000000000000000000006040850151151560a81b16911617905560405191829182919091604080606083019473ffffffffffffffffffffffffffffffffffffffff815116845260ff602082015116602085015201511515910152565b0390a201613f35565b6140da81613d7b565b9063ffffffff602083015116158015614159575b6141155750517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff907f06439c6b000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff825116156140ee565b3360005260036020526040600020541561419657565b7fd86ad9cf000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff6001541633036141e557565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b919091357fffffffff0000000000000000000000000000000000000000000000000000000081169260048110614243575050565b7fffffffff00000000000000000000000000000000000000000000000000000000929350829060040360031b1b161690565b909291928360041161022957831161022957600401917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0190565b90816020910312610229575190565b90816040910312610229576020604051916142d9836105e2565b805183520151612eff81610c2f565b916142f16131ef565b5081156143e757506143326126b3828061432c7fffffffff00000000000000000000000000000000000000000000000000000000958761420f565b95614275565b91167f181dcf1000000000000000000000000000000000000000000000000000000000810361436f575080602080612ded935183010191016142bf565b7f97a657c900000000000000000000000000000000000000000000000000000000146143bf577f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b806020806143d2935183010191016142b0565b6143da61065b565b9081526000602082015290565b91505067ffffffffffffffff6143fb61065b565b911681526000602082015290565b9061441382610c17565b614420604051918261061a565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061444e8294610c17565b019060005b82811061445f57505050565b806060602080938501015201614453565b9190811015612ea25760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6181360301821215610229570190565b9092916144d660016132e58467ffffffffffffffff166000526009602052604060002090565b906144e081614409565b9560005b8281106144f5575050505050505090565b614508614503828489612e92565b613208565b8388614522614518858484614470565b6040810190613ecb565b90506020811161463c575b50839261455c6145566126b361454c60019861457f9761457a97614470565b6020810190613ecb565b896158ce565b61373b8967ffffffffffffffff16600052600a602052604060002090565b613a98565b60a081015115614602576145e66145a060606145ba93015163ffffffff1690565b6040805163ffffffff909216602083015290928391820190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261061a565b6145f0828b6130a4565b526145fb818a6130a4565b50016144e4565b506145ba6145e661463761462a8967ffffffffffffffff166000526009602052604060002090565b5460d81c63ffffffff1690565b6145a0565b915050614674611e666146678461373b8b67ffffffffffffffff16600052600a602052604060002090565b5460701c63ffffffff1690565b106146815783883861452d565b7f36f536ca0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff1660045260246000fd5b6020604051917f181dcf1000000000000000000000000000000000000000000000000000000000828401528051602484015201511515604482015260448152612ded60648261061a565b9055565b90614c8d61020060016102399461475d61472c8651151590565b829060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b6147a361476f602087015161ffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff1660089190911b62ffff0016178255565b6147ef6147b7604087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffff1660189190911b66ffffffff00000016178255565b61483f614803606087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffff1660389190911b6affffffff0000000000000016178255565b614893614853608087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff1660589190911b6effffffff000000000000000000000016178255565b6148e76148a560a087015161ffff1690565b82547fffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffff1660789190911b70ffff00000000000000000000000000000016178255565b6149416148fb60c087015163ffffffff1690565b82547fffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffff1660889190911b74ffffffff000000000000000000000000000000000016178255565b61499b61495360e087015161ffff1690565b82547fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff1660a89190911b76ffff00000000000000000000000000000000000000000016178255565b6149f86149ae61010087015161ffff1690565b82547fffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffff1660b89190911b78ffff000000000000000000000000000000000000000000000016178255565b614a57614a0b61012087015161ffff1690565b82547fffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c89190911b7affff0000000000000000000000000000000000000000000000000016178255565b614abc614a6c61014087015163ffffffff1690565b82547fff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff1660d89190911b7effffffff00000000000000000000000000000000000000000000000000000016178255565b0192614b04614ad361016083015163ffffffff1690565b859063ffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000825416179055565b614b5a614b1d61018083015167ffffffffffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff1660209190911b6bffffffffffffffff0000000016178555565b614bb0614b6f6101a083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff1660609190911b6fffffffff00000000000000000000000016178555565b614c0a614bc56101c083015163ffffffff1690565b85547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff1660809190911b73ffffffff0000000000000000000000000000000016178555565b614c66614c1b6101e0830151151590565b85805490917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90911690151560a01b74ff000000000000000000000000000000000000000016179055565b01517fffffffff000000000000000000000000000000000000000000000000000000001690565b81547fffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffff1660389190911c78ffffffff00000000000000000000000000000000000000000016179055565b614e1d60a061023993614d1c63ffffffff825116859063ffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000825416179055565b60208181015185546040808501517fffffffffffffffffffffffffffffffffffffffffffff000000000000ffffffff9092169290931b67ffffffff000000001691909117911b69ffff0000000000000000161784556060810151614dbf9063ffffffff1685547fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff1660509190911b6dffffffff0000000000000000000016178555565b614e16614dd3608083015163ffffffff1690565b85547fffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff1660709190911b71ffffffff000000000000000000000000000016178555565b0151151590565b81547fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff1690151560901b72ff00000000000000000000000000000000000016179055565b91929092614e718282868661583d565b600052600460205260ff6040600020541615614e8d5750505050565b6040517f097e17ff00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529390921660248401527fffffffffffffffffffff0000000000000000000000000000000000000000000090911660448301527fffff000000000000000000000000000000000000000000000000000000000000166064820152608490fd5b0390fd5b604d8111612d3657600a0a90565b60ff1660120160ff8111612d365760ff16906024821115615005577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8201918211612d3657614f91614f9792614f32565b90612d6e565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111614fdb577bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7f10cb51d10000000000000000000000000000000000000000000000000000000060005260046000fd5b906024039060248211612d365761280061501e92614f32565b614f97565b9060ff80911691160160ff8111612d365760ff16906024821115615005577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8201918211612d3657614f91614f9792614f32565b519069ffffffffffffffffffff8216820361022957565b908160a0910312610229576150a281615077565b91602082015191604081015191612ded608060608401519301615077565b6040513d6000823e3d90fd5b908160209103126102295751612ded81612aae565b6150e96131ef565b5061510e613b3a613b3a835173ffffffffffffffffffffffffffffffffffffffff1690565b90604051907ffeaf968c00000000000000000000000000000000000000000000000000000000825260a082600481865afa92831561522b57600092600094615230575b5060008312614fdb576020600491604051928380927f313ce5670000000000000000000000000000000000000000000000000000000082525afa92831561522b57612ded9363ffffffff936151b7936000926151f5575b506020015160ff165b90615023565b926151e76151c361065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9095168552565b1663ffffffff166020830152565b6151b191925061521c602091823d8411615224575b615214818361061a565b8101906150cc565b9291506151a8565b503d61520a565b6150c0565b90935061525691925060a03d60a011615263575b61524e818361061a565b81019061508e565b5093925050919238615151565b503d615244565b919063ffffffff6040840151168082116152fa57505061ffff602083015116908181116152c4575050907fffffffff00000000000000000000000000000000000000000000000000000000610200610239930151166158ce565b61ffff92507fd88dddd6000000000000000000000000000000000000000000000000000000006000526004521660245260446000fd5b7f869337890000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b67ffffffffffffffff8116600052600560205260406000209160405192615350846105e2565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116845260e01c9182602085015263ffffffff821692836153b4575b50505050612ded90517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b63ffffffff164290810393908411612d365783116153d2578061538a565b7ff08bcb3e0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045263ffffffff1660245260445260646000fd5b6040813603126102295760206040519161542e836105e2565b80356154398161020b565b83520135602082015290565b63ffffffff60209116019063ffffffff8211612d3657565b9063ffffffff8091169116019063ffffffff8211612d3657565b929593909491956000936000976000976000955b80871061549e5750505050505050929190565b9091929394959698996154ba6154b589848a612e92565b615415565b9961552261457a8c6154fe6154e38867ffffffffffffffff16600052600a602052604060002090565b915173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b91615533611db060a0850151151590565b6156a25760009b604084019061554e6127f9835161ffff1690565b615603575b5050606083015163ffffffff166155699161545d565b9b608083015161557c9063ffffffff1690565b6155859161545d565b9a82516155959063ffffffff1690565b63ffffffff166155a490612d14565b600193908083106155f75750612929611e6660206155c793015163ffffffff1690565b8082116155e657506155d891613f1c565b975b0195949392919061548b565b90506155f191613f1c565b976155da565b9150506155f191613f1c565b906128006127f9615693949f61568a9460208e61568193508d73ffffffffffffffffffffffffffffffffffffffff61564f855173ffffffffffffffffffffffffffffffffffffffff1690565b911673ffffffffffffffffffffffffffffffffffffffff82161461569b5761567791506140d1565b915b0151906159e0565b925161ffff1690565b620186a0900490565b9a3880615553565b5091615679565b989a50600191506156e86156cf6156ee926156c96129296127f96101208c015161ffff1690565b90613f1c565b996156e261014089015163ffffffff1690565b9061545d565b9b615445565b996155da565b91939093806101e00193846101e011612d36576101208102908082046101201490151715612d36576101e0910101809311612d36576127f96101006127ef612ded966dffffffffffffffffffffffffffff6157886157746157626157909a63ffffffff6128009a1690613f1c565b6128006127f960e08c015161ffff1690565b6156c9611e6660c08b015163ffffffff1690565b911690612d5b565b612d3b565b6157b4916157a16131ef565b5063ffffffff61016085015116916142e8565b90815163ffffffff806060840151161610615813576101e00151151580615807575b6157dd5790565b7fee433e990000000000000000000000000000000000000000000000000000000060005260046000fd5b506020810151156157d6565b7f4c4fc93a0000000000000000000000000000000000000000000000000000000060005260046000fd5b6040805173ffffffffffffffffffffffffffffffffffffffff9283166020820190815292909316908301527fffffffffffffffffffff0000000000000000000000000000000000000000000090921660608201527fffff0000000000000000000000000000000000000000000000000000000000009092166080830152906158c88160a081016145ba565b51902090565b7fffffffff00000000000000000000000000000000000000000000000000000000167f2812d52c00000000000000000000000000000000000000000000000000000000146159195750565b602081510361595c5761593560208251830101602083016142b0565b73ffffffffffffffffffffffffffffffffffffffff8111908115615992575b5061595c5750565b614f2e906040519182917f8d666f6000000000000000000000000000000000000000000000000000000000835260048301615a15565b61040091501038615954565b73ffffffffffffffffffffffffffffffffffffffff612ded9116600b615b09565b73ffffffffffffffffffffffffffffffffffffffff612ded9116600b615c97565b670de0b6b3a7640000917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff615a119216612d5b565b0490565b906020612ded92818152019061067a565b8054821015612ea25760005260206000200190600090565b9161470e918354907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b80548015615ada577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190615aab8282615a26565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001810191806000528260205260406000205492831515600014615bf7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8401848111612d36578354937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8501948511612d36576000958583615ba897615b999503615bae575b505050615a76565b90600052602052604060002090565b55600190565b615bde615bd891615bcf615bc5615bee9588615a26565b90549060031b1c90565b92839187615a26565b90615a3e565b8590600052602052604060002090565b55388080615b91565b50505050600090565b805490680100000000000000008210156105c15781615c2791600161470e94018155615a26565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b600081815260036020526040902054615c9157615c7a816002615c00565b600254906000526003602052604060002055600190565b50600090565b6000828152600182016020526040902054615cce5780615cb983600193615c00565b80549260005201602052604060002055600190565b5050600090565b600081815260036020526040902054908115615cce577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820190828211612d3657600254927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8401938411612d36578383615ba89460009603615d71575b505050615d606002615a76565b600390600052602052604060002090565b615d60615bd891615d89615bc5615d93956002615a26565b9283916002615a26565b55388080615d5356fea164736f6c634300081a000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"priceUpdaters\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]},{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"FEE_BASE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"KEYSTONE_PRICE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyAuthorizedCallerUpdates\",\"inputs\":[{\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\",\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"components\":[{\"name\":\"addedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"removedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyDestChainConfigUpdates\",\"inputs\":[{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyFeeTokensUpdates\",\"inputs\":[{\"name\":\"feeTokensToRemove\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokensToAdd\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyPremiumMultiplierWeiPerEthUpdates\",\"inputs\":[{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyTokenTransferFeeConfigUpdates\",\"inputs\":[{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"tokensToUseDefaultFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigRemoveArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"convertTokenAmount\",\"inputs\":[{\"name\":\"fromToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"fromTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toToken\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAllAuthorizedCallers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestinationChainGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeTokens\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPremiumMultiplierWeiPerEth\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStaticConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenAndGasPrices\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"tokenPrice\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"gasPriceValue\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPriceFeedConfig\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrices\",\"inputs\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenTransferFeeConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedFee\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structClient.EVM2AnyMessage\",\"components\":[{\"name\":\"receiver\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onReport\",\"inputs\":[{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processMessageArgs\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"onRampTokenTransfers\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.EVM2AnyTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destTokenAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"destExecData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"sourceTokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"isOutOfOrderExecution\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"convertedExtraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destExecDataPerToken\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setReportPermissions\",\"inputs\":[{\"name\":\"permissions\",\"type\":\"tuple[]\",\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission[]\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updatePrices\",\"inputs\":[{\"name\":\"priceUpdates\",\"type\":\"tuple\",\"internalType\":\"structInternal.PriceUpdates\",\"components\":[{\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"usdPerToken\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]},{\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.GasPriceUpdate[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"usdPerUnitGas\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateTokenPriceFeeds\",\"inputs\":[{\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AuthorizedCallerAdded\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AuthorizedCallerRemoved\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainAdded\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenAdded\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenRemoved\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PremiumMultiplierWeiPerEthUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PriceFeedPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"priceFeedConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ReportPermissionSet\",\"inputs\":[{\"name\":\"reportId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"permission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigDeleted\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerUnitGasUpdated\",\"inputs\":[{\"name\":\"destChain\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DataFeedValueOutOfUint224Range\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DestinationChainNotEnabled\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ExtraArgOutOfOrderExecutionMustBeTrue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FeeTokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidDestBytesOverhead\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidEVMAddress\",\"inputs\":[{\"name\":\"encodedAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidExtraArgsTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidFeeRange\",\"inputs\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStaticConfig\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageFeeTooHigh\",\"inputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MessageGasLimitTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageTooLarge\",\"inputs\":[{\"name\":\"maxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actualSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReportForwarderUnauthorized\",\"inputs\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"}]},{\"type\":\"error\",\"name\":\"SourceTokenDataTooLarge\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"StaleGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timePassed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"TokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnsupportedNumberOfTokens\",\"inputs\":[{\"name\":\"numberOfTokens\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ZeroAddressNotAllowed\",\"inputs\":[]}]", + Bin: "0x60e0604052346110505761755180380380610019816112bc565b9283398101908082036101208112611050576060136110505761003a61127e565b81516001600160601b038116810361105057815261005a602083016112e1565b906020810191825261006e604084016112f5565b6040820190815260608401516001600160401b038111611050578561009491860161131d565b60808501519094906001600160401b03811161105057866100b691830161131d565b60a08201519096906001600160401b0381116110505782019080601f830112156110505781516100ed6100e882611306565b6112bc565b9260208085848152019260071b8201019083821161105057602001915b8183106112095750505060c08301516001600160401b0381116110505783019781601f8a011215611050578851986101446100e88b611306565b996020808c838152019160051b830101918483116110505760208101915b8383106110a7575050505060e08401516001600160401b0381116110505784019382601f8601121561105057845161019c6100e882611306565b9560208088848152019260061b8201019085821161105057602001915b81831061106b57505050610100810151906001600160401b038211611050570182601f82011215611050578051906101f36100e883611306565b93602061028081878681520194028301019181831161105057602001925b828410610e8e57505050503315610e7d57600180546001600160a01b031916331790556020986102408a6112bc565b9760008952600036813761025261129d565b998a52888b8b015260005b89518110156102c4576001906001600160a01b0361027b828d6113b6565b51168d610287826115a2565b610294575b50500161025d565b7fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758091604051908152a1388d61028c565b508a985089519660005b885181101561033f576001600160a01b036102e9828b6113b6565b511690811561032e577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8c8361032060019561152a565b50604051908152a1016102ce565b6342bcdf7f60e11b60005260046000fd5b5081518a985089906001600160a01b0316158015610e6b575b8015610e5c575b610e4b5791516001600160a01b031660a05290516001600160601b03166080525163ffffffff1660c052610392866112bc565b9360008552600036813760005b855181101561040e576001906103c76001600160a01b036103c0838a6113b6565b5116611437565b6103d2575b0161039f565b818060a01b036103e282896113b6565b51167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26103cc565b508694508560005b84518110156104855760019061043e6001600160a01b0361043783896113b6565b5116611569565b610449575b01610416565b818060a01b0361045982886113b6565b51167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2610443565b508593508460005b835181101561054757806104a3600192866113b6565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf606089858060a01b038451169301518360005260078b5260406000209060ff878060a01b038251169283898060a01b03198254161781558d8301908151604082549501948460a81b8651151560a81b16918560a01b9060a01b169061ffff60a01b19161717905560405193845251168c8301525115156040820152a20161048d565b5091509160005b8251811015610ae35761056181846113b6565b51856001600160401b0361057584876113b6565b5151169101519080158015610ad0575b8015610ab0575b8015610a92575b610a7e57600081815260098852604090205460019392919060081b6001600160e01b03191661093657807f71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad604051806106fc868291909161024063ffffffff8161026084019580511515855261ffff602082015116602086015282604082015116604086015282606082015116606086015282608082015116608086015260ff60a08201511660a086015260ff60c08201511660c086015261ffff60e08201511660e0860152826101008201511661010086015261ffff6101208201511661012086015261ffff610140820151166101408601528260e01b61016082015116610160860152610180810151151561018086015261ffff6101a0820151166101a0860152826101c0820151166101c0860152826101e0820151166101e086015260018060401b03610200820151166102008601528261022082015116610220860152015116910152565b0390a25b60005260098752826040600020825115158382549162ffff008c83015160081b169066ffffffff000000604084015160181b166affffffff00000000000000606085015160381b16926effffffff0000000000000000000000608086015160581b169260ff60781b60a087015160781b169460ff60801b60c088015160801b169161ffff60881b60e089015160881b169063ffffffff60981b6101008a015160981b169361ffff60b81b6101208b015160b81b169661ffff60c81b6101408c015160c81b169963ffffffff60d81b6101608d015160081c169b61018060ff60f81b910151151560f81b169c8f8060f81b039a63ffffffff60d81b199961ffff60c81b199861ffff60b81b199763ffffffff60981b199661ffff60881b199560ff60801b199460ff60781b19936effffffff0000000000000000000000199260ff6affffffff000000000000001992169066ffffffffffffff19161716171617161716171617161716171617161716179063ffffffff60d81b1617178155019061ffff6101a0820151169082549165ffffffff00006101c083015160101b169269ffffffff0000000000006101e084015160301b166a01000000000000000000008860901b0361020085015160501b169263ffffffff60901b61022086015160901b169461024063ffffffff60b01b91015160b01b169563ffffffff60b01b199363ffffffff60901b19926a01000000000000000000008c60901b0319918c8060501b03191617161716171617171790550161054e565b807f2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e360405180610a76868291909161024063ffffffff8161026084019580511515855261ffff602082015116602086015282604082015116604086015282606082015116606086015282608082015116608086015260ff60a08201511660a086015260ff60c08201511660c086015261ffff60e08201511660e0860152826101008201511661010086015261ffff6101208201511661012086015261ffff610140820151166101408601528260e01b61016082015116610160860152610180810151151561018086015261ffff6101a0820151166101a0860152826101c0820151166101c0860152826101e0820151166101e086015260018060401b03610200820151166102008601528261022082015116610220860152015116910152565b0390a2610700565b63c35aa79d60e01b60005260045260246000fd5b5063ffffffff6101e08301511663ffffffff60608401511610610593565b506101608201516001600160e01b031916630a04b54b60e21b141561058c565b5063ffffffff6101e08301511615610585565b84828560005b8151811015610b69576001906001600160a01b03610b0782856113b6565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d86848060401b0381610b3d86896113b6565b510151168360005260088252604060002081878060401b0319825416179055604051908152a201610ae9565b83600184610b76836112bc565b9060008252600092610e46575b909282935b8251851015610d8557610b9b85846113b6565b5180516001600160401b0316939083019190855b83518051821015610d7457610bc58287926113b6565b51015184516001600160a01b0390610bde9084906113b6565b5151169063ffffffff815116908781019163ffffffff8351169081811015610d5f5750506080810163ffffffff815116898110610d48575090899291838c52600a8a5260408c20600160a01b6001900386168d528a5260408c2092825163ffffffff169380549180518d1b67ffffffff0000000016916040860192835160401b69ffff000000000000000016966060810195865160501b6dffffffff00000000000000000000169063ffffffff60701b895160701b169260a001998b60ff60901b8c51151560901b169560ff60901b199363ffffffff60701b19926dffffffff000000000000000000001991600160501b60019003191617161716171617171790556040519586525163ffffffff168c8601525161ffff1660408501525163ffffffff1660608401525163ffffffff16608083015251151560a082015260c07f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b591a3600101610baf565b6312766e0160e11b8c52600485905260245260448bfd5b6305a7b3d160e11b8c5260045260245260448afd5b505060019096019593509050610b88565b9150825b8251811015610e07576001906001600160401b03610da782866113b6565b515116828060a01b0384610dbb84886113b6565b5101511690808752600a855260408720848060a01b038316885285528660408120557f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b8780a301610d89565b604051615f1a908161163782396080518181816104d40152613273015260a051818181610517015261320a015260c05181818161053e0152613f1b0152f35b610b83565b63d794ef9560e01b60005260046000fd5b5063ffffffff8251161561035f565b5080516001600160601b031615610358565b639b15e16f60e01b60005260046000fd5b838203610280811261105057610260610ea561129d565b91610eaf87611393565b8352601f190112611050576040519161026083016001600160401b0381118482101761105557604052610ee460208701611386565b8352610ef2604087016113a7565b6020840152610f03606087016112f5565b6040840152610f14608087016112f5565b6060840152610f2560a087016112f5565b6080840152610f3660c08701611378565b60a0840152610f4760e08701611378565b60c0840152610f5961010087016113a7565b60e0840152610f6b61012087016112f5565b610100840152610f7e61014087016113a7565b610120840152610f9161016087016113a7565b610140840152610180860151916001600160e01b0319831683036110505783602093610160610280960152610fc96101a08901611386565b610180820152610fdc6101c089016113a7565b6101a0820152610fef6101e089016112f5565b6101c082015261100261020089016112f5565b6101e08201526110156102208901611393565b61020082015261102861024089016112f5565b61022082015261103b61026089016112f5565b61024082015283820152815201930192610211565b600080fd5b634e487b7160e01b600052604160045260246000fd5b60408387031261105057602060409161108261129d565b61108b866112e1565b8152611098838701611393565b838201528152019201916101b9565b82516001600160401b0381116110505782016040818803601f190112611050576110cf61129d565b906110dc60208201611393565b825260408101516001600160401b03811161105057602091010187601f8201121561105057805161110f6100e882611306565b91602060e08185858152019302820101908a821161105057602001915b81831061114b5750505091816020938480940152815201920191610162565b828b0360e081126110505760c061116061129d565b9161116a866112e1565b8352601f190112611050576040519160c08301916001600160401b038311848410176110555760e0936020936040526111a48488016112f5565b81526111b2604088016112f5565b848201526111c2606088016113a7565b60408201526111d3608088016112f5565b60608201526111e460a088016112f5565b60808201526111f560c08801611386565b60a08201528382015281520192019161112c565b8284036080811261105057606061121e61129d565b91611228866112e1565b8352601f1901126110505760809160209161124161127e565b61124c8488016112e1565b815261125a60408801611378565b8482015261126a60608801611386565b60408201528382015281520192019161010a565b60405190606082016001600160401b0381118382101761105557604052565b60408051919082016001600160401b0381118382101761105557604052565b6040519190601f01601f191682016001600160401b0381118382101761105557604052565b51906001600160a01b038216820361105057565b519063ffffffff8216820361105057565b6001600160401b0381116110555760051b60200190565b9080601f830112156110505781516113376100e882611306565b9260208085848152019260051b82010192831161105057602001905b8282106113605750505090565b6020809161136d846112e1565b815201910190611353565b519060ff8216820361105057565b5190811515820361105057565b51906001600160401b038216820361105057565b519061ffff8216820361105057565b80518210156113ca5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b80548210156113ca5760005260206000200190600090565b8054801561142157600019019061140f82826113e0565b8154906000199060031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6000818152600c602052604090205480156114f85760001981018181116114e257600b546000198101919082116114e257818103611491575b50505061147d600b6113f8565b600052600c60205260006040812055600190565b6114ca6114a26114b393600b6113e0565b90549060031b1c928392600b6113e0565b819391549060031b91821b91600019901b19161790565b9055600052600c602052604060002055388080611470565b634e487b7160e01b600052601160045260246000fd5b5050600090565b8054906801000000000000000082101561105557816114b3916001611526940181556113e0565b9055565b806000526003602052604060002054156000146115635761154c8160026114ff565b600254906000526003602052604060002055600190565b50600090565b80600052600c602052604060002054156000146115635761158b81600b6114ff565b600b5490600052600c602052604060002055600190565b60008181526003602052604090205480156114f85760001981018181116114e2576002546000198101919082116114e2578082036115fc575b5050506115e860026113f8565b600052600360205260006040812055600190565b61161e61160d6114b39360026113e0565b90549060031b1c92839260026113e0565b905560005260036020526040600020553880806115db56fe6080604052600436101561001257600080fd5b60003560e01c806241e5be1461020657806301ffc9a714610201578063061877e3146101fc57806306285c69146101f7578063181f5a77146101f25780632451a627146101ed578063325c868e146101e85780633937306f146101e357806341ed29e7146101de578063430d138c146101d957806345ac924d146101d45780634ab35b0b146101cf578063514e8cff146101ca5780636def4ce7146101c5578063770e2dc4146101c057806379ba5097146101bb5780637afac322146101b6578063805f2132146101b157806382b49eb0146101ac57806387b8d879146101a75780638da5cb5b146101a257806391a2749a1461019d578063a69c64c014610198578063bf78e03f14610193578063cdc73d511461018e578063d02641a014610189578063d63d3af214610184578063d8694ccd1461017f578063f2fde38b1461017a578063fbe3f778146101755763ffdb4b371461017057600080fd5b612d38565b612bff565b612b0b565b6125f3565b6125b9565b61253d565b6124a8565b6123bd565b6122e6565b612216565b6121c4565b611f6c565b611dc4565b611a83565b611912565b6117c2565b611567565b6113ca565b6111ab565b611140565b61103b565b610edb565b610c44565b610885565b61084b565b6107aa565b6106d9565b61047a565b610407565b6102c5565b61023b565b73ffffffffffffffffffffffffffffffffffffffff81160361022957565b600080fd5b35906102398261020b565b565b346102295760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602061029060043561027b8161020b565b6024356044359161028b8361020b565b612eed565b604051908152f35b35907fffffffff000000000000000000000000000000000000000000000000000000008216820361022957565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576004357fffffffff0000000000000000000000000000000000000000000000000000000081168103610229577fffffffff00000000000000000000000000000000000000000000000000000000602091167f805f21320000000000000000000000000000000000000000000000000000000081149081156103dd575b81156103b3575b8115610389575b506040519015158152f35b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150143861037e565b7f181f5a770000000000000000000000000000000000000000000000000000000081149150610377565b7f9b645f410000000000000000000000000000000000000000000000000000000081149150610370565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff6004356104578161020b565b166000526008602052602067ffffffffffffffff60406000205416604051908152f35b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576104b1612f36565b5060606040516104c0816105a5565b63ffffffff6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169182815273ffffffffffffffffffffffffffffffffffffffff60406020830192827f00000000000000000000000000000000000000000000000000000000000000001684520191837f00000000000000000000000000000000000000000000000000000000000000001683526040519485525116602084015251166040820152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176105c157604052565b610576565b60a0810190811067ffffffffffffffff8211176105c157604052565b6040810190811067ffffffffffffffff8211176105c157604052565b60c0810190811067ffffffffffffffff8211176105c157604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105c157604052565b6040519061023960408361061a565b604051906102396102608361061a565b919082519283825260005b8481106106c45750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b80602080928401015182828601015201610685565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610756604080519061071a818361061a565b601382527f46656551756f74657220312e362e302d6465760000000000000000000000000060208301525191829160208352602083019061067a565b0390f35b602060408183019282815284518094520192019060005b81811061077e5750505090565b825173ffffffffffffffffffffffffffffffffffffffff16845260209384019390920191600101610771565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760405180602060025491828152019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9060005b81811061083557610756856108298187038261061a565b6040519182918261075a565b8254845260209093019260019283019201610812565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602060405160248152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957806004019060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8236030112610229576108ff6142e6565b6109098280612f55565b4263ffffffff1692915060005b818110610ae35750506024019061092d8284612f55565b92905060005b83811061093c57005b8061095b610956600193610950868a612f55565b90612fd8565b61304d565b7fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e67ffffffffffffffff610aaa610a876020850194610a796109b987517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6109e86109c461065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092168252565b63ffffffff8c166020820152610a23610a09845167ffffffffffffffff1690565b67ffffffffffffffff166000526005602052604060002090565b815160209092015160e01b7fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5167ffffffffffffffff1690565b93517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610933565b80610afc610af76001936109508980612f55565b613016565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff610bde610a876020850194610bc4610b6687517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b610b716109c461065b565b63ffffffff8d166020820152610a23610b9e845173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526006602052604060002090565b5173ffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610916565b67ffffffffffffffff81116105c15760051b60200190565b8015150361022957565b359061023982610c2f565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590610c9f82610c17565b90610cad604051928361061a565b828252602460a06020840194028201019036821161022957602401925b818410610cdc57610cda83613072565b005b60a0843603126102295760405190610cf3826105c6565b8435610cfe8161020b565b825260208501357fffffffffffffffffffff00000000000000000000000000000000000000000000811681036102295760208301526040850135907fffff000000000000000000000000000000000000000000000000000000000000821682036102295782602092604060a0950152610d796060880161022e565b6060820152610d8a60808801610c39565b6080820152815201930192610cca565b6004359067ffffffffffffffff8216820361022957565b6024359067ffffffffffffffff8216820361022957565b359067ffffffffffffffff8216820361022957565b9181601f840112156102295782359167ffffffffffffffff8311610229576020838186019501011161022957565b9181601f840112156102295782359167ffffffffffffffff8311610229576020808501948460051b01011161022957565b929091610e5d9284521515602084015260806040840152608083019061067a565b906060818303910152815180825260208201916020808360051b8301019401926000915b838310610e9057505050505090565b9091929394602080610ecc837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660019603018752895161067a565b97019301930191939290610e81565b346102295760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610f12610d9a565b60243590610f1f8261020b565b60443560643567ffffffffffffffff811161022957610f42903690600401610ddd565b60849391933567ffffffffffffffff811161022957610f65903690600401610e0b565b9160a4359567ffffffffffffffff871161022957366023880112156102295786600401359567ffffffffffffffff8711610229573660248860061b8a01011161022957610756986024610fb99901966131fe565b9060409492945194859485610e3c565b602060408183019282815284518094520192019060005b818110610fed5750505090565b9091926020604082611030600194885163ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b019401929101610fe0565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295761108a903690600401610e0b565b61109381610c17565b916110a1604051938461061a565b8183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06110ce83610c17565b0160005b81811061112957505060005b8281101561111b576001906110ff6110fa8260051b8501613357565b613eba565b61110982876131ea565b5261111481866131ea565b50016110de565b604051806107568682610fc9565b60209061113461333e565b828288010152016110d2565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760206111856004356111808161020b565b614237565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295767ffffffffffffffff6111eb610d9a565b6111f361333e565b5016600052600560205260406000206040519061120f826105e2565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116825260e01c6020820152604051809161075682604081019263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b610239909291926102408061026083019561129784825115159052565b60208181015161ffff169085015260408181015163ffffffff169085015260608181015163ffffffff169085015260808181015163ffffffff169085015260a08181015160ff169085015260c08181015160ff169085015260e08181015161ffff16908501526101008181015163ffffffff16908501526101208181015161ffff16908501526101408181015161ffff1690850152610160818101517fffffffff000000000000000000000000000000000000000000000000000000001690850152610180818101511515908501526101a08181015161ffff16908501526101c08181015163ffffffff16908501526101e08181015163ffffffff16908501526102008181015167ffffffffffffffff16908501526102208181015163ffffffff1690850152015163ffffffff16910152565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576107566114ab6114a661140a610d9a565b600061024061141761066a565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a0820152826101c0820152826101e08201528261020082015282610220820152015267ffffffffffffffff166000526009602052604060002090565b61339b565b6040519182918261127a565b359063ffffffff8216820361022957565b359061ffff8216820361022957565b81601f82011215610229578035906114ee82610c17565b926114fc604051948561061a565b82845260208085019360061b8301019181831161022957602001925b828410611526575050505090565b6040848303126102295760206040918251611540816105e2565b61154987610dc8565b8152828701356115588161020b565b83820152815201930192611518565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957366023820112156102295780600401356115c181610c17565b916115cf604051938461061a565b8183526024602084019260051b820101903682116102295760248101925b82841061161e576024358567ffffffffffffffff821161022957611618610cda9236906004016114d7565b90613509565b833567ffffffffffffffff811161022957820160407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8236030112610229576040519061166a826105e2565b61167660248201610dc8565b8252604481013567ffffffffffffffff811161022957602491010136601f820112156102295780356116a781610c17565b916116b5604051938461061a565b818352602060e081850193028201019036821161022957602001915b8183106116f057505050918160209384809401528152019301926115ed565b82360360e081126102295760c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06040519261172b846105e2565b86356117368161020b565b845201126102295760e091602091604051611750816105fe565b61175b8488016114b7565b8152611769604088016114b7565b84820152611779606088016114c8565b604082015261178a608088016114b7565b606082015261179b60a088016114b7565b608082015260c08701356117ae81610c2f565b60a0820152838201528152019201916116d1565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760005473ffffffffffffffffffffffffffffffffffffffff81163303611881577fffffffffffffffffffffffff00000000000000000000000000000000000000006001549133828416176001551660005573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b9080601f830112156102295781356118c281610c17565b926118d0604051948561061a565b81845260208085019260051b82010192831161022957602001905b8282106118f85750505090565b6020809183356119078161020b565b8152019101906118eb565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229576119619036906004016118ab565b60243567ffffffffffffffff8111610229576119819036906004016118ab565b9061198a61432a565b60005b8151811015611a0657806119ae6119a9610bc4600194866131ea565b615b0b565b6119b9575b0161198d565b73ffffffffffffffffffffffffffffffffffffffff6119db610bc483866131ea565b167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26119b3565b8260005b8151811015610cda5780611a2b611a26610bc4600194866131ea565b615b2c565b611a36575b01611a0a565b73ffffffffffffffffffffffffffffffffffffffff611a58610bc483866131ea565b167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2611a30565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957611ad2903690600401610ddd565b6024359167ffffffffffffffff831161022957611b2b611b23611b09611aff611b33963690600401610ddd565b9490953691613811565b90604082015190605e604a84015160601c93015191929190565b9190336149c8565b810190613876565b60005b8151811015610cda57611b98611b93611b6d611b5284866131ea565b515173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b613935565b611bac611ba86040830151151590565b1590565b611d6e5790611c21611bc46020600194015160ff1690565b611c1b611bfa6020611bd686896131ea565b5101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b90614aa7565b611c3c6040611c3084876131ea565b51015163ffffffff1690565b63ffffffff611c67611c5e611c57610b9e611b52888b6131ea565b5460e01c90565b63ffffffff1690565b911610611d6857611cca611c806040611c3085886131ea565b611cba611c8b61065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff851681529163ffffffff166020830152565b610a23610b9e611b5286896131ea565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff611d0d611b5285886131ea565b611d5e611d1f6040611c30888b6131ea565b60405193849316958390929163ffffffff6020917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff604085019616845216910152565b0390a25b01611b36565b50611d62565b611dc0611d7e611b5284866131ea565b7f06439c6b0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b6000fd5b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610756611e77611e01610d9a565b67ffffffffffffffff60243591611e178361020b565b600060a0604051611e27816105fe565b828152826020820152826040820152826060820152826080820152015216600052600a60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b611ef3611eea60405192611e8a846105fe565b5463ffffffff8116845263ffffffff8160201c16602085015261ffff8160401c166040850152611ed1611ec48263ffffffff9060501c1690565b63ffffffff166060860152565b63ffffffff607082901c16608085015260901c60ff1690565b151560a0830152565b6040519182918291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b60ff81160361022957565b359061023982611f56565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590611fc782610c17565b90611fd5604051928361061a565b82825260246102806020840194028201019036821161022957602401925b81841061200357610cda836139d2565b8336036102808112610229576102607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060405192612040846105e2565b61204988610dc8565b84520112610229576102809160209161206061066a565b61206b848901610c39565b8152612079604089016114c8565b84820152612089606089016114b7565b604082015261209a608089016114b7565b60608201526120ab60a089016114b7565b60808201526120bc60c08901611f61565b60a08201526120cd60e08901611f61565b60c08201526120df61010089016114c8565b60e08201526120f161012089016114b7565b61010082015261210461014089016114c8565b61012082015261211761016089016114c8565b61014082015261212a6101808901610298565b61016082015261213d6101a08901610c39565b6101808201526121506101c089016114c8565b6101a08201526121636101e089016114b7565b6101c082015261217661020089016114b7565b6101e08201526121896102208901610dc8565b61020082015261219c61024089016114b7565b6102208201526121af61026089016114b7565b61024082015283820152815201930192611ff3565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc82360301126102295760405161228f816105e2565b816004013567ffffffffffffffff8111610229576122b390600436918501016118ab565b8152602482013567ffffffffffffffff811161022957610cda9260046122dc92369201016118ab565b6020820152613c31565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957366023820112156102295780600401359061234182610c17565b9061234f604051928361061a565b8282526024602083019360061b8201019036821161022957602401925b81841061237c57610cda83613dd1565b6040843603126102295760206040918251612396816105e2565b86356123a18161020b565b81526123ae838801610dc8565b8382015281520193019261236c565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff60043561240d8161020b565b612415612f36565b50166000526007602052610756604060002060ff60405191612436836105a5565b5473ffffffffffffffffffffffffffffffffffffffff81168352818160a01c16602084015260a81c161515604082015260405191829182919091604080606083019473ffffffffffffffffffffffffffffffffffffffff815116845260ff602082015116602085015201511515910152565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957604051806020600b54918281520190600b6000527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db99060005b81811061252757610756856108298187038261061a565b8254845260209093019260019283019201612510565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957604061257d6004356110fa8161020b565b6125b78251809263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565bf35b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602060405160128152f35b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295761262a610d9a565b6024359067ffffffffffffffff821161022957816004019160a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc82360301126102295761268f6114a68367ffffffffffffffff166000526009602052604060002090565b61269c611ba88251151590565b612ad35760648201916126e0611ba86126b485613357565b73ffffffffffffffffffffffffffffffffffffffff166000526001600b01602052604060002054151590565b612a85576044810190856126f48382612f55565b9690506024830195612727612709888561400a565b905089612720612719878061400a565b3691613811565b9189615435565b8561273461118083613357565b998a9361275261274c61022085015163ffffffff1690565b826154f5565b976000808d15612a4c5750506127b761ffff856127e9986127c39896612804966127f7966127ae61279e6101c06127926101a061280a9f015161ffff1690565b97015163ffffffff1690565b916127a88c613357565b94612f55565b96909516615610565b97919796909794613357565b73ffffffffffffffffffffffffffffffffffffffff166000526008602052604060002090565b5467ffffffffffffffff1690565b67ffffffffffffffff1690565b90612ea1565b9660009861ffff6128216101408a015161ffff1690565b166129f2575b50956128046127f761020061295b61296b996dffffffffffffffffffffffffffff6107569f9d986129739f9b61294c7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9f6129138e6129069f61290b6129069f978f956129539963ffffffff61289e6128a89360849761400a565b929050169061405b565b9060a08701876128cb6128c56128bf845160ff1690565b60ff1690565b85612ea1565b9360e08201926128dd845161ffff1690565b9061ffff82168311612983575b5050506080015161290692611c5e92509063ffffffff16614099565b61405b565b95019061400a565b6101e083015163ffffffff169063ffffffff61294461018061293c606088015163ffffffff1690565b960151151590565b941692615918565b519061405b565b911690612ea1565b93015167ffffffffffffffff1690565b911690612eb4565b6040519081529081906020820190565b6129069596506129e6936128046128bf60c06129d6611c5e99976129d06129c96129c061ffff9a60ff6129ba6129df9c5160ff1690565b16614068565b9a5161ffff1690565b61ffff1690565b90613ead565b93015160ff1690565b911661405b565b929150873880806128ea565b82879b999493969a50612a188993986dffffffffffffffffffffffffffff9060701c1690565b6dffffffffffffffffffffffffffff1691612a33898861400a565b9050612a3f9385615873565b9894919297999590612827565b959350955050506128046127f76127e96127c3612a7f612a7a611c5e61024061280a99015163ffffffff1690565b612e5a565b94613357565b611dc0612a9184613357565b7f2502348c0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b7f99ac52f20000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff831660045260246000fd5b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff600435612b5b8161020b565b612b6361432a565b16338114612bd557807fffffffffffffffffffffffff0000000000000000000000000000000000000000600054161760005573ffffffffffffffffffffffffffffffffffffffff600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590612c5a82610c17565b90612c68604051928361061a565b8282526024602083019360071b8201019036821161022957602401925b818410612c9557610cda836140b3565b833603608081126102295760607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060405192612cd0846105e2565b8735612cdb8161020b565b8452011261022957608091602091604051612cf5816105a5565b83880135612d028161020b565b81526040880135612d1281611f56565b848201526060880135612d2481610c2f565b604082015283820152815201930192612c85565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957600435612d738161020b565b612d7b610db1565b9067ffffffffffffffff82169182600052600960205260ff6040600020541615612dfd57612dab612dcc92614237565b92600052600960205263ffffffff60016040600020015460901c16906154f5565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152f35b827f99ac52f20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90662386f26fc10000820291808304662386f26fc100001490151715612e7c57565b612e2b565b90655af3107a4000820291808304655af3107a40001490151715612e7c57565b81810292918115918404141715612e7c57565b8115612ebe570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b612f2c612f26612f3394937bffffffffffffffffffffffffffffffffffffffffffffffffffffffff612f1f8195614237565b1690612ea1565b92614237565b1690612eb4565b90565b60405190612f43826105a5565b60006040838281528260208201520152565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610229570180359067ffffffffffffffff821161022957602001918160061b3603831361022957565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015612fe85760061b0190565b612fa9565b35907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216820361022957565b60408136031261022957613045602060405192613032846105e2565b803561303d8161020b565b845201612fed565b602082015290565b60408136031261022957613045602060405192613069846105e2565b61303d81610dc8565b9061307b61432a565b60005b82518110156131e55780613094600192856131ea565b517f32a4ba3fa3351b11ad555d4c8ec70a744e8705607077a946807030d64b6ab1a360a073ffffffffffffffffffffffffffffffffffffffff83511692606081019373ffffffffffffffffffffffffffffffffffffffff80865116957fffff00000000000000000000000000000000000000000000000000000000000061314c60208601947fffffffffffffffffffff00000000000000000000000000000000000000000000865116604088019a848c5116926159aa565b977fffffffffffffffffffff0000000000000000000000000000000000000000000060808701956131b8875115158c600052600460205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b8560405198511688525116602087015251166040850152511660608301525115156080820152a20161307e565b509050565b8051821015612fe85760209160051b010190565b989592919097949693977f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff821673ffffffffffffffffffffffffffffffffffffffff82161460001461332e575050965b6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168089116132fd5750916132dc6132f094926132f6969463ffffffff8060016132cf8f67ffffffffffffffff166000526009602052604060002090565b015460301c16169161444e565b966132ea6020890151151590565b99614616565b9261482a565b9293929190565b887f6a92a4830000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b9161333892612eed565b96613264565b6040519061334b826105e2565b60006020838281520152565b35612f338161020b565b9060405161336e816105e2565b91547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116835260e01c6020830152565b906102396134fb60016133ac61066a565b9461349a61349082546133c86133c28260ff1690565b15158a52565b61ffff600882901c1660208a015263ffffffff601882901c1660408a015263ffffffff603882901c1660608a015263ffffffff605882901c1660808a015260ff607882901c1660a08a015260ff608082901c1660c08a015261ffff608882901c1660e08a015263ffffffff609882901c166101008a015261ffff60b882901c166101208a015261ffff60c882901c166101408a01527fffffffff00000000000000000000000000000000000000000000000000000000600882901b166101608a015260f81c90565b1515610180880152565b015461ffff81166101a086015263ffffffff601082901c166101c086015263ffffffff603082901c166101e086015267ffffffffffffffff605082901c1661020086015263ffffffff609082901c1661022086015260b01c63ffffffff1690565b63ffffffff16610240840152565b9061351261432a565b6000915b80518310156137435761352983826131ea565b519061353d825167ffffffffffffffff1690565b946020600093019367ffffffffffffffff8716935b8551805182101561372e57613569826020926131ea565b51015161357a611b528389516131ea565b8151602083015163ffffffff9081169116818110156136f5575050608082015163ffffffff16602081106136a7575090867f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b573ffffffffffffffffffffffffffffffffffffffff84613636858f6001999861360c6136319267ffffffffffffffff16600052600a602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b614874565b61369e60405192839216958291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b0390a301613552565b7f24ecdc020000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff90911660045263ffffffff1660245260446000fd5b7f0b4f67a20000000000000000000000000000000000000000000000000000000060005263ffffffff9081166004521660245260446000fd5b50509550925092600191500191929092613516565b50905060005b815181101561380d5780613771613762600193856131ea565b515167ffffffffffffffff1690565b67ffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff6137ba602061379e86896131ea565b51015173ffffffffffffffffffffffffffffffffffffffff1690565b60006137de8261360c8767ffffffffffffffff16600052600a602052604060002090565b551691167f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b600080a301613749565b5050565b92919267ffffffffffffffff82116105c15760405191613859601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0166020018461061a565b829481845281830111610229578281602093846000960137010152565b6020818303126102295780359067ffffffffffffffff8211610229570181601f82011215610229578035906138aa82610c17565b926138b8604051948561061a565b8284526020606081860194028301019181831161022957602001925b8284106138e2575050505090565b6060848303126102295760206060916040516138fd816105a5565b86356139088161020b565b8152613915838801612fed565b83820152613925604088016114b7565b60408201528152019301926138d4565b90604051613942816105a5565b604060ff82945473ffffffffffffffffffffffffffffffffffffffff81168452818160a01c16602085015260a81c161515910152565b90610239604051613988816105fe565b925463ffffffff8082168552602082811c821690860152604082811c61ffff1690860152605082901c81166060860152607082901c16608085015260901c60ff16151560a0840152565b906139db61432a565b60005b82518110156131e5576139f181846131ea565b516020613a0161376284876131ea565b9101519067ffffffffffffffff811680158015613c12575b8015613b99575b8015613b6b575b613b335791613af98260019594613aa9613a84613a5b613afe9767ffffffffffffffff166000526009602052604060002090565b5460081b7fffffffff000000000000000000000000000000000000000000000000000000001690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b613b04577f71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad60405180613adc878261127a565b0390a267ffffffffffffffff166000526009602052604060002090565b614bde565b016139de565b7f2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e360405180613adc878261127a565b7fc35aa79d0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff821660045260246000fd5b506101e083015163ffffffff1663ffffffff613b91611c5e606087015163ffffffff1690565b911611613a27565b507f2812d52c000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000613c0a6101608601517fffffffff000000000000000000000000000000000000000000000000000000001690565b161415613a20565b5063ffffffff613c2a6101e085015163ffffffff1690565b1615613a19565b613c3961432a565b60208101519160005b8351811015613ced5780613c5b610bc4600193876131ea565b613c97613c9273ffffffffffffffffffffffffffffffffffffffff83165b73ffffffffffffffffffffffffffffffffffffffff1690565b615e46565b613ca3575b5001613c42565b60405173ffffffffffffffffffffffffffffffffffffffff9190911681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758090602090a138613c9c565b5091505160005b815181101561380d57613d0a610bc482846131ea565b9073ffffffffffffffffffffffffffffffffffffffff821615613da7577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef613d9e83613d76613d71613c7960019773ffffffffffffffffffffffffffffffffffffffff1690565b615dcd565b5060405173ffffffffffffffffffffffffffffffffffffffff90911681529081906020820190565b0390a101613cf4565b7f8579befe0000000000000000000000000000000000000000000000000000000060005260046000fd5b613dd961432a565b60005b815181101561380d578073ffffffffffffffffffffffffffffffffffffffff613e07600193856131ea565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d613ea467ffffffffffffffff6020613e4386896131ea565b51015116836000526008602052604060002067ffffffffffffffff82167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556040519182918291909167ffffffffffffffff6020820193169052565b0390a201613ddc565b91908203918211612e7c57565b613ec261333e565b50613ef5613ef08273ffffffffffffffffffffffffffffffffffffffff166000526006602052604060002090565b613361565b6020810191613f14613f0e611c5e855163ffffffff1690565b42613ead565b63ffffffff7f00000000000000000000000000000000000000000000000000000000000000001611613fc957611b93613f6d9173ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b613f7d611ba86040830151151590565b8015613fcf575b613fc957613f91906152ac565b9163ffffffff613fb9611c5e613fae602087015163ffffffff1690565b935163ffffffff1690565b911610613fc4575090565b905090565b50905090565b5073ffffffffffffffffffffffffffffffffffffffff614003825173ffffffffffffffffffffffffffffffffffffffff1690565b1615613f84565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610229570180359067ffffffffffffffff82116102295760200191813603831361022957565b91908201809211612e7c57565b9061ffff8091169116029061ffff8216918203612e7c57565b63ffffffff60209116019063ffffffff8211612e7c57565b9063ffffffff8091169116019063ffffffff8211612e7c57565b906140bc61432a565b60005b82518110156131e557806140d5600192856131ea565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf61422e602073ffffffffffffffffffffffffffffffffffffffff845116930151836000526007602052604060002061418173ffffffffffffffffffffffffffffffffffffffff835116829073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b602082015181547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000075ff0000000000000000000000000000000000000000006040870151151560a81b169360a01b1691161717905560405191829182919091604080606083019473ffffffffffffffffffffffffffffffffffffffff815116845260ff602082015116602085015201511515910152565b0390a2016140bf565b61424081613eba565b9063ffffffff6020830151161580156142bf575b61427b5750517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff907f06439c6b000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff82511615614254565b336000526003602052604060002054156142fc57565b7fd86ad9cf000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff60015416330361434b57565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b919091357fffffffff00000000000000000000000000000000000000000000000000000000811692600481106143a9575050565b7fffffffff00000000000000000000000000000000000000000000000000000000929350829060040360031b1b161690565b909291928360041161022957831161022957600401917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0190565b90816020910312610229575190565b908160409103126102295760206040519161443f836105e2565b80518352015161304581610c2f565b9161445761333e565b50811561454d575061449861271982806144927fffffffff000000000000000000000000000000000000000000000000000000009587614375565b956143db565b91167f181dcf100000000000000000000000000000000000000000000000000000000081036144d5575080602080612f3393518301019101614425565b7f97a657c90000000000000000000000000000000000000000000000000000000014614525577f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b8060208061453893518301019101614416565b61454061065b565b9081526000602082015290565b91505067ffffffffffffffff61456161065b565b911681526000602082015290565b9061457982610c17565b614586604051918261061a565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06145b48294610c17565b019060005b8281106145c557505050565b8060606020809385010152016145b9565b9190811015612fe85760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6181360301821215610229570190565b90929161463a613a5b8367ffffffffffffffff166000526009602052604060002090565b906146448161456f565b9560005b828110614659575050505050505090565b61466c614667828489612fd8565b613357565b838861468661467c8584846145d6565b604081019061400a565b9050602081116147a2575b5083926146c06146ba6127196146b06001986146e3976146de976145d6565b602081019061400a565b89615a3b565b61360c8967ffffffffffffffff16600052600a602052604060002090565b613978565b60a0810151156147665761474a614704606061471e93015163ffffffff1690565b6040805163ffffffff909216602083015290928391820190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261061a565b614754828b6131ea565b5261475f818a6131ea565b5001614648565b5061471e61474a61479d8461478f8a67ffffffffffffffff166000526009602052604060002090565b015460101c63ffffffff1690565b614704565b9150506147da611c5e6147cd8461360c8b67ffffffffffffffff16600052600a602052604060002090565b5460701c63ffffffff1690565b106147e757838838614691565b7f36f536ca0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff1660045260246000fd5b6020604051917f181dcf1000000000000000000000000000000000000000000000000000000000828401528051602484015201511515604482015260448152612f3360648261061a565b815181546020808501516040808701517fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090941663ffffffff958616179190921b67ffffffff00000000161791901b69ffff0000000000000000161782556060830151610239936149849260a092614926911685547fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff1660509190911b6dffffffff0000000000000000000016178555565b61497d61493a608083015163ffffffff1690565b85547fffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff1660709190911b71ffffffff000000000000000000000000000016178555565b0151151590565b81547fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff1690151560901b72ff00000000000000000000000000000000000016179055565b919290926149d8828286866159aa565b600052600460205260ff60406000205416156149f45750505050565b6040517f097e17ff00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529390921660248401527fffffffffffffffffffff0000000000000000000000000000000000000000000090911660448301527fffff000000000000000000000000000000000000000000000000000000000000166064820152608490fd5b0390fd5b604d8111612e7c57600a0a90565b60ff1660120160ff8111612e7c5760ff16906024821115614b6c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8201918211612e7c57614af8614afe92614a99565b90612eb4565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111614b42577bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7f10cb51d10000000000000000000000000000000000000000000000000000000060005260046000fd5b906024039060248211612e7c57612804614b8592614a99565b614afe565b9060ff80911691160160ff8111612e7c5760ff16906024821115614b6c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8201918211612e7c57614af8614afe92614a99565b906151f8610240600161023994614c29614bf88651151590565b829060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b614c6f614c3b602087015161ffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff1660089190911b62ffff0016178255565b614cbb614c83604087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffff1660189190911b66ffffffff00000016178255565b614d0b614ccf606087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffff1660389190911b6affffffff0000000000000016178255565b614d5f614d1f608087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff1660589190911b6effffffff000000000000000000000016178255565b614db1614d7060a087015160ff1690565b82547fffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffff1660789190911b6fff00000000000000000000000000000016178255565b614e04614dc260c087015160ff1690565b82547fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff1660809190911b70ff0000000000000000000000000000000016178255565b614e5a614e1660e087015161ffff1690565b82547fffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffff1660889190911b72ffff000000000000000000000000000000000016178255565b614eb7614e6f61010087015163ffffffff1690565b82547fffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffff1660989190911b76ffffffff0000000000000000000000000000000000000016178255565b614f14614eca61012087015161ffff1690565b82547fffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffff1660b89190911b78ffff000000000000000000000000000000000000000000000016178255565b614f73614f2761014087015161ffff1690565b82547fffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c89190911b7affff0000000000000000000000000000000000000000000000000016178255565b614ff4614fa46101608701517fffffffff000000000000000000000000000000000000000000000000000000001690565b82547fff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff1660089190911c7effffffff00000000000000000000000000000000000000000000000000000016178255565b615055615005610180870151151590565b82547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690151560f81b7fff0000000000000000000000000000000000000000000000000000000000000016178255565b019261509961506a6101a083015161ffff1690565b859061ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000825416179055565b6150e56150ae6101c083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff1660109190911b65ffffffff000016178555565b6151356150fa6101e083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffff1660309190911b69ffffffff00000000000016178555565b61519161514e61020083015167ffffffffffffffff1690565b85547fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff1660509190911b71ffffffffffffffff0000000000000000000016178555565b6151ed6151a661022083015163ffffffff1690565b85547fffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffff1660909190911b75ffffffff00000000000000000000000000000000000016178555565b015163ffffffff1690565b7fffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffff79ffffffff0000000000000000000000000000000000000000000083549260b01b169116179055565b519069ffffffffffffffffffff8216820361022957565b908160a09103126102295761526d81615242565b91602082015191604081015191612f33608060608401519301615242565b6040513d6000823e3d90fd5b908160209103126102295751612f3381611f56565b6152b461333e565b506152d9613c79613c79835173ffffffffffffffffffffffffffffffffffffffff1690565b90604051907ffeaf968c00000000000000000000000000000000000000000000000000000000825260a082600481865afa9283156153f6576000926000946153fb575b5060008312614b42576020600491604051928380927f313ce5670000000000000000000000000000000000000000000000000000000082525afa9283156153f657612f339363ffffffff93615382936000926153c0575b506020015160ff165b90614b8a565b926153b261538e61065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9095168552565b1663ffffffff166020830152565b61537c9192506153e7602091823d84116153ef575b6153df818361061a565b810190615297565b929150615373565b503d6153d5565b61528b565b90935061542191925060a03d60a01161542e575b615419818361061a565b810190615259565b509392505091923861531c565b503d61540f565b919063ffffffff6040840151168082116154c557505061ffff6020830151169081811161548f575050907fffffffff0000000000000000000000000000000000000000000000000000000061016061023993015116615a3b565b61ffff92507fd88dddd6000000000000000000000000000000000000000000000000000000006000526004521660245260446000fd5b7f869337890000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b67ffffffffffffffff811660005260056020526040600020916040519261551b846105e2565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116845260e01c9182602085015263ffffffff8216928361557f575b50505050612f3390517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b63ffffffff164290810393908411612e7c57831161559d5780615555565b7ff08bcb3e0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045263ffffffff1660245260445260646000fd5b604081360312610229576020604051916155f9836105e2565b80356156048161020b565b83520135602082015290565b9694919695929390956000946000986000986000965b80881061563a575050505050505050929190565b9091929394959697999a6156576156528a848b612fd8565b6155e0565b9a6156bf6146de8d61569b6156808967ffffffffffffffff16600052600a602052604060002090565b915173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b916156d0611ba860a0850151151590565b6158405760009c60408401906156eb6129c9835161ffff1690565b6157a1575b5050606083015163ffffffff1661570691614099565b9c60808301516157199063ffffffff1690565b61572291614099565b9b82516157329063ffffffff1690565b63ffffffff1661574190612e5a565b600193908083106157955750612a7a611c5e602061576493015163ffffffff1690565b80821161578457506157759161405b565b985b0196959493929190615626565b905061578f9161405b565b98615777565b91505061578f9161405b565b90612804615831939f61581f6158289460208f8e6129c9955073ffffffffffffffffffffffffffffffffffffffff6157ed855173ffffffffffffffffffffffffffffffffffffffff1690565b911673ffffffffffffffffffffffffffffffffffffffff821614615839576158159150614237565b915b015190615b4d565b925161ffff1690565b620186a0900490565b9b38806156f0565b5091615817565b999b50600191506158678461586161586d9361585b8b612e5a565b9061405b565b9b614099565b9c614081565b9a615777565b91939093806101e00193846101e011612e7c576101208102908082046101201490151715612e7c576101e0910101809311612e7c576129c9610140615909612f33966dffffffffffffffffffffffffffff6129536158f46158e16159139a63ffffffff6128049a169061405b565b6128046129c96101208c015161ffff1690565b61585b611c5e6101008b015163ffffffff1690565b93015161ffff1690565b612e81565b9063ffffffff6159359395949561592d61333e565b50169161444e565b918251116159805780615974575b61594a5790565b7fee433e990000000000000000000000000000000000000000000000000000000060005260046000fd5b50602081015115615943565b7f4c4fc93a0000000000000000000000000000000000000000000000000000000060005260046000fd5b6040805173ffffffffffffffffffffffffffffffffffffffff9283166020820190815292909316908301527fffffffffffffffffffff0000000000000000000000000000000000000000000090921660608201527fffff000000000000000000000000000000000000000000000000000000000000909216608083015290615a358160a0810161471e565b51902090565b7fffffffff00000000000000000000000000000000000000000000000000000000167f2812d52c0000000000000000000000000000000000000000000000000000000014615a865750565b6020815103615ac957615aa26020825183010160208301614416565b73ffffffffffffffffffffffffffffffffffffffff8111908115615aff575b50615ac95750565b614a95906040519182917f8d666f6000000000000000000000000000000000000000000000000000000000835260048301615b82565b61040091501038615ac1565b73ffffffffffffffffffffffffffffffffffffffff612f339116600b615c7a565b73ffffffffffffffffffffffffffffffffffffffff612f339116600b615e08565b670de0b6b3a7640000917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff615b7e9216612ea1565b0490565b906020612f3392818152019061067a565b8054821015612fe85760005260206000200190600090565b91615be3918354907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055565b80548015615c4b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190615c1c8282615b93565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001810191806000528260205260406000205492831515600014615d68577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8401848111612e7c578354937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8501948511612e7c576000958583615d1997615d0a9503615d1f575b505050615be7565b90600052602052604060002090565b55600190565b615d4f615d4991615d40615d36615d5f9588615b93565b90549060031b1c90565b92839187615b93565b90615bab565b8590600052602052604060002090565b55388080615d02565b50505050600090565b805490680100000000000000008210156105c15781615d98916001615be394018155615b93565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b600081815260036020526040902054615e0257615deb816002615d71565b600254906000526003602052604060002055600190565b50600090565b6000828152600182016020526040902054615e3f5780615e2a83600193615d71565b80549260005201602052604060002055600190565b5050600090565b600081815260036020526040902054908115615e3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820190828211612e7c57600254927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8401938411612e7c578383615d199460009603615ee2575b505050615ed16002615be7565b600390600052602052604060002090565b615ed1615d4991615efa615d36615f04956002615b93565b9283916002615b93565b55388080615ec456fea164736f6c634300081a000a", } var FeeQuoterABI = FeeQuoterMetaData.ABI @@ -2875,11 +2877,11 @@ func (FeeQuoterAuthorizedCallerRemoved) Topic() common.Hash { } func (FeeQuoterDestChainAdded) Topic() common.Hash { - return common.HexToHash("0x525e3d4e0c31cef19cf9426af8d2c0ddd2d576359ca26bed92aac5fadda46265") + return common.HexToHash("0x71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad") } func (FeeQuoterDestChainConfigUpdated) Topic() common.Hash { - return common.HexToHash("0x283b699f411baff8f1c29fe49f32a828c8151596244b8e7e4c164edd6569a835") + return common.HexToHash("0x2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e3") } func (FeeQuoterFeeTokenAdded) Topic() common.Hash { diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 9d10c76b0ad..7ee516ab47b 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -6,7 +6,7 @@ ccip_encoding_utils: ../../../contracts/solc/ccip/EncodingUtils/EncodingUtils.so ccip_home: ../../../contracts/solc/ccip/CCIPHome/CCIPHome.sol/CCIPHome.abi.json ../../../contracts/solc/ccip/CCIPHome/CCIPHome.sol/CCIPHome.bin 39de1fbc907a2b573e9358e716803bf5ac3b0a2e622d5bc0069ab60daf38949b ccip_reader_tester: ../../../contracts/solc/ccip/CCIPReaderTester/CCIPReaderTester.sol/CCIPReaderTester.abi.json ../../../contracts/solc/ccip/CCIPReaderTester/CCIPReaderTester.sol/CCIPReaderTester.bin b8e597d175ec5ff4990d98b4e3b8a8cf06c6ae22977dd6f0e58c0f4107639e8f ether_sender_receiver: ../../../contracts/solc/ccip/EtherSenderReceiver/EtherSenderReceiver.sol/EtherSenderReceiver.abi.json ../../../contracts/solc/ccip/EtherSenderReceiver/EtherSenderReceiver.sol/EtherSenderReceiver.bin 88973abc1bfbca23a23704e20087ef46f2e20581a13477806308c8f2e664844e -fee_quoter: ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.abi.json ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.bin 8b29159231e67ab38d9c9bbddbf218d0e5c0e6685ff3816b391680e889c385ff +fee_quoter: ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.abi.json ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.bin f1c4b4d170308bad29ca393d81202f3f5a40398385817023fdf4992f5ebeff8d lock_release_token_pool: ../../../contracts/solc/ccip/LockReleaseTokenPool/LockReleaseTokenPool.sol/LockReleaseTokenPool.abi.json ../../../contracts/solc/ccip/LockReleaseTokenPool/LockReleaseTokenPool.sol/LockReleaseTokenPool.bin 2e73ee0da6f9a9a5722294289b969e4202476706e5d7cdb623e728831c79c28b maybe_revert_message_receiver: ../../../contracts/solc/ccip/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.sol/MaybeRevertMessageReceiver.abi.json ../../../contracts/solc/ccip/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.sol/MaybeRevertMessageReceiver.bin d1eb951af1027ca20cbee2c34df80fddbfd861e1695989aeebd29327cfe56584 message_hasher: ../../../contracts/solc/ccip/MessageHasher/MessageHasher.sol/MessageHasher.abi.json ../../../contracts/solc/ccip/MessageHasher/MessageHasher.sol/MessageHasher.bin 9d503e62f007cfa7bf411ec845c3537b272709001d25ec738820ca83991c299c diff --git a/deployment/ccip/changeset/cs_chain_contracts.go b/deployment/ccip/changeset/cs_chain_contracts.go index 196de01124b..8b50aa2fd3c 100644 --- a/deployment/ccip/changeset/cs_chain_contracts.go +++ b/deployment/ccip/changeset/cs_chain_contracts.go @@ -1121,7 +1121,9 @@ func DefaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig { MaxPerMsgGasLimit: 3_000_000, DestGasOverhead: ccipevm.DestGasOverhead, DefaultTokenFeeUSDCents: 1, - DestGasPerPayloadByte: ccipevm.CalldataGasPerByte, + DestGasPerPayloadByteBase: ccipevm.CalldataGasPerByteBase, + DestGasPerPayloadByteHigh: ccipevm.CalldataGasPerByteHigh, + DestGasPerPayloadByteThreshold: ccipevm.CalldataGasPerByteThreshold, DestDataAvailabilityOverheadGas: 100, DestGasPerDataAvailabilityByte: 100, DestDataAvailabilityMultiplierBps: 1, diff --git a/deployment/ccip/changeset/test_assertions.go b/deployment/ccip/changeset/test_assertions.go index c83d6e3597a..eeb21d452a8 100644 --- a/deployment/ccip/changeset/test_assertions.go +++ b/deployment/ccip/changeset/test_assertions.go @@ -646,7 +646,9 @@ func AssertEqualFeeConfig(t *testing.T, want, have fee_quoter.FeeQuoterDestChain assert.Equal(t, want.DefaultTokenDestGasOverhead, have.DefaultTokenDestGasOverhead) assert.Equal(t, want.DefaultTokenFeeUSDCents, have.DefaultTokenFeeUSDCents) assert.Equal(t, want.DefaultTxGasLimit, have.DefaultTxGasLimit) - assert.Equal(t, want.DestGasPerPayloadByte, have.DestGasPerPayloadByte) + assert.Equal(t, want.DestGasPerPayloadByteBase, have.DestGasPerPayloadByteBase) + assert.Equal(t, want.DestGasPerPayloadByteHigh, have.DestGasPerPayloadByteHigh) + assert.Equal(t, want.DestGasPerPayloadByteThreshold, have.DestGasPerPayloadByteThreshold) assert.Equal(t, want.DestGasPerDataAvailabilityByte, have.DestGasPerDataAvailabilityByte) assert.Equal(t, want.DestDataAvailabilityMultiplierBps, have.DestDataAvailabilityMultiplierBps) assert.Equal(t, want.DestDataAvailabilityOverheadGas, have.DestDataAvailabilityOverheadGas) diff --git a/deployment/ccip/view/v1_6/feequoter.go b/deployment/ccip/view/v1_6/feequoter.go index ed85f84ac2f..1fd10b3fb63 100644 --- a/deployment/ccip/view/v1_6/feequoter.go +++ b/deployment/ccip/view/v1_6/feequoter.go @@ -33,7 +33,9 @@ type FeeQuoterDestChainConfig struct { MaxDataBytes uint32 `json:"maxDataBytes,omitempty"` MaxPerMsgGasLimit uint32 `json:"maxPerMsgGasLimit,omitempty"` DestGasOverhead uint32 `json:"destGasOverhead,omitempty"` - DestGasPerPayloadByte uint16 `json:"destGasPerPayloadByte,omitempty"` + DestGasPerPayloadByteBase uint8 `json:"destGasPerPayloadByteBase,omitempty"` + DestGasPerPayloadByteHigh uint8 `json:"destGasPerPayloadByteHigh,omitempty"` + DestGasPerPayloadByteThreshold uint16 `json:"destGasPerPayloadByteThreshold,omitempty"` DestDataAvailabilityOverheadGas uint32 `json:"destDataAvailabilityOverheadGas,omitempty"` DestGasPerDataAvailabilityByte uint16 `json:"destGasPerDataAvailabilityByte,omitempty"` DestDataAvailabilityMultiplierBps uint16 `json:"destDataAvailabilityMultiplierBps,omitempty"` @@ -99,7 +101,9 @@ func GenerateFeeQuoterView(fqContract *fee_quoter.FeeQuoter, router *router1_2.R MaxDataBytes: destChainConfig.MaxDataBytes, MaxPerMsgGasLimit: destChainConfig.MaxPerMsgGasLimit, DestGasOverhead: destChainConfig.DestGasOverhead, - DestGasPerPayloadByte: destChainConfig.DestGasPerPayloadByte, + DestGasPerPayloadByteBase: destChainConfig.DestGasPerPayloadByteBase, + DestGasPerPayloadByteHigh: destChainConfig.DestGasPerPayloadByteHigh, + DestGasPerPayloadByteThreshold: destChainConfig.DestGasPerPayloadByteThreshold, DestDataAvailabilityOverheadGas: destChainConfig.DestDataAvailabilityOverheadGas, DestGasPerDataAvailabilityByte: destChainConfig.DestGasPerDataAvailabilityByte, DestDataAvailabilityMultiplierBps: destChainConfig.DestDataAvailabilityMultiplierBps, From d44df0154fb0e0e29d9cd5517d22dedc778a5d3e Mon Sep 17 00:00:00 2001 From: pavel-raykov <165708424+pavel-raykov@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:57:47 +0100 Subject: [PATCH 61/91] Bump the chainlink-common version (#15935) * Minor. * Update late-hornets-yell.md --- .changeset/late-hornets-yell.md | 5 +++++ core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 11 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .changeset/late-hornets-yell.md diff --git a/.changeset/late-hornets-yell.md b/.changeset/late-hornets-yell.md new file mode 100644 index 00000000000..7d04500cc77 --- /dev/null +++ b/.changeset/late-hornets-yell.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#updated Bump chainlink-common version. diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 9eccf5cd5a0..e5fa565327a 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -34,7 +34,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 47a3a61ba0c..c659d329fbd 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1164,8 +1164,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= diff --git a/deployment/go.mod b/deployment/go.mod index 89c11b336ef..20ec2aa2d51 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -31,7 +31,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 diff --git a/deployment/go.sum b/deployment/go.sum index 933721417a4..f39378c7369 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1390,8 +1390,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= diff --git a/go.mod b/go.mod index bb9a8f6884f..1cad28ea09d 100644 --- a/go.mod +++ b/go.mod @@ -80,7 +80,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index 701ec6ec08c..10c6bc0e667 100644 --- a/go.sum +++ b/go.sum @@ -1154,8 +1154,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 10748184fe4..65d4bfb05f3 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -47,7 +47,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index b79a6020857..f5a223dd01c 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1414,8 +1414,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 3d311cbb94f..67acbc538b8 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -27,7 +27,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 159fe3b94cb..23f6bde3370 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1403,8 +1403,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e h1:l1npEX9O1Y1R4ss6yNPlggxFOdhPWmvD3tIMZkOzuDU= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250113183410-42c3764c171e/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= From 912d6bc1c70f0b89ba0d437782e05fbacf335109 Mon Sep 17 00:00:00 2001 From: Margaret Ma Date: Wed, 15 Jan 2025 08:00:07 -0500 Subject: [PATCH 62/91] [DEVSVCS-556] Workflow Registry Contract Fixes (#15923) * do not allow empty urls for binaryURL * since workflowID must be unique this already covers that the new one must also be different from the new one * do not add a new version to the registry manager; instead activate the existing one if desired * do not allow name to be empty * minor gas optimization for updateAllowedDONs and updateAuthorizedAddresses * gas optimization for update status: bundle multiple status condition checks into one * run forge fmt + update gas snapshot + add changeset * address pr comment: move check for contract existence to top of function call * update core tests * Update gethwrappers --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> --- contracts/.changeset/ninety-pianos-approve.md | 5 ++ contracts/gas-snapshots/workflow.gas-snapshot | 54 +++++++++---------- .../v0.8/workflow/dev/WorkflowRegistry.sol | 44 ++++++++------- .../workflow/dev/WorkflowRegistryManager.sol | 10 +++- .../WorkflowRegistry.registerWorkflow.t.sol | 32 +++++++++++ .../WorkflowRegistry.registerWorkflow.tree | 8 ++- .../WorkflowRegistry.updateWorkflow.t.sol | 18 +++---- .../WorkflowRegistry.updateWorkflow.tree | 4 +- .../WorkflowRegistryManager.addVersion.t.sol | 28 ++++++---- .../WorkflowRegistryManager.addVersion.tree | 4 +- .../workflow_registry_wrapper.go | 4 +- ...rapper-dependency-versions-do-not-edit.txt | 2 +- .../workflows/syncer/workflow_syncer_test.go | 4 ++ 13 files changed, 140 insertions(+), 77 deletions(-) create mode 100644 contracts/.changeset/ninety-pianos-approve.md diff --git a/contracts/.changeset/ninety-pianos-approve.md b/contracts/.changeset/ninety-pianos-approve.md new file mode 100644 index 00000000000..d19823ceb6c --- /dev/null +++ b/contracts/.changeset/ninety-pianos-approve.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +Address misc fixes for workflow registry contract diff --git a/contracts/gas-snapshots/workflow.gas-snapshot b/contracts/gas-snapshots/workflow.gas-snapshot index bdfd2b24aec..48f92cbabbe 100644 --- a/contracts/gas-snapshots/workflow.gas-snapshot +++ b/contracts/gas-snapshots/workflow.gas-snapshot @@ -1,25 +1,25 @@ -WorkflowRegistryManager_activateVersion:test_WhenTheVersionNumberIsNotActive_AndWhenThereAreNoActiveVersions() (gas: 528769) -WorkflowRegistryManager_addVersion:test_WhenAutoActivateIsFalse() (gas: 265551) -WorkflowRegistryManager_addVersion:test_WhenAutoActivateIsTrue() (gas: 270596) -WorkflowRegistryManager_getActiveVersion:test_WhenAnActiveVersionExists() (gas: 287760) +WorkflowRegistryManager_activateVersion:test_WhenTheVersionNumberIsNotActive_AndWhenThereAreNoActiveVersions() (gas: 529151) +WorkflowRegistryManager_addVersion:test_WhenAutoActivateIsFalse() (gas: 265730) +WorkflowRegistryManager_addVersion:test_WhenAutoActivateIsTrue() (gas: 270806) +WorkflowRegistryManager_getActiveVersion:test_WhenAnActiveVersionExists() (gas: 287951) WorkflowRegistryManager_getActiveVersion:test_WhenNoActiveVersionIsAvailable() (gas: 13258) -WorkflowRegistryManager_getActiveVersionNumber:test_WhenAnActiveVersionExists() (gas: 283885) +WorkflowRegistryManager_getActiveVersionNumber:test_WhenAnActiveVersionExists() (gas: 284076) WorkflowRegistryManager_getActiveVersionNumber:test_WhenNoActiveVersionIsAvailable() (gas: 10698) WorkflowRegistryManager_getAllVersions:test_WhenLimitExceedsMaximumPaginationLimit() (gas: 54503) WorkflowRegistryManager_getAllVersions:test_WhenRequestingWithInvalidStartIndex() (gas: 11338) WorkflowRegistryManager_getAllVersions:test_WhenRequestingWithValidStartIndexAndLimitWithinBounds() (gas: 40398) WorkflowRegistryManager_getLatestVersion:test_WhenNoVersionsHaveBeenRegistered() (gas: 12984) -WorkflowRegistryManager_getLatestVersion:test_WhenVersionsHaveBeenRegistered() (gas: 287791) +WorkflowRegistryManager_getLatestVersion:test_WhenVersionsHaveBeenRegistered() (gas: 287982) WorkflowRegistryManager_getLatestVersionNumber:test_WhenNoVersionsHaveBeenRegistered() (gas: 10637) -WorkflowRegistryManager_getLatestVersionNumber:test_WhenVersionsHaveBeenRegistered() (gas: 284134) +WorkflowRegistryManager_getLatestVersionNumber:test_WhenVersionsHaveBeenRegistered() (gas: 284325) WorkflowRegistryManager_getVersion:test_WhenVersionNumberIsNotRegistered() (gas: 13785) -WorkflowRegistryManager_getVersion:test_WhenVersionNumberIsRegistered() (gas: 288169) -WorkflowRegistryManager_getVersionNumberByContractAddressAndChainID:test_WhenAVersionIsRegisteredForTheContractAddressAndChainIDCombination() (gas: 285022) -WorkflowRegistryManager_getVersionNumberByContractAddressAndChainID:test_WhenNoVersionIsRegisteredForTheContractAddressAndChainIDCombination() (gas: 286634) -WorkflowRegistryManager_getVersionNumberByContractAddressAndChainID:test_WhenTheContractAddressIsInvalid() (gas: 284604) -WorkflowRegistry_activateWorkflow:test_WhenTheCallerIsAnAuthorizedAddress() (gas: 517416) -WorkflowRegistry_deleteWorkflow:test_WhenTheCallerIsAnAuthorizedAddress_AndTheDonIDIsAllowed() (gas: 422157) -WorkflowRegistry_deleteWorkflow:test_WhenTheCallerIsAnAuthorizedAddress_AndTheDonIDIsNotAllowed() (gas: 439960) +WorkflowRegistryManager_getVersion:test_WhenVersionNumberIsRegistered() (gas: 288360) +WorkflowRegistryManager_getVersionNumberByContractAddressAndChainID:test_WhenAVersionIsRegisteredForTheContractAddressAndChainIDCombination() (gas: 285213) +WorkflowRegistryManager_getVersionNumberByContractAddressAndChainID:test_WhenNoVersionIsRegisteredForTheContractAddressAndChainIDCombination() (gas: 286825) +WorkflowRegistryManager_getVersionNumberByContractAddressAndChainID:test_WhenTheContractAddressIsInvalid() (gas: 284795) +WorkflowRegistry_activateWorkflow:test_WhenTheCallerIsAnAuthorizedAddress() (gas: 517448) +WorkflowRegistry_deleteWorkflow:test_WhenTheCallerIsAnAuthorizedAddress_AndTheDonIDIsAllowed() (gas: 422188) +WorkflowRegistry_deleteWorkflow:test_WhenTheCallerIsAnAuthorizedAddress_AndTheDonIDIsNotAllowed() (gas: 439990) WorkflowRegistry_getAllAllowedDONs:test_WhenTheRegistryIsLocked() (gas: 47473) WorkflowRegistry_getAllAllowedDONs:test_WhenTheSetOfAllowedDONsIsEmpty() (gas: 25780) WorkflowRegistry_getAllAllowedDONs:test_WhenThereAreMultipleAllowedDONs() (gas: 75437) @@ -28,9 +28,9 @@ WorkflowRegistry_getAllAuthorizedAddresses:test_WhenTheRegistryIsLocked() (gas: WorkflowRegistry_getAllAuthorizedAddresses:test_WhenTheSetOfAuthorizedAddressesIsEmpty() (gas: 26152) WorkflowRegistry_getAllAuthorizedAddresses:test_WhenThereAreMultipleAuthorizedAddresses() (gas: 78270) WorkflowRegistry_getAllAuthorizedAddresses:test_WhenThereIsASingleAuthorizedAddress() (gas: 16832) -WorkflowRegistry_getWorkflowMetadata:test_WhenTheRegistryIsLocked() (gas: 541532) +WorkflowRegistry_getWorkflowMetadata:test_WhenTheRegistryIsLocked() (gas: 541570) WorkflowRegistry_getWorkflowMetadata:test_WhenTheWorkflowDoesNotExist() (gas: 17543) -WorkflowRegistry_getWorkflowMetadata:test_WhenTheWorkflowExistsWithTheOwnerAndName() (gas: 512388) +WorkflowRegistry_getWorkflowMetadata:test_WhenTheWorkflowExistsWithTheOwnerAndName() (gas: 512426) WorkflowRegistry_getWorkflowMetadataListByDON:test_WhenLimitExceedsTotalWorkflows() (gas: 128146) WorkflowRegistry_getWorkflowMetadataListByDON:test_WhenLimitIsEqualToTotalWorkflows() (gas: 128035) WorkflowRegistry_getWorkflowMetadataListByDON:test_WhenLimitIsLessThanTotalWorkflows() (gas: 90141) @@ -48,17 +48,17 @@ WorkflowRegistry_getWorkflowMetadataListByOwner:test_WhenStartIsGreaterThanOrEqu WorkflowRegistry_getWorkflowMetadataListByOwner:test_WhenTheOwnerHasNoWorkflows() (gas: 14006) WorkflowRegistry_getWorkflowMetadataListByOwner:test_WhenTheRegistryIsLocked() (gas: 165968) WorkflowRegistry_lockRegistry:test_WhenTheCallerIsTheContractOwner() (gas: 38758) -WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsAllowed_AndTheCallerIsAnAuthorizedAddress() (gas: 517380) -WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsAllowed_AndTheCallerIsAnUnauthorizedAddress() (gas: 525183) -WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsNotAllowed_AndTheCallerIsAnAuthorizedAddress() (gas: 524942) -WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsNotAllowed_AndTheCallerIsAnUnauthorizedAddress() (gas: 529353) -WorkflowRegistry_registerWorkflow:test_WhenTheWorkflowInputsAreAllValid() (gas: 572178) -WorkflowRegistry_requestForceUpdateSecrets:test_WhenTheCallerIsAnAuthorizedAddress_AndTheWorkflowIsInAnAllowedDON() (gas: 936016) -WorkflowRegistry_requestForceUpdateSecrets:test_WhenTheCallerIsAnAuthorizedAddress_AndTheWorkflowIsNotInAnAllowedDON() (gas: 510784) -WorkflowRegistry_requestForceUpdateSecrets:test_WhenTheCallerIsNotAnAuthorizedAddress() (gas: 509138) +WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsAllowed_AndTheCallerIsAnAuthorizedAddress() (gas: 517427) +WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsAllowed_AndTheCallerIsAnUnauthorizedAddress() (gas: 525230) +WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsNotAllowed_AndTheCallerIsAnAuthorizedAddress() (gas: 524989) +WorkflowRegistry_pauseWorkflow:test_WhenTheDonIDIsNotAllowed_AndTheCallerIsAnUnauthorizedAddress() (gas: 529400) +WorkflowRegistry_registerWorkflow:test_WhenTheWorkflowInputsAreAllValid() (gas: 572239) +WorkflowRegistry_requestForceUpdateSecrets:test_WhenTheCallerIsAnAuthorizedAddress_AndTheWorkflowIsInAnAllowedDON() (gas: 936092) +WorkflowRegistry_requestForceUpdateSecrets:test_WhenTheCallerIsAnAuthorizedAddress_AndTheWorkflowIsNotInAnAllowedDON() (gas: 510822) +WorkflowRegistry_requestForceUpdateSecrets:test_WhenTheCallerIsNotAnAuthorizedAddress() (gas: 509176) WorkflowRegistry_unlockRegistry:test_WhenTheCallerIsTheContractOwner() (gas: 30325) WorkflowRegistry_updateAllowedDONs:test_WhenTheBoolInputIsFalse() (gas: 29739) -WorkflowRegistry_updateAllowedDONs:test_WhenTheBoolInputIsTrue() (gas: 170296) +WorkflowRegistry_updateAllowedDONs:test_WhenTheBoolInputIsTrue() (gas: 170256) WorkflowRegistry_updateAuthorizedAddresses:test_WhenTheBoolInputIsFalse() (gas: 30278) -WorkflowRegistry_updateAuthorizedAddresses:test_WhenTheBoolInputIsTrue() (gas: 175515) -WorkflowRegistry_updateWorkflow:test_WhenTheWorkflowInputsAreAllValid() (gas: 515666) +WorkflowRegistry_updateAuthorizedAddresses:test_WhenTheBoolInputIsTrue() (gas: 175475) +WorkflowRegistry_updateWorkflow:test_WhenTheWorkflowInputsAreAllValid() (gas: 515414) \ No newline at end of file diff --git a/contracts/src/v0.8/workflow/dev/WorkflowRegistry.sol b/contracts/src/v0.8/workflow/dev/WorkflowRegistry.sol index 2454374b2fb..2a5f797d3c8 100644 --- a/contracts/src/v0.8/workflow/dev/WorkflowRegistry.sol +++ b/contracts/src/v0.8/workflow/dev/WorkflowRegistry.sol @@ -89,6 +89,7 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { event RegistryUnlockedV1(address unlockedBy); error AddressNotAuthorized(address caller); + error BinaryURLRequired(); error CallerIsNotWorkflowOwner(address caller); error DONNotAllowed(uint32 donID); error InvalidWorkflowID(); @@ -99,7 +100,7 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { error WorkflowContentNotUpdated(); error WorkflowDoesNotExist(); error WorkflowIDAlreadyExists(); - error WorkflowIDNotUpdated(); + error WorkflowNameRequired(); error WorkflowNameTooLong(uint256 providedLength, uint8 maxAllowedLength); modifier registryNotLocked() { @@ -119,10 +120,12 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { /// @param allowed True if they should be added to the allowlist, false to remove them. function updateAllowedDONs(uint32[] calldata donIDs, bool allowed) external onlyOwner registryNotLocked { uint256 length = donIDs.length; - for (uint256 i = 0; i < length; ++i) { - if (allowed) { + if (allowed) { + for (uint256 i = 0; i < length; ++i) { s_allowedDONs.add(donIDs[i]); - } else { + } + } else { + for (uint256 i = 0; i < length; ++i) { s_allowedDONs.remove(donIDs[i]); } } @@ -136,10 +139,12 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { /// @param allowed True if they should be added to whitelist, false to remove them. function updateAuthorizedAddresses(address[] calldata addresses, bool allowed) external onlyOwner registryNotLocked { uint256 length = addresses.length; - for (uint256 i = 0; i < length; ++i) { - if (allowed) { + if (allowed) { + for (uint256 i = 0; i < length; ++i) { s_authorizedAddresses.add(addresses[i]); - } else { + } + } else { + for (uint256 i = 0; i < length; ++i) { s_authorizedAddresses.remove(addresses[i]); } } @@ -286,11 +291,6 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { // Store the old workflowID for event emission. bytes32 currentWorkflowID = workflow.workflowID; - // Condition to revert: WorkflowID must change, and at least one URL must change - if (currentWorkflowID == newWorkflowID) { - revert WorkflowIDNotUpdated(); - } - // Determine which URLs have changed bool sameBinaryURL = Strings.equal(workflow.binaryURL, binaryURL); bool sameConfigURL = Strings.equal(workflow.configURL, configURL); @@ -489,20 +489,16 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { revert WorkflowAlreadyInDesiredStatus(); } - // Check if the DON ID is allowed when activating a workflow + // Emit the appropriate event based on newStatus if (newStatus == WorkflowStatus.ACTIVE) { _validatePermissions(donID, msg.sender); + emit WorkflowActivatedV1(workflow.workflowID, msg.sender, donID, workflow.workflowName); + } else if (newStatus == WorkflowStatus.PAUSED) { + emit WorkflowPausedV1(workflow.workflowID, msg.sender, donID, workflow.workflowName); } // Update the workflow status workflow.status = newStatus; - - // Emit the appropriate event based on newStatus - if (newStatus == WorkflowStatus.PAUSED) { - emit WorkflowPausedV1(workflow.workflowID, msg.sender, donID, workflow.workflowName); - } else if (newStatus == WorkflowStatus.ACTIVE) { - emit WorkflowActivatedV1(workflow.workflowID, msg.sender, donID, workflow.workflowName); - } } /// @dev Internal function to retrieve a workflow from storage. @@ -669,6 +665,10 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { uint256 configURLLength, uint256 secretsURLLength ) internal pure { + if (binaryURLLength == 0) { + revert BinaryURLRequired(); + } + if (binaryURLLength > MAX_URL_LENGTH) { revert URLTooLong(binaryURLLength, MAX_URL_LENGTH); } @@ -688,6 +688,10 @@ contract WorkflowRegistry is Ownable2StepMsgSender, ITypeAndVersion { function _validateWorkflowName( uint256 workflowNameLength ) internal pure { + if (workflowNameLength == 0) { + revert WorkflowNameRequired(); + } + if (workflowNameLength > MAX_WORKFLOW_NAME_LENGTH) { revert WorkflowNameTooLong(workflowNameLength, MAX_WORKFLOW_NAME_LENGTH); } diff --git a/contracts/src/v0.8/workflow/dev/WorkflowRegistryManager.sol b/contracts/src/v0.8/workflow/dev/WorkflowRegistryManager.sol index 818d4a1a8ae..cf55aaeffb8 100644 --- a/contracts/src/v0.8/workflow/dev/WorkflowRegistryManager.sol +++ b/contracts/src/v0.8/workflow/dev/WorkflowRegistryManager.sol @@ -39,12 +39,13 @@ contract WorkflowRegistryManager is Ownable2StepMsgSender, ITypeAndVersion { uint32 private s_latestVersionNumber = 0; // Errors + error ContractAlreadyRegistered(address contractAddress, uint64 chainID); error InvalidContractAddress(address invalidAddress); error InvalidContractType(address invalidAddress); error NoActiveVersionAvailable(); error NoVersionsRegistered(); - error VersionNotRegistered(uint32 versionNumber); error VersionAlreadyActive(uint32 versionNumber); + error VersionNotRegistered(uint32 versionNumber); // Events event VersionAdded(address indexed contractAddress, uint64 chainID, uint32 deployedAt, uint32 version); @@ -63,6 +64,12 @@ contract WorkflowRegistryManager is Ownable2StepMsgSender, ITypeAndVersion { /// @param autoActivate A boolean indicating whether the new version should be activated immediately. /// @custom:throws InvalidContractType if the provided contract address is zero or not a WorkflowRegistry. function addVersion(address contractAddress, uint64 chainID, uint32 deployedAt, bool autoActivate) external onlyOwner { + // Check if the contract is already registered. If it is, you can just activate that existing version. + bytes32 key = keccak256(abi.encodePacked(contractAddress, chainID)); + if (s_versionNumberByAddressAndChainID[key] != 0) { + revert ContractAlreadyRegistered(contractAddress, chainID); + } + string memory typeVer = _getTypeAndVersionForContract(contractAddress); uint32 latestVersionNumber = ++s_latestVersionNumber; @@ -74,7 +81,6 @@ contract WorkflowRegistryManager is Ownable2StepMsgSender, ITypeAndVersion { }); // Store the version number associated with the hash of contract address and chainID - bytes32 key = keccak256(abi.encodePacked(contractAddress, chainID)); s_versionNumberByAddressAndChainID[key] = latestVersionNumber; if (autoActivate) { diff --git a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.t.sol b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.t.sol index 859437196cd..c44c28520a4 100644 --- a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.t.sol +++ b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.t.sol @@ -55,6 +55,22 @@ contract WorkflowRegistry_registerWorkflow is WorkflowRegistrySetup { ); } + // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed + function test_RevertWhen_TheWorkflowNameIsEmpty() external { + vm.prank(s_authorizedAddress); + + vm.expectRevert(WorkflowRegistry.WorkflowNameRequired.selector); + s_registry.registerWorkflow( + "", + s_validWorkflowID, + s_allowedDonID, + WorkflowRegistry.WorkflowStatus.ACTIVE, + s_validBinaryURL, + s_validConfigURL, + s_validSecretsURL + ); + } + // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed function test_RevertWhen_TheWorkflowNameIsTooLong() external { vm.prank(s_authorizedAddress); @@ -74,6 +90,22 @@ contract WorkflowRegistry_registerWorkflow is WorkflowRegistrySetup { ); } + // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed + function test_RevertWhen_TheBinaryURLIsEmpty() external { + vm.prank(s_authorizedAddress); + + vm.expectRevert(WorkflowRegistry.BinaryURLRequired.selector); + s_registry.registerWorkflow( + s_validWorkflowName, + s_validWorkflowID, + s_allowedDonID, + WorkflowRegistry.WorkflowStatus.ACTIVE, + "", + s_validConfigURL, + s_validSecretsURL + ); + } + // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed function test_RevertWhen_TheBinaryURLIsTooLong() external { vm.prank(s_authorizedAddress); diff --git a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.tree b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.tree index eabbf58d464..143ee46c394 100644 --- a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.tree +++ b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.registerWorkflow.tree @@ -2,14 +2,18 @@ WorkflowRegistry.registerWorkflow ├── when the caller is not an authorized address │ └── it should revert └── when the caller is an authorized address - └── when the registry is locked + ├── when the registry is locked │ └── it should revert └── when the registry is not locked - └── when the donID is not allowed + ├── when the donID is not allowed │ └── it should revert └── when the donID is allowed + ├── when the workflow name is empty + │ └── it should revert ├── when the workflow name is too long │ └── it should revert + ├── when the binaryURL is empty + │ └── it should revert ├── when the binaryURL is too long │ └── it should revert ├── when the configURL is too long diff --git a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.t.sol b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.t.sol index 4082874a91e..b60d44d8df6 100644 --- a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.t.sol +++ b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.t.sol @@ -83,29 +83,27 @@ contract WorkflowRegistry_updateWorkflow is WorkflowRegistrySetup { } // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed whenTheCallerIsTheWorkflowOwner - function test_RevertWhen_TheNewWorkflowIDIsTheSameAsTheExistingWorkflowID() external { + function test_RevertWhen_NoneOfTheURLsAreUpdated() external { // Register a workflow first _registerValidWorkflow(); - // Update the workflow now with the same workflow ID + // Update the workflow with no changes to any URLs vm.prank(s_authorizedAddress); - vm.expectRevert(WorkflowRegistry.WorkflowIDNotUpdated.selector); + vm.expectRevert(WorkflowRegistry.WorkflowContentNotUpdated.selector); s_registry.updateWorkflow( - s_validWorkflowKey, s_validWorkflowID, s_validBinaryURL, s_validConfigURL, s_newValidSecretsURL + s_validWorkflowKey, s_newValidWorkflowID, s_validBinaryURL, s_validConfigURL, s_validSecretsURL ); } // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed whenTheCallerIsTheWorkflowOwner - function test_RevertWhen_NoneOfTheURLsAreUpdated() external { + function test_RevertWhen_TheBinaryURLIsEmpty() external { // Register a workflow first _registerValidWorkflow(); - // Update the workflow with no changes to any URLs + // Update the workflow with a binary URL that is empty vm.prank(s_authorizedAddress); - vm.expectRevert(WorkflowRegistry.WorkflowContentNotUpdated.selector); - s_registry.updateWorkflow( - s_validWorkflowKey, s_newValidWorkflowID, s_validBinaryURL, s_validConfigURL, s_validSecretsURL - ); + vm.expectRevert(WorkflowRegistry.BinaryURLRequired.selector); + s_registry.updateWorkflow(s_validWorkflowKey, s_newValidWorkflowID, "", s_validConfigURL, s_validSecretsURL); } // whenTheCallerIsAnAuthorizedAddress whenTheRegistryIsNotLocked whenTheDonIDIsAllowed whenTheCallerIsTheWorkflowOwner diff --git a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.tree b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.tree index 9b8243a8672..5577ea8e17e 100644 --- a/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.tree +++ b/contracts/src/v0.8/workflow/test/WorkflowRegistry/WorkflowRegistry.updateWorkflow.tree @@ -13,10 +13,10 @@ WorkflowRegistry.updateWorkflow └── when the caller is the workflow owner ├── when an existing workflow is not found with the given workflow name │ └── it should revert - ├── when the new workflowID is the same as the existing workflowID - │ └── it should revert ├── when none of the URLs are updated │ └── it should revert + ├── when the binaryURL is empty + │ └── it should revert ├── when the binaryURL is too long │ └── it should revert ├── when the configURL is too long diff --git a/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.t.sol b/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.t.sol index 218ac44eaa6..79eec6f71e5 100644 --- a/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.t.sol +++ b/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.t.sol @@ -21,21 +21,29 @@ contract WorkflowRegistryManager_addVersion is WorkflowRegistryManagerSetup { // whenTheCallerIsTheOwner function test_RevertWhen_TheContractAddressIsInvalid() external { - // Deploy a random contract - MockContract mockContract = new MockContract(); + // Add a 0 address to the WorkflowRegistryManager + vm.prank(s_owner); + vm.expectRevert(abi.encodeWithSelector(WorkflowRegistryManager.InvalidContractAddress.selector, address(0))); + s_registryManager.addVersion(address(0), s_chainID, s_deployedAt, true); + } + + // whenTheCallerIsTheOwner whenTheContractAddressIsValid + function test_RevertWhen_TheContractIsAlreadyRegistered() external { + // Deploy a MockWorkflowRegistryContract contract + MockWorkflowRegistryContract mockWfrContract = new MockWorkflowRegistryContract(); // Add it to the WorkflowRegistryManager vm.prank(s_owner); - vm.expectRevert(abi.encodeWithSelector(WorkflowRegistryManager.InvalidContractType.selector, address(mockContract))); - s_registryManager.addVersion(address(mockContract), s_chainID, s_deployedAt, true); - } + s_registryManager.addVersion(address(mockWfrContract), s_chainID, s_deployedAt, true); - // whenTheCallerIsTheOwner - function test_RevertWhen_TheContractAddressIsValid() external { - // Add a 0 address to the WorkflowRegistryManager + // Try to add it again vm.prank(s_owner); - vm.expectRevert(abi.encodeWithSelector(WorkflowRegistryManager.InvalidContractAddress.selector, address(0))); - s_registryManager.addVersion(address(0), s_chainID, s_deployedAt, true); + vm.expectRevert( + abi.encodeWithSelector( + WorkflowRegistryManager.ContractAlreadyRegistered.selector, address(mockWfrContract), s_chainID + ) + ); + s_registryManager.addVersion(address(mockWfrContract), s_chainID, s_deployedAt, true); } // whenTheCallerIsTheOwner whenTheContractAddressIsValid diff --git a/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.tree b/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.tree index 5e1c22b7840..60ccc6013d5 100644 --- a/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.tree +++ b/contracts/src/v0.8/workflow/test/WorkflowRegistryManager/WorkflowRegistryManager.addVersion.tree @@ -5,7 +5,9 @@ WorkflowRegistryManager.addVersion ├── when the contract address is invalid │ └── it should revert └── when the contract address is valid - ├── when the contract type is invalid + ├── when the contract is already registered + │ └── it should revert + └── when the contract type is invalid │ └── it should revert └── when the contract type is valid ├── when autoActivate is true diff --git a/core/gethwrappers/workflow/generated/workflow_registry_wrapper/workflow_registry_wrapper.go b/core/gethwrappers/workflow/generated/workflow_registry_wrapper/workflow_registry_wrapper.go index a81d69c343e..ca75b4a82d9 100644 --- a/core/gethwrappers/workflow/generated/workflow_registry_wrapper/workflow_registry_wrapper.go +++ b/core/gethwrappers/workflow/generated/workflow_registry_wrapper/workflow_registry_wrapper.go @@ -42,8 +42,8 @@ type WorkflowRegistryWorkflowMetadata struct { } var WorkflowRegistryMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AddressNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotWorkflowOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotTransferToSelf\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"}],\"name\":\"DONNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWorkflowID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeProposedOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryLocked\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"providedLength\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"maxAllowedLength\",\"type\":\"uint8\"}],\"name\":\"URLTooLong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowAlreadyInDesiredStatus\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowContentNotUpdated\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowIDAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowIDNotUpdated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"providedLength\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"maxAllowedLength\",\"type\":\"uint8\"}],\"name\":\"WorkflowNameTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32[]\",\"name\":\"donIDs\",\"type\":\"uint32[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AllowedDONsUpdatedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"addresses\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AuthorizedAddressesUpdatedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lockedBy\",\"type\":\"address\"}],\"name\":\"RegistryLockedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"unlockedBy\",\"type\":\"address\"}],\"name\":\"RegistryUnlockedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowActivatedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowDeletedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"secretsURLHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowForceUpdateSecretsRequestedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowPausedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"WorkflowRegisteredV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"oldWorkflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newWorkflowID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"WorkflowUpdatedV1\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"}],\"name\":\"activateWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"computeHashKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"}],\"name\":\"deleteWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAllowedDONs\",\"outputs\":[{\"internalType\":\"uint32[]\",\"name\":\"allowedDONs\",\"type\":\"uint32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAuthorizedAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"authorizedAddresses\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"getWorkflowMetadata\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"internalType\":\"structWorkflowRegistry.WorkflowMetadata\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"getWorkflowMetadataListByDON\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"internalType\":\"structWorkflowRegistry.WorkflowMetadata[]\",\"name\":\"workflowMetadataList\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"getWorkflowMetadataListByOwner\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"internalType\":\"structWorkflowRegistry.WorkflowMetadata[]\",\"name\":\"workflowMetadataList\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRegistryLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"}],\"name\":\"pauseWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"registerWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"requestForceUpdateSecrets\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"donIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"updateAllowedDONs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"addresses\",\"type\":\"address[]\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"updateAuthorizedAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newWorkflowID\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"updateWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6080806040523461004a57331561003b57600180546001600160a01b03191633179055600b805460ff191690556040516134e290816100508239f35b639b15e16f60e01b8152600490fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806308e7f63a1461210e578063181f5a771461207f5780632303348a14611f425780632b596f6d14611eb45780633ccd14ff14611572578063695e1340146113965780636f351771146112bd578063724c13dd146111c65780637497066b146110ab57806379ba509714610fd55780637ec0846d14610f4a5780638da5cb5b14610ef85780639f4cb53414610ed7578063b87a019414610e81578063d4b89c7414610698578063db800092146105fd578063e3dce080146104d6578063e690f33214610362578063f2fde38b14610284578063f794bdeb146101495763f99ecb6b1461010357600080fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457602060ff600b54166040519015158152f35b600080fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610144576007805461018581612488565b610192604051918261230f565b81815261019e82612488565b916020937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060208401940136853760005b82811061023257505050906040519283926020840190602085525180915260408401929160005b82811061020557505050500390f35b835173ffffffffffffffffffffffffffffffffffffffff16855286955093810193928101926001016101f6565b6001908260005273ffffffffffffffffffffffffffffffffffffffff817fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801541661027d82876125ba565b52016101cf565b346101445760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610144576102bb6123f6565b6102c3612c53565b73ffffffffffffffffffffffffffffffffffffffff8091169033821461033857817fffffffffffffffffffffffff00000000000000000000000000000000000000006000541617600055600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b60046040517fdad89dca000000000000000000000000000000000000000000000000000000008152fd5b346101445760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760ff600b54166104ac576103a760043533612eb0565b600181019081549160ff8360c01c16600281101561047d576001146104535778010000000000000000000000000000000000000000000000007fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff841617905580547f6a0ed88e9cf3cb493ab4028fcb1dc7d18f0130fcdfba096edde0aadbfbf5e99f63ffffffff604051946020865260a01c16938061044e3395600260208401910161265c565b0390a4005b60046040517f6f861db1000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60046040517f78a4e7d9000000000000000000000000000000000000000000000000000000008152fd5b34610144576104e43661237e565b916104ed612c53565b60ff600b54166104ac5760005b828110610589575060405191806040840160408552526060830191906000905b8082106105515785151560208601527f509460cccbb176edde6cac28895a4415a24961b8f3a0bd2617b9bb7b4e166c9b85850386a1005b90919283359073ffffffffffffffffffffffffffffffffffffffff82168092036101445760019181526020809101940192019061051a565b60019084156105cb576105c373ffffffffffffffffffffffffffffffffffffffff6105bd6105b8848888612af3565b612c32565b1661308b565b505b016104fa565b6105f773ffffffffffffffffffffffffffffffffffffffff6105f16105b8848888612af3565b166132bc565b506105c5565b346101445761061d61060e36612419565b916106176124a0565b50612b14565b6000526004602052604060002073ffffffffffffffffffffffffffffffffffffffff6001820154161561066e5761065661066a91612710565b6040519182916020835260208301906121cc565b0390f35b60046040517f871e01b2000000000000000000000000000000000000000000000000000000008152fd5b346101445760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760443567ffffffffffffffff8111610144576106e7903690600401612350565b9060643567ffffffffffffffff811161014457610708903690600401612350565b9160843567ffffffffffffffff811161014457610729903690600401612350565b60ff600b94929454166104ac57610741818688612d48565b61074d60043533612eb0565b9163ffffffff600184015460a01c16956107673388612c9e565b8354946024358614610e57576107a26040516107918161078a8160038b0161265c565b038261230f565b61079c368c856128c4565b90612f1f565b6107c46040516107b98161078a8160048c0161265c565b61079c3686886128c4565b6107e66040516107db8161078a8160058d0161265c565b61079c36898d6128c4565b918080610e50575b80610e49575b610e1f57610803602435612e08565b88600052600660205260406000207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008154169055602435885515610cca575b15610b79575b156108cc575b926108bc7f41161473ce2ed633d9f902aab9702d16a5531da27ec84e1939abeffe54ad7353959361044e936108ae6108a0978d604051998a996024358b5260a060208c0152600260a08c01910161265c565b9189830360408b0152612987565b918683036060880152612987565b9083820360808501523397612987565b6108d96005860154612609565b610b12575b67ffffffffffffffff8411610ae357610907846108fe6005880154612609565b60058801612940565b6000601f85116001146109e3579284926108ae6108bc938a9b9c61098b876108a09b9a61044e9a7f41161473ce2ed633d9f902aab9702d16a5531da27ec84e1939abeffe54ad73539e9f6000926109d8575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60058a01555b8c87806109ae575b50509c9b9a995093505092949550925061084e565b6109b89133612b14565b60005260056020526109d060043560406000206130dd565b508c87610999565b013590508f80610959565b9860058601600052602060002060005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe087168110610acb5750926108ae6108bc9361044e969388968c7f41161473ce2ed633d9f902aab9702d16a5531da27ec84e1939abeffe54ad73539c9d9e9f897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06108a09e9d1610610a93575b505050600187811b0160058a0155610991565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88b60031b161c199101351690558e8d81610a80565b898c0135825560209b8c019b600190920191016109f3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516020810190610b5881610b2c60058a0133866129c6565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261230f565b5190206000526005602052610b736004356040600020613383565b506108de565b67ffffffffffffffff8311610ae357610ba283610b996004890154612609565b60048901612940565b600083601f8111600114610c035780610bee92600091610bf8575b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b6004870155610848565b90508601358d610bbd565b506004870160005260206000209060005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086168110610cb25750847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610610c7a575b5050600183811b016004870155610848565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88660031b161c19908601351690558a80610c68565b9091602060018192858a013581550193019101610c14565b67ffffffffffffffff8b11610ae357610cf38b610cea60038a0154612609565b60038a01612940565b60008b601f8111600114610d535780610d3e92600091610d4857507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b6003880155610842565b90508501358e610bbd565b506003880160005260206000209060005b8d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081168210610e06578091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610610dcd575b905060018092501b016003880155610842565b60f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9160031b161c19908501351690558b808c610dba565b5085820135835560019092019160209182019101610d64565b60046040517f6b4a810d000000000000000000000000000000000000000000000000000000008152fd5b50826107f4565b50816107ee565b60046040517f95406722000000000000000000000000000000000000000000000000000000008152fd5b346101445760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445761066a610ecb610ebe6123f6565b6044359060243590612b6f565b60405191829182612270565b34610144576020610ef0610eea36612419565b91612b14565b604051908152f35b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457610f81612c53565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600b5416600b557f11a03e25ee25bf1459f9e1cb293ea03707d84917f54a65e32c9a7be2f2edd68a6020604051338152a1005b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760005473ffffffffffffffffffffffffffffffffffffffff808216330361108157600154917fffffffffffffffffffffffff0000000000000000000000000000000000000000903382851617600155166000553391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60046040517f02b543c6000000000000000000000000000000000000000000000000000000008152fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457600980546110e781612488565b6110f4604051918261230f565b81815261110082612488565b916020937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060208401940136853760005b82811061118457505050906040519283926020840190602085525180915260408401929160005b82811061116757505050500390f35b835163ffffffff1685528695509381019392810192600101611158565b6001908260005263ffffffff817f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0154166111bf82876125ba565b5201611131565b34610144576111d43661237e565b916111dd612c53565b60ff600b54166104ac5760005b828110611269575060405191806040840160408552526060830191906000905b8082106112415785151560208601527fcab63bf31d1e656baa23cebef64e12033ea0ffbd44b1278c3747beec2d2f618c85850386a1005b90919283359063ffffffff82168092036101445760019181526020809101940192019061120a565b600190841561129b5761129363ffffffff61128d611288848888612af3565b612b03565b16612fd2565b505b016111ea565b6112b763ffffffff6112b1611288848888612af3565b16613169565b50611295565b346101445760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760ff600b54166104ac5761130260043533612eb0565b600181019081549163ffffffff8360a01c169260ff8160c01c16600281101561047d5715610453577fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff906113563386612c9e565b16905580547f17b2d730bb5e064df3fbc6165c8aceb3b0d62c524c196c0bc1012209280bc9a6604051602081528061044e3395600260208401910161265c565b34610144576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610144576004359060ff600b54166104ac576113de8233612eb0565b916113f6336000526008602052604060002054151590565b156115425782600493546000526006835260406000207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553360005260028352611448826040600020613383565b50600181019063ffffffff80835460a01c166000526003855261146f846040600020613383565b506005820161147e8154612609565b61150e575b508154925460a01c16917f76ee2dfcae10cb8522e62e713e62660e09ecfaab08db15d9404de19141322571604051868152806114c6339560028a8401910161265c565b0390a46000525261150c6005604060002060008155600060018201556114ee60028201612aaa565b6114fa60038201612aaa565b61150660048201612aaa565b01612aaa565b005b60405161152381610b2c8982019433866129c6565b5190206000526005855261153b846040600020613383565b5086611483565b60246040517f85982a00000000000000000000000000000000000000000000000000000000008152336004820152fd5b346101445760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760043567ffffffffffffffff8111610144576115c1903690600401612350565b6044359163ffffffff8316830361014457600260643510156101445760843567ffffffffffffffff8111610144576115fd903690600401612350565b91909260a43567ffffffffffffffff811161014457611620903690600401612350565b60c43567ffffffffffffffff811161014457611640903690600401612350565b96909560ff600b54166104ac57611657338a612c9e565b60408511611e7c5761166a888483612d48565b611675858733612b14565b80600052600460205273ffffffffffffffffffffffffffffffffffffffff60016040600020015416611e52576116ac602435612e08565b604051906116b9826122f2565b602435825233602083015263ffffffff8b1660408301526116df606435606084016125fd565b6116ea36888a6128c4565b60808301526116fa3684866128c4565b60a083015261170a3686886128c4565b60c083015261171a368b8b6128c4565b60e0830152806000526004602052604060002091805183556001830173ffffffffffffffffffffffffffffffffffffffff60208301511681549077ffffffff0000000000000000000000000000000000000000604085015160a01b16906060850151600281101561047d5778ff0000000000000000000000000000000000000000000000007fffffffffffffff000000000000000000000000000000000000000000000000009160c01b1693161717179055608081015180519067ffffffffffffffff8211610ae3576117fd826117f46002880154612609565b60028801612940565b602090601f8311600114611d865761184a929160009183611caf5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60028401555b60a081015180519067ffffffffffffffff8211610ae357611881826118786003880154612609565b60038801612940565b602090601f8311600114611cba576118ce929160009183611caf5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60038401555b60c081015180519067ffffffffffffffff8211610ae357611905826118fc6004880154612609565b60048801612940565b602090601f8311600114611be25791806119569260e09594600092611abd5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60048501555b015180519267ffffffffffffffff8411610ae357838d9261198e8e966119856005860154612609565b60058601612940565b602090601f8311600114611ac8579463ffffffff6108ae95819a957fc4399022965bad9b2b468bbd8c758a7e80cdde36ff3088ddbb7f93bdfb5623cb9f9e9d9994611a1a8761044e9f9b98600593611a7e9f9a600092611abd5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b9101555b336000526002602052611a358360406000206130dd565b50166000526003602052611a4d8160406000206130dd565b508d82611a94575b5050506108a06040519a8b9a611a6d8c606435612161565b60a060208d015260a08c0191612987565b9783890360808501521696339660243596612987565b611ab492611aa29133612b14565b600052600560205260406000206130dd565b508c8f8d611a55565b015190503880610959565b906005840160005260206000209160005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085168110611bb857506108ae9563ffffffff9a957fc4399022965bad9b2b468bbd8c758a7e80cdde36ff3088ddbb7f93bdfb5623cb9f9e9d999460018761044e9f9b96928f9693611a7e9f9a94837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06005971610611b81575b505050811b01910155611a1e565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080611b73565b939550918194969750600160209291839285015181550194019201918f9492918f97969492611ad9565b906004860160005260206000209160005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085168110611c975750918391600193837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060e098971610611c60575b505050811b01600485015561195c565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690558f8080611c50565b91926020600181928685015181550194019201611bf3565b015190508f80610959565b9190600386016000526020600020906000935b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084168510611d6b5760019450837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610611d34575b505050811b0160038401556118d4565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690558e8080611d24565b81810151835560209485019460019093019290910190611ccd565b9190600286016000526020600020906000935b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084168510611e375760019450837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610611e00575b505050811b016002840155611850565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690558e8080611df0565b81810151835560209485019460019093019290910190611d99565b60046040517fa0677dd0000000000000000000000000000000000000000000000000000000008152fd5b604485604051907f36a7c503000000000000000000000000000000000000000000000000000000008252600482015260406024820152fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457611eeb612c53565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600b541617600b557f2789711f6fd67d131ad68378617b5d1d21a2c92b34d7c3745d70b3957c08096c6020604051338152a1005b34610144576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760043567ffffffffffffffff811161014457611f92903690600401612350565b60ff600b54166104ac57611fa69133612b14565b90816000526005602052604060002091825491821561066e5760005b838110611fcb57005b80611fd860019287612fba565b90549060031b1c60005260048352604060002063ffffffff8382015460a01c16600052600a8452604060002054151580612062575b612019575b5001611fc2565b7f95d94f817db4971aa99ba35d0fe019bd8cc39866fbe02b6d47b5f0f3727fb673604051868152604086820152806120593394600260408401910161265c565b0390a286612012565b5061207a336000526008602052604060002054151590565b61200d565b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457604051604081019080821067ffffffffffffffff831117610ae35761066a91604052601a81527f576f726b666c6f77526567697374727920312e302e302d646576000000000000602082015260405191829160208352602083019061216e565b346101445760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760043563ffffffff8116810361014457610ecb61066a9160443590602435906127cf565b90600282101561047d5752565b919082519283825260005b8481106121b85750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201612179565b61226d9160e061225c61224a6122386101008651865273ffffffffffffffffffffffffffffffffffffffff602088015116602087015263ffffffff604088015116604087015261222460608801516060880190612161565b60808701519080608088015286019061216e565b60a086015185820360a087015261216e565b60c085015184820360c086015261216e565b9201519060e081840391015261216e565b90565b6020808201906020835283518092526040830192602060408460051b8301019501936000915b8483106122a65750505050505090565b90919293949584806122e2837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a516121cc565b9801930193019194939290612296565b610100810190811067ffffffffffffffff821117610ae357604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610ae357604052565b9181601f840112156101445782359167ffffffffffffffff8311610144576020838186019501011161014457565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101445760043567ffffffffffffffff9283821161014457806023830112156101445781600401359384116101445760248460051b8301011161014457602401919060243580151581036101445790565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361014457565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101445760043573ffffffffffffffffffffffffffffffffffffffff8116810361014457916024359067ffffffffffffffff82116101445761248491600401612350565b9091565b67ffffffffffffffff8111610ae35760051b60200190565b604051906124ad826122f2565b606060e0836000815260006020820152600060408201526000838201528260808201528260a08201528260c08201520152565b6040516020810181811067ffffffffffffffff821117610ae3576040526000815290565b9061250e82612488565b61251b604051918261230f565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06125498294612488565b019060005b82811061255a57505050565b6020906125656124a0565b8282850101520161254e565b9190820180921161257e57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9190820391821161257e57565b80518210156125ce5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600282101561047d5752565b90600182811c92168015612652575b602083101461262357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691612618565b80546000939261266b82612609565b918282526020936001916001811690816000146126d35750600114612692575b5050505050565b90939495506000929192528360002092846000945b8386106126bf5750505050010190388080808061268b565b8054858701830152940193859082016126a7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168685015250505090151560051b01019150388080808061268b565b90600560e06040936127cb855191612727836122f2565b6127c483978254855261277160ff600185015473ffffffffffffffffffffffffffffffffffffffff8116602089015263ffffffff8160a01c168489015260c01c16606087016125fd565b80516127848161078a816002880161265c565b6080860152805161279c8161078a816003880161265c565b60a086015280516127b48161078a816004880161265c565b60c086015251809681930161265c565b038461230f565b0152565b63ffffffff1691600083815260036020906003602052604093604084205490818710156128b4576128239181606489931180156128ac575b6128a4575b816128178285612571565b111561289457506125ad565b9461282d86612504565b96845b87811061284257505050505050505090565b60019082875284865261286188882061285b8387612571565b90612fba565b905490861b1c875260048652612878888820612710565b612882828c6125ba565b5261288d818b6125ba565b5001612830565b61289f915082612571565b6125ad565b50606461280c565b508015612807565b505050505050505061226d6124e0565b92919267ffffffffffffffff8211610ae3576040519161290c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461230f565b829481845281830111610144578281602093846000960137010152565b818110612934575050565b60008155600101612929565b9190601f811161294f57505050565b61297b926000526020600020906020601f840160051c8301931061297d575b601f0160051c0190612929565b565b909150819061296e565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b91907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009060601b168252601490600092815492612a0284612609565b92600194600181169081600014612a695750600114612a24575b505050505090565b9091929395945060005260209460206000206000905b858210612a565750505050601492935001013880808080612a1c565b8054858301850152908701908201612a3a565b92505050601494507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091935016838301528015150201013880808080612a1c565b612ab48154612609565b9081612abe575050565b81601f60009311600114612ad0575055565b908083918252612aef601f60208420940160051c840160018501612929565b5555565b91908110156125ce5760051b0190565b3563ffffffff811681036101445790565b91906034612b6991836040519485927fffffffffffffffffffffffffffffffffffffffff000000000000000000000000602085019860601b16885284840137810160008382015203601481018452018261230f565b51902090565b73ffffffffffffffffffffffffffffffffffffffff169160008381526002926020906002602052604093604084205490818310156128b457612bc69181606485931180156128ac576128a457816128178285612571565b94612bd086612504565b96845b878110612be557505050505050505090565b600190828752838652612bfe88882061285b8388612571565b90549060031b1c875260048652612c16888820612710565b612c20828c6125ba565b52612c2b818b6125ba565b5001612bd3565b3573ffffffffffffffffffffffffffffffffffffffff811681036101445790565b73ffffffffffffffffffffffffffffffffffffffff600154163303612c7457565b60046040517f2b5c74de000000000000000000000000000000000000000000000000000000008152fd5b63ffffffff1680600052600a60205260406000205415612d17575073ffffffffffffffffffffffffffffffffffffffff1680600052600860205260406000205415612ce65750565b602490604051907f85982a000000000000000000000000000000000000000000000000000000000082526004820152fd5b602490604051907f8fe6d7e10000000000000000000000000000000000000000000000000000000082526004820152fd5b9060c891828111612dd25750818111612d9d5750808211612d67575050565b60449250604051917ecd56a800000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b604491604051917ecd56a800000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b60449083604051917ecd56a800000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b8015612e865780600052600660205260ff60406000205416612e5c576000526006602052604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055565b60046040517f4cb050e4000000000000000000000000000000000000000000000000000000008152fd5b60046040517f7dc2f4e1000000000000000000000000000000000000000000000000000000008152fd5b90600052600460205260406000209073ffffffffffffffffffffffffffffffffffffffff8060018401541691821561066e5716809103612eee575090565b602490604051907f31ee6dc70000000000000000000000000000000000000000000000000000000082526004820152fd5b9081518151908181149384612f36575b5050505090565b6020929394508201209201201438808080612f2f565b6009548110156125ce5760096000527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0190600090565b6007548110156125ce5760076000527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880190600090565b80548210156125ce5760005260206000200190600090565b6000818152600a6020526040812054613086576009546801000000000000000081101561305957908261304561301084600160409601600955612f4c565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055600954928152600a6020522055600190565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b905090565b60008181526008602052604081205461308657600754680100000000000000008110156130595790826130c961301084600160409601600755612f83565b905560075492815260086020522055600190565b9190600183016000908282528060205260408220541560001461316357845494680100000000000000008610156131365783613126613010886001604098999a01855584612fba565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b6000818152600a602052604081205490919080156132b7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081810181811161328a576009549083820191821161325d57818103613229575b50505060095480156131fc578101906131db82612f4c565b909182549160031b1b191690556009558152600a6020526040812055600190565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b61324761323861301093612f4c565b90549060031b1c928392612f4c565b90558452600a60205260408420553880806131c3565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b505090565b60008181526008602052604081205490919080156132b7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081810181811161328a576007549083820191821161325d5781810361334f575b50505060075480156131fc5781019061332e82612f83565b909182549160031b1b19169055600755815260086020526040812055600190565b61336d61335e61301093612f83565b90549060031b1c928392612f83565b9055845260086020526040842055388080613316565b90600182019060009281845282602052604084205490811515600014612f2f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff918281018181116134a85782549084820191821161347b57818103613446575b50505080548015613419578201916133fc8383612fba565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b6134666134566130109386612fba565b90549060031b1c92839286612fba565b905586528460205260408620553880806133e4565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fdfea164736f6c6343000818000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AddressNotAuthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BinaryURLRequired\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotWorkflowOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotTransferToSelf\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"}],\"name\":\"DONNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWorkflowID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeProposedOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryLocked\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"providedLength\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"maxAllowedLength\",\"type\":\"uint8\"}],\"name\":\"URLTooLong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowAlreadyInDesiredStatus\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowContentNotUpdated\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowIDAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WorkflowNameRequired\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"providedLength\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"maxAllowedLength\",\"type\":\"uint8\"}],\"name\":\"WorkflowNameTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32[]\",\"name\":\"donIDs\",\"type\":\"uint32[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AllowedDONsUpdatedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"addresses\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AuthorizedAddressesUpdatedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lockedBy\",\"type\":\"address\"}],\"name\":\"RegistryLockedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"unlockedBy\",\"type\":\"address\"}],\"name\":\"RegistryUnlockedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowActivatedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowDeletedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"secretsURLHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowForceUpdateSecretsRequestedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"WorkflowPausedV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"WorkflowRegisteredV1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"oldWorkflowID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newWorkflowID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"WorkflowUpdatedV1\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"}],\"name\":\"activateWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"computeHashKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"}],\"name\":\"deleteWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAllowedDONs\",\"outputs\":[{\"internalType\":\"uint32[]\",\"name\":\"allowedDONs\",\"type\":\"uint32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAuthorizedAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"authorizedAddresses\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"}],\"name\":\"getWorkflowMetadata\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"internalType\":\"structWorkflowRegistry.WorkflowMetadata\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"getWorkflowMetadataListByDON\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"internalType\":\"structWorkflowRegistry.WorkflowMetadata[]\",\"name\":\"workflowMetadataList\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"getWorkflowMetadataListByOwner\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"internalType\":\"structWorkflowRegistry.WorkflowMetadata[]\",\"name\":\"workflowMetadataList\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRegistryLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"}],\"name\":\"pauseWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"workflowName\",\"type\":\"string\"},{\"internalType\":\"bytes32\",\"name\":\"workflowID\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"donID\",\"type\":\"uint32\"},{\"internalType\":\"enumWorkflowRegistry.WorkflowStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"registerWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"requestForceUpdateSecrets\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"donIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"updateAllowedDONs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"addresses\",\"type\":\"address[]\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"updateAuthorizedAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"workflowKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newWorkflowID\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"binaryURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"configURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"secretsURL\",\"type\":\"string\"}],\"name\":\"updateWorkflow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6080806040523461004a57331561003b57600180546001600160a01b03191633179055600b805460ff1916905560405161354290816100508239f35b639b15e16f60e01b8152600490fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806308e7f63a1461213e578063181f5a77146120af5780632303348a14611f725780632b596f6d14611ee45780633ccd14ff14611572578063695e1340146113965780636f351771146112ba578063724c13dd146111af5780637497066b1461109457806379ba509714610fbe5780637ec0846d14610f335780638da5cb5b14610ee15780639f4cb53414610ec0578063b87a019414610e6a578063d4b89c74146106af578063db80009214610614578063e3dce080146104d9578063e690f33214610362578063f2fde38b14610284578063f794bdeb146101495763f99ecb6b1461010357600080fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457602060ff600b54166040519015158152f35b600080fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760078054610185816124b8565b610192604051918261233f565b81815261019e826124b8565b916020937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060208401940136853760005b82811061023257505050906040519283926020840190602085525180915260408401929160005b82811061020557505050500390f35b835173ffffffffffffffffffffffffffffffffffffffff16855286955093810193928101926001016101f6565b6001908260005273ffffffffffffffffffffffffffffffffffffffff817fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801541661027d82876125ea565b52016101cf565b346101445760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610144576102bb612426565b6102c3612c83565b73ffffffffffffffffffffffffffffffffffffffff8091169033821461033857817fffffffffffffffffffffffff00000000000000000000000000000000000000006000541617600055600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b60046040517fdad89dca000000000000000000000000000000000000000000000000000000008152fd5b346101445760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760ff600b54166104af576103a760043533612f10565b600181019081549060ff8260c01c1660028110156104805760011461045657780100000000000000000000000000000000000000000000000091817fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff92549060405191602083527f6a0ed88e9cf3cb493ab4028fcb1dc7d18f0130fcdfba096edde0aadbfbf5e99f63ffffffff8560a01c16938061044d3395600260208401910161268c565b0390a416179055005b60046040517f6f861db1000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60046040517f78a4e7d9000000000000000000000000000000000000000000000000000000008152fd5b34610144576104e7366123ae565b916104f0612c83565b60ff600b54166104af5782156105ce5760005b82811061059357505b60405191806040840160408552526060830191906000905b80821061055b5785151560208601527f509460cccbb176edde6cac28895a4415a24961b8f3a0bd2617b9bb7b4e166c9b85850386a1005b90919283359073ffffffffffffffffffffffffffffffffffffffff821680920361014457600191815260208091019401920190610524565b806105c773ffffffffffffffffffffffffffffffffffffffff6105c16105bc6001958888612b23565b612c62565b166130eb565b5001610503565b60005b8281106105de575061050c565b8061060d73ffffffffffffffffffffffffffffffffffffffff6106076105bc6001958888612b23565b1661331c565b50016105d1565b346101445761063461062536612449565b9161062e6124d0565b50612b44565b6000526004602052604060002073ffffffffffffffffffffffffffffffffffffffff600182015416156106855761066d61068191612740565b6040519182916020835260208301906121fc565b0390f35b60046040517f871e01b2000000000000000000000000000000000000000000000000000000008152fd5b346101445760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760443567ffffffffffffffff8111610144576106fe903690600401612380565b9060643567ffffffffffffffff81116101445761071f903690600401612380565b9160843567ffffffffffffffff811161014457610740903690600401612380565b60ff600b94929454166104af57610758818688612d78565b61076460043533612f10565b9163ffffffff600184015460a01c169561077e3388612cce565b8354946107b060405161079f816107988160038b0161268c565b038261233f565b6107aa368c856128f4565b90612f7f565b6107d26040516107c7816107988160048c0161268c565b6107aa3686886128f4565b6107f46040516107e9816107988160058d0161268c565b6107aa36898d6128f4565b918080610e63575b80610e5c575b610e3257610811602435612e68565b88600052600660205260406000207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008154169055602435885515610cdd575b15610b8c575b156108df575b926108ca7f41161473ce2ed633d9f902aab9702d16a5531da27ec84e1939abeffe54ad735395936108da936108bc6108ae978d604051998a996024358b5260a060208c0152600260a08c01910161268c565b9189830360408b01526129b7565b9186830360608801526129b7565b90838203608085015233976129b7565b0390a4005b6108ec6005860154612639565b610b25575b67ffffffffffffffff8411610af65761091a846109116005880154612639565b60058801612970565b6000601f85116001146109f6579284926108bc6108ca938a9b9c61099e876108ae9b9a6108da9a7f41161473ce2ed633d9f902aab9702d16a5531da27ec84e1939abeffe54ad73539e9f6000926109eb575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60058a01555b8c87806109c1575b50509c9b9a995093505092949550925061085c565b6109cb9133612b44565b60005260056020526109e3600435604060002061313d565b508c876109ac565b013590508f8061096c565b9860058601600052602060002060005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe087168110610ade5750926108bc6108ca936108da969388968c7f41161473ce2ed633d9f902aab9702d16a5531da27ec84e1939abeffe54ad73539c9d9e9f897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06108ae9e9d1610610aa6575b505050600187811b0160058a01556109a4565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88b60031b161c199101351690558e8d81610a93565b898c0135825560209b8c019b60019092019101610a06565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516020810190610b6b81610b3f60058a0133866129f6565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261233f565b5190206000526005602052610b8660043560406000206133e3565b506108f1565b67ffffffffffffffff8311610af657610bb583610bac6004890154612639565b60048901612970565b600083601f8111600114610c165780610c0192600091610c0b575b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b6004870155610856565b90508601358d610bd0565b506004870160005260206000209060005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086168110610cc55750847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610610c8d575b5050600183811b016004870155610856565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88660031b161c19908601351690558a80610c7b565b9091602060018192858a013581550193019101610c27565b67ffffffffffffffff8b11610af657610d068b610cfd60038a0154612639565b60038a01612970565b60008b601f8111600114610d665780610d5192600091610d5b57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b6003880155610850565b90508501358e610bd0565b506003880160005260206000209060005b8d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081168210610e19578091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610610de0575b905060018092501b016003880155610850565b60f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9160031b161c19908501351690558b808c610dcd565b5085820135835560019092019160209182019101610d77565b60046040517f6b4a810d000000000000000000000000000000000000000000000000000000008152fd5b5082610802565b50816107fc565b346101445760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457610681610eb4610ea7612426565b6044359060243590612b9f565b604051918291826122a0565b34610144576020610ed9610ed336612449565b91612b44565b604051908152f35b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457610f6a612c83565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600b5416600b557f11a03e25ee25bf1459f9e1cb293ea03707d84917f54a65e32c9a7be2f2edd68a6020604051338152a1005b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760005473ffffffffffffffffffffffffffffffffffffffff808216330361106a57600154917fffffffffffffffffffffffff0000000000000000000000000000000000000000903382851617600155166000553391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60046040517f02b543c6000000000000000000000000000000000000000000000000000000008152fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457600980546110d0816124b8565b6110dd604051918261233f565b8181526110e9826124b8565b916020937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060208401940136853760005b82811061116d57505050906040519283926020840190602085525180915260408401929160005b82811061115057505050500390f35b835163ffffffff1685528695509381019392810192600101611141565b6001908260005263ffffffff817f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0154166111a882876125ea565b520161111a565b34610144576111bd366123ae565b916111c6612c83565b60ff600b54166104af5782156112845760005b82811061125957505b60405191806040840160408552526060830191906000905b8082106112315785151560208601527fcab63bf31d1e656baa23cebef64e12033ea0ffbd44b1278c3747beec2d2f618c85850386a1005b90919283359063ffffffff8216809203610144576001918152602080910194019201906111fa565b8061127d63ffffffff6112776112726001958888612b23565b612b33565b16613032565b50016111d9565b60005b82811061129457506111e2565b806112b363ffffffff6112ad6112726001958888612b23565b166131c9565b5001611287565b346101445760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760ff600b54166104af576112ff60043533612f10565b6001810190815463ffffffff8160a01c1660ff8260c01c1660028110156104805715610456577fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff926113513383612cce565b80547f17b2d730bb5e064df3fbc6165c8aceb3b0d62c524c196c0bc1012209280bc9a6604051602081528061138e3395600260208401910161268c565b0390a4169055005b34610144576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610144576004359060ff600b54166104af576113de8233612f10565b916113f6336000526008602052604060002054151590565b156115425782600493546000526006835260406000207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905533600052600283526114488260406000206133e3565b50600181019063ffffffff80835460a01c166000526003855261146f8460406000206133e3565b506005820161147e8154612639565b61150e575b508154925460a01c16917f76ee2dfcae10cb8522e62e713e62660e09ecfaab08db15d9404de19141322571604051868152806114c6339560028a8401910161268c565b0390a46000525261150c6005604060002060008155600060018201556114ee60028201612ada565b6114fa60038201612ada565b61150660048201612ada565b01612ada565b005b60405161152381610b3f8982019433866129f6565b5190206000526005855261153b8460406000206133e3565b5086611483565b60246040517f85982a00000000000000000000000000000000000000000000000000000000008152336004820152fd5b346101445760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760043567ffffffffffffffff8111610144576115c1903690600401612380565b6044359163ffffffff8316830361014457600260643510156101445760843567ffffffffffffffff8111610144576115fd903690600401612380565b91909260a43567ffffffffffffffff811161014457611620903690600401612380565b60c43567ffffffffffffffff811161014457611640903690600401612380565b96909560ff600b54166104af57611657338a612cce565b8415611eba5760408511611e8257611670888483612d78565b61167b858733612b44565b80600052600460205273ffffffffffffffffffffffffffffffffffffffff60016040600020015416611e58576116b2602435612e68565b604051906116bf82612322565b602435825233602083015263ffffffff8b1660408301526116e56064356060840161262d565b6116f036888a6128f4565b60808301526117003684866128f4565b60a08301526117103686886128f4565b60c0830152611720368b8b6128f4565b60e0830152806000526004602052604060002091805183556001830173ffffffffffffffffffffffffffffffffffffffff60208301511681549077ffffffff0000000000000000000000000000000000000000604085015160a01b1690606085015160028110156104805778ff0000000000000000000000000000000000000000000000007fffffffffffffff000000000000000000000000000000000000000000000000009160c01b1693161717179055608081015180519067ffffffffffffffff8211610af657611803826117fa6002880154612639565b60028801612970565b602090601f8311600114611d8c57611850929160009183611cb55750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60028401555b60a081015180519067ffffffffffffffff8211610af6576118878261187e6003880154612639565b60038801612970565b602090601f8311600114611cc0576118d4929160009183611cb55750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60038401555b60c081015180519067ffffffffffffffff8211610af65761190b826119026004880154612639565b60048801612970565b602090601f8311600114611be857918061195c9260e09594600092611ac35750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b60048501555b015180519267ffffffffffffffff8411610af657838d926119948e9661198b6005860154612639565b60058601612970565b602090601f8311600114611ace579463ffffffff6108bc95819a957fc4399022965bad9b2b468bbd8c758a7e80cdde36ff3088ddbb7f93bdfb5623cb9f9e9d9994611a20876108da9f9b98600593611a849f9a600092611ac35750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790565b9101555b336000526002602052611a3b83604060002061313d565b50166000526003602052611a5381604060002061313d565b508d82611a9a575b5050506108ae6040519a8b9a611a738c606435612191565b60a060208d015260a08c01916129b7565b97838903608085015216963396602435966129b7565b611aba92611aa89133612b44565b6000526005602052604060002061313d565b508c8f8d611a5b565b01519050388061096c565b906005840160005260206000209160005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085168110611bbe57506108bc9563ffffffff9a957fc4399022965bad9b2b468bbd8c758a7e80cdde36ff3088ddbb7f93bdfb5623cb9f9e9d99946001876108da9f9b96928f9693611a849f9a94837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06005971610611b87575b505050811b01910155611a24565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388080611b79565b939550918194969750600160209291839285015181550194019201918f9492918f97969492611adf565b906004860160005260206000209160005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085168110611c9d5750918391600193837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060e098971610611c66575b505050811b016004850155611962565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690558f8080611c56565b91926020600181928685015181550194019201611bf9565b015190508f8061096c565b9190600386016000526020600020906000935b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084168510611d715760019450837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610611d3a575b505050811b0160038401556118da565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690558e8080611d2a565b81810151835560209485019460019093019290910190611cd3565b9190600286016000526020600020906000935b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084168510611e3d5760019450837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0811610611e06575b505050811b016002840155611856565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c191690558e8080611df6565b81810151835560209485019460019093019290910190611d9f565b60046040517fa0677dd0000000000000000000000000000000000000000000000000000000008152fd5b604485604051907f36a7c503000000000000000000000000000000000000000000000000000000008252600482015260406024820152fd5b60046040517f485b8ed4000000000000000000000000000000000000000000000000000000008152fd5b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457611f1b612c83565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600b541617600b557f2789711f6fd67d131ad68378617b5d1d21a2c92b34d7c3745d70b3957c08096c6020604051338152a1005b34610144576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760043567ffffffffffffffff811161014457611fc2903690600401612380565b60ff600b54166104af57611fd69133612b44565b9081600052600560205260406000209182549182156106855760005b838110611ffb57005b806120086001928761301a565b90549060031b1c60005260048352604060002063ffffffff8382015460a01c16600052600a8452604060002054151580612092575b612049575b5001611ff2565b7f95d94f817db4971aa99ba35d0fe019bd8cc39866fbe02b6d47b5f0f3727fb673604051868152604086820152806120893394600260408401910161268c565b0390a286612042565b506120aa336000526008602052604060002054151590565b61203d565b346101445760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261014457604051604081019080821067ffffffffffffffff831117610af65761068191604052601a81527f576f726b666c6f77526567697374727920312e302e302d646576000000000000602082015260405191829160208352602083019061219e565b346101445760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101445760043563ffffffff8116810361014457610eb46106819160443590602435906127ff565b9060028210156104805752565b919082519283825260005b8481106121e85750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b6020818301810151848301820152016121a9565b61229d9160e061228c61227a6122686101008651865273ffffffffffffffffffffffffffffffffffffffff602088015116602087015263ffffffff604088015116604087015261225460608801516060880190612191565b60808701519080608088015286019061219e565b60a086015185820360a087015261219e565b60c085015184820360c086015261219e565b9201519060e081840391015261219e565b90565b6020808201906020835283518092526040830192602060408460051b8301019501936000915b8483106122d65750505050505090565b9091929394958480612312837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a516121fc565b98019301930191949392906122c6565b610100810190811067ffffffffffffffff821117610af657604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610af657604052565b9181601f840112156101445782359167ffffffffffffffff8311610144576020838186019501011161014457565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101445760043567ffffffffffffffff9283821161014457806023830112156101445781600401359384116101445760248460051b8301011161014457602401919060243580151581036101445790565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361014457565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101445760043573ffffffffffffffffffffffffffffffffffffffff8116810361014457916024359067ffffffffffffffff8211610144576124b491600401612380565b9091565b67ffffffffffffffff8111610af65760051b60200190565b604051906124dd82612322565b606060e0836000815260006020820152600060408201526000838201528260808201528260a08201528260c08201520152565b6040516020810181811067ffffffffffffffff821117610af6576040526000815290565b9061253e826124b8565b61254b604051918261233f565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061257982946124b8565b019060005b82811061258a57505050565b6020906125956124d0565b8282850101520161257e565b919082018092116125ae57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919082039182116125ae57565b80518210156125fe5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60028210156104805752565b90600182811c92168015612682575b602083101461265357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691612648565b80546000939261269b82612639565b9182825260209360019160018116908160001461270357506001146126c2575b5050505050565b90939495506000929192528360002092846000945b8386106126ef575050505001019038808080806126bb565b8054858701830152940193859082016126d7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168685015250505090151560051b0101915038808080806126bb565b90600560e06040936127fb85519161275783612322565b6127f48397825485526127a160ff600185015473ffffffffffffffffffffffffffffffffffffffff8116602089015263ffffffff8160a01c168489015260c01c166060870161262d565b80516127b481610798816002880161268c565b608086015280516127cc81610798816003880161268c565b60a086015280516127e481610798816004880161268c565b60c086015251809681930161268c565b038461233f565b0152565b63ffffffff1691600083815260036020906003602052604093604084205490818710156128e4576128539181606489931180156128dc575b6128d4575b8161284782856125a1565b11156128c457506125dd565b9461285d86612534565b96845b87811061287257505050505050505090565b60019082875284865261289188882061288b83876125a1565b9061301a565b905490861b1c8752600486526128a8888820612740565b6128b2828c6125ea565b526128bd818b6125ea565b5001612860565b6128cf9150826125a1565b6125dd565b50606461283c565b508015612837565b505050505050505061229d612510565b92919267ffffffffffffffff8211610af6576040519161293c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461233f565b829481845281830111610144578281602093846000960137010152565b818110612964575050565b60008155600101612959565b9190601f811161297f57505050565b6129ab926000526020600020906020601f840160051c830193106129ad575b601f0160051c0190612959565b565b909150819061299e565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b91907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009060601b168252601490600092815492612a3284612639565b92600194600181169081600014612a995750600114612a54575b505050505090565b9091929395945060005260209460206000206000905b858210612a865750505050601492935001013880808080612a4c565b8054858301850152908701908201612a6a565b92505050601494507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091935016838301528015150201013880808080612a4c565b612ae48154612639565b9081612aee575050565b81601f60009311600114612b00575055565b908083918252612b1f601f60208420940160051c840160018501612959565b5555565b91908110156125fe5760051b0190565b3563ffffffff811681036101445790565b91906034612b9991836040519485927fffffffffffffffffffffffffffffffffffffffff000000000000000000000000602085019860601b16885284840137810160008382015203601481018452018261233f565b51902090565b73ffffffffffffffffffffffffffffffffffffffff169160008381526002926020906002602052604093604084205490818310156128e457612bf69181606485931180156128dc576128d4578161284782856125a1565b94612c0086612534565b96845b878110612c1557505050505050505090565b600190828752838652612c2e88882061288b83886125a1565b90549060031b1c875260048652612c46888820612740565b612c50828c6125ea565b52612c5b818b6125ea565b5001612c03565b3573ffffffffffffffffffffffffffffffffffffffff811681036101445790565b73ffffffffffffffffffffffffffffffffffffffff600154163303612ca457565b60046040517f2b5c74de000000000000000000000000000000000000000000000000000000008152fd5b63ffffffff1680600052600a60205260406000205415612d47575073ffffffffffffffffffffffffffffffffffffffff1680600052600860205260406000205415612d165750565b602490604051907f85982a000000000000000000000000000000000000000000000000000000000082526004820152fd5b602490604051907f8fe6d7e10000000000000000000000000000000000000000000000000000000082526004820152fd5b908115612e3e5760c891828111612e085750818111612dd35750808211612d9d575050565b60449250604051917ecd56a800000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b604491604051917ecd56a800000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b60449083604051917ecd56a800000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b60046040517f9cd963cf000000000000000000000000000000000000000000000000000000008152fd5b8015612ee65780600052600660205260ff60406000205416612ebc576000526006602052604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055565b60046040517f4cb050e4000000000000000000000000000000000000000000000000000000008152fd5b60046040517f7dc2f4e1000000000000000000000000000000000000000000000000000000008152fd5b90600052600460205260406000209073ffffffffffffffffffffffffffffffffffffffff806001840154169182156106855716809103612f4e575090565b602490604051907f31ee6dc70000000000000000000000000000000000000000000000000000000082526004820152fd5b9081518151908181149384612f96575b5050505090565b6020929394508201209201201438808080612f8f565b6009548110156125fe5760096000527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0190600090565b6007548110156125fe5760076000527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880190600090565b80548210156125fe5760005260206000200190600090565b6000818152600a60205260408120546130e657600954680100000000000000008110156130b95790826130a561307084600160409601600955612fac565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055600954928152600a6020522055600190565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b905090565b6000818152600860205260408120546130e657600754680100000000000000008110156130b957908261312961307084600160409601600755612fe3565b905560075492815260086020522055600190565b919060018301600090828252806020526040822054156000146131c357845494680100000000000000008610156131965783613186613070886001604098999a0185558461301a565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b6000818152600a60205260408120549091908015613317577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908181018181116132ea57600954908382019182116132bd57818103613289575b505050600954801561325c5781019061323b82612fac565b909182549160031b1b191690556009558152600a6020526040812055600190565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b6132a761329861307093612fac565b90549060031b1c928392612fac565b90558452600a6020526040842055388080613223565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b505090565b6000818152600860205260408120549091908015613317577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908181018181116132ea57600754908382019182116132bd578181036133af575b505050600754801561325c5781019061338e82612fe3565b909182549160031b1b19169055600755815260086020526040812055600190565b6133cd6133be61307093612fe3565b90549060031b1c928392612fe3565b9055845260086020526040842055388080613376565b90600182019060009281845282602052604084205490811515600014612f8f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91828101818111613508578254908482019182116134db578181036134a6575b505050805480156134795782019161345c838361301a565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b6134c66134b6613070938661301a565b90549060031b1c9283928661301a565b90558652846020526040862055388080613444565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fdfea164736f6c6343000818000a", } var WorkflowRegistryABI = WorkflowRegistryMetaData.ABI diff --git a/core/gethwrappers/workflow/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/workflow/generation/generated-wrapper-dependency-versions-do-not-edit.txt index a908ff2e724..afc0ccbefd9 100644 --- a/core/gethwrappers/workflow/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/workflow/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,2 +1,2 @@ GETH_VERSION: 1.14.11 -workflow_registry_wrapper: ../../../contracts/solc/v0.8.24/WorkflowRegistry/WorkflowRegistry.abi ../../../contracts/solc/v0.8.24/WorkflowRegistry/WorkflowRegistry.bin bad48df0196c8a170a8e5486d0334183defd60e74bd89d3885989e00d6f13d23 +workflow_registry_wrapper: ../../../contracts/solc/v0.8.24/WorkflowRegistry/WorkflowRegistry.abi ../../../contracts/solc/v0.8.24/WorkflowRegistry/WorkflowRegistry.bin 88356c4673d32f7d17b5e418d411a418a24ac972e6ec9cb740d8b731d6b9916a diff --git a/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go b/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go index 48b805295ff..aa2ef2c167c 100644 --- a/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go +++ b/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go @@ -120,6 +120,7 @@ func Test_EventHandlerStateSync(t *testing.T) { DonID: donID, Status: uint8(1), SecretsURL: "someurl", + BinaryURL: "someurl", } workflow.ID = workflowID registerWorkflow(t, backendTH, wfRegistryC, workflow) @@ -171,6 +172,7 @@ func Test_EventHandlerStateSync(t *testing.T) { DonID: donID, Status: uint8(1), SecretsURL: "", + BinaryURL: "someurl", } workflow.ID = workflowID @@ -246,6 +248,7 @@ func Test_InitialStateSync(t *testing.T) { DonID: donID, Status: uint8(1), SecretsURL: "someurl", + BinaryURL: "someurl", } workflow.ID = workflowID registerWorkflow(t, backendTH, wfRegistryC, workflow) @@ -301,6 +304,7 @@ func Test_SecretsWorker(t *testing.T) { DonID: donID, Status: uint8(1), SecretsURL: giveSecretsURL, + BinaryURL: "someurl", } giveContents = "contents" wantContents = "updated contents" From 32be20e7dc7c83812b74ededea2a1deb80802dd5 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami <167726375+b-gopalswami@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:29:05 -0500 Subject: [PATCH 63/91] CCIP-4753: Defining the timer based on test timeout (#15907) --- deployment/ccip/changeset/test_assertions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ccip/changeset/test_assertions.go b/deployment/ccip/changeset/test_assertions.go index eeb21d452a8..ba1b5fa4a88 100644 --- a/deployment/ccip/changeset/test_assertions.go +++ b/deployment/ccip/changeset/test_assertions.go @@ -486,7 +486,7 @@ func ConfirmExecWithSeqNrs( return nil, errors.New("no expected sequence numbers provided") } - timer := time.NewTimer(8 * time.Minute) + timer := time.NewTimer(tests.WaitTimeout(t)) defer timer.Stop() tick := time.NewTicker(3 * time.Second) defer tick.Stop() From eb855ea30fdcaab6849d2649ddf578ab8d8e5a83 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 15 Jan 2025 09:30:40 -0600 Subject: [PATCH 64/91] common/fee: consolidate package; rename fees (#15931) --- common/fee/types/fee.go | 15 --- common/fee/utils.go | 29 ----- common/{fee/models.go => fees/fees.go} | 37 +++++- common/txmgr/broadcaster.go | 17 ++- common/txmgr/confirmer.go | 13 +-- common/txmgr/mocks/tx_manager.go | 50 ++++----- common/txmgr/resender.go | 9 +- common/txmgr/tracker.go | 6 +- common/txmgr/txmgr.go | 10 +- common/txmgr/types/client.go | 6 +- .../txmgr/types/mocks/tx_attempt_builder.go | 80 ++++++------- common/txmgr/types/mocks/tx_store.go | 106 +++++++++--------- common/txmgr/types/stuck_tx_detector.go | 4 +- common/txmgr/types/tx.go | 6 +- common/txmgr/types/tx_attempt_builder.go | 9 +- common/txmgr/types/tx_store.go | 6 +- core/chains/evm/gas/arbitrum_estimator.go | 7 +- .../chains/evm/gas/block_history_estimator.go | 13 +-- .../evm/gas/block_history_estimator_test.go | 16 +-- core/chains/evm/gas/fee_history_estimator.go | 13 +-- .../evm/gas/fee_history_estimator_test.go | 4 +- core/chains/evm/gas/fixed_price_estimator.go | 9 +- core/chains/evm/gas/mocks/evm_estimator.go | 34 +++--- .../chains/evm/gas/mocks/evm_fee_estimator.go | 52 ++++----- core/chains/evm/gas/models.go | 37 +++--- core/chains/evm/gas/models_test.go | 6 +- .../evm/gas/suggested_price_estimator.go | 15 ++- core/chains/evm/txmgr/attempts.go | 7 +- core/chains/evm/txmgr/broadcaster_test.go | 5 +- core/chains/evm/txmgr/confirmer_test.go | 6 +- core/chains/evm/txmgr/stuck_tx_detector.go | 5 +- 31 files changed, 309 insertions(+), 323 deletions(-) delete mode 100644 common/fee/types/fee.go delete mode 100644 common/fee/utils.go rename common/{fee/models.go => fees/fees.go} (77%) diff --git a/common/fee/types/fee.go b/common/fee/types/fee.go deleted file mode 100644 index 2c03db5973f..00000000000 --- a/common/fee/types/fee.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -import ( - "fmt" -) - -// Opt is an option for a gas estimator -type Opt int - -const ( - // OptForceRefetch forces the estimator to bust a cache if necessary - OptForceRefetch Opt = iota -) - -type Fee fmt.Stringer diff --git a/common/fee/utils.go b/common/fee/utils.go deleted file mode 100644 index 3d4b001e839..00000000000 --- a/common/fee/utils.go +++ /dev/null @@ -1,29 +0,0 @@ -package fee - -import ( - "fmt" - "math" - "math/big" - - "github.com/shopspring/decimal" -) - -func ApplyMultiplier(feeLimit uint64, multiplier float32) (uint64, error) { - result := decimal.NewFromBigInt(big.NewInt(0).SetUint64(feeLimit), 0).Mul(decimal.NewFromFloat32(multiplier)) - - if result.GreaterThan(decimal.NewFromBigInt(big.NewInt(0).SetUint64(math.MaxUint64), 0)) { - return 0, fmt.Errorf("integer overflow when applying multiplier of %f to fee limit of %d", multiplier, feeLimit) - } - return result.BigInt().Uint64(), nil -} - -// Returns the input value increased by the given percentage. -func AddPercentage(value *big.Int, percentage uint16) *big.Int { - bumped := new(big.Int) - bumped.Mul(value, big.NewInt(int64(100+percentage))) - bumped.Div(bumped, big.NewInt(100)) - return bumped -} - -// Returns the fee in its chain specific unit. -type feeUnitToChainUnit func(fee *big.Int) string diff --git a/common/fee/models.go b/common/fees/fees.go similarity index 77% rename from common/fee/models.go rename to common/fees/fees.go index 0cc479d3560..84504eeee13 100644 --- a/common/fee/models.go +++ b/common/fees/fees.go @@ -1,15 +1,48 @@ -package fee +package fees import ( "errors" "fmt" + "math" "math/big" + "github.com/shopspring/decimal" + "github.com/smartcontractkit/chainlink-common/pkg/chains/label" "github.com/smartcontractkit/chainlink-common/pkg/logger" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" ) +// Opt is an option for a gas estimator +type Opt int + +const ( + // OptForceRefetch forces the estimator to bust a cache if necessary + OptForceRefetch Opt = iota +) + +type Fee fmt.Stringer + +func ApplyMultiplier(feeLimit uint64, multiplier float32) (uint64, error) { + result := decimal.NewFromBigInt(big.NewInt(0).SetUint64(feeLimit), 0).Mul(decimal.NewFromFloat32(multiplier)) + + if result.GreaterThan(decimal.NewFromBigInt(big.NewInt(0).SetUint64(math.MaxUint64), 0)) { + return 0, fmt.Errorf("integer overflow when applying multiplier of %f to fee limit of %d", multiplier, feeLimit) + } + return result.BigInt().Uint64(), nil +} + +// AddPercentage returns the input value increased by the given percentage. +func AddPercentage(value *big.Int, percentage uint16) *big.Int { + bumped := new(big.Int) + bumped.Mul(value, big.NewInt(int64(100+percentage))) + bumped.Div(bumped, big.NewInt(100)) + return bumped +} + +// Returns the fee in its chain specific unit. +type feeUnitToChainUnit func(fee *big.Int) string + var ( ErrBumpFeeExceedsLimit = errors.New("fee bump exceeds limit") ErrBump = errors.New("fee bump failed") @@ -61,7 +94,7 @@ func CalculateBumpedFee( return bumpedFeePrice, nil } -// Returns highest bumped fee price of originalFeePrice bumped by fixed units or percentage. +// MaxBumpedFee returns highest bumped fee price of originalFeePrice bumped by fixed units or percentage. func MaxBumpedFee(originalFeePrice *big.Int, feeBumpPercent uint16, feeBumpUnits *big.Int) *big.Int { return bigmath.Max( AddPercentage(originalFeePrice, feeBumpPercent), diff --git a/common/txmgr/broadcaster.go b/common/txmgr/broadcaster.go index 41ec0f644b4..6174c1ed482 100644 --- a/common/txmgr/broadcaster.go +++ b/common/txmgr/broadcaster.go @@ -20,8 +20,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-framework/multinode" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -70,7 +69,7 @@ type TransmitCheckerFactory[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] interface { // BuildChecker builds a new TransmitChecker based on the given spec. BuildChecker(spec txmgrtypes.TransmitCheckerSpec[ADDR]) (TransmitChecker[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) @@ -82,7 +81,7 @@ type TransmitChecker[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] interface { // Check the given transaction. If the transaction should not be sent, an error indicating why @@ -112,7 +111,7 @@ type Broadcaster[ TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { services.StateMachine lggr logger.SugaredLogger @@ -158,7 +157,7 @@ func NewBroadcaster[ TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ]( txStore txmgrtypes.TransactionStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, SEQ, FEE], client txmgrtypes.TransactionClient[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], @@ -436,8 +435,8 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand attempt, _, _, retryable, err := eb.NewTxAttempt(ctx, *etx, eb.lggr) // Mark transaction as fatal if provided gas limit is set too low - if errors.Is(err, commonfee.ErrFeeLimitTooLow) { - etx.Error = null.StringFrom(commonfee.ErrFeeLimitTooLow.Error()) + if errors.Is(err, fees.ErrFeeLimitTooLow) { + etx.Error = null.StringFrom(fees.ErrFeeLimitTooLow.Error()) return eb.saveFatallyErroredTransaction(eb.lggr, etx), false } else if err != nil { return fmt.Errorf("processUnstartedTxs failed on NewAttempt: %w", err), retryable @@ -722,7 +721,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) repl // replaceAttemptWithNewEstimation performs the replacement of the existing tx attempt with a new estimated fee attempt. func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) replaceAttemptWithNewEstimation(ctx context.Context, lgr logger.Logger, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) (updatedAttempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryable bool, err error) { - newEstimatedAttempt, fee, feeLimit, retryable, err := eb.NewTxAttemptWithType(ctx, etx, lgr, attempt.TxType, feetypes.OptForceRefetch) + newEstimatedAttempt, fee, feeLimit, retryable, err := eb.NewTxAttemptWithType(ctx, etx, lgr, attempt.TxType, fees.OptForceRefetch) if err != nil { return &newEstimatedAttempt, retryable, err } diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index 54905340cbb..7dd3be6b4ae 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -22,8 +22,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" "github.com/smartcontractkit/chainlink-framework/multinode" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -90,7 +89,7 @@ type Confirmer[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { services.StateMachine txStore txmgrtypes.TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] @@ -123,7 +122,7 @@ func NewConfirmer[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ]( txStore txmgrtypes.TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE], client txmgrtypes.TxmClient[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE], @@ -634,7 +633,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) att } attempt, err = ec.bumpGas(ctx, etx, etx.TxAttempts) - if commonfee.IsBumpErr(err) { + if fees.IsBumpErr(err) { lggr.Errorw("Failed to bump gas", append(logFields, "err", err)...) // Do not create a new attempt if bumping gas would put us over the limit or cause some other problem // Instead try to resubmit the previous attempt, and keep resubmitting until its accepted @@ -678,7 +677,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) bum return bumpedAttempt, err } - if errors.Is(err, commonfee.ErrBumpFeeExceedsLimit) { + if errors.Is(err, fees.ErrBumpFeeExceedsLimit) { promGasBumpExceedsLimit.WithLabelValues(ec.chainID.String()).Inc() } @@ -866,7 +865,7 @@ func observeUntilTxConfirmed[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ](chainID CHAIN_ID, attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], head types.Head[BLOCK_HASH]) { for _, attempt := range attempts { // We estimate the time until confirmation by subtracting from the time the tx (not the attempt) diff --git a/common/txmgr/mocks/tx_manager.go b/common/txmgr/mocks/tx_manager.go index 4e4c2f17bec..04a2c69d7c2 100644 --- a/common/txmgr/mocks/tx_manager.go +++ b/common/txmgr/mocks/tx_manager.go @@ -6,7 +6,7 @@ import ( context "context" big "math/big" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + fees "github.com/smartcontractkit/chainlink/v2/common/fees" mock "github.com/stretchr/testify/mock" null "gopkg.in/guregu/null.v4" @@ -21,11 +21,11 @@ import ( ) // TxManager is an autogenerated mock type for the TxManager type -type TxManager[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { mock.Mock } -type TxManager_Expecter[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Expecter[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { mock *mock.Mock } @@ -52,7 +52,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close( } // TxManager_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type TxManager_Close_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Close_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -107,7 +107,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CountT } // TxManager_CountTransactionsByState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountTransactionsByState' -type TxManager_CountTransactionsByState_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_CountTransactionsByState_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -164,7 +164,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Create } // TxManager_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' -type TxManager_CreateTransaction_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_CreateTransaction_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -221,7 +221,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEa } // TxManager_FindEarliestUnconfirmedBroadcastTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedBroadcastTime' -type TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -277,7 +277,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEa } // TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedTxAttemptBlock' -type TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -335,7 +335,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx } // TxManager_FindTxesByMetaFieldAndStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesByMetaFieldAndStates' -type TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -397,7 +397,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx } // TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithAttemptsAndReceiptsByIdsAndState' -type TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -458,7 +458,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx } // TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByReceiptBlockNum' -type TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -519,7 +519,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx } // TxManager_FindTxesWithMetaFieldByStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByStates' -type TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -580,7 +580,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetFor } // TxManager_GetForwarderForEOA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForwarderForEOA' -type TxManager_GetForwarderForEOA_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_GetForwarderForEOA_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -639,7 +639,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetFor } // TxManager_GetForwarderForEOAOCR2Feeds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForwarderForEOAOCR2Feeds' -type TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -697,7 +697,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetTra } // TxManager_GetTransactionStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionStatus' -type TxManager_GetTransactionStatus_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_GetTransactionStatus_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -746,7 +746,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Health } // TxManager_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' -type TxManager_HealthReport_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_HealthReport_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -791,7 +791,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() } // TxManager_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type TxManager_Name_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Name_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -823,7 +823,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) OnNewL } // TxManager_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' -type TxManager_OnNewLongestChain_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_OnNewLongestChain_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -870,7 +870,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready( } // TxManager_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' -type TxManager_Ready_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Ready_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -902,7 +902,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Regist } // TxManager_RegisterResumeCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterResumeCallback' -type TxManager_RegisterResumeCallback_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_RegisterResumeCallback_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -948,7 +948,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Reset( } // TxManager_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset' -type TxManager_Reset_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Reset_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1005,7 +1005,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNa } // TxManager_SendNativeToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendNativeToken' -type TxManager_SendNativeToken_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_SendNativeToken_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1056,7 +1056,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start( } // TxManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type TxManager_Start_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Start_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1089,7 +1089,7 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Trigge } // TxManager_Trigger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Trigger' -type TxManager_Trigger_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxManager_Trigger_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1118,7 +1118,7 @@ func (_c *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, // NewTxManager creates a new instance of TxManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewTxManager[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee](t interface { +func NewTxManager[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee](t interface { mock.TestingT Cleanup(func()) }) *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { diff --git a/common/txmgr/resender.go b/common/txmgr/resender.go index 6b65ca05923..16d39763cd3 100644 --- a/common/txmgr/resender.go +++ b/common/txmgr/resender.go @@ -10,7 +10,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-framework/multinode" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -42,7 +43,7 @@ type Resender[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { txStore txmgrtypes.TransactionStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, SEQ, FEE] client txmgrtypes.TransactionClient[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] @@ -66,7 +67,7 @@ func NewResender[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ]( lggr logger.Logger, txStore txmgrtypes.TransactionStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, SEQ, FEE], @@ -217,7 +218,7 @@ func findOldestUnconfirmedAttempt[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ](attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], bool) { var oldestAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] if len(attempts) < 1 { diff --git a/common/txmgr/tracker.go b/common/txmgr/tracker.go index 408ae62173a..6c2d586548f 100644 --- a/common/txmgr/tracker.go +++ b/common/txmgr/tracker.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -39,7 +39,7 @@ type Tracker[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { services.StateMachine txStore txmgrtypes.TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] @@ -67,7 +67,7 @@ func NewTracker[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ]( txStore txmgrtypes.TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE], keyStore txmgrtypes.KeyStore[ADDR, CHAIN_ID, SEQ], diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index 55498911b85..20d872efd20 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -17,7 +17,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/headtracker" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" @@ -40,7 +40,7 @@ type TxManager[ TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] interface { headtracker.HeadTrackable[HEAD, BLOCK_HASH] services.Service @@ -82,7 +82,7 @@ type Txm[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { services.StateMachine logger logger.SugaredLogger @@ -130,7 +130,7 @@ func NewTxm[ BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ]( chainId CHAIN_ID, cfg txmgrtypes.TransactionManagerChainConfig, @@ -682,7 +682,7 @@ type NullTxManager[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { ErrMsg string } diff --git a/common/txmgr/types/client.go b/common/txmgr/types/client.go index 67426437c8a..610f503c5b5 100644 --- a/common/txmgr/types/client.go +++ b/common/txmgr/types/client.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-framework/multinode" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -21,7 +21,7 @@ type TxmClient[ BLOCK_HASH types.Hashable, R ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] interface { ChainClient[CHAIN_ID, ADDR, SEQ] TransactionClient[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] @@ -40,7 +40,7 @@ type TransactionClient[ TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] interface { ChainClient[CHAIN_ID, ADDR, SEQ] diff --git a/common/txmgr/types/mocks/tx_attempt_builder.go b/common/txmgr/types/mocks/tx_attempt_builder.go index d20b8249050..ddc09f3b2dd 100644 --- a/common/txmgr/types/mocks/tx_attempt_builder.go +++ b/common/txmgr/types/mocks/tx_attempt_builder.go @@ -6,7 +6,7 @@ import ( context "context" logger "github.com/smartcontractkit/chainlink-common/pkg/logger" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + fees "github.com/smartcontractkit/chainlink/v2/common/fees" mock "github.com/stretchr/testify/mock" @@ -16,11 +16,11 @@ import ( ) // TxAttemptBuilder is an autogenerated mock type for the TxAttemptBuilder type -type TxAttemptBuilder[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { mock.Mock } -type TxAttemptBuilder_Expecter[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_Expecter[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { mock *mock.Mock } @@ -47,7 +47,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type TxAttemptBuilder_Close_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_Close_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -94,7 +94,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' -type TxAttemptBuilder_HealthReport_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_HealthReport_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -139,7 +139,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' -type TxAttemptBuilder_Name_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_Name_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -217,7 +217,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_NewBumpTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBumpTxAttempt' -type TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -284,7 +284,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_NewCustomTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCustomTxAttempt' -type TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -345,7 +345,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_NewEmptyTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewEmptyTxAttempt' -type TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -405,7 +405,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_NewPurgeTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPurgeTxAttempt' -type TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -435,7 +435,7 @@ func (_c *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, } // NewTxAttempt provides a mock function with given fields: ctx, tx, lggr, opts -func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttempt(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { +func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttempt(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...fees.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -454,16 +454,16 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) var r2 uint64 var r3 bool var r4 error - if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)); ok { return rf(ctx, tx, lggr, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { r0 = rf(ctx, tx, lggr, opts...) } else { r0 = ret.Get(0).(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } - if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) FEE); ok { + if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) FEE); ok { r1 = rf(ctx, tx, lggr, opts...) } else { if ret.Get(1) != nil { @@ -471,19 +471,19 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) uint64); ok { + if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) uint64); ok { r2 = rf(ctx, tx, lggr, opts...) } else { r2 = ret.Get(2).(uint64) } - if rf, ok := ret.Get(3).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) bool); ok { + if rf, ok := ret.Get(3).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) bool); ok { r3 = rf(ctx, tx, lggr, opts...) } else { r3 = ret.Get(3).(bool) } - if rf, ok := ret.Get(4).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) error); ok { + if rf, ok := ret.Get(4).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) error); ok { r4 = rf(ctx, tx, lggr, opts...) } else { r4 = ret.Error(4) @@ -493,7 +493,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_NewTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewTxAttempt' -type TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -501,18 +501,18 @@ type TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK // - ctx context.Context // - tx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] // - lggr logger.Logger -// - opts ...feetypes.Opt +// - opts ...fees.Opt func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttempt(ctx interface{}, tx interface{}, lggr interface{}, opts ...interface{}) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { return &TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewTxAttempt", append([]interface{}{ctx, tx, lggr}, opts...)...)} } -func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...feetypes.Opt)) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { +func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...fees.Opt)) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]feetypes.Opt, len(args)-3) + variadicArgs := make([]fees.Opt, len(args)-3) for i, a := range args[3:] { if a != nil { - variadicArgs[i] = a.(feetypes.Opt) + variadicArgs[i] = a.(fees.Opt) } } run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(logger.Logger), variadicArgs...) @@ -525,13 +525,13 @@ func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOC return _c } -func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { +func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...fees.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { _c.Call.Return(run) return _c } // NewTxAttemptWithType provides a mock function with given fields: ctx, tx, lggr, txType, opts -func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttemptWithType(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { +func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttemptWithType(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...fees.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -550,16 +550,16 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) var r2 uint64 var r3 bool var r4 error - if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)); ok { return rf(ctx, tx, lggr, txType, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { r0 = rf(ctx, tx, lggr, txType, opts...) } else { r0 = ret.Get(0).(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } - if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) FEE); ok { + if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) FEE); ok { r1 = rf(ctx, tx, lggr, txType, opts...) } else { if ret.Get(1) != nil { @@ -567,19 +567,19 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) uint64); ok { + if rf, ok := ret.Get(2).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) uint64); ok { r2 = rf(ctx, tx, lggr, txType, opts...) } else { r2 = ret.Get(2).(uint64) } - if rf, ok := ret.Get(3).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) bool); ok { + if rf, ok := ret.Get(3).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) bool); ok { r3 = rf(ctx, tx, lggr, txType, opts...) } else { r3 = ret.Get(3).(bool) } - if rf, ok := ret.Get(4).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) error); ok { + if rf, ok := ret.Get(4).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) error); ok { r4 = rf(ctx, tx, lggr, txType, opts...) } else { r4 = ret.Error(4) @@ -589,7 +589,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_NewTxAttemptWithType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewTxAttemptWithType' -type TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -598,18 +598,18 @@ type TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID types.ID, HEAD types.He // - tx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] // - lggr logger.Logger // - txType int -// - opts ...feetypes.Opt +// - opts ...fees.Opt func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttemptWithType(ctx interface{}, tx interface{}, lggr interface{}, txType interface{}, opts ...interface{}) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { return &TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewTxAttemptWithType", append([]interface{}{ctx, tx, lggr, txType}, opts...)...)} } -func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...feetypes.Opt)) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { +func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...fees.Opt)) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]feetypes.Opt, len(args)-4) + variadicArgs := make([]fees.Opt, len(args)-4) for i, a := range args[4:] { if a != nil { - variadicArgs[i] = a.(feetypes.Opt) + variadicArgs[i] = a.(fees.Opt) } } run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(logger.Logger), args[3].(int), variadicArgs...) @@ -622,7 +622,7 @@ func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HA return _c } -func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { +func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...fees.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { _c.Call.Return(run) return _c } @@ -633,7 +633,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' -type TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -680,7 +680,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' -type TxAttemptBuilder_Ready_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_Ready_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -725,7 +725,7 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } // TxAttemptBuilder_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type TxAttemptBuilder_Start_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxAttemptBuilder_Start_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -754,7 +754,7 @@ func (_c *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, // NewTxAttemptBuilder creates a new instance of TxAttemptBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewTxAttemptBuilder[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee](t interface { +func NewTxAttemptBuilder[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE fees.Fee](t interface { mock.TestingT Cleanup(func()) }) *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { diff --git a/common/txmgr/types/mocks/tx_store.go b/common/txmgr/types/mocks/tx_store.go index 0c3b4d93258..29e67c6165f 100644 --- a/common/txmgr/types/mocks/tx_store.go +++ b/common/txmgr/types/mocks/tx_store.go @@ -6,7 +6,7 @@ import ( context "context" big "math/big" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + fees "github.com/smartcontractkit/chainlink/v2/common/fees" mock "github.com/stretchr/testify/mock" null "gopkg.in/guregu/null.v4" @@ -21,11 +21,11 @@ import ( ) // TxStore is an autogenerated mock type for the TxStore type -type TxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { mock.Mock } -type TxStore_Expecter[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_Expecter[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { mock *mock.Mock } @@ -52,7 +52,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(ctx } // TxStore_Abandon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Abandon' -type TxStore_Abandon_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_Abandon_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -100,7 +100,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckTxQueu } // TxStore_CheckTxQueueCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTxQueueCapacity' -type TxStore_CheckTxQueueCapacity_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_CheckTxQueueCapacity_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -136,7 +136,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Close() { } // TxStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type TxStore_Close_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_Close_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -191,7 +191,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountTransa } // TxStore_CountTransactionsByState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountTransactionsByState' -type TxStore_CountTransactionsByState_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_CountTransactionsByState_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -249,7 +249,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconf } // TxStore_CountUnconfirmedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountUnconfirmedTransactions' -type TxStore_CountUnconfirmedTransactions_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_CountUnconfirmedTransactions_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -307,7 +307,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstar } // TxStore_CountUnstartedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountUnstartedTransactions' -type TxStore_CountUnstartedTransactions_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_CountUnstartedTransactions_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -365,7 +365,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTrans } // TxStore_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' -type TxStore_CreateTransaction_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_CreateTransaction_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -413,7 +413,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) DeleteInPro } // TxStore_DeleteInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInProgressAttempt' -type TxStore_DeleteInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_DeleteInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -470,7 +470,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarlies } // TxStore_FindEarliestUnconfirmedBroadcastTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedBroadcastTime' -type TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -527,7 +527,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarlies } // TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedTxAttemptBlock' -type TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -586,7 +586,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindLatestS } // TxStore_FindLatestSequence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindLatestSequence' -type TxStore_FindLatestSequence_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindLatestSequence_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -646,7 +646,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindNextUns } // TxStore_FindNextUnstartedTransactionFromAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindNextUnstartedTransactionFromAddress' -type TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -715,7 +715,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindReorgOr } // TxStore_FindReorgOrIncludedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindReorgOrIncludedTxs' -type TxStore_FindReorgOrIncludedTxs_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindReorgOrIncludedTxs_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -776,7 +776,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem } // TxStore_FindTxAttemptsConfirmedMissingReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsConfirmedMissingReceipt' -type TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -835,7 +835,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem } // TxStore_FindTxAttemptsRequiringResend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsRequiringResend' -type TxStore_FindTxAttemptsRequiringResend_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxAttemptsRequiringResend_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -897,7 +897,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithI } // TxStore_FindTxWithIdempotencyKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithIdempotencyKey' -type TxStore_FindTxWithIdempotencyKey_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxWithIdempotencyKey_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -957,7 +957,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithS } // TxStore_FindTxWithSequence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithSequence' -type TxStore_FindTxWithSequence_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxWithSequence_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1017,7 +1017,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesByM } // TxStore_FindTxesByMetaFieldAndStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesByMetaFieldAndStates' -type TxStore_FindTxesByMetaFieldAndStates_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxesByMetaFieldAndStates_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1079,7 +1079,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesPen } // TxStore_FindTxesPendingCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesPendingCallback' -type TxStore_FindTxesPendingCallback_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxesPendingCallback_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1140,7 +1140,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWit } // TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithAttemptsAndReceiptsByIdsAndState' -type TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1201,7 +1201,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWit } // TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByReceiptBlockNum' -type TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1262,7 +1262,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWit } // TxStore_FindTxesWithMetaFieldByStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByStates' -type TxStore_FindTxesWithMetaFieldByStates_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxesWithMetaFieldByStates_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1323,7 +1323,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequ } // TxStore_FindTxsRequiringGasBump_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsRequiringGasBump' -type TxStore_FindTxsRequiringGasBump_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxsRequiringGasBump_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1386,7 +1386,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequ } // TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsRequiringResubmissionDueToInsufficientFunds' -type TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1446,7 +1446,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetAbandone } // TxStore_GetAbandonedTransactionsByBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAbandonedTransactionsByBatch' -type TxStore_GetAbandonedTransactionsByBatch_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_GetAbandonedTransactionsByBatch_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1508,7 +1508,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetInProgre } // TxStore_GetInProgressTxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInProgressTxAttempts' -type TxStore_GetInProgressTxAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_GetInProgressTxAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1568,7 +1568,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxByID(c } // TxStore_GetTxByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxByID' -type TxStore_GetTxByID_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_GetTxByID_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1627,7 +1627,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProg } // TxStore_GetTxInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxInProgress' -type TxStore_GetTxInProgress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_GetTxInProgress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1684,7 +1684,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgre } // TxStore_HasInProgressTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasInProgressTransaction' -type TxStore_HasInProgressTransaction_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_HasInProgressTransaction_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1732,7 +1732,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) LoadTxAttem } // TxStore_LoadTxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadTxAttempts' -type TxStore_LoadTxAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_LoadTxAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1779,7 +1779,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes } // TxStore_PreloadTxes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PreloadTxes' -type TxStore_PreloadTxes_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_PreloadTxes_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1838,7 +1838,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstar } // TxStore_PruneUnstartedTxQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneUnstartedTxQueue' -type TxStore_PruneUnstartedTxQueue_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_PruneUnstartedTxQueue_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1886,7 +1886,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHisto } // TxStore_ReapTxHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReapTxHistory' -type TxStore_ReapTxHistory_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_ReapTxHistory_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1934,7 +1934,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveConfirm } // TxStore_SaveConfirmedAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveConfirmedAttempt' -type TxStore_SaveConfirmedAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SaveConfirmedAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -1983,7 +1983,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetched } // TxStore_SaveFetchedReceipts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveFetchedReceipts' -type TxStore_SaveFetchedReceipts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SaveFetchedReceipts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2030,7 +2030,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgr } // TxStore_SaveInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveInProgressAttempt' -type TxStore_SaveInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SaveInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2077,7 +2077,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsuffi } // TxStore_SaveInsufficientFundsAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveInsufficientFundsAttempt' -type TxStore_SaveInsufficientFundsAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SaveInsufficientFundsAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2126,7 +2126,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplace } // TxStore_SaveReplacementInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveReplacementInProgressAttempt' -type TxStore_SaveReplacementInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SaveReplacementInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2174,7 +2174,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAtt } // TxStore_SaveSentAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveSentAttempt' -type TxStore_SaveSentAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SaveSentAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2223,7 +2223,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcas } // TxStore_SetBroadcastBeforeBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBroadcastBeforeBlockNum' -type TxStore_SetBroadcastBeforeBlockNum_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_SetBroadcastBeforeBlockNum_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2271,7 +2271,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateBroad } // TxStore_UpdateBroadcastAts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBroadcastAts' -type TxStore_UpdateBroadcastAts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateBroadcastAts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2319,7 +2319,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxAtt } // TxStore_UpdateTxAttemptInProgressToBroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxAttemptInProgressToBroadcast' -type TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2368,7 +2368,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxCal } // TxStore_UpdateTxCallbackCompleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxCallbackCompleted' -type TxStore_UpdateTxCallbackCompleted_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxCallbackCompleted_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2416,7 +2416,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxCon } // TxStore_UpdateTxConfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxConfirmed' -type TxStore_UpdateTxConfirmed_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxConfirmed_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2463,7 +2463,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFat } // TxStore_UpdateTxFatalError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxFatalError' -type TxStore_UpdateTxFatalError_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxFatalError_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2511,7 +2511,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFat } // TxStore_UpdateTxFatalErrorAndDeleteAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxFatalErrorAndDeleteAttempts' -type TxStore_UpdateTxFatalErrorAndDeleteAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxFatalErrorAndDeleteAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2558,7 +2558,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUns } // TxStore_UpdateTxUnstartedToInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxUnstartedToInProgress' -type TxStore_UpdateTxUnstartedToInProgress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxUnstartedToInProgress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2606,7 +2606,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsFo } // TxStore_UpdateTxsForRebroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxsForRebroadcast' -type TxStore_UpdateTxsForRebroadcast_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxsForRebroadcast_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2654,7 +2654,7 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsUn } // TxStore_UpdateTxsUnconfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxsUnconfirmed' -type TxStore_UpdateTxsUnconfirmed_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { +type TxStore_UpdateTxsUnconfirmed_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee] struct { *mock.Call } @@ -2684,7 +2684,7 @@ func (_c *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, // NewTxStore creates a new instance of TxStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewTxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee](t interface { +func NewTxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE fees.Fee](t interface { mock.TestingT Cleanup(func()) }) *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { diff --git a/common/txmgr/types/stuck_tx_detector.go b/common/txmgr/types/stuck_tx_detector.go index dc09eea9807..dcc7e7a027b 100644 --- a/common/txmgr/types/stuck_tx_detector.go +++ b/common/txmgr/types/stuck_tx_detector.go @@ -3,7 +3,7 @@ package types import ( "context" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -13,7 +13,7 @@ type StuckTxDetector[ ADDR types.Hashable, // ADDR - chain address type TX_HASH, BLOCK_HASH types.Hashable, // various chain hash types SEQ types.Sequence, // SEQ - chain sequence type (nonce, utxo, etc) - FEE feetypes.Fee, // FEE - chain fee type + FEE fees.Fee, // FEE - chain fee type ] interface { // Uses either a chain specific API or heuristic to determine if any unconfirmed transactions are terminally stuck. Returns only one transaction per enabled address. DetectStuckTransactions(ctx context.Context, enabledAddresses []ADDR, blockNum int64) ([]Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) diff --git a/common/txmgr/types/tx.go b/common/txmgr/types/tx.go index b0bc2ca7025..b32e688fe50 100644 --- a/common/txmgr/types/tx.go +++ b/common/txmgr/types/tx.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" clnull "github.com/smartcontractkit/chainlink-common/pkg/utils/null" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -170,7 +170,7 @@ type TxAttempt[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { ID int64 TxID int64 @@ -197,7 +197,7 @@ type Tx[ ADDR types.Hashable, TX_HASH, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] struct { ID int64 IdempotencyKey *string diff --git a/common/txmgr/types/tx_attempt_builder.go b/common/txmgr/types/tx_attempt_builder.go index 44443e78211..acb93e9fc18 100644 --- a/common/txmgr/types/tx_attempt_builder.go +++ b/common/txmgr/types/tx_attempt_builder.go @@ -5,7 +5,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/headtracker" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -19,17 +20,17 @@ type TxAttemptBuilder[ ADDR types.Hashable, // ADDR - chain address type TX_HASH, BLOCK_HASH types.Hashable, // various chain hash types SEQ types.Sequence, // SEQ - chain sequence type (nonce, utxo, etc) - FEE feetypes.Fee, // FEE - chain fee type + FEE fees.Fee, // FEE - chain fee type ] interface { // interfaces for running the underlying estimator services.Service headtracker.HeadTrackable[HEAD, BLOCK_HASH] // NewTxAttempt builds a transaction using the configured transaction type and fee estimator (new estimation) - NewTxAttempt(ctx context.Context, tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...feetypes.Opt) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, feeLimit uint64, retryable bool, err error) + NewTxAttempt(ctx context.Context, tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...fees.Opt) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, feeLimit uint64, retryable bool, err error) // NewTxAttemptWithType builds a transaction using the configured fee estimator (new estimation) + passed in tx type - NewTxAttemptWithType(ctx context.Context, tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...feetypes.Opt) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, feeLimit uint64, retryable bool, err error) + NewTxAttemptWithType(ctx context.Context, tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...fees.Opt) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, feeLimit uint64, retryable bool, err error) // NewBumpTxAttempt builds a transaction using the configured fee estimator (bumping) + tx type from previous attempt // this should only be used after an initial attempt has been broadcast and the underlying gas estimator only needs to bump the fee diff --git a/common/txmgr/types/tx_store.go b/common/txmgr/types/tx_store.go index d685a6c5ce7..9a7e3736429 100644 --- a/common/txmgr/types/tx_store.go +++ b/common/txmgr/types/tx_store.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "gopkg.in/guregu/null.v4" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -27,7 +27,7 @@ type TxStore[ // Represents the sequence type for a chain. For example, nonce for EVM. SEQ types.Sequence, // Represents the chain specific fee type - FEE feetypes.Fee, + FEE fees.Fee, ] interface { UnstartedTxQueuePruner TxHistoryReaper[CHAIN_ID] @@ -61,7 +61,7 @@ type TransactionStore[ TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, - FEE feetypes.Fee, + FEE fees.Fee, ] interface { CountUnconfirmedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (count uint32, err error) CountTransactionsByState(ctx context.Context, state TxState, chainID CHAIN_ID) (count uint32, err error) diff --git a/core/chains/evm/gas/arbitrum_estimator.go b/core/chains/evm/gas/arbitrum_estimator.go index 6a11932878b..a53760e45e6 100644 --- a/core/chains/evm/gas/arbitrum_estimator.go +++ b/core/chains/evm/gas/arbitrum_estimator.go @@ -11,7 +11,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" ) @@ -96,14 +97,14 @@ func (a *arbitrumEstimator) HealthReport() map[string]error { // - Limit is computed from the dynamic values perL2Tx and perL1CalldataUnit, provided by the getPricesInArbGas() method // of the precompilie contract at ArbGasInfoAddress. perL2Tx is a constant amount of gas, and perL1CalldataUnit is // multiplied by the length of the tx calldata. The sum of these two values plus the original l2GasLimit is returned. -func (a *arbitrumEstimator) GetLegacyGas(ctx context.Context, calldata []byte, l2GasLimit uint64, maxGasPriceWei *assets.Wei, opts ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { +func (a *arbitrumEstimator) GetLegacyGas(ctx context.Context, calldata []byte, l2GasLimit uint64, maxGasPriceWei *assets.Wei, opts ...fees.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { gasPrice, _, err = a.EvmEstimator.GetLegacyGas(ctx, calldata, l2GasLimit, maxGasPriceWei, opts...) if err != nil { return } gasPrice = a.gasPriceWithBuffer(gasPrice, maxGasPriceWei) ok := a.IfStarted(func() { - if slices.Contains(opts, feetypes.OptForceRefetch) { + if slices.Contains(opts, fees.OptForceRefetch) { ch := make(chan struct{}) select { case a.chForceRefetch <- ch: diff --git a/core/chains/evm/gas/block_history_estimator.go b/core/chains/evm/gas/block_history_estimator.go index 12e2d915ee2..31dfdc54541 100644 --- a/core/chains/evm/gas/block_history_estimator.go +++ b/core/chains/evm/gas/block_history_estimator.go @@ -21,8 +21,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" "github.com/smartcontractkit/chainlink-common/pkg/utils/mathutil" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" @@ -235,7 +234,7 @@ func (b *BlockHistoryEstimator) HealthReport() map[string]error { return map[string]error{b.Name(): b.Healthy()} } -func (b *BlockHistoryEstimator) GetLegacyGas(_ context.Context, _ []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, _ ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { +func (b *BlockHistoryEstimator) GetLegacyGas(_ context.Context, _ []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, _ ...fees.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { ok := b.IfStarted(func() { gasPrice = b.getGasPrice() }) @@ -303,7 +302,7 @@ func (b *BlockHistoryEstimator) setMaxPercentileTipCap(tipCap *assets.Wei) { func (b *BlockHistoryEstimator) BumpLegacyGas(_ context.Context, originalGasPrice *assets.Wei, gasLimit uint64, maxGasPriceWei *assets.Wei, attempts []EvmPriorAttempt) (bumpedGasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { if b.bhConfig.CheckInclusionBlocks() > 0 { if err = b.haltBumping(attempts); err != nil { - if errors.Is(err, commonfee.ErrConnectivity) { + if errors.Is(err, fees.ErrConnectivity) { b.logger.Criticalw(BumpingHaltedLabel, "err", err) b.SvcErrBuffer.Append(err) promBlockHistoryEstimatorConnectivityFailureCount.WithLabelValues(b.chainID.String(), "legacy").Inc() @@ -365,7 +364,7 @@ func (b *BlockHistoryEstimator) haltBumping(attempts []EvmPriorAttempt) error { } if !attemptEip1559 { if attempt.GasPrice.Cmp(maxGasPrice) > 0 { - return fmt.Errorf("transaction %s has gas price of %s, which is above percentile=%d%% (percentile price: %s): %w", attempt.TxHash, attempt.GasPrice, percentile, maxGasPrice, commonfee.ErrConnectivity) + return fmt.Errorf("transaction %s has gas price of %s, which is above percentile=%d%% (percentile price: %s): %w", attempt.TxHash, attempt.GasPrice, percentile, maxGasPrice, fees.ErrConnectivity) } continue } @@ -382,7 +381,7 @@ func (b *BlockHistoryEstimator) haltBumping(attempts []EvmPriorAttempt) error { } } if sufficientFeeCap && attempt.DynamicFee.GasTipCap.Cmp(maxTipCap) > 0 { - return fmt.Errorf("transaction %s has tip cap of %s, which is above percentile=%d%% (percentile tip cap: %s): %w", attempt.TxHash, attempt.DynamicFee.GasTipCap, percentile, maxTipCap, commonfee.ErrConnectivity) + return fmt.Errorf("transaction %s has tip cap of %s, which is above percentile=%d%% (percentile tip cap: %s): %w", attempt.TxHash, attempt.DynamicFee.GasTipCap, percentile, maxTipCap, fees.ErrConnectivity) } } return nil @@ -461,7 +460,7 @@ func calcFeeCap(latestAvailableBaseFeePerGas *assets.Wei, bufferBlocks int, tipC func (b *BlockHistoryEstimator) BumpDynamicFee(_ context.Context, originalFee DynamicFee, maxGasPriceWei *assets.Wei, attempts []EvmPriorAttempt) (bumped DynamicFee, err error) { if b.bhConfig.CheckInclusionBlocks() > 0 { if err = b.haltBumping(attempts); err != nil { - if errors.Is(err, commonfee.ErrConnectivity) { + if errors.Is(err, fees.ErrConnectivity) { b.logger.Criticalw(BumpingHaltedLabel, "err", err) b.SvcErrBuffer.Append(err) promBlockHistoryEstimatorConnectivityFailureCount.WithLabelValues(b.chainID.String(), "eip1559").Inc() diff --git a/core/chains/evm/gas/block_history_estimator_test.go b/core/chains/evm/gas/block_history_estimator_test.go index b754132d7c7..d3cb058064e 100644 --- a/core/chains/evm/gas/block_history_estimator_test.go +++ b/core/chains/evm/gas/block_history_estimator_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" @@ -2318,7 +2318,7 @@ func TestBlockHistoryEstimator_HaltBumping(t *testing.T) { err := bhe.HaltBumping(attempts) require.Error(t, err) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has gas price of 7 wei, which is above percentile=40%% (percentile price: 5 wei)", attempts[2].TxHash)) - require.ErrorIs(t, err, commonfee.ErrConnectivity) + require.ErrorIs(t, err, fees.ErrConnectivity) }) }) @@ -2352,7 +2352,7 @@ func TestBlockHistoryEstimator_HaltBumping(t *testing.T) { err := bhe.HaltBumping(attempts) require.Error(t, err) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has gas price of 10 wei, which is above percentile=60%% (percentile price: 7 wei)", attempts[1].TxHash)) - require.ErrorIs(t, err, commonfee.ErrConnectivity) + require.ErrorIs(t, err, fees.ErrConnectivity) }) attempts = []gas.EvmPriorAttempt{ @@ -2370,7 +2370,7 @@ func TestBlockHistoryEstimator_HaltBumping(t *testing.T) { err := bhe.HaltBumping(attempts) require.Error(t, err) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has tip cap of 10 wei, which is above percentile=60%% (percentile tip cap: 6 wei)", attempts[0].TxHash)) - require.ErrorIs(t, err, commonfee.ErrConnectivity) + require.ErrorIs(t, err, fees.ErrConnectivity) }) }) @@ -2429,7 +2429,7 @@ func TestBlockHistoryEstimator_HaltBumping(t *testing.T) { err := bhe.HaltBumping(attempts) require.Error(t, err) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has tip cap of 5 wei, which is above percentile=20%% (percentile tip cap: 4 wei)", attempts[1].TxHash)) - require.ErrorIs(t, err, commonfee.ErrConnectivity) + require.ErrorIs(t, err, fees.ErrConnectivity) bhCfg.CheckInclusionBlocksF = 3 bhCfg.CheckInclusionPercentileF = 2 @@ -2438,7 +2438,7 @@ func TestBlockHistoryEstimator_HaltBumping(t *testing.T) { err = bhe.HaltBumping(attempts) require.Error(t, err) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has tip cap of 3 wei, which is above percentile=2%% (percentile tip cap: 2 wei)", attempts[0].TxHash)) - require.ErrorIs(t, err, commonfee.ErrConnectivity) + require.ErrorIs(t, err, fees.ErrConnectivity) }) t.Run("passes check if, for at least one block, feecap < tipcap+basefee, even if percentile is not reached", func(t *testing.T) { @@ -2500,7 +2500,7 @@ func TestBlockHistoryEstimator_Bumps(t *testing.T) { } _, _, err = bhe.BumpLegacyGas(ctx, assets.NewWeiI(42), 100000, maxGasPrice, attempts) require.Error(t, err) - assert.True(t, pkgerrors.Is(err, commonfee.ErrConnectivity)) + assert.True(t, pkgerrors.Is(err, fees.ErrConnectivity)) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has gas price of 1 kwei, which is above percentile=10%% (percentile price: 1 wei)", attempts[0].TxHash)) }) @@ -2628,7 +2628,7 @@ func TestBlockHistoryEstimator_Bumps(t *testing.T) { _, err = bhe.BumpDynamicFee(tests.Context(t), originalFee, maxGasPrice, attempts) require.Error(t, err) - assert.True(t, pkgerrors.Is(err, commonfee.ErrConnectivity)) + assert.True(t, pkgerrors.Is(err, fees.ErrConnectivity)) assert.Contains(t, err.Error(), fmt.Sprintf("transaction %s has tip cap of 25 wei, which is above percentile=10%% (percentile tip cap: 1 wei)", attempts[0].TxHash)) }) diff --git a/core/chains/evm/gas/fee_history_estimator.go b/core/chains/evm/gas/fee_history_estimator.go index 1e76e99c95e..1b3f1a38416 100644 --- a/core/chains/evm/gas/fee_history_estimator.go +++ b/core/chains/evm/gas/fee_history_estimator.go @@ -17,8 +17,7 @@ import ( bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -162,7 +161,7 @@ func (f *FeeHistoryEstimator) run() { } // GetLegacyGas will fetch the cached gas price value. -func (f *FeeHistoryEstimator) GetLegacyGas(ctx context.Context, _ []byte, gasLimit uint64, maxPrice *assets.Wei, opts ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { +func (f *FeeHistoryEstimator) GetLegacyGas(ctx context.Context, _ []byte, gasLimit uint64, maxPrice *assets.Wei, opts ...fees.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { chainSpecificGasLimit = gasLimit if gasPrice, err = f.getGasPrice(); err != nil { return @@ -315,7 +314,7 @@ func (f *FeeHistoryEstimator) BumpLegacyGas(ctx context.Context, originalGasPric // Sanitize original fee input if originalGasPrice == nil || originalGasPrice.Cmp(maxPrice) >= 0 { return nil, 0, fmt.Errorf("%w: error while retrieving original gas price: originalGasPrice: %s. Maximum price configured: %s", - commonfee.ErrBump, originalGasPrice, maxPrice) + fees.ErrBump, originalGasPrice, maxPrice) } currentGasPrice, err := f.RefreshGasPrice() @@ -364,7 +363,7 @@ func (f *FeeHistoryEstimator) BumpDynamicFee(ctx context.Context, originalFee Dy ((originalFee.GasTipCap.Cmp(originalFee.GasFeeCap)) > 0) || (originalFee.GasFeeCap.Cmp(maxPrice) >= 0) { return bumped, fmt.Errorf("%w: error while retrieving original dynamic fees: (originalFeePerGas: %s - originalPriorityFeePerGas: %s). Maximum price configured: %s", - commonfee.ErrBump, originalFee.GasFeeCap, originalFee.GasTipCap, maxPrice) + fees.ErrBump, originalFee.GasFeeCap, originalFee.GasTipCap, maxPrice) } currentDynamicPrice, err := f.getDynamicPrice() @@ -387,7 +386,7 @@ func (f *FeeHistoryEstimator) BumpDynamicFee(ctx context.Context, originalFee Dy if bumpedMaxPriorityFeePerGas.Cmp(priorityFeeThreshold) > 0 { return bumped, fmt.Errorf("%w: bumpedMaxPriorityFeePerGas: %s is above market's %sth percentile: %s, bumping is halted", - commonfee.ErrConnectivity, bumpedMaxPriorityFeePerGas, strconv.Itoa(ConnectivityPercentile), priorityFeeThreshold) + fees.ErrConnectivity, bumpedMaxPriorityFeePerGas, strconv.Itoa(ConnectivityPercentile), priorityFeeThreshold) } bumpedMaxFeePerGas, err = LimitBumpedFee(originalFee.GasFeeCap, currentDynamicPrice.GasFeeCap, bumpedMaxFeePerGas, maxPrice) @@ -421,7 +420,7 @@ func LimitBumpedFee(originalFee *assets.Wei, currentFee *assets.Wei, bumpedFee * if bumpedFee.Cmp(originalFee) == 0 || bumpedFee.Cmp(originalFee.AddPercentage(MinimumBumpPercentage)) < 0 { return nil, fmt.Errorf("%w: %s is bumped less than minimum allowed percentage(%s) from originalFee: %s - maxPrice: %s", - commonfee.ErrBump, bumpedFee, strconv.Itoa(MinimumBumpPercentage), originalFee, maxPrice) + fees.ErrBump, bumpedFee, strconv.Itoa(MinimumBumpPercentage), originalFee, maxPrice) } return bumpedFee, nil } diff --git a/core/chains/evm/gas/fee_history_estimator_test.go b/core/chains/evm/gas/fee_history_estimator_test.go index 7d66b9375d7..e537538460f 100644 --- a/core/chains/evm/gas/fee_history_estimator_test.go +++ b/core/chains/evm/gas/fee_history_estimator_test.go @@ -12,8 +12,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/chainlink/v2/common/fee" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" @@ -412,7 +412,7 @@ func TestFeeHistoryEstimatorBumpDynamicFee(t *testing.T) { assert.NoError(t, err) _, err = u.BumpDynamicFee(tests.Context(t), originalFee, globalMaxPrice, nil) assert.Error(t, err) - assert.True(t, fee.IsBumpErr(err)) + assert.True(t, fees.IsBumpErr(err)) }) t.Run("returns max price if the aggregation of max and original bumped fee is higher", func(t *testing.T) { diff --git a/core/chains/evm/gas/fixed_price_estimator.go b/core/chains/evm/gas/fixed_price_estimator.go index 43398ef4b19..e744cb8cb5f 100644 --- a/core/chains/evm/gas/fixed_price_estimator.go +++ b/core/chains/evm/gas/fixed_price_estimator.go @@ -6,8 +6,7 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -59,8 +58,8 @@ func (f *fixedPriceEstimator) Start(context.Context) error { return nil } -func (f *fixedPriceEstimator) GetLegacyGas(_ context.Context, _ []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, _ ...feetypes.Opt) (*assets.Wei, uint64, error) { - gasPrice := commonfee.CalculateFee(f.config.PriceDefault().ToInt(), maxGasPriceWei.ToInt(), f.config.PriceMax().ToInt()) +func (f *fixedPriceEstimator) GetLegacyGas(_ context.Context, _ []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, _ ...fees.Opt) (*assets.Wei, uint64, error) { + gasPrice := fees.CalculateFee(f.config.PriceDefault().ToInt(), maxGasPriceWei.ToInt(), f.config.PriceMax().ToInt()) chainSpecificGasLimit := gasLimit return assets.NewWei(gasPrice), chainSpecificGasLimit, nil } @@ -72,7 +71,7 @@ func (f *fixedPriceEstimator) BumpLegacyGas( maxGasPriceWei *assets.Wei, _ []EvmPriorAttempt, ) (*assets.Wei, uint64, error) { - gasPrice, err := commonfee.CalculateBumpedFee( + gasPrice, err := fees.CalculateBumpedFee( f.lggr, f.config.PriceDefault().ToInt(), originalGasPrice.ToInt(), diff --git a/core/chains/evm/gas/mocks/evm_estimator.go b/core/chains/evm/gas/mocks/evm_estimator.go index 13f8d210e64..b0396c656f2 100644 --- a/core/chains/evm/gas/mocks/evm_estimator.go +++ b/core/chains/evm/gas/mocks/evm_estimator.go @@ -7,7 +7,7 @@ import ( assets "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + fees "github.com/smartcontractkit/chainlink/v2/common/fees" gas "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" @@ -15,7 +15,7 @@ import ( rollups "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" - types "github.com/smartcontractkit/chainlink/v2/common/fee/types" + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) // EvmEstimator is an autogenerated mock type for the EvmEstimator type @@ -262,7 +262,7 @@ func (_c *EvmEstimator_GetDynamicFee_Call) RunAndReturn(run func(context.Context } // GetLegacyGas provides a mock function with given fields: ctx, calldata, gasLimit, maxGasPriceWei, opts -func (_m *EvmEstimator) GetLegacyGas(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...types.Opt) (*assets.Wei, uint64, error) { +func (_m *EvmEstimator) GetLegacyGas(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...fees.Opt) (*assets.Wei, uint64, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -279,10 +279,10 @@ func (_m *EvmEstimator) GetLegacyGas(ctx context.Context, calldata []byte, gasLi var r0 *assets.Wei var r1 uint64 var r2 error - if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) (*assets.Wei, uint64, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, ...fees.Opt) (*assets.Wei, uint64, error)); ok { return rf(ctx, calldata, gasLimit, maxGasPriceWei, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) *assets.Wei); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, ...fees.Opt) *assets.Wei); ok { r0 = rf(ctx, calldata, gasLimit, maxGasPriceWei, opts...) } else { if ret.Get(0) != nil { @@ -290,13 +290,13 @@ func (_m *EvmEstimator) GetLegacyGas(ctx context.Context, calldata []byte, gasLi } } - if rf, ok := ret.Get(1).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) uint64); ok { + if rf, ok := ret.Get(1).(func(context.Context, []byte, uint64, *assets.Wei, ...fees.Opt) uint64); ok { r1 = rf(ctx, calldata, gasLimit, maxGasPriceWei, opts...) } else { r1 = ret.Get(1).(uint64) } - if rf, ok := ret.Get(2).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) error); ok { + if rf, ok := ret.Get(2).(func(context.Context, []byte, uint64, *assets.Wei, ...fees.Opt) error); ok { r2 = rf(ctx, calldata, gasLimit, maxGasPriceWei, opts...) } else { r2 = ret.Error(2) @@ -315,18 +315,18 @@ type EvmEstimator_GetLegacyGas_Call struct { // - calldata []byte // - gasLimit uint64 // - maxGasPriceWei *assets.Wei -// - opts ...types.Opt +// - opts ...fees.Opt func (_e *EvmEstimator_Expecter) GetLegacyGas(ctx interface{}, calldata interface{}, gasLimit interface{}, maxGasPriceWei interface{}, opts ...interface{}) *EvmEstimator_GetLegacyGas_Call { return &EvmEstimator_GetLegacyGas_Call{Call: _e.mock.On("GetLegacyGas", append([]interface{}{ctx, calldata, gasLimit, maxGasPriceWei}, opts...)...)} } -func (_c *EvmEstimator_GetLegacyGas_Call) Run(run func(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...types.Opt)) *EvmEstimator_GetLegacyGas_Call { +func (_c *EvmEstimator_GetLegacyGas_Call) Run(run func(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...fees.Opt)) *EvmEstimator_GetLegacyGas_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]types.Opt, len(args)-4) + variadicArgs := make([]fees.Opt, len(args)-4) for i, a := range args[4:] { if a != nil { - variadicArgs[i] = a.(types.Opt) + variadicArgs[i] = a.(fees.Opt) } } run(args[0].(context.Context), args[1].([]byte), args[2].(uint64), args[3].(*assets.Wei), variadicArgs...) @@ -339,7 +339,7 @@ func (_c *EvmEstimator_GetLegacyGas_Call) Return(gasPrice *assets.Wei, chainSpec return _c } -func (_c *EvmEstimator_GetLegacyGas_Call) RunAndReturn(run func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) (*assets.Wei, uint64, error)) *EvmEstimator_GetLegacyGas_Call { +func (_c *EvmEstimator_GetLegacyGas_Call) RunAndReturn(run func(context.Context, []byte, uint64, *assets.Wei, ...fees.Opt) (*assets.Wei, uint64, error)) *EvmEstimator_GetLegacyGas_Call { _c.Call.Return(run) return _c } @@ -484,7 +484,7 @@ func (_c *EvmEstimator_Name_Call) RunAndReturn(run func() string) *EvmEstimator_ } // OnNewLongestChain provides a mock function with given fields: ctx, head -func (_m *EvmEstimator) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) { +func (_m *EvmEstimator) OnNewLongestChain(ctx context.Context, head *types.Head) { _m.Called(ctx, head) } @@ -495,14 +495,14 @@ type EvmEstimator_OnNewLongestChain_Call struct { // OnNewLongestChain is a helper method to define mock.On call // - ctx context.Context -// - head *evmtypes.Head +// - head *types.Head func (_e *EvmEstimator_Expecter) OnNewLongestChain(ctx interface{}, head interface{}) *EvmEstimator_OnNewLongestChain_Call { return &EvmEstimator_OnNewLongestChain_Call{Call: _e.mock.On("OnNewLongestChain", ctx, head)} } -func (_c *EvmEstimator_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *evmtypes.Head)) *EvmEstimator_OnNewLongestChain_Call { +func (_c *EvmEstimator_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *types.Head)) *EvmEstimator_OnNewLongestChain_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*evmtypes.Head)) + run(args[0].(context.Context), args[1].(*types.Head)) }) return _c } @@ -512,7 +512,7 @@ func (_c *EvmEstimator_OnNewLongestChain_Call) Return() *EvmEstimator_OnNewLonge return _c } -func (_c *EvmEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *evmtypes.Head)) *EvmEstimator_OnNewLongestChain_Call { +func (_c *EvmEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *types.Head)) *EvmEstimator_OnNewLongestChain_Call { _c.Run(run) return _c } diff --git a/core/chains/evm/gas/mocks/evm_fee_estimator.go b/core/chains/evm/gas/mocks/evm_fee_estimator.go index 9a8a9e456a7..1de0eb09ffa 100644 --- a/core/chains/evm/gas/mocks/evm_fee_estimator.go +++ b/core/chains/evm/gas/mocks/evm_fee_estimator.go @@ -11,7 +11,7 @@ import ( context "context" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + fees "github.com/smartcontractkit/chainlink/v2/common/fees" gas "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" @@ -19,7 +19,7 @@ import ( rollups "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" - types "github.com/smartcontractkit/chainlink/v2/common/fee/types" + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) // EvmFeeEstimator is an autogenerated mock type for the EvmFeeEstimator type @@ -148,7 +148,7 @@ func (_c *EvmFeeEstimator_Close_Call) RunAndReturn(run func() error) *EvmFeeEsti } // GetFee provides a mock function with given fields: ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts -func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt) (gas.EvmFee, uint64, error) { +func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...fees.Opt) (gas.EvmFee, uint64, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -165,22 +165,22 @@ func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit var r0 gas.EvmFee var r1 uint64 var r2 error - if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (gas.EvmFee, uint64, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) (gas.EvmFee, uint64, error)); ok { return rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) gas.EvmFee); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) gas.EvmFee); ok { r0 = rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r0 = ret.Get(0).(gas.EvmFee) } - if rf, ok := ret.Get(1).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) uint64); ok { + if rf, ok := ret.Get(1).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) uint64); ok { r1 = rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r1 = ret.Get(1).(uint64) } - if rf, ok := ret.Get(2).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) error); ok { + if rf, ok := ret.Get(2).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) error); ok { r2 = rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r2 = ret.Error(2) @@ -201,18 +201,18 @@ type EvmFeeEstimator_GetFee_Call struct { // - maxFeePrice *assets.Wei // - fromAddress *common.Address // - toAddress *common.Address -// - opts ...types.Opt +// - opts ...fees.Opt func (_e *EvmFeeEstimator_Expecter) GetFee(ctx interface{}, calldata interface{}, feeLimit interface{}, maxFeePrice interface{}, fromAddress interface{}, toAddress interface{}, opts ...interface{}) *EvmFeeEstimator_GetFee_Call { return &EvmFeeEstimator_GetFee_Call{Call: _e.mock.On("GetFee", append([]interface{}{ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress}, opts...)...)} } -func (_c *EvmFeeEstimator_GetFee_Call) Run(run func(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt)) *EvmFeeEstimator_GetFee_Call { +func (_c *EvmFeeEstimator_GetFee_Call) Run(run func(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...fees.Opt)) *EvmFeeEstimator_GetFee_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]types.Opt, len(args)-6) + variadicArgs := make([]fees.Opt, len(args)-6) for i, a := range args[6:] { if a != nil { - variadicArgs[i] = a.(types.Opt) + variadicArgs[i] = a.(fees.Opt) } } run(args[0].(context.Context), args[1].([]byte), args[2].(uint64), args[3].(*assets.Wei), args[4].(*common.Address), args[5].(*common.Address), variadicArgs...) @@ -225,13 +225,13 @@ func (_c *EvmFeeEstimator_GetFee_Call) Return(fee gas.EvmFee, estimatedFeeLimit return _c } -func (_c *EvmFeeEstimator_GetFee_Call) RunAndReturn(run func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (gas.EvmFee, uint64, error)) *EvmFeeEstimator_GetFee_Call { +func (_c *EvmFeeEstimator_GetFee_Call) RunAndReturn(run func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) (gas.EvmFee, uint64, error)) *EvmFeeEstimator_GetFee_Call { _c.Call.Return(run) return _c } // GetMaxCost provides a mock function with given fields: ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts -func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt) (*big.Int, error) { +func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...fees.Opt) (*big.Int, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -247,10 +247,10 @@ func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, ca var r0 *big.Int var r1 error - if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (*big.Int, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) (*big.Int, error)); ok { return rf(ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) *big.Int); ok { + if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) *big.Int); ok { r0 = rf(ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { if ret.Get(0) != nil { @@ -258,7 +258,7 @@ func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, ca } } - if rf, ok := ret.Get(1).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) error); ok { r1 = rf(ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r1 = ret.Error(1) @@ -280,18 +280,18 @@ type EvmFeeEstimator_GetMaxCost_Call struct { // - maxFeePrice *assets.Wei // - fromAddress *common.Address // - toAddress *common.Address -// - opts ...types.Opt +// - opts ...fees.Opt func (_e *EvmFeeEstimator_Expecter) GetMaxCost(ctx interface{}, amount interface{}, calldata interface{}, feeLimit interface{}, maxFeePrice interface{}, fromAddress interface{}, toAddress interface{}, opts ...interface{}) *EvmFeeEstimator_GetMaxCost_Call { return &EvmFeeEstimator_GetMaxCost_Call{Call: _e.mock.On("GetMaxCost", append([]interface{}{ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress}, opts...)...)} } -func (_c *EvmFeeEstimator_GetMaxCost_Call) Run(run func(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt)) *EvmFeeEstimator_GetMaxCost_Call { +func (_c *EvmFeeEstimator_GetMaxCost_Call) Run(run func(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...fees.Opt)) *EvmFeeEstimator_GetMaxCost_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]types.Opt, len(args)-7) + variadicArgs := make([]fees.Opt, len(args)-7) for i, a := range args[7:] { if a != nil { - variadicArgs[i] = a.(types.Opt) + variadicArgs[i] = a.(fees.Opt) } } run(args[0].(context.Context), args[1].(assets.Eth), args[2].([]byte), args[3].(uint64), args[4].(*assets.Wei), args[5].(*common.Address), args[6].(*common.Address), variadicArgs...) @@ -304,7 +304,7 @@ func (_c *EvmFeeEstimator_GetMaxCost_Call) Return(_a0 *big.Int, _a1 error) *EvmF return _c } -func (_c *EvmFeeEstimator_GetMaxCost_Call) RunAndReturn(run func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (*big.Int, error)) *EvmFeeEstimator_GetMaxCost_Call { +func (_c *EvmFeeEstimator_GetMaxCost_Call) RunAndReturn(run func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...fees.Opt) (*big.Int, error)) *EvmFeeEstimator_GetMaxCost_Call { _c.Call.Return(run) return _c } @@ -449,7 +449,7 @@ func (_c *EvmFeeEstimator_Name_Call) RunAndReturn(run func() string) *EvmFeeEsti } // OnNewLongestChain provides a mock function with given fields: ctx, head -func (_m *EvmFeeEstimator) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) { +func (_m *EvmFeeEstimator) OnNewLongestChain(ctx context.Context, head *types.Head) { _m.Called(ctx, head) } @@ -460,14 +460,14 @@ type EvmFeeEstimator_OnNewLongestChain_Call struct { // OnNewLongestChain is a helper method to define mock.On call // - ctx context.Context -// - head *evmtypes.Head +// - head *types.Head func (_e *EvmFeeEstimator_Expecter) OnNewLongestChain(ctx interface{}, head interface{}) *EvmFeeEstimator_OnNewLongestChain_Call { return &EvmFeeEstimator_OnNewLongestChain_Call{Call: _e.mock.On("OnNewLongestChain", ctx, head)} } -func (_c *EvmFeeEstimator_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *evmtypes.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { +func (_c *EvmFeeEstimator_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *types.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*evmtypes.Head)) + run(args[0].(context.Context), args[1].(*types.Head)) }) return _c } @@ -477,7 +477,7 @@ func (_c *EvmFeeEstimator_OnNewLongestChain_Call) Return() *EvmFeeEstimator_OnNe return _c } -func (_c *EvmFeeEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *evmtypes.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { +func (_c *EvmFeeEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *types.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { _c.Run(run) return _c } diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index 2d6fe971d9c..d71dcea680e 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -14,8 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/headtracker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" @@ -35,11 +34,11 @@ type EvmFeeEstimator interface { // L1Oracle returns the L1 gas price oracle only if the chain has one, e.g. OP stack L2s and Arbitrum. L1Oracle() rollups.L1Oracle - GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (fee EvmFee, estimatedFeeLimit uint64, err error) + GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...fees.Opt) (fee EvmFee, estimatedFeeLimit uint64, err error) BumpFee(ctx context.Context, originalFee EvmFee, feeLimit uint64, maxFeePrice *assets.Wei, attempts []EvmPriorAttempt) (bumpedFee EvmFee, chainSpecificFeeLimit uint64, err error) // GetMaxCost returns the total value = max price x fee units + transferred value - GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (*big.Int, error) + GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...fees.Opt) (*big.Int, error) } type feeEstimatorClient interface { @@ -151,7 +150,7 @@ type EvmEstimator interface { // GetLegacyGas Calculates initial gas fee for non-EIP1559 transaction // maxGasPriceWei parameter is the highest possible gas fee cap that the function will return - GetLegacyGas(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) + GetLegacyGas(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...fees.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) // BumpLegacyGas Increases gas price and/or limit for non-EIP1559 transactions // if the bumped gas fee is greater than maxGasPriceWei, the method returns an error // attempts must: @@ -171,7 +170,7 @@ type EvmEstimator interface { L1Oracle() rollups.L1Oracle } -var _ feetypes.Fee = (*EvmFee)(nil) +var _ fees.Fee = (*EvmFee)(nil) type EvmFee struct { GasPrice *assets.Wei @@ -277,7 +276,7 @@ func (e *evmFeeEstimator) L1Oracle() rollups.L1Oracle { // GetFee returns an initial estimated gas price and gas limit for a transaction // The gas limit provided by the caller can be adjusted by gas estimation or for 2D fees -func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (fee EvmFee, estimatedFeeLimit uint64, err error) { +func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...fees.Opt) (fee EvmFee, estimatedFeeLimit uint64, err error) { var chainSpecificFeeLimit uint64 // get dynamic fee if e.EIP1559Enabled { @@ -301,7 +300,7 @@ func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit return } -func (e *evmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (*big.Int, error) { +func (e *evmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...fees.Opt) (*big.Int, error) { fees, gasLimit, err := e.GetFee(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) if err != nil { return nil, err @@ -338,7 +337,7 @@ func (e *evmFeeEstimator) BumpFee(ctx context.Context, originalFee EvmFee, feeLi if err != nil { return } - chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(feeLimit, e.geCfg.LimitMultiplier()) + chainSpecificFeeLimit, err = fees.ApplyMultiplier(feeLimit, e.geCfg.LimitMultiplier()) bumpedFee.GasFeeCap = bumpedDynamic.GasFeeCap bumpedFee.GasTipCap = bumpedDynamic.GasTipCap return @@ -349,13 +348,13 @@ func (e *evmFeeEstimator) BumpFee(ctx context.Context, originalFee EvmFee, feeLi if err != nil { return } - chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(chainSpecificFeeLimit, e.geCfg.LimitMultiplier()) + chainSpecificFeeLimit, err = fees.ApplyMultiplier(chainSpecificFeeLimit, e.geCfg.LimitMultiplier()) return } func (e *evmFeeEstimator) estimateFeeLimit(ctx context.Context, feeLimit uint64, calldata []byte, fromAddress, toAddress *common.Address) (estimatedFeeLimit uint64, err error) { // Use the feeLimit * LimitMultiplier as the provided gas limit since this multiplier is applied on top of the caller specified gas limit - providedGasLimit, err := commonfee.ApplyMultiplier(feeLimit, e.geCfg.LimitMultiplier()) + providedGasLimit, err := fees.ApplyMultiplier(feeLimit, e.geCfg.LimitMultiplier()) if err != nil { return estimatedFeeLimit, err } @@ -386,10 +385,10 @@ func (e *evmFeeEstimator) estimateFeeLimit(ctx context.Context, feeLimit uint64, // Transaction would be destined to run out of gas and fail if providedGasLimit > 0 && estimatedGas > providedGasLimit { e.lggr.Errorw("estimated gas exceeds provided gas limit with multiplier", "estimatedGas", estimatedGas, "providedGasLimitWithMultiplier", providedGasLimit) - return estimatedFeeLimit, commonfee.ErrFeeLimitTooLow + return estimatedFeeLimit, fees.ErrFeeLimitTooLow } // Apply EstimateGasBuffer to the estimated gas limit - estimatedFeeLimit, err = commonfee.ApplyMultiplier(estimatedGas, EstimateGasBuffer) + estimatedFeeLimit, err = fees.ApplyMultiplier(estimatedGas, EstimateGasBuffer) if err != nil { return } @@ -441,13 +440,13 @@ func bumpGasPrice(cfg bumpConfig, lggr logger.SugaredLogger, currentGasPrice, or bumpedGasPrice = maxBumpedFee(lggr, currentGasPrice, bumpedGasPrice, maxGasPrice, "gas price") if bumpedGasPrice.Cmp(maxGasPrice) > 0 { - return maxGasPrice, pkgerrors.Wrapf(commonfee.ErrBumpFeeExceedsLimit, "bumped gas price of %s would exceed configured max gas price of %s (original price was %s). %s", + return maxGasPrice, pkgerrors.Wrapf(fees.ErrBumpFeeExceedsLimit, "bumped gas price of %s would exceed configured max gas price of %s (original price was %s). %s", bumpedGasPrice.String(), maxGasPrice, originalGasPrice.String(), label.NodeConnectivityProblemWarning) } else if bumpedGasPrice.Cmp(originalGasPrice) == 0 { // NOTE: This really shouldn't happen since we enforce minimums for // EVM.GasEstimator.BumpPercent and EVM.GasEstimator.BumpMin in the config validation, // but it's here anyway for a "belts and braces" approach - return bumpedGasPrice, pkgerrors.Wrapf(commonfee.ErrBump, "bumped gas price of %s is equal to original gas price of %s."+ + return bumpedGasPrice, pkgerrors.Wrapf(fees.ErrBump, "bumped gas price of %s is equal to original gas price of %s."+ " ACTION REQUIRED: This is a configuration error, you must increase either "+ "EVM.GasEstimator.BumpPercent or EVM.GasEstimator.BumpMin", bumpedGasPrice.String(), originalGasPrice.String()) } @@ -482,13 +481,13 @@ func bumpDynamicFee(cfg bumpConfig, feeCapBufferBlocks uint16, lggr logger.Sugar bumpedTipCap = maxBumpedFee(lggr, currentTipCap, bumpedTipCap, maxGasPrice, "tip cap") if bumpedTipCap.Cmp(maxGasPrice) > 0 { - return bumpedFee, pkgerrors.Wrapf(commonfee.ErrBumpFeeExceedsLimit, "bumped tip cap of %s would exceed configured max gas price of %s (original fee: tip cap %s, fee cap %s). %s", + return bumpedFee, pkgerrors.Wrapf(fees.ErrBumpFeeExceedsLimit, "bumped tip cap of %s would exceed configured max gas price of %s (original fee: tip cap %s, fee cap %s). %s", bumpedTipCap.String(), maxGasPrice, originalFee.GasTipCap.String(), originalFee.GasFeeCap.String(), label.NodeConnectivityProblemWarning) } else if bumpedTipCap.Cmp(originalFee.GasTipCap) <= 0 { // NOTE: This really shouldn't happen since we enforce minimums for // EVM.GasEstimator.BumpPercent and EVM.GasEstimator.BumpMin in the config validation, // but it's here anyway for a "belts and braces" approach - return bumpedFee, pkgerrors.Wrapf(commonfee.ErrBump, "bumped gas tip cap of %s is less than or equal to original gas tip cap of %s."+ + return bumpedFee, pkgerrors.Wrapf(fees.ErrBump, "bumped gas tip cap of %s is less than or equal to original gas tip cap of %s."+ " ACTION REQUIRED: This is a configuration error, you must increase either "+ "EVM.GasEstimator.BumpPercent or EVM.GasEstimator.BumpMin", bumpedTipCap.String(), originalFee.GasTipCap.String()) } @@ -508,7 +507,7 @@ func bumpDynamicFee(cfg bumpConfig, feeCapBufferBlocks uint16, lggr logger.Sugar } if bumpedFeeCap.Cmp(maxGasPrice) > 0 { - return bumpedFee, pkgerrors.Wrapf(commonfee.ErrBumpFeeExceedsLimit, "bumped fee cap of %s would exceed configured max gas price of %s (original fee: tip cap %s, fee cap %s). %s", + return bumpedFee, pkgerrors.Wrapf(fees.ErrBumpFeeExceedsLimit, "bumped fee cap of %s would exceed configured max gas price of %s (original fee: tip cap %s, fee cap %s). %s", bumpedFeeCap.String(), maxGasPrice, originalFee.GasTipCap.String(), originalFee.GasFeeCap.String(), label.NodeConnectivityProblemWarning) } @@ -542,6 +541,6 @@ func getMaxGasPrice(userSpecifiedMax, maxGasPriceWei *assets.Wei) *assets.Wei { } func capGasPrice(calculatedGasPrice, userSpecifiedMax, maxGasPriceWei *assets.Wei) *assets.Wei { - maxGasPrice := commonfee.CalculateFee(calculatedGasPrice.ToInt(), userSpecifiedMax.ToInt(), maxGasPriceWei.ToInt()) + maxGasPrice := fees.CalculateFee(calculatedGasPrice.ToInt(), userSpecifiedMax.ToInt(), maxGasPriceWei.ToInt()) return assets.NewWei(maxGasPrice) } diff --git a/core/chains/evm/gas/models_test.go b/core/chains/evm/gas/models_test.go index 3cc83ec7034..6bec271f0ac 100644 --- a/core/chains/evm/gas/models_test.go +++ b/core/chains/evm/gas/models_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" @@ -294,13 +294,13 @@ func TestWrappedEvmEstimator(t *testing.T) { ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice() estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) _, _, err := estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) - require.ErrorIs(t, err, commonfee.ErrFeeLimitTooLow) + require.ErrorIs(t, err, fees.ErrFeeLimitTooLow) // expect dynamic fee data dynamicFees = true estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) _, _, err = estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) - require.ErrorIs(t, err, commonfee.ErrFeeLimitTooLow) + require.ErrorIs(t, err, fees.ErrFeeLimitTooLow) }) t.Run("GetFee, estimate gas limit enabled, buffer exceeds provided limit, fallsback to provided limit", func(t *testing.T) { diff --git a/core/chains/evm/gas/suggested_price_estimator.go b/core/chains/evm/gas/suggested_price_estimator.go index 0f8c23195d3..68e23f75d28 100644 --- a/core/chains/evm/gas/suggested_price_estimator.go +++ b/core/chains/evm/gas/suggested_price_estimator.go @@ -13,11 +13,10 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - "github.com/smartcontractkit/chainlink/v2/common/fee" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -172,17 +171,17 @@ func (*SuggestedPriceEstimator) BumpDynamicFee(_ context.Context, _ DynamicFee, return } -func (o *SuggestedPriceEstimator) GetLegacyGas(ctx context.Context, _ []byte, GasLimit uint64, maxGasPriceWei *assets.Wei, opts ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { - chainSpecificGasLimit = GasLimit +func (o *SuggestedPriceEstimator) GetLegacyGas(ctx context.Context, _ []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...fees.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { + chainSpecificGasLimit = gasLimit ok := o.IfStarted(func() { - if slices.Contains(opts, feetypes.OptForceRefetch) { + if slices.Contains(opts, fees.OptForceRefetch) { err = o.forceRefresh(ctx) } if gasPrice = o.getGasPrice(); gasPrice == nil { err = pkgerrors.New("failed to estimate gas; gas price not set") return } - o.logger.Debugw("GetLegacyGas", "GasPrice", gasPrice, "GasLimit", GasLimit) + o.logger.Debugw("GetLegacyGas", "GasPrice", gasPrice, "GasLimit", gasLimit) }) if !ok { return nil, 0, pkgerrors.New("estimator is not started") @@ -227,7 +226,7 @@ func (o *SuggestedPriceEstimator) BumpLegacyGas(ctx context.Context, originalFee // Add a buffer on top of the gas price returned by the RPC. // Bump logic when using the suggested gas price from an RPC is realistically only needed when there is increased volatility in gas price. // This buffer is a precaution to increase the chance of getting this tx on chain - bufferedPrice := fee.MaxBumpedFee(newGasPrice.ToInt(), o.cfg.BumpPercent(), o.cfg.BumpMin().ToInt()) + bufferedPrice := fees.MaxBumpedFee(newGasPrice.ToInt(), o.cfg.BumpPercent(), o.cfg.BumpMin().ToInt()) // If the new suggested price is less than or equal to the max and the buffer puts the new price over the max, return the max price instead // The buffer is added on top of the suggested price during bumping as just a precaution. It is better to resubmit the transaction with the max gas price instead of erroring. newGasPrice = assets.NewWei(bigmath.Min(bufferedPrice, maxGasPriceWei.ToInt())) diff --git a/core/chains/evm/txmgr/attempts.go b/core/chains/evm/txmgr/attempts.go index bcdb28acb53..e0c24c08d9e 100644 --- a/core/chains/evm/txmgr/attempts.go +++ b/core/chains/evm/txmgr/attempts.go @@ -11,7 +11,8 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" commontypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -44,7 +45,7 @@ func NewEvmTxAttemptBuilder(chainID big.Int, feeConfig evmTxAttemptBuilderFeeCon // NewTxAttempt builds an new attempt using the configured fee estimator + using the EIP1559 config to determine tx type // used for when a brand new transaction is being created in the txm -func (c *evmTxAttemptBuilder) NewTxAttempt(ctx context.Context, etx Tx, lggr logger.Logger, opts ...feetypes.Opt) (attempt TxAttempt, fee gas.EvmFee, feeLimit uint64, retryable bool, err error) { +func (c *evmTxAttemptBuilder) NewTxAttempt(ctx context.Context, etx Tx, lggr logger.Logger, opts ...fees.Opt) (attempt TxAttempt, fee gas.EvmFee, feeLimit uint64, retryable bool, err error) { txType := 0x0 if c.feeConfig.EIP1559DynamicFees() { txType = 0x2 @@ -54,7 +55,7 @@ func (c *evmTxAttemptBuilder) NewTxAttempt(ctx context.Context, etx Tx, lggr log // NewTxAttemptWithType builds a new attempt with a new fee estimation where the txType can be specified by the caller // used for L2 re-estimation on broadcasting (note EIP1559 must be disabled otherwise this will fail with mismatched fees + tx type) -func (c *evmTxAttemptBuilder) NewTxAttemptWithType(ctx context.Context, etx Tx, lggr logger.Logger, txType int, opts ...feetypes.Opt) (attempt TxAttempt, fee gas.EvmFee, feeLimit uint64, retryable bool, err error) { +func (c *evmTxAttemptBuilder) NewTxAttemptWithType(ctx context.Context, etx Tx, lggr logger.Logger, txType int, opts ...fees.Opt) (attempt TxAttempt, fee gas.EvmFee, feeLimit uint64, retryable bool, err error) { keySpecificMaxGasPriceWei := c.feeConfig.PriceMaxKey(etx.FromAddress) fee, feeLimit, err = c.EvmFeeEstimator.GetFee(ctx, etx.EncodedPayload, etx.FeeLimit, keySpecificMaxGasPriceWei, &etx.FromAddress, &etx.ToAddress, opts...) if err != nil { diff --git a/core/chains/evm/txmgr/broadcaster_test.go b/core/chains/evm/txmgr/broadcaster_test.go index 4ed6729466b..561f7a3b93a 100644 --- a/core/chains/evm/txmgr/broadcaster_test.go +++ b/core/chains/evm/txmgr/broadcaster_test.go @@ -29,10 +29,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-framework/multinode" - commmonfee "github.com/smartcontractkit/chainlink/v2/common/fee" + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" @@ -1717,7 +1716,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_GasEstimationError(t *testing.T) dbEtx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) require.Equal(t, txmgrcommon.TxFatalError, dbEtx.State) - require.Equal(t, commmonfee.ErrFeeLimitTooLow.Error(), dbEtx.Error.String) + require.Equal(t, fees.ErrFeeLimitTooLow.Error(), dbEtx.Error.String) }) } diff --git a/core/chains/evm/txmgr/confirmer_test.go b/core/chains/evm/txmgr/confirmer_test.go index a35765272bb..a747ba65135 100644 --- a/core/chains/evm/txmgr/confirmer_test.go +++ b/core/chains/evm/txmgr/confirmer_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-framework/multinode" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" + "github.com/smartcontractkit/chainlink/v2/common/fees" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -728,7 +728,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing estimator := gasmocks.NewEvmEstimator(t) newEst := func(logger.Logger) gas.EvmEstimator { return estimator } - estimator.On("BumpLegacyGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil, uint64(0), pkgerrors.Wrapf(commonfee.ErrConnectivity, "transaction...")) + estimator.On("BumpLegacyGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil, uint64(0), pkgerrors.Wrapf(fees.ErrConnectivity, "transaction...")) ge := ccfg.EVM().GasEstimator() feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge, ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, kst, feeEstimator) @@ -776,7 +776,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing kst := ksmocks.NewEth(t) estimator := gasmocks.NewEvmEstimator(t) - estimator.On("BumpDynamicFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.DynamicFee{}, pkgerrors.Wrapf(commonfee.ErrConnectivity, "transaction...")) + estimator.On("BumpDynamicFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.DynamicFee{}, pkgerrors.Wrapf(fees.ErrConnectivity, "transaction...")) newEst := func(logger.Logger) gas.EvmEstimator { return estimator } // Create confirmer with necessary state ge := ccfg.EVM().GasEstimator() diff --git a/core/chains/evm/txmgr/stuck_tx_detector.go b/core/chains/evm/txmgr/stuck_tx_detector.go index a8bb18af416..0550fb7a170 100644 --- a/core/chains/evm/txmgr/stuck_tx_detector.go +++ b/core/chains/evm/txmgr/stuck_tx_detector.go @@ -15,7 +15,8 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/smartcontractkit/chainlink-common/pkg/logger" - feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + + "github.com/smartcontractkit/chainlink/v2/common/fees" "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -25,7 +26,7 @@ import ( ) type stuckTxDetectorGasEstimator interface { - GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (fee gas.EvmFee, chainSpecificFeeLimit uint64, err error) + GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...fees.Opt) (fee gas.EvmFee, chainSpecificFeeLimit uint64, err error) } type stuckTxDetectorClient interface { From d0a7df39f0391b15d67ba5f4ad2268d40d0b3359 Mon Sep 17 00:00:00 2001 From: Oliver Townsend <133903322+ogtownsend@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:08:56 -0800 Subject: [PATCH 65/91] Add chaintype.ChainZircuit to chaintypes with rollup support in L1 oracle (#15913) * Add chaintype.ChainZircuit to chaintypes with rollup support in L1 oracle * changeset * sort alphabetically --- .changeset/five-beds-wait.md | 5 +++++ core/chains/evm/gas/rollups/l1_oracle.go | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/five-beds-wait.md diff --git a/.changeset/five-beds-wait.md b/.changeset/five-beds-wait.md new file mode 100644 index 00000000000..36ee14f49b6 --- /dev/null +++ b/.changeset/five-beds-wait.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#bugfix Add chaintype.ChainZircuit to chaintypes with rollup support in L1 oracle to prevent a nil L1 oracle being used for Zircuit's gas estimator diff --git a/core/chains/evm/gas/rollups/l1_oracle.go b/core/chains/evm/gas/rollups/l1_oracle.go index d9f12dfa79e..50d5dff6e4e 100644 --- a/core/chains/evm/gas/rollups/l1_oracle.go +++ b/core/chains/evm/gas/rollups/l1_oracle.go @@ -50,7 +50,16 @@ const ( PollPeriod = 6 * time.Second ) -var supportedChainTypes = []chaintype.ChainType{chaintype.ChainArbitrum, chaintype.ChainOptimismBedrock, chaintype.ChainKroma, chaintype.ChainScroll, chaintype.ChainZkSync, chaintype.ChainMantle} +// Sort alphabetically +var supportedChainTypes = []chaintype.ChainType{ + chaintype.ChainArbitrum, + chaintype.ChainKroma, + chaintype.ChainMantle, + chaintype.ChainOptimismBedrock, + chaintype.ChainScroll, + chaintype.ChainZircuit, + chaintype.ChainZkSync, +} func IsRollupWithL1Support(chainType chaintype.ChainType) bool { return slices.Contains(supportedChainTypes, chainType) From e18884cd789663fea62ec0dfefbbad7750363d4e Mon Sep 17 00:00:00 2001 From: dimitris Date: Wed, 15 Jan 2025 20:39:01 +0200 Subject: [PATCH 66/91] CCIP-4852 Fix cs deploy chain linkToken and Add RMN Permabless changeset (#15918) * fix cs deploy chain * require at least one of LinkToken StaticLinkToken * more updates to link token address reference * rmn permabless changeset * comments * fix the tests * more updates * fix all tests * ignore underscore in package name * trying to fix test * fix comments * add state validate * review comments * fix err message --------- Co-authored-by: AnieeG --- deployment/.golangci.yml | 3 + .../ccip/changeset/cs_ccip_home_test.go | 2 +- deployment/ccip/changeset/cs_deploy_chain.go | 24 ++- deployment/ccip/changeset/cs_prerequisites.go | 14 +- deployment/ccip/changeset/state.go | 22 ++- deployment/ccip/changeset/test_environment.go | 13 +- .../ccip/changeset/v1_5/cs_lane_contracts.go | 2 +- deployment/ccip/changeset/v1_5/cs_rmn.go | 169 ++++++++++++++++++ deployment/ccip/changeset/v1_5/e2e_test.go | 39 +++- .../ccip/changeset/v1_5/test_helpers.go | 21 ++- .../ccip/ccip_migration_to_v_1_6_test.go | 49 ++++- 11 files changed, 324 insertions(+), 34 deletions(-) create mode 100644 deployment/ccip/changeset/v1_5/cs_rmn.go diff --git a/deployment/.golangci.yml b/deployment/.golangci.yml index 7341210ce00..edfe43c7c43 100644 --- a/deployment/.golangci.yml +++ b/deployment/.golangci.yml @@ -166,6 +166,9 @@ linters-settings: require-explanation: true issues: exclude-rules: + - text: "^var-naming: don't use an underscore in package name" + linters: + - revive - path: memory/(.+)\.go linters: - revive diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go index cde4d9919bb..96220477384 100644 --- a/deployment/ccip/changeset/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/cs_ccip_home_test.go @@ -27,7 +27,7 @@ import ( func TestInvalidOCR3Params(t *testing.T) { e, _ := NewMemoryEnvironment(t, - WithPrerequisiteDeployment()) + WithPrerequisiteDeployment(nil)) chain1 := e.Env.AllChainSelectors()[0] envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) diff --git a/deployment/ccip/changeset/cs_deploy_chain.go b/deployment/ccip/changeset/cs_deploy_chain.go index 1f985789c8d..175498ba2cf 100644 --- a/deployment/ccip/changeset/cs_deploy_chain.go +++ b/deployment/ccip/changeset/cs_deploy_chain.go @@ -119,8 +119,14 @@ func deployChainContractsForChains( if !ok { return fmt.Errorf("chain %d not found", chainSel) } - if existingState.Chains[chainSel].LinkToken == nil || existingState.Chains[chainSel].Weth9 == nil { - return fmt.Errorf("fee tokens not found for chain %d", chainSel) + + staticLinkExists := existingState.Chains[chainSel].StaticLinkToken != nil + linkExists := existingState.Chains[chainSel].LinkToken != nil + weth9Exists := existingState.Chains[chainSel].Weth9 != nil + feeTokensAreValid := weth9Exists && (linkExists != staticLinkExists) + + if !feeTokensAreValid { + return fmt.Errorf("fee tokens not valid for chain %d, staticLinkExists: %t, linkExists: %t, weth9Exists: %t", chainSel, staticLinkExists, linkExists, weth9Exists) } deployGrp.Go( func() error { @@ -162,10 +168,10 @@ func deployChainContracts( return fmt.Errorf("timelock not found for chain %s, deploy the mcms contracts first", chain.String()) } weth9Contract := chainState.Weth9 - if chainState.LinkToken == nil { - return fmt.Errorf("link token not found for chain %s, deploy the prerequisites first", chain.String()) + linkTokenContractAddr, err := chainState.LinkTokenAddress() + if err != nil { + return fmt.Errorf("failed to get link token address for chain %s: %w", chain.String(), err) } - linkTokenContract := chainState.LinkToken if chainState.TokenAdminRegistry == nil { return fmt.Errorf("token admin registry not found for chain %s, deploy the prerequisites first", chain.String()) } @@ -285,17 +291,17 @@ func deployChainContracts( chain.Client, fee_quoter.FeeQuoterStaticConfig{ MaxFeeJuelsPerMsg: big.NewInt(0).Mul(big.NewInt(2e2), big.NewInt(1e18)), - LinkToken: linkTokenContract.Address(), + LinkToken: linkTokenContractAddr, TokenPriceStalenessThreshold: uint32(24 * 60 * 60), }, - []common.Address{state.Chains[chain.Selector].Timelock.Address()}, // timelock should be able to update, ramps added after - []common.Address{weth9Contract.Address(), linkTokenContract.Address()}, // fee tokens + []common.Address{state.Chains[chain.Selector].Timelock.Address()}, // timelock should be able to update, ramps added after + []common.Address{weth9Contract.Address(), linkTokenContractAddr}, // fee tokens []fee_quoter.FeeQuoterTokenPriceFeedUpdate{}, []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{}, // TODO: tokens []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs{ { PremiumMultiplierWeiPerEth: 9e17, // 0.9 ETH - Token: linkTokenContract.Address(), + Token: linkTokenContractAddr, }, { PremiumMultiplierWeiPerEth: 1e18, diff --git a/deployment/ccip/changeset/cs_prerequisites.go b/deployment/ccip/changeset/cs_prerequisites.go index 2736ecf44bf..33db57cdc91 100644 --- a/deployment/ccip/changeset/cs_prerequisites.go +++ b/deployment/ccip/changeset/cs_prerequisites.go @@ -52,10 +52,10 @@ func DeployPrerequisites(env deployment.Environment, cfg DeployPrerequisiteConfi type DeployPrerequisiteContractsOpts struct { USDCEnabled bool Multicall3Enabled bool - LegacyDeploymentCfg *LegacyDeploymentConfig + LegacyDeploymentCfg *V1_5DeploymentConfig } -type LegacyDeploymentConfig struct { +type V1_5DeploymentConfig struct { RMNConfig *rmn_contract.RMNConfig PriceRegStalenessThreshold uint32 } @@ -98,7 +98,7 @@ func WithMultiCall3Enabled() PrerequisiteOpt { } } -func WithLegacyDeploymentEnabled(cfg LegacyDeploymentConfig) PrerequisiteOpt { +func WithLegacyDeploymentEnabled(cfg V1_5DeploymentConfig) PrerequisiteOpt { return func(o *DeployPrerequisiteContractsOpts) { if cfg.PriceRegStalenessThreshold == 0 { panic("PriceRegStalenessThreshold must be set") @@ -171,7 +171,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address } }) if err != nil { - lggr.Errorw("Failed to deploy RMN", "chain", chain.String(), "err", err) + lggr.Errorw("Failed to deploy RMN", "chain", chain.String(), "err", deployment.MaybeDataErr(err)) return err } rmnAddr = rmn.Address @@ -407,13 +407,17 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address // Only applicable if setting up for 1.5 version, remove this once we have fully migrated to 1.6 if deployOpts.LegacyDeploymentCfg != nil { if chainState.PriceRegistry == nil { + linkAddr, err1 := chainState.LinkTokenAddress() + if err1 != nil { + return fmt.Errorf("failed to get link token address for chain %s: %w", chain.String(), err1) + } _, err := deployment.DeployContract(lggr, chain, ab, func(chain deployment.Chain) deployment.ContractDeploy[*price_registry_1_2_0.PriceRegistry] { priceRegAddr, tx2, priceRegAddrC, err2 := price_registry_1_2_0.DeployPriceRegistry( chain.DeployerKey, chain.Client, nil, - []common.Address{weth9Contract.Address(), chainState.LinkToken.Address()}, + []common.Address{weth9Contract.Address(), linkAddr}, deployOpts.LegacyDeploymentCfg.PriceRegStalenessThreshold, ) return deployment.ContractDeploy[*price_registry_1_2_0.PriceRegistry]{ diff --git a/deployment/ccip/changeset/state.go b/deployment/ccip/changeset/state.go index e5b8577cd43..b1f44ac4b99 100644 --- a/deployment/ccip/changeset/state.go +++ b/deployment/ccip/changeset/state.go @@ -142,6 +142,16 @@ type CCIPChainState struct { RMN *rmn_contract.RMNContract } +func (c CCIPChainState) LinkTokenAddress() (common.Address, error) { + if c.LinkToken != nil { + return c.LinkToken.Address(), nil + } + if c.StaticLinkToken != nil { + return c.StaticLinkToken.Address(), nil + } + return common.Address{}, errors.New("no link token found in the state") +} + func (c CCIPChainState) GenerateView() (view.ChainView, error) { chainView := view.NewChain() if c.Router != nil { @@ -315,6 +325,16 @@ type CCIPOnChainState struct { SolChains map[uint64]SolCCIPChainState } +func (s CCIPOnChainState) Validate() error { + for sel, chain := range s.Chains { + // cannot have static link and link together + if chain.LinkToken != nil && chain.StaticLinkToken != nil { + return fmt.Errorf("cannot have both link and static link token on the same chain %d", sel) + } + } + return nil +} + func (s CCIPOnChainState) GetAllProposerMCMSForChains(chains []uint64) (map[uint64]*gethwrappers.ManyChainMultiSig, error) { multiSigs := make(map[uint64]*gethwrappers.ManyChainMultiSig) for _, chain := range chains { @@ -397,7 +417,7 @@ func LoadOnchainState(e deployment.Environment) (CCIPOnChainState, error) { } state.Chains[chainSelector] = chainState } - return state, nil + return state, state.Validate() } // LoadChainState Loads all state for a chain into state diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/test_environment.go index fc1c232f367..16994211010 100644 --- a/deployment/ccip/changeset/test_environment.go +++ b/deployment/ccip/changeset/test_environment.go @@ -44,6 +44,7 @@ type TestConfigs struct { // TODO: This should be CreateContracts so the booleans make sense? CreateJobAndContracts bool PrerequisiteDeploymentOnly bool + V1_5Cfg V1_5DeploymentConfig Chains int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input ChainIDs []uint64 // only used in memory mode, for docker mode, this is determined by the integration-test config toml input NumOfUsersPerChain int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input @@ -106,9 +107,12 @@ func WithMultiCall3() TestOps { } } -func WithPrerequisiteDeployment() TestOps { +func WithPrerequisiteDeployment(v1_5Cfg *V1_5DeploymentConfig) TestOps { return func(testCfg *TestConfigs) { testCfg.PrerequisiteDeploymentOnly = true + if v1_5Cfg != nil { + testCfg.V1_5Cfg = *v1_5Cfg + } } } @@ -361,10 +365,9 @@ func NewEnvironmentWithPrerequisitesContracts(t *testing.T, tEnv TestEnvironment opts = append(opts, WithMultiCall3Enabled()) } } - // no RMNConfig will ensure that mock RMN is deployed - opts = append(opts, WithLegacyDeploymentEnabled(LegacyDeploymentConfig{ - PriceRegStalenessThreshold: 60 * 60 * 24 * 14, // two weeks - })) + if tc.V1_5Cfg != (V1_5DeploymentConfig{}) { + opts = append(opts, WithLegacyDeploymentEnabled(tc.V1_5Cfg)) + } prereqCfg = append(prereqCfg, DeployPrerequisiteConfigPerChain{ ChainSelector: chain, Opts: opts, diff --git a/deployment/ccip/changeset/v1_5/cs_lane_contracts.go b/deployment/ccip/changeset/v1_5/cs_lane_contracts.go index 2d6c8fcb5ed..25e14c898ff 100644 --- a/deployment/ccip/changeset/v1_5/cs_lane_contracts.go +++ b/deployment/ccip/changeset/v1_5/cs_lane_contracts.go @@ -275,7 +275,7 @@ func arePrerequisitesMet(chainState changeset.CCIPChainState, chain deployment.C if chainState.Weth9 == nil { return fmt.Errorf("WETH9 not found for chain %s", chain.String()) } - if chainState.LinkToken == nil { + if _, err := chainState.LinkTokenAddress(); err != nil { return fmt.Errorf("LINK token not found for chain %s", chain.String()) } if chainState.TokenAdminRegistry == nil { diff --git a/deployment/ccip/changeset/v1_5/cs_rmn.go b/deployment/ccip/changeset/v1_5/cs_rmn.go new file mode 100644 index 00000000000..df96645b9bf --- /dev/null +++ b/deployment/ccip/changeset/v1_5/cs_rmn.go @@ -0,0 +1,169 @@ +package v1_5 + +import ( + "context" + "fmt" + "math/big" + "slices" + + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +) + +var _ deployment.ChangeSet[PermaBlessCommitStoreConfig] = PermaBlessCommitStoreCS + +type PermaBlessConfigPerSourceChain struct { + SourceChainSelector uint64 + PermaBless bool // if true, the commit store will be included in adds and if false it will be included in removes list, + // https://github.com/smartcontractkit/ccip/blob/ccip-develop/contracts/src/v0.8/ccip/RMN.sol#L699C30-L699C54 +} + +func (p PermaBlessConfigPerSourceChain) Validate(destChain uint64, state changeset.CCIPOnChainState, permaBlessedCommitStores []common.Address) error { + if err := deployment.IsValidChainSelector(p.SourceChainSelector); err != nil { + return fmt.Errorf("invalid SourceChainSelector: %w", err) + } + _, ok := state.Chains[p.SourceChainSelector] + if !ok { + return fmt.Errorf("source chain state not found for chain selector %d", p.SourceChainSelector) + } + destState := state.Chains[destChain] + if destState.CommitStore[p.SourceChainSelector] == nil { + return fmt.Errorf("dest chain %d does not have a commit store for source chain %d", destChain, p.SourceChainSelector) + } + + if p.PermaBless { + if slices.Contains(permaBlessedCommitStores, destState.CommitStore[p.SourceChainSelector].Address()) { + return fmt.Errorf("commit store for source chain %d is already permablessed", p.SourceChainSelector) + } + } else { + if !slices.Contains(permaBlessedCommitStores, destState.CommitStore[p.SourceChainSelector].Address()) { + return fmt.Errorf("commit store for source chain %d is not permablessed, cannot be removed", p.SourceChainSelector) + } + } + return nil +} + +type PermaBlessCommitStoreConfigPerDest struct { + Sources []PermaBlessConfigPerSourceChain +} + +type PermaBlessCommitStoreConfig struct { + Configs map[uint64]PermaBlessCommitStoreConfigPerDest + MCMSConfig *changeset.MCMSConfig +} + +func (c PermaBlessCommitStoreConfig) Validate(env deployment.Environment) error { + state, err := changeset.LoadOnchainState(env) + if err != nil { + return fmt.Errorf("failed to load onchain state: %w", err) + } + for destChain, pCfg := range c.Configs { + if err := deployment.IsValidChainSelector(destChain); err != nil { + return fmt.Errorf("invalid DestChainSelector: %w", err) + } + destState, ok := state.Chains[destChain] + if !ok { + return fmt.Errorf("dest chain state not found for chain selector %d", destChain) + } + if destState.RMN == nil { + return fmt.Errorf("dest chain %d does not have an RMN", destChain) + } + if destState.CommitStore == nil { + return fmt.Errorf("dest chain %d does not have any commit store", destChain) + } + // get all permablessed commit stores + permaBlessedCommitStores, err := destState.RMN.GetPermaBlessedCommitStores(nil) + if err != nil { + return fmt.Errorf("failed to get perma blessed commit stores: %w", err) + } + for _, sourceCfg := range pCfg.Sources { + if err := sourceCfg.Validate(destChain, state, permaBlessedCommitStores); err != nil { + return fmt.Errorf("invalid PermaBlessConfig for source chain %d and dest chain %d : %w", sourceCfg.SourceChainSelector, destChain, err) + } + } + + if err := commoncs.ValidateOwnership(context.Background(), c.MCMSConfig != nil, env.Chains[destChain].DeployerKey.From, destState.Timelock.Address(), destState.RMN); err != nil { + return fmt.Errorf("failed to validate ownership: %w", err) + } + } + return nil +} + +// PermaBlessCommitStoreCS permablesses the commit stores on the RMN contract +// If commit store addresses are added to the permaBlessed list, those will be considered automatically blessed. +// This changeset can add to or remove from the existing permaBlessed list. +func PermaBlessCommitStoreCS(env deployment.Environment, c PermaBlessCommitStoreConfig) (deployment.ChangesetOutput, error) { + if err := c.Validate(env); err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("invalid PermaBlessCommitStoreConfig: %w", err) + } + state, err := changeset.LoadOnchainState(env) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) + } + ops := make([]timelock.BatchChainOperation, 0) + timelocks := make(map[uint64]common.Address) + proposerMCM := make(map[uint64]*gethwrappers.ManyChainMultiSig) + for destChain, cfg := range c.Configs { + destState := state.Chains[destChain] + RMN := destState.RMN + var removes []common.Address + var adds []common.Address + for _, sourceCfg := range cfg.Sources { + commitStore := destState.CommitStore[sourceCfg.SourceChainSelector] + if sourceCfg.PermaBless { + adds = append(adds, commitStore.Address()) + } else { + removes = append(removes, commitStore.Address()) + } + } + txOpts := env.Chains[destChain].DeployerKey + if c.MCMSConfig != nil { + txOpts = deployment.SimTransactOpts() + } + tx, err := RMN.OwnerRemoveThenAddPermaBlessedCommitStores(txOpts, removes, adds) + if c.MCMSConfig == nil { + _, err = deployment.ConfirmIfNoError(env.Chains[destChain], tx, err) + if err != nil { + return deployment.ChangesetOutput{}, err + } + env.Logger.Infof("PermaBlessed commit stores on chain %d removed %v, added %v", destChain, removes, adds) + continue + } + timelocks[destChain] = destState.Timelock.Address() + proposerMCM[destChain] = destState.ProposerMcm + ops = append(ops, timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(destChain), + Batch: []mcms.Operation{ + { + To: RMN.Address(), + Data: tx.Data(), + Value: big.NewInt(0), + }, + }, + }) + } + if c.MCMSConfig == nil { + return deployment.ChangesetOutput{}, nil + } + p, err := proposalutils.BuildProposalFromBatches( + timelocks, + proposerMCM, + ops, + "PermaBless commit stores on RMN", + c.MCMSConfig.MinDelay, + ) + if err != nil { + return deployment.ChangesetOutput{}, err + } + env.Logger.Infof("perma bless commit stores proposal created with %d operations", len(ops)) + return deployment.ChangesetOutput{Proposals: []timelock.MCMSWithTimelockProposal{ + *p, + }}, nil +} diff --git a/deployment/ccip/changeset/v1_5/e2e_test.go b/deployment/ccip/changeset/v1_5/e2e_test.go index 2019758b179..59d6a30066c 100644 --- a/deployment/ccip/changeset/v1_5/e2e_test.go +++ b/deployment/ccip/changeset/v1_5/e2e_test.go @@ -9,6 +9,9 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) @@ -17,7 +20,22 @@ import ( func TestE2ELegacy(t *testing.T) { e, _ := changeset.NewMemoryEnvironment( t, - changeset.WithPrerequisiteDeployment(), + changeset.WithPrerequisiteDeployment(&changeset.V1_5DeploymentConfig{ + PriceRegStalenessThreshold: 60 * 60 * 24 * 14, // two weeks + RMNConfig: &rmn_contract.RMNConfig{ + BlessWeightThreshold: 2, + CurseWeightThreshold: 2, + // setting dummy voters, we will permabless this later + Voters: []rmn_contract.RMNVoter{ + { + BlessWeight: 2, + CurseWeight: 2, + BlessVoteAddr: utils.RandomAddress(), + CurseVoteAddr: utils.RandomAddress(), + }, + }, + }, + }), changeset.WithChains(3), changeset.WithChainIds([]uint64{chainselectors.GETH_TESTNET.EvmChainID})) state, err := changeset.LoadOnchainState(e.Env) @@ -32,6 +50,25 @@ func TestE2ELegacy(t *testing.T) { {SourceChainSelector: src, DestChainSelector: dest}, } e.Env = AddLanes(t, e.Env, state, pairs) + // permabless the commit stores + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(PermaBlessCommitStoreCS), + Config: PermaBlessCommitStoreConfig{ + Configs: map[uint64]PermaBlessCommitStoreConfigPerDest{ + dest: { + Sources: []PermaBlessConfigPerSourceChain{ + { + SourceChainSelector: src, + PermaBless: true, + }, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) // reload state after adding lanes state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) diff --git a/deployment/ccip/changeset/v1_5/test_helpers.go b/deployment/ccip/changeset/v1_5/test_helpers.go index e1a03539a77..671089a5546 100644 --- a/deployment/ccip/changeset/v1_5/test_helpers.go +++ b/deployment/ccip/changeset/v1_5/test_helpers.go @@ -73,13 +73,15 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change src := pair.SourceChainSelector sourceChainState := state.Chains[src] destChainState := state.Chains[dest] - require.NotNil(t, sourceChainState.LinkToken) + _, err := sourceChainState.LinkTokenAddress() + require.NoError(t, err) require.NotNil(t, sourceChainState.RMNProxy) require.NotNil(t, sourceChainState.TokenAdminRegistry) require.NotNil(t, sourceChainState.Router) require.NotNil(t, sourceChainState.PriceRegistry) require.NotNil(t, sourceChainState.Weth9) - require.NotNil(t, destChainState.LinkToken) + _, err = destChainState.LinkTokenAddress() + require.NoError(t, err) require.NotNil(t, destChainState.RMNProxy) require.NotNil(t, destChainState.TokenAdminRegistry) tokenPrice, _, _ := CreatePricesPipeline(t, state, src, dest) @@ -96,11 +98,13 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change TokenPricesUSDPipeline: tokenPrice, DestinationStartBlock: block.Number.Uint64(), }) + srcLinkTokenAddr, err := sourceChainState.LinkTokenAddress() + require.NoError(t, err) addLanesCfg = append(addLanesCfg, DeployLaneConfig{ SourceChainSelector: src, DestinationChainSelector: dest, OnRampStaticCfg: evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ - LinkToken: sourceChainState.LinkToken.Address(), + LinkToken: srcLinkTokenAddr, ChainSelector: src, DestChainSelector: dest, DefaultTxGasLimit: 200_000, @@ -125,7 +129,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change }, OnRampFeeTokenArgs: []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ { - Token: sourceChainState.LinkToken.Address(), + Token: srcLinkTokenAddr, NetworkFeeUSDCents: 1_00, GasMultiplierWeiPerEth: 1e18, PremiumMultiplierWeiPerEth: 9e17, @@ -141,7 +145,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change }, OnRampTransferTokenCfgs: []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ { - Token: sourceChainState.LinkToken.Address(), + Token: srcLinkTokenAddr, MinFeeUSDCents: 50, // $0.5 MaxFeeUSDCents: 1_000_000_00, // $ 1 million DeciBps: 5_0, // 5 bps @@ -163,7 +167,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change }, InitialTokenPrices: []price_registry_1_2_0.InternalTokenPriceUpdate{ { - SourceToken: sourceChainState.LinkToken.Address(), + SourceToken: srcLinkTokenAddr, UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(20)), }, { @@ -214,7 +218,8 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change func CreatePricesPipeline(t *testing.T, state changeset.CCIPOnChainState, source, dest uint64) (string, *httptest.Server, *httptest.Server) { sourceRouter := state.Chains[source].Router destRouter := state.Chains[dest].Router - destLink := state.Chains[dest].LinkToken + destLinkAddr, err := state.Chains[dest].LinkTokenAddress() + require.NoError(t, err) linkUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { _, err := w.Write([]byte(`{"UsdPerLink": "8000000000000000000"}`)) require.NoError(t, err) @@ -240,7 +245,7 @@ eth [type=http method=GET url="%s"]; eth_parse [type=jsonparse path="UsdPerETH"]; eth->eth_parse; merge [type=merge left="{}" right="{\\\"%s\\\":$(link_parse), \\\"%s\\\":$(eth_parse), \\\"%s\\\":$(eth_parse)}"];`, - linkUSD.URL, ethUSD.URL, destLink.Address(), sourceWrappedNative, destWrappedNative) + linkUSD.URL, ethUSD.URL, destLinkAddr, sourceWrappedNative, destWrappedNative) return tokenPricesUSDPipeline, linkUSD, ethUSD } diff --git a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go index 0559054f2d6..5c35be01f93 100644 --- a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go +++ b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go @@ -15,15 +15,34 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) func TestMigrateFromV1_5ToV1_6(t *testing.T) { + t.Skipf("CCIP-4868 -This test needs to be investigated for flakiness") // Deploy CCIP 1.5 with 3 chains and 4 nodes + 1 bootstrap - // Deploy 1.5 contracts (excluding pools and real RMN, use MockRMN to start, but including MCMS) . + // Deploy 1.5 contracts (excluding pools to start, but including MCMS) . e, _, tEnv := testsetups.NewIntegrationEnvironment( t, - changeset.WithPrerequisiteDeployment(), + changeset.WithPrerequisiteDeployment( + &changeset.V1_5DeploymentConfig{ + PriceRegStalenessThreshold: 60 * 60 * 24 * 14, // two weeks + RMNConfig: &rmn_contract.RMNConfig{ + BlessWeightThreshold: 2, + CurseWeightThreshold: 2, + // setting dummy voters, we will permabless this later + Voters: []rmn_contract.RMNVoter{ + { + BlessWeight: 2, + CurseWeight: 2, + BlessVoteAddr: utils.RandomAddress(), + CurseVoteAddr: utils.RandomAddress(), + }, + }, + }, + }), changeset.WithChains(3), changeset.WithUsersPerChain(2), // for in-memory test it is important to set the dest chain id as 1337 otherwise the config digest will not match @@ -45,6 +64,29 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // deploy onRamp, commit store, offramp , set ocr2config and send corresponding jobs e.Env = v1_5.AddLanes(t, e.Env, state, pairs) + // permabless the commit stores + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(v1_5.PermaBlessCommitStoreCS), + Config: v1_5.PermaBlessCommitStoreConfig{ + Configs: map[uint64]v1_5.PermaBlessCommitStoreConfigPerDest{ + dest: { + Sources: []v1_5.PermaBlessConfigPerSourceChain{ + { + SourceChainSelector: src1, + PermaBless: true, + }, + { + SourceChainSelector: src2, + PermaBless: true, + }, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) // reload state after adding lanes state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) @@ -80,7 +122,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { state.Chains[chain].RMNProxy.Address(), state.Chains[chain].PriceRegistry.Address(), state.Chains[chain].TokenAdminRegistry.Address(), - state.Chains[chain].MockRMN.Address(), + state.Chains[chain].RMN.Address(), } if state.Chains[chain].EVM2EVMOnRamp != nil { for _, onRamp := range state.Chains[chain].EVM2EVMOnRamp { @@ -165,6 +207,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // Enable a single 1.6 lane with test router changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, src1, dest, true) require.GreaterOrEqual(t, len(e.Users[src1]), 2) + changeset.ReplayLogs(t, e.Env.Offchain, e.ReplayBlocks) startBlocks := make(map[uint64]*uint64) latesthdr, err := e.Env.Chains[dest].Client.HeaderByNumber(testcontext.Get(t), nil) require.NoError(t, err) From 58ceadaa2b30f59873db49aac4088c5244291011 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 15 Jan 2025 13:45:37 -0500 Subject: [PATCH 67/91] Node Version Heartbeat (#15700) * rough implementation of node heartbeat * consuming services engine to simplify tick + start/close handling * fixing duration^2 bug * fixing health tests * fixing testscripts test; using eng logger; using time.seconds const * minor refactoring * NodeHeartbeat --> Heartbeat * removing close from Heartbeat --- core/services/chainlink/application.go | 63 +++++++++++++++++++ core/services/chainlink/config_telemetry.go | 9 ++- .../chainlink/config_telemetry_test.go | 14 +++-- core/web/testdata/body/health.html | 3 + core/web/testdata/body/health.json | 9 +++ core/web/testdata/body/health.txt | 1 + testdata/scripts/health/default.txtar | 10 +++ testdata/scripts/health/multi-chain.txtar | 10 +++ 8 files changed, 112 insertions(+), 7 deletions(-) diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 4004b86c341..06289b13fd4 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -7,6 +7,7 @@ import ( "math/big" "net/http" "sync" + "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -20,10 +21,12 @@ import ( "go.uber.org/multierr" "go.uber.org/zap/zapcore" + "github.com/smartcontractkit/chainlink-common/pkg/beholder" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" "github.com/smartcontractkit/chainlink-common/pkg/loop" commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/pkg/timeutil" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" @@ -80,6 +83,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/plugins" ) +const HeartbeatPeriod = time.Second + // Application implements the common functions used in the core node. type Application interface { Start(ctx context.Context) error @@ -192,6 +197,60 @@ type ApplicationOpts struct { NewOracleFactoryFn standardcapabilities.NewOracleFactoryFn } +type Heartbeat struct { + commonservices.Service + eng *commonservices.Engine + + beat time.Duration +} + +func NewHeartbeat(lggr logger.Logger) Heartbeat { + h := Heartbeat{ + beat: HeartbeatPeriod, + } + h.Service, h.eng = commonservices.Config{ + Name: "Heartbeat", + Start: h.start, + }.NewServiceEngine(lggr) + return h +} + +func (h *Heartbeat) start(_ context.Context) error { + // Setup beholder resources + gauge, err := beholder.GetMeter().Int64Gauge("heartbeat") + if err != nil { + return err + } + count, err := beholder.GetMeter().Int64Gauge("heartbeat_count") + if err != nil { + return err + } + + cme := custmsg.NewLabeler() + + // Define tick functions + beatFn := func(ctx context.Context) { + // TODO allow override of tracer provider into engine for beholder + _, innerSpan := beholder.GetTracer().Start(ctx, "heartbeat.beat") + defer innerSpan.End() + + gauge.Record(ctx, 1) + count.Record(ctx, 1) + + err = cme.Emit(ctx, "heartbeat") + if err != nil { + h.eng.Errorw("heartbeat emit failed", "err", err) + } + } + + h.eng.GoTick(timeutil.NewTicker(h.getBeat), beatFn) + return nil +} + +func (h *Heartbeat) getBeat() time.Duration { + return h.beat +} + // NewApplication initializes a new store if one is not already // present at the configured root directory (default: ~/.chainlink), // the logger at the same directory and returns the Application to @@ -199,6 +258,10 @@ type ApplicationOpts struct { // TODO: Inject more dependencies here to save booting up useless stuff in tests func NewApplication(opts ApplicationOpts) (Application, error) { var srvcs []services.ServiceCtx + + heartbeat := NewHeartbeat(opts.Logger) + srvcs = append(srvcs, &heartbeat) + auditLogger := opts.AuditLogger cfg := opts.Config relayerChainInterops := opts.RelayerChainInteroperators diff --git a/core/services/chainlink/config_telemetry.go b/core/services/chainlink/config_telemetry.go index 125eeed64e5..f2359997933 100644 --- a/core/services/chainlink/config_telemetry.go +++ b/core/services/chainlink/config_telemetry.go @@ -1,6 +1,7 @@ package chainlink import ( + "fmt" "time" "github.com/smartcontractkit/chainlink/v2/core/config/toml" @@ -42,9 +43,13 @@ func (b *telemetryConfig) OtelExporterGRPCEndpoint() string { // // These can be overridden by the TOML if the user so chooses func (b *telemetryConfig) ResourceAttributes() map[string]string { + sha, ver := static.Short() + defaults := map[string]string{ - "service.name": "chainlink", - "service.version": static.Version, + "service.name": "chainlink", + "service.version": static.Version, + "service.sha": static.Sha, + "service.shortversion": fmt.Sprintf("%s@%s", ver, sha), } for k, v := range b.s.ResourceAttributes { diff --git a/core/services/chainlink/config_telemetry_test.go b/core/services/chainlink/config_telemetry_test.go index d0963129994..0627da03fb4 100644 --- a/core/services/chainlink/config_telemetry_test.go +++ b/core/services/chainlink/config_telemetry_test.go @@ -97,17 +97,21 @@ func TestTelemetryConfig_ResourceAttributes(t *testing.T) { "DefaultAttributes", toml.Telemetry{ResourceAttributes: nil}, map[string]string{ - "service.name": "chainlink", - "service.version": static.Version, + "service.name": "chainlink", + "service.sha": "unset", + "service.shortversion": "unset@unset", + "service.version": static.Version, }, }, { "CustomAttributes", toml.Telemetry{ResourceAttributes: map[string]string{"custom.key": "custom.value"}}, map[string]string{ - "service.name": "chainlink", - "service.version": static.Version, - "custom.key": "custom.value", + "service.name": "chainlink", + "service.sha": "unset", + "service.shortversion": "unset@unset", + "service.version": static.Version, + "custom.key": "custom.value", }, }, } diff --git a/core/web/testdata/body/health.html b/core/web/testdata/body/health.html index 4692d452a5b..cff516904bc 100644 --- a/core/web/testdata/body/health.html +++ b/core/web/testdata/body/health.html @@ -93,6 +93,9 @@

HeadReporter
+
+ Heartbeat +
JobSpawner
diff --git a/core/web/testdata/body/health.json b/core/web/testdata/body/health.json index 8c4c3b312de..9c36f4d4a47 100644 --- a/core/web/testdata/body/health.json +++ b/core/web/testdata/body/health.json @@ -153,6 +153,15 @@ "output": "" } }, + { + "type": "checks", + "id": "Heartbeat", + "attributes": { + "name": "Heartbeat", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "JobSpawner", diff --git a/core/web/testdata/body/health.txt b/core/web/testdata/body/health.txt index a098f906146..a12bbae56ef 100644 --- a/core/web/testdata/body/health.txt +++ b/core/web/testdata/body/health.txt @@ -16,6 +16,7 @@ ok EVM.0.Txm.Confirmer ok EVM.0.Txm.Finalizer ok EVM.0.Txm.WrappedEvmEstimator ok HeadReporter +ok Heartbeat ok JobSpawner ok Mailbox.Monitor ok Mercury.WSRPCPool diff --git a/testdata/scripts/health/default.txtar b/testdata/scripts/health/default.txtar index 73b82bc7e39..e5b3d4176f6 100644 --- a/testdata/scripts/health/default.txtar +++ b/testdata/scripts/health/default.txtar @@ -32,6 +32,7 @@ HTTPPort = $PORT -- out.txt -- ok HeadReporter +ok Heartbeat ok JobSpawner ok Mailbox.Monitor ok Mercury.WSRPCPool @@ -55,6 +56,15 @@ ok WorkflowDBStore "output": "" } }, + { + "type": "checks", + "id": "Heartbeat", + "attributes": { + "name": "Heartbeat", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "JobSpawner", diff --git a/testdata/scripts/health/multi-chain.txtar b/testdata/scripts/health/multi-chain.txtar index d3a0caf67b5..5fe2759dcc0 100644 --- a/testdata/scripts/health/multi-chain.txtar +++ b/testdata/scripts/health/multi-chain.txtar @@ -86,6 +86,7 @@ ok EVM.1.Txm.Confirmer ok EVM.1.Txm.Finalizer ok EVM.1.Txm.WrappedEvmEstimator ok HeadReporter +ok Heartbeat ok JobSpawner ok Mailbox.Monitor ok Mercury.WSRPCPool @@ -263,6 +264,15 @@ ok WorkflowDBStore "output": "" } }, + { + "type": "checks", + "id": "Heartbeat", + "attributes": { + "name": "Heartbeat", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "JobSpawner", From f9cc5147878cc5f454e2f36ce9e7da3035af04d3 Mon Sep 17 00:00:00 2001 From: "Simon B.Robert" Date: Wed, 15 Jan 2025 14:28:18 -0500 Subject: [PATCH 68/91] New rmn curse changeset (#15868) * Initial commit * Add unit tests * Cleanup * Add uncurse changeset * Address linting issues * Fix more linting issues * Use changeset in e2e test * Address PR feedback * Fix linting issue and bug with subject * Remove nolint * Use error group * Use global curse only instead of CurseChain since it curse all connected chains * Address PR comments * Fix linting issue * Merge develop * Use fmnt.Errorf * Fix linting issue * Fix linting issue * Additional comments and renaming * Enhance idempotency checks in RMN curse and uncurse operations * Fix build error * Address PR comments * Fix build error * Fix test name * Add more test for deployer group * Fix linting issue --- .../ccip/changeset/cs_rmn_curse_uncurse.go | 334 +++++++++++++++ .../changeset/cs_rmn_curse_uncurse_test.go | 379 ++++++++++++++++++ .../ccip/changeset/cs_update_rmn_config.go | 29 -- deployment/ccip/changeset/deployer_group.go | 194 +++++++++ .../ccip/changeset/deployer_group_test.go | 191 +++++++++ integration-tests/smoke/ccip/ccip_rmn_test.go | 98 +++-- 6 files changed, 1155 insertions(+), 70 deletions(-) create mode 100644 deployment/ccip/changeset/cs_rmn_curse_uncurse.go create mode 100644 deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go create mode 100644 deployment/ccip/changeset/deployer_group.go create mode 100644 deployment/ccip/changeset/deployer_group_test.go diff --git a/deployment/ccip/changeset/cs_rmn_curse_uncurse.go b/deployment/ccip/changeset/cs_rmn_curse_uncurse.go new file mode 100644 index 00000000000..1f3222014e3 --- /dev/null +++ b/deployment/ccip/changeset/cs_rmn_curse_uncurse.go @@ -0,0 +1,334 @@ +package changeset + +import ( + "encoding/binary" + "errors" + "fmt" + + "github.com/smartcontractkit/chainlink/deployment" + commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" +) + +// GlobalCurseSubject as defined here: https://github.com/smartcontractkit/chainlink/blob/new-rmn-curse-changeset/contracts/src/v0.8/ccip/rmn/RMNRemote.sol#L15 +func GlobalCurseSubject() Subject { + return Subject{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} +} + +// RMNCurseAction represent a curse action to be applied on a chain (ChainSelector) with a specific subject (SubjectToCurse) +// The curse action will by applied by calling the Curse method on the RMNRemote contract on the chain (ChainSelector) +type RMNCurseAction struct { + ChainSelector uint64 + SubjectToCurse Subject +} + +// CurseAction is a function that returns a list of RMNCurseAction to be applied on a chain +// CurseChain, CurseLane, CurseGloballyOnlyOnSource are examples of function implementing CurseAction +type CurseAction func(e deployment.Environment) []RMNCurseAction + +type RMNCurseConfig struct { + MCMS *MCMSConfig + CurseActions []CurseAction + Reason string +} + +func (c RMNCurseConfig) Validate(e deployment.Environment) error { + state, err := LoadOnchainState(e) + + if err != nil { + return fmt.Errorf("failed to load onchain state: %w", err) + } + + if len(c.CurseActions) == 0 { + return errors.New("curse actions are required") + } + + if c.Reason == "" { + return errors.New("reason is required") + } + + validSubjects := map[Subject]struct{}{ + GlobalCurseSubject(): {}, + } + for _, selector := range e.AllChainSelectors() { + validSubjects[SelectorToSubject(selector)] = struct{}{} + } + + for _, curseAction := range c.CurseActions { + result := curseAction(e) + for _, action := range result { + targetChain := e.Chains[action.ChainSelector] + targetChainState, ok := state.Chains[action.ChainSelector] + if !ok { + return fmt.Errorf("chain %s not found in onchain state", targetChain.String()) + } + + if err := commoncs.ValidateOwnership(e.GetContext(), c.MCMS != nil, targetChain.DeployerKey.From, targetChainState.Timelock.Address(), targetChainState.RMNRemote); err != nil { + return fmt.Errorf("chain %s: %w", targetChain.String(), err) + } + + if err = deployment.IsValidChainSelector(action.ChainSelector); err != nil { + return fmt.Errorf("invalid chain selector %d for chain %s", action.ChainSelector, targetChain.String()) + } + + if _, ok := validSubjects[action.SubjectToCurse]; !ok { + return fmt.Errorf("invalid subject %x for chain %s", action.SubjectToCurse, targetChain.String()) + } + } + } + + return nil +} + +type Subject = [16]byte + +func SelectorToSubject(selector uint64) Subject { + var b Subject + binary.BigEndian.PutUint64(b[8:], selector) + return b +} + +// CurseLaneOnlyOnSource curses a lane only on the source chain +// This will prevent message from source to destination to be initiated +// One noteworthy behaviour is that this means that message can be sent from destination to source but will not be executed on the source +// Given 3 chains A, B, C +// CurseLaneOnlyOnSource(A, B) will curse A with the curse subject of B +func CurseLaneOnlyOnSource(sourceSelector uint64, destinationSelector uint64) CurseAction { + // Curse from source to destination + return func(e deployment.Environment) []RMNCurseAction { + return []RMNCurseAction{ + { + ChainSelector: sourceSelector, + SubjectToCurse: SelectorToSubject(destinationSelector), + }, + } + } +} + +// CurseGloballyOnlyOnChain curses a chain globally only on the source chain +// Given 3 chains A, B, C +// CurseGloballyOnlyOnChain(A) will curse a with the global curse subject only +func CurseGloballyOnlyOnChain(selector uint64) CurseAction { + return func(e deployment.Environment) []RMNCurseAction { + return []RMNCurseAction{ + { + ChainSelector: selector, + SubjectToCurse: GlobalCurseSubject(), + }, + } + } +} + +// Call Curse on both RMNRemote from source and destination to prevent message from source to destination and vice versa +// Given 3 chains A, B, C +// CurseLaneBidirectionally(A, B) will curse A with the curse subject of B and B with the curse subject of A +func CurseLaneBidirectionally(sourceSelector uint64, destinationSelector uint64) CurseAction { + // Bidirectional curse between two chains + return func(e deployment.Environment) []RMNCurseAction { + return append( + CurseLaneOnlyOnSource(sourceSelector, destinationSelector)(e), + CurseLaneOnlyOnSource(destinationSelector, sourceSelector)(e)..., + ) + } +} + +// CurseChain do a global curse on chainSelector and curse chainSelector on all other chains +// Given 3 chains A, B, C +// CurseChain(A) will curse A with the global curse subject and curse B and C with the curse subject of A +func CurseChain(chainSelector uint64) CurseAction { + return func(e deployment.Environment) []RMNCurseAction { + chainSelectors := e.AllChainSelectors() + + // Curse all other chains to prevent onramp from sending message to the cursed chain + var curseActions []RMNCurseAction + for _, otherChainSelector := range chainSelectors { + if otherChainSelector != chainSelector { + curseActions = append(curseActions, RMNCurseAction{ + ChainSelector: otherChainSelector, + SubjectToCurse: SelectorToSubject(chainSelector), + }) + } + } + + // Curse the chain with a global curse to prevent any onramp or offramp message from send message in and out of the chain + curseActions = append(curseActions, CurseGloballyOnlyOnChain(chainSelector)(e)...) + + return curseActions + } +} + +func groupRMNSubjectBySelector(rmnSubjects []RMNCurseAction, avoidCursingSelf bool, onlyKeepGlobal bool) map[uint64][]Subject { + grouped := make(map[uint64][]Subject) + for _, s := range rmnSubjects { + // Skip self-curse if needed + if s.SubjectToCurse == SelectorToSubject(s.ChainSelector) && avoidCursingSelf { + continue + } + // Initialize slice for this chain if needed + if _, ok := grouped[s.ChainSelector]; !ok { + grouped[s.ChainSelector] = []Subject{} + } + // If global is already set and we only keep global, skip + if onlyKeepGlobal && len(grouped[s.ChainSelector]) == 1 && grouped[s.ChainSelector][0] == GlobalCurseSubject() { + continue + } + // If subject is global and we only keep global, reset immediately + if s.SubjectToCurse == GlobalCurseSubject() && onlyKeepGlobal { + grouped[s.ChainSelector] = []Subject{GlobalCurseSubject()} + continue + } + // Ensure uniqueness + duplicate := false + for _, added := range grouped[s.ChainSelector] { + if added == s.SubjectToCurse { + duplicate = true + break + } + } + if !duplicate { + grouped[s.ChainSelector] = append(grouped[s.ChainSelector], s.SubjectToCurse) + } + } + + return grouped +} + +// RMNCurseChangeset creates a new changeset for cursing chains or lanes on RMNRemote contracts. +// Example usage: +// +// cfg := RMNCurseConfig{ +// CurseActions: []CurseAction{ +// CurseChain(SEPOLIA_CHAIN_SELECTOR), +// CurseLane(SEPOLIA_CHAIN_SELECTOR, AVAX_FUJI_CHAIN_SELECTOR), +// }, +// CurseReason: "test curse", +// MCMS: &MCMSConfig{MinDelay: 0}, +// } +// output, err := RMNCurseChangeset(env, cfg) +func RMNCurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployment.ChangesetOutput, error) { + err := cfg.Validate(e) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + state, err := LoadOnchainState(e) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) + } + deployerGroup := NewDeployerGroup(e, state, cfg.MCMS) + + // Generate curse actions + var curseActions []RMNCurseAction + for _, curseAction := range cfg.CurseActions { + curseActions = append(curseActions, curseAction(e)...) + } + // Group curse actions by chain selector + grouped := groupRMNSubjectBySelector(curseActions, true, true) + // For each chain in the environment get the RMNRemote contract and call curse + for selector, chain := range state.Chains { + deployer, err := deployerGroup.getDeployer(selector) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to get deployer for chain %d: %w", selector, err) + } + if curseSubjects, ok := grouped[selector]; ok { + // Only curse the subjects that are not actually cursed + notAlreadyCursedSubjects := make([]Subject, 0) + for _, subject := range curseSubjects { + cursed, err := chain.RMNRemote.IsCursed(nil, subject) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to check if chain %d is cursed: %w", selector, err) + } + + if !cursed { + notAlreadyCursedSubjects = append(notAlreadyCursedSubjects, subject) + } else { + e.Logger.Warnf("chain %s subject %x is already cursed, ignoring it while cursing", e.Chains[selector].Name(), subject) + } + } + + if len(notAlreadyCursedSubjects) == 0 { + e.Logger.Infof("chain %s is already cursed with all the subjects, skipping", e.Chains[selector].Name()) + continue + } + + _, err := chain.RMNRemote.Curse0(deployer, notAlreadyCursedSubjects) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to curse chain %d: %w", selector, err) + } + e.Logger.Infof("Cursed chain %d with subjects %v", selector, notAlreadyCursedSubjects) + } + } + + return deployerGroup.enact("proposal to curse RMNs: " + cfg.Reason) +} + +// RMNUncurseChangeset creates a new changeset for uncursing chains or lanes on RMNRemote contracts. +// Example usage: +// +// cfg := RMNCurseConfig{ +// CurseActions: []CurseAction{ +// CurseChain(SEPOLIA_CHAIN_SELECTOR), +// CurseLane(SEPOLIA_CHAIN_SELECTOR, AVAX_FUJI_CHAIN_SELECTOR), +// }, +// MCMS: &MCMSConfig{MinDelay: 0}, +// } +// output, err := RMNUncurseChangeset(env, cfg) +// +// Curse actions are reused and reverted instead of applied in this changeset +func RMNUncurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployment.ChangesetOutput, error) { + err := cfg.Validate(e) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + state, err := LoadOnchainState(e) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) + } + deployerGroup := NewDeployerGroup(e, state, cfg.MCMS) + + // Generate curse actions + var curseActions []RMNCurseAction + for _, curseAction := range cfg.CurseActions { + curseActions = append(curseActions, curseAction(e)...) + } + // Group curse actions by chain selector + grouped := groupRMNSubjectBySelector(curseActions, false, false) + + // For each chain in the environement get the RMNRemote contract and call uncurse + for selector, chain := range state.Chains { + deployer, err := deployerGroup.getDeployer(selector) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to get deployer for chain %d: %w", selector, err) + } + + if curseSubjects, ok := grouped[selector]; ok { + // Only keep the subject that are actually cursed + actuallyCursedSubjects := make([]Subject, 0) + for _, subject := range curseSubjects { + cursed, err := chain.RMNRemote.IsCursed(nil, subject) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to check if chain %d is cursed: %w", selector, err) + } + + if cursed { + actuallyCursedSubjects = append(actuallyCursedSubjects, subject) + } else { + e.Logger.Warnf("chain %s subject %x is not cursed, ignoring it while uncursing", e.Chains[selector].Name(), subject) + } + } + + if len(actuallyCursedSubjects) == 0 { + e.Logger.Infof("chain %s is not cursed with any of the subjects, skipping", e.Chains[selector].Name()) + continue + } + + _, err := chain.RMNRemote.Uncurse0(deployer, actuallyCursedSubjects) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to uncurse chain %d: %w", selector, err) + } + e.Logger.Infof("Uncursed chain %d with subjects %v", selector, actuallyCursedSubjects) + } + } + + return deployerGroup.enact("proposal to uncurse RMNs: %s" + cfg.Reason) +} diff --git a/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go b/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go new file mode 100644 index 00000000000..2b0a6c07a59 --- /dev/null +++ b/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go @@ -0,0 +1,379 @@ +package changeset + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +) + +type curseAssertion struct { + chainID uint64 + subject uint64 + globalCurse bool + cursed bool +} + +type CurseTestCase struct { + name string + curseActionsBuilder func(mapIDToSelectorFunc) []CurseAction + curseAssertions []curseAssertion +} + +type mapIDToSelectorFunc func(uint64) uint64 + +var testCases = []CurseTestCase{ + { + name: "lane", + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { + return []CurseAction{CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1))} + }, + curseAssertions: []curseAssertion{ + {chainID: 0, subject: 1, cursed: true}, + {chainID: 0, subject: 2, cursed: false}, + {chainID: 1, subject: 0, cursed: true}, + {chainID: 1, subject: 2, cursed: false}, + {chainID: 2, subject: 0, cursed: false}, + {chainID: 2, subject: 1, cursed: false}, + }, + }, + { + name: "lane duplicate", + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { + return []CurseAction{CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1)), CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1))} + }, + curseAssertions: []curseAssertion{ + {chainID: 0, subject: 1, cursed: true}, + {chainID: 0, subject: 2, cursed: false}, + {chainID: 1, subject: 0, cursed: true}, + {chainID: 1, subject: 2, cursed: false}, + {chainID: 2, subject: 0, cursed: false}, + {chainID: 2, subject: 1, cursed: false}, + }, + }, + { + name: "chain", + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { + return []CurseAction{CurseChain(mapIDToSelector(0))} + }, + curseAssertions: []curseAssertion{ + {chainID: 0, globalCurse: true, cursed: true}, + {chainID: 1, subject: 0, cursed: true}, + {chainID: 1, subject: 2, cursed: false}, + {chainID: 2, subject: 0, cursed: true}, + {chainID: 2, subject: 1, cursed: false}, + }, + }, + { + name: "chain duplicate", + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { + return []CurseAction{CurseChain(mapIDToSelector(0)), CurseChain(mapIDToSelector(0))} + }, + curseAssertions: []curseAssertion{ + {chainID: 0, globalCurse: true, cursed: true}, + {chainID: 1, subject: 0, cursed: true}, + {chainID: 1, subject: 2, cursed: false}, + {chainID: 2, subject: 0, cursed: true}, + {chainID: 2, subject: 1, cursed: false}, + }, + }, + { + name: "chain and lanes", + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { + return []CurseAction{CurseChain(mapIDToSelector(0)), CurseLaneBidirectionally(mapIDToSelector(1), mapIDToSelector(2))} + }, + curseAssertions: []curseAssertion{ + {chainID: 0, globalCurse: true, cursed: true}, + {chainID: 1, subject: 0, cursed: true}, + {chainID: 1, subject: 2, cursed: true}, + {chainID: 2, subject: 0, cursed: true}, + {chainID: 2, subject: 1, cursed: true}, + }, + }, +} + +func TestRMNCurse(t *testing.T) { + for _, tc := range testCases { + t.Run(tc.name+"_NO_MCMS", func(t *testing.T) { + runRmnCurseTest(t, tc) + }) + t.Run(tc.name+"_MCMS", func(t *testing.T) { + runRmnCurseMCMSTest(t, tc) + }) + } +} + +func TestRMNCurseIdempotent(t *testing.T) { + for _, tc := range testCases { + t.Run(tc.name+"_CURSE_IDEMPOTENT_NO_MCMS", func(t *testing.T) { + runRmnCurseIdempotentTest(t, tc) + }) + } +} + +func TestRMNUncurseIdempotent(t *testing.T) { + for _, tc := range testCases { + t.Run(tc.name+"_UNCURESE_IDEMPOTENT_NO_MCMS", func(t *testing.T) { + runRmnUncurseIdempotentTest(t, tc) + }) + } +} + +func TestRMNUncurse(t *testing.T) { + for _, tc := range testCases { + t.Run(tc.name+"_UNCURSE", func(t *testing.T) { + runRmnUncurseTest(t, tc) + }) + t.Run(tc.name+"_UNCURSE_MCMS", func(t *testing.T) { + runRmnUncurseMCMSTest(t, tc) + }) + } +} + +func TestRMNCurseConfigValidate(t *testing.T) { + for _, tc := range testCases { + t.Run(tc.name+"_VALIDATE", func(t *testing.T) { + runRmnCurseConfigValidateTest(t, tc) + }) + } +} + +func runRmnUncurseTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + verifyNoActiveCurseOnAllChains(t, &e) + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + } + + _, err := RMNCurseChangeset(e.Env, config) + require.NoError(t, err) + + verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) + + _, err = RMNUncurseChangeset(e.Env, config) + require.NoError(t, err) + + verifyNoActiveCurseOnAllChains(t, &e) +} + +func transferRMNContractToMCMS(t *testing.T, e *DeployedEnv, state CCIPOnChainState, timelocksPerChain map[uint64]*proposalutils.TimelockExecutionContracts) { + contractsByChain := make(map[uint64][]common.Address) + rmnRemoteAddressesByChain := buildRMNRemoteAddressPerChain(e.Env, state) + for chainSelector, rmnRemoteAddress := range rmnRemoteAddressesByChain { + contractsByChain[chainSelector] = []common.Address{rmnRemoteAddress} + } + + contractsByChain[e.HomeChainSel] = append(contractsByChain[e.HomeChainSel], state.Chains[e.HomeChainSel].RMNHome.Address()) + + // This is required because RMN Contracts is initially owned by the deployer + _, err := commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), + Config: commonchangeset.TransferToMCMSWithTimelockConfig{ + ContractsByChain: contractsByChain, + MinDelay: 0, + }, + }, + }) + require.NoError(t, err) +} + +func runRmnUncurseMCMSTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + MCMS: &MCMSConfig{MinDelay: 0}, + } + + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + + verifyNoActiveCurseOnAllChains(t, &e) + + timelocksPerChain := buildTimelockPerChain(e.Env, state) + + transferRMNContractToMCMS(t, &e, state, timelocksPerChain) + + _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(RMNCurseChangeset), + Config: config, + }, + }) + require.NoError(t, err) + + verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) + + _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(RMNUncurseChangeset), + Config: config, + }, + }) + require.NoError(t, err) + + verifyNoActiveCurseOnAllChains(t, &e) +} + +func runRmnCurseConfigValidateTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + } + + err := config.Validate(e.Env) + require.NoError(t, err) +} + +func runRmnCurseTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + verifyNoActiveCurseOnAllChains(t, &e) + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + } + + _, err := RMNCurseChangeset(e.Env, config) + require.NoError(t, err) + + verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) +} + +func runRmnCurseIdempotentTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + verifyNoActiveCurseOnAllChains(t, &e) + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + } + + _, err := RMNCurseChangeset(e.Env, config) + require.NoError(t, err) + + _, err = RMNCurseChangeset(e.Env, config) + require.NoError(t, err) + + verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) +} + +func runRmnUncurseIdempotentTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + verifyNoActiveCurseOnAllChains(t, &e) + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + } + + _, err := RMNCurseChangeset(e.Env, config) + require.NoError(t, err) + + verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) + + _, err = RMNUncurseChangeset(e.Env, config) + require.NoError(t, err) + + _, err = RMNUncurseChangeset(e.Env, config) + require.NoError(t, err) + + verifyNoActiveCurseOnAllChains(t, &e) +} + +func runRmnCurseMCMSTest(t *testing.T, tc CurseTestCase) { + e, _ := NewMemoryEnvironment(t, WithChains(3)) + + mapIDToSelector := func(id uint64) uint64 { + return e.Env.AllChainSelectors()[id] + } + + config := RMNCurseConfig{ + CurseActions: tc.curseActionsBuilder(mapIDToSelector), + Reason: "test curse", + MCMS: &MCMSConfig{MinDelay: 0}, + } + + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + + verifyNoActiveCurseOnAllChains(t, &e) + + timelocksPerChain := buildTimelockPerChain(e.Env, state) + + transferRMNContractToMCMS(t, &e, state, timelocksPerChain) + + _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(RMNCurseChangeset), + Config: config, + }, + }) + require.NoError(t, err) + + verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) +} + +func verifyTestCaseAssertions(t *testing.T, e *DeployedEnv, tc CurseTestCase, mapIDToSelector mapIDToSelectorFunc) { + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + + for _, assertion := range tc.curseAssertions { + cursedSubject := SelectorToSubject(mapIDToSelector(assertion.subject)) + if assertion.globalCurse { + cursedSubject = GlobalCurseSubject() + } + + isCursed, err := state.Chains[mapIDToSelector(assertion.chainID)].RMNRemote.IsCursed(nil, cursedSubject) + require.NoError(t, err) + require.Equal(t, assertion.cursed, isCursed, "chain %d subject %d", assertion.chainID, assertion.subject) + } +} + +func verifyNoActiveCurseOnAllChains(t *testing.T, e *DeployedEnv) { + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + + for _, chain := range e.Env.Chains { + isCursed, err := state.Chains[chain.Selector].RMNRemote.IsCursed0(nil) + require.NoError(t, err) + require.False(t, isCursed, "chain %d", chain.Selector) + } +} diff --git a/deployment/ccip/changeset/cs_update_rmn_config.go b/deployment/ccip/changeset/cs_update_rmn_config.go index e52ca407b5d..1797d588fca 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/cs_update_rmn_config.go @@ -9,7 +9,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" @@ -415,34 +414,6 @@ func PromoteCandidateConfigChangeset(e deployment.Environment, config PromoteRMN }, nil } -func buildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*proposalutils.TimelockExecutionContracts { - timelocksPerChain := make(map[uint64]*proposalutils.TimelockExecutionContracts) - for _, chain := range e.Chains { - timelocksPerChain[chain.Selector] = &proposalutils.TimelockExecutionContracts{ - Timelock: state.Chains[chain.Selector].Timelock, - CallProxy: state.Chains[chain.Selector].CallProxy, - } - } - return timelocksPerChain -} - -func buildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address { - timelocksPerChain := buildTimelockPerChain(e, state) - timelockAddressPerChain := make(map[uint64]common.Address) - for chain, timelock := range timelocksPerChain { - timelockAddressPerChain[chain] = timelock.Timelock.Address() - } - return timelockAddressPerChain -} - -func buildProposerPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*gethwrappers.ManyChainMultiSig { - proposerPerChain := make(map[uint64]*gethwrappers.ManyChainMultiSig) - for _, chain := range e.Chains { - proposerPerChain[chain.Selector] = state.Chains[chain.Selector].ProposerMcm - } - return proposerPerChain -} - func buildRMNRemotePerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*rmn_remote.RMNRemote { timelocksPerChain := make(map[uint64]*rmn_remote.RMNRemote) for _, chain := range e.Chains { diff --git a/deployment/ccip/changeset/deployer_group.go b/deployment/ccip/changeset/deployer_group.go new file mode 100644 index 00000000000..0c0ff1e5c8e --- /dev/null +++ b/deployment/ccip/changeset/deployer_group.go @@ -0,0 +1,194 @@ +package changeset + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +) + +type DeployerGroup struct { + e deployment.Environment + state CCIPOnChainState + mcmConfig *MCMSConfig + transactions map[uint64][]*types.Transaction +} + +// DeployerGroup is an abstraction that lets developers write their changeset +// without needing to know if it's executed using a DeployerKey or an MCMS proposal. +// +// Example usage: +// +// deployerGroup := NewDeployerGroup(e, state, mcmConfig) +// selector := 0 +// # Get the right deployer key for the chain +// deployer := deployerGroup.getDeployer(selector) +// state.Chains[selector].RMNRemote.Curse() +// # Execute the transaction or create the proposal +// deployerGroup.enact("Curse RMNRemote") +func NewDeployerGroup(e deployment.Environment, state CCIPOnChainState, mcmConfig *MCMSConfig) *DeployerGroup { + return &DeployerGroup{ + e: e, + mcmConfig: mcmConfig, + state: state, + transactions: make(map[uint64][]*types.Transaction), + } +} + +func (d *DeployerGroup) getDeployer(chain uint64) (*bind.TransactOpts, error) { + txOpts := d.e.Chains[chain].DeployerKey + if d.mcmConfig != nil { + txOpts = deployment.SimTransactOpts() + txOpts = &bind.TransactOpts{ + From: d.state.Chains[chain].Timelock.Address(), + Signer: txOpts.Signer, + GasLimit: txOpts.GasLimit, + GasPrice: txOpts.GasPrice, + Nonce: txOpts.Nonce, + Value: txOpts.Value, + GasFeeCap: txOpts.GasFeeCap, + GasTipCap: txOpts.GasTipCap, + Context: txOpts.Context, + AccessList: txOpts.AccessList, + NoSend: txOpts.NoSend, + } + } + sim := &bind.TransactOpts{ + From: txOpts.From, + Signer: txOpts.Signer, + GasLimit: txOpts.GasLimit, + GasPrice: txOpts.GasPrice, + Nonce: txOpts.Nonce, + Value: txOpts.Value, + GasFeeCap: txOpts.GasFeeCap, + GasTipCap: txOpts.GasTipCap, + Context: txOpts.Context, + AccessList: txOpts.AccessList, + NoSend: true, + } + oldSigner := sim.Signer + + var startingNonce *big.Int + if txOpts.Nonce != nil { + startingNonce = new(big.Int).Set(txOpts.Nonce) + } else { + nonce, err := d.e.Chains[chain].Client.PendingNonceAt(context.Background(), txOpts.From) + if err != nil { + return nil, fmt.Errorf("could not get nonce for deployer: %w", err) + } + startingNonce = new(big.Int).SetUint64(nonce) + } + + sim.Signer = func(a common.Address, t *types.Transaction) (*types.Transaction, error) { + // Update the nonce to consider the transactions that have been sent + sim.Nonce = big.NewInt(0).Add(startingNonce, big.NewInt(int64(len(d.transactions[chain]))+1)) + + tx, err := oldSigner(a, t) + if err != nil { + return nil, err + } + d.transactions[chain] = append(d.transactions[chain], tx) + return tx, nil + } + return sim, nil +} + +func (d *DeployerGroup) enact(deploymentDescription string) (deployment.ChangesetOutput, error) { + if d.mcmConfig != nil { + return d.enactMcms(deploymentDescription) + } + + return d.enactDeployer() +} + +func (d *DeployerGroup) enactMcms(deploymentDescription string) (deployment.ChangesetOutput, error) { + batches := make([]timelock.BatchChainOperation, 0) + for selector, txs := range d.transactions { + mcmOps := make([]mcms.Operation, len(txs)) + for i, tx := range txs { + mcmOps[i] = mcms.Operation{ + To: *tx.To(), + Data: tx.Data(), + Value: tx.Value(), + } + } + batches = append(batches, timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(selector), + Batch: mcmOps, + }) + } + + timelocksPerChain := buildTimelockAddressPerChain(d.e, d.state) + + proposerMCMSes := buildProposerPerChain(d.e, d.state) + + prop, err := proposalutils.BuildProposalFromBatches( + timelocksPerChain, + proposerMCMSes, + batches, + deploymentDescription, + d.mcmConfig.MinDelay, + ) + + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to build proposal %w", err) + } + + return deployment.ChangesetOutput{ + Proposals: []timelock.MCMSWithTimelockProposal{*prop}, + }, nil +} + +func (d *DeployerGroup) enactDeployer() (deployment.ChangesetOutput, error) { + for selector, txs := range d.transactions { + for _, tx := range txs { + err := d.e.Chains[selector].Client.SendTransaction(context.Background(), tx) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to send transaction: %w", err) + } + + _, err = d.e.Chains[selector].Confirm(tx) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("waiting for tx to be mined failed: %w", err) + } + } + } + return deployment.ChangesetOutput{}, nil +} + +func buildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*proposalutils.TimelockExecutionContracts { + timelocksPerChain := make(map[uint64]*proposalutils.TimelockExecutionContracts) + for _, chain := range e.Chains { + timelocksPerChain[chain.Selector] = &proposalutils.TimelockExecutionContracts{ + Timelock: state.Chains[chain.Selector].Timelock, + CallProxy: state.Chains[chain.Selector].CallProxy, + } + } + return timelocksPerChain +} + +func buildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address { + timelocksPerChain := buildTimelockPerChain(e, state) + timelockAddressPerChain := make(map[uint64]common.Address) + for chain, timelock := range timelocksPerChain { + timelockAddressPerChain[chain] = timelock.Timelock.Address() + } + return timelockAddressPerChain +} + +func buildProposerPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*gethwrappers.ManyChainMultiSig { + proposerPerChain := make(map[uint64]*gethwrappers.ManyChainMultiSig) + for _, chain := range e.Chains { + proposerPerChain[chain.Selector] = state.Chains[chain.Selector].ProposerMcm + } + return proposerPerChain +} diff --git a/deployment/ccip/changeset/deployer_group_test.go b/deployment/ccip/changeset/deployer_group_test.go new file mode 100644 index 00000000000..12dcaa9076b --- /dev/null +++ b/deployment/ccip/changeset/deployer_group_test.go @@ -0,0 +1,191 @@ +package changeset + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/deployment" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" +) + +type dummyDeployerGroupChangesetConfig struct { + selector uint64 + address common.Address + mints []*big.Int + MCMS *MCMSConfig +} + +func dummyDeployerGroupGrantMintChangeset(e deployment.Environment, cfg dummyDeployerGroupChangesetConfig) (deployment.ChangesetOutput, error) { + state, err := LoadOnchainState(e) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + token := state.Chains[cfg.selector].LinkToken + + group := NewDeployerGroup(e, state, cfg.MCMS) + deployer, err := group.getDeployer(cfg.selector) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + _, err = token.GrantMintRole(deployer, deployer.From) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + return group.enact("Grant mint role") +} + +func dummyDeployerGroupMintChangeset(e deployment.Environment, cfg dummyDeployerGroupChangesetConfig) (deployment.ChangesetOutput, error) { + state, err := LoadOnchainState(e) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + token := state.Chains[cfg.selector].LinkToken + + group := NewDeployerGroup(e, state, cfg.MCMS) + deployer, err := group.getDeployer(cfg.selector) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + for _, mint := range cfg.mints { + _, err = token.Mint(deployer, cfg.address, mint) + if err != nil { + return deployment.ChangesetOutput{}, err + } + } + + return group.enact("Mint tokens") +} + +type deployerGroupTestCase struct { + name string + cfg dummyDeployerGroupChangesetConfig + expectError bool +} + +var deployerGroupTestCases = []deployerGroupTestCase{ + { + name: "happy path", + cfg: dummyDeployerGroupChangesetConfig{ + mints: []*big.Int{big.NewInt(1), big.NewInt(2)}, + address: common.HexToAddress("0x455E5AA18469bC6ccEF49594645666C587A3a71B"), + }, + }, + { + name: "error", + cfg: dummyDeployerGroupChangesetConfig{ + mints: []*big.Int{big.NewInt(-1)}, + address: common.HexToAddress("0x455E5AA18469bC6ccEF49594645666C587A3a71B"), + }, + expectError: true, + }, +} + +func TestDeployerGroup(t *testing.T) { + for _, tc := range deployerGroupTestCases { + t.Run(tc.name, func(t *testing.T) { + e, _ := NewMemoryEnvironment(t, WithChains(2)) + + tc.cfg.selector = e.HomeChainSel + tc.cfg.MCMS = nil + + _, err := dummyDeployerGroupGrantMintChangeset(e.Env, tc.cfg) + require.NoError(t, err) + + _, err = dummyDeployerGroupMintChangeset(e.Env, tc.cfg) + if tc.expectError { + require.Error(t, err) + } else { + require.NoError(t, err) + + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + + token := state.Chains[e.HomeChainSel].LinkToken + + amount, err := token.BalanceOf(nil, tc.cfg.address) + require.NoError(t, err) + + sumOfMints := big.NewInt(0) + for _, mint := range tc.cfg.mints { + sumOfMints = sumOfMints.Add(sumOfMints, mint) + } + + require.Equal(t, sumOfMints, amount) + } + }) + } +} + +func TestDeployerGroupMCMS(t *testing.T) { + for _, tc := range deployerGroupTestCases { + t.Run(tc.name, func(t *testing.T) { + if tc.expectError { + t.Skip("skipping test because it's not possible to verify error when using MCMS since we are explicitly failing the test in ApplyChangesets") + } + + e, _ := NewMemoryEnvironment(t, WithChains(2)) + + tc.cfg.selector = e.HomeChainSel + tc.cfg.MCMS = &MCMSConfig{ + MinDelay: 0, + } + state, err := LoadOnchainState(e.Env) + require.NoError(t, err) + + timelocksPerChain := buildTimelockPerChain(e.Env, state) + + contractsByChain := make(map[uint64][]common.Address) + contractsByChain[e.HomeChainSel] = []common.Address{state.Chains[e.HomeChainSel].LinkToken.Address()} + + _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), + Config: commonchangeset.TransferToMCMSWithTimelockConfig{ + ContractsByChain: contractsByChain, + MinDelay: 0, + }, + }, + }) + require.NoError(t, err) + + _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(dummyDeployerGroupGrantMintChangeset), + Config: tc.cfg, + }, + }) + require.NoError(t, err) + + _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(dummyDeployerGroupMintChangeset), + Config: tc.cfg, + }, + }) + require.NoError(t, err) + + state, err = LoadOnchainState(e.Env) + require.NoError(t, err) + + token := state.Chains[e.HomeChainSel].LinkToken + + amount, err := token.BalanceOf(nil, tc.cfg.address) + require.NoError(t, err) + + sumOfMints := big.NewInt(0) + for _, mint := range tc.cfg.mints { + sumOfMints = sumOfMints.Add(sumOfMints, mint) + } + + require.Equal(t, sumOfMints, amount) + }) + } +} diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go index c655caa9f08..fcf17956dc0 100644 --- a/integration-tests/smoke/ccip/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -2,7 +2,6 @@ package smoke import ( "context" - "encoding/binary" "errors" "math/big" "os" @@ -17,17 +16,15 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" "github.com/stretchr/testify/require" + "golang.org/x/sync/errgroup" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - "github.com/smartcontractkit/chainlink-ccip/pkg/reader" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/environment/devenv" - "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_home" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -329,8 +326,9 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { startBlocks, seqNumCommit, seqNumExec := tc.sendMessages(t, onChainState, envWithRMN) t.Logf("Sent all messages, seqNumCommit: %v seqNumExec: %v", seqNumCommit, seqNumExec) + eg := errgroup.Group{} tc.callContractsToCurseChains(ctx, t, onChainState, envWithRMN) - tc.callContractsToCurseAndRevokeCurse(ctx, t, onChainState, envWithRMN) + tc.callContractsToCurseAndRevokeCurse(ctx, &eg, t, onChainState, envWithRMN) tc.enableOracles(ctx, t, envWithRMN, disabledNodes) @@ -390,6 +388,8 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { <-commitReportReceived // wait for commit reports t.Logf("✅ Commit report") + require.NoError(t, eg.Wait()) + if tc.waitForExec { t.Logf("⌛ Waiting for exec reports...") changeset.ConfirmExecWithSeqNrsForAll(t, envWithRMN.Env, onChainState, seqNumExec, startBlocks) @@ -614,7 +614,7 @@ func (tc rmnTestCase) callContractsToCurseChains(ctx context.Context, t *testing remoteSel := tc.pf.chainSelectors[remoteCfg.chainIdx] chState, ok := onChainState.Chains[remoteSel] require.True(t, ok) - chain, ok := envWithRMN.Env.Chains[remoteSel] + _, ok = envWithRMN.Env.Chains[remoteSel] require.True(t, ok) cursedSubjects, ok := tc.cursedSubjectsPerChain[remoteCfg.chainIdx] @@ -623,14 +623,19 @@ func (tc rmnTestCase) callContractsToCurseChains(ctx context.Context, t *testing } for _, subjectDescription := range cursedSubjects { - subj := reader.GlobalCurseSubject - if subjectDescription != globalCurse { - subj = chainSelectorToBytes16(tc.pf.chainSelectors[subjectDescription]) + curseActions := make([]changeset.CurseAction, 0) + + if subjectDescription == globalCurse { + curseActions = append(curseActions, changeset.CurseGloballyOnlyOnChain(remoteSel)) + } else { + curseActions = append(curseActions, changeset.CurseLaneOnlyOnSource(remoteSel, tc.pf.chainSelectors[subjectDescription])) } - t.Logf("cursing subject %d (%d)", subj, subjectDescription) - txCurse, errCurse := chState.RMNRemote.Curse(chain.DeployerKey, subj) - _, errConfirm := deployment.ConfirmIfNoError(chain, txCurse, errCurse) - require.NoError(t, errConfirm) + + _, err := changeset.RMNCurseChangeset(envWithRMN.Env, changeset.RMNCurseConfig{ + CurseActions: curseActions, + Reason: "test curse", + }) + require.NoError(t, err) } cs, err := chState.RMNRemote.GetCursedSubjects(&bind.CallOpts{Context: ctx}) @@ -639,41 +644,59 @@ func (tc rmnTestCase) callContractsToCurseChains(ctx context.Context, t *testing } } -func (tc rmnTestCase) callContractsToCurseAndRevokeCurse(ctx context.Context, t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN changeset.DeployedEnv) { +func (tc rmnTestCase) callContractsToCurseAndRevokeCurse(ctx context.Context, eg *errgroup.Group, t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN changeset.DeployedEnv) { for _, remoteCfg := range tc.remoteChainsConfig { remoteSel := tc.pf.chainSelectors[remoteCfg.chainIdx] chState, ok := onChainState.Chains[remoteSel] require.True(t, ok) - chain, ok := envWithRMN.Env.Chains[remoteSel] + _, ok = envWithRMN.Env.Chains[remoteSel] require.True(t, ok) - cursedSubjects, ok := tc.revokedCursedSubjectsPerChain[remoteCfg.chainIdx] - if !ok { - continue // nothing to curse on this chain - } + cursedSubjects := tc.revokedCursedSubjectsPerChain[remoteCfg.chainIdx] for subjectDescription, revokeAfter := range cursedSubjects { - subj := reader.GlobalCurseSubject - if subjectDescription != globalCurse { - subj = chainSelectorToBytes16(tc.pf.chainSelectors[subjectDescription]) + curseActions := make([]changeset.CurseAction, 0) + + if subjectDescription == globalCurse { + curseActions = append(curseActions, changeset.CurseGloballyOnlyOnChain(remoteSel)) + } else { + curseActions = append(curseActions, changeset.CurseLaneOnlyOnSource(remoteSel, tc.pf.chainSelectors[subjectDescription])) } - t.Logf("cursing subject %d (%d)", subj, subjectDescription) - txCurse, errCurse := chState.RMNRemote.Curse(chain.DeployerKey, subj) - _, errConfirm := deployment.ConfirmIfNoError(chain, txCurse, errCurse) - require.NoError(t, errConfirm) - go func() { + _, err := changeset.RMNCurseChangeset(envWithRMN.Env, changeset.RMNCurseConfig{ + CurseActions: curseActions, + Reason: "test curse", + }) + require.NoError(t, err) + + eg.Go(func() error { <-time.NewTimer(revokeAfter).C - t.Logf("revoking curse on subject %d (%d)", subj, subjectDescription) - txUncurse, errUncurse := chState.RMNRemote.Uncurse(chain.DeployerKey, subj) - _, errConfirm = deployment.ConfirmIfNoError(chain, txUncurse, errUncurse) - require.NoError(t, errConfirm) - }() + t.Logf("revoking curse on subject %d (%d)", subjectDescription, subjectDescription) + + _, err := changeset.RMNUncurseChangeset(envWithRMN.Env, changeset.RMNCurseConfig{ + CurseActions: curseActions, + Reason: "test uncurse", + }) + if err != nil { + return err + } + return nil + }) } - cs, err := chState.RMNRemote.GetCursedSubjects(&bind.CallOpts{Context: ctx}) require.NoError(t, err) - t.Logf("Cursed subjects: %v", cs) + t.Logf("Cursed subjects: %v, %v", cs, remoteSel) + eg.Go(func() error { + <-time.NewTimer(time.Second * 10).C + cs, err := chState.RMNRemote.GetCursedSubjects(&bind.CallOpts{Context: ctx}) + + if err != nil { + return err + } + + t.Logf("Cursed subjects after revoking: %v, %v", cs, remoteSel) + return nil + }) } } @@ -684,10 +707,3 @@ func (tc rmnTestCase) enableOracles(ctx context.Context, t *testing.T, envWithRM t.Logf("node %s enabled", n) } } - -func chainSelectorToBytes16(chainSel uint64) [16]byte { - var result [16]byte - // Convert the uint64 to bytes and place it in the last 8 bytes of the array - binary.BigEndian.PutUint64(result[8:], chainSel) - return result -} From 469ebf75226a7a4fa6d366c14272cc81ee93a656 Mon Sep 17 00:00:00 2001 From: Njegos Railic Date: Thu, 16 Jan 2025 13:51:04 +0100 Subject: [PATCH 69/91] Migrating the tests that are using CRIB and GAP to the latest GHA versions (#15947) --- .github/actions/crib/action.yml | 14 ++++++++------ .github/workflows/crib-integration-test.yml | 2 +- .github/workflows/on-demand-ocr-soak-test.yml | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/actions/crib/action.yml b/.github/actions/crib/action.yml index 79715cca0d2..a877d0ff4b3 100644 --- a/.github/actions/crib/action.yml +++ b/.github/actions/crib/action.yml @@ -21,9 +21,6 @@ inputs: api-gw-host-k8s: description: "API Gateway Host for K8s" required: true - k8s-api-endpoint: - description: "Kubernetes API endpoint" - required: true k8s-cluster-name: description: "Kubernetes cluster name" required: true @@ -64,7 +61,12 @@ inputs: description: "Whether to run integration tests" required: false default: "true" - + main-dns-zone: + description: + "The DNS zone is used for exposing services. It is required when using the + dynamic local proxy to prevent sending requests and exposing sensitive + information to random external endpoints. This ensures that the dynamic + local proxy is used only for the specific DNS zone." runs: using: "composite" steps: @@ -110,7 +112,7 @@ runs: aws-role-duration-seconds: "1800" - name: Deploy and validate CRIB Environment for Core - uses: smartcontractkit/.github/actions/crib-deploy-environment@815e0d550527897746e889441407926d7e28169c # crib-deploy-environment@7.4.0 + uses: smartcontractkit/.github/actions/crib-deploy-environment@265e28cc322771651688493303785323e3482b15 # crib-deploy-environment@8.2.1 id: deploy-crib with: github-token: ${{ steps.token.outputs.access-token }} @@ -118,7 +120,6 @@ runs: aws-region: ${{ inputs.aws-region }} aws-role-arn: ${{ inputs.aws-role-arn }} ingress-base-domain: ${{ inputs.ingress-base-domain }} - k8s-api-endpoint: ${{ inputs.k8s-api-endpoint }} k8s-cluster-name: ${{ inputs.k8s-cluster-name }} chainlink-team: releng chainlink-product: crib @@ -127,6 +128,7 @@ runs: product-image: ${{ inputs.crib-chainlink-docker-image-name }} product-image-tag: ${{ inputs.crib-chainlink-docker-image-tag }} ns-ttl: ${{ inputs.crib-cleanup-ttl }} + main-dns-zone: ${{ inputs.main-dns-zone }} - name: Set up Go uses: ./.github/actions/setup-go diff --git a/.github/workflows/crib-integration-test.yml b/.github/workflows/crib-integration-test.yml index df29b2e1b6a..97f87c7d7fc 100644 --- a/.github/workflows/crib-integration-test.yml +++ b/.github/workflows/crib-integration-test.yml @@ -33,7 +33,6 @@ jobs: aws-account-id: ${{ secrets.AWS_ACCOUNT_ID_PROD }} api-gw-host-crib: ${{ secrets.AWS_API_GW_HOST_CRIB_STAGE }} api-gw-host-k8s: ${{ secrets.AWS_API_GW_HOST_K8S_STAGE }} - k8s-api-endpoint: ${{ secrets.GAP_HOST_K8S_STAGE }} k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }} aws-token-issuer-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} aws-token-issuer-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} @@ -43,3 +42,4 @@ jobs: crib-alert-slack-webhook: ${{ secrets.CRIB_ALERT_SLACK_WEBHOOK }} crib-chainlink-docker-image-name: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/chainlink crib-chainlink-docker-image-tag: develop + main-dns-zone: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_STAGE }} diff --git a/.github/workflows/on-demand-ocr-soak-test.yml b/.github/workflows/on-demand-ocr-soak-test.yml index 8db718700c8..57b47401fe9 100644 --- a/.github/workflows/on-demand-ocr-soak-test.yml +++ b/.github/workflows/on-demand-ocr-soak-test.yml @@ -43,7 +43,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@80366cb090f714f9842da4ced1102f4a0e805f20 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: test_path: .github/e2e-tests.yml test_ids: ${{ inputs.testToRun}} From 970330978453fd0af9da088292f67027175ad3f4 Mon Sep 17 00:00:00 2001 From: Njegos Railic Date: Thu, 16 Jan 2025 15:52:56 +0100 Subject: [PATCH 70/91] Migrating all tests to the latest version of e2e test workflow (#15952) --- .../workflows/automation-benchmark-tests.yml | 13 ++++---- .github/workflows/automation-load-tests.yml | 11 ++++--- .../workflows/automation-ondemand-tests.yml | 32 +++++++++---------- .github/workflows/ccip-chaos-tests.yml | 9 +++--- .github/workflows/ccip-load-tests.yml | 11 ++++--- .github/workflows/integration-chaos-tests.yml | 11 ++++--- 6 files changed, 46 insertions(+), 41 deletions(-) diff --git a/.github/workflows/automation-benchmark-tests.yml b/.github/workflows/automation-benchmark-tests.yml index 3a826f523a0..27169549181 100644 --- a/.github/workflows/automation-benchmark-tests.yml +++ b/.github/workflows/automation-benchmark-tests.yml @@ -5,11 +5,11 @@ on: test_config_override_path: description: Path to a test config file used to override the default test config required: false - type: string + type: string test_secrets_override_key: description: Key to run tests with custom test secrets required: false - type: string + type: string slackMemberID: description: Notifies test results (Not your @) required: true @@ -28,7 +28,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0d4a2b2b009c87b5c366d0b97f7a8d7de2f60760 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: test_path: .github/e2e-tests.yml test_ids: '${{ inputs.testType }}/automation_test.go:TestAutomationBenchmark' @@ -43,7 +43,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -51,10 +50,12 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/automation-load-tests.yml b/.github/workflows/automation-load-tests.yml index c11e353a7db..a3581e7543e 100644 --- a/.github/workflows/automation-load-tests.yml +++ b/.github/workflows/automation-load-tests.yml @@ -5,7 +5,7 @@ on: test_config_override_path: description: Path to a test config file used to override the default test config required: false - type: string + type: string test_secrets_override_key: description: 'Key to run tests with custom test secrets' required: false @@ -23,7 +23,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0d4a2b2b009c87b5c366d0b97f7a8d7de2f60760 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: test_path: .github/e2e-tests.yml test_ids: 'load/automationv2_1/automationv2_1_test.go:TestLogTrigger' @@ -38,7 +38,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -46,10 +45,12 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index ee917da0e56..e71f96ee816 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -36,7 +36,7 @@ on: default: false required: true with_existing_remote_runner_version: - description: 'Tag of the existing remote runner version to use (Leave empty to build from head/ref)' + description: 'Tag of the existing remote runner version to use (Leave empty to build from head/ref)' required: false type: string team: @@ -64,7 +64,7 @@ jobs: run: | if [[ "$GH_INPUTS_CHAINLINK_IMAGE" == "QA_ECR" ]]; then echo "image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV - else + else echo "image=$GH_INPUTS_CHAINLINK_IMAGE" >> $GITHUB_ENV fi if [[ "$GH_INPUTS_CHAINLINK_IMAGE_UPDATE" == "QA_ECR" ]]; then @@ -74,7 +74,7 @@ jobs: fi if [[ -z "$GH_INPUTS_CHAINLINK_VERSION" ]] && [[ "$CHAINLINK_IMAGE" == "QA_ECR" ]]; then echo "version=${{ github.sha }}" >> $GITHUB_ENV - else + else echo "version=$GH_INPUTS_CHAINLINK_VERSION" >> $GITHUB_ENV fi if [[ -z "$GH_INPUTS_CHAINLINK_VERSION_UPDATE" ]] && [[ "$GH_INPUTS_CHAINLINK_IMAGE_UPDATE" == "QA_ECR" ]]; then @@ -88,7 +88,7 @@ jobs: env: CHAINLKINK_IMAGE: ${{ github.event.inputs.chainlinkImage }} CHAINLINK_IMAGE_UPDATE: ${{ github.event.inputs.chainlinkImageUpdate }} - run: | + run: | chainlink_image_versions="" if [ "$CHAINLKINK_IMAGE" = "QA_ECR" ]; then chainlink_image_versions+="${{ env.version }}," @@ -96,7 +96,7 @@ jobs: if [ "$CHAINLINK_IMAGE_UPDATE" = "QA_ECR" ]; then chainlink_image_versions+="${{ env.upgrade_version }}" fi - echo "require_chainlink_image_versions_in_qa_ecr=$chainlink_image_versions" >> $GITHUB_OUTPUT + echo "require_chainlink_image_versions_in_qa_ecr=$chainlink_image_versions" >> $GITHUB_OUTPUT - name: Set tests to run id: set-tests env: @@ -104,7 +104,7 @@ jobs: GH_EVENT_INPUTS_ENABLE_CHAOS: ${{ github.event.inputs.enableChaos }} run: | - # Always run upgrade tests + # Always run upgrade tests cat > test_list.yaml < Date: Thu, 16 Jan 2025 10:19:18 -0500 Subject: [PATCH 71/91] Implement gRPC support for LLO transmission (#15924) * Support gRPC transmission mode for LLO * Set dial and keepalive options --- .changeset/warm-panthers-stare.md | 5 + core/config/docs/core.toml | 8 +- core/config/mercury_config.go | 1 + core/config/toml/types.go | 4 + core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/chainlink/config_mercury.go | 4 + core/services/chainlink/config_test.go | 2 + .../testdata/config-empty-effective.toml | 3 +- .../chainlink/testdata/config-full.toml | 1 + .../config-multi-chain-effective.toml | 3 +- core/services/keystore/keys/csakey/key_v2.go | 4 + core/services/llo/grpc/client.go | 118 ++++++++++++++++++ .../services/llo/mercurytransmitter/server.go | 14 +-- .../llo/mercurytransmitter/transmitter.go | 7 +- .../mercurytransmitter/transmitter_test.go | 54 +++++--- .../services/ocr2/plugins/llo/helpers_test.go | 84 ++++++++++--- .../ocr2/plugins/llo/integration_test.go | 43 +++---- core/services/relay/evm/evm.go | 24 +++- core/services/relay/evm/mercury/orm_test.go | 6 +- .../evm/mercury/persistence_manager_test.go | 2 +- .../relay/evm/mercury/transmitter_test.go | 4 + .../relay/evm/mercury/wsrpc/client.go | 24 ++++ .../testdata/config-empty-effective.toml | 3 +- core/web/resolver/testdata/config-full.toml | 1 + .../config-multi-chain-effective.toml | 3 +- deployment/go.mod | 2 +- deployment/go.sum | 4 +- docs/CONFIG.md | 15 ++- go.mod | 2 +- go.sum | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- .../scripts/config/merge_raw_configs.txtar | 3 +- testdata/scripts/node/validate/default.txtar | 3 +- .../node/validate/defaults-override.txtar | 3 +- .../disk-based-logging-disabled.txtar | 3 +- .../validate/disk-based-logging-no-dir.txtar | 3 +- .../node/validate/disk-based-logging.txtar | 3 +- .../node/validate/fallback-override.txtar | 3 +- .../node/validate/invalid-ocr-p2p.txtar | 3 +- testdata/scripts/node/validate/invalid.txtar | 3 +- testdata/scripts/node/validate/valid.txtar | 3 +- testdata/scripts/node/validate/warnings.txtar | 3 +- 46 files changed, 396 insertions(+), 104 deletions(-) create mode 100644 .changeset/warm-panthers-stare.md create mode 100644 core/services/llo/grpc/client.go diff --git a/.changeset/warm-panthers-stare.md b/.changeset/warm-panthers-stare.md new file mode 100644 index 00000000000..319a7ad22b3 --- /dev/null +++ b/.changeset/warm-panthers-stare.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Add grpc support for LLO #added diff --git a/core/config/docs/core.toml b/core/config/docs/core.toml index 20c519e81a1..f32b95ba4cf 100644 --- a/core/config/docs/core.toml +++ b/core/config/docs/core.toml @@ -686,13 +686,19 @@ CertFile = "/path/to/client/certs.pem" # Example # Mercury.Transmitter controls settings for the mercury transmitter [Mercury.Transmitter] +# Protocol is the protocol to use for the transmitter. +# +# Options are either: +# - "wsrpc" for the legacy websocket protocol +# - "grpc" for the gRPC protocol +Protocol = "wsrpc" # Default # TransmitQueueMaxSize controls the size of the transmit queue. This is scoped # per OCR instance. If the queue is full, the transmitter will start dropping # the oldest messages in order to make space. # # This is useful if mercury server goes offline and the nop needs to buffer # transmissions. -TransmitQueueMaxSize = 10_000 # Default +TransmitQueueMaxSize = 100_000 # Default # TransmitTimeout controls how long the transmitter will wait for a response # when sending a message to the mercury server, before aborting and considering # the transmission to be failed. diff --git a/core/config/mercury_config.go b/core/config/mercury_config.go index 2e58ff0ee9d..9b98686974c 100644 --- a/core/config/mercury_config.go +++ b/core/config/mercury_config.go @@ -18,6 +18,7 @@ type MercuryTLS interface { } type MercuryTransmitter interface { + Protocol() string TransmitQueueMaxSize() uint32 TransmitTimeout() commonconfig.Duration TransmitConcurrency() uint32 diff --git a/core/config/toml/types.go b/core/config/toml/types.go index 620f7d96eee..b644d1b27db 100644 --- a/core/config/toml/types.go +++ b/core/config/toml/types.go @@ -1327,12 +1327,16 @@ func (m *MercuryTLS) ValidateConfig() (err error) { } type MercuryTransmitter struct { + Protocol *string TransmitQueueMaxSize *uint32 TransmitTimeout *commonconfig.Duration TransmitConcurrency *uint32 } func (m *MercuryTransmitter) setFrom(f *MercuryTransmitter) { + if v := f.Protocol; v != nil { + m.Protocol = v + } if v := f.TransmitQueueMaxSize; v != nil { m.TransmitQueueMaxSize = v } diff --git a/core/scripts/go.mod b/core/scripts/go.mod index e5fa565327a..db32d617615 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -35,7 +35,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index c659d329fbd..f5c0b058cfc 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1168,8 +1168,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/core/services/chainlink/config_mercury.go b/core/services/chainlink/config_mercury.go index 0e56105406b..06e2d7822a3 100644 --- a/core/services/chainlink/config_mercury.go +++ b/core/services/chainlink/config_mercury.go @@ -42,6 +42,10 @@ type mercuryTransmitterConfig struct { c toml.MercuryTransmitter } +func (m *mercuryTransmitterConfig) Protocol() string { + return *m.c.Protocol +} + func (m *mercuryTransmitterConfig) TransmitQueueMaxSize() uint32 { return *m.c.TransmitQueueMaxSize } diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index eb467835b6f..0e64fa0444e 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -843,6 +843,7 @@ func TestConfig_Marshal(t *testing.T) { CertFile: ptr("/path/to/cert.pem"), }, Transmitter: toml.MercuryTransmitter{ + Protocol: ptr("grpc"), TransmitQueueMaxSize: ptr(uint32(123)), TransmitTimeout: commoncfg.MustNewDuration(234 * time.Second), TransmitConcurrency: ptr(uint32(456)), @@ -1356,6 +1357,7 @@ LatestReportDeadline = '1m42s' CertFile = '/path/to/cert.pem' [Mercury.Transmitter] +Protocol = 'grpc' TransmitQueueMaxSize = 123 TransmitTimeout = '3m54s' TransmitConcurrency = 456 diff --git a/core/services/chainlink/testdata/config-empty-effective.toml b/core/services/chainlink/testdata/config-empty-effective.toml index a2052c04a8e..e219296e673 100644 --- a/core/services/chainlink/testdata/config-empty-effective.toml +++ b/core/services/chainlink/testdata/config-empty-effective.toml @@ -235,7 +235,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index 6878e09c911..a3fcea9bf73 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -245,6 +245,7 @@ LatestReportDeadline = '1m42s' CertFile = '/path/to/cert.pem' [Mercury.Transmitter] +Protocol = 'grpc' TransmitQueueMaxSize = 123 TransmitTimeout = '3m54s' TransmitConcurrency = 456 diff --git a/core/services/chainlink/testdata/config-multi-chain-effective.toml b/core/services/chainlink/testdata/config-multi-chain-effective.toml index ba7538cac04..a659223134a 100644 --- a/core/services/chainlink/testdata/config-multi-chain-effective.toml +++ b/core/services/chainlink/testdata/config-multi-chain-effective.toml @@ -235,7 +235,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/core/services/keystore/keys/csakey/key_v2.go b/core/services/keystore/keys/csakey/key_v2.go index ddccbfb488b..c90a1640b86 100644 --- a/core/services/keystore/keys/csakey/key_v2.go +++ b/core/services/keystore/keys/csakey/key_v2.go @@ -83,6 +83,10 @@ func (k KeyV2) Raw() Raw { return Raw(*k.privateKey) } +func (k KeyV2) PrivateKey() ed25519.PrivateKey { + return *k.privateKey +} + func (k KeyV2) String() string { return fmt.Sprintf("CSAKeyV2{PrivateKey: , PublicKey: %s}", k.PublicKey) } diff --git a/core/services/llo/grpc/client.go b/core/services/llo/grpc/client.go new file mode 100644 index 00000000000..321c252978c --- /dev/null +++ b/core/services/llo/grpc/client.go @@ -0,0 +1,118 @@ +package grpc + +import ( + "context" + "crypto/ed25519" + "errors" + "fmt" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/backoff" + "google.golang.org/grpc/keepalive" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-data-streams/rpc" + "github.com/smartcontractkit/chainlink-data-streams/rpc/mtls" +) + +type Client interface { + services.Service + Transmit(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) + ServerURL() string +} + +var _ Client = (*client)(nil) + +type client struct { + services.Service + eng *services.Engine + + clientPrivKey ed25519.PrivateKey + serverPubKey ed25519.PublicKey + serverURL string + + conn *grpc.ClientConn + client rpc.TransmitterClient +} + +type ClientOpts struct { + Logger logger.Logger + ClientPrivKey ed25519.PrivateKey + ServerPubKey ed25519.PublicKey + ServerURL string +} + +func NewClient(opts ClientOpts) Client { + return newClient(opts) +} + +func newClient(opts ClientOpts) Client { + c := &client{ + clientPrivKey: opts.ClientPrivKey, + serverPubKey: opts.ServerPubKey, + serverURL: opts.ServerURL, + } + c.Service, c.eng = services.Config{ + Name: "GRPCClient", + Start: c.start, + Close: c.close, + }.NewServiceEngine(opts.Logger) + return c +} + +func (c *client) start(context.Context) error { + cMtls, err := mtls.NewTransportCredentials(c.clientPrivKey, []ed25519.PublicKey{c.serverPubKey}) + if err != nil { + return fmt.Errorf("failed to create client mTLS credentials: %w", err) + } + // Latency is critical so configure aggressively for fast + // redial attempts and short keepalive + clientConn, err := grpc.NewClient( + c.serverURL, + grpc.WithTransportCredentials(cMtls), + grpc.WithConnectParams( + grpc.ConnectParams{ + Backoff: backoff.Config{ + BaseDelay: 1 * time.Second, + Multiplier: 2, + Jitter: 0.2, + MaxDelay: 30 * time.Second, + }, + MinConnectTimeout: time.Second, + }, + ), + grpc.WithKeepaliveParams( + keepalive.ClientParameters{ + Time: time.Second * 10, + Timeout: time.Second * 20, + PermitWithoutStream: true, + }), + grpc.WithDefaultCallOptions( + grpc.WaitForReady(true), + ), + ) + if err != nil { + return fmt.Errorf("failed to create client connection: %w", err) + } + c.conn = clientConn + c.client = rpc.NewTransmitterClient(c.conn) + return nil +} + +func (c *client) close() error { + return c.conn.Close() +} + +func (c *client) Transmit(ctx context.Context, req *rpc.TransmitRequest) (resp *rpc.TransmitResponse, err error) { + return c.client.Transmit(ctx, req) +} + +func (c *client) LatestReport(ctx context.Context, req *rpc.LatestReportRequest) (resp *rpc.LatestReportResponse, err error) { + return nil, errors.New("LatestReport is not supported in grpc mode") +} + +func (c *client) ServerURL() string { + return c.serverURL +} diff --git a/core/services/llo/mercurytransmitter/server.go b/core/services/llo/mercurytransmitter/server.go index 769b5e99cda..e87923eab6f 100644 --- a/core/services/llo/mercurytransmitter/server.go +++ b/core/services/llo/mercurytransmitter/server.go @@ -21,11 +21,11 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink-data-streams/rpc" corelogger "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/grpc" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -92,7 +92,7 @@ type server struct { transmitTimeout time.Duration - c wsrpc.Client + c grpc.Client pm *persistenceManager q TransmitQueue @@ -121,7 +121,7 @@ type QueueConfig interface { TransmitTimeout() commonconfig.Duration } -func newServer(lggr logger.Logger, verboseLogging bool, cfg QueueConfig, client wsrpc.Client, orm ORM, serverURL string) *server { +func newServer(lggr logger.Logger, verboseLogging bool, cfg QueueConfig, client grpc.Client, orm ORM, serverURL string) *server { pm := NewPersistenceManager(lggr, orm, serverURL, int(cfg.TransmitQueueMaxSize()), flushDeletesFrequency, pruneFrequency) donIDStr := fmt.Sprintf("%d", pm.DonID()) var codecLggr logger.Logger @@ -248,7 +248,7 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, donI s.transmitThreadBusyCountInc() defer s.transmitThreadBusyCountDec() - req, res, err := func(ctx context.Context) (*pb.TransmitRequest, *pb.TransmitResponse, error) { + req, res, err := func(ctx context.Context) (*rpc.TransmitRequest, *rpc.TransmitResponse, error) { ctx, cancelFn := context.WithTimeout(ctx, utils.WithJitter(s.transmitTimeout)) defer cancelFn() return s.transmit(ctx, t) @@ -308,7 +308,7 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, donI } } -func (s *server) transmit(ctx context.Context, t *Transmission) (*pb.TransmitRequest, *pb.TransmitResponse, error) { +func (s *server) transmit(ctx context.Context, t *Transmission) (*rpc.TransmitRequest, *rpc.TransmitResponse, error) { var payload []byte var err error @@ -325,7 +325,7 @@ func (s *server) transmit(ctx context.Context, t *Transmission) (*pb.TransmitReq return nil, nil, fmt.Errorf("Transmit: encode failed; %w", err) } - req := &pb.TransmitRequest{ + req := &rpc.TransmitRequest{ Payload: payload, ReportFormat: uint32(t.Report.Info.ReportFormat), } diff --git a/core/services/llo/mercurytransmitter/transmitter.go b/core/services/llo/mercurytransmitter/transmitter.go index 23aa4b79e58..e9091fbe4cb 100644 --- a/core/services/llo/mercurytransmitter/transmitter.go +++ b/core/services/llo/mercurytransmitter/transmitter.go @@ -19,12 +19,12 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/grpc" + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" ) const ( @@ -102,6 +102,7 @@ type Transmitter interface { var _ Transmitter = (*transmitter)(nil) type Config interface { + Protocol() string TransmitQueueMaxSize() uint32 TransmitTimeout() commonconfig.Duration TransmitConcurrency() uint32 @@ -129,7 +130,7 @@ type Opts struct { Registerer prometheus.Registerer VerboseLogging bool Cfg Config - Clients map[string]wsrpc.Client + Clients map[string]grpc.Client FromAccount ed25519.PublicKey DonID uint32 ORM ORM diff --git a/core/services/llo/mercurytransmitter/transmitter_test.go b/core/services/llo/mercurytransmitter/transmitter_test.go index fabc9bb0d0e..000933fe61d 100644 --- a/core/services/llo/mercurytransmitter/transmitter_test.go +++ b/core/services/llo/mercurytransmitter/transmitter_test.go @@ -14,17 +14,21 @@ import ( "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-data-streams/rpc" + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/grpc" ) type mockCfg struct{} +func (m mockCfg) Protocol() string { + return "" +} + func (m mockCfg) TransmitQueueMaxSize() uint32 { return 10_000 } @@ -37,16 +41,30 @@ func (m mockCfg) TransmitConcurrency() uint32 { return 5 } +type MockGRPCClient struct { + TransmitF func(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) +} + +func (m *MockGRPCClient) Name() string { return "" } +func (m *MockGRPCClient) Start(context.Context) error { return nil } +func (m *MockGRPCClient) Close() error { return nil } +func (m *MockGRPCClient) HealthReport() map[string]error { return map[string]error{} } +func (m *MockGRPCClient) Ready() error { return nil } +func (m *MockGRPCClient) Transmit(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { + return m.TransmitF(ctx, in) +} +func (m *MockGRPCClient) ServerURL() string { return "mock server url" } + func Test_Transmitter_Transmit(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) donID := uint32(123456) orm := NewORM(db, donID) - clients := map[string]wsrpc.Client{} + clients := map[string]grpc.Client{} t.Run("with multiple mercury servers", func(t *testing.T) { t.Run("transmission successfully enqueued", func(t *testing.T) { - c := &mocks.MockWSRPCClient{} + c := &MockGRPCClient{} clients[sURL] = c clients[sURL2] = c clients[sURL3] = c @@ -133,7 +151,7 @@ func (m *mockQ) IsEmpty() bool { return false } func Test_Transmitter_runQueueLoop(t *testing.T) { donIDStr := "555" lggr := logger.TestLogger(t) - c := &mocks.MockWSRPCClient{} + c := &MockGRPCClient{} db := pgtest.NewSqlxDB(t) donID := uint32(123456) orm := NewORM(db, donID) @@ -142,10 +160,10 @@ func Test_Transmitter_runQueueLoop(t *testing.T) { s := newServer(lggr, true, cfg, c, orm, sURL) t.Run("pulls from queue and transmits successfully", func(t *testing.T) { - transmit := make(chan *pb.TransmitRequest, 1) - c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit := make(chan *rpc.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { transmit <- in - return &pb.TransmitResponse{Code: 0, Error: ""}, nil + return &rpc.TransmitResponse{Code: 0, Error: ""}, nil } q := newMockQ() s.q = q @@ -170,10 +188,10 @@ func Test_Transmitter_runQueueLoop(t *testing.T) { }) t.Run("on duplicate, success", func(t *testing.T) { - transmit := make(chan *pb.TransmitRequest, 1) - c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit := make(chan *rpc.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { transmit <- in - return &pb.TransmitResponse{Code: DuplicateReport, Error: ""}, nil + return &rpc.TransmitResponse{Code: DuplicateReport, Error: ""}, nil } q := newMockQ() s.q = q @@ -197,10 +215,10 @@ func Test_Transmitter_runQueueLoop(t *testing.T) { wg.Wait() }) t.Run("on server-side error, does not retry", func(t *testing.T) { - transmit := make(chan *pb.TransmitRequest, 1) - c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit := make(chan *rpc.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { transmit <- in - return &pb.TransmitResponse{Code: DuplicateReport, Error: ""}, nil + return &rpc.TransmitResponse{Code: DuplicateReport, Error: ""}, nil } q := newMockQ() s.q = q @@ -224,10 +242,10 @@ func Test_Transmitter_runQueueLoop(t *testing.T) { wg.Wait() }) t.Run("on transmit error, retries", func(t *testing.T) { - transmit := make(chan *pb.TransmitRequest, 1) - c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit := make(chan *rpc.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { transmit <- in - return &pb.TransmitResponse{}, errors.New("transmission error") + return &rpc.TransmitResponse{}, errors.New("transmission error") } q := newMockQ() s.q = q diff --git a/core/services/ocr2/plugins/llo/helpers_test.go b/core/services/ocr2/plugins/llo/helpers_test.go index 947b66ca8ed..ff3f6e3461e 100644 --- a/core/services/ocr2/plugins/llo/helpers_test.go +++ b/core/services/ocr2/plugins/llo/helpers_test.go @@ -21,6 +21,10 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" + "google.golang.org/grpc" + + "github.com/smartcontractkit/chainlink-data-streams/rpc" + "github.com/smartcontractkit/chainlink-data-streams/rpc/mtls" "github.com/smartcontractkit/wsrpc/credentials" "github.com/smartcontractkit/wsrpc/peer" @@ -48,33 +52,81 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) -var _ pb.MercuryServer = &mercuryServer{} +var _ pb.MercuryServer = &wsrpcMercuryServer{} -type request struct { - pk credentials.StaticSizedPublicKey - req *pb.TransmitRequest +type mercuryServer struct { + rpc.UnimplementedTransmitterServer + privKey ed25519.PrivateKey + reqsCh chan *rpc.TransmitRequest + t *testing.T } -func (r request) TransmitterID() ocr2types.Account { - return ocr2types.Account(fmt.Sprintf("%x", r.pk)) +func startMercuryServer(t *testing.T, srv *mercuryServer, pubKeys []ed25519.PublicKey) (serverURL string) { + // Set up the grpc server + lis, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("[MAIN] failed to listen: %v", err) + } + serverURL = lis.Addr().String() + sMtls, err := mtls.NewTransportCredentials(srv.privKey, pubKeys) + require.NoError(t, err) + s := grpc.NewServer(grpc.Creds(sMtls)) + + // Register mercury implementation with the wsrpc server + rpc.RegisterTransmitterServer(s, srv) + + // Start serving + go func() { + s.Serve(lis) //nolint:errcheck // don't care about errors in tests + }() + + t.Cleanup(s.Stop) + + return } -type mercuryServer struct { +func NewMercuryServer(t *testing.T, privKey ed25519.PrivateKey, reqsCh chan *rpc.TransmitRequest) *mercuryServer { + return &mercuryServer{rpc.UnimplementedTransmitterServer{}, privKey, reqsCh, t} +} + +func (s *mercuryServer) Transmit(ctx context.Context, req *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { + s.reqsCh <- req + + return &rpc.TransmitResponse{ + Code: 1, + Error: "", + }, nil +} + +func (s *mercuryServer) LatestReport(ctx context.Context, lrr *rpc.LatestReportRequest) (*rpc.LatestReportResponse, error) { + panic("should not be called") +} + +type wsrpcMercuryServer struct { privKey ed25519.PrivateKey - reqsCh chan request + reqsCh chan wsrpcRequest t *testing.T } -func NewMercuryServer(t *testing.T, privKey ed25519.PrivateKey, reqsCh chan request) *mercuryServer { - return &mercuryServer{privKey, reqsCh, t} +type wsrpcRequest struct { + pk credentials.StaticSizedPublicKey + req *pb.TransmitRequest +} + +func (r wsrpcRequest) TransmitterID() ocr2types.Account { + return ocr2types.Account(fmt.Sprintf("%x", r.pk)) +} + +func NewWSRPCMercuryServer(t *testing.T, privKey ed25519.PrivateKey, reqsCh chan wsrpcRequest) *wsrpcMercuryServer { + return &wsrpcMercuryServer{privKey, reqsCh, t} } -func (s *mercuryServer) Transmit(ctx context.Context, req *pb.TransmitRequest) (*pb.TransmitResponse, error) { +func (s *wsrpcMercuryServer) Transmit(ctx context.Context, req *pb.TransmitRequest) (*pb.TransmitResponse, error) { p, ok := peer.FromContext(ctx) if !ok { return nil, errors.New("could not extract public key") } - r := request{p.PublicKey, req} + r := wsrpcRequest{p.PublicKey, req} s.reqsCh <- r return &pb.TransmitResponse{ @@ -83,11 +135,11 @@ func (s *mercuryServer) Transmit(ctx context.Context, req *pb.TransmitRequest) ( }, nil } -func (s *mercuryServer) LatestReport(ctx context.Context, lrr *pb.LatestReportRequest) (*pb.LatestReportResponse, error) { +func (s *wsrpcMercuryServer) LatestReport(ctx context.Context, lrr *pb.LatestReportRequest) (*pb.LatestReportResponse, error) { panic("should not be called") } -func startMercuryServer(t *testing.T, srv *mercuryServer, pubKeys []ed25519.PublicKey) (serverURL string) { +func startWSRPCMercuryServer(t *testing.T, srv *wsrpcMercuryServer, pubKeys []ed25519.PublicKey) (serverURL string) { // Set up the wsrpc server lis, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { @@ -147,6 +199,7 @@ func setupNode( dbName string, backend evmtypes.Backend, csaKey csakey.KeyV2, + transmissionMode string, ) (app chainlink.Application, peerID string, clientPubKey credentials.StaticSizedPublicKey, ocr2kb ocr2key.KeyBundle, observedLogs *observer.ObservedLogs) { k := big.NewInt(int64(port)) // keys unique to port p2pKey := p2pkey.MustNewV2XXXTestingOnly(k) @@ -186,6 +239,9 @@ func setupNode( // [Mercury] c.Mercury.VerboseLogging = ptr(true) c.Mercury.Transmitter.TransmitConcurrency = ptr(uint32(5)) // Avoid a ridiculous number of goroutines + if transmissionMode != "" { + c.Mercury.Transmitter.Protocol = ptr(transmissionMode) + } }) lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.DebugLevel) diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index 90a41886761..c942d44c954 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -33,6 +33,7 @@ import ( llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" datastreamsllo "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink-data-streams/rpc" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" @@ -363,16 +364,16 @@ func TestIntegration_LLO_evm_premium_legacy(t *testing.T) { // Setup bootstrap bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 1)) bootstrapNodePort := freeport.GetOne(t) - appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) + appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey, "") bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} t.Run("using legacy verifier configuration contract, produces reports in v0.3 format", func(t *testing.T) { - reqs := make(chan request, 100000) + reqs := make(chan wsrpcRequest, 100000) serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 2)) serverPubKey := serverKey.PublicKey - srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) + srv := NewWSRPCMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) - serverURL := startMercuryServer(t, srv, clientPubKeys) + serverURL := startWSRPCMercuryServer(t, srv, clientPubKeys) donID := uint32(995544) streams := []Stream{ethStream, linkStream, quoteStream1, quoteStream2} @@ -382,7 +383,7 @@ func TestIntegration_LLO_evm_premium_legacy(t *testing.T) { } // Setup oracle nodes - oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams) + oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams, "wsrpc") chainID := testutils.SimulatedChainID relayType := "evm" @@ -579,11 +580,11 @@ func TestIntegration_LLO_evm_abi_encode_unpacked(t *testing.T) { // Setup bootstrap bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 1)) bootstrapNodePort := freeport.GetOne(t) - appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) + appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey, "") bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} t.Run("generates reports using go ReportFormatEVMABIEncodeUnpacked format", func(t *testing.T) { - reqs := make(chan request, 100000) + reqs := make(chan *rpc.TransmitRequest, 100000) serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 2)) serverPubKey := serverKey.PublicKey srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) @@ -598,7 +599,7 @@ func TestIntegration_LLO_evm_abi_encode_unpacked(t *testing.T) { } // Setup oracle nodes - oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams) + oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams, "grpc") chainID := testutils.SimulatedChainID relayType := "evm" @@ -938,7 +939,7 @@ dp -> deribit_funding_interval_hours_parse -> deribit_funding_interval_hours_dec for req := range reqs { v := make(map[string]interface{}) - err := mercury.PayloadTypes.UnpackIntoMap(v, req.req.Payload) + err := mercury.PayloadTypes.UnpackIntoMap(v, req.Payload) require.NoError(t, err) report, exists := v["report"] if !exists { @@ -1058,11 +1059,11 @@ func TestIntegration_LLO_blue_green_lifecycle(t *testing.T) { // Setup bootstrap bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 1)) bootstrapNodePort := freeport.GetOne(t) - appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) + appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey, "") bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} t.Run("Blue/Green lifecycle (using JSON report format)", func(t *testing.T) { - reqs := make(chan request, 100000) + reqs := make(chan *rpc.TransmitRequest, 100000) serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(salt - 2)) serverPubKey := serverKey.PublicKey srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) @@ -1077,7 +1078,7 @@ func TestIntegration_LLO_blue_green_lifecycle(t *testing.T) { } // Setup oracle nodes - oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams) + oracles, nodes := setupNodes(t, nNodes, backend, clientCSAKeys, streams, "grpc") chainID := testutils.SimulatedChainID relayType := "evm" @@ -1128,7 +1129,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi // NOTE: Wait until blue produces a report for req := range reqs { - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1149,7 +1150,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi // NOTE: Wait until green produces the first "specimen" report for req := range reqs { - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1170,7 +1171,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi // NOTE: Wait for first non-specimen report for the newly promoted (green) instance for req := range reqs { - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1239,7 +1240,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi if i == 5 { break } - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1256,7 +1257,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi // NOTE: Wait until blue produces the first "specimen" report for req := range reqs { - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1276,7 +1277,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi // NOTE: Wait for first non-specimen report for the newly promoted (blue) instance for req := range reqs { - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1316,7 +1317,7 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi // NOTE: Wait until the first report for the new channel definition is produced for req := range reqs { - _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.req.Payload) + _, _, r, _, err := (datastreamsllo.JSONReportCodec{}).UnpackDecode(req.Payload) require.NoError(t, err) allReports[r.ConfigDigest] = append(allReports[r.ConfigDigest], r) @@ -1343,10 +1344,10 @@ channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, confi }) } -func setupNodes(t *testing.T, nNodes int, backend evmtypes.Backend, clientCSAKeys []csakey.KeyV2, streams []Stream) (oracles []confighelper.OracleIdentityExtra, nodes []Node) { +func setupNodes(t *testing.T, nNodes int, backend evmtypes.Backend, clientCSAKeys []csakey.KeyV2, streams []Stream, transmissionMode string) (oracles []confighelper.OracleIdentityExtra, nodes []Node) { ports := freeport.GetN(t, nNodes) for i := 0; i < nNodes; i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_streams_%d", i), backend, clientCSAKeys[i]) + app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_streams_%d", i), backend, clientCSAKeys[i], transmissionMode) nodes = append(nodes, Node{ app, transmitter, kb, observedLogs, diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index ae77ce61e10..748e1c87a1e 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -3,6 +3,7 @@ package evm import ( "bytes" "context" + "crypto/ed25519" "crypto/sha256" "encoding/json" "errors" @@ -45,6 +46,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/llo" "github.com/smartcontractkit/chainlink/v2/core/services/llo/bm" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/grpc" "github.com/smartcontractkit/chainlink/v2/core/services/llo/mercurytransmitter" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipcommit" @@ -738,11 +740,25 @@ func (r *Relayer) NewLLOProvider(ctx context.Context, rargs commontypes.RelayArg r.lggr.Info("Benchmark mode enabled, using dummy transmitter. NOTE: THIS WILL NOT TRANSMIT ANYTHING") transmitter = bm.NewTransmitter(r.lggr, fmt.Sprintf("%x", privKey.PublicKey)) } else { - clients := make(map[string]wsrpc.Client) + clients := make(map[string]grpc.Client) for _, server := range lloCfg.GetServers() { - client, err2 := r.mercuryPool.Checkout(ctx, privKey, server.PubKey, server.URL) - if err2 != nil { - return nil, err2 + var client grpc.Client + switch r.mercuryCfg.Transmitter().Protocol() { + case "grpc": + client = grpc.NewClient(grpc.ClientOpts{ + Logger: r.lggr, + ClientPrivKey: privKey.PrivateKey(), + ServerPubKey: ed25519.PublicKey(server.PubKey), + ServerURL: server.URL, + }) + case "wsrpc": + wsrpcClient, checkoutErr := r.mercuryPool.Checkout(ctx, privKey, server.PubKey, server.URL) + if checkoutErr != nil { + return nil, checkoutErr + } + client = wsrpc.GRPCCompatibilityWrapper{Client: wsrpcClient} + default: + return nil, fmt.Errorf("unsupported protocol %q", r.mercuryCfg.Transmitter().Protocol()) } clients[server.URL] = client } diff --git a/core/services/relay/evm/mercury/orm_test.go b/core/services/relay/evm/mercury/orm_test.go index f3ff70cdced..090b3f06eac 100644 --- a/core/services/relay/evm/mercury/orm_test.go +++ b/core/services/relay/evm/mercury/orm_test.go @@ -178,17 +178,17 @@ func TestORM_InsertTransmitRequest_MultipleServerURLs(t *testing.T) { transmissions, err := orm.GetTransmitRequests(ctx, sURL, jobID) require.NoError(t, err) require.Len(t, transmissions, 1) - assert.Equal(t, transmissions[0], &Transmission{Req: &pb.TransmitRequest{Payload: reports[0]}, ReportCtx: reportContexts[0]}) + assert.Equal(t, &Transmission{Req: &pb.TransmitRequest{Payload: reports[0]}, ReportCtx: reportContexts[0]}, transmissions[0]) transmissions, err = orm.GetTransmitRequests(ctx, sURL2, jobID) require.NoError(t, err) require.Len(t, transmissions, 1) - assert.Equal(t, transmissions[0], &Transmission{Req: &pb.TransmitRequest{Payload: reports[0]}, ReportCtx: reportContexts[0]}) + assert.Equal(t, &Transmission{Req: &pb.TransmitRequest{Payload: reports[0]}, ReportCtx: reportContexts[0]}, transmissions[0]) transmissions, err = orm.GetTransmitRequests(ctx, sURL3, jobID) require.NoError(t, err) require.Len(t, transmissions, 1) - assert.Equal(t, transmissions[0], &Transmission{Req: &pb.TransmitRequest{Payload: reports[0]}, ReportCtx: reportContexts[0]}) + assert.Equal(t, &Transmission{Req: &pb.TransmitRequest{Payload: reports[0]}, ReportCtx: reportContexts[0]}, transmissions[0]) l, err := orm.LatestReport(testutils.Context(t), feedID) require.NoError(t, err) diff --git a/core/services/relay/evm/mercury/persistence_manager_test.go b/core/services/relay/evm/mercury/persistence_manager_test.go index 1ba999614a6..f2f4c379a4c 100644 --- a/core/services/relay/evm/mercury/persistence_manager_test.go +++ b/core/services/relay/evm/mercury/persistence_manager_test.go @@ -129,7 +129,7 @@ func TestPersistenceManagerPrune(t *testing.T) { pm2, _ := bootstrapPersistenceManager(t, jobID2, db) for i := 0; i < 20; i++ { - err := pm2.Insert(ctx, &pb.TransmitRequest{Payload: reports[i]}, ocrtypes.ReportContext{ReportTimestamp: ocrtypes.ReportTimestamp{Epoch: uint32(i)}}) + err := pm2.Insert(ctx, &pb.TransmitRequest{Payload: reports[i]}, ocrtypes.ReportContext{ReportTimestamp: ocrtypes.ReportTimestamp{Epoch: uint32(i)}}) //nolint:gosec // G115 require.NoError(t, err) } diff --git a/core/services/relay/evm/mercury/transmitter_test.go b/core/services/relay/evm/mercury/transmitter_test.go index 70ee8fca74f..079f765f07c 100644 --- a/core/services/relay/evm/mercury/transmitter_test.go +++ b/core/services/relay/evm/mercury/transmitter_test.go @@ -28,6 +28,10 @@ import ( type mockCfg struct{} +func (m mockCfg) Protocol() string { + return "" +} + func (m mockCfg) TransmitQueueMaxSize() uint32 { return 10_000 } diff --git a/core/services/relay/evm/mercury/wsrpc/client.go b/core/services/relay/evm/mercury/wsrpc/client.go index 1cd8c9af50d..7aa7de27b8d 100644 --- a/core/services/relay/evm/mercury/wsrpc/client.go +++ b/core/services/relay/evm/mercury/wsrpc/client.go @@ -16,10 +16,13 @@ import ( "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/connectivity" + "github.com/smartcontractkit/chainlink-data-streams/rpc" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/grpc" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/cache" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -396,3 +399,24 @@ func (w *client) RawClient() pb.MercuryClient { defer w.mu.RUnlock() return w.rawClient } + +var _ grpc.Client = GRPCCompatibilityWrapper{} + +type GRPCCompatibilityWrapper struct { + Client +} + +func (w GRPCCompatibilityWrapper) Transmit(ctx context.Context, in *rpc.TransmitRequest) (*rpc.TransmitResponse, error) { + req := &pb.TransmitRequest{ + Payload: in.Payload, + ReportFormat: in.ReportFormat, + } + resp, err := w.Client.Transmit(ctx, req) + if err != nil { + return nil, err + } + return &rpc.TransmitResponse{ + Code: resp.Code, + Error: resp.Error, + }, nil +} diff --git a/core/web/resolver/testdata/config-empty-effective.toml b/core/web/resolver/testdata/config-empty-effective.toml index a2052c04a8e..e219296e673 100644 --- a/core/web/resolver/testdata/config-empty-effective.toml +++ b/core/web/resolver/testdata/config-empty-effective.toml @@ -235,7 +235,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/core/web/resolver/testdata/config-full.toml b/core/web/resolver/testdata/config-full.toml index 1418ae9497e..4672d176915 100644 --- a/core/web/resolver/testdata/config-full.toml +++ b/core/web/resolver/testdata/config-full.toml @@ -245,6 +245,7 @@ LatestReportDeadline = '1m42s' CertFile = '' [Mercury.Transmitter] +Protocol = 'grpc' TransmitQueueMaxSize = 123 TransmitTimeout = '3m54s' TransmitConcurrency = 456 diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml index f5de84093a4..35974ea1ac8 100644 --- a/core/web/resolver/testdata/config-multi-chain-effective.toml +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -235,7 +235,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/deployment/go.mod b/deployment/go.mod index 20ec2aa2d51..61386414da3 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -415,7 +415,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index f39378c7369..fdc79445ba5 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 9e93c6d2e77..18a44e30fa5 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -1900,15 +1900,26 @@ CertFile is the path to a PEM file of trusted root certificate authority certifi ## Mercury.Transmitter ```toml [Mercury.Transmitter] -TransmitQueueMaxSize = 10_000 # Default +Protocol = "wsrpc" # Default +TransmitQueueMaxSize = 100_000 # Default TransmitTimeout = "5s" # Default TransmitConcurrency = 100 # Default ``` Mercury.Transmitter controls settings for the mercury transmitter +### Protocol +```toml +Protocol = "wsrpc" # Default +``` +Protocol is the protocol to use for the transmitter. + +Options are either: +- "wsrpc" for the legacy websocket protocol +- "grpc" for the gRPC protocol + ### TransmitQueueMaxSize ```toml -TransmitQueueMaxSize = 10_000 # Default +TransmitQueueMaxSize = 100_000 # Default ``` TransmitQueueMaxSize controls the size of the transmit queue. This is scoped per OCR instance. If the queue is full, the transmitter will start dropping diff --git a/go.mod b/go.mod index 1cad28ea09d..b40846d2419 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 diff --git a/go.sum b/go.sum index 10c6bc0e667..0c4377dc53d 100644 --- a/go.sum +++ b/go.sum @@ -1158,8 +1158,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 65d4bfb05f3..a1d096882c8 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -430,7 +430,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f5a223dd01c..0e9d850ed22 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1418,8 +1418,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 67acbc538b8..d288fe465ad 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -413,7 +413,7 @@ require ( github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect - github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 23f6bde3370..219ff5fe19a 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1407,8 +1407,8 @@ github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4 h1:8qPzgbMGGn6CxQe/cjWvBgNKAxOL+brZZV+xYoY5+GE= -github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250113165937-53c02f2513d4/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= +github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= diff --git a/testdata/scripts/config/merge_raw_configs.txtar b/testdata/scripts/config/merge_raw_configs.txtar index efac49f8ef8..08a6aa74a6a 100644 --- a/testdata/scripts/config/merge_raw_configs.txtar +++ b/testdata/scripts/config/merge_raw_configs.txtar @@ -382,7 +382,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/default.txtar b/testdata/scripts/node/validate/default.txtar index d4e4a188d2a..135b0c1dbb8 100644 --- a/testdata/scripts/node/validate/default.txtar +++ b/testdata/scripts/node/validate/default.txtar @@ -247,7 +247,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/defaults-override.txtar b/testdata/scripts/node/validate/defaults-override.txtar index eaa8b9b2e43..44f24dda47f 100644 --- a/testdata/scripts/node/validate/defaults-override.txtar +++ b/testdata/scripts/node/validate/defaults-override.txtar @@ -308,7 +308,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar index 8e632f7b23f..79fee5634d8 100644 --- a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar @@ -291,7 +291,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar index cbe09179049..2a64da5c274 100644 --- a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar @@ -291,7 +291,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/disk-based-logging.txtar b/testdata/scripts/node/validate/disk-based-logging.txtar index ed6d3d608d8..b6450111b71 100644 --- a/testdata/scripts/node/validate/disk-based-logging.txtar +++ b/testdata/scripts/node/validate/disk-based-logging.txtar @@ -291,7 +291,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/fallback-override.txtar b/testdata/scripts/node/validate/fallback-override.txtar index 91feb48693d..58580d8203a 100644 --- a/testdata/scripts/node/validate/fallback-override.txtar +++ b/testdata/scripts/node/validate/fallback-override.txtar @@ -382,7 +382,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/invalid-ocr-p2p.txtar b/testdata/scripts/node/validate/invalid-ocr-p2p.txtar index 2cc7b7afe0e..5bf99757698 100644 --- a/testdata/scripts/node/validate/invalid-ocr-p2p.txtar +++ b/testdata/scripts/node/validate/invalid-ocr-p2p.txtar @@ -276,7 +276,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/invalid.txtar b/testdata/scripts/node/validate/invalid.txtar index f0882d0d24c..2247cf66e87 100644 --- a/testdata/scripts/node/validate/invalid.txtar +++ b/testdata/scripts/node/validate/invalid.txtar @@ -281,7 +281,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/valid.txtar b/testdata/scripts/node/validate/valid.txtar index f7278540745..f431e853454 100644 --- a/testdata/scripts/node/validate/valid.txtar +++ b/testdata/scripts/node/validate/valid.txtar @@ -288,7 +288,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 diff --git a/testdata/scripts/node/validate/warnings.txtar b/testdata/scripts/node/validate/warnings.txtar index 85b7bc6a253..3174dab46ae 100644 --- a/testdata/scripts/node/validate/warnings.txtar +++ b/testdata/scripts/node/validate/warnings.txtar @@ -270,7 +270,8 @@ LatestReportDeadline = '5s' CertFile = '' [Mercury.Transmitter] -TransmitQueueMaxSize = 10000 +Protocol = 'wsrpc' +TransmitQueueMaxSize = 100000 TransmitTimeout = '5s' TransmitConcurrency = 100 From 0f554159e80887f9433442317030faaccdf9dc8c Mon Sep 17 00:00:00 2001 From: Gabriel Paradiso Date: Thu, 16 Jan 2025 17:15:36 +0100 Subject: [PATCH 72/91] chore: script to generate local ocr3 config (#15808) --- core/scripts/keystone/main.go | 1 + .../src/generate_local_ocr3_config.go | 119 ++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 core/scripts/keystone/src/generate_local_ocr3_config.go diff --git a/core/scripts/keystone/main.go b/core/scripts/keystone/main.go index 4bd8dea0e5f..3f14540e22c 100644 --- a/core/scripts/keystone/main.go +++ b/core/scripts/keystone/main.go @@ -18,6 +18,7 @@ func main() { src.NewProvisionKeystoneCommand(), src.NewDeployAndInitializeCapabilitiesRegistryCommand(), src.NewToolkit(), + src.NewGenerateLocalOCR3ConfigCommand(), } commandsList := func(commands []command) string { diff --git a/core/scripts/keystone/src/generate_local_ocr3_config.go b/core/scripts/keystone/src/generate_local_ocr3_config.go new file mode 100644 index 00000000000..c171c7f097d --- /dev/null +++ b/core/scripts/keystone/src/generate_local_ocr3_config.go @@ -0,0 +1,119 @@ +package src + +import ( + "encoding/json" + "os" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/keystone" + ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone" +) + +type generateLocalOCR3Config struct{} + +func NewGenerateLocalOCR3ConfigCommand() *generateLocalOCR3Config { + return &generateLocalOCR3Config{} +} + +func (g *generateLocalOCR3Config) Name() string { + return "generate-local-ocr3-config" +} + +func (g *generateLocalOCR3Config) Run(args []string) { + publicKeys := []byte(`[ + { + "EthAddress": "0xF4e7e516146c8567F8E8be0ED1f1A92798628d35", + "P2PPeerID": "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ", + "OCR2BundleID": "2f92c96da20fbe39c89e59516e3a7473254523316887394e406527c72071d3db", + "OCR2OnchainPublicKey": "a2402db8e549f094ea31e1c0edd77623f4ca5b12", + "OCR2OffchainPublicKey": "3ca9918cd2787de8f9aff91f220f30a5cc54c394f73e173b12c93368bd7072ad", + "OCR2ConfigPublicKey": "19904debd03994fe9ea411cda7a6b2f01f20a3fe803df0fed67aaf00cc99113f", + "CSAPublicKey": "csa_dbae6965bad0b0fa95ecc34a602eee1c0c570ddc29b56502e400d18574b8c3df" + }, + { + "EthAddress": "0x8B60FDcc9CAC8ea476b31d17011CB204471431d9", + "P2PPeerID": "12D3KooWFUjV73ZYkAMhS2cVwte3kXDWD8Ybyx3u9CEDHNoeEhBH", + "OCR2BundleID": "b3df4d8748b67731a1112e8b45a764941974f5590c93672eebbc4f3504dd10ed", + "OCR2OnchainPublicKey": "4af19c802b244d1d085492c3946391c965e10519", + "OCR2OffchainPublicKey": "365b9e1c3c945fc3f51afb25772f0a5a1f1547935a4b5dc89c012f590709fefe", + "OCR2ConfigPublicKey": "15ff12569d11b8ff9f17f8999ea928d03a439f3fb116661cbc4669a0a3192775", + "CSAPublicKey": "csa_c5cc655a9c19b69626519c4a72c44a94a3675daeba9c16cc23e010a7a6dac1be" + }, + { + "EthAddress": "0x6620F516F29979B214e2451498a057FDd3a0A85d", + "P2PPeerID": "12D3KooWRTtH2WWrztD87Do1kXePSmGjyU4r7mZVWThmqTGgdbUC", + "OCR2BundleID": "38459ae37f29f2c1fde0f25972a973322be8cada82acf43f464756836725be97", + "OCR2OnchainPublicKey": "61925685d2b80b121537341d063c4e57b2f9323c", + "OCR2OffchainPublicKey": "7fe2dbd9f9fb96f7dbbe0410e32d435ad67dae6c91410189fe5664cf3057ef10", + "OCR2ConfigPublicKey": "2f02fd80b362e1c7acf91680fd48c062718233acd595a6ae7cbe434e118e6a4f", + "CSAPublicKey": "csa_7407fc90c70895c0fb2bdf385e2e4918364bec1f7a74bad7fdf696bffafbcab8" + }, + { + "EthAddress": "0xFeB61E22FCf4F9740c9D96b05199F195bd61A7c2", + "P2PPeerID": "12D3KooWMTZnZtcVK4EJsjkKsV9qXNoNRSjT62CZi3tKkXGaCsGh", + "OCR2BundleID": "b5dbc4c9da983cddde2e3226b85807eb7beaf818694a22576af4d80f352702ed", + "OCR2OnchainPublicKey": "fd97efd53fc20acc098fcd746c04d8d7540d97e0", + "OCR2OffchainPublicKey": "91b393bb5e6bd6fd9de23845bcd0e0d9b0dd28a1d65d3cfb1fce9f91bd3d8c19", + "OCR2ConfigPublicKey": "09eb53924ff8b33a08b4eae2f3819015314ce6e8864ac4f86e97caafd4181506", + "CSAPublicKey": "csa_ef55caf17eefc2a9d547b5a3978d396bd237c73af99cd849a4758701122e3cba" + }, + { + "EthAddress": "0x882Fd04D78A7e7D386Dd5b550f19479E5494B0B2", + "P2PPeerID": "12D3KooWRsM9yordRQDhLgbErH8WMMGz1bC1J4hR5gAGvMWu8goN", + "OCR2BundleID": "260d5c1a618cdf5324509d7db95f5a117511864ebb9e1f709e8969339eb225af", + "OCR2OnchainPublicKey": "a0b67dc5345a71d02b396147ae2cb75dda63cbe9", + "OCR2OffchainPublicKey": "4f42ef42e5cc351dbbd79c29ef33af25c0250cac84837c1ff997bc111199d07e", + "OCR2ConfigPublicKey": "3b90249731beb9e4f598371f0b96c3babf47bcc62121ebc9c195e3c33e4fd708", + "CSAPublicKey": "csa_1b874ac2d54b966cec5a8358678ca6f030261aabf3372ce9dbea2d4eb9cdab3d" + }]`) + + var pubKeys []ksdeploy.NodeKeys + err := json.Unmarshal(publicKeys, &pubKeys) + if err != nil { + panic(err) + } + + config := []byte(`{ + "MaxQueryLengthBytes": 1000000, + "MaxObservationLengthBytes": 1000000, + "MaxReportLengthBytes": 1000000, + "MaxRequestBatchSize": 1000, + "UniqueReports": true, + "DeltaProgressMillis": 5000, + "DeltaResendMillis": 5000, + "DeltaInitialMillis": 5000, + "DeltaRoundMillis": 2000, + "DeltaGraceMillis": 500, + "DeltaCertifiedCommitRequestMillis": 1000, + "DeltaStageMillis": 30000, + "MaxRoundsPerEpoch": 10, + "TransmissionSchedule": [4], + "MaxDurationQueryMillis": 1000, + "MaxDurationObservationMillis": 1000, + "MaxDurationReportMillis": 1000, + "MaxDurationAcceptMillis": 1000, + "MaxDurationTransmitMillis": 1000, + "MaxFaultyOracles": 1}`) + var cfg keystone.OracleConfig + err = json.Unmarshal(config, &cfg) + if err != nil { + panic(err) + } + + ocrConfig, err := ksdeploy.GenerateOCR3Config(cfg, pubKeys, deployment.XXXGenerateTestOCRSecrets()) + if err != nil { + panic(err) + } + + // Convert to JSON + jsonData, err := json.MarshalIndent(ocrConfig, "", " ") + if err != nil { + panic(err) + } + + // Generate a json file in `./OCR3Config.json` + err = os.WriteFile("./OCR3LocalConfig.json", jsonData, 0600) + if err != nil { + panic(err) + } +} From f9dd7e13bc952e1f006f7e5c663b0953aa565cce Mon Sep 17 00:00:00 2001 From: Street <5597260+MStreet3@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:18:31 -0500 Subject: [PATCH 73/91] Fix(core/scripts): removes panic and adds node public keys to peer (#15950) * fix(core/scripts): adds encrypted public key to peer * chore: bumps changeset --- .changeset/eight-meals-march.md | 7 +++++++ core/scripts/common/helpers.go | 5 +++++ .../src/88_capabilities_registry_helpers.go | 16 +++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .changeset/eight-meals-march.md diff --git a/.changeset/eight-meals-march.md b/.changeset/eight-meals-march.md new file mode 100644 index 00000000000..f2439280063 --- /dev/null +++ b/.changeset/eight-meals-march.md @@ -0,0 +1,7 @@ +--- +"chainlink": patch +--- + +Prevents a panic in test helper for confirming transaction +and adds encrypted public key to a peer before calling addNodes +on CapabilitiesRegistry diff --git a/core/scripts/common/helpers.go b/core/scripts/common/helpers.go index 97ca2dd4929..f852c88de5b 100644 --- a/core/scripts/common/helpers.go +++ b/core/scripts/common/helpers.go @@ -298,6 +298,11 @@ func TenderlySimLink(simID string) string { // ConfirmTXMined confirms that the given transaction is mined and prints useful execution information. func ConfirmTXMined(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64, txInfo ...string) (receipt *types.Receipt) { + if transaction == nil { + fmt.Println("No transaction to confirm") + return + } + fmt.Println("Executing TX", ExplorerLink(chainID, transaction.Hash()), txInfo) receipt, err := bind.WaitMined(context, client, transaction) PanicErr(err) diff --git a/core/scripts/keystone/src/88_capabilities_registry_helpers.go b/core/scripts/keystone/src/88_capabilities_registry_helpers.go index 5494375aa4f..b75b2fb48af 100644 --- a/core/scripts/keystone/src/88_capabilities_registry_helpers.go +++ b/core/scripts/keystone/src/88_capabilities_registry_helpers.go @@ -554,13 +554,23 @@ func peerToNode(nopID uint32, p peer) (kcr.CapabilitiesRegistryNodeParams, error return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert signer: %w", err) } + epk := strings.TrimPrefix(p.EncryptionPublicKey, "0x") + epkB, err := hex.DecodeString(epk) + if err != nil { + return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert encryptionPublicKey: %w", err) + } + + var epkb [32]byte + copy(epkb[:], epkB) + var sigb [32]byte copy(sigb[:], signerB) return kcr.CapabilitiesRegistryNodeParams{ - NodeOperatorId: nopID, - P2pId: peerIDB, - Signer: sigb, + NodeOperatorId: nopID, + P2pId: peerIDB, + Signer: sigb, + EncryptionPublicKey: epkb, }, nil } From a3042b6f80db2373ed574f2e612f464a6d9e6e3f Mon Sep 17 00:00:00 2001 From: Dylan Tinianov Date: Thu, 16 Jan 2025 12:00:09 -0500 Subject: [PATCH 74/91] Bump chainlink-framework (#15955) --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index db32d617615..e312d6df955 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -315,7 +315,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index f5c0b058cfc..097005e9dc5 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1172,8 +1172,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= diff --git a/deployment/go.mod b/deployment/go.mod index 61386414da3..c4da3714707 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -417,7 +417,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index fdc79445ba5..31fa464b3b0 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1398,8 +1398,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= diff --git a/go.mod b/go.mod index b40846d2419..6b42f86e66c 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 github.com/smartcontractkit/chainlink-feeds v0.1.1 - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 diff --git a/go.sum b/go.sum index 0c4377dc53d..6152134905c 100644 --- a/go.sum +++ b/go.sum @@ -1162,8 +1162,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index a1d096882c8..90360e7f736 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -432,7 +432,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 0e9d850ed22..133585022d5 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1422,8 +1422,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index d288fe465ad..d344cc9a352 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -415,7 +415,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 219ff5fe19a..81be2e202ea 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1411,8 +1411,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20 h1:p/gzWpEf8alodCXm2Gtx2kWI/O9ZLdWZOdNnv5ZGO6c= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20241220173418-09e17ddbeb20/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= From 46ef62537ea0389a86de03465253a8629766c2c9 Mon Sep 17 00:00:00 2001 From: Josh Weintraub <26035072+jhweintraub@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:04:44 -0500 Subject: [PATCH 75/91] CCIP-4723 Feat/burn to zero address pool (#15804) * Begin adding tests and fix Hybrid Pool bug * add test for HybridUSDCTokenPool bugfix and changeset * [Bot] Update changeset file with jira issues * linter fix * more tests * finish filling in coverage gaps * fix CI issues * every time I encounter a snapshot issue like this a little part of me dies inside * remove transferLiquidity function. Liquidity transfers can be manual * fixes * fix gas snapshotting from merge * fix comments, add new error, and fix snapshot * remove transferLiquidity function from hybrid USDC token pool * test renaming * streamine provideLiquidity authorization check * update rebalancer system for unsiloed chains * update snapshot * Update Liquidity functions and update function for ease of use * Fix naming and other additional security checks * new error code and test cleanup * fix snapshot changes from develop merge * fix test linting * fix comments --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> --- contracts/.changeset/chilly-news-wink.md | 10 + contracts/gas-snapshots/ccip.gas-snapshot | 56 ++-- .../ccip/pools/BurnMintTokenPoolAbstract.sol | 2 +- .../ccip/pools/BurnToAddressMintTokenPool.sol | 103 ++++++ .../ccip/pools/SiloedLockReleaseTokenPool.sol | 299 ++++++++++++++++++ .../USDC/HybridLockReleaseUSDCTokenPool.sol | 26 -- .../MaybeRevertingBurnMintTokenPool.sol | 2 +- ...urnToAddressMintTokenPool.lockOrBurn.t.sol | 63 ++++ ...ToAddressMintTokenPool.releaseOrMint.t.sol | 35 ++ ...AddressMintTokenPool.setMintedTokens.t.sol | 20 ++ .../BurnToAddressMintTokenPoolSetup.t.sol | 28 ++ ...iloedLockReleaseTokenPool.lockOrBurn.t.sol | 57 ++++ ...ockReleaseTokenPool.provideLiquidity.t.sol | 91 ++++++ ...edLockReleaseTokenPool.releaseOrMint.t.sol | 149 +++++++++ ...edLockReleaseTokenPool.setRebalancer.t.sol | 36 +++ ...easeTokenPool.updateSiloDesignations.t.sol | 73 +++++ ...ckReleaseTokenPool.withdrawLiquidity.t.sol | 126 ++++++++ .../SiloedLockReleaseTokenPoolSetup.t.sol | 96 ++++++ ...leaseUSDCTokenPool.transferLiquidity.t.sol | 95 ------ 19 files changed, 1225 insertions(+), 142 deletions(-) create mode 100644 contracts/.changeset/chilly-news-wink.md create mode 100644 contracts/src/v0.8/ccip/pools/BurnToAddressMintTokenPool.sol create mode 100644 contracts/src/v0.8/ccip/pools/SiloedLockReleaseTokenPool.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.lockOrBurn.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.releaseOrMint.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.setMintedTokens.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPoolSetup.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.lockOrBurn.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.provideLiquidity.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.releaseOrMint.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.setRebalancer.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.updateSiloDesignations.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.withdrawLiquidity.t.sol create mode 100644 contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPoolSetup.t.sol delete mode 100644 contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol diff --git a/contracts/.changeset/chilly-news-wink.md b/contracts/.changeset/chilly-news-wink.md new file mode 100644 index 00000000000..2ccdbb483ca --- /dev/null +++ b/contracts/.changeset/chilly-news-wink.md @@ -0,0 +1,10 @@ +--- +'@chainlink/contracts': minor +--- + +#feature Add two new pool types: Siloed-LockRelease and BurnToAddress and fix bug in HybridUSDCTokenPool for transferLiqudity #bugfix + + +PR issue: CCIP-4723 + +Solidity Review issue: CCIP-3966 \ No newline at end of file diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 942e75dc516..f1eefe78fa8 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -4,6 +4,9 @@ BurnMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 236872) BurnMintTokenPool_lockOrBurn:test_Setup() (gas: 17819) BurnMintTokenPool_releaseOrMint:test_PoolMint() (gas: 102527) BurnMintWithLockReleaseFlagTokenPool_lockOrBurn:test_LockOrBurn_CorrectReturnData() (gas: 237292) +BurnToAddressMintTokenPool_lockOrBurn:test_LockOrBurn() (gas: 257956) +BurnToAddressMintTokenPool_releaseOrMint:test_releaseOrMint() (gas: 126048) +BurnToAddressMintTokenPool_setOutstandingokens:test_setOutstandingTokens() (gas: 37793) BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 239012) BurnWithFromMintTokenPool_lockOrBurn:test_Setup() (gas: 24169) CCIPClientExample_sanity:test_ImmutableExamples() (gas: 2073613) @@ -126,12 +129,11 @@ FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate() (gas: 53171) FeeQuoter_updateTokenPriceFeeds:test_ZeroFeeds() (gas: 12471) FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress() (gas: 6767) FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress() (gas: 6492) -HybridLockReleaseUSDCTokenPool_TransferLiquidity:test_transferLiquidity() (gas: 167013) -HybridLockReleaseUSDCTokenPool_lockOrBurn:test_PrimaryMechanism() (gas: 130356) -HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism() (gas: 140104) +HybridLockReleaseUSDCTokenPool_lockOrBurn:test_PrimaryMechanism() (gas: 130339) +HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism() (gas: 140169) HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 202967) -HybridLockReleaseUSDCTokenPool_releaseOrMint:test_OnLockReleaseMechanism() (gas: 206218) -HybridLockReleaseUSDCTokenPool_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 260387) +HybridLockReleaseUSDCTokenPool_releaseOrMint:test_OnLockReleaseMechanism() (gas: 206350) +HybridLockReleaseUSDCTokenPool_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 260423) LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquidity() (gas: 3222607) LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList() (gas: 72828) LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint() (gas: 217898) @@ -348,6 +350,22 @@ Router_recoverTokens:test_RecoverTokens() (gas: 52668) Router_routeMessage:test_routeMessage_AutoExec() (gas: 38071) Router_routeMessage:test_routeMessage_ExecutionEvent() (gas: 153593) Router_routeMessage:test_routeMessage_ManualExec() (gas: 31120) +SiloedLockReleaseTokenPool_lockOrBurn:test_lockOrBurn_SiloedFunds() (gas: 76874) +SiloedLockReleaseTokenPool_lockOrBurn:test_lockOrBurn_UnsiloedFunds() (gas: 76104) +SiloedLockReleaseTokenPool_provideLiqudity:test_ProvideLiquidity_LegacyProvideLiquiditySelector() (gas: 91873) +SiloedLockReleaseTokenPool_provideLiqudity:test_ProvideLiquidity_SiloedChain() (gas: 82416) +SiloedLockReleaseTokenPool_provideLiqudity:test_ProvideLiquidity_UnsiloedChain() (gas: 84036) +SiloedLockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_RevertsWhen_InsufficientLiquidity_SiloedChain() (gas: 110002) +SiloedLockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_RevertsWhen_InsufficientLiquidity_UnsiloedChain() (gas: 115718) +SiloedLockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_SiloedChain() (gas: 262340) +SiloedLockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_UnsiloedChain() (gas: 263392) +SiloedLockReleaseTokenPool_setRebalancer:test_setRebalancer_UnsiloedChains() (gas: 24429) +SiloedLockReleaseTokenPool_setRebalancer:test_setSiloRebalancer() (gas: 32165) +SiloedLockReleaseTokenPool_updateSiloDesignations:test_updateSiloDesignations() (gas: 105825) +SiloedLockReleaseTokenPool_withdrawLiqudity:test_withdrawLiquidity_RevertsWhen_LegacyFunctionSelectorUnauthorized() (gas: 18244) +SiloedLockReleaseTokenPool_withdrawLiqudity:test_withdrawLiquidity_SiloedFunds() (gas: 70948) +SiloedLockReleaseTokenPool_withdrawLiqudity:test_withdrawLiquidity_UnsiloedFunds_LegacyFunctionSelector() (gas: 76391) +SiloedLockReleaseTokenPool_withdrawLiqudity:test_withdrawSiloedLiquidity_UnsiloedFunds() (gas: 71945) TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole() (gas: 44236) TokenAdminRegistry_addRegistryModule:test_addRegistryModule() (gas: 67093) TokenAdminRegistry_getAllConfiguredTokens:test_getAllConfiguredTokens_outOfBounds() (gas: 11363) @@ -387,22 +405,22 @@ TokenPool_parseRemoteDecimals:test_parseRemoteDecimals() (gas: 14030) TokenPool_parseRemoteDecimals:test_parseRemoteDecimals_NoDecimalsDefaultsToLocalDecimals() (gas: 9705) TokenPool_removeRemotePool:test_removeRemotePool() (gas: 188402) TokenPool_setRateLimitAdmin:test_SetRateLimitAdmin() (gas: 37630) -USDCBridgeMigrator_BurnLockedUSDC:test_PrimaryMechanism() (gas: 130520) -USDCBridgeMigrator_BurnLockedUSDC:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303986) -USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism() (gas: 140171) +USDCBridgeMigrator_BurnLockedUSDC:test_PrimaryMechanism() (gas: 130502) +USDCBridgeMigrator_BurnLockedUSDC:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303967) +USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism() (gas: 140236) USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 203330) -USDCBridgeMigrator_cancelMigrationProposal:test_cancelExistingCCTPMigrationProposal() (gas: 56117) -USDCBridgeMigrator_provideLiquidity:test_PrimaryMechanism() (gas: 130538) -USDCBridgeMigrator_provideLiquidity:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303986) -USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism() (gas: 140260) +USDCBridgeMigrator_cancelMigrationProposal:test_cancelExistingCCTPMigrationProposal() (gas: 56100) +USDCBridgeMigrator_provideLiquidity:test_PrimaryMechanism() (gas: 130520) +USDCBridgeMigrator_provideLiquidity:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303967) +USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism() (gas: 140325) USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 203331) -USDCBridgeMigrator_releaseOrMint:test_OnLockReleaseMechanism() (gas: 206251) -USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 260440) -USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_destChain() (gas: 142763) -USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain() (gas: 505520) -USDCBridgeMigrator_updateChainSelectorMechanism:test_PrimaryMechanism() (gas: 130520) -USDCBridgeMigrator_updateChainSelectorMechanism:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303968) -USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism() (gas: 140260) +USDCBridgeMigrator_releaseOrMint:test_OnLockReleaseMechanism() (gas: 206383) +USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 260476) +USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_destChain() (gas: 142853) +USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain() (gas: 505540) +USDCBridgeMigrator_updateChainSelectorMechanism:test_PrimaryMechanism() (gas: 130502) +USDCBridgeMigrator_updateChainSelectorMechanism:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303949) +USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism() (gas: 140325) USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 203312) USDCTokenPool_lockOrBurn:test_LockOrBurn() (gas: 128094) USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx() (gas: 260189) diff --git a/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol b/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol index 91472a5f5c8..aba9852d639 100644 --- a/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol +++ b/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol @@ -35,7 +35,7 @@ abstract contract BurnMintTokenPoolAbstract is TokenPool { /// @dev The _validateReleaseOrMint check is an essential security check function releaseOrMint( Pool.ReleaseOrMintInV1 calldata releaseOrMintIn - ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + ) public virtual override returns (Pool.ReleaseOrMintOutV1 memory) { _validateReleaseOrMint(releaseOrMintIn); // Calculate the local amount diff --git a/contracts/src/v0.8/ccip/pools/BurnToAddressMintTokenPool.sol b/contracts/src/v0.8/ccip/pools/BurnToAddressMintTokenPool.sol new file mode 100644 index 00000000000..563375f099a --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnToAddressMintTokenPool.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {BurnMintTokenPoolAbstract} from "./BurnMintTokenPoolAbstract.sol"; +import {TokenPool} from "./TokenPool.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice This pool mints and burns a 3rd-party token by sending tokens to an address which is unrecoverable. +/// @dev The pool is designed to have an immutable burn address. If the tokens at the burn address become recoverable, +/// for example, a quantum computer calculating a private key for the zero address, the pool will need to be replaced +/// with a new pool with a different burn address. +contract BurnToAddressMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion { + using SafeERC20 for IERC20; + + event OutstandingTokensSet(uint256 newMintedTokenAmount, uint256 oldMintedTokenAmount); + + error InsufficientOutstandingTokens(); + + string public constant override typeAndVersion = "BurnToAddressTokenPool 1.5.1"; + + /// @notice The address where tokens are sent during a call to lockOrBurn, functionally burning but without decreasing + /// total supply. This address is expected to have no ability to recover the tokens sent to it, and will thus be locked forever. + /// This can be either an EOA without a corresponding private key, or a contract which does not have the ability to transfer the tokens. + address public immutable i_burnAddress; + + /// @notice Minted Tokens is a safety mechanism to ensure that more tokens cannot be sent out of the bridge + /// than were originally sent in via CCIP. On incoming messages the value is increased, and on outgoing messages, + /// the value is decreased. For pools with existing tokens in circulation, the value may not be known at deployment + /// time, and thus should be set later using the setoutstandingTokens() function. + uint256 internal s_outstandingTokens; + + /// @dev Since burnAddress is expected to make the tokens unrecoverable, no check for the zero address needs to be + /// performed, as it is a valid input. + constructor( + IBurnMintERC20 token, + uint8 localTokenDecimals, + address[] memory allowlist, + address rmnProxy, + address router, + address burnAddress + ) TokenPool(token, localTokenDecimals, allowlist, rmnProxy, router) { + i_burnAddress = burnAddress; + } + + /// @notice Mint tokens from the pool to the recipient, updating the internal accounting for an outflow of tokens. + /// @dev If the amount of tokens to be + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) public virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + // When minting tokens, the local outstanding supply increases. These tokens will be burned + // when they are sent back to the pool on an outgoing message. + s_outstandingTokens += releaseOrMintIn.amount; + + return super.releaseOrMint(releaseOrMintIn); + } + + /// @inheritdoc BurnMintTokenPoolAbstract + /// @notice Tokens are burned by sending to an address which can never transfer them, + /// making the tokens unrecoverable without reducing the total supply. + function _burn( + uint256 amount + ) internal virtual override { + if (amount > s_outstandingTokens) { + revert InsufficientOutstandingTokens(); + } + + // When tokens are burned, the amount outstanding decreases. This ensures that more tokens cannot be sent out + // of the bridge than were originally sent in via CCIP. + s_outstandingTokens -= amount; + + getToken().safeTransfer(i_burnAddress, amount); + } + + /// @notice Returns the address where tokens are sent during a call to lockOrBurn + /// @return burnAddress the address which receives the tokens. + function getBurnAddress() public view returns (address burnAddress) { + return i_burnAddress; + } + + /// @notice Return the amount of tokens which were minted by this contract and not yet burned. + /// @return outstandingTokens The amount of tokens which were minted by this token pool and not yet burned. + function getOutstandingTokens() public view returns (uint256 outstandingTokens) { + return s_outstandingTokens; + } + + /// @notice Set the amount of tokens which were minted by this contract and not yet burned. + /// @param amount The new amount of tokens which were minted by this token pool and not yet burned. + function setOutstandingTokens( + uint256 amount + ) external onlyOwner { + uint256 currentOutstandingTokens = s_outstandingTokens; + + s_outstandingTokens = amount; + + emit OutstandingTokensSet(amount, currentOutstandingTokens); + } +} diff --git a/contracts/src/v0.8/ccip/pools/SiloedLockReleaseTokenPool.sol b/contracts/src/v0.8/ccip/pools/SiloedLockReleaseTokenPool.sol new file mode 100644 index 00000000000..adb3a452957 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/SiloedLockReleaseTokenPool.sol @@ -0,0 +1,299 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {TokenPool} from "./TokenPool.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice A variation on Lock Release token pools where liquidity is shared among some chains, and stored independently +/// for others. Chains which do not share liquidity are known as siloed chains. +contract SiloedLockReleaseTokenPool is TokenPool, ITypeAndVersion { + using SafeERC20 for IERC20; + + error InsufficientLiquidity(uint256 availableLiquidity, uint256 requestedAmount); + error ChainNotSiloed(uint64 remoteChainSelector); + error InvalidChainSelector(uint64 remoteChainSelector); + + event LiquidityAdded(uint64 remoteChainSelector, address indexed provider, uint256 amount); + event LiquidityRemoved(uint64 remoteChainSelector, address indexed provider, uint256 amount); + event ChainUnsiloed(uint64 remoteChainSelector, uint256 amountUnsiloed); + event ChainSiloed(uint64 remoteChainSelector, address rebalancer); + event SiloRebalancerSet(uint64 indexed remoteChainSelector, address oldRebalancer, address newRebalancer); + event UnsiloedRebalancerSet(address oldRebalancer, address newRebalancer); + + string public constant override typeAndVersion = "SiloedLockReleaseTokenPool 1.6.0-dev"; + + /// @notice The amount of tokens available for remote chains which are not siloed as an additional security precaution. + uint256 internal s_unsiloedTokenBalance; + + /// @notice The rebalancer for unsiloed chains, which can add liquidity to the shared pool. + address internal s_rebalancer; + + struct SiloConfigUpdate { + uint64 remoteChainSelector; + address rebalancer; + } + + struct SiloConfig { + uint256 tokenBalance; // The amount of tokens available for incoming messages, either locked or as liquidity. + address rebalancer; // ─╮ The address allowed to add liquidity for the given siloed chain. + bool isSiloed; // ──────╯ Whether funds should be isolated from all other chains or shared amongst all non-siloed chains. + } + + /// @notice The configuration for each chain that is siloed, or not. By default chains are not siloed. + mapping(uint64 remoteChainSelector => SiloConfig) internal s_chainConfigs; + + constructor( + IERC20 token, + uint8 localTokenDecimals, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, localTokenDecimals, allowlist, rmnProxy, router) {} + + /// @notice Locks the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + // If funds need to be siloed, update internal accounting; + if (s_chainConfigs[lockOrBurnIn.remoteChainSelector].isSiloed) { + s_chainConfigs[lockOrBurnIn.remoteChainSelector].tokenBalance += lockOrBurnIn.amount; + } + // If the messages is going to a chain without siloed funds, update state accounting accordingly. + else { + s_unsiloedTokenBalance += lockOrBurnIn.amount; + } + + emit Locked(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({ + destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), + destPoolData: _encodeLocalDecimals() + }); + } + + /// @notice Release tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + /// @dev If the releaseOrMintIn amount is greater than available liquidity, the function will revert as a security + /// measure to prevent funds from a Silo being released by another chain. + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + // Calculate the local amount + uint256 localAmount = + _calculateLocalAmount(releaseOrMintIn.amount, _parseRemoteDecimals(releaseOrMintIn.sourcePoolData)); + + // Save gas by using storage instead of memory as a value may need to be updated. + SiloConfig storage remoteConfig = s_chainConfigs[releaseOrMintIn.remoteChainSelector]; + + // Prevent A silent underflow by explicitly ensuring that enough funds are available to release + uint256 availableLiquidity = remoteConfig.isSiloed ? remoteConfig.tokenBalance : s_unsiloedTokenBalance; + if (localAmount > availableLiquidity) revert InsufficientLiquidity(availableLiquidity, localAmount); + + // Tracking balances independently by chain is a security measure to prevent liquidity for one chain from being + // released by another chain. + if (remoteConfig.isSiloed) { + remoteConfig.tokenBalance -= localAmount; + } else { + s_unsiloedTokenBalance -= localAmount; + } + + // Release to the recipient + getToken().safeTransfer(releaseOrMintIn.receiver, localAmount); + + emit Released(msg.sender, releaseOrMintIn.receiver, localAmount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: localAmount}); + } + + /// @notice Returns whether the tokens locked for a given remote chain should be siloed independently + /// from all other remote chains. + /// @param remoteChainSelector the CCIP specific selector for the remote chain being interacted with. + /// @return isSiloed Whether the funds should be isolated from all the others. + function isSiloed( + uint64 remoteChainSelector + ) external view returns (bool) { + return s_chainConfigs[remoteChainSelector].isSiloed; + } + + /// @notice Returns the amount of tokens in the token pool that were siloed for a specific remote chain selector. + /// @param remoteChainSelector the CCIP specific selector for the remote chain being interacted with. + /// @return lockedTokens The tokens locked into this token pool for the given selector. If the chain is not siloed, + /// the amount will be the amount of liquidity shared among all unsiloed chains. + function getAvailableTokens( + uint64 remoteChainSelector + ) external view returns (uint256 lockedTokens) { + if (s_chainConfigs[remoteChainSelector].isSiloed) { + return s_chainConfigs[remoteChainSelector].tokenBalance; + } + + return s_unsiloedTokenBalance; + } + + /// @notice Returns the amount of tokens in the token pool that are shared among all unsiloed chains. + /// @return unsiloedTokens amount of tokens available to all unsiloed chains. + function getUnsiloedLiquidity() external view returns (uint256) { + return s_unsiloedTokenBalance; + } + + /// @notice Updates designations for chains on whether to mark funds as Siloed or not + /// @param removes A list of chain selectors to disable Siloing. Their funds will be moved into the unsiloed pool. + /// If a chain is not siloed, and attempted to be removed, the function will revert. + /// @param adds A list of chain selectors to enable Siloing. Adding a chain to siloing will not set the rebalancer. + /// The rebalancer will need to be set separately. + function updateSiloDesignations(uint64[] calldata removes, SiloConfigUpdate[] calldata adds) external onlyOwner { + for (uint256 i = 0; i < removes.length; ++i) { + if (!s_chainConfigs[removes[i]].isSiloed) revert ChainNotSiloed(removes[i]); + + // When a chain is removed from siloing, the funds are moved to the accounting pool shared by all unsiloed chain. + uint256 amountUnsiloed = s_chainConfigs[removes[i]].tokenBalance; + + s_unsiloedTokenBalance += amountUnsiloed; + + delete s_chainConfigs[removes[i]]; + + // Emit a removal event which includes the amount of funds moved to the general silo. + emit ChainUnsiloed(removes[i], amountUnsiloed); + } + + for (uint256 i = 0; i < adds.length; ++i) { + // Since the zero chain selector is used to designate unsiloed chains, it should never be used for siloed chains. + if (adds[i].remoteChainSelector == 0) { + revert InvalidChainSelector(0); + } + + SiloConfig memory newConfig = SiloConfig({tokenBalance: 0, rebalancer: adds[i].rebalancer, isSiloed: true}); + + s_chainConfigs[adds[i].remoteChainSelector] = newConfig; + + emit ChainSiloed(adds[i].remoteChainSelector, adds[i].rebalancer); + } + } + + /// @notice Gets the rebalancer able to provide liquidity for a remote chain selector + /// @param remoteChainSelector The CCIP specific selector for the remote chain being interacted with. + /// @return The current liquidity manager, contract owner if the chain's funds are not siloed. + function getSiloRebalancer( + uint64 remoteChainSelector + ) public view returns (address) { + SiloConfig memory remoteConfig = s_chainConfigs[remoteChainSelector]; + if (remoteConfig.isSiloed) { + return remoteConfig.rebalancer; + } + + return s_rebalancer; + } + + /// @notice Sets the Rebalancer address for a given remoteChainSelector. + /// @dev Only callable by the owner. + /// @param remoteChainSelector the remote chain to set. + /// @param newRebalancer the address allowed to add liquidity for the given siloed chain. + function setSiloRebalancer(uint64 remoteChainSelector, address newRebalancer) external onlyOwner { + SiloConfig memory remoteConfig = s_chainConfigs[remoteChainSelector]; + + if (!remoteConfig.isSiloed) revert ChainNotSiloed(remoteChainSelector); + + address oldRebalancer = remoteConfig.rebalancer; + + s_chainConfigs[remoteChainSelector].rebalancer = newRebalancer; + + emit SiloRebalancerSet(remoteChainSelector, newRebalancer, oldRebalancer); + } + + /// @notice Sets the Rebalancer address for unsiloed chains. + /// @dev Only callable by the owner. + /// @param newRebalancer the address allowed to add liquidity for the given siloed chain. + function setRebalancer( + address newRebalancer + ) external onlyOwner { + address oldRebalancer = s_rebalancer; + + s_rebalancer = newRebalancer; + + emit UnsiloedRebalancerSet(newRebalancer, oldRebalancer); + } + + /// @notice Adds liquidity to the pool. The tokens should be approved first. + /// @param remoteChainSelector the remote chain to set. If the chain is not siloed, the liquidity will be shared among all + /// non-siloed chains. + /// @param amount The amount of liquidity to provide. + /// @dev Only the rebalancer for the chain can add liquidity + function provideSiloedLiquidity(uint64 remoteChainSelector, uint256 amount) external { + _provideLiquidity(remoteChainSelector, amount); + } + + /// @notice Adds liquidity to the pool for unsiloed chains. Function is used to support legacy liquidity operations + /// by using a function selector available to previous L/R pools. + /// @dev Since the remoteChainSelector 0 should never be applied to a real chain, it is used to designate unsiloed chains. + /// @param amount The amount of liquidity to provide. + function provideLiquidity( + uint256 amount + ) external { + _provideLiquidity(0, amount); + } + + function _provideLiquidity(uint64 remoteChainSelector, uint256 amount) internal { + if (msg.sender != getSiloRebalancer(remoteChainSelector)) revert Unauthorized(msg.sender); + + // Storage is used instead of memory to save gas, as the state may need to be updated if the chain is siloed. + SiloConfig storage remoteConfig = s_chainConfigs[remoteChainSelector]; + + if (remoteConfig.isSiloed) { + remoteConfig.tokenBalance += amount; + } else { + s_unsiloedTokenBalance += amount; + } + + i_token.safeTransferFrom(msg.sender, address(this), amount); + emit LiquidityAdded(remoteChainSelector, msg.sender, amount); + } + + /// @notice Removes liquidity from the pool for unsiloed chains. Function is used to support legacy liquidity operations + /// by using a function selector available to previous L/R pools. + /// @dev Since the remoteChainSelector 0 should never be applied to a real chain, it is used to designate unsiloed chains. + /// @param amount The amount of liquidity to remove. + function withdrawLiquidity( + uint256 amount + ) external { + _withdrawLiquidity(0, amount); + } + + /// @notice Removed liquidity to the pool. The tokens will be sent to msg.sender. + /// @dev Only the rebalancer can remove liquidity from the contract, for both siloed and unsiloed chains. + /// @param remoteChainSelector the remote chain to set. If the chain is not siloed, then no accounting will be updated, + /// which can be considered the liquidity for all non-siloed chains sharing liquidity. + /// @param amount The amount of liquidity to remove. + function withdrawSiloedLiquidity(uint64 remoteChainSelector, uint256 amount) external { + _withdrawLiquidity(remoteChainSelector, amount); + } + + function _withdrawLiquidity(uint64 remoteChainSelector, uint256 amount) internal { + if (msg.sender != getSiloRebalancer(remoteChainSelector)) revert Unauthorized(msg.sender); + + // Save gas by using storage as multiple values may need to be read/written. + SiloConfig storage remoteConfig = s_chainConfigs[remoteChainSelector]; + + // Prevent A silent underflow by explicitly ensuring that enough funds are available to withdraw + uint256 availableLiquidity = remoteConfig.isSiloed ? remoteConfig.tokenBalance : s_unsiloedTokenBalance; + if (amount > availableLiquidity) revert InsufficientLiquidity(availableLiquidity, amount); + + // If funds are siloed by chain, prevent more than has been locked from being removed from the token pool. + if (remoteConfig.isSiloed) { + remoteConfig.tokenBalance -= amount; + } else { + s_unsiloedTokenBalance -= amount; + } + + i_token.safeTransfer(msg.sender, amount); + emit LiquidityRemoved(remoteChainSelector, msg.sender, amount); + } +} diff --git a/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol b/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol index 89e609fcc5e..3f94a1b719a 100644 --- a/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol +++ b/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.24; import {ILiquidityContainer} from "../../../liquiditymanager/interfaces/ILiquidityContainer.sol"; import {ITokenMessenger} from "../USDC/ITokenMessenger.sol"; -import {Ownable2StepMsgSender} from "../../../shared/access/Ownable2StepMsgSender.sol"; import {Pool} from "../../libraries/Pool.sol"; import {TokenPool} from "../TokenPool.sol"; import {USDCTokenPool} from "../USDC/USDCTokenPool.sol"; @@ -209,31 +208,6 @@ contract HybridLockReleaseUSDCTokenPool is USDCTokenPool, USDCBridgeMigrator { emit ILiquidityContainer.LiquidityRemoved(msg.sender, amount); } - /// @notice This function can be used to transfer liquidity from an older version of the pool to this pool. To do so - /// this pool must be the owner of the old pool. Since the pool uses two-step ownership transfer, the old pool must - /// first propose the ownership transfer, and then this pool must accept it. This function can only be called after - /// the ownership transfer has been proposed, as it will accept it and then make the call to withdrawLiquidity - /// @dev When upgrading a LockRelease pool, this function can be called at the same time as the pool is changed in the - /// TokenAdminRegistry. This allows for a smooth transition of both liquidity and transactions to the new pool. - /// Alternatively, when no multicall is available, a portion of the funds can be transferred to the new pool before - /// changing which pool CCIP uses, to ensure both pools can operate. Then the pool should be changed in the - /// TokenAdminRegistry, which will activate the new pool. All new transactions will use the new pool and its - /// liquidity. - /// @param from The address of the old pool. - /// @param remoteChainSelector The chain for which liquidity is being transferred. - function transferLiquidity(address from, uint64 remoteChainSelector) external onlyOwner { - Ownable2StepMsgSender(from).acceptOwnership(); - - // Withdraw all available liquidity from the old pool. No check is needed for pending migrations, as the old pool - // will revert if the migration has begun. - uint256 withdrawAmount = HybridLockReleaseUSDCTokenPool(from).getLockedTokensForChain(remoteChainSelector); - HybridLockReleaseUSDCTokenPool(from).withdrawLiquidity(remoteChainSelector, withdrawAmount); - - s_lockedTokensByChainSelector[remoteChainSelector] += withdrawAmount; - - emit LiquidityTransferred(from, remoteChainSelector, withdrawAmount); - } - // ================================================================ // │ Alt Mechanism Logic | // ================================================================ diff --git a/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol b/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol index 058398e4c08..2ec5219b36c 100644 --- a/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol +++ b/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol @@ -60,7 +60,7 @@ contract MaybeRevertingBurnMintTokenPool is BurnMintTokenPool { /// @notice Reverts depending on the value of `s_revertReason` function releaseOrMint( Pool.ReleaseOrMintInV1 calldata releaseOrMintIn - ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + ) public virtual override returns (Pool.ReleaseOrMintOutV1 memory) { _validateReleaseOrMint(releaseOrMintIn); bytes memory revertReason = s_revertReason; diff --git a/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.lockOrBurn.t.sol new file mode 100644 index 00000000000..c5e559b2d9e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.lockOrBurn.t.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {Pool} from "../../../libraries/Pool.sol"; +import {BurnToAddressMintTokenPool} from "../../../pools/BurnToAddressMintTokenPool.sol"; +import {BurnToAddressMintTokenPoolSetup} from "./BurnToAddressMintTokenPoolSetup.t.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; + +contract BurnToAddressMintTokenPool_lockOrBurn is BurnToAddressMintTokenPoolSetup { + uint256 public constant AMOUNT = 1e24; + + function test_LockOrBurn() public { + s_pool.setOutstandingTokens(AMOUNT); + + deal(address(s_burnMintERC20), address(s_pool), AMOUNT); + assertEq(s_burnMintERC20.balanceOf(address(s_pool)), AMOUNT); + + vm.startPrank(s_burnMintOnRamp); + + vm.expectEmit(); + emit IERC20.Transfer(address(s_pool), BURN_ADDRESS, AMOUNT); + + vm.expectCall(address(s_burnMintERC20), abi.encodeWithSelector(IERC20.transfer.selector, BURN_ADDRESS, AMOUNT)); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: AMOUNT, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC20) + }) + ); + + assertEq(s_burnMintERC20.balanceOf(s_pool.getBurnAddress()), AMOUNT); + assertEq(s_burnMintERC20.balanceOf(address(s_pool)), 0); + assertEq(s_pool.getOutstandingTokens(), 0); + } + + // Reverts + + function test_LockOrBurn_RevertWhen_InsufficientOutstandingTokens() public { + s_pool.setOutstandingTokens(AMOUNT - 1); + + deal(address(s_burnMintERC20), address(s_pool), AMOUNT); + assertEq(s_burnMintERC20.balanceOf(address(s_pool)), AMOUNT); + + vm.startPrank(s_burnMintOnRamp); + + vm.expectRevert(BurnToAddressMintTokenPool.InsufficientOutstandingTokens.selector); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: AMOUNT, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC20) + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.releaseOrMint.t.sol new file mode 100644 index 00000000000..508ed6bb787 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.releaseOrMint.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {Pool} from "../../../libraries/Pool.sol"; +import {BurnToAddressMintTokenPoolSetup} from "./BurnToAddressMintTokenPoolSetup.t.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; + +contract BurnToAddressMintTokenPool_releaseOrMint is BurnToAddressMintTokenPoolSetup { + function test_releaseOrMint() public { + uint256 amount = 1e24; + address receiver = makeAddr("RECEIVER_ADDRESS"); + + vm.startPrank(s_burnMintOffRamp); + + vm.expectEmit(); + emit IERC20.Transfer(address(0), receiver, amount); + + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: receiver, + amount: amount, + localToken: address(s_burnMintERC20), + remoteChainSelector: DEST_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_remoteBurnMintPool), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + + assertEq(s_burnMintERC20.balanceOf(receiver), amount); + assertEq(s_pool.getOutstandingTokens(), amount); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.setMintedTokens.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.setMintedTokens.t.sol new file mode 100644 index 00000000000..11c615d8b2b --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPool.setMintedTokens.t.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {BurnToAddressMintTokenPool} from "../../../pools/BurnToAddressMintTokenPool.sol"; +import {BurnToAddressMintTokenPoolSetup} from "./BurnToAddressMintTokenPoolSetup.t.sol"; + +contract BurnToAddressMintTokenPool_setOutstandingokens is BurnToAddressMintTokenPoolSetup { + function test_setOutstandingTokens() public { + uint256 amount = 1e18; + + assertEq(s_pool.getOutstandingTokens(), 0); + + vm.expectEmit(); + emit BurnToAddressMintTokenPool.OutstandingTokensSet(amount, 0); + + s_pool.setOutstandingTokens(amount); + + assertEq(s_pool.getOutstandingTokens(), amount); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPoolSetup.t.sol new file mode 100644 index 00000000000..a27c0a0f8c4 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnToAddressMintTokenPool/BurnToAddressMintTokenPoolSetup.t.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {BurnToAddressMintTokenPool} from "../../../pools/BurnToAddressMintTokenPool.sol"; +import {BurnMintSetup} from "../BurnMintTokenPool/BurnMintSetup.t.sol"; + +contract BurnToAddressMintTokenPoolSetup is BurnMintSetup { + BurnToAddressMintTokenPool internal s_pool; + + address public constant BURN_ADDRESS = address(0xdead); + + function setUp() public virtual override { + BurnMintSetup.setUp(); + + s_pool = new BurnToAddressMintTokenPool( + s_burnMintERC20, + DEFAULT_TOKEN_DECIMALS, + new address[](0), + address(s_mockRMNRemote), + address(s_sourceRouter), + BURN_ADDRESS + ); + + s_burnMintERC20.grantMintAndBurnRoles(address(s_pool)); + + _applyChainUpdates(address(s_pool)); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.lockOrBurn.t.sol new file mode 100644 index 00000000000..2cf51a045e9 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.lockOrBurn.t.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {Pool} from "../../../libraries/Pool.sol"; +import {RateLimiter} from "../../../libraries/RateLimiter.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {SiloedLockReleaseTokenPoolSetup} from "./SiloedLockReleaseTokenPoolSetup.t.sol"; + +contract SiloedLockReleaseTokenPool_lockOrBurn is SiloedLockReleaseTokenPoolSetup { + uint256 public constant AMOUNT = 10e18; + + function test_lockOrBurn_SiloedFunds() public { + assertTrue(s_siloedLockReleaseTokenPool.isSiloed(SILOED_CHAIN_SELECTOR)); + + vm.startPrank(s_allowedOnRamp); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(AMOUNT); + vm.expectEmit(); + emit TokenPool.Locked(s_allowedOnRamp, AMOUNT); + + s_siloedLockReleaseTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: bytes(""), + amount: AMOUNT, + remoteChainSelector: SILOED_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), AMOUNT); + } + + function test_lockOrBurn_UnsiloedFunds() public { + vm.startPrank(s_allowedOnRamp); + + assertFalse(s_siloedLockReleaseTokenPool.isSiloed(DEST_CHAIN_SELECTOR)); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(AMOUNT); + vm.expectEmit(); + emit TokenPool.Locked(s_allowedOnRamp, AMOUNT); + + s_siloedLockReleaseTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: bytes(""), + amount: AMOUNT, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(DEST_CHAIN_SELECTOR), AMOUNT); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.provideLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.provideLiquidity.t.sol new file mode 100644 index 00000000000..6af10971018 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.provideLiquidity.t.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {SiloedLockReleaseTokenPool} from "../../../pools/SiloedLockReleaseTokenPool.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {SiloedLockReleaseTokenPoolSetup} from "./SiloedLockReleaseTokenPoolSetup.t.sol"; + +contract SiloedLockReleaseTokenPool_provideLiqudity is SiloedLockReleaseTokenPoolSetup { + address public UNAUTHORIZED_ADDRESS = address(0xdeadbeef); + + function setUp() public override { + super.setUp(); + + s_siloedLockReleaseTokenPool.setSiloRebalancer(SILOED_CHAIN_SELECTOR, OWNER); + } + + function test_ProvideLiquidity_UnsiloedChain() public { + uint256 amount = 1e24; + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.LiquidityAdded(DEST_CHAIN_SELECTOR, OWNER, amount); + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(DEST_CHAIN_SELECTOR, amount); + + assertEq(s_token.balanceOf(address(s_siloedLockReleaseTokenPool)), amount); + + // Since the funds for the destination chain are not siloed, + // the locked token amount should not be increased + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(DEST_CHAIN_SELECTOR), amount); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), amount); + } + + function test_ProvideLiquidity_SiloedChain() public { + uint256 amount = 1e24; + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.LiquidityAdded(SILOED_CHAIN_SELECTOR, OWNER, amount); + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(SILOED_CHAIN_SELECTOR, amount); + + assertEq(s_token.balanceOf(address(s_siloedLockReleaseTokenPool)), amount); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), amount); + + // Since the funds for the destination chain are not siloed, the locked token amount should not be increased + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), 0); + } + + function test_ProvideLiquidity_LegacyProvideLiquiditySelector() public { + uint256 amount = 1e24; + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.LiquidityAdded(0, OWNER, amount); + + s_siloedLockReleaseTokenPool.provideLiquidity(amount); + + assertEq(s_token.balanceOf(address(s_siloedLockReleaseTokenPool)), amount); + + // Since the funds for the destination chain are not siloed, + // the locked token amount should not be increased + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(DEST_CHAIN_SELECTOR), amount); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), amount); + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), 0); + } + + // Reverts + + function test_ProvideLiquidity_RevertWhen_UnauthorizedForSiloedChain() public { + vm.startPrank(UNAUTHORIZED_ADDRESS); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, UNAUTHORIZED_ADDRESS)); + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(SILOED_CHAIN_SELECTOR, 1); + } + + function test_ProvideLiquidity_RevertWhen_UnauthorizedForUnsiloedChain() public { + vm.startPrank(UNAUTHORIZED_ADDRESS); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, UNAUTHORIZED_ADDRESS)); + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(DEST_CHAIN_SELECTOR, 1); + } + + function test_ProvideLiquidity_RevertWhen_LegacyFunctionSelector_Unauthorized() public { + vm.startPrank(UNAUTHORIZED_ADDRESS); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, UNAUTHORIZED_ADDRESS)); + + s_siloedLockReleaseTokenPool.provideLiquidity(1); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.releaseOrMint.t.sol new file mode 100644 index 00000000000..eec0503b716 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.releaseOrMint.t.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {Pool} from "../../../libraries/Pool.sol"; +import {SiloedLockReleaseTokenPool} from "../../../pools/SiloedLockReleaseTokenPool.sol"; +import {SiloedLockReleaseTokenPoolSetup} from "./SiloedLockReleaseTokenPoolSetup.t.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; + +contract SiloedLockReleaseTokenPool_releaseOrMint is SiloedLockReleaseTokenPoolSetup { + function test_ReleaseOrMint_SiloedChain() public { + uint256 amount = 10e18; + + deal(address(s_token), address(s_siloedLockReleaseTokenPool), amount); + vm.startPrank(s_allowedOnRamp); + + // Lock funds so that they can be released without underflowing the internal accounting + s_siloedLockReleaseTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: bytes(""), + amount: amount, + remoteChainSelector: SILOED_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), amount); + + vm.startPrank(s_allowedOffRamp); + + vm.expectEmit(); + emit IERC20.Transfer(address(s_siloedLockReleaseTokenPool), OWNER, amount); + + s_siloedLockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SILOED_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_siloedDestPoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), 0); + } + + function test_ReleaseOrMint_UnsiloedChain() public { + uint256 amount = 10e18; + + deal(address(s_token), address(s_siloedLockReleaseTokenPool), amount); + vm.startPrank(s_allowedOnRamp); + + // Lock funds for unsiloed chain so they can be released later + s_siloedLockReleaseTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: bytes(""), + amount: amount, + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SOURCE_CHAIN_SELECTOR), amount); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), amount); + + vm.startPrank(s_allowedOffRamp); + + vm.expectEmit(); + emit IERC20.Transfer(address(s_siloedLockReleaseTokenPool), OWNER, amount); + + s_siloedLockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_siloedDestPoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SOURCE_CHAIN_SELECTOR), 0); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), 0); + } + + // Reverts + + function test_ReleaseOrMint_RevertsWhen_InsufficientLiquidity_SiloedChain() public { + uint256 releaseAmount = 10e18; + uint256 liquidityAmount = releaseAmount - 1; + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(SILOED_CHAIN_SELECTOR, liquidityAmount); + + // Since amount to release is greater than provided liquidity, the function should revert + vm.expectRevert( + abi.encodeWithSelector(SiloedLockReleaseTokenPool.InsufficientLiquidity.selector, liquidityAmount, releaseAmount) + ); + + vm.startPrank(s_allowedOffRamp); + + s_siloedLockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: releaseAmount, + localToken: address(s_token), + remoteChainSelector: SILOED_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_siloedDestPoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } + + function test_ReleaseOrMint_RevertsWhen_InsufficientLiquidity_UnsiloedChain() public { + uint256 releaseAmount = 10e18; + uint256 liquidityAmount = releaseAmount - 1; + + // Call the provide liquidity function which provides to unsiloed chains. + s_siloedLockReleaseTokenPool.provideLiquidity(liquidityAmount); + + // Since amount to release is greater than provided liquidity, the function should revert + vm.expectRevert( + abi.encodeWithSelector(SiloedLockReleaseTokenPool.InsufficientLiquidity.selector, liquidityAmount, releaseAmount) + ); + + vm.startPrank(s_allowedOffRamp); + + s_siloedLockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: releaseAmount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_siloedDestPoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.setRebalancer.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.setRebalancer.t.sol new file mode 100644 index 00000000000..ea676d53015 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.setRebalancer.t.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {SiloedLockReleaseTokenPool} from "../../../pools/SiloedLockReleaseTokenPool.sol"; +import {SiloedLockReleaseTokenPoolSetup} from "./SiloedLockReleaseTokenPoolSetup.t.sol"; + +contract SiloedLockReleaseTokenPool_setRebalancer is SiloedLockReleaseTokenPoolSetup { + address public constant REBALANCER_ADDRESS = address(0xdeadbeef); + + function test_setSiloRebalancer() public { + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.SiloRebalancerSet(SILOED_CHAIN_SELECTOR, REBALANCER_ADDRESS, OWNER); + + s_siloedLockReleaseTokenPool.setSiloRebalancer(SILOED_CHAIN_SELECTOR, REBALANCER_ADDRESS); + + assertEq(s_siloedLockReleaseTokenPool.getSiloRebalancer(SILOED_CHAIN_SELECTOR), REBALANCER_ADDRESS); + assertEq(s_siloedLockReleaseTokenPool.getSiloRebalancer(DEST_CHAIN_SELECTOR), OWNER); + } + + function test_setRebalancer_UnsiloedChains() public { + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.UnsiloedRebalancerSet(REBALANCER_ADDRESS, OWNER); + + s_siloedLockReleaseTokenPool.setRebalancer(REBALANCER_ADDRESS); + + assertEq(s_siloedLockReleaseTokenPool.getSiloRebalancer(DEST_CHAIN_SELECTOR), REBALANCER_ADDRESS); + } + + // Reverts + + function test_setSiloRebalancer_RevertWhen_ChainNotSiloed() public { + vm.expectRevert(abi.encodeWithSelector(SiloedLockReleaseTokenPool.ChainNotSiloed.selector, DEST_CHAIN_SELECTOR)); + + s_siloedLockReleaseTokenPool.setSiloRebalancer(DEST_CHAIN_SELECTOR, REBALANCER_ADDRESS); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.updateSiloDesignations.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.updateSiloDesignations.t.sol new file mode 100644 index 00000000000..506b1373ceb --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.updateSiloDesignations.t.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {SiloedLockReleaseTokenPool} from "../../../pools/SiloedLockReleaseTokenPool.sol"; +import {SiloedLockReleaseTokenPoolSetup} from "./SiloedLockReleaseTokenPoolSetup.t.sol"; + +contract SiloedLockReleaseTokenPool_updateSiloDesignations is SiloedLockReleaseTokenPoolSetup { + function test_updateSiloDesignations() public { + uint256 amount = 1e18; + + SiloedLockReleaseTokenPool.SiloConfigUpdate[] memory chainSelectors = + new SiloedLockReleaseTokenPool.SiloConfigUpdate[](1); + + chainSelectors[0] = + SiloedLockReleaseTokenPool.SiloConfigUpdate({remoteChainSelector: SILOED_CHAIN_SELECTOR, rebalancer: OWNER}); + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.ChainSiloed(SILOED_CHAIN_SELECTOR, OWNER); + + s_siloedLockReleaseTokenPool.updateSiloDesignations(new uint64[](0), chainSelectors); + + // Assert that the funds are siloed correctly + assertTrue(s_siloedLockReleaseTokenPool.isSiloed(SILOED_CHAIN_SELECTOR)); + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), 0); + assertEq(s_siloedLockReleaseTokenPool.getSiloRebalancer(SILOED_CHAIN_SELECTOR), OWNER); + + // Provide some Liquidity so that we can then check that it gets removed. + s_siloedLockReleaseTokenPool.setSiloRebalancer(SILOED_CHAIN_SELECTOR, OWNER); + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(SILOED_CHAIN_SELECTOR, amount); + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), amount); + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.ChainUnsiloed(SILOED_CHAIN_SELECTOR, amount); + + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), 0); + + uint64[] memory removableChainSelectors = new uint64[](1); + removableChainSelectors[0] = SILOED_CHAIN_SELECTOR; + + s_siloedLockReleaseTokenPool.updateSiloDesignations( + removableChainSelectors, new SiloedLockReleaseTokenPool.SiloConfigUpdate[](0) + ); + + // Check that the locked funds accounting was cleared when the funds were un-siloed. + assertFalse(s_siloedLockReleaseTokenPool.isSiloed(SILOED_CHAIN_SELECTOR)); + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), amount); + + // Assert that the available liquidity moved from being siloed to unsiloed. + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), amount); + } + + // Reverts + + function test_updateSiloDesignations_RevertWhen_ChainNotSiloed() public { + uint64[] memory removableChainSelectors = new uint64[](1); + removableChainSelectors[0] = DEST_CHAIN_SELECTOR; + + vm.expectRevert(abi.encodeWithSelector(SiloedLockReleaseTokenPool.ChainNotSiloed.selector, DEST_CHAIN_SELECTOR)); + + s_siloedLockReleaseTokenPool.updateSiloDesignations( + removableChainSelectors, new SiloedLockReleaseTokenPool.SiloConfigUpdate[](0) + ); + } + + function test_updateSiloDesignations_RevertWhen_InvalidChainSelector() public { + SiloedLockReleaseTokenPool.SiloConfigUpdate[] memory adds = new SiloedLockReleaseTokenPool.SiloConfigUpdate[](1); + adds[0] = SiloedLockReleaseTokenPool.SiloConfigUpdate({remoteChainSelector: 0, rebalancer: OWNER}); + + vm.expectRevert(abi.encodeWithSelector(SiloedLockReleaseTokenPool.InvalidChainSelector.selector, 0)); + + s_siloedLockReleaseTokenPool.updateSiloDesignations(new uint64[](0), adds); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.withdrawLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.withdrawLiquidity.t.sol new file mode 100644 index 00000000000..7a82f0954a0 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPool.withdrawLiquidity.t.sol @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {SiloedLockReleaseTokenPool} from "../../../pools/SiloedLockReleaseTokenPool.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {SiloedLockReleaseTokenPoolSetup} from "./SiloedLockReleaseTokenPoolSetup.t.sol"; + +contract SiloedLockReleaseTokenPool_withdrawLiqudity is SiloedLockReleaseTokenPoolSetup { + address public UNAUTHORIZED_ADDRESS = address(0xdeadbeef); + + function setUp() public override { + super.setUp(); + + s_siloedLockReleaseTokenPool.setSiloRebalancer(SILOED_CHAIN_SELECTOR, OWNER); + } + + function test_withdrawLiquidity_SiloedFunds() public { + uint256 amount = 1e24; + + uint256 balanceBefore = s_token.balanceOf(OWNER); + + // Provide the Liquidity first + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(SILOED_CHAIN_SELECTOR, amount); + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.LiquidityRemoved(SILOED_CHAIN_SELECTOR, OWNER, amount); + + // Remove the Liquidity + s_siloedLockReleaseTokenPool.withdrawSiloedLiquidity(SILOED_CHAIN_SELECTOR, amount); + + assertEq(s_token.balanceOf(OWNER), balanceBefore); + assertEq(s_token.balanceOf(address(s_siloedLockReleaseTokenPool)), 0); + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(SILOED_CHAIN_SELECTOR), 0); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), 0); + } + + function test_withdrawSiloedLiquidity_UnsiloedFunds() public { + uint256 amount = 1e24; + + uint256 balanceBefore = s_token.balanceOf(OWNER); + + // Provide the Liquidity first + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(DEST_CHAIN_SELECTOR, amount); + + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), amount); + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.LiquidityRemoved(DEST_CHAIN_SELECTOR, OWNER, amount); + + // Remove the Liquidity + s_siloedLockReleaseTokenPool.withdrawSiloedLiquidity(DEST_CHAIN_SELECTOR, amount); + + assertEq(s_token.balanceOf(OWNER), balanceBefore); + assertEq(s_token.balanceOf(address(s_siloedLockReleaseTokenPool)), 0); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), 0); + } + + function test_withdrawLiquidity_UnsiloedFunds_LegacyFunctionSelector() public { + uint256 amount = 1e24; + + uint256 balanceBefore = s_token.balanceOf(OWNER); + + // Provide the Liquidity first + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(DEST_CHAIN_SELECTOR, amount); + + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), amount); + + vm.expectEmit(); + emit SiloedLockReleaseTokenPool.LiquidityRemoved(0, OWNER, amount); + + // Remove the Liquidity + s_siloedLockReleaseTokenPool.withdrawLiquidity(amount); + + assertEq(s_token.balanceOf(OWNER), balanceBefore); + assertEq(s_token.balanceOf(address(s_siloedLockReleaseTokenPool)), 0); + assertEq(s_siloedLockReleaseTokenPool.getUnsiloedLiquidity(), 0); + assertEq(s_siloedLockReleaseTokenPool.getAvailableTokens(DEST_CHAIN_SELECTOR), 0); + } + + // Reverts + + function test_withdrawLiquidity_RevertWhen_SiloedFunds_NotEnoughLiquidity() public { + uint256 liquidityAmount = 1e24; + uint256 withdrawAmount = liquidityAmount + 1; + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(SILOED_CHAIN_SELECTOR, liquidityAmount); + + // Call should revert due to underflow error due to trying to burn more tokens than are locked via CCIP. + vm.expectRevert( + abi.encodeWithSelector(SiloedLockReleaseTokenPool.InsufficientLiquidity.selector, liquidityAmount, withdrawAmount) + ); + + s_siloedLockReleaseTokenPool.withdrawSiloedLiquidity(SILOED_CHAIN_SELECTOR, withdrawAmount); + } + + function test_withdrawSiloedLiquidity_RevertWhen_UnsiloedFunds_NotEnoughLiquidity() public { + uint256 liquidityAmount = 1e24; + uint256 withdrawAmount = liquidityAmount + 1; + + s_siloedLockReleaseTokenPool.provideSiloedLiquidity(DEST_CHAIN_SELECTOR, liquidityAmount); + + // Call should revert due to underflow error due to trying to burn more tokens than are locked via CCIP. + vm.expectRevert( + abi.encodeWithSelector(SiloedLockReleaseTokenPool.InsufficientLiquidity.selector, liquidityAmount, withdrawAmount) + ); + + // Test withdrawing funds from unsiloed liquidity pool but underflow + s_siloedLockReleaseTokenPool.withdrawSiloedLiquidity(DEST_CHAIN_SELECTOR, withdrawAmount); + } + + function test_withdrawSiloedLiqudity_RevertWhen_UnauthorizedOnlyUnsiloedRebalancer() public { + vm.startPrank(UNAUTHORIZED_ADDRESS); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, UNAUTHORIZED_ADDRESS)); + + s_siloedLockReleaseTokenPool.withdrawSiloedLiquidity(DEST_CHAIN_SELECTOR, 1); + } + + function test_withdrawLiquidity_RevertsWhen_LegacyFunctionSelectorUnauthorized() public { + vm.startPrank(UNAUTHORIZED_ADDRESS); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, UNAUTHORIZED_ADDRESS)); + + s_siloedLockReleaseTokenPool.withdrawLiquidity(1); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPoolSetup.t.sol new file mode 100644 index 00000000000..e7724663e05 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/SiloedLockReleaseTokenPool/SiloedLockReleaseTokenPoolSetup.t.sol @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {BurnMintERC20} from "../../../../shared/token/ERC20/BurnMintERC20.sol"; +import {Router} from "../../../Router.sol"; +import {SiloedLockReleaseTokenPool} from "../../../pools/SiloedLockReleaseTokenPool.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {BaseTest} from "../../BaseTest.t.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract SiloedLockReleaseTokenPoolSetup is BaseTest { + IERC20 internal s_token; + SiloedLockReleaseTokenPool internal s_siloedLockReleaseTokenPool; + address[] internal s_allowedList; + + address internal s_allowedOnRamp = address(123); + address internal s_allowedOffRamp = address(234); + + address internal s_destPoolAddress = address(2736782345); + address internal s_sourcePoolAddress = address(53852352095); + + address internal s_siloedDestPoolAddress = address(4245234524); + uint64 internal constant SILOED_CHAIN_SELECTOR = DEST_CHAIN_SELECTOR + 1; + + function setUp() public virtual override { + super.setUp(); + s_token = new BurnMintERC20("LINK", "LNK", 18, 0, 0); + deal(address(s_token), OWNER, type(uint256).max); + + s_siloedLockReleaseTokenPool = new SiloedLockReleaseTokenPool( + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) + ); + + s_siloedLockReleaseTokenPool.setRebalancer(OWNER); + + s_token.approve(address(s_siloedLockReleaseTokenPool), type(uint256).max); + + bytes[] memory remotePoolAddresses = new bytes[](2); + remotePoolAddresses[0] = abi.encode(s_destPoolAddress); + remotePoolAddresses[1] = abi.encode(s_siloedDestPoolAddress); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](3); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddresses: remotePoolAddresses, + remoteTokenAddress: abi.encode(address(2)), + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + chainUpdates[1] = TokenPool.ChainUpdate({ + remoteChainSelector: SILOED_CHAIN_SELECTOR, + remotePoolAddresses: remotePoolAddresses, + remoteTokenAddress: abi.encode(address(2)), + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + chainUpdates[2] = TokenPool.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + remotePoolAddresses: remotePoolAddresses, + remoteTokenAddress: abi.encode(address(2)), + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_siloedLockReleaseTokenPool.applyChainUpdates(new uint64[](0), chainUpdates); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](3); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](2); + + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_allowedOnRamp}); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_allowedOffRamp}); + + onRampUpdates[1] = Router.OnRamp({destChainSelector: SILOED_CHAIN_SELECTOR, onRamp: s_allowedOnRamp}); + offRampUpdates[1] = Router.OffRamp({sourceChainSelector: SILOED_CHAIN_SELECTOR, offRamp: s_allowedOffRamp}); + + onRampUpdates[2] = Router.OnRamp({destChainSelector: SOURCE_CHAIN_SELECTOR, onRamp: s_allowedOnRamp}); + + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + + // Apply Siloeing Rules + SiloedLockReleaseTokenPool.SiloConfigUpdate[] memory adds = new SiloedLockReleaseTokenPool.SiloConfigUpdate[](1); + + adds[0] = + SiloedLockReleaseTokenPool.SiloConfigUpdate({remoteChainSelector: SILOED_CHAIN_SELECTOR, rebalancer: OWNER}); + + s_siloedLockReleaseTokenPool.updateSiloDesignations(new uint64[](0), adds); + + assertTrue(s_siloedLockReleaseTokenPool.isSiloed(SILOED_CHAIN_SELECTOR)); + assertFalse(s_siloedLockReleaseTokenPool.isSiloed(DEST_CHAIN_SELECTOR)); + + s_siloedLockReleaseTokenPool.setSiloRebalancer(SILOED_CHAIN_SELECTOR, OWNER); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol deleted file mode 100644 index d0600d26b88..00000000000 --- a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.24; - -import {ILiquidityContainer} from "../../../../../liquiditymanager/interfaces/ILiquidityContainer.sol"; - -import {HybridLockReleaseUSDCTokenPool} from "../../../../pools/USDC/HybridLockReleaseUSDCTokenPool.sol"; -import {HybridLockReleaseUSDCTokenPoolSetup} from "./HybridLockReleaseUSDCTokenPoolSetup.t.sol"; - -contract HybridLockReleaseUSDCTokenPool_TransferLiquidity is HybridLockReleaseUSDCTokenPoolSetup { - function test_transferLiquidity() public { - // Set as the OWNER so we can provide liquidity - vm.startPrank(OWNER); - - s_usdcTokenPool.setLiquidityProvider(DEST_CHAIN_SELECTOR, OWNER); - s_token.approve(address(s_usdcTokenPool), type(uint256).max); - - uint256 liquidityAmount = 1e9; - - // Provide some liquidity to the pool - s_usdcTokenPool.provideLiquidity(DEST_CHAIN_SELECTOR, liquidityAmount); - - // Set the new token pool as the rebalancer - s_usdcTokenPool.transferOwnership(address(s_usdcTokenPoolTransferLiquidity)); - - vm.expectEmit(); - emit ILiquidityContainer.LiquidityRemoved(address(s_usdcTokenPoolTransferLiquidity), liquidityAmount); - - vm.expectEmit(); - emit HybridLockReleaseUSDCTokenPool.LiquidityTransferred( - address(s_usdcTokenPool), DEST_CHAIN_SELECTOR, liquidityAmount - ); - - s_usdcTokenPoolTransferLiquidity.transferLiquidity(address(s_usdcTokenPool), DEST_CHAIN_SELECTOR); - - assertEq( - s_usdcTokenPool.owner(), - address(s_usdcTokenPoolTransferLiquidity), - "Ownership of the old pool should be transferred to the new pool" - ); - - assertEq( - s_usdcTokenPoolTransferLiquidity.getLockedTokensForChain(DEST_CHAIN_SELECTOR), - liquidityAmount, - "Tokens locked for dest chain doesn't match expected amount in storage" - ); - - assertEq( - s_usdcTokenPool.getLockedTokensForChain(DEST_CHAIN_SELECTOR), - 0, - "Tokens locked for dest chain in old token pool doesn't match expected amount in storage" - ); - - assertEq( - s_token.balanceOf(address(s_usdcTokenPoolTransferLiquidity)), - liquidityAmount, - "Liquidity amount of tokens should be new in new pool, but aren't" - ); - - assertEq( - s_token.balanceOf(address(s_usdcTokenPool)), - 0, - "Liquidity amount of tokens should be zero in old pool, but aren't" - ); - } - - function test_RevertWhen_cannotTransferLiquidityDuringPendingMigration() public { - // Set as the OWNER so we can provide liquidity - vm.startPrank(OWNER); - - // Mark the destination chain as supporting CCTP, so use L/R instead. - uint64[] memory destChainAdds = new uint64[](1); - destChainAdds[0] = DEST_CHAIN_SELECTOR; - - s_usdcTokenPool.updateChainSelectorMechanisms(new uint64[](0), destChainAdds); - - s_usdcTokenPool.setLiquidityProvider(DEST_CHAIN_SELECTOR, OWNER); - s_token.approve(address(s_usdcTokenPool), type(uint256).max); - - uint256 liquidityAmount = 1e9; - - // Provide some liquidity to the pool - s_usdcTokenPool.provideLiquidity(DEST_CHAIN_SELECTOR, liquidityAmount); - - // Set the new token pool as the rebalancer - s_usdcTokenPool.transferOwnership(address(s_usdcTokenPoolTransferLiquidity)); - - s_usdcTokenPool.proposeCCTPMigration(DEST_CHAIN_SELECTOR); - - vm.expectRevert( - abi.encodeWithSelector(HybridLockReleaseUSDCTokenPool.LanePausedForCCTPMigration.selector, DEST_CHAIN_SELECTOR) - ); - - s_usdcTokenPoolTransferLiquidity.transferLiquidity(address(s_usdcTokenPool), DEST_CHAIN_SELECTOR); - } -} From 47a0c4227c1ccdd93a7b0a6365e7e1c78c74b6d7 Mon Sep 17 00:00:00 2001 From: FelixFan1992 Date: Thu, 16 Jan 2025 13:46:00 -0500 Subject: [PATCH 76/91] devsvcs-958: fix automation v2.3 batching bug (#15897) * devsvcs-958: fix automation v2.3 batching bug * Update gethwrappers * update * fix changeset * update logic and tests * update --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> --- .changeset/long-apples-fold.md | 5 + contracts/.changeset/poor-turtles-give.md | 5 + .../test/v2_3/AutomationRegistry2_3.t.sol | 136 +++++++++++++++++- .../v0.8/automation/test/v2_3/BaseTest.t.sol | 48 +++++++ .../test/v2_3_zksync/BaseTest.t.sol | 48 +++++++ .../ZKSyncAutomationRegistry2_3.t.sol | 136 +++++++++++++++++- .../automation/v2_3/AutomationRegistry2_3.sol | 4 +- .../v2_3/AutomationRegistryBase2_3.sol | 4 +- .../ZKSyncAutomationRegistry2_3.sol | 4 +- .../automation/AutomationRegistry2_3.test.ts | 5 +- .../ZKSyncAutomationRegistry2_3.test.ts | 6 - .../automation_registry_wrapper_2_3.go | 2 +- ...rapper-dependency-versions-do-not-edit.txt | 2 +- 13 files changed, 383 insertions(+), 22 deletions(-) create mode 100644 .changeset/long-apples-fold.md create mode 100644 contracts/.changeset/poor-turtles-give.md diff --git a/.changeset/long-apples-fold.md b/.changeset/long-apples-fold.md new file mode 100644 index 00000000000..ba3e731951f --- /dev/null +++ b/.changeset/long-apples-fold.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +DEVSVCS-958: fix automation v2.3 batching bug #bugfix diff --git a/contracts/.changeset/poor-turtles-give.md b/contracts/.changeset/poor-turtles-give.md new file mode 100644 index 00000000000..7776bdd195e --- /dev/null +++ b/contracts/.changeset/poor-turtles-give.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +DEVSVCS-958: fix automation v2.3 batching bug #bugfix diff --git a/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol b/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol index 41aabf1bbe2..e461060e27d 100644 --- a/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol @@ -1653,6 +1653,140 @@ contract Transmit is SetUp { vm.stopPrank(); } + struct PaymentReceipt { + uint96 gasChargeInBillingToken; + uint96 premiumInBillingToken; + uint96 gasReimbursementInJuels; + uint96 premiumInJuels; + IERC20 billingToken; + uint96 linkUSD; + uint96 nativeUSD; + uint96 billingUSD; + } + event ReorgedUpkeepReport(uint256 indexed id, bytes trigger); + event UpkeepCharged(uint256 indexed id, PaymentReceipt receipt); + event UpkeepPerformed( + uint256 indexed id, + bool indexed success, + uint96 totalPayment, + uint256 gasUsed, + uint256 gasOverhead, + bytes trigger + ); + function test_whenFirstUpkeepFails_subsequentUpkeepsPerform() external { + // the first and second upkeeps use LINK as billing token and the third uses WETH + // the first upkeep fails the pre perform check due to incorrect block number in its trigger + // the second and third upkeep perform + // the first upkeep should not be charged and the second and third upkeep should be charged + uint256[] memory prevUpkeepBalances = new uint256[](3); + prevUpkeepBalances[0] = registry.getBalance(linkUpkeepID); + prevUpkeepBalances[1] = registry.getBalance(linkUpkeepID2); + prevUpkeepBalances[2] = registry.getBalance(nativeUpkeepID); + uint256[] memory prevTokenBalances = new uint256[](2); + prevTokenBalances[0] = linkToken.balanceOf(address(registry)); + prevTokenBalances[1] = weth.balanceOf(address(registry)); + uint256[] memory prevReserveBalances = new uint256[](2); + prevReserveBalances[0] = registry.getReserveAmount(address(linkToken)); + prevReserveBalances[1] = registry.getReserveAmount(address(weth)); + uint256[] memory upkeepIDs = new uint256[](3); + upkeepIDs[0] = linkUpkeepID; + upkeepIDs[1] = linkUpkeepID2; + upkeepIDs[2] = nativeUpkeepID; + + // do the transmit + vm.expectEmit(); + emit ReorgedUpkeepReport(linkUpkeepID, abi.encode(block.number, blockhash(block.number))); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(linkUpkeepID2, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(linkUpkeepID2, true, 0, 0, 0, bytes("")); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(nativeUpkeepID, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(nativeUpkeepID, true, 0, 0, 0, bytes("")); + bool[] memory goodTriggers = new bool[](3); + goodTriggers[0] = false; + goodTriggers[1] = true; + goodTriggers[2] = true; + _batchTransmitWithBadTriggers(upkeepIDs, goodTriggers, registry); + + // assert upkeep balances + // the first upkeep fails and the second and third upkeep succeeds + require(prevUpkeepBalances[0] == registry.getBalance(linkUpkeepID), "link upkeep balance should remain the same"); + require(prevUpkeepBalances[1] > registry.getBalance(linkUpkeepID2), "link upkeep 2 balance should have decreased"); + require(prevUpkeepBalances[2] > registry.getBalance(nativeUpkeepID), "native upkeep balance should have decreased"); + // assert token balances have not changed + assertEq(prevTokenBalances[0], linkToken.balanceOf(address(registry))); + assertEq(prevTokenBalances[1], weth.balanceOf(address(registry))); + // assert reserve amounts have adjusted accordingly + require( + prevReserveBalances[0] < registry.getReserveAmount(address(linkToken)), + "link reserve amount should have increased" + ); // link reserve amount increases in value equal to the decrease of the other reserve amounts + require( + prevReserveBalances[1] > registry.getReserveAmount(address(weth)), + "native reserve amount should have decreased" + ); + } + + function test_whenSecondUpkeepFails_FirstAndThirdUpkeepsPerform() external { + // the first upkeep uses WETH as billing token and the second and third use LINK + // the first upkeep succeeds + // the second upkeep fails pre perform check due to incorrect block number in its trigger + // the third upkeep succeeds + // the second upkeep should not be charged and the first and third upkeep should be charged + uint256[] memory prevUpkeepBalances = new uint256[](3); + prevUpkeepBalances[0] = registry.getBalance(nativeUpkeepID); + prevUpkeepBalances[1] = registry.getBalance(linkUpkeepID); + prevUpkeepBalances[2] = registry.getBalance(linkUpkeepID2); + uint256[] memory prevTokenBalances = new uint256[](2); + prevTokenBalances[0] = weth.balanceOf(address(registry)); + prevTokenBalances[1] = linkToken.balanceOf(address(registry)); + uint256[] memory prevReserveBalances = new uint256[](2); + prevReserveBalances[0] = registry.getReserveAmount(address(weth)); + prevReserveBalances[1] = registry.getReserveAmount(address(linkToken)); + uint256[] memory upkeepIDs = new uint256[](3); + upkeepIDs[0] = nativeUpkeepID; + upkeepIDs[1] = linkUpkeepID; + upkeepIDs[2] = linkUpkeepID2; + + // do the transmit + // expect this event first because all the upkeeps will be checked first before they are performed and charged + vm.expectEmit(); + emit ReorgedUpkeepReport(linkUpkeepID, abi.encode(block.number, blockhash(block.number))); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(nativeUpkeepID, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(nativeUpkeepID, true, 0, 0, 0, bytes("")); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(linkUpkeepID2, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(linkUpkeepID2, true, 0, 0, 0, bytes("")); + bool[] memory goodTriggers = new bool[](3); + goodTriggers[0] = true; + goodTriggers[1] = false; + goodTriggers[2] = true; + _batchTransmitWithBadTriggers(upkeepIDs, goodTriggers, registry); + + // assert upkeep balances + // the first upkeep fails and the second and third upkeep succeeds + require(prevUpkeepBalances[0] > registry.getBalance(nativeUpkeepID), "native upkeep balance should have decreased"); + require(prevUpkeepBalances[1] == registry.getBalance(linkUpkeepID), "link upkeep balance should remain the same"); + require(prevUpkeepBalances[2] > registry.getBalance(linkUpkeepID2), "link upkeep 2 balance should have decreased"); + // assert token balances have not changed + assertEq(prevTokenBalances[0], weth.balanceOf(address(registry))); + assertEq(prevTokenBalances[1], linkToken.balanceOf(address(registry))); + // assert reserve amounts have adjusted accordingly + require( + prevReserveBalances[0] > registry.getReserveAmount(address(weth)), + "native reserve amount should have decreased" + ); // link reserve amount increases in value equal to the decrease of the other reserve amounts + require( + prevReserveBalances[1] < registry.getReserveAmount(address(linkToken)), + "link reserve amount should have increased" + ); + } + function test_handlesMixedBatchOfBillingTokens() external { uint256[] memory prevUpkeepBalances = new uint256[](3); prevUpkeepBalances[0] = registry.getBalance(linkUpkeepID); @@ -1696,7 +1830,7 @@ contract Transmit is SetUp { // assert reserve amounts have adjusted accordingly require( prevReserveBalances[0] < registry.getReserveAmount(address(linkToken)), - "usd reserve amount should have increased" + "link reserve amount should have increased" ); // link reserve amount increases in value equal to the decrease of the other reserve amounts require( prevReserveBalances[1] > registry.getReserveAmount(address(usdToken18)), diff --git a/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol b/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol index f1086e7bfa4..44bb0f0ae60 100644 --- a/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol @@ -367,6 +367,54 @@ contract BaseTest is Test { _handleTransmit(ids, registry, bytes4(0)); } + function _batchTransmitWithBadTriggers(uint256[] memory ids, bool[] memory goodTriggers, Registry registry) internal { + bytes memory reportBytes; + { + uint256[] memory upkeepIds = new uint256[](ids.length); + uint256[] memory gasLimits = new uint256[](ids.length); + bytes[] memory performDatas = new bytes[](ids.length); + bytes[] memory triggers = new bytes[](ids.length); + for (uint256 i = 0; i < ids.length; i++) { + upkeepIds[i] = ids[i]; + gasLimits[i] = registry.getUpkeep(ids[i]).performGas; + performDatas[i] = new bytes(0); + uint8 triggerType = registry.getTriggerType(ids[i]); + if (triggerType == 0) { + uint256 j = 0; + if (goodTriggers[i]) { + j = 1; + } + triggers[i] = _encodeConditionalTrigger( + AutoBase.ConditionalTrigger(uint32(block.number - j), blockhash(block.number - j)) + ); + } else { + revert("not implemented"); + } + } + + AutoBase.Report memory report = AutoBase.Report( + uint256(1000000000), + uint256(2000000000), + upkeepIds, + gasLimits, + triggers, + performDatas + ); + + reportBytes = _encodeReport(report); + } + (, , bytes32 configDigest) = registry.latestConfigDetails(); + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + uint256[] memory signerPKs = new uint256[](2); + signerPKs[0] = SIGNING_KEY0; + signerPKs[1] = SIGNING_KEY1; + (bytes32[] memory rs, bytes32[] memory ss, bytes32 vs) = _signReport(reportBytes, reportContext, signerPKs); + + vm.startPrank(TRANSMITTERS[0]); + registry.transmit(reportContext, reportBytes, rs, ss, vs); + vm.stopPrank(); + } + // tests single upkeep, expects revert function _transmitAndExpectRevert(uint256 id, Registry registry, bytes4 selector) internal { uint256[] memory ids = new uint256[](1); diff --git a/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol b/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol index dde8f5b3867..f33360aa9f6 100644 --- a/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol @@ -419,6 +419,54 @@ contract BaseTest is Test { vm.stopPrank(); } + function _batchTransmitWithBadTriggers(uint256[] memory ids, bool[] memory goodTriggers, Registry registry) internal { + bytes memory reportBytes; + { + uint256[] memory upkeepIds = new uint256[](ids.length); + uint256[] memory gasLimits = new uint256[](ids.length); + bytes[] memory performDatas = new bytes[](ids.length); + bytes[] memory triggers = new bytes[](ids.length); + for (uint256 i = 0; i < ids.length; i++) { + upkeepIds[i] = ids[i]; + gasLimits[i] = registry.getUpkeep(ids[i]).performGas; + performDatas[i] = new bytes(0); + uint8 triggerType = registry.getTriggerType(ids[i]); + if (triggerType == 0) { + uint256 j = 0; + if (goodTriggers[i]) { + j = 1; + } + triggers[i] = _encodeConditionalTrigger( + ZKSyncAutoBase.ConditionalTrigger(uint32(block.number - j), blockhash(block.number - j)) + ); + } else { + revert("not implemented"); + } + } + + ZKSyncAutoBase.Report memory report = ZKSyncAutoBase.Report( + uint256(1000000000), + uint256(2000000000), + upkeepIds, + gasLimits, + triggers, + performDatas + ); + + reportBytes = _encodeReport(report); + } + (, , bytes32 configDigest) = registry.latestConfigDetails(); + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + uint256[] memory signerPKs = new uint256[](2); + signerPKs[0] = SIGNING_KEY0; + signerPKs[1] = SIGNING_KEY1; + (bytes32[] memory rs, bytes32[] memory ss, bytes32 vs) = _signReport(reportBytes, reportContext, signerPKs); + + vm.startPrank(TRANSMITTERS[0]); + registry.transmit(reportContext, reportBytes, rs, ss, vs); + vm.stopPrank(); + } + /// @notice Gather signatures on report data /// @param report - Report bytes generated from `_buildReport` /// @param reportContext - Report context bytes32 generated from `_buildReport` diff --git a/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol b/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol index 7098d9f38fa..2e3ca5b1584 100644 --- a/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol @@ -1655,6 +1655,140 @@ contract Transmit is SetUp { vm.stopPrank(); } + struct PaymentReceipt { + uint96 gasChargeInBillingToken; + uint96 premiumInBillingToken; + uint96 gasReimbursementInJuels; + uint96 premiumInJuels; + IERC20 billingToken; + uint96 linkUSD; + uint96 nativeUSD; + uint96 billingUSD; + } + event ReorgedUpkeepReport(uint256 indexed id, bytes trigger); + event UpkeepCharged(uint256 indexed id, PaymentReceipt receipt); + event UpkeepPerformed( + uint256 indexed id, + bool indexed success, + uint96 totalPayment, + uint256 gasUsed, + uint256 gasOverhead, + bytes trigger + ); + function test_whenFirstUpkeepFails_subsequentUpkeepsPerformZK() external { + // the first and second upkeeps use LINK as billing token and the third uses WETH + // the first upkeep fails the pre perform check due to incorrect block number in its trigger + // the second and third upkeep perform + // the first upkeep should not be charged and the second and third upkeep should be charged + uint256[] memory prevUpkeepBalances = new uint256[](3); + prevUpkeepBalances[0] = registry.getBalance(linkUpkeepID); + prevUpkeepBalances[1] = registry.getBalance(linkUpkeepID2); + prevUpkeepBalances[2] = registry.getBalance(nativeUpkeepID); + uint256[] memory prevTokenBalances = new uint256[](2); + prevTokenBalances[0] = linkToken.balanceOf(address(registry)); + prevTokenBalances[1] = weth.balanceOf(address(registry)); + uint256[] memory prevReserveBalances = new uint256[](2); + prevReserveBalances[0] = registry.getReserveAmount(address(linkToken)); + prevReserveBalances[1] = registry.getReserveAmount(address(weth)); + uint256[] memory upkeepIDs = new uint256[](3); + upkeepIDs[0] = linkUpkeepID; + upkeepIDs[1] = linkUpkeepID2; + upkeepIDs[2] = nativeUpkeepID; + + // do the transmit + vm.expectEmit(); + emit ReorgedUpkeepReport(linkUpkeepID, abi.encode(block.number, blockhash(block.number))); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(linkUpkeepID2, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(linkUpkeepID2, true, 0, 0, 0, bytes("")); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(nativeUpkeepID, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(nativeUpkeepID, true, 0, 0, 0, bytes("")); + bool[] memory goodTriggers = new bool[](3); + goodTriggers[0] = false; + goodTriggers[1] = true; + goodTriggers[2] = true; + _batchTransmitWithBadTriggers(upkeepIDs, goodTriggers, registry); + + // assert upkeep balances + // the first upkeep fails and the second and third upkeep succeeds + require(prevUpkeepBalances[0] == registry.getBalance(linkUpkeepID), "link upkeep balance should remain the same"); + require(prevUpkeepBalances[1] > registry.getBalance(linkUpkeepID2), "link upkeep 2 balance should have decreased"); + require(prevUpkeepBalances[2] > registry.getBalance(nativeUpkeepID), "native upkeep balance should have decreased"); + // assert token balances have not changed + assertEq(prevTokenBalances[0], linkToken.balanceOf(address(registry))); + assertEq(prevTokenBalances[1], weth.balanceOf(address(registry))); + // assert reserve amounts have adjusted accordingly + require( + prevReserveBalances[0] < registry.getReserveAmount(address(linkToken)), + "link reserve amount should have increased" + ); // link reserve amount increases in value equal to the decrease of the other reserve amounts + require( + prevReserveBalances[1] > registry.getReserveAmount(address(weth)), + "native reserve amount should have decreased" + ); + } + + function test_whenSecondUpkeepFails_FirstAndThirdUpkeepsPerform() external { + // the first upkeep uses WETH as billing token and the second and third use LINK + // the first upkeep succeeds + // the second upkeep fails pre perform check due to incorrect block number in its trigger + // the third upkeep succeeds + // the second upkeep should not be charged and the first and third upkeep should be charged + uint256[] memory prevUpkeepBalances = new uint256[](3); + prevUpkeepBalances[0] = registry.getBalance(nativeUpkeepID); + prevUpkeepBalances[1] = registry.getBalance(linkUpkeepID); + prevUpkeepBalances[2] = registry.getBalance(linkUpkeepID2); + uint256[] memory prevTokenBalances = new uint256[](2); + prevTokenBalances[0] = weth.balanceOf(address(registry)); + prevTokenBalances[1] = linkToken.balanceOf(address(registry)); + uint256[] memory prevReserveBalances = new uint256[](2); + prevReserveBalances[0] = registry.getReserveAmount(address(weth)); + prevReserveBalances[1] = registry.getReserveAmount(address(linkToken)); + uint256[] memory upkeepIDs = new uint256[](3); + upkeepIDs[0] = nativeUpkeepID; + upkeepIDs[1] = linkUpkeepID; + upkeepIDs[2] = linkUpkeepID2; + + // do the transmit + // expect this event first because all the upkeeps will be checked first before they are performed and charged + vm.expectEmit(); + emit ReorgedUpkeepReport(linkUpkeepID, abi.encode(block.number, blockhash(block.number))); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(nativeUpkeepID, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(nativeUpkeepID, true, 0, 0, 0, bytes("")); + vm.expectEmit(true, false, false, false); + emit UpkeepCharged(linkUpkeepID2, PaymentReceipt(0, 0, 0, 0, linkToken, 0, 0, 0)); + vm.expectEmit(true, true, false, false); + emit UpkeepPerformed(linkUpkeepID2, true, 0, 0, 0, bytes("")); + bool[] memory goodTriggers = new bool[](3); + goodTriggers[0] = true; + goodTriggers[1] = false; + goodTriggers[2] = true; + _batchTransmitWithBadTriggers(upkeepIDs, goodTriggers, registry); + + // assert upkeep balances + // the first upkeep fails and the second and third upkeep succeeds + require(prevUpkeepBalances[0] > registry.getBalance(nativeUpkeepID), "native upkeep balance should have decreased"); + require(prevUpkeepBalances[1] == registry.getBalance(linkUpkeepID), "link upkeep balance should remain the same"); + require(prevUpkeepBalances[2] > registry.getBalance(linkUpkeepID2), "link upkeep 2 balance should have decreased"); + // assert token balances have not changed + assertEq(prevTokenBalances[0], weth.balanceOf(address(registry))); + assertEq(prevTokenBalances[1], linkToken.balanceOf(address(registry))); + // assert reserve amounts have adjusted accordingly + require( + prevReserveBalances[0] > registry.getReserveAmount(address(weth)), + "native reserve amount should have decreased" + ); // link reserve amount increases in value equal to the decrease of the other reserve amounts + require( + prevReserveBalances[1] < registry.getReserveAmount(address(linkToken)), + "link reserve amount should have increased" + ); + } + function test_handlesMixedBatchOfBillingTokens() external { uint256[] memory prevUpkeepBalances = new uint256[](3); prevUpkeepBalances[0] = registry.getBalance(linkUpkeepID); @@ -1698,7 +1832,7 @@ contract Transmit is SetUp { // assert reserve amounts have adjusted accordingly require( prevReserveBalances[0] < registry.getReserveAmount(address(linkToken)), - "usd reserve amount should have increased" + "link reserve amount should have increased" ); // link reserve amount increases in value equal to the decrease of the other reserve amounts require( prevReserveBalances[1] > registry.getReserveAmount(address(usdToken18)), diff --git a/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol b/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol index 031d7b5dfb8..fbf509772f0 100644 --- a/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol +++ b/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol @@ -192,9 +192,7 @@ contract AutomationRegistry2_3 is AutomationRegistryBase2_3, OCR2Abstract, Chain uint256 nativeUSD = _getNativeUSD(hotVars); for (uint256 i = 0; i < report.upkeepIds.length; i++) { if (upkeepTransmitInfo[i].earlyChecksPassed) { - if (i == 0 || upkeepTransmitInfo[i].upkeep.billingToken != upkeepTransmitInfo[i - 1].upkeep.billingToken) { - billingTokenParams = _getBillingTokenPaymentParams(hotVars, upkeepTransmitInfo[i].upkeep.billingToken); - } + billingTokenParams = _getBillingTokenPaymentParams(hotVars, upkeepTransmitInfo[i].upkeep.billingToken); PaymentReceipt memory receipt = _handlePayment( hotVars, PaymentParams({ diff --git a/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol b/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol index 354a6a9b475..bc9cc144424 100644 --- a/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol +++ b/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol @@ -59,8 +59,8 @@ abstract contract AutomationRegistryBase2_3 is ConfirmedOwner { // tx itself, but since payment processing itself takes gas, and it needs the overhead as input, we use fixed constants // to account for gas used in payment processing. These values are calibrated using hardhat tests which simulates various cases and verifies that // the variables result in accurate estimation - uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 51_200; // Fixed overhead per tx - uint256 internal constant ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD = 14_200; // Overhead per upkeep performed in batch + uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 51_000; // Fixed overhead per tx + uint256 internal constant ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD = 14_900; // Overhead per upkeep performed in batch LinkTokenInterface internal immutable i_link; AggregatorV3Interface internal immutable i_linkUSDFeed; diff --git a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol index 5d5bf23aa26..b1b2feff83f 100644 --- a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol +++ b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol @@ -187,9 +187,7 @@ contract ZKSyncAutomationRegistry2_3 is ZKSyncAutomationRegistryBase2_3, OCR2Abs uint256 nativeUSD = _getNativeUSD(hotVars); for (uint256 i = 0; i < report.upkeepIds.length; i++) { if (upkeepTransmitInfo[i].earlyChecksPassed) { - if (i == 0 || upkeepTransmitInfo[i].upkeep.billingToken != upkeepTransmitInfo[i - 1].upkeep.billingToken) { - billingTokenParams = _getBillingTokenPaymentParams(hotVars, upkeepTransmitInfo[i].upkeep.billingToken); - } + billingTokenParams = _getBillingTokenPaymentParams(hotVars, upkeepTransmitInfo[i].upkeep.billingToken); PaymentReceipt memory receipt = _handlePayment( hotVars, PaymentParams({ diff --git a/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts b/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts index 48ec8469f9a..11282bdff94 100644 --- a/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts @@ -117,7 +117,7 @@ const emptyBytes = '0x' const emptyBytes32 = '0x0000000000000000000000000000000000000000000000000000000000000000' -const transmitGasOverhead = 1_040_000 +const transmitGasOverhead = 1_080_000 const checkGasOverhead = 600_000 const stalenessSeconds = BigNumber.from(43820) @@ -165,7 +165,6 @@ let registry: IAutomationRegistry // default registry, used for most tests let arbRegistry: IAutomationRegistry // arbitrum registry let opRegistry: IAutomationRegistry // optimism registry let mgRegistry: IAutomationRegistry // "migrate registry" used in migration tests -let blankRegistry: IAutomationRegistry // used to test initial configurations let mockArbGasInfo: MockArbGasInfo let mockOVMGasPriceOracle: MockOVMGasPriceOracle let mock: UpkeepMock @@ -402,7 +401,6 @@ describe('AutomationRegistry2_3', () => { let afUpkeepId: BigNumber // auto funding upkeep let logUpkeepId: BigNumber // log trigger upkeepID let streamsLookupUpkeepId: BigNumber // streams lookup upkeep - const numUpkeeps = 4 // see above let keeperAddresses: string[] let payees: string[] let signers: Wallet[] @@ -1017,7 +1015,6 @@ describe('AutomationRegistry2_3', () => { arbRegistry = await deployRegistry23(...registryParams) opRegistry = await deployRegistry23(...registryParams) mgRegistry = await deployRegistry23(...registryParams) - blankRegistry = await deployRegistry23(...registryParams) registryConditionalOverhead = await registry.getConditionalGasOverhead() registryLogOverhead = await registry.getLogGasOverhead() diff --git a/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts b/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts index ffbde4464b9..21af6fcbf0a 100644 --- a/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts +++ b/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts @@ -84,9 +84,6 @@ type OnChainConfig = Parameters[3] let registryConditionalOverhead: BigNumber let registryLogOverhead: BigNumber let registryPerSignerGasOverhead: BigNumber -// let registryPerPerformByteGasOverhead: BigNumber -// let registryTransmitCalldataFixedBytesOverhead: BigNumber -// let registryTransmitCalldataPerSignerBytesOverhead: BigNumber let cancellationDelay: number // This is the margin for gas that we test for. Gas charged should always be greater @@ -1618,7 +1615,6 @@ describe('ZKSyncAutomationRegistry2_3', () => { BigNumber.from('1'), // Not the config multiplier, but the actual gas used paymentPremiumPPB, flatFeeMilliCents, - // pubdataGas.mul(gasPrice), ).total.toString(), totalPayment.toString(), ) @@ -1630,7 +1626,6 @@ describe('ZKSyncAutomationRegistry2_3', () => { BigNumber.from('1'), // Not the config multiplier, but the actual gas used paymentPremiumPPB, flatFeeMilliCents, - // pubdataGas.mul(gasPrice), ).premium.toString(), premium.toString(), ) @@ -1661,7 +1656,6 @@ describe('ZKSyncAutomationRegistry2_3', () => { gasCeilingMultiplier, // Should be same with exisitng multiplier paymentPremiumPPB, flatFeeMilliCents, - // pubdataGas.mul(gasPrice), ).total.toString(), totalPayment.toString(), ) diff --git a/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go b/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go index 97f0cfb113a..17cbd9a95a8 100644 --- a/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go +++ b/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go @@ -76,7 +76,7 @@ type AutomationRegistryBase23PaymentReceipt struct { var AutomationRegistryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"contractAutomationRegistryLogicA2_3\",\"name\":\"logicA\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLinkLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFeed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOffchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOnchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyFinanceAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingOverrides\",\"name\":\"overrides\",\"type\":\"tuple\"}],\"name\":\"BillingConfigOverridden\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"BillingConfigOverrideRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractIERC20Metadata\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"BillingConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newModule\",\"type\":\"address\"}],\"name\":\"ChainSpecificModuleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"payments\",\"type\":\"uint256[]\"}],\"name\":\"NOPsSettledOffchain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint96\",\"name\":\"gasChargeInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"gasReimbursementInJuels\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInJuels\",\"type\":\"uint96\"},{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"linkUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"billingUSD\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.PaymentReceipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"UpkeepCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fallbackTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfigBytes\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"reorgProtectionEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"financeAdmin\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackNativePrice\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"contractIChainModule\",\"name\":\"chainModule\",\"type\":\"address\"}],\"internalType\":\"structAutomationRegistryBase2_3.OnchainConfig\",\"name\":\"onchainConfig\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"contractIERC20Metadata[]\",\"name\":\"billingTokens\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig[]\",\"name\":\"billingConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConfigTypeSafe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6101806040523480156200001257600080fd5b50604051620065423803806200654283398101604081905262000035916200062f565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b91906200062f565b826001600160a01b031663226cf83c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010091906200062f565b836001600160a01b031663614486af6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016591906200062f565b846001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca91906200062f565b856001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f91906200062f565b866001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029491906200062f565b876001600160a01b031663c5b964e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f9919062000656565b886001600160a01b031663ac4dc59a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000338573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035e91906200062f565b3380600081620003b55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620003e857620003e8816200056b565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff19166001838181111562000439576200043962000679565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200049a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c091906200068f565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200052a91906200068f565b60ff16146200054c576040516301f86e1760e41b815260040160405180910390fd5b5050506001600160a01b039095166101605250620006b4945050505050565b336001600160a01b03821603620005c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620003ac565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200062c57600080fd5b50565b6000602082840312156200064257600080fd5b81516200064f8162000616565b9392505050565b6000602082840312156200066957600080fd5b8151600281106200064f57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215620006a257600080fd5b815160ff811681146200064f57600080fd5b60805160a05160c05160e05161010051610120516101405161016051615e2a620007186000396000818160b3015261018601526000505060005050600050506000505060006137bd015260005050600081816113710152612de60152615e2a6000f3fe6080604052600436106100b15760003560e01c80638da5cb5b11610069578063b1dc65a41161004e578063b1dc65a4146102cb578063e3d0e712146102eb578063f2fde38b1461030b576100b1565b80638da5cb5b1461025a578063afcb95d714610285576100b1565b8063349e8cca1161009a578063349e8cca1461017757806379ba5097146101cb57806381ff7048146101e0576100b1565b80630870d3a1146100f8578063181f5a7714610118575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e8080156100f1573d6000f35b3d6000fd5b005b34801561010457600080fd5b506100f6610113366004614b9e565b61032b565b34801561012457600080fd5b506101616040518060400160405280601881526020017f4175746f6d6174696f6e526567697374727920322e332e30000000000000000081525081565b60405161016e9190614d1a565b60405180910390f35b34801561018357600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016e565b3480156101d757600080fd5b506100f6610c0f565b3480156101ec57600080fd5b5061023760175460135463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff94851681529390921660208401529082015260600161016e565b34801561026657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101a6565b34801561029157600080fd5b50601354601454604080516000815260208101939093526c0100000000000000000000000090910463ffffffff169082015260600161016e565b3480156102d757600080fd5b506100f66102e6366004614d79565b610d11565b3480156102f757600080fd5b506100f6610306366004614e5e565b611051565b34801561031757600080fd5b506100f6610326366004614f2b565b61108b565b61033361109f565b601f8851111561036f576040517f25d0209c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8560ff166000036103ac576040517fe77dba5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b865188511415806103cb57506103c3866003614f77565b60ff16885111155b15610402576040517f1d2d1c5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805182511461043d576040517fcf54c06a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104478282611122565b610451888861175a565b604051806101200160405280601460000160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001600063ffffffff1681526020018660a0015162ffffff16815260200186610120015161ffff1681526020018760ff168152602001601460000160169054906101000a900460ff1615158152602001601460000160179054906101000a900460ff1615158152602001866080015115158152602001866101e0015173ffffffffffffffffffffffffffffffffffffffff16815250601460008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160106101000a81548162ffffff021916908362ffffff16021790555060608201518160000160136101000a81548161ffff021916908361ffff16021790555060808201518160000160156101000a81548160ff021916908360ff16021790555060a08201518160000160166101000a81548160ff02191690831515021790555060c08201518160000160176101000a81548160ff02191690831515021790555060e08201518160000160186101000a81548160ff0219169083151502179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506000601660010160189054906101000a900463ffffffff1690506000866101e0015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107259190614f93565b6017549091506000906107579074010000000000000000000000000000000000000000900463ffffffff166001614fac565b9050604051806101600160405280896060015173ffffffffffffffffffffffffffffffffffffffff168152602001896000015163ffffffff168152602001896020015163ffffffff1681526020016016600001601c9054906101000a900463ffffffff1663ffffffff16815260200189610100015173ffffffffffffffffffffffffffffffffffffffff1681526020018263ffffffff1681526020018363ffffffff168152602001896040015163ffffffff16815260200189610140015173ffffffffffffffffffffffffffffffffffffffff1681526020018960c0015163ffffffff1681526020018960e0015163ffffffff16815250601660008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555060e082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160020160146101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160186101000a81548163ffffffff021916908363ffffffff160217905550905050876101600151601981905550876101800151601a81905550876101a00151601b81905550600088604051602001610a9a919061501a565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052601754909150610aff904690309074010000000000000000000000000000000000000000900463ffffffff168f8f8f878f8f611e19565b6013556000610b0e6009611ec3565b90505b8015610b4b57610b38610b30610b286001846151a0565b600990611ed3565b600990611ee6565b5080610b43816151b3565b915050610b11565b5060005b896101c0015151811015610ba257610b8f8a6101c001518281518110610b7757610b776151e8565b60200260200101516009611f0890919063ffffffff16565b5080610b9a81615217565b915050610b4f565b507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0584601354601660010160149054906101000a900463ffffffff168f8f8f878f8f604051610bf99998979695949392919061524f565b60405180910390a1505050505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005a90506000610d238660406152e5565b610d2f896101446152fc565b610d3991906152fc565b9050368114610d74576040517fdfe9309000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff75010000000000000000000000000000000000000000008304811660808301527601000000000000000000000000000000000000000000008304811615801560a08401527701000000000000000000000000000000000000000000000084048216151560c0840152780100000000000000000000000000000000000000000000000090930416151560e082015260155473ffffffffffffffffffffffffffffffffffffffff1661010082015290610ed3576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b602052604090205460ff16610f1c576040517f1099ed7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6013548b3514610f58576040517fdfdcf8e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151610f6890600161530f565b60ff1687141580610f795750868514155b15610fb0576040517f0244f71a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc08b8b8b8b8b8b8b8b611f2a565b6000610fcc8b8b612193565b905060208c0135600881901c63ffffffff16610fe984848861224c565b836020015163ffffffff168163ffffffff16111561104157601480547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790555b5050505050505050505050505050565b60008060008580602001905181019061106a9190615495565b925092509250611080898989868989888861032b565b505050505050505050565b61109361109f565b61109c81612e5c565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c8c565b565b60005b6024548110156111e0576022600060248381548110611146576111466151e8565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffff00000000000000000000000000000000000000000000000000000000168155600181019190915560020180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169055806111d881615217565b915050611125565b506111ed602460006145f2565b60255460ff1660005b8351811015611754576000848281518110611213576112136151e8565b602002602001015190506000848381518110611231576112316151e8565b602002602001015190508173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa9190615640565b60ff16816060015160ff161415806113385750806040015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561130c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113309190615640565b60ff16600814155b1561136f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113db575060018460018111156113d9576113d961565d565b145b15611412576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216158061144d5750604081015173ffffffffffffffffffffffffffffffffffffffff16155b15611484576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff828116600090815260226020526040902054670100000000000000900416156114ee576040517f357d0cc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024805460018181019092557f7cd332d19b93bcabe3cce7ca0c18a052f57e5fd03b4758a09f30f5ddc4b22ec401805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216821790925560008181526022602090815260409182902086518154928801518489015160608a015160ff167b01000000000000000000000000000000000000000000000000000000027fffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffff9190981667010000000000000002167fffffffff000000000000000000000000000000000000000000ffffffffffffff62ffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000090951663ffffffff9093169290921793909317929092169190911793909317835560808501519383019390935560a0840151600290920180546bffffffffffffffffffffffff9093167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009093169290921790915590517fca93cbe727c73163ec538f71be6c0a64877d7f1f6dd35d5ca7cbaef3a3e34ba390611737908490600060c08201905063ffffffff835116825262ffffff602084015116602083015273ffffffffffffffffffffffffffffffffffffffff604084015116604083015260ff6060840151166060830152608083015160808301526bffffffffffffffffffffffff60a08401511660a083015292915050565b60405180910390a25050808061174c90615217565b9150506111f6565b50505050565b600e546014546bffffffffffffffffffffffff1660005b600e548110156117cd576117ba600e8281548110611791576117916151e8565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff168385612f51565b50806117c581615217565b915050611771565b5060255460009060ff16815b600e5481101561193e57600e81815481106117f6576117f66151e8565b6000918252602082200154600d805473ffffffffffffffffffffffffffffffffffffffff9092169550600c929184908110611833576118336151e8565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168452838201949094526040928301822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690559286168152600b909252902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560018260018111156118d5576118d561565d565b14801561191a575073ffffffffffffffffffffffffffffffffffffffff83166000908152600b60205260409020546201000090046bffffffffffffffffffffffff1615155b1561192c5761192a600f84611f08565b505b8061193681615217565b9150506117d9565b5061194b600d60006145f2565b611957600e60006145f2565b6040805160808101825260008082526020820181905291810182905260608101829052905b8751811015611de757600c600089838151811061199b5761199b6151e8565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff1615611a06576040517f77cea0fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16888281518110611a3057611a306151e8565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603611a85576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052806001151581526020018260ff16815250600c60008a8481518110611ab657611ab66151e8565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528181019290925260400160002082518154939092015160ff16610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909316929092171790558651879082908110611b5e57611b5e6151e8565b60200260200101519350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611bce576040517f58a70a0a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84166000908152600b60209081526040918290208251608081018452905460ff80821615801584526101008304909116938301939093526bffffffffffffffffffffffff6201000082048116948301949094526e01000000000000000000000000000090049092166060830152909250611c89576040517f6a7281ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180835260ff80831660208086019182526014546bffffffffffffffffffffffff9081166060880190815273ffffffffffffffffffffffffffffffffffffffff8a166000908152600b909352604092839020885181549551948a0151925184166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff939094166201000002929092167fffffffffffff000000000000000000000000000000000000000000000000ffff94909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090951694909417179190911692909217919091179055836001811115611dc357611dc361565d565b03611dd557611dd3600f85611ee6565b505b80611ddf81615217565b91505061197c565b508651611dfb90600d9060208a0190614610565b508551611e0f90600e906020890190614610565b5050505050505050565b6000808a8a8a8a8a8a8a8a8a604051602001611e3d9998979695949392919061568c565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179b9a5050505050505050505050565b6000611ecd825490565b92915050565b6000611edf8383613159565b9392505050565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff8416613183565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff841661327d565b60008787604051611f3c929190615721565b604051908190038120611f53918b90602001615731565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201208383019092526000808452908301819052909250906000805b8881101561212a57600185878360208110611fbf57611fbf6151e8565b611fcc91901a601b61530f565b8c8c85818110611fde57611fde6151e8565b905060200201358b8b86818110611ff757611ff76151e8565b9050602002013560405160008152602001604052604051612034949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612056573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815290849020838501909452925460ff8082161515808552610100909204169383019390935290955093509050612104576040517f0f4c073700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015160080260ff166001901b84019350808061212290615217565b915050611fa2565b50827e01010101010101010101010101010101010101010101010101010101010101841614612185576040517fc103be2e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050505050565b6121cc6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006121da83850185615822565b60408101515160608201515191925090811415806121fd57508082608001515114155b8061220d5750808260a001515114155b15612244576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b509392505050565b600082604001515167ffffffffffffffff81111561226c5761226c6146a7565b60405190808252806020026020018201604052801561233857816020015b6040805161020081018252600060e08201818152610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e0830182905282526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161228a5790505b50905060006040518060800160405280600061ffff16815260200160006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff16815260200160008152509050600085610100015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fa9190614f93565b6101008701516040517f7810d12a00000000000000000000000000000000000000000000000000000000815236600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690637810d12a90602401602060405180830381865afa158015612471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124959190614f93565b905060005b8660400151518110156129255760046000886040015183815181106124c1576124c16151e8565b6020908102919091018101518252818101929092526040908101600020815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490931660e08201526002909101549091169181019190915285518690839081106125e4576125e46151e8565b6020026020010151600001819052506126198760400151828151811061260c5761260c6151e8565b60200260200101516132cc565b85828151811061262b5761262b6151e8565b60200260200101516060019060018111156126485761264861565d565b9081600181111561265b5761265b61565d565b815250506126bf87604001518281518110612678576126786151e8565b60200260200101518489608001518481518110612697576126976151e8565b60200260200101518885815181106126b1576126b16151e8565b60200260200101518c613377565b8683815181106126d1576126d16151e8565b60200260200101516020018784815181106126ee576126ee6151e8565b602002602001015160c0018281525082151515158152505050848181518110612719576127196151e8565b602002602001015160200151156127495760018460000181815161273d919061590f565b61ffff1690525061274e565b612913565b6127b4858281518110612763576127636151e8565b6020026020010151600001516080015188606001518381518110612789576127896151e8565b60200260200101518960a0015184815181106127a7576127a76151e8565b6020026020010151613496565b8683815181106127c6576127c66151e8565b60200260200101516040018784815181106127e3576127e36151e8565b602002602001015160800182815250821515151581525050508760800151600161280d919061530f565b61281b9060ff1660406152e5565b6103a48860a001518381518110612834576128346151e8565b60200260200101515161284791906152fc565b61285191906152fc565b858281518110612863576128636151e8565b602002602001015160a0018181525050848181518110612885576128856151e8565b602002602001015160a00151846060018181516128a291906152fc565b90525084518590829081106128b9576128b96151e8565b602002602001015160800151866128d091906151a0565b9550612913876040015182815181106128eb576128eb6151e8565b602002602001015184878481518110612906576129066151e8565b60200260200101516136b1565b8061291d81615217565b91505061249a565b50825161ffff1660000361293c5750505050505050565b61c80061294a3660106152e5565b5a61295590886151a0565b61295f91906152fc565b61296991906152fc565b8351909550613778906129809061ffff1687615959565b61298a91906152fc565b60408051608081018252600080825260208201819052918101829052606081018290529196506129b9896137b6565b905060005b886040015151811015612cf5578681815181106129dd576129dd6151e8565b60200260200101516020015115612ce357801580612a75575086612a026001836151a0565b81518110612a1257612a126151e8565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff16878281518110612a4b57612a4b6151e8565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff1614155b15612aa957612aa68a888381518110612a9057612a906151e8565b60200260200101516000015161010001516138a0565b92505b6000612bc78b6040518061012001604052808b8681518110612acd57612acd6151e8565b60200260200101516080015181526020018c81526020018a606001518c8781518110612afb57612afb6151e8565b602002602001015160a001518a612b1291906152e5565b612b1c9190615959565b81526020018d6000015181526020018d6020015181526020018681526020018b8681518110612b4d57612b4d6151e8565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff168152602001878152602001600115158152508c604001518581518110612b9c57612b9c6151e8565b60200260200101518b8681518110612bb657612bb66151e8565b602002602001015160000151613a1c565b9050806060015187604001818151612bdf919061596d565b6bffffffffffffffffffffffff169052506040810151602088018051612c0690839061596d565b6bffffffffffffffffffffffff169052508751889083908110612c2b57612c2b6151e8565b60200260200101516040015115158a604001518381518110612c4f57612c4f6151e8565b60200260200101517fad8cc9579b21dfe2c2f6ea35ba15b656e46b4f5b0cb424f52739b8ce5cac9c5b83602001518460000151612c8c919061596d565b8b8681518110612c9e57612c9e6151e8565b6020026020010151608001518d8f608001518881518110612cc157612cc16151e8565b6020026020010151604051612cd99493929190615992565b60405180910390a3505b80612ced81615217565b9150506129be565b505050602083810151336000908152600b90925260409091208054600290612d329084906201000090046bffffffffffffffffffffffff1661596d565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508260400151601460000160008282829054906101000a90046bffffffffffffffffffffffff16612d90919061596d565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555082604001518360200151612dd2919061596d565b6bffffffffffffffffffffffff16602160007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612e4e91906152fc565b909155505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603612edb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c8c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e010000000000000000000000000000900490911660608201529061314d576000816060015185612fe991906159cf565b90506000612ff785836159f4565b9050808360400181815161300b919061596d565b6bffffffffffffffffffffffff169052506130268582615a1f565b83606001818151613037919061596d565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b6000826000018281548110613170576131706151e8565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561326c5760006131a76001836151a0565b85549091506000906131bb906001906151a0565b90508181146132205760008660000182815481106131db576131db6151e8565b90600052602060002001549050808760000184815481106131fe576131fe6151e8565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061323157613231615a4f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611ecd565b6000915050611ecd565b5092915050565b60008181526001830160205260408120546132c457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611ecd565b506000611ecd565b6000818160045b600f811015613359577fff000000000000000000000000000000000000000000000000000000000000008216838260208110613311576133116151e8565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461334757506000949350505050565b8061335181615217565b9150506132d3565b5081600f1a600181111561336f5761336f61565d565b949350505050565b6000808080856060015160018111156133925761339261565d565b036133b8576133a48888888888613e8b565b6133b35760009250905061348c565b613430565b6001856060015160018111156133d0576133d061565d565b036133fe5760006133e389898988614015565b92509050806133f8575060009250905061348c565b50613430565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84516060015163ffffffff16871061348557877fc3237c8807c467c1b39b8d0395eff077313e691bf0a7388106792564ebfd5636876040516134729190614d1a565b60405180910390a260009250905061348c565b6001925090505b9550959350505050565b601454600090819077010000000000000000000000000000000000000000000000900460ff16156134f3576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16770100000000000000000000000000000000000000000000001790556040517f4585e33b0000000000000000000000000000000000000000000000000000000090613568908590602401614d1a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d169061363b9087908790600401615a7e565b60408051808303816000875af1158015613659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061367d9190615a97565b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b6000816060015160018111156136c9576136c961565d565b0361372d57600083815260046020526040902060010180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff851602179055505050565b6001816060015160018111156137455761374561565d565b036137b15760c08101805160009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055915191517fa4a4e334c0e330143f9437484fe516c13bc560b86b5b0daf58e7084aaac228f29190a25b505050565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061384a9190615adf565b5093505092505060008213158061386057508042105b8061389057506000846040015162ffffff16118015613890575061388481426151a0565b846040015162ffffff16105b15613276575050601b5492915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa15801561398d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b19190615adf565b509350509250506000821315806139c757508042105b806139f757506000866040015162ffffff161180156139f757506139eb81426151a0565b866040015162ffffff16105b15613a0b5760018301546060850152613a13565b606084018290525b50505092915050565b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201529082015115613ab25760008381526023602090815260409182902082518084018452905463ffffffff811680835262ffffff640100000000909204821692840192835260e089018051909401529051915191169101525b6000613abe8686614222565b60c0840151602082015182519293509091600091613adb9161596d565b60e08801515190915060ff16600060128210613af8576001613b0e565b613b038260126151a0565b613b0e90600a615c4f565b9050600060128311613b21576001613b37565b613b2c6012846151a0565b613b3790600a615c4f565b905085600001516bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613bdf57849350613bb3818b60800151613b7791906152e5565b838c60e0015160600151886bffffffffffffffffffffffff16613b9a91906152e5565b613ba491906152e5565b613bae9190615959565b614550565b6bffffffffffffffffffffffff9081166040880152600060608801819052602088015285168652613d05565b836bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613d0557849350613c6d86604001516bffffffffffffffffffffffff16828c60800151613c2c91906152e5565b848d60e0015160600151896bffffffffffffffffffffffff16613c4f91906152e5565b613c5991906152e5565b613c639190615959565b613bae91906151a0565b6bffffffffffffffffffffffff1660608088019190915260e08b01510151613cf190613c9a9084906152e5565b6001848d60e0015160600151613cb091906152e5565b613cba91906151a0565b838d608001518a606001516bffffffffffffffffffffffff16613cdd91906152e5565b613ce791906152e5565b613ba491906152fc565b6bffffffffffffffffffffffff1660208701525b60008981526004602052604090206001018054859190601090613d4b90849070010000000000000000000000000000000090046bffffffffffffffffffffffff166159cf565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b81526004602052604081206001018054928816935091613da69084906fffffffffffffffffffffffffffffffff16615c5b565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836bffffffffffffffffffffffff16602160008c60c0015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613e3d91906151a0565b92505081905550887f801ba6ed51146ffe3e99d1dbd9dd0f4de6292e78a9a34c39c0183de17b3f40fc87604051613e749190615c84565b60405180910390a250939998505050505050505050565b60008084806020019051810190613ea29190615d44565b845160e00151815191925063ffffffff90811691161015613eff57867f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e886604051613eed9190614d1a565b60405180910390a2600091505061400c565b8260e001518015613fbf5750602081015115801590613fbf5750602081015161010084015182516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015613f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fbc9190614f93565b14155b80613fd15750805163ffffffff168611155b1561400657867f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc30186604051613eed9190614d1a565b60019150505b95945050505050565b60008060008480602001905181019061402e9190615d9c565b905060008782600001518360200151846040015160405160200161409094939291909384526020840192909252604083015260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016606082015260640190565b6040516020818303038152906040528051906020012090508460e00151801561416b575060808201511580159061416b5750608082015161010086015160608401516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015614144573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141689190614f93565b14155b80614180575086826060015163ffffffff1610155b156141ca57877f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc301876040516141b59190614d1a565b60405180910390a26000935091506142199050565b60008181526008602052604090205460ff161561421157877f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e8876040516141b59190614d1a565b600193509150505b94509492505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff16846060015161428d91906152e5565b905083610100015180156142a05750803a105b156142a857503a5b6000601283116142b95760016142cf565b6142c46012846151a0565b6142cf90600a615c4f565b90506000601284106142e25760016142f8565b6142ed8460126151a0565b6142f890600a615c4f565b905060008660a0015187604001518860200151896000015161431a91906152fc565b61432490876152e5565b61432e91906152fc565b61433891906152e5565b905061437b828860e001516060015161435191906152e5565b6001848a60e001516060015161436791906152e5565b61437191906151a0565b613ce786856152e5565b6bffffffffffffffffffffffff168652608087015161439e90613bae9083615959565b6bffffffffffffffffffffffff1660408088019190915260e088015101516000906143d79062ffffff16683635c9adc5dea000006152e5565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b61440a91906152e5565b61441491906152fc565b61441e91906152e5565b61442891906152e5565b6144329190615959565b61443c91906152fc565b905061447f848a60e001516060015161445591906152e5565b6001868c60e001516060015161446b91906152e5565b61447591906151a0565b613ce788856152e5565b6bffffffffffffffffffffffff16602089015260808901516144a590613bae9083615959565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a01919091528901516144e890614550565b6bffffffffffffffffffffffff1660a0808a019190915289015161450b90614550565b6bffffffffffffffffffffffff1660c089015260e08901516060015161453090614550565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b60006bffffffffffffffffffffffff8211156145ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610c8c565b5090565b508054600082559060005260206000209081019061109c9190614692565b82805482825590600052602060002090810192821561468a579160200282015b8281111561468a57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614630565b506145ee9291505b5b808211156145ee5760008155600101614693565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610200810167ffffffffffffffff811182821017156146fa576146fa6146a7565b60405290565b60405160c0810167ffffffffffffffff811182821017156146fa576146fa6146a7565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561476a5761476a6146a7565b604052919050565b600067ffffffffffffffff82111561478c5761478c6146a7565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461109c57600080fd5b80356147c381614796565b919050565b600082601f8301126147d957600080fd5b813560206147ee6147e983614772565b614723565b82815260059290921b8401810191818101908684111561480d57600080fd5b8286015b8481101561483157803561482481614796565b8352918301918301614811565b509695505050505050565b60ff8116811461109c57600080fd5b80356147c38161483c565b63ffffffff8116811461109c57600080fd5b80356147c381614856565b801515811461109c57600080fd5b80356147c381614873565b62ffffff8116811461109c57600080fd5b80356147c38161488c565b61ffff8116811461109c57600080fd5b80356147c3816148a8565b600061020082840312156148d657600080fd5b6148de6146d6565b90506148e982614868565b81526148f760208301614868565b602082015261490860408301614868565b6040820152614919606083016147b8565b606082015261492a60808301614881565b608082015261493b60a0830161489d565b60a082015261494c60c08301614868565b60c082015261495d60e08301614868565b60e08201526101006149708184016147b8565b908201526101206149828382016148b8565b908201526101406149948382016147b8565b90820152610160828101359082015261018080830135908201526101a080830135908201526101c08083013567ffffffffffffffff8111156149d557600080fd5b6149e1858286016147c8565b8284015250506101e06149f58184016147b8565b9082015292915050565b803567ffffffffffffffff811681146147c357600080fd5b600082601f830112614a2857600080fd5b813567ffffffffffffffff811115614a4257614a426146a7565b614a7360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614723565b818152846020838601011115614a8857600080fd5b816020850160208301376000918101602001919091529392505050565b6bffffffffffffffffffffffff8116811461109c57600080fd5b600082601f830112614ad057600080fd5b81356020614ae06147e983614772565b82815260c09283028501820192828201919087851115614aff57600080fd5b8387015b85811015614b915781818a031215614b1b5760008081fd5b614b23614700565b8135614b2e81614856565b815281860135614b3d8161488c565b81870152604082810135614b5081614796565b90820152606082810135614b638161483c565b908201526080828101359082015260a080830135614b8081614aa5565b908201528452928401928101614b03565b5090979650505050505050565b600080600080600080600080610100898b031215614bbb57600080fd5b883567ffffffffffffffff80821115614bd357600080fd5b614bdf8c838d016147c8565b995060208b0135915080821115614bf557600080fd5b614c018c838d016147c8565b9850614c0f60408c0161484b565b975060608b0135915080821115614c2557600080fd5b614c318c838d016148c3565b9650614c3f60808c016149ff565b955060a08b0135915080821115614c5557600080fd5b614c618c838d01614a17565b945060c08b0135915080821115614c7757600080fd5b614c838c838d016147c8565b935060e08b0135915080821115614c9957600080fd5b50614ca68b828c01614abf565b9150509295985092959890939650565b6000815180845260005b81811015614cdc57602081850181015186830182015201614cc0565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611edf6020830184614cb6565b60008083601f840112614d3f57600080fd5b50813567ffffffffffffffff811115614d5757600080fd5b6020830191508360208260051b8501011115614d7257600080fd5b9250929050565b60008060008060008060008060e0898b031215614d9557600080fd5b606089018a811115614da657600080fd5b8998503567ffffffffffffffff80821115614dc057600080fd5b818b0191508b601f830112614dd457600080fd5b813581811115614de357600080fd5b8c6020828501011115614df557600080fd5b6020830199508098505060808b0135915080821115614e1357600080fd5b614e1f8c838d01614d2d565b909750955060a08b0135915080821115614e3857600080fd5b50614e458b828c01614d2d565b999c989b50969995989497949560c00135949350505050565b60008060008060008060c08789031215614e7757600080fd5b863567ffffffffffffffff80821115614e8f57600080fd5b614e9b8a838b016147c8565b97506020890135915080821115614eb157600080fd5b614ebd8a838b016147c8565b9650614ecb60408a0161484b565b95506060890135915080821115614ee157600080fd5b614eed8a838b01614a17565b9450614efb60808a016149ff565b935060a0890135915080821115614f1157600080fd5b50614f1e89828a01614a17565b9150509295509295509295565b600060208284031215614f3d57600080fd5b8135611edf81614796565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff818116838216029081169081811461327657613276614f48565b600060208284031215614fa557600080fd5b5051919050565b63ffffffff81811683821601908082111561327657613276614f48565b600081518084526020808501945080840160005b8381101561500f57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614fdd565b509495945050505050565b6020815261503160208201835163ffffffff169052565b6000602083015161504a604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015173ffffffffffffffffffffffffffffffffffffffff8116608084015250608083015180151560a08401525060a083015162ffffff811660c08401525060c083015163ffffffff811660e08401525060e08301516101006150c98185018363ffffffff169052565b84015190506101206150f28482018373ffffffffffffffffffffffffffffffffffffffff169052565b84015190506101406151098482018361ffff169052565b84015190506101606151328482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610180848101919091528401516101a0808501919091528401516101c0808501919091528401516102006101e08086018290529192509061517a610220860184614fc9565b95015173ffffffffffffffffffffffffffffffffffffffff169301929092525090919050565b81810381811115611ecd57611ecd614f48565b6000816151c2576151c2614f48565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361524857615248614f48565b5060010190565b600061012063ffffffff808d1684528b6020850152808b1660408501525080606084015261527f8184018a614fc9565b905082810360808401526152938189614fc9565b905060ff871660a084015282810360c08401526152b08187614cb6565b905067ffffffffffffffff851660e08401528281036101008401526152d58185614cb6565b9c9b505050505050505050505050565b8082028115828204841417611ecd57611ecd614f48565b80820180821115611ecd57611ecd614f48565b60ff8181168382160190811115611ecd57611ecd614f48565b80516147c381614856565b80516147c381614796565b80516147c381614873565b80516147c38161488c565b80516147c3816148a8565b600082601f83011261537057600080fd5b815160206153806147e983614772565b82815260059290921b8401810191818101908684111561539f57600080fd5b8286015b848110156148315780516153b681614796565b83529183019183016153a3565b600082601f8301126153d457600080fd5b815160206153e46147e983614772565b82815260c0928302850182019282820191908785111561540357600080fd5b8387015b85811015614b915781818a03121561541f5760008081fd5b615427614700565b815161543281614856565b8152818601516154418161488c565b8187015260408281015161545481614796565b908201526060828101516154678161483c565b908201526080828101519082015260a08083015161548481614aa5565b908201528452928401928101615407565b6000806000606084860312156154aa57600080fd5b835167ffffffffffffffff808211156154c257600080fd5b9085019061020082880312156154d757600080fd5b6154df6146d6565b6154e883615328565b81526154f660208401615328565b602082015261550760408401615328565b604082015261551860608401615333565b60608201526155296080840161533e565b608082015261553a60a08401615349565b60a082015261554b60c08401615328565b60c082015261555c60e08401615328565b60e082015261010061556f818501615333565b90820152610120615581848201615354565b90820152610140615593848201615333565b90820152610160838101519082015261018080840151908201526101a080840151908201526101c080840151838111156155cc57600080fd5b6155d88a82870161535f565b8284015250506101e06155ec818501615333565b90820152602087015190955091508082111561560757600080fd5b6156138783880161535f565b9350604086015191508082111561562957600080fd5b50615636868287016153c3565b9150509250925092565b60006020828403121561565257600080fd5b8151611edf8161483c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526156d38285018b614fc9565b915083820360808501526156e7828a614fc9565b915060ff881660a085015283820360c08501526157048288614cb6565b90861660e085015283810361010085015290506152d58185614cb6565b8183823760009101908152919050565b8281526080810160608360208401379392505050565b600082601f83011261575857600080fd5b813560206157686147e983614772565b82815260059290921b8401810191818101908684111561578757600080fd5b8286015b84811015614831578035835291830191830161578b565b600082601f8301126157b357600080fd5b813560206157c36147e983614772565b82815260059290921b840181019181810190868411156157e257600080fd5b8286015b8481101561483157803567ffffffffffffffff8111156158065760008081fd5b6158148986838b0101614a17565b8452509183019183016157e6565b60006020828403121561583457600080fd5b813567ffffffffffffffff8082111561584c57600080fd5b9083019060c0828603121561586057600080fd5b615868614700565b823581526020830135602082015260408301358281111561588857600080fd5b61589487828601615747565b6040830152506060830135828111156158ac57600080fd5b6158b887828601615747565b6060830152506080830135828111156158d057600080fd5b6158dc878286016157a2565b60808301525060a0830135828111156158f457600080fd5b615900878286016157a2565b60a08301525095945050505050565b61ffff81811683821601908082111561327657613276614f48565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826159685761596861592a565b500490565b6bffffffffffffffffffffffff81811683821601908082111561327657613276614f48565b6bffffffffffffffffffffffff851681528360208201528260408201526080606082015260006159c56080830184614cb6565b9695505050505050565b6bffffffffffffffffffffffff82811682821603908082111561327657613276614f48565b60006bffffffffffffffffffffffff80841680615a1357615a1361592a565b92169190910492915050565b6bffffffffffffffffffffffff818116838216028082169190828114615a4757615a47614f48565b505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b82815260406020820152600061336f6040830184614cb6565b60008060408385031215615aaa57600080fd5b8251615ab581614873565b6020939093015192949293505050565b805169ffffffffffffffffffff811681146147c357600080fd5b600080600080600060a08688031215615af757600080fd5b615b0086615ac5565b9450602086015193506040860151925060608601519150615b2360808701615ac5565b90509295509295909350565b600181815b80851115615b8857817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615b6e57615b6e614f48565b80851615615b7b57918102915b93841c9390800290615b34565b509250929050565b600082615b9f57506001611ecd565b81615bac57506000611ecd565b8160018114615bc25760028114615bcc57615be8565b6001915050611ecd565b60ff841115615bdd57615bdd614f48565b50506001821b611ecd565b5060208310610133831016604e8410600b8410161715615c0b575081810a611ecd565b615c158383615b2f565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615c4757615c47614f48565b029392505050565b6000611edf8383615b90565b6fffffffffffffffffffffffffffffffff81811683821601908082111561327657613276614f48565b6000610100820190506bffffffffffffffffffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401525073ffffffffffffffffffffffffffffffffffffffff608084015116608083015260a0830151615d0460a08401826bffffffffffffffffffffffff169052565b5060c0830151615d2460c08401826bffffffffffffffffffffffff169052565b5060e083015161327660e08401826bffffffffffffffffffffffff169052565b600060408284031215615d5657600080fd5b6040516040810181811067ffffffffffffffff82111715615d7957615d796146a7565b6040528251615d8781614856565b81526020928301519281019290925250919050565b600060a08284031215615dae57600080fd5b60405160a0810181811067ffffffffffffffff82111715615dd157615dd16146a7565b806040525082518152602083015160208201526040830151615df281614856565b60408201526060830151615e0581614856565b6060820152608092830151928101929092525091905056fea164736f6c6343000813000a", + Bin: "0x6101806040523480156200001257600080fd5b50604051620064b5380380620064b583398101604081905262000035916200062f565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b91906200062f565b826001600160a01b031663226cf83c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010091906200062f565b836001600160a01b031663614486af6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016591906200062f565b846001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca91906200062f565b856001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f91906200062f565b866001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029491906200062f565b876001600160a01b031663c5b964e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f9919062000656565b886001600160a01b031663ac4dc59a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000338573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035e91906200062f565b3380600081620003b55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620003e857620003e8816200056b565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff19166001838181111562000439576200043962000679565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200049a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c091906200068f565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200052a91906200068f565b60ff16146200054c576040516301f86e1760e41b815260040160405180910390fd5b5050506001600160a01b039095166101605250620006b4945050505050565b336001600160a01b03821603620005c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620003ac565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200062c57600080fd5b50565b6000602082840312156200064257600080fd5b81516200064f8162000616565b9392505050565b6000602082840312156200066957600080fd5b8151600281106200064f57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215620006a257600080fd5b815160ff811681146200064f57600080fd5b60805160a05160c05160e05161010051610120516101405161016051615d9d620007186000396000818160b301526101860152600050506000505060005050600050506000613730015260005050600081816113710152612d590152615d9d6000f3fe6080604052600436106100b15760003560e01c80638da5cb5b11610069578063b1dc65a41161004e578063b1dc65a4146102cb578063e3d0e712146102eb578063f2fde38b1461030b576100b1565b80638da5cb5b1461025a578063afcb95d714610285576100b1565b8063349e8cca1161009a578063349e8cca1461017757806379ba5097146101cb57806381ff7048146101e0576100b1565b80630870d3a1146100f8578063181f5a7714610118575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e8080156100f1573d6000f35b3d6000fd5b005b34801561010457600080fd5b506100f6610113366004614b11565b61032b565b34801561012457600080fd5b506101616040518060400160405280601881526020017f4175746f6d6174696f6e526567697374727920322e332e30000000000000000081525081565b60405161016e9190614c8d565b60405180910390f35b34801561018357600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016e565b3480156101d757600080fd5b506100f6610c0f565b3480156101ec57600080fd5b5061023760175460135463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff94851681529390921660208401529082015260600161016e565b34801561026657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101a6565b34801561029157600080fd5b50601354601454604080516000815260208101939093526c0100000000000000000000000090910463ffffffff169082015260600161016e565b3480156102d757600080fd5b506100f66102e6366004614cec565b610d11565b3480156102f757600080fd5b506100f6610306366004614dd1565b611051565b34801561031757600080fd5b506100f6610326366004614e9e565b61108b565b61033361109f565b601f8851111561036f576040517f25d0209c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8560ff166000036103ac576040517fe77dba5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b865188511415806103cb57506103c3866003614eea565b60ff16885111155b15610402576040517f1d2d1c5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805182511461043d576040517fcf54c06a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104478282611122565b610451888861175a565b604051806101200160405280601460000160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001600063ffffffff1681526020018660a0015162ffffff16815260200186610120015161ffff1681526020018760ff168152602001601460000160169054906101000a900460ff1615158152602001601460000160179054906101000a900460ff1615158152602001866080015115158152602001866101e0015173ffffffffffffffffffffffffffffffffffffffff16815250601460008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160106101000a81548162ffffff021916908362ffffff16021790555060608201518160000160136101000a81548161ffff021916908361ffff16021790555060808201518160000160156101000a81548160ff021916908360ff16021790555060a08201518160000160166101000a81548160ff02191690831515021790555060c08201518160000160176101000a81548160ff02191690831515021790555060e08201518160000160186101000a81548160ff0219169083151502179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506000601660010160189054906101000a900463ffffffff1690506000866101e0015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107259190614f06565b6017549091506000906107579074010000000000000000000000000000000000000000900463ffffffff166001614f1f565b9050604051806101600160405280896060015173ffffffffffffffffffffffffffffffffffffffff168152602001896000015163ffffffff168152602001896020015163ffffffff1681526020016016600001601c9054906101000a900463ffffffff1663ffffffff16815260200189610100015173ffffffffffffffffffffffffffffffffffffffff1681526020018263ffffffff1681526020018363ffffffff168152602001896040015163ffffffff16815260200189610140015173ffffffffffffffffffffffffffffffffffffffff1681526020018960c0015163ffffffff1681526020018960e0015163ffffffff16815250601660008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555060e082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160020160146101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160186101000a81548163ffffffff021916908363ffffffff160217905550905050876101600151601981905550876101800151601a81905550876101a00151601b81905550600088604051602001610a9a9190614f8d565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052601754909150610aff904690309074010000000000000000000000000000000000000000900463ffffffff168f8f8f878f8f611e19565b6013556000610b0e6009611ec3565b90505b8015610b4b57610b38610b30610b28600184615113565b600990611ed3565b600990611ee6565b5080610b4381615126565b915050610b11565b5060005b896101c0015151811015610ba257610b8f8a6101c001518281518110610b7757610b7761515b565b60200260200101516009611f0890919063ffffffff16565b5080610b9a8161518a565b915050610b4f565b507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0584601354601660010160149054906101000a900463ffffffff168f8f8f878f8f604051610bf9999897969594939291906151c2565b60405180910390a1505050505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005a90506000610d23866040615258565b610d2f8961014461526f565b610d39919061526f565b9050368114610d74576040517fdfe9309000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff75010000000000000000000000000000000000000000008304811660808301527601000000000000000000000000000000000000000000008304811615801560a08401527701000000000000000000000000000000000000000000000084048216151560c0840152780100000000000000000000000000000000000000000000000090930416151560e082015260155473ffffffffffffffffffffffffffffffffffffffff1661010082015290610ed3576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b602052604090205460ff16610f1c576040517f1099ed7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6013548b3514610f58576040517fdfdcf8e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151610f68906001615282565b60ff1687141580610f795750868514155b15610fb0576040517f0244f71a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc08b8b8b8b8b8b8b8b611f2a565b6000610fcc8b8b612193565b905060208c0135600881901c63ffffffff16610fe984848861224c565b836020015163ffffffff168163ffffffff16111561104157601480547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790555b5050505050505050505050505050565b60008060008580602001905181019061106a9190615408565b925092509250611080898989868989888861032b565b505050505050505050565b61109361109f565b61109c81612dcf565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c8c565b565b60005b6024548110156111e05760226000602483815481106111465761114661515b565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffff00000000000000000000000000000000000000000000000000000000168155600181019190915560020180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169055806111d88161518a565b915050611125565b506111ed60246000614565565b60255460ff1660005b83518110156117545760008482815181106112135761121361515b565b6020026020010151905060008483815181106112315761123161515b565b602002602001015190508173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa91906155b3565b60ff16816060015160ff161415806113385750806040015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561130c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133091906155b3565b60ff16600814155b1561136f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113db575060018460018111156113d9576113d96155d0565b145b15611412576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216158061144d5750604081015173ffffffffffffffffffffffffffffffffffffffff16155b15611484576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff828116600090815260226020526040902054670100000000000000900416156114ee576040517f357d0cc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024805460018181019092557f7cd332d19b93bcabe3cce7ca0c18a052f57e5fd03b4758a09f30f5ddc4b22ec401805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216821790925560008181526022602090815260409182902086518154928801518489015160608a015160ff167b01000000000000000000000000000000000000000000000000000000027fffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffff9190981667010000000000000002167fffffffff000000000000000000000000000000000000000000ffffffffffffff62ffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000090951663ffffffff9093169290921793909317929092169190911793909317835560808501519383019390935560a0840151600290920180546bffffffffffffffffffffffff9093167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009093169290921790915590517fca93cbe727c73163ec538f71be6c0a64877d7f1f6dd35d5ca7cbaef3a3e34ba390611737908490600060c08201905063ffffffff835116825262ffffff602084015116602083015273ffffffffffffffffffffffffffffffffffffffff604084015116604083015260ff6060840151166060830152608083015160808301526bffffffffffffffffffffffff60a08401511660a083015292915050565b60405180910390a25050808061174c9061518a565b9150506111f6565b50505050565b600e546014546bffffffffffffffffffffffff1660005b600e548110156117cd576117ba600e82815481106117915761179161515b565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff168385612ec4565b50806117c58161518a565b915050611771565b5060255460009060ff16815b600e5481101561193e57600e81815481106117f6576117f661515b565b6000918252602082200154600d805473ffffffffffffffffffffffffffffffffffffffff9092169550600c9291849081106118335761183361515b565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168452838201949094526040928301822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690559286168152600b909252902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560018260018111156118d5576118d56155d0565b14801561191a575073ffffffffffffffffffffffffffffffffffffffff83166000908152600b60205260409020546201000090046bffffffffffffffffffffffff1615155b1561192c5761192a600f84611f08565b505b806119368161518a565b9150506117d9565b5061194b600d6000614565565b611957600e6000614565565b6040805160808101825260008082526020820181905291810182905260608101829052905b8751811015611de757600c600089838151811061199b5761199b61515b565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff1615611a06576040517f77cea0fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16888281518110611a3057611a3061515b565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603611a85576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052806001151581526020018260ff16815250600c60008a8481518110611ab657611ab661515b565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528181019290925260400160002082518154939092015160ff16610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909316929092171790558651879082908110611b5e57611b5e61515b565b60200260200101519350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611bce576040517f58a70a0a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84166000908152600b60209081526040918290208251608081018452905460ff80821615801584526101008304909116938301939093526bffffffffffffffffffffffff6201000082048116948301949094526e01000000000000000000000000000090049092166060830152909250611c89576040517f6a7281ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180835260ff80831660208086019182526014546bffffffffffffffffffffffff9081166060880190815273ffffffffffffffffffffffffffffffffffffffff8a166000908152600b909352604092839020885181549551948a0151925184166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff939094166201000002929092167fffffffffffff000000000000000000000000000000000000000000000000ffff94909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090951694909417179190911692909217919091179055836001811115611dc357611dc36155d0565b03611dd557611dd3600f85611ee6565b505b80611ddf8161518a565b91505061197c565b508651611dfb90600d9060208a0190614583565b508551611e0f90600e906020890190614583565b5050505050505050565b6000808a8a8a8a8a8a8a8a8a604051602001611e3d999897969594939291906155ff565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179b9a5050505050505050505050565b6000611ecd825490565b92915050565b6000611edf83836130cc565b9392505050565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff84166130f6565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff84166131f0565b60008787604051611f3c929190615694565b604051908190038120611f53918b906020016156a4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201208383019092526000808452908301819052909250906000805b8881101561212a57600185878360208110611fbf57611fbf61515b565b611fcc91901a601b615282565b8c8c85818110611fde57611fde61515b565b905060200201358b8b86818110611ff757611ff761515b565b9050602002013560405160008152602001604052604051612034949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612056573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815290849020838501909452925460ff8082161515808552610100909204169383019390935290955093509050612104576040517f0f4c073700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015160080260ff166001901b8401935080806121229061518a565b915050611fa2565b50827e01010101010101010101010101010101010101010101010101010101010101841614612185576040517fc103be2e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050505050565b6121cc6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006121da83850185615795565b60408101515160608201515191925090811415806121fd57508082608001515114155b8061220d5750808260a001515114155b15612244576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b509392505050565b600082604001515167ffffffffffffffff81111561226c5761226c61461a565b60405190808252806020026020018201604052801561233857816020015b6040805161020081018252600060e08201818152610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e0830182905282526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161228a5790505b50905060006040518060800160405280600061ffff16815260200160006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff16815260200160008152509050600085610100015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fa9190614f06565b6101008701516040517f7810d12a00000000000000000000000000000000000000000000000000000000815236600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690637810d12a90602401602060405180830381865afa158015612471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124959190614f06565b905060005b8660400151518110156129255760046000886040015183815181106124c1576124c161515b565b6020908102919091018101518252818101929092526040908101600020815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490931660e08201526002909101549091169181019190915285518690839081106125e4576125e461515b565b6020026020010151600001819052506126198760400151828151811061260c5761260c61515b565b602002602001015161323f565b85828151811061262b5761262b61515b565b6020026020010151606001906001811115612648576126486155d0565b9081600181111561265b5761265b6155d0565b815250506126bf876040015182815181106126785761267861515b565b602002602001015184896080015184815181106126975761269761515b565b60200260200101518885815181106126b1576126b161515b565b60200260200101518c6132ea565b8683815181106126d1576126d161515b565b60200260200101516020018784815181106126ee576126ee61515b565b602002602001015160c00182815250821515151581525050508481815181106127195761271961515b565b602002602001015160200151156127495760018460000181815161273d9190615882565b61ffff1690525061274e565b612913565b6127b48582815181106127635761276361515b565b60200260200101516000015160800151886060015183815181106127895761278961515b565b60200260200101518960a0015184815181106127a7576127a761515b565b6020026020010151613409565b8683815181106127c6576127c661515b565b60200260200101516040018784815181106127e3576127e361515b565b602002602001015160800182815250821515151581525050508760800151600161280d9190615282565b61281b9060ff166040615258565b6103a48860a0015183815181106128345761283461515b565b602002602001015151612847919061526f565b612851919061526f565b8582815181106128635761286361515b565b602002602001015160a00181815250508481815181106128855761288561515b565b602002602001015160a00151846060018181516128a2919061526f565b90525084518590829081106128b9576128b961515b565b602002602001015160800151866128d09190615113565b9550612913876040015182815181106128eb576128eb61515b565b6020026020010151848784815181106129065761290661515b565b6020026020010151613624565b8061291d8161518a565b91505061249a565b50825161ffff1660000361293c5750505050505050565b61c73861294a366010615258565b5a6129559088615113565b61295f919061526f565b612969919061526f565b8351909550613a34906129809061ffff16876158cc565b61298a919061526f565b60408051608081018252600080825260208201819052918101829052606081018290529196506129b989613729565b905060005b886040015151811015612c68578681815181106129dd576129dd61515b565b60200260200101516020015115612c5657612a1a8a888381518110612a0457612a0461515b565b6020026020010151600001516101000151613813565b92506000612b3a8b6040518061012001604052808b8681518110612a4057612a4061515b565b60200260200101516080015181526020018c81526020018a606001518c8781518110612a6e57612a6e61515b565b602002602001015160a001518a612a859190615258565b612a8f91906158cc565b81526020018d6000015181526020018d6020015181526020018681526020018b8681518110612ac057612ac061515b565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff168152602001878152602001600115158152508c604001518581518110612b0f57612b0f61515b565b60200260200101518b8681518110612b2957612b2961515b565b60200260200101516000015161398f565b9050806060015187604001818151612b5291906158e0565b6bffffffffffffffffffffffff169052506040810151602088018051612b799083906158e0565b6bffffffffffffffffffffffff169052508751889083908110612b9e57612b9e61515b565b60200260200101516040015115158a604001518381518110612bc257612bc261515b565b60200260200101517fad8cc9579b21dfe2c2f6ea35ba15b656e46b4f5b0cb424f52739b8ce5cac9c5b83602001518460000151612bff91906158e0565b8b8681518110612c1157612c1161515b565b6020026020010151608001518d8f608001518881518110612c3457612c3461515b565b6020026020010151604051612c4c9493929190615905565b60405180910390a3505b80612c608161518a565b9150506129be565b505050602083810151336000908152600b90925260409091208054600290612ca59084906201000090046bffffffffffffffffffffffff166158e0565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508260400151601460000160008282829054906101000a90046bffffffffffffffffffffffff16612d0391906158e0565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555082604001518360200151612d4591906158e0565b6bffffffffffffffffffffffff16602160007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612dc1919061526f565b909155505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603612e4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c8c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e01000000000000000000000000000090049091166060820152906130c0576000816060015185612f5c9190615942565b90506000612f6a8583615967565b90508083604001818151612f7e91906158e0565b6bffffffffffffffffffffffff16905250612f998582615992565b83606001818151612faa91906158e0565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b60008260000182815481106130e3576130e361515b565b9060005260206000200154905092915050565b600081815260018301602052604081205480156131df57600061311a600183615113565b855490915060009061312e90600190615113565b905081811461319357600086600001828154811061314e5761314e61515b565b90600052602060002001549050808760000184815481106131715761317161515b565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806131a4576131a46159c2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611ecd565b6000915050611ecd565b5092915050565b600081815260018301602052604081205461323757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611ecd565b506000611ecd565b6000818160045b600f8110156132cc577fff0000000000000000000000000000000000000000000000000000000000000082168382602081106132845761328461515b565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146132ba57506000949350505050565b806132c48161518a565b915050613246565b5081600f1a60018111156132e2576132e26155d0565b949350505050565b600080808085606001516001811115613305576133056155d0565b0361332b576133178888888888613dfe565b613326576000925090506133ff565b6133a3565b600185606001516001811115613343576133436155d0565b0361337157600061335689898988613f88565b925090508061336b57506000925090506133ff565b506133a3565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84516060015163ffffffff1687106133f857877fc3237c8807c467c1b39b8d0395eff077313e691bf0a7388106792564ebfd5636876040516133e59190614c8d565b60405180910390a26000925090506133ff565b6001925090505b9550959350505050565b601454600090819077010000000000000000000000000000000000000000000000900460ff1615613466576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16770100000000000000000000000000000000000000000000001790556040517f4585e33b00000000000000000000000000000000000000000000000000000000906134db908590602401614c8d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d16906135ae90879087906004016159f1565b60408051808303816000875af11580156135cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f09190615a0a565b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b60008160600151600181111561363c5761363c6155d0565b036136a057600083815260046020526040902060010180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff851602179055505050565b6001816060015160018111156136b8576136b86155d0565b036137245760c08101805160009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055915191517fa4a4e334c0e330143f9437484fe516c13bc560b86b5b0daf58e7084aaac228f29190a25b505050565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613799573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137bd9190615a52565b509350509250506000821315806137d357508042105b8061380357506000846040015162ffffff1611801561380357506137f78142615113565b846040015162ffffff16105b156131e9575050601b5492915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa158015613900573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139249190615a52565b5093505092505060008213158061393a57508042105b8061396a57506000866040015162ffffff1611801561396a575061395e8142615113565b866040015162ffffff16105b1561397e5760018301546060850152613986565b606084018290525b50505092915050565b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201529082015115613a255760008381526023602090815260409182902082518084018452905463ffffffff811680835262ffffff640100000000909204821692840192835260e089018051909401529051915191169101525b6000613a318686614195565b60c0840151602082015182519293509091600091613a4e916158e0565b60e08801515190915060ff16600060128210613a6b576001613a81565b613a76826012615113565b613a8190600a615bc2565b9050600060128311613a94576001613aaa565b613a9f601284615113565b613aaa90600a615bc2565b905085600001516bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613b5257849350613b26818b60800151613aea9190615258565b838c60e0015160600151886bffffffffffffffffffffffff16613b0d9190615258565b613b179190615258565b613b2191906158cc565b6144c3565b6bffffffffffffffffffffffff9081166040880152600060608801819052602088015285168652613c78565b836bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613c7857849350613be086604001516bffffffffffffffffffffffff16828c60800151613b9f9190615258565b848d60e0015160600151896bffffffffffffffffffffffff16613bc29190615258565b613bcc9190615258565b613bd691906158cc565b613b219190615113565b6bffffffffffffffffffffffff1660608088019190915260e08b01510151613c6490613c0d908490615258565b6001848d60e0015160600151613c239190615258565b613c2d9190615113565b838d608001518a606001516bffffffffffffffffffffffff16613c509190615258565b613c5a9190615258565b613b17919061526f565b6bffffffffffffffffffffffff1660208701525b60008981526004602052604090206001018054859190601090613cbe90849070010000000000000000000000000000000090046bffffffffffffffffffffffff16615942565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b81526004602052604081206001018054928816935091613d199084906fffffffffffffffffffffffffffffffff16615bce565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836bffffffffffffffffffffffff16602160008c60c0015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613db09190615113565b92505081905550887f801ba6ed51146ffe3e99d1dbd9dd0f4de6292e78a9a34c39c0183de17b3f40fc87604051613de79190615bf7565b60405180910390a250939998505050505050505050565b60008084806020019051810190613e159190615cb7565b845160e00151815191925063ffffffff90811691161015613e7257867f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e886604051613e609190614c8d565b60405180910390a26000915050613f7f565b8260e001518015613f325750602081015115801590613f325750602081015161010084015182516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015613f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f2f9190614f06565b14155b80613f445750805163ffffffff168611155b15613f7957867f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc30186604051613e609190614c8d565b60019150505b95945050505050565b600080600084806020019051810190613fa19190615d0f565b905060008782600001518360200151846040015160405160200161400394939291909384526020840192909252604083015260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016606082015260640190565b6040516020818303038152906040528051906020012090508460e0015180156140de57506080820151158015906140de5750608082015161010086015160608401516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa1580156140b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140db9190614f06565b14155b806140f3575086826060015163ffffffff1610155b1561413d57877f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc301876040516141289190614c8d565b60405180910390a260009350915061418c9050565b60008181526008602052604090205460ff161561418457877f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e8876040516141289190614c8d565b600193509150505b94509492505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff1684606001516142009190615258565b905083610100015180156142135750803a105b1561421b57503a5b60006012831161422c576001614242565b614237601284615113565b61424290600a615bc2565b905060006012841061425557600161426b565b614260846012615113565b61426b90600a615bc2565b905060008660a0015187604001518860200151896000015161428d919061526f565b6142979087615258565b6142a1919061526f565b6142ab9190615258565b90506142ee828860e00151606001516142c49190615258565b6001848a60e00151606001516142da9190615258565b6142e49190615113565b613c5a8685615258565b6bffffffffffffffffffffffff168652608087015161431190613b2190836158cc565b6bffffffffffffffffffffffff1660408088019190915260e0880151015160009061434a9062ffffff16683635c9adc5dea00000615258565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b61437d9190615258565b614387919061526f565b6143919190615258565b61439b9190615258565b6143a591906158cc565b6143af919061526f565b90506143f2848a60e00151606001516143c89190615258565b6001868c60e00151606001516143de9190615258565b6143e89190615113565b613c5a8885615258565b6bffffffffffffffffffffffff166020890152608089015161441890613b2190836158cc565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a019190915289015161445b906144c3565b6bffffffffffffffffffffffff1660a0808a019190915289015161447e906144c3565b6bffffffffffffffffffffffff1660c089015260e0890151606001516144a3906144c3565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b60006bffffffffffffffffffffffff821115614561576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610c8c565b5090565b508054600082559060005260206000209081019061109c9190614605565b8280548282559060005260206000209081019282156145fd579160200282015b828111156145fd57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906145a3565b506145619291505b5b808211156145615760008155600101614606565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610200810167ffffffffffffffff8111828210171561466d5761466d61461a565b60405290565b60405160c0810167ffffffffffffffff8111828210171561466d5761466d61461a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156146dd576146dd61461a565b604052919050565b600067ffffffffffffffff8211156146ff576146ff61461a565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461109c57600080fd5b803561473681614709565b919050565b600082601f83011261474c57600080fd5b8135602061476161475c836146e5565b614696565b82815260059290921b8401810191818101908684111561478057600080fd5b8286015b848110156147a457803561479781614709565b8352918301918301614784565b509695505050505050565b60ff8116811461109c57600080fd5b8035614736816147af565b63ffffffff8116811461109c57600080fd5b8035614736816147c9565b801515811461109c57600080fd5b8035614736816147e6565b62ffffff8116811461109c57600080fd5b8035614736816147ff565b61ffff8116811461109c57600080fd5b80356147368161481b565b6000610200828403121561484957600080fd5b614851614649565b905061485c826147db565b815261486a602083016147db565b602082015261487b604083016147db565b604082015261488c6060830161472b565b606082015261489d608083016147f4565b60808201526148ae60a08301614810565b60a08201526148bf60c083016147db565b60c08201526148d060e083016147db565b60e08201526101006148e381840161472b565b908201526101206148f583820161482b565b9082015261014061490783820161472b565b90820152610160828101359082015261018080830135908201526101a080830135908201526101c08083013567ffffffffffffffff81111561494857600080fd5b6149548582860161473b565b8284015250506101e061496881840161472b565b9082015292915050565b803567ffffffffffffffff8116811461473657600080fd5b600082601f83011261499b57600080fd5b813567ffffffffffffffff8111156149b5576149b561461a565b6149e660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614696565b8181528460208386010111156149fb57600080fd5b816020850160208301376000918101602001919091529392505050565b6bffffffffffffffffffffffff8116811461109c57600080fd5b600082601f830112614a4357600080fd5b81356020614a5361475c836146e5565b82815260c09283028501820192828201919087851115614a7257600080fd5b8387015b85811015614b045781818a031215614a8e5760008081fd5b614a96614673565b8135614aa1816147c9565b815281860135614ab0816147ff565b81870152604082810135614ac381614709565b90820152606082810135614ad6816147af565b908201526080828101359082015260a080830135614af381614a18565b908201528452928401928101614a76565b5090979650505050505050565b600080600080600080600080610100898b031215614b2e57600080fd5b883567ffffffffffffffff80821115614b4657600080fd5b614b528c838d0161473b565b995060208b0135915080821115614b6857600080fd5b614b748c838d0161473b565b9850614b8260408c016147be565b975060608b0135915080821115614b9857600080fd5b614ba48c838d01614836565b9650614bb260808c01614972565b955060a08b0135915080821115614bc857600080fd5b614bd48c838d0161498a565b945060c08b0135915080821115614bea57600080fd5b614bf68c838d0161473b565b935060e08b0135915080821115614c0c57600080fd5b50614c198b828c01614a32565b9150509295985092959890939650565b6000815180845260005b81811015614c4f57602081850181015186830182015201614c33565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611edf6020830184614c29565b60008083601f840112614cb257600080fd5b50813567ffffffffffffffff811115614cca57600080fd5b6020830191508360208260051b8501011115614ce557600080fd5b9250929050565b60008060008060008060008060e0898b031215614d0857600080fd5b606089018a811115614d1957600080fd5b8998503567ffffffffffffffff80821115614d3357600080fd5b818b0191508b601f830112614d4757600080fd5b813581811115614d5657600080fd5b8c6020828501011115614d6857600080fd5b6020830199508098505060808b0135915080821115614d8657600080fd5b614d928c838d01614ca0565b909750955060a08b0135915080821115614dab57600080fd5b50614db88b828c01614ca0565b999c989b50969995989497949560c00135949350505050565b60008060008060008060c08789031215614dea57600080fd5b863567ffffffffffffffff80821115614e0257600080fd5b614e0e8a838b0161473b565b97506020890135915080821115614e2457600080fd5b614e308a838b0161473b565b9650614e3e60408a016147be565b95506060890135915080821115614e5457600080fd5b614e608a838b0161498a565b9450614e6e60808a01614972565b935060a0890135915080821115614e8457600080fd5b50614e9189828a0161498a565b9150509295509295509295565b600060208284031215614eb057600080fd5b8135611edf81614709565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff81811683821602908116908181146131e9576131e9614ebb565b600060208284031215614f1857600080fd5b5051919050565b63ffffffff8181168382160190808211156131e9576131e9614ebb565b600081518084526020808501945080840160005b83811015614f8257815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614f50565b509495945050505050565b60208152614fa460208201835163ffffffff169052565b60006020830151614fbd604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015173ffffffffffffffffffffffffffffffffffffffff8116608084015250608083015180151560a08401525060a083015162ffffff811660c08401525060c083015163ffffffff811660e08401525060e083015161010061503c8185018363ffffffff169052565b84015190506101206150658482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151905061014061507c8482018361ffff169052565b84015190506101606150a58482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610180848101919091528401516101a0808501919091528401516101c0808501919091528401516102006101e0808601829052919250906150ed610220860184614f3c565b95015173ffffffffffffffffffffffffffffffffffffffff169301929092525090919050565b81810381811115611ecd57611ecd614ebb565b60008161513557615135614ebb565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036151bb576151bb614ebb565b5060010190565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526151f28184018a614f3c565b905082810360808401526152068189614f3c565b905060ff871660a084015282810360c08401526152238187614c29565b905067ffffffffffffffff851660e08401528281036101008401526152488185614c29565b9c9b505050505050505050505050565b8082028115828204841417611ecd57611ecd614ebb565b80820180821115611ecd57611ecd614ebb565b60ff8181168382160190811115611ecd57611ecd614ebb565b8051614736816147c9565b805161473681614709565b8051614736816147e6565b8051614736816147ff565b80516147368161481b565b600082601f8301126152e357600080fd5b815160206152f361475c836146e5565b82815260059290921b8401810191818101908684111561531257600080fd5b8286015b848110156147a457805161532981614709565b8352918301918301615316565b600082601f83011261534757600080fd5b8151602061535761475c836146e5565b82815260c0928302850182019282820191908785111561537657600080fd5b8387015b85811015614b045781818a0312156153925760008081fd5b61539a614673565b81516153a5816147c9565b8152818601516153b4816147ff565b818701526040828101516153c781614709565b908201526060828101516153da816147af565b908201526080828101519082015260a0808301516153f781614a18565b90820152845292840192810161537a565b60008060006060848603121561541d57600080fd5b835167ffffffffffffffff8082111561543557600080fd5b90850190610200828803121561544a57600080fd5b615452614649565b61545b8361529b565b81526154696020840161529b565b602082015261547a6040840161529b565b604082015261548b606084016152a6565b606082015261549c608084016152b1565b60808201526154ad60a084016152bc565b60a08201526154be60c0840161529b565b60c08201526154cf60e0840161529b565b60e08201526101006154e28185016152a6565b908201526101206154f48482016152c7565b908201526101406155068482016152a6565b90820152610160838101519082015261018080840151908201526101a080840151908201526101c0808401518381111561553f57600080fd5b61554b8a8287016152d2565b8284015250506101e061555f8185016152a6565b90820152602087015190955091508082111561557a57600080fd5b615586878388016152d2565b9350604086015191508082111561559c57600080fd5b506155a986828701615336565b9150509250925092565b6000602082840312156155c557600080fd5b8151611edf816147af565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526156468285018b614f3c565b9150838203608085015261565a828a614f3c565b915060ff881660a085015283820360c08501526156778288614c29565b90861660e085015283810361010085015290506152488185614c29565b8183823760009101908152919050565b8281526080810160608360208401379392505050565b600082601f8301126156cb57600080fd5b813560206156db61475c836146e5565b82815260059290921b840181019181810190868411156156fa57600080fd5b8286015b848110156147a457803583529183019183016156fe565b600082601f83011261572657600080fd5b8135602061573661475c836146e5565b82815260059290921b8401810191818101908684111561575557600080fd5b8286015b848110156147a457803567ffffffffffffffff8111156157795760008081fd5b6157878986838b010161498a565b845250918301918301615759565b6000602082840312156157a757600080fd5b813567ffffffffffffffff808211156157bf57600080fd5b9083019060c082860312156157d357600080fd5b6157db614673565b82358152602083013560208201526040830135828111156157fb57600080fd5b615807878286016156ba565b60408301525060608301358281111561581f57600080fd5b61582b878286016156ba565b60608301525060808301358281111561584357600080fd5b61584f87828601615715565b60808301525060a08301358281111561586757600080fd5b61587387828601615715565b60a08301525095945050505050565b61ffff8181168382160190808211156131e9576131e9614ebb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826158db576158db61589d565b500490565b6bffffffffffffffffffffffff8181168382160190808211156131e9576131e9614ebb565b6bffffffffffffffffffffffff851681528360208201528260408201526080606082015260006159386080830184614c29565b9695505050505050565b6bffffffffffffffffffffffff8281168282160390808211156131e9576131e9614ebb565b60006bffffffffffffffffffffffff808416806159865761598661589d565b92169190910492915050565b6bffffffffffffffffffffffff8181168382160280821691908281146159ba576159ba614ebb565b505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b8281526040602082015260006132e26040830184614c29565b60008060408385031215615a1d57600080fd5b8251615a28816147e6565b6020939093015192949293505050565b805169ffffffffffffffffffff8116811461473657600080fd5b600080600080600060a08688031215615a6a57600080fd5b615a7386615a38565b9450602086015193506040860151925060608601519150615a9660808701615a38565b90509295509295909350565b600181815b80851115615afb57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615ae157615ae1614ebb565b80851615615aee57918102915b93841c9390800290615aa7565b509250929050565b600082615b1257506001611ecd565b81615b1f57506000611ecd565b8160018114615b355760028114615b3f57615b5b565b6001915050611ecd565b60ff841115615b5057615b50614ebb565b50506001821b611ecd565b5060208310610133831016604e8410600b8410161715615b7e575081810a611ecd565b615b888383615aa2565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615bba57615bba614ebb565b029392505050565b6000611edf8383615b03565b6fffffffffffffffffffffffffffffffff8181168382160190808211156131e9576131e9614ebb565b6000610100820190506bffffffffffffffffffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401525073ffffffffffffffffffffffffffffffffffffffff608084015116608083015260a0830151615c7760a08401826bffffffffffffffffffffffff169052565b5060c0830151615c9760c08401826bffffffffffffffffffffffff169052565b5060e08301516131e960e08401826bffffffffffffffffffffffff169052565b600060408284031215615cc957600080fd5b6040516040810181811067ffffffffffffffff82111715615cec57615cec61461a565b6040528251615cfa816147c9565b81526020928301519281019290925250919050565b600060a08284031215615d2157600080fd5b60405160a0810181811067ffffffffffffffff82111715615d4457615d4461461a565b806040525082518152602083015160208201526040830151615d65816147c9565b60408201526060830151615d78816147c9565b6060820152608092830151928101929092525091905056fea164736f6c6343000813000a", } var AutomationRegistryABI = AutomationRegistryMetaData.ABI diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index b10ad89f930..03ebf78995e 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -13,7 +13,7 @@ automation_registry_logic_b_wrapper_2_2: ../../contracts/solc/v0.8.19/Automation automation_registry_logic_b_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_3/AutomationRegistryLogicB2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_3/AutomationRegistryLogicB2_3.bin e628b4ba1ca8bf45c2b08c6b80f0b14efbd2dff13b85e5a9ebf643df32335ed2 automation_registry_logic_c_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicC2_3/AutomationRegistryLogicC2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicC2_3/AutomationRegistryLogicC2_3.bin 19d59318e42f28777756eff60d5c5e52563a2fffb8e3f0f0b07b6d36d82b2c55 automation_registry_wrapper_2_2: ../../contracts/solc/v0.8.19/AutomationRegistry2_2/AutomationRegistry2_2.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_2/AutomationRegistry2_2.bin 7072ba90159d84572f427ec816e78aa032cf907b39bf228185e0c446842f7c11 -automation_registry_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.bin b6163402434b84e3b66bc078f6efac121c1e1240dca0e8ea89c43db46b4e308b +automation_registry_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.bin 77ed34165d8623c4998dfdfb2ee74dcb395bbaa916e011a78ed1cbc98b24819e automation_utils_2_1: ../../contracts/solc/v0.8.16/AutomationUtils2_1/AutomationUtils2_1.abi ../../contracts/solc/v0.8.16/AutomationUtils2_1/AutomationUtils2_1.bin 815b17b63f15d26a0274b962eefad98cdee4ec897ead58688bbb8e2470e585f5 automation_utils_2_2: ../../contracts/solc/v0.8.19/AutomationUtils2_2/AutomationUtils2_2.abi ../../contracts/solc/v0.8.19/AutomationUtils2_2/AutomationUtils2_2.bin 8743f6231aaefa3f2a0b2d484258070d506e2d0860690e66890dccc3949edb2e automation_utils_2_3: ../../contracts/solc/v0.8.19/AutomationUtils2_3/AutomationUtils2_3.abi ../../contracts/solc/v0.8.19/AutomationUtils2_3/AutomationUtils2_3.bin 11e2b481dc9a4d936e3443345d45d2cc571164459d214917b42a8054b295393b From ac3a55f767154547fb1eecbc50b161bdae846b44 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:26:51 -0800 Subject: [PATCH 77/91] Improvement in naming changesets (#15943) * remove deployCCIPContracts * deprecate existing add lane * making OCR input more user friendly * rename changesets * fix lint errors * fix * further rename * populate addresses from state for 1.5 * move test related methods to test package * updates * more fix * create new package for test * another move * more fixes * fix lint * fix file path * fix file path * go mod tidy * review comments --- .github/integration-in-memory-tests.yml | 6 +- .../ccip/changeset/accept_ownership_test.go | 90 +----- .../changeset/cs_active_candidate_test.go | 86 +++--- deployment/ccip/changeset/cs_add_lane_test.go | 18 +- deployment/ccip/changeset/cs_ccip_home.go | 98 ++++--- .../ccip/changeset/cs_ccip_home_test.go | 153 ++++++----- .../ccip/changeset/cs_chain_contracts.go | 36 +-- .../ccip/changeset/cs_chain_contracts_test.go | 80 +++--- deployment/ccip/changeset/cs_deploy_chain.go | 8 +- .../ccip/changeset/cs_deploy_chain_test.go | 32 ++- deployment/ccip/changeset/cs_home_chain.go | 7 +- .../ccip/changeset/cs_home_chain_test.go | 44 +-- deployment/ccip/changeset/cs_jobspec.go | 6 +- deployment/ccip/changeset/cs_jobspec_test.go | 5 +- deployment/ccip/changeset/cs_prerequisites.go | 133 ++++++++- .../ccip/changeset/cs_prerequisites_test.go | 11 +- .../ccip/changeset/cs_rmn_curse_uncurse.go | 13 +- .../changeset/cs_rmn_curse_uncurse_test.go | 104 +++---- .../ccip/changeset/cs_update_rmn_config.go | 24 +- .../changeset/cs_update_rmn_config_test.go | 84 +++--- deployment/ccip/changeset/deployer_group.go | 20 +- .../ccip/changeset/deployer_group_test.go | 36 +-- .../ccip/changeset/save_existing_test.go | 15 +- deployment/ccip/changeset/state_test.go | 9 +- .../ccip/changeset/test_usdc_helpers.go | 260 ------------------ .../{ => testhelpers}/test_assertions.go | 50 +++- .../{ => testhelpers}/test_environment.go | 125 ++++----- .../{ => testhelpers}/test_helpers.go | 160 ++++++----- .../{ => testhelpers}/test_params.go | 2 +- .../testhelpers/test_usdc_helpers.go | 140 ++++++++++ .../{ => testhelpers}/v1_5/test_helpers.go | 58 ++-- deployment/ccip/changeset/token_info.go | 22 ++ deployment/ccip/changeset/v1_5/cs_jobspec.go | 4 +- .../ccip/changeset/v1_5/cs_lane_contracts.go | 25 +- .../ccip/changeset/v1_5/cs_ocr2_config.go | 6 +- deployment/ccip/changeset/v1_5/cs_rmn.go | 6 +- deployment/ccip/changeset/v1_5/e2e_test.go | 39 +-- deployment/ccip/changeset/view_test.go | 9 +- deployment/common/changeset/save_existing.go | 6 +- .../common/changeset/save_existing_test.go | 2 +- deployment/environment/crib/ccip_deployer.go | 36 +-- integration-tests/load/go.sum | 8 - .../smoke/ccip/ccip_batching_test.go | 43 +-- .../smoke/ccip/ccip_fee_boosting_test.go | 30 +- .../smoke/ccip/ccip_fees_test.go | 31 ++- .../smoke/ccip/ccip_gas_price_updates_test.go | 8 +- .../ccip/ccip_message_limitations_test.go | 29 +- .../smoke/ccip/ccip_messaging_test.go | 43 +-- .../ccip/ccip_migration_to_v_1_6_test.go | 102 +++---- .../smoke/ccip/ccip_ooo_execution_test.go | 81 +++--- .../ccip/ccip_reader_test.go} | 45 +-- integration-tests/smoke/ccip/ccip_rmn_test.go | 39 +-- .../ccip/ccip_token_price_updates_test.go | 8 +- .../smoke/ccip/ccip_token_transfer_test.go | 49 ++-- .../smoke/ccip/ccip_usdc_test.go | 59 ++-- .../testsetups/ccip/test_helpers.go | 39 +-- 56 files changed, 1404 insertions(+), 1278 deletions(-) delete mode 100644 deployment/ccip/changeset/test_usdc_helpers.go rename deployment/ccip/changeset/{ => testhelpers}/test_assertions.go (92%) rename deployment/ccip/changeset/{ => testhelpers}/test_environment.go (82%) rename deployment/ccip/changeset/{ => testhelpers}/test_helpers.go (89%) rename deployment/ccip/changeset/{ => testhelpers}/test_params.go (97%) create mode 100644 deployment/ccip/changeset/testhelpers/test_usdc_helpers.go rename deployment/ccip/changeset/{ => testhelpers}/v1_5/test_helpers.go (87%) rename integration-tests/{contracts/ccipreader_test.go => smoke/ccip/ccip_reader_test.go} (96%) diff --git a/.github/integration-in-memory-tests.yml b/.github/integration-in-memory-tests.yml index ef0bf95c596..01bb90044f4 100644 --- a/.github/integration-in-memory-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -55,13 +55,13 @@ runner-test-matrix: - PR Integration CCIP Tests test_cmd: cd integration-tests/smoke/ccip && go test ccip_batching_test.go -timeout 12m -test.parallel=2 -count=1 -json - - id: contracts/ccipreader_test.go:* - path: integration-tests/contracts/ccipreader_test.go + - id: smoke/ccip/ccip_reader_test.go:* + path: integration-tests/smoke/ccip/ccip_reader_test.go test_env_type: in-memory runs_on: ubuntu-latest triggers: - PR Integration CCIP Tests - test_cmd: cd integration-tests/contracts && go test ccipreader_test.go -timeout 5m -test.parallel=1 -count=1 -json + test_cmd: cd integration-tests/smoke/ccip && go test ccip_reader_test.go -timeout 5m -test.parallel=1 -count=1 -json - id: smoke/ccip/ccip_usdc_test.go:* path: integration-tests/smoke/ccip/ccip_usdc_test.go diff --git a/deployment/ccip/changeset/accept_ownership_test.go b/deployment/ccip/changeset/accept_ownership_test.go index dc3b0ba33b3..264be42cce1 100644 --- a/deployment/ccip/changeset/accept_ownership_test.go +++ b/deployment/ccip/changeset/accept_ownership_test.go @@ -1,21 +1,21 @@ -package changeset +package changeset_test import ( "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" "golang.org/x/exp/maps" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func Test_NewAcceptOwnershipChangeset(t *testing.T) { t.Parallel() - e, _ := NewMemoryEnvironment(t) - state, err := LoadOnchainState(e.Env) + e, _ := testhelpers.NewMemoryEnvironment(t) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) allChains := maps.Keys(e.Env.Chains) @@ -35,7 +35,7 @@ func Test_NewAcceptOwnershipChangeset(t *testing.T) { // at this point we have the initial deploys done, now we need to transfer ownership // to the timelock contract - state, err = LoadOnchainState(e.Env) + state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) // compose the transfer ownership and accept ownership changesets @@ -43,84 +43,10 @@ func Test_NewAcceptOwnershipChangeset(t *testing.T) { // note this doesn't have proposals. { Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), - Config: genTestTransferOwnershipConfig(e, allChains, state), + Config: testhelpers.GenTestTransferOwnershipConfig(e, allChains, state), }, }) require.NoError(t, err) - assertTimelockOwnership(t, e, allChains, state) -} - -func genTestTransferOwnershipConfig( - e DeployedEnv, - chains []uint64, - state CCIPOnChainState, -) commonchangeset.TransferToMCMSWithTimelockConfig { - var ( - timelocksPerChain = make(map[uint64]common.Address) - contracts = make(map[uint64][]common.Address) - ) - - // chain contracts - for _, chain := range chains { - timelocksPerChain[chain] = state.Chains[chain].Timelock.Address() - contracts[chain] = []common.Address{ - state.Chains[chain].OnRamp.Address(), - state.Chains[chain].OffRamp.Address(), - state.Chains[chain].FeeQuoter.Address(), - state.Chains[chain].NonceManager.Address(), - state.Chains[chain].RMNRemote.Address(), - state.Chains[chain].TestRouter.Address(), - state.Chains[chain].Router.Address(), - } - } - - // home chain - homeChainTimelockAddress := state.Chains[e.HomeChainSel].Timelock.Address() - timelocksPerChain[e.HomeChainSel] = homeChainTimelockAddress - contracts[e.HomeChainSel] = append(contracts[e.HomeChainSel], - state.Chains[e.HomeChainSel].CapabilityRegistry.Address(), - state.Chains[e.HomeChainSel].CCIPHome.Address(), - state.Chains[e.HomeChainSel].RMNHome.Address(), - ) - - return commonchangeset.TransferToMCMSWithTimelockConfig{ - ContractsByChain: contracts, - } -} - -// assertTimelockOwnership asserts that the ownership of the contracts has been transferred -// to the appropriate timelock contract on each chain. -func assertTimelockOwnership( - t *testing.T, - e DeployedEnv, - chains []uint64, - state CCIPOnChainState, -) { - // check that the ownership has been transferred correctly - for _, chain := range chains { - for _, contract := range []common.Address{ - state.Chains[chain].OnRamp.Address(), - state.Chains[chain].OffRamp.Address(), - state.Chains[chain].FeeQuoter.Address(), - state.Chains[chain].NonceManager.Address(), - state.Chains[chain].RMNRemote.Address(), - } { - owner, _, err := commonchangeset.LoadOwnableContract(contract, e.Env.Chains[chain].Client) - require.NoError(t, err) - require.Equal(t, state.Chains[chain].Timelock.Address(), owner) - } - } - - // check home chain contracts ownership - homeChainTimelockAddress := state.Chains[e.HomeChainSel].Timelock.Address() - for _, contract := range []common.Address{ - state.Chains[e.HomeChainSel].CapabilityRegistry.Address(), - state.Chains[e.HomeChainSel].CCIPHome.Address(), - state.Chains[e.HomeChainSel].RMNHome.Address(), - } { - owner, _, err := commonchangeset.LoadOwnableContract(contract, e.Env.Chains[e.HomeChainSel].Client) - require.NoError(t, err) - require.Equal(t, homeChainTimelockAddress, owner) - } + testhelpers.AssertTimelockOwnership(t, e, allChains, state) } diff --git a/deployment/ccip/changeset/cs_active_candidate_test.go b/deployment/ccip/changeset/cs_active_candidate_test.go index 7c50fbc77d0..a3a0505b950 100644 --- a/deployment/ccip/changeset/cs_active_candidate_test.go +++ b/deployment/ccip/changeset/cs_active_candidate_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "math/big" @@ -10,7 +10,9 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/stretchr/testify/require" @@ -26,10 +28,10 @@ func Test_ActiveCandidate(t *testing.T) { // We want to have the active instance execute a few messages // and then setup a candidate instance. The candidate instance // should not be able to transmit anything until we make it active. - tenv, _ := NewMemoryEnvironment(t, - WithChains(2), - WithNodes(4)) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, + testhelpers.WithNumOfChains(2), + testhelpers.WithNumOfNodes(4)) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) // Deploy to all chains. @@ -41,9 +43,9 @@ func Test_ActiveCandidate(t *testing.T) { sourceState := state.Chains[source] tenv.Env, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateOnRampsDests), - Config: UpdateOnRampDestsConfig{ - UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDestsChangeset), + Config: changeset.UpdateOnRampDestsConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{ source: { dest: { IsEnabled: true, @@ -54,35 +56,35 @@ func Test_ActiveCandidate(t *testing.T) { }, }, { - Changeset: commonchangeset.WrapChangeSet(UpdateFeeQuoterPricesCS), - Config: UpdateFeeQuoterPricesConfig{ - PricesByChain: map[uint64]FeeQuoterPriceUpdatePerSource{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterPricesChangeset), + Config: changeset.UpdateFeeQuoterPricesConfig{ + PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{ source: { TokenPrices: map[common.Address]*big.Int{ - sourceState.LinkToken.Address(): DefaultLinkPrice, - sourceState.Weth9.Address(): DefaultWethPrice, + sourceState.LinkToken.Address(): testhelpers.DefaultLinkPrice, + sourceState.Weth9.Address(): testhelpers.DefaultWethPrice, }, GasPrices: map[uint64]*big.Int{ - dest: DefaultGasPrice, + dest: testhelpers.DefaultGasPrice, }, }, }, }, }, { - Changeset: commonchangeset.WrapChangeSet(UpdateFeeQuoterDests), - Config: UpdateFeeQuoterDestsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterDestsChangeset), + Config: changeset.UpdateFeeQuoterDestsConfig{ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ source: { - dest: DefaultFeeQuoterDestChainConfig(), + dest: changeset.DefaultFeeQuoterDestChainConfig(), }, }, }, }, { - Changeset: commonchangeset.WrapChangeSet(UpdateOffRampSources), - Config: UpdateOffRampSourcesConfig{ - UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSourcesChangeset), + Config: changeset.UpdateOffRampSourcesConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{ dest: { source: { IsEnabled: true, @@ -92,9 +94,9 @@ func Test_ActiveCandidate(t *testing.T) { }, }, { - Changeset: commonchangeset.WrapChangeSet(UpdateRouterRamps), - Config: UpdateRouterRampsConfig{ - UpdatesByChain: map[uint64]RouterUpdates{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRampsChangeset), + Config: changeset.UpdateRouterRampsConfig{ + UpdatesByChain: map[uint64]changeset.RouterUpdates{ // onRamp update on source chain source: { OnRampUpdates: map[uint64]bool{ @@ -125,17 +127,17 @@ func Test_ActiveCandidate(t *testing.T) { _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), - Config: genTestTransferOwnershipConfig(tenv, allChains, state), + Config: testhelpers.GenTestTransferOwnershipConfig(tenv, allChains, state), }, }) require.NoError(t, err) - assertTimelockOwnership(t, tenv, allChains, state) + testhelpers.AssertTimelockOwnership(t, tenv, allChains, state) sendMsg := func() { latesthdr, err := tenv.Env.Chains[dest].Client.HeaderByNumber(testcontext.Get(t), nil) require.NoError(t, err) block := latesthdr.Number.Uint64() - msgSentEvent := TestSendRequest(t, tenv.Env, state, source, dest, false, router.ClientEVM2AnyMessage{ + msgSentEvent := testhelpers.TestSendRequest(t, tenv.Env, state, source, dest, false, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), Data: []byte("hello world"), TokenAmounts: nil, @@ -147,13 +149,13 @@ func Test_ActiveCandidate(t *testing.T) { startBlocks = map[uint64]*uint64{ dest: &block, } - expectedSeqNum = map[SourceDestPair]uint64{ + expectedSeqNum = map[testhelpers.SourceDestPair]uint64{ { SourceChainSelector: source, DestChainSelector: dest, }: msgSentEvent.SequenceNumber, } - expectedSeqNumExec = map[SourceDestPair][]uint64{ + expectedSeqNumExec = map[testhelpers.SourceDestPair][]uint64{ { SourceChainSelector: source, DestChainSelector: dest, @@ -162,8 +164,8 @@ func Test_ActiveCandidate(t *testing.T) { ) // Confirm execution of the message - ConfirmCommitForAllWithExpectedSeqNums(t, tenv.Env, state, expectedSeqNum, startBlocks) - ConfirmExecWithSeqNrsForAll(t, tenv.Env, state, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, tenv.Env, state, expectedSeqNum, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, tenv.Env, state, expectedSeqNumExec, startBlocks) } // send a message from source to dest and ensure that it gets executed @@ -188,30 +190,34 @@ func Test_ActiveCandidate(t *testing.T) { // Now we can add a candidate config, send another request, and observe behavior. // The candidate config should not be able to execute messages. - tokenConfig := NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) + tokenConfig := changeset.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetCandidateChangeset), + Config: changeset.SetCandidateChangesetConfig{ + SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, - MCMS: &MCMSConfig{ + MCMS: &changeset.MCMSConfig{ MinDelay: 0, }, }, - PluginInfo: []SetCandidatePluginInfo{ + PluginInfo: []changeset.SetCandidatePluginInfo{ { // NOTE: this is technically not a new chain, but needed for validation. - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, false), + OCRConfigPerRemoteChainSelector: map[uint64]changeset.CCIPOCRParams{ + dest: changeset.DeriveCCIPOCRParams( + changeset.WithDefaultCommitOffChainConfig(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9)), + ), }, PluginType: types.PluginTypeCCIPCommit, }, { // NOTE: this is technically not a new chain, but needed for validation. - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, false, true), + OCRConfigPerRemoteChainSelector: map[uint64]changeset.CCIPOCRParams{ + dest: changeset.DeriveCCIPOCRParams( + changeset.WithDefaultExecuteOffChainConfig(nil), + ), }, PluginType: types.PluginTypeCCIPExec, }, diff --git a/deployment/ccip/changeset/cs_add_lane_test.go b/deployment/ccip/changeset/cs_add_lane_test.go index 4b9f1f8641f..18f86d98a68 100644 --- a/deployment/ccip/changeset/cs_add_lane_test.go +++ b/deployment/ccip/changeset/cs_add_lane_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -8,37 +8,39 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) func TestAddLanesWithTestRouter(t *testing.T) { t.Parallel() - e, _ := NewMemoryEnvironment(t) + e, _ := testhelpers.NewMemoryEnvironment(t) // Here we have CR + nodes set up, but no CCIP contracts deployed. - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) selectors := e.Env.AllChainSelectors() chain1, chain2 := selectors[0], selectors[1] - AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, chain1, chain2, true) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, chain1, chain2, true) // Need to keep track of the block number for each chain so that event subscription can be done from that block. startBlocks := make(map[uint64]*uint64) // Send a message from each chain to every other chain. - expectedSeqNumExec := make(map[SourceDestPair][]uint64) + expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) latesthdr, err := e.Env.Chains[chain2].Client.HeaderByNumber(testcontext.Get(t), nil) require.NoError(t, err) block := latesthdr.Number.Uint64() startBlocks[chain2] = &block - msgSentEvent := TestSendRequest(t, e.Env, state, chain1, chain2, true, router.ClientEVM2AnyMessage{ + msgSentEvent := testhelpers.TestSendRequest(t, e.Env, state, chain1, chain2, true, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[chain2].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, FeeToken: common.HexToAddress("0x0"), ExtraArgs: nil, }) - expectedSeqNumExec[SourceDestPair{ + expectedSeqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: chain1, DestChainSelector: chain2, }] = []uint64{msgSentEvent.SequenceNumber} - ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) } diff --git a/deployment/ccip/changeset/cs_ccip_home.go b/deployment/ccip/changeset/cs_ccip_home.go index 12f488d1cfd..ef173e5ed07 100644 --- a/deployment/ccip/changeset/cs_ccip_home.go +++ b/deployment/ccip/changeset/cs_ccip_home.go @@ -39,7 +39,7 @@ var ( _ deployment.ChangeSet[PromoteCandidateChangesetConfig] = PromoteCandidateChangeset _ deployment.ChangeSet[SetCandidateChangesetConfig] = SetCandidateChangeset _ deployment.ChangeSet[RevokeCandidateChangesetConfig] = RevokeCandidateChangeset - _ deployment.ChangeSet[UpdateChainConfigConfig] = UpdateChainConfig + _ deployment.ChangeSet[UpdateChainConfigConfig] = UpdateChainConfigChangeset ) type tokenInfo interface { @@ -171,14 +171,66 @@ func (c CCIPOCRParams) Validate(selector uint64, feedChainSel uint64, state CCIP return nil } -// DefaultOCRParams returns the default OCR parameters for a chain, -// except for a few values which must be parameterized (passed as arguments). -func DefaultOCRParams( - feedChainSel uint64, - tokenInfo map[ccipocr3.UnknownEncodedAddress]pluginconfig.TokenInfo, - tokenDataObservers []pluginconfig.TokenDataObserverConfig, - commit bool, - exec bool, +type CCIPOCROpts func(params *CCIPOCRParams) + +// WithOCRParamOverride can be used if you want to override the default OCR parameters with your custom function. +func WithOCRParamOverride(override func(params *CCIPOCRParams)) CCIPOCROpts { + return func(params *CCIPOCRParams) { + if override != nil { + override(params) + } + } +} + +// WithDefaultCommitOffChainConfig can be used to add token info to the existing commit off-chain config. If no commit off-chain config is set, it will be created with default values. +func WithDefaultCommitOffChainConfig(feedChainSel uint64, tokenInfo map[ccipocr3.UnknownEncodedAddress]pluginconfig.TokenInfo) CCIPOCROpts { + return func(params *CCIPOCRParams) { + if params.CommitOffChainConfig == nil { + params.CommitOffChainConfig = &pluginconfig.CommitOffchainConfig{ + RemoteGasPriceBatchWriteFrequency: *config.MustNewDuration(internal.RemoteGasPriceBatchWriteFrequency), + TokenPriceBatchWriteFrequency: *config.MustNewDuration(internal.TokenPriceBatchWriteFrequency), + TokenInfo: tokenInfo, + PriceFeedChainSelector: ccipocr3.ChainSelector(feedChainSel), + NewMsgScanBatchSize: merklemulti.MaxNumberTreeLeaves, + MaxReportTransmissionCheckAttempts: 5, + RMNEnabled: os.Getenv("ENABLE_RMN") == "true", // only enabled in manual test + RMNSignaturesTimeout: 30 * time.Minute, + MaxMerkleTreeSize: merklemulti.MaxNumberTreeLeaves, + SignObservationPrefix: "chainlink ccip 1.6 rmn observation", + } + } else { + if params.CommitOffChainConfig.TokenInfo == nil { + params.CommitOffChainConfig.TokenInfo = make(map[ccipocr3.UnknownEncodedAddress]pluginconfig.TokenInfo) + } + for k, v := range tokenInfo { + params.CommitOffChainConfig.TokenInfo[k] = v + } + } + } +} + +// WithDefaultExecuteOffChainConfig can be used to add token data observers to the execute off-chain config. If no execute off-chain config is set, it will be created with default values. +func WithDefaultExecuteOffChainConfig(tokenDataObservers []pluginconfig.TokenDataObserverConfig) CCIPOCROpts { + return func(params *CCIPOCRParams) { + if params.ExecuteOffChainConfig == nil { + params.ExecuteOffChainConfig = &pluginconfig.ExecuteOffchainConfig{ + BatchGasLimit: internal.BatchGasLimit, + RelativeBoostPerWaitHour: internal.RelativeBoostPerWaitHour, + InflightCacheExpiry: *config.MustNewDuration(internal.InflightCacheExpiry), + RootSnoozeTime: *config.MustNewDuration(internal.RootSnoozeTime), + MessageVisibilityInterval: *config.MustNewDuration(internal.FirstBlockAge), + BatchingStrategyID: internal.BatchingStrategyID, + TokenDataObservers: tokenDataObservers, + } + } else if tokenDataObservers != nil { + params.ExecuteOffChainConfig.TokenDataObservers = append(params.ExecuteOffChainConfig.TokenDataObservers, tokenDataObservers...) + } + } +} + +// DeriveCCIPOCRParams derives the default OCR parameters for a chain, with the option to override them. +func DeriveCCIPOCRParams( + opts ...CCIPOCROpts, ) CCIPOCRParams { params := CCIPOCRParams{ OCRParameters: commontypes.OCRParameters{ @@ -196,30 +248,8 @@ func DefaultOCRParams( MaxDurationShouldTransmitAcceptedReport: internal.MaxDurationShouldTransmitAcceptedReport, }, } - if exec { - params.ExecuteOffChainConfig = &pluginconfig.ExecuteOffchainConfig{ - BatchGasLimit: internal.BatchGasLimit, - RelativeBoostPerWaitHour: internal.RelativeBoostPerWaitHour, - InflightCacheExpiry: *config.MustNewDuration(internal.InflightCacheExpiry), - RootSnoozeTime: *config.MustNewDuration(internal.RootSnoozeTime), - MessageVisibilityInterval: *config.MustNewDuration(internal.FirstBlockAge), - BatchingStrategyID: internal.BatchingStrategyID, - TokenDataObservers: tokenDataObservers, - } - } - if commit { - params.CommitOffChainConfig = &pluginconfig.CommitOffchainConfig{ - RemoteGasPriceBatchWriteFrequency: *config.MustNewDuration(internal.RemoteGasPriceBatchWriteFrequency), - TokenPriceBatchWriteFrequency: *config.MustNewDuration(internal.TokenPriceBatchWriteFrequency), - TokenInfo: tokenInfo, - PriceFeedChainSelector: ccipocr3.ChainSelector(feedChainSel), - NewMsgScanBatchSize: merklemulti.MaxNumberTreeLeaves, - MaxReportTransmissionCheckAttempts: 5, - RMNEnabled: os.Getenv("ENABLE_RMN") == "true", // only enabled in manual test - RMNSignaturesTimeout: 30 * time.Minute, - MaxMerkleTreeSize: merklemulti.MaxNumberTreeLeaves, - SignObservationPrefix: "chainlink ccip 1.6 rmn observation", - } + for _, opt := range opts { + opt(¶ms) } return params } @@ -1217,7 +1247,7 @@ func (c UpdateChainConfigConfig) Validate(e deployment.Environment) error { return nil } -func UpdateChainConfig(e deployment.Environment, cfg UpdateChainConfigConfig) (deployment.ChangesetOutput, error) { +func UpdateChainConfigChangeset(e deployment.Environment, cfg UpdateChainConfigConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("%w: %w", deployment.ErrInvalidConfig, err) } diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go index 96220477384..73fd921d503 100644 --- a/deployment/ccip/changeset/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/cs_ccip_home_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "math/big" @@ -15,7 +15,9 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -26,8 +28,8 @@ import ( ) func TestInvalidOCR3Params(t *testing.T) { - e, _ := NewMemoryEnvironment(t, - WithPrerequisiteDeployment(nil)) + e, _ := testhelpers.NewMemoryEnvironment(t, + testhelpers.WithPrerequisiteDeploymentOnly(nil)) chain1 := e.Env.AllChainSelectors()[0] envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) @@ -35,20 +37,20 @@ func TestInvalidOCR3Params(t *testing.T) { // no proposals to be made, timelock can be passed as nil here e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), - Config: DeployHomeChainConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChainChangeset), + Config: changeset.DeployHomeChainConfig{ HomeChainSel: e.HomeChainSel, - RMNDynamicConfig: NewTestRMNDynamicConfig(), - RMNStaticConfig: NewTestRMNStaticConfig(), - NodeOperators: NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ - TestNodeOperator: envNodes.NonBootstraps().PeerIDs(), + testhelpers.TestNodeOperator: envNodes.NonBootstraps().PeerIDs(), }, }, }, { - Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), - Config: DeployChainContractsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), + Config: changeset.DeployChainContractsConfig{ ChainSelectors: []uint64{chain1}, HomeChainSelector: e.HomeChainSel, }, @@ -56,11 +58,14 @@ func TestInvalidOCR3Params(t *testing.T) { }) require.NoError(t, err) - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) nodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) - params := DefaultOCRParams(e.FeedChainSel, nil, nil, true, true) + params := changeset.DeriveCCIPOCRParams( + changeset.WithDefaultCommitOffChainConfig(e.FeedChainSel, nil), + changeset.WithDefaultExecuteOffChainConfig(nil), + ) // tweak params to have invalid config // make DeltaRound greater than DeltaProgress params.OCRParameters.DeltaRound = params.OCRParameters.DeltaProgress + time.Duration(1) @@ -97,10 +102,10 @@ func Test_PromoteCandidate(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv, _ := NewMemoryEnvironment(t, - WithChains(2), - WithNodes(4)) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, + testhelpers.WithNumOfChains(2), + testhelpers.WithNumOfNodes(4)) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) // Deploy to all chains. @@ -132,9 +137,9 @@ func Test_PromoteCandidate(t *testing.T) { require.NoError(t, err) require.NotEqual(t, [32]byte{}, ActiveDigestExecBefore) - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } @@ -146,10 +151,10 @@ func Test_PromoteCandidate(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(PromoteCandidateChangeset), - Config: PromoteCandidateChangesetConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.PromoteCandidateChangeset), + Config: changeset.PromoteCandidateChangesetConfig{ HomeChainSelector: tenv.HomeChainSel, - PluginInfo: []PromoteCandidatePluginInfo{ + PluginInfo: []changeset.PromoteCandidatePluginInfo{ { RemoteChainSelectors: []uint64{dest}, PluginType: types.PluginTypeCCIPCommit, @@ -193,10 +198,10 @@ func Test_SetCandidate(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv, _ := NewMemoryEnvironment(t, - WithChains(2), - WithNodes(4)) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, + testhelpers.WithNumOfChains(2), + testhelpers.WithNumOfNodes(4)) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) // Deploy to all chains. @@ -227,13 +232,13 @@ func Test_SetCandidate(t *testing.T) { require.NoError(t, err) require.Equal(t, [32]byte{}, candidateDigestExecBefore) - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } - tokenConfig := NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) + tokenConfig := changeset.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) _, err = commonchangeset.ApplyChangesets(t, tenv.Env, map[uint64]*proposalutils.TimelockExecutionContracts{ tenv.HomeChainSel: { Timelock: state.Chains[tenv.HomeChainSel].Timelock, @@ -241,23 +246,27 @@ func Test_SetCandidate(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetCandidateChangeset), + Config: changeset.SetCandidateChangesetConfig{ + SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, MCMS: mcmsConfig, }, - PluginInfo: []SetCandidatePluginInfo{ + PluginInfo: []changeset.SetCandidatePluginInfo{ { - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, false), + OCRConfigPerRemoteChainSelector: map[uint64]changeset.CCIPOCRParams{ + dest: changeset.DeriveCCIPOCRParams( + changeset.WithDefaultCommitOffChainConfig(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9)), + ), }, PluginType: types.PluginTypeCCIPCommit, }, { - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, false, true), + OCRConfigPerRemoteChainSelector: map[uint64]changeset.CCIPOCRParams{ + dest: changeset.DeriveCCIPOCRParams( + changeset.WithDefaultExecuteOffChainConfig(nil), + ), }, PluginType: types.PluginTypeCCIPExec, }, @@ -302,10 +311,10 @@ func Test_RevokeCandidate(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv, _ := NewMemoryEnvironment(t, - WithChains(2), - WithNodes(4)) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, + testhelpers.WithNumOfChains(2), + testhelpers.WithNumOfNodes(4)) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) // Deploy to all chains. @@ -336,13 +345,13 @@ func Test_RevokeCandidate(t *testing.T) { require.NoError(t, err) require.Equal(t, [32]byte{}, candidateDigestExecBefore) - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } - tokenConfig := NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) + tokenConfig := changeset.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds) _, err = commonchangeset.ApplyChangesets(t, tenv.Env, map[uint64]*proposalutils.TimelockExecutionContracts{ tenv.HomeChainSel: { Timelock: state.Chains[tenv.HomeChainSel].Timelock, @@ -350,23 +359,27 @@ func Test_RevokeCandidate(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetCandidateChangeset), + Config: changeset.SetCandidateChangesetConfig{ + SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, MCMS: mcmsConfig, }, - PluginInfo: []SetCandidatePluginInfo{ + PluginInfo: []changeset.SetCandidatePluginInfo{ { - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, true), + OCRConfigPerRemoteChainSelector: map[uint64]changeset.CCIPOCRParams{ + dest: changeset.DeriveCCIPOCRParams( + changeset.WithDefaultCommitOffChainConfig(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9)), + ), }, PluginType: types.PluginTypeCCIPCommit, }, { - OCRConfigPerRemoteChainSelector: map[uint64]CCIPOCRParams{ - dest: DefaultOCRParams(tenv.FeedChainSel, tokenConfig.GetTokenInfo(logger.TestLogger(t), state.Chains[dest].LinkToken, state.Chains[dest].Weth9), nil, true, true), + OCRConfigPerRemoteChainSelector: map[uint64]changeset.CCIPOCRParams{ + dest: changeset.DeriveCCIPOCRParams( + changeset.WithDefaultExecuteOffChainConfig(nil), + ), }, PluginType: types.PluginTypeCCIPExec, }, @@ -400,8 +413,8 @@ func Test_RevokeCandidate(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(RevokeCandidateChangeset), - Config: RevokeCandidateChangesetConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.RevokeCandidateChangeset), + Config: changeset.RevokeCandidateChangesetConfig{ HomeChainSelector: tenv.HomeChainSel, RemoteChainSelector: dest, PluginType: types.PluginTypeCCIPCommit, @@ -409,8 +422,8 @@ func Test_RevokeCandidate(t *testing.T) { }, }, { - Changeset: commonchangeset.WrapChangeSet(RevokeCandidateChangeset), - Config: RevokeCandidateChangesetConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.RevokeCandidateChangeset), + Config: changeset.RevokeCandidateChangesetConfig{ HomeChainSelector: tenv.HomeChainSel, RemoteChainSelector: dest, PluginType: types.PluginTypeCCIPExec, @@ -438,8 +451,8 @@ func Test_RevokeCandidate(t *testing.T) { func transferToTimelock( t *testing.T, - tenv DeployedEnv, - state CCIPOnChainState, + tenv testhelpers.DeployedEnv, + state changeset.CCIPOnChainState, source, dest uint64) { // Transfer ownership to timelock so that we can promote the zero digest later down the line. @@ -459,11 +472,11 @@ func transferToTimelock( }, []commonchangeset.ChangesetApplication{ { Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), - Config: genTestTransferOwnershipConfig(tenv, []uint64{source, dest}, state), + Config: testhelpers.GenTestTransferOwnershipConfig(tenv, []uint64{source, dest}, state), }, }) require.NoError(t, err) - assertTimelockOwnership(t, tenv, []uint64{source, dest}, state) + testhelpers.AssertTimelockOwnership(t, tenv, []uint64{source, dest}, state) } func Test_UpdateChainConfigs(t *testing.T) { @@ -481,8 +494,8 @@ func Test_UpdateChainConfigs(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - tenv, _ := NewMemoryEnvironment(t, WithChains(3)) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) allChains := maps.Keys(tenv.Env.Chains) @@ -500,9 +513,9 @@ func Test_UpdateChainConfigs(t *testing.T) { require.NoError(t, err) assert.NotZero(t, otherChainConfig.FChain) - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } @@ -513,11 +526,11 @@ func Test_UpdateChainConfigs(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateChainConfig), - Config: UpdateChainConfigConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfigChangeset), + Config: changeset.UpdateChainConfigConfig{ HomeChainSelector: tenv.HomeChainSel, RemoteChainRemoves: []uint64{otherChain}, - RemoteChainAdds: make(map[uint64]ChainConfig), + RemoteChainAdds: make(map[uint64]changeset.ChainConfig), MCMS: mcmsConfig, }, }, @@ -537,11 +550,11 @@ func Test_UpdateChainConfigs(t *testing.T) { }, }, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateChainConfig), - Config: UpdateChainConfigConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfigChangeset), + Config: changeset.UpdateChainConfigConfig{ HomeChainSelector: tenv.HomeChainSel, RemoteChainRemoves: []uint64{}, - RemoteChainAdds: map[uint64]ChainConfig{ + RemoteChainAdds: map[uint64]changeset.ChainConfig{ otherChain: { EncodableChainConfig: chainconfig.ChainConfig{ GasPriceDeviationPPB: cciptypes.BigInt{Int: big.NewInt(internal.GasPriceDeviationPPB)}, diff --git a/deployment/ccip/changeset/cs_chain_contracts.go b/deployment/ccip/changeset/cs_chain_contracts.go index 8b50aa2fd3c..64e7ca295d7 100644 --- a/deployment/ccip/changeset/cs_chain_contracts.go +++ b/deployment/ccip/changeset/cs_chain_contracts.go @@ -31,13 +31,13 @@ import ( ) var ( - _ deployment.ChangeSet[UpdateOnRampDestsConfig] = UpdateOnRampsDests - _ deployment.ChangeSet[UpdateOffRampSourcesConfig] = UpdateOffRampSources - _ deployment.ChangeSet[UpdateRouterRampsConfig] = UpdateRouterRamps - _ deployment.ChangeSet[UpdateFeeQuoterDestsConfig] = UpdateFeeQuoterDests - _ deployment.ChangeSet[SetOCR3OffRampConfig] = SetOCR3OffRamp - _ deployment.ChangeSet[UpdateFeeQuoterPricesConfig] = UpdateFeeQuoterPricesCS - _ deployment.ChangeSet[UpdateNonceManagerConfig] = UpdateNonceManagersCS + _ deployment.ChangeSet[UpdateOnRampDestsConfig] = UpdateOnRampsDestsChangeset + _ deployment.ChangeSet[UpdateOffRampSourcesConfig] = UpdateOffRampSourcesChangeset + _ deployment.ChangeSet[UpdateRouterRampsConfig] = UpdateRouterRampsChangeset + _ deployment.ChangeSet[UpdateFeeQuoterDestsConfig] = UpdateFeeQuoterDestsChangeset + _ deployment.ChangeSet[SetOCR3OffRampConfig] = SetOCR3OffRampChangeset + _ deployment.ChangeSet[UpdateFeeQuoterPricesConfig] = UpdateFeeQuoterPricesChangeset + _ deployment.ChangeSet[UpdateNonceManagerConfig] = UpdateNonceManagersChangeset ) type UpdateNonceManagerConfig struct { @@ -107,7 +107,7 @@ func (cfg UpdateNonceManagerConfig) Validate(e deployment.Environment) error { return nil } -func UpdateNonceManagersCS(e deployment.Environment, cfg UpdateNonceManagerConfig) (deployment.ChangesetOutput, error) { +func UpdateNonceManagersChangeset(e deployment.Environment, cfg UpdateNonceManagerConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } @@ -272,10 +272,10 @@ func (cfg UpdateOnRampDestsConfig) Validate(e deployment.Environment) error { return nil } -// UpdateOnRampsDests updates the onramp destinations for each onramp +// UpdateOnRampsDestsChangeset updates the onramp destinations for each onramp // in the chains specified. Multichain support is important - consider when we add a new chain // and need to update the onramp destinations for all chains to support the new chain. -func UpdateOnRampsDests(e deployment.Environment, cfg UpdateOnRampDestsConfig) (deployment.ChangesetOutput, error) { +func UpdateOnRampsDestsChangeset(e deployment.Environment, cfg UpdateOnRampDestsConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } @@ -437,7 +437,7 @@ func (cfg UpdateFeeQuoterPricesConfig) Validate(e deployment.Environment) error return nil } -func UpdateFeeQuoterPricesCS(e deployment.Environment, cfg UpdateFeeQuoterPricesConfig) (deployment.ChangesetOutput, error) { +func UpdateFeeQuoterPricesChangeset(e deployment.Environment, cfg UpdateFeeQuoterPricesConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } @@ -559,7 +559,7 @@ func (cfg UpdateFeeQuoterDestsConfig) Validate(e deployment.Environment) error { return nil } -func UpdateFeeQuoterDests(e deployment.Environment, cfg UpdateFeeQuoterDestsConfig) (deployment.ChangesetOutput, error) { +func UpdateFeeQuoterDestsChangeset(e deployment.Environment, cfg UpdateFeeQuoterDestsConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } @@ -680,8 +680,8 @@ func (cfg UpdateOffRampSourcesConfig) Validate(e deployment.Environment) error { return nil } -// UpdateOffRampSources updates the offramp sources for each offramp. -func UpdateOffRampSources(e deployment.Environment, cfg UpdateOffRampSourcesConfig) (deployment.ChangesetOutput, error) { +// UpdateOffRampSourcesChangeset updates the offramp sources for each offramp. +func UpdateOffRampSourcesChangeset(e deployment.Environment, cfg UpdateOffRampSourcesConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } @@ -834,14 +834,14 @@ func (cfg UpdateRouterRampsConfig) Validate(e deployment.Environment) error { return nil } -// UpdateRouterRamps updates the on/offramps +// UpdateRouterRampsChangeset updates the on/offramps // in either the router or test router for a series of chains. Use cases include: // - Ramp upgrade. After deploying new ramps you can enable them on the test router and // ensure it works e2e. Then enable the ramps on the real router. // - New chain support. When adding a new chain, you can enable the new destination // on all chains to support the new chain through the test router first. Once tested, // Enable the new destination on the real router. -func UpdateRouterRamps(e deployment.Environment, cfg UpdateRouterRampsConfig) (deployment.ChangesetOutput, error) { +func UpdateRouterRampsChangeset(e deployment.Environment, cfg UpdateRouterRampsConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } @@ -964,13 +964,13 @@ func (c SetOCR3OffRampConfig) Validate(e deployment.Environment) error { return nil } -// SetOCR3OffRamp will set the OCR3 offramp for the given chain. +// SetOCR3OffRampChangeset will set the OCR3 offramp for the given chain. // to the active configuration on CCIPHome. This // is used to complete the candidate->active promotion cycle, it's // run after the candidate is confirmed to be working correctly. // Multichain is especially helpful for NOP rotations where we have // to touch all the chain to change signers. -func SetOCR3OffRamp(e deployment.Environment, cfg SetOCR3OffRampConfig) (deployment.ChangesetOutput, error) { +func SetOCR3OffRampChangeset(e deployment.Environment, cfg SetOCR3OffRampConfig) (deployment.ChangesetOutput, error) { if err := cfg.Validate(e); err != nil { return deployment.ChangesetOutput{}, err } diff --git a/deployment/ccip/changeset/cs_chain_contracts_test.go b/deployment/ccip/changeset/cs_chain_contracts_test.go index 544362a1b1e..7b7f420e531 100644 --- a/deployment/ccip/changeset/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/cs_chain_contracts_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -10,6 +10,8 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" ) @@ -32,8 +34,8 @@ func TestUpdateOnRampsDests(t *testing.T) { ctx := testcontext.Get(t) // Default env just has 2 chains with all contracts // deployed but no lanes. - tenv, _ := NewMemoryEnvironment(t) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) allChains := maps.Keys(tenv.Env.Chains) @@ -45,17 +47,17 @@ func TestUpdateOnRampsDests(t *testing.T) { transferToTimelock(t, tenv, state, source, dest) } - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateOnRampsDests), - Config: UpdateOnRampDestsConfig{ - UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDestsChangeset), + Config: changeset.UpdateOnRampDestsConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{ source: { dest: { IsEnabled: true, @@ -106,8 +108,8 @@ func TestUpdateOffRampsSources(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv, _ := NewMemoryEnvironment(t) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) allChains := maps.Keys(tenv.Env.Chains) @@ -119,17 +121,17 @@ func TestUpdateOffRampsSources(t *testing.T) { transferToTimelock(t, tenv, state, source, dest) } - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateOffRampSources), - Config: UpdateOffRampSourcesConfig{ - UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSourcesChangeset), + Config: changeset.UpdateOffRampSourcesConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{ source: { dest: { IsEnabled: true, @@ -176,8 +178,8 @@ func TestUpdateFQDests(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv, _ := NewMemoryEnvironment(t) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) allChains := maps.Keys(tenv.Env.Chains) @@ -189,20 +191,20 @@ func TestUpdateFQDests(t *testing.T) { transferToTimelock(t, tenv, state, source, dest) } - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } - fqCfg1 := DefaultFeeQuoterDestChainConfig() - fqCfg2 := DefaultFeeQuoterDestChainConfig() + fqCfg1 := changeset.DefaultFeeQuoterDestChainConfig() + fqCfg2 := changeset.DefaultFeeQuoterDestChainConfig() fqCfg2.DestGasOverhead = 1000 _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateFeeQuoterDests), - Config: UpdateFeeQuoterDestsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterDestsChangeset), + Config: changeset.UpdateFeeQuoterDestsConfig{ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ source: { dest: fqCfg1, @@ -220,10 +222,10 @@ func TestUpdateFQDests(t *testing.T) { // Assert the fq configuration is as we expect. source2destCfg, err := state.Chains[source].FeeQuoter.GetDestChainConfig(&bind.CallOpts{Context: ctx}, dest) require.NoError(t, err) - AssertEqualFeeConfig(t, fqCfg1, source2destCfg) + testhelpers.AssertEqualFeeConfig(t, fqCfg1, source2destCfg) dest2sourceCfg, err := state.Chains[dest].FeeQuoter.GetDestChainConfig(&bind.CallOpts{Context: ctx}, source) require.NoError(t, err) - AssertEqualFeeConfig(t, fqCfg2, dest2sourceCfg) + testhelpers.AssertEqualFeeConfig(t, fqCfg2, dest2sourceCfg) }) } } @@ -244,8 +246,8 @@ func TestUpdateRouterRamps(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := testcontext.Get(t) - tenv, _ := NewMemoryEnvironment(t) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) allChains := maps.Keys(tenv.Env.Chains) @@ -257,9 +259,9 @@ func TestUpdateRouterRamps(t *testing.T) { transferToTimelock(t, tenv, state, source, dest) } - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } @@ -267,10 +269,10 @@ func TestUpdateRouterRamps(t *testing.T) { // Updates test router. _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateRouterRamps), - Config: UpdateRouterRampsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRampsChangeset), + Config: changeset.UpdateRouterRampsConfig{ TestRouter: true, - UpdatesByChain: map[uint64]RouterUpdates{ + UpdatesByChain: map[uint64]changeset.RouterUpdates{ source: { OffRampUpdates: map[uint64]bool{ dest: true, @@ -320,8 +322,8 @@ func TestUpdateNonceManagersCS(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - tenv, _ := NewMemoryEnvironment(t) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) allChains := maps.Keys(tenv.Env.Chains) @@ -333,18 +335,18 @@ func TestUpdateNonceManagersCS(t *testing.T) { transferToTimelock(t, tenv, state, source, dest) } - var mcmsConfig *MCMSConfig + var mcmsConfig *changeset.MCMSConfig if tc.mcmsEnabled { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(UpdateNonceManagersCS), - Config: UpdateNonceManagerConfig{ - UpdatesByChain: map[uint64]NonceManagerUpdate{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateNonceManagersChangeset), + Config: changeset.UpdateNonceManagerConfig{ + UpdatesByChain: map[uint64]changeset.NonceManagerUpdate{ source: { RemovedAuthCallers: []common.Address{state.Chains[source].OnRamp.Address()}, }, diff --git a/deployment/ccip/changeset/cs_deploy_chain.go b/deployment/ccip/changeset/cs_deploy_chain.go index 175498ba2cf..0cdc2327ca3 100644 --- a/deployment/ccip/changeset/cs_deploy_chain.go +++ b/deployment/ccip/changeset/cs_deploy_chain.go @@ -23,18 +23,18 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) -var _ deployment.ChangeSet[DeployChainContractsConfig] = DeployChainContracts +var _ deployment.ChangeSet[DeployChainContractsConfig] = DeployChainContractsChangeset -// DeployChainContracts deploys all new CCIP v1.6 or later contracts for the given chains. +// DeployChainContractsChangeset deploys all new CCIP v1.6 or later contracts for the given chains. // It returns the new addresses for the contracts. -// DeployChainContracts is idempotent. If there is an error, it will return the successfully deployed addresses and the error so that the caller can call the +// DeployChainContractsChangeset is idempotent. If there is an error, it will return the successfully deployed addresses and the error so that the caller can call the // changeset again with the same input to retry the failed deployment. // Caller should update the environment's address book with the returned addresses. // Points to note : // In case of migrating from legacy ccip to 1.6, the previous RMN address should be set while deploying RMNRemote. // if there is no existing RMN address found, RMNRemote will be deployed with 0x0 address for previous RMN address // which will set RMN to 0x0 address immutably in RMNRemote. -func DeployChainContracts(env deployment.Environment, c DeployChainContractsConfig) (deployment.ChangesetOutput, error) { +func DeployChainContractsChangeset(env deployment.Environment, c DeployChainContractsConfig) (deployment.ChangesetOutput, error) { if err := c.Validate(); err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("invalid DeployChainContractsConfig: %w", err) } diff --git a/deployment/ccip/changeset/cs_deploy_chain_test.go b/deployment/ccip/changeset/cs_deploy_chain_test.go index 1f77be3ca5a..c579b075b70 100644 --- a/deployment/ccip/changeset/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/cs_deploy_chain_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "encoding/json" @@ -9,6 +9,8 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" @@ -33,20 +35,20 @@ func TestDeployChainContractsChangeset(t *testing.T) { for _, chain := range e.AllChainSelectors() { cfg[chain] = proposalutils.SingleGroupTimelockConfig(t) } - var prereqCfg []DeployPrerequisiteConfigPerChain + prereqCfg := make([]changeset.DeployPrerequisiteConfigPerChain, 0) for _, chain := range e.AllChainSelectors() { - prereqCfg = append(prereqCfg, DeployPrerequisiteConfigPerChain{ + prereqCfg = append(prereqCfg, changeset.DeployPrerequisiteConfigPerChain{ ChainSelector: chain, }) } e, err = commonchangeset.ApplyChangesets(t, e, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), - Config: DeployHomeChainConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChainChangeset), + Config: changeset.DeployHomeChainConfig{ HomeChainSel: homeChainSel, - RMNStaticConfig: NewTestRMNStaticConfig(), - RMNDynamicConfig: NewTestRMNDynamicConfig(), - NodeOperators: NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ "NodeOperator": p2pIds, }, @@ -61,14 +63,14 @@ func TestDeployChainContractsChangeset(t *testing.T) { Config: cfg, }, { - Changeset: commonchangeset.WrapChangeSet(DeployPrerequisites), - Config: DeployPrerequisiteConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployPrerequisitesChangeset), + Config: changeset.DeployPrerequisiteConfig{ Configs: prereqCfg, }, }, { - Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), - Config: DeployChainContractsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), + Config: changeset.DeployChainContractsConfig{ ChainSelectors: selectors, HomeChainSelector: homeChainSel, }, @@ -77,7 +79,7 @@ func TestDeployChainContractsChangeset(t *testing.T) { require.NoError(t, err) // load onchain state - state, err := LoadOnchainState(e) + state, err := changeset.LoadOnchainState(e) require.NoError(t, err) // verify all contracts populated @@ -101,9 +103,9 @@ func TestDeployChainContractsChangeset(t *testing.T) { func TestDeployCCIPContracts(t *testing.T) { t.Parallel() - e, _ := NewMemoryEnvironment(t) + e, _ := testhelpers.NewMemoryEnvironment(t) // Deploy all the CCIP contracts. - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) snap, err := state.View(e.Env.AllChainSelectors()) require.NoError(t, err) diff --git a/deployment/ccip/changeset/cs_home_chain.go b/deployment/ccip/changeset/cs_home_chain.go index 3b985f5c526..cc234a45e49 100644 --- a/deployment/ccip/changeset/cs_home_chain.go +++ b/deployment/ccip/changeset/cs_home_chain.go @@ -16,6 +16,7 @@ import ( "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment" @@ -26,10 +27,10 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) -var _ deployment.ChangeSet[DeployHomeChainConfig] = DeployHomeChain +var _ deployment.ChangeSet[DeployHomeChainConfig] = DeployHomeChainChangeset -// DeployHomeChain is a separate changeset because it is a standalone deployment performed once in home chain for the entire CCIP deployment. -func DeployHomeChain(env deployment.Environment, cfg DeployHomeChainConfig) (deployment.ChangesetOutput, error) { +// DeployHomeChainChangeset is a separate changeset because it is a standalone deployment performed once in home chain for the entire CCIP deployment. +func DeployHomeChainChangeset(env deployment.Environment, cfg DeployHomeChainConfig) (deployment.ChangesetOutput, error) { err := cfg.Validate() if err != nil { return deployment.ChangesetOutput{}, errors.Wrapf(deployment.ErrInvalidConfig, "%v", err) diff --git a/deployment/ccip/changeset/cs_home_chain_test.go b/deployment/ccip/changeset/cs_home_chain_test.go index 135e60f4eb1..0dbdb866d9b 100644 --- a/deployment/ccip/changeset/cs_home_chain_test.go +++ b/deployment/ccip/changeset/cs_home_chain_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -8,6 +8,8 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" @@ -27,19 +29,19 @@ func TestDeployHomeChain(t *testing.T) { nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) require.NoError(t, err) p2pIds := nodes.NonBootstraps().PeerIDs() - homeChainCfg := DeployHomeChainConfig{ + homeChainCfg := changeset.DeployHomeChainConfig{ HomeChainSel: homeChainSel, - RMNStaticConfig: NewTestRMNStaticConfig(), - RMNDynamicConfig: NewTestRMNDynamicConfig(), - NodeOperators: NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ "NodeOperator": p2pIds, }, } - output, err := DeployHomeChain(e, homeChainCfg) + output, err := changeset.DeployHomeChainChangeset(e, homeChainCfg) require.NoError(t, err) require.NoError(t, e.ExistingAddresses.Merge(output.AddressBook)) - state, err := LoadOnchainState(e) + state, err := changeset.LoadOnchainState(e) require.NoError(t, err) require.NotNil(t, state.Chains[homeChainSel].CapabilityRegistry) require.NotNil(t, state.Chains[homeChainSel].CCIPHome) @@ -62,18 +64,18 @@ func TestDeployHomeChain(t *testing.T) { } func TestRemoveDonsValidate(t *testing.T) { - e, _ := NewMemoryEnvironment(t) - s, err := LoadOnchainState(e.Env) + e, _ := testhelpers.NewMemoryEnvironment(t) + s, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) homeChain := s.Chains[e.HomeChainSel] var tt = []struct { name string - config RemoveDONsConfig + config changeset.RemoveDONsConfig expectErr bool }{ { name: "invalid home", - config: RemoveDONsConfig{ + config: changeset.RemoveDONsConfig{ HomeChainSel: 0, DonIDs: []uint32{1}, }, @@ -81,7 +83,7 @@ func TestRemoveDonsValidate(t *testing.T) { }, { name: "invalid dons", - config: RemoveDONsConfig{ + config: changeset.RemoveDONsConfig{ HomeChainSel: e.HomeChainSel, DonIDs: []uint32{1377}, }, @@ -89,7 +91,7 @@ func TestRemoveDonsValidate(t *testing.T) { }, { name: "no dons", - config: RemoveDONsConfig{ + config: changeset.RemoveDONsConfig{ HomeChainSel: e.HomeChainSel, DonIDs: []uint32{}, }, @@ -97,7 +99,7 @@ func TestRemoveDonsValidate(t *testing.T) { }, { name: "success", - config: RemoveDONsConfig{ + config: changeset.RemoveDONsConfig{ HomeChainSel: e.HomeChainSel, DonIDs: []uint32{1}, }, @@ -117,8 +119,8 @@ func TestRemoveDonsValidate(t *testing.T) { } func TestRemoveDons(t *testing.T) { - e, _ := NewMemoryEnvironment(t) - s, err := LoadOnchainState(e.Env) + e, _ := testhelpers.NewMemoryEnvironment(t) + s, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) homeChain := s.Chains[e.HomeChainSel] @@ -127,8 +129,8 @@ func TestRemoveDons(t *testing.T) { require.NoError(t, err) e.Env, err = commoncs.ApplyChangesets(t, e.Env, nil, []commoncs.ChangesetApplication{ { - Changeset: commoncs.WrapChangeSet(RemoveDONs), - Config: RemoveDONsConfig{ + Changeset: commoncs.WrapChangeSet(changeset.RemoveDONs), + Config: changeset.RemoveDONsConfig{ HomeChainSel: e.HomeChainSel, DonIDs: []uint32{donsBefore[0].Id}, }, @@ -158,11 +160,11 @@ func TestRemoveDons(t *testing.T) { }, }, { - Changeset: commoncs.WrapChangeSet(RemoveDONs), - Config: RemoveDONsConfig{ + Changeset: commoncs.WrapChangeSet(changeset.RemoveDONs), + Config: changeset.RemoveDONsConfig{ HomeChainSel: e.HomeChainSel, DonIDs: []uint32{donsBefore[0].Id}, - MCMS: &MCMSConfig{MinDelay: 0}, + MCMS: &changeset.MCMSConfig{MinDelay: 0}, }, }, }) diff --git a/deployment/ccip/changeset/cs_jobspec.go b/deployment/ccip/changeset/cs_jobspec.go index 2551f193f47..e29578a516a 100644 --- a/deployment/ccip/changeset/cs_jobspec.go +++ b/deployment/ccip/changeset/cs_jobspec.go @@ -9,11 +9,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay" ) -var _ deployment.ChangeSet[any] = CCIPCapabilityJobspec +var _ deployment.ChangeSet[any] = CCIPCapabilityJobspecChangeset -// CCIPCapabilityJobspec returns the job specs for the CCIP capability. +// CCIPCapabilityJobspecChangeset returns the job specs for the CCIP capability. // The caller needs to propose these job specs to the offchain system. -func CCIPCapabilityJobspec(env deployment.Environment, _ any) (deployment.ChangesetOutput, error) { +func CCIPCapabilityJobspecChangeset(env deployment.Environment, _ any) (deployment.ChangesetOutput, error) { nodes, err := deployment.NodeInfo(env.NodeIDs, env.Offchain) if err != nil { return deployment.ChangesetOutput{}, err diff --git a/deployment/ccip/changeset/cs_jobspec_test.go b/deployment/ccip/changeset/cs_jobspec_test.go index a0445b0d5ee..b79dfc47387 100644 --- a/deployment/ccip/changeset/cs_jobspec_test.go +++ b/deployment/ccip/changeset/cs_jobspec_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -7,6 +7,7 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/environment/memory" ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -19,7 +20,7 @@ func TestJobSpecChangeset(t *testing.T) { Chains: 1, Nodes: 4, }) - output, err := CCIPCapabilityJobspec(e, nil) + output, err := changeset.CCIPCapabilityJobspecChangeset(e, nil) require.NoError(t, err) require.NotNil(t, output.JobSpecs) nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) diff --git a/deployment/ccip/changeset/cs_prerequisites.go b/deployment/ccip/changeset/cs_prerequisites.go index 33db57cdc91..da4f59c3eb6 100644 --- a/deployment/ccip/changeset/cs_prerequisites.go +++ b/deployment/ccip/changeset/cs_prerequisites.go @@ -2,34 +2,41 @@ package changeset import ( "fmt" + "math/big" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "golang.org/x/sync/errgroup" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_messenger" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/registry_module_owner_custom" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/multicall3" ) var ( - _ deployment.ChangeSet[DeployPrerequisiteConfig] = DeployPrerequisites + _ deployment.ChangeSet[DeployPrerequisiteConfig] = DeployPrerequisitesChangeset ) -// DeployPrerequisites deploys the pre-requisite contracts for CCIP +// DeployPrerequisitesChangeset deploys the pre-requisite contracts for CCIP // pre-requisite contracts are the contracts which can be reused from previous versions of CCIP // Or the contracts which are already deployed on the chain ( for example, tokens, feeds, etc) // Caller should update the environment's address book with the returned addresses. -func DeployPrerequisites(env deployment.Environment, cfg DeployPrerequisiteConfig) (deployment.ChangesetOutput, error) { +func DeployPrerequisitesChangeset(env deployment.Environment, cfg DeployPrerequisiteConfig) (deployment.ChangesetOutput, error) { err := cfg.Validate() if err != nil { return deployment.ChangesetOutput{}, errors.Wrapf(deployment.ErrInvalidConfig, "%v", err) @@ -236,7 +243,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address if rmnOwner != chain.DeployerKey.From { lggr.Warnw( "RMNProxy is not owned by the deployer and RMNProxy is not pointing to the correct RMN contract, "+ - "run SetRMNRemoteOnRMNProxy to update RMN with a proposal", + "run SetRMNRemoteOnRMNProxyChangeset to update RMN with a proposal", "chain", chain.String(), "owner", rmnOwner, "currentRMN", currentRMNAddr, "expectedRMN", rmnAddr) } else { tx, err := rmnProxy.SetARM(chain.DeployerKey, rmnAddr) @@ -373,7 +380,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address } } if deployOpts.USDCEnabled { - token, pool, messenger, transmitter, err1 := DeployUSDC(e.Logger, chain, ab, rmnProxy.Address(), r.Address()) + token, pool, messenger, transmitter, err1 := deployUSDC(e.Logger, chain, ab, rmnProxy.Address(), r.Address()) if err1 != nil { return err1 } @@ -435,3 +442,119 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address } return nil } + +func deployUSDC( + lggr logger.Logger, + chain deployment.Chain, + addresses deployment.AddressBook, + rmnProxy common.Address, + router common.Address, +) ( + *burn_mint_erc677.BurnMintERC677, + *usdc_token_pool.USDCTokenPool, + *mock_usdc_token_messenger.MockE2EUSDCTokenMessenger, + *mock_usdc_token_transmitter.MockE2EUSDCTransmitter, + error, +) { + token, err := deployment.DeployContract(lggr, chain, addresses, + func(chain deployment.Chain) deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677] { + tokenAddress, tx, tokenContract, err2 := burn_mint_erc677.DeployBurnMintERC677( + chain.DeployerKey, + chain.Client, + USDCName, + string(USDCSymbol), + UsdcDecimals, + big.NewInt(0), + ) + return deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ + Address: tokenAddress, + Contract: tokenContract, + Tx: tx, + Tv: deployment.NewTypeAndVersion(USDCToken, deployment.Version1_0_0), + Err: err2, + } + }) + if err != nil { + lggr.Errorw("Failed to deploy USDC token", "chain", chain.String(), "err", err) + return nil, nil, nil, nil, err + } + + tx, err := token.Contract.GrantMintRole(chain.DeployerKey, chain.DeployerKey.From) + if err != nil { + lggr.Errorw("Failed to grant mint role", "chain", chain.String(), "token", token.Contract.Address(), "err", err) + return nil, nil, nil, nil, err + } + _, err = chain.Confirm(tx) + if err != nil { + return nil, nil, nil, nil, err + } + + transmitter, err := deployment.DeployContract(lggr, chain, addresses, + func(chain deployment.Chain) deployment.ContractDeploy[*mock_usdc_token_transmitter.MockE2EUSDCTransmitter] { + transmitterAddress, tx, transmitterContract, err2 := mock_usdc_token_transmitter.DeployMockE2EUSDCTransmitter( + chain.DeployerKey, + chain.Client, + 0, + reader.AllAvailableDomains()[chain.Selector], + token.Address, + ) + return deployment.ContractDeploy[*mock_usdc_token_transmitter.MockE2EUSDCTransmitter]{ + Address: transmitterAddress, + Contract: transmitterContract, + Tx: tx, + Tv: deployment.NewTypeAndVersion(USDCMockTransmitter, deployment.Version1_0_0), + Err: err2, + } + }) + if err != nil { + lggr.Errorw("Failed to deploy mock USDC transmitter", "chain", chain.String(), "err", err) + return nil, nil, nil, nil, err + } + + messenger, err := deployment.DeployContract(lggr, chain, addresses, + func(chain deployment.Chain) deployment.ContractDeploy[*mock_usdc_token_messenger.MockE2EUSDCTokenMessenger] { + messengerAddress, tx, messengerContract, err2 := mock_usdc_token_messenger.DeployMockE2EUSDCTokenMessenger( + chain.DeployerKey, + chain.Client, + 0, + transmitter.Address, + ) + return deployment.ContractDeploy[*mock_usdc_token_messenger.MockE2EUSDCTokenMessenger]{ + Address: messengerAddress, + Contract: messengerContract, + Tx: tx, + Tv: deployment.NewTypeAndVersion(USDCTokenMessenger, deployment.Version1_0_0), + Err: err2, + } + }) + if err != nil { + lggr.Errorw("Failed to deploy USDC token messenger", "chain", chain.String(), "err", err) + return nil, nil, nil, nil, err + } + + tokenPool, err := deployment.DeployContract(lggr, chain, addresses, + func(chain deployment.Chain) deployment.ContractDeploy[*usdc_token_pool.USDCTokenPool] { + tokenPoolAddress, tx, tokenPoolContract, err2 := usdc_token_pool.DeployUSDCTokenPool( + chain.DeployerKey, + chain.Client, + messenger.Address, + token.Address, + []common.Address{}, + rmnProxy, + router, + ) + return deployment.ContractDeploy[*usdc_token_pool.USDCTokenPool]{ + Address: tokenPoolAddress, + Contract: tokenPoolContract, + Tx: tx, + Tv: deployment.NewTypeAndVersion(USDCTokenPool, deployment.Version1_0_0), + Err: err2, + } + }) + if err != nil { + lggr.Errorw("Failed to deploy USDC token pool", "chain", chain.String(), "err", err) + return nil, nil, nil, nil, err + } + + return token.Contract, tokenPool.Contract, messenger.Contract, transmitter.Contract, nil +} diff --git a/deployment/ccip/changeset/cs_prerequisites_test.go b/deployment/ccip/changeset/cs_prerequisites_test.go index 5835bd41aa3..c9c20757e92 100644 --- a/deployment/ccip/changeset/cs_prerequisites_test.go +++ b/deployment/ccip/changeset/cs_prerequisites_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -19,18 +20,18 @@ func TestDeployPrerequisites(t *testing.T) { Nodes: 4, }) newChain := e.AllChainSelectors()[0] - cfg := DeployPrerequisiteConfig{ - Configs: []DeployPrerequisiteConfigPerChain{ + cfg := changeset.DeployPrerequisiteConfig{ + Configs: []changeset.DeployPrerequisiteConfigPerChain{ { ChainSelector: newChain, }, }, } - output, err := DeployPrerequisites(e, cfg) + output, err := changeset.DeployPrerequisitesChangeset(e, cfg) require.NoError(t, err) err = e.ExistingAddresses.Merge(output.AddressBook) require.NoError(t, err) - state, err := LoadOnchainState(e) + state, err := changeset.LoadOnchainState(e) require.NoError(t, err) require.NotNil(t, state.Chains[newChain].Weth9) require.NotNil(t, state.Chains[newChain].TokenAdminRegistry) diff --git a/deployment/ccip/changeset/cs_rmn_curse_uncurse.go b/deployment/ccip/changeset/cs_rmn_curse_uncurse.go index 1f3222014e3..b6125638143 100644 --- a/deployment/ccip/changeset/cs_rmn_curse_uncurse.go +++ b/deployment/ccip/changeset/cs_rmn_curse_uncurse.go @@ -9,6 +9,11 @@ import ( commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) +var ( + _ deployment.ChangeSet[RMNCurseConfig] = RMNCurseChangeset + _ deployment.ChangeSet[RMNCurseConfig] = RMNUncurseChangeset +) + // GlobalCurseSubject as defined here: https://github.com/smartcontractkit/chainlink/blob/new-rmn-curse-changeset/contracts/src/v0.8/ccip/rmn/RMNRemote.sol#L15 func GlobalCurseSubject() Subject { return Subject{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} @@ -225,7 +230,7 @@ func RMNCurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployment grouped := groupRMNSubjectBySelector(curseActions, true, true) // For each chain in the environment get the RMNRemote contract and call curse for selector, chain := range state.Chains { - deployer, err := deployerGroup.getDeployer(selector) + deployer, err := deployerGroup.GetDeployer(selector) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to get deployer for chain %d: %w", selector, err) } @@ -258,7 +263,7 @@ func RMNCurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployment } } - return deployerGroup.enact("proposal to curse RMNs: " + cfg.Reason) + return deployerGroup.Enact("proposal to curse RMNs: " + cfg.Reason) } // RMNUncurseChangeset creates a new changeset for uncursing chains or lanes on RMNRemote contracts. @@ -296,7 +301,7 @@ func RMNUncurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployme // For each chain in the environement get the RMNRemote contract and call uncurse for selector, chain := range state.Chains { - deployer, err := deployerGroup.getDeployer(selector) + deployer, err := deployerGroup.GetDeployer(selector) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to get deployer for chain %d: %w", selector, err) } @@ -330,5 +335,5 @@ func RMNUncurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployme } } - return deployerGroup.enact("proposal to uncurse RMNs: %s" + cfg.Reason) + return deployerGroup.Enact("proposal to uncurse RMNs: %s" + cfg.Reason) } diff --git a/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go b/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go index 2b0a6c07a59..7a043b36645 100644 --- a/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go +++ b/deployment/ccip/changeset/cs_rmn_curse_uncurse_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -6,6 +6,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) @@ -19,7 +21,7 @@ type curseAssertion struct { type CurseTestCase struct { name string - curseActionsBuilder func(mapIDToSelectorFunc) []CurseAction + curseActionsBuilder func(mapIDToSelectorFunc) []changeset.CurseAction curseAssertions []curseAssertion } @@ -28,8 +30,8 @@ type mapIDToSelectorFunc func(uint64) uint64 var testCases = []CurseTestCase{ { name: "lane", - curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { - return []CurseAction{CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1))} + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []changeset.CurseAction { + return []changeset.CurseAction{changeset.CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1))} }, curseAssertions: []curseAssertion{ {chainID: 0, subject: 1, cursed: true}, @@ -42,8 +44,10 @@ var testCases = []CurseTestCase{ }, { name: "lane duplicate", - curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { - return []CurseAction{CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1)), CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1))} + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []changeset.CurseAction { + return []changeset.CurseAction{ + changeset.CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1)), + changeset.CurseLaneBidirectionally(mapIDToSelector(0), mapIDToSelector(1))} }, curseAssertions: []curseAssertion{ {chainID: 0, subject: 1, cursed: true}, @@ -56,8 +60,8 @@ var testCases = []CurseTestCase{ }, { name: "chain", - curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { - return []CurseAction{CurseChain(mapIDToSelector(0))} + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []changeset.CurseAction { + return []changeset.CurseAction{changeset.CurseChain(mapIDToSelector(0))} }, curseAssertions: []curseAssertion{ {chainID: 0, globalCurse: true, cursed: true}, @@ -69,8 +73,8 @@ var testCases = []CurseTestCase{ }, { name: "chain duplicate", - curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { - return []CurseAction{CurseChain(mapIDToSelector(0)), CurseChain(mapIDToSelector(0))} + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []changeset.CurseAction { + return []changeset.CurseAction{changeset.CurseChain(mapIDToSelector(0)), changeset.CurseChain(mapIDToSelector(0))} }, curseAssertions: []curseAssertion{ {chainID: 0, globalCurse: true, cursed: true}, @@ -82,8 +86,8 @@ var testCases = []CurseTestCase{ }, { name: "chain and lanes", - curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []CurseAction { - return []CurseAction{CurseChain(mapIDToSelector(0)), CurseLaneBidirectionally(mapIDToSelector(1), mapIDToSelector(2))} + curseActionsBuilder: func(mapIDToSelector mapIDToSelectorFunc) []changeset.CurseAction { + return []changeset.CurseAction{changeset.CurseChain(mapIDToSelector(0)), changeset.CurseLaneBidirectionally(mapIDToSelector(1), mapIDToSelector(2))} }, curseAssertions: []curseAssertion{ {chainID: 0, globalCurse: true, cursed: true}, @@ -142,7 +146,7 @@ func TestRMNCurseConfigValidate(t *testing.T) { } func runRmnUncurseTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] @@ -150,23 +154,23 @@ func runRmnUncurseTest(t *testing.T, tc CurseTestCase) { verifyNoActiveCurseOnAllChains(t, &e) - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", } - _, err := RMNCurseChangeset(e.Env, config) + _, err := changeset.RMNCurseChangeset(e.Env, config) require.NoError(t, err) verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) - _, err = RMNUncurseChangeset(e.Env, config) + _, err = changeset.RMNUncurseChangeset(e.Env, config) require.NoError(t, err) verifyNoActiveCurseOnAllChains(t, &e) } -func transferRMNContractToMCMS(t *testing.T, e *DeployedEnv, state CCIPOnChainState, timelocksPerChain map[uint64]*proposalutils.TimelockExecutionContracts) { +func transferRMNContractToMCMS(t *testing.T, e *testhelpers.DeployedEnv, state changeset.CCIPOnChainState, timelocksPerChain map[uint64]*proposalutils.TimelockExecutionContracts) { contractsByChain := make(map[uint64][]common.Address) rmnRemoteAddressesByChain := buildRMNRemoteAddressPerChain(e.Env, state) for chainSelector, rmnRemoteAddress := range rmnRemoteAddressesByChain { @@ -189,30 +193,30 @@ func transferRMNContractToMCMS(t *testing.T, e *DeployedEnv, state CCIPOnChainSt } func runRmnUncurseMCMSTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] } - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", - MCMS: &MCMSConfig{MinDelay: 0}, + MCMS: &changeset.MCMSConfig{MinDelay: 0}, } - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) verifyNoActiveCurseOnAllChains(t, &e) - timelocksPerChain := buildTimelockPerChain(e.Env, state) + timelocksPerChain := changeset.BuildTimelockPerChain(e.Env, state) transferRMNContractToMCMS(t, &e, state, timelocksPerChain) _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(RMNCurseChangeset), + Changeset: commonchangeset.WrapChangeSet(changeset.RMNCurseChangeset), Config: config, }, }) @@ -222,7 +226,7 @@ func runRmnUncurseMCMSTest(t *testing.T, tc CurseTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(RMNUncurseChangeset), + Changeset: commonchangeset.WrapChangeSet(changeset.RMNUncurseChangeset), Config: config, }, }) @@ -232,13 +236,13 @@ func runRmnUncurseMCMSTest(t *testing.T, tc CurseTestCase) { } func runRmnCurseConfigValidateTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] } - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", } @@ -248,7 +252,7 @@ func runRmnCurseConfigValidateTest(t *testing.T, tc CurseTestCase) { } func runRmnCurseTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] @@ -256,19 +260,19 @@ func runRmnCurseTest(t *testing.T, tc CurseTestCase) { verifyNoActiveCurseOnAllChains(t, &e) - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", } - _, err := RMNCurseChangeset(e.Env, config) + _, err := changeset.RMNCurseChangeset(e.Env, config) require.NoError(t, err) verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) } func runRmnCurseIdempotentTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] @@ -276,22 +280,22 @@ func runRmnCurseIdempotentTest(t *testing.T, tc CurseTestCase) { verifyNoActiveCurseOnAllChains(t, &e) - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", } - _, err := RMNCurseChangeset(e.Env, config) + _, err := changeset.RMNCurseChangeset(e.Env, config) require.NoError(t, err) - _, err = RMNCurseChangeset(e.Env, config) + _, err = changeset.RMNCurseChangeset(e.Env, config) require.NoError(t, err) verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) } func runRmnUncurseIdempotentTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] @@ -299,50 +303,50 @@ func runRmnUncurseIdempotentTest(t *testing.T, tc CurseTestCase) { verifyNoActiveCurseOnAllChains(t, &e) - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", } - _, err := RMNCurseChangeset(e.Env, config) + _, err := changeset.RMNCurseChangeset(e.Env, config) require.NoError(t, err) verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) - _, err = RMNUncurseChangeset(e.Env, config) + _, err = changeset.RMNUncurseChangeset(e.Env, config) require.NoError(t, err) - _, err = RMNUncurseChangeset(e.Env, config) + _, err = changeset.RMNUncurseChangeset(e.Env, config) require.NoError(t, err) verifyNoActiveCurseOnAllChains(t, &e) } func runRmnCurseMCMSTest(t *testing.T, tc CurseTestCase) { - e, _ := NewMemoryEnvironment(t, WithChains(3)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) mapIDToSelector := func(id uint64) uint64 { return e.Env.AllChainSelectors()[id] } - config := RMNCurseConfig{ + config := changeset.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", - MCMS: &MCMSConfig{MinDelay: 0}, + MCMS: &changeset.MCMSConfig{MinDelay: 0}, } - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) verifyNoActiveCurseOnAllChains(t, &e) - timelocksPerChain := buildTimelockPerChain(e.Env, state) + timelocksPerChain := changeset.BuildTimelockPerChain(e.Env, state) transferRMNContractToMCMS(t, &e, state, timelocksPerChain) _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(RMNCurseChangeset), + Changeset: commonchangeset.WrapChangeSet(changeset.RMNCurseChangeset), Config: config, }, }) @@ -351,14 +355,14 @@ func runRmnCurseMCMSTest(t *testing.T, tc CurseTestCase) { verifyTestCaseAssertions(t, &e, tc, mapIDToSelector) } -func verifyTestCaseAssertions(t *testing.T, e *DeployedEnv, tc CurseTestCase, mapIDToSelector mapIDToSelectorFunc) { - state, err := LoadOnchainState(e.Env) +func verifyTestCaseAssertions(t *testing.T, e *testhelpers.DeployedEnv, tc CurseTestCase, mapIDToSelector mapIDToSelectorFunc) { + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) for _, assertion := range tc.curseAssertions { - cursedSubject := SelectorToSubject(mapIDToSelector(assertion.subject)) + cursedSubject := changeset.SelectorToSubject(mapIDToSelector(assertion.subject)) if assertion.globalCurse { - cursedSubject = GlobalCurseSubject() + cursedSubject = changeset.GlobalCurseSubject() } isCursed, err := state.Chains[mapIDToSelector(assertion.chainID)].RMNRemote.IsCursed(nil, cursedSubject) @@ -367,8 +371,8 @@ func verifyTestCaseAssertions(t *testing.T, e *DeployedEnv, tc CurseTestCase, ma } } -func verifyNoActiveCurseOnAllChains(t *testing.T, e *DeployedEnv) { - state, err := LoadOnchainState(e.Env) +func verifyNoActiveCurseOnAllChains(t *testing.T, e *testhelpers.DeployedEnv) { + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) for _, chain := range e.Env.Chains { diff --git a/deployment/ccip/changeset/cs_update_rmn_config.go b/deployment/ccip/changeset/cs_update_rmn_config.go index 1797d588fca..e220ca50998 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/cs_update_rmn_config.go @@ -20,9 +20,9 @@ import ( ) var ( - _ deployment.ChangeSet[SetRMNRemoteOnRMNProxyConfig] = SetRMNRemoteOnRMNProxy + _ deployment.ChangeSet[SetRMNRemoteOnRMNProxyConfig] = SetRMNRemoteOnRMNProxyChangeset _ deployment.ChangeSet[SetRMNHomeCandidateConfig] = SetRMNHomeCandidateConfigChangeset - _ deployment.ChangeSet[PromoteRMNHomeCandidateConfig] = PromoteCandidateConfigChangeset + _ deployment.ChangeSet[PromoteRMNHomeCandidateConfig] = PromoteRMNHomeCandidateConfigChangeset _ deployment.ChangeSet[SetRMNRemoteConfig] = SetRMNRemoteConfigChangeset ) @@ -51,7 +51,7 @@ func (c SetRMNRemoteOnRMNProxyConfig) Validate(state CCIPOnChainState) error { return nil } -func SetRMNRemoteOnRMNProxy(e deployment.Environment, cfg SetRMNRemoteOnRMNProxyConfig) (deployment.ChangesetOutput, error) { +func SetRMNRemoteOnRMNProxyChangeset(e deployment.Environment, cfg SetRMNRemoteOnRMNProxyConfig) (deployment.ChangesetOutput, error) { state, err := LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) @@ -314,9 +314,9 @@ func SetRMNHomeCandidateConfigChangeset(e deployment.Environment, config SetRMNH }, } - timelocksPerChain := buildTimelockAddressPerChain(e, state) + timelocksPerChain := BuildTimelockAddressPerChain(e, state) - proposerMCMSes := buildProposerPerChain(e, state) + proposerMCMSes := BuildProposerPerChain(e, state) prop, err := proposalutils.BuildProposalFromBatches( timelocksPerChain, @@ -331,7 +331,7 @@ func SetRMNHomeCandidateConfigChangeset(e deployment.Environment, config SetRMNH }, nil } -func PromoteCandidateConfigChangeset(e deployment.Environment, config PromoteRMNHomeCandidateConfig) (deployment.ChangesetOutput, error) { +func PromoteRMNHomeCandidateConfigChangeset(e deployment.Environment, config PromoteRMNHomeCandidateConfig) (deployment.ChangesetOutput, error) { state, err := LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) @@ -393,9 +393,9 @@ func PromoteCandidateConfigChangeset(e deployment.Environment, config PromoteRMN }, } - timelocksPerChain := buildTimelockAddressPerChain(e, state) + timelocksPerChain := BuildTimelockAddressPerChain(e, state) - proposerMCMSes := buildProposerPerChain(e, state) + proposerMCMSes := BuildProposerPerChain(e, state) prop, err := proposalutils.BuildProposalFromBatches( timelocksPerChain, @@ -414,7 +414,7 @@ func PromoteCandidateConfigChangeset(e deployment.Environment, config PromoteRMN }, nil } -func buildRMNRemotePerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*rmn_remote.RMNRemote { +func BuildRMNRemotePerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*rmn_remote.RMNRemote { timelocksPerChain := make(map[uint64]*rmn_remote.RMNRemote) for _, chain := range e.Chains { timelocksPerChain[chain.Selector] = state.Chains[chain.Selector].RMNRemote @@ -488,7 +488,7 @@ func SetRMNRemoteConfigChangeset(e deployment.Environment, config SetRMNRemoteCo return deployment.ChangesetOutput{}, fmt.Errorf("failed to get RMNHome active digest for chain %s: %w", homeChain.String(), err) } - rmnRemotePerChain := buildRMNRemotePerChain(e, state) + rmnRemotePerChain := BuildRMNRemotePerChain(e, state) batches := make([]timelock.BatchChainOperation, 0) for chain, remoteConfig := range config.RMNRemoteConfigs { remote, ok := rmnRemotePerChain[chain] @@ -545,9 +545,9 @@ func SetRMNRemoteConfigChangeset(e deployment.Environment, config SetRMNRemoteCo return deployment.ChangesetOutput{}, nil } - timelocksPerChain := buildTimelockAddressPerChain(e, state) + timelocksPerChain := BuildTimelockAddressPerChain(e, state) - proposerMCMSes := buildProposerPerChain(e, state) + proposerMCMSes := BuildProposerPerChain(e, state) prop, err := proposalutils.BuildProposalFromBatches( timelocksPerChain, diff --git a/deployment/ccip/changeset/cs_update_rmn_config_test.go b/deployment/ccip/changeset/cs_update_rmn_config_test.go index fdccf36af07..1db80197b15 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config_test.go +++ b/deployment/ccip/changeset/cs_update_rmn_config_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "testing" @@ -7,6 +7,8 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" @@ -15,19 +17,19 @@ import ( ) var ( - rmn_staging_1 = RMNNopConfig{ + rmnStaging1 = changeset.RMNNopConfig{ NodeIndex: 0, PeerId: deployment.MustPeerIDFromString("p2p_12D3KooWRXxZq3pd4a3ZGkKj7Nt1SQQrnB8CuvbPnnV9KVeMeWqg"), OffchainPublicKey: [32]byte(common.FromHex("0xb34944857a42444d1b285d7940d6e06682309e0781e43a69676ee9f85c73c2d1")), EVMOnChainPublicKey: common.HexToAddress("0x5af8ee32316a6427f169a45fdc1b3a91a85ac459e3c1cb91c69e1c51f0c1fc21"), } - rmn_staging_2 = RMNNopConfig{ + rmnStaging2 = changeset.RMNNopConfig{ NodeIndex: 1, PeerId: deployment.MustPeerIDFromString("p2p_12D3KooWEmdxYQFsRbD9aFczF32zA3CcUwuSiWCk2CrmACo4v9RL"), OffchainPublicKey: [32]byte(common.FromHex("0x68d9f3f274e3985528a923a9bace3d39c55dd778b187b4120b384cc48c892859")), EVMOnChainPublicKey: common.HexToAddress("0x858589216956f482a0f68b282a7050af4cd48ed2"), } - rmn_staging_3 = RMNNopConfig{ + rmnStaging3 = changeset.RMNNopConfig{ NodeIndex: 2, PeerId: deployment.MustPeerIDFromString("p2p_12D3KooWJS42cNXKJvj6DeZnxEX7aGxhEuap6uNFrz554AbUDw6Q"), OffchainPublicKey: [32]byte(common.FromHex("0x5af8ee32316a6427f169a45fdc1b3a91a85ac459e3c1cb91c69e1c51f0c1fc21")), @@ -38,7 +40,7 @@ var ( type updateRMNConfigTestCase struct { useMCMS bool name string - nops []RMNNopConfig + nops []changeset.RMNNopConfig } func TestUpdateRMNConfig(t *testing.T) { @@ -47,12 +49,12 @@ func TestUpdateRMNConfig(t *testing.T) { { useMCMS: true, name: "with MCMS", - nops: []RMNNopConfig{rmn_staging_1, rmn_staging_2, rmn_staging_3}, + nops: []changeset.RMNNopConfig{rmnStaging1, rmnStaging2, rmnStaging3}, }, { useMCMS: false, name: "without MCMS", - nops: []RMNNopConfig{rmn_staging_1, rmn_staging_2, rmn_staging_3}, + nops: []changeset.RMNNopConfig{rmnStaging1, rmnStaging2, rmnStaging3}, }, } @@ -65,9 +67,9 @@ func TestUpdateRMNConfig(t *testing.T) { } func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { - e, _ := NewMemoryEnvironment(t) + e, _ := testhelpers.NewMemoryEnvironment(t) - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) contractsByChain := make(map[uint64][]common.Address) @@ -78,7 +80,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { contractsByChain[e.HomeChainSel] = append(contractsByChain[e.HomeChainSel], state.Chains[e.HomeChainSel].RMNHome.Address()) - timelocksPerChain := buildTimelockPerChain(e.Env, state) + timelocksPerChain := changeset.BuildTimelockPerChain(e.Env, state) if tc.useMCMS { // This is required because RMNHome is initially owned by the deployer _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ @@ -99,10 +101,10 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { previousActiveDigest, err := rmnHome.GetActiveDigest(nil) require.NoError(t, err) - var mcmsConfig *MCMSConfig = nil + var mcmsConfig *changeset.MCMSConfig if tc.useMCMS { - mcmsConfig = &MCMSConfig{ + mcmsConfig = &changeset.MCMSConfig{ MinDelay: 0, } } @@ -112,7 +114,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { nodes = append(nodes, nop.ToRMNHomeNode()) } - setRMNHomeCandidateConfig := SetRMNHomeCandidateConfig{ + setRMNHomeCandidateConfig := changeset.SetRMNHomeCandidateConfig{ HomeChainSelector: e.HomeChainSel, RMNStaticConfig: rmn_home.RMNHomeStaticConfig{ Nodes: nodes, @@ -127,14 +129,14 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(SetRMNHomeCandidateConfigChangeset), + Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNHomeCandidateConfigChangeset), Config: setRMNHomeCandidateConfig, }, }) require.NoError(t, err) - state, err = LoadOnchainState(e.Env) + state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) currentCandidateDigest, err := rmnHome.GetCandidateDigest(nil) @@ -145,7 +147,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { require.NotEqual(t, previousCandidateDigest, currentCandidateDigest) require.Equal(t, previousActiveDigest, currentActiveDigest) - promoteConfig := PromoteRMNHomeCandidateConfig{ + promoteConfig := changeset.PromoteRMNHomeCandidateConfig{ HomeChainSelector: e.HomeChainSel, DigestToPromote: currentCandidateDigest, MCMSConfig: mcmsConfig, @@ -153,7 +155,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(PromoteCandidateConfigChangeset), + Changeset: commonchangeset.WrapChangeSet(changeset.PromoteRMNHomeCandidateConfigChangeset), Config: promoteConfig, }, }) @@ -169,9 +171,9 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { signers = append(signers, nop.ToRMNRemoteSigner()) } - remoteConfigs := make(map[uint64]RMNRemoteConfig, len(e.Env.Chains)) + remoteConfigs := make(map[uint64]changeset.RMNRemoteConfig, len(e.Env.Chains)) for _, chain := range e.Env.Chains { - remoteConfig := RMNRemoteConfig{ + remoteConfig := changeset.RMNRemoteConfig{ Signers: signers, F: 0, } @@ -179,7 +181,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { remoteConfigs[chain.Selector] = remoteConfig } - setRemoteConfig := SetRMNRemoteConfig{ + setRemoteConfig := changeset.SetRMNRemoteConfig{ HomeChainSelector: e.HomeChainSel, RMNRemoteConfigs: remoteConfigs, MCMSConfig: mcmsConfig, @@ -187,13 +189,13 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(SetRMNRemoteConfigChangeset), + Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNRemoteConfigChangeset), Config: setRemoteConfig, }, }) require.NoError(t, err) - rmnRemotePerChain := buildRMNRemotePerChain(e.Env, state) + rmnRemotePerChain := changeset.BuildRMNRemotePerChain(e.Env, state) for _, rmnRemote := range rmnRemotePerChain { remoteConfigSetEvents, err := rmnRemote.FilterConfigSet(nil, nil) require.NoError(t, err) @@ -206,8 +208,8 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { } } -func buildRMNRemoteAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address { - rmnRemotePerChain := buildRMNRemotePerChain(e, state) +func buildRMNRemoteAddressPerChain(e deployment.Environment, state changeset.CCIPOnChainState) map[uint64]common.Address { + rmnRemotePerChain := changeset.BuildRMNRemotePerChain(e, state) rmnRemoteAddressPerChain := make(map[uint64]common.Address) for chain, remote := range rmnRemotePerChain { if remote == nil { @@ -220,14 +222,14 @@ func buildRMNRemoteAddressPerChain(e deployment.Environment, state CCIPOnChainSt func TestSetRMNRemoteOnRMNProxy(t *testing.T) { t.Parallel() - e, _ := NewMemoryEnvironment(t, WithNoJobsAndContracts()) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNoJobsAndContracts()) allChains := e.Env.AllChainSelectors() mcmsCfg := make(map[uint64]commontypes.MCMSWithTimelockConfig) var err error - var prereqCfgs []DeployPrerequisiteConfigPerChain + prereqCfgs := make([]changeset.DeployPrerequisiteConfigPerChain, 0) for _, c := range e.Env.AllChainSelectors() { mcmsCfg[c] = proposalutils.SingleGroupTimelockConfig(t) - prereqCfgs = append(prereqCfgs, DeployPrerequisiteConfigPerChain{ + prereqCfgs = append(prereqCfgs, changeset.DeployPrerequisiteConfigPerChain{ ChainSelector: c, }) } @@ -239,8 +241,8 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { Config: allChains, }, { - Changeset: commonchangeset.WrapChangeSet(DeployPrerequisites), - Config: DeployPrerequisiteConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployPrerequisitesChangeset), + Config: changeset.DeployPrerequisiteConfig{ Configs: prereqCfgs, }, }, @@ -251,7 +253,7 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { }) require.NoError(t, err) contractsByChain := make(map[uint64][]common.Address) - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) for _, chain := range allChains { rmnProxy := state.Chains[chain].RMNProxy @@ -278,36 +280,36 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { }, { - Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), - Config: DeployHomeChainConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChainChangeset), + Config: changeset.DeployHomeChainConfig{ HomeChainSel: e.HomeChainSel, - RMNDynamicConfig: NewTestRMNDynamicConfig(), - RMNStaticConfig: NewTestRMNStaticConfig(), - NodeOperators: NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.Env.Chains[e.HomeChainSel].DeployerKey.From), NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ "NodeOperator": envNodes.NonBootstraps().PeerIDs(), }, }, }, { - Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), - Config: DeployChainContractsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), + Config: changeset.DeployChainContractsConfig{ ChainSelectors: allChains, HomeChainSelector: e.HomeChainSel, }, }, { - Changeset: commonchangeset.WrapChangeSet(SetRMNRemoteOnRMNProxy), - Config: SetRMNRemoteOnRMNProxyConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNRemoteOnRMNProxyChangeset), + Config: changeset.SetRMNRemoteOnRMNProxyConfig{ ChainSelectors: allChains, - MCMSConfig: &MCMSConfig{ + MCMSConfig: &changeset.MCMSConfig{ MinDelay: 0, }, }, }, }) require.NoError(t, err) - state, err = LoadOnchainState(e.Env) + state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) for _, chain := range allChains { rmnProxy := state.Chains[chain].RMNProxy diff --git a/deployment/ccip/changeset/deployer_group.go b/deployment/ccip/changeset/deployer_group.go index 0c0ff1e5c8e..5f7c7e52da2 100644 --- a/deployment/ccip/changeset/deployer_group.go +++ b/deployment/ccip/changeset/deployer_group.go @@ -31,10 +31,10 @@ type DeployerGroup struct { // deployerGroup := NewDeployerGroup(e, state, mcmConfig) // selector := 0 // # Get the right deployer key for the chain -// deployer := deployerGroup.getDeployer(selector) +// deployer := deployerGroup.GetDeployer(selector) // state.Chains[selector].RMNRemote.Curse() // # Execute the transaction or create the proposal -// deployerGroup.enact("Curse RMNRemote") +// deployerGroup.Enact("Curse RMNRemote") func NewDeployerGroup(e deployment.Environment, state CCIPOnChainState, mcmConfig *MCMSConfig) *DeployerGroup { return &DeployerGroup{ e: e, @@ -44,7 +44,7 @@ func NewDeployerGroup(e deployment.Environment, state CCIPOnChainState, mcmConfi } } -func (d *DeployerGroup) getDeployer(chain uint64) (*bind.TransactOpts, error) { +func (d *DeployerGroup) GetDeployer(chain uint64) (*bind.TransactOpts, error) { txOpts := d.e.Chains[chain].DeployerKey if d.mcmConfig != nil { txOpts = deployment.SimTransactOpts() @@ -102,7 +102,7 @@ func (d *DeployerGroup) getDeployer(chain uint64) (*bind.TransactOpts, error) { return sim, nil } -func (d *DeployerGroup) enact(deploymentDescription string) (deployment.ChangesetOutput, error) { +func (d *DeployerGroup) Enact(deploymentDescription string) (deployment.ChangesetOutput, error) { if d.mcmConfig != nil { return d.enactMcms(deploymentDescription) } @@ -127,9 +127,9 @@ func (d *DeployerGroup) enactMcms(deploymentDescription string) (deployment.Chan }) } - timelocksPerChain := buildTimelockAddressPerChain(d.e, d.state) + timelocksPerChain := BuildTimelockAddressPerChain(d.e, d.state) - proposerMCMSes := buildProposerPerChain(d.e, d.state) + proposerMCMSes := BuildProposerPerChain(d.e, d.state) prop, err := proposalutils.BuildProposalFromBatches( timelocksPerChain, @@ -165,7 +165,7 @@ func (d *DeployerGroup) enactDeployer() (deployment.ChangesetOutput, error) { return deployment.ChangesetOutput{}, nil } -func buildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*proposalutils.TimelockExecutionContracts { +func BuildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*proposalutils.TimelockExecutionContracts { timelocksPerChain := make(map[uint64]*proposalutils.TimelockExecutionContracts) for _, chain := range e.Chains { timelocksPerChain[chain.Selector] = &proposalutils.TimelockExecutionContracts{ @@ -176,8 +176,8 @@ func buildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map return timelocksPerChain } -func buildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address { - timelocksPerChain := buildTimelockPerChain(e, state) +func BuildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address { + timelocksPerChain := BuildTimelockPerChain(e, state) timelockAddressPerChain := make(map[uint64]common.Address) for chain, timelock := range timelocksPerChain { timelockAddressPerChain[chain] = timelock.Timelock.Address() @@ -185,7 +185,7 @@ func buildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainSta return timelockAddressPerChain } -func buildProposerPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*gethwrappers.ManyChainMultiSig { +func BuildProposerPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*gethwrappers.ManyChainMultiSig { proposerPerChain := make(map[uint64]*gethwrappers.ManyChainMultiSig) for _, chain := range e.Chains { proposerPerChain[chain.Selector] = state.Chains[chain.Selector].ProposerMcm diff --git a/deployment/ccip/changeset/deployer_group_test.go b/deployment/ccip/changeset/deployer_group_test.go index 12dcaa9076b..ba598ec74e8 100644 --- a/deployment/ccip/changeset/deployer_group_test.go +++ b/deployment/ccip/changeset/deployer_group_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "math/big" @@ -8,6 +8,8 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) @@ -15,19 +17,19 @@ type dummyDeployerGroupChangesetConfig struct { selector uint64 address common.Address mints []*big.Int - MCMS *MCMSConfig + MCMS *changeset.MCMSConfig } func dummyDeployerGroupGrantMintChangeset(e deployment.Environment, cfg dummyDeployerGroupChangesetConfig) (deployment.ChangesetOutput, error) { - state, err := LoadOnchainState(e) + state, err := changeset.LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, err } token := state.Chains[cfg.selector].LinkToken - group := NewDeployerGroup(e, state, cfg.MCMS) - deployer, err := group.getDeployer(cfg.selector) + group := changeset.NewDeployerGroup(e, state, cfg.MCMS) + deployer, err := group.GetDeployer(cfg.selector) if err != nil { return deployment.ChangesetOutput{}, err } @@ -37,19 +39,19 @@ func dummyDeployerGroupGrantMintChangeset(e deployment.Environment, cfg dummyDep return deployment.ChangesetOutput{}, err } - return group.enact("Grant mint role") + return group.Enact("Grant mint role") } func dummyDeployerGroupMintChangeset(e deployment.Environment, cfg dummyDeployerGroupChangesetConfig) (deployment.ChangesetOutput, error) { - state, err := LoadOnchainState(e) + state, err := changeset.LoadOnchainState(e) if err != nil { return deployment.ChangesetOutput{}, err } token := state.Chains[cfg.selector].LinkToken - group := NewDeployerGroup(e, state, cfg.MCMS) - deployer, err := group.getDeployer(cfg.selector) + group := changeset.NewDeployerGroup(e, state, cfg.MCMS) + deployer, err := group.GetDeployer(cfg.selector) if err != nil { return deployment.ChangesetOutput{}, err } @@ -61,7 +63,7 @@ func dummyDeployerGroupMintChangeset(e deployment.Environment, cfg dummyDeployer } } - return group.enact("Mint tokens") + return group.Enact("Mint tokens") } type deployerGroupTestCase struct { @@ -91,7 +93,7 @@ var deployerGroupTestCases = []deployerGroupTestCase{ func TestDeployerGroup(t *testing.T) { for _, tc := range deployerGroupTestCases { t.Run(tc.name, func(t *testing.T) { - e, _ := NewMemoryEnvironment(t, WithChains(2)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) tc.cfg.selector = e.HomeChainSel tc.cfg.MCMS = nil @@ -105,7 +107,7 @@ func TestDeployerGroup(t *testing.T) { } else { require.NoError(t, err) - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) token := state.Chains[e.HomeChainSel].LinkToken @@ -131,16 +133,16 @@ func TestDeployerGroupMCMS(t *testing.T) { t.Skip("skipping test because it's not possible to verify error when using MCMS since we are explicitly failing the test in ApplyChangesets") } - e, _ := NewMemoryEnvironment(t, WithChains(2)) + e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) tc.cfg.selector = e.HomeChainSel - tc.cfg.MCMS = &MCMSConfig{ + tc.cfg.MCMS = &changeset.MCMSConfig{ MinDelay: 0, } - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) - timelocksPerChain := buildTimelockPerChain(e.Env, state) + timelocksPerChain := changeset.BuildTimelockPerChain(e.Env, state) contractsByChain := make(map[uint64][]common.Address) contractsByChain[e.HomeChainSel] = []common.Address{state.Chains[e.HomeChainSel].LinkToken.Address()} @@ -172,7 +174,7 @@ func TestDeployerGroupMCMS(t *testing.T) { }) require.NoError(t, err) - state, err = LoadOnchainState(e.Env) + state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) token := state.Chains[e.HomeChainSel].LinkToken diff --git a/deployment/ccip/changeset/save_existing_test.go b/deployment/ccip/changeset/save_existing_test.go index 080ed80481a..f575bc005f2 100644 --- a/deployment/ccip/changeset/save_existing_test.go +++ b/deployment/ccip/changeset/save_existing_test.go @@ -1,4 +1,4 @@ -package changeset +package changeset_test import ( "math/big" @@ -9,6 +9,7 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/memory" @@ -35,32 +36,32 @@ func TestSaveExistingCCIP(t *testing.T) { }, { Address: common.BigToAddress(big.NewInt(2)), - TypeAndVersion: deployment.NewTypeAndVersion(WETH9, deployment.Version1_0_0), + TypeAndVersion: deployment.NewTypeAndVersion(changeset.WETH9, deployment.Version1_0_0), ChainSelector: chain1, }, { Address: common.BigToAddress(big.NewInt(3)), - TypeAndVersion: deployment.NewTypeAndVersion(TokenAdminRegistry, deployment.Version1_5_0), + TypeAndVersion: deployment.NewTypeAndVersion(changeset.TokenAdminRegistry, deployment.Version1_5_0), ChainSelector: chain1, }, { Address: common.BigToAddress(big.NewInt(4)), - TypeAndVersion: deployment.NewTypeAndVersion(RegistryModule, deployment.Version1_5_0), + TypeAndVersion: deployment.NewTypeAndVersion(changeset.RegistryModule, deployment.Version1_5_0), ChainSelector: chain2, }, { Address: common.BigToAddress(big.NewInt(5)), - TypeAndVersion: deployment.NewTypeAndVersion(Router, deployment.Version1_2_0), + TypeAndVersion: deployment.NewTypeAndVersion(changeset.Router, deployment.Version1_2_0), ChainSelector: chain2, }, }, } - output, err := commonchangeset.SaveExistingContracts(e, cfg) + output, err := commonchangeset.SaveExistingContractsChangeset(e, cfg) require.NoError(t, err) err = e.ExistingAddresses.Merge(output.AddressBook) require.NoError(t, err) - state, err := LoadOnchainState(e) + state, err := changeset.LoadOnchainState(e) require.NoError(t, err) require.Equal(t, state.Chains[chain1].LinkToken.Address(), common.BigToAddress(big.NewInt(1))) require.Equal(t, state.Chains[chain1].Weth9.Address(), common.BigToAddress(big.NewInt(2))) diff --git a/deployment/ccip/changeset/state_test.go b/deployment/ccip/changeset/state_test.go index f7d06efa66d..c46df8b1dc7 100644 --- a/deployment/ccip/changeset/state_test.go +++ b/deployment/ccip/changeset/state_test.go @@ -1,14 +1,17 @@ -package changeset +package changeset_test import ( "testing" "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" ) func TestSmokeState(t *testing.T) { - tenv, _ := NewMemoryEnvironment(t, WithChains(3)) - state, err := LoadOnchainState(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) + state, err := changeset.LoadOnchainState(tenv.Env) require.NoError(t, err) _, err = state.View(tenv.Env.AllChainSelectors()) require.NoError(t, err) diff --git a/deployment/ccip/changeset/test_usdc_helpers.go b/deployment/ccip/changeset/test_usdc_helpers.go deleted file mode 100644 index c9dd87b866e..00000000000 --- a/deployment/ccip/changeset/test_usdc_helpers.go +++ /dev/null @@ -1,260 +0,0 @@ -package changeset - -import ( - "math/big" - - "golang.org/x/sync/errgroup" - - "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-ccip/pkg/reader" - "github.com/smartcontractkit/chainlink-common/pkg/logger" - - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_messenger" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" -) - -func ConfigureUSDCTokenPools( - lggr logger.Logger, - chains map[uint64]deployment.Chain, - src, dst uint64, - state CCIPOnChainState, -) (*burn_mint_erc677.BurnMintERC677, *burn_mint_erc677.BurnMintERC677, error) { - srcToken := state.Chains[src].BurnMintTokens677[USDCSymbol] - dstToken := state.Chains[dst].BurnMintTokens677[USDCSymbol] - srcPool := state.Chains[src].USDCTokenPool - dstPool := state.Chains[dst].USDCTokenPool - - args := []struct { - sourceChain deployment.Chain - dstChainSel uint64 - state CCIPChainState - srcToken *burn_mint_erc677.BurnMintERC677 - srcPool *usdc_token_pool.USDCTokenPool - dstToken *burn_mint_erc677.BurnMintERC677 - dstPool *usdc_token_pool.USDCTokenPool - }{ - { - chains[src], - dst, - state.Chains[src], - srcToken, - srcPool, - dstToken, - dstPool, - }, - { - chains[dst], - src, - state.Chains[dst], - dstToken, - dstPool, - srcToken, - srcPool, - }, - } - - configurePoolGrp := errgroup.Group{} - for _, arg := range args { - configurePoolGrp.Go(configureSingleChain(lggr, arg.sourceChain, arg.dstChainSel, arg.state, arg.srcToken, arg.srcPool, arg.dstToken, arg.dstPool)) - } - if err := configurePoolGrp.Wait(); err != nil { - return nil, nil, err - } - return srcToken, dstToken, nil -} - -func configureSingleChain( - lggr logger.Logger, - sourceChain deployment.Chain, - dstChainSel uint64, - state CCIPChainState, - srcToken *burn_mint_erc677.BurnMintERC677, - srcPool *usdc_token_pool.USDCTokenPool, - dstToken *burn_mint_erc677.BurnMintERC677, - dstPool *usdc_token_pool.USDCTokenPool, -) func() error { - return func() error { - if err := attachTokenToTheRegistry(sourceChain, state, sourceChain.DeployerKey, srcToken.Address(), srcPool.Address()); err != nil { - lggr.Errorw("Failed to attach token to the registry", "err", err, "token", srcToken.Address(), "pool", srcPool.Address()) - return err - } - - if err := setUSDCTokenPoolCounterPart(sourceChain, srcPool, dstChainSel, sourceChain.DeployerKey, dstToken.Address(), dstPool.Address()); err != nil { - lggr.Errorw("Failed to set counter part", "err", err, "srcPool", srcPool.Address(), "dstPool", dstPool.Address()) - return err - } - - for _, addr := range []common.Address{ - srcPool.Address(), - state.MockUSDCTokenMessenger.Address(), - state.MockUSDCTransmitter.Address(), - } { - if err := grantMintBurnPermissions(lggr, sourceChain, srcToken, sourceChain.DeployerKey, addr); err != nil { - lggr.Errorw("Failed to grant mint/burn permissions", "err", err, "token", srcToken.Address(), "address", addr) - return err - } - } - return nil - } -} - -func UpdateFeeQuoterForUSDC( - lggr logger.Logger, - chain deployment.Chain, - state CCIPChainState, - dstChain uint64, - usdcToken *burn_mint_erc677.BurnMintERC677, -) error { - config := []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{ - { - DestChainSelector: dstChain, - TokenTransferFeeConfigs: []fee_quoter.FeeQuoterTokenTransferFeeConfigSingleTokenArgs{ - { - Token: usdcToken.Address(), - TokenTransferFeeConfig: fee_quoter.FeeQuoterTokenTransferFeeConfig{ - MinFeeUSDCents: 50, - MaxFeeUSDCents: 50_000, - DeciBps: 0, - DestGasOverhead: 180_000, - DestBytesOverhead: 640, - IsEnabled: true, - }, - }, - }, - }, - } - - tx, err := state.FeeQuoter.ApplyTokenTransferFeeConfigUpdates( - chain.DeployerKey, - config, - []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs{}, - ) - if err != nil { - lggr.Errorw("Failed to apply token transfer fee config updates", "err", err, "config", config) - return err - } - - _, err = chain.Confirm(tx) - return err -} - -func DeployUSDC( - lggr logger.Logger, - chain deployment.Chain, - addresses deployment.AddressBook, - rmnProxy common.Address, - router common.Address, -) ( - *burn_mint_erc677.BurnMintERC677, - *usdc_token_pool.USDCTokenPool, - *mock_usdc_token_messenger.MockE2EUSDCTokenMessenger, - *mock_usdc_token_transmitter.MockE2EUSDCTransmitter, - error, -) { - token, err := deployment.DeployContract(lggr, chain, addresses, - func(chain deployment.Chain) deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677] { - tokenAddress, tx, tokenContract, err2 := burn_mint_erc677.DeployBurnMintERC677( - chain.DeployerKey, - chain.Client, - USDCName, - string(USDCSymbol), - UsdcDecimals, - big.NewInt(0), - ) - return deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ - Address: tokenAddress, - Contract: tokenContract, - Tx: tx, - Tv: deployment.NewTypeAndVersion(USDCToken, deployment.Version1_0_0), - Err: err2, - } - }) - if err != nil { - lggr.Errorw("Failed to deploy USDC token", "chain", chain.String(), "err", err) - return nil, nil, nil, nil, err - } - - tx, err := token.Contract.GrantMintRole(chain.DeployerKey, chain.DeployerKey.From) - if err != nil { - lggr.Errorw("Failed to grant mint role", "chain", chain.String(), "token", token.Contract.Address(), "err", err) - return nil, nil, nil, nil, err - } - _, err = chain.Confirm(tx) - if err != nil { - return nil, nil, nil, nil, err - } - - transmitter, err := deployment.DeployContract(lggr, chain, addresses, - func(chain deployment.Chain) deployment.ContractDeploy[*mock_usdc_token_transmitter.MockE2EUSDCTransmitter] { - transmitterAddress, tx, transmitterContract, err2 := mock_usdc_token_transmitter.DeployMockE2EUSDCTransmitter( - chain.DeployerKey, - chain.Client, - 0, - reader.AllAvailableDomains()[chain.Selector], - token.Address, - ) - return deployment.ContractDeploy[*mock_usdc_token_transmitter.MockE2EUSDCTransmitter]{ - Address: transmitterAddress, - Contract: transmitterContract, - Tx: tx, - Tv: deployment.NewTypeAndVersion(USDCMockTransmitter, deployment.Version1_0_0), - Err: err2, - } - }) - if err != nil { - lggr.Errorw("Failed to deploy mock USDC transmitter", "chain", chain.String(), "err", err) - return nil, nil, nil, nil, err - } - - messenger, err := deployment.DeployContract(lggr, chain, addresses, - func(chain deployment.Chain) deployment.ContractDeploy[*mock_usdc_token_messenger.MockE2EUSDCTokenMessenger] { - messengerAddress, tx, messengerContract, err2 := mock_usdc_token_messenger.DeployMockE2EUSDCTokenMessenger( - chain.DeployerKey, - chain.Client, - 0, - transmitter.Address, - ) - return deployment.ContractDeploy[*mock_usdc_token_messenger.MockE2EUSDCTokenMessenger]{ - Address: messengerAddress, - Contract: messengerContract, - Tx: tx, - Tv: deployment.NewTypeAndVersion(USDCTokenMessenger, deployment.Version1_0_0), - Err: err2, - } - }) - if err != nil { - lggr.Errorw("Failed to deploy USDC token messenger", "chain", chain.String(), "err", err) - return nil, nil, nil, nil, err - } - - tokenPool, err := deployment.DeployContract(lggr, chain, addresses, - func(chain deployment.Chain) deployment.ContractDeploy[*usdc_token_pool.USDCTokenPool] { - tokenPoolAddress, tx, tokenPoolContract, err2 := usdc_token_pool.DeployUSDCTokenPool( - chain.DeployerKey, - chain.Client, - messenger.Address, - token.Address, - []common.Address{}, - rmnProxy, - router, - ) - return deployment.ContractDeploy[*usdc_token_pool.USDCTokenPool]{ - Address: tokenPoolAddress, - Contract: tokenPoolContract, - Tx: tx, - Tv: deployment.NewTypeAndVersion(USDCTokenPool, deployment.Version1_0_0), - Err: err2, - } - }) - if err != nil { - lggr.Errorw("Failed to deploy USDC token pool", "chain", chain.String(), "err", err) - return nil, nil, nil, nil, err - } - - return token.Contract, tokenPool.Contract, messenger.Contract, transmitter.Contract, nil -} diff --git a/deployment/ccip/changeset/test_assertions.go b/deployment/ccip/changeset/testhelpers/test_assertions.go similarity index 92% rename from deployment/ccip/changeset/test_assertions.go rename to deployment/ccip/changeset/testhelpers/test_assertions.go index ba1b5fa4a88..768788cef1a 100644 --- a/deployment/ccip/changeset/test_assertions.go +++ b/deployment/ccip/changeset/testhelpers/test_assertions.go @@ -1,4 +1,4 @@ -package changeset +package testhelpers import ( "context" @@ -19,6 +19,8 @@ import ( commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/deployment" @@ -29,7 +31,7 @@ import ( func ConfirmGasPriceUpdatedForAll( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, startBlocks map[uint64]*uint64, gasPrice *big.Int, ) { @@ -82,7 +84,7 @@ func ConfirmGasPriceUpdated( func ConfirmTokenPriceUpdatedForAll( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, startBlocks map[uint64]*uint64, linkPrice *big.Int, wethPrice *big.Int, @@ -167,7 +169,7 @@ type SourceDestPair struct { func ConfirmCommitForAllWithExpectedSeqNums( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, expectedSeqNums map[SourceDestPair]uint64, startBlocks map[uint64]*uint64, ) { @@ -267,7 +269,7 @@ func (c *commitReportTracker) allCommited(sourceChainSelector uint64) bool { func ConfirmMultipleCommits( t *testing.T, chains map[uint64]deployment.Chain, - state map[uint64]CCIPChainState, + state map[uint64]changeset.CCIPChainState, startBlocks map[uint64]*uint64, enforceSingleCommit bool, expectedSeqNums map[SourceDestPair]ccipocr3.SeqNumRange, @@ -413,7 +415,7 @@ func ConfirmCommitWithExpectedSeqNumRange( func ConfirmExecWithSeqNrsForAll( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, expectedSeqNums map[SourceDestPair][]uint64, startBlocks map[uint64]*uint64, ) (executionStates map[SourceDestPair]map[uint64]int) { @@ -656,3 +658,39 @@ func AssertEqualFeeConfig(t *testing.T, want, have fee_quoter.FeeQuoterDestChain assert.Equal(t, want.MaxNumberOfTokensPerMsg, have.MaxNumberOfTokensPerMsg) assert.Equal(t, want.MaxPerMsgGasLimit, have.MaxPerMsgGasLimit) } + +// AssertTimelockOwnership asserts that the ownership of the contracts has been transferred +// to the appropriate timelock contract on each chain. +func AssertTimelockOwnership( + t *testing.T, + e DeployedEnv, + chains []uint64, + state changeset.CCIPOnChainState, +) { + // check that the ownership has been transferred correctly + for _, chain := range chains { + for _, contract := range []common.Address{ + state.Chains[chain].OnRamp.Address(), + state.Chains[chain].OffRamp.Address(), + state.Chains[chain].FeeQuoter.Address(), + state.Chains[chain].NonceManager.Address(), + state.Chains[chain].RMNRemote.Address(), + } { + owner, _, err := commonchangeset.LoadOwnableContract(contract, e.Env.Chains[chain].Client) + require.NoError(t, err) + require.Equal(t, state.Chains[chain].Timelock.Address(), owner) + } + } + + // check home chain contracts ownership + homeChainTimelockAddress := state.Chains[e.HomeChainSel].Timelock.Address() + for _, contract := range []common.Address{ + state.Chains[e.HomeChainSel].CapabilityRegistry.Address(), + state.Chains[e.HomeChainSel].CCIPHome.Address(), + state.Chains[e.HomeChainSel].RMNHome.Address(), + } { + owner, _, err := commonchangeset.LoadOwnableContract(contract, e.Env.Chains[e.HomeChainSel].Client) + require.NoError(t, err) + require.Equal(t, homeChainTimelockAddress, owner) + } +} diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/testhelpers/test_environment.go similarity index 82% rename from deployment/ccip/changeset/test_environment.go rename to deployment/ccip/changeset/testhelpers/test_environment.go index 16994211010..040dce9f17f 100644 --- a/deployment/ccip/changeset/test_environment.go +++ b/deployment/ccip/changeset/testhelpers/test_environment.go @@ -1,4 +1,4 @@ -package changeset +package testhelpers import ( "context" @@ -20,6 +20,7 @@ import ( jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" @@ -44,7 +45,7 @@ type TestConfigs struct { // TODO: This should be CreateContracts so the booleans make sense? CreateJobAndContracts bool PrerequisiteDeploymentOnly bool - V1_5Cfg V1_5DeploymentConfig + V1_5Cfg changeset.V1_5DeploymentConfig Chains int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input ChainIDs []uint64 // only used in memory mode, for docker mode, this is determined by the integration-test config toml input NumOfUsersPerChain int // only used in memory mode, for docker mode, this is determined by the integration-test config toml input @@ -53,7 +54,7 @@ type TestConfigs struct { IsUSDC bool IsUSDCAttestationMissing bool IsMultiCall3 bool - OCRConfigOverride func(CCIPOCRParams) CCIPOCRParams + OCRConfigOverride func(*changeset.CCIPOCRParams) RMNEnabled bool NumOfRMNNodes int LinkPrice *big.Int @@ -93,8 +94,8 @@ func DefaultTestConfigs() *TestConfigs { NumOfUsersPerChain: 1, Nodes: 4, Bootstraps: 1, - LinkPrice: MockLinkPrice, - WethPrice: MockWethPrice, + LinkPrice: changeset.MockLinkPrice, + WethPrice: changeset.MockWethPrice, CreateJobAndContracts: true, } } @@ -107,7 +108,7 @@ func WithMultiCall3() TestOps { } } -func WithPrerequisiteDeployment(v1_5Cfg *V1_5DeploymentConfig) TestOps { +func WithPrerequisiteDeploymentOnly(v1_5Cfg *changeset.V1_5DeploymentConfig) TestOps { return func(testCfg *TestConfigs) { testCfg.PrerequisiteDeploymentOnly = true if v1_5Cfg != nil { @@ -116,7 +117,7 @@ func WithPrerequisiteDeployment(v1_5Cfg *V1_5DeploymentConfig) TestOps { } } -func WithChainIds(chainIDs []uint64) TestOps { +func WithChainIDs(chainIDs []uint64) TestOps { return func(testCfg *TestConfigs) { testCfg.ChainIDs = chainIDs } @@ -143,7 +144,7 @@ func WithRMNEnabled(numOfNode int) TestOps { } } -func WithOCRConfigOverride(override func(CCIPOCRParams) CCIPOCRParams) TestOps { +func WithOCRConfigOverride(override func(*changeset.CCIPOCRParams)) TestOps { return func(testCfg *TestConfigs) { testCfg.OCRConfigOverride = override } @@ -161,25 +162,25 @@ func WithUSDC() TestOps { } } -func WithChains(numChains int) TestOps { +func WithNumOfChains(numChains int) TestOps { return func(testCfg *TestConfigs) { testCfg.Chains = numChains } } -func WithUsersPerChain(numUsers int) TestOps { +func WithNumOfUsersPerChain(numUsers int) TestOps { return func(testCfg *TestConfigs) { testCfg.NumOfUsersPerChain = numUsers } } -func WithNodes(numNodes int) TestOps { +func WithNumOfNodes(numNodes int) TestOps { return func(testCfg *TestConfigs) { testCfg.Nodes = numNodes } } -func WithBootstraps(numBootstraps int) TestOps { +func WithNumOfBootstrapNodes(numBootstraps int) TestOps { return func(testCfg *TestConfigs) { testCfg.Bootstraps = numBootstraps } @@ -205,7 +206,7 @@ type DeployedEnv struct { func (d *DeployedEnv) TimelockContracts(t *testing.T) map[uint64]*proposalutils.TimelockExecutionContracts { timelocks := make(map[uint64]*proposalutils.TimelockExecutionContracts) - state, err := LoadOnchainState(d.Env) + state, err := changeset.LoadOnchainState(d.Env) require.NoError(t, err) for chain, chainState := range state.Chains { timelocks[chain] = &proposalutils.TimelockExecutionContracts{ @@ -218,7 +219,7 @@ func (d *DeployedEnv) TimelockContracts(t *testing.T) map[uint64]*proposalutils. func (d *DeployedEnv) SetupJobs(t *testing.T) { ctx := testcontext.Get(t) - out, err := CCIPCapabilityJobspec(d.Env, struct{}{}) + out, err := changeset.CCIPCapabilityJobspecChangeset(d.Env, struct{}{}) require.NoError(t, err) for nodeID, jobs := range out.JobSpecs { for _, job := range jobs { @@ -354,21 +355,21 @@ func NewEnvironmentWithPrerequisitesContracts(t *testing.T, tEnv TestEnvironment for _, c := range e.Env.AllChainSelectors() { mcmsCfg[c] = proposalutils.SingleGroupTimelockConfig(t) } - var prereqCfg []DeployPrerequisiteConfigPerChain + prereqCfg := make([]changeset.DeployPrerequisiteConfigPerChain, 0) for _, chain := range allChains { - var opts []PrerequisiteOpt + var opts []changeset.PrerequisiteOpt if tc != nil { if tc.IsUSDC { - opts = append(opts, WithUSDCEnabled()) + opts = append(opts, changeset.WithUSDCEnabled()) } if tc.IsMultiCall3 { - opts = append(opts, WithMultiCall3Enabled()) + opts = append(opts, changeset.WithMultiCall3Enabled()) } } - if tc.V1_5Cfg != (V1_5DeploymentConfig{}) { - opts = append(opts, WithLegacyDeploymentEnabled(tc.V1_5Cfg)) + if tc.V1_5Cfg != (changeset.V1_5DeploymentConfig{}) { + opts = append(opts, changeset.WithLegacyDeploymentEnabled(tc.V1_5Cfg)) } - prereqCfg = append(prereqCfg, DeployPrerequisiteConfigPerChain{ + prereqCfg = append(prereqCfg, changeset.DeployPrerequisiteConfigPerChain{ ChainSelector: chain, Opts: opts, }) @@ -380,8 +381,8 @@ func NewEnvironmentWithPrerequisitesContracts(t *testing.T, tEnv TestEnvironment Config: allChains, }, { - Changeset: commonchangeset.WrapChangeSet(DeployPrerequisites), - Config: DeployPrerequisiteConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployPrerequisitesChangeset), + Config: changeset.DeployPrerequisiteConfig{ Configs: prereqCfg, }, }, @@ -422,18 +423,18 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl mcmsCfg[c] = proposalutils.SingleGroupTimelockConfig(t) } - var prereqCfg []DeployPrerequisiteConfigPerChain + prereqCfg := make([]changeset.DeployPrerequisiteConfigPerChain, 0) for _, chain := range allChains { - var opts []PrerequisiteOpt + var opts []changeset.PrerequisiteOpt if tc != nil { if tc.IsUSDC { - opts = append(opts, WithUSDCEnabled()) + opts = append(opts, changeset.WithUSDCEnabled()) } if tc.IsMultiCall3 { - opts = append(opts, WithMultiCall3Enabled()) + opts = append(opts, changeset.WithMultiCall3Enabled()) } } - prereqCfg = append(prereqCfg, DeployPrerequisiteConfigPerChain{ + prereqCfg = append(prereqCfg, changeset.DeployPrerequisiteConfigPerChain{ ChainSelector: chain, Opts: opts, }) @@ -446,8 +447,8 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl Config: allChains, }, { - Changeset: commonchangeset.WrapChangeSet(DeployPrerequisites), - Config: DeployPrerequisiteConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployPrerequisitesChangeset), + Config: changeset.DeployPrerequisiteConfig{ Configs: prereqCfg, }, }, @@ -462,8 +463,8 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl // now we update RMNProxy to point to RMNRemote e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(SetRMNRemoteOnRMNProxy), - Config: SetRMNRemoteOnRMNProxyConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNRemoteOnRMNProxyChangeset), + Config: changeset.SetRMNRemoteOnRMNProxyConfig{ ChainSelectors: allChains, }, }, @@ -481,8 +482,8 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn // no proposals to be made, timelock can be passed as nil here e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(DeployHomeChain), - Config: DeployHomeChainConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChainChangeset), + Config: changeset.DeployHomeChainConfig{ HomeChainSel: e.HomeChainSel, RMNDynamicConfig: NewTestRMNDynamicConfig(), RMNStaticConfig: NewTestRMNStaticConfig(), @@ -493,8 +494,8 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }, }, { - Changeset: commonchangeset.WrapChangeSet(DeployChainContracts), - Config: DeployChainContractsConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), + Config: changeset.DeployChainContractsConfig{ ChainSelectors: allChains, HomeChainSelector: e.HomeChainSel, }, @@ -502,13 +503,13 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }) require.NoError(t, err) - state, err := LoadOnchainState(e.Env) + state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) // Assert link present require.NotNil(t, state.Chains[e.FeedChainSel].LinkToken) require.NotNil(t, state.Chains[e.FeedChainSel].Weth9) - tokenConfig := NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) + tokenConfig := changeset.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) var tokenDataProviders []pluginconfig.TokenDataObserverConfig if tc.IsUSDC { endpoint := tEnv.MockUSDCAttestationServer(t, tc.IsUSDCAttestationMissing) @@ -533,8 +534,8 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }}) } // Build the per chain config. - ocrConfigs := make(map[uint64]CCIPOCRParams) - chainConfigs := make(map[uint64]ChainConfig) + ocrConfigs := make(map[uint64]changeset.CCIPOCRParams) + chainConfigs := make(map[uint64]changeset.ChainConfig) timelockContractsPerChain := make(map[uint64]*proposalutils.TimelockExecutionContracts) nodeInfo, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) @@ -544,12 +545,12 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn CallProxy: state.Chains[chain].CallProxy, } tokenInfo := tokenConfig.GetTokenInfo(e.Env.Logger, state.Chains[chain].LinkToken, state.Chains[chain].Weth9) - ocrParams := DefaultOCRParams(e.FeedChainSel, tokenInfo, tokenDataProviders, true, true) - if tc.OCRConfigOverride != nil { - ocrParams = tc.OCRConfigOverride(ocrParams) - } + ocrParams := changeset.DeriveCCIPOCRParams(changeset.WithDefaultCommitOffChainConfig(e.FeedChainSel, tokenInfo), + changeset.WithDefaultExecuteOffChainConfig(tokenDataProviders), + changeset.WithOCRParamOverride(tc.OCRConfigOverride), + ) ocrConfigs[chain] = ocrParams - chainConfigs[chain] = ChainConfig{ + chainConfigs[chain] = changeset.ChainConfig{ Readers: nodeInfo.NonBootstraps().PeerIDs(), FChain: uint8(len(nodeInfo.NonBootstraps().PeerIDs()) / 3), EncodableChainConfig: chainconfig.ChainConfig{ @@ -563,21 +564,21 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, timelockContractsPerChain, []commonchangeset.ChangesetApplication{ { // Add the chain configs for the new chains. - Changeset: commonchangeset.WrapChangeSet(UpdateChainConfig), - Config: UpdateChainConfigConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfigChangeset), + Config: changeset.UpdateChainConfigConfig{ HomeChainSelector: e.HomeChainSel, RemoteChainAdds: chainConfigs, }, }, { // Add the DONs and candidate commit OCR instances for the chain. - Changeset: commonchangeset.WrapChangeSet(AddDonAndSetCandidateChangeset), - Config: AddDonAndSetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ + Changeset: commonchangeset.WrapChangeSet(changeset.AddDonAndSetCandidateChangeset), + Config: changeset.AddDonAndSetCandidateChangesetConfig{ + SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: e.HomeChainSel, FeedChainSelector: e.FeedChainSel, }, - PluginInfo: SetCandidatePluginInfo{ + PluginInfo: changeset.SetCandidatePluginInfo{ OCRConfigPerRemoteChainSelector: ocrConfigs, PluginType: types.PluginTypeCCIPCommit, }, @@ -585,13 +586,13 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }, { // Add the exec OCR instances for the new chains. - Changeset: commonchangeset.WrapChangeSet(SetCandidateChangeset), - Config: SetCandidateChangesetConfig{ - SetCandidateConfigBase: SetCandidateConfigBase{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetCandidateChangeset), + Config: changeset.SetCandidateChangesetConfig{ + SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: e.HomeChainSel, FeedChainSelector: e.FeedChainSel, }, - PluginInfo: []SetCandidatePluginInfo{ + PluginInfo: []changeset.SetCandidatePluginInfo{ { OCRConfigPerRemoteChainSelector: ocrConfigs, PluginType: types.PluginTypeCCIPExec, @@ -601,10 +602,10 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }, { // Promote everything - Changeset: commonchangeset.WrapChangeSet(PromoteCandidateChangeset), - Config: PromoteCandidateChangesetConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.PromoteCandidateChangeset), + Config: changeset.PromoteCandidateChangesetConfig{ HomeChainSelector: e.HomeChainSel, - PluginInfo: []PromoteCandidatePluginInfo{ + PluginInfo: []changeset.PromoteCandidatePluginInfo{ { PluginType: types.PluginTypeCCIPCommit, RemoteChainSelectors: allChains, @@ -618,21 +619,21 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }, { // Enable the OCR config on the remote chains. - Changeset: commonchangeset.WrapChangeSet(SetOCR3OffRamp), - Config: SetOCR3OffRampConfig{ + Changeset: commonchangeset.WrapChangeSet(changeset.SetOCR3OffRampChangeset), + Config: changeset.SetOCR3OffRampConfig{ HomeChainSel: e.HomeChainSel, RemoteChainSels: allChains, }, }, { - Changeset: commonchangeset.WrapChangeSet(CCIPCapabilityJobspec), + Changeset: commonchangeset.WrapChangeSet(changeset.CCIPCapabilityJobspecChangeset), }, }) require.NoError(t, err) ReplayLogs(t, e.Env.Offchain, e.ReplayBlocks) - state, err = LoadOnchainState(e.Env) + state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) require.NotNil(t, state.Chains[e.HomeChainSel].CapabilityRegistry) require.NotNil(t, state.Chains[e.HomeChainSel].CCIPHome) diff --git a/deployment/ccip/changeset/test_helpers.go b/deployment/ccip/changeset/testhelpers/test_helpers.go similarity index 89% rename from deployment/ccip/changeset/test_helpers.go rename to deployment/ccip/changeset/testhelpers/test_helpers.go index e0edbc93e12..fc08dc3c6b3 100644 --- a/deployment/ccip/changeset/test_helpers.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers.go @@ -1,4 +1,4 @@ -package changeset +package testhelpers import ( "context" @@ -18,8 +18,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/ethereum/go-ethereum/common" @@ -105,11 +107,16 @@ func DeployTestContracts(t *testing.T, linkPrice *big.Int, wethPrice *big.Int, ) deployment.CapabilityRegistryConfig { - capReg, err := deployCapReg(lggr, - // deploying cap reg for the first time on a blank chain state - CCIPOnChainState{ - Chains: make(map[uint64]CCIPChainState), - }, ab, chains[homeChainSel]) + capReg, err := deployment.DeployContract(lggr, chains[homeChainSel], ab, + func(chain deployment.Chain) deployment.ContractDeploy[*capabilities_registry.CapabilitiesRegistry] { + crAddr, tx, cr, err2 := capabilities_registry.DeployCapabilitiesRegistry( + chain.DeployerKey, + chain.Client, + ) + return deployment.ContractDeploy[*capabilities_registry.CapabilitiesRegistry]{ + Address: crAddr, Contract: cr, Tv: deployment.NewTypeAndVersion(changeset.CapabilitiesRegistry, deployment.Version1_0_0), Tx: tx, Err: err2, + } + }) require.NoError(t, err) _, err = DeployFeeds(lggr, ab, chains[feedChainSel], linkPrice, wethPrice) @@ -178,7 +185,7 @@ func mockAttestationResponse(isFaulty bool) *httptest.Server { func CCIPSendRequest( e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, cfg *CCIPSendReqConfig, ) (*types.Transaction, uint64, error) { msg := router.ClientEVM2AnyMessage{ @@ -266,7 +273,7 @@ func CCIPSendCalldata( func TestSendRequest( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, src, dest uint64, testRouter bool, evm2AnyMessage router.ClientEVM2AnyMessage, @@ -325,7 +332,7 @@ func WithDestChain(destChain uint64) SendReqOpts { func DoSendRequest( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, opts ...SendReqOpts, ) (*onramp.OnRampCCIPMessageSent, error) { cfg := &CCIPSendReqConfig{} @@ -394,9 +401,9 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g var err error e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{ { - Changeset: commoncs.WrapChangeSet(UpdateOnRampsDests), - Config: UpdateOnRampDestsConfig{ - UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{ + Changeset: commoncs.WrapChangeSet(changeset.UpdateOnRampsDestsChangeset), + Config: changeset.UpdateOnRampDestsConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{ from: { to: { IsEnabled: true, @@ -408,9 +415,9 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g }, }, { - Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterPricesCS), - Config: UpdateFeeQuoterPricesConfig{ - PricesByChain: map[uint64]FeeQuoterPriceUpdatePerSource{ + Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesChangeset), + Config: changeset.UpdateFeeQuoterPricesConfig{ + PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{ from: { TokenPrices: tokenPrices, GasPrices: gasprice, @@ -419,8 +426,8 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g }, }, { - Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterDests), - Config: UpdateFeeQuoterDestsConfig{ + Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterDestsChangeset), + Config: changeset.UpdateFeeQuoterDestsConfig{ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ from: { to: fqCfg, @@ -429,9 +436,9 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g }, }, { - Changeset: commoncs.WrapChangeSet(UpdateOffRampSources), - Config: UpdateOffRampSourcesConfig{ - UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{ + Changeset: commoncs.WrapChangeSet(changeset.UpdateOffRampSourcesChangeset), + Config: changeset.UpdateOffRampSourcesConfig{ + UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{ to: { from: { IsEnabled: true, @@ -442,10 +449,10 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g }, }, { - Changeset: commoncs.WrapChangeSet(UpdateRouterRamps), - Config: UpdateRouterRampsConfig{ + Changeset: commoncs.WrapChangeSet(changeset.UpdateRouterRampsChangeset), + Config: changeset.UpdateRouterRampsConfig{ TestRouter: isTestRouter, - UpdatesByChain: map[uint64]RouterUpdates{ + UpdatesByChain: map[uint64]changeset.RouterUpdates{ // onRamp update on source chain from: { OnRampUpdates: map[uint64]bool{ @@ -465,7 +472,7 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g require.NoError(t, err) } -func AddLaneWithDefaultPricesAndFeeQuoterConfig(t *testing.T, e *DeployedEnv, state CCIPOnChainState, from, to uint64, isTestRouter bool) { +func AddLaneWithDefaultPricesAndFeeQuoterConfig(t *testing.T, e *DeployedEnv, state changeset.CCIPOnChainState, from, to uint64, isTestRouter bool) { stateChainFrom := state.Chains[from] AddLane(t, e, from, to, isTestRouter, map[uint64]*big.Int{ @@ -473,12 +480,12 @@ func AddLaneWithDefaultPricesAndFeeQuoterConfig(t *testing.T, e *DeployedEnv, st }, map[common.Address]*big.Int{ stateChainFrom.LinkToken.Address(): DefaultLinkPrice, stateChainFrom.Weth9.Address(): DefaultWethPrice, - }, DefaultFeeQuoterDestChainConfig()) + }, changeset.DefaultFeeQuoterDestChainConfig()) } // AddLanesForAll adds densely connected lanes for all chains in the environment so that each chain // is connected to every other chain except itself. -func AddLanesForAll(t *testing.T, e *DeployedEnv, state CCIPOnChainState) { +func AddLanesForAll(t *testing.T, e *DeployedEnv, state changeset.CCIPOnChainState) { for source := range e.Env.Chains { for dest := range e.Env.Chains { if source != dest { @@ -493,31 +500,6 @@ func ToPackedFee(execFee, daFee *big.Int) *big.Int { return new(big.Int).Or(daShifted, execFee) } -const ( - // MockLinkAggregatorDescription This is the description of the MockV3Aggregator.sol contract - //nolint:lll - // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/tests/MockV3Aggregator.sol#L76-L76 - MockLinkAggregatorDescription = "v0.8/tests/MockV3Aggregator.sol" - // MockWETHAggregatorDescription WETH use description from MockETHUSDAggregator.sol - //nolint:lll - // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/automation/testhelpers/MockETHUSDAggregator.sol#L19-L19 - MockWETHAggregatorDescription = "MockETHUSDAggregator" -) - -var ( - MockLinkPrice = deployment.E18Mult(500) - MockWethPrice = big.NewInt(9e8) - // MockDescriptionToTokenSymbol maps a mock feed description to token descriptor - MockDescriptionToTokenSymbol = map[string]TokenSymbol{ - MockLinkAggregatorDescription: LinkSymbol, - MockWETHAggregatorDescription: WethSymbol, - } - MockSymbolToDescription = map[TokenSymbol]string{ - LinkSymbol: MockLinkAggregatorDescription, - WethSymbol: MockWETHAggregatorDescription, - } -) - func DeployFeeds( lggr logger.Logger, ab deployment.AddressBook, @@ -525,13 +507,13 @@ func DeployFeeds( linkPrice *big.Int, wethPrice *big.Int, ) (map[string]common.Address, error) { - linkTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) + linkTV := deployment.NewTypeAndVersion(changeset.PriceFeed, deployment.Version1_0_0) mockLinkFeed := func(chain deployment.Chain) deployment.ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface] { linkFeed, tx, _, err1 := mock_v3_aggregator_contract.DeployMockV3Aggregator( chain.DeployerKey, chain.Client, - LinkDecimals, // decimals - linkPrice, // initialAnswer + changeset.LinkDecimals, // decimals + linkPrice, // initialAnswer ) aggregatorCr, err2 := aggregator_v3_interface.NewAggregatorV3Interface(linkFeed, chain.Client) @@ -553,12 +535,12 @@ func DeployFeeds( } } - linkFeedAddress, linkFeedDescription, err := deploySingleFeed(lggr, ab, chain, mockLinkFeed, LinkSymbol) + linkFeedAddress, linkFeedDescription, err := deploySingleFeed(lggr, ab, chain, mockLinkFeed, changeset.LinkSymbol) if err != nil { return nil, err } - wethFeedAddress, wethFeedDescription, err := deploySingleFeed(lggr, ab, chain, mockWethFeed, WethSymbol) + wethFeedAddress, wethFeedDescription, err := deploySingleFeed(lggr, ab, chain, mockWethFeed, changeset.WethSymbol) if err != nil { return nil, err } @@ -576,7 +558,7 @@ func deploySingleFeed( ab deployment.AddressBook, chain deployment.Chain, deployFunc func(deployment.Chain) deployment.ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface], - symbol TokenSymbol, + symbol changeset.TokenSymbol, ) (common.Address, string, error) { // tokenTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) mockTokenFeed, err := deployment.DeployContract(lggr, chain, ab, deployFunc) @@ -593,7 +575,7 @@ func deploySingleFeed( return common.Address{}, "", err } - if desc != MockSymbolToDescription[symbol] { + if desc != changeset.MockSymbolToDescription[symbol] { lggr.Errorw("Unexpected description for token", "symbol", symbol, "desc", desc) return common.Address{}, "", fmt.Errorf("unexpected description: %s", desc) } @@ -601,7 +583,7 @@ func deploySingleFeed( return mockTokenFeed.Address, desc, nil } -func ConfirmRequestOnSourceAndDest(t *testing.T, env deployment.Environment, state CCIPOnChainState, sourceCS, destCS, expectedSeqNr uint64) error { +func ConfirmRequestOnSourceAndDest(t *testing.T, env deployment.Environment, state changeset.CCIPOnChainState, sourceCS, destCS, expectedSeqNr uint64) error { latesthdr, err := env.Chains[destCS].Client.HeaderByNumber(testcontext.Get(t), nil) require.NoError(t, err) startBlock := latesthdr.Number.Uint64() @@ -645,7 +627,7 @@ func DeployTransferableToken( chains map[uint64]deployment.Chain, src, dst uint64, srcActor, dstActor *bind.TransactOpts, - state CCIPOnChainState, + state changeset.CCIPOnChainState, addresses deployment.AddressBook, token string, ) (*burn_mint_erc677.BurnMintERC677, *burn_mint_token_pool.BurnMintTokenPool, *burn_mint_erc677.BurnMintERC677, *burn_mint_token_pool.BurnMintTokenPool, error) { @@ -689,7 +671,7 @@ func deployTokenPoolsInParallel( chains map[uint64]deployment.Chain, src, dst uint64, srcActor, dstActor *bind.TransactOpts, - state CCIPOnChainState, + state changeset.CCIPOnChainState, addresses deployment.AddressBook, token string, ) ( @@ -833,7 +815,7 @@ func setTokenPoolCounterPart(chain deployment.Chain, tokenPool *burn_mint_token_ func attachTokenToTheRegistry( chain deployment.Chain, - state CCIPChainState, + state changeset.CCIPChainState, owner *bind.TransactOpts, token common.Address, tokenPool common.Address, @@ -889,10 +871,10 @@ func deployTransferTokenOneEnd( return nil, nil, err } for address, v := range chainAddresses { - if deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_0_0) == v { + if deployment.NewTypeAndVersion(changeset.ARMProxy, deployment.Version1_0_0) == v { rmnAddress = address } - if deployment.NewTypeAndVersion(Router, deployment.Version1_2_0) == v { + if deployment.NewTypeAndVersion(changeset.Router, deployment.Version1_2_0) == v { routerAddress = address } if rmnAddress != "" && routerAddress != "" { @@ -913,7 +895,7 @@ func deployTransferTokenOneEnd( big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), ) return deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ - Address: tokenAddress, Contract: token, Tx: tx, Tv: deployment.NewTypeAndVersion(BurnMintToken, deployment.Version1_0_0), Err: err2, + Address: tokenAddress, Contract: token, Tx: tx, Tv: deployment.NewTypeAndVersion(changeset.BurnMintToken, deployment.Version1_0_0), Err: err2, } }) if err != nil { @@ -942,7 +924,7 @@ func deployTransferTokenOneEnd( common.HexToAddress(routerAddress), ) return deployment.ContractDeploy[*burn_mint_token_pool.BurnMintTokenPool]{ - Address: tokenPoolAddress, Contract: tokenPoolContract, Tx: tx, Tv: deployment.NewTypeAndVersion(BurnMintTokenPool, deployment.Version1_5_1), Err: err2, + Address: tokenPoolAddress, Contract: tokenPoolContract, Tx: tx, Tv: deployment.NewTypeAndVersion(changeset.BurnMintTokenPool, deployment.Version1_5_1), Err: err2, } }) if err != nil { @@ -971,7 +953,7 @@ func NewMintTokenWithCustomSender(auth *bind.TransactOpts, sender *bind.Transact func MintAndAllow( t *testing.T, e deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, tokenMap map[uint64][]MintTokenInfo, ) { configurePoolGrp := errgroup.Group{} @@ -1014,7 +996,7 @@ func Transfer( ctx context.Context, t *testing.T, env deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, sourceChain, destChain uint64, tokens []router.ClientEVMTokenAmount, receiver common.Address, @@ -1060,7 +1042,7 @@ func TransferMultiple( ctx context.Context, t *testing.T, env deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, requests []TestTransferRequest, ) ( map[uint64]*uint64, @@ -1114,7 +1096,7 @@ func TransferAndWaitForSuccess( ctx context.Context, t *testing.T, env deployment.Environment, - state CCIPOnChainState, + state changeset.CCIPOnChainState, sourceChain, destChain uint64, tokens []router.ClientEVMTokenAmount, receiver common.Address, @@ -1253,3 +1235,41 @@ func DefaultRouterMessage(receiverAddress common.Address) router.ClientEVM2AnyMe ExtraArgs: nil, } } + +func GenTestTransferOwnershipConfig( + e DeployedEnv, + chains []uint64, + state changeset.CCIPOnChainState, +) commoncs.TransferToMCMSWithTimelockConfig { + var ( + timelocksPerChain = make(map[uint64]common.Address) + contracts = make(map[uint64][]common.Address) + ) + + // chain contracts + for _, chain := range chains { + timelocksPerChain[chain] = state.Chains[chain].Timelock.Address() + contracts[chain] = []common.Address{ + state.Chains[chain].OnRamp.Address(), + state.Chains[chain].OffRamp.Address(), + state.Chains[chain].FeeQuoter.Address(), + state.Chains[chain].NonceManager.Address(), + state.Chains[chain].RMNRemote.Address(), + state.Chains[chain].TestRouter.Address(), + state.Chains[chain].Router.Address(), + } + } + + // home chain + homeChainTimelockAddress := state.Chains[e.HomeChainSel].Timelock.Address() + timelocksPerChain[e.HomeChainSel] = homeChainTimelockAddress + contracts[e.HomeChainSel] = append(contracts[e.HomeChainSel], + state.Chains[e.HomeChainSel].CapabilityRegistry.Address(), + state.Chains[e.HomeChainSel].CCIPHome.Address(), + state.Chains[e.HomeChainSel].RMNHome.Address(), + ) + + return commoncs.TransferToMCMSWithTimelockConfig{ + ContractsByChain: contracts, + } +} diff --git a/deployment/ccip/changeset/test_params.go b/deployment/ccip/changeset/testhelpers/test_params.go similarity index 97% rename from deployment/ccip/changeset/test_params.go rename to deployment/ccip/changeset/testhelpers/test_params.go index 90331b50675..8e43c08919f 100644 --- a/deployment/ccip/changeset/test_params.go +++ b/deployment/ccip/changeset/testhelpers/test_params.go @@ -1,4 +1,4 @@ -package changeset +package testhelpers import ( "github.com/ethereum/go-ethereum/common" diff --git a/deployment/ccip/changeset/testhelpers/test_usdc_helpers.go b/deployment/ccip/changeset/testhelpers/test_usdc_helpers.go new file mode 100644 index 00000000000..ebaa3b8ec37 --- /dev/null +++ b/deployment/ccip/changeset/testhelpers/test_usdc_helpers.go @@ -0,0 +1,140 @@ +package testhelpers + +import ( + "golang.org/x/sync/errgroup" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" +) + +func ConfigureUSDCTokenPools( + lggr logger.Logger, + chains map[uint64]deployment.Chain, + src, dst uint64, + state changeset.CCIPOnChainState, +) (*burn_mint_erc677.BurnMintERC677, *burn_mint_erc677.BurnMintERC677, error) { + srcToken := state.Chains[src].BurnMintTokens677[changeset.USDCSymbol] + dstToken := state.Chains[dst].BurnMintTokens677[changeset.USDCSymbol] + srcPool := state.Chains[src].USDCTokenPool + dstPool := state.Chains[dst].USDCTokenPool + + args := []struct { + sourceChain deployment.Chain + dstChainSel uint64 + state changeset.CCIPChainState + srcToken *burn_mint_erc677.BurnMintERC677 + srcPool *usdc_token_pool.USDCTokenPool + dstToken *burn_mint_erc677.BurnMintERC677 + dstPool *usdc_token_pool.USDCTokenPool + }{ + { + chains[src], + dst, + state.Chains[src], + srcToken, + srcPool, + dstToken, + dstPool, + }, + { + chains[dst], + src, + state.Chains[dst], + dstToken, + dstPool, + srcToken, + srcPool, + }, + } + + configurePoolGrp := errgroup.Group{} + for _, arg := range args { + configurePoolGrp.Go(configureSingleChain(lggr, arg.sourceChain, arg.dstChainSel, arg.state, arg.srcToken, arg.srcPool, arg.dstToken, arg.dstPool)) + } + if err := configurePoolGrp.Wait(); err != nil { + return nil, nil, err + } + return srcToken, dstToken, nil +} + +func configureSingleChain( + lggr logger.Logger, + sourceChain deployment.Chain, + dstChainSel uint64, + state changeset.CCIPChainState, + srcToken *burn_mint_erc677.BurnMintERC677, + srcPool *usdc_token_pool.USDCTokenPool, + dstToken *burn_mint_erc677.BurnMintERC677, + dstPool *usdc_token_pool.USDCTokenPool, +) func() error { + return func() error { + if err := attachTokenToTheRegistry(sourceChain, state, sourceChain.DeployerKey, srcToken.Address(), srcPool.Address()); err != nil { + lggr.Errorw("Failed to attach token to the registry", "err", err, "token", srcToken.Address(), "pool", srcPool.Address()) + return err + } + + if err := setUSDCTokenPoolCounterPart(sourceChain, srcPool, dstChainSel, sourceChain.DeployerKey, dstToken.Address(), dstPool.Address()); err != nil { + lggr.Errorw("Failed to set counter part", "err", err, "srcPool", srcPool.Address(), "dstPool", dstPool.Address()) + return err + } + + for _, addr := range []common.Address{ + srcPool.Address(), + state.MockUSDCTokenMessenger.Address(), + state.MockUSDCTransmitter.Address(), + } { + if err := grantMintBurnPermissions(lggr, sourceChain, srcToken, sourceChain.DeployerKey, addr); err != nil { + lggr.Errorw("Failed to grant mint/burn permissions", "err", err, "token", srcToken.Address(), "address", addr) + return err + } + } + return nil + } +} + +func UpdateFeeQuoterForUSDC( + lggr logger.Logger, + chain deployment.Chain, + state changeset.CCIPChainState, + dstChain uint64, + usdcToken *burn_mint_erc677.BurnMintERC677, +) error { + config := []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{ + { + DestChainSelector: dstChain, + TokenTransferFeeConfigs: []fee_quoter.FeeQuoterTokenTransferFeeConfigSingleTokenArgs{ + { + Token: usdcToken.Address(), + TokenTransferFeeConfig: fee_quoter.FeeQuoterTokenTransferFeeConfig{ + MinFeeUSDCents: 50, + MaxFeeUSDCents: 50_000, + DeciBps: 0, + DestGasOverhead: 180_000, + DestBytesOverhead: 640, + IsEnabled: true, + }, + }, + }, + }, + } + + tx, err := state.FeeQuoter.ApplyTokenTransferFeeConfigUpdates( + chain.DeployerKey, + config, + []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs{}, + ) + if err != nil { + lggr.Errorw("Failed to apply token transfer fee config updates", "err", err, "config", config) + return err + } + + _, err = chain.Confirm(tx) + return err +} diff --git a/deployment/ccip/changeset/v1_5/test_helpers.go b/deployment/ccip/changeset/testhelpers/v1_5/test_helpers.go similarity index 87% rename from deployment/ccip/changeset/v1_5/test_helpers.go rename to deployment/ccip/changeset/testhelpers/v1_5/test_helpers.go index 671089a5546..be2804c6527 100644 --- a/deployment/ccip/changeset/v1_5/test_helpers.go +++ b/deployment/ccip/changeset/testhelpers/v1_5/test_helpers.go @@ -21,35 +21,37 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + v1_5changeset "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + plugintesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" ) -func AddLanes(t *testing.T, e deployment.Environment, state changeset.CCIPOnChainState, pairs []changeset.SourceDestPair) deployment.Environment { +func AddLanes(t *testing.T, e deployment.Environment, state changeset.CCIPOnChainState, pairs []testhelpers.SourceDestPair) deployment.Environment { addLanesCfg, commitOCR2Configs, execOCR2Configs, jobspecs := LaneConfigsForChains(t, e, state, pairs) var err error e, err = commonchangeset.ApplyChangesets(t, e, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(DeployLanes), - Config: DeployLanesConfig{ + Changeset: commonchangeset.WrapChangeSet(v1_5changeset.DeployLanesChangeset), + Config: v1_5changeset.DeployLanesConfig{ Configs: addLanesCfg, }, }, { - Changeset: commonchangeset.WrapChangeSet(SetOCR2ConfigForTest), - Config: OCR2Config{ + Changeset: commonchangeset.WrapChangeSet(v1_5changeset.SetOCR2ConfigForTestChangeset), + Config: v1_5changeset.OCR2Config{ CommitConfigs: commitOCR2Configs, ExecConfigs: execOCR2Configs, }, }, { - Changeset: commonchangeset.WrapChangeSet(JobSpecsForLanes), - Config: JobSpecsForLanesConfig{ + Changeset: commonchangeset.WrapChangeSet(v1_5changeset.JobSpecsForLanesChangeset), + Config: v1_5changeset.JobSpecsForLanesConfig{ Configs: jobspecs, }, }, @@ -58,16 +60,16 @@ func AddLanes(t *testing.T, e deployment.Environment, state changeset.CCIPOnChai return e } -func LaneConfigsForChains(t *testing.T, env deployment.Environment, state changeset.CCIPOnChainState, pairs []changeset.SourceDestPair) ( - []DeployLaneConfig, - []CommitOCR2ConfigParams, - []ExecuteOCR2ConfigParams, - []JobSpecInput, +func LaneConfigsForChains(t *testing.T, env deployment.Environment, state changeset.CCIPOnChainState, pairs []testhelpers.SourceDestPair) ( + []v1_5changeset.DeployLaneConfig, + []v1_5changeset.CommitOCR2ConfigParams, + []v1_5changeset.ExecuteOCR2ConfigParams, + []v1_5changeset.JobSpecInput, ) { - var addLanesCfg []DeployLaneConfig - var commitOCR2Configs []CommitOCR2ConfigParams - var execOCR2Configs []ExecuteOCR2ConfigParams - var jobSpecs []JobSpecInput + addLanesCfg := make([]v1_5changeset.DeployLaneConfig, 0) + commitOCR2Configs := make([]v1_5changeset.CommitOCR2ConfigParams, 0) + execOCR2Configs := make([]v1_5changeset.ExecuteOCR2ConfigParams, 0) + jobSpecs := make([]v1_5changeset.JobSpecInput, 0) for _, pair := range pairs { dest := pair.DestChainSelector src := pair.SourceChainSelector @@ -91,7 +93,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change require.NoError(t, err) destEVMChainId, err := strconv.ParseUint(destEVMChainIdStr, 10, 64) require.NoError(t, err) - jobSpecs = append(jobSpecs, JobSpecInput{ + jobSpecs = append(jobSpecs, v1_5changeset.JobSpecInput{ SourceChainSelector: src, DestinationChainSelector: dest, DestEVMChainID: destEVMChainId, @@ -100,7 +102,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change }) srcLinkTokenAddr, err := sourceChainState.LinkTokenAddress() require.NoError(t, err) - addLanesCfg = append(addLanesCfg, DeployLaneConfig{ + addLanesCfg = append(addLanesCfg, v1_5changeset.DeployLaneConfig{ SourceChainSelector: src, DestinationChainSelector: dest, OnRampStaticCfg: evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ @@ -157,13 +159,13 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change OnRampNopsAndWeight: []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, OnRampRateLimiterCfg: evm_2_evm_onramp.RateLimiterConfig{ IsEnabled: true, - Capacity: testhelpers.LinkUSDValue(100), - Rate: testhelpers.LinkUSDValue(1), + Capacity: plugintesthelpers.LinkUSDValue(100), + Rate: plugintesthelpers.LinkUSDValue(1), }, OffRampRateLimiterCfg: evm_2_evm_offramp.RateLimiterConfig{ IsEnabled: true, - Capacity: testhelpers.LinkUSDValue(100), - Rate: testhelpers.LinkUSDValue(1), + Capacity: plugintesthelpers.LinkUSDValue(100), + Rate: plugintesthelpers.LinkUSDValue(1), }, InitialTokenPrices: []price_registry_1_2_0.InternalTokenPriceUpdate{ { @@ -182,7 +184,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change }, }, }) - commitOCR2Configs = append(commitOCR2Configs, CommitOCR2ConfigParams{ + commitOCR2Configs = append(commitOCR2Configs, v1_5changeset.CommitOCR2ConfigParams{ SourceChainSelector: src, DestinationChainSelector: dest, OCR2ConfigParams: DefaultOCRParams(), @@ -194,7 +196,7 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change InflightCacheExpiry: *config.MustNewDuration(5 * time.Second), PriceReportingDisabled: false, }) - execOCR2Configs = append(execOCR2Configs, ExecuteOCR2ConfigParams{ + execOCR2Configs = append(execOCR2Configs, v1_5changeset.ExecuteOCR2ConfigParams{ DestinationChainSelector: dest, SourceChainSelector: src, DestOptimisticConfirmations: 1, @@ -271,9 +273,9 @@ func SendRequest( t *testing.T, e deployment.Environment, state changeset.CCIPOnChainState, - opts ...changeset.SendReqOpts, + opts ...testhelpers.SendReqOpts, ) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested, error) { - cfg := &changeset.CCIPSendReqConfig{} + cfg := &testhelpers.CCIPSendReqConfig{} for _, opt := range opts { opt(cfg) } @@ -283,7 +285,7 @@ func SendRequest( } t.Logf("Sending CCIP request from chain selector %d to chain selector %d from sender %s", cfg.SourceChain, cfg.DestChain, cfg.Sender.From.String()) - tx, blockNum, err := changeset.CCIPSendRequest(e, state, cfg) + tx, blockNum, err := testhelpers.CCIPSendRequest(e, state, cfg) if err != nil { return nil, err } diff --git a/deployment/ccip/changeset/token_info.go b/deployment/ccip/changeset/token_info.go index 84f728df9f4..379119dba92 100644 --- a/deployment/ccip/changeset/token_info.go +++ b/deployment/ccip/changeset/token_info.go @@ -1,11 +1,16 @@ package changeset import ( + "math/big" + "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/link_token" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/aggregator_v3_interface" ) @@ -20,9 +25,26 @@ const ( LinkDecimals = 18 WethDecimals = 18 UsdcDecimals = 6 + // MockLinkAggregatorDescription is the description of the MockV3Aggregator.sol contract + // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/tests/MockV3Aggregator.sol#L76-L76 + MockLinkAggregatorDescription = "v0.8/tests/MockV3Aggregator.sol" + // MockWETHAggregatorDescription is the description from MockETHUSDAggregator.sol + // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/automation/testhelpers/MockETHUSDAggregator.sol#L19-L19 + MockWETHAggregatorDescription = "MockETHUSDAggregator" ) var ( + MockLinkPrice = deployment.E18Mult(500) + MockWethPrice = big.NewInt(9e8) + // MockDescriptionToTokenSymbol maps a mock feed description to token descriptor + MockDescriptionToTokenSymbol = map[string]TokenSymbol{ + MockLinkAggregatorDescription: LinkSymbol, + MockWETHAggregatorDescription: WethSymbol, + } + MockSymbolToDescription = map[TokenSymbol]string{ + LinkSymbol: MockLinkAggregatorDescription, + WethSymbol: MockWETHAggregatorDescription, + } TestDeviationPPB = ccipocr3.NewBigIntFromInt64(1e9) ) diff --git a/deployment/ccip/changeset/v1_5/cs_jobspec.go b/deployment/ccip/changeset/v1_5/cs_jobspec.go index e1cd73f1e30..fd80a392136 100644 --- a/deployment/ccip/changeset/v1_5/cs_jobspec.go +++ b/deployment/ccip/changeset/v1_5/cs_jobspec.go @@ -10,6 +10,8 @@ import ( integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" ) +var _ deployment.ChangeSet[JobSpecsForLanesConfig] = JobSpecsForLanesChangeset + type JobSpecsForLanesConfig struct { Configs []JobSpecInput } @@ -55,7 +57,7 @@ func (j JobSpecInput) Validate() error { return nil } -func JobSpecsForLanes(env deployment.Environment, c JobSpecsForLanesConfig) (deployment.ChangesetOutput, error) { +func JobSpecsForLanesChangeset(env deployment.Environment, c JobSpecsForLanesConfig) (deployment.ChangesetOutput, error) { if err := c.Validate(); err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("invalid JobSpecsForLanesConfig: %w", err) } diff --git a/deployment/ccip/changeset/v1_5/cs_lane_contracts.go b/deployment/ccip/changeset/v1_5/cs_lane_contracts.go index 25e14c898ff..6f6f0d54a69 100644 --- a/deployment/ccip/changeset/v1_5/cs_lane_contracts.go +++ b/deployment/ccip/changeset/v1_5/cs_lane_contracts.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) -var _ deployment.ChangeSet[DeployLanesConfig] = DeployLanes +var _ deployment.ChangeSet[DeployLanesConfig] = DeployLanesChangeset type DeployLanesConfig struct { Configs []DeployLaneConfig @@ -83,7 +83,22 @@ func (c *DeployLaneConfig) Validate(e deployment.Environment, state changeset.CC return nil } -func DeployLanes(env deployment.Environment, c DeployLanesConfig) (deployment.ChangesetOutput, error) { +func (c *DeployLaneConfig) populateAddresses(state changeset.CCIPOnChainState) error { + sourceChainState := state.Chains[c.SourceChainSelector] + srcLink, err := sourceChainState.LinkTokenAddress() + if err != nil { + return fmt.Errorf("failed to get LINK token address for source chain %d: %w", c.SourceChainSelector, err) + } + c.OnRampStaticCfg.LinkToken = srcLink + c.OnRampStaticCfg.RmnProxy = sourceChainState.RMNProxy.Address() + c.OnRampStaticCfg.TokenAdminRegistry = sourceChainState.TokenAdminRegistry.Address() + + c.OnRampDynamicCfg.Router = sourceChainState.Router.Address() + c.OnRampDynamicCfg.PriceRegistry = sourceChainState.PriceRegistry.Address() + return nil +} + +func DeployLanesChangeset(env deployment.Environment, c DeployLanesConfig) (deployment.ChangesetOutput, error) { state, err := changeset.LoadOnchainState(env) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load CCIP onchain state: %w", err) @@ -91,6 +106,12 @@ func DeployLanes(env deployment.Environment, c DeployLanesConfig) (deployment.Ch if err := c.Validate(env, state); err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("invalid DeployChainContractsConfig: %w", err) } + // populate addresses from the state + for i := range c.Configs { + if err := c.Configs[i].populateAddresses(state); err != nil { + return deployment.ChangesetOutput{}, err + } + } newAddresses := deployment.NewMemoryAddressBook() for _, cfg := range c.Configs { if err := deployLane(env, state, newAddresses, cfg); err != nil { diff --git a/deployment/ccip/changeset/v1_5/cs_ocr2_config.go b/deployment/ccip/changeset/v1_5/cs_ocr2_config.go index 497bcb53ad8..2babf666da2 100644 --- a/deployment/ccip/changeset/v1_5/cs_ocr2_config.go +++ b/deployment/ccip/changeset/v1_5/cs_ocr2_config.go @@ -17,6 +17,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" ) +var _ deployment.ChangeSet[OCR2Config] = SetOCR2ConfigForTestChangeset + type FinalOCR2Config struct { Signers []common.Address Transmitters []common.Address @@ -175,9 +177,9 @@ func (o OCR2Config) Validate(state changeset.CCIPOnChainState) error { return nil } -// SetOCR2ConfigForTest sets the OCR2 config on the chain for commit and offramp +// SetOCR2ConfigForTestChangeset sets the OCR2 config on the chain for commit and offramp // This is currently not suitable for prod environments it's only for testing -func SetOCR2ConfigForTest(env deployment.Environment, c OCR2Config) (deployment.ChangesetOutput, error) { +func SetOCR2ConfigForTestChangeset(env deployment.Environment, c OCR2Config) (deployment.ChangesetOutput, error) { state, err := changeset.LoadOnchainState(env) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to load CCIP onchain state: %w", err) diff --git a/deployment/ccip/changeset/v1_5/cs_rmn.go b/deployment/ccip/changeset/v1_5/cs_rmn.go index df96645b9bf..ffe20294873 100644 --- a/deployment/ccip/changeset/v1_5/cs_rmn.go +++ b/deployment/ccip/changeset/v1_5/cs_rmn.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) -var _ deployment.ChangeSet[PermaBlessCommitStoreConfig] = PermaBlessCommitStoreCS +var _ deployment.ChangeSet[PermaBlessCommitStoreConfig] = PermaBlessCommitStoreChangeset type PermaBlessConfigPerSourceChain struct { SourceChainSelector uint64 @@ -96,10 +96,10 @@ func (c PermaBlessCommitStoreConfig) Validate(env deployment.Environment) error return nil } -// PermaBlessCommitStoreCS permablesses the commit stores on the RMN contract +// PermaBlessCommitStoreChangeset permablesses the commit stores on the RMN contract // If commit store addresses are added to the permaBlessed list, those will be considered automatically blessed. // This changeset can add to or remove from the existing permaBlessed list. -func PermaBlessCommitStoreCS(env deployment.Environment, c PermaBlessCommitStoreConfig) (deployment.ChangesetOutput, error) { +func PermaBlessCommitStoreChangeset(env deployment.Environment, c PermaBlessCommitStoreConfig) (deployment.ChangesetOutput, error) { if err := c.Validate(env); err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("invalid PermaBlessCommitStoreConfig: %w", err) } diff --git a/deployment/ccip/changeset/v1_5/e2e_test.go b/deployment/ccip/changeset/v1_5/e2e_test.go index 59d6a30066c..8911dcc8bf4 100644 --- a/deployment/ccip/changeset/v1_5/e2e_test.go +++ b/deployment/ccip/changeset/v1_5/e2e_test.go @@ -1,4 +1,4 @@ -package v1_5 +package v1_5_test import ( "context" @@ -9,6 +9,9 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers/v1_5" + v1_5changeset "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" @@ -18,9 +21,9 @@ import ( // This test only works if the destination chain id is 1337 // Otherwise it shows error for offchain and onchain config digest mismatch func TestE2ELegacy(t *testing.T) { - e, _ := changeset.NewMemoryEnvironment( + e, _ := testhelpers.NewMemoryEnvironment( t, - changeset.WithPrerequisiteDeployment(&changeset.V1_5DeploymentConfig{ + testhelpers.WithPrerequisiteDeploymentOnly(&changeset.V1_5DeploymentConfig{ PriceRegStalenessThreshold: 60 * 60 * 24 * 14, // two weeks RMNConfig: &rmn_contract.RMNConfig{ BlessWeightThreshold: 2, @@ -36,8 +39,8 @@ func TestE2ELegacy(t *testing.T) { }, }, }), - changeset.WithChains(3), - changeset.WithChainIds([]uint64{chainselectors.GETH_TESTNET.EvmChainID})) + testhelpers.WithNumOfChains(3), + testhelpers.WithChainIDs([]uint64{chainselectors.GETH_TESTNET.EvmChainID})) state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) allChains := e.Env.AllChainSelectorsExcluding([]uint64{chainselectors.GETH_TESTNET.Selector}) @@ -46,18 +49,18 @@ func TestE2ELegacy(t *testing.T) { src, dest := allChains[1], chainselectors.GETH_TESTNET.Selector srcChain := e.Env.Chains[src] destChain := e.Env.Chains[dest] - pairs := []changeset.SourceDestPair{ + pairs := []testhelpers.SourceDestPair{ {SourceChainSelector: src, DestChainSelector: dest}, } - e.Env = AddLanes(t, e.Env, state, pairs) + e.Env = v1_5.AddLanes(t, e.Env, state, pairs) // permabless the commit stores e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(PermaBlessCommitStoreCS), - Config: PermaBlessCommitStoreConfig{ - Configs: map[uint64]PermaBlessCommitStoreConfigPerDest{ + Changeset: commonchangeset.WrapChangeSet(v1_5changeset.PermaBlessCommitStoreChangeset), + Config: v1_5changeset.PermaBlessCommitStoreConfig{ + Configs: map[uint64]v1_5changeset.PermaBlessCommitStoreConfigPerDest{ dest: { - Sources: []PermaBlessConfigPerSourceChain{ + Sources: []v1_5changeset.PermaBlessConfigPerSourceChain{ { SourceChainSelector: src, PermaBless: true, @@ -72,11 +75,11 @@ func TestE2ELegacy(t *testing.T) { // reload state after adding lanes state, err = changeset.LoadOnchainState(e.Env) require.NoError(t, err) - sentEvent, err := SendRequest(t, e.Env, state, - changeset.WithSourceChain(src), - changeset.WithDestChain(dest), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + sentEvent, err := v1_5.SendRequest(t, e.Env, state, + testhelpers.WithSourceChain(src), + testhelpers.WithDestChain(dest), + testhelpers.WithTestRouter(false), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, @@ -88,6 +91,6 @@ func TestE2ELegacy(t *testing.T) { require.NotNil(t, sentEvent) destStartBlock, err := destChain.Client.HeaderByNumber(context.Background(), nil) require.NoError(t, err) - WaitForCommit(t, srcChain, destChain, state.Chains[dest].CommitStore[src], sentEvent.Message.SequenceNumber) - WaitForExecute(t, srcChain, destChain, state.Chains[dest].EVM2EVMOffRamp[src], []uint64{sentEvent.Message.SequenceNumber}, destStartBlock.Number.Uint64()) + v1_5.WaitForCommit(t, srcChain, destChain, state.Chains[dest].CommitStore[src], sentEvent.Message.SequenceNumber) + v1_5.WaitForExecute(t, srcChain, destChain, state.Chains[dest].EVM2EVMOffRamp[src], []uint64{sentEvent.Message.SequenceNumber}, destStartBlock.Number.Uint64()) } diff --git a/deployment/ccip/changeset/view_test.go b/deployment/ccip/changeset/view_test.go index 16d1f8a0dfc..cb798835cd7 100644 --- a/deployment/ccip/changeset/view_test.go +++ b/deployment/ccip/changeset/view_test.go @@ -1,14 +1,17 @@ -package changeset +package changeset_test import ( "testing" "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" ) func TestSmokeView(t *testing.T) { t.Parallel() - tenv, _ := NewMemoryEnvironment(t, WithChains(3)) - _, err := ViewCCIP(tenv.Env) + tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) + _, err := changeset.ViewCCIP(tenv.Env) require.NoError(t, err) } diff --git a/deployment/common/changeset/save_existing.go b/deployment/common/changeset/save_existing.go index 57e53607cdc..17fdc0a8025 100644 --- a/deployment/common/changeset/save_existing.go +++ b/deployment/common/changeset/save_existing.go @@ -11,7 +11,7 @@ import ( ) var ( - _ deployment.ChangeSet[ExistingContractsConfig] = SaveExistingContracts + _ deployment.ChangeSet[ExistingContractsConfig] = SaveExistingContractsChangeset ) type Contract struct { @@ -42,9 +42,9 @@ func (cfg ExistingContractsConfig) Validate() error { return nil } -// SaveExistingContracts saves the existing contracts to the address book. +// SaveExistingContractsChangeset saves the existing contracts to the address book. // Caller should update the environment's address book with the returned addresses. -func SaveExistingContracts(env deployment.Environment, cfg ExistingContractsConfig) (deployment.ChangesetOutput, error) { +func SaveExistingContractsChangeset(env deployment.Environment, cfg ExistingContractsConfig) (deployment.ChangesetOutput, error) { err := cfg.Validate() if err != nil { return deployment.ChangesetOutput{}, errors.Wrapf(deployment.ErrInvalidConfig, "%v", err) diff --git a/deployment/common/changeset/save_existing_test.go b/deployment/common/changeset/save_existing_test.go index 2a2618c8f54..a7e8c9068f3 100644 --- a/deployment/common/changeset/save_existing_test.go +++ b/deployment/common/changeset/save_existing_test.go @@ -43,7 +43,7 @@ func TestSaveExisting(t *testing.T) { }, } - output, err := SaveExistingContracts(dummyEnv, ExistingContracts) + output, err := SaveExistingContractsChangeset(dummyEnv, ExistingContracts) require.NoError(t, err) require.NoError(t, dummyEnv.ExistingAddresses.Merge(output.AddressBook)) addresses, err := dummyEnv.ExistingAddresses.Addresses() diff --git a/deployment/environment/crib/ccip_deployer.go b/deployment/environment/crib/ccip_deployer.go index 639e42b4024..9aa7972585d 100644 --- a/deployment/environment/crib/ccip_deployer.go +++ b/deployment/environment/crib/ccip_deployer.go @@ -12,8 +12,10 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chainconfig" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/devenv" @@ -23,7 +25,7 @@ import ( ) // DeployHomeChainContracts deploys the home chain contracts so that the chainlink nodes can use the CR address in Capabilities.ExternalRegistry -// Afterwards, we call DeployHomeChain changeset with nodeinfo ( the peer id and all) +// Afterwards, we call DeployHomeChainChangeset changeset with nodeinfo ( the peer id and all) func DeployHomeChainContracts(ctx context.Context, lggr logger.Logger, envConfig devenv.EnvironmentConfig, homeChainSel uint64, feedChainSel uint64) (deployment.CapabilityRegistryConfig, deployment.AddressBook, error) { e, _, err := devenv.NewEnvironment(func() context.Context { return ctx }, lggr, envConfig) if err != nil { @@ -40,12 +42,12 @@ func DeployHomeChainContracts(ctx context.Context, lggr logger.Logger, envConfig p2pIds := nodes.NonBootstraps().PeerIDs() *e, err = commonchangeset.ApplyChangesets(nil, *e, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChain), + Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChainChangeset), Config: changeset.DeployHomeChainConfig{ HomeChainSel: homeChainSel, - RMNStaticConfig: changeset.NewTestRMNStaticConfig(), - RMNDynamicConfig: changeset.NewTestRMNDynamicConfig(), - NodeOperators: changeset.NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), + RMNStaticConfig: testhelpers.NewTestRMNStaticConfig(), + RMNDynamicConfig: testhelpers.NewTestRMNDynamicConfig(), + NodeOperators: testhelpers.NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), NodeP2PIDsPerNodeOpAdmin: map[string][][32]byte{ "NodeOperator": p2pIds, }, @@ -116,7 +118,7 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de // Setup because we only need to deploy the contracts and distribute job specs *e, err = commonchangeset.ApplyChangesets(nil, *e, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfig), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfigChangeset), Config: changeset.UpdateChainConfigConfig{ HomeChainSelector: homeChainSel, RemoteChainAdds: chainConfigs, @@ -127,7 +129,7 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de Config: chainSelectors, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.DeployPrerequisites), + Changeset: commonchangeset.WrapChangeSet(changeset.DeployPrerequisitesChangeset), Config: changeset.DeployPrerequisiteConfig{ Configs: prereqCfgs, }, @@ -137,14 +139,14 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de Config: cfg, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContracts), + Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), Config: changeset.DeployChainContractsConfig{ ChainSelectors: chainSelectors, HomeChainSelector: homeChainSel, }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.CCIPCapabilityJobspec), + Changeset: commonchangeset.WrapChangeSet(changeset.CCIPCapabilityJobspecChangeset), Config: struct{}{}, }, }) @@ -159,7 +161,7 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de stateChain1 := state.Chains[from] newEnv, err := commonchangeset.ApplyChangesets(nil, *e, nil, []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDests), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDestsChangeset), Config: changeset.UpdateOnRampDestsConfig{ UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{ from: { @@ -173,23 +175,23 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterPricesCS), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterPricesChangeset), Config: changeset.UpdateFeeQuoterPricesConfig{ PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{ from: { TokenPrices: map[common.Address]*big.Int{ - stateChain1.LinkToken.Address(): changeset.DefaultLinkPrice, - stateChain1.Weth9.Address(): changeset.DefaultWethPrice, + stateChain1.LinkToken.Address(): testhelpers.DefaultLinkPrice, + stateChain1.Weth9.Address(): testhelpers.DefaultWethPrice, }, GasPrices: map[uint64]*big.Int{ - to: changeset.DefaultGasPrice, + to: testhelpers.DefaultGasPrice, }, }, }, }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterDests), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterDestsChangeset), Config: changeset.UpdateFeeQuoterDestsConfig{ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ from: { @@ -199,7 +201,7 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSources), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSourcesChangeset), Config: changeset.UpdateOffRampSourcesConfig{ UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{ to: { @@ -212,7 +214,7 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRamps), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRampsChangeset), Config: changeset.UpdateRouterRampsConfig{ TestRouter: true, UpdatesByChain: map[uint64]changeset.RouterUpdates{ diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 81be2e202ea..cf96d2d91aa 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1393,16 +1393,12 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/slack-go/slack v0.15.0 h1:LE2lj2y9vqqiOf+qIIy0GvEoxgF1N5yLGZffmEZykt0= github.com/slack-go/slack v0.15.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= -github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix h1:DPJD++yKLSx0EfT+U14P8vLVxjXFmoIETiCO9lVwQo8= -github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix/go.mod h1:NnT6w4Kj42OFFXhSx99LvJZWPpMjmo4+CpDEWfw61xY= github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPorGF//PAqwq2Cm4gRK0= github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= -github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= @@ -1413,16 +1409,12 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= -github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3rZrovdRUCgd028yOXX8KigB4FndAUdI2kM= -github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2/go.mod h1:DsT43c1oTBmp3iQkMcoZOoKThwZvt8X3Pz6UmznJ4GY= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 h1:9PMwKNqFKc5FXf4VchyD3CGzZelnSgi13fgVdT2X7T4= diff --git a/integration-tests/smoke/ccip/ccip_batching_test.go b/integration-tests/smoke/ccip/ccip_batching_test.go index 6c204fa45a3..38b068dad92 100644 --- a/integration-tests/smoke/ccip/ccip_batching_test.go +++ b/integration-tests/smoke/ccip/ccip_batching_test.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/deployment" @@ -30,7 +31,7 @@ const ( ) type batchTestSetup struct { - e changeset.DeployedEnv + e testhelpers.DeployedEnv state changeset.CCIPOnChainState sourceChain1 uint64 sourceChain2 uint64 @@ -41,9 +42,9 @@ func newBatchTestSetup(t *testing.T) batchTestSetup { // Setup 3 chains, with 2 lanes going to the dest. e, _, _ := testsetups.NewIntegrationEnvironment( t, - changeset.WithMultiCall3(), - changeset.WithChains(3), - changeset.WithUsersPerChain(2), + testhelpers.WithMultiCall3(), + testhelpers.WithNumOfChains(3), + testhelpers.WithNumOfUsersPerChain(2), ) state, err := changeset.LoadOnchainState(e.Env) @@ -63,8 +64,8 @@ func newBatchTestSetup(t *testing.T) batchTestSetup { ) // connect sourceChain1 and sourceChain2 to destChain - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain1, destChain, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain2, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain1, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain2, destChain, false) return batchTestSetup{e, state, sourceChain1, sourceChain2, destChain} } @@ -72,7 +73,7 @@ func newBatchTestSetup(t *testing.T) batchTestSetup { func Test_CCIPBatching_MaxBatchSizeEVM(t *testing.T) { t.Parallel() - ctx := changeset.Context(t) + ctx := testhelpers.Context(t) setup := newBatchTestSetup(t) sourceChain1, sourceChain2, destChain, e, state := setup.sourceChain1, setup.sourceChain2, setup.destChain, setup.e, setup.state @@ -120,7 +121,7 @@ func Test_CCIPBatching_MaxBatchSizeEVM(t *testing.T) { } } - _, err := changeset.ConfirmCommitWithExpectedSeqNumRange( + _, err := testhelpers.ConfirmCommitWithExpectedSeqNumRange( t, e.Env.Chains[sourceChain], e.Env.Chains[destChain], @@ -141,7 +142,7 @@ func Test_CCIPBatching_MultiSource(t *testing.T) { t.Parallel() // Setup 3 chains, with 2 lanes going to the dest. - ctx := changeset.Context(t) + ctx := testhelpers.Context(t) setup := newBatchTestSetup(t) sourceChain1, sourceChain2, destChain, e, state := setup.sourceChain1, setup.sourceChain2, setup.destChain, setup.e, setup.state @@ -259,7 +260,7 @@ func Test_CCIPBatching_MultiSource(t *testing.T) { // assert that all states are successful for _, states := range execStates { for _, state := range states { - require.Equal(t, changeset.EXECUTION_STATE_SUCCESS, state) + require.Equal(t, testhelpers.EXECUTION_STATE_SUCCESS, state) } } } @@ -268,7 +269,7 @@ func Test_CCIPBatching_SingleSource(t *testing.T) { t.Parallel() // Setup 3 chains, with 2 lanes going to the dest. - ctx := changeset.Context(t) + ctx := testhelpers.Context(t) setup := newBatchTestSetup(t) sourceChain1, sourceChain2, destChain, e, state := setup.sourceChain1, setup.sourceChain2, setup.destChain, setup.e, setup.state @@ -296,7 +297,7 @@ func Test_CCIPBatching_SingleSource(t *testing.T) { ) require.NoError(t, err) - _, err = changeset.ConfirmCommitWithExpectedSeqNumRange( + _, err = testhelpers.ConfirmCommitWithExpectedSeqNumRange( t, e.Env.Chains[sourceChain], e.Env.Chains[destChain], @@ -307,7 +308,7 @@ func Test_CCIPBatching_SingleSource(t *testing.T) { ) require.NoErrorf(t, err, "failed to confirm commit from chain %d", sourceChain) - states, err := changeset.ConfirmExecWithSeqNrs( + states, err := testhelpers.ConfirmExecWithSeqNrs( t, e.Env.Chains[sourceChain], e.Env.Chains[destChain], @@ -318,7 +319,7 @@ func Test_CCIPBatching_SingleSource(t *testing.T) { require.NoError(t, err) // assert that all states are successful for _, state := range states { - require.Equal(t, changeset.EXECUTION_STATE_SUCCESS, state) + require.Equal(t, testhelpers.EXECUTION_STATE_SUCCESS, state) } } @@ -329,7 +330,7 @@ type outputErr[T any] struct { func assertExecAsync( t *testing.T, - e changeset.DeployedEnv, + e testhelpers.DeployedEnv, state changeset.CCIPOnChainState, sourceChainSelector, destChainSelector uint64, @@ -338,7 +339,7 @@ func assertExecAsync( errs chan<- outputErr[map[uint64]int], ) { defer wg.Done() - states, err := changeset.ConfirmExecWithSeqNrs( + states, err := testhelpers.ConfirmExecWithSeqNrs( t, e.Env.Chains[sourceChainSelector], e.Env.Chains[destChainSelector], @@ -352,7 +353,7 @@ func assertExecAsync( func assertCommitReportsAsync( t *testing.T, - e changeset.DeployedEnv, + e testhelpers.DeployedEnv, state changeset.CCIPOnChainState, sourceChainSelector, destChainSelector uint64, @@ -362,7 +363,7 @@ func assertCommitReportsAsync( errs chan<- outputErr[*offramp.OffRampCommitReportAccepted], ) { defer wg.Done() - commitReport, err := changeset.ConfirmCommitWithExpectedSeqNumRange( + commitReport, err := testhelpers.ConfirmCommitWithExpectedSeqNumRange( t, e.Env.Chains[sourceChainSelector], e.Env.Chains[destChainSelector], @@ -378,7 +379,7 @@ func assertCommitReportsAsync( func sendMessagesAsync( ctx context.Context, t *testing.T, - e changeset.DeployedEnv, + e testhelpers.DeployedEnv, state changeset.CCIPOnChainState, sourceChainSelector, destChainSelector uint64, @@ -498,7 +499,7 @@ func genMessages( Data: []byte(fmt.Sprintf("hello world %d", i)), TokenAmounts: nil, FeeToken: common.HexToAddress("0x0"), - ExtraArgs: changeset.MakeEVMExtraArgsV2(50_000, false), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(50_000, false), } fee, err := sourceRouter.GetFee(&bind.CallOpts{Context: ctx}, destChainSelector, msg) @@ -508,7 +509,7 @@ func genMessages( totalValue.Add(totalValue, fee) - calldata, err := changeset.CCIPSendCalldata(destChainSelector, msg) + calldata, err := testhelpers.CCIPSendCalldata(destChainSelector, msg) if err != nil { return nil, nil, fmt.Errorf("generate calldata: %w", err) } diff --git a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go index 49f603a39f4..d1800174a25 100644 --- a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go +++ b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go @@ -8,6 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" @@ -36,7 +37,7 @@ var ( func Test_CCIPFeeBoosting(t *testing.T) { e, _, _ := testsetups.NewIntegrationEnvironment( t, - changeset.WithOCRConfigOverride(func(params changeset.CCIPOCRParams) changeset.CCIPOCRParams { + testhelpers.WithOCRConfigOverride(func(params *changeset.CCIPOCRParams) { // Only 1 boost (=OCR round) is enough to cover the fee params.ExecuteOffChainConfig.RelativeBoostPerWaitHour = 10 // Disable token price updates @@ -45,7 +46,6 @@ func Test_CCIPFeeBoosting(t *testing.T) { params.CommitOffChainConfig.RemoteGasPriceBatchWriteFrequency = *config.MustNewDuration(1_000_000 * time.Hour) // Disable token price updates params.CommitOffChainConfig.TokenInfo = nil - return params }), ) @@ -81,9 +81,9 @@ func Test_CCIPFeeBoosting(t *testing.T) { ) t.Log("Adjusted gas price on dest chain:", adjustedGasPriceDest) - changeset.AddLane(t, &e, sourceChain, destChain, false, + testhelpers.AddLane(t, &e, sourceChain, destChain, false, map[uint64]*big.Int{ - destChain: changeset.ToPackedFee(adjustedGasPriceDest, big.NewInt(0)), + destChain: testhelpers.ToPackedFee(adjustedGasPriceDest, big.NewInt(0)), }, map[common.Address]*big.Int{ state.Chains[sourceChain].LinkToken.Address(): linkPrice, @@ -94,7 +94,7 @@ func Test_CCIPFeeBoosting(t *testing.T) { // Update token prices in destination chain FeeQuoter e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{ { - Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesCS), + Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesChangeset), Config: changeset.UpdateFeeQuoterPricesConfig{ PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{ destChain: { @@ -110,13 +110,13 @@ func Test_CCIPFeeBoosting(t *testing.T) { require.NoError(t, err) startBlocks := make(map[uint64]*uint64) - expectedSeqNum := make(map[changeset.SourceDestPair]uint64) - expectedSeqNumExec := make(map[changeset.SourceDestPair][]uint64) + expectedSeqNum := make(map[testhelpers.SourceDestPair]uint64) + expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) latesthdr, err := e.Env.Chains[sourceChain].Client.HeaderByNumber(testcontext.Get(t), nil) require.NoError(t, err) block := latesthdr.Number.Uint64() - msgSentEvent := changeset.TestSendRequest(t, e.Env, state, sourceChain, destChain, false, router.ClientEVM2AnyMessage{ + msgSentEvent := testhelpers.TestSendRequest(t, e.Env, state, sourceChain, destChain, false, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[destChain].Receiver.Address().Bytes(), 32), Data: []byte("message that needs fee boosting"), TokenAmounts: nil, @@ -124,18 +124,18 @@ func Test_CCIPFeeBoosting(t *testing.T) { ExtraArgs: nil, }) startBlocks[sourceChain] = &block - expectedSeqNum[changeset.SourceDestPair{ + expectedSeqNum[testhelpers.SourceDestPair{ SourceChainSelector: sourceChain, DestChainSelector: destChain, }] = msgSentEvent.SequenceNumber - expectedSeqNumExec[changeset.SourceDestPair{ + expectedSeqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: sourceChain, DestChainSelector: destChain, }] = []uint64{msgSentEvent.SequenceNumber} e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{ { - Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesCS), + Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesChangeset), Config: changeset.UpdateFeeQuoterPricesConfig{ PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{ sourceChain: { @@ -151,7 +151,7 @@ func Test_CCIPFeeBoosting(t *testing.T) { // Confirm gas prices are updated srcFeeQuoter := state.Chains[sourceChain].FeeQuoter - err = changeset.ConfirmGasPriceUpdated(t, e.Env.Chains[destChain], srcFeeQuoter, 0, originalGasPriceDestUSD) + err = testhelpers.ConfirmGasPriceUpdated(t, e.Env.Chains[destChain], srcFeeQuoter, 0, originalGasPriceDestUSD) require.NoError(t, err) // Confirm that fee boosting will be triggered @@ -162,11 +162,11 @@ func Test_CCIPFeeBoosting(t *testing.T) { replayBlocks := make(map[uint64]uint64) replayBlocks[sourceChain] = 1 replayBlocks[destChain] = 1 - changeset.ReplayLogs(t, e.Env.Offchain, replayBlocks) + testhelpers.ReplayLogs(t, e.Env.Offchain, replayBlocks) // Confirm that the message is committed and executed - changeset.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNum, startBlocks) - changeset.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNum, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) } // TODO: Find a more accurate way to determine if fee boosting will be triggered diff --git a/integration-tests/smoke/ccip/ccip_fees_test.go b/integration-tests/smoke/ccip/ccip_fees_test.go index d0f9cc71683..7c329179e55 100644 --- a/integration-tests/smoke/ccip/ccip_fees_test.go +++ b/integration-tests/smoke/ccip/ccip_fees_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -27,7 +28,7 @@ import ( func setupTokens( t *testing.T, state changeset.CCIPOnChainState, - tenv changeset.DeployedEnv, + tenv testhelpers.DeployedEnv, src, dest uint64, transferTokenMintAmount, feeTokenMintAmount *big.Int, @@ -39,7 +40,7 @@ func setupTokens( e := tenv.Env // Deploy the token to test transferring - srcToken, _, dstToken, _, err := changeset.DeployTransferableToken( + srcToken, _, dstToken, _, err := testhelpers.DeployTransferableToken( lggr, tenv.Env.Chains, src, @@ -103,7 +104,7 @@ func Test_CCIPFees(t *testing.T) { t.Parallel() tenv, _, _ := testsetups.NewIntegrationEnvironment( t, - changeset.WithMultiCall3(), + testhelpers.WithMultiCall3(), ) e := tenv.Env @@ -127,10 +128,10 @@ func Test_CCIPFees(t *testing.T) { ) // Ensure capreg logs are up to date. - changeset.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks) + testhelpers.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks) // Add all lanes - changeset.AddLanesForAll(t, &tenv, state) + testhelpers.AddLanesForAll(t, &tenv, state) t.Run("Send programmable token transfer pay with Link token", func(t *testing.T) { runFeeTokenTestCase(feeTokenTestCase{ @@ -222,10 +223,10 @@ func Test_CCIPFees(t *testing.T) { ExtraArgs: nil, } - _, _, err = changeset.CCIPSendRequest( + _, _, err = testhelpers.CCIPSendRequest( e, state, - &changeset.CCIPSendReqConfig{ + &testhelpers.CCIPSendReqConfig{ Sender: e.Chains[sourceChain].DeployerKey, IsTestRouter: true, SourceChain: sourceChain, @@ -291,7 +292,7 @@ func Test_CCIPFees(t *testing.T) { type feeTokenTestCase struct { t *testing.T src, dst uint64 - env changeset.DeployedEnv + env testhelpers.DeployedEnv srcToken, dstToken *burn_mint_erc677.BurnMintERC677 tokenAmounts []router.ClientEVMTokenAmount feeToken common.Address @@ -304,8 +305,8 @@ func runFeeTokenTestCase(tc feeTokenTestCase) { ctx := tests.Context(tc.t) // Need to keep track of the block number for each chain so that event subscription can be done from that block. startBlocks := make(map[uint64]*uint64) - expectedSeqNum := make(map[changeset.SourceDestPair]uint64) - expectedSeqNumExec := make(map[changeset.SourceDestPair][]uint64) + expectedSeqNum := make(map[testhelpers.SourceDestPair]uint64) + expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) srcChain := tc.env.Env.Chains[tc.src] dstChain := tc.env.Env.Chains[tc.dst] @@ -374,7 +375,7 @@ func runFeeTokenTestCase(tc feeTokenTestCase) { tc.t.Logf("fee token balance before: %s, fee token enabled: %s", feeTokenBalanceBefore.String(), tc.feeToken.String()) - msgSentEvent := changeset.TestSendRequest( + msgSentEvent := testhelpers.TestSendRequest( tc.t, tc.env.Env, state, @@ -390,11 +391,11 @@ func runFeeTokenTestCase(tc feeTokenTestCase) { }, ) - expectedSeqNum[changeset.SourceDestPair{ + expectedSeqNum[testhelpers.SourceDestPair{ SourceChainSelector: tc.src, DestChainSelector: tc.dst, }] = msgSentEvent.SequenceNumber - expectedSeqNumExec[changeset.SourceDestPair{ + expectedSeqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: tc.src, DestChainSelector: tc.dst, }] = []uint64{msgSentEvent.SequenceNumber} @@ -427,7 +428,7 @@ func runFeeTokenTestCase(tc feeTokenTestCase) { ) // Wait for all commit reports to land. - changeset.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.env.Env, state, expectedSeqNum, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.env.Env, state, expectedSeqNum, startBlocks) // After commit is reported on all chains, token prices should be updated in FeeQuoter. linkAddress := state.Chains[tc.dst].LinkToken.Address() @@ -439,7 +440,7 @@ func runFeeTokenTestCase(tc feeTokenTestCase) { require.Equal(tc.t, changeset.MockLinkPrice, timestampedPrice.Value) // Wait for all exec reports to land - changeset.ConfirmExecWithSeqNrsForAll(tc.t, tc.env.Env, state, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(tc.t, tc.env.Env, state, expectedSeqNumExec, startBlocks) if tc.assertTokenBalance { require.Len(tc.t, tc.tokenAmounts, 1) diff --git a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go index 09023f1d321..0035be6f71c 100644 --- a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go +++ b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" ) @@ -22,19 +23,18 @@ import ( // Test_CCIPGasPriceUpdates tests that chain fee price updates are propagated correctly when // price reaches some deviation threshold or when the price has expired. func Test_CCIPGasPriceUpdates(t *testing.T) { - ctx := changeset.Context(t) + ctx := testhelpers.Context(t) callOpts := &bind.CallOpts{Context: ctx} var gasPriceExpiry = 5 * time.Second e, _, _ := testsetups.NewIntegrationEnvironment(t, - changeset.WithOCRConfigOverride(func(params changeset.CCIPOCRParams) changeset.CCIPOCRParams { + testhelpers.WithOCRConfigOverride(func(params *changeset.CCIPOCRParams) { params.CommitOffChainConfig.RemoteGasPriceBatchWriteFrequency = *config.MustNewDuration(gasPriceExpiry) - return params }), ) state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) - changeset.AddLanesForAll(t, &e, state) + testhelpers.AddLanesForAll(t, &e, state) allChainSelectors := maps.Keys(e.Env.Chains) assert.GreaterOrEqual(t, len(allChainSelectors), 2, "test requires at least 2 chains") diff --git a/integration-tests/smoke/ccip/ccip_message_limitations_test.go b/integration-tests/smoke/ccip/ccip_message_limitations_test.go index 2882a34af63..01be93a01a1 100644 --- a/integration-tests/smoke/ccip/ccip_message_limitations_test.go +++ b/integration-tests/smoke/ccip/ccip_message_limitations_test.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) @@ -29,7 +30,7 @@ func Test_CCIPMessageLimitations(t *testing.T) { onChainState, err := changeset.LoadOnchainState(testEnv.Env) require.NoError(t, err) - changeset.AddLanesForAll(t, &testEnv, onChainState) + testhelpers.AddLanesForAll(t, &testEnv, onChainState) srcToken, _ := setupTokens( t, @@ -82,7 +83,7 @@ func Test_CCIPMessageLimitations(t *testing.T) { Receiver: common.LeftPadBytes(onChainState.Chains[chains[1]].Receiver.Address().Bytes(), 32), Data: []byte(strings.Repeat("0", int(chain0DestConfig.MaxDataBytes))), FeeToken: common.HexToAddress("0x0"), - ExtraArgs: changeset.MakeEVMExtraArgsV2(uint64(chain0DestConfig.MaxPerMsgGasLimit), true), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(uint64(chain0DestConfig.MaxPerMsgGasLimit), true), }, }, //{ // TODO: exec plugin never executed this message. CCIP-4471 @@ -136,7 +137,7 @@ func Test_CCIPMessageLimitations(t *testing.T) { Data: []byte("abc"), TokenAmounts: []router.ClientEVMTokenAmount{}, FeeToken: common.HexToAddress("0x0"), - ExtraArgs: changeset.MakeEVMExtraArgsV2(uint64(chain0DestConfig.MaxPerMsgGasLimit)+1, true), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(uint64(chain0DestConfig.MaxPerMsgGasLimit)+1, true), }, expRevert: true, }, @@ -145,18 +146,18 @@ func Test_CCIPMessageLimitations(t *testing.T) { // Need to keep track of the block number for each chain so that event subscription can be done from that block. startBlocks := make(map[uint64]*uint64) // Send a message from each chain to every other chain. - expectedSeqNum := make(map[changeset.SourceDestPair]uint64) - expectedSeqNumExec := make(map[changeset.SourceDestPair][]uint64) + expectedSeqNum := make(map[testhelpers.SourceDestPair]uint64) + expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) for _, msg := range testMsgs { t.Logf("Sending msg: %s", msg.name) require.NotEqual(t, msg.fromChain, msg.toChain, "fromChain and toChain cannot be the same") startBlocks[msg.toChain] = nil - msgSentEvent, err := changeset.DoSendRequest( + msgSentEvent, err := testhelpers.DoSendRequest( t, testEnv.Env, onChainState, - changeset.WithSourceChain(msg.fromChain), - changeset.WithDestChain(msg.toChain), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(msg.msg)) + testhelpers.WithSourceChain(msg.fromChain), + testhelpers.WithDestChain(msg.toChain), + testhelpers.WithTestRouter(false), + testhelpers.WithEvm2AnyMessage(msg.msg)) if msg.expRevert { t.Logf("Message reverted as expected") @@ -168,19 +169,19 @@ func Test_CCIPMessageLimitations(t *testing.T) { t.Logf("Message not reverted as expected") - expectedSeqNum[changeset.SourceDestPair{ + expectedSeqNum[testhelpers.SourceDestPair{ SourceChainSelector: msg.fromChain, DestChainSelector: msg.toChain, }] = msgSentEvent.SequenceNumber - expectedSeqNumExec[changeset.SourceDestPair{ + expectedSeqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: msg.fromChain, DestChainSelector: msg.toChain, }] = []uint64{msgSentEvent.SequenceNumber} } // Wait for all commit reports to land. - changeset.ConfirmCommitForAllWithExpectedSeqNums(t, testEnv.Env, onChainState, expectedSeqNum, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, testEnv.Env, onChainState, expectedSeqNum, startBlocks) // Wait for all exec reports to land - changeset.ConfirmExecWithSeqNrsForAll(t, testEnv.Env, onChainState, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, testEnv.Env, onChainState, expectedSeqNumExec, startBlocks) } diff --git a/integration-tests/smoke/ccip/ccip_messaging_test.go b/integration-tests/smoke/ccip/ccip_messaging_test.go index f010bab5ee1..3e28c7851ca 100644 --- a/integration-tests/smoke/ccip/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip/ccip_messaging_test.go @@ -18,6 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" @@ -27,7 +28,7 @@ import ( type testCaseSetup struct { t *testing.T sender []byte - deployedEnv changeset.DeployedEnv + deployedEnv testhelpers.DeployedEnv onchainState changeset.CCIPOnChainState sourceChain, destChain uint64 } @@ -46,7 +47,7 @@ type messagingTestCaseOutput struct { func Test_CCIPMessaging(t *testing.T) { // Setup 2 chains and a single lane. - ctx := changeset.Context(t) + ctx := testhelpers.Context(t) e, _, _ := testsetups.NewIntegrationEnvironment(t) state, err := changeset.LoadOnchainState(e.Env) @@ -63,7 +64,7 @@ func Test_CCIPMessaging(t *testing.T) { ", dest chain selector:", destChain, ) // connect a single lane, source to dest - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false) var ( replayed bool @@ -88,8 +89,8 @@ func Test_CCIPMessaging(t *testing.T) { }, common.HexToAddress("0xdead"), []byte("hello eoa"), - nil, // default extraArgs - changeset.EXECUTION_STATE_SUCCESS, // success because offRamp won't call an EOA + nil, // default extraArgs + testhelpers.EXECUTION_STATE_SUCCESS, // success because offRamp won't call an EOA ) }) @@ -102,8 +103,8 @@ func Test_CCIPMessaging(t *testing.T) { }, state.Chains[destChain].FeeQuoter.Address(), []byte("hello FeeQuoter"), - nil, // default extraArgs - changeset.EXECUTION_STATE_SUCCESS, // success because offRamp won't call a contract not implementing CCIPReceiver + nil, // default extraArgs + testhelpers.EXECUTION_STATE_SUCCESS, // success because offRamp won't call a contract not implementing CCIPReceiver ) }) @@ -119,7 +120,7 @@ func Test_CCIPMessaging(t *testing.T) { state.Chains[destChain].Receiver.Address(), []byte("hello CCIPReceiver"), nil, // default extraArgs - changeset.EXECUTION_STATE_SUCCESS, + testhelpers.EXECUTION_STATE_SUCCESS, func(t *testing.T) { iter, err := state.Chains[destChain].Receiver.FilterMessageReceived(&bind.FilterOpts{ Context: ctx, @@ -143,8 +144,8 @@ func Test_CCIPMessaging(t *testing.T) { }, state.Chains[destChain].Receiver.Address(), []byte("hello CCIPReceiver with low exec gas"), - changeset.MakeEVMExtraArgsV2(1, false), // 1 gas is too low. - changeset.EXECUTION_STATE_FAILURE, // state would be failed onchain due to low gas + testhelpers.MakeEVMExtraArgsV2(1, false), // 1 gas is too low. + testhelpers.EXECUTION_STATE_FAILURE, // state would be failed onchain due to low gas ) manuallyExecute(ctx, t, latestHead.Number.Uint64(), state, destChain, out, sourceChain, e, sender) @@ -162,7 +163,7 @@ func manuallyExecute( destChain uint64, out messagingTestCaseOutput, sourceChain uint64, - e changeset.DeployedEnv, + e testhelpers.DeployedEnv, sender []byte, ) { merkleRoot := getMerkleRoot( @@ -229,7 +230,7 @@ func manuallyExecute( newExecutionState, err := state.Chains[destChain].OffRamp.GetExecutionState(&bind.CallOpts{Context: ctx}, sourceChain, out.msgSentEvent.SequenceNumber) require.NoError(t, err) - require.Equal(t, uint8(changeset.EXECUTION_STATE_SUCCESS), newExecutionState) + require.Equal(t, uint8(testhelpers.EXECUTION_STATE_SUCCESS), newExecutionState) } func getMerkleRoot( @@ -285,12 +286,12 @@ func getMessageHash( return iter.Event.MessageHash } -func sleepAndReplay(t *testing.T, e changeset.DeployedEnv, sourceChain, destChain uint64) { +func sleepAndReplay(t *testing.T, e testhelpers.DeployedEnv, sourceChain, destChain uint64) { time.Sleep(30 * time.Second) replayBlocks := make(map[uint64]uint64) replayBlocks[sourceChain] = 1 replayBlocks[destChain] = 1 - changeset.ReplayLogs(t, e.Env.Offchain, replayBlocks) + testhelpers.ReplayLogs(t, e.Env.Offchain, replayBlocks) } func runMessagingTestCase( @@ -309,20 +310,20 @@ func runMessagingTestCase( require.Equal(tc.t, tc.nonce, latestNonce) startBlocks := make(map[uint64]*uint64) - msgSentEvent := changeset.TestSendRequest(tc.t, tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, false, router.ClientEVM2AnyMessage{ + msgSentEvent := testhelpers.TestSendRequest(tc.t, tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, false, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(receiver.Bytes(), 32), Data: msgData, TokenAmounts: nil, FeeToken: common.HexToAddress("0x0"), ExtraArgs: extraArgs, }) - expectedSeqNum := map[changeset.SourceDestPair]uint64{ + expectedSeqNum := map[testhelpers.SourceDestPair]uint64{ { SourceChainSelector: tc.sourceChain, DestChainSelector: tc.destChain, }: msgSentEvent.SequenceNumber, } - expectedSeqNumExec := map[changeset.SourceDestPair][]uint64{ + expectedSeqNumExec := map[testhelpers.SourceDestPair][]uint64{ { SourceChainSelector: tc.sourceChain, DestChainSelector: tc.destChain, @@ -336,20 +337,20 @@ func runMessagingTestCase( out.replayed = true } - changeset.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) - execStates := changeset.ConfirmExecWithSeqNrsForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) + execStates := testhelpers.ConfirmExecWithSeqNrsForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNumExec, startBlocks) require.Equalf( tc.t, expectedExecutionState, - execStates[changeset.SourceDestPair{ + execStates[testhelpers.SourceDestPair{ SourceChainSelector: tc.sourceChain, DestChainSelector: tc.destChain, }][msgSentEvent.SequenceNumber], "wrong execution state for seq nr %d, expected %d, got %d", msgSentEvent.SequenceNumber, expectedExecutionState, - execStates[changeset.SourceDestPair{ + execStates[testhelpers.SourceDestPair{ SourceChainSelector: tc.sourceChain, DestChainSelector: tc.destChain, }][msgSentEvent.SequenceNumber], diff --git a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go index 5c35be01f93..a0b62fe8182 100644 --- a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go +++ b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go @@ -12,6 +12,8 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + v1_5testhelpers "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers/v1_5" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" @@ -26,7 +28,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // Deploy 1.5 contracts (excluding pools to start, but including MCMS) . e, _, tEnv := testsetups.NewIntegrationEnvironment( t, - changeset.WithPrerequisiteDeployment( + testhelpers.WithPrerequisiteDeploymentOnly( &changeset.V1_5DeploymentConfig{ PriceRegStalenessThreshold: 60 * 60 * 24 * 14, // two weeks RMNConfig: &rmn_contract.RMNConfig{ @@ -43,11 +45,11 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { }, }, }), - changeset.WithChains(3), - changeset.WithUsersPerChain(2), + testhelpers.WithNumOfChains(3), + testhelpers.WithNumOfUsersPerChain(2), // for in-memory test it is important to set the dest chain id as 1337 otherwise the config digest will not match // between nodes' calculated digest and the digest set on the contract - changeset.WithChainIds([]uint64{chainselectors.GETH_TESTNET.EvmChainID}), + testhelpers.WithChainIDs([]uint64{chainselectors.GETH_TESTNET.EvmChainID}), ) state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) @@ -55,19 +57,19 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { require.Contains(t, e.Env.AllChainSelectors(), chainselectors.GETH_TESTNET.Selector) require.Len(t, allChainsExcept1337, 2) src1, src2, dest := allChainsExcept1337[0], allChainsExcept1337[1], chainselectors.GETH_TESTNET.Selector - pairs := []changeset.SourceDestPair{ + pairs := []testhelpers.SourceDestPair{ // as mentioned in the comment above, the dest chain id should be 1337 {SourceChainSelector: src1, DestChainSelector: dest}, {SourceChainSelector: src2, DestChainSelector: dest}, } // wire up all lanes // deploy onRamp, commit store, offramp , set ocr2config and send corresponding jobs - e.Env = v1_5.AddLanes(t, e.Env, state, pairs) + e.Env = v1_5testhelpers.AddLanes(t, e.Env, state, pairs) // permabless the commit stores e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(v1_5.PermaBlessCommitStoreCS), + Changeset: commonchangeset.WrapChangeSet(v1_5.PermaBlessCommitStoreChangeset), Config: v1_5.PermaBlessCommitStoreConfig{ Configs: map[uint64]v1_5.PermaBlessCommitStoreConfigPerDest{ dest: { @@ -93,11 +95,11 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { tEnv.UpdateDeployedEnvironment(e) // ensure that all lanes are functional for _, pair := range pairs { - sentEvent, err := v1_5.SendRequest(t, e.Env, state, - changeset.WithSourceChain(pair.SourceChainSelector), - changeset.WithDestChain(pair.DestChainSelector), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + sentEvent, err := v1_5testhelpers.SendRequest(t, e.Env, state, + testhelpers.WithSourceChain(pair.SourceChainSelector), + testhelpers.WithDestChain(pair.DestChainSelector), + testhelpers.WithTestRouter(false), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[pair.DestChainSelector].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, @@ -110,8 +112,8 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { destChain := e.Env.Chains[pair.DestChainSelector] destStartBlock, err := destChain.Client.HeaderByNumber(context.Background(), nil) require.NoError(t, err) - v1_5.WaitForCommit(t, e.Env.Chains[pair.SourceChainSelector], destChain, state.Chains[dest].CommitStore[src1], sentEvent.Message.SequenceNumber) - v1_5.WaitForExecute(t, e.Env.Chains[pair.SourceChainSelector], destChain, state.Chains[dest].EVM2EVMOffRamp[src1], []uint64{sentEvent.Message.SequenceNumber}, destStartBlock.Number.Uint64()) + v1_5testhelpers.WaitForCommit(t, e.Env.Chains[pair.SourceChainSelector], destChain, state.Chains[dest].CommitStore[src1], sentEvent.Message.SequenceNumber) + v1_5testhelpers.WaitForExecute(t, e.Env.Chains[pair.SourceChainSelector], destChain, state.Chains[dest].EVM2EVMOffRamp[src1], []uint64{sentEvent.Message.SequenceNumber}, destStartBlock.Number.Uint64()) } // now that all 1.5 lanes work transfer ownership of the contracts to MCMS @@ -149,13 +151,13 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // add 1.6 contracts to the environment and send 1.6 jobs // First we need to deploy Homechain contracts and restart the nodes with updated cap registry // in this test we have already deployed home chain contracts and the nodes are already running with the deployed cap registry. - e = changeset.AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv) + e = testhelpers.AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv) // Set RMNProxy to point to RMNRemote. // nonce manager should point to 1.5 ramps e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { // as we have already transferred ownership for RMNProxy to MCMS, it needs to be done via MCMS proposal - Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNRemoteOnRMNProxy), + Changeset: commonchangeset.WrapChangeSet(changeset.SetRMNRemoteOnRMNProxyChangeset), Config: changeset.SetRMNRemoteOnRMNProxyConfig{ ChainSelectors: e.Env.AllChainSelectors(), MCMSConfig: &changeset.MCMSConfig{ @@ -164,7 +166,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateNonceManagersCS), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateNonceManagersChangeset), Config: changeset.UpdateNonceManagerConfig{ // we only have lanes between src1 --> dest UpdatesByChain: map[uint64]changeset.NonceManagerUpdate{ @@ -205,24 +207,24 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { require.NoError(t, err) // Enable a single 1.6 lane with test router - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, src1, dest, true) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, src1, dest, true) require.GreaterOrEqual(t, len(e.Users[src1]), 2) - changeset.ReplayLogs(t, e.Env.Offchain, e.ReplayBlocks) + testhelpers.ReplayLogs(t, e.Env.Offchain, e.ReplayBlocks) startBlocks := make(map[uint64]*uint64) latesthdr, err := e.Env.Chains[dest].Client.HeaderByNumber(testcontext.Get(t), nil) require.NoError(t, err) block := latesthdr.Number.Uint64() startBlocks[dest] = &block - expectedSeqNumExec := make(map[changeset.SourceDestPair][]uint64) - msgSentEvent, err := changeset.DoSendRequest( + expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) + msgSentEvent, err := testhelpers.DoSendRequest( t, e.Env, state, - changeset.WithSourceChain(src1), - changeset.WithDestChain(dest), - changeset.WithTestRouter(true), + testhelpers.WithSourceChain(src1), + testhelpers.WithDestChain(dest), + testhelpers.WithTestRouter(true), // Send traffic across single 1.6 lane with a DIFFERENT ( very important to not mess with real sender nonce) sender // from test router to ensure 1.6 is working. - changeset.WithSender(e.Users[src1][1]), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + testhelpers.WithSender(e.Users[src1][1]), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, @@ -231,21 +233,21 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { })) require.NoError(t, err) - expectedSeqNumExec[changeset.SourceDestPair{ + expectedSeqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: src1, DestChainSelector: dest, }] = []uint64{msgSentEvent.SequenceNumber} // Wait for all exec reports to land - changeset.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) // send a message from real router, the send requested event should be received in 1.5 onRamp // the request should get delivered to 1.5 offRamp - sentEventBeforeSwitch, err := v1_5.SendRequest(t, e.Env, state, - changeset.WithSourceChain(src1), - changeset.WithDestChain(dest), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + sentEventBeforeSwitch, err := v1_5testhelpers.SendRequest(t, e.Env, state, + testhelpers.WithSourceChain(src1), + testhelpers.WithDestChain(dest), + testhelpers.WithTestRouter(false), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, @@ -259,7 +261,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // now that the 1.6 lane is working, we can enable the real router e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDests), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDestsChangeset), Config: changeset.UpdateOnRampDestsConfig{ UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{ src1: { @@ -273,7 +275,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { }, }, { - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSources), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSourcesChangeset), Config: changeset.UpdateOffRampSourcesConfig{ UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{ dest: { @@ -287,7 +289,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { }, { // this needs to be MCMS proposal as the router contract is owned by MCMS - Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRamps), + Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRampsChangeset), Config: changeset.UpdateRouterRampsConfig{ TestRouter: false, MCMS: &changeset.MCMSConfig{ @@ -316,12 +318,12 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // the request should get delivered to 1.6 offRamp destStartBlock, err := e.Env.Chains[dest].Client.HeaderByNumber(context.Background(), nil) require.NoError(t, err) - sentEventAfterSwitch, err := changeset.DoSendRequest( + sentEventAfterSwitch, err := testhelpers.DoSendRequest( t, e.Env, state, - changeset.WithSourceChain(src1), - changeset.WithDestChain(dest), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + testhelpers.WithSourceChain(src1), + testhelpers.WithDestChain(dest), + testhelpers.WithTestRouter(false), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, @@ -330,22 +332,22 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { })) require.NoError(t, err) // verify that before switch message is received in 1.5 offRamp - v1_5.WaitForExecute(t, e.Env.Chains[src1], e.Env.Chains[dest], state.Chains[dest].EVM2EVMOffRamp[src1], + v1_5testhelpers.WaitForExecute(t, e.Env.Chains[src1], e.Env.Chains[dest], state.Chains[dest].EVM2EVMOffRamp[src1], []uint64{sentEventBeforeSwitch.Message.SequenceNumber}, destStartBlock.Number.Uint64()) // verify that after switch message is received in 1.6 offRamp - expectedSeqNumExec[changeset.SourceDestPair{ + expectedSeqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: src1, DestChainSelector: dest, }] = []uint64{sentEventAfterSwitch.SequenceNumber} - changeset.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) // confirm that the other lane src2->dest is still working with v1.5 - sentEventOnOtherLane, err := v1_5.SendRequest(t, e.Env, state, - changeset.WithSourceChain(src2), - changeset.WithDestChain(dest), - changeset.WithTestRouter(false), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + sentEventOnOtherLane, err := v1_5testhelpers.SendRequest(t, e.Env, state, + testhelpers.WithSourceChain(src2), + testhelpers.WithDestChain(dest), + testhelpers.WithTestRouter(false), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), Data: []byte("hello"), TokenAmounts: nil, @@ -355,6 +357,6 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { ) require.NoError(t, err) require.NotNil(t, sentEventOnOtherLane) - v1_5.WaitForExecute(t, e.Env.Chains[src2], e.Env.Chains[dest], state.Chains[dest].EVM2EVMOffRamp[src2], + v1_5testhelpers.WaitForExecute(t, e.Env.Chains[src2], e.Env.Chains[dest], state.Chains[dest].EVM2EVMOffRamp[src2], []uint64{sentEventOnOtherLane.Message.SequenceNumber}, destStartBlock.Number.Uint64()) } diff --git a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go index 272c87e9996..004dd3989f8 100644 --- a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go +++ b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -35,9 +36,9 @@ func Test_OutOfOrderExecution(t *testing.T) { ctx := tests.Context(t) tenv, _, _ := testsetups.NewIntegrationEnvironment( t, - changeset.WithUSDC(), - changeset.WithUSDCAttestationMissing(), - changeset.WithUsersPerChain(2), + testhelpers.WithUSDC(), + testhelpers.WithUSDCAttestationMissing(), + testhelpers.WithNumOfUsersPerChain(2), ) e := tenv.Env @@ -54,7 +55,7 @@ func Test_OutOfOrderExecution(t *testing.T) { oneE18 := new(big.Int).SetUint64(1e18) - srcToken, _, destToken, _, err := changeset.DeployTransferableToken( + srcToken, _, destToken, _, err := testhelpers.DeployTransferableToken( lggr, tenv.Env.Chains, sourceChain, @@ -67,26 +68,26 @@ func Test_OutOfOrderExecution(t *testing.T) { ) require.NoError(t, err) - srcUSDC, destUSDC, err := changeset.ConfigureUSDCTokenPools(lggr, e.Chains, sourceChain, destChain, state) + srcUSDC, destUSDC, err := testhelpers.ConfigureUSDCTokenPools(lggr, e.Chains, sourceChain, destChain, state) require.NoError(t, err) - err = changeset.UpdateFeeQuoterForUSDC(lggr, e.Chains[sourceChain], state.Chains[sourceChain], destChain, srcUSDC) + err = testhelpers.UpdateFeeQuoterForUSDC(lggr, e.Chains[sourceChain], state.Chains[sourceChain], destChain, srcUSDC) require.NoError(t, err) - err = changeset.UpdateFeeQuoterForUSDC(lggr, e.Chains[destChain], state.Chains[destChain], sourceChain, destUSDC) + err = testhelpers.UpdateFeeQuoterForUSDC(lggr, e.Chains[destChain], state.Chains[destChain], sourceChain, destUSDC) require.NoError(t, err) - changeset.MintAndAllow( + testhelpers.MintAndAllow( t, e, state, - map[uint64][]changeset.MintTokenInfo{ + map[uint64][]testhelpers.MintTokenInfo{ sourceChain: { - changeset.NewMintTokenInfo(ownerSourceChain, srcToken, srcUSDC), - changeset.NewMintTokenWithCustomSender(ownerSourceChain, anotherSender, srcToken), + testhelpers.NewMintTokenInfo(ownerSourceChain, srcToken, srcUSDC), + testhelpers.NewMintTokenWithCustomSender(ownerSourceChain, anotherSender, srcToken), }, }, ) - changeset.AddLanesForAll(t, &tenv, state) + testhelpers.AddLanesForAll(t, &tenv, state) tokenTransfer := []router.ClientEVMTokenAmount{ { @@ -101,7 +102,7 @@ func Test_OutOfOrderExecution(t *testing.T) { }, } - identifier := changeset.SourceDestPair{ + identifier := testhelpers.SourceDestPair{ SourceChainSelector: sourceChain, DestChainSelector: destChain, } @@ -116,7 +117,7 @@ func Test_OutOfOrderExecution(t *testing.T) { // Out of order execution to the EOA should be properly executed firstReceiver := utils.RandomAddress() - firstMessage, _ := changeset.Transfer( + firstMessage, _ := testhelpers.Transfer( ctx, t, e, @@ -126,16 +127,16 @@ func Test_OutOfOrderExecution(t *testing.T) { tokenTransfer, firstReceiver, nil, - changeset.MakeEVMExtraArgsV2(0, true), + testhelpers.MakeEVMExtraArgsV2(0, true), ) - expectedStatuses[firstMessage.SequenceNumber] = changeset.EXECUTION_STATE_SUCCESS + expectedStatuses[firstMessage.SequenceNumber] = testhelpers.EXECUTION_STATE_SUCCESS t.Logf("Out of order messages sent from chain %d to chain %d with sequence number %d", sourceChain, destChain, firstMessage.SequenceNumber, ) // Ordered execution should fail because attestation is not present secondReceiver := utils.RandomAddress() - secondMsg, _ := changeset.Transfer( + secondMsg, _ := testhelpers.Transfer( ctx, t, e, @@ -153,7 +154,7 @@ func Test_OutOfOrderExecution(t *testing.T) { // Ordered token transfer should fail, because previous message cannot be executed thirdReceiver := utils.RandomAddress() - thirdMessage, _ := changeset.Transfer( + thirdMessage, _ := testhelpers.Transfer( ctx, t, e, @@ -163,7 +164,7 @@ func Test_OutOfOrderExecution(t *testing.T) { tokenTransfer, thirdReceiver, nil, - changeset.MakeEVMExtraArgsV2(0, false), + testhelpers.MakeEVMExtraArgsV2(0, false), ) t.Logf("Ordered token transfer from chain %d to chain %d with sequence number %d", sourceChain, destChain, thirdMessage.SequenceNumber, @@ -171,7 +172,7 @@ func Test_OutOfOrderExecution(t *testing.T) { // Out of order programmable token transfer should be executed fourthReceiver := state.Chains[destChain].Receiver.Address() - fourthMessage, _ := changeset.Transfer( + fourthMessage, _ := testhelpers.Transfer( ctx, t, e, @@ -181,34 +182,34 @@ func Test_OutOfOrderExecution(t *testing.T) { tokenTransfer, fourthReceiver, []byte("this message has enough gas to execute"), - changeset.MakeEVMExtraArgsV2(300_000, true), + testhelpers.MakeEVMExtraArgsV2(300_000, true), ) - expectedStatuses[fourthMessage.SequenceNumber] = changeset.EXECUTION_STATE_SUCCESS + expectedStatuses[fourthMessage.SequenceNumber] = testhelpers.EXECUTION_STATE_SUCCESS t.Logf("Out of order programmable token transfer from chain %d to chain %d with sequence number %d", sourceChain, destChain, fourthMessage.SequenceNumber, ) // Ordered token transfer, but using different sender, should be executed fifthReceiver := utils.RandomAddress() - fifthMessage, err := changeset.DoSendRequest(t, e, state, - changeset.WithSender(anotherSender), - changeset.WithSourceChain(sourceChain), - changeset.WithDestChain(destChain), - changeset.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ + fifthMessage, err := testhelpers.DoSendRequest(t, e, state, + testhelpers.WithSender(anotherSender), + testhelpers.WithSourceChain(sourceChain), + testhelpers.WithDestChain(destChain), + testhelpers.WithEvm2AnyMessage(router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(fifthReceiver.Bytes(), 32), Data: nil, TokenAmounts: tokenTransfer, FeeToken: common.HexToAddress("0x0"), - ExtraArgs: changeset.MakeEVMExtraArgsV2(0, false), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(0, false), })) require.NoError(t, err) - expectedStatuses[fifthMessage.SequenceNumber] = changeset.EXECUTION_STATE_SUCCESS + expectedStatuses[fifthMessage.SequenceNumber] = testhelpers.EXECUTION_STATE_SUCCESS t.Logf("Ordered message send by %v from chain %d to chain %d with sequence number %d", anotherSender.From, sourceChain, destChain, fifthMessage.SequenceNumber, ) // All messages are committed, even these which are going to be reverted during the exec - _, err = changeset.ConfirmCommitWithExpectedSeqNumRange( + _, err = testhelpers.ConfirmCommitWithExpectedSeqNumRange( t, e.Chains[sourceChain], e.Chains[destChain], @@ -223,11 +224,11 @@ func Test_OutOfOrderExecution(t *testing.T) { ) require.NoError(t, err) - execStates := changeset.ConfirmExecWithSeqNrsForAll( + execStates := testhelpers.ConfirmExecWithSeqNrsForAll( t, e, state, - map[changeset.SourceDestPair][]uint64{ + map[testhelpers.SourceDestPair][]uint64{ identifier: { firstMessage.SequenceNumber, fourthMessage.SequenceNumber, @@ -240,21 +241,21 @@ func Test_OutOfOrderExecution(t *testing.T) { secondMsgState, err := state.Chains[destChain].OffRamp.GetExecutionState(&bind.CallOpts{Context: ctx}, sourceChain, secondMsg.SequenceNumber) require.NoError(t, err) - require.Equal(t, uint8(changeset.EXECUTION_STATE_UNTOUCHED), secondMsgState) + require.Equal(t, uint8(testhelpers.EXECUTION_STATE_UNTOUCHED), secondMsgState) thirdMsgState, err := state.Chains[destChain].OffRamp.GetExecutionState(&bind.CallOpts{Context: ctx}, sourceChain, thirdMessage.SequenceNumber) require.NoError(t, err) - require.Equal(t, uint8(changeset.EXECUTION_STATE_UNTOUCHED), thirdMsgState) + require.Equal(t, uint8(testhelpers.EXECUTION_STATE_UNTOUCHED), thirdMsgState) - changeset.WaitForTheTokenBalance(ctx, t, destToken.Address(), firstReceiver, e.Chains[destChain], oneE18) - changeset.WaitForTheTokenBalance(ctx, t, destUSDC.Address(), secondReceiver, e.Chains[destChain], big.NewInt(0)) - changeset.WaitForTheTokenBalance(ctx, t, destToken.Address(), thirdReceiver, e.Chains[destChain], big.NewInt(0)) - changeset.WaitForTheTokenBalance(ctx, t, destToken.Address(), fourthReceiver, e.Chains[destChain], oneE18) - changeset.WaitForTheTokenBalance(ctx, t, destToken.Address(), fifthReceiver, e.Chains[destChain], oneE18) + testhelpers.WaitForTheTokenBalance(ctx, t, destToken.Address(), firstReceiver, e.Chains[destChain], oneE18) + testhelpers.WaitForTheTokenBalance(ctx, t, destUSDC.Address(), secondReceiver, e.Chains[destChain], big.NewInt(0)) + testhelpers.WaitForTheTokenBalance(ctx, t, destToken.Address(), thirdReceiver, e.Chains[destChain], big.NewInt(0)) + testhelpers.WaitForTheTokenBalance(ctx, t, destToken.Address(), fourthReceiver, e.Chains[destChain], oneE18) + testhelpers.WaitForTheTokenBalance(ctx, t, destToken.Address(), fifthReceiver, e.Chains[destChain], oneE18) } func pickFirstAvailableUser( - tenv changeset.DeployedEnv, + tenv testhelpers.DeployedEnv, sourceChain uint64, e deployment.Environment, ) (*bind.TransactOpts, error) { diff --git a/integration-tests/contracts/ccipreader_test.go b/integration-tests/smoke/ccip/ccip_reader_test.go similarity index 96% rename from integration-tests/contracts/ccipreader_test.go rename to integration-tests/smoke/ccip/ccip_reader_test.go index b7ea027a568..f907c06f58f 100644 --- a/integration-tests/contracts/ccipreader_test.go +++ b/integration-tests/smoke/ccip/ccip_reader_test.go @@ -1,4 +1,4 @@ -package contracts +package smoke import ( "context" @@ -18,6 +18,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" "github.com/smartcontractkit/chainlink-ccip/plugintypes" @@ -590,15 +591,15 @@ func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) { t.Parallel() ctx := tests.Context(t) //env := NewMemoryEnvironmentContractsOnly(t, logger.TestLogger(t), 2, 4, nil) - env, _ := changeset.NewMemoryEnvironment(t) + env, _ := testhelpers.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) selectors := env.Env.AllChainSelectors() destChain, srcChain := selectors[0], selectors[1] - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, destChain, srcChain, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, srcChain, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, destChain, srcChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, srcChain, destChain, false) reader := testSetupRealContracts( ctx, @@ -619,8 +620,8 @@ func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) { maxExpectedSeqNum := uint64(10) var i uint64 for i = 1; i < maxExpectedSeqNum; i++ { - msg := changeset.DefaultRouterMessage(state.Chains[destChain].Receiver.Address()) - msgSentEvent := changeset.TestSendRequest(t, env.Env, state, srcChain, destChain, false, msg) + msg := testhelpers.DefaultRouterMessage(state.Chains[destChain].Receiver.Address()) + msgSentEvent := testhelpers.TestSendRequest(t, env.Env, state, srcChain, destChain, false, msg) require.Equal(t, uint64(i), msgSentEvent.SequenceNumber) require.Equal(t, uint64(i), msgSentEvent.Message.Header.Nonce) // check outbound nonce incremented seqNum, err2 := reader.GetExpectedNextSequenceNumber(ctx, cs(srcChain), cs(destChain)) @@ -700,15 +701,15 @@ func TestCCIPReader_Nonces(t *testing.T) { func Test_GetChainFeePriceUpdates(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env, _ := changeset.NewMemoryEnvironment(t) + env, _ := testhelpers.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) selectors := env.Env.AllChainSelectors() chain1, chain2 := selectors[0], selectors[1] - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false) // Change the gas price for chain2 feeQuoter := state.Chains[chain1].FeeQuoter @@ -756,15 +757,15 @@ func Test_GetChainFeePriceUpdates(t *testing.T) { func Test_LinkPriceUSD(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env, _ := changeset.NewMemoryEnvironment(t) + env, _ := testhelpers.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) selectors := env.Env.AllChainSelectors() chain1, chain2 := selectors[0], selectors[1] - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false) reader := testSetupRealContracts( ctx, @@ -785,22 +786,22 @@ func Test_LinkPriceUSD(t *testing.T) { linkPriceUSD, err := reader.LinkPriceUSD(ctx) require.NoError(t, err) require.NotNil(t, linkPriceUSD.Int) - require.Equal(t, changeset.DefaultLinkPrice, linkPriceUSD.Int) + require.Equal(t, testhelpers.DefaultLinkPrice, linkPriceUSD.Int) } func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env, _ := changeset.NewMemoryEnvironment(t, changeset.WithChains(4)) + env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(4)) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) selectors := env.Env.AllChainSelectors() destChain, chain1, chain2, chain3 := selectors[0], selectors[1], selectors[2], selectors[3] - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, destChain, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, destChain, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain3, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, destChain, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain3, destChain, false) boundContracts := map[cciptypes.ChainSelector][]types.BoundContract{} for i, selector := range env.Env.AllChainSelectorsExcluding([]uint64{destChain}) { @@ -850,15 +851,15 @@ func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) { func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) { t.Parallel() ctx := tests.Context(t) - env, _ := changeset.NewMemoryEnvironment(t) + env, _ := testhelpers.NewMemoryEnvironment(t) state, err := changeset.LoadOnchainState(env.Env) require.NoError(t, err) selectors := env.Env.AllChainSelectors() chain1, chain2 := selectors[0], selectors[1] - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false) - changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false) + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false) reader := testSetupRealContracts( ctx, @@ -884,7 +885,7 @@ func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) { // Only chainD has reader contracts bound require.Len(t, prices, 1) - require.Equal(t, changeset.DefaultWethPrice, prices[cciptypes.ChainSelector(chain1)].Int) + require.Equal(t, testhelpers.DefaultWethPrice, prices[cciptypes.ChainSelector(chain1)].Int) } // Benchmark Results: @@ -1341,7 +1342,7 @@ func testSetupRealContracts( destChain uint64, toBindContracts map[cciptypes.ChainSelector][]types.BoundContract, toMockBindings map[cciptypes.ChainSelector][]types.BoundContract, - env changeset.DeployedEnv, + env testhelpers.DeployedEnv, ) ccipreaderpkg.CCIPReader { db := pgtest.NewSqlxDB(t) lpOpts := logpoller.Opts{ diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go index fcf17956dc0..d8f5aae0882 100644 --- a/integration-tests/smoke/ccip/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -23,6 +23,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/environment/devenv" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_home" @@ -245,7 +246,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { t.Logf("Running RMN test case: %s", tc.name) envWithRMN, rmnCluster, _ := testsetups.NewIntegrationEnvironment(t, - changeset.WithRMNEnabled(len(tc.rmnNodes)), + testhelpers.WithRMNEnabled(len(tc.rmnNodes)), ) t.Logf("envWithRmn: %#v", envWithRMN) @@ -286,7 +287,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { t.Logf("RMNHome candidateDigest after setting new candidate: %x", candidateDigest[:]) t.Logf("Promoting RMNHome candidate with candidateDigest: %x", candidateDigest[:]) - _, err = changeset.PromoteCandidateConfigChangeset(envWithRMN.Env, changeset.PromoteRMNHomeCandidateConfig{ + _, err = changeset.PromoteRMNHomeCandidateConfigChangeset(envWithRMN.Env, changeset.PromoteRMNHomeCandidateConfig{ HomeChainSelector: envWithRMN.HomeChainSel, DigestToPromote: candidateDigest, }) @@ -319,8 +320,8 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { tc.killMarkedRmnNodes(t, rmnCluster) - changeset.ReplayLogs(t, envWithRMN.Env.Offchain, envWithRMN.ReplayBlocks) - changeset.AddLanesForAll(t, &envWithRMN, onChainState) + testhelpers.ReplayLogs(t, envWithRMN.Env.Offchain, envWithRMN.ReplayBlocks) + testhelpers.AddLanesForAll(t, &envWithRMN, onChainState) disabledNodes := tc.disableOraclesIfThisIsACursingTestCase(ctx, t, envWithRMN) startBlocks, seqNumCommit, seqNumExec := tc.sendMessages(t, onChainState, envWithRMN) @@ -332,7 +333,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { tc.enableOracles(ctx, t, envWithRMN, disabledNodes) - expectedSeqNum := make(map[changeset.SourceDestPair]uint64) + expectedSeqNum := make(map[testhelpers.SourceDestPair]uint64) for k, v := range seqNumCommit { cursedSubjectsOfDest, exists := tc.pf.cursedSubjectsPerChainSel[k.DestChainSelector] shouldSkip := exists && (slices.Contains(cursedSubjectsOfDest, globalCurse) || @@ -354,13 +355,13 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { commitReportReceived := make(chan struct{}) go func() { if len(expectedSeqNum) > 0 { - changeset.ConfirmCommitForAllWithExpectedSeqNums(t, envWithRMN.Env, onChainState, expectedSeqNum, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, envWithRMN.Env, onChainState, expectedSeqNum, startBlocks) commitReportReceived <- struct{}{} } if len(seqNumCommit) > 0 && len(seqNumCommit) > len(expectedSeqNum) { // wait for a duration and assert that commit reports were not delivered for cursed source chains - changeset.ConfirmCommitForAllWithExpectedSeqNums(t, envWithRMN.Env, onChainState, seqNumCommit, startBlocks) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, envWithRMN.Env, onChainState, seqNumCommit, startBlocks) commitReportReceived <- struct{}{} } }() @@ -392,7 +393,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) { if tc.waitForExec { t.Logf("⌛ Waiting for exec reports...") - changeset.ConfirmExecWithSeqNrsForAll(t, envWithRMN.Env, onChainState, seqNumExec, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, envWithRMN.Env, onChainState, seqNumExec, startBlocks) t.Logf("✅ Exec report") } } @@ -464,7 +465,7 @@ type testCasePopulatedFields struct { revokedCursedSubjectsPerChainSel map[uint64]map[uint64]time.Duration } -func (tc *rmnTestCase) populateFields(t *testing.T, envWithRMN changeset.DeployedEnv, rmnCluster devenv.RMNCluster) { +func (tc *rmnTestCase) populateFields(t *testing.T, envWithRMN testhelpers.DeployedEnv, rmnCluster devenv.RMNCluster) { require.GreaterOrEqual(t, len(envWithRMN.Env.Chains), 2, "test assumes at least two chains") for _, chain := range envWithRMN.Env.Chains { tc.pf.chainSelectors = append(tc.pf.chainSelectors, chain.Selector) @@ -553,7 +554,7 @@ func (tc rmnTestCase) killMarkedRmnNodes(t *testing.T, rmnCluster devenv.RMNClus } } -func (tc rmnTestCase) disableOraclesIfThisIsACursingTestCase(ctx context.Context, t *testing.T, envWithRMN changeset.DeployedEnv) []string { +func (tc rmnTestCase) disableOraclesIfThisIsACursingTestCase(ctx context.Context, t *testing.T, envWithRMN testhelpers.DeployedEnv) []string { disabledNodes := make([]string, 0) if len(tc.cursedSubjectsPerChain) > 0 { @@ -574,28 +575,28 @@ func (tc rmnTestCase) disableOraclesIfThisIsACursingTestCase(ctx context.Context return disabledNodes } -func (tc rmnTestCase) sendMessages(t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN changeset.DeployedEnv) (map[uint64]*uint64, map[changeset.SourceDestPair]uint64, map[changeset.SourceDestPair][]uint64) { +func (tc rmnTestCase) sendMessages(t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN testhelpers.DeployedEnv) (map[uint64]*uint64, map[testhelpers.SourceDestPair]uint64, map[testhelpers.SourceDestPair][]uint64) { startBlocks := make(map[uint64]*uint64) - seqNumCommit := make(map[changeset.SourceDestPair]uint64) - seqNumExec := make(map[changeset.SourceDestPair][]uint64) + seqNumCommit := make(map[testhelpers.SourceDestPair]uint64) + seqNumExec := make(map[testhelpers.SourceDestPair][]uint64) for _, msg := range tc.messagesToSend { fromChain := tc.pf.chainSelectors[msg.fromChainIdx] toChain := tc.pf.chainSelectors[msg.toChainIdx] for i := 0; i < msg.count; i++ { - msgSentEvent := changeset.TestSendRequest(t, envWithRMN.Env, onChainState, fromChain, toChain, false, router.ClientEVM2AnyMessage{ + msgSentEvent := testhelpers.TestSendRequest(t, envWithRMN.Env, onChainState, fromChain, toChain, false, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(onChainState.Chains[toChain].Receiver.Address().Bytes(), 32), Data: []byte("hello world"), TokenAmounts: nil, FeeToken: common.HexToAddress("0x0"), ExtraArgs: nil, }) - seqNumCommit[changeset.SourceDestPair{ + seqNumCommit[testhelpers.SourceDestPair{ SourceChainSelector: fromChain, DestChainSelector: toChain, }] = msgSentEvent.SequenceNumber - seqNumExec[changeset.SourceDestPair{ + seqNumExec[testhelpers.SourceDestPair{ SourceChainSelector: fromChain, DestChainSelector: toChain, }] = []uint64{msgSentEvent.SequenceNumber} @@ -609,7 +610,7 @@ func (tc rmnTestCase) sendMessages(t *testing.T, onChainState changeset.CCIPOnCh return startBlocks, seqNumCommit, seqNumExec } -func (tc rmnTestCase) callContractsToCurseChains(ctx context.Context, t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN changeset.DeployedEnv) { +func (tc rmnTestCase) callContractsToCurseChains(ctx context.Context, t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN testhelpers.DeployedEnv) { for _, remoteCfg := range tc.remoteChainsConfig { remoteSel := tc.pf.chainSelectors[remoteCfg.chainIdx] chState, ok := onChainState.Chains[remoteSel] @@ -644,7 +645,7 @@ func (tc rmnTestCase) callContractsToCurseChains(ctx context.Context, t *testing } } -func (tc rmnTestCase) callContractsToCurseAndRevokeCurse(ctx context.Context, eg *errgroup.Group, t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN changeset.DeployedEnv) { +func (tc rmnTestCase) callContractsToCurseAndRevokeCurse(ctx context.Context, eg *errgroup.Group, t *testing.T, onChainState changeset.CCIPOnChainState, envWithRMN testhelpers.DeployedEnv) { for _, remoteCfg := range tc.remoteChainsConfig { remoteSel := tc.pf.chainSelectors[remoteCfg.chainIdx] chState, ok := onChainState.Chains[remoteSel] @@ -700,7 +701,7 @@ func (tc rmnTestCase) callContractsToCurseAndRevokeCurse(ctx context.Context, eg } } -func (tc rmnTestCase) enableOracles(ctx context.Context, t *testing.T, envWithRMN changeset.DeployedEnv, nodeIDs []string) { +func (tc rmnTestCase) enableOracles(ctx context.Context, t *testing.T, envWithRMN testhelpers.DeployedEnv, nodeIDs []string) { for _, n := range nodeIDs { _, err := envWithRMN.Env.Offchain.EnableNode(ctx, &node.EnableNodeRequest{Id: n}) require.NoError(t, err) diff --git a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go index e54790de24c..4c15eecc545 100644 --- a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go +++ b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go @@ -19,23 +19,23 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" ) func Test_CCIPTokenPriceUpdates(t *testing.T) { - ctx := changeset.Context(t) + ctx := testhelpers.Context(t) callOpts := &bind.CallOpts{Context: ctx} var tokenPriceExpiry = 5 * time.Second e, _, _ := testsetups.NewIntegrationEnvironment(t, - changeset.WithOCRConfigOverride(func(params changeset.CCIPOCRParams) changeset.CCIPOCRParams { + testhelpers.WithOCRConfigOverride(func(params *changeset.CCIPOCRParams) { params.CommitOffChainConfig.TokenPriceBatchWriteFrequency = *config.MustNewDuration(tokenPriceExpiry) - return params })) state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) - changeset.AddLanesForAll(t, &e, state) + testhelpers.AddLanesForAll(t, &e, state) allChainSelectors := maps.Keys(e.Env.Chains) assert.GreaterOrEqual(t, len(allChainSelectors), 2, "test requires at least 2 chains") diff --git a/integration-tests/smoke/ccip/ccip_token_transfer_test.go b/integration-tests/smoke/ccip/ccip_token_transfer_test.go index 7946d6f8c7c..ef9a4bea8b8 100644 --- a/integration-tests/smoke/ccip/ccip_token_transfer_test.go +++ b/integration-tests/smoke/ccip/ccip_token_transfer_test.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -23,7 +24,7 @@ func TestTokenTransfer(t *testing.T) { ctx := tests.Context(t) tenv, _, _ := testsetups.NewIntegrationEnvironment(t, - changeset.WithUsersPerChain(3)) + testhelpers.WithNumOfUsersPerChain(3)) e := tenv.Env state, err := changeset.LoadOnchainState(e) @@ -43,7 +44,7 @@ func TestTokenTransfer(t *testing.T) { oneE18 := new(big.Int).SetUint64(1e18) // Deploy tokens and pool by CCIP Owner - srcToken, _, destToken, _, err := changeset.DeployTransferableToken( + srcToken, _, destToken, _, err := testhelpers.DeployTransferableToken( lggr, tenv.Env.Chains, sourceChain, @@ -57,7 +58,7 @@ func TestTokenTransfer(t *testing.T) { require.NoError(t, err) // Deploy Self Serve tokens and pool - selfServeSrcToken, _, selfServeDestToken, _, err := changeset.DeployTransferableToken( + selfServeSrcToken, _, selfServeDestToken, _, err := testhelpers.DeployTransferableToken( lggr, tenv.Env.Chains, sourceChain, @@ -69,25 +70,25 @@ func TestTokenTransfer(t *testing.T) { "SELF_SERVE_TOKEN", ) require.NoError(t, err) - changeset.AddLanesForAll(t, &tenv, state) + testhelpers.AddLanesForAll(t, &tenv, state) - changeset.MintAndAllow( + testhelpers.MintAndAllow( t, e, state, - map[uint64][]changeset.MintTokenInfo{ + map[uint64][]testhelpers.MintTokenInfo{ sourceChain: { - changeset.NewMintTokenInfo(selfServeSrcTokenPoolDeployer, selfServeSrcToken), - changeset.NewMintTokenInfo(ownerSourceChain, srcToken), + testhelpers.NewMintTokenInfo(selfServeSrcTokenPoolDeployer, selfServeSrcToken), + testhelpers.NewMintTokenInfo(ownerSourceChain, srcToken), }, destChain: { - changeset.NewMintTokenInfo(selfServeDestTokenPoolDeployer, selfServeDestToken), - changeset.NewMintTokenInfo(ownerDestChain, destToken), + testhelpers.NewMintTokenInfo(selfServeDestTokenPoolDeployer, selfServeDestToken), + testhelpers.NewMintTokenInfo(ownerDestChain, destToken), }, }, ) - tcs := []changeset.TestTransferRequest{ + tcs := []testhelpers.TestTransferRequest{ { Name: "Send token to EOA", SourceChain: sourceChain, @@ -102,7 +103,7 @@ func TestTokenTransfer(t *testing.T) { ExpectedTokenBalances: map[common.Address]*big.Int{ destToken.Address(): oneE18, }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "Send token to contract", @@ -118,7 +119,7 @@ func TestTokenTransfer(t *testing.T) { ExpectedTokenBalances: map[common.Address]*big.Int{ destToken.Address(): oneE18, }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "Send N tokens to contract", @@ -139,12 +140,12 @@ func TestTokenTransfer(t *testing.T) { }, }, Receiver: state.Chains[sourceChain].Receiver.Address(), - ExtraArgs: changeset.MakeEVMExtraArgsV2(300_000, false), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(300_000, false), ExpectedTokenBalances: map[common.Address]*big.Int{ selfServeSrcToken.Address(): new(big.Int).Add(oneE18, oneE18), srcToken.Address(): oneE18, }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "Sending token transfer with custom gasLimits to the EOA is successful", @@ -161,12 +162,12 @@ func TestTokenTransfer(t *testing.T) { }, }, Receiver: utils.RandomAddress(), - ExtraArgs: changeset.MakeEVMExtraArgsV2(1, false), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(1, false), ExpectedTokenBalances: map[common.Address]*big.Int{ selfServeSrcToken.Address(): oneE18, srcToken.Address(): new(big.Int).Add(oneE18, oneE18), }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "Sending PTT with too low gas limit leads to the revert when receiver is a contract", @@ -184,19 +185,19 @@ func TestTokenTransfer(t *testing.T) { }, Receiver: state.Chains[sourceChain].Receiver.Address(), Data: []byte("this should be reverted because gasLimit is too low, no tokens are transferred as well"), - ExtraArgs: changeset.MakeEVMExtraArgsV2(1, false), + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(1, false), ExpectedTokenBalances: map[common.Address]*big.Int{ selfServeSrcToken.Address(): big.NewInt(0), srcToken.Address(): big.NewInt(0), }, - ExpectedStatus: changeset.EXECUTION_STATE_FAILURE, + ExpectedStatus: testhelpers.EXECUTION_STATE_FAILURE, }, } startBlocks, expectedSeqNums, expectedExecutionStates, expectedTokenBalances := - changeset.TransferMultiple(ctx, t, e, state, tcs) + testhelpers.TransferMultiple(ctx, t, e, state, tcs) - err = changeset.ConfirmMultipleCommits( + err = testhelpers.ConfirmMultipleCommits( t, e.Chains, state.Chains, @@ -206,14 +207,14 @@ func TestTokenTransfer(t *testing.T) { ) require.NoError(t, err) - execStates := changeset.ConfirmExecWithSeqNrsForAll( + execStates := testhelpers.ConfirmExecWithSeqNrsForAll( t, e, state, - changeset.SeqNumberRangeToSlice(expectedSeqNums), + testhelpers.SeqNumberRangeToSlice(expectedSeqNums), startBlocks, ) require.Equal(t, expectedExecutionStates, execStates) - changeset.WaitForTokenBalances(ctx, t, e.Chains, expectedTokenBalances) + testhelpers.WaitForTokenBalances(ctx, t, e.Chains, expectedTokenBalances) } diff --git a/integration-tests/smoke/ccip/ccip_usdc_test.go b/integration-tests/smoke/ccip/ccip_usdc_test.go index 33af1570943..b64f8056c13 100644 --- a/integration-tests/smoke/ccip/ccip_usdc_test.go +++ b/integration-tests/smoke/ccip/ccip_usdc_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -33,9 +34,9 @@ func TestUSDCTokenTransfer(t *testing.T) { lggr := logger.TestLogger(t) ctx := tests.Context(t) tenv, _, _ := testsetups.NewIntegrationEnvironment(t, - changeset.WithUsersPerChain(3), - changeset.WithChains(3), - changeset.WithUSDC(), + testhelpers.WithNumOfUsersPerChain(3), + testhelpers.WithNumOfChains(3), + testhelpers.WithUSDC(), ) e := tenv.Env @@ -51,13 +52,13 @@ func TestUSDCTokenTransfer(t *testing.T) { ownerChainC := e.Chains[chainC].DeployerKey ownerChainB := e.Chains[chainB].DeployerKey - aChainUSDC, cChainUSDC, err := changeset.ConfigureUSDCTokenPools(lggr, e.Chains, chainA, chainC, state) + aChainUSDC, cChainUSDC, err := testhelpers.ConfigureUSDCTokenPools(lggr, e.Chains, chainA, chainC, state) require.NoError(t, err) - bChainUSDC, _, err := changeset.ConfigureUSDCTokenPools(lggr, e.Chains, chainB, chainC, state) + bChainUSDC, _, err := testhelpers.ConfigureUSDCTokenPools(lggr, e.Chains, chainB, chainC, state) require.NoError(t, err) - aChainToken, _, cChainToken, _, err := changeset.DeployTransferableToken( + aChainToken, _, cChainToken, _, err := testhelpers.DeployTransferableToken( lggr, tenv.Env.Chains, chainA, @@ -71,21 +72,21 @@ func TestUSDCTokenTransfer(t *testing.T) { require.NoError(t, err) // Add all lanes - changeset.AddLanesForAll(t, &tenv, state) + testhelpers.AddLanesForAll(t, &tenv, state) - changeset.MintAndAllow( + testhelpers.MintAndAllow( t, e, state, - map[uint64][]changeset.MintTokenInfo{ + map[uint64][]testhelpers.MintTokenInfo{ chainA: { - changeset.NewMintTokenInfo(ownerChainA, aChainUSDC, aChainToken), + testhelpers.NewMintTokenInfo(ownerChainA, aChainUSDC, aChainToken), }, chainB: { - changeset.NewMintTokenInfo(ownerChainB, bChainUSDC), + testhelpers.NewMintTokenInfo(ownerChainB, bChainUSDC), }, chainC: { - changeset.NewMintTokenInfo(ownerChainC, cChainUSDC, cChainToken), + testhelpers.NewMintTokenInfo(ownerChainC, cChainUSDC, cChainToken), }, }, ) @@ -96,7 +97,7 @@ func TestUSDCTokenTransfer(t *testing.T) { // MockE2EUSDCTransmitter always mint 1, see MockE2EUSDCTransmitter.sol for more details tinyOneCoin := new(big.Int).SetUint64(1) - tcs := []changeset.TestTransferRequest{ + tcs := []testhelpers.TestTransferRequest{ { Name: "single USDC token transfer to EOA", Receiver: utils.RandomAddress(), @@ -110,7 +111,7 @@ func TestUSDCTokenTransfer(t *testing.T) { ExpectedTokenBalances: map[common.Address]*big.Int{ aChainUSDC.Address(): tinyOneCoin, }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "multiple USDC tokens within the same message", @@ -131,7 +132,7 @@ func TestUSDCTokenTransfer(t *testing.T) { // 2 coins because of the same Receiver aChainUSDC.Address(): new(big.Int).Add(tinyOneCoin, tinyOneCoin), }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "USDC token together with another token transferred to EOA", @@ -152,7 +153,7 @@ func TestUSDCTokenTransfer(t *testing.T) { cChainUSDC.Address(): tinyOneCoin, cChainToken.Address(): new(big.Int).Mul(tinyOneCoin, big.NewInt(10)), }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "USDC programmable token transfer to valid contract receiver", @@ -169,7 +170,7 @@ func TestUSDCTokenTransfer(t *testing.T) { ExpectedTokenBalances: map[common.Address]*big.Int{ cChainUSDC.Address(): tinyOneCoin, }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, { Name: "USDC programmable token transfer with too little gas", @@ -186,8 +187,8 @@ func TestUSDCTokenTransfer(t *testing.T) { ExpectedTokenBalances: map[common.Address]*big.Int{ bChainUSDC.Address(): new(big.Int).SetUint64(0), }, - ExtraArgs: changeset.MakeEVMExtraArgsV2(1, false), - ExpectedStatus: changeset.EXECUTION_STATE_FAILURE, + ExtraArgs: testhelpers.MakeEVMExtraArgsV2(1, false), + ExpectedStatus: testhelpers.EXECUTION_STATE_FAILURE, }, { Name: "USDC token transfer from a different source chain", @@ -204,14 +205,14 @@ func TestUSDCTokenTransfer(t *testing.T) { ExpectedTokenBalances: map[common.Address]*big.Int{ cChainUSDC.Address(): tinyOneCoin, }, - ExpectedStatus: changeset.EXECUTION_STATE_SUCCESS, + ExpectedStatus: testhelpers.EXECUTION_STATE_SUCCESS, }, } startBlocks, expectedSeqNums, expectedExecutionStates, expectedTokenBalances := - changeset.TransferMultiple(ctx, t, e, state, tcs) + testhelpers.TransferMultiple(ctx, t, e, state, tcs) - err = changeset.ConfirmMultipleCommits( + err = testhelpers.ConfirmMultipleCommits( t, e.Chains, state.Chains, @@ -221,16 +222,16 @@ func TestUSDCTokenTransfer(t *testing.T) { ) require.NoError(t, err) - execStates := changeset.ConfirmExecWithSeqNrsForAll( + execStates := testhelpers.ConfirmExecWithSeqNrsForAll( t, e, state, - changeset.SeqNumberRangeToSlice(expectedSeqNums), + testhelpers.SeqNumberRangeToSlice(expectedSeqNums), startBlocks, ) require.Equal(t, expectedExecutionStates, execStates) - changeset.WaitForTokenBalances(ctx, t, e.Chains, expectedTokenBalances) + testhelpers.WaitForTokenBalances(ctx, t, e.Chains, expectedTokenBalances) } func updateFeeQuoters( @@ -242,17 +243,17 @@ func updateFeeQuoters( ) error { updateFeeQtrGrp := errgroup.Group{} updateFeeQtrGrp.Go(func() error { - return changeset.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainA], state.Chains[chainA], chainC, aChainUSDC) + return testhelpers.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainA], state.Chains[chainA], chainC, aChainUSDC) }) updateFeeQtrGrp.Go(func() error { - return changeset.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainB], state.Chains[chainB], chainC, bChainUSDC) + return testhelpers.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainB], state.Chains[chainB], chainC, bChainUSDC) }) updateFeeQtrGrp.Go(func() error { - err1 := changeset.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainC], state.Chains[chainC], chainA, cChainUSDC) + err1 := testhelpers.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainC], state.Chains[chainC], chainA, cChainUSDC) if err1 != nil { return err1 } - return changeset.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainC], state.Chains[chainC], chainB, cChainUSDC) + return testhelpers.UpdateFeeQuoterForUSDC(lggr, e.Chains[chainC], state.Chains[chainC], chainB, cChainUSDC) }) return updateFeeQtrGrp.Wait() } diff --git a/integration-tests/testsetups/ccip/test_helpers.go b/integration-tests/testsetups/ccip/test_helpers.go index 889c6b1cdf5..59a9bdb47ed 100644 --- a/integration-tests/testsetups/ccip/test_helpers.go +++ b/integration-tests/testsetups/ccip/test_helpers.go @@ -27,6 +27,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" integrationnodes "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" corechainlink "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -52,23 +53,23 @@ import ( // DeployedLocalDevEnvironment is a helper struct for setting up a local dev environment with docker type DeployedLocalDevEnvironment struct { - changeset.DeployedEnv + testhelpers.DeployedEnv testEnv *test_env.CLClusterTestEnv DON *devenv.DON - GenericTCConfig *changeset.TestConfigs + GenericTCConfig *testhelpers.TestConfigs devEnvTestCfg tc.TestConfig devEnvCfg *devenv.EnvironmentConfig } -func (l *DeployedLocalDevEnvironment) DeployedEnvironment() changeset.DeployedEnv { +func (l *DeployedLocalDevEnvironment) DeployedEnvironment() testhelpers.DeployedEnv { return l.DeployedEnv } -func (l *DeployedLocalDevEnvironment) UpdateDeployedEnvironment(env changeset.DeployedEnv) { +func (l *DeployedLocalDevEnvironment) UpdateDeployedEnvironment(env testhelpers.DeployedEnv) { l.DeployedEnv = env } -func (l *DeployedLocalDevEnvironment) TestConfigs() *changeset.TestConfigs { +func (l *DeployedLocalDevEnvironment) TestConfigs() *testhelpers.TestConfigs { return l.GenericTCConfig } @@ -91,7 +92,7 @@ func (l *DeployedLocalDevEnvironment) StartChains(t *testing.T) { require.NotEmpty(t, feedSel, "feedSel should not be empty") chains, err := devenv.NewChains(lggr, envConfig.Chains) require.NoError(t, err) - replayBlocks, err := changeset.LatestBlocksByChain(ctx, chains) + replayBlocks, err := testhelpers.LatestBlocksByChain(ctx, chains) require.NoError(t, err) l.DeployedEnv.Users = users l.DeployedEnv.Env.Chains = chains @@ -152,8 +153,8 @@ func (l *DeployedLocalDevEnvironment) RestartChainlinkNodes(t *testing.T) error // if CCIP_V16_TEST_ENV is set to 'docker', it creates a docker environment with test config provided under testconfig/ccip/ccip.toml // It also creates a RMN cluster if the test config has RMN enabled // It returns the deployed environment and RMN cluster ( in case of RMN enabled) -func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changeset.DeployedEnv, devenv.RMNCluster, changeset.TestEnvironment) { - testCfg := changeset.DefaultTestConfigs() +func NewIntegrationEnvironment(t *testing.T, opts ...testhelpers.TestOps) (testhelpers.DeployedEnv, devenv.RMNCluster, testhelpers.TestEnvironment) { + testCfg := testhelpers.DefaultTestConfigs() for _, opt := range opts { opt(testCfg) } @@ -161,21 +162,21 @@ func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changes testCfg.MustSetEnvTypeOrDefault(t) require.NoError(t, testCfg.Validate(), "invalid test config") switch testCfg.Type { - case changeset.Memory: - dEnv, memEnv := changeset.NewMemoryEnvironment(t, opts...) + case testhelpers.Memory: + dEnv, memEnv := testhelpers.NewMemoryEnvironment(t, opts...) return dEnv, devenv.RMNCluster{}, memEnv - case changeset.Docker: + case testhelpers.Docker: dockerEnv := &DeployedLocalDevEnvironment{ GenericTCConfig: testCfg, } if testCfg.PrerequisiteDeploymentOnly { - deployedEnv := changeset.NewEnvironmentWithPrerequisitesContracts(t, dockerEnv) + deployedEnv := testhelpers.NewEnvironmentWithPrerequisitesContracts(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") dockerEnv.UpdateDeployedEnvironment(deployedEnv) return deployedEnv, devenv.RMNCluster{}, dockerEnv } if testCfg.RMNEnabled { - deployedEnv := changeset.NewEnvironmentWithJobsAndContracts(t, dockerEnv) + deployedEnv := testhelpers.NewEnvironmentWithJobsAndContracts(t, dockerEnv) l := logging.GetTestLogger(t) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") config := GenerateTestRMNConfig(t, testCfg.NumOfRMNNodes, deployedEnv, MustNetworksToRPCMap(dockerEnv.testEnv.EVMNetworks)) @@ -194,25 +195,25 @@ func NewIntegrationEnvironment(t *testing.T, opts ...changeset.TestOps) (changes return deployedEnv, *rmnCluster, dockerEnv } if testCfg.CreateJobAndContracts { - deployedEnv := changeset.NewEnvironmentWithJobsAndContracts(t, dockerEnv) + deployedEnv := testhelpers.NewEnvironmentWithJobsAndContracts(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") dockerEnv.UpdateDeployedEnvironment(deployedEnv) return deployedEnv, devenv.RMNCluster{}, dockerEnv } if testCfg.CreateJob { - deployedEnv := changeset.NewEnvironmentWithJobs(t, dockerEnv) + deployedEnv := testhelpers.NewEnvironmentWithJobs(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") dockerEnv.UpdateDeployedEnvironment(deployedEnv) return deployedEnv, devenv.RMNCluster{}, dockerEnv } - deployedEnv := changeset.NewEnvironment(t, dockerEnv) + deployedEnv := testhelpers.NewEnvironment(t, dockerEnv) require.NotNil(t, dockerEnv.testEnv, "empty docker environment") dockerEnv.UpdateDeployedEnvironment(deployedEnv) return deployedEnv, devenv.RMNCluster{}, dockerEnv default: - require.Failf(t, "Type %s not supported in integration tests choose between %s and %s", string(testCfg.Type), changeset.Memory, changeset.Docker) + require.Failf(t, "Type %s not supported in integration tests choose between %s and %s", string(testCfg.Type), testhelpers.Memory, testhelpers.Docker) } - return changeset.DeployedEnv{}, devenv.RMNCluster{}, nil + return testhelpers.DeployedEnv{}, devenv.RMNCluster{}, nil } func MustNetworksToRPCMap(evmNetworks []*blockchain.EVMNetwork) map[uint64]string { @@ -243,7 +244,7 @@ func MustCCIPNameToRMNName(a string) string { return v } -func GenerateTestRMNConfig(t *testing.T, nRMNNodes int, tenv changeset.DeployedEnv, rpcMap map[uint64]string) map[string]devenv.RMNConfig { +func GenerateTestRMNConfig(t *testing.T, nRMNNodes int, tenv testhelpers.DeployedEnv, rpcMap map[uint64]string) map[string]devenv.RMNConfig { // Find the bootstrappers. nodes, err := deployment.NodeInfo(tenv.Env.NodeIDs, tenv.Env.Offchain) require.NoError(t, err) From 415343f304b574d4f024a82e0fad266060c34cf5 Mon Sep 17 00:00:00 2001 From: Street <5597260+MStreet3@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:00:00 -0500 Subject: [PATCH 78/91] fix(workflow/fetcher): validates response before use (#15921) * fix(workflow/fetcher): validates response before use * feat(capabilities): add Validate method on Response * feat(workflows/syncer): use Validate in Fetch and test * refactor(workflows/syncer): simplifies getWorkflowArtifacts * refactor(workflow/fetcher): lint fixes and clean up --- .changeset/cyan-ladybugs-check.md | 5 + .../gateway/handlers/capabilities/webapi.go | 21 ++++ .../handlers/capabilities/webapi_test.go | 54 ++++++++ core/services/workflows/syncer/fetcher.go | 14 ++- .../services/workflows/syncer/fetcher_test.go | 115 +++++++++++++++--- core/services/workflows/syncer/handler.go | 45 +++---- 6 files changed, 214 insertions(+), 40 deletions(-) create mode 100644 .changeset/cyan-ladybugs-check.md create mode 100644 core/services/gateway/handlers/capabilities/webapi_test.go diff --git a/.changeset/cyan-ladybugs-check.md b/.changeset/cyan-ladybugs-check.md new file mode 100644 index 00000000000..d430890001a --- /dev/null +++ b/.changeset/cyan-ladybugs-check.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +validates response from gateway in workflow/fetcher diff --git a/core/services/gateway/handlers/capabilities/webapi.go b/core/services/gateway/handlers/capabilities/webapi.go index a0213eb8f42..f4a324420c0 100644 --- a/core/services/gateway/handlers/capabilities/webapi.go +++ b/core/services/gateway/handlers/capabilities/webapi.go @@ -1,5 +1,7 @@ package capabilities +import "errors" + type Request struct { URL string `json:"url"` // URL to query, only http and https protocols are supported. Method string `json:"method,omitempty"` // HTTP verb, defaults to GET. @@ -16,6 +18,25 @@ type Response struct { Body []byte `json:"body,omitempty"` // HTTP response body } +// Validate ensures the Response struct is consistent. +func (r Response) Validate() error { + if r.ExecutionError { + if r.ErrorMessage == "" { + return errors.New("executionError is true but errorMessage is empty") + } + if r.StatusCode != 0 || len(r.Headers) > 0 || len(r.Body) > 0 { + return errors.New("executionError is true but response details (statusCode, headers, body) are populated") + } + return nil + } + + if r.StatusCode < 100 || r.StatusCode > 599 { + return errors.New("statusCode must be a valid HTTP status code (100-599)") + } + + return nil +} + type TriggerResponsePayload struct { ErrorMessage string `json:"error_message,omitempty"` // ERROR, ACCEPTED, PENDING, COMPLETED diff --git a/core/services/gateway/handlers/capabilities/webapi_test.go b/core/services/gateway/handlers/capabilities/webapi_test.go new file mode 100644 index 00000000000..2030c898053 --- /dev/null +++ b/core/services/gateway/handlers/capabilities/webapi_test.go @@ -0,0 +1,54 @@ +package capabilities + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestResponseValidate(t *testing.T) { + tt := []struct { + name string + response Response + expectError string + }{ + { + name: "valid Response with ExecutionError", + response: Response{ExecutionError: true, ErrorMessage: "Some error"}, + }, + { + name: "invalid Response with ExecutionError but no ErrorMessage", + response: Response{ExecutionError: true}, + expectError: "executionError is true but errorMessage is empty", + }, + { + name: "valid HTTP Response", + response: Response{StatusCode: 200}, + }, + { + name: "invalid status code", + response: Response{ + Body: []byte("body"), + }, + expectError: "statusCode must be set when executionError is false", + }, + { + name: "invalid HTTP Response with bad StatusCode", + response: Response{StatusCode: 700}, + expectError: "statusCode must be a valid HTTP status code (100-599)", + }, + } + + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + err := tc.response.Validate() + + if tc.expectError != "" { + require.Error(t, err) + return + } + + require.NoError(t, err) + }) + } +} diff --git a/core/services/workflows/syncer/fetcher.go b/core/services/workflows/syncer/fetcher.go index 5c8856d58c1..2e4fbd51354 100644 --- a/core/services/workflows/syncer/fetcher.go +++ b/core/services/workflows/syncer/fetcher.go @@ -93,13 +93,21 @@ func (s *FetcherService) Fetch(ctx context.Context, url string) ([]byte, error) return nil, err } - s.lggr.Debugw("received gateway response") + if err = resp.Validate(); err != nil { + return nil, fmt.Errorf("invalid response from gateway: %w", err) + } + + s.lggr.Debugw("received gateway response", "donID", resp.Body.DonId, "msgID", resp.Body.MessageId) + var payload ghcapabilities.Response - err = json.Unmarshal(resp.Body.Payload, &payload) - if err != nil { + if err = json.Unmarshal(resp.Body.Payload, &payload); err != nil { return nil, err } + if err = payload.Validate(); err != nil { + return nil, fmt.Errorf("invalid payload received from gateway message: %w", err) + } + if payload.ExecutionError { return nil, fmt.Errorf("execution error from gateway: %s", payload.ErrorMessage) } diff --git a/core/services/workflows/syncer/fetcher_test.go b/core/services/workflows/syncer/fetcher_test.go index 017b052f8ab..600cde5c577 100644 --- a/core/services/workflows/syncer/fetcher_test.go +++ b/core/services/workflows/syncer/fetcher_test.go @@ -2,6 +2,7 @@ package syncer import ( "context" + "crypto/ecdsa" "encoding/json" "strings" "testing" @@ -11,10 +12,12 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/common" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" gcmocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" + "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/smartcontractkit/chainlink/v2/core/utils/matches" ) @@ -33,9 +36,11 @@ func TestNewFetcherService(t *testing.T) { connector := gcmocks.NewGatewayConnector(t) wrapper := &wrapper{c: connector} - url := "http://example.com" - - msgID := strings.Join([]string{ghcapabilities.MethodWorkflowSyncer, hash(url)}, "/") + var ( + url = "http://example.com" + msgID = strings.Join([]string{ghcapabilities.MethodWorkflowSyncer, hash(url)}, "/") + donID = "don-id" + ) t.Run("OK-valid_request", func(t *testing.T) { connector.EXPECT().AddHandler([]string{capabilities.MethodWorkflowSyncer}, mock.Anything).Return(nil) @@ -44,11 +49,11 @@ func TestNewFetcherService(t *testing.T) { require.NoError(t, fetcher.Start(ctx)) defer fetcher.Close() - gatewayResp := gatewayResponse(t, msgID) + gatewayResp := signGatewayResponse(t, gatewayResponse(t, msgID, donID)) connector.EXPECT().SignAndSendToGateway(mock.Anything, "gateway1", mock.Anything).Run(func(ctx context.Context, gatewayID string, msg *api.MessageBody) { fetcher.och.HandleGatewayMessage(ctx, "gateway1", gatewayResp) }).Return(nil).Times(1) - connector.EXPECT().DonID().Return("don-id") + connector.EXPECT().DonID().Return(donID) connector.EXPECT().AwaitConnection(matches.AnyContext, "gateway1").Return(nil) connector.EXPECT().GatewayIDs().Return([]string{"gateway1", "gateway2"}) @@ -59,13 +64,51 @@ func TestNewFetcherService(t *testing.T) { require.Equal(t, expectedPayload, payload) }) + t.Run("fails with invalid payload response", func(t *testing.T) { + connector.EXPECT().AddHandler([]string{capabilities.MethodWorkflowSyncer}, mock.Anything).Return(nil) + + fetcher := NewFetcherService(lggr, wrapper) + require.NoError(t, fetcher.Start(ctx)) + defer fetcher.Close() + + gatewayResp := signGatewayResponse(t, inconsistentPayload(t, msgID, donID)) + connector.EXPECT().SignAndSendToGateway(mock.Anything, "gateway1", mock.Anything).Run(func(ctx context.Context, gatewayID string, msg *api.MessageBody) { + fetcher.och.HandleGatewayMessage(ctx, "gateway1", gatewayResp) + }).Return(nil).Times(1) + connector.EXPECT().DonID().Return(donID) + connector.EXPECT().AwaitConnection(matches.AnyContext, "gateway1").Return(nil) + connector.EXPECT().GatewayIDs().Return([]string{"gateway1", "gateway2"}) + + _, err := fetcher.Fetch(ctx, url) + require.Error(t, err) + }) + + t.Run("fails due to invalid gateway response", func(t *testing.T) { + connector.EXPECT().AddHandler([]string{capabilities.MethodWorkflowSyncer}, mock.Anything).Return(nil) + + fetcher := NewFetcherService(lggr, wrapper) + require.NoError(t, fetcher.Start(ctx)) + defer fetcher.Close() + + gatewayResp := gatewayResponse(t, msgID, donID) // gateway response that is not signed + connector.EXPECT().SignAndSendToGateway(mock.Anything, "gateway1", mock.Anything).Run(func(ctx context.Context, gatewayID string, msg *api.MessageBody) { + fetcher.och.HandleGatewayMessage(ctx, "gateway1", gatewayResp) + }).Return(nil).Times(1) + connector.EXPECT().DonID().Return(donID) + connector.EXPECT().AwaitConnection(matches.AnyContext, "gateway1").Return(nil) + connector.EXPECT().GatewayIDs().Return([]string{"gateway1", "gateway2"}) + + _, err := fetcher.Fetch(ctx, url) + require.Error(t, err) + require.ErrorContains(t, err, "invalid response from gateway") + }) + t.Run("NOK-response_payload_too_large", func(t *testing.T) { headers := map[string]string{"Content-Type": "application/json"} responsePayload, err := json.Marshal(ghcapabilities.Response{ - StatusCode: 400, - Headers: headers, - ErrorMessage: "http: request body too large", - ExecutionError: true, + StatusCode: 400, + Headers: headers, + ErrorMessage: "http: request body too large", }) require.NoError(t, err) gatewayResponse := &api.Message{ @@ -85,7 +128,7 @@ func TestNewFetcherService(t *testing.T) { connector.EXPECT().SignAndSendToGateway(mock.Anything, "gateway1", mock.Anything).Run(func(ctx context.Context, gatewayID string, msg *api.MessageBody) { fetcher.och.HandleGatewayMessage(ctx, "gateway1", gatewayResponse) }).Return(nil).Times(1) - connector.EXPECT().DonID().Return("don-id") + connector.EXPECT().DonID().Return(donID) connector.EXPECT().AwaitConnection(matches.AnyContext, "gateway1").Return(nil) connector.EXPECT().GatewayIDs().Return([]string{"gateway1", "gateway2"}) @@ -94,21 +137,63 @@ func TestNewFetcherService(t *testing.T) { }) } -func gatewayResponse(t *testing.T, msgID string) *api.Message { +// gatewayResponse creates an unsigned gateway response with a status code of 200 and a response body. +func gatewayResponse(t *testing.T, msgID string, donID string) *api.Message { headers := map[string]string{"Content-Type": "application/json"} body := []byte("response body") responsePayload, err := json.Marshal(ghcapabilities.Response{ - StatusCode: 200, - Headers: headers, - Body: body, - ExecutionError: false, + StatusCode: 200, + Headers: headers, + Body: body, }) require.NoError(t, err) return &api.Message{ Body: api.MessageBody{ MessageId: msgID, + DonId: donID, Method: ghcapabilities.MethodWebAPITarget, Payload: responsePayload, }, } } + +// inconsistentPayload creates an unsigned gateway response with an inconsistent payload. The +// ExecutionError is true, but there is no ErrorMessage, so it is invalid. +func inconsistentPayload(t *testing.T, msgID string, donID string) *api.Message { + responsePayload, err := json.Marshal(ghcapabilities.Response{ + ExecutionError: true, + }) + require.NoError(t, err) + return &api.Message{ + Body: api.MessageBody{ + MessageId: msgID, + DonId: donID, + Method: ghcapabilities.MethodWebAPITarget, + Payload: responsePayload, + }, + } +} + +// signGatewayResponse signs the gateway response with a private key and arbitrarily sets the receiver +// to the signer's address. A signature and receiver are required for a valid gateway response. +func signGatewayResponse(t *testing.T, msg *api.Message) *api.Message { + nodeKeys := common.NewTestNodes(t, 1) + s := &signer{pk: nodeKeys[0].PrivateKey} + signature, err := s.Sign(api.GetRawMessageBody(&msg.Body)...) + require.NoError(t, err) + msg.Signature = utils.StringToHex(string(signature)) + + signerBytes, err := msg.ExtractSigner() + require.NoError(t, err) + + msg.Body.Receiver = utils.StringToHex(string(signerBytes)) + return msg +} + +type signer struct { + pk *ecdsa.PrivateKey +} + +func (s *signer) Sign(data ...[]byte) ([]byte, error) { + return common.SignData(s.pk, data...) +} diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index 6d0ee7073e9..c8dbf94846d 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -495,34 +495,35 @@ func (h *eventHandler) getWorkflowArtifacts( ctx context.Context, payload WorkflowRegistryWorkflowRegisteredV1, ) ([]byte, []byte, error) { - spec, err := h.orm.GetWorkflowSpecByID(ctx, hex.EncodeToString(payload.WorkflowID[:])) - if err != nil { - binary, err2 := h.fetcher(ctx, payload.BinaryURL) - if err2 != nil { - return nil, nil, fmt.Errorf("failed to fetch binary from %s : %w", payload.BinaryURL, err2) + // Check if the workflow spec is already stored in the database + if spec, err := h.orm.GetWorkflowSpecByID(ctx, hex.EncodeToString(payload.WorkflowID[:])); err == nil { + // there is no update in the BinaryURL or ConfigURL, lets decode the stored artifacts + decodedBinary, err := hex.DecodeString(spec.Workflow) + if err != nil { + return nil, nil, fmt.Errorf("failed to decode stored workflow spec: %w", err) } + return decodedBinary, []byte(spec.Config), nil + } - decodedBinary, err2 := base64.StdEncoding.DecodeString(string(binary)) - if err2 != nil { - return nil, nil, fmt.Errorf("failed to decode binary: %w", err2) - } + // Fetch the binary and config files from the specified URLs. + var ( + binary, decodedBinary, config []byte + err error + ) + if binary, err = h.fetcher(ctx, payload.BinaryURL); err != nil { + return nil, nil, fmt.Errorf("failed to fetch binary from %s : %w", payload.BinaryURL, err) + } - var config []byte - if payload.ConfigURL != "" { - config, err2 = h.fetcher(ctx, payload.ConfigURL) - if err2 != nil { - return nil, nil, fmt.Errorf("failed to fetch config from %s : %w", payload.ConfigURL, err2) - } - } - return decodedBinary, config, nil + if decodedBinary, err = base64.StdEncoding.DecodeString(string(binary)); err != nil { + return nil, nil, fmt.Errorf("failed to decode binary: %w", err) } - // there is no update in the BinaryURL or ConfigURL, lets decode the stored artifacts - decodedBinary, err := hex.DecodeString(spec.Workflow) - if err != nil { - return nil, nil, fmt.Errorf("failed to decode stored workflow spec: %w", err) + if payload.ConfigURL != "" { + if config, err = h.fetcher(ctx, payload.ConfigURL); err != nil { + return nil, nil, fmt.Errorf("failed to fetch config from %s : %w", payload.ConfigURL, err) + } } - return decodedBinary, []byte(spec.Config), nil + return decodedBinary, config, nil } func (h *eventHandler) engineFactoryFn(ctx context.Context, id string, owner string, name string, config []byte, binary []byte) (services.Service, error) { From 1a260c0ee5be8c6d2546de8489428115c3bea9f2 Mon Sep 17 00:00:00 2001 From: Njegos Railic Date: Fri, 17 Jan 2025 08:42:19 +0100 Subject: [PATCH 79/91] Migrating rest of the tests to the latest version of e2e test workflow (#15957) --- .github/workflows/integration-tests.yml | 20 +++++++++------- .../on-demand-vrfv2-performance-test.yml | 23 ++++++++++--------- .../workflows/on-demand-vrfv2-smoke-tests.yml | 13 ++++++----- .../on-demand-vrfv2plus-performance-test.yml | 19 +++++++-------- .../on-demand-vrfv2plus-smoke-tests.yml | 13 ++++++----- .github/workflows/run-nightly-e2e-tests.yml | 9 ++++---- .github/workflows/run-selected-e2e-tests.yml | 13 ++++++----- 7 files changed, 60 insertions(+), 50 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 33bb7721d77..0677e9bc226 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -175,7 +175,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -192,7 +192,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -205,6 +204,8 @@ jobs: AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} run-core-e2e-tests-for-merge-queue: name: Run Core E2E Tests For Merge Queue @@ -216,7 +217,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -237,7 +238,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -250,6 +250,8 @@ jobs: AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} run-ccip-e2e-tests-for-pr: name: Run CCIP E2E Tests For PR @@ -261,7 +263,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -279,7 +281,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -292,6 +293,8 @@ jobs: AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} run-ccip-e2e-tests-for-merge-queue: name: Run CCIP E2E Tests For Merge Queue @@ -303,7 +306,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -321,7 +324,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -334,6 +336,8 @@ jobs: AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} check-e2e-test-results: if: always() diff --git a/.github/workflows/on-demand-vrfv2-performance-test.yml b/.github/workflows/on-demand-vrfv2-performance-test.yml index 2f3ea12cbe2..85ded7f1a58 100644 --- a/.github/workflows/on-demand-vrfv2-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2-performance-test.yml @@ -18,16 +18,16 @@ on: test_config_override_path: description: Path to a test config file used to override the default test config required: false - type: string + type: string test_secrets_override_key: description: 'Key to run tests with custom test secrets' required: false - type: string + type: string notify_user_id_on_failure: description: 'Enter Slack user ID to notify on test failure' required: false - type: string - + type: string + jobs: set-tests-to-run: name: Set tests to run @@ -60,7 +60,7 @@ jobs: "test_cmd": $test_cmd, "test_config_override_path": $test_config_override_path, "test_env_vars": { - "TEST_TYPE": $TEST_TYPE + "TEST_TYPE": $TEST_TYPE } } ] @@ -71,13 +71,13 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} slack_notification_after_tests: always slack_notification_after_tests_name: "VRF V2 Performance Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" - slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -85,7 +85,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -93,11 +92,13 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} - SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} + SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/on-demand-vrfv2-smoke-tests.yml b/.github/workflows/on-demand-vrfv2-smoke-tests.yml index db242c1aae2..ddfdedca54d 100644 --- a/.github/workflows/on-demand-vrfv2-smoke-tests.yml +++ b/.github/workflows/on-demand-vrfv2-smoke-tests.yml @@ -17,7 +17,7 @@ on: test_config_override_path: description: Path to a test config file used to override the default test config required: false - type: string + type: string test_secrets_override_key: description: 'Key to run tests with custom test secrets' required: false @@ -31,7 +31,7 @@ on: description: 'Enter Slack user ID to notify on test failure' required: false type: string - + jobs: set-tests-to-run: name: Set tests to run @@ -74,7 +74,7 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} @@ -88,7 +88,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -96,10 +95,12 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_NOTIFICATION_AFTER_TESTS_CHANNEL_ID: ${{ secrets.QA_VRF_SLACK_CHANNEL }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/on-demand-vrfv2plus-performance-test.yml b/.github/workflows/on-demand-vrfv2plus-performance-test.yml index 66878c552fd..fc9b9f7d8f3 100644 --- a/.github/workflows/on-demand-vrfv2plus-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2plus-performance-test.yml @@ -13,11 +13,11 @@ on: test_config_override_path: description: Path to a test config file used to override the default test config required: false - type: string + type: string test_secrets_override_key: description: 'Key to run tests with custom test secrets' required: false - type: string + type: string chainlink_version: description: Chainlink image version to use default: develop @@ -26,7 +26,7 @@ on: notify_user_id_on_failure: description: 'Enter Slack user ID to notify on test failure' required: false - type: string + type: string jobs: set-tests-to-run: @@ -60,7 +60,7 @@ jobs: "test_cmd": $test_cmd, "test_config_override_path": $test_config_override_path, "test_env_vars": { - "TEST_TYPE": $TEST_TYPE + "TEST_TYPE": $TEST_TYPE } } ] @@ -71,7 +71,7 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} @@ -85,7 +85,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -93,12 +92,14 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_NOTIFICATION_AFTER_TESTS_CHANNEL_ID: ${{ secrets.QA_VRF_SLACK_CHANNEL }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} - SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} + SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml index 51c80af9bfa..b44a41fd137 100644 --- a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml +++ b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml @@ -17,7 +17,7 @@ on: test_config_override_path: description: Path to a test config file used to override the default test config required: false - type: string + type: string test_secrets_override_key: description: 'Key to run tests with custom test secrets' required: false @@ -31,7 +31,7 @@ on: description: 'Enter Slack user ID to notify on test failure' required: false type: string - + jobs: set-tests-to-run: name: Set tests to run @@ -74,7 +74,7 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} @@ -88,7 +88,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -96,10 +95,12 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_NOTIFICATION_AFTER_TESTS_CHANNEL_ID: ${{ secrets.QA_VRF_SLACK_CHANNEL }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/run-nightly-e2e-tests.yml b/.github/workflows/run-nightly-e2e-tests.yml index 712fb088181..23b2f7ce7c1 100644 --- a/.github/workflows/run-nightly-e2e-tests.yml +++ b/.github/workflows/run-nightly-e2e-tests.yml @@ -20,7 +20,7 @@ on: jobs: call-run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: chainlink_version: ${{ inputs.chainlink_version || 'develop' }} test_path: .github/e2e-tests.yml @@ -35,7 +35,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -43,8 +42,10 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} diff --git a/.github/workflows/run-selected-e2e-tests.yml b/.github/workflows/run-selected-e2e-tests.yml index e95ce1cef19..ba96c3daa54 100644 --- a/.github/workflows/run-selected-e2e-tests.yml +++ b/.github/workflows/run-selected-e2e-tests.yml @@ -15,7 +15,7 @@ on: test_secrets_override_key: description: 'Enter the secret key to override test secrets' required: false - type: string + type: string test_config_override_path: description: 'Path to a test config file used to override the default test config' required: false @@ -23,19 +23,19 @@ on: with_existing_remote_runner_version: description: 'Use the existing remote runner version for k8s tests. Example: "d3bf5044af33e08be788a2df31c4a745cf69d787"' required: false - type: string + type: string workflow_run_name: description: 'Enter the name of the workflow run' default: 'Run E2E Tests' required: false type: string - + run-name: ${{ inputs.workflow_run_name }} jobs: call-run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0632b5652dd5eb03bfa87e23a2b3e2911484fe59 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 with: chainlink_version: ${{ github.event.inputs.chainlink_version }} test_path: .github/e2e-tests.yml @@ -49,7 +49,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -57,9 +56,11 @@ jobs: LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} LOKI_URL: ${{ secrets.LOKI_URL }} LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} From 9bc0db561bd23f523c2e2a3690ff69b9c923b567 Mon Sep 17 00:00:00 2001 From: Lukasz <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:38:55 +0100 Subject: [PATCH 80/91] Support getting test secrets in Github workflows from AWS Secrets Manager (#15966) * test aws secret * fix * add permissions * bump * bump * bump * bump * bump * bump * Bump * bump * bump * bump * Update workflows * update automation-nightly-tests workflow * update test config * bump version * Revert "update test config" This reverts commit 568e56075dfac47082e1a50b7b7b65a709c2dd09. --------- Co-authored-by: joaoluisam --- .github/workflows/automation-benchmark-tests.yml | 3 ++- .github/workflows/automation-load-tests.yml | 3 ++- .github/workflows/automation-nightly-tests.yml | 5 +++-- .github/workflows/automation-ondemand-tests.yml | 2 +- .github/workflows/ccip-chaos-tests.yml | 2 +- .github/workflows/ccip-load-tests.yml | 3 ++- .github/workflows/integration-chaos-tests.yml | 4 ++-- .github/workflows/integration-tests.yml | 8 ++++---- .github/workflows/on-demand-ocr-soak-test.yml | 3 ++- .github/workflows/on-demand-vrfv2-performance-test.yml | 2 +- .github/workflows/on-demand-vrfv2-smoke-tests.yml | 3 ++- .../workflows/on-demand-vrfv2plus-performance-test.yml | 3 ++- .github/workflows/on-demand-vrfv2plus-smoke-tests.yml | 3 ++- .github/workflows/run-nightly-e2e-tests.yml | 2 +- .github/workflows/run-selected-e2e-tests.yml | 3 ++- 15 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/automation-benchmark-tests.yml b/.github/workflows/automation-benchmark-tests.yml index 27169549181..ae73a65eb5f 100644 --- a/.github/workflows/automation-benchmark-tests.yml +++ b/.github/workflows/automation-benchmark-tests.yml @@ -28,7 +28,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: test_path: .github/e2e-tests.yml test_ids: '${{ inputs.testType }}/automation_test.go:TestAutomationBenchmark' @@ -36,6 +36,7 @@ jobs: SLACK_USER: ${{ inputs.slackMemberID }} SLACK_CHANNEL: C03KJ5S7KEK team: ${{ inputs.team }} + test_secrets_override_key: ${{ github.event.inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/automation-load-tests.yml b/.github/workflows/automation-load-tests.yml index a3581e7543e..42bd47649ef 100644 --- a/.github/workflows/automation-load-tests.yml +++ b/.github/workflows/automation-load-tests.yml @@ -23,7 +23,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: test_path: .github/e2e-tests.yml test_ids: 'load/automationv2_1/automationv2_1_test.go:TestLogTrigger' @@ -31,6 +31,7 @@ jobs: SLACK_USER: ${{ inputs.slackMemberID }} SLACK_CHANNEL: C03KJ5S7KEK team: ${{ inputs.team }} + test_secrets_override_key: ${{ github.event.inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/automation-nightly-tests.yml b/.github/workflows/automation-nightly-tests.yml index c184021f028..753ecd4f2a0 100644 --- a/.github/workflows/automation-nightly-tests.yml +++ b/.github/workflows/automation-nightly-tests.yml @@ -10,7 +10,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d # ctf-run-tests@0.2.0 with: test_path: .github/e2e-tests.yml test_trigger: Automation Nightly Tests @@ -26,7 +26,6 @@ jobs: PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} @@ -40,3 +39,5 @@ jobs: AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + MAIN_DNS_ZONE_PUBLIC_SDLC: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_SDLC }} + AWS_K8S_CLUSTER_NAME_SDLC: ${{ secrets.AWS_K8S_CLUSTER_NAME_SDLC }} \ No newline at end of file diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index e71f96ee816..5b940d867e9 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -168,7 +168,7 @@ jobs: call-run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: test_path: .github/e2e-tests.yml test_list: ${{ needs.set-tests-to-run.outputs.test_list }} diff --git a/.github/workflows/ccip-chaos-tests.yml b/.github/workflows/ccip-chaos-tests.yml index da8a866fc53..1e82c38dca4 100644 --- a/.github/workflows/ccip-chaos-tests.yml +++ b/.github/workflows/ccip-chaos-tests.yml @@ -21,7 +21,7 @@ concurrency: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: test_path: .github/e2e-tests.yml chainlink_version: ${{ github.sha }} diff --git a/.github/workflows/ccip-load-tests.yml b/.github/workflows/ccip-load-tests.yml index e13636724a9..312de974273 100644 --- a/.github/workflows/ccip-load-tests.yml +++ b/.github/workflows/ccip-load-tests.yml @@ -36,7 +36,7 @@ concurrency: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: test_path: .github/e2e-tests.yml test_trigger: E2E CCIP Load Tests @@ -47,6 +47,7 @@ jobs: slack_notification_after_tests_name: CCIP E2E Load Tests test_image_suites: ccip-load team: ${{ inputs.team }} + test_secrets_override_key: ${{ github.event.inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/integration-chaos-tests.yml b/.github/workflows/integration-chaos-tests.yml index 670a08f1754..b0e337631a4 100644 --- a/.github/workflows/integration-chaos-tests.yml +++ b/.github/workflows/integration-chaos-tests.yml @@ -15,7 +15,7 @@ on: jobs: run-e2e-tests-workflow-dispatch: name: Run E2E Tests (Workflow Dispatch) - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d if: github.event_name == 'workflow_dispatch' with: test_path: .github/e2e-tests.yml @@ -48,7 +48,7 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests (Push and Sechedule) - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d if: github.event_name != 'workflow_dispatch' with: test_path: .github/e2e-tests.yml diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0677e9bc226..76a5aa379b4 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -175,7 +175,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -217,7 +217,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -263,7 +263,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -306,7 +306,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} diff --git a/.github/workflows/on-demand-ocr-soak-test.yml b/.github/workflows/on-demand-ocr-soak-test.yml index 57b47401fe9..32284137722 100644 --- a/.github/workflows/on-demand-ocr-soak-test.yml +++ b/.github/workflows/on-demand-ocr-soak-test.yml @@ -43,7 +43,7 @@ on: jobs: run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: test_path: .github/e2e-tests.yml test_ids: ${{ inputs.testToRun}} @@ -51,6 +51,7 @@ jobs: chainlink_version: ${{ inputs.chainlink_version }} SLACK_USER: ${{ inputs.slackMemberID }} team: ${{ inputs.team }} + test_secrets_override_key: ${{ inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/on-demand-vrfv2-performance-test.yml b/.github/workflows/on-demand-vrfv2-performance-test.yml index 85ded7f1a58..e2ccf70cd32 100644 --- a/.github/workflows/on-demand-vrfv2-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2-performance-test.yml @@ -71,7 +71,7 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} diff --git a/.github/workflows/on-demand-vrfv2-smoke-tests.yml b/.github/workflows/on-demand-vrfv2-smoke-tests.yml index ddfdedca54d..5352c64c027 100644 --- a/.github/workflows/on-demand-vrfv2-smoke-tests.yml +++ b/.github/workflows/on-demand-vrfv2-smoke-tests.yml @@ -74,13 +74,14 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} slack_notification_after_tests: always slack_notification_after_tests_name: "VRF V2 Smoke Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + test_secrets_override_key: ${{ inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/on-demand-vrfv2plus-performance-test.yml b/.github/workflows/on-demand-vrfv2plus-performance-test.yml index fc9b9f7d8f3..82b2d67b616 100644 --- a/.github/workflows/on-demand-vrfv2plus-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2plus-performance-test.yml @@ -71,13 +71,14 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} slack_notification_after_tests: always slack_notification_after_tests_name: "VRF V2 Plus Performance Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + test_secrets_override_key: ${{ inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml index b44a41fd137..48c7cb5a3e5 100644 --- a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml +++ b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml @@ -74,13 +74,14 @@ jobs: run-e2e-tests-workflow: name: Run E2E Tests needs: set-tests-to-run - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} chainlink_version: ${{ inputs.chainlink_version }} slack_notification_after_tests: always slack_notification_after_tests_name: "VRF V2 Plus Smoke Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + test_secrets_override_key: ${{ inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/run-nightly-e2e-tests.yml b/.github/workflows/run-nightly-e2e-tests.yml index 23b2f7ce7c1..76783601e75 100644 --- a/.github/workflows/run-nightly-e2e-tests.yml +++ b/.github/workflows/run-nightly-e2e-tests.yml @@ -20,7 +20,7 @@ on: jobs: call-run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: chainlink_version: ${{ inputs.chainlink_version || 'develop' }} test_path: .github/e2e-tests.yml diff --git a/.github/workflows/run-selected-e2e-tests.yml b/.github/workflows/run-selected-e2e-tests.yml index ba96c3daa54..3b1efc8c45c 100644 --- a/.github/workflows/run-selected-e2e-tests.yml +++ b/.github/workflows/run-selected-e2e-tests.yml @@ -35,13 +35,14 @@ run-name: ${{ inputs.workflow_run_name }} jobs: call-run-e2e-tests-workflow: name: Run E2E Tests - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@fb79097de87a6391457ccc36f82387746d1cef55 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@61acf908014e2fe42c04f2a507c79f97eb5f8c4d with: chainlink_version: ${{ github.event.inputs.chainlink_version }} test_path: .github/e2e-tests.yml test_ids: ${{ github.event.inputs.test_ids }} test_config_override_path: ${{ github.event.inputs.test_config_override_path }} with_existing_remote_runner_version: ${{ github.event.inputs.with_existing_remote_runner_version }} + test_secrets_override_key: ${{ github.event.inputs.test_secrets_override_key }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} From a5ed556b6621c6f3abfdb69e38ba14901be1ac22 Mon Sep 17 00:00:00 2001 From: Cedric Date: Fri, 17 Jan 2025 11:53:03 +0000 Subject: [PATCH 81/91] [CAPPL-472] Avoid overwriting engines (#15967) --- core/services/workflows/syncer/engine_registry.go | 6 +++++- core/services/workflows/syncer/handler.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/services/workflows/syncer/engine_registry.go b/core/services/workflows/syncer/engine_registry.go index fa3771c5a0f..ecea3b98c2f 100644 --- a/core/services/workflows/syncer/engine_registry.go +++ b/core/services/workflows/syncer/engine_registry.go @@ -19,10 +19,14 @@ func NewEngineRegistry() *EngineRegistry { } // Add adds an engine to the registry. -func (r *EngineRegistry) Add(id string, engine services.Service) { +func (r *EngineRegistry) Add(id string, engine services.Service) error { r.mu.Lock() defer r.mu.Unlock() + if _, found := r.engines[id]; found { + return errors.New("attempting to register duplicate engine") + } r.engines[id] = engine + return nil } // Get retrieves an engine from the registry. diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index c8dbf94846d..f560a96da25 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -484,7 +484,11 @@ func (h *eventHandler) workflowRegisteredEvent( return fmt.Errorf("failed to start workflow engine: %w", err) } - h.engineRegistry.Add(wfID, engine) + // This shouldn't happen because we call the handler serially and + // check for running engines above, see the call to engineRegistry.IsRunning. + if err := h.engineRegistry.Add(wfID, engine); err != nil { + return fmt.Errorf("invariant violation: %w", err) + } return nil } From 2f88d75cfbd4343236a7bfc1a594b56fb4085001 Mon Sep 17 00:00:00 2001 From: Aleksandr Bukata <96521086+bukata-sa@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:34:50 +0000 Subject: [PATCH 82/91] aggregator-v2v3 contract gethwrapper (#15945) --- .../scripts/native_solc_compile_all_feeds | 1 + .../aggregator_v2v3_interface.go | 750 ++++++++++++++++++ ...rapper-dependency-versions-do-not-edit.txt | 1 + core/gethwrappers/go_generate.go | 1 + 4 files changed, 753 insertions(+) create mode 100644 core/gethwrappers/generated/aggregator_v2v3_interface/aggregator_v2v3_interface.go diff --git a/contracts/scripts/native_solc_compile_all_feeds b/contracts/scripts/native_solc_compile_all_feeds index c6b80958156..9e0a58b4364 100755 --- a/contracts/scripts/native_solc_compile_all_feeds +++ b/contracts/scripts/native_solc_compile_all_feeds @@ -30,5 +30,6 @@ compileContract () { } # Aggregators +compileContract shared/interfaces/AggregatorV2V3Interface.sol compileContract operatorforwarder/Chainlink.sol compileContract operatorforwarder/ChainlinkClient.sol diff --git a/core/gethwrappers/generated/aggregator_v2v3_interface/aggregator_v2v3_interface.go b/core/gethwrappers/generated/aggregator_v2v3_interface/aggregator_v2v3_interface.go new file mode 100644 index 00000000000..e008e54fbb4 --- /dev/null +++ b/core/gethwrappers/generated/aggregator_v2v3_interface/aggregator_v2v3_interface.go @@ -0,0 +1,750 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package aggregator_v2v3_interface + +import ( + "errors" + "fmt" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var AggregatorV2V3InterfaceMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int256\",\"name\":\"current\",\"type\":\"int256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"}],\"name\":\"AnswerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"startedBy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"}],\"name\":\"NewRound\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"description\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"}],\"name\":\"getAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint80\",\"name\":\"_roundId\",\"type\":\"uint80\"}],\"name\":\"getRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"}],\"name\":\"getTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var AggregatorV2V3InterfaceABI = AggregatorV2V3InterfaceMetaData.ABI + +type AggregatorV2V3Interface struct { + address common.Address + abi abi.ABI + AggregatorV2V3InterfaceCaller + AggregatorV2V3InterfaceTransactor + AggregatorV2V3InterfaceFilterer +} + +type AggregatorV2V3InterfaceCaller struct { + contract *bind.BoundContract +} + +type AggregatorV2V3InterfaceTransactor struct { + contract *bind.BoundContract +} + +type AggregatorV2V3InterfaceFilterer struct { + contract *bind.BoundContract +} + +type AggregatorV2V3InterfaceSession struct { + Contract *AggregatorV2V3Interface + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type AggregatorV2V3InterfaceCallerSession struct { + Contract *AggregatorV2V3InterfaceCaller + CallOpts bind.CallOpts +} + +type AggregatorV2V3InterfaceTransactorSession struct { + Contract *AggregatorV2V3InterfaceTransactor + TransactOpts bind.TransactOpts +} + +type AggregatorV2V3InterfaceRaw struct { + Contract *AggregatorV2V3Interface +} + +type AggregatorV2V3InterfaceCallerRaw struct { + Contract *AggregatorV2V3InterfaceCaller +} + +type AggregatorV2V3InterfaceTransactorRaw struct { + Contract *AggregatorV2V3InterfaceTransactor +} + +func NewAggregatorV2V3Interface(address common.Address, backend bind.ContractBackend) (*AggregatorV2V3Interface, error) { + abi, err := abi.JSON(strings.NewReader(AggregatorV2V3InterfaceABI)) + if err != nil { + return nil, err + } + contract, err := bindAggregatorV2V3Interface(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &AggregatorV2V3Interface{address: address, abi: abi, AggregatorV2V3InterfaceCaller: AggregatorV2V3InterfaceCaller{contract: contract}, AggregatorV2V3InterfaceTransactor: AggregatorV2V3InterfaceTransactor{contract: contract}, AggregatorV2V3InterfaceFilterer: AggregatorV2V3InterfaceFilterer{contract: contract}}, nil +} + +func NewAggregatorV2V3InterfaceCaller(address common.Address, caller bind.ContractCaller) (*AggregatorV2V3InterfaceCaller, error) { + contract, err := bindAggregatorV2V3Interface(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &AggregatorV2V3InterfaceCaller{contract: contract}, nil +} + +func NewAggregatorV2V3InterfaceTransactor(address common.Address, transactor bind.ContractTransactor) (*AggregatorV2V3InterfaceTransactor, error) { + contract, err := bindAggregatorV2V3Interface(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &AggregatorV2V3InterfaceTransactor{contract: contract}, nil +} + +func NewAggregatorV2V3InterfaceFilterer(address common.Address, filterer bind.ContractFilterer) (*AggregatorV2V3InterfaceFilterer, error) { + contract, err := bindAggregatorV2V3Interface(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &AggregatorV2V3InterfaceFilterer{contract: contract}, nil +} + +func bindAggregatorV2V3Interface(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := AggregatorV2V3InterfaceMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AggregatorV2V3Interface.Contract.AggregatorV2V3InterfaceCaller.contract.Call(opts, result, method, params...) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AggregatorV2V3Interface.Contract.AggregatorV2V3InterfaceTransactor.contract.Transfer(opts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AggregatorV2V3Interface.Contract.AggregatorV2V3InterfaceTransactor.contract.Transact(opts, method, params...) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AggregatorV2V3Interface.Contract.contract.Call(opts, result, method, params...) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AggregatorV2V3Interface.Contract.contract.Transfer(opts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AggregatorV2V3Interface.Contract.contract.Transact(opts, method, params...) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) Decimals() (uint8, error) { + return _AggregatorV2V3Interface.Contract.Decimals(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) Decimals() (uint8, error) { + return _AggregatorV2V3Interface.Contract.Decimals(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) Description(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "description") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) Description() (string, error) { + return _AggregatorV2V3Interface.Contract.Description(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) Description() (string, error) { + return _AggregatorV2V3Interface.Contract.Description(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) GetAnswer(opts *bind.CallOpts, roundId *big.Int) (*big.Int, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "getAnswer", roundId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) GetAnswer(roundId *big.Int) (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.GetAnswer(&_AggregatorV2V3Interface.CallOpts, roundId) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) GetAnswer(roundId *big.Int) (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.GetAnswer(&_AggregatorV2V3Interface.CallOpts, roundId) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (GetRoundData, + + error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "getRoundData", _roundId) + + outstruct := new(GetRoundData) + if err != nil { + return *outstruct, err + } + + outstruct.RoundId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Answer = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.StartedAt = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.UpdatedAt = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.AnsweredInRound = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) GetRoundData(_roundId *big.Int) (GetRoundData, + + error) { + return _AggregatorV2V3Interface.Contract.GetRoundData(&_AggregatorV2V3Interface.CallOpts, _roundId) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) GetRoundData(_roundId *big.Int) (GetRoundData, + + error) { + return _AggregatorV2V3Interface.Contract.GetRoundData(&_AggregatorV2V3Interface.CallOpts, _roundId) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) GetTimestamp(opts *bind.CallOpts, roundId *big.Int) (*big.Int, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "getTimestamp", roundId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) GetTimestamp(roundId *big.Int) (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.GetTimestamp(&_AggregatorV2V3Interface.CallOpts, roundId) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) GetTimestamp(roundId *big.Int) (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.GetTimestamp(&_AggregatorV2V3Interface.CallOpts, roundId) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) LatestAnswer(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "latestAnswer") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) LatestAnswer() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.LatestAnswer(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) LatestAnswer() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.LatestAnswer(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) LatestRound(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "latestRound") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) LatestRound() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.LatestRound(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) LatestRound() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.LatestRound(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) LatestRoundData(opts *bind.CallOpts) (LatestRoundData, + + error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "latestRoundData") + + outstruct := new(LatestRoundData) + if err != nil { + return *outstruct, err + } + + outstruct.RoundId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Answer = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.StartedAt = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.UpdatedAt = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.AnsweredInRound = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) LatestRoundData() (LatestRoundData, + + error) { + return _AggregatorV2V3Interface.Contract.LatestRoundData(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) LatestRoundData() (LatestRoundData, + + error) { + return _AggregatorV2V3Interface.Contract.LatestRoundData(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "latestTimestamp") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) LatestTimestamp() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.LatestTimestamp(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) LatestTimestamp() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.LatestTimestamp(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCaller) Version(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _AggregatorV2V3Interface.contract.Call(opts, &out, "version") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceSession) Version() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.Version(&_AggregatorV2V3Interface.CallOpts) +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceCallerSession) Version() (*big.Int, error) { + return _AggregatorV2V3Interface.Contract.Version(&_AggregatorV2V3Interface.CallOpts) +} + +type AggregatorV2V3InterfaceAnswerUpdatedIterator struct { + Event *AggregatorV2V3InterfaceAnswerUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *AggregatorV2V3InterfaceAnswerUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(AggregatorV2V3InterfaceAnswerUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(AggregatorV2V3InterfaceAnswerUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *AggregatorV2V3InterfaceAnswerUpdatedIterator) Error() error { + return it.fail +} + +func (it *AggregatorV2V3InterfaceAnswerUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type AggregatorV2V3InterfaceAnswerUpdated struct { + Current *big.Int + RoundId *big.Int + UpdatedAt *big.Int + Raw types.Log +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) FilterAnswerUpdated(opts *bind.FilterOpts, current []*big.Int, roundId []*big.Int) (*AggregatorV2V3InterfaceAnswerUpdatedIterator, error) { + + var currentRule []interface{} + for _, currentItem := range current { + currentRule = append(currentRule, currentItem) + } + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + + logs, sub, err := _AggregatorV2V3Interface.contract.FilterLogs(opts, "AnswerUpdated", currentRule, roundIdRule) + if err != nil { + return nil, err + } + return &AggregatorV2V3InterfaceAnswerUpdatedIterator{contract: _AggregatorV2V3Interface.contract, event: "AnswerUpdated", logs: logs, sub: sub}, nil +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) WatchAnswerUpdated(opts *bind.WatchOpts, sink chan<- *AggregatorV2V3InterfaceAnswerUpdated, current []*big.Int, roundId []*big.Int) (event.Subscription, error) { + + var currentRule []interface{} + for _, currentItem := range current { + currentRule = append(currentRule, currentItem) + } + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + + logs, sub, err := _AggregatorV2V3Interface.contract.WatchLogs(opts, "AnswerUpdated", currentRule, roundIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(AggregatorV2V3InterfaceAnswerUpdated) + if err := _AggregatorV2V3Interface.contract.UnpackLog(event, "AnswerUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) ParseAnswerUpdated(log types.Log) (*AggregatorV2V3InterfaceAnswerUpdated, error) { + event := new(AggregatorV2V3InterfaceAnswerUpdated) + if err := _AggregatorV2V3Interface.contract.UnpackLog(event, "AnswerUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type AggregatorV2V3InterfaceNewRoundIterator struct { + Event *AggregatorV2V3InterfaceNewRound + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *AggregatorV2V3InterfaceNewRoundIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(AggregatorV2V3InterfaceNewRound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(AggregatorV2V3InterfaceNewRound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *AggregatorV2V3InterfaceNewRoundIterator) Error() error { + return it.fail +} + +func (it *AggregatorV2V3InterfaceNewRoundIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type AggregatorV2V3InterfaceNewRound struct { + RoundId *big.Int + StartedBy common.Address + StartedAt *big.Int + Raw types.Log +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*AggregatorV2V3InterfaceNewRoundIterator, error) { + + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + var startedByRule []interface{} + for _, startedByItem := range startedBy { + startedByRule = append(startedByRule, startedByItem) + } + + logs, sub, err := _AggregatorV2V3Interface.contract.FilterLogs(opts, "NewRound", roundIdRule, startedByRule) + if err != nil { + return nil, err + } + return &AggregatorV2V3InterfaceNewRoundIterator{contract: _AggregatorV2V3Interface.contract, event: "NewRound", logs: logs, sub: sub}, nil +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) WatchNewRound(opts *bind.WatchOpts, sink chan<- *AggregatorV2V3InterfaceNewRound, roundId []*big.Int, startedBy []common.Address) (event.Subscription, error) { + + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + var startedByRule []interface{} + for _, startedByItem := range startedBy { + startedByRule = append(startedByRule, startedByItem) + } + + logs, sub, err := _AggregatorV2V3Interface.contract.WatchLogs(opts, "NewRound", roundIdRule, startedByRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(AggregatorV2V3InterfaceNewRound) + if err := _AggregatorV2V3Interface.contract.UnpackLog(event, "NewRound", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) ParseNewRound(log types.Log) (*AggregatorV2V3InterfaceNewRound, error) { + event := new(AggregatorV2V3InterfaceNewRound) + if err := _AggregatorV2V3Interface.contract.UnpackLog(event, "NewRound", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetRoundData struct { + RoundId *big.Int + Answer *big.Int + StartedAt *big.Int + UpdatedAt *big.Int + AnsweredInRound *big.Int +} +type LatestRoundData struct { + RoundId *big.Int + Answer *big.Int + StartedAt *big.Int + UpdatedAt *big.Int + AnsweredInRound *big.Int +} + +func (_AggregatorV2V3Interface *AggregatorV2V3Interface) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _AggregatorV2V3Interface.abi.Events["AnswerUpdated"].ID: + return _AggregatorV2V3Interface.ParseAnswerUpdated(log) + case _AggregatorV2V3Interface.abi.Events["NewRound"].ID: + return _AggregatorV2V3Interface.ParseNewRound(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (AggregatorV2V3InterfaceAnswerUpdated) Topic() common.Hash { + return common.HexToHash("0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f") +} + +func (AggregatorV2V3InterfaceNewRound) Topic() common.Hash { + return common.HexToHash("0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271") +} + +func (_AggregatorV2V3Interface *AggregatorV2V3Interface) Address() common.Address { + return _AggregatorV2V3Interface.address +} + +type AggregatorV2V3InterfaceInterface interface { + Decimals(opts *bind.CallOpts) (uint8, error) + + Description(opts *bind.CallOpts) (string, error) + + GetAnswer(opts *bind.CallOpts, roundId *big.Int) (*big.Int, error) + + GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (GetRoundData, + + error) + + GetTimestamp(opts *bind.CallOpts, roundId *big.Int) (*big.Int, error) + + LatestAnswer(opts *bind.CallOpts) (*big.Int, error) + + LatestRound(opts *bind.CallOpts) (*big.Int, error) + + LatestRoundData(opts *bind.CallOpts) (LatestRoundData, + + error) + + LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) + + Version(opts *bind.CallOpts) (*big.Int, error) + + FilterAnswerUpdated(opts *bind.FilterOpts, current []*big.Int, roundId []*big.Int) (*AggregatorV2V3InterfaceAnswerUpdatedIterator, error) + + WatchAnswerUpdated(opts *bind.WatchOpts, sink chan<- *AggregatorV2V3InterfaceAnswerUpdated, current []*big.Int, roundId []*big.Int) (event.Subscription, error) + + ParseAnswerUpdated(log types.Log) (*AggregatorV2V3InterfaceAnswerUpdated, error) + + FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*AggregatorV2V3InterfaceNewRoundIterator, error) + + WatchNewRound(opts *bind.WatchOpts, sink chan<- *AggregatorV2V3InterfaceNewRound, roundId []*big.Int, startedBy []common.Address) (event.Subscription, error) + + ParseNewRound(log types.Log) (*AggregatorV2V3InterfaceNewRound, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 03ebf78995e..7080ec31b26 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,5 @@ GETH_VERSION: 1.14.11 +aggregator_v2v3_interface: ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.bin 95e8814b408bb05bf21742ef580d98698b7db6a9bac6a35c3de12b23aec4ee28 arbitrum_module: ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.abi ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.bin 12a7bad1f887d832d101a73ae279a91a90c93fd72befea9983e85eff493f62f4 authorized_forwarder: ../../contracts/solc/v0.8.19/AuthorizedForwarder/AuthorizedForwarder.abi ../../contracts/solc/v0.8.19/AuthorizedForwarder/AuthorizedForwarder.bin 8ea76c883d460f8353a45a493f2aebeb5a2d9a7b4619d1bc4fff5fb590bb3e10 authorized_receiver: ../../contracts/solc/v0.8.19/AuthorizedReceiver/AuthorizedReceiver.abi ../../contracts/solc/v0.8.19/AuthorizedReceiver/AuthorizedReceiver.bin 18e8969ba3234b027e1b16c11a783aca58d0ea5c2361010ec597f134b7bf1c4f diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index ab610f01d67..7f1d3f02e91 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -145,6 +145,7 @@ package gethwrappers //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/VRFCoordinatorTestV2_5/VRFCoordinatorTestV2_5.abi ../../contracts/solc/v0.8.19/VRFCoordinatorTestV2_5/VRFCoordinatorTestV2_5.bin VRFCoordinatorTestV2_5 vrf_coordinator_test_v2_5 // Aggregators +//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.bin AggregatorV2V3Interface aggregator_v2v3_interface //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/MockAggregatorProxy/MockAggregatorProxy.abi ../../contracts/solc/v0.8.6/MockAggregatorProxy/MockAggregatorProxy.bin MockAggregatorProxy mock_aggregator_proxy //go:generate go generate ./functions From 6842bf5f06e571d4ff6745391f6ad2804a480036 Mon Sep 17 00:00:00 2001 From: Makram Date: Fri, 17 Jan 2025 18:39:01 +0200 Subject: [PATCH 83/91] [CCIP-4868] go.mod: bump chainlink-ccip version (#15968) * go.mod: bump chainlink-ccip version Fix the flakey test TestMigrateFromV1_5ToV1_6. The test was flakey because not enough nodes picked up the ccip message event. This was fixed by adding a ReplayBlocks call after the message got sent. * add time.Sleep to wait for plugins to come up --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- .../ccip/changeset/testhelpers/test_helpers.go | 3 ++- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- .../smoke/ccip/ccip_migration_to_v_1_6_test.go | 15 +++++++++++++-- 12 files changed, 30 insertions(+), 18 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index e312d6df955..ed6d8669033 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -311,7 +311,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 097005e9dc5..2afb5628089 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1160,8 +1160,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= diff --git a/deployment/ccip/changeset/testhelpers/test_helpers.go b/deployment/ccip/changeset/testhelpers/test_helpers.go index fc08dc3c6b3..65b43d3d502 100644 --- a/deployment/ccip/changeset/testhelpers/test_helpers.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers.go @@ -360,7 +360,7 @@ func DoSendRequest( } require.True(t, it.Next()) - t.Logf("CCIP message (id %x) sent from chain selector %d to chain selector %d tx %s seqNum %d nonce %d sender %s", + t.Logf("CCIP message (id %x) sent from chain selector %d to chain selector %d tx %s seqNum %d nonce %d sender %s testRouterEnabled %t", it.Event.Message.Header.MessageId[:], cfg.SourceChain, cfg.DestChain, @@ -368,6 +368,7 @@ func DoSendRequest( it.Event.SequenceNumber, it.Event.Message.Header.Nonce, it.Event.Message.Sender.String(), + cfg.IsTestRouter, ) return it.Event, nil } diff --git a/deployment/go.mod b/deployment/go.mod index c4da3714707..a4fe8728226 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -29,7 +29,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix github.com/smartcontractkit/chain-selectors v1.0.36 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 diff --git a/deployment/go.sum b/deployment/go.sum index 31fa464b3b0..01001431596 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1386,8 +1386,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= diff --git a/go.mod b/go.mod index 6b42f86e66c..3f8bc3d3d86 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 diff --git a/go.sum b/go.sum index 6152134905c..0eb30797097 100644 --- a/go.sum +++ b/go.sum @@ -1152,8 +1152,8 @@ github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3f github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 90360e7f736..dd7c699c93e 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -46,7 +46,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 133585022d5..5b33caacde7 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1410,8 +1410,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index d344cc9a352..3ee4c09b258 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -411,7 +411,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index cf96d2d91aa..5febfce689e 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1397,8 +1397,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103 h1:TeWnxdgSO2cYCKcBMwdkRcs/YdhSvXoWqqw7QWz/KeI= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250110181647-9dba278f2103/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go index a0b62fe8182..d629843596c 100644 --- a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go +++ b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go @@ -3,6 +3,7 @@ package smoke import ( "context" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" @@ -23,7 +24,6 @@ import ( ) func TestMigrateFromV1_5ToV1_6(t *testing.T) { - t.Skipf("CCIP-4868 -This test needs to be investigated for flakiness") // Deploy CCIP 1.5 with 3 chains and 4 nodes + 1 bootstrap // Deploy 1.5 contracts (excluding pools to start, but including MCMS) . e, _, tEnv := testsetups.NewIntegrationEnvironment( @@ -216,6 +216,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { block := latesthdr.Number.Uint64() startBlocks[dest] = &block expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) + expectedSeqNums := make(map[testhelpers.SourceDestPair]uint64) msgSentEvent, err := testhelpers.DoSendRequest( t, e.Env, state, testhelpers.WithSourceChain(src1), @@ -237,8 +238,18 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { SourceChainSelector: src1, DestChainSelector: dest, }] = []uint64{msgSentEvent.SequenceNumber} + expectedSeqNums[testhelpers.SourceDestPair{ + SourceChainSelector: src1, + DestChainSelector: dest, + }] = msgSentEvent.SequenceNumber - // Wait for all exec reports to land + // This sleep is needed so that plugins come up and start indexing logs. + // Otherwise test will flake. + time.Sleep(15 * time.Second) + testhelpers.ReplayLogs(t, e.Env.Offchain, map[uint64]uint64{ + src1: msgSentEvent.Raw.BlockNumber, + }) + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNums, startBlocks) testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) // send a message from real router, the send requested event should be received in 1.5 onRamp From 410b3d01457bd19695c5add448173cf31f8279be Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:03:14 -0800 Subject: [PATCH 84/91] Mix Fixes for tooling (#15962) * remove deployCCIPContracts * deprecate existing add lane * making OCR input more user friendly * rename changesets * fix lint errors * fix * further rename * populate addresses from state for 1.5 * move test related methods to test package * updates * more fix * create new package for test * another move * more fixes * fix lint * fix file path * fix file path * go mod tidy * review comments * handle rmn * deployer key as fee aggregator * more multi contract methods * fix another issue * more fix * proper feed mapping * updates * fixes --- deployment/ccip/changeset/cs_ccip_home.go | 10 +++-- deployment/ccip/changeset/cs_deploy_chain.go | 2 +- deployment/ccip/changeset/state.go | 2 +- .../changeset/testhelpers/test_environment.go | 14 ++++++- deployment/ccip/changeset/token_info.go | 14 ++++++- deployment/multiclient.go | 41 +++++++++++++++++++ integration-tests/smoke/ccip/ccip_rmn_test.go | 2 - 7 files changed, 74 insertions(+), 11 deletions(-) diff --git a/deployment/ccip/changeset/cs_ccip_home.go b/deployment/ccip/changeset/cs_ccip_home.go index ef173e5ed07..ffd353e7d59 100644 --- a/deployment/ccip/changeset/cs_ccip_home.go +++ b/deployment/ccip/changeset/cs_ccip_home.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "math/big" - "os" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -88,7 +87,12 @@ func validateCommitOffchainConfig(c *pluginconfig.CommitOffchainConfig, selector for _, tk := range onchainState.ERC677Tokens { tokenInfos = append(tokenInfos, tk) } - tokenInfos = append(tokenInfos, onchainState.LinkToken) + var linkTokenInfo tokenInfo + linkTokenInfo = onchainState.LinkToken + if onchainState.LinkToken == nil { + linkTokenInfo = onchainState.StaticLinkToken + } + tokenInfos = append(tokenInfos, linkTokenInfo) tokenInfos = append(tokenInfos, onchainState.Weth9) symbol, decimal, err := findTokenInfo(tokenInfos, token) if err != nil { @@ -193,7 +197,7 @@ func WithDefaultCommitOffChainConfig(feedChainSel uint64, tokenInfo map[ccipocr3 PriceFeedChainSelector: ccipocr3.ChainSelector(feedChainSel), NewMsgScanBatchSize: merklemulti.MaxNumberTreeLeaves, MaxReportTransmissionCheckAttempts: 5, - RMNEnabled: os.Getenv("ENABLE_RMN") == "true", // only enabled in manual test + RMNEnabled: false, RMNSignaturesTimeout: 30 * time.Minute, MaxMerkleTreeSize: merklemulti.MaxNumberTreeLeaves, SignObservationPrefix: "chainlink ccip 1.6 rmn observation", diff --git a/deployment/ccip/changeset/cs_deploy_chain.go b/deployment/ccip/changeset/cs_deploy_chain.go index 0cdc2327ca3..28a4702df0b 100644 --- a/deployment/ccip/changeset/cs_deploy_chain.go +++ b/deployment/ccip/changeset/cs_deploy_chain.go @@ -337,7 +337,7 @@ func deployChainContracts( }, onramp.OnRampDynamicConfig{ FeeQuoter: feeQuoterContract.Address(), - FeeAggregator: common.HexToAddress("0x1"), // TODO real fee aggregator + FeeAggregator: chain.DeployerKey.From, // TODO real fee aggregator, using deployer key for now }, []onramp.OnRampDestChainConfigArgs{}, ) diff --git a/deployment/ccip/changeset/state.go b/deployment/ccip/changeset/state.go index b1f44ac4b99..323226c6a4a 100644 --- a/deployment/ccip/changeset/state.go +++ b/deployment/ccip/changeset/state.go @@ -584,7 +584,7 @@ func LoadChainState(chain deployment.Chain, addresses map[string]deployment.Type if err != nil { return state, err } - key, ok := MockDescriptionToTokenSymbol[desc] + key, ok := DescriptionToTokenSymbol[desc] if !ok { return state, fmt.Errorf("unknown feed description %s", desc) } diff --git a/deployment/ccip/changeset/testhelpers/test_environment.go b/deployment/ccip/changeset/testhelpers/test_environment.go index 040dce9f17f..a898c4d98c3 100644 --- a/deployment/ccip/changeset/testhelpers/test_environment.go +++ b/deployment/ccip/changeset/testhelpers/test_environment.go @@ -545,9 +545,19 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn CallProxy: state.Chains[chain].CallProxy, } tokenInfo := tokenConfig.GetTokenInfo(e.Env.Logger, state.Chains[chain].LinkToken, state.Chains[chain].Weth9) - ocrParams := changeset.DeriveCCIPOCRParams(changeset.WithDefaultCommitOffChainConfig(e.FeedChainSel, tokenInfo), + ocrOverride := tc.OCRConfigOverride + if tc.RMNEnabled { + ocrOverride = func(ocrParams *changeset.CCIPOCRParams) { + if tc.OCRConfigOverride != nil { + tc.OCRConfigOverride(ocrParams) + } + ocrParams.CommitOffChainConfig.RMNEnabled = true + } + } + ocrParams := changeset.DeriveCCIPOCRParams( + changeset.WithDefaultCommitOffChainConfig(e.FeedChainSel, tokenInfo), changeset.WithDefaultExecuteOffChainConfig(tokenDataProviders), - changeset.WithOCRParamOverride(tc.OCRConfigOverride), + changeset.WithOCRParamOverride(ocrOverride), ) ocrConfigs[chain] = ocrParams chainConfigs[chain] = changeset.ChainConfig{ diff --git a/deployment/ccip/changeset/token_info.go b/deployment/ccip/changeset/token_info.go index 379119dba92..cecc3070ab8 100644 --- a/deployment/ccip/changeset/token_info.go +++ b/deployment/ccip/changeset/token_info.go @@ -20,11 +20,18 @@ type TokenSymbol string const ( LinkSymbol TokenSymbol = "LINK" WethSymbol TokenSymbol = "WETH" + WAVAXSymbol TokenSymbol = "WAVAX" USDCSymbol TokenSymbol = "USDC" USDCName string = "USD Coin" LinkDecimals = 18 WethDecimals = 18 UsdcDecimals = 6 + + // Price Feed Descriptions + AvaxUSD = "AVAX / USD" + LinkUSD = "LINK / USD" + EthUSD = "ETH / USD" + // MockLinkAggregatorDescription is the description of the MockV3Aggregator.sol contract // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/tests/MockV3Aggregator.sol#L76-L76 MockLinkAggregatorDescription = "v0.8/tests/MockV3Aggregator.sol" @@ -36,10 +43,13 @@ const ( var ( MockLinkPrice = deployment.E18Mult(500) MockWethPrice = big.NewInt(9e8) - // MockDescriptionToTokenSymbol maps a mock feed description to token descriptor - MockDescriptionToTokenSymbol = map[string]TokenSymbol{ + // DescriptionToTokenSymbol maps price feed description to token descriptor + DescriptionToTokenSymbol = map[string]TokenSymbol{ MockLinkAggregatorDescription: LinkSymbol, MockWETHAggregatorDescription: WethSymbol, + LinkUSD: LinkSymbol, + AvaxUSD: WAVAXSymbol, + EthUSD: WethSymbol, } MockSymbolToDescription = map[TokenSymbol]string{ LinkSymbol: MockLinkAggregatorDescription, diff --git a/deployment/multiclient.go b/deployment/multiclient.go index 9765e0368ea..256de787b5e 100644 --- a/deployment/multiclient.go +++ b/deployment/multiclient.go @@ -7,6 +7,7 @@ import ( "time" "github.com/avast/retry-go/v4" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -88,6 +89,26 @@ func (mc *MultiClient) SendTransaction(ctx context.Context, tx *types.Transactio }) } +func (mc *MultiClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { + var result []byte + err := mc.retryWithBackups("CallContract", func(client *ethclient.Client) error { + var err error + result, err = client.CallContract(ctx, msg, blockNumber) + return err + }) + return result, err +} + +func (mc *MultiClient) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) { + var result []byte + err := mc.retryWithBackups("CallContractAtHash", func(client *ethclient.Client) error { + var err error + result, err = client.CallContractAtHash(ctx, msg, blockHash) + return err + }) + return result, err +} + func (mc *MultiClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) { var code []byte err := mc.retryWithBackups("CodeAt", func(client *ethclient.Client) error { @@ -98,6 +119,16 @@ func (mc *MultiClient) CodeAt(ctx context.Context, account common.Address, block return code, err } +func (mc *MultiClient) CodeAtHash(ctx context.Context, account common.Address, blockHash common.Hash) ([]byte, error) { + var code []byte + err := mc.retryWithBackups("CodeAtHash", func(client *ethclient.Client) error { + var err error + code, err = client.CodeAtHash(ctx, account, blockHash) + return err + }) + return code, err +} + func (mc *MultiClient) NonceAt(ctx context.Context, account common.Address, block *big.Int) (uint64, error) { var count uint64 err := mc.retryWithBackups("NonceAt", func(client *ethclient.Client) error { @@ -108,6 +139,16 @@ func (mc *MultiClient) NonceAt(ctx context.Context, account common.Address, bloc return count, err } +func (mc *MultiClient) NonceAtHash(ctx context.Context, account common.Address, blockHash common.Hash) (uint64, error) { + var count uint64 + err := mc.retryWithBackups("NonceAtHash", func(client *ethclient.Client) error { + var err error + count, err = client.NonceAtHash(ctx, account, blockHash) + return err + }) + return count, err +} + func (mc *MultiClient) WaitMined(ctx context.Context, tx *types.Transaction) (*types.Receipt, error) { mc.lggr.Debugf("Waiting for tx %s to be mined for chain %s", tx.Hash().Hex(), mc.chainName) // no retries here because we want to wait for the tx to be mined diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go index d8f5aae0882..65493f9d161 100644 --- a/integration-tests/smoke/ccip/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -4,7 +4,6 @@ import ( "context" "errors" "math/big" - "os" "slices" "strconv" "strings" @@ -239,7 +238,6 @@ const ( ) func runRmnTestCase(t *testing.T, tc rmnTestCase) { - require.NoError(t, os.Setenv("ENABLE_RMN", "true")) require.NoError(t, tc.validate()) ctx := testcontext.Get(t) From 0796288dc37cfc8ba0b35e3b2bc70362d175d0ff Mon Sep 17 00:00:00 2001 From: Makram Date: Fri, 17 Jan 2025 20:25:28 +0200 Subject: [PATCH 85/91] integration-tests/smoke/ccip: add the add chain test (#15903) * deployment/ccip/changeset: add the add chain test * inbound working * outbound from new chain * fix inbound on toDeploy * send msg from new chain to toDeploy * fix lint, build * transfer to mcms and wire to real router * first pass at high level abstraction separate cs apps to setup inbound & outbound * move test to integration-tests * fix * goimports * fixes, fee boosting cfg * fix test * axe duplicate * remove time.Sleep, update docstrings * add onramp equality check --- .github/integration-in-memory-tests.yml | 8 + .../ccip/changeset/cs_chain_contracts.go | 9 +- .../changeset/testhelpers/test_environment.go | 52 +- .../changeset/testhelpers/test_helpers.go | 16 +- deployment/environment_test.go | 8 +- .../smoke/ccip/ccip_add_chain_test.go | 813 ++++++++++++++++++ .../smoke/ccip/ccip_batching_test.go | 2 +- .../smoke/ccip/ccip_fee_boosting_test.go | 2 +- .../smoke/ccip/ccip_fees_test.go | 2 +- .../smoke/ccip/ccip_gas_price_updates_test.go | 2 +- .../ccip/ccip_message_limitations_test.go | 2 +- .../smoke/ccip/ccip_messaging_test.go | 2 +- .../ccip/ccip_migration_to_v_1_6_test.go | 4 +- .../smoke/ccip/ccip_ooo_execution_test.go | 2 +- .../smoke/ccip/ccip_reader_test.go | 2 +- integration-tests/smoke/ccip/ccip_rmn_test.go | 2 +- .../ccip/ccip_token_price_updates_test.go | 2 +- .../smoke/ccip/ccip_token_transfer_test.go | 2 +- .../smoke/ccip/ccip_usdc_test.go | 2 +- 19 files changed, 895 insertions(+), 39 deletions(-) create mode 100644 integration-tests/smoke/ccip/ccip_add_chain_test.go diff --git a/.github/integration-in-memory-tests.yml b/.github/integration-in-memory-tests.yml index 01bb90044f4..a23ec5432ee 100644 --- a/.github/integration-in-memory-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -54,6 +54,14 @@ runner-test-matrix: triggers: - PR Integration CCIP Tests test_cmd: cd integration-tests/smoke/ccip && go test ccip_batching_test.go -timeout 12m -test.parallel=2 -count=1 -json + + - id: smoke/ccip/ccip_add_chain_test.go:* + path: integration-tests/smoke/ccip/ccip_add_chain_test.go + test_env_type: in-memory + runs_on: ubuntu-latest + triggers: + - PR Integration CCIP Tests + test_cmd: cd integration-tests/smoke/ccip && go test ccip_add_chain_test.go -timeout 15m -test.parallel=1 -count=1 -json - id: smoke/ccip/ccip_reader_test.go:* path: integration-tests/smoke/ccip/ccip_reader_test.go diff --git a/deployment/ccip/changeset/cs_chain_contracts.go b/deployment/ccip/changeset/cs_chain_contracts.go index 64e7ca295d7..e52c2f2a603 100644 --- a/deployment/ccip/changeset/cs_chain_contracts.go +++ b/deployment/ccip/changeset/cs_chain_contracts.go @@ -157,9 +157,6 @@ func UpdateNonceManagersChangeset(e deployment.Environment, cfg UpdateNonceManag if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("error updating previous ramps for chain %s: %w", e.Chains[chainSel].String(), err) } - if err != nil { - return deployment.ChangesetOutput{}, fmt.Errorf("error updating previous ramps for chain %s: %w", e.Chains[chainSel].String(), err) - } } if cfg.MCMS == nil { if authTx != nil { @@ -219,6 +216,7 @@ func UpdateNonceManagersChangeset(e deployment.Environment, cfg UpdateNonceManag } type UpdateOnRampDestsConfig struct { + // UpdatesByChain is a mapping of source -> dest -> update. UpdatesByChain map[uint64]map[uint64]OnRampDestinationUpdate // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) @@ -490,6 +488,8 @@ func UpdateFeeQuoterPricesChangeset(e deployment.Environment, cfg UpdateFeeQuote }, }, }) + timelocks[chainSel] = s.Chains[chainSel].Timelock.Address() + proposers[chainSel] = s.Chains[chainSel].ProposerMcm } } if cfg.MCMS == nil { @@ -512,6 +512,7 @@ func UpdateFeeQuoterPricesChangeset(e deployment.Environment, cfg UpdateFeeQuote } type UpdateFeeQuoterDestsConfig struct { + // UpdatesByChain is a mapping from source -> dest -> config update. UpdatesByChain map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) @@ -627,6 +628,8 @@ func UpdateFeeQuoterDestsChangeset(e deployment.Environment, cfg UpdateFeeQuoter } type UpdateOffRampSourcesConfig struct { + // UpdatesByChain is a mapping from dest chain -> source chain -> source chain + // update on the dest chain offramp. UpdatesByChain map[uint64]map[uint64]OffRampSourceUpdate MCMS *MCMSConfig } diff --git a/deployment/ccip/changeset/testhelpers/test_environment.go b/deployment/ccip/changeset/testhelpers/test_environment.go index a898c4d98c3..ca58a067667 100644 --- a/deployment/ccip/changeset/testhelpers/test_environment.go +++ b/deployment/ccip/changeset/testhelpers/test_environment.go @@ -459,7 +459,7 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl }) require.NoError(t, err) tEnv.UpdateDeployedEnvironment(e) - e = AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv) + e = AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv, true, true, false) // now we update RMNProxy to point to RMNRemote e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ { @@ -473,15 +473,17 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl return e } -func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEnvironment) DeployedEnv { +func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEnvironment, deployJobs, deployHomeChain, mcmsEnabled bool) DeployedEnv { tc := tEnv.TestConfigs() e := tEnv.DeployedEnvironment() envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) + // Need to deploy prerequisites first so that we can form the USDC config // no proposals to be made, timelock can be passed as nil here - e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{ - { + var apps []commonchangeset.ChangesetApplication + if deployHomeChain { + apps = append(apps, commonchangeset.ChangesetApplication{ Changeset: commonchangeset.WrapChangeSet(changeset.DeployHomeChainChangeset), Config: changeset.DeployHomeChainConfig{ HomeChainSel: e.HomeChainSel, @@ -492,15 +494,16 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn TestNodeOperator: envNodes.NonBootstraps().PeerIDs(), }, }, - }, - { - Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), - Config: changeset.DeployChainContractsConfig{ - ChainSelectors: allChains, - HomeChainSelector: e.HomeChainSel, - }, + }) + } + apps = append(apps, commonchangeset.ChangesetApplication{ + Changeset: commonchangeset.WrapChangeSet(changeset.DeployChainContractsChangeset), + Config: changeset.DeployChainContractsConfig{ + ChainSelectors: allChains, + HomeChainSelector: e.HomeChainSel, }, }) + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, apps) require.NoError(t, err) state, err := changeset.LoadOnchainState(e.Env) @@ -570,14 +573,25 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn }, } } - // Deploy second set of changesets to deploy and configure the CCIP contracts. - e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, timelockContractsPerChain, []commonchangeset.ChangesetApplication{ + timelockContractsPerChain[e.HomeChainSel] = &proposalutils.TimelockExecutionContracts{ + Timelock: state.Chains[e.HomeChainSel].Timelock, + CallProxy: state.Chains[e.HomeChainSel].CallProxy, + } + // Apply second set of changesets to configure the CCIP contracts. + var mcmsConfig *changeset.MCMSConfig + if mcmsEnabled { + mcmsConfig = &changeset.MCMSConfig{ + MinDelay: 0, + } + } + apps = []commonchangeset.ChangesetApplication{ { // Add the chain configs for the new chains. Changeset: commonchangeset.WrapChangeSet(changeset.UpdateChainConfigChangeset), Config: changeset.UpdateChainConfigConfig{ HomeChainSelector: e.HomeChainSel, RemoteChainAdds: chainConfigs, + MCMS: mcmsConfig, }, }, { @@ -587,6 +601,7 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: e.HomeChainSel, FeedChainSelector: e.FeedChainSel, + MCMS: mcmsConfig, }, PluginInfo: changeset.SetCandidatePluginInfo{ OCRConfigPerRemoteChainSelector: ocrConfigs, @@ -601,6 +616,7 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn SetCandidateConfigBase: changeset.SetCandidateConfigBase{ HomeChainSelector: e.HomeChainSel, FeedChainSelector: e.FeedChainSel, + MCMS: mcmsConfig, }, PluginInfo: []changeset.SetCandidatePluginInfo{ { @@ -625,6 +641,7 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn RemoteChainSelectors: allChains, }, }, + MCMS: mcmsConfig, }, }, { @@ -635,10 +652,13 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn RemoteChainSels: allChains, }, }, - { + } + if deployJobs { + apps = append(apps, commonchangeset.ChangesetApplication{ Changeset: commonchangeset.WrapChangeSet(changeset.CCIPCapabilityJobspecChangeset), - }, - }) + }) + } + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, timelockContractsPerChain, apps) require.NoError(t, err) ReplayLogs(t, e.Env.Offchain, e.ReplayBlocks) diff --git a/deployment/ccip/changeset/testhelpers/test_helpers.go b/deployment/ccip/changeset/testhelpers/test_helpers.go index 65b43d3d502..dcfba1fad9e 100644 --- a/deployment/ccip/changeset/testhelpers/test_helpers.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers.go @@ -398,7 +398,15 @@ func MakeEVMExtraArgsV2(gasLimit uint64, allowOOO bool) []byte { return extraArgs } -func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, gasprice map[uint64]*big.Int, tokenPrices map[common.Address]*big.Int, fqCfg fee_quoter.FeeQuoterDestChainConfig) { +func AddLane( + t *testing.T, + e *DeployedEnv, + from, to uint64, + isTestRouter bool, + gasprice map[uint64]*big.Int, + tokenPrices map[common.Address]*big.Int, + fqCfg fee_quoter.FeeQuoterDestChainConfig, +) { var err error e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{ { @@ -475,7 +483,11 @@ func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, g func AddLaneWithDefaultPricesAndFeeQuoterConfig(t *testing.T, e *DeployedEnv, state changeset.CCIPOnChainState, from, to uint64, isTestRouter bool) { stateChainFrom := state.Chains[from] - AddLane(t, e, from, to, isTestRouter, + AddLane( + t, + e, + from, to, + isTestRouter, map[uint64]*big.Int{ to: DefaultGasPrice, }, map[common.Address]*big.Int{ diff --git a/deployment/environment_test.go b/deployment/environment_test.go index 37a7e3baeae..5ebbe0be1ce 100644 --- a/deployment/environment_test.go +++ b/deployment/environment_test.go @@ -9,16 +9,16 @@ import ( func TestNode_OCRConfigForChainSelector(t *testing.T) { var m = map[chain_selectors.ChainDetails]OCRConfig{ - chain_selectors.ChainDetails{ + { ChainSelector: chain_selectors.APTOS_TESTNET.Selector, ChainName: chain_selectors.APTOS_TESTNET.Name, - }: OCRConfig{ + }: { KeyBundleID: "aptos bundle 1", }, - chain_selectors.ChainDetails{ + { ChainSelector: chain_selectors.ETHEREUM_MAINNET_ARBITRUM_1.Selector, ChainName: chain_selectors.ETHEREUM_MAINNET_ARBITRUM_1.Name, - }: OCRConfig{ + }: { KeyBundleID: "arb bundle 1", }, } diff --git a/integration-tests/smoke/ccip/ccip_add_chain_test.go b/integration-tests/smoke/ccip/ccip_add_chain_test.go new file mode 100644 index 00000000000..3e7a8887e46 --- /dev/null +++ b/integration-tests/smoke/ccip/ccip_add_chain_test.go @@ -0,0 +1,813 @@ +package ccip + +import ( + "math/big" + "slices" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + ccipcs "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + + "github.com/stretchr/testify/require" + "golang.org/x/exp/maps" +) + +func Test_AddChain(t *testing.T) { + const ( + numChains = 4 + usersPerChain = 2 + ) + + // Set up an env with 4 chains but initially + // only deploy and configure 3 of them. + e, tEnv := testhelpers.NewMemoryEnvironment( + t, + testhelpers.WithNumOfChains(numChains), + testhelpers.WithNumOfNodes(4), + testhelpers.WithPrerequisiteDeploymentOnly(nil), + testhelpers.WithNumOfUsersPerChain(usersPerChain), + testhelpers.WithNoJobsAndContracts(), + testhelpers.WithOCRConfigOverride(func(params *ccipcs.CCIPOCRParams) { + // Only 1 boost (=OCR round) is enough to cover the fee + params.ExecuteOffChainConfig.RelativeBoostPerWaitHour = 10 + }), + ) + + allChains := maps.Keys(e.Env.Chains) + slices.Sort(allChains) + toDeploy := e.Env.AllChainSelectorsExcluding([]uint64{allChains[0]}) + require.Len(t, toDeploy, numChains-1) + remainingChain := allChains[0] + t.Log("initially deploying chains:", toDeploy, "and afterwards adding chain", remainingChain) + + ///////////////////////////////////// + // START Setup initial chains + ///////////////////////////////////// + e = setupChain( + t, + e, + tEnv, + toDeploy, + true, // deployJobs + true, // deployHomeChain + false, // mcmsEnabled + ) + + state, err := ccipcs.LoadOnchainState(e.Env) + require.NoError(t, err) + + // check RMNRemote is up and RMNProxy is correctly wired. + assertRMNRemoteAndProxyState(t, toDeploy, state) + + // Setup densely connected lanes between all chains. + for _, source := range toDeploy { + for _, dest := range toDeploy { + if source == dest { + continue + } + testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig( + t, + &e, + state, + source, + dest, + false, // isTestRouter + ) + } + } + + // Transfer ownership of all contracts to the MCMS and renounce the timelock deployer. + transferToMCMSAndRenounceTimelockDeployer( + t, + e, + toDeploy, + state, + false, // onlyChainContracts + ) + + // At this stage we can send some requests and confirm the setup is working. + sendMsgs := func( + sources []uint64, + dests []uint64, + testRouter bool, + ) (gasPricePreUpdate map[testhelpers.SourceDestPair]*big.Int, startBlocks map[uint64]*uint64) { + startBlocks = make(map[uint64]*uint64) + gasPricePreUpdate = make(map[testhelpers.SourceDestPair]*big.Int) + var ( + expectedSeqNum = make(map[testhelpers.SourceDestPair]uint64) + expectedSeqNumExec = make(map[testhelpers.SourceDestPair][]uint64) + ) + for _, source := range sources { + for _, dest := range dests { + if source == dest { + continue + } + + gp, err := state.Chains[source].FeeQuoter.GetDestinationChainGasPrice(&bind.CallOpts{ + Context: tests.Context(t), + }, dest) + require.NoError(t, err) + gasPricePreUpdate[testhelpers.SourceDestPair{ + SourceChainSelector: source, + DestChainSelector: dest, + }] = gp.Value + + latesthdr, err := e.Env.Chains[dest].Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + block := latesthdr.Number.Uint64() + msgSentEvent := testhelpers.TestSendRequest(t, e.Env, state, source, dest, testRouter, router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello world"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }) + + startBlocks[dest] = &block + expectedSeqNum[testhelpers.SourceDestPair{ + SourceChainSelector: source, + DestChainSelector: dest, + }] = msgSentEvent.SequenceNumber + expectedSeqNumExec[testhelpers.SourceDestPair{ + SourceChainSelector: source, + DestChainSelector: dest, + }] = append(expectedSeqNumExec[testhelpers.SourceDestPair{ + SourceChainSelector: source, + DestChainSelector: dest, + }], msgSentEvent.SequenceNumber) + } + } + + // Confirm execution of the message + testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNum, startBlocks) + testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) + return gasPricePreUpdate, startBlocks + } + + sendMsgs(toDeploy, toDeploy, false) + + ///////////////////////////////////// + // END Setup initial chains + ///////////////////////////////////// + + // TODO: Not working. Need to fix/figure out why. + // gasPricePreUpdate, startBlocks := sendMsgs(toDeploy) + // for sourceDestPair, preUpdateGp := range gasPricePreUpdate { + // // check that each chain's fee quoter has updated its gas price + // // for all dests. + // err := ConfirmGasPriceUpdated( + // t, + // e.Env.Chains[sourceDestPair.DestChainSelector], + // state.Chains[sourceDestPair.SourceChainSelector].FeeQuoter, + // *startBlocks[sourceDestPair.DestChainSelector], + // preUpdateGp, + // ) + // require.NoError(t, err) + // } + + ///////////////////////////////////// + // START Deploy to the remaining chain. + ///////////////////////////////////// + + // MCMS needs to be enabled because the home chain contracts have been + // transferred to MCMS. + e = setupChain( + t, + e, + tEnv, + []uint64{remainingChain}, + false, // deployJobs + false, // deployHomeChain + true, // mcmsEnabled + ) + + state, err = ccipcs.LoadOnchainState(e.Env) + require.NoError(t, err) + + assertRMNRemoteAndProxyState(t, []uint64{remainingChain}, state) + + // TODO: wait for gas price of new chain to be updated on all other chains. + + ///////////////////////////////////// + // END Deploy to the remaining chain. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up toDeploy -> remainingChain outbound. + ///////////////////////////////////// + e = setupOutboundWiring( + t, + e, + toDeploy, + []uint64{remainingChain}, + true, // testRouterEnabled + true, // mcmsEnabled + ) + + state, err = ccipcs.LoadOnchainState(e.Env) + require.NoError(t, err) + + assertChainWiringOutbound( + t, + state, + remainingChain, + toDeploy, + true, // testRouterEnabled + ) + + // At this point we can send messages from the test router to the new chain. + // These won't be processed yet because the offRamp is not aware of these new sources. + + ///////////////////////////////////// + // END Wire up toDeploy -> remainingChain outbound. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up toDeploy -> remainingChain inbound on remainingChain. + ///////////////////////////////////// + + // UpdateOffRampSourcesConfig called on the new chain to enable existing sources. Also with the test router. + // UpdateRouterRampsConfig to enable the existing sources on the new test router. + // This means we can send messages from toDeploy to remainingChain. + // NOTE: not using MCMS since haven't transferred to timelock yet. + e = setupInboundWiring(t, e, toDeploy, []uint64{remainingChain}, true, false) + + assertChainWiringInbound( + t, + state, + remainingChain, + toDeploy, + true, // testRouterEnabled + ) + + // Send messages from toDeploy to the newly added chain thru the test router. + sendMsgs(toDeploy, []uint64{remainingChain}, true) + + ///////////////////////////////////// + // END Wire up toDeploy -> remainingChain inbound on remainingChain. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up remainingChain -> toDeploy outbound. + ///////////////////////////////////// + + // Now we switch to testing outbound from the new chain. + // This amounts to enabling a new lane on the existing OCR instances + // (assuming by default we want to enable all chains). + e = setupOutboundWiring( + t, + e, + []uint64{remainingChain}, + toDeploy, + true, // testRouterEnabled + false, // mcmsEnabled + ) + + // sanity check that everything is correctly set up. + for _, chain := range toDeploy { + assertChainWiringOutbound(t, state, chain, []uint64{remainingChain}, true) + } + + ///////////////////////////////////// + // END Wire up remainingChain -> toDeploy outbound. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up remainingChain -> toDeploy inbound on toDeploy. + ///////////////////////////////////// + + e = setupInboundWiring(t, e, []uint64{remainingChain}, toDeploy, true, true) + + for _, chain := range toDeploy { + assertChainWiringInbound(t, state, chain, []uint64{remainingChain}, true) + } + + ///////////////////////////////////// + // END Wire up remainingChain -> toDeploy inbound on toDeploy. + ///////////////////////////////////// + + ///////////////////////////////////// + // START send messages from remainingChain to toDeploy. + ///////////////////////////////////// + + // Send messages from remainingChain to toDeploy thru the test router. + sendMsgs([]uint64{remainingChain}, toDeploy, true) + + ///////////////////////////////////// + // END send messages from remainingChain to toDeploy. + ///////////////////////////////////// + + // Transfer the new chain contracts to the timelock ownership. + transferToMCMSAndRenounceTimelockDeployer( + t, + e, + []uint64{remainingChain}, + state, + true, // onlyChainContracts + ) + + // Once verified with the test routers, the last step is to whitelist the new chain on the real routers everywhere with + // UpdateRouterRamps, UpdateOffRampSources and UpdateOnRampDests with TestRouter=False. + // This is basically the same as the wiring done above, just setting testRouterEnabled=false. + + ///////////////////////////////////// + // START Wire up toDeploy -> remainingChain outbound through real router. + ///////////////////////////////////// + e = setupOutboundWiring( + t, + e, + toDeploy, + []uint64{remainingChain}, + false, // testRouterEnabled + true, // mcmsEnabled + ) + + state, err = ccipcs.LoadOnchainState(e.Env) + require.NoError(t, err) + + assertChainWiringOutbound( + t, + state, + remainingChain, + toDeploy, + false, // testRouterEnabled + ) + ///////////////////////////////////// + // END Wire up toDeploy -> remainingChain outbound through real router. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up toDeploy -> remainingChain inbound on remainingChain through real router. + ///////////////////////////////////// + + e = setupInboundWiring( + t, + e, + toDeploy, + []uint64{remainingChain}, + false, // testRouterEnabled + true, // mcmsEnabled + ) + + assertChainWiringInbound( + t, + state, + remainingChain, + toDeploy, + false, // testRouterEnabled + ) + + ///////////////////////////////////// + // END Wire up toDeploy -> remainingChain inbound on remainingChain through real router. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up remainingChain -> toDeploy outbound through real router. + ///////////////////////////////////// + + e = setupOutboundWiring( + t, + e, + []uint64{remainingChain}, + toDeploy, + false, // testRouterEnabled + true, // mcmsEnabled + ) + + // sanity check that everything is correctly set up. + for _, chain := range toDeploy { + assertChainWiringOutbound( + t, + state, + chain, + []uint64{remainingChain}, + false, // testRouterEnabled + ) + } + + ///////////////////////////////////// + // END Wire up remainingChain -> toDeploy outbound through real router. + ///////////////////////////////////// + + ///////////////////////////////////// + // START Wire up remainingChain -> toDeploy inbound on toDeploy through real router. + ///////////////////////////////////// + + e = setupInboundWiring( + t, + e, + []uint64{remainingChain}, + toDeploy, + false, // testRouterEnabled + true, // mcmsEnabled + ) + + for _, chain := range toDeploy { + assertChainWiringInbound( + t, + state, + chain, + []uint64{remainingChain}, + false, // testRouterEnabled + ) + } + + ///////////////////////////////////// + // END Wire up remainingChain -> toDeploy inbound on toDeploy. + ///////////////////////////////////// + + // Send messages from toDeploy to the newly added chain thru the real router. + sendMsgs(toDeploy, []uint64{remainingChain}, false) +} + +// setupInboundWiring sets up the newChain to be able to receive ccip messages from the provided sources. +// This only touches the newChain and does not touch the sources. +func setupInboundWiring( + t *testing.T, + e testhelpers.DeployedEnv, + sources []uint64, + newChains []uint64, + testRouterEnabled, + mcmsEnabled bool, +) testhelpers.DeployedEnv { + var mcmsConfig *ccipcs.MCMSConfig + if mcmsEnabled { + mcmsConfig = &ccipcs.MCMSConfig{ + MinDelay: 0, + } + } + + var err error + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.UpdateOffRampSourcesChangeset), + Config: ccipcs.UpdateOffRampSourcesConfig{ + UpdatesByChain: offRampSourceUpdates(t, newChains, sources, testRouterEnabled), + MCMS: mcmsConfig, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.UpdateRouterRampsChangeset), + Config: ccipcs.UpdateRouterRampsConfig{ + TestRouter: testRouterEnabled, + UpdatesByChain: routerOffRampUpdates(t, newChains, sources), + MCMS: mcmsConfig, + }, + }, + }) + require.NoError(t, err) + + return e +} + +// setupOutboundWiring sets up the given sources to be able to request ccip messages to the newChain. +// This only touches the sources and does not touch newChain. +// Therefore any requests to newChain will not be processed until the inbound wiring is set up. +func setupOutboundWiring( + t *testing.T, + e testhelpers.DeployedEnv, + sources []uint64, + newChains []uint64, + testRouterEnabled, + mcmsEnabled bool, +) testhelpers.DeployedEnv { + var mcmsConfig *ccipcs.MCMSConfig + if mcmsEnabled { + mcmsConfig = &ccipcs.MCMSConfig{ + MinDelay: 0, + } + } + + var err error + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.UpdateOnRampsDestsChangeset), + Config: ccipcs.UpdateOnRampDestsConfig{ + UpdatesByChain: onRampDestUpdates(t, newChains, sources, testRouterEnabled), + MCMS: mcmsConfig, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.UpdateFeeQuoterPricesChangeset), + Config: ccipcs.UpdateFeeQuoterPricesConfig{ + PricesByChain: feeQuoterPricesByChain(t, newChains, sources), + MCMS: mcmsConfig, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.UpdateFeeQuoterDestsChangeset), + Config: ccipcs.UpdateFeeQuoterDestsConfig{ + UpdatesByChain: feeQuoterDestUpdates(t, newChains, sources), + MCMS: mcmsConfig, + }, + }, + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.UpdateRouterRampsChangeset), + Config: ccipcs.UpdateRouterRampsConfig{ + TestRouter: testRouterEnabled, + UpdatesByChain: routerOnRampUpdates(t, newChains, sources), + MCMS: mcmsConfig, + }, + }, + }) + require.NoError(t, err) + + return e +} + +// setupChain will deploy the ccip chain contracts to the provided chains. +// Based on the flags provided, it will also deploy the jobs and home chain contracts. +// mcmsEnabled should be set to true if the home chain contracts have been transferred to MCMS. +func setupChain(t *testing.T, e testhelpers.DeployedEnv, tEnv testhelpers.TestEnvironment, chains []uint64, deployJobs, deployHomeChain, mcmsEnabled bool) testhelpers.DeployedEnv { + e = testhelpers.AddCCIPContractsToEnvironment( + t, + chains, + tEnv, + deployJobs, + deployHomeChain, + mcmsEnabled, + ) + + // Need to update what the RMNProxy is pointing to, otherwise plugin will not work. + var err error + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(ccipcs.SetRMNRemoteOnRMNProxyChangeset), + Config: ccipcs.SetRMNRemoteOnRMNProxyConfig{ + ChainSelectors: chains, + }, + }, + }) + require.NoError(t, err) + + return e +} + +// assertChainWiringInbound checks that the newChain has the existingChains enabled as sources. +// It only checks the inbound wiring on the newChain. +// It doesn't check that the existingChains have the newChain enabled as a dest. +func assertChainWiringInbound( + t *testing.T, + state ccipcs.CCIPOnChainState, + newChain uint64, + existingChains []uint64, + testRouterEnabled bool, +) { + for _, existingChain := range existingChains { + var rtr *router.Router + if testRouterEnabled { + rtr = state.Chains[newChain].TestRouter + } else { + rtr = state.Chains[newChain].Router + } + + // check that the offRamp has the existing chain enabled as a source. + // in addition, check that the onRamp set in the source chain config + // matches the address of the onRamp on the existing chain. + dcc, err := state.Chains[newChain].OffRamp.GetSourceChainConfig(&bind.CallOpts{ + Context: tests.Context(t), + }, existingChain) + require.NoError(t, err) + require.Equal(t, rtr.Address(), dcc.Router) + require.Equal(t, dcc.OnRamp, common.LeftPadBytes(state.Chains[existingChain].OnRamp.Address().Bytes(), 32)) + + // check that the router has the existing chain enabled as a source. + routerOffRamps, err := rtr.GetOffRamps(&bind.CallOpts{ + Context: tests.Context(t), + }) + require.NoError(t, err) + + var found bool + for _, offRamp := range routerOffRamps { + if offRamp.SourceChainSelector == existingChain { + require.Equal(t, state.Chains[newChain].OffRamp.Address(), offRamp.OffRamp) + found = true + break + } + } + require.True(t, found) + } +} + +// assertChainWiringOutbound checks that newChain can be requested from existingChains. +// This only checks the outbound wiring on existingChains. +// It doesn't check that the newChain can process the requests. +func assertChainWiringOutbound( + t *testing.T, + state ccipcs.CCIPOnChainState, + newChain uint64, + existingChains []uint64, + testRouterEnabled bool, +) { + for _, existingChain := range existingChains { + var rtr *router.Router + if testRouterEnabled { + rtr = state.Chains[existingChain].TestRouter + } else { + rtr = state.Chains[existingChain].Router + } + + // check that the onRamp has the new chain enabled as a dest. + dcc, err := state.Chains[existingChain].OnRamp.GetDestChainConfig(&bind.CallOpts{ + Context: tests.Context(t), + }, newChain) + require.NoError(t, err) + require.Equal(t, rtr.Address(), dcc.Router) + + // check that the feeQuoter has the new chain enabled as a dest. + fqdcc, err := state.Chains[existingChain].FeeQuoter.GetDestChainConfig(&bind.CallOpts{ + Context: tests.Context(t), + }, newChain) + require.NoError(t, err) + require.True(t, fqdcc.IsEnabled) + + // check that the router has the new chain enabled as a dest. + routerOnRamp, err := rtr.GetOnRamp(&bind.CallOpts{ + Context: tests.Context(t), + }, newChain) + require.NoError(t, err) + require.Equal(t, state.Chains[existingChain].OnRamp.Address(), routerOnRamp) + } +} + +// routerOffRampUpdates adds the provided sources to the router of the provided dest chain. +func routerOffRampUpdates(t *testing.T, dests []uint64, sources []uint64) (updates map[uint64]ccipcs.RouterUpdates) { + updates = make(map[uint64]ccipcs.RouterUpdates) + for _, source := range sources { + for _, dest := range dests { + require.NotEqual(t, source, dest) + if _, ok := updates[dest]; !ok { + updates[dest] = ccipcs.RouterUpdates{ + OffRampUpdates: map[uint64]bool{ + source: true, + }, + } + } else { + updates[dest].OffRampUpdates[source] = true + } + } + } + return +} + +// routerOnRampUpdates sets each dest selector in the given dest chains slice on the router +// to point to the local onramp on each source chain. +func routerOnRampUpdates(t *testing.T, dests []uint64, sources []uint64) (updates map[uint64]ccipcs.RouterUpdates) { + updates = make(map[uint64]ccipcs.RouterUpdates) + for _, source := range sources { + for _, dest := range dests { + require.NotEqual(t, source, dest) + if _, ok := updates[source]; !ok { + updates[source] = ccipcs.RouterUpdates{ + OnRampUpdates: map[uint64]bool{ + dest: true, + }, + } + } else { + updates[source].OnRampUpdates[dest] = true + } + } + } + return +} + +// feeQuoterDestUpdates adds a fee quoter configuration for the provided dest chains on the fee quoters on the provided sources. +func feeQuoterDestUpdates(t *testing.T, dests []uint64, sources []uint64) (updates map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig) { + updates = make(map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig) + for _, source := range sources { + for _, dest := range dests { + require.NotEqual(t, source, dest) + if _, ok := updates[source]; !ok { + updates[source] = make(map[uint64]fee_quoter.FeeQuoterDestChainConfig) + } + updates[source][dest] = ccipcs.DefaultFeeQuoterDestChainConfig() + } + } + return +} + +// feeQuoterPricesByChain sets the gas price for the provided dests on the fee quoters in the provided sources. +func feeQuoterPricesByChain(t *testing.T, dests []uint64, sources []uint64) (prices map[uint64]ccipcs.FeeQuoterPriceUpdatePerSource) { + prices = make(map[uint64]ccipcs.FeeQuoterPriceUpdatePerSource) + for _, source := range sources { + prices[source] = ccipcs.FeeQuoterPriceUpdatePerSource{ + GasPrices: make(map[uint64]*big.Int), + } + for _, dest := range dests { + require.NotEqual(t, source, dest) + prices[source].GasPrices[dest] = testhelpers.DefaultGasPrice + } + } + return +} + +// onRampDestUpdates adds the provided dests as destination chains to the onRamps on the provided sources. +func onRampDestUpdates(t *testing.T, dests []uint64, sources []uint64, testRouterEnabled bool) (updates map[uint64]map[uint64]ccipcs.OnRampDestinationUpdate) { + updates = make(map[uint64]map[uint64]ccipcs.OnRampDestinationUpdate) + for _, source := range sources { + for _, dest := range dests { + require.NotEqual(t, source, dest) + if _, ok := updates[source]; !ok { + updates[source] = map[uint64]ccipcs.OnRampDestinationUpdate{ + dest: { + IsEnabled: true, + TestRouter: testRouterEnabled, + }, + } + } else { + updates[source][dest] = ccipcs.OnRampDestinationUpdate{ + IsEnabled: true, + TestRouter: testRouterEnabled, + } + } + } + } + return +} + +// offRampSourceUpdates adds the provided sources to the offRamp on the provided dest chains. +func offRampSourceUpdates(t *testing.T, dests []uint64, sources []uint64, testRouterEnabled bool) (updates map[uint64]map[uint64]ccipcs.OffRampSourceUpdate) { + updates = make(map[uint64]map[uint64]ccipcs.OffRampSourceUpdate) + for _, source := range sources { + for _, dest := range dests { + require.NotEqual(t, source, dest) + if _, ok := updates[dest]; !ok { + updates[dest] = make(map[uint64]ccipcs.OffRampSourceUpdate) + } + updates[dest][source] = ccipcs.OffRampSourceUpdate{ + IsEnabled: true, + TestRouter: testRouterEnabled, + } + } + } + return +} + +func assertRMNRemoteAndProxyState(t *testing.T, chains []uint64, state ccipcs.CCIPOnChainState) { + for _, chain := range chains { + require.NotEqual(t, common.Address{}, state.Chains[chain].RMNRemote.Address()) + _, err := state.Chains[chain].RMNRemote.GetCursedSubjects(&bind.CallOpts{ + Context: tests.Context(t), + }) + require.NoError(t, err) + + // check which address RMNProxy is pointing to + rmnAddress, err := state.Chains[chain].RMNProxy.GetARM(&bind.CallOpts{ + Context: tests.Context(t), + }) + require.NoError(t, err) + require.Equal(t, state.Chains[chain].RMNRemote.Address(), rmnAddress) + + t.Log("RMNRemote address for chain", chain, "is:", state.Chains[chain].RMNRemote.Address().Hex()) + t.Log("RMNProxy address for chain", chain, "is:", state.Chains[chain].RMNProxy.Address().Hex()) + } +} + +func transferToMCMSAndRenounceTimelockDeployer( + t *testing.T, + e testhelpers.DeployedEnv, + chains []uint64, + state ccipcs.CCIPOnChainState, + onlyChainContracts bool, +) { + apps := make([]commonchangeset.ChangesetApplication, 0, len(chains)+1) + cfg := testhelpers.GenTestTransferOwnershipConfig(e, chains, state) + if onlyChainContracts { + // filter out the home chain contracts from e.HomeChainSel + var homeChainContracts = map[common.Address]struct{}{ + state.Chains[e.HomeChainSel].CapabilityRegistry.Address(): {}, + state.Chains[e.HomeChainSel].CCIPHome.Address(): {}, + state.Chains[e.HomeChainSel].RMNHome.Address(): {}, + } + var chainContracts []common.Address + for _, contract := range cfg.ContractsByChain[e.HomeChainSel] { + if _, ok := homeChainContracts[contract]; !ok { + chainContracts = append(chainContracts, contract) + } + } + cfg.ContractsByChain[e.HomeChainSel] = chainContracts + } + apps = append(apps, commonchangeset.ChangesetApplication{ + Changeset: commonchangeset.WrapChangeSet(commonchangeset.TransferToMCMSWithTimelock), + Config: cfg, + }) + for _, chain := range chains { + apps = append(apps, commonchangeset.ChangesetApplication{ + Changeset: commonchangeset.WrapChangeSet(commonchangeset.RenounceTimelockDeployer), + Config: commonchangeset.RenounceTimelockDeployerConfig{ + ChainSel: chain, + }, + }) + } + var err error + e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), apps) + require.NoError(t, err) +} diff --git a/integration-tests/smoke/ccip/ccip_batching_test.go b/integration-tests/smoke/ccip/ccip_batching_test.go index 38b068dad92..7b5a9092cf1 100644 --- a/integration-tests/smoke/ccip/ccip_batching_test.go +++ b/integration-tests/smoke/ccip/ccip_batching_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" diff --git a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go index d1800174a25..61cd7830c85 100644 --- a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go +++ b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" diff --git a/integration-tests/smoke/ccip/ccip_fees_test.go b/integration-tests/smoke/ccip/ccip_fees_test.go index 7c329179e55..f5b74791bfa 100644 --- a/integration-tests/smoke/ccip/ccip_fees_test.go +++ b/integration-tests/smoke/ccip/ccip_fees_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "math/big" diff --git a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go index 0035be6f71c..42fcacc58f3 100644 --- a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go +++ b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "math/big" diff --git a/integration-tests/smoke/ccip/ccip_message_limitations_test.go b/integration-tests/smoke/ccip/ccip_message_limitations_test.go index 01be93a01a1..ea775e5445d 100644 --- a/integration-tests/smoke/ccip/ccip_message_limitations_test.go +++ b/integration-tests/smoke/ccip/ccip_message_limitations_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "math/big" diff --git a/integration-tests/smoke/ccip/ccip_messaging_test.go b/integration-tests/smoke/ccip/ccip_messaging_test.go index 3e28c7851ca..fc154b848be 100644 --- a/integration-tests/smoke/ccip/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip/ccip_messaging_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" diff --git a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go index d629843596c..d70a6e8a3fa 100644 --- a/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go +++ b/integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" @@ -151,7 +151,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) { // add 1.6 contracts to the environment and send 1.6 jobs // First we need to deploy Homechain contracts and restart the nodes with updated cap registry // in this test we have already deployed home chain contracts and the nodes are already running with the deployed cap registry. - e = testhelpers.AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv) + e = testhelpers.AddCCIPContractsToEnvironment(t, e.Env.AllChainSelectors(), tEnv, true, true, false) // Set RMNProxy to point to RMNRemote. // nonce manager should point to 1.5 ramps e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commonchangeset.ChangesetApplication{ diff --git a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go index 004dd3989f8..6a68ecd9e30 100644 --- a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go +++ b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "fmt" diff --git a/integration-tests/smoke/ccip/ccip_reader_test.go b/integration-tests/smoke/ccip/ccip_reader_test.go index f907c06f58f..beb7b00b85b 100644 --- a/integration-tests/smoke/ccip/ccip_reader_test.go +++ b/integration-tests/smoke/ccip/ccip_reader_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go index 65493f9d161..9a33abc844d 100644 --- a/integration-tests/smoke/ccip/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" diff --git a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go index 4c15eecc545..8498417a6b6 100644 --- a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go +++ b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "context" diff --git a/integration-tests/smoke/ccip/ccip_token_transfer_test.go b/integration-tests/smoke/ccip/ccip_token_transfer_test.go index ef9a4bea8b8..f612cba523f 100644 --- a/integration-tests/smoke/ccip/ccip_token_transfer_test.go +++ b/integration-tests/smoke/ccip/ccip_token_transfer_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "math/big" diff --git a/integration-tests/smoke/ccip/ccip_usdc_test.go b/integration-tests/smoke/ccip/ccip_usdc_test.go index b64f8056c13..acbca534b8f 100644 --- a/integration-tests/smoke/ccip/ccip_usdc_test.go +++ b/integration-tests/smoke/ccip/ccip_usdc_test.go @@ -1,4 +1,4 @@ -package smoke +package ccip import ( "math/big" From 436b68410b4e93030e99eaf73c7af9ad1c3b702a Mon Sep 17 00:00:00 2001 From: Dimitris Grigoriou Date: Fri, 17 Jan 2025 20:42:40 +0200 Subject: [PATCH 86/91] Txmv2 (#15467) * TXMv2 alpha version * TXM fixes * Fix * Update orchestrator * Add builder * Add txmv2 tests * Update retry logic * Add backoff mechanism * Add multi address support * Add backoff mechanism for broadcasting and backfilling * Minor fix * Add check to dummy keystore * Fix inmemory store logging per address * Remove unnecessary const * Fix txm to work with enabled addresses from keystore * AttemptBuilder fixes * Add AttemptBuilder close * Minor updates * Make purgable attempts empty * Fix Idempotency in Store Manager * Update trigger * Fix lint * Fix more lint * Fix lint * Fix lint * More lint fixes * Fix lint * Fix lint final * Fix races * Update logs * Fix lint * Start documentation * Update DummyKeystore Add method * Txmv2 stuck tx detection (#15436) * Stuck tx detector alpha * Update stuck tx detection * Add stuck_tx_detection and dual broadcast client * Add support for TXMv2 * Fix orchestrator's monitoring call * Fix AttemptBuilder * Enable DualBroadcast client * Switch DualBroadcast params to pointers * Add context to client * Fix lint * Fix DualBroadcast client * More lint fixes * Fix lint * Make nonce nullable * Update configs * Add prom metrics * Add transaction confirmation metric * Improve logs * Address feedback * Update tests * Fix orchestrator log * Fix Nonce log * Improvements * Update tests * Add fixes * Improvements * Improve logs * Move initialization of nonce * Add Beholder metrics * Improve InMemoryStorage * Support different priceMax per key * Upgrades * Fix config tests * Fix docs * Fix config test lint * Update configs * Reuse transaction states * Fix docs * Deprecate DualBroadcastDetection * Add health report * Fix configs * Bump mockery * Update testfiles * Update docs * Address feedback * Add backfill tests * Update docs --- .mockery.yaml | 6 + .../evm/config/chain_scoped_transactions.go | 25 + core/chains/evm/config/config.go | 8 + core/chains/evm/config/toml/config.go | 61 +- .../evm/config/toml/defaults/fallback.toml | 3 + core/chains/evm/keystore/eth.go | 1 + core/chains/evm/keystore/mocks/eth.go | 60 ++ core/chains/evm/txm/attempt_builder.go | 161 +++++ core/chains/evm/txm/attempt_builder_test.go | 97 +++ .../evm/txm/clientwrappers/chain_client.go | 31 + .../clientwrappers/dual_broadcast_client.go | 128 ++++ .../evm/txm/clientwrappers/geth_client.go | 51 ++ .../evm/txm/docs/TRANSACTION_MANAGER_V2.md | 14 + core/chains/evm/txm/dummy_keystore.go | 64 ++ core/chains/evm/txm/metrics.go | 93 +++ core/chains/evm/txm/mocks/attempt_builder.go | 161 +++++ core/chains/evm/txm/mocks/client.go | 204 ++++++ core/chains/evm/txm/mocks/keystore.go | 98 +++ core/chains/evm/txm/mocks/tx_store.go | 647 ++++++++++++++++++ core/chains/evm/txm/orchestrator.go | 363 ++++++++++ core/chains/evm/txm/storage/inmemory_store.go | 358 ++++++++++ .../evm/txm/storage/inmemory_store_manager.go | 136 ++++ .../storage/inmemory_store_manager_test.go | 36 + .../evm/txm/storage/inmemory_store_test.go | 559 +++++++++++++++ core/chains/evm/txm/stuck_tx_detector.go | 123 ++++ core/chains/evm/txm/stuck_tx_detector_test.go | 80 +++ core/chains/evm/txm/txm.go | 447 ++++++++++++ core/chains/evm/txm/txm_test.go | 327 +++++++++ core/chains/evm/txm/types/transaction.go | 192 ++++++ core/chains/evm/txmgr/builder.go | 53 ++ core/chains/legacyevm/evm_txm.go | 43 +- core/config/docs/chains-evm.toml | 10 + core/config/docs/docs_test.go | 5 + core/services/chainlink/config_test.go | 15 + .../chainlink/testdata/config-full.toml | 3 + .../chainlink/testdata/config-invalid.toml | 6 + .../config-multi-chain-effective.toml | 9 + core/web/resolver/testdata/config-full.toml | 3 + .../config-multi-chain-effective.toml | 9 + docs/CONFIG.md | 283 ++++++++ .../node/validate/defaults-override.txtar | 3 + .../disk-based-logging-disabled.txtar | 3 + .../validate/disk-based-logging-no-dir.txtar | 3 + .../node/validate/disk-based-logging.txtar | 3 + .../node/validate/fallback-override.txtar | 6 + testdata/scripts/node/validate/invalid.txtar | 3 + testdata/scripts/node/validate/valid.txtar | 3 + 47 files changed, 4982 insertions(+), 15 deletions(-) create mode 100644 core/chains/evm/txm/attempt_builder.go create mode 100644 core/chains/evm/txm/attempt_builder_test.go create mode 100644 core/chains/evm/txm/clientwrappers/chain_client.go create mode 100644 core/chains/evm/txm/clientwrappers/dual_broadcast_client.go create mode 100644 core/chains/evm/txm/clientwrappers/geth_client.go create mode 100644 core/chains/evm/txm/docs/TRANSACTION_MANAGER_V2.md create mode 100644 core/chains/evm/txm/dummy_keystore.go create mode 100644 core/chains/evm/txm/metrics.go create mode 100644 core/chains/evm/txm/mocks/attempt_builder.go create mode 100644 core/chains/evm/txm/mocks/client.go create mode 100644 core/chains/evm/txm/mocks/keystore.go create mode 100644 core/chains/evm/txm/mocks/tx_store.go create mode 100644 core/chains/evm/txm/orchestrator.go create mode 100644 core/chains/evm/txm/storage/inmemory_store.go create mode 100644 core/chains/evm/txm/storage/inmemory_store_manager.go create mode 100644 core/chains/evm/txm/storage/inmemory_store_manager_test.go create mode 100644 core/chains/evm/txm/storage/inmemory_store_test.go create mode 100644 core/chains/evm/txm/stuck_tx_detector.go create mode 100644 core/chains/evm/txm/stuck_tx_detector_test.go create mode 100644 core/chains/evm/txm/txm.go create mode 100644 core/chains/evm/txm/txm_test.go create mode 100644 core/chains/evm/txm/types/transaction.go diff --git a/.mockery.yaml b/.mockery.yaml index b7dbb8a1e85..88dcf307d20 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -81,6 +81,12 @@ packages: BalanceMonitor: config: dir: "{{ .InterfaceDir }}/../mocks" + github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm: + interfaces: + Client: + TxStore: + AttemptBuilder: + Keystore: github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr: interfaces: ChainConfig: diff --git a/core/chains/evm/config/chain_scoped_transactions.go b/core/chains/evm/config/chain_scoped_transactions.go index 8cddce20e65..3da171c98f0 100644 --- a/core/chains/evm/config/chain_scoped_transactions.go +++ b/core/chains/evm/config/chain_scoped_transactions.go @@ -39,6 +39,31 @@ func (t *transactionsConfig) MaxQueued() uint64 { return uint64(*t.c.MaxQueued) } +func (t *transactionsConfig) TransactionManagerV2() TransactionManagerV2 { + return &transactionManagerV2Config{c: t.c.TransactionManagerV2} +} + +type transactionManagerV2Config struct { + c toml.TransactionManagerV2Config +} + +func (t *transactionManagerV2Config) Enabled() bool { + return *t.c.Enabled +} + +func (t *transactionManagerV2Config) BlockTime() *time.Duration { + d := t.c.BlockTime.Duration() + return &d +} + +func (t *transactionManagerV2Config) CustomURL() *url.URL { + return t.c.CustomURL.URL() +} + +func (t *transactionManagerV2Config) DualBroadcast() *bool { + return t.c.DualBroadcast +} + func (t *transactionsConfig) AutoPurge() AutoPurgeConfig { return &autoPurgeConfig{c: t.c.AutoPurge} } diff --git a/core/chains/evm/config/config.go b/core/chains/evm/config/config.go index fbaf1ff6dda..c76cb6953e5 100644 --- a/core/chains/evm/config/config.go +++ b/core/chains/evm/config/config.go @@ -111,6 +111,7 @@ type Transactions interface { MaxInFlight() uint32 MaxQueued() uint64 AutoPurge() AutoPurgeConfig + TransactionManagerV2() TransactionManagerV2 } type AutoPurgeConfig interface { @@ -120,6 +121,13 @@ type AutoPurgeConfig interface { DetectionApiUrl() *url.URL } +type TransactionManagerV2 interface { + Enabled() bool + BlockTime() *time.Duration + CustomURL() *url.URL + DualBroadcast() *bool +} + type GasEstimator interface { BlockHistory() BlockHistory FeeHistory() FeeHistory diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index 807e1141791..7a3dddcb1de 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -6,6 +6,7 @@ import ( "net/url" "slices" "strconv" + "time" "github.com/ethereum/go-ethereum/core/txpool/legacypool" "github.com/pelletier/go-toml/v2" @@ -471,6 +472,27 @@ func (c *Chain) ValidateConfig() (err error) { return } +func (c *Transactions) ValidateConfig() (err error) { + if c.TransactionManagerV2.Enabled != nil && *c.TransactionManagerV2.Enabled && + c.TransactionManagerV2.DualBroadcast != nil && *c.TransactionManagerV2.DualBroadcast { + if c.TransactionManagerV2.CustomURL == nil { + err = multierr.Append(err, commonconfig.ErrMissing{Name: "TransactionManagerV2.CustomURL", Msg: "must be set if DualBroadcast is enabled"}) + } + if c.AutoPurge.Enabled != nil && !*c.AutoPurge.Enabled { + err = multierr.Append(err, commonconfig.ErrInvalid{Name: "AutoPurge.Enabled", Value: false, Msg: "cannot be false if DualBroadcast is enabled"}) + } + if c.AutoPurge.DetectionApiUrl == nil { + err = multierr.Append(err, commonconfig.ErrMissing{Name: "AutoPurge.DetectionApiUrl", Msg: "must be set if DualBroadcast is enabled"}) + } + if c.AutoPurge.Threshold == nil { + err = multierr.Append(err, commonconfig.ErrMissing{Name: "AutoPurge.Threshold", Msg: "needs to be set if auto-purge feature is enabled"}) + } else if *c.AutoPurge.Threshold == 0 { + err = multierr.Append(err, commonconfig.ErrInvalid{Name: "AutoPurge.Threshold", Value: 0, Msg: "cannot be 0 if auto-purge feature is enabled"}) + } + } + return +} + type Transactions struct { Enabled *bool ForwardersEnabled *bool @@ -480,7 +502,8 @@ type Transactions struct { ReaperThreshold *commonconfig.Duration ResendAfterThreshold *commonconfig.Duration - AutoPurge AutoPurgeConfig `toml:",omitempty"` + AutoPurge AutoPurgeConfig `toml:",omitempty"` + TransactionManagerV2 TransactionManagerV2Config `toml:",omitempty"` } func (t *Transactions) setFrom(f *Transactions) { @@ -506,6 +529,7 @@ func (t *Transactions) setFrom(f *Transactions) { t.ResendAfterThreshold = v } t.AutoPurge.setFrom(&f.AutoPurge) + t.TransactionManagerV2.setFrom(&f.TransactionManagerV2) } type AutoPurgeConfig struct { @@ -530,6 +554,41 @@ func (a *AutoPurgeConfig) setFrom(f *AutoPurgeConfig) { } } +type TransactionManagerV2Config struct { + Enabled *bool `toml:",omitempty"` + BlockTime *commonconfig.Duration `toml:",omitempty"` + CustomURL *commonconfig.URL `toml:",omitempty"` + DualBroadcast *bool `toml:",omitempty"` +} + +func (t *TransactionManagerV2Config) setFrom(f *TransactionManagerV2Config) { + if v := f.Enabled; v != nil { + t.Enabled = f.Enabled + } + if v := f.BlockTime; v != nil { + t.BlockTime = f.BlockTime + } + if v := f.CustomURL; v != nil { + t.CustomURL = f.CustomURL + } + if v := f.DualBroadcast; v != nil { + t.DualBroadcast = f.DualBroadcast + } +} + +func (t *TransactionManagerV2Config) ValidateConfig() (err error) { + if t.Enabled != nil && *t.Enabled { + if t.BlockTime == nil { + err = multierr.Append(err, commonconfig.ErrMissing{Name: "BlockTime", Msg: "must be set if TransactionManagerV2 feature is enabled"}) + return + } + if t.BlockTime.Duration() < 2*time.Second { + err = multierr.Append(err, commonconfig.ErrInvalid{Name: "BlockTime", Msg: "must be equal to or greater than 2 seconds"}) + } + } + return +} + type OCR2 struct { Automation Automation `toml:",omitempty"` } diff --git a/core/chains/evm/config/toml/defaults/fallback.toml b/core/chains/evm/config/toml/defaults/fallback.toml index d2a6f0e4a2d..4b6caa20787 100644 --- a/core/chains/evm/config/toml/defaults/fallback.toml +++ b/core/chains/evm/config/toml/defaults/fallback.toml @@ -30,6 +30,9 @@ ResendAfterThreshold = '1m' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true diff --git a/core/chains/evm/keystore/eth.go b/core/chains/evm/keystore/eth.go index ff71e0a4f18..9c0986d9c3d 100644 --- a/core/chains/evm/keystore/eth.go +++ b/core/chains/evm/keystore/eth.go @@ -13,5 +13,6 @@ type Eth interface { CheckEnabled(ctx context.Context, address common.Address, chainID *big.Int) error EnabledAddressesForChain(ctx context.Context, chainID *big.Int) (addresses []common.Address, err error) SignTx(ctx context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) + SignMessage(ctx context.Context, address common.Address, message []byte) ([]byte, error) SubscribeToKeyChanges(ctx context.Context) (ch chan struct{}, unsub func()) } diff --git a/core/chains/evm/keystore/mocks/eth.go b/core/chains/evm/keystore/mocks/eth.go index aefe6ff7548..96125e66936 100644 --- a/core/chains/evm/keystore/mocks/eth.go +++ b/core/chains/evm/keystore/mocks/eth.go @@ -133,6 +133,66 @@ func (_c *Eth_EnabledAddressesForChain_Call) RunAndReturn(run func(context.Conte return _c } +// SignMessage provides a mock function with given fields: ctx, address, message +func (_m *Eth) SignMessage(ctx context.Context, address common.Address, message []byte) ([]byte, error) { + ret := _m.Called(ctx, address, message) + + if len(ret) == 0 { + panic("no return value specified for SignMessage") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, []byte) ([]byte, error)); ok { + return rf(ctx, address, message) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, []byte) []byte); ok { + r0 = rf(ctx, address, message) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, []byte) error); ok { + r1 = rf(ctx, address, message) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Eth_SignMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignMessage' +type Eth_SignMessage_Call struct { + *mock.Call +} + +// SignMessage is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - message []byte +func (_e *Eth_Expecter) SignMessage(ctx interface{}, address interface{}, message interface{}) *Eth_SignMessage_Call { + return &Eth_SignMessage_Call{Call: _e.mock.On("SignMessage", ctx, address, message)} +} + +func (_c *Eth_SignMessage_Call) Run(run func(ctx context.Context, address common.Address, message []byte)) *Eth_SignMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].([]byte)) + }) + return _c +} + +func (_c *Eth_SignMessage_Call) Return(_a0 []byte, _a1 error) *Eth_SignMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_SignMessage_Call) RunAndReturn(run func(context.Context, common.Address, []byte) ([]byte, error)) *Eth_SignMessage_Call { + _c.Call.Return(run) + return _c +} + // SignTx provides a mock function with given fields: ctx, fromAddress, tx, chainID func (_m *Eth) SignTx(ctx context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { ret := _m.Called(ctx, fromAddress, tx, chainID) diff --git a/core/chains/evm/txm/attempt_builder.go b/core/chains/evm/txm/attempt_builder.go new file mode 100644 index 00000000000..16ed0f1a86a --- /dev/null +++ b/core/chains/evm/txm/attempt_builder.go @@ -0,0 +1,161 @@ +package txm + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + evmtypes "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +type AttemptBuilderKeystore interface { + SignTx(ctx context.Context, fromAddress common.Address, tx *evmtypes.Transaction, chainID *big.Int) (*evmtypes.Transaction, error) +} + +type attemptBuilder struct { + gas.EvmFeeEstimator + chainID *big.Int + priceMaxKey func(common.Address) *assets.Wei + keystore AttemptBuilderKeystore +} + +func NewAttemptBuilder(chainID *big.Int, priceMaxKey func(common.Address) *assets.Wei, estimator gas.EvmFeeEstimator, keystore AttemptBuilderKeystore) *attemptBuilder { + return &attemptBuilder{ + chainID: chainID, + priceMaxKey: priceMaxKey, + EvmFeeEstimator: estimator, + keystore: keystore, + } +} + +func (a *attemptBuilder) NewAttempt(ctx context.Context, lggr logger.Logger, tx *types.Transaction, dynamic bool) (*types.Attempt, error) { + fee, estimatedGasLimit, err := a.EvmFeeEstimator.GetFee(ctx, tx.Data, tx.SpecifiedGasLimit, a.priceMaxKey(tx.FromAddress), &tx.FromAddress, &tx.ToAddress) + if err != nil { + return nil, err + } + txType := evmtypes.LegacyTxType + if dynamic { + txType = evmtypes.DynamicFeeTxType + } + return a.newCustomAttempt(ctx, tx, fee, estimatedGasLimit, byte(txType), lggr) +} + +func (a *attemptBuilder) NewBumpAttempt(ctx context.Context, lggr logger.Logger, tx *types.Transaction, previousAttempt types.Attempt) (*types.Attempt, error) { + bumpedFee, bumpedFeeLimit, err := a.EvmFeeEstimator.BumpFee(ctx, previousAttempt.Fee, tx.SpecifiedGasLimit, a.priceMaxKey(tx.FromAddress), nil) + if err != nil { + return nil, err + } + return a.newCustomAttempt(ctx, tx, bumpedFee, bumpedFeeLimit, previousAttempt.Type, lggr) +} + +func (a *attemptBuilder) newCustomAttempt( + ctx context.Context, + tx *types.Transaction, + fee gas.EvmFee, + estimatedGasLimit uint64, + txType byte, + lggr logger.Logger, +) (attempt *types.Attempt, err error) { + switch txType { + case 0x0: + if fee.GasPrice == nil { + err = fmt.Errorf("tried to create attempt of type %v for txID: %v but estimator did not return legacy fee", txType, tx.ID) + logger.Sugared(lggr).AssumptionViolation(err.Error()) + return + } + return a.newLegacyAttempt(ctx, tx, fee.GasPrice, estimatedGasLimit) + case 0x2: + if !fee.ValidDynamic() { + err = fmt.Errorf("tried to create attempt of type %v for txID: %v but estimator did not return dynamic fee", txType, tx.ID) + logger.Sugared(lggr).AssumptionViolation(err.Error()) + return + } + return a.newDynamicFeeAttempt(ctx, tx, fee.DynamicFee, estimatedGasLimit) + default: + return nil, fmt.Errorf("cannot build attempt, unrecognized transaction type: %v", txType) + } +} + +func (a *attemptBuilder) newLegacyAttempt(ctx context.Context, tx *types.Transaction, gasPrice *assets.Wei, estimatedGasLimit uint64) (*types.Attempt, error) { + var data []byte + var toAddress common.Address + value := big.NewInt(0) + if !tx.IsPurgeable { + data = tx.Data + toAddress = tx.ToAddress + value = tx.Value + } + if tx.Nonce == nil { + return nil, fmt.Errorf("failed to create attempt for txID: %v: nonce empty", tx.ID) + } + legacyTx := evmtypes.LegacyTx{ + Nonce: *tx.Nonce, + To: &toAddress, + Value: value, + Gas: estimatedGasLimit, + GasPrice: gasPrice.ToInt(), + Data: data, + } + + signedTx, err := a.keystore.SignTx(ctx, tx.FromAddress, evmtypes.NewTx(&legacyTx), a.chainID) + if err != nil { + return nil, fmt.Errorf("failed to sign attempt for txID: %v, err: %w", tx.ID, err) + } + + attempt := &types.Attempt{ + TxID: tx.ID, + Fee: gas.EvmFee{GasPrice: gasPrice}, + Hash: signedTx.Hash(), + GasLimit: estimatedGasLimit, + Type: evmtypes.LegacyTxType, + SignedTransaction: signedTx, + } + + return attempt, nil +} + +func (a *attemptBuilder) newDynamicFeeAttempt(ctx context.Context, tx *types.Transaction, dynamicFee gas.DynamicFee, estimatedGasLimit uint64) (*types.Attempt, error) { + var data []byte + var toAddress common.Address + value := big.NewInt(0) + if !tx.IsPurgeable { + data = tx.Data + toAddress = tx.ToAddress + value = tx.Value + } + if tx.Nonce == nil { + return nil, fmt.Errorf("failed to create attempt for txID: %v: nonce empty", tx.ID) + } + dynamicTx := evmtypes.DynamicFeeTx{ + Nonce: *tx.Nonce, + To: &toAddress, + Value: value, + Gas: estimatedGasLimit, + GasFeeCap: dynamicFee.GasFeeCap.ToInt(), + GasTipCap: dynamicFee.GasTipCap.ToInt(), + Data: data, + } + + signedTx, err := a.keystore.SignTx(ctx, tx.FromAddress, evmtypes.NewTx(&dynamicTx), a.chainID) + if err != nil { + return nil, fmt.Errorf("failed to sign attempt for txID: %v, err: %w", tx.ID, err) + } + + attempt := &types.Attempt{ + TxID: tx.ID, + Fee: gas.EvmFee{DynamicFee: gas.DynamicFee{GasFeeCap: dynamicFee.GasFeeCap, GasTipCap: dynamicFee.GasTipCap}}, + Hash: signedTx.Hash(), + GasLimit: estimatedGasLimit, + Type: evmtypes.DynamicFeeTxType, + SignedTransaction: signedTx, + } + + return attempt, nil +} diff --git a/core/chains/evm/txm/attempt_builder_test.go b/core/chains/evm/txm/attempt_builder_test.go new file mode 100644 index 00000000000..65330cd39d7 --- /dev/null +++ b/core/chains/evm/txm/attempt_builder_test.go @@ -0,0 +1,97 @@ +package txm + +import ( + "math/big" + "testing" + + evmtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +func TestAttemptBuilder_newLegacyAttempt(t *testing.T) { + ks := mocks.NewEth(t) + ab := NewAttemptBuilder(testutils.FixtureChainID, nil, nil, ks) + address := testutils.NewAddress() + toAddress := testutils.NewAddress() + lggr := logger.Test(t) + var gasLimit uint64 = 100 + + t.Run("fails if GasPrice is nil", func(t *testing.T) { + tx := &types.Transaction{ID: 10, FromAddress: address} + _, err := ab.newCustomAttempt(tests.Context(t), tx, gas.EvmFee{DynamicFee: gas.DynamicFee{GasTipCap: assets.NewWeiI(1), GasFeeCap: assets.NewWeiI(2)}}, gasLimit, evmtypes.LegacyTxType, lggr) + require.Error(t, err) + assert.Contains(t, err.Error(), "estimator did not return legacy fee") + }) + + t.Run("fails if tx doesn't have a nonce", func(t *testing.T) { + tx := &types.Transaction{ID: 10, FromAddress: address} + _, err := ab.newCustomAttempt(tests.Context(t), tx, gas.EvmFee{GasPrice: assets.NewWeiI(25)}, gasLimit, evmtypes.LegacyTxType, lggr) + require.Error(t, err) + assert.Contains(t, err.Error(), "nonce empty") + }) + + t.Run("creates attempt with fields", func(t *testing.T) { + var nonce uint64 = 77 + tx := &types.Transaction{ID: 10, FromAddress: address, Nonce: &nonce} + legacyTx := evmtypes.NewTx(&evmtypes.LegacyTx{Nonce: nonce, To: &toAddress, Gas: gasLimit, GasPrice: big.NewInt(25)}) + ks.On("SignTx", mock.Anything, mock.Anything, mock.Anything, testutils.FixtureChainID).Return(legacyTx, nil).Once() + a, err := ab.newCustomAttempt(tests.Context(t), tx, gas.EvmFee{GasPrice: assets.NewWeiI(25)}, gasLimit, evmtypes.LegacyTxType, lggr) + require.NoError(t, err) + assert.Equal(t, tx.ID, a.TxID) + assert.Equal(t, evmtypes.LegacyTxType, int(a.Type)) + assert.NotNil(t, a.Fee.GasPrice) + assert.Equal(t, "25 wei", a.Fee.GasPrice.String()) + assert.Nil(t, a.Fee.GasTipCap) + assert.Nil(t, a.Fee.GasFeeCap) + assert.Equal(t, gasLimit, a.GasLimit) + }) +} + +func TestAttemptBuilder_newDynamicFeeAttempt(t *testing.T) { + ks := mocks.NewEth(t) + ab := NewAttemptBuilder(testutils.FixtureChainID, nil, nil, ks) + address := testutils.NewAddress() + toAddress := testutils.NewAddress() + lggr := logger.Test(t) + var gasLimit uint64 = 100 + + t.Run("fails if DynamicFee is invalid", func(t *testing.T) { + tx := &types.Transaction{ID: 10, FromAddress: address} + _, err := ab.newCustomAttempt(tests.Context(t), tx, gas.EvmFee{GasPrice: assets.NewWeiI(1)}, gasLimit, evmtypes.DynamicFeeTxType, lggr) + require.Error(t, err) + assert.Contains(t, err.Error(), "estimator did not return dynamic fee") + }) + + t.Run("fails if tx doesn't have a nonce", func(t *testing.T) { + tx := &types.Transaction{ID: 10, FromAddress: address} + _, err := ab.newCustomAttempt(tests.Context(t), tx, gas.EvmFee{DynamicFee: gas.DynamicFee{GasTipCap: assets.NewWeiI(1), GasFeeCap: assets.NewWeiI(2)}}, gasLimit, evmtypes.DynamicFeeTxType, lggr) + require.Error(t, err) + assert.Contains(t, err.Error(), "nonce empty") + }) + + t.Run("creates attempt with fields", func(t *testing.T) { + var nonce uint64 = 77 + tx := &types.Transaction{ID: 10, FromAddress: address, Nonce: &nonce} + legacyTx := evmtypes.NewTx(&evmtypes.LegacyTx{Nonce: nonce, To: &toAddress, Gas: gasLimit, GasPrice: big.NewInt(25)}) + ks.On("SignTx", mock.Anything, mock.Anything, mock.Anything, testutils.FixtureChainID).Return(legacyTx, nil).Once() + a, err := ab.newCustomAttempt(tests.Context(t), tx, gas.EvmFee{DynamicFee: gas.DynamicFee{GasTipCap: assets.NewWeiI(1), GasFeeCap: assets.NewWeiI(2)}}, gasLimit, evmtypes.DynamicFeeTxType, lggr) + require.NoError(t, err) + assert.Equal(t, tx.ID, a.TxID) + assert.Equal(t, evmtypes.DynamicFeeTxType, int(a.Type)) + assert.Equal(t, "1 wei", a.Fee.DynamicFee.GasTipCap.String()) + assert.Equal(t, "2 wei", a.Fee.DynamicFee.GasFeeCap.String()) + assert.Nil(t, a.Fee.GasPrice) + assert.Equal(t, gasLimit, a.GasLimit) + }) +} diff --git a/core/chains/evm/txm/clientwrappers/chain_client.go b/core/chains/evm/txm/clientwrappers/chain_client.go new file mode 100644 index 00000000000..7638cc53443 --- /dev/null +++ b/core/chains/evm/txm/clientwrappers/chain_client.go @@ -0,0 +1,31 @@ +package clientwrappers + +import ( + "context" + "math/big" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +type ChainClient struct { + c client.Client +} + +func NewChainClient(client client.Client) *ChainClient { + return &ChainClient{c: client} +} + +func (c *ChainClient) NonceAt(ctx context.Context, address common.Address, blockNumber *big.Int) (uint64, error) { + return c.c.NonceAt(ctx, address, blockNumber) +} + +func (c *ChainClient) PendingNonceAt(ctx context.Context, address common.Address) (uint64, error) { + return c.c.PendingNonceAt(ctx, address) +} + +func (c *ChainClient) SendTransaction(ctx context.Context, _ *types.Transaction, attempt *types.Attempt) error { + return c.c.SendTransaction(ctx, attempt.SignedTransaction) +} diff --git a/core/chains/evm/txm/clientwrappers/dual_broadcast_client.go b/core/chains/evm/txm/clientwrappers/dual_broadcast_client.go new file mode 100644 index 00000000000..481c26cbc2b --- /dev/null +++ b/core/chains/evm/txm/clientwrappers/dual_broadcast_client.go @@ -0,0 +1,128 @@ +package clientwrappers + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "math/big" + "net/http" + "net/url" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +type DualBroadcastClientKeystore interface { + SignMessage(ctx context.Context, address common.Address, message []byte) ([]byte, error) +} + +type DualBroadcastClient struct { + c client.Client + keystore DualBroadcastClientKeystore + customURL *url.URL +} + +func NewDualBroadcastClient(c client.Client, keystore DualBroadcastClientKeystore, customURL *url.URL) *DualBroadcastClient { + return &DualBroadcastClient{ + c: c, + keystore: keystore, + customURL: customURL, + } +} + +func (d *DualBroadcastClient) NonceAt(ctx context.Context, address common.Address, blockNumber *big.Int) (uint64, error) { + return d.c.NonceAt(ctx, address, blockNumber) +} + +func (d *DualBroadcastClient) PendingNonceAt(ctx context.Context, address common.Address) (uint64, error) { + body := []byte(fmt.Sprintf(`{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["%s","pending"], "id":1}`, address.String())) + response, err := d.signAndPostMessage(ctx, address, body, "") + if err != nil { + return 0, err + } + + nonce, err := hexutil.DecodeUint64(response) + if err != nil { + return 0, fmt.Errorf("failed to decode response %v into uint64: %w", response, err) + } + return nonce, nil +} + +func (d *DualBroadcastClient) SendTransaction(ctx context.Context, tx *types.Transaction, attempt *types.Attempt) error { + meta, err := tx.GetMeta() + if err != nil { + return err + } + + if meta != nil && meta.DualBroadcast != nil && *meta.DualBroadcast && !tx.IsPurgeable { + data, err := attempt.SignedTransaction.MarshalBinary() + if err != nil { + return err + } + params := "" + if meta.DualBroadcastParams != nil { + params = *meta.DualBroadcastParams + } + body := []byte(fmt.Sprintf(`{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["%s"], "id":1}`, hexutil.Encode(data))) + _, err = d.signAndPostMessage(ctx, tx.FromAddress, body, params) + return err + } + + return d.c.SendTransaction(ctx, attempt.SignedTransaction) +} + +func (d *DualBroadcastClient) signAndPostMessage(ctx context.Context, address common.Address, body []byte, urlParams string) (result string, err error) { + bodyReader := bytes.NewReader(body) + postReq, err := http.NewRequestWithContext(ctx, http.MethodPost, d.customURL.String()+"?"+urlParams, bodyReader) + if err != nil { + return + } + + hashedBody := crypto.Keccak256Hash(body).Hex() + signedMessage, err := d.keystore.SignMessage(ctx, address, []byte(hashedBody)) + if err != nil { + return + } + + postReq.Header.Add("X-Flashbots-signature", address.String()+":"+hexutil.Encode(signedMessage)) + postReq.Header.Add("Content-Type", "application/json") + + resp, err := http.DefaultClient.Do(postReq) + if err != nil { + return result, fmt.Errorf("request %v failed: %w", postReq, err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return result, fmt.Errorf("request %v failed with status: %d", postReq, resp.StatusCode) + } + + keyJSON, err := io.ReadAll(resp.Body) + if err != nil { + return + } + var response postResponse + err = json.Unmarshal(keyJSON, &response) + if err != nil { + return result, fmt.Errorf("failed to unmarshal response into struct: %w: %s", err, string(keyJSON)) + } + if response.Error.Message != "" { + return result, errors.New(response.Error.Message) + } + return response.Result, nil +} + +type postResponse struct { + Result string `json:"result,omitempty"` + Error postError +} + +type postError struct { + Message string `json:"message,omitempty"` +} diff --git a/core/chains/evm/txm/clientwrappers/geth_client.go b/core/chains/evm/txm/clientwrappers/geth_client.go new file mode 100644 index 00000000000..d97e5cfae35 --- /dev/null +++ b/core/chains/evm/txm/clientwrappers/geth_client.go @@ -0,0 +1,51 @@ +package clientwrappers + +import ( + "context" + "math/big" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" +) + +type GethClient struct { + *ethclient.Client +} + +func NewGethClient(client *ethclient.Client) *GethClient { + return &GethClient{ + Client: client, + } +} + +func (g *GethClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { + return g.Client.Client().BatchCallContext(ctx, b) +} + +func (g *GethClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { + return g.Client.Client().CallContext(ctx, result, method, args...) +} + +func (g *GethClient) CallContract(ctx context.Context, message ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { + var hex hexutil.Bytes + err := g.CallContext(ctx, &hex, "eth_call", client.ToBackwardCompatibleCallArg(message), client.ToBackwardCompatibleBlockNumArg(blockNumber)) + return hex, err +} + +func (g *GethClient) HeadByNumber(ctx context.Context, number *big.Int) (*evmtypes.Head, error) { + hexNumber := client.ToBlockNumArg(number) + args := []interface{}{hexNumber, false} + head := new(evmtypes.Head) + err := g.CallContext(ctx, head, "eth_getBlockByNumber", args...) + return head, err +} + +func (g *GethClient) SendTransaction(ctx context.Context, _ *types.Transaction, attempt *types.Attempt) error { + return g.Client.SendTransaction(ctx, attempt.SignedTransaction) +} diff --git a/core/chains/evm/txm/docs/TRANSACTION_MANAGER_V2.md b/core/chains/evm/txm/docs/TRANSACTION_MANAGER_V2.md new file mode 100644 index 00000000000..d408cc7d733 --- /dev/null +++ b/core/chains/evm/txm/docs/TRANSACTION_MANAGER_V2.md @@ -0,0 +1,14 @@ + +# Transaction Manager V2 + +## Configs +- `EIP1559`: enables EIP-1559 mode. This means the transaction manager will create and broadcast Dynamic attempts. Set this to false to broadcast Legacy transactions. +- `BlockTime`: controls the interval of the backfill loop. This dictates how frequently the transaction manager will check for confirmed transactions, rebroadcast stuck ones, and fill any nonce gaps. Transactions are getting confirmed only during new blocks so it's best if you set this to a value close to the block time. At least one RPC call is made during each BlockTime interval so the recommended minimum is 2s. A small jitter is applied so the timeout won't be exactly the same each time. +- `RetryBlockThreshold`: is the number of blocks to wait for a transaction stuck in the mempool before automatically rebroadcasting it with a new attempt. +- `EmptyTxLimitDefault`: sets default gas limit for empty transactions. Empty transactions are created in case there is a nonce gap or another stuck transaction in the mempool to fill a given nonce. These are empty transactions and they don't have any data or value. + +## Metrics +- `txm_num_broadcasted_transactions`: total number of successful broadcasted transactions. +- `txm_num_confirmed_transactions`: total number of confirmed transactions. Note that this can happen multiple times per transaction in the case of re-orgs. +- `txm_num_nonce_gaps`: total number of nonce gaps created that the transaction manager had to fill. +- `txm_time_until_tx_confirmed`: The amount of time elapsed from a transaction being broadcast to being included in a block. \ No newline at end of file diff --git a/core/chains/evm/txm/dummy_keystore.go b/core/chains/evm/txm/dummy_keystore.go new file mode 100644 index 00000000000..01816dfcbbd --- /dev/null +++ b/core/chains/evm/txm/dummy_keystore.go @@ -0,0 +1,64 @@ +package txm + +import ( + "context" + "crypto/ecdsa" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" +) + +type DummyKeystore struct { + privateKeyMap map[common.Address]*ecdsa.PrivateKey +} + +func NewKeystore() *DummyKeystore { + return &DummyKeystore{privateKeyMap: make(map[common.Address]*ecdsa.PrivateKey)} +} + +func (k *DummyKeystore) Add(privateKeyString string) error { + privateKey, err := crypto.HexToECDSA(privateKeyString) + if err != nil { + return err + } + + publicKey := privateKey.Public() + publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) + if !ok { + return fmt.Errorf("error casting public key: %v to ECDSA", publicKey) + } + + address := crypto.PubkeyToAddress(*publicKeyECDSA) + k.privateKeyMap[address] = privateKey + return nil +} + +func (k *DummyKeystore) SignTx(_ context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { + if key, exists := k.privateKeyMap[fromAddress]; exists { + return types.SignTx(tx, types.LatestSignerForChainID(chainID), key) + } + return nil, fmt.Errorf("private key for address: %v not found", fromAddress) +} + +func (k *DummyKeystore) SignMessage(ctx context.Context, address common.Address, data []byte) ([]byte, error) { + key, exists := k.privateKeyMap[address] + if !exists { + return nil, fmt.Errorf("private key for address: %v not found", address) + } + signature, err := crypto.Sign(accounts.TextHash(data), key) + if err != nil { + return nil, fmt.Errorf("failed to sign message for address: %v", address) + } + return signature, nil +} + +func (k *DummyKeystore) EnabledAddressesForChain(_ context.Context, _ *big.Int) (addresses []common.Address, err error) { + for address := range k.privateKeyMap { + addresses = append(addresses, address) + } + return +} diff --git a/core/chains/evm/txm/metrics.go b/core/chains/evm/txm/metrics.go new file mode 100644 index 00000000000..5ccc711ef09 --- /dev/null +++ b/core/chains/evm/txm/metrics.go @@ -0,0 +1,93 @@ +package txm + +import ( + "context" + "fmt" + "math/big" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "go.opentelemetry.io/otel/metric" + + "github.com/smartcontractkit/chainlink-common/pkg/beholder" + "github.com/smartcontractkit/chainlink-common/pkg/metrics" +) + +var ( + promNumBroadcastedTxs = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "txm_num_broadcasted_transactions", + Help: "Total number of successful broadcasted transactions.", + }, []string{"chainID"}) + promNumConfirmedTxs = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "txm_num_confirmed_transactions", + Help: "Total number of confirmed transactions. Note that this can happen multiple times per transaction in the case of re-orgs or when filling the nonce for untracked transactions.", + }, []string{"chainID"}) + promNumNonceGaps = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "txm_num_nonce_gaps", + Help: "Total number of nonce gaps created that the transaction manager had to fill.", + }, []string{"chainID"}) + promTimeUntilTxConfirmed = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "txm_time_until_tx_confirmed", + Help: "The amount of time elapsed from a transaction being broadcast to being included in a block.", + }, []string{"chainID"}) +) + +type txmMetrics struct { + metrics.Labeler + chainID *big.Int + numBroadcastedTxs metric.Int64Counter + numConfirmedTxs metric.Int64Counter + numNonceGaps metric.Int64Counter + timeUntilTxConfirmed metric.Float64Histogram +} + +func NewTxmMetrics(chainID *big.Int) (*txmMetrics, error) { + numBroadcastedTxs, err := beholder.GetMeter().Int64Counter("txm_num_broadcasted_transactions") + if err != nil { + return nil, fmt.Errorf("failed to register broadcasted txs number: %w", err) + } + + numConfirmedTxs, err := beholder.GetMeter().Int64Counter("txm_num_confirmed_transactions") + if err != nil { + return nil, fmt.Errorf("failed to register confirmed txs number: %w", err) + } + + numNonceGaps, err := beholder.GetMeter().Int64Counter("txm_num_nonce_gaps") + if err != nil { + return nil, fmt.Errorf("failed to register nonce gaps number: %w", err) + } + + timeUntilTxConfirmed, err := beholder.GetMeter().Float64Histogram("txm_time_until_tx_confirmed") + if err != nil { + return nil, fmt.Errorf("failed to register time until tx confirmed: %w", err) + } + + return &txmMetrics{ + chainID: chainID, + Labeler: metrics.NewLabeler().With("chainID", chainID.String()), + numBroadcastedTxs: numBroadcastedTxs, + numConfirmedTxs: numConfirmedTxs, + numNonceGaps: numNonceGaps, + timeUntilTxConfirmed: timeUntilTxConfirmed, + }, nil +} + +func (m *txmMetrics) IncrementNumBroadcastedTxs(ctx context.Context) { + promNumBroadcastedTxs.WithLabelValues(m.chainID.String()).Add(float64(1)) + m.numBroadcastedTxs.Add(ctx, 1) +} + +func (m *txmMetrics) IncrementNumConfirmedTxs(ctx context.Context, confirmedTransactions int) { + promNumConfirmedTxs.WithLabelValues(m.chainID.String()).Add(float64(confirmedTransactions)) + m.numConfirmedTxs.Add(ctx, int64(confirmedTransactions)) +} + +func (m *txmMetrics) IncrementNumNonceGaps(ctx context.Context) { + promNumNonceGaps.WithLabelValues(m.chainID.String()).Add(float64(1)) + m.numNonceGaps.Add(ctx, 1) +} + +func (m *txmMetrics) RecordTimeUntilTxConfirmed(ctx context.Context, duration float64) { + promTimeUntilTxConfirmed.WithLabelValues(m.chainID.String()).Observe(duration) + m.timeUntilTxConfirmed.Record(ctx, duration) +} diff --git a/core/chains/evm/txm/mocks/attempt_builder.go b/core/chains/evm/txm/mocks/attempt_builder.go new file mode 100644 index 00000000000..91961e5d420 --- /dev/null +++ b/core/chains/evm/txm/mocks/attempt_builder.go @@ -0,0 +1,161 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + logger "github.com/smartcontractkit/chainlink-common/pkg/logger" + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +// AttemptBuilder is an autogenerated mock type for the AttemptBuilder type +type AttemptBuilder struct { + mock.Mock +} + +type AttemptBuilder_Expecter struct { + mock *mock.Mock +} + +func (_m *AttemptBuilder) EXPECT() *AttemptBuilder_Expecter { + return &AttemptBuilder_Expecter{mock: &_m.Mock} +} + +// NewAttempt provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *AttemptBuilder) NewAttempt(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 bool) (*types.Attempt, error) { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for NewAttempt") + } + + var r0 *types.Attempt + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, logger.Logger, *types.Transaction, bool) (*types.Attempt, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } + if rf, ok := ret.Get(0).(func(context.Context, logger.Logger, *types.Transaction, bool) *types.Attempt); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Attempt) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, logger.Logger, *types.Transaction, bool) error); ok { + r1 = rf(_a0, _a1, _a2, _a3) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// AttemptBuilder_NewAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewAttempt' +type AttemptBuilder_NewAttempt_Call struct { + *mock.Call +} + +// NewAttempt is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 logger.Logger +// - _a2 *types.Transaction +// - _a3 bool +func (_e *AttemptBuilder_Expecter) NewAttempt(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *AttemptBuilder_NewAttempt_Call { + return &AttemptBuilder_NewAttempt_Call{Call: _e.mock.On("NewAttempt", _a0, _a1, _a2, _a3)} +} + +func (_c *AttemptBuilder_NewAttempt_Call) Run(run func(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 bool)) *AttemptBuilder_NewAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(logger.Logger), args[2].(*types.Transaction), args[3].(bool)) + }) + return _c +} + +func (_c *AttemptBuilder_NewAttempt_Call) Return(_a0 *types.Attempt, _a1 error) *AttemptBuilder_NewAttempt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AttemptBuilder_NewAttempt_Call) RunAndReturn(run func(context.Context, logger.Logger, *types.Transaction, bool) (*types.Attempt, error)) *AttemptBuilder_NewAttempt_Call { + _c.Call.Return(run) + return _c +} + +// NewBumpAttempt provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *AttemptBuilder) NewBumpAttempt(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 types.Attempt) (*types.Attempt, error) { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for NewBumpAttempt") + } + + var r0 *types.Attempt + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, logger.Logger, *types.Transaction, types.Attempt) (*types.Attempt, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } + if rf, ok := ret.Get(0).(func(context.Context, logger.Logger, *types.Transaction, types.Attempt) *types.Attempt); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Attempt) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, logger.Logger, *types.Transaction, types.Attempt) error); ok { + r1 = rf(_a0, _a1, _a2, _a3) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// AttemptBuilder_NewBumpAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBumpAttempt' +type AttemptBuilder_NewBumpAttempt_Call struct { + *mock.Call +} + +// NewBumpAttempt is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 logger.Logger +// - _a2 *types.Transaction +// - _a3 types.Attempt +func (_e *AttemptBuilder_Expecter) NewBumpAttempt(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *AttemptBuilder_NewBumpAttempt_Call { + return &AttemptBuilder_NewBumpAttempt_Call{Call: _e.mock.On("NewBumpAttempt", _a0, _a1, _a2, _a3)} +} + +func (_c *AttemptBuilder_NewBumpAttempt_Call) Run(run func(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 types.Attempt)) *AttemptBuilder_NewBumpAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(logger.Logger), args[2].(*types.Transaction), args[3].(types.Attempt)) + }) + return _c +} + +func (_c *AttemptBuilder_NewBumpAttempt_Call) Return(_a0 *types.Attempt, _a1 error) *AttemptBuilder_NewBumpAttempt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AttemptBuilder_NewBumpAttempt_Call) RunAndReturn(run func(context.Context, logger.Logger, *types.Transaction, types.Attempt) (*types.Attempt, error)) *AttemptBuilder_NewBumpAttempt_Call { + _c.Call.Return(run) + return _c +} + +// NewAttemptBuilder creates a new instance of AttemptBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewAttemptBuilder(t interface { + mock.TestingT + Cleanup(func()) +}) *AttemptBuilder { + mock := &AttemptBuilder{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/txm/mocks/client.go b/core/chains/evm/txm/mocks/client.go new file mode 100644 index 00000000000..cac2e55491a --- /dev/null +++ b/core/chains/evm/txm/mocks/client.go @@ -0,0 +1,204 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + big "math/big" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +// Client is an autogenerated mock type for the Client type +type Client struct { + mock.Mock +} + +type Client_Expecter struct { + mock *mock.Mock +} + +func (_m *Client) EXPECT() *Client_Expecter { + return &Client_Expecter{mock: &_m.Mock} +} + +// NonceAt provides a mock function with given fields: _a0, _a1, _a2 +func (_m *Client) NonceAt(_a0 context.Context, _a1 common.Address, _a2 *big.Int) (uint64, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for NonceAt") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) (uint64, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) uint64); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Client_NonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NonceAt' +type Client_NonceAt_Call struct { + *mock.Call +} + +// NonceAt is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +// - _a2 *big.Int +func (_e *Client_Expecter) NonceAt(_a0 interface{}, _a1 interface{}, _a2 interface{}) *Client_NonceAt_Call { + return &Client_NonceAt_Call{Call: _e.mock.On("NonceAt", _a0, _a1, _a2)} +} + +func (_c *Client_NonceAt_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 *big.Int)) *Client_NonceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Client_NonceAt_Call) Return(_a0 uint64, _a1 error) *Client_NonceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_NonceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (uint64, error)) *Client_NonceAt_Call { + _c.Call.Return(run) + return _c +} + +// PendingNonceAt provides a mock function with given fields: _a0, _a1 +func (_m *Client) PendingNonceAt(_a0 context.Context, _a1 common.Address) (uint64, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for PendingNonceAt") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address) (uint64, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Client_PendingNonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingNonceAt' +type Client_PendingNonceAt_Call struct { + *mock.Call +} + +// PendingNonceAt is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +func (_e *Client_Expecter) PendingNonceAt(_a0 interface{}, _a1 interface{}) *Client_PendingNonceAt_Call { + return &Client_PendingNonceAt_Call{Call: _e.mock.On("PendingNonceAt", _a0, _a1)} +} + +func (_c *Client_PendingNonceAt_Call) Run(run func(_a0 context.Context, _a1 common.Address)) *Client_PendingNonceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *Client_PendingNonceAt_Call) Return(_a0 uint64, _a1 error) *Client_PendingNonceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_PendingNonceAt_Call) RunAndReturn(run func(context.Context, common.Address) (uint64, error)) *Client_PendingNonceAt_Call { + _c.Call.Return(run) + return _c +} + +// SendTransaction provides a mock function with given fields: ctx, tx, attempt +func (_m *Client) SendTransaction(ctx context.Context, tx *types.Transaction, attempt *types.Attempt) error { + ret := _m.Called(ctx, tx, attempt) + + if len(ret) == 0 { + panic("no return value specified for SendTransaction") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, *types.Attempt) error); ok { + r0 = rf(ctx, tx, attempt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Client_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type Client_SendTransaction_Call struct { + *mock.Call +} + +// SendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - tx *types.Transaction +// - attempt *types.Attempt +func (_e *Client_Expecter) SendTransaction(ctx interface{}, tx interface{}, attempt interface{}) *Client_SendTransaction_Call { + return &Client_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, tx, attempt)} +} + +func (_c *Client_SendTransaction_Call) Run(run func(ctx context.Context, tx *types.Transaction, attempt *types.Attempt)) *Client_SendTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(*types.Attempt)) + }) + return _c +} + +func (_c *Client_SendTransaction_Call) Return(_a0 error) *Client_SendTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_SendTransaction_Call) RunAndReturn(run func(context.Context, *types.Transaction, *types.Attempt) error) *Client_SendTransaction_Call { + _c.Call.Return(run) + return _c +} + +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { + mock.TestingT + Cleanup(func()) +}) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/txm/mocks/keystore.go b/core/chains/evm/txm/mocks/keystore.go new file mode 100644 index 00000000000..3d11a6fa549 --- /dev/null +++ b/core/chains/evm/txm/mocks/keystore.go @@ -0,0 +1,98 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + big "math/big" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" +) + +// Keystore is an autogenerated mock type for the Keystore type +type Keystore struct { + mock.Mock +} + +type Keystore_Expecter struct { + mock *mock.Mock +} + +func (_m *Keystore) EXPECT() *Keystore_Expecter { + return &Keystore_Expecter{mock: &_m.Mock} +} + +// EnabledAddressesForChain provides a mock function with given fields: ctx, chainID +func (_m *Keystore) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ([]common.Address, error) { + ret := _m.Called(ctx, chainID) + + if len(ret) == 0 { + panic("no return value specified for EnabledAddressesForChain") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]common.Address, error)); ok { + return rf(ctx, chainID) + } + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []common.Address); ok { + r0 = rf(ctx, chainID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { + r1 = rf(ctx, chainID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Keystore_EnabledAddressesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledAddressesForChain' +type Keystore_EnabledAddressesForChain_Call struct { + *mock.Call +} + +// EnabledAddressesForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *Keystore_Expecter) EnabledAddressesForChain(ctx interface{}, chainID interface{}) *Keystore_EnabledAddressesForChain_Call { + return &Keystore_EnabledAddressesForChain_Call{Call: _e.mock.On("EnabledAddressesForChain", ctx, chainID)} +} + +func (_c *Keystore_EnabledAddressesForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Keystore_EnabledAddressesForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Keystore_EnabledAddressesForChain_Call) Return(addresses []common.Address, err error) *Keystore_EnabledAddressesForChain_Call { + _c.Call.Return(addresses, err) + return _c +} + +func (_c *Keystore_EnabledAddressesForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]common.Address, error)) *Keystore_EnabledAddressesForChain_Call { + _c.Call.Return(run) + return _c +} + +// NewKeystore creates a new instance of Keystore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewKeystore(t interface { + mock.TestingT + Cleanup(func()) +}) *Keystore { + mock := &Keystore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/txm/mocks/tx_store.go b/core/chains/evm/txm/mocks/tx_store.go new file mode 100644 index 00000000000..318b36942b8 --- /dev/null +++ b/core/chains/evm/txm/mocks/tx_store.go @@ -0,0 +1,647 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +// TxStore is an autogenerated mock type for the TxStore type +type TxStore struct { + mock.Mock +} + +type TxStore_Expecter struct { + mock *mock.Mock +} + +func (_m *TxStore) EXPECT() *TxStore_Expecter { + return &TxStore_Expecter{mock: &_m.Mock} +} + +// AbandonPendingTransactions provides a mock function with given fields: _a0, _a1 +func (_m *TxStore) AbandonPendingTransactions(_a0 context.Context, _a1 common.Address) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbandonPendingTransactions") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TxStore_AbandonPendingTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbandonPendingTransactions' +type TxStore_AbandonPendingTransactions_Call struct { + *mock.Call +} + +// AbandonPendingTransactions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +func (_e *TxStore_Expecter) AbandonPendingTransactions(_a0 interface{}, _a1 interface{}) *TxStore_AbandonPendingTransactions_Call { + return &TxStore_AbandonPendingTransactions_Call{Call: _e.mock.On("AbandonPendingTransactions", _a0, _a1)} +} + +func (_c *TxStore_AbandonPendingTransactions_Call) Run(run func(_a0 context.Context, _a1 common.Address)) *TxStore_AbandonPendingTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *TxStore_AbandonPendingTransactions_Call) Return(_a0 error) *TxStore_AbandonPendingTransactions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_AbandonPendingTransactions_Call) RunAndReturn(run func(context.Context, common.Address) error) *TxStore_AbandonPendingTransactions_Call { + _c.Call.Return(run) + return _c +} + +// AppendAttemptToTransaction provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *TxStore) AppendAttemptToTransaction(_a0 context.Context, _a1 uint64, _a2 common.Address, _a3 *types.Attempt) error { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for AppendAttemptToTransaction") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address, *types.Attempt) error); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TxStore_AppendAttemptToTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendAttemptToTransaction' +type TxStore_AppendAttemptToTransaction_Call struct { + *mock.Call +} + +// AppendAttemptToTransaction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +// - _a3 *types.Attempt +func (_e *TxStore_Expecter) AppendAttemptToTransaction(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *TxStore_AppendAttemptToTransaction_Call { + return &TxStore_AppendAttemptToTransaction_Call{Call: _e.mock.On("AppendAttemptToTransaction", _a0, _a1, _a2, _a3)} +} + +func (_c *TxStore_AppendAttemptToTransaction_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address, _a3 *types.Attempt)) *TxStore_AppendAttemptToTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address), args[3].(*types.Attempt)) + }) + return _c +} + +func (_c *TxStore_AppendAttemptToTransaction_Call) Return(_a0 error) *TxStore_AppendAttemptToTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_AppendAttemptToTransaction_Call) RunAndReturn(run func(context.Context, uint64, common.Address, *types.Attempt) error) *TxStore_AppendAttemptToTransaction_Call { + _c.Call.Return(run) + return _c +} + +// CreateEmptyUnconfirmedTransaction provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *TxStore) CreateEmptyUnconfirmedTransaction(_a0 context.Context, _a1 common.Address, _a2 uint64, _a3 uint64) (*types.Transaction, error) { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for CreateEmptyUnconfirmedTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, uint64) (*types.Transaction, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, uint64) *types.Transaction); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64, uint64) error); ok { + r1 = rf(_a0, _a1, _a2, _a3) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TxStore_CreateEmptyUnconfirmedTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEmptyUnconfirmedTransaction' +type TxStore_CreateEmptyUnconfirmedTransaction_Call struct { + *mock.Call +} + +// CreateEmptyUnconfirmedTransaction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +// - _a2 uint64 +// - _a3 uint64 +func (_e *TxStore_Expecter) CreateEmptyUnconfirmedTransaction(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *TxStore_CreateEmptyUnconfirmedTransaction_Call { + return &TxStore_CreateEmptyUnconfirmedTransaction_Call{Call: _e.mock.On("CreateEmptyUnconfirmedTransaction", _a0, _a1, _a2, _a3)} +} + +func (_c *TxStore_CreateEmptyUnconfirmedTransaction_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 uint64, _a3 uint64)) *TxStore_CreateEmptyUnconfirmedTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64), args[3].(uint64)) + }) + return _c +} + +func (_c *TxStore_CreateEmptyUnconfirmedTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *TxStore_CreateEmptyUnconfirmedTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_CreateEmptyUnconfirmedTransaction_Call) RunAndReturn(run func(context.Context, common.Address, uint64, uint64) (*types.Transaction, error)) *TxStore_CreateEmptyUnconfirmedTransaction_Call { + _c.Call.Return(run) + return _c +} + +// CreateTransaction provides a mock function with given fields: _a0, _a1 +func (_m *TxStore) CreateTransaction(_a0 context.Context, _a1 *types.TxRequest) (*types.Transaction, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for CreateTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.TxRequest) (*types.Transaction, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.TxRequest) *types.Transaction); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.TxRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TxStore_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' +type TxStore_CreateTransaction_Call struct { + *mock.Call +} + +// CreateTransaction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *types.TxRequest +func (_e *TxStore_Expecter) CreateTransaction(_a0 interface{}, _a1 interface{}) *TxStore_CreateTransaction_Call { + return &TxStore_CreateTransaction_Call{Call: _e.mock.On("CreateTransaction", _a0, _a1)} +} + +func (_c *TxStore_CreateTransaction_Call) Run(run func(_a0 context.Context, _a1 *types.TxRequest)) *TxStore_CreateTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.TxRequest)) + }) + return _c +} + +func (_c *TxStore_CreateTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *TxStore_CreateTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_CreateTransaction_Call) RunAndReturn(run func(context.Context, *types.TxRequest) (*types.Transaction, error)) *TxStore_CreateTransaction_Call { + _c.Call.Return(run) + return _c +} + +// DeleteAttemptForUnconfirmedTx provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *TxStore) DeleteAttemptForUnconfirmedTx(_a0 context.Context, _a1 uint64, _a2 *types.Attempt, _a3 common.Address) error { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for DeleteAttemptForUnconfirmedTx") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.Attempt, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TxStore_DeleteAttemptForUnconfirmedTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAttemptForUnconfirmedTx' +type TxStore_DeleteAttemptForUnconfirmedTx_Call struct { + *mock.Call +} + +// DeleteAttemptForUnconfirmedTx is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 *types.Attempt +// - _a3 common.Address +func (_e *TxStore_Expecter) DeleteAttemptForUnconfirmedTx(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *TxStore_DeleteAttemptForUnconfirmedTx_Call { + return &TxStore_DeleteAttemptForUnconfirmedTx_Call{Call: _e.mock.On("DeleteAttemptForUnconfirmedTx", _a0, _a1, _a2, _a3)} +} + +func (_c *TxStore_DeleteAttemptForUnconfirmedTx_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 *types.Attempt, _a3 common.Address)) *TxStore_DeleteAttemptForUnconfirmedTx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(*types.Attempt), args[3].(common.Address)) + }) + return _c +} + +func (_c *TxStore_DeleteAttemptForUnconfirmedTx_Call) Return(_a0 error) *TxStore_DeleteAttemptForUnconfirmedTx_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_DeleteAttemptForUnconfirmedTx_Call) RunAndReturn(run func(context.Context, uint64, *types.Attempt, common.Address) error) *TxStore_DeleteAttemptForUnconfirmedTx_Call { + _c.Call.Return(run) + return _c +} + +// FetchUnconfirmedTransactionAtNonceWithCount provides a mock function with given fields: _a0, _a1, _a2 +func (_m *TxStore) FetchUnconfirmedTransactionAtNonceWithCount(_a0 context.Context, _a1 uint64, _a2 common.Address) (*types.Transaction, int, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for FetchUnconfirmedTransactionAtNonceWithCount") + } + + var r0 *types.Transaction + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) (*types.Transaction, int, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) *types.Transaction); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, common.Address) int); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Get(1).(int) + } + + if rf, ok := ret.Get(2).(func(context.Context, uint64, common.Address) error); ok { + r2 = rf(_a0, _a1, _a2) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchUnconfirmedTransactionAtNonceWithCount' +type TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call struct { + *mock.Call +} + +// FetchUnconfirmedTransactionAtNonceWithCount is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +func (_e *TxStore_Expecter) FetchUnconfirmedTransactionAtNonceWithCount(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + return &TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call{Call: _e.mock.On("FetchUnconfirmedTransactionAtNonceWithCount", _a0, _a1, _a2)} +} + +func (_c *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) Return(_a0 *types.Transaction, _a1 int, _a2 error) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) RunAndReturn(run func(context.Context, uint64, common.Address) (*types.Transaction, int, error)) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + _c.Call.Return(run) + return _c +} + +// MarkConfirmedAndReorgedTransactions provides a mock function with given fields: _a0, _a1, _a2 +func (_m *TxStore) MarkConfirmedAndReorgedTransactions(_a0 context.Context, _a1 uint64, _a2 common.Address) ([]*types.Transaction, []uint64, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for MarkConfirmedAndReorgedTransactions") + } + + var r0 []*types.Transaction + var r1 []uint64 + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) []*types.Transaction); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, common.Address) []uint64); ok { + r1 = rf(_a0, _a1, _a2) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]uint64) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, uint64, common.Address) error); ok { + r2 = rf(_a0, _a1, _a2) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// TxStore_MarkConfirmedAndReorgedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkConfirmedAndReorgedTransactions' +type TxStore_MarkConfirmedAndReorgedTransactions_Call struct { + *mock.Call +} + +// MarkConfirmedAndReorgedTransactions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +func (_e *TxStore_Expecter) MarkConfirmedAndReorgedTransactions(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_MarkConfirmedAndReorgedTransactions_Call { + return &TxStore_MarkConfirmedAndReorgedTransactions_Call{Call: _e.mock.On("MarkConfirmedAndReorgedTransactions", _a0, _a1, _a2)} +} + +func (_c *TxStore_MarkConfirmedAndReorgedTransactions_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *TxStore_MarkConfirmedAndReorgedTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *TxStore_MarkConfirmedAndReorgedTransactions_Call) Return(_a0 []*types.Transaction, _a1 []uint64, _a2 error) *TxStore_MarkConfirmedAndReorgedTransactions_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *TxStore_MarkConfirmedAndReorgedTransactions_Call) RunAndReturn(run func(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error)) *TxStore_MarkConfirmedAndReorgedTransactions_Call { + _c.Call.Return(run) + return _c +} + +// MarkTxFatal provides a mock function with given fields: _a0, _a1, _a2 +func (_m *TxStore) MarkTxFatal(_a0 context.Context, _a1 *types.Transaction, _a2 common.Address) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for MarkTxFatal") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TxStore_MarkTxFatal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkTxFatal' +type TxStore_MarkTxFatal_Call struct { + *mock.Call +} + +// MarkTxFatal is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *types.Transaction +// - _a2 common.Address +func (_e *TxStore_Expecter) MarkTxFatal(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_MarkTxFatal_Call { + return &TxStore_MarkTxFatal_Call{Call: _e.mock.On("MarkTxFatal", _a0, _a1, _a2)} +} + +func (_c *TxStore_MarkTxFatal_Call) Run(run func(_a0 context.Context, _a1 *types.Transaction, _a2 common.Address)) *TxStore_MarkTxFatal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(common.Address)) + }) + return _c +} + +func (_c *TxStore_MarkTxFatal_Call) Return(_a0 error) *TxStore_MarkTxFatal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_MarkTxFatal_Call) RunAndReturn(run func(context.Context, *types.Transaction, common.Address) error) *TxStore_MarkTxFatal_Call { + _c.Call.Return(run) + return _c +} + +// MarkUnconfirmedTransactionPurgeable provides a mock function with given fields: _a0, _a1, _a2 +func (_m *TxStore) MarkUnconfirmedTransactionPurgeable(_a0 context.Context, _a1 uint64, _a2 common.Address) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for MarkUnconfirmedTransactionPurgeable") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TxStore_MarkUnconfirmedTransactionPurgeable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkUnconfirmedTransactionPurgeable' +type TxStore_MarkUnconfirmedTransactionPurgeable_Call struct { + *mock.Call +} + +// MarkUnconfirmedTransactionPurgeable is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +func (_e *TxStore_Expecter) MarkUnconfirmedTransactionPurgeable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { + return &TxStore_MarkUnconfirmedTransactionPurgeable_Call{Call: _e.mock.On("MarkUnconfirmedTransactionPurgeable", _a0, _a1, _a2)} +} + +func (_c *TxStore_MarkUnconfirmedTransactionPurgeable_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *TxStore_MarkUnconfirmedTransactionPurgeable_Call) Return(_a0 error) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_MarkUnconfirmedTransactionPurgeable_Call) RunAndReturn(run func(context.Context, uint64, common.Address) error) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { + _c.Call.Return(run) + return _c +} + +// UpdateTransactionBroadcast provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 +func (_m *TxStore) UpdateTransactionBroadcast(_a0 context.Context, _a1 uint64, _a2 uint64, _a3 common.Hash, _a4 common.Address) error { + ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + + if len(ret) == 0 { + panic("no return value specified for UpdateTransactionBroadcast") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, common.Hash, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2, _a3, _a4) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TxStore_UpdateTransactionBroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTransactionBroadcast' +type TxStore_UpdateTransactionBroadcast_Call struct { + *mock.Call +} + +// UpdateTransactionBroadcast is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 uint64 +// - _a3 common.Hash +// - _a4 common.Address +func (_e *TxStore_Expecter) UpdateTransactionBroadcast(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *TxStore_UpdateTransactionBroadcast_Call { + return &TxStore_UpdateTransactionBroadcast_Call{Call: _e.mock.On("UpdateTransactionBroadcast", _a0, _a1, _a2, _a3, _a4)} +} + +func (_c *TxStore_UpdateTransactionBroadcast_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 uint64, _a3 common.Hash, _a4 common.Address)) *TxStore_UpdateTransactionBroadcast_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(uint64), args[3].(common.Hash), args[4].(common.Address)) + }) + return _c +} + +func (_c *TxStore_UpdateTransactionBroadcast_Call) Return(_a0 error) *TxStore_UpdateTransactionBroadcast_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTransactionBroadcast_Call) RunAndReturn(run func(context.Context, uint64, uint64, common.Hash, common.Address) error) *TxStore_UpdateTransactionBroadcast_Call { + _c.Call.Return(run) + return _c +} + +// UpdateUnstartedTransactionWithNonce provides a mock function with given fields: _a0, _a1, _a2 +func (_m *TxStore) UpdateUnstartedTransactionWithNonce(_a0 context.Context, _a1 common.Address, _a2 uint64) (*types.Transaction, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for UpdateUnstartedTransactionWithNonce") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64) (*types.Transaction, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64) *types.Transaction); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64) error); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TxStore_UpdateUnstartedTransactionWithNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUnstartedTransactionWithNonce' +type TxStore_UpdateUnstartedTransactionWithNonce_Call struct { + *mock.Call +} + +// UpdateUnstartedTransactionWithNonce is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +// - _a2 uint64 +func (_e *TxStore_Expecter) UpdateUnstartedTransactionWithNonce(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_UpdateUnstartedTransactionWithNonce_Call { + return &TxStore_UpdateUnstartedTransactionWithNonce_Call{Call: _e.mock.On("UpdateUnstartedTransactionWithNonce", _a0, _a1, _a2)} +} + +func (_c *TxStore_UpdateUnstartedTransactionWithNonce_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 uint64)) *TxStore_UpdateUnstartedTransactionWithNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64)) + }) + return _c +} + +func (_c *TxStore_UpdateUnstartedTransactionWithNonce_Call) Return(_a0 *types.Transaction, _a1 error) *TxStore_UpdateUnstartedTransactionWithNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_UpdateUnstartedTransactionWithNonce_Call) RunAndReturn(run func(context.Context, common.Address, uint64) (*types.Transaction, error)) *TxStore_UpdateUnstartedTransactionWithNonce_Call { + _c.Call.Return(run) + return _c +} + +// NewTxStore creates a new instance of TxStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTxStore(t interface { + mock.TestingT + Cleanup(func()) +}) *TxStore { + mock := &TxStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/txm/orchestrator.go b/core/chains/evm/txm/orchestrator.go new file mode 100644 index 00000000000..ae981e153b0 --- /dev/null +++ b/core/chains/evm/txm/orchestrator.go @@ -0,0 +1,363 @@ +package txm + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "math" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/google/uuid" + nullv4 "gopkg.in/guregu/null.v4" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/utils" + + "github.com/smartcontractkit/chainlink/v2/common/txmgr" + txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" + "github.com/smartcontractkit/chainlink/v2/common/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + txmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" +) + +type OrchestratorTxStore interface { + Add(addresses ...common.Address) error + FetchUnconfirmedTransactionAtNonceWithCount(context.Context, uint64, common.Address) (*txmtypes.Transaction, int, error) + FindTxWithIdempotencyKey(context.Context, string) (*txmtypes.Transaction, error) +} + +type OrchestratorKeystore interface { + CheckEnabled(ctx context.Context, address common.Address, chainID *big.Int) error + EnabledAddressesForChain(ctx context.Context, chainID *big.Int) (addresses []common.Address, err error) +} + +type OrchestratorAttemptBuilder[ + BLOCK_HASH types.Hashable, + HEAD types.Head[BLOCK_HASH], +] interface { + services.Service + OnNewLongestChain(ctx context.Context, head HEAD) +} + +// Generics are necessary to keep TXMv2 backwards compatible +type Orchestrator[ + BLOCK_HASH types.Hashable, + HEAD types.Head[BLOCK_HASH], +] struct { + services.StateMachine + lggr logger.SugaredLogger + chainID *big.Int + txm *Txm + txStore OrchestratorTxStore + fwdMgr *forwarders.FwdMgr + keystore OrchestratorKeystore + attemptBuilder OrchestratorAttemptBuilder[BLOCK_HASH, HEAD] + resumeCallback txmgr.ResumeCallback +} + +func NewTxmOrchestrator[BLOCK_HASH types.Hashable, HEAD types.Head[BLOCK_HASH]]( + lggr logger.Logger, + chainID *big.Int, + txm *Txm, + txStore OrchestratorTxStore, + fwdMgr *forwarders.FwdMgr, + keystore OrchestratorKeystore, + attemptBuilder OrchestratorAttemptBuilder[BLOCK_HASH, HEAD], +) *Orchestrator[BLOCK_HASH, HEAD] { + return &Orchestrator[BLOCK_HASH, HEAD]{ + lggr: logger.Sugared(logger.Named(lggr, "Orchestrator")), + chainID: chainID, + txm: txm, + txStore: txStore, + keystore: keystore, + attemptBuilder: attemptBuilder, + fwdMgr: fwdMgr, + } +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) Start(ctx context.Context) error { + return o.StartOnce("Orchestrator", func() error { + var ms services.MultiStart + if err := ms.Start(ctx, o.attemptBuilder); err != nil { + return fmt.Errorf("Orchestrator: AttemptBuilder failed to start: %w", err) + } + addresses, err := o.keystore.EnabledAddressesForChain(ctx, o.chainID) + if err != nil { + return err + } + for _, address := range addresses { + err := o.txStore.Add(address) + if err != nil { + return err + } + } + if err := ms.Start(ctx, o.txm); err != nil { + return fmt.Errorf("Orchestrator: Txm failed to start: %w", err) + } + if o.fwdMgr != nil { + if err := ms.Start(ctx, o.fwdMgr); err != nil { + return fmt.Errorf("Orchestrator: ForwarderManager failed to start: %w", err) + } + } + return nil + }) +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) Close() (merr error) { + return o.StopOnce("Orchestrator", func() error { + if o.fwdMgr != nil { + if err := o.fwdMgr.Close(); err != nil { + merr = errors.Join(merr, fmt.Errorf("Orchestrator failed to stop ForwarderManager: %w", err)) + } + } + if err := o.txm.Close(); err != nil { + merr = errors.Join(merr, fmt.Errorf("Orchestrator failed to stop Txm: %w", err)) + } + if err := o.attemptBuilder.Close(); err != nil { + merr = errors.Join(merr, fmt.Errorf("Orchestrator failed to stop AttemptBuilder: %w", err)) + } + return merr + }) +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) Trigger(addr common.Address) { + o.txm.Trigger(addr) +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) Name() string { + return o.lggr.Name() +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) HealthReport() map[string]error { + return map[string]error{o.Name(): o.Healthy()} +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) RegisterResumeCallback(fn txmgr.ResumeCallback) { + o.resumeCallback = fn +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) Reset(addr common.Address, abandon bool) error { + ok := o.IfStarted(func() { + if err := o.txm.Abandon(addr); err != nil { + o.lggr.Error(err) + } + }) + if !ok { + return errors.New("Orchestrator not started yet") + } + return nil +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) OnNewLongestChain(ctx context.Context, head HEAD) { + ok := o.IfStarted(func() { + o.attemptBuilder.OnNewLongestChain(ctx, head) + }) + if !ok { + o.lggr.Debugw("Not started; ignoring head", "head", head, "state", o.State()) + } +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) CreateTransaction(ctx context.Context, request txmgrtypes.TxRequest[common.Address, common.Hash]) (tx txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { + var wrappedTx *txmtypes.Transaction + if request.IdempotencyKey != nil { + wrappedTx, err = o.txStore.FindTxWithIdempotencyKey(ctx, *request.IdempotencyKey) + if err != nil { + return + } + } + + if wrappedTx != nil { + o.lggr.Infof("Found Tx with IdempotencyKey: %v. Returning existing Tx without creating a new one.", *wrappedTx.IdempotencyKey) + } else { + if kErr := o.keystore.CheckEnabled(ctx, request.FromAddress, o.chainID); kErr != nil { + return tx, fmt.Errorf("cannot send transaction from %s on chain ID %s: %w", request.FromAddress, o.chainID.String(), kErr) + } + + var pipelineTaskRunID uuid.NullUUID + if request.PipelineTaskRunID != nil { + pipelineTaskRunID.UUID = *request.PipelineTaskRunID + pipelineTaskRunID.Valid = true + } + + if o.fwdMgr != nil && (!utils.IsZero(request.ForwarderAddress)) { + fwdPayload, fwdErr := o.fwdMgr.ConvertPayload(request.ToAddress, request.EncodedPayload) + if fwdErr == nil { + // Handling meta not set at caller. + if request.Meta != nil { + request.Meta.FwdrDestAddress = &request.ToAddress + } else { + request.Meta = &txmgrtypes.TxMeta[common.Address, common.Hash]{ + FwdrDestAddress: &request.ToAddress, + } + } + request.ToAddress = request.ForwarderAddress + request.EncodedPayload = fwdPayload + } else { + o.lggr.Errorf("Failed to use forwarder set upstream: %v", fwdErr.Error()) + } + } + + var meta *sqlutil.JSON + if request.Meta != nil { + raw, mErr := json.Marshal(request.Meta) + if mErr != nil { + return tx, mErr + } + m := sqlutil.JSON(raw) + meta = &m + } + + wrappedTxRequest := &txmtypes.TxRequest{ + IdempotencyKey: request.IdempotencyKey, + ChainID: o.chainID, + FromAddress: request.FromAddress, + ToAddress: request.ToAddress, + Value: &request.Value, + Data: request.EncodedPayload, + SpecifiedGasLimit: request.FeeLimit, + Meta: meta, + ForwarderAddress: request.ForwarderAddress, + + PipelineTaskRunID: pipelineTaskRunID, + MinConfirmations: request.MinConfirmations, + SignalCallback: request.SignalCallback, + } + + wrappedTx, err = o.txm.CreateTransaction(ctx, wrappedTxRequest) + if err != nil { + return + } + o.txm.Trigger(request.FromAddress) + } + + if wrappedTx.ID > math.MaxInt64 { + return tx, fmt.Errorf("overflow for int64: %d", wrappedTx.ID) + } + + tx = txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]{ + ID: int64(wrappedTx.ID), + IdempotencyKey: wrappedTx.IdempotencyKey, + FromAddress: wrappedTx.FromAddress, + ToAddress: wrappedTx.ToAddress, + EncodedPayload: wrappedTx.Data, + Value: *wrappedTx.Value, + FeeLimit: wrappedTx.SpecifiedGasLimit, + CreatedAt: wrappedTx.CreatedAt, + Meta: wrappedTx.Meta, + Subject: wrappedTx.Subject, + ChainID: wrappedTx.ChainID, + + PipelineTaskRunID: wrappedTx.PipelineTaskRunID, + MinConfirmations: wrappedTx.MinConfirmations, + SignalCallback: wrappedTx.SignalCallback, + CallbackCompleted: wrappedTx.CallbackCompleted, + } + return +} + +// CountTransactionsByState was required for backwards compatibility and it's used only for unconfirmed transactions. +func (o *Orchestrator[BLOCK_HASH, HEAD]) CountTransactionsByState(ctx context.Context, state txmgrtypes.TxState) (uint32, error) { + addresses, err := o.keystore.EnabledAddressesForChain(ctx, o.chainID) + if err != nil { + return 0, err + } + total := 0 + for _, address := range addresses { + _, count, err := o.txStore.FetchUnconfirmedTransactionAtNonceWithCount(ctx, 0, address) + if err != nil { + return 0, err + } + total += count + } + + //nolint:gosec // disable G115 + return uint32(total), nil +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) FindEarliestUnconfirmedBroadcastTime(ctx context.Context) (time nullv4.Time, err error) { + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) FindEarliestUnconfirmedTxAttemptBlock(ctx context.Context) (time nullv4.Int, err error) { + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) FindTxesByMetaFieldAndStates(ctx context.Context, metaField string, metaValue string, states []txmgrtypes.TxState, chainID *big.Int) (txs []*txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) FindTxesWithMetaFieldByStates(ctx context.Context, metaField string, states []txmgrtypes.TxState, chainID *big.Int) (txs []*txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) FindTxesWithMetaFieldByReceiptBlockNum(ctx context.Context, metaField string, blockNum int64, chainID *big.Int) (txs []*txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { + return +} + +//nolint:revive // keep API backwards compatible +func (o *Orchestrator[BLOCK_HASH, HEAD]) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx context.Context, ids []int64, states []txmgrtypes.TxState, chainID *big.Int) (txs []*txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) GetForwarderForEOA(ctx context.Context, eoa common.Address) (forwarder common.Address, err error) { + if o.fwdMgr != nil { + forwarder, err = o.fwdMgr.ForwarderFor(ctx, eoa) + } + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) GetForwarderForEOAOCR2Feeds(ctx context.Context, eoa, ocr2AggregatorID common.Address) (forwarder common.Address, err error) { + if o.fwdMgr != nil { + forwarder, err = o.fwdMgr.ForwarderForOCR2Feeds(ctx, eoa, ocr2AggregatorID) + } + return +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) GetTransactionStatus(ctx context.Context, transactionID string) (status commontypes.TransactionStatus, err error) { + // Loads attempts and receipts in the transaction + tx, err := o.txStore.FindTxWithIdempotencyKey(ctx, transactionID) + if err != nil || tx == nil { + return status, fmt.Errorf("failed to find transaction with IdempotencyKey %s: %w", transactionID, err) + } + + switch tx.State { + case txmgr.TxUnconfirmed: + return commontypes.Pending, nil + case txmgr.TxConfirmed: + // Return unconfirmed for confirmed transactions because they are not yet finalized + return commontypes.Unconfirmed, nil + case txmgr.TxFinalized: + return commontypes.Finalized, nil + case txmgr.TxFatalError: + return commontypes.Fatal, nil + default: + return commontypes.Unknown, nil + } +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) SendNativeToken(ctx context.Context, chainID *big.Int, from, to common.Address, value big.Int, gasLimit uint64) (tx txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { + txRequest := txmgrtypes.TxRequest[common.Address, common.Hash]{ + FromAddress: from, + ToAddress: to, + EncodedPayload: []byte{}, + Value: value, + FeeLimit: gasLimit, + //Strategy: NewSendEveryStrategy(), + } + + tx, err = o.CreateTransaction(ctx, txRequest) + if err != nil { + return + } + + // Trigger the Txm to check for new transaction + o.txm.Trigger(from) + return tx, err +} diff --git a/core/chains/evm/txm/storage/inmemory_store.go b/core/chains/evm/txm/storage/inmemory_store.go new file mode 100644 index 00000000000..57217913d76 --- /dev/null +++ b/core/chains/evm/txm/storage/inmemory_store.go @@ -0,0 +1,358 @@ +package storage + +import ( + "errors" + "fmt" + "math/big" + "sort" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + txmgr "github.com/smartcontractkit/chainlink/v2/common/txmgr" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +const ( + // maxQueuedTransactions is the max limit of UnstartedTransactions and ConfirmedTransactions structures. + maxQueuedTransactions = 250 + // pruneSubset controls the subset of confirmed transactions to prune when the structure reaches its max limit. + // i.e. if the value is 3 and the limit is 90, 30 transactions will be pruned. + pruneSubset = 3 +) + +type InMemoryStore struct { + sync.RWMutex + lggr logger.Logger + txIDCount uint64 + address common.Address + chainID *big.Int + + UnstartedTransactions []*types.Transaction + UnconfirmedTransactions map[uint64]*types.Transaction + ConfirmedTransactions map[uint64]*types.Transaction + FatalTransactions []*types.Transaction + + Transactions map[uint64]*types.Transaction +} + +func NewInMemoryStore(lggr logger.Logger, address common.Address, chainID *big.Int) *InMemoryStore { + return &InMemoryStore{ + lggr: logger.Named(lggr, "InMemoryStore"), + address: address, + chainID: chainID, + UnstartedTransactions: make([]*types.Transaction, 0, maxQueuedTransactions), + UnconfirmedTransactions: make(map[uint64]*types.Transaction), + ConfirmedTransactions: make(map[uint64]*types.Transaction, maxQueuedTransactions), + Transactions: make(map[uint64]*types.Transaction), + } +} + +func (m *InMemoryStore) AbandonPendingTransactions() { + // TODO: append existing fatal transactions and cap the size + m.Lock() + defer m.Unlock() + + for _, tx := range m.UnstartedTransactions { + tx.State = txmgr.TxFatalError + } + for _, tx := range m.FatalTransactions { + delete(m.Transactions, tx.ID) + } + m.FatalTransactions = m.UnstartedTransactions + m.UnstartedTransactions = []*types.Transaction{} + + for _, tx := range m.UnconfirmedTransactions { + tx.State = txmgr.TxFatalError + m.FatalTransactions = append(m.FatalTransactions, tx) + } + m.UnconfirmedTransactions = make(map[uint64]*types.Transaction) +} + +func (m *InMemoryStore) AppendAttemptToTransaction(txNonce uint64, attempt *types.Attempt) error { + m.Lock() + defer m.Unlock() + + tx, exists := m.UnconfirmedTransactions[txNonce] + if !exists { + return fmt.Errorf("unconfirmed tx was not found for nonce: %d - txID: %v", txNonce, attempt.TxID) + } + + if tx.ID != attempt.TxID { + return fmt.Errorf("unconfirmed tx with nonce exists but attempt points to a different txID. Found Tx: %v - txID: %v", m.UnconfirmedTransactions[txNonce], attempt.TxID) + } + + attempt.CreatedAt = time.Now() + attempt.ID = uint64(len(tx.Attempts)) // Attempts are not collectively tracked by the in-memory store so attemptIDs are not unique between transactions and can be reused. + tx.AttemptCount++ + m.UnconfirmedTransactions[txNonce].Attempts = append(m.UnconfirmedTransactions[txNonce].Attempts, attempt.DeepCopy()) + + return nil +} + +func (m *InMemoryStore) CountUnstartedTransactions() int { + m.RLock() + defer m.RUnlock() + + return len(m.UnstartedTransactions) +} + +func (m *InMemoryStore) CreateEmptyUnconfirmedTransaction(nonce uint64, gasLimit uint64) (*types.Transaction, error) { + m.Lock() + defer m.Unlock() + + emptyTx := &types.Transaction{ + ID: m.txIDCount, + ChainID: m.chainID, + Nonce: &nonce, + FromAddress: m.address, + ToAddress: common.Address{}, + Value: big.NewInt(0), + SpecifiedGasLimit: gasLimit, + CreatedAt: time.Now(), + State: txmgr.TxUnconfirmed, + } + + if _, exists := m.UnconfirmedTransactions[nonce]; exists { + return nil, fmt.Errorf("an unconfirmed tx with the same nonce already exists: %v", m.UnconfirmedTransactions[nonce]) + } + + if _, exists := m.ConfirmedTransactions[nonce]; exists { + return nil, fmt.Errorf("a confirmed tx with the same nonce already exists: %v", m.ConfirmedTransactions[nonce]) + } + + m.txIDCount++ + m.UnconfirmedTransactions[nonce] = emptyTx + m.Transactions[emptyTx.ID] = emptyTx + + return emptyTx.DeepCopy(), nil +} + +func (m *InMemoryStore) CreateTransaction(txRequest *types.TxRequest) *types.Transaction { + m.Lock() + defer m.Unlock() + + tx := &types.Transaction{ + ID: m.txIDCount, + IdempotencyKey: txRequest.IdempotencyKey, + ChainID: m.chainID, + FromAddress: m.address, + ToAddress: txRequest.ToAddress, + Value: txRequest.Value, + Data: txRequest.Data, + SpecifiedGasLimit: txRequest.SpecifiedGasLimit, + CreatedAt: time.Now(), + State: txmgr.TxUnstarted, + Meta: txRequest.Meta, + MinConfirmations: txRequest.MinConfirmations, + PipelineTaskRunID: txRequest.PipelineTaskRunID, + SignalCallback: txRequest.SignalCallback, + } + + uLen := len(m.UnstartedTransactions) + if uLen >= maxQueuedTransactions { + m.lggr.Warnw(fmt.Sprintf("Unstarted transactions queue for address: %v reached max limit of: %d. Dropping oldest transactions", m.address, maxQueuedTransactions), + "txs", m.UnstartedTransactions[0:uLen-maxQueuedTransactions+1]) // need to make room for the new tx + for _, tx := range m.UnstartedTransactions[0 : uLen-maxQueuedTransactions+1] { + delete(m.Transactions, tx.ID) + } + m.UnstartedTransactions = m.UnstartedTransactions[uLen-maxQueuedTransactions+1:] + } + + m.txIDCount++ + txCopy := tx.DeepCopy() + m.Transactions[txCopy.ID] = txCopy + m.UnstartedTransactions = append(m.UnstartedTransactions, txCopy) + return tx +} + +func (m *InMemoryStore) FetchUnconfirmedTransactionAtNonceWithCount(latestNonce uint64) (txCopy *types.Transaction, unconfirmedCount int) { + m.RLock() + defer m.RUnlock() + + tx := m.UnconfirmedTransactions[latestNonce] + if tx != nil { + txCopy = tx.DeepCopy() + } + unconfirmedCount = len(m.UnconfirmedTransactions) + return +} + +func (m *InMemoryStore) MarkConfirmedAndReorgedTransactions(latestNonce uint64) ([]*types.Transaction, []uint64, error) { + m.Lock() + defer m.Unlock() + + var confirmedTransactions []*types.Transaction + for _, tx := range m.UnconfirmedTransactions { + if tx.Nonce == nil { + return nil, nil, fmt.Errorf("nonce for txID: %v is empty", tx.ID) + } + existingTx, exists := m.ConfirmedTransactions[*tx.Nonce] + if exists { + m.lggr.Errorw("Another confirmed transaction with the same nonce exists. Transaction will be overwritten.", + "existingTx", existingTx, "newTx", tx) + } + if *tx.Nonce < latestNonce { + tx.State = txmgr.TxConfirmed + confirmedTransactions = append(confirmedTransactions, tx.DeepCopy()) + m.ConfirmedTransactions[*tx.Nonce] = tx + delete(m.UnconfirmedTransactions, *tx.Nonce) + } + } + + var unconfirmedTransactionIDs []uint64 + for _, tx := range m.ConfirmedTransactions { + if tx.Nonce == nil { + return nil, nil, fmt.Errorf("nonce for txID: %v is empty", tx.ID) + } + existingTx, exists := m.UnconfirmedTransactions[*tx.Nonce] + if exists { + m.lggr.Errorw("Another unconfirmed transaction with the same nonce exists. Transaction will overwritten.", + "existingTx", existingTx, "newTx", tx) + } + if *tx.Nonce >= latestNonce { + tx.State = txmgr.TxUnconfirmed + tx.LastBroadcastAt = nil // Mark reorged transaction as if it wasn't broadcasted before + unconfirmedTransactionIDs = append(unconfirmedTransactionIDs, tx.ID) + m.UnconfirmedTransactions[*tx.Nonce] = tx + delete(m.ConfirmedTransactions, *tx.Nonce) + } + } + + if len(m.ConfirmedTransactions) > maxQueuedTransactions { + prunedTxIDs := m.pruneConfirmedTransactions() + m.lggr.Debugf("Confirmed transactions map for address: %v reached max limit of: %d. Pruned 1/%d of the oldest confirmed transactions. TxIDs: %v", + m.address, maxQueuedTransactions, pruneSubset, prunedTxIDs) + } + sort.Slice(confirmedTransactions, func(i, j int) bool { return confirmedTransactions[i].ID < confirmedTransactions[j].ID }) + sort.Slice(unconfirmedTransactionIDs, func(i, j int) bool { return unconfirmedTransactionIDs[i] < unconfirmedTransactionIDs[j] }) + return confirmedTransactions, unconfirmedTransactionIDs, nil +} + +func (m *InMemoryStore) MarkUnconfirmedTransactionPurgeable(nonce uint64) error { + m.Lock() + defer m.Unlock() + + tx, exists := m.UnconfirmedTransactions[nonce] + if !exists { + return fmt.Errorf("unconfirmed tx with nonce: %d was not found", nonce) + } + + tx.IsPurgeable = true + + return nil +} + +func (m *InMemoryStore) UpdateTransactionBroadcast(txID uint64, txNonce uint64, attemptHash common.Hash) error { + m.Lock() + defer m.Unlock() + + unconfirmedTx, exists := m.UnconfirmedTransactions[txNonce] + if !exists { + return fmt.Errorf("unconfirmed tx was not found for nonce: %d - txID: %v", txNonce, txID) + } + + // Set the same time for both the tx and its attempt + now := time.Now() + unconfirmedTx.LastBroadcastAt = &now + if unconfirmedTx.InitialBroadcastAt == nil { + unconfirmedTx.InitialBroadcastAt = &now + } + a, err := unconfirmedTx.FindAttemptByHash(attemptHash) + if err != nil { + return fmt.Errorf("UpdateTransactionBroadcast failed to find attempt. %w", err) + } + a.BroadcastAt = &now + + return nil +} + +func (m *InMemoryStore) UpdateUnstartedTransactionWithNonce(nonce uint64) (*types.Transaction, error) { + m.Lock() + defer m.Unlock() + + if len(m.UnstartedTransactions) == 0 { + m.lggr.Debugf("Unstarted transactions queue is empty for address: %v", m.address) + return nil, nil + } + + if tx, exists := m.UnconfirmedTransactions[nonce]; exists { + return nil, fmt.Errorf("an unconfirmed tx with the same nonce already exists: %v", tx) + } + + tx := m.UnstartedTransactions[0] + tx.Nonce = &nonce + tx.State = txmgr.TxUnconfirmed + + m.UnstartedTransactions = m.UnstartedTransactions[1:] + m.UnconfirmedTransactions[nonce] = tx + + return tx.DeepCopy(), nil +} + +// Shouldn't call lock because it's being called by a method that already has the lock +func (m *InMemoryStore) pruneConfirmedTransactions() []uint64 { + noncesToPrune := make([]uint64, 0, len(m.ConfirmedTransactions)) + for nonce := range m.ConfirmedTransactions { + noncesToPrune = append(noncesToPrune, nonce) + } + if len(noncesToPrune) == 0 { + return nil + } + sort.Slice(noncesToPrune, func(i, j int) bool { return noncesToPrune[i] < noncesToPrune[j] }) + minNonce := noncesToPrune[len(noncesToPrune)/pruneSubset] + + var txIDsToPrune []uint64 + for nonce, tx := range m.ConfirmedTransactions { + if nonce < minNonce { + txIDsToPrune = append(txIDsToPrune, tx.ID) + delete(m.Transactions, tx.ID) + delete(m.ConfirmedTransactions, nonce) + } + } + + sort.Slice(txIDsToPrune, func(i, j int) bool { return txIDsToPrune[i] < txIDsToPrune[j] }) + return txIDsToPrune +} + +// Error Handler +func (m *InMemoryStore) DeleteAttemptForUnconfirmedTx(transactionNonce uint64, attempt *types.Attempt) error { + m.Lock() + defer m.Unlock() + + tx, exists := m.UnconfirmedTransactions[transactionNonce] + if !exists { + return fmt.Errorf("unconfirmed tx was not found for nonce: %d - txID: %v", transactionNonce, attempt.TxID) + } + + for i, a := range tx.Attempts { + if a.Hash == attempt.Hash { + tx.Attempts = append(tx.Attempts[:i], tx.Attempts[i+1:]...) + return nil + } + } + + return fmt.Errorf("attempt with hash: %v for txID: %v was not found", attempt.Hash, attempt.TxID) +} + +func (m *InMemoryStore) MarkTxFatal(*types.Transaction) error { + return errors.New("not implemented") +} + +// Orchestrator +func (m *InMemoryStore) FindTxWithIdempotencyKey(idempotencyKey string) *types.Transaction { + m.RLock() + defer m.RUnlock() + + for _, tx := range m.Transactions { + if tx.IdempotencyKey != nil && *tx.IdempotencyKey == idempotencyKey { + return tx.DeepCopy() + } + } + + return nil +} diff --git a/core/chains/evm/txm/storage/inmemory_store_manager.go b/core/chains/evm/txm/storage/inmemory_store_manager.go new file mode 100644 index 00000000000..a7538823eea --- /dev/null +++ b/core/chains/evm/txm/storage/inmemory_store_manager.go @@ -0,0 +1,136 @@ +package storage + +import ( + "context" + "errors" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +const StoreNotFoundForAddress string = "InMemoryStore for address: %v not found" + +type InMemoryStoreManager struct { + lggr logger.Logger + chainID *big.Int + InMemoryStoreMap map[common.Address]*InMemoryStore +} + +func NewInMemoryStoreManager(lggr logger.Logger, chainID *big.Int) *InMemoryStoreManager { + inMemoryStoreMap := make(map[common.Address]*InMemoryStore) + return &InMemoryStoreManager{ + lggr: lggr, + chainID: chainID, + InMemoryStoreMap: inMemoryStoreMap} +} + +func (m *InMemoryStoreManager) AbandonPendingTransactions(_ context.Context, fromAddress common.Address) error { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + store.AbandonPendingTransactions() + return nil + } + return fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) Add(addresses ...common.Address) (err error) { + for _, address := range addresses { + if _, exists := m.InMemoryStoreMap[address]; exists { + err = errors.Join(err, fmt.Errorf("address %v already exists in store manager", address)) + } + m.InMemoryStoreMap[address] = NewInMemoryStore(m.lggr, address, m.chainID) + } + return +} + +func (m *InMemoryStoreManager) AppendAttemptToTransaction(_ context.Context, txNonce uint64, fromAddress common.Address, attempt *types.Attempt) error { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.AppendAttemptToTransaction(txNonce, attempt) + } + return fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) CountUnstartedTransactions(fromAddress common.Address) (int, error) { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.CountUnstartedTransactions(), nil + } + return 0, fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) CreateEmptyUnconfirmedTransaction(_ context.Context, fromAddress common.Address, nonce uint64, gasLimit uint64) (*types.Transaction, error) { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.CreateEmptyUnconfirmedTransaction(nonce, gasLimit) + } + return nil, fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) CreateTransaction(_ context.Context, txRequest *types.TxRequest) (*types.Transaction, error) { + if store, exists := m.InMemoryStoreMap[txRequest.FromAddress]; exists { + return store.CreateTransaction(txRequest), nil + } + return nil, fmt.Errorf(StoreNotFoundForAddress, txRequest.FromAddress) +} + +func (m *InMemoryStoreManager) FetchUnconfirmedTransactionAtNonceWithCount(_ context.Context, nonce uint64, fromAddress common.Address) (tx *types.Transaction, count int, err error) { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + tx, count = store.FetchUnconfirmedTransactionAtNonceWithCount(nonce) + return + } + return nil, 0, fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) MarkConfirmedAndReorgedTransactions(_ context.Context, nonce uint64, fromAddress common.Address) (confirmedTxs []*types.Transaction, unconfirmedTxIDs []uint64, err error) { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + confirmedTxs, unconfirmedTxIDs, err = store.MarkConfirmedAndReorgedTransactions(nonce) + return + } + return nil, nil, fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) MarkUnconfirmedTransactionPurgeable(_ context.Context, nonce uint64, fromAddress common.Address) error { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.MarkUnconfirmedTransactionPurgeable(nonce) + } + return fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) UpdateTransactionBroadcast(_ context.Context, txID uint64, nonce uint64, attemptHash common.Hash, fromAddress common.Address) error { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.UpdateTransactionBroadcast(txID, nonce, attemptHash) + } + return fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) UpdateUnstartedTransactionWithNonce(_ context.Context, fromAddress common.Address, nonce uint64) (*types.Transaction, error) { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.UpdateUnstartedTransactionWithNonce(nonce) + } + return nil, fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) DeleteAttemptForUnconfirmedTx(_ context.Context, nonce uint64, attempt *types.Attempt, fromAddress common.Address) error { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.DeleteAttemptForUnconfirmedTx(nonce, attempt) + } + return fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) MarkTxFatal(_ context.Context, tx *types.Transaction, fromAddress common.Address) error { + if store, exists := m.InMemoryStoreMap[fromAddress]; exists { + return store.MarkTxFatal(tx) + } + return fmt.Errorf(StoreNotFoundForAddress, fromAddress) +} + +func (m *InMemoryStoreManager) FindTxWithIdempotencyKey(_ context.Context, idempotencyKey string) (*types.Transaction, error) { + for _, store := range m.InMemoryStoreMap { + tx := store.FindTxWithIdempotencyKey(idempotencyKey) + if tx != nil { + return tx, nil + } + } + return nil, nil +} diff --git a/core/chains/evm/txm/storage/inmemory_store_manager_test.go b/core/chains/evm/txm/storage/inmemory_store_manager_test.go new file mode 100644 index 00000000000..aff589fb9e1 --- /dev/null +++ b/core/chains/evm/txm/storage/inmemory_store_manager_test.go @@ -0,0 +1,36 @@ +package storage + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" +) + +func TestAdd(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + m := NewInMemoryStoreManager(logger.Test(t), testutils.FixtureChainID) + // Adds a new address + err := m.Add(fromAddress) + require.NoError(t, err) + assert.Len(t, m.InMemoryStoreMap, 1) + + // Fails if address exists + err = m.Add(fromAddress) + require.Error(t, err) + + // Adds multiple addresses + fromAddress1 := testutils.NewAddress() + fromAddress2 := testutils.NewAddress() + addresses := []common.Address{fromAddress1, fromAddress2} + err = m.Add(addresses...) + require.NoError(t, err) + assert.Len(t, m.InMemoryStoreMap, 3) +} diff --git a/core/chains/evm/txm/storage/inmemory_store_test.go b/core/chains/evm/txm/storage/inmemory_store_test.go new file mode 100644 index 00000000000..226cf284bba --- /dev/null +++ b/core/chains/evm/txm/storage/inmemory_store_test.go @@ -0,0 +1,559 @@ +package storage + +import ( + "fmt" + "math/big" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/common/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +func TestAbandonPendingTransactions(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + t.Run("abandons unstarted and unconfirmed transactions", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + // Unstarted + tx1 := insertUnstartedTransaction(m) + tx2 := insertUnstartedTransaction(m) + + // Unconfirmed + tx3, err := insertUnconfirmedTransaction(m, 3) + require.NoError(t, err) + tx4, err := insertUnconfirmedTransaction(m, 4) + require.NoError(t, err) + + m.AbandonPendingTransactions() + + assert.Equal(t, txmgr.TxFatalError, tx1.State) + assert.Equal(t, txmgr.TxFatalError, tx2.State) + assert.Equal(t, txmgr.TxFatalError, tx3.State) + assert.Equal(t, txmgr.TxFatalError, tx4.State) + }) + + t.Run("skips all types apart from unstarted and unconfirmed transactions", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + // Fatal + tx1 := insertFataTransaction(m) + tx2 := insertFataTransaction(m) + + // Confirmed + tx3, err := insertConfirmedTransaction(m, 3) + require.NoError(t, err) + tx4, err := insertConfirmedTransaction(m, 4) + require.NoError(t, err) + + m.AbandonPendingTransactions() + + assert.Equal(t, txmgr.TxFatalError, tx1.State) + assert.Equal(t, txmgr.TxFatalError, tx2.State) + assert.Equal(t, txmgr.TxConfirmed, tx3.State) + assert.Equal(t, txmgr.TxConfirmed, tx4.State) + assert.Len(t, m.Transactions, 2) // tx1, tx2 were dropped + }) +} + +func TestAppendAttemptToTransaction(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + + _, err := insertUnconfirmedTransaction(m, 10) // txID = 1, nonce = 10 + require.NoError(t, err) + _, err = insertConfirmedTransaction(m, 2) // txID = 2, nonce = 2 + require.NoError(t, err) + + t.Run("fails if corresponding unconfirmed transaction for attempt was not found", func(t *testing.T) { + var nonce uint64 = 1 + newAttempt := &types.Attempt{} + err := m.AppendAttemptToTransaction(nonce, newAttempt) + require.Error(t, err) + require.ErrorContains(t, err, "unconfirmed tx was not found") + }) + + t.Run("fails if unconfirmed transaction was found but doesn't match the txID", func(t *testing.T) { + var nonce uint64 = 10 + newAttempt := &types.Attempt{ + TxID: 2, + } + err := m.AppendAttemptToTransaction(nonce, newAttempt) + require.Error(t, err) + require.ErrorContains(t, err, "attempt points to a different txID") + }) + + t.Run("appends attempt to transaction", func(t *testing.T) { + var nonce uint64 = 10 + newAttempt := &types.Attempt{ + TxID: 1, + } + require.NoError(t, m.AppendAttemptToTransaction(nonce, newAttempt)) + tx, _ := m.FetchUnconfirmedTransactionAtNonceWithCount(10) + assert.Len(t, tx.Attempts, 1) + assert.Equal(t, uint16(1), tx.AttemptCount) + assert.False(t, tx.Attempts[0].CreatedAt.IsZero()) + }) +} + +func TestCountUnstartedTransactions(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + + assert.Equal(t, 0, m.CountUnstartedTransactions()) + + insertUnstartedTransaction(m) + assert.Equal(t, 1, m.CountUnstartedTransactions()) + + _, err := insertConfirmedTransaction(m, 10) + require.NoError(t, err) + assert.Equal(t, 1, m.CountUnstartedTransactions()) +} + +func TestCreateEmptyUnconfirmedTransaction(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + _, err := insertUnconfirmedTransaction(m, 1) + require.NoError(t, err) + _, err = insertConfirmedTransaction(m, 0) + require.NoError(t, err) + + t.Run("fails if unconfirmed transaction with the same nonce exists", func(t *testing.T) { + _, err := m.CreateEmptyUnconfirmedTransaction(1, 0) + require.Error(t, err) + }) + + t.Run("fails if confirmed transaction with the same nonce exists", func(t *testing.T) { + _, err := m.CreateEmptyUnconfirmedTransaction(0, 0) + require.Error(t, err) + }) + + t.Run("creates a new empty unconfirmed transaction", func(t *testing.T) { + tx, err := m.CreateEmptyUnconfirmedTransaction(2, 0) + require.NoError(t, err) + assert.Equal(t, txmgr.TxUnconfirmed, tx.State) + }) +} + +func TestCreateTransaction(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + + t.Run("creates new transactions", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + now := time.Now() + txR1 := &types.TxRequest{} + txR2 := &types.TxRequest{} + tx1 := m.CreateTransaction(txR1) + assert.Equal(t, uint64(0), tx1.ID) + assert.LessOrEqual(t, now, tx1.CreatedAt) + + tx2 := m.CreateTransaction(txR2) + assert.Equal(t, uint64(1), tx2.ID) + assert.LessOrEqual(t, now, tx2.CreatedAt) + + assert.Equal(t, 2, m.CountUnstartedTransactions()) + }) + + t.Run("prunes oldest unstarted transactions if limit is reached", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + overshot := 5 + for i := 0; i < maxQueuedTransactions+overshot; i++ { + r := &types.TxRequest{} + tx := m.CreateTransaction(r) + //nolint:gosec // this won't overflow + assert.Equal(t, uint64(i), tx.ID) + } + // total shouldn't exceed maxQueuedTransactions + assert.Equal(t, maxQueuedTransactions, m.CountUnstartedTransactions()) + // earliest tx ID should be the same amount of the number of transactions that we dropped + tx, err := m.UpdateUnstartedTransactionWithNonce(0) + require.NoError(t, err) + //nolint:gosec // this won't overflow + assert.Equal(t, uint64(overshot), tx.ID) + }) +} + +func TestFetchUnconfirmedTransactionAtNonceWithCount(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + + tx, count := m.FetchUnconfirmedTransactionAtNonceWithCount(0) + assert.Nil(t, tx) + assert.Equal(t, 0, count) + + var nonce uint64 + _, err := insertUnconfirmedTransaction(m, nonce) + require.NoError(t, err) + tx, count = m.FetchUnconfirmedTransactionAtNonceWithCount(0) + assert.Equal(t, *tx.Nonce, nonce) + assert.Equal(t, 1, count) +} + +func TestMarkConfirmedAndReorgedTransactions(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + + t.Run("returns 0 if there are no transactions", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + un, cn, err := m.MarkConfirmedAndReorgedTransactions(100) + require.NoError(t, err) + assert.Empty(t, un) + assert.Empty(t, cn) + }) + + t.Run("confirms transaction with nonce lower than the latest", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + ctx1, err := insertUnconfirmedTransaction(m, 0) + require.NoError(t, err) + + ctx2, err := insertUnconfirmedTransaction(m, 1) + require.NoError(t, err) + + ctxs, utxs, err := m.MarkConfirmedAndReorgedTransactions(1) + require.NoError(t, err) + assert.Equal(t, txmgr.TxConfirmed, ctx1.State) + assert.Equal(t, txmgr.TxUnconfirmed, ctx2.State) + assert.Equal(t, ctxs[0].ID, ctx1.ID) // Ensure order + assert.Empty(t, utxs) + }) + + t.Run("state remains the same if nonce didn't change", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + ctx1, err := insertConfirmedTransaction(m, 0) + require.NoError(t, err) + + ctx2, err := insertUnconfirmedTransaction(m, 1) + require.NoError(t, err) + + ctxs, utxs, err := m.MarkConfirmedAndReorgedTransactions(1) + require.NoError(t, err) + assert.Equal(t, txmgr.TxConfirmed, ctx1.State) + assert.Equal(t, txmgr.TxUnconfirmed, ctx2.State) + assert.Empty(t, ctxs) + assert.Empty(t, utxs) + }) + + t.Run("unconfirms transaction with nonce equal to or higher than the latest", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + ctx1, err := insertConfirmedTransaction(m, 0) + require.NoError(t, err) + + ctx2, err := insertConfirmedTransaction(m, 1) + require.NoError(t, err) + + ctxs, utxs, err := m.MarkConfirmedAndReorgedTransactions(1) + require.NoError(t, err) + assert.Equal(t, txmgr.TxConfirmed, ctx1.State) + assert.Equal(t, txmgr.TxUnconfirmed, ctx2.State) + assert.Equal(t, utxs[0], ctx2.ID) + assert.Empty(t, ctxs) + }) + + t.Run("logs an error during confirmation if a transaction with the same nonce already exists", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + m := NewInMemoryStore(lggr, fromAddress, testutils.FixtureChainID) + _, err := insertConfirmedTransaction(m, 0) + require.NoError(t, err) + _, err = insertUnconfirmedTransaction(m, 0) + require.NoError(t, err) + + _, _, err = m.MarkConfirmedAndReorgedTransactions(1) + require.NoError(t, err) + tests.AssertLogEventually(t, observedLogs, "Another confirmed transaction with the same nonce exists") + }) + + t.Run("prunes confirmed transactions map if it reaches the limit", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + overshot := 5 + for i := 0; i < maxQueuedTransactions+overshot; i++ { + //nolint:gosec // this won't overflow + _, err := insertConfirmedTransaction(m, uint64(i)) + require.NoError(t, err) + } + assert.Len(t, m.ConfirmedTransactions, maxQueuedTransactions+overshot) + //nolint:gosec // this won't overflow + _, _, err := m.MarkConfirmedAndReorgedTransactions(uint64(maxQueuedTransactions + overshot)) + require.NoError(t, err) + assert.Len(t, m.ConfirmedTransactions, 170) + }) +} + +func TestMarkUnconfirmedTransactionPurgeable(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + + // fails if tx was not found + err := m.MarkUnconfirmedTransactionPurgeable(0) + require.Error(t, err) + + tx, err := insertUnconfirmedTransaction(m, 0) + require.NoError(t, err) + err = m.MarkUnconfirmedTransactionPurgeable(0) + require.NoError(t, err) + assert.True(t, tx.IsPurgeable) +} + +func TestUpdateTransactionBroadcast(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + hash := testutils.NewHash() + t.Run("fails if unconfirmed transaction was not found", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + var nonce uint64 + require.Error(t, m.UpdateTransactionBroadcast(0, nonce, hash)) + }) + + t.Run("fails if attempt was not found for a given transaction", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + var nonce uint64 + tx, err := insertUnconfirmedTransaction(m, nonce) + require.NoError(t, err) + require.Error(t, m.UpdateTransactionBroadcast(0, nonce, hash)) + + // Attempt with different hash + attempt := &types.Attempt{TxID: tx.ID, Hash: testutils.NewHash()} + tx.Attempts = append(tx.Attempts, attempt) + require.Error(t, m.UpdateTransactionBroadcast(0, nonce, hash)) + }) + + t.Run("updates transaction's and attempt's broadcast times", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + var nonce uint64 + tx, err := insertUnconfirmedTransaction(m, nonce) + require.NoError(t, err) + attempt := &types.Attempt{TxID: tx.ID, Hash: hash} + tx.Attempts = append(tx.Attempts, attempt) + require.NoError(t, m.UpdateTransactionBroadcast(0, nonce, hash)) + assert.False(t, tx.LastBroadcastAt.IsZero()) + assert.False(t, attempt.BroadcastAt.IsZero()) + assert.False(t, tx.InitialBroadcastAt.IsZero()) + }) +} + +func TestUpdateUnstartedTransactionWithNonce(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + t.Run("returns nil if there are no unstarted transactions", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + tx, err := m.UpdateUnstartedTransactionWithNonce(0) + require.NoError(t, err) + assert.Nil(t, tx) + }) + + t.Run("fails if there is already another unconfirmed transaction with the same nonce", func(t *testing.T) { + var nonce uint64 + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + insertUnstartedTransaction(m) + _, err := insertUnconfirmedTransaction(m, nonce) + require.NoError(t, err) + + _, err = m.UpdateUnstartedTransactionWithNonce(nonce) + require.Error(t, err) + }) + + t.Run("updates unstarted transaction to unconfirmed and assigns a nonce", func(t *testing.T) { + var nonce uint64 + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + insertUnstartedTransaction(m) + + tx, err := m.UpdateUnstartedTransactionWithNonce(nonce) + require.NoError(t, err) + assert.Equal(t, nonce, *tx.Nonce) + assert.Equal(t, txmgr.TxUnconfirmed, tx.State) + assert.Empty(t, m.UnstartedTransactions) + }) +} + +func TestDeleteAttemptForUnconfirmedTx(t *testing.T) { + t.Parallel() + + fromAddress := testutils.NewAddress() + t.Run("fails if corresponding unconfirmed transaction for attempt was not found", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + var nonce uint64 + tx := &types.Transaction{Nonce: &nonce} + attempt := &types.Attempt{TxID: 0} + err := m.DeleteAttemptForUnconfirmedTx(*tx.Nonce, attempt) + require.Error(t, err) + }) + + t.Run("fails if corresponding unconfirmed attempt for txID was not found", func(t *testing.T) { + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + _, err := insertUnconfirmedTransaction(m, 0) + require.NoError(t, err) + + attempt := &types.Attempt{TxID: 2, Hash: testutils.NewHash()} + err = m.DeleteAttemptForUnconfirmedTx(0, attempt) + + require.Error(t, err) + }) + + t.Run("deletes attempt of unconfirmed transaction", func(t *testing.T) { + hash := testutils.NewHash() + var nonce uint64 + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + tx, err := insertUnconfirmedTransaction(m, nonce) + require.NoError(t, err) + + attempt := &types.Attempt{TxID: 0, Hash: hash} + tx.Attempts = append(tx.Attempts, attempt) + err = m.DeleteAttemptForUnconfirmedTx(nonce, attempt) + require.NoError(t, err) + + assert.Empty(t, tx.Attempts) + }) +} + +func TestFindTxWithIdempotencyKey(t *testing.T) { + t.Parallel() + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + tx, err := insertConfirmedTransaction(m, 0) + require.NoError(t, err) + + ik := "IK" + tx.IdempotencyKey = &ik + itx := m.FindTxWithIdempotencyKey(ik) + assert.Equal(t, ik, *itx.IdempotencyKey) + + uik := "Unknown" + itx = m.FindTxWithIdempotencyKey(uik) + assert.Nil(t, itx) +} + +func TestPruneConfirmedTransactions(t *testing.T) { + t.Parallel() + fromAddress := testutils.NewAddress() + m := NewInMemoryStore(logger.Test(t), fromAddress, testutils.FixtureChainID) + total := 5 + for i := 0; i < total; i++ { + //nolint:gosec // this won't overflow + _, err := insertConfirmedTransaction(m, uint64(i)) + require.NoError(t, err) + } + prunedTxIDs := m.pruneConfirmedTransactions() + left := total - total/pruneSubset + assert.Len(t, m.ConfirmedTransactions, left) + assert.Len(t, prunedTxIDs, total/pruneSubset) +} + +func insertUnstartedTransaction(m *InMemoryStore) *types.Transaction { + m.Lock() + defer m.Unlock() + + var nonce uint64 + m.txIDCount++ + tx := &types.Transaction{ + ID: m.txIDCount, + ChainID: testutils.FixtureChainID, + Nonce: &nonce, + FromAddress: m.address, + ToAddress: testutils.NewAddress(), + Value: big.NewInt(0), + SpecifiedGasLimit: 0, + CreatedAt: time.Now(), + State: txmgr.TxUnstarted, + } + + m.UnstartedTransactions = append(m.UnstartedTransactions, tx) + m.Transactions[tx.ID] = tx + return tx +} + +func insertUnconfirmedTransaction(m *InMemoryStore, nonce uint64) (*types.Transaction, error) { + m.Lock() + defer m.Unlock() + + m.txIDCount++ + tx := &types.Transaction{ + ID: m.txIDCount, + ChainID: testutils.FixtureChainID, + Nonce: &nonce, + FromAddress: m.address, + ToAddress: testutils.NewAddress(), + Value: big.NewInt(0), + SpecifiedGasLimit: 0, + CreatedAt: time.Now(), + State: txmgr.TxUnconfirmed, + } + + if _, exists := m.UnconfirmedTransactions[nonce]; exists { + return nil, fmt.Errorf("an unconfirmed tx with the same nonce already exists: %v", m.UnconfirmedTransactions[nonce]) + } + + m.UnconfirmedTransactions[nonce] = tx + m.Transactions[tx.ID] = tx + return tx, nil +} + +func insertConfirmedTransaction(m *InMemoryStore, nonce uint64) (*types.Transaction, error) { + m.Lock() + defer m.Unlock() + + m.txIDCount++ + tx := &types.Transaction{ + ID: m.txIDCount, + ChainID: testutils.FixtureChainID, + Nonce: &nonce, + FromAddress: m.address, + ToAddress: testutils.NewAddress(), + Value: big.NewInt(0), + SpecifiedGasLimit: 0, + CreatedAt: time.Now(), + State: txmgr.TxConfirmed, + } + + if _, exists := m.ConfirmedTransactions[nonce]; exists { + return nil, fmt.Errorf("a confirmed tx with the same nonce already exists: %v", m.ConfirmedTransactions[nonce]) + } + + m.ConfirmedTransactions[nonce] = tx + m.Transactions[tx.ID] = tx + return tx, nil +} + +func insertFataTransaction(m *InMemoryStore) *types.Transaction { + m.Lock() + defer m.Unlock() + + var nonce uint64 + m.txIDCount++ + tx := &types.Transaction{ + ID: m.txIDCount, + ChainID: testutils.FixtureChainID, + Nonce: &nonce, + FromAddress: m.address, + ToAddress: testutils.NewAddress(), + Value: big.NewInt(0), + SpecifiedGasLimit: 0, + CreatedAt: time.Now(), + State: txmgr.TxFatalError, + } + + m.FatalTransactions = append(m.FatalTransactions, tx) + m.Transactions[tx.ID] = tx + return tx +} diff --git a/core/chains/evm/txm/stuck_tx_detector.go b/core/chains/evm/txm/stuck_tx_detector.go new file mode 100644 index 00000000000..2da4ad4cd67 --- /dev/null +++ b/core/chains/evm/txm/stuck_tx_detector.go @@ -0,0 +1,123 @@ +package txm + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "time" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +type StuckTxDetectorConfig struct { + BlockTime time.Duration + StuckTxBlockThreshold uint32 + DetectionURL string + DualBroadcast bool +} + +type stuckTxDetector struct { + lggr logger.Logger + chainType chaintype.ChainType + config StuckTxDetectorConfig + lastPurgeMap map[common.Address]time.Time +} + +func NewStuckTxDetector(lggr logger.Logger, chaintype chaintype.ChainType, config StuckTxDetectorConfig) *stuckTxDetector { + return &stuckTxDetector{ + lggr: lggr, + chainType: chaintype, + config: config, + lastPurgeMap: make(map[common.Address]time.Time), + } +} + +func (s *stuckTxDetector) DetectStuckTransaction(ctx context.Context, tx *types.Transaction) (bool, error) { + //nolint:gocritic //placeholder for upcoming chaintypes + switch s.chainType { + default: + return s.timeBasedDetection(tx), nil + } +} + +// timeBasedDetection marks a transaction if all the following conditions are met: +// - LastBroadcastAt is not nil +// - Time since last broadcast is above the threshold +// - Time since last purge is above threshold +// +// NOTE: Potentially we can use a subset of threhsold for last purge check, because the transaction would have already been broadcasted to the mempool +// so it is more likely to be picked up compared to a transaction that hasn't been broadcasted before. This would avoid slowing down TXM for sebsequent transactions +// in case the current one is stuck. +func (s *stuckTxDetector) timeBasedDetection(tx *types.Transaction) bool { + threshold := (s.config.BlockTime * time.Duration(s.config.StuckTxBlockThreshold)) + if tx.LastBroadcastAt != nil && min(time.Since(*tx.LastBroadcastAt), time.Since(s.lastPurgeMap[tx.FromAddress])) > threshold { + s.lggr.Debugf("TxID: %v last broadcast was: %v and last purge: %v which is more than the max configured duration: %v. Transaction is now considered stuck and will be purged.", + tx.ID, tx.LastBroadcastAt, s.lastPurgeMap[tx.FromAddress], threshold) + s.lastPurgeMap[tx.FromAddress] = time.Now() + return true + } + return false +} + +type APIResponse struct { + Status string `json:"status,omitempty"` + Hash common.Hash `json:"hash,omitempty"` +} + +const ( + APIStatusPending = "PENDING" + APIStatusIncluded = "INCLUDED" + APIStatusFailed = "FAILED" + APIStatusCancelled = "CANCELLED" + APIStatusUnknown = "UNKNOWN" +) + +// Deprecated: DualBroadcastDetection doesn't provide any significant benefits in terms of speed and time +// based detection can replace it. +func (s *stuckTxDetector) DualBroadcastDetection(ctx context.Context, tx *types.Transaction) (bool, error) { + for _, attempt := range tx.Attempts { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, s.config.DetectionURL+attempt.Hash.String(), nil) + if err != nil { + return false, fmt.Errorf("failed to make request for txID: %v, attemptHash: %v - %w", tx.ID, attempt.Hash, err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return false, fmt.Errorf("failed to get transaction status for txID: %v, attemptHash: %v - %w", tx.ID, attempt.Hash, err) + } + if resp.StatusCode != http.StatusOK { + resp.Body.Close() + return false, fmt.Errorf("request %v failed with status: %d", req, resp.StatusCode) + } + body, err := io.ReadAll(resp.Body) + resp.Body.Close() + if err != nil { + return false, err + } + + var apiResponse APIResponse + err = json.Unmarshal(body, &apiResponse) + if err != nil { + return false, fmt.Errorf("failed to unmarshal response for txID: %v, attemptHash: %v - %w: %s", tx.ID, attempt.Hash, err, string(body)) + } + switch apiResponse.Status { + case APIStatusPending, APIStatusIncluded: + return false, nil + case APIStatusFailed, APIStatusCancelled: + s.lggr.Debugf("TxID: %v with attempHash: %v was marked as failed/cancelled by the RPC. Transaction is now considered stuck and will be purged.", + tx.ID, attempt.Hash) + return true, nil + case APIStatusUnknown: + continue + default: + continue + } + } + return false, nil +} diff --git a/core/chains/evm/txm/stuck_tx_detector_test.go b/core/chains/evm/txm/stuck_tx_detector_test.go new file mode 100644 index 00000000000..af5a765dcdb --- /dev/null +++ b/core/chains/evm/txm/stuck_tx_detector_test.go @@ -0,0 +1,80 @@ +package txm + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +func TestTimeBasedDetection(t *testing.T) { + t.Parallel() + + t.Run("returns false if transaction is not stuck", func(t *testing.T) { + config := StuckTxDetectorConfig{ + BlockTime: 10 * time.Second, + StuckTxBlockThreshold: 5, + } + fromAddress := testutils.NewAddress() + s := NewStuckTxDetector(logger.Test(t), "", config) + + // No previous broadcast + tx := &types.Transaction{ + ID: 1, + LastBroadcastAt: nil, + FromAddress: fromAddress, + } + assert.False(t, s.timeBasedDetection(tx)) + // Not enough time has passed since last broadcast + now := time.Now() + tx.LastBroadcastAt = &now + assert.False(t, s.timeBasedDetection(tx)) + // Not enough time has passed since last purge + tx.LastBroadcastAt = &time.Time{} + s.lastPurgeMap[fromAddress] = now + assert.False(t, s.timeBasedDetection(tx)) + }) + + t.Run("returns true if transaction is stuck", func(t *testing.T) { + config := StuckTxDetectorConfig{ + BlockTime: 10 * time.Second, + StuckTxBlockThreshold: 5, + } + fromAddress := testutils.NewAddress() + s := NewStuckTxDetector(logger.Test(t), "", config) + + tx := &types.Transaction{ + ID: 1, + LastBroadcastAt: &time.Time{}, + FromAddress: fromAddress, + } + assert.True(t, s.timeBasedDetection(tx)) + }) + + t.Run("marks first tx as stuck, updates purge time for address, and returns false for the second tx with the same broadcast time", func(t *testing.T) { + config := StuckTxDetectorConfig{ + BlockTime: 1 * time.Second, + StuckTxBlockThreshold: 10, + } + fromAddress := testutils.NewAddress() + s := NewStuckTxDetector(logger.Test(t), "", config) + + tx1 := &types.Transaction{ + ID: 1, + LastBroadcastAt: &time.Time{}, + FromAddress: fromAddress, + } + tx2 := &types.Transaction{ + ID: 2, + LastBroadcastAt: &time.Time{}, + FromAddress: fromAddress, + } + assert.True(t, s.timeBasedDetection(tx1)) + assert.False(t, s.timeBasedDetection(tx2)) + }) +} diff --git a/core/chains/evm/txm/txm.go b/core/chains/evm/txm/txm.go new file mode 100644 index 00000000000..c8b4b6f1688 --- /dev/null +++ b/core/chains/evm/txm/txm.go @@ -0,0 +1,447 @@ +package txm + +import ( + "context" + "fmt" + "math/big" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/jpillora/backoff" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/utils" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +const ( + broadcastInterval time.Duration = 30 * time.Second + maxInFlightTransactions int = 16 + maxInFlightSubset int = 5 + maxAllowedAttempts uint16 = 10 + pendingNonceDefaultTimeout time.Duration = 30 * time.Second + pendingNonceRecheckInterval time.Duration = 1 * time.Second +) + +type Client interface { + PendingNonceAt(context.Context, common.Address) (uint64, error) + NonceAt(context.Context, common.Address, *big.Int) (uint64, error) + SendTransaction(ctx context.Context, tx *types.Transaction, attempt *types.Attempt) error +} + +type TxStore interface { + AbandonPendingTransactions(context.Context, common.Address) error + AppendAttemptToTransaction(context.Context, uint64, common.Address, *types.Attempt) error + CreateEmptyUnconfirmedTransaction(context.Context, common.Address, uint64, uint64) (*types.Transaction, error) + CreateTransaction(context.Context, *types.TxRequest) (*types.Transaction, error) + FetchUnconfirmedTransactionAtNonceWithCount(context.Context, uint64, common.Address) (*types.Transaction, int, error) + MarkConfirmedAndReorgedTransactions(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error) + MarkUnconfirmedTransactionPurgeable(context.Context, uint64, common.Address) error + UpdateTransactionBroadcast(context.Context, uint64, uint64, common.Hash, common.Address) error + UpdateUnstartedTransactionWithNonce(context.Context, common.Address, uint64) (*types.Transaction, error) + + // ErrorHandler + DeleteAttemptForUnconfirmedTx(context.Context, uint64, *types.Attempt, common.Address) error + MarkTxFatal(context.Context, *types.Transaction, common.Address) error +} + +type AttemptBuilder interface { + NewAttempt(context.Context, logger.Logger, *types.Transaction, bool) (*types.Attempt, error) + NewBumpAttempt(context.Context, logger.Logger, *types.Transaction, types.Attempt) (*types.Attempt, error) +} + +type ErrorHandler interface { + HandleError(*types.Transaction, error, AttemptBuilder, Client, TxStore, func(common.Address, uint64), bool) (err error) +} + +type StuckTxDetector interface { + DetectStuckTransaction(ctx context.Context, tx *types.Transaction) (bool, error) +} + +type Keystore interface { + EnabledAddressesForChain(ctx context.Context, chainID *big.Int) (addresses []common.Address, err error) +} + +type Config struct { + EIP1559 bool + BlockTime time.Duration + RetryBlockThreshold uint16 + EmptyTxLimitDefault uint64 +} + +type Txm struct { + services.StateMachine + lggr logger.SugaredLogger + chainID *big.Int + client Client + attemptBuilder AttemptBuilder + errorHandler ErrorHandler + stuckTxDetector StuckTxDetector + txStore TxStore + keystore Keystore + config Config + metrics *txmMetrics + + nonceMapMu sync.RWMutex + nonceMap map[common.Address]uint64 + + triggerCh map[common.Address]chan struct{} + stopCh services.StopChan + wg sync.WaitGroup +} + +func NewTxm(lggr logger.Logger, chainID *big.Int, client Client, attemptBuilder AttemptBuilder, txStore TxStore, stuckTxDetector StuckTxDetector, config Config, keystore Keystore) *Txm { + return &Txm{ + lggr: logger.Sugared(logger.Named(lggr, "Txm")), + keystore: keystore, + chainID: chainID, + client: client, + attemptBuilder: attemptBuilder, + txStore: txStore, + stuckTxDetector: stuckTxDetector, + config: config, + nonceMap: make(map[common.Address]uint64), + triggerCh: make(map[common.Address]chan struct{}), + } +} + +func (t *Txm) Start(ctx context.Context) error { + return t.StartOnce("Txm", func() error { + tm, err := NewTxmMetrics(t.chainID) + if err != nil { + return err + } + t.metrics = tm + t.stopCh = make(chan struct{}) + + addresses, err := t.keystore.EnabledAddressesForChain(ctx, t.chainID) + if err != nil { + return err + } + for _, address := range addresses { + t.startAddress(address) + } + return nil + }) +} + +func (t *Txm) startAddress(address common.Address) { + triggerCh := make(chan struct{}, 1) + t.triggerCh[address] = triggerCh + + t.wg.Add(2) + go t.broadcastLoop(address, triggerCh) + go t.backfillLoop(address) +} + +func (t *Txm) initializeNonce(ctx context.Context, address common.Address) { + ctxWithTimeout, cancel := context.WithTimeout(ctx, pendingNonceDefaultTimeout) + defer cancel() + for { + pendingNonce, err := t.client.PendingNonceAt(ctxWithTimeout, address) + if err != nil { + t.lggr.Errorw("Error when fetching initial nonce", "address", address, "err", err) + select { + case <-time.After(pendingNonceRecheckInterval): + case <-ctx.Done(): + t.lggr.Errorw("context error", "err", context.Cause(ctx)) + return + } + continue + } + t.setNonce(address, pendingNonce) + t.lggr.Debugf("Set initial nonce for address: %v to %d", address, pendingNonce) + return + } +} + +func (t *Txm) Close() error { + return t.StopOnce("Txm", func() error { + close(t.stopCh) + t.wg.Wait() + return nil + }) +} + +func (t *Txm) HealthReport() map[string]error { + return map[string]error{t.lggr.Name(): t.Healthy()} +} + +func (t *Txm) CreateTransaction(ctx context.Context, txRequest *types.TxRequest) (tx *types.Transaction, err error) { + tx, err = t.txStore.CreateTransaction(ctx, txRequest) + if err == nil { + t.lggr.Infow("Created transaction", "tx", tx) + } + return +} + +func (t *Txm) Trigger(address common.Address) { + if !t.IfStarted(func() { + triggerCh, exists := t.triggerCh[address] + if !exists { + return + } + triggerCh <- struct{}{} + }) { + t.lggr.Error("Txm unstarted") + } +} + +func (t *Txm) Abandon(address common.Address) error { + // TODO: restart txm + t.lggr.Infof("Dropping unstarted and unconfirmed transactions for address: %v", address) + return t.txStore.AbandonPendingTransactions(context.TODO(), address) +} + +func (t *Txm) getNonce(address common.Address) uint64 { + t.nonceMapMu.RLock() + defer t.nonceMapMu.RUnlock() + return t.nonceMap[address] +} + +func (t *Txm) setNonce(address common.Address, nonce uint64) { + t.nonceMapMu.Lock() + t.nonceMap[address] = nonce + defer t.nonceMapMu.Unlock() +} + +func newBackoff(minDuration time.Duration) backoff.Backoff { + return backoff.Backoff{ + Min: minDuration, + Max: 1 * time.Minute, + Jitter: true, + } +} + +func (t *Txm) broadcastLoop(address common.Address, triggerCh chan struct{}) { + defer t.wg.Done() + ctx, cancel := t.stopCh.NewCtx() + defer cancel() + broadcastWithBackoff := newBackoff(1 * time.Second) + var broadcastCh <-chan time.Time + + t.initializeNonce(ctx, address) + + for { + start := time.Now() + bo, err := t.broadcastTransaction(ctx, address) + if err != nil { + t.lggr.Errorw("Error during transaction broadcasting", "err", err) + } else { + t.lggr.Debug("Transaction broadcasting time elapsed: ", time.Since(start)) + } + if bo { + broadcastCh = time.After(broadcastWithBackoff.Duration()) + } else { + broadcastWithBackoff.Reset() + broadcastCh = time.After(utils.WithJitter(broadcastInterval)) + } + select { + case <-ctx.Done(): + return + case <-triggerCh: + continue + case <-broadcastCh: + continue + } + } +} + +func (t *Txm) backfillLoop(address common.Address) { + defer t.wg.Done() + ctx, cancel := t.stopCh.NewCtx() + defer cancel() + backfillWithBackoff := newBackoff(t.config.BlockTime) + backfillCh := time.After(utils.WithJitter(t.config.BlockTime)) + + for { + select { + case <-ctx.Done(): + return + case <-backfillCh: + start := time.Now() + bo, err := t.backfillTransactions(ctx, address) + if err != nil { + t.lggr.Errorw("Error during backfill", "err", err) + } else { + t.lggr.Debug("Backfill time elapsed: ", time.Since(start)) + } + if bo { + backfillCh = time.After(backfillWithBackoff.Duration()) + } else { + backfillWithBackoff.Reset() + backfillCh = time.After(utils.WithJitter(t.config.BlockTime)) + } + } + } +} + +func (t *Txm) broadcastTransaction(ctx context.Context, address common.Address) (bool, error) { + for { + _, unconfirmedCount, err := t.txStore.FetchUnconfirmedTransactionAtNonceWithCount(ctx, 0, address) + if err != nil { + return false, err + } + + // Optimistically send up to maxInFlightSubset of the maxInFlightTransactions. After that threshold, broadcast more cautiously + // by checking the pending nonce so no more than maxInFlightSubset can get stuck simultaneously i.e. due + // to insufficient balance. We're making this trade-off to avoid storing stuck transactions and making unnecessary + // RPC calls. The upper limit is always maxInFlightTransactions regardless of the pending nonce. + if unconfirmedCount >= maxInFlightSubset { + if unconfirmedCount > maxInFlightTransactions { + t.lggr.Warnf("Reached transaction limit: %d for unconfirmed transactions", maxInFlightTransactions) + return true, nil + } + pendingNonce, e := t.client.PendingNonceAt(ctx, address) + if e != nil { + return false, e + } + nonce := t.getNonce(address) + if nonce > pendingNonce { + t.lggr.Warnf("Reached transaction limit. LocalNonce: %d, PendingNonce %d, unconfirmedCount: %d", + nonce, pendingNonce, unconfirmedCount) + return true, nil + } + } + + nonce := t.getNonce(address) + tx, err := t.txStore.UpdateUnstartedTransactionWithNonce(ctx, address, nonce) + if err != nil { + return false, err + } + if tx == nil { + return false, nil + } + t.setNonce(address, nonce+1) + + if err := t.createAndSendAttempt(ctx, tx, address); err != nil { + return false, err + } + } +} + +func (t *Txm) createAndSendAttempt(ctx context.Context, tx *types.Transaction, address common.Address) error { + attempt, err := t.attemptBuilder.NewAttempt(ctx, t.lggr, tx, t.config.EIP1559) + if err != nil { + return err + } + + if tx.Nonce == nil { + return fmt.Errorf("nonce for txID: %v is empty", tx.ID) + } + if err = t.txStore.AppendAttemptToTransaction(ctx, *tx.Nonce, address, attempt); err != nil { + return err + } + + return t.sendTransactionWithError(ctx, tx, attempt, address) +} + +func (t *Txm) sendTransactionWithError(ctx context.Context, tx *types.Transaction, attempt *types.Attempt, address common.Address) (err error) { + if tx.Nonce == nil { + return fmt.Errorf("nonce for txID: %v is empty", tx.ID) + } + start := time.Now() + txErr := t.client.SendTransaction(ctx, tx, attempt) + tx.AttemptCount++ + t.lggr.Infow("Broadcasted attempt", "tx", tx, "attempt", attempt, "duration", time.Since(start), "txErr: ", txErr) + if txErr != nil && t.errorHandler != nil { + if err = t.errorHandler.HandleError(tx, txErr, t.attemptBuilder, t.client, t.txStore, t.setNonce, false); err != nil { + return + } + } else if txErr != nil { + pendingNonce, err := t.client.PendingNonceAt(ctx, address) + if err != nil { + return err + } + if pendingNonce <= *tx.Nonce { + return fmt.Errorf("Pending nonce for txID: %v didn't increase. PendingNonce: %d, TxNonce: %d. TxErr: %w", tx.ID, pendingNonce, *tx.Nonce, txErr) + } + } + + t.metrics.IncrementNumBroadcastedTxs(ctx) + return t.txStore.UpdateTransactionBroadcast(ctx, attempt.TxID, *tx.Nonce, attempt.Hash, address) +} + +func (t *Txm) backfillTransactions(ctx context.Context, address common.Address) (bool, error) { + latestNonce, err := t.client.NonceAt(ctx, address, nil) + if err != nil { + return false, err + } + + confirmedTransactions, unconfirmedTransactionIDs, err := t.txStore.MarkConfirmedAndReorgedTransactions(ctx, latestNonce, address) + if err != nil { + return false, err + } + if len(confirmedTransactions) > 0 || len(unconfirmedTransactionIDs) > 0 { + t.metrics.IncrementNumConfirmedTxs(ctx, len(confirmedTransactions)) + confirmedTransactionIDs := t.extractMetrics(ctx, confirmedTransactions) + t.lggr.Infof("Confirmed transaction IDs: %v . Re-orged transaction IDs: %v", confirmedTransactionIDs, unconfirmedTransactionIDs) + } + + tx, unconfirmedCount, err := t.txStore.FetchUnconfirmedTransactionAtNonceWithCount(ctx, latestNonce, address) + if err != nil { + return false, err + } + if unconfirmedCount == 0 { + t.lggr.Debugf("All transactions confirmed for address: %v", address) + return false, err // TODO: add backoff to optimize requests + } + + if tx == nil || *tx.Nonce != latestNonce { + t.lggr.Warnf("Nonce gap at nonce: %d - address: %v. Creating a new transaction\n", latestNonce, address) + t.metrics.IncrementNumNonceGaps(ctx) + return false, t.createAndSendEmptyTx(ctx, latestNonce, address) + } else { //nolint:revive //easier to read + if !tx.IsPurgeable && t.stuckTxDetector != nil { + isStuck, err := t.stuckTxDetector.DetectStuckTransaction(ctx, tx) + if err != nil { + return false, err + } + if isStuck { + tx.IsPurgeable = true + err = t.txStore.MarkUnconfirmedTransactionPurgeable(ctx, *tx.Nonce, address) + if err != nil { + return false, err + } + t.lggr.Infof("Marked tx as purgeable. Sending purge attempt for txID: %d", tx.ID) + return false, t.createAndSendAttempt(ctx, tx, address) + } + } + + if tx.AttemptCount >= maxAllowedAttempts { + return true, fmt.Errorf("reached max allowed attempts for txID: %d. TXM won't broadcast any more attempts."+ + "If this error persists, it means the transaction won't be confirmed and the TXM needs to be restarted."+ + "Look for any error messages from previous broadcasted attempts that may indicate why this happened, i.e. wallet is out of funds. Tx: %v", tx.ID, + tx.PrintWithAttempts()) + } + + if tx.LastBroadcastAt == nil || time.Since(*tx.LastBroadcastAt) > (t.config.BlockTime*time.Duration(t.config.RetryBlockThreshold)) { + // TODO: add optional graceful bumping strategy + t.lggr.Info("Rebroadcasting attempt for txID: ", tx.ID) + return false, t.createAndSendAttempt(ctx, tx, address) + } + } + return false, nil +} + +func (t *Txm) createAndSendEmptyTx(ctx context.Context, latestNonce uint64, address common.Address) error { + tx, err := t.txStore.CreateEmptyUnconfirmedTransaction(ctx, address, latestNonce, t.config.EmptyTxLimitDefault) + if err != nil { + return err + } + return t.createAndSendAttempt(ctx, tx, address) +} + +func (t *Txm) extractMetrics(ctx context.Context, txs []*types.Transaction) []uint64 { + confirmedTxIDs := make([]uint64, 0, len(txs)) + for _, tx := range txs { + confirmedTxIDs = append(confirmedTxIDs, tx.ID) + if tx.InitialBroadcastAt != nil { + t.metrics.RecordTimeUntilTxConfirmed(ctx, float64(time.Since(*tx.InitialBroadcastAt))) + } + } + return confirmedTxIDs +} diff --git a/core/chains/evm/txm/txm_test.go b/core/chains/evm/txm/txm_test.go new file mode 100644 index 00000000000..af77f3ac084 --- /dev/null +++ b/core/chains/evm/txm/txm_test.go @@ -0,0 +1,327 @@ +package txm + +import ( + "errors" + "fmt" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/storage" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +func TestLifecycle(t *testing.T) { + t.Parallel() + + client := mocks.NewClient(t) + ab := mocks.NewAttemptBuilder(t) + address1 := testutils.NewAddress() + address2 := testutils.NewAddress() + assert.NotEqual(t, address1, address2) + addresses := []common.Address{address1, address2} + keystore := mocks.NewKeystore(t) + + t.Run("retries if initial pending nonce call fails", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + config := Config{BlockTime: 1 * time.Minute} + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(address1)) + keystore.On("EnabledAddressesForChain", mock.Anything, mock.Anything).Return([]common.Address{address1}, nil).Once() + txm := NewTxm(lggr, testutils.FixtureChainID, client, nil, txStore, nil, config, keystore) + client.On("PendingNonceAt", mock.Anything, address1).Return(uint64(0), errors.New("error")).Once() + client.On("PendingNonceAt", mock.Anything, address1).Return(uint64(100), nil).Once() + require.NoError(t, txm.Start(tests.Context(t))) + tests.AssertLogEventually(t, observedLogs, "Error when fetching initial nonce") + tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("Set initial nonce for address: %v to %d", address1, 100)) + }) + + t.Run("tests lifecycle successfully without any transactions", func(t *testing.T) { + config := Config{BlockTime: 200 * time.Millisecond} + keystore.On("EnabledAddressesForChain", mock.Anything, mock.Anything).Return(addresses, nil).Once() + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(addresses...)) + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) + var nonce uint64 + // Start + client.On("PendingNonceAt", mock.Anything, address1).Return(nonce, nil).Once() + client.On("PendingNonceAt", mock.Anything, address2).Return(nonce, nil).Once() + // backfill loop (may or may not be executed multiple times) + client.On("NonceAt", mock.Anything, address1, mock.Anything).Return(nonce, nil).Maybe() + client.On("NonceAt", mock.Anything, address2, mock.Anything).Return(nonce, nil).Maybe() + + servicetest.Run(t, txm) + tests.AssertLogEventually(t, observedLogs, "Backfill time elapsed") + }) +} + +func TestTrigger(t *testing.T) { + t.Parallel() + + address := testutils.NewAddress() + keystore := mocks.NewKeystore(t) + t.Run("Trigger fails if Txm is unstarted", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) + txm := NewTxm(lggr, nil, nil, nil, nil, nil, Config{}, keystore) + txm.Trigger(address) + tests.AssertLogEventually(t, observedLogs, "Txm unstarted") + }) + + t.Run("executes Trigger", func(t *testing.T) { + lggr := logger.Test(t) + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(address)) + client := mocks.NewClient(t) + ab := mocks.NewAttemptBuilder(t) + config := Config{BlockTime: 1 * time.Minute, RetryBlockThreshold: 10} + keystore.On("EnabledAddressesForChain", mock.Anything, mock.Anything).Return([]common.Address{address}, nil) + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) + var nonce uint64 + // Start + client.On("PendingNonceAt", mock.Anything, address).Return(nonce, nil).Maybe() + servicetest.Run(t, txm) + txm.Trigger(address) + }) +} + +func TestBroadcastTransaction(t *testing.T) { + t.Parallel() + + ctx := tests.Context(t) + client := mocks.NewClient(t) + ab := mocks.NewAttemptBuilder(t) + config := Config{} + address := testutils.NewAddress() + keystore := mocks.NewKeystore(t) + + t.Run("fails if FetchUnconfirmedTransactionAtNonceWithCount for unconfirmed transactions fails", func(t *testing.T) { + mTxStore := mocks.NewTxStore(t) + mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, 0, errors.New("call failed")).Once() + txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) + bo, err := txm.broadcastTransaction(ctx, address) + require.Error(t, err) + assert.False(t, bo) + require.ErrorContains(t, err, "call failed") + }) + + t.Run("throws a warning and returns if unconfirmed transactions exceed maxInFlightTransactions", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + mTxStore := mocks.NewTxStore(t) + mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, maxInFlightTransactions+1, nil).Once() + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) + bo, err := txm.broadcastTransaction(ctx, address) + assert.True(t, bo) + require.NoError(t, err) + tests.AssertLogEventually(t, observedLogs, "Reached transaction limit") + }) + + t.Run("checks pending nonce if unconfirmed transactions are equal or more than maxInFlightSubset", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + mTxStore := mocks.NewTxStore(t) + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) + txm.setNonce(address, 1) + mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, maxInFlightSubset, nil).Twice() + + client.On("PendingNonceAt", mock.Anything, address).Return(uint64(0), nil).Once() // LocalNonce: 1, PendingNonce: 0 + bo, err := txm.broadcastTransaction(ctx, address) + assert.True(t, bo) + require.NoError(t, err) + + client.On("PendingNonceAt", mock.Anything, address).Return(uint64(1), nil).Once() // LocalNonce: 1, PendingNonce: 1 + mTxStore.On("UpdateUnstartedTransactionWithNonce", mock.Anything, mock.Anything, mock.Anything).Return(nil, nil).Once() + bo, err = txm.broadcastTransaction(ctx, address) + assert.False(t, bo) + require.NoError(t, err) + tests.AssertLogCountEventually(t, observedLogs, "Reached transaction limit.", 1) + }) + + t.Run("fails if UpdateUnstartedTransactionWithNonce fails", func(t *testing.T) { + mTxStore := mocks.NewTxStore(t) + mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, 0, nil).Once() + txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) + mTxStore.On("UpdateUnstartedTransactionWithNonce", mock.Anything, mock.Anything, mock.Anything).Return(nil, errors.New("call failed")).Once() + bo, err := txm.broadcastTransaction(ctx, address) + assert.False(t, bo) + require.Error(t, err) + require.ErrorContains(t, err, "call failed") + }) + + t.Run("returns if there are no unstarted transactions", func(t *testing.T) { + lggr := logger.Test(t) + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(address)) + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) + bo, err := txm.broadcastTransaction(ctx, address) + require.NoError(t, err) + assert.False(t, bo) + assert.Equal(t, uint64(0), txm.getNonce(address)) + }) + + t.Run("picks a new tx and creates a new attempt then sends it and updates the broadcast time", func(t *testing.T) { + lggr := logger.Test(t) + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(address)) + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) + txm.setNonce(address, 8) + metrics, err := NewTxmMetrics(testutils.FixtureChainID) + require.NoError(t, err) + txm.metrics = metrics + IDK := "IDK" + txRequest := &types.TxRequest{ + Data: []byte{100, 200}, + IdempotencyKey: &IDK, + ChainID: testutils.FixtureChainID, + FromAddress: address, + ToAddress: testutils.NewAddress(), + SpecifiedGasLimit: 22000, + } + tx, err := txm.CreateTransaction(tests.Context(t), txRequest) + require.NoError(t, err) + attempt := &types.Attempt{ + TxID: tx.ID, + Fee: gas.EvmFee{GasPrice: assets.NewWeiI(1)}, + GasLimit: 22000, + } + ab.On("NewAttempt", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(attempt, nil).Once() + client.On("SendTransaction", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once() + + bo, err := txm.broadcastTransaction(ctx, address) + require.NoError(t, err) + assert.False(t, bo) + assert.Equal(t, uint64(9), txm.getNonce(address)) + tx, err = txStore.FindTxWithIdempotencyKey(tests.Context(t), IDK) + require.NoError(t, err) + assert.Len(t, tx.Attempts, 1) + var zeroTime time.Time + assert.Greater(t, *tx.LastBroadcastAt, zeroTime) + assert.Greater(t, *tx.Attempts[0].BroadcastAt, zeroTime) + assert.Greater(t, *tx.InitialBroadcastAt, zeroTime) + }) +} + +func TestBackfillTransactions(t *testing.T) { + t.Parallel() + + ctx := tests.Context(t) + client := mocks.NewClient(t) + ab := mocks.NewAttemptBuilder(t) + txStore := mocks.NewTxStore(t) + config := Config{} + address := testutils.NewAddress() + keystore := mocks.NewKeystore(t) + + t.Run("fails if latest nonce fetching fails", func(t *testing.T) { + txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) + client.On("NonceAt", mock.Anything, address, mock.Anything).Return(uint64(0), errors.New("latest nonce fail")).Once() + bo, err := txm.backfillTransactions(ctx, address) + require.Error(t, err) + assert.False(t, bo) + require.ErrorContains(t, err, "latest nonce fail") + }) + + t.Run("fails if MarkConfirmedAndReorgedTransactions fails", func(t *testing.T) { + txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) + client.On("NonceAt", mock.Anything, address, mock.Anything).Return(uint64(0), nil).Once() + txStore.On("MarkConfirmedAndReorgedTransactions", mock.Anything, mock.Anything, address). + Return([]*types.Transaction{}, []uint64{}, errors.New("marking transactions confirmed failed")).Once() + bo, err := txm.backfillTransactions(ctx, address) + require.Error(t, err) + assert.False(t, bo) + require.ErrorContains(t, err, "marking transactions confirmed failed") + }) + + t.Run("fills nonce gap", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(address)) + ab := mocks.NewAttemptBuilder(t) + c := Config{EIP1559: false, BlockTime: 10 * time.Minute, RetryBlockThreshold: 10, EmptyTxLimitDefault: 22000} + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, c, keystore) + emptyMetrics, err := NewTxmMetrics(testutils.FixtureChainID) + require.NoError(t, err) + txm.metrics = emptyMetrics + + // Add a new transaction that will be assigned with nonce = 1. Nonce = 0 is not being tracked by the txStore. This will trigger a nonce gap. + txRequest := &types.TxRequest{ + ChainID: testutils.FixtureChainID, + FromAddress: address, + ToAddress: testutils.NewAddress(), + } + _, err = txm.CreateTransaction(tests.Context(t), txRequest) + require.NoError(t, err) + _, err = txStore.UpdateUnstartedTransactionWithNonce(tests.Context(t), address, 1) // Create nonce gap + require.NoError(t, err) + + // During backfill we observe nonce has changed. The transaction with nonce = 1 should be marked unconfirmed. + // For nonce = 0 there are no transactions stored in txStore, which results in a nonce gap. + // TXM creates a new empty transaction and fills the gap. + client.On("NonceAt", mock.Anything, address, mock.Anything).Return(uint64(0), nil).Once() + attempt := &types.Attempt{ + TxID: 1, + Fee: gas.EvmFee{GasPrice: assets.NewWeiI(1)}, + GasLimit: 22000, + } + ab.On("NewAttempt", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(attempt, nil).Once() + client.On("SendTransaction", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once() + bo, err := txm.backfillTransactions(ctx, address) + require.NoError(t, err) + assert.False(t, bo) + tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("Nonce gap at nonce: %d - address: %v. Creating a new transaction", 0, address)) + _, count, err := txStore.FetchUnconfirmedTransactionAtNonceWithCount(ctx, 0, address) + require.NoError(t, err) + assert.Equal(t, 2, count) + }) + + t.Run("retries attempt after threshold", func(t *testing.T) { + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) + require.NoError(t, txStore.Add(address)) + ab := mocks.NewAttemptBuilder(t) + c := Config{EIP1559: false, BlockTime: 1 * time.Second, RetryBlockThreshold: 1, EmptyTxLimitDefault: 22000} + txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, c, keystore) + emptyMetrics, err := NewTxmMetrics(testutils.FixtureChainID) + require.NoError(t, err) + txm.metrics = emptyMetrics + + IDK := "IDK" + txRequest := &types.TxRequest{ + Data: []byte{100, 200}, + IdempotencyKey: &IDK, + ChainID: testutils.FixtureChainID, + FromAddress: address, + ToAddress: testutils.NewAddress(), + SpecifiedGasLimit: 22000, + } + tx, err := txm.CreateTransaction(tests.Context(t), txRequest) + require.NoError(t, err) + _, err = txStore.UpdateUnstartedTransactionWithNonce(tests.Context(t), address, 0) + require.NoError(t, err) + + attempt := &types.Attempt{ + TxID: tx.ID, + Fee: gas.EvmFee{GasPrice: assets.NewWeiI(1)}, + GasLimit: 22000, + } + ab.On("NewAttempt", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(attempt, nil).Once() + + client.On("NonceAt", mock.Anything, address, mock.Anything).Return(uint64(0), nil).Once() + client.On("SendTransaction", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once() + _, err = txm.backfillTransactions(tests.Context(t), address) + require.NoError(t, err) + tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("Rebroadcasting attempt for txID: %d", attempt.TxID)) + }) +} diff --git a/core/chains/evm/txm/types/transaction.go b/core/chains/evm/txm/types/transaction.go new file mode 100644 index 00000000000..1d1104545d4 --- /dev/null +++ b/core/chains/evm/txm/types/transaction.go @@ -0,0 +1,192 @@ +package types + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "math/big" + "time" + + "github.com/google/uuid" + "gopkg.in/guregu/null.v4" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + clnull "github.com/smartcontractkit/chainlink-common/pkg/utils/null" + + commontypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" +) + +type Transaction struct { + ID uint64 + IdempotencyKey *string + ChainID *big.Int + Nonce *uint64 + FromAddress common.Address + ToAddress common.Address + Value *big.Int + Data []byte + SpecifiedGasLimit uint64 + + CreatedAt time.Time + InitialBroadcastAt *time.Time + LastBroadcastAt *time.Time + + State commontypes.TxState + IsPurgeable bool + Attempts []*Attempt + AttemptCount uint16 // AttempCount is strictly kept in memory and prevents indefinite retrying + Meta *sqlutil.JSON + Subject uuid.NullUUID + + // Pipeline variables - if you aren't calling this from chain tx task within + // the pipeline, you don't need these variables + PipelineTaskRunID uuid.NullUUID + MinConfirmations clnull.Uint32 + SignalCallback bool + CallbackCompleted bool +} + +func (t *Transaction) String() string { + return fmt.Sprintf(`{txID:%d, IdempotencyKey:%v, ChainID:%v, Nonce:%s, FromAddress:%v, ToAddress:%v, Value:%v, `+ + `Data:%s, SpecifiedGasLimit:%d, CreatedAt:%v, InitialBroadcastAt:%v, LastBroadcastAt:%v, State:%v, IsPurgeable:%v, AttemptCount:%d, `+ + `Meta:%v, Subject:%v}`, + t.ID, stringOrNull(t.IdempotencyKey), t.ChainID, stringOrNull(t.Nonce), t.FromAddress, t.ToAddress, t.Value, + base64.StdEncoding.EncodeToString(t.Data), t.SpecifiedGasLimit, t.CreatedAt, stringOrNull(t.InitialBroadcastAt), stringOrNull(t.LastBroadcastAt), + t.State, t.IsPurgeable, t.AttemptCount, t.Meta, t.Subject) +} + +func stringOrNull[T any](t *T) string { + if t != nil { + return fmt.Sprintf("%v", *t) + } + return "null" +} + +func (t *Transaction) PrintWithAttempts() string { + attempts := " Attempts: [" + for _, a := range t.Attempts { + attempts += a.String() + ", " + } + attempts += "]" + + return t.String() + attempts +} + +func (t *Transaction) FindAttemptByHash(attemptHash common.Hash) (*Attempt, error) { + for _, a := range t.Attempts { + if a.Hash == attemptHash { + return a, nil + } + } + return nil, fmt.Errorf("attempt with hash: %v was not found", attemptHash) +} + +func (t *Transaction) DeepCopy() *Transaction { + txCopy := *t + attemptsCopy := make([]*Attempt, 0, len(t.Attempts)) + for _, attempt := range t.Attempts { + attemptsCopy = append(attemptsCopy, attempt.DeepCopy()) + } + txCopy.Attempts = attemptsCopy + return &txCopy +} + +func (t *Transaction) GetMeta() (*TxMeta, error) { + if t.Meta == nil { + return nil, nil + } + var m TxMeta + if err := json.Unmarshal(*t.Meta, &m); err != nil { + return nil, fmt.Errorf("unmarshalling meta: %w", err) + } + return &m, nil +} + +type Attempt struct { + ID uint64 + TxID uint64 + Hash common.Hash + Fee gas.EvmFee + GasLimit uint64 + Type byte + SignedTransaction *types.Transaction + + CreatedAt time.Time + BroadcastAt *time.Time +} + +func (a *Attempt) DeepCopy() *Attempt { + txCopy := *a + if a.SignedTransaction != nil { + txCopy.SignedTransaction = a.SignedTransaction.WithoutBlobTxSidecar() + } + return &txCopy +} + +func (a *Attempt) String() string { + return fmt.Sprintf(`{ID:%d, TxID:%d, Hash:%v, Fee:%v, GasLimit:%d, Type:%v, CreatedAt:%v, BroadcastAt:%v}`, + a.ID, a.TxID, a.Hash, a.Fee, a.GasLimit, a.Type, a.CreatedAt, stringOrNull(a.BroadcastAt)) +} + +type TxRequest struct { + IdempotencyKey *string + ChainID *big.Int + FromAddress common.Address + ToAddress common.Address + Value *big.Int + Data []byte + SpecifiedGasLimit uint64 + + Meta *sqlutil.JSON // TODO: *TxMeta after migration + ForwarderAddress common.Address + + // Pipeline variables - if you aren't calling this from chain tx task within + // the pipeline, you don't need these variables + PipelineTaskRunID uuid.NullUUID + MinConfirmations clnull.Uint32 + SignalCallback bool +} + +type TxMeta struct { + // Pipeline + JobID *int32 `json:"JobID,omitempty"` + FailOnRevert null.Bool `json:"FailOnRevert,omitempty"` + + // VRF + RequestID *common.Hash `json:"RequestID,omitempty"` + RequestTxHash *common.Hash `json:"RequestTxHash,omitempty"` + RequestIDs []common.Hash `json:"RequestIDs,omitempty"` + RequestTxHashes []common.Hash `json:"RequestTxHashes,omitempty"` + MaxLink *string `json:"MaxLink,omitempty"` + SubID *uint64 `json:"SubId,omitempty"` + GlobalSubID *string `json:"GlobalSubId,omitempty"` + MaxEth *string `json:"MaxEth,omitempty"` + ForceFulfilled *bool `json:"ForceFulfilled,omitempty"` + ForceFulfillmentAttempt *uint64 `json:"ForceFulfillmentAttempt,omitempty"` + + // Used for keepers + UpkeepID *string `json:"UpkeepID,omitempty"` + + // Used for Keystone Workflows + WorkflowExecutionID *string `json:"WorkflowExecutionID,omitempty"` + + // Forwarders + FwdrDestAddress *common.Address `json:"ForwarderDestAddress,omitempty"` + + // CCIP + MessageIDs []string `json:"MessageIDs,omitempty"` + SeqNumbers []uint64 `json:"SeqNumbers,omitempty"` + + // Dual Broadcast + DualBroadcast *bool `json:"DualBroadcast,omitempty"` + DualBroadcastParams *string `json:"DualBroadcastParams,omitempty"` +} + +type QueueingTxStrategy struct { + QueueSize uint32 + Subject uuid.NullUUID +} diff --git a/core/chains/evm/txmgr/builder.go b/core/chains/evm/txmgr/builder.go index 73c5614aba3..4a09d16d214 100644 --- a/core/chains/evm/txmgr/builder.go +++ b/core/chains/evm/txmgr/builder.go @@ -18,6 +18,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/clientwrappers" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/storage" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -91,6 +94,56 @@ func NewEvmTxm( return txmgr.NewTxm(chainId, cfg, txCfg, keyStore, lggr, checkerFactory, fwdMgr, txAttemptBuilder, txStore, broadcaster, confirmer, resender, tracker, finalizer, client.NewTxError) } +func NewTxmV2( + ds sqlutil.DataSource, + chainConfig ChainConfig, + fCfg FeeConfig, + txConfig config.Transactions, + txmV2Config config.TransactionManagerV2, + client client.Client, + lggr logger.Logger, + logPoller logpoller.LogPoller, + keyStore keystore.Eth, + estimator gas.EvmFeeEstimator, +) (TxManager, error) { + var fwdMgr *forwarders.FwdMgr + if txConfig.ForwardersEnabled() { + fwdMgr = forwarders.NewFwdMgr(ds, client, logPoller, lggr, chainConfig) + } else { + lggr.Info("ForwarderManager: Disabled") + } + + chainID := client.ConfiguredChainID() + + var stuckTxDetector txm.StuckTxDetector + if txConfig.AutoPurge().Enabled() { + stuckTxDetectorConfig := txm.StuckTxDetectorConfig{ + BlockTime: *txmV2Config.BlockTime(), + StuckTxBlockThreshold: *txConfig.AutoPurge().Threshold(), + DetectionURL: txConfig.AutoPurge().DetectionApiUrl().String(), + } + stuckTxDetector = txm.NewStuckTxDetector(lggr, chainConfig.ChainType(), stuckTxDetectorConfig) + } + + attemptBuilder := txm.NewAttemptBuilder(chainID, fCfg.PriceMaxKey, estimator, keyStore) + inMemoryStoreManager := storage.NewInMemoryStoreManager(lggr, chainID) + config := txm.Config{ + EIP1559: fCfg.EIP1559DynamicFees(), + BlockTime: *txmV2Config.BlockTime(), + //nolint:gosec // reuse existing config until migration + RetryBlockThreshold: uint16(fCfg.BumpThreshold()), + EmptyTxLimitDefault: fCfg.LimitDefault(), + } + var c txm.Client + if txmV2Config.DualBroadcast() != nil && *txmV2Config.DualBroadcast() { + c = clientwrappers.NewDualBroadcastClient(client, keyStore, txmV2Config.CustomURL()) + } else { + c = clientwrappers.NewChainClient(client) + } + t := txm.NewTxm(lggr, chainID, c, attemptBuilder, inMemoryStoreManager, stuckTxDetector, config, keyStore) + return txm.NewTxmOrchestrator(lggr, chainID, t, inMemoryStoreManager, fwdMgr, keyStore, attemptBuilder), nil +} + // NewEvmResender creates a new concrete EvmResender func NewEvmResender( lggr logger.Logger, diff --git a/core/chains/legacyevm/evm_txm.go b/core/chains/legacyevm/evm_txm.go index 17dbce79e84..15731790f67 100644 --- a/core/chains/legacyevm/evm_txm.go +++ b/core/chains/legacyevm/evm_txm.go @@ -40,20 +40,35 @@ func newEvmTxm( ) if opts.GenTxManager == nil { - txm, err = txmgr.NewTxm( - ds, - cfg, - txmgr.NewEvmTxmFeeConfig(cfg.GasEstimator()), - cfg.Transactions(), - cfg.NodePool().Errors(), - databaseConfig, - listenerConfig, - client, - lggr, - logPoller, - opts.KeyStore, - estimator, - headTracker) + if cfg.Transactions().TransactionManagerV2().Enabled() { + txm, err = txmgr.NewTxmV2( + ds, + cfg, + txmgr.NewEvmTxmFeeConfig(cfg.GasEstimator()), + cfg.Transactions(), + cfg.Transactions().TransactionManagerV2(), + client, + lggr, + logPoller, + opts.KeyStore, + estimator, + ) + } else { + txm, err = txmgr.NewTxm( + ds, + cfg, + txmgr.NewEvmTxmFeeConfig(cfg.GasEstimator()), + cfg.Transactions(), + cfg.NodePool().Errors(), + databaseConfig, + listenerConfig, + client, + lggr, + logPoller, + opts.KeyStore, + estimator, + headTracker) + } } else { txm = opts.GenTxManager(chainID) } diff --git a/core/config/docs/chains-evm.toml b/core/config/docs/chains-evm.toml index e8adb3d611c..bdcb0e8c5d4 100644 --- a/core/config/docs/chains-evm.toml +++ b/core/config/docs/chains-evm.toml @@ -141,6 +141,16 @@ Threshold = 5 # Example # MinAttempts configures the minimum number of broadcasted attempts a transaction has to have before it is evaluated further for being terminally stuck. This threshold is only applied if there is no custom API to identify stuck transactions provided by the chain. Ensure the gas estimator configs take more bump attempts before reaching the configured max gas price. MinAttempts = 3 # Example +[EVM.Transactions.TransactionManagerV2] +# Enabled enables TransactionManagerV2. +Enabled = false # Default +# BlockTime controls the frequency of the backfill loop of TransactionManagerV2. +BlockTime = '10s' # Example +# CustomURL configures the base url of a custom endpoint used by the ChainDualBroadcast chain type. +CustomURL = 'https://example.api.io' # Example +# DualBroadcast enables DualBroadcast functionality. +DualBroadcast = false # Example + [EVM.BalanceMonitor] # Enabled balance monitoring for all keys. Enabled = true # Default diff --git a/core/config/docs/docs_test.go b/core/config/docs/docs_test.go index 9fca08ee99b..bc171caf8c1 100644 --- a/core/config/docs/docs_test.go +++ b/core/config/docs/docs_test.go @@ -97,6 +97,11 @@ func TestDoc(t *testing.T) { docDefaults.Transactions.AutoPurge.Threshold = nil docDefaults.Transactions.AutoPurge.MinAttempts = nil + // TransactionManagerV2 configs are only set if the feature is enabled + docDefaults.Transactions.TransactionManagerV2.BlockTime = nil + docDefaults.Transactions.TransactionManagerV2.CustomURL = nil + docDefaults.Transactions.TransactionManagerV2.DualBroadcast = nil + // Fallback DA oracle is not set docDefaults.GasEstimator.DAOracle = evmcfg.DAOracle{} diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 0e64fa0444e..764830409fc 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -664,6 +664,9 @@ func TestConfig_Marshal(t *testing.T) { AutoPurge: evmcfg.AutoPurgeConfig{ Enabled: ptr(false), }, + TransactionManagerV2: evmcfg.TransactionManagerV2Config{ + Enabled: ptr(false), + }, }, HeadTracker: evmcfg.HeadTracker{ @@ -1132,6 +1135,9 @@ ResendAfterThreshold = '1h0m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true @@ -1408,6 +1414,15 @@ func TestConfig_full(t *testing.T) { got.EVM[c].Nodes[n].Order = ptr(int32(100)) } } + if got.EVM[c].Transactions.TransactionManagerV2.BlockTime == nil { + got.EVM[c].Transactions.TransactionManagerV2.BlockTime = new(commoncfg.Duration) + } + if got.EVM[c].Transactions.TransactionManagerV2.CustomURL == nil { + got.EVM[c].Transactions.TransactionManagerV2.CustomURL = new(commoncfg.URL) + } + if got.EVM[c].Transactions.TransactionManagerV2.DualBroadcast == nil { + got.EVM[c].Transactions.TransactionManagerV2.DualBroadcast = ptr(false) + } if got.EVM[c].Transactions.AutoPurge.Threshold == nil { got.EVM[c].Transactions.AutoPurge.Threshold = ptr(uint32(0)) } diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index a3fcea9bf73..b57f9a76cf2 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -349,6 +349,9 @@ ResendAfterThreshold = '1h0m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/core/services/chainlink/testdata/config-invalid.toml b/core/services/chainlink/testdata/config-invalid.toml index 347530cec53..2a3506da45b 100644 --- a/core/services/chainlink/testdata/config-invalid.toml +++ b/core/services/chainlink/testdata/config-invalid.toml @@ -58,6 +58,9 @@ FinalizedBlockOffset = 64 [EVM.Transactions.AutoPurge] Enabled = true +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.GasEstimator] Mode = 'FixedPrice' BumpThreshold = 0 @@ -112,6 +115,9 @@ ChainType = 'scroll' Enabled = true DetectionApiUrl = '' +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [[EVM.Nodes]] Name = 'scroll node' WSURL = 'ws://foo.bar' diff --git a/core/services/chainlink/testdata/config-multi-chain-effective.toml b/core/services/chainlink/testdata/config-multi-chain-effective.toml index a659223134a..dbaafbe67d1 100644 --- a/core/services/chainlink/testdata/config-multi-chain-effective.toml +++ b/core/services/chainlink/testdata/config-multi-chain-effective.toml @@ -332,6 +332,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true @@ -443,6 +446,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true @@ -548,6 +554,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/core/web/resolver/testdata/config-full.toml b/core/web/resolver/testdata/config-full.toml index 4672d176915..d2d4b90e3ca 100644 --- a/core/web/resolver/testdata/config-full.toml +++ b/core/web/resolver/testdata/config-full.toml @@ -349,6 +349,9 @@ ResendAfterThreshold = '1h0m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml index 35974ea1ac8..82b82216371 100644 --- a/core/web/resolver/testdata/config-multi-chain-effective.toml +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -332,6 +332,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true @@ -443,6 +446,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true @@ -548,6 +554,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 18a44e30fa5..e90b37d09c7 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -2056,6 +2056,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2161,6 +2164,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2266,6 +2272,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2371,6 +2380,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2477,6 +2489,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2586,6 +2601,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2691,6 +2709,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2797,6 +2818,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -2902,6 +2926,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3006,6 +3033,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3110,6 +3140,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3215,6 +3248,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3321,6 +3357,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3426,6 +3465,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3531,6 +3573,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3635,6 +3680,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3741,6 +3789,9 @@ ResendAfterThreshold = '3m0s' Enabled = true MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3847,6 +3898,9 @@ ResendAfterThreshold = '3m0s' Enabled = true MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -3952,6 +4006,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4061,6 +4118,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4166,6 +4226,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4275,6 +4338,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4383,6 +4449,9 @@ ResendAfterThreshold = '2m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4488,6 +4557,9 @@ ResendAfterThreshold = '2m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4593,6 +4665,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4701,6 +4776,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4810,6 +4888,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -4919,6 +5000,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5028,6 +5112,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5132,6 +5219,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5237,6 +5327,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5343,6 +5436,9 @@ ResendAfterThreshold = '3m0s' Enabled = true MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5448,6 +5544,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5553,6 +5652,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5658,6 +5760,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5767,6 +5872,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5875,6 +5983,9 @@ ResendAfterThreshold = '0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -5981,6 +6092,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6091,6 +6205,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6200,6 +6317,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6305,6 +6425,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6410,6 +6533,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6520,6 +6646,9 @@ ResendAfterThreshold = '3m0s' Enabled = true MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6624,6 +6753,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6729,6 +6861,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6834,6 +6969,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -6943,6 +7081,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7053,6 +7194,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7162,6 +7306,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7267,6 +7414,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7376,6 +7526,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7482,6 +7635,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7591,6 +7747,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7700,6 +7859,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7808,6 +7970,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -7913,6 +8078,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8018,6 +8186,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8123,6 +8294,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8231,6 +8405,9 @@ Enabled = true Threshold = 90 MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8343,6 +8520,9 @@ Enabled = true Threshold = 90 MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8451,6 +8631,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8556,6 +8739,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8664,6 +8850,9 @@ ResendAfterThreshold = '3m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8770,6 +8959,9 @@ Enabled = true Threshold = 50 MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8876,6 +9068,9 @@ Enabled = true Threshold = 50 MinAttempts = 3 +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -8981,6 +9176,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9086,6 +9284,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9195,6 +9396,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9299,6 +9503,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9403,6 +9610,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9508,6 +9718,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9617,6 +9830,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9727,6 +9943,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9836,6 +10055,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -9944,6 +10166,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10053,6 +10278,9 @@ ResendAfterThreshold = '1m0s' Enabled = true DetectionApiUrl = 'https://sepolia-venus.scroll.io' +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10163,6 +10391,9 @@ ResendAfterThreshold = '1m0s' Enabled = true DetectionApiUrl = 'https://venus.scroll.io' +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10272,6 +10503,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10381,6 +10615,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10490,6 +10727,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10595,6 +10835,9 @@ ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10704,6 +10947,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -10809,6 +11055,9 @@ ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -11180,6 +11429,40 @@ MinAttempts = 3 # Example ``` MinAttempts configures the minimum number of broadcasted attempts a transaction has to have before it is evaluated further for being terminally stuck. This threshold is only applied if there is no custom API to identify stuck transactions provided by the chain. Ensure the gas estimator configs take more bump attempts before reaching the configured max gas price. +## EVM.Transactions.TransactionManagerV2 +```toml +[EVM.Transactions.TransactionManagerV2] +Enabled = false # Default +BlockTime = '10s' # Example +CustomURL = 'https://example.api.io' # Example +DualBroadcast = false # Example +``` + + +### Enabled +```toml +Enabled = false # Default +``` +Enabled enables TransactionManagerV2. + +### BlockTime +```toml +BlockTime = '10s' # Example +``` +BlockTime controls the frequency of the backfill loop of TransactionManagerV2. + +### CustomURL +```toml +CustomURL = 'https://example.api.io' # Example +``` +CustomURL configures the base url of a custom endpoint used by the ChainDualBroadcast chain type. + +### DualBroadcast +```toml +DualBroadcast = false # Example +``` +DualBroadcast enables DualBroadcast functionality. + ## EVM.BalanceMonitor ```toml [EVM.BalanceMonitor] diff --git a/testdata/scripts/node/validate/defaults-override.txtar b/testdata/scripts/node/validate/defaults-override.txtar index 44f24dda47f..2acde4e13b6 100644 --- a/testdata/scripts/node/validate/defaults-override.txtar +++ b/testdata/scripts/node/validate/defaults-override.txtar @@ -405,6 +405,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar index 79fee5634d8..d061e4468ec 100644 --- a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar @@ -388,6 +388,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar index 2a64da5c274..b5609655977 100644 --- a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar @@ -388,6 +388,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/testdata/scripts/node/validate/disk-based-logging.txtar b/testdata/scripts/node/validate/disk-based-logging.txtar index b6450111b71..217a78a7c3c 100644 --- a/testdata/scripts/node/validate/disk-based-logging.txtar +++ b/testdata/scripts/node/validate/disk-based-logging.txtar @@ -388,6 +388,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/testdata/scripts/node/validate/fallback-override.txtar b/testdata/scripts/node/validate/fallback-override.txtar index 58580d8203a..5cc001850d6 100644 --- a/testdata/scripts/node/validate/fallback-override.txtar +++ b/testdata/scripts/node/validate/fallback-override.txtar @@ -40,6 +40,9 @@ ResendAfterThreshold = '1m' [Transactions.AutoPurge] Enabled = false +[Transactions.TransactionManagerV2] +Enabled = false + [BalanceMonitor] Enabled = true @@ -479,6 +482,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/testdata/scripts/node/validate/invalid.txtar b/testdata/scripts/node/validate/invalid.txtar index 2247cf66e87..4d42750c96d 100644 --- a/testdata/scripts/node/validate/invalid.txtar +++ b/testdata/scripts/node/validate/invalid.txtar @@ -378,6 +378,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true diff --git a/testdata/scripts/node/validate/valid.txtar b/testdata/scripts/node/validate/valid.txtar index f431e853454..eef870f2280 100644 --- a/testdata/scripts/node/validate/valid.txtar +++ b/testdata/scripts/node/validate/valid.txtar @@ -385,6 +385,9 @@ ResendAfterThreshold = '1m0s' [EVM.Transactions.AutoPurge] Enabled = false +[EVM.Transactions.TransactionManagerV2] +Enabled = false + [EVM.BalanceMonitor] Enabled = true From 874daef670f33e091e2360ce4c3004e2b66437eb Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Fri, 17 Jan 2025 12:58:25 -0600 Subject: [PATCH 87/91] report LOOP plugin health to host (#15495) --- .github/workflows/ci-core.yml | 14 +- GNUmakefile | 11 + core/scripts/go.mod | 8 +- core/scripts/go.sum | 16 +- core/services/chainlink/application.go | 2 +- deployment/go.mod | 8 +- deployment/go.sum | 16 +- go.mod | 8 +- go.sum | 16 +- integration-tests/go.mod | 8 +- integration-tests/go.sum | 16 +- integration-tests/load/go.mod | 8 +- integration-tests/load/go.sum | 16 +- .../scripts/health/multi-chain-loopp.txtar | 498 ++++++++++++++++++ 14 files changed, 571 insertions(+), 74 deletions(-) create mode 100644 testdata/scripts/health/multi-chain-loopp.txtar diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 5eafa0a6721..315b9fa6596 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -255,19 +255,7 @@ jobs: - name: Install LOOP Plugins if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }} - run: | - pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds) - go install ./cmd/chainlink-feeds - popd - pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-data-streams) - go install ./mercury/cmd/chainlink-mercury - popd - pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana) - go install ./pkg/solana/cmd/chainlink-solana - popd - pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer) - go install ./pkg/chainlink/cmd/chainlink-starknet - popd + run: make install-plugins - name: Increase Timeouts for Fuzz/Race # Increase timeouts for scheduled runs only diff --git a/GNUmakefile b/GNUmakefile index f877f01decb..d86b791bbee 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -65,6 +65,17 @@ install-medianpoc: ## Build & install the chainlink-medianpoc binary. install-ocr3-capability: ## Build & install the chainlink-ocr3-capability binary. go install $(GOFLAGS) ./plugins/cmd/chainlink-ocr3-capability +.PHONY: install-plugins +install-plugins: ## Build & install LOOPP binaries for products and chains. + cd $(shell go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds) && \ + go install ./cmd/chainlink-feeds + cd $(shell go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-data-streams) && \ + go install ./mercury/cmd/chainlink-mercury + cd $(shell go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana) && \ + go install ./pkg/solana/cmd/chainlink-solana + cd $(shell go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer) && \ + go install ./pkg/chainlink/cmd/chainlink-starknet + .PHONY: docker ## Build the chainlink docker image docker: docker buildx build \ diff --git a/core/scripts/go.mod b/core/scripts/go.mod index ed6d8669033..823475e2f02 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -34,7 +34,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 @@ -311,15 +311,15 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 2afb5628089..5ad6415a060 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1160,12 +1160,12 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= @@ -1178,10 +1178,10 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 h1:kDW6Ab8vGRK2y+DPEvvhU2It8UCS9FK5ZQqIVjDfpK4= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5/go.mod h1:uHVnYLMgJ1rTcNoVxhBpy38t69gXq0j+LN3TkcIVE3U= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 h1:tQCjnIjY88AClWXApaTS+/ihQYM1GVCrbD9W00eh11E= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34/go.mod h1:lgG9JT2P19KnYuBheKIis5ZeCO+AaSta+RfzvwDQS2Y= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 06289b13fd4..50921cc93cc 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -818,7 +818,7 @@ func (app *ChainlinkApplication) Start(ctx context.Context) error { return multierr.Combine(err, ms.Close()) } - app.logger.Debugw("Starting service...", "name", service.Name()) + app.logger.Infow("Starting service...", "name", service.Name()) if err := ms.Start(ctx, service); err != nil { return err diff --git a/deployment/go.mod b/deployment/go.mod index a4fe8728226..bab3380833c 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -29,11 +29,11 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix github.com/smartcontractkit/chain-selectors v1.0.36 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 @@ -419,7 +419,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 // indirect github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 01001431596..d36e4e68bc2 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1386,12 +1386,12 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= @@ -1404,10 +1404,10 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 h1:kDW6Ab8vGRK2y+DPEvvhU2It8UCS9FK5ZQqIVjDfpK4= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5/go.mod h1:uHVnYLMgJ1rTcNoVxhBpy38t69gXq0j+LN3TkcIVE3U= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 h1:tQCjnIjY88AClWXApaTS+/ihQYM1GVCrbD9W00eh11E= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34/go.mod h1:lgG9JT2P19KnYuBheKIis5ZeCO+AaSta+RfzvwDQS2Y= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= diff --git a/go.mod b/go.mod index 3f8bc3d3d86..bf7c8e44b69 100644 --- a/go.mod +++ b/go.mod @@ -79,15 +79,15 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 - github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 + github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de diff --git a/go.sum b/go.sum index 0eb30797097..29642366545 100644 --- a/go.sum +++ b/go.sum @@ -1152,10 +1152,10 @@ github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3f github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= @@ -1166,10 +1166,10 @@ github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616- github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 h1:kDW6Ab8vGRK2y+DPEvvhU2It8UCS9FK5ZQqIVjDfpK4= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5/go.mod h1:uHVnYLMgJ1rTcNoVxhBpy38t69gXq0j+LN3TkcIVE3U= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 h1:tQCjnIjY88AClWXApaTS+/ihQYM1GVCrbD9W00eh11E= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34/go.mod h1:lgG9JT2P19KnYuBheKIis5ZeCO+AaSta+RfzvwDQS2Y= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index dd7c699c93e..2f8faf7601e 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -46,8 +46,8 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 @@ -434,8 +434,8 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 5b33caacde7..f581d1d41ca 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1410,12 +1410,12 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= @@ -1428,10 +1428,10 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 h1:kDW6Ab8vGRK2y+DPEvvhU2It8UCS9FK5ZQqIVjDfpK4= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5/go.mod h1:uHVnYLMgJ1rTcNoVxhBpy38t69gXq0j+LN3TkcIVE3U= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 h1:tQCjnIjY88AClWXApaTS+/ihQYM1GVCrbD9W00eh11E= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34/go.mod h1:lgG9JT2P19KnYuBheKIis5ZeCO+AaSta+RfzvwDQS2Y= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2 h1:nTUoe7GZLw17nPLV5t3Vgf4U4pf+VW0Uko5xpNiKdKU= github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.2-0.20250110073248-456673e8eea2/go.mod h1:mMUqvS3BZfvN1OfK4OFTYf1+T0X6nwmSXJM2keaPsSM= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 3ee4c09b258..0bd89ebc820 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -27,7 +27,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 @@ -411,14 +411,14 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 5febfce689e..6ede9ce3947 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1397,10 +1397,10 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71 h1:9GnOQycooNVvwwHFP9hiG06SGdQcppUrmZ1jGIHSOl8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250116170623-5caf6a5ece71/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd h1:SX16W7pqXGyn6fHFgtlr/rUdLZzBtQ5O3Gt3a6sFL70= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20250115094325-4e61572bb9bd/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 h1:GcPYNVFYjB065CNq0h8nK/VeU08nUkHgBX0cJIEpuHY= @@ -1411,10 +1411,10 @@ github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616- github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3 h1:L6UDu0GzSKfz+/nMSz9yfYrgOpW1/OXhiVK60PxVsnY= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250110142550-e2a9566d39f3/go.mod h1:52U0UH8K0Qwu+HB1LMc+5V27ru2Tgy29YPT+2HkMevY= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= -github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5 h1:kDW6Ab8vGRK2y+DPEvvhU2It8UCS9FK5ZQqIVjDfpK4= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20250117143722-fb6416c087a5/go.mod h1:uHVnYLMgJ1rTcNoVxhBpy38t69gXq0j+LN3TkcIVE3U= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34 h1:tQCjnIjY88AClWXApaTS+/ihQYM1GVCrbD9W00eh11E= +github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34/go.mod h1:lgG9JT2P19KnYuBheKIis5ZeCO+AaSta+RfzvwDQS2Y= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2/go.mod h1:DsT43c1oTBmp3iQkMcoZOoKThwZvt8X3Pz6UmznJ4GY= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 h1:9PMwKNqFKc5FXf4VchyD3CGzZelnSgi13fgVdT2X7T4= diff --git a/testdata/scripts/health/multi-chain-loopp.txtar b/testdata/scripts/health/multi-chain-loopp.txtar new file mode 100644 index 00000000000..6eaa9d9e26e --- /dev/null +++ b/testdata/scripts/health/multi-chain-loopp.txtar @@ -0,0 +1,498 @@ +env CL_SOLANA_CMD=chainlink-solana +env CL_STARKNET_CMD=chainlink-starknet + +# start node +exec sh -c 'eval "echo \"$(cat config.toml.tmpl)\" > config.toml"' +exec chainlink node -c config.toml start -p password -a creds & + +# initialize client +env NODEURL=http://localhost:$PORT +exec curl --retry 10 --retry-max-time 60 --retry-connrefused $NODEURL +exec chainlink --remote-node-url $NODEURL admin login -file creds --bypass-version-check + +exec chainlink --remote-node-url $NODEURL health +cmp stdout out.txt + +exec chainlink --remote-node-url $NODEURL health -json +cp stdout compact.json +exec jq . compact.json +cmp stdout out.json + +exec chainlink --remote-node-url $NODEURL health -failing +cmp stdout out-unhealthy.txt + +exec chainlink --remote-node-url $NODEURL health -f -json +cp stdout compact.json +exec jq . compact.json +cmp stdout out-unhealthy.json + +-- testdb.txt -- +CL_DATABASE_URL +-- testport.txt -- +PORT + +-- password -- +T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ +-- creds -- +notreal@fakeemail.ch +fj293fbBnlQ!f9vNs + +-- config.toml.tmpl -- +[Webserver] +HTTPPort = $PORT + +[[Cosmos]] +ChainID = 'Foo' + +[[Cosmos.Nodes]] +Name = 'primary' +TendermintURL = 'http://tender.mint' + +[[EVM]] +ChainID = '1' + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +[[Solana]] +ChainID = 'Bar' + +[[Solana.Nodes]] +Name = 'primary' +URL = 'http://solana.web' + +[[Starknet]] +ChainID = 'Baz' + +[[Starknet.Nodes]] +Name = 'primary' +URL = 'http://stark.node' + +-- out.txt -- +ok Cosmos.Foo.Chain +ok Cosmos.Foo.Relayer +ok Cosmos.Foo.Txm +ok EVM.1 +ok EVM.1.BalanceMonitor +ok EVM.1.HeadBroadcaster +ok EVM.1.HeadTracker +! EVM.1.HeadTracker.HeadListener + Listener is not connected +ok EVM.1.LogBroadcaster +ok EVM.1.Relayer +ok EVM.1.Txm +ok EVM.1.Txm.BlockHistoryEstimator +ok EVM.1.Txm.Broadcaster +ok EVM.1.Txm.Confirmer +ok EVM.1.Txm.Finalizer +ok EVM.1.Txm.WrappedEvmEstimator +ok HeadReporter +ok Heartbeat +ok JobSpawner +ok Mailbox.Monitor +ok Mercury.WSRPCPool +ok Mercury.WSRPCPool.CacheSet +ok PipelineORM +ok PipelineRunner +ok PipelineRunner.BridgeCache +ok RetirementReportCache +ok Solana.Bar.RelayerService +ok Solana.Bar.RelayerService.PluginRelayerClient +ok Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana +ok Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Chain +ok Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Relayer +ok Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Txm +ok StarkNet.Baz.RelayerService +ok StarkNet.Baz.RelayerService.PluginRelayerClient +ok StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet +ok StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Chain +ok StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Relayer +ok StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Txm +ok TelemetryManager +ok WorkflowDBStore + +-- out-unhealthy.txt -- +! EVM.1.HeadTracker.HeadListener + Listener is not connected + +-- out.json -- +{ + "data": [ + { + "type": "checks", + "id": "Cosmos.Foo.Chain", + "attributes": { + "name": "Cosmos.Foo.Chain", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Cosmos.Foo.Relayer", + "attributes": { + "name": "Cosmos.Foo.Relayer", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Cosmos.Foo.Txm", + "attributes": { + "name": "Cosmos.Foo.Txm", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1", + "attributes": { + "name": "EVM.1", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.BalanceMonitor", + "attributes": { + "name": "EVM.1.BalanceMonitor", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.HeadBroadcaster", + "attributes": { + "name": "EVM.1.HeadBroadcaster", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.HeadTracker", + "attributes": { + "name": "EVM.1.HeadTracker", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.HeadTracker.HeadListener", + "attributes": { + "name": "EVM.1.HeadTracker.HeadListener", + "status": "failing", + "output": "Listener is not connected" + } + }, + { + "type": "checks", + "id": "EVM.1.LogBroadcaster", + "attributes": { + "name": "EVM.1.LogBroadcaster", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Relayer", + "attributes": { + "name": "EVM.1.Relayer", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Txm", + "attributes": { + "name": "EVM.1.Txm", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Txm.BlockHistoryEstimator", + "attributes": { + "name": "EVM.1.Txm.BlockHistoryEstimator", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Txm.Broadcaster", + "attributes": { + "name": "EVM.1.Txm.Broadcaster", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Txm.Confirmer", + "attributes": { + "name": "EVM.1.Txm.Confirmer", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Txm.Finalizer", + "attributes": { + "name": "EVM.1.Txm.Finalizer", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "EVM.1.Txm.WrappedEvmEstimator", + "attributes": { + "name": "EVM.1.Txm.WrappedEvmEstimator", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "HeadReporter", + "attributes": { + "name": "HeadReporter", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Heartbeat", + "attributes": { + "name": "Heartbeat", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "JobSpawner", + "attributes": { + "name": "JobSpawner", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Mailbox.Monitor", + "attributes": { + "name": "Mailbox.Monitor", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Mercury.WSRPCPool", + "attributes": { + "name": "Mercury.WSRPCPool", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Mercury.WSRPCPool.CacheSet", + "attributes": { + "name": "Mercury.WSRPCPool.CacheSet", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "PipelineORM", + "attributes": { + "name": "PipelineORM", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "PipelineRunner", + "attributes": { + "name": "PipelineRunner", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "PipelineRunner.BridgeCache", + "attributes": { + "name": "PipelineRunner.BridgeCache", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "RetirementReportCache", + "attributes": { + "name": "RetirementReportCache", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Solana.Bar.RelayerService", + "attributes": { + "name": "Solana.Bar.RelayerService", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Solana.Bar.RelayerService.PluginRelayerClient", + "attributes": { + "name": "Solana.Bar.RelayerService.PluginRelayerClient", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana", + "attributes": { + "name": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Chain", + "attributes": { + "name": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Chain", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Relayer", + "attributes": { + "name": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Relayer", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Txm", + "attributes": { + "name": "Solana.Bar.RelayerService.PluginRelayerClient.PluginSolana.Txm", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "StarkNet.Baz.RelayerService", + "attributes": { + "name": "StarkNet.Baz.RelayerService", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "StarkNet.Baz.RelayerService.PluginRelayerClient", + "attributes": { + "name": "StarkNet.Baz.RelayerService.PluginRelayerClient", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet", + "attributes": { + "name": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Chain", + "attributes": { + "name": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Chain", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Relayer", + "attributes": { + "name": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Relayer", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Txm", + "attributes": { + "name": "StarkNet.Baz.RelayerService.PluginRelayerClient.PluginStarknet.Txm", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "TelemetryManager", + "attributes": { + "name": "TelemetryManager", + "status": "passing", + "output": "" + } + }, + { + "type": "checks", + "id": "WorkflowDBStore", + "attributes": { + "name": "WorkflowDBStore", + "status": "passing", + "output": "" + } + } + ] +} +-- out-unhealthy.json -- +{ + "data": [ + { + "type": "checks", + "id": "EVM.1.HeadTracker.HeadListener", + "attributes": { + "name": "EVM.1.HeadTracker.HeadListener", + "status": "failing", + "output": "Listener is not connected" + } + } + ] +} From ed5cb0880a5c9cb1f31c4ecdadc05b1de0168f17 Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Fri, 17 Jan 2025 15:13:36 -0600 Subject: [PATCH 88/91] Nonevm 1163/update plugin factory with extra args decoder (#15944) * interface change for plugin to support extra args codec, right now noop * add changeset * lint * go mod * remove error * fix lint * go import * implement evm * update name * go import * remove old comment * update * remove unused * update mod * update to master chainlink-ccip --- .changeset/soft-rivers-care.md | 5 +++++ core/capabilities/ccip/ccipevm/extraargscodec.go | 16 ++++++++++++++++ core/capabilities/ccip/oraclecreator/plugin.go | 2 ++ core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- integration-tests/smoke/ccip/ccip_reader_test.go | 8 ++++++-- 14 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 .changeset/soft-rivers-care.md create mode 100644 core/capabilities/ccip/ccipevm/extraargscodec.go diff --git a/.changeset/soft-rivers-care.md b/.changeset/soft-rivers-care.md new file mode 100644 index 00000000000..22eeea042ba --- /dev/null +++ b/.changeset/soft-rivers-care.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +interface change for plugin to support extra args codec, right now noop #added diff --git a/core/capabilities/ccip/ccipevm/extraargscodec.go b/core/capabilities/ccip/ccipevm/extraargscodec.go new file mode 100644 index 00000000000..8cd8bda48f7 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/extraargscodec.go @@ -0,0 +1,16 @@ +package ccipevm + +import ( + cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" +) + +type ExtraArgsCodec struct{} + +func NewExtraArgsCodec() ExtraArgsCodec { + return ExtraArgsCodec{} +} + +func (ExtraArgsCodec) DecodeExtraData(extraArgs cciptypes.Bytes, sourceChainSelector cciptypes.ChainSelector) (map[string]any, error) { + // Not implemented and not return error + return nil, nil +} diff --git a/core/capabilities/ccip/oraclecreator/plugin.go b/core/capabilities/ccip/oraclecreator/plugin.go index d4c5596aeaf..f791a804586 100644 --- a/core/capabilities/ccip/oraclecreator/plugin.go +++ b/core/capabilities/ccip/oraclecreator/plugin.go @@ -263,6 +263,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter( ccipreaderpkg.OCR3ConfigWithMeta(config), ccipevm.NewCommitPluginCodecV1(), ccipevm.NewMessageHasherV1(i.lggr.Named("MessageHasherV1")), + ccipevm.NewExtraArgsCodec(), i.homeChainReader, i.homeChainSelector, contractReaders, @@ -285,6 +286,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter( ccipreaderpkg.OCR3ConfigWithMeta(config), ccipevm.NewExecutePluginCodecV1(), ccipevm.NewMessageHasherV1(i.lggr.Named("MessageHasherV1")), + ccipevm.NewExtraArgsCodec(), i.homeChainReader, ccipevm.NewEVMTokenDataEncoder(), ccipevm.NewGasEstimateProvider(), diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 823475e2f02..0428101e86c 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -311,7 +311,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 5ad6415a060..18e6a6ba941 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1160,8 +1160,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= diff --git a/deployment/go.mod b/deployment/go.mod index bab3380833c..40d0629f35e 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -29,7 +29,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix github.com/smartcontractkit/chain-selectors v1.0.36 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 diff --git a/deployment/go.sum b/deployment/go.sum index d36e4e68bc2..82fac992e8f 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1386,8 +1386,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= diff --git a/go.mod b/go.mod index bf7c8e44b69..83822155b9e 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 diff --git a/go.sum b/go.sum index 29642366545..50f8fd0b1fc 100644 --- a/go.sum +++ b/go.sum @@ -1152,8 +1152,8 @@ github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3f github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 2f8faf7601e..d3f5e88e940 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -46,7 +46,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f581d1d41ca..fd165a64cf2 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1410,8 +1410,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 0bd89ebc820..c2ad7725fce 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -411,7 +411,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 6ede9ce3947..cc30e409cba 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1397,8 +1397,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/smoke/ccip/ccip_reader_test.go b/integration-tests/smoke/ccip/ccip_reader_test.go index beb7b00b85b..4345bd4d894 100644 --- a/integration-tests/smoke/ccip/ccip_reader_test.go +++ b/integration-tests/smoke/ccip/ccip_reader_test.go @@ -19,6 +19,7 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" "github.com/smartcontractkit/chainlink-ccip/plugintypes" @@ -290,6 +291,7 @@ func TestCCIPReader_GetOffRampConfigDigest(t *testing.T) { nil, chainD, addr.Bytes(), + ccipevm.NewExtraArgsCodec(), ) ccipReaderCommitDigest, err := reader.GetOffRampConfigDigest(ctx, consts.PluginTypeCommit) @@ -1409,7 +1411,8 @@ func testSetupRealContracts( contractReaders[chain] = cr } contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter) - reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil) + edc := ccipevm.NewExtraArgsCodec() + reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil, edc) return reader } @@ -1524,7 +1527,8 @@ func testSetup( contractReaders[chain] = cr } contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter) - reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil) + edc := ccipevm.NewExtraArgsCodec() + reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil, edc) t.Cleanup(func() { require.NoError(t, cr.Close()) From dc46808b56ce6de0aec1b57a0767ab42e2870c20 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 17 Jan 2025 13:55:58 -0800 Subject: [PATCH 89/91] fix: ci-core use all modules for scheduled runs (#15976) --- .github/workflows/ci-core.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 315b9fa6596..075901f1778 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -112,9 +112,17 @@ jobs: - name: Resolve affected files to affected modules id: resolved-modules shell: bash + env: + GH_EVENT_NAME: ${{ github.event_name }} run: | - # Ensure the step uses `with.list-files: json` to get the list of files in JSON format - bash ./.github/scripts/map-affected-files-to-modules.sh '${{ steps.match-every.outputs.all_files }}' + # if scheduled, run for all modules. Otherwise, run for only affected modules. + if [[ "$GH_EVENT_NAME" == "schedule" ]]; then + json_array=$(find . -name 'go.mod' -exec dirname {} \; | sed 's|^./||' | uniq | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "module_names=$json_array" >> "$GITHUB_OUTPUT" + else + # Ensure the step uses `with.list-files: json` to get the list of files in JSON format + bash ./.github/scripts/map-affected-files-to-modules.sh '${{ steps.match-every.outputs.all_files }}' + fi golangci: name: GolangCI Lint From 16d48748ba13bb71edd5baefbc913088e8267fb6 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 17 Jan 2025 18:19:42 -0800 Subject: [PATCH 90/91] fix: add context to golang ci lint notifications (#15979) * fix: add context to golang ci lint notifications * feat: add artifact url to slack message --- .github/actions/golangci-lint/action.yml | 6 ++++++ .github/workflows/ci-core.yml | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/golangci-lint/action.yml b/.github/actions/golangci-lint/action.yml index 8fa3e1775d0..5fb7865c5e8 100644 --- a/.github/actions/golangci-lint/action.yml +++ b/.github/actions/golangci-lint/action.yml @@ -18,6 +18,11 @@ inputs: description: Set where the go module file is located at default: "go.sum" +outputs: + golang-report-artifact-url: + description: The URL to the uploaded artifact + value: ${{ steps.upload-artifact.outputs.artifact_url }} + runs: using: composite steps: @@ -100,6 +105,7 @@ runs: - name: Store Golangci-lint report artifact if: always() + id: upload-artifact uses: actions/upload-artifact@v4.4.3 with: # Use a unique suffix for each lint report artifact to avoid duplication errors diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 075901f1778..b593bfa218f 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -146,6 +146,7 @@ jobs: with: persist-credentials: false - name: Golang Lint (${{ matrix.modules }}) + id: golang-lint uses: ./.github/actions/golangci-lint with: go-directory: ${{ matrix.modules }} @@ -156,7 +157,10 @@ jobs: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} with: channel-id: "#team-core" - slack-message: "golangci-lint failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}" + slack-message: | + "golangci-lint failed (${{ matrix.modules }}) + - Run: ${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}" + - Report: ${{ steps.golang-lint.outputs.golang-report-artifact-url }}" # Fails if any golangci-lint matrix jobs fails and silently succeeds otherwise # Consolidates golangci-lint matrix job results under one required `lint` check From 4e284976ea8ca7c0e355efce6336742d70918ac2 Mon Sep 17 00:00:00 2001 From: Josh Weintraub <26035072+jhweintraub@users.noreply.github.com> Date: Sat, 18 Jan 2025 01:41:33 -0500 Subject: [PATCH 91/91] CCIP-4687 Support Solana in the FeeQuoter (#15811) * Initial Scaffolding Tests still needed * Start writing tests for SolExtra args and rework a lot of stuff to accomplish this * [Bot] Update changeset file with jira issues * Finish provisional tests * Delete contracts/.changeset/tame-worms-sneeze.md delete unnec. changeset file * Update gethwrappers * remove dead code * Update gethwrappers * remove superfluous extraArgs validation checks * update wrapper and snapshot * optimise SolExtraArgsV1 * fmt * rename solana args to SVM * add validation on token and logic receiver + add tokenReceiver to SVMExtraArgs * wrappers update * rm foundry lib * fix: svm tokenReceiver type bytes32 * Sol/solana reference rename to SVM * remove else, revert on invalid input and cleanup * Update gethwrappers * add test for extra args tag const validation * Update gethwrappers * remove else from _processChainFamilySelector * compile FeeQuoter with 10_000 optimizer runs * Update gethwrappers * compile FeeQuoter with 10_000 optimizer runs * improved checks in extra args processing + tests * fix test * move gas limit receiver check * make test run * golf * clean up InvalidSVMAddress * Update gethwrappers * fix test and add correct comments + SVM specific compute unit error * remove unnecessary check --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: 0xsuryansh Co-authored-by: Rens Rooimans --- contracts/.changeset/clean-horses-cheat.md | 10 ++ contracts/gas-snapshots/ccip.gas-snapshot | 167 +++++++++--------- .../scripts/native_solc_compile_all_ccip | 6 +- contracts/src/v0.8/ccip/FeeQuoter.sol | 133 +++++++++++--- contracts/src/v0.8/ccip/libraries/Client.sol | 17 ++ .../src/v0.8/ccip/libraries/Internal.sol | 17 +- ...eeQuoter.applyDestChainConfigUpdates.t.sol | 12 -- .../feeQuoter/FeeQuoter.getValidatedFee.t.sol | 19 +- ...FeeQuoter.parseEVMExtraArgsFromBytes.t.sol | 10 +- ...FeeQuoter.parseSVMExtraArgsFromBytes.t.sol | 105 +++++++++++ ...FeeQuoter.processChainFamilySelector.t.sol | 131 ++++++++++++++ .../FeeQuoter.processMessageArgs.t.sol | 41 +++++ .../FeeQuoter.validateDestFamilyAddress.t.sol | 21 ++- .../ccip/test/feeQuoter/FeeQuoterSetup.t.sol | 19 ++ .../ccip/test/helpers/FeeQuoterHelper.sol | 30 +++- .../ccip/generated/fee_quoter/fee_quoter.go | 4 +- ...rapper-dependency-versions-do-not-edit.txt | 2 +- 17 files changed, 605 insertions(+), 139 deletions(-) create mode 100644 contracts/.changeset/clean-horses-cheat.md create mode 100644 contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseSVMExtraArgsFromBytes.t.sol create mode 100644 contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processChainFamilySelector.t.sol diff --git a/contracts/.changeset/clean-horses-cheat.md b/contracts/.changeset/clean-horses-cheat.md new file mode 100644 index 00000000000..09cce822451 --- /dev/null +++ b/contracts/.changeset/clean-horses-cheat.md @@ -0,0 +1,10 @@ +--- +'@chainlink/contracts': minor +--- + +Update FeeQuoter to support Solana chain families #feature + + +PR issue: CCIP-4687 + +Solidity Review issue: CCIP-3966 \ No newline at end of file diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index f1eefe78fa8..a6cb9fe68fc 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -9,7 +9,7 @@ BurnToAddressMintTokenPool_releaseOrMint:test_releaseOrMint() (gas: 126048) BurnToAddressMintTokenPool_setOutstandingokens:test_setOutstandingTokens() (gas: 37793) BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 239012) BurnWithFromMintTokenPool_lockOrBurn:test_Setup() (gas: 24169) -CCIPClientExample_sanity:test_ImmutableExamples() (gas: 2073613) +CCIPClientExample_sanity:test_ImmutableExamples() (gas: 2078596) CCIPHome__validateConfig:test__validateConfig() (gas: 300016) CCIPHome__validateConfig:test__validateConfigLessTransmittersThanSigners() (gas: 332965) CCIPHome__validateConfig:test__validateConfigSmallerFChain() (gas: 459322) @@ -25,9 +25,9 @@ CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_mu CCIPHome_revokeCandidate:test_revokeCandidate() (gas: 30647) CCIPHome_setCandidate:test_setCandidate() (gas: 1365392) CCIPHome_supportsInterface:test_supportsInterface() (gas: 9885) -DefensiveExampleTest:test_HappyPath() (gas: 200517) +DefensiveExampleTest:test_HappyPath() (gas: 200535) DefensiveExampleTest:test_Recovery() (gas: 424996) -E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1490723) +E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1494287) ERC165CheckerReverting_supportsInterfaceReverting:test__supportsInterfaceReverting() (gas: 10445) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96964) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49797) @@ -62,7 +62,7 @@ FactoryBurnMintERC20_increaseApproval:test_IncreaseApproval() (gas: 44421) FactoryBurnMintERC20_mint:test_BasicMint() (gas: 149826) FactoryBurnMintERC20_supportsInterface:test_SupportsInterface() (gas: 11539) FactoryBurnMintERC20_transfer:test_Transfer() (gas: 42505) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates() (gas: 149177) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates() (gas: 149063) FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput() (gas: 12493) FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates() (gas: 162480) FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens() (gas: 54881) @@ -70,31 +70,32 @@ FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiP FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12468) FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig() (gas: 88604) FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13196) -FeeQuoter_constructor:test_Setup() (gas: 5034079) +FeeQuoter_constructor:test_Setup() (gas: 5429233) FeeQuoter_convertTokenAmount:test_ConvertTokenAmount() (gas: 68417) -FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost() (gas: 98963) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost() (gas: 21527) +FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost() (gas: 98884) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost() (gas: 21505) FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector() (gas: 14904) FeeQuoter_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices() (gas: 73123) -FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled() (gas: 113611) -FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice() (gas: 110698) +FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled() (gas: 113576) +FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice() (gas: 110663) FeeQuoter_getTokenPrice:test_GetTokenPriceFromFeed() (gas: 68158) FeeQuoter_getTokenPrice:test_GetTokenPrice_LocalMoreRecent() (gas: 33546) FeeQuoter_getTokenPrices:test_GetTokenPrices() (gas: 78534) -FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee() (gas: 34575) -FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee() (gas: 32354) -FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas() (gas: 25402) -FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee() (gas: 91665) -FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee() (gas: 17863) -FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas() (gas: 25231) -FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas() (gas: 25232) -FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee() (gas: 37790) -FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults() (gas: 26926) -FeeQuoter_getValidatedFee:test_EmptyMessage() (gas: 84794) -FeeQuoter_getValidatedFee:test_HighGasMessage() (gas: 242730) -FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer() (gas: 143322) -FeeQuoter_getValidatedFee:test_SingleTokenMessage() (gas: 114915) -FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier() (gas: 66086) +FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee() (gas: 34616) +FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee() (gas: 32395) +FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas() (gas: 25465) +FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee() (gas: 91728) +FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee() (gas: 17904) +FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas() (gas: 25272) +FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas() (gas: 25295) +FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee() (gas: 37853) +FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults() (gas: 26989) +FeeQuoter_getValidatedFee:test_EmptyMessage() (gas: 85158) +FeeQuoter_getValidatedFee:test_HighGasMessage() (gas: 243094) +FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer() (gas: 143736) +FeeQuoter_getValidatedFee:test_SingleTokenMessage() (gas: 115240) +FeeQuoter_getValidatedFee:test_SolChainFamilySelector() (gas: 60999) +FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier() (gas: 66233) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice() (gas: 58905) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed() (gas: 65115) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals() (gas: 1897724) @@ -108,27 +109,35 @@ FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken() (gas: 61854) FeeQuoter_onReport:test_OnReport_SkipPriceUpdateWhenStaleUpdateReceived() (gas: 52565) FeeQuoter_onReport:test_onReport() (gas: 88942) FeeQuoter_onReport:test_onReport_withKeystoneForwarderContract() (gas: 122570) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsDefault() (gas: 17113) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV1() (gas: 16202) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV2() (gas: 16306) -FeeQuoter_processMessageArgs:test_processMessageArgs_WitEVMExtraArgsV2() (gas: 27978) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithConvertedTokenAmount() (gas: 32012) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithCorrectPoolReturnData() (gas: 76591) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithEVMExtraArgsV1() (gas: 27609) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithEmptyEVMExtraArgs() (gas: 25468) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithLinkTokenAmount() (gas: 21652) +FeeQuoter_parseSVMExtraArgsFromBytes:test_SVMExtraArgsV1() (gas: 23233) +FeeQuoter_parseSVMExtraArgsFromBytes:test_SVMExtraArgsV1TagSelector() (gas: 3157) +FeeQuoter_processChainFamilySelector:test_processChainFamilySelectorEVM() (gas: 19457) +FeeQuoter_processChainFamilySelector:test_processChainFamilySelectorSVM_NoTokenTransfer() (gas: 22644) +FeeQuoter_processChainFamilySelector:test_processChainFamilySelectorSVM_WithTokenTransfer() (gas: 22633) +FeeQuoter_processMessageArgs:test_processMessageArgs_WitEVMExtraArgsV2() (gas: 29003) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithConvertedTokenAmount() (gas: 33038) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithCorrectPoolReturnData() (gas: 77567) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithEVMExtraArgsV1() (gas: 28634) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithEmptyEVMExtraArgs() (gas: 26494) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithLinkTokenAmount() (gas: 22700) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithSVMExtraArgsV1() (gas: 63415) +FeeQuoter_resolveGasLimitForDestination:test_EVMExtraArgsDefault() (gas: 17113) +FeeQuoter_resolveGasLimitForDestination:test_EVMExtraArgsV1() (gas: 16180) +FeeQuoter_resolveGasLimitForDestination:test_EVMExtraArgsV1TagSelector() (gas: 3169) +FeeQuoter_resolveGasLimitForDestination:test_EVMExtraArgsV2() (gas: 16306) +FeeQuoter_resolveGasLimitForDestination:test_EVMExtraArgsV2TagSelector() (gas: 3168) FeeQuoter_supportsInterface:test_SupportsInterface() (gas: 13264) -FeeQuoter_updatePrices:test_OnlyGasPrice() (gas: 23912) +FeeQuoter_updatePrices:test_OnlyGasPrice() (gas: 24001) FeeQuoter_updatePrices:test_OnlyTokenPrice() (gas: 28739) -FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller() (gas: 74768) -FeeQuoter_updatePrices:test_UpdateMultiplePrices() (gas: 145958) +FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller() (gas: 74733) +FeeQuoter_updatePrices:test_UpdateMultiplePrices() (gas: 146225) FeeQuoter_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 52495) FeeQuoter_updateTokenPriceFeeds:test_FeedUnset() (gas: 66418) FeeQuoter_updateTokenPriceFeeds:test_MultipleFeedUpdate() (gas: 93559) FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate() (gas: 53171) FeeQuoter_updateTokenPriceFeeds:test_ZeroFeeds() (gas: 12471) -FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress() (gas: 6767) -FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress() (gas: 6492) +FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress() (gas: 6796) +FeeQuoter_validateDestFamilyAddress:test_ValidSVMAddress() (gas: 6657) HybridLockReleaseUSDCTokenPool_lockOrBurn:test_PrimaryMechanism() (gas: 130339) HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism() (gas: 140169) HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 202967) @@ -190,10 +199,10 @@ MultiOCR3Base_setOCR3Configs:test_UpdateConfigSigners() (gas: 861909) MultiOCR3Base_setOCR3Configs:test_UpdateConfigTransmittersWithoutSigners() (gas: 476109) MultiOCR3Base_transmit:test_TransmitSigners_gas() (gas: 33559) MultiOCR3Base_transmit:test_TransmitWithoutSignatureVerification_gas() (gas: 18638) -NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 123595) +NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 123617) NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySet_overrideAllowed() (gas: 45935) NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate() (gas: 66937) -NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12145) +NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12123) NonceManager_getInboundNonce:test_getInboundNonce_NoPrevOffRampForChain() (gas: 178906) NonceManager_getInboundNonce:test_getInboundNonce_Upgraded() (gas: 146095) NonceManager_getInboundNonce:test_getInboundNonce_UpgradedNonceNewSenderStartsAtZero() (gas: 182376) @@ -204,10 +213,10 @@ NonceManager_getIncrementedOutboundNonce:test_getIncrementedOutboundNonce() (gas NonceManager_getIncrementedOutboundNonce:test_incrementInboundNonce() (gas: 38746) NonceManager_getIncrementedOutboundNonce:test_incrementInboundNonce_SkippedIncorrectNonce() (gas: 23739) NonceManager_getIncrementedOutboundNonce:test_incrementNoncesInboundAndOutbound() (gas: 71886) -NonceManager_getOutboundNonce:test_getOutboundNonce_Upgrade() (gas: 104563) -NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceNewSenderStartsAtZero() (gas: 165406) -NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceStartsAtV1Nonce() (gas: 194435) -NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeSenderNoncesReadsPreviousRamp() (gas: 142134) +NonceManager_getOutboundNonce:test_getOutboundNonce_Upgrade() (gas: 105588) +NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceNewSenderStartsAtZero() (gas: 167456) +NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceStartsAtV1Nonce() (gas: 197510) +NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeSenderNoncesReadsPreviousRamp() (gas: 145209) OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains() (gas: 626140) OffRamp_applySourceChainConfigUpdates:test_AddNewChain() (gas: 166441) OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates() (gas: 16671) @@ -276,33 +285,33 @@ OffRamp_trialExecute:test_trialExecute_RevertsWhen_NoEnoughGasForCallSigAndSende OffRamp_trialExecute:test_trialExecute_RevertsWhen_NoGasForCallExactCheckAndSenderIsGasEstimator() (gas: 29539) OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 131932) OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 281327) -OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy() (gas: 244845) -OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates() (gas: 325979) +OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy() (gas: 245406) +OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates() (gas: 325996) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 17190) OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates() (gas: 65874) -OnRamp_constructor:test_Constructor() (gas: 2672129) -OnRamp_forwardFromRouter:test_ForwardFromRouter() (gas: 144671) -OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2() (gas: 145505) -OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue() (gas: 114684) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145069) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 143346) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 145310) -OnRamp_forwardFromRouter:test_ForwardFromRouter_ConfigurableSourceRouter() (gas: 142650) -OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered() (gas: 184400) -OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce() (gas: 210755) -OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 146316) -OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception() (gas: 274013) -OnRamp_getFee:test_EmptyMessage() (gas: 99565) -OnRamp_getFee:test_GetFeeOfZeroForTokenMessage() (gas: 89015) -OnRamp_getFee:test_SingleTokenMessage() (gas: 114859) -OnRamp_getTokenPool:test_GetTokenPool() (gas: 35382) +OnRamp_constructor:test_Constructor() (gas: 2672063) +OnRamp_forwardFromRouter:test_ForwardFromRouter() (gas: 145718) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2() (gas: 146530) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue() (gas: 115709) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 146116) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 144372) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 146357) +OnRamp_forwardFromRouter:test_ForwardFromRouter_ConfigurableSourceRouter() (gas: 143697) +OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered() (gas: 187475) +OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce() (gas: 213852) +OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 147363) +OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception() (gas: 275037) +OnRamp_getFee:test_EmptyMessage() (gas: 100389) +OnRamp_getFee:test_GetFeeOfZeroForTokenMessage() (gas: 89392) +OnRamp_getFee:test_SingleTokenMessage() (gas: 115707) +OnRamp_getTokenPool:test_GetTokenPool() (gas: 35404) OnRamp_setDynamicConfig:test_setDynamicConfig() (gas: 56650) OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens() (gas: 125835) -PingPong_ccipReceive:test_CcipReceive() (gas: 165996) -PingPong_setOutOfOrderExecution:test_OutOfOrderExecution() (gas: 20350) -PingPong_setPaused:test_Pausing() (gas: 17738) -PingPong_startPingPong:test_StartPingPong_With_OOO() (gas: 145147) -PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered() (gas: 170800) +PingPong_ccipReceive:test_CcipReceive() (gas: 167206) +PingPong_setOutOfOrderExecution:test_OutOfOrderExecution() (gas: 20284) +PingPong_setPaused:test_Pausing() (gas: 17760) +PingPong_startPingPong:test_StartPingPong_With_OOO() (gas: 146357) +PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered() (gas: 171988) RMNHome_getConfigDigests:test_getConfigDigests() (gas: 1081176) RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive() (gas: 1086556) RMNHome_revokeCandidate:test_revokeCandidate() (gas: 28085) @@ -332,21 +341,21 @@ RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetC RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner() (gas: 129941) Router_applyRampUpdates:test_applyRampUpdates_OffRampUpdatesWithRouting() (gas: 10413055) Router_applyRampUpdates:test_applyRampUpdates_OnRampDisable() (gas: 56445) -Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 124610) -Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 212051) +Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 125820) +Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 213241) Router_ccipSend:test_InvalidMsgValue() (gas: 27856) -Router_ccipSend:test_NativeFeeToken() (gas: 185287) -Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 62598) -Router_ccipSend:test_NativeFeeTokenOverpay() (gas: 186704) -Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 54690) -Router_ccipSend:test_NonLinkFeeToken() (gas: 219712) -Router_ccipSend:test_WrappedNativeFeeToken() (gas: 187526) -Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 133767) -Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 221252) -Router_constructor:test_Constructor() (gas: 13148) +Router_ccipSend:test_NativeFeeToken() (gas: 186661) +Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 62761) +Router_ccipSend:test_NativeFeeTokenOverpay() (gas: 188056) +Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 54853) +Router_ccipSend:test_NonLinkFeeToken() (gas: 220901) +Router_ccipSend:test_WrappedNativeFeeToken() (gas: 188878) +Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 134978) +Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 222442) +Router_constructor:test_Constructor() (gas: 13170) Router_getArmProxy:test_getArmProxy() (gas: 10573) -Router_getFee:test_GetFeeSupportedChain() (gas: 52161) -Router_recoverTokens:test_RecoverTokens() (gas: 52668) +Router_getFee:test_GetFeeSupportedChain() (gas: 52432) +Router_recoverTokens:test_RecoverTokens() (gas: 52686) Router_routeMessage:test_routeMessage_AutoExec() (gas: 38071) Router_routeMessage:test_routeMessage_ExecutionEvent() (gas: 153593) Router_routeMessage:test_routeMessage_ManualExec() (gas: 31120) diff --git a/contracts/scripts/native_solc_compile_all_ccip b/contracts/scripts/native_solc_compile_all_ccip index 8c3168c4fc3..a62a25ddbb0 100755 --- a/contracts/scripts/native_solc_compile_all_ccip +++ b/contracts/scripts/native_solc_compile_all_ccip @@ -9,6 +9,7 @@ echo " └─────────────────────── # The offRamp uses a specific lower optimization runs value. All other contracts use the default value # as specified in the foundry.toml. OPTIMIZE_RUNS_OFFRAMP=800 +OPTIMIZE_RUNS_FEE_QUOTER=10000 PROJECT="ccip" FOUNDRY_PROJECT_SUFFIX="-compile" @@ -37,7 +38,10 @@ function getOptimizations() { case $1 in "OffRamp") - optimize_runs_override="--optimizer-runs "$OPTIMIZE_RUNS_OFFRAMP + optimize_runs_override="--optimizer-runs $OPTIMIZE_RUNS_OFFRAMP" + ;; + "FeeQuoter") + optimize_runs_override="--optimizer-runs $OPTIMIZE_RUNS_FEE_QUOTER" ;; esac diff --git a/contracts/src/v0.8/ccip/FeeQuoter.sol b/contracts/src/v0.8/ccip/FeeQuoter.sol index 40972df1c0b..590233c6230 100644 --- a/contracts/src/v0.8/ccip/FeeQuoter.sol +++ b/contracts/src/v0.8/ccip/FeeQuoter.sol @@ -34,9 +34,11 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, error DataFeedValueOutOfUint224Range(); error InvalidDestBytesOverhead(address token, uint32 destBytesOverhead); error MessageGasLimitTooHigh(); + error MessageComputeUnitLimitTooHigh(); error DestinationChainNotEnabled(uint64 destChainSelector); error ExtraArgOutOfOrderExecutionMustBeTrue(); error InvalidExtraArgsTag(); + error InvalidExtraArgsData(); error SourceTokenDataTooLarge(address token); error InvalidDestChainConfig(uint64 destChainSelector); error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg); @@ -44,6 +46,8 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, error MessageTooLarge(uint256 maxSize, uint256 actualSize); error UnsupportedNumberOfTokens(uint256 numberOfTokens, uint256 maxNumberOfTokensPerMsg); error InvalidFeeRange(uint256 minFeeUSDCents, uint256 maxFeeUSDCents); + error InvalidChainFamilySelector(bytes4 chainFamilySelector); + error InvalidTokenReceiver(); event FeeTokenAdded(address indexed feeToken); event FeeTokenRemoved(address indexed feeToken); @@ -551,11 +555,12 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, Client.EVM2AnyMessage calldata message ) external view returns (uint256 feeTokenAmount) { DestChainConfig memory destChainConfig = s_destChainConfigs[destChainSelector]; - if (!destChainConfig.isEnabled) revert DestinationChainNotEnabled(destChainSelector); if (!s_feeTokens.contains(message.feeToken)) revert FeeTokenNotSupported(message.feeToken); uint256 numberOfTokens = message.tokenAmounts.length; - _validateMessage(destChainConfig, message.data.length, numberOfTokens, message.receiver); + uint256 gasLimit = _resolveGasLimitForDestination(message.extraArgs, destChainConfig); + + _validateMessage(destChainConfig, message.data.length, numberOfTokens, gasLimit, message.receiver); // The below call asserts that feeToken is a supported token. uint224 feeTokenPrice = _getValidatedTokenPrice(message.feeToken); @@ -622,13 +627,7 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, // We add the destination chain CCIP overhead (commit, exec), the token transfer gas, the calldata cost and the msg // gas limit to get the total gas the tx costs to execute on the destination chain. - uint256 totalDestChainGas = destChainConfig.destGasOverhead + tokenTransferGas + destCallDataCost - + _parseEVMExtraArgsFromBytes( - message.extraArgs, - destChainConfig.defaultTxGasLimit, - destChainConfig.maxPerMsgGasLimit, - destChainConfig.enforceOutOfOrder - ).gasLimit; + uint256 totalDestChainGas = destChainConfig.destGasOverhead + tokenTransferGas + destCallDataCost + gasLimit; // Total USD fee is in 36 decimals, feeTokenPrice is in 18 decimals USD for 1e18 smallest token denominations. // The result is the fee in the feeTokens smallest denominations (e.g. wei for ETH). @@ -877,10 +876,66 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, /// @param chainFamilySelector Tag to identify the target family. /// @param destAddress Dest address to validate. /// @dev precondition - assumes the family tag is correct and validated. - function _validateDestFamilyAddress(bytes4 chainFamilySelector, bytes memory destAddress) internal pure { + function _validateDestFamilyAddress( + bytes4 chainFamilySelector, + bytes memory destAddress, + uint256 gasLimit + ) internal pure { if (chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_EVM) { - Internal._validateEVMAddress(destAddress); + return Internal._validateEVMAddress(destAddress); } + if (chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_SVM) { + return Internal._validateSVMAddress(destAddress, gasLimit > 0); + } + revert InvalidChainFamilySelector(chainFamilySelector); + } + + function _resolveGasLimitForDestination( + bytes calldata extraArgs, + DestChainConfig memory destChainConfig + ) internal pure returns (uint256) { + if (destChainConfig.chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_EVM) { + return _parseEVMExtraArgsFromBytes( + extraArgs, + destChainConfig.defaultTxGasLimit, + destChainConfig.maxPerMsgGasLimit, + destChainConfig.enforceOutOfOrder + ).gasLimit; + } + if (destChainConfig.chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_SVM) { + return _parseSVMExtraArgsFromBytes( + extraArgs, destChainConfig.maxPerMsgGasLimit, destChainConfig.enforceOutOfOrder + ).computeUnits; + } + revert InvalidChainFamilySelector(destChainConfig.chainFamilySelector); + } + + /// @notice Parse and validate the SVM specific Extra Args Bytes. + function _parseSVMExtraArgsFromBytes( + bytes calldata extraArgs, + uint256 maxPerMsgGasLimit, + bool enforcedOutOfOrder + ) internal pure returns (Client.SVMExtraArgsV1 memory svmExtraArgs) { + if (extraArgs.length == 0) { + revert InvalidExtraArgsData(); + } + + bytes4 tag = bytes4(extraArgs[:4]); + if (tag != Client.SVM_EXTRA_EXTRA_ARGS_V1_TAG) { + revert InvalidExtraArgsTag(); + } + + svmExtraArgs = abi.decode(extraArgs[4:], (Client.SVMExtraArgsV1)); + + if (enforcedOutOfOrder && !svmExtraArgs.allowOutOfOrderExecution) { + revert ExtraArgOutOfOrderExecutionMustBeTrue(); + } + + if (svmExtraArgs.computeUnits > maxPerMsgGasLimit) { + revert MessageComputeUnitLimitTooHigh(); + } + + return svmExtraArgs; } /// @dev Convert the extra args bytes into a struct with validations against the dest chain config. @@ -929,7 +984,6 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, // Clients may still include it but it will be ignored. return Client.EVMExtraArgsV2({gasLimit: abi.decode(argsData, (uint256)), allowOutOfOrderExecution: false}); } - revert InvalidExtraArgsTag(); } @@ -943,6 +997,7 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, DestChainConfig memory destChainConfig, uint256 dataLength, uint256 numberOfTokens, + uint256 gasLimit, bytes memory receiver ) internal pure { // Check that payload is formed correctly. @@ -952,7 +1007,7 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, if (numberOfTokens > uint256(destChainConfig.maxNumberOfTokensPerMsg)) { revert UnsupportedNumberOfTokens(numberOfTokens, destChainConfig.maxNumberOfTokensPerMsg); } - _validateDestFamilyAddress(destChainConfig.chainFamilySelector, receiver); + _validateDestFamilyAddress(destChainConfig.chainFamilySelector, receiver, gasLimit); } /// @inheritdoc IFeeQuoter @@ -983,16 +1038,42 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, if (msgFeeJuels > i_maxFeeJuelsPerMsg) revert MessageFeeTooHigh(msgFeeJuels, i_maxFeeJuelsPerMsg); - uint64 defaultTxGasLimit = s_destChainConfigs[destChainSelector].defaultTxGasLimit; + (convertedExtraArgs, isOutOfOrderExecution) = + _processChainFamilySelector(destChainSelector, sourceTokenAmounts.length > 0, extraArgs); - // NOTE: Only EVM chains are supported for now, additional validation logic will be added when supporting other - // chain families to parse non-EVM args. - // Since the message is called after getFee, which will already validate the params, no validation is necessary. - Client.EVMExtraArgsV2 memory parsedExtraArgs = _parseUnvalidatedEVMExtraArgsFromBytes(extraArgs, defaultTxGasLimit); - isOutOfOrderExecution = parsedExtraArgs.allowOutOfOrderExecution; destExecDataPerToken = _processPoolReturnData(destChainSelector, onRampTokenTransfers, sourceTokenAmounts); - return (msgFeeJuels, isOutOfOrderExecution, Client._argsToBytes(parsedExtraArgs), destExecDataPerToken); + return (msgFeeJuels, isOutOfOrderExecution, convertedExtraArgs, destExecDataPerToken); + } + + /// @notice Parses the extra Args based on the chain family selector. Isolated into a separate function + /// as it was the only way to prevent a stack too deep error, and makes future chain family additions easier. + function _processChainFamilySelector( + uint64 destChainSelector, + bool isMessageWithTokenTransfer, + bytes calldata extraArgs + ) internal view returns (bytes memory, bool) { + DestChainConfig memory destChainConfig = s_destChainConfigs[destChainSelector]; + if (destChainConfig.chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_EVM) { + // Since the message is called after getFee, which already validates the params, no validation is necessary. + Client.EVMExtraArgsV2 memory parsedExtraArgs = + _parseUnvalidatedEVMExtraArgsFromBytes(extraArgs, destChainConfig.defaultTxGasLimit); + + return (Client._argsToBytes(parsedExtraArgs), parsedExtraArgs.allowOutOfOrderExecution); + } + if (destChainConfig.chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_SVM) { + bytes32 tokenReceiver = _parseSVMExtraArgsFromBytes( + extraArgs, destChainConfig.maxPerMsgGasLimit, destChainConfig.enforceOutOfOrder + ).tokenReceiver; + if (isMessageWithTokenTransfer && tokenReceiver == bytes32(0)) { + revert InvalidTokenReceiver(); + } + + // ExtraArgs are required on SVM, meaning the supplied extraArgs are either invalid and we would have reverted + // or we have valid extraArgs and we can return them without having to re-encode them. + return (extraArgs, true); + } + revert InvalidChainFamilySelector(destChainConfig.chainFamilySelector); } /// @notice Validates pool return data. @@ -1020,12 +1101,13 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, } } - _validateDestFamilyAddress(chainFamilySelector, onRampTokenTransfers[i].destTokenAddress); + // We pass '1' here so that SVM validation requires a non-zero token address. + // The 'gasLimit' parameter isn't actually used for gas in this context; it simply + // signals that the address must not be zero on SVM. + _validateDestFamilyAddress(chainFamilySelector, onRampTokenTransfers[i].destTokenAddress, 1); FeeQuoter.TokenTransferFeeConfig memory tokenTransferFeeConfig = s_tokenTransferFeeConfig[destChainSelector][sourceToken]; - // NOTE: Only EVM chains' gas model is supported for now, additional fee logic for non-EVM chains will - // be required in the future with parsing based on chain family selector. uint32 destGasAmount = tokenTransferFeeConfig.isEnabled ? tokenTransferFeeConfig.destGasOverhead : s_destChainConfigs[destChainSelector].defaultTokenDestGasOverhead; @@ -1067,12 +1149,9 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, uint64 destChainSelector = destChainConfigArgs[i].destChainSelector; DestChainConfig memory destChainConfig = destChainConfigArg.destChainConfig; - // destChainSelector must be non-zero, defaultTxGasLimit must be set, and must be less than maxPerMsgGasLimit. - // Only EVM chains are supported for now, additional validation logic will be added when supporting other chain - // families + // destChainSelector must be non-zero, defaultTxGasLimit must be set, must be less than maxPerMsgGasLimit if ( destChainSelector == 0 || destChainConfig.defaultTxGasLimit == 0 - || destChainConfig.chainFamilySelector != Internal.CHAIN_FAMILY_SELECTOR_EVM || destChainConfig.defaultTxGasLimit > destChainConfig.maxPerMsgGasLimit ) { revert InvalidDestChainConfig(destChainSelector); diff --git a/contracts/src/v0.8/ccip/libraries/Client.sol b/contracts/src/v0.8/ccip/libraries/Client.sol index b1e1ca4a7c5..cde66e46cc0 100644 --- a/contracts/src/v0.8/ccip/libraries/Client.sol +++ b/contracts/src/v0.8/ccip/libraries/Client.sol @@ -42,6 +42,9 @@ library Client { // bytes4(keccak256("CCIP EVMExtraArgsV2")); bytes4 public constant EVM_EXTRA_ARGS_V2_TAG = 0x181dcf10; + // bytes4(keccak256("CCIP SVMExtraArgsV1")); + bytes4 public constant SVM_EXTRA_EXTRA_ARGS_V1_TAG = 0x1f3b3aba; + /// @param gasLimit: gas limit for the callback on the destination chain. /// @param allowOutOfOrderExecution: if true, it indicates that the message can be executed in any order relative to /// other messages from the same sender. This value's default varies by chain. On some chains, a particular value is @@ -51,9 +54,23 @@ library Client { bool allowOutOfOrderExecution; } + struct SVMExtraArgsV1 { + uint32 computeUnits; + uint64 accountIsWritableBitmap; + bool allowOutOfOrderExecution; + bytes32 tokenReceiver; + bytes32[] accounts; + } + function _argsToBytes( EVMExtraArgsV2 memory extraArgs ) internal pure returns (bytes memory bts) { return abi.encodeWithSelector(EVM_EXTRA_ARGS_V2_TAG, extraArgs); } + + function _svmArgsToBytes( + SVMExtraArgsV1 memory extraArgs + ) internal pure returns (bytes memory bts) { + return abi.encodeWithSelector(SVM_EXTRA_EXTRA_ARGS_V1_TAG, extraArgs); + } } diff --git a/contracts/src/v0.8/ccip/libraries/Internal.sol b/contracts/src/v0.8/ccip/libraries/Internal.sol index 443ea22a107..435e26733a9 100644 --- a/contracts/src/v0.8/ccip/libraries/Internal.sol +++ b/contracts/src/v0.8/ccip/libraries/Internal.sol @@ -10,6 +10,7 @@ import {MerkleMultiProof} from "../libraries/MerkleMultiProof.sol"; /// expect to have migrated to a new version by then. library Internal { error InvalidEVMAddress(bytes encodedAddress); + error InvalidSVMAddress(bytes SVMAddress); /// @dev We limit return data to a selector plus 4 words. This is to avoid malicious contracts from returning /// large amounts of data and causing repeated out-of-gas scenarios. @@ -166,16 +167,23 @@ library Internal { /// @notice This methods provides validation for parsing abi encoded addresses by ensuring the address is within the /// EVM address space. If it isn't it will revert with an InvalidEVMAddress error, which we can catch and handle /// more gracefully than a revert from abi.decode. - /// @return The address if it is valid, the function will revert otherwise. function _validateEVMAddress( bytes memory encodedAddress - ) internal pure returns (address) { + ) internal pure { if (encodedAddress.length != 32) revert InvalidEVMAddress(encodedAddress); uint256 encodedAddressUint = abi.decode(encodedAddress, (uint256)); if (encodedAddressUint > type(uint160).max || encodedAddressUint < PRECOMPILE_SPACE) { revert InvalidEVMAddress(encodedAddress); } - return address(uint160(encodedAddressUint)); + } + + function _validateSVMAddress(bytes memory encodedAddress, bool mustBeNonZero) internal pure { + if (encodedAddress.length != 32) revert InvalidSVMAddress(encodedAddress); + if (mustBeNonZero) { + if (abi.decode(encodedAddress, (bytes32)) == bytes32(0)) { + revert InvalidSVMAddress(encodedAddress); + } + } } /// @notice Enum listing the possible message execution states within the offRamp contract. @@ -267,6 +275,9 @@ library Internal { // bytes4(keccak256("CCIP ChainFamilySelector EVM")); bytes4 public constant CHAIN_FAMILY_SELECTOR_EVM = 0x2812d52c; + // bytes4(keccak256("CCIP ChainFamilySelector SVM")); + bytes4 public constant CHAIN_FAMILY_SELECTOR_SVM = 0x1e10bdc4; + /// @dev Holds a merkle root and interval for a source chain so that an array of these can be passed in the CommitReport. /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. /// @dev inefficient struct packing intentionally chosen to maintain order of specificity. Not a storage struct so impact is minimal. diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol index c598eedc0d1..242b513cf5a 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol @@ -109,16 +109,4 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { ); s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); } - - function test_RevertWhen_InvalidChainFamilySelector() public { - FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); - FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; - - destChainConfigArg.destChainConfig.chainFamilySelector = bytes4(uint32(1)); - - vm.expectRevert( - abi.encodeWithSelector(FeeQuoter.InvalidDestChainConfig.selector, destChainConfigArg.destChainSelector) - ); - s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); - } } diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol index 40db39dcb87..67ff5ae4ede 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol @@ -205,13 +205,24 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); } - // Reverts + function test_SolChainFamilySelector() public { + // Update config to enforce allowOutOfOrderExecution = true. + vm.stopPrank(); + vm.startPrank(OWNER); - function test_RevertWhen_DestinationChainNotEnabled() public { - vm.expectRevert(abi.encodeWithSelector(FeeQuoter.DestinationChainNotEnabled.selector, DEST_CHAIN_SELECTOR + 1)); - s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR + 1, _generateEmptyMessage()); + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + destChainConfigArgs[0].destChainConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_SVM; + + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + vm.stopPrank(); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage2SVM(); + + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); } + // Reverts + function test_RevertWhen_EnforceOutOfOrder() public { // Update config to enforce allowOutOfOrderExecution = true. vm.stopPrank(); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol index 5e41f4ee223..ba2bde126c8 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol @@ -5,7 +5,7 @@ import {FeeQuoter} from "../../FeeQuoter.sol"; import {Client} from "../../libraries/Client.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; -contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { +contract FeeQuoter_resolveGasLimitForDestination is FeeQuoterSetup { FeeQuoter.DestChainConfig private s_destChainConfig; function setUp() public virtual override { @@ -13,6 +13,14 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { s_destChainConfig = _generateFeeQuoterDestChainConfigArgs()[0].destChainConfig; } + function test_EVMExtraArgsV1TagSelector() public view { + assertEq(Client.EVM_EXTRA_ARGS_V1_TAG, bytes4(keccak256("CCIP EVMExtraArgsV1"))); + } + + function test_EVMExtraArgsV2TagSelector() public view { + assertEq(Client.EVM_EXTRA_ARGS_V2_TAG, bytes4(keccak256("CCIP EVMExtraArgsV2"))); + } + function test_EVMExtraArgsV1() public view { Client.EVMExtraArgsV1 memory inputArgs = Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT}); bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseSVMExtraArgsFromBytes.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseSVMExtraArgsFromBytes.t.sol new file mode 100644 index 00000000000..882fc17fe8f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseSVMExtraArgsFromBytes.t.sol @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {Client} from "../../libraries/Client.sol"; + +import {Internal} from "../../libraries/Internal.sol"; +import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; + +contract FeeQuoter_parseSVMExtraArgsFromBytes is FeeQuoterSetup { + FeeQuoter.DestChainConfig private s_destChainConfig; + + /// @dev a Valid pubkey is one that is 32 bytes long, and that's it since no other validation can be performed + /// within the constraints of the EVM. + bytes32 internal constant VALID_SOL_PUBKEY = keccak256("SOL_PUBKEY"); + + function setUp() public virtual override { + super.setUp(); + s_destChainConfig = _generateFeeQuoterDestChainConfigArgs()[0].destChainConfig; + s_destChainConfig.enforceOutOfOrder = true; // Enforcing out of order execution for messages to SVM + s_destChainConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_SVM; + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigs = new FeeQuoter.DestChainConfigArgs[](1); + destChainConfigs[0] = + FeeQuoter.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, destChainConfig: s_destChainConfig}); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigs); + } + + function test_SVMExtraArgsV1TagSelector() public view { + assertEq(Client.SVM_EXTRA_EXTRA_ARGS_V1_TAG, bytes4(keccak256("CCIP SVMExtraArgsV1"))); + } + + function test_SVMExtraArgsV1() public view { + bytes32[] memory solAccounts = new bytes32[](1); + solAccounts[0] = VALID_SOL_PUBKEY; + + Client.SVMExtraArgsV1 memory inputArgs = Client.SVMExtraArgsV1({ + computeUnits: GAS_LIMIT, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), + allowOutOfOrderExecution: true, + accounts: solAccounts + }); + + bytes memory inputExtraArgs = Client._svmArgsToBytes(inputArgs); + + Client.SVMExtraArgsV1 memory expectedOutputArgs = Client.SVMExtraArgsV1({ + computeUnits: GAS_LIMIT, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), + allowOutOfOrderExecution: true, + accounts: solAccounts + }); + + vm.assertEq( + abi.encode(s_feeQuoter.parseSVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig)), + abi.encode(expectedOutputArgs) + ); + } + + // Reverts + function test_RevertWhen_ExtraArgsAreEmpty() public { + bytes memory inputExtraArgs = new bytes(0); + vm.expectRevert(FeeQuoter.InvalidExtraArgsData.selector); + s_feeQuoter.parseSVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } + + function test_RevertWhen_InvalidExtraArgsTag() public { + bytes memory inputExtraArgs = abi.encodeWithSelector(bytes4(0)); + + vm.expectRevert(FeeQuoter.InvalidExtraArgsTag.selector); + s_feeQuoter.parseSVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } + + function test_RevertWhen_SVMMessageGasLimitTooHigh() public { + Client.SVMExtraArgsV1 memory inputArgs = Client.SVMExtraArgsV1({ + computeUnits: s_destChainConfig.maxPerMsgGasLimit + 1, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), + allowOutOfOrderExecution: true, + accounts: new bytes32[](0) + }); + + bytes memory inputExtraArgs = Client._svmArgsToBytes(inputArgs); + + vm.expectRevert(FeeQuoter.MessageComputeUnitLimitTooHigh.selector); + s_feeQuoter.parseSVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } + + function test_RevertWhen_ExtraArgOutOfOrderExecutionIsFalse() public { + bytes memory inputExtraArgs = abi.encodeWithSelector( + Client.SVM_EXTRA_EXTRA_ARGS_V1_TAG, + Client.SVMExtraArgsV1({ + computeUnits: 1_000_000, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), + allowOutOfOrderExecution: false, // mismatch with enforcedOutOfOrder = true + accounts: new bytes32[](0) + }) + ); + + vm.expectRevert(FeeQuoter.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + s_feeQuoter.parseSVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } +} diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processChainFamilySelector.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processChainFamilySelector.t.sol new file mode 100644 index 00000000000..e90034d3a9e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processChainFamilySelector.t.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; + +contract FeeQuoter_processChainFamilySelector is FeeQuoterSetup { + uint64 internal constant SVM_SELECTOR = SOURCE_CHAIN_SELECTOR; + uint64 internal constant EVM_SELECTOR = DEST_CHAIN_SELECTOR; + uint64 internal constant INVALID_SELECTOR = 99; + + function setUp() public virtual override { + super.setUp(); + + // 1. Configure an EVM chain + FeeQuoter.DestChainConfig memory evmConfig; + evmConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_EVM; + evmConfig.defaultTxGasLimit = 500_000; + evmConfig.maxPerMsgGasLimit = 1_000_000; // Example + evmConfig.enforceOutOfOrder = false; // Example + + // 2. Configure an SVM chain + FeeQuoter.DestChainConfig memory svmConfig; + svmConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_SVM; + svmConfig.defaultTxGasLimit = 2_000_000; + svmConfig.maxPerMsgGasLimit = 3_000_000; // Example + svmConfig.enforceOutOfOrder = true; + + // Apply both configs + FeeQuoter.DestChainConfigArgs[] memory configs = new FeeQuoter.DestChainConfigArgs[](2); + configs[0] = FeeQuoter.DestChainConfigArgs({destChainSelector: EVM_SELECTOR, destChainConfig: evmConfig}); + configs[1] = FeeQuoter.DestChainConfigArgs({destChainSelector: SVM_SELECTOR, destChainConfig: svmConfig}); + s_feeQuoter.applyDestChainConfigUpdates(configs); + } + + // ---------------------------------------------------------------- + // TEST: EVM path + // ---------------------------------------------------------------- + function test_processChainFamilySelectorEVM() public { + Client.EVMExtraArgsV2 memory evmArgs = Client.EVMExtraArgsV2({gasLimit: 400_000, allowOutOfOrderExecution: true}); + bytes memory encodedEvmArgs = Client._argsToBytes(evmArgs); + + (bytes memory resultBytes, bool outOfOrder) = s_feeQuoter.processChainFamilySelector( + EVM_SELECTOR, + false, // isMessageWithTokenTransfer + encodedEvmArgs + ); + + assertEq(resultBytes, encodedEvmArgs, "Should return the same EVM-encoded bytes"); + assertEq(outOfOrder, evmArgs.allowOutOfOrderExecution, "Out-of-order mismatch"); + } + + // ---------------------------------------------------------------- + // TEST: SVM path + // ---------------------------------------------------------------- + function test_processChainFamilySelectorSVM_WithTokenTransfer() public { + // Construct an SVMExtraArgsV1 with a non-zero tokenReceiver + Client.SVMExtraArgsV1 memory svmArgs = Client.SVMExtraArgsV1({ + computeUnits: 1_500_000, // within the limit + accountIsWritableBitmap: 0, + tokenReceiver: bytes32("someReceiver"), + allowOutOfOrderExecution: true, + accounts: new bytes32[](0) + }); + bytes memory encodedSvmArgs = Client._svmArgsToBytes(svmArgs); + + (bytes memory resultBytes, bool outOfOrder) = s_feeQuoter.processChainFamilySelector( + SVM_SELECTOR, + true, // isMessageWithTokenTransfer + encodedSvmArgs + ); + + // The function should NOT revert since tokenReceiver != 0 + // Check that it returned the SVM-encoded bytes + assertEq(resultBytes, encodedSvmArgs, "Should return the same SVM-encoded bytes"); + // The function always returns `true` for outOfOrder on SVM + assertTrue(outOfOrder, "Out-of-order for SVM must be true"); + } + + function test_processChainFamilySelectorSVM_NoTokenTransfer() public { + Client.SVMExtraArgsV1 memory svmArgs = Client.SVMExtraArgsV1({ + computeUnits: 2_000_000, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), // zero is fine if not transferring tokens + allowOutOfOrderExecution: true, + accounts: new bytes32[](0) + }); + bytes memory encodedSvmArgs = Client._svmArgsToBytes(svmArgs); + + (bytes memory resultBytes, bool outOfOrder) = s_feeQuoter.processChainFamilySelector( + SVM_SELECTOR, + false, // no token transfer + encodedSvmArgs + ); + + // Should succeed with outOfOrder = true + assertEq(resultBytes, encodedSvmArgs, "Should return the SVM-encoded bytes"); + assertTrue(outOfOrder, "Out-of-order should be true for SVM"); + } + + // TEST: SVM path → reverts + + function test_processChainFamilySelector_RevertWhen_TokenTransferNoTokenReceiver() public { + // Construct an SVMExtraArgsV1 with tokenReceiver == 0 + Client.SVMExtraArgsV1 memory svmArgs = Client.SVMExtraArgsV1({ + computeUnits: 1_500_000, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), // <-- zero + allowOutOfOrderExecution: true, + accounts: new bytes32[](0) + }); + bytes memory encodedSvmArgs = Client._svmArgsToBytes(svmArgs); + + vm.expectRevert(FeeQuoter.InvalidTokenReceiver.selector); + + s_feeQuoter.processChainFamilySelector( + SVM_SELECTOR, + true, // token transfer + encodedSvmArgs + ); + } + + function test_processChainFamilySelector_RevertWhen_InvalidChainFamilySelector() public { + // Provide random extraArgs + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.InvalidChainFamilySelector.selector, bytes4(0))); + + s_feeQuoter.processChainFamilySelector(INVALID_SELECTOR, false, "0x1234"); + } +} diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol index 5041ddef667..92b59a7e592 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol @@ -128,6 +128,47 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } + function test_processMessageArgs_WithSVMExtraArgsV1() public { + // Apply the chain update to set the chain family selector to SOL + FeeQuoter.DestChainConfig memory s_destChainConfig = _generateFeeQuoterDestChainConfigArgs()[0].destChainConfig; + s_destChainConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_SVM; + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigs = new FeeQuoter.DestChainConfigArgs[](1); + destChainConfigs[0] = + FeeQuoter.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, destChainConfig: s_destChainConfig}); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigs); + + bytes memory extraArgs = Client._svmArgsToBytes( + Client.SVMExtraArgsV1({ + computeUnits: 0, + accountIsWritableBitmap: 0, + tokenReceiver: bytes32(0), + allowOutOfOrderExecution: true, + accounts: new bytes32[](0) + }) + ); + + ( + /* uint256 msgFeeJuels */ + , + bool isOutOfOrderExecution, + bytes memory convertedExtraArgs, + /* destExecDataPerToken */ + ) = s_feeQuoter.processMessageArgs( + DEST_CHAIN_SELECTOR, + s_sourceTokens[0], + 0, + extraArgs, + new Internal.EVM2AnyTokenTransfer[](0), + new Client.EVMTokenAmount[](0) + ); + + assertTrue(isOutOfOrderExecution); + assertEq( + convertedExtraArgs, Client._svmArgsToBytes(s_feeQuoter.parseSVMExtraArgsFromBytes(extraArgs, s_destChainConfig)) + ); + } + // Reverts function test_RevertWhen_processMessageArgs_MessageFeeTooHigh() public { diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol index d11d8baddef..ae4e4766bd9 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol @@ -1,42 +1,49 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; +import {FeeQuoter} from "../../FeeQuoter.sol"; import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_validateDestFamilyAddress is FeeQuoterSetup { function test_ValidEVMAddress() public view { bytes memory encodedAddress = abi.encode(address(10000)); - s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, encodedAddress); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, encodedAddress, 0); } - function test_ValidNonEVMAddress() public view { - s_feeQuoter.validateDestFamilyAddress(bytes4(uint32(1)), abi.encode(type(uint208).max)); + function test_ValidSVMAddress() public view { + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_SVM, abi.encode(type(uint208).max), 0); } // Reverts + function test_RevertWhen_InvalidChainFamilySelector() public { + bytes4 selector = bytes4(0xdeadbeef); + bytes memory encodedAddress = abi.encode(address(10000)); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.InvalidChainFamilySelector.selector, selector)); + s_feeQuoter.validateDestFamilyAddress(selector, encodedAddress, 0); + } function test_RevertWhen_InvalidEVMAddress() public { bytes memory invalidAddress = abi.encode(type(uint208).max); vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); - s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress, 0); } function test_RevertWhen_InvalidEVMAddressEncodePacked() public { bytes memory invalidAddress = abi.encodePacked(address(234)); vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); - s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress, 0); } function test_RevertWhen_InvalidEVMAddressPrecompiles() public { for (uint160 i = 0; i < Internal.PRECOMPILE_SPACE; ++i) { bytes memory invalidAddress = abi.encode(address(i)); vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); - s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress, 0); } s_feeQuoter.validateDestFamilyAddress( - Internal.CHAIN_FAMILY_SELECTOR_EVM, abi.encode(address(uint160(Internal.PRECOMPILE_SPACE))) + Internal.CHAIN_FAMILY_SELECTOR_EVM, abi.encode(address(uint160(Internal.PRECOMPILE_SPACE))), 0 ); } } diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol index 006e3251467..5bf9b845eae 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol @@ -348,6 +348,25 @@ contract FeeQuoterFeeSetup is FeeQuoterSetup { }); } + // Used to generate a message with a specific extraArgs tag for SVM + function _generateEmptyMessage2SVM() public view returns (Client.EVM2AnyMessage memory) { + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: s_sourceFeeToken, + extraArgs: Client._svmArgsToBytes( + Client.SVMExtraArgsV1({ + computeUnits: GAS_LIMIT, + accountIsWritableBitmap: 0, + allowOutOfOrderExecution: true, + tokenReceiver: bytes32(0), + accounts: new bytes32[](0) + }) + ) + }); + } + function _generateSingleTokenMessage( address token, uint256 amount diff --git a/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol b/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol index acee4dfda2f..6e4233b7d1f 100644 --- a/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol +++ b/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol @@ -82,8 +82,27 @@ contract FeeQuoterHelper is FeeQuoter { ); } - function validateDestFamilyAddress(bytes4 chainFamilySelector, bytes memory destAddress) external pure { - _validateDestFamilyAddress(chainFamilySelector, destAddress); + function parseSVMExtraArgsFromBytes( + bytes calldata extraArgs, + DestChainConfig memory destChainConfig + ) external pure returns (Client.SVMExtraArgsV1 memory) { + return _parseSVMExtraArgsFromBytes(extraArgs, destChainConfig.maxPerMsgGasLimit, destChainConfig.enforceOutOfOrder); + } + + function processChainFamilySelector( + uint64 chainFamilySelector, + bool isMessageWithTokenTransfer, + bytes calldata extraArgs + ) external view returns (bytes memory, bool) { + return _processChainFamilySelector(chainFamilySelector, isMessageWithTokenTransfer, extraArgs); + } + + function validateDestFamilyAddress( + bytes4 chainFamilySelector, + bytes memory destAddress, + uint256 gasLimit + ) external pure { + _validateDestFamilyAddress(chainFamilySelector, destAddress, gasLimit); } function calculateRebasedValue( @@ -93,4 +112,11 @@ contract FeeQuoterHelper is FeeQuoter { ) external pure returns (uint224) { return _calculateRebasedValue(dataFeedDecimal, tokenDecimal, feedValue); } + + function resolveGasLimitForDestination( + bytes calldata extraArgs, + DestChainConfig memory destChainConfig + ) external pure returns (uint256 gasLimit) { + return _resolveGasLimitForDestination(extraArgs, destChainConfig); + } } diff --git a/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go b/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go index c2804d46a32..a8ee1906951 100644 --- a/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go +++ b/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go @@ -158,8 +158,8 @@ type KeystoneFeedsPermissionHandlerPermission struct { } var FeeQuoterMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"priceUpdaters\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]},{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"FEE_BASE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"KEYSTONE_PRICE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyAuthorizedCallerUpdates\",\"inputs\":[{\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\",\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"components\":[{\"name\":\"addedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"removedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyDestChainConfigUpdates\",\"inputs\":[{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyFeeTokensUpdates\",\"inputs\":[{\"name\":\"feeTokensToRemove\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokensToAdd\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyPremiumMultiplierWeiPerEthUpdates\",\"inputs\":[{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyTokenTransferFeeConfigUpdates\",\"inputs\":[{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"tokensToUseDefaultFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigRemoveArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"convertTokenAmount\",\"inputs\":[{\"name\":\"fromToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"fromTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toToken\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAllAuthorizedCallers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestinationChainGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeTokens\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPremiumMultiplierWeiPerEth\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStaticConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenAndGasPrices\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"tokenPrice\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"gasPriceValue\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPriceFeedConfig\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrices\",\"inputs\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenTransferFeeConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedFee\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structClient.EVM2AnyMessage\",\"components\":[{\"name\":\"receiver\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onReport\",\"inputs\":[{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processMessageArgs\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"onRampTokenTransfers\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.EVM2AnyTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destTokenAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"destExecData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"sourceTokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"isOutOfOrderExecution\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"convertedExtraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destExecDataPerToken\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setReportPermissions\",\"inputs\":[{\"name\":\"permissions\",\"type\":\"tuple[]\",\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission[]\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updatePrices\",\"inputs\":[{\"name\":\"priceUpdates\",\"type\":\"tuple\",\"internalType\":\"structInternal.PriceUpdates\",\"components\":[{\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"usdPerToken\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]},{\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.GasPriceUpdate[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"usdPerUnitGas\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateTokenPriceFeeds\",\"inputs\":[{\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AuthorizedCallerAdded\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AuthorizedCallerRemoved\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainAdded\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenAdded\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenRemoved\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PremiumMultiplierWeiPerEthUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PriceFeedPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"priceFeedConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ReportPermissionSet\",\"inputs\":[{\"name\":\"reportId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"permission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigDeleted\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerUnitGasUpdated\",\"inputs\":[{\"name\":\"destChain\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DataFeedValueOutOfUint224Range\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DestinationChainNotEnabled\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ExtraArgOutOfOrderExecutionMustBeTrue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FeeTokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidDestBytesOverhead\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidEVMAddress\",\"inputs\":[{\"name\":\"encodedAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidExtraArgsTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidFeeRange\",\"inputs\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStaticConfig\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageFeeTooHigh\",\"inputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MessageGasLimitTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageTooLarge\",\"inputs\":[{\"name\":\"maxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actualSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReportForwarderUnauthorized\",\"inputs\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"}]},{\"type\":\"error\",\"name\":\"SourceTokenDataTooLarge\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"StaleGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timePassed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"TokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnsupportedNumberOfTokens\",\"inputs\":[{\"name\":\"numberOfTokens\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ZeroAddressNotAllowed\",\"inputs\":[]}]", - Bin: "0x60e0604052346110505761755180380380610019816112bc565b9283398101908082036101208112611050576060136110505761003a61127e565b81516001600160601b038116810361105057815261005a602083016112e1565b906020810191825261006e604084016112f5565b6040820190815260608401516001600160401b038111611050578561009491860161131d565b60808501519094906001600160401b03811161105057866100b691830161131d565b60a08201519096906001600160401b0381116110505782019080601f830112156110505781516100ed6100e882611306565b6112bc565b9260208085848152019260071b8201019083821161105057602001915b8183106112095750505060c08301516001600160401b0381116110505783019781601f8a011215611050578851986101446100e88b611306565b996020808c838152019160051b830101918483116110505760208101915b8383106110a7575050505060e08401516001600160401b0381116110505784019382601f8601121561105057845161019c6100e882611306565b9560208088848152019260061b8201019085821161105057602001915b81831061106b57505050610100810151906001600160401b038211611050570182601f82011215611050578051906101f36100e883611306565b93602061028081878681520194028301019181831161105057602001925b828410610e8e57505050503315610e7d57600180546001600160a01b031916331790556020986102408a6112bc565b9760008952600036813761025261129d565b998a52888b8b015260005b89518110156102c4576001906001600160a01b0361027b828d6113b6565b51168d610287826115a2565b610294575b50500161025d565b7fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758091604051908152a1388d61028c565b508a985089519660005b885181101561033f576001600160a01b036102e9828b6113b6565b511690811561032e577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8c8361032060019561152a565b50604051908152a1016102ce565b6342bcdf7f60e11b60005260046000fd5b5081518a985089906001600160a01b0316158015610e6b575b8015610e5c575b610e4b5791516001600160a01b031660a05290516001600160601b03166080525163ffffffff1660c052610392866112bc565b9360008552600036813760005b855181101561040e576001906103c76001600160a01b036103c0838a6113b6565b5116611437565b6103d2575b0161039f565b818060a01b036103e282896113b6565b51167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26103cc565b508694508560005b84518110156104855760019061043e6001600160a01b0361043783896113b6565b5116611569565b610449575b01610416565b818060a01b0361045982886113b6565b51167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2610443565b508593508460005b835181101561054757806104a3600192866113b6565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf606089858060a01b038451169301518360005260078b5260406000209060ff878060a01b038251169283898060a01b03198254161781558d8301908151604082549501948460a81b8651151560a81b16918560a01b9060a01b169061ffff60a01b19161717905560405193845251168c8301525115156040820152a20161048d565b5091509160005b8251811015610ae35761056181846113b6565b51856001600160401b0361057584876113b6565b5151169101519080158015610ad0575b8015610ab0575b8015610a92575b610a7e57600081815260098852604090205460019392919060081b6001600160e01b03191661093657807f71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad604051806106fc868291909161024063ffffffff8161026084019580511515855261ffff602082015116602086015282604082015116604086015282606082015116606086015282608082015116608086015260ff60a08201511660a086015260ff60c08201511660c086015261ffff60e08201511660e0860152826101008201511661010086015261ffff6101208201511661012086015261ffff610140820151166101408601528260e01b61016082015116610160860152610180810151151561018086015261ffff6101a0820151166101a0860152826101c0820151166101c0860152826101e0820151166101e086015260018060401b03610200820151166102008601528261022082015116610220860152015116910152565b0390a25b60005260098752826040600020825115158382549162ffff008c83015160081b169066ffffffff000000604084015160181b166affffffff00000000000000606085015160381b16926effffffff0000000000000000000000608086015160581b169260ff60781b60a087015160781b169460ff60801b60c088015160801b169161ffff60881b60e089015160881b169063ffffffff60981b6101008a015160981b169361ffff60b81b6101208b015160b81b169661ffff60c81b6101408c015160c81b169963ffffffff60d81b6101608d015160081c169b61018060ff60f81b910151151560f81b169c8f8060f81b039a63ffffffff60d81b199961ffff60c81b199861ffff60b81b199763ffffffff60981b199661ffff60881b199560ff60801b199460ff60781b19936effffffff0000000000000000000000199260ff6affffffff000000000000001992169066ffffffffffffff19161716171617161716171617161716171617161716179063ffffffff60d81b1617178155019061ffff6101a0820151169082549165ffffffff00006101c083015160101b169269ffffffff0000000000006101e084015160301b166a01000000000000000000008860901b0361020085015160501b169263ffffffff60901b61022086015160901b169461024063ffffffff60b01b91015160b01b169563ffffffff60b01b199363ffffffff60901b19926a01000000000000000000008c60901b0319918c8060501b03191617161716171617171790550161054e565b807f2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e360405180610a76868291909161024063ffffffff8161026084019580511515855261ffff602082015116602086015282604082015116604086015282606082015116606086015282608082015116608086015260ff60a08201511660a086015260ff60c08201511660c086015261ffff60e08201511660e0860152826101008201511661010086015261ffff6101208201511661012086015261ffff610140820151166101408601528260e01b61016082015116610160860152610180810151151561018086015261ffff6101a0820151166101a0860152826101c0820151166101c0860152826101e0820151166101e086015260018060401b03610200820151166102008601528261022082015116610220860152015116910152565b0390a2610700565b63c35aa79d60e01b60005260045260246000fd5b5063ffffffff6101e08301511663ffffffff60608401511610610593565b506101608201516001600160e01b031916630a04b54b60e21b141561058c565b5063ffffffff6101e08301511615610585565b84828560005b8151811015610b69576001906001600160a01b03610b0782856113b6565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d86848060401b0381610b3d86896113b6565b510151168360005260088252604060002081878060401b0319825416179055604051908152a201610ae9565b83600184610b76836112bc565b9060008252600092610e46575b909282935b8251851015610d8557610b9b85846113b6565b5180516001600160401b0316939083019190855b83518051821015610d7457610bc58287926113b6565b51015184516001600160a01b0390610bde9084906113b6565b5151169063ffffffff815116908781019163ffffffff8351169081811015610d5f5750506080810163ffffffff815116898110610d48575090899291838c52600a8a5260408c20600160a01b6001900386168d528a5260408c2092825163ffffffff169380549180518d1b67ffffffff0000000016916040860192835160401b69ffff000000000000000016966060810195865160501b6dffffffff00000000000000000000169063ffffffff60701b895160701b169260a001998b60ff60901b8c51151560901b169560ff60901b199363ffffffff60701b19926dffffffff000000000000000000001991600160501b60019003191617161716171617171790556040519586525163ffffffff168c8601525161ffff1660408501525163ffffffff1660608401525163ffffffff16608083015251151560a082015260c07f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b591a3600101610baf565b6312766e0160e11b8c52600485905260245260448bfd5b6305a7b3d160e11b8c5260045260245260448afd5b505060019096019593509050610b88565b9150825b8251811015610e07576001906001600160401b03610da782866113b6565b515116828060a01b0384610dbb84886113b6565b5101511690808752600a855260408720848060a01b038316885285528660408120557f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b8780a301610d89565b604051615f1a908161163782396080518181816104d40152613273015260a051818181610517015261320a015260c05181818161053e0152613f1b0152f35b610b83565b63d794ef9560e01b60005260046000fd5b5063ffffffff8251161561035f565b5080516001600160601b031615610358565b639b15e16f60e01b60005260046000fd5b838203610280811261105057610260610ea561129d565b91610eaf87611393565b8352601f190112611050576040519161026083016001600160401b0381118482101761105557604052610ee460208701611386565b8352610ef2604087016113a7565b6020840152610f03606087016112f5565b6040840152610f14608087016112f5565b6060840152610f2560a087016112f5565b6080840152610f3660c08701611378565b60a0840152610f4760e08701611378565b60c0840152610f5961010087016113a7565b60e0840152610f6b61012087016112f5565b610100840152610f7e61014087016113a7565b610120840152610f9161016087016113a7565b610140840152610180860151916001600160e01b0319831683036110505783602093610160610280960152610fc96101a08901611386565b610180820152610fdc6101c089016113a7565b6101a0820152610fef6101e089016112f5565b6101c082015261100261020089016112f5565b6101e08201526110156102208901611393565b61020082015261102861024089016112f5565b61022082015261103b61026089016112f5565b61024082015283820152815201930192610211565b600080fd5b634e487b7160e01b600052604160045260246000fd5b60408387031261105057602060409161108261129d565b61108b866112e1565b8152611098838701611393565b838201528152019201916101b9565b82516001600160401b0381116110505782016040818803601f190112611050576110cf61129d565b906110dc60208201611393565b825260408101516001600160401b03811161105057602091010187601f8201121561105057805161110f6100e882611306565b91602060e08185858152019302820101908a821161105057602001915b81831061114b5750505091816020938480940152815201920191610162565b828b0360e081126110505760c061116061129d565b9161116a866112e1565b8352601f190112611050576040519160c08301916001600160401b038311848410176110555760e0936020936040526111a48488016112f5565b81526111b2604088016112f5565b848201526111c2606088016113a7565b60408201526111d3608088016112f5565b60608201526111e460a088016112f5565b60808201526111f560c08801611386565b60a08201528382015281520192019161112c565b8284036080811261105057606061121e61129d565b91611228866112e1565b8352601f1901126110505760809160209161124161127e565b61124c8488016112e1565b815261125a60408801611378565b8482015261126a60608801611386565b60408201528382015281520192019161010a565b60405190606082016001600160401b0381118382101761105557604052565b60408051919082016001600160401b0381118382101761105557604052565b6040519190601f01601f191682016001600160401b0381118382101761105557604052565b51906001600160a01b038216820361105057565b519063ffffffff8216820361105057565b6001600160401b0381116110555760051b60200190565b9080601f830112156110505781516113376100e882611306565b9260208085848152019260051b82010192831161105057602001905b8282106113605750505090565b6020809161136d846112e1565b815201910190611353565b519060ff8216820361105057565b5190811515820361105057565b51906001600160401b038216820361105057565b519061ffff8216820361105057565b80518210156113ca5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b80548210156113ca5760005260206000200190600090565b8054801561142157600019019061140f82826113e0565b8154906000199060031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6000818152600c602052604090205480156114f85760001981018181116114e257600b546000198101919082116114e257818103611491575b50505061147d600b6113f8565b600052600c60205260006040812055600190565b6114ca6114a26114b393600b6113e0565b90549060031b1c928392600b6113e0565b819391549060031b91821b91600019901b19161790565b9055600052600c602052604060002055388080611470565b634e487b7160e01b600052601160045260246000fd5b5050600090565b8054906801000000000000000082101561105557816114b3916001611526940181556113e0565b9055565b806000526003602052604060002054156000146115635761154c8160026114ff565b600254906000526003602052604060002055600190565b50600090565b80600052600c602052604060002054156000146115635761158b81600b6114ff565b600b5490600052600c602052604060002055600190565b60008181526003602052604090205480156114f85760001981018181116114e2576002546000198101919082116114e2578082036115fc575b5050506115e860026113f8565b600052600360205260006040812055600190565b61161e61160d6114b39360026113e0565b90549060031b1c92839260026113e0565b905560005260036020526040600020553880806115db56fe6080604052600436101561001257600080fd5b60003560e01c806241e5be1461020657806301ffc9a714610201578063061877e3146101fc57806306285c69146101f7578063181f5a77146101f25780632451a627146101ed578063325c868e146101e85780633937306f146101e357806341ed29e7146101de578063430d138c146101d957806345ac924d146101d45780634ab35b0b146101cf578063514e8cff146101ca5780636def4ce7146101c5578063770e2dc4146101c057806379ba5097146101bb5780637afac322146101b6578063805f2132146101b157806382b49eb0146101ac57806387b8d879146101a75780638da5cb5b146101a257806391a2749a1461019d578063a69c64c014610198578063bf78e03f14610193578063cdc73d511461018e578063d02641a014610189578063d63d3af214610184578063d8694ccd1461017f578063f2fde38b1461017a578063fbe3f778146101755763ffdb4b371461017057600080fd5b612d38565b612bff565b612b0b565b6125f3565b6125b9565b61253d565b6124a8565b6123bd565b6122e6565b612216565b6121c4565b611f6c565b611dc4565b611a83565b611912565b6117c2565b611567565b6113ca565b6111ab565b611140565b61103b565b610edb565b610c44565b610885565b61084b565b6107aa565b6106d9565b61047a565b610407565b6102c5565b61023b565b73ffffffffffffffffffffffffffffffffffffffff81160361022957565b600080fd5b35906102398261020b565b565b346102295760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602061029060043561027b8161020b565b6024356044359161028b8361020b565b612eed565b604051908152f35b35907fffffffff000000000000000000000000000000000000000000000000000000008216820361022957565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576004357fffffffff0000000000000000000000000000000000000000000000000000000081168103610229577fffffffff00000000000000000000000000000000000000000000000000000000602091167f805f21320000000000000000000000000000000000000000000000000000000081149081156103dd575b81156103b3575b8115610389575b506040519015158152f35b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150143861037e565b7f181f5a770000000000000000000000000000000000000000000000000000000081149150610377565b7f9b645f410000000000000000000000000000000000000000000000000000000081149150610370565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff6004356104578161020b565b166000526008602052602067ffffffffffffffff60406000205416604051908152f35b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576104b1612f36565b5060606040516104c0816105a5565b63ffffffff6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169182815273ffffffffffffffffffffffffffffffffffffffff60406020830192827f00000000000000000000000000000000000000000000000000000000000000001684520191837f00000000000000000000000000000000000000000000000000000000000000001683526040519485525116602084015251166040820152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176105c157604052565b610576565b60a0810190811067ffffffffffffffff8211176105c157604052565b6040810190811067ffffffffffffffff8211176105c157604052565b60c0810190811067ffffffffffffffff8211176105c157604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105c157604052565b6040519061023960408361061a565b604051906102396102608361061a565b919082519283825260005b8481106106c45750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b80602080928401015182828601015201610685565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610756604080519061071a818361061a565b601382527f46656551756f74657220312e362e302d6465760000000000000000000000000060208301525191829160208352602083019061067a565b0390f35b602060408183019282815284518094520192019060005b81811061077e5750505090565b825173ffffffffffffffffffffffffffffffffffffffff16845260209384019390920191600101610771565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760405180602060025491828152019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9060005b81811061083557610756856108298187038261061a565b6040519182918261075a565b8254845260209093019260019283019201610812565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602060405160248152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957806004019060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8236030112610229576108ff6142e6565b6109098280612f55565b4263ffffffff1692915060005b818110610ae35750506024019061092d8284612f55565b92905060005b83811061093c57005b8061095b610956600193610950868a612f55565b90612fd8565b61304d565b7fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e67ffffffffffffffff610aaa610a876020850194610a796109b987517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6109e86109c461065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092168252565b63ffffffff8c166020820152610a23610a09845167ffffffffffffffff1690565b67ffffffffffffffff166000526005602052604060002090565b815160209092015160e01b7fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5167ffffffffffffffff1690565b93517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610933565b80610afc610af76001936109508980612f55565b613016565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff610bde610a876020850194610bc4610b6687517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b610b716109c461065b565b63ffffffff8d166020820152610a23610b9e845173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526006602052604060002090565b5173ffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610916565b67ffffffffffffffff81116105c15760051b60200190565b8015150361022957565b359061023982610c2f565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590610c9f82610c17565b90610cad604051928361061a565b828252602460a06020840194028201019036821161022957602401925b818410610cdc57610cda83613072565b005b60a0843603126102295760405190610cf3826105c6565b8435610cfe8161020b565b825260208501357fffffffffffffffffffff00000000000000000000000000000000000000000000811681036102295760208301526040850135907fffff000000000000000000000000000000000000000000000000000000000000821682036102295782602092604060a0950152610d796060880161022e565b6060820152610d8a60808801610c39565b6080820152815201930192610cca565b6004359067ffffffffffffffff8216820361022957565b6024359067ffffffffffffffff8216820361022957565b359067ffffffffffffffff8216820361022957565b9181601f840112156102295782359167ffffffffffffffff8311610229576020838186019501011161022957565b9181601f840112156102295782359167ffffffffffffffff8311610229576020808501948460051b01011161022957565b929091610e5d9284521515602084015260806040840152608083019061067a565b906060818303910152815180825260208201916020808360051b8301019401926000915b838310610e9057505050505090565b9091929394602080610ecc837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660019603018752895161067a565b97019301930191939290610e81565b346102295760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610f12610d9a565b60243590610f1f8261020b565b60443560643567ffffffffffffffff811161022957610f42903690600401610ddd565b60849391933567ffffffffffffffff811161022957610f65903690600401610e0b565b9160a4359567ffffffffffffffff871161022957366023880112156102295786600401359567ffffffffffffffff8711610229573660248860061b8a01011161022957610756986024610fb99901966131fe565b9060409492945194859485610e3c565b602060408183019282815284518094520192019060005b818110610fed5750505090565b9091926020604082611030600194885163ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b019401929101610fe0565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295761108a903690600401610e0b565b61109381610c17565b916110a1604051938461061a565b8183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06110ce83610c17565b0160005b81811061112957505060005b8281101561111b576001906110ff6110fa8260051b8501613357565b613eba565b61110982876131ea565b5261111481866131ea565b50016110de565b604051806107568682610fc9565b60209061113461333e565b828288010152016110d2565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760206111856004356111808161020b565b614237565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295767ffffffffffffffff6111eb610d9a565b6111f361333e565b5016600052600560205260406000206040519061120f826105e2565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116825260e01c6020820152604051809161075682604081019263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b610239909291926102408061026083019561129784825115159052565b60208181015161ffff169085015260408181015163ffffffff169085015260608181015163ffffffff169085015260808181015163ffffffff169085015260a08181015160ff169085015260c08181015160ff169085015260e08181015161ffff16908501526101008181015163ffffffff16908501526101208181015161ffff16908501526101408181015161ffff1690850152610160818101517fffffffff000000000000000000000000000000000000000000000000000000001690850152610180818101511515908501526101a08181015161ffff16908501526101c08181015163ffffffff16908501526101e08181015163ffffffff16908501526102008181015167ffffffffffffffff16908501526102208181015163ffffffff1690850152015163ffffffff16910152565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610229576107566114ab6114a661140a610d9a565b600061024061141761066a565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a0820152826101c0820152826101e08201528261020082015282610220820152015267ffffffffffffffff166000526009602052604060002090565b61339b565b6040519182918261127a565b359063ffffffff8216820361022957565b359061ffff8216820361022957565b81601f82011215610229578035906114ee82610c17565b926114fc604051948561061a565b82845260208085019360061b8301019181831161022957602001925b828410611526575050505090565b6040848303126102295760206040918251611540816105e2565b61154987610dc8565b8152828701356115588161020b565b83820152815201930192611518565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957366023820112156102295780600401356115c181610c17565b916115cf604051938461061a565b8183526024602084019260051b820101903682116102295760248101925b82841061161e576024358567ffffffffffffffff821161022957611618610cda9236906004016114d7565b90613509565b833567ffffffffffffffff811161022957820160407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8236030112610229576040519061166a826105e2565b61167660248201610dc8565b8252604481013567ffffffffffffffff811161022957602491010136601f820112156102295780356116a781610c17565b916116b5604051938461061a565b818352602060e081850193028201019036821161022957602001915b8183106116f057505050918160209384809401528152019301926115ed565b82360360e081126102295760c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06040519261172b846105e2565b86356117368161020b565b845201126102295760e091602091604051611750816105fe565b61175b8488016114b7565b8152611769604088016114b7565b84820152611779606088016114c8565b604082015261178a608088016114b7565b606082015261179b60a088016114b7565b608082015260c08701356117ae81610c2f565b60a0820152838201528152019201916116d1565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760005473ffffffffffffffffffffffffffffffffffffffff81163303611881577fffffffffffffffffffffffff00000000000000000000000000000000000000006001549133828416176001551660005573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b9080601f830112156102295781356118c281610c17565b926118d0604051948561061a565b81845260208085019260051b82010192831161022957602001905b8282106118f85750505090565b6020809183356119078161020b565b8152019101906118eb565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229576119619036906004016118ab565b60243567ffffffffffffffff8111610229576119819036906004016118ab565b9061198a61432a565b60005b8151811015611a0657806119ae6119a9610bc4600194866131ea565b615b0b565b6119b9575b0161198d565b73ffffffffffffffffffffffffffffffffffffffff6119db610bc483866131ea565b167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26119b3565b8260005b8151811015610cda5780611a2b611a26610bc4600194866131ea565b615b2c565b611a36575b01611a0a565b73ffffffffffffffffffffffffffffffffffffffff611a58610bc483866131ea565b167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2611a30565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957611ad2903690600401610ddd565b6024359167ffffffffffffffff831161022957611b2b611b23611b09611aff611b33963690600401610ddd565b9490953691613811565b90604082015190605e604a84015160601c93015191929190565b9190336149c8565b810190613876565b60005b8151811015610cda57611b98611b93611b6d611b5284866131ea565b515173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b613935565b611bac611ba86040830151151590565b1590565b611d6e5790611c21611bc46020600194015160ff1690565b611c1b611bfa6020611bd686896131ea565b5101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b90614aa7565b611c3c6040611c3084876131ea565b51015163ffffffff1690565b63ffffffff611c67611c5e611c57610b9e611b52888b6131ea565b5460e01c90565b63ffffffff1690565b911610611d6857611cca611c806040611c3085886131ea565b611cba611c8b61065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff851681529163ffffffff166020830152565b610a23610b9e611b5286896131ea565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff611d0d611b5285886131ea565b611d5e611d1f6040611c30888b6131ea565b60405193849316958390929163ffffffff6020917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff604085019616845216910152565b0390a25b01611b36565b50611d62565b611dc0611d7e611b5284866131ea565b7f06439c6b0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b6000fd5b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957610756611e77611e01610d9a565b67ffffffffffffffff60243591611e178361020b565b600060a0604051611e27816105fe565b828152826020820152826040820152826060820152826080820152015216600052600a60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b611ef3611eea60405192611e8a846105fe565b5463ffffffff8116845263ffffffff8160201c16602085015261ffff8160401c166040850152611ed1611ec48263ffffffff9060501c1690565b63ffffffff166060860152565b63ffffffff607082901c16608085015260901c60ff1690565b151560a0830152565b6040519182918291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b60ff81160361022957565b359061023982611f56565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590611fc782610c17565b90611fd5604051928361061a565b82825260246102806020840194028201019036821161022957602401925b81841061200357610cda836139d2565b8336036102808112610229576102607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060405192612040846105e2565b61204988610dc8565b84520112610229576102809160209161206061066a565b61206b848901610c39565b8152612079604089016114c8565b84820152612089606089016114b7565b604082015261209a608089016114b7565b60608201526120ab60a089016114b7565b60808201526120bc60c08901611f61565b60a08201526120cd60e08901611f61565b60c08201526120df61010089016114c8565b60e08201526120f161012089016114b7565b61010082015261210461014089016114c8565b61012082015261211761016089016114c8565b61014082015261212a6101808901610298565b61016082015261213d6101a08901610c39565b6101808201526121506101c089016114c8565b6101a08201526121636101e089016114b7565b6101c082015261217661020089016114b7565b6101e08201526121896102208901610dc8565b61020082015261219c61024089016114b7565b6102208201526121af61026089016114b7565b61024082015283820152815201930192611ff3565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff81116102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc82360301126102295760405161228f816105e2565b816004013567ffffffffffffffff8111610229576122b390600436918501016118ab565b8152602482013567ffffffffffffffff811161022957610cda9260046122dc92369201016118ab565b6020820152613c31565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff811161022957366023820112156102295780600401359061234182610c17565b9061234f604051928361061a565b8282526024602083019360061b8201019036821161022957602401925b81841061237c57610cda83613dd1565b6040843603126102295760206040918251612396816105e2565b86356123a18161020b565b81526123ae838801610dc8565b8382015281520193019261236c565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff60043561240d8161020b565b612415612f36565b50166000526007602052610756604060002060ff60405191612436836105a5565b5473ffffffffffffffffffffffffffffffffffffffff81168352818160a01c16602084015260a81c161515604082015260405191829182919091604080606083019473ffffffffffffffffffffffffffffffffffffffff815116845260ff602082015116602085015201511515910152565b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957604051806020600b54918281520190600b6000527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db99060005b81811061252757610756856108298187038261061a565b8254845260209093019260019283019201612510565b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957604061257d6004356110fa8161020b565b6125b78251809263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565bf35b346102295760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957602060405160128152f35b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295761262a610d9a565b6024359067ffffffffffffffff821161022957816004019160a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc82360301126102295761268f6114a68367ffffffffffffffff166000526009602052604060002090565b61269c611ba88251151590565b612ad35760648201916126e0611ba86126b485613357565b73ffffffffffffffffffffffffffffffffffffffff166000526001600b01602052604060002054151590565b612a85576044810190856126f48382612f55565b9690506024830195612727612709888561400a565b905089612720612719878061400a565b3691613811565b9189615435565b8561273461118083613357565b998a9361275261274c61022085015163ffffffff1690565b826154f5565b976000808d15612a4c5750506127b761ffff856127e9986127c39896612804966127f7966127ae61279e6101c06127926101a061280a9f015161ffff1690565b97015163ffffffff1690565b916127a88c613357565b94612f55565b96909516615610565b97919796909794613357565b73ffffffffffffffffffffffffffffffffffffffff166000526008602052604060002090565b5467ffffffffffffffff1690565b67ffffffffffffffff1690565b90612ea1565b9660009861ffff6128216101408a015161ffff1690565b166129f2575b50956128046127f761020061295b61296b996dffffffffffffffffffffffffffff6107569f9d986129739f9b61294c7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9f6129138e6129069f61290b6129069f978f956129539963ffffffff61289e6128a89360849761400a565b929050169061405b565b9060a08701876128cb6128c56128bf845160ff1690565b60ff1690565b85612ea1565b9360e08201926128dd845161ffff1690565b9061ffff82168311612983575b5050506080015161290692611c5e92509063ffffffff16614099565b61405b565b95019061400a565b6101e083015163ffffffff169063ffffffff61294461018061293c606088015163ffffffff1690565b960151151590565b941692615918565b519061405b565b911690612ea1565b93015167ffffffffffffffff1690565b911690612eb4565b6040519081529081906020820190565b6129069596506129e6936128046128bf60c06129d6611c5e99976129d06129c96129c061ffff9a60ff6129ba6129df9c5160ff1690565b16614068565b9a5161ffff1690565b61ffff1690565b90613ead565b93015160ff1690565b911661405b565b929150873880806128ea565b82879b999493969a50612a188993986dffffffffffffffffffffffffffff9060701c1690565b6dffffffffffffffffffffffffffff1691612a33898861400a565b9050612a3f9385615873565b9894919297999590612827565b959350955050506128046127f76127e96127c3612a7f612a7a611c5e61024061280a99015163ffffffff1690565b612e5a565b94613357565b611dc0612a9184613357565b7f2502348c0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b7f99ac52f20000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff831660045260246000fd5b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295773ffffffffffffffffffffffffffffffffffffffff600435612b5b8161020b565b612b6361432a565b16338114612bd557807fffffffffffffffffffffffff0000000000000000000000000000000000000000600054161760005573ffffffffffffffffffffffffffffffffffffffff600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b346102295760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102295760043567ffffffffffffffff8111610229573660238201121561022957806004013590612c5a82610c17565b90612c68604051928361061a565b8282526024602083019360071b8201019036821161022957602401925b818410612c9557610cda836140b3565b833603608081126102295760607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060405192612cd0846105e2565b8735612cdb8161020b565b8452011261022957608091602091604051612cf5816105a5565b83880135612d028161020b565b81526040880135612d1281611f56565b848201526060880135612d2481610c2f565b604082015283820152815201930192612c85565b346102295760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022957600435612d738161020b565b612d7b610db1565b9067ffffffffffffffff82169182600052600960205260ff6040600020541615612dfd57612dab612dcc92614237565b92600052600960205263ffffffff60016040600020015460901c16906154f5565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152f35b827f99ac52f20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90662386f26fc10000820291808304662386f26fc100001490151715612e7c57565b612e2b565b90655af3107a4000820291808304655af3107a40001490151715612e7c57565b81810292918115918404141715612e7c57565b8115612ebe570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b612f2c612f26612f3394937bffffffffffffffffffffffffffffffffffffffffffffffffffffffff612f1f8195614237565b1690612ea1565b92614237565b1690612eb4565b90565b60405190612f43826105a5565b60006040838281528260208201520152565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610229570180359067ffffffffffffffff821161022957602001918160061b3603831361022957565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015612fe85760061b0190565b612fa9565b35907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216820361022957565b60408136031261022957613045602060405192613032846105e2565b803561303d8161020b565b845201612fed565b602082015290565b60408136031261022957613045602060405192613069846105e2565b61303d81610dc8565b9061307b61432a565b60005b82518110156131e55780613094600192856131ea565b517f32a4ba3fa3351b11ad555d4c8ec70a744e8705607077a946807030d64b6ab1a360a073ffffffffffffffffffffffffffffffffffffffff83511692606081019373ffffffffffffffffffffffffffffffffffffffff80865116957fffff00000000000000000000000000000000000000000000000000000000000061314c60208601947fffffffffffffffffffff00000000000000000000000000000000000000000000865116604088019a848c5116926159aa565b977fffffffffffffffffffff0000000000000000000000000000000000000000000060808701956131b8875115158c600052600460205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b8560405198511688525116602087015251166040850152511660608301525115156080820152a20161307e565b509050565b8051821015612fe85760209160051b010190565b989592919097949693977f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff821673ffffffffffffffffffffffffffffffffffffffff82161460001461332e575050965b6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168089116132fd5750916132dc6132f094926132f6969463ffffffff8060016132cf8f67ffffffffffffffff166000526009602052604060002090565b015460301c16169161444e565b966132ea6020890151151590565b99614616565b9261482a565b9293929190565b887f6a92a4830000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b9161333892612eed565b96613264565b6040519061334b826105e2565b60006020838281520152565b35612f338161020b565b9060405161336e816105e2565b91547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116835260e01c6020830152565b906102396134fb60016133ac61066a565b9461349a61349082546133c86133c28260ff1690565b15158a52565b61ffff600882901c1660208a015263ffffffff601882901c1660408a015263ffffffff603882901c1660608a015263ffffffff605882901c1660808a015260ff607882901c1660a08a015260ff608082901c1660c08a015261ffff608882901c1660e08a015263ffffffff609882901c166101008a015261ffff60b882901c166101208a015261ffff60c882901c166101408a01527fffffffff00000000000000000000000000000000000000000000000000000000600882901b166101608a015260f81c90565b1515610180880152565b015461ffff81166101a086015263ffffffff601082901c166101c086015263ffffffff603082901c166101e086015267ffffffffffffffff605082901c1661020086015263ffffffff609082901c1661022086015260b01c63ffffffff1690565b63ffffffff16610240840152565b9061351261432a565b6000915b80518310156137435761352983826131ea565b519061353d825167ffffffffffffffff1690565b946020600093019367ffffffffffffffff8716935b8551805182101561372e57613569826020926131ea565b51015161357a611b528389516131ea565b8151602083015163ffffffff9081169116818110156136f5575050608082015163ffffffff16602081106136a7575090867f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b573ffffffffffffffffffffffffffffffffffffffff84613636858f6001999861360c6136319267ffffffffffffffff16600052600a602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b614874565b61369e60405192839216958291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b0390a301613552565b7f24ecdc020000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff90911660045263ffffffff1660245260446000fd5b7f0b4f67a20000000000000000000000000000000000000000000000000000000060005263ffffffff9081166004521660245260446000fd5b50509550925092600191500191929092613516565b50905060005b815181101561380d5780613771613762600193856131ea565b515167ffffffffffffffff1690565b67ffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff6137ba602061379e86896131ea565b51015173ffffffffffffffffffffffffffffffffffffffff1690565b60006137de8261360c8767ffffffffffffffff16600052600a602052604060002090565b551691167f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b600080a301613749565b5050565b92919267ffffffffffffffff82116105c15760405191613859601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0166020018461061a565b829481845281830111610229578281602093846000960137010152565b6020818303126102295780359067ffffffffffffffff8211610229570181601f82011215610229578035906138aa82610c17565b926138b8604051948561061a565b8284526020606081860194028301019181831161022957602001925b8284106138e2575050505090565b6060848303126102295760206060916040516138fd816105a5565b86356139088161020b565b8152613915838801612fed565b83820152613925604088016114b7565b60408201528152019301926138d4565b90604051613942816105a5565b604060ff82945473ffffffffffffffffffffffffffffffffffffffff81168452818160a01c16602085015260a81c161515910152565b90610239604051613988816105fe565b925463ffffffff8082168552602082811c821690860152604082811c61ffff1690860152605082901c81166060860152607082901c16608085015260901c60ff16151560a0840152565b906139db61432a565b60005b82518110156131e5576139f181846131ea565b516020613a0161376284876131ea565b9101519067ffffffffffffffff811680158015613c12575b8015613b99575b8015613b6b575b613b335791613af98260019594613aa9613a84613a5b613afe9767ffffffffffffffff166000526009602052604060002090565b5460081b7fffffffff000000000000000000000000000000000000000000000000000000001690565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b613b04577f71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad60405180613adc878261127a565b0390a267ffffffffffffffff166000526009602052604060002090565b614bde565b016139de565b7f2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e360405180613adc878261127a565b7fc35aa79d0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff821660045260246000fd5b506101e083015163ffffffff1663ffffffff613b91611c5e606087015163ffffffff1690565b911611613a27565b507f2812d52c000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000613c0a6101608601517fffffffff000000000000000000000000000000000000000000000000000000001690565b161415613a20565b5063ffffffff613c2a6101e085015163ffffffff1690565b1615613a19565b613c3961432a565b60208101519160005b8351811015613ced5780613c5b610bc4600193876131ea565b613c97613c9273ffffffffffffffffffffffffffffffffffffffff83165b73ffffffffffffffffffffffffffffffffffffffff1690565b615e46565b613ca3575b5001613c42565b60405173ffffffffffffffffffffffffffffffffffffffff9190911681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758090602090a138613c9c565b5091505160005b815181101561380d57613d0a610bc482846131ea565b9073ffffffffffffffffffffffffffffffffffffffff821615613da7577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef613d9e83613d76613d71613c7960019773ffffffffffffffffffffffffffffffffffffffff1690565b615dcd565b5060405173ffffffffffffffffffffffffffffffffffffffff90911681529081906020820190565b0390a101613cf4565b7f8579befe0000000000000000000000000000000000000000000000000000000060005260046000fd5b613dd961432a565b60005b815181101561380d578073ffffffffffffffffffffffffffffffffffffffff613e07600193856131ea565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d613ea467ffffffffffffffff6020613e4386896131ea565b51015116836000526008602052604060002067ffffffffffffffff82167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556040519182918291909167ffffffffffffffff6020820193169052565b0390a201613ddc565b91908203918211612e7c57565b613ec261333e565b50613ef5613ef08273ffffffffffffffffffffffffffffffffffffffff166000526006602052604060002090565b613361565b6020810191613f14613f0e611c5e855163ffffffff1690565b42613ead565b63ffffffff7f00000000000000000000000000000000000000000000000000000000000000001611613fc957611b93613f6d9173ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b613f7d611ba86040830151151590565b8015613fcf575b613fc957613f91906152ac565b9163ffffffff613fb9611c5e613fae602087015163ffffffff1690565b935163ffffffff1690565b911610613fc4575090565b905090565b50905090565b5073ffffffffffffffffffffffffffffffffffffffff614003825173ffffffffffffffffffffffffffffffffffffffff1690565b1615613f84565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610229570180359067ffffffffffffffff82116102295760200191813603831361022957565b91908201809211612e7c57565b9061ffff8091169116029061ffff8216918203612e7c57565b63ffffffff60209116019063ffffffff8211612e7c57565b9063ffffffff8091169116019063ffffffff8211612e7c57565b906140bc61432a565b60005b82518110156131e557806140d5600192856131ea565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf61422e602073ffffffffffffffffffffffffffffffffffffffff845116930151836000526007602052604060002061418173ffffffffffffffffffffffffffffffffffffffff835116829073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b602082015181547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000075ff0000000000000000000000000000000000000000006040870151151560a81b169360a01b1691161717905560405191829182919091604080606083019473ffffffffffffffffffffffffffffffffffffffff815116845260ff602082015116602085015201511515910152565b0390a2016140bf565b61424081613eba565b9063ffffffff6020830151161580156142bf575b61427b5750517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff907f06439c6b000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff82511615614254565b336000526003602052604060002054156142fc57565b7fd86ad9cf000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff60015416330361434b57565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b919091357fffffffff00000000000000000000000000000000000000000000000000000000811692600481106143a9575050565b7fffffffff00000000000000000000000000000000000000000000000000000000929350829060040360031b1b161690565b909291928360041161022957831161022957600401917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0190565b90816020910312610229575190565b908160409103126102295760206040519161443f836105e2565b80518352015161304581610c2f565b9161445761333e565b50811561454d575061449861271982806144927fffffffff000000000000000000000000000000000000000000000000000000009587614375565b956143db565b91167f181dcf100000000000000000000000000000000000000000000000000000000081036144d5575080602080612f3393518301019101614425565b7f97a657c90000000000000000000000000000000000000000000000000000000014614525577f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b8060208061453893518301019101614416565b61454061065b565b9081526000602082015290565b91505067ffffffffffffffff61456161065b565b911681526000602082015290565b9061457982610c17565b614586604051918261061a565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06145b48294610c17565b019060005b8281106145c557505050565b8060606020809385010152016145b9565b9190811015612fe85760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6181360301821215610229570190565b90929161463a613a5b8367ffffffffffffffff166000526009602052604060002090565b906146448161456f565b9560005b828110614659575050505050505090565b61466c614667828489612fd8565b613357565b838861468661467c8584846145d6565b604081019061400a565b9050602081116147a2575b5083926146c06146ba6127196146b06001986146e3976146de976145d6565b602081019061400a565b89615a3b565b61360c8967ffffffffffffffff16600052600a602052604060002090565b613978565b60a0810151156147665761474a614704606061471e93015163ffffffff1690565b6040805163ffffffff909216602083015290928391820190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261061a565b614754828b6131ea565b5261475f818a6131ea565b5001614648565b5061471e61474a61479d8461478f8a67ffffffffffffffff166000526009602052604060002090565b015460101c63ffffffff1690565b614704565b9150506147da611c5e6147cd8461360c8b67ffffffffffffffff16600052600a602052604060002090565b5460701c63ffffffff1690565b106147e757838838614691565b7f36f536ca0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff1660045260246000fd5b6020604051917f181dcf1000000000000000000000000000000000000000000000000000000000828401528051602484015201511515604482015260448152612f3360648261061a565b815181546020808501516040808701517fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090941663ffffffff958616179190921b67ffffffff00000000161791901b69ffff0000000000000000161782556060830151610239936149849260a092614926911685547fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff1660509190911b6dffffffff0000000000000000000016178555565b61497d61493a608083015163ffffffff1690565b85547fffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff1660709190911b71ffffffff000000000000000000000000000016178555565b0151151590565b81547fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff1690151560901b72ff00000000000000000000000000000000000016179055565b919290926149d8828286866159aa565b600052600460205260ff60406000205416156149f45750505050565b6040517f097e17ff00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529390921660248401527fffffffffffffffffffff0000000000000000000000000000000000000000000090911660448301527fffff000000000000000000000000000000000000000000000000000000000000166064820152608490fd5b0390fd5b604d8111612e7c57600a0a90565b60ff1660120160ff8111612e7c5760ff16906024821115614b6c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8201918211612e7c57614af8614afe92614a99565b90612eb4565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111614b42577bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b7f10cb51d10000000000000000000000000000000000000000000000000000000060005260046000fd5b906024039060248211612e7c57612804614b8592614a99565b614afe565b9060ff80911691160160ff8111612e7c5760ff16906024821115614b6c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc8201918211612e7c57614af8614afe92614a99565b906151f8610240600161023994614c29614bf88651151590565b829060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b614c6f614c3b602087015161ffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff1660089190911b62ffff0016178255565b614cbb614c83604087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffff1660189190911b66ffffffff00000016178255565b614d0b614ccf606087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffff1660389190911b6affffffff0000000000000016178255565b614d5f614d1f608087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff1660589190911b6effffffff000000000000000000000016178255565b614db1614d7060a087015160ff1690565b82547fffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffff1660789190911b6fff00000000000000000000000000000016178255565b614e04614dc260c087015160ff1690565b82547fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff1660809190911b70ff0000000000000000000000000000000016178255565b614e5a614e1660e087015161ffff1690565b82547fffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffff1660889190911b72ffff000000000000000000000000000000000016178255565b614eb7614e6f61010087015163ffffffff1690565b82547fffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffff1660989190911b76ffffffff0000000000000000000000000000000000000016178255565b614f14614eca61012087015161ffff1690565b82547fffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffff1660b89190911b78ffff000000000000000000000000000000000000000000000016178255565b614f73614f2761014087015161ffff1690565b82547fffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c89190911b7affff0000000000000000000000000000000000000000000000000016178255565b614ff4614fa46101608701517fffffffff000000000000000000000000000000000000000000000000000000001690565b82547fff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff1660089190911c7effffffff00000000000000000000000000000000000000000000000000000016178255565b615055615005610180870151151590565b82547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690151560f81b7fff0000000000000000000000000000000000000000000000000000000000000016178255565b019261509961506a6101a083015161ffff1690565b859061ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000825416179055565b6150e56150ae6101c083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff1660109190911b65ffffffff000016178555565b6151356150fa6101e083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffff1660309190911b69ffffffff00000000000016178555565b61519161514e61020083015167ffffffffffffffff1690565b85547fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff1660509190911b71ffffffffffffffff0000000000000000000016178555565b6151ed6151a661022083015163ffffffff1690565b85547fffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffff1660909190911b75ffffffff00000000000000000000000000000000000016178555565b015163ffffffff1690565b7fffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffff79ffffffff0000000000000000000000000000000000000000000083549260b01b169116179055565b519069ffffffffffffffffffff8216820361022957565b908160a09103126102295761526d81615242565b91602082015191604081015191612f33608060608401519301615242565b6040513d6000823e3d90fd5b908160209103126102295751612f3381611f56565b6152b461333e565b506152d9613c79613c79835173ffffffffffffffffffffffffffffffffffffffff1690565b90604051907ffeaf968c00000000000000000000000000000000000000000000000000000000825260a082600481865afa9283156153f6576000926000946153fb575b5060008312614b42576020600491604051928380927f313ce5670000000000000000000000000000000000000000000000000000000082525afa9283156153f657612f339363ffffffff93615382936000926153c0575b506020015160ff165b90614b8a565b926153b261538e61065b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9095168552565b1663ffffffff166020830152565b61537c9192506153e7602091823d84116153ef575b6153df818361061a565b810190615297565b929150615373565b503d6153d5565b61528b565b90935061542191925060a03d60a01161542e575b615419818361061a565b810190615259565b509392505091923861531c565b503d61540f565b919063ffffffff6040840151168082116154c557505061ffff6020830151169081811161548f575050907fffffffff0000000000000000000000000000000000000000000000000000000061016061023993015116615a3b565b61ffff92507fd88dddd6000000000000000000000000000000000000000000000000000000006000526004521660245260446000fd5b7f869337890000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b67ffffffffffffffff811660005260056020526040600020916040519261551b846105e2565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116845260e01c9182602085015263ffffffff8216928361557f575b50505050612f3390517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b63ffffffff164290810393908411612e7c57831161559d5780615555565b7ff08bcb3e0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045263ffffffff1660245260445260646000fd5b604081360312610229576020604051916155f9836105e2565b80356156048161020b565b83520135602082015290565b9694919695929390956000946000986000986000965b80881061563a575050505050505050929190565b9091929394959697999a6156576156528a848b612fd8565b6155e0565b9a6156bf6146de8d61569b6156808967ffffffffffffffff16600052600a602052604060002090565b915173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b916156d0611ba860a0850151151590565b6158405760009c60408401906156eb6129c9835161ffff1690565b6157a1575b5050606083015163ffffffff1661570691614099565b9c60808301516157199063ffffffff1690565b61572291614099565b9b82516157329063ffffffff1690565b63ffffffff1661574190612e5a565b600193908083106157955750612a7a611c5e602061576493015163ffffffff1690565b80821161578457506157759161405b565b985b0196959493929190615626565b905061578f9161405b565b98615777565b91505061578f9161405b565b90612804615831939f61581f6158289460208f8e6129c9955073ffffffffffffffffffffffffffffffffffffffff6157ed855173ffffffffffffffffffffffffffffffffffffffff1690565b911673ffffffffffffffffffffffffffffffffffffffff821614615839576158159150614237565b915b015190615b4d565b925161ffff1690565b620186a0900490565b9b38806156f0565b5091615817565b999b50600191506158678461586161586d9361585b8b612e5a565b9061405b565b9b614099565b9c614081565b9a615777565b91939093806101e00193846101e011612e7c576101208102908082046101201490151715612e7c576101e0910101809311612e7c576129c9610140615909612f33966dffffffffffffffffffffffffffff6129536158f46158e16159139a63ffffffff6128049a169061405b565b6128046129c96101208c015161ffff1690565b61585b611c5e6101008b015163ffffffff1690565b93015161ffff1690565b612e81565b9063ffffffff6159359395949561592d61333e565b50169161444e565b918251116159805780615974575b61594a5790565b7fee433e990000000000000000000000000000000000000000000000000000000060005260046000fd5b50602081015115615943565b7f4c4fc93a0000000000000000000000000000000000000000000000000000000060005260046000fd5b6040805173ffffffffffffffffffffffffffffffffffffffff9283166020820190815292909316908301527fffffffffffffffffffff0000000000000000000000000000000000000000000090921660608201527fffff000000000000000000000000000000000000000000000000000000000000909216608083015290615a358160a0810161471e565b51902090565b7fffffffff00000000000000000000000000000000000000000000000000000000167f2812d52c0000000000000000000000000000000000000000000000000000000014615a865750565b6020815103615ac957615aa26020825183010160208301614416565b73ffffffffffffffffffffffffffffffffffffffff8111908115615aff575b50615ac95750565b614a95906040519182917f8d666f6000000000000000000000000000000000000000000000000000000000835260048301615b82565b61040091501038615ac1565b73ffffffffffffffffffffffffffffffffffffffff612f339116600b615c7a565b73ffffffffffffffffffffffffffffffffffffffff612f339116600b615e08565b670de0b6b3a7640000917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff615b7e9216612ea1565b0490565b906020612f3392818152019061067a565b8054821015612fe85760005260206000200190600090565b91615be3918354907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055565b80548015615c4b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190615c1c8282615b93565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001810191806000528260205260406000205492831515600014615d68577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8401848111612e7c578354937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8501948511612e7c576000958583615d1997615d0a9503615d1f575b505050615be7565b90600052602052604060002090565b55600190565b615d4f615d4991615d40615d36615d5f9588615b93565b90549060031b1c90565b92839187615b93565b90615bab565b8590600052602052604060002090565b55388080615d02565b50505050600090565b805490680100000000000000008210156105c15781615d98916001615be394018155615b93565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b600081815260036020526040902054615e0257615deb816002615d71565b600254906000526003602052604060002055600190565b50600090565b6000828152600182016020526040902054615e3f5780615e2a83600193615d71565b80549260005201602052604060002055600190565b5050600090565b600081815260036020526040902054908115615e3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820190828211612e7c57600254927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8401938411612e7c578383615d199460009603615ee2575b505050615ed16002615be7565b600390600052602052604060002090565b615ed1615d4991615efa615d36615f04956002615b93565b9283916002615b93565b55388080615ec456fea164736f6c634300081a000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"staticConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"priceUpdaters\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]},{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"FEE_BASE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"KEYSTONE_PRICE_DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyAuthorizedCallerUpdates\",\"inputs\":[{\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\",\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"components\":[{\"name\":\"addedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"removedCallers\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyDestChainConfigUpdates\",\"inputs\":[{\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyFeeTokensUpdates\",\"inputs\":[{\"name\":\"feeTokensToRemove\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"feeTokensToAdd\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyPremiumMultiplierWeiPerEthUpdates\",\"inputs\":[{\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"applyTokenTransferFeeConfigUpdates\",\"inputs\":[{\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}]},{\"name\":\"tokensToUseDefaultFeeConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigRemoveArgs[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"convertTokenAmount\",\"inputs\":[{\"name\":\"fromToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"fromTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toToken\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAllAuthorizedCallers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDestinationChainGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeTokens\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPremiumMultiplierWeiPerEth\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStaticConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.StaticConfig\",\"components\":[{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"linkToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenAndGasPrices\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"tokenPrice\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"gasPriceValue\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structInternal.TimestampedPackedUint224\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPriceFeedConfig\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenPrices\",\"inputs\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"components\":[{\"name\":\"value\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenTransferFeeConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedFee\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structClient.EVM2AnyMessage\",\"components\":[{\"name\":\"receiver\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"tokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatedTokenPrice\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint224\",\"internalType\":\"uint224\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onReport\",\"inputs\":[{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"report\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processMessageArgs\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"feeToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feeTokenAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"extraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"onRampTokenTransfers\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.EVM2AnyTokenTransfer[]\",\"components\":[{\"name\":\"sourcePoolAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destTokenAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"destExecData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"sourceTokenAmounts\",\"type\":\"tuple[]\",\"internalType\":\"structClient.EVMTokenAmount[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"isOutOfOrderExecution\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"convertedExtraArgs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"destExecDataPerToken\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setReportPermissions\",\"inputs\":[{\"name\":\"permissions\",\"type\":\"tuple[]\",\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission[]\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"typeAndVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updatePrices\",\"inputs\":[{\"name\":\"priceUpdates\",\"type\":\"tuple\",\"internalType\":\"structInternal.PriceUpdates\",\"components\":[{\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"usdPerToken\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]},{\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structInternal.GasPriceUpdate[]\",\"components\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"usdPerUnitGas\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateTokenPriceFeeds\",\"inputs\":[{\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\",\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"components\":[{\"name\":\"sourceToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"feedConfig\",\"type\":\"tuple\",\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AuthorizedCallerAdded\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AuthorizedCallerRemoved\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainAdded\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DestChainConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"destChainConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"components\":[{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maxDataBytes\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerPayloadByteBase\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteHigh\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"destGasPerPayloadByteThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"enforceOutOfOrder\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasPriceStalenessThreshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenAdded\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FeeTokenRemoved\",\"inputs\":[{\"name\":\"feeToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferRequested\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PremiumMultiplierWeiPerEthUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PriceFeedPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"priceFeedConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenPriceFeedConfig\",\"components\":[{\"name\":\"dataFeedAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenDecimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ReportPermissionSet\",\"inputs\":[{\"name\":\"reportId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"permission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission\",\"components\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isAllowed\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigDeleted\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeeConfigUpdated\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"components\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"deciBps\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"destGasOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"isEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerTokenUpdated\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UsdPerUnitGasUpdated\",\"inputs\":[{\"name\":\"destChain\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CannotTransferToSelf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DataFeedValueOutOfUint224Range\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DestinationChainNotEnabled\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"ExtraArgOutOfOrderExecutionMustBeTrue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FeeTokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidChainFamilySelector\",\"inputs\":[{\"name\":\"chainFamilySelector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]},{\"type\":\"error\",\"name\":\"InvalidDestBytesOverhead\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destBytesOverhead\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidDestChainConfig\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidEVMAddress\",\"inputs\":[{\"name\":\"encodedAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidExtraArgsData\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidExtraArgsTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidFeeRange\",\"inputs\":[{\"name\":\"minFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeUSDCents\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidSVMAddress\",\"inputs\":[{\"name\":\"SVMAddress\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidStaticConfig\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTokenReceiver\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageComputeUnitLimitTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageFeeTooHigh\",\"inputs\":[{\"name\":\"msgFeeJuels\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MessageGasLimitTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageTooLarge\",\"inputs\":[{\"name\":\"maxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"actualSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"MustBeProposedOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCallableByOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnerCannotBeZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReportForwarderUnauthorized\",\"inputs\":[{\"name\":\"forwarder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"workflowName\",\"type\":\"bytes10\",\"internalType\":\"bytes10\"},{\"name\":\"reportName\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"}]},{\"type\":\"error\",\"name\":\"SourceTokenDataTooLarge\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"StaleGasPrice\",\"inputs\":[{\"name\":\"destChainSelector\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timePassed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"TokenNotSupported\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnsupportedNumberOfTokens\",\"inputs\":[{\"name\":\"numberOfTokens\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ZeroAddressNotAllowed\",\"inputs\":[]}]", + Bin: "0x60e060405234611029576170618038038061001981611295565b9283398101908082036101208112611029576060136110295761003a611257565b81516001600160601b038116810361102957815261005a602083016112ba565b906020810191825261006e604084016112ce565b6040820190815260608401516001600160401b03811161102957856100949186016112f6565b60808501519094906001600160401b03811161102957866100b69183016112f6565b60a08201519096906001600160401b0381116110295782019080601f830112156110295781516100ed6100e8826112df565b611295565b9260208085848152019260071b8201019083821161102957602001915b8183106111e25750505060c08301516001600160401b0381116110295783019781601f8a011215611029578851986101446100e88b6112df565b996020808c838152019160051b830101918483116110295760208101915b838310611080575050505060e08401516001600160401b0381116110295784019382601f8601121561102957845161019c6100e8826112df565b9560208088848152019260061b8201019085821161102957602001915b81831061104457505050610100810151906001600160401b038211611029570182601f82011215611029578051906101f36100e8836112df565b93602061028081878681520194028301019181831161102957602001925b828410610e6757505050503315610e5657600180546001600160a01b031916331790556020986102408a611295565b97600089526000368137610252611276565b998a52888b8b015260005b89518110156102c4576001906001600160a01b0361027b828d61138f565b51168d6102878261157b565b610294575b50500161025d565b7fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758091604051908152a1388d61028c565b508a985089519660005b885181101561033f576001600160a01b036102e9828b61138f565b511690811561032e577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8c83610320600195611503565b50604051908152a1016102ce565b6342bcdf7f60e11b60005260046000fd5b5081518a985089906001600160a01b0316158015610e44575b8015610e35575b610e245791516001600160a01b031660a05290516001600160601b03166080525163ffffffff1660c05261039286611295565b9360008552600036813760005b855181101561040e576001906103c76001600160a01b036103c0838a61138f565b5116611410565b6103d2575b0161039f565b818060a01b036103e2828961138f565b51167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26103cc565b508694508560005b84518110156104855760019061043e6001600160a01b03610437838961138f565b5116611542565b610449575b01610416565b818060a01b03610459828861138f565b51167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2610443565b508593508460005b835181101561054757806104a36001928661138f565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf606089858060a01b038451169301518360005260078b5260406000209060ff878060a01b038251169283898060a01b03198254161781558d8301908151604082549501948460a81b8651151560a81b16918560a01b9060a01b169061ffff60a01b19161717905560405193845251168c8301525115156040820152a20161048d565b5091509160005b8251811015610abc57610561818461138f565b51856001600160401b03610575848761138f565b5151169101519080158015610aa9575b8015610a8b575b610a7757600081815260098852604090205460019392919060081b6001600160e01b03191661092f57807f71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad604051806106f5868291909161024063ffffffff8161026084019580511515855261ffff602082015116602086015282604082015116604086015282606082015116606086015282608082015116608086015260ff60a08201511660a086015260ff60c08201511660c086015261ffff60e08201511660e0860152826101008201511661010086015261ffff6101208201511661012086015261ffff610140820151166101408601528260e01b61016082015116610160860152610180810151151561018086015261ffff6101a0820151166101a0860152826101c0820151166101c0860152826101e0820151166101e086015260018060401b03610200820151166102008601528261022082015116610220860152015116910152565b0390a25b60005260098752826040600020825115158382549162ffff008c83015160081b169066ffffffff000000604084015160181b166affffffff00000000000000606085015160381b16926effffffff0000000000000000000000608086015160581b169260ff60781b60a087015160781b169460ff60801b60c088015160801b169161ffff60881b60e089015160881b169063ffffffff60981b6101008a015160981b169361ffff60b81b6101208b015160b81b169661ffff60c81b6101408c015160c81b169963ffffffff60d81b6101608d015160081c169b61018060ff60f81b910151151560f81b169c8f8060f81b039a63ffffffff60d81b199961ffff60c81b199861ffff60b81b199763ffffffff60981b199661ffff60881b199560ff60801b199460ff60781b19936effffffff0000000000000000000000199260ff6affffffff000000000000001992169066ffffffffffffff19161716171617161716171617161716171617161716179063ffffffff60d81b1617178155019061ffff6101a0820151169082549165ffffffff00006101c083015160101b169269ffffffff0000000000006101e084015160301b166a01000000000000000000008860901b0361020085015160501b169263ffffffff60901b61022086015160901b169461024063ffffffff60b01b91015160b01b169563ffffffff60b01b199363ffffffff60901b19926a01000000000000000000008c60901b0319918c8060501b03191617161716171617171790550161054e565b807f2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e360405180610a6f868291909161024063ffffffff8161026084019580511515855261ffff602082015116602086015282604082015116604086015282606082015116606086015282608082015116608086015260ff60a08201511660a086015260ff60c08201511660c086015261ffff60e08201511660e0860152826101008201511661010086015261ffff6101208201511661012086015261ffff610140820151166101408601528260e01b61016082015116610160860152610180810151151561018086015261ffff6101a0820151166101a0860152826101c0820151166101c0860152826101e0820151166101e086015260018060401b03610200820151166102008601528261022082015116610220860152015116910152565b0390a26106f9565b63c35aa79d60e01b60005260045260246000fd5b5063ffffffff6101e08301511663ffffffff6060840151161061058c565b5063ffffffff6101e08301511615610585565b84828560005b8151811015610b42576001906001600160a01b03610ae0828561138f565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d86848060401b0381610b16868961138f565b510151168360005260088252604060002081878060401b0319825416179055604051908152a201610ac2565b83600184610b4f83611295565b9060008252600092610e1f575b909282935b8251851015610d5e57610b74858461138f565b5180516001600160401b0316939083019190855b83518051821015610d4d57610b9e82879261138f565b51015184516001600160a01b0390610bb790849061138f565b5151169063ffffffff815116908781019163ffffffff8351169081811015610d385750506080810163ffffffff815116898110610d21575090899291838c52600a8a5260408c20600160a01b6001900386168d528a5260408c2092825163ffffffff169380549180518d1b67ffffffff0000000016916040860192835160401b69ffff000000000000000016966060810195865160501b6dffffffff00000000000000000000169063ffffffff60701b895160701b169260a001998b60ff60901b8c51151560901b169560ff60901b199363ffffffff60701b19926dffffffff000000000000000000001991600160501b60019003191617161716171617171790556040519586525163ffffffff168c8601525161ffff1660408501525163ffffffff1660608401525163ffffffff16608083015251151560a082015260c07f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b591a3600101610b88565b6312766e0160e11b8c52600485905260245260448bfd5b6305a7b3d160e11b8c5260045260245260448afd5b505060019096019593509050610b61565b9150825b8251811015610de0576001906001600160401b03610d80828661138f565b515116828060a01b0384610d94848861138f565b5101511690808752600a855260408720848060a01b038316885285528660408120557f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b8780a301610d62565b604051615a519081611610823960805181818161044201526129ff015260a05181818161047801526129b0015260c05181818161049f01526136d60152f35b610b5c565b63d794ef9560e01b60005260046000fd5b5063ffffffff8251161561035f565b5080516001600160601b031615610358565b639b15e16f60e01b60005260046000fd5b838203610280811261102957610260610e7e611276565b91610e888761136c565b8352601f190112611029576040519161026083016001600160401b0381118482101761102e57604052610ebd6020870161135f565b8352610ecb60408701611380565b6020840152610edc606087016112ce565b6040840152610eed608087016112ce565b6060840152610efe60a087016112ce565b6080840152610f0f60c08701611351565b60a0840152610f2060e08701611351565b60c0840152610f326101008701611380565b60e0840152610f4461012087016112ce565b610100840152610f576101408701611380565b610120840152610f6a6101608701611380565b610140840152610180860151916001600160e01b0319831683036110295783602093610160610280960152610fa26101a0890161135f565b610180820152610fb56101c08901611380565b6101a0820152610fc86101e089016112ce565b6101c0820152610fdb61020089016112ce565b6101e0820152610fee610220890161136c565b61020082015261100161024089016112ce565b61022082015261101461026089016112ce565b61024082015283820152815201930192610211565b600080fd5b634e487b7160e01b600052604160045260246000fd5b60408387031261102957602060409161105b611276565b611064866112ba565b815261107183870161136c565b838201528152019201916101b9565b82516001600160401b0381116110295782016040818803601f190112611029576110a8611276565b906110b56020820161136c565b825260408101516001600160401b03811161102957602091010187601f820112156110295780516110e86100e8826112df565b91602060e08185858152019302820101908a821161102957602001915b8183106111245750505091816020938480940152815201920191610162565b828b0360e081126110295760c0611139611276565b91611143866112ba565b8352601f190112611029576040519160c08301916001600160401b0383118484101761102e5760e09360209360405261117d8488016112ce565b815261118b604088016112ce565b8482015261119b60608801611380565b60408201526111ac608088016112ce565b60608201526111bd60a088016112ce565b60808201526111ce60c0880161135f565b60a082015283820152815201920191611105565b828403608081126110295760606111f7611276565b91611201866112ba565b8352601f1901126110295760809160209161121a611257565b6112258488016112ba565b815261123360408801611351565b848201526112436060880161135f565b60408201528382015281520192019161010a565b60405190606082016001600160401b0381118382101761102e57604052565b60408051919082016001600160401b0381118382101761102e57604052565b6040519190601f01601f191682016001600160401b0381118382101761102e57604052565b51906001600160a01b038216820361102957565b519063ffffffff8216820361102957565b6001600160401b03811161102e5760051b60200190565b9080601f830112156110295781516113106100e8826112df565b9260208085848152019260051b82010192831161102957602001905b8282106113395750505090565b60208091611346846112ba565b81520191019061132c565b519060ff8216820361102957565b5190811515820361102957565b51906001600160401b038216820361102957565b519061ffff8216820361102957565b80518210156113a35760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b80548210156113a35760005260206000200190600090565b805480156113fa5760001901906113e882826113b9565b8154906000199060031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6000818152600c602052604090205480156114d15760001981018181116114bb57600b546000198101919082116114bb5781810361146a575b505050611456600b6113d1565b600052600c60205260006040812055600190565b6114a361147b61148c93600b6113b9565b90549060031b1c928392600b6113b9565b819391549060031b91821b91600019901b19161790565b9055600052600c602052604060002055388080611449565b634e487b7160e01b600052601160045260246000fd5b5050600090565b8054906801000000000000000082101561102e578161148c9160016114ff940181556113b9565b9055565b8060005260036020526040600020541560001461153c576115258160026114d8565b600254906000526003602052604060002055600190565b50600090565b80600052600c6020526040600020541560001461153c5761156481600b6114d8565b600b5490600052600c602052604060002055600190565b60008181526003602052604090205480156114d15760001981018181116114bb576002546000198101919082116114bb578082036115d5575b5050506115c160026113d1565b600052600360205260006040812055600190565b6115f76115e661148c9360026113b9565b90549060031b1c92839260026113b9565b905560005260036020526040600020553880806115b456fe6080604052600436101561001257600080fd5b60003560e01c806241e5be1461020657806301ffc9a714610201578063061877e3146101fc57806306285c69146101f7578063181f5a77146101f25780632451a627146101ed578063325c868e146101e85780633937306f146101e357806341ed29e7146101de578063430d138c146101d957806345ac924d146101d45780634ab35b0b146101cf578063514e8cff146101ca5780636def4ce7146101c5578063770e2dc4146101c057806379ba5097146101bb5780637afac322146101b6578063805f2132146101b157806382b49eb0146101ac57806387b8d879146101a75780638da5cb5b146101a257806391a2749a1461019d578063a69c64c014610198578063bf78e03f14610193578063cdc73d511461018e578063d02641a014610189578063d63d3af214610184578063d8694ccd1461017f578063f2fde38b1461017a578063fbe3f778146101755763ffdb4b371461017057600080fd5b612556565b612459565b61239d565b611f78565b611f5c565b611f13565b611e9c565b611df6565b611d3d565b611ca9565b611c82565b611a66565b6118e9565b61164e565b611515565b6113fd565b6111de565b61105f565b610e88565b610e50565b610d87565b610c5a565b6109ff565b610743565b610727565b6106a4565b6105fe565b610406565b6103be565b61029a565b61022e565b6001600160a01b0381160361021c57565b600080fd5b359061022c8261020b565b565b3461021c57606060031936011261021c5760206102656004356102508161020b565b602435604435916102608361020b565b6126d8565b604051908152f35b35907fffffffff000000000000000000000000000000000000000000000000000000008216820361021c57565b3461021c57602060031936011261021c576004357fffffffff000000000000000000000000000000000000000000000000000000008116810361021c577fffffffff00000000000000000000000000000000000000000000000000000000602091167f805f2132000000000000000000000000000000000000000000000000000000008114908115610394575b811561036a575b8115610340575b506040519015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438610335565b7f181f5a77000000000000000000000000000000000000000000000000000000008114915061032e565b7f9b645f410000000000000000000000000000000000000000000000000000000081149150610327565b3461021c57602060031936011261021c576001600160a01b036004356103e38161020b565b166000526008602052602067ffffffffffffffff60406000205416604051908152f35b3461021c57600060031936011261021c5761041f61270c565b50606060405161042e81610506565b63ffffffff6bffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016918281526001600160a01b0360406020830192827f00000000000000000000000000000000000000000000000000000000000000001684520191837f00000000000000000000000000000000000000000000000000000000000000001683526040519485525116602084015251166040820152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761052257604052565b6104d7565b60a0810190811067ffffffffffffffff82111761052257604052565b6040810190811067ffffffffffffffff82111761052257604052565b60c0810190811067ffffffffffffffff82111761052257604052565b90601f601f19910116810190811067ffffffffffffffff82111761052257604052565b6040519061022c60408361057b565b6040519061022c6102608361057b565b919082519283825260005b8481106105e9575050601f19601f8460006020809697860101520116010190565b806020809284010151828286010152016105c8565b3461021c57600060031936011261021c5761065d6040805190610621818361057b565b601382527f46656551756f74657220312e362e302d646576000000000000000000000000006020830152519182916020835260208301906105bd565b0390f35b602060408183019282815284518094520192019060005b8181106106855750505090565b82516001600160a01b0316845260209384019390920191600101610678565b3461021c57600060031936011261021c5760405180602060025491828152019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9060005b8181106107115761065d856107058187038261057b565b60405191829182610661565b82548452602090930192600192830192016106ee565b3461021c57600060031936011261021c57602060405160248152f35b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c5780600401906040600319823603011261021c57610781613a0f565b61078b828061272b565b4263ffffffff1692915060005b8181106108fc575050602401906107af828461272b565b92905060005b8381106107be57005b806107dd6107d86001936107d2868a61272b565b906127ae565b61280e565b7fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e67ffffffffffffffff6108d86108ca60208501946108bc61082687516001600160e01b031690565b61084061083161059e565b6001600160e01b039092168252565b63ffffffff8c16602082015261087b610861845167ffffffffffffffff1690565b67ffffffffffffffff166000526005602052604060002090565b815160209092015160e01b7fffffffff00000000000000000000000000000000000000000000000000000000166001600160e01b0392909216919091179055565b5167ffffffffffffffff1690565b93516001600160e01b031690565b604080516001600160e01b039290921682524260208301529190931692a2016107b5565b806109156109106001936107d2898061272b565b6127d7565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a6001600160a01b036109ae6108ca60208501946109a161095d87516001600160e01b031690565b61096861083161059e565b63ffffffff8d16602082015261087b61098884516001600160a01b031690565b6001600160a01b03166000526006602052604060002090565b516001600160a01b031690565b604080516001600160e01b039290921682524260208301529190931692a201610798565b67ffffffffffffffff81116105225760051b60200190565b8015150361021c57565b359061022c826109ea565b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c573660238201121561021c57806004013590610a3c826109d2565b90610a4a604051928361057b565b828252602460a06020840194028201019036821161021c57602401925b818410610a7957610a7783612833565b005b60a08436031261021c5760405190610a9082610527565b8435610a9b8161020b565b825260208501357fffffffffffffffffffff000000000000000000000000000000000000000000008116810361021c5760208301526040850135907fffff0000000000000000000000000000000000000000000000000000000000008216820361021c5782602092604060a0950152610b1660608801610221565b6060820152610b27608088016109f4565b6080820152815201930192610a67565b6004359067ffffffffffffffff8216820361021c57565b6024359067ffffffffffffffff8216820361021c57565b359067ffffffffffffffff8216820361021c57565b9181601f8401121561021c5782359167ffffffffffffffff831161021c576020838186019501011161021c57565b9181601f8401121561021c5782359167ffffffffffffffff831161021c576020808501948460051b01011161021c57565b929091610bfa928452151560208401526080604084015260808301906105bd565b906060818303910152815180825260208201916020808360051b8301019401926000915b838310610c2d57505050505090565b9091929394602080610c4b83601f19866001960301875289516105bd565b97019301930191939290610c1e565b3461021c5760c060031936011261021c57610c73610b37565b60243590610c808261020b565b60443560643567ffffffffffffffff811161021c57610ca3903690600401610b7a565b60849391933567ffffffffffffffff811161021c57610cc6903690600401610ba8565b9160a4359567ffffffffffffffff871161021c573660238801121561021c5786600401359567ffffffffffffffff871161021c573660248860061b8a01011161021c5761065d986024610d1a9901966129a5565b9060409492945194859485610bd9565b602060408183019282815284518094520192019060005b818110610d4e5750505090565b9091926020604082610d7c600194885163ffffffff602080926001600160e01b038151168552015116910152565b019401929101610d41565b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c57610db8903690600401610ba8565b610dc1816109d2565b91610dcf604051938461057b565b818352601f19610dde836109d2565b0160005b818110610e3957505060005b82811015610e2b57600190610e0f610e0a8260051b8501612cbc565b613682565b610e198287612991565b52610e248186612991565b5001610dee565b6040518061065d8682610d2a565b602090610e44612ca3565b82828801015201610de2565b3461021c57602060031936011261021c576020610e77600435610e728161020b565b613997565b6001600160e01b0360405191168152f35b3461021c57602060031936011261021c5767ffffffffffffffff610eaa610b37565b610eb2612ca3565b50166000526005602052604060002060405190610ece82610543565b546001600160e01b038116825260e01c6020820152604051809161065d82604081019263ffffffff602080926001600160e01b038151168552015116910152565b61022c9092919261024080610260830195610f2c84825115159052565b60208181015161ffff169085015260408181015163ffffffff169085015260608181015163ffffffff169085015260808181015163ffffffff169085015260a08181015160ff169085015260c08181015160ff169085015260e08181015161ffff16908501526101008181015163ffffffff16908501526101208181015161ffff16908501526101408181015161ffff1690850152610160818101517fffffffff000000000000000000000000000000000000000000000000000000001690850152610180818101511515908501526101a08181015161ffff16908501526101c08181015163ffffffff16908501526101e08181015163ffffffff16908501526102008181015167ffffffffffffffff16908501526102208181015163ffffffff1690850152015163ffffffff16910152565b3461021c57602060031936011261021c5761065d61112261111d611081610b37565b600061024061108e6105ad565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a0820152826101c0820152826101e08201528261020082015282610220820152015267ffffffffffffffff166000526009602052604060002090565b612ceb565b60405191829182610f0f565b359063ffffffff8216820361021c57565b359061ffff8216820361021c57565b81601f8201121561021c57803590611165826109d2565b92611173604051948561057b565b82845260208085019360061b8301019181831161021c57602001925b82841061119d575050505090565b60408483031261021c57602060409182516111b781610543565b6111c087610b65565b8152828701356111cf8161020b565b8382015281520193019261118f565b3461021c57604060031936011261021c5760043567ffffffffffffffff811161021c573660238201121561021c57806004013561121a816109d2565b91611228604051938461057b565b8183526024602084019260051b8201019036821161021c5760248101925b828410611277576024358567ffffffffffffffff821161021c57611271610a7792369060040161114e565b90612e59565b833567ffffffffffffffff811161021c57820160407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc823603011261021c57604051906112c382610543565b6112cf60248201610b65565b8252604481013567ffffffffffffffff811161021c57602491010136601f8201121561021c578035611300816109d2565b9161130e604051938461057b565b818352602060e081850193028201019036821161021c57602001915b8183106113495750505091816020938480940152815201930192611246565b82360360e0811261021c5760c0601f196040519261136684610543565b86356113718161020b565b8452011261021c5760e09160209160405161138b8161055f565b61139684880161112e565b81526113a46040880161112e565b848201526113b46060880161113f565b60408201526113c56080880161112e565b60608201526113d660a0880161112e565b608082015260c08701356113e9816109ea565b60a08201528382015281520192019161132a565b3461021c57600060031936011261021c576000546001600160a01b0381163303611484577fffffffffffffffffffffffff0000000000000000000000000000000000000000600154913382841617600155166000556001600160a01b033391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b9080601f8301121561021c5781356114c5816109d2565b926114d3604051948561057b565b81845260208085019260051b82010192831161021c57602001905b8282106114fb5750505090565b60208091833561150a8161020b565b8152019101906114ee565b3461021c57604060031936011261021c5760043567ffffffffffffffff811161021c576115469036906004016114ae565b60243567ffffffffffffffff811161021c576115669036906004016114ae565b9061156f613a53565b60005b81518110156115de578061159361158e6109a160019486612991565b615656565b61159e575b01611572565b6001600160a01b036115b36109a18386612991565b167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a2611598565b8260005b8151811015610a7757806116036115fe6109a160019486612991565b61566a565b61160e575b016115e2565b6001600160a01b036116236109a18386612991565b167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2611608565b3461021c57604060031936011261021c5760043567ffffffffffffffff811161021c5761167f903690600401610b7a565b6024359167ffffffffffffffff831161021c576116d86116d06116b66116ac6116e0963690600401610b7a565b9490953691613108565b90604082015190605e604a84015160601c93015191929190565b919033613eb7565b81019061314f565b60005b8151811015610a775761172b61172661170d6116ff8486612991565b51516001600160a01b031690565b6001600160a01b03166000526007602052604060002090565b61320e565b61173f61173b6040830151151590565b1590565b6118a0579061178a6117576020600194015160ff1690565b61178461177860206117698689612991565b5101516001600160e01b031690565b6001600160e01b031690565b90613f89565b6117a560406117998487612991565b51015163ffffffff1690565b63ffffffff6117d06117c76117c06109886116ff888b612991565b5460e01c90565b63ffffffff1690565b91161061189a5761181e6117e960406117998588612991565b61180e6117f461059e565b6001600160e01b03851681529163ffffffff166020830152565b61087b6109886116ff8689612991565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a6001600160a01b036118546116ff8588612991565b6118906118666040611799888b612991565b60405193849316958390929163ffffffff6020916001600160e01b03604085019616845216910152565b0390a25b016116e3565b50611894565b6118e56118b06116ff8486612991565b7f06439c6b000000000000000000000000000000000000000000000000000000006000526001600160a01b0316600452602490565b6000fd5b3461021c57604060031936011261021c5761065d611971611908610b37565b67ffffffffffffffff6024359161191e8361020b565b600060a060405161192e8161055f565b828152826020820152826040820152826060820152826080820152015216600052600a6020526040600020906001600160a01b0316600052602052604060002090565b6119ed6119e4604051926119848461055f565b5463ffffffff8116845263ffffffff8160201c16602085015261ffff8160401c1660408501526119cb6119be8263ffffffff9060501c1690565b63ffffffff166060860152565b63ffffffff607082901c16608085015260901c60ff1690565b151560a0830152565b6040519182918291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b60ff81160361021c57565b359061022c82611a50565b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c573660238201121561021c57806004013590611aa3826109d2565b90611ab1604051928361057b565b82825260246102806020840194028201019036821161021c57602401925b818410611adf57610a778361329e565b833603610280811261021c57610260601f1960405192611afe84610543565b611b0788610b65565b8452011261021c5761028091602091611b1e6105ad565b611b298489016109f4565b8152611b376040890161113f565b84820152611b476060890161112e565b6040820152611b586080890161112e565b6060820152611b6960a0890161112e565b6080820152611b7a60c08901611a5b565b60a0820152611b8b60e08901611a5b565b60c0820152611b9d610100890161113f565b60e0820152611baf610120890161112e565b610100820152611bc2610140890161113f565b610120820152611bd5610160890161113f565b610140820152611be8610180890161026d565b610160820152611bfb6101a089016109f4565b610180820152611c0e6101c0890161113f565b6101a0820152611c216101e0890161112e565b6101c0820152611c34610200890161112e565b6101e0820152611c476102208901610b65565b610200820152611c5a610240890161112e565b610220820152611c6d610260890161112e565b61024082015283820152815201930192611acf565b3461021c57600060031936011261021c5760206001600160a01b0360015416604051908152f35b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c576040600319823603011261021c57604051611ce681610543565b816004013567ffffffffffffffff811161021c57611d0a90600436918501016114ae565b8152602482013567ffffffffffffffff811161021c57610a77926004611d3392369201016114ae565b6020820152613454565b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c573660238201121561021c57806004013590611d7a826109d2565b90611d88604051928361057b565b8282526024602083019360061b8201019036821161021c57602401925b818410611db557610a77836135a6565b60408436031261021c5760206040918251611dcf81610543565b8635611dda8161020b565b8152611de7838801610b65565b83820152815201930192611da5565b3461021c57602060031936011261021c576001600160a01b03600435611e1b8161020b565b611e2361270c565b5016600052600760205261065d604060002060ff60405191611e4483610506565b546001600160a01b0381168352818160a01c16602084015260a81c16151560408201526040519182918291909160408060608301946001600160a01b03815116845260ff602082015116602085015201511515910152565b3461021c57600060031936011261021c57604051806020600b54918281520190600b6000527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db99060005b818110611efd5761065d856107058187038261057b565b8254845260209093019260019283019201611ee6565b3461021c57602060031936011261021c576040611f35600435610e0a8161020b565b611f5a8251809263ffffffff602080926001600160e01b038151168552015116910152565bf35b3461021c57600060031936011261021c57602060405160128152f35b3461021c57604060031936011261021c57611f91610b37565b60243567ffffffffffffffff811161021c57806004019060a0600319823603011261021c57611fd761111d8467ffffffffffffffff166000526009602052604060002090565b606482019161200a61173b611feb85612cbc565b6001600160a01b03166000526001600b01602052604060002054151590565b61235c579081604485930195612020878561272b565b959050602461203c85612036608487018961379e565b906148cb565b93019061206b61204c838861379e565b9050858961206461205d8b8061379e565b3691613108565b9289614a74565b84612078610e7283612cbc565b98899461209661209061022085015163ffffffff1690565b82614b36565b9b6000808c156123225750506120fc61ffff856121219961210899989661213c9661212f966120f36120e36101c06120d76101a06121429f015161ffff1690565b97015163ffffffff1690565b916120ed8c612cbc565b9461272b565b96909516614c27565b98919897909894612cbc565b6001600160a01b03166000526008602052604060002090565b5467ffffffffffffffff1690565b67ffffffffffffffff1690565b9061268c565b9560009761ffff61215961014089015161ffff1690565b166122c7575b509461213c61212f61020061222d61065d9d6dffffffffffffffffffffffffffff6122256122459f9e9b6122206001600160e01b039f9b9c61223d9f6122209e63ffffffff6121b46122209f6121be9461379e565b92905016906137ef565b908b60a081016121e16121db6121d5835160ff1690565b60ff1690565b8561268c565b9360e08301916121f3835161ffff1690565b9061ffff82168311612255575b5050505060800151612220916117c79163ffffffff1661382d565b61382d565b6137ef565b91169061268c565b93015167ffffffffffffffff1690565b91169061269f565b6040519081529081906020820190565b6117c7949650612220959361ffff6122b66122a561221b9661229f61229861228f60809960ff6122896122bd9b5160ff1690565b166137fc565b965161ffff1690565b61ffff1690565b90613675565b61213c6121d560c08d015160ff1690565b91166137ef565b9593839550612200565b909594989750826122ed8b989495986dffffffffffffffffffffffffffff9060701c1690565b6dffffffffffffffffffffffffffff1691612308848961379e565b90506123149388614e49565b96979394389693929661215f565b969593509650505061213c61212f6121216121086123566123516117c761024061214299015163ffffffff1690565b612645565b94612cbc565b6118e561236884612cbc565b7f2502348c000000000000000000000000000000000000000000000000000000006000526001600160a01b0316600452602490565b3461021c57602060031936011261021c576001600160a01b036004356123c28161020b565b6123ca613a53565b1633811461242f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060005416176000556001600160a01b03600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b3461021c57602060031936011261021c5760043567ffffffffffffffff811161021c573660238201121561021c57806004013590612496826109d2565b906124a4604051928361057b565b8282526024602083019360071b8201019036821161021c57602401925b8184106124d157610a7783613847565b8336036080811261021c576060601f19604051926124ee84610543565b87356124f98161020b565b8452011261021c5760809160209160405161251381610506565b838801356125208161020b565b8152604088013561253081611a50565b848201526060880135612542816109ea565b6040820152838201528152019301926124c1565b3461021c57604060031936011261021c576004356125738161020b565b61257b610b4e565b9067ffffffffffffffff82169182600052600960205260ff60406000205416156125e8576125ab6125cc92613997565b92600052600960205263ffffffff60016040600020015460901c1690614b36565b604080516001600160e01b039384168152919092166020820152f35b827f99ac52f20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90662386f26fc10000820291808304662386f26fc10000149015171561266757565b612616565b90655af3107a4000820291808304655af3107a4000149015171561266757565b8181029291811591840414171561266757565b81156126a9570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6127026126fc61270994936001600160e01b036126f58195613997565b169061268c565b92613997565b169061269f565b90565b6040519061271982610506565b60006040838281528260208201520152565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561021c570180359067ffffffffffffffff821161021c57602001918160061b3603831361021c57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b91908110156127be5760061b0190565b61277f565b35906001600160e01b038216820361021c57565b60408136031261021c576128066020604051926127f384610543565b80356127fe8161020b565b8452016127c3565b602082015290565b60408136031261021c5761280660206040519261282a84610543565b6127fe81610b65565b9061283c613a53565b60005b825181101561298c578061285560019285612991565b517f32a4ba3fa3351b11ad555d4c8ec70a744e8705607077a946807030d64b6ab1a360a06001600160a01b038351169260608101936001600160a01b0380865116957fffff0000000000000000000000000000000000000000000000000000000000006128f360208601947fffffffffffffffffffff00000000000000000000000000000000000000000000865116604088019a848c511692614eee565b977fffffffffffffffffffff00000000000000000000000000000000000000000000608087019561295f875115158c600052600460205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b8560405198511688525116602087015251166040850152511660608301525115156080820152a20161283f565b509050565b80518210156127be5760209160051b010190565b9895979692949391907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b0382166001600160a01b03821614600014612c93575050935b6bffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016808611612c62575090612a35918715158a613a91565b979096612a82612a598367ffffffffffffffff166000526009602052604060002090565b5460081b7fffffffff000000000000000000000000000000000000000000000000000000001690565b90612a8c81613cda565b9760005b828110612aa4575050505050505093929190565b612ab7612ab28284896127ae565b612cbc565b8388612ad1612ac7858484613d23565b604081019061379e565b905060208111612be7575b508392612b0b612b0561205d612afb600198612b4697612b4197613d23565b602081019061379e565b8961541f565b612b298967ffffffffffffffff16600052600a602052604060002090565b906001600160a01b0316600052602052604060002090565b613244565b60a081015115612bab57612b8f612b676060612b8193015163ffffffff1690565b6040805163ffffffff909216602083015290928391820190565b03601f19810183528261057b565b612b99828d612991565b52612ba4818c612991565b5001612a90565b50612b81612b8f612be284612bd48a67ffffffffffffffff166000526009602052604060002090565b015460101c63ffffffff1690565b612b67565b915050612c1f6117c7612c1284612b298b67ffffffffffffffff16600052600a602052604060002090565b5460701c63ffffffff1690565b10612c2c57838838612adc565b7f36f536ca000000000000000000000000000000000000000000000000000000006000526001600160a01b031660045260246000fd5b857f6a92a4830000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b91612c9d926126d8565b936129f0565b60405190612cb082610543565b60006020838281520152565b356127098161020b565b90604051612cd381610543565b91546001600160e01b038116835260e01c6020830152565b9061022c612e4b6001612cfc6105ad565b94612dea612de08254612d18612d128260ff1690565b15158a52565b61ffff600882901c1660208a015263ffffffff601882901c1660408a015263ffffffff603882901c1660608a015263ffffffff605882901c1660808a015260ff607882901c1660a08a015260ff608082901c1660c08a015261ffff608882901c1660e08a015263ffffffff609882901c166101008a015261ffff60b882901c166101208a015261ffff60c882901c166101408a01527fffffffff00000000000000000000000000000000000000000000000000000000600882901b166101608a015260f81c90565b1515610180880152565b015461ffff81166101a086015263ffffffff601082901c166101c086015263ffffffff603082901c166101e086015267ffffffffffffffff605082901c1661020086015263ffffffff609082901c1661022086015260b01c63ffffffff1690565b63ffffffff16610240840152565b90612e62613a53565b6000915b805183101561305457612e798382612991565b5190612e8d825167ffffffffffffffff1690565b946020600093019367ffffffffffffffff8716935b8551805182101561303f57612eb982602092612991565b510151612eca6116ff838951612991565b8151602083015163ffffffff908116911681811015613006575050608082015163ffffffff1660208110612fc5575090867f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b56001600160a01b0384612f54858f60019998612b29612f4f9267ffffffffffffffff16600052600a602052604060002090565b613d63565b612fbc60405192839216958291909160a08060c083019463ffffffff815116845263ffffffff602082015116602085015261ffff604082015116604085015263ffffffff606082015116606085015263ffffffff608082015116608085015201511515910152565b0390a301612ea2565b7f24ecdc02000000000000000000000000000000000000000000000000000000006000526001600160a01b0390911660045263ffffffff1660245260446000fd5b7f0b4f67a20000000000000000000000000000000000000000000000000000000060005263ffffffff9081166004521660245260446000fd5b50509550925092600191500191929092612e66565b50905060005b8151811015613104578061308261307360019385612991565b515167ffffffffffffffff1690565b67ffffffffffffffff6001600160a01b036130b160206130a28689612991565b5101516001600160a01b031690565b60006130d582612b298767ffffffffffffffff16600052600a602052604060002090565b551691167f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b600080a30161305a565b5050565b92919267ffffffffffffffff82116105225760405191613132601f8201601f19166020018461057b565b82948184528183011161021c578281602093846000960137010152565b60208183031261021c5780359067ffffffffffffffff821161021c570181601f8201121561021c57803590613183826109d2565b92613191604051948561057b565b8284526020606081860194028301019181831161021c57602001925b8284106131bb575050505090565b60608483031261021c5760206060916040516131d681610506565b86356131e18161020b565b81526131ee8388016127c3565b838201526131fe6040880161112e565b60408201528152019301926131ad565b9060405161321b81610506565b604060ff8294546001600160a01b0381168452818160a01c16602085015260a81c161515910152565b9061022c6040516132548161055f565b925463ffffffff8082168552602082811c821690860152604082811c61ffff1690860152605082901c81166060860152607082901c16608085015260901c60ff16151560a0840152565b906132a7613a53565b60005b825181101561298c576132bd8184612991565b5160206132cd6130738487612991565b9101519067ffffffffffffffff811680158015613435575b8015613407575b6133cf57916133958260019594613345613320612a5961339a9767ffffffffffffffff166000526009602052604060002090565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b6133a0577f71e9302ab4e912a9678ae7f5a8542856706806f2817e1bf2a20b171e265cb4ad604051806133788782610f0f565b0390a267ffffffffffffffff166000526009602052604060002090565b614096565b016132aa565b7f2431cc0363f2f66b21782c7e3d54dd9085927981a21bd0cc6be45a51b19689e3604051806133788782610f0f565b7fc35aa79d0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff821660045260246000fd5b506101e083015163ffffffff1663ffffffff61342d6117c7606087015163ffffffff1690565b9116116132ec565b5063ffffffff61344d6101e085015163ffffffff1690565b16156132e5565b61345c613a53565b60208101519160005b83518110156134e9578061347e6109a160019387612991565b6134a061349b6001600160a01b0383165b6001600160a01b031690565b6159b9565b6134ac575b5001613465565b6040516001600160a01b039190911681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758090602090a1386134a5565b5091505160005b8151811015613104576135066109a18284612991565b906001600160a01b0382161561357c577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef6135738361355861355361348f6001976001600160a01b031690565b615940565b506040516001600160a01b0390911681529081906020820190565b0390a1016134f0565b7f8579befe0000000000000000000000000000000000000000000000000000000060005260046000fd5b6135ae613a53565b60005b815181101561310457806001600160a01b036135cf60019385612991565b5151167fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d61366c67ffffffffffffffff602061360b8689612991565b51015116836000526008602052604060002067ffffffffffffffff82167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556040519182918291909167ffffffffffffffff6020820193169052565b0390a2016135b1565b9190820391821161266757565b61368a612ca3565b506136b06136ab826001600160a01b03166000526006602052604060002090565b612cc6565b60208101916136cf6136c96117c7855163ffffffff1690565b42613675565b63ffffffff7f000000000000000000000000000000000000000000000000000000000000000016116137775761172661371b916001600160a01b03166000526007602052604060002090565b61372b61173b6040830151151590565b801561377d575b6137775761373f90614764565b9163ffffffff6137676117c761375c602087015163ffffffff1690565b935163ffffffff1690565b911610613772575090565b905090565b50905090565b506001600160a01b0361379782516001600160a01b031690565b1615613732565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561021c570180359067ffffffffffffffff821161021c5760200191813603831361021c57565b9190820180921161266757565b9061ffff8091169116029061ffff821691820361266757565b63ffffffff60209116019063ffffffff821161266757565b9063ffffffff8091169116019063ffffffff821161266757565b90613850613a53565b60005b825181101561298c578061386960019285612991565b517fe6a7a17d710bf0b2cd05e5397dc6f97a5da4ee79e31e234bf5f965ee2bd9a5bf61398e60206001600160a01b0384511693015183600052600760205260406000206138ee6001600160a01b0383511682906001600160a01b03167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b602082015181547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000075ff0000000000000000000000000000000000000000006040870151151560a81b169360a01b169116171790556040519182918291909160408060608301946001600160a01b03815116845260ff602082015116602085015201511515910152565b0390a201613853565b6139a081613682565b9063ffffffff6020830151161580156139fd575b6139c65750516001600160e01b031690565b6001600160a01b03907f06439c6b000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b506001600160e01b03825116156139b4565b33600052600360205260406000205415613a2557565b7fd86ad9cf000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b6001600160a01b03600154163303613a6757565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b61111d613ab791959493929567ffffffffffffffff166000526009602052604060002090565b936101608501947f2812d52c000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000613b2a88517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614613ca6577f1e10bdc4000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000613b9c88517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614613c1d576118e5613bcf87517fffffffff000000000000000000000000000000000000000000000000000000001690565b7f2ee82075000000000000000000000000000000000000000000000000000000006000527fffffffff0000000000000000000000000000000000000000000000000000000016600452602490565b60609192939495508063ffffffff613c4c610180613c4486613c5596015163ffffffff1690565b930151151590565b911686866152ba565b015181613c9d575b50613c7357613c6d913691613108565b90600190565b7f5bed51920000000000000000000000000000000000000000000000000000000060005260046000fd5b90501538613c5d565b6101e00151939450613ccb93919291613cc5915063ffffffff166117c7565b9161503b565b906127096020613c448461515c565b90613ce4826109d2565b613cf1604051918261057b565b828152601f19613d0182946109d2565b019060005b828110613d1257505050565b806060602080938501015201613d06565b91908110156127be5760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618136030182121561021c570190565b815181546020808501516040808701517fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090941663ffffffff958616179190921b67ffffffff00000000161791901b69ffff000000000000000016178255606083015161022c93613e739260a092613e15911685547fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff1660509190911b6dffffffff0000000000000000000016178555565b613e6c613e29608083015163ffffffff1690565b85547fffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff1660709190911b71ffffffff000000000000000000000000000016178555565b0151151590565b81547fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff1690151560901b72ff00000000000000000000000000000000000016179055565b91929092613ec782828686614eee565b600052600460205260ff6040600020541615613ee35750505050565b6040517f097e17ff0000000000000000000000000000000000000000000000000000000081526001600160a01b0393841660048201529390921660248401527fffffffffffffffffffff0000000000000000000000000000000000000000000090911660448301527fffff000000000000000000000000000000000000000000000000000000000000166064820152608490fd5b0390fd5b604d811161266757600a0a90565b60ff1660120160ff81116126675760ff16906024821115614024577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc820191821161266757613fda613fe092613f7b565b9061269f565b6001600160e01b038111613ffa576001600160e01b031690565b7f10cb51d10000000000000000000000000000000000000000000000000000000060005260046000fd5b9060240390602482116126675761213c61403d92613f7b565b613fe0565b9060ff80911691160160ff81116126675760ff16906024821115614024577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc820191821161266757613fda613fe092613f7b565b906146b0610240600161022c946140e16140b08651151590565b829060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b6141276140f3602087015161ffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff1660089190911b62ffff0016178255565b61417361413b604087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffff1660189190911b66ffffffff00000016178255565b6141c3614187606087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffff1660389190911b6affffffff0000000000000016178255565b6142176141d7608087015163ffffffff1690565b82547fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff1660589190911b6effffffff000000000000000000000016178255565b61426961422860a087015160ff1690565b82547fffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffff1660789190911b6fff00000000000000000000000000000016178255565b6142bc61427a60c087015160ff1690565b82547fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff1660809190911b70ff0000000000000000000000000000000016178255565b6143126142ce60e087015161ffff1690565b82547fffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffff1660889190911b72ffff000000000000000000000000000000000016178255565b61436f61432761010087015163ffffffff1690565b82547fffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffff1660989190911b76ffffffff0000000000000000000000000000000000000016178255565b6143cc61438261012087015161ffff1690565b82547fffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffff1660b89190911b78ffff000000000000000000000000000000000000000000000016178255565b61442b6143df61014087015161ffff1690565b82547fffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c89190911b7affff0000000000000000000000000000000000000000000000000016178255565b6144ac61445c6101608701517fffffffff000000000000000000000000000000000000000000000000000000001690565b82547fff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff1660089190911c7effffffff00000000000000000000000000000000000000000000000000000016178255565b61450d6144bd610180870151151590565b82547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690151560f81b7fff0000000000000000000000000000000000000000000000000000000000000016178255565b01926145516145226101a083015161ffff1690565b859061ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000825416179055565b61459d6145666101c083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff1660109190911b65ffffffff000016178555565b6145ed6145b26101e083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffff1660309190911b69ffffffff00000000000016178555565b61464961460661020083015167ffffffffffffffff1690565b85547fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff1660509190911b71ffffffffffffffff0000000000000000000016178555565b6146a561465e61022083015163ffffffff1690565b85547fffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffff1660909190911b75ffffffff00000000000000000000000000000000000016178555565b015163ffffffff1690565b7fffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffff79ffffffff0000000000000000000000000000000000000000000083549260b01b169116179055565b519069ffffffffffffffffffff8216820361021c57565b908160a091031261021c57614725816146fa565b916020820151916040810151916127096080606084015193016146fa565b6040513d6000823e3d90fd5b9081602091031261021c575161270981611a50565b61476c612ca3565b5061478461348f61348f83516001600160a01b031690565b90604051907ffeaf968c00000000000000000000000000000000000000000000000000000000825260a082600481865afa92831561488c57600092600094614891575b5060008312613ffa576020600491604051928380927f313ce5670000000000000000000000000000000000000000000000000000000082525afa92831561488c576127099363ffffffff9361482d93600092614856575b506020015160ff165b90614042565b9261484861483961059e565b6001600160e01b039095168552565b1663ffffffff166020830152565b61482791925061487d602091823d8411614885575b614875818361057b565b81019061474f565b92915061481e565b503d61486b565b614743565b9093506148b791925060a03d60a0116148c4575b6148af818361057b565b810190614711565b50939250509192386147c7565b503d6148a5565b929190926101608201937f2812d52c000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000061494187517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614614a2b577f1e10bdc4000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000006149b387517fffffffff000000000000000000000000000000000000000000000000000000001690565b16146149e6576118e5613bcf86517fffffffff000000000000000000000000000000000000000000000000000000001690565b61270993945091614a21916117c79363ffffffff614a19610180614a11606087015163ffffffff1690565b950151151590565b9316916152ba565b5163ffffffff1690565b614a70939450614a436101e084015163ffffffff1690565b9063ffffffff614a68610180614a60606088015163ffffffff1690565b960151151590565b94169261567e565b5190565b9493919063ffffffff604087015116808211614b0657505061ffff60208601511690818111614ad05750507fffffffff0000000000000000000000000000000000000000000000000000000061016061022c9495015116615568565b61ffff92507fd88dddd6000000000000000000000000000000000000000000000000000000006000526004521660245260446000fd5b7f869337890000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b67ffffffffffffffff8116600052600560205260406000209160405192614b5c84610543565b546001600160e01b038116845260e01c9182602085015263ffffffff82169283614b96575b5050505061270990516001600160e01b031690565b63ffffffff164290810393908411612667578311614bb45780614b81565b7ff08bcb3e0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045263ffffffff1660245260445260646000fd5b60408136031261021c57602060405191614c1083610543565b8035614c1b8161020b565b83520135602082015290565b9694919695929390956000946000986000986000965b808810614c51575050505050505050929190565b9091929394959697999a614c6e614c698a848b6127ae565b614bf7565b9a614cbc612b418d614ca5614c978967ffffffffffffffff16600052600a602052604060002090565b91516001600160a01b031690565b6001600160a01b0316600052602052604060002090565b91614ccd61173b60a0850151151590565b614e165760009c6040840190614ce8612298835161ffff1690565b614d9e575b5050606083015163ffffffff16614d039161382d565b9c6080830151614d169063ffffffff1690565b614d1f9161382d565b9b8251614d2f9063ffffffff1690565b63ffffffff16614d3e90612645565b60019390808310614d9257506123516117c76020614d6193015163ffffffff1690565b808211614d815750614d72916137ef565b985b0196959493929190614c3d565b9050614d8c916137ef565b98614d74565b915050614d8c916137ef565b9061213c614e07939f614df5614dfe9460208f8e61229895506001600160a01b03614dd085516001600160a01b031690565b91166001600160a01b03821614614e0f57614deb9150613997565b915b0151906156e6565b925161ffff1690565b620186a0900490565b9b3880614ced565b5091614ded565b999b5060019150614e3d84614e37614e4393614e318b612645565b906137ef565b9b61382d565b9c613815565b9a614d74565b91939093806101e00193846101e011612667576101208102908082046101201490151715612667576101e091010180931161266757612298610140614edf612709966dffffffffffffffffffffffffffff612225614eca614eb7614ee99a63ffffffff61213c9a16906137ef565b61213c6122986101208c015161ffff1690565b614e316117c76101008b015163ffffffff1690565b93015161ffff1690565b61266c565b604080516001600160a01b039283166020820190815292909316908301527fffffffffffffffffffff0000000000000000000000000000000000000000000090921660608201527fffff000000000000000000000000000000000000000000000000000000000000909216608083015290614f6c8160a08101612b81565b51902090565b919091357fffffffff0000000000000000000000000000000000000000000000000000000081169260048110614fa6575050565b7fffffffff00000000000000000000000000000000000000000000000000000000929350829060040360031b1b161690565b909291928360041161021c57831161021c57600401916003190190565b9060041161021c5790600490565b9081602091031261021c575190565b9081604091031261021c5760206040519161502c83610543565b805183520151612806816109ea565b91615044612ca3565b50811561513a575061508561205d828061507f7fffffffff000000000000000000000000000000000000000000000000000000009587614f72565b95614fd8565b91167f181dcf100000000000000000000000000000000000000000000000000000000081036150c257508060208061270993518301019101615012565b7f97a657c90000000000000000000000000000000000000000000000000000000014615112577f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b8060208061512593518301019101615003565b61512d61059e565b9081526000602082015290565b91505067ffffffffffffffff61514e61059e565b911681526000602082015290565b6020604051917f181dcf100000000000000000000000000000000000000000000000000000000082840152805160248401520151151560448201526044815261270960648261057b565b604051906151b382610527565b60606080836000815260006020820152600060408201526000838201520152565b60208183031261021c5780359067ffffffffffffffff821161021c57019060a08282031261021c576040519161520983610527565b6152128161112e565b835261522060208201610b65565b60208401526040810135615233816109ea565b60408401526060810135606084015260808101359067ffffffffffffffff821161021c57019080601f8301121561021c57813561526f816109d2565b9261527d604051948561057b565b81845260208085019260051b82010192831161021c57602001905b8282106152aa57505050608082015290565b8135815260209182019101615298565b6152c26151a6565b5081156153f5577f1f3b3aba000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000061531e6153188585614ff5565b90614f72565b16036153cb578161533a9261533292614fd8565b8101906151d4565b91806153b5575b61538b5763ffffffff615358835163ffffffff1690565b16116153615790565b7f2e2b0c290000000000000000000000000000000000000000000000000000000060005260046000fd5b7fee433e990000000000000000000000000000000000000000000000000000000060005260046000fd5b506153c661173b6040840151151590565b615341565b7f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b7fb00b53dc0000000000000000000000000000000000000000000000000000000060005260046000fd5b907fffffffff0000000000000000000000000000000000000000000000000000000082167f2812d52c0000000000000000000000000000000000000000000000000000000081146154ed577f1e10bdc400000000000000000000000000000000000000000000000000000000146154e0577f2ee82075000000000000000000000000000000000000000000000000000000006000527fffffffff00000000000000000000000000000000000000000000000000000000821660045260246000fd5b61022c9150600190615717565b50905060208151036155265761550c6020825183010160208301615003565b6001600160a01b03811190811561555c575b506155265750565b613f77906040519182917f8d666f6000000000000000000000000000000000000000000000000000000000835260048301615706565b6104009150103861551e565b917fffffffff0000000000000000000000000000000000000000000000000000000083167f2812d52c000000000000000000000000000000000000000000000000000000008114615636577f1e10bdc40000000000000000000000000000000000000000000000000000000014615629577f2ee82075000000000000000000000000000000000000000000000000000000006000527fffffffff00000000000000000000000000000000000000000000000000000000831660045260246000fd5b61022c9250151590615717565b5050905060208151036155265761550c6020825183010160208301615003565b6001600160a01b036127099116600b615847565b6001600160a01b036127099116600b61597b565b9063ffffffff61569b93959495615693612ca3565b50169161503b565b918251116156bc57806156b0575b61538b5790565b506020810151156156a9565b7f4c4fc93a0000000000000000000000000000000000000000000000000000000060005260046000fd5b670de0b6b3a7640000916001600160e01b03615702921661268c565b0490565b9060206127099281815201906105bd565b90602082510361577f576157285750565b60208180518101031261021c576020810151156157425750565b613f77906040519182917fff828faa00000000000000000000000000000000000000000000000000000000835260206004840181815201906105bd565b6040517fff828faa0000000000000000000000000000000000000000000000000000000081526020600482015280613f7760248201856105bd565b80548210156127be5760005260206000200190600090565b916157ec918354906000199060031b92831b921b19161790565b9055565b8054801561581857600019019061580782826157ba565b60001982549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60018101918060005282602052604060002054928315156000146158f95760001984018481116126675783549360001985019485116126675760009585836158aa9761589b95036158b0575b5050506157f0565b90600052602052604060002090565b55600190565b6158e06158da916158d16158c76158f095886157ba565b90549060031b1c90565b928391876157ba565b906157d2565b8590600052602052604060002090565b55388080615893565b50505050600090565b8054906801000000000000000082101561052257816159299160016157ec940181556157ba565b81939154906000199060031b92831b921b19161790565b6000818152600360205260409020546159755761595e816002615902565b600254906000526003602052604060002055600190565b50600090565b60008281526001820160205260409020546159b2578061599d83600193615902565b80549260005201602052604060002055600190565b5050600090565b6000818152600360205260409020549081156159b257600019820190828211612667576002549260001984019384116126675783836158aa9460009603615a19575b505050615a0860026157f0565b600390600052602052604060002090565b615a086158da91615a316158c7615a3b9560026157ba565b92839160026157ba565b553880806159fb56fea164736f6c634300081a000a", } var FeeQuoterABI = FeeQuoterMetaData.ABI diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 7ee516ab47b..c063c5709f6 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -6,7 +6,7 @@ ccip_encoding_utils: ../../../contracts/solc/ccip/EncodingUtils/EncodingUtils.so ccip_home: ../../../contracts/solc/ccip/CCIPHome/CCIPHome.sol/CCIPHome.abi.json ../../../contracts/solc/ccip/CCIPHome/CCIPHome.sol/CCIPHome.bin 39de1fbc907a2b573e9358e716803bf5ac3b0a2e622d5bc0069ab60daf38949b ccip_reader_tester: ../../../contracts/solc/ccip/CCIPReaderTester/CCIPReaderTester.sol/CCIPReaderTester.abi.json ../../../contracts/solc/ccip/CCIPReaderTester/CCIPReaderTester.sol/CCIPReaderTester.bin b8e597d175ec5ff4990d98b4e3b8a8cf06c6ae22977dd6f0e58c0f4107639e8f ether_sender_receiver: ../../../contracts/solc/ccip/EtherSenderReceiver/EtherSenderReceiver.sol/EtherSenderReceiver.abi.json ../../../contracts/solc/ccip/EtherSenderReceiver/EtherSenderReceiver.sol/EtherSenderReceiver.bin 88973abc1bfbca23a23704e20087ef46f2e20581a13477806308c8f2e664844e -fee_quoter: ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.abi.json ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.bin f1c4b4d170308bad29ca393d81202f3f5a40398385817023fdf4992f5ebeff8d +fee_quoter: ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.abi.json ../../../contracts/solc/ccip/FeeQuoter/FeeQuoter.sol/FeeQuoter.bin 7be986f71fb72d1790b05033ba39531679284ff6a1b8f4978aea11763d932e73 lock_release_token_pool: ../../../contracts/solc/ccip/LockReleaseTokenPool/LockReleaseTokenPool.sol/LockReleaseTokenPool.abi.json ../../../contracts/solc/ccip/LockReleaseTokenPool/LockReleaseTokenPool.sol/LockReleaseTokenPool.bin 2e73ee0da6f9a9a5722294289b969e4202476706e5d7cdb623e728831c79c28b maybe_revert_message_receiver: ../../../contracts/solc/ccip/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.sol/MaybeRevertMessageReceiver.abi.json ../../../contracts/solc/ccip/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.sol/MaybeRevertMessageReceiver.bin d1eb951af1027ca20cbee2c34df80fddbfd861e1695989aeebd29327cfe56584 message_hasher: ../../../contracts/solc/ccip/MessageHasher/MessageHasher.sol/MessageHasher.abi.json ../../../contracts/solc/ccip/MessageHasher/MessageHasher.sol/MessageHasher.bin 9d503e62f007cfa7bf411ec845c3537b272709001d25ec738820ca83991c299c