From 264b95282a0490025b52bcc05c7659bf7dc583e4 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Mon, 8 Apr 2024 13:59:39 +0200 Subject: [PATCH] rm offchain check for token pool rate limits (#690) ## Motivation Self serve will allow for token pools that do not have all the functions we currently call offchain After this PR we assume it will go through due to the same rate limits being enforced onchain on send --- .../ocr2/plugins/ccip/ccipexec/ocr2.go | 161 +--------- .../ocr2/plugins/ccip/ccipexec/ocr2_test.go | 282 +----------------- 2 files changed, 8 insertions(+), 435 deletions(-) diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go index ae440af572..a941218ee2 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go @@ -114,7 +114,7 @@ func (r *ExecutionReportingPlugin) Observation(ctx context.Context, timestamp ty r.inflightReports.expire(lggr) inFlight := r.inflightReports.getAll() - executableObservations, err := r.getExecutableObservations(ctx, lggr, timestamp, inFlight) + executableObservations, err := r.getExecutableObservations(ctx, lggr, inFlight) if err != nil { return nil, err } @@ -138,7 +138,7 @@ func (r *ExecutionReportingPlugin) Observation(ctx context.Context, timestamp ty return ccip.NewExecutionObservation(executableObservations).Marshal() } -func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context, lggr logger.Logger, timestamp types.ReportTimestamp, inflight []InflightInternalExecutionReport) ([]ccip.ObservedMessage, error) { +func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context, lggr logger.Logger, inflight []InflightInternalExecutionReport) ([]ccip.ObservedMessage, error) { unexpiredReports, err := r.getUnexpiredCommitReports( ctx, r.commitStoreReader, @@ -166,14 +166,6 @@ func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context return nil, err } - getDestPoolRateLimits := cache.LazyFetch(func() (map[cciptypes.Address]*big.Int, error) { - tokenExecData, err1 := getExecTokenData() - if err1 != nil { - return nil, err1 - } - return r.destPoolRateLimits(ctx, unexpiredReportsWithSendReqs, tokenExecData.sourceToDestTokens) - }) - for _, unexpiredReport := range unexpiredReportsWithSendReqs { r.tokenDataWorker.AddJobsFromMsgs(ctx, unexpiredReport.sendRequestsWithMeta) } @@ -218,11 +210,6 @@ func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context return nil, err } - destPoolRateLimits, err := getDestPoolRateLimits() - if err != nil { - return nil, err - } - batch := r.buildBatch( ctx, rootLggr, @@ -232,8 +219,7 @@ func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context tokenExecData.sourceTokenPrices, tokenExecData.destTokenPrices, tokenExecData.gasPrice, - tokenExecData.sourceToDestTokens, - destPoolRateLimits) + tokenExecData.sourceToDestTokens) if len(batch) != 0 { return batch, nil } @@ -243,71 +229,6 @@ func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context return []ccip.ObservedMessage{}, nil } -// destPoolRateLimits returns a map that consists of the rate limits of each destination token of the provided reports. -// If a token is missing from the returned map it either means that token was not found or token pool is disabled for this token. -func (r *ExecutionReportingPlugin) destPoolRateLimits(ctx context.Context, commitReports []commitReportWithSendRequests, sourceToDestToken map[cciptypes.Address]cciptypes.Address) (map[cciptypes.Address]*big.Int, error) { - tokens, err := r.offRampReader.GetTokens(ctx) - if err != nil { - return nil, fmt.Errorf("get cached token pools: %w", err) - } - - dstTokenToPool := make(map[cciptypes.Address]cciptypes.Address) - dstPoolToToken := make(map[cciptypes.Address]cciptypes.Address) - dstPoolAddresses := make([]cciptypes.Address, 0) - - for _, msg := range commitReports { - for _, req := range msg.sendRequestsWithMeta { - for _, tk := range req.TokenAmounts { - dstToken, exists := sourceToDestToken[tk.Token] - if !exists { - r.lggr.Warnw("token not found on destination chain", "sourceToken", tk) - continue - } - - // another message with the same token exists in the report - // we skip it since we don't want to query for the rate limit twice - if _, seen := dstTokenToPool[dstToken]; seen { - continue - } - - poolAddress, exists := tokens.DestinationPool[dstToken] - if !exists { - return nil, fmt.Errorf("pool for token '%s' does not exist", dstToken) - } - - if tokenAddr, seen := dstPoolToToken[poolAddress]; seen { - return nil, fmt.Errorf("pool is already seen for token %s", tokenAddr) - } - - dstTokenToPool[dstToken] = poolAddress - dstPoolToToken[poolAddress] = dstToken - dstPoolAddresses = append(dstPoolAddresses, poolAddress) - } - } - } - - rateLimits, err := r.tokenPoolBatchedReader.GetInboundTokenPoolRateLimits(ctx, dstPoolAddresses) - if err != nil { - return nil, fmt.Errorf("fetch pool rate limits: %w", err) - } - - res := make(map[cciptypes.Address]*big.Int, len(dstTokenToPool)) - for i, rateLimit := range rateLimits { - // if the rate limit is disabled for this token pool then we omit it from the result - if !rateLimit.IsEnabled { - continue - } - - tokenAddr, exists := dstPoolToToken[dstPoolAddresses[i]] - if !exists { - return nil, fmt.Errorf("pool to token mapping does not contain %s", dstPoolAddresses[i]) - } - res[tokenAddr] = rateLimit.Tokens - } - - return res, nil -} - // Calculates a map that indicates whether a sequence number has already been executed. // It doesn't matter if the execution succeeded, since we don't retry previous // attempts even if they failed. Value in the map indicates whether the log is finalized or not. @@ -341,9 +262,8 @@ func (r *ExecutionReportingPlugin) buildBatch( destTokenPricesUSD map[cciptypes.Address]*big.Int, gasPrice *big.Int, sourceToDestToken map[cciptypes.Address]cciptypes.Address, - destTokenPoolRateLimits map[cciptypes.Address]*big.Int, ) (executableMessages []ccip.ObservedMessage) { - inflightAggregateValue, inflightTokenAmounts, err := inflightAggregates(inflight, destTokenPricesUSD, sourceToDestToken) + inflightAggregateValue, err := inflightAggregates(inflight, destTokenPricesUSD, sourceToDestToken) if err != nil { lggr.Errorw("Unexpected error computing inflight values", "err", err) return []ccip.ObservedMessage{} @@ -385,11 +305,6 @@ func (r *ExecutionReportingPlugin) buildBatch( continue } - if !r.isRateLimitEnoughForTokenPool(destTokenPoolRateLimits, msg.TokenAmounts, inflightTokenAmounts, sourceToDestToken) { - msgLggr.Warnw("Skipping message token pool rate limit hit") - continue - } - msgValue, err := aggregateTokenValue(destTokenPricesUSD, sourceToDestToken, msg.TokenAmounts) if err != nil { msgLggr.Errorw("Skipping message unable to compute aggregate value", "err", err) @@ -470,16 +385,6 @@ func (r *ExecutionReportingPlugin) buildBatch( } availableGas -= messageMaxGas aggregateTokenLimit.Sub(aggregateTokenLimit, msgValue) - for _, tk := range msg.TokenAmounts { - dstToken, exists := sourceToDestToken[tk.Token] - if !exists { - msgLggr.Warnw("destination token does not exist", "token", tk.Token) - continue - } - if rl, exists := destTokenPoolRateLimits[dstToken]; exists { - destTokenPoolRateLimits[dstToken] = rl.Sub(rl, tk.Amount) - } - } msgLggr.Infow("Adding msg to batch", "seqNr", msg.SequenceNumber, "nonce", msg.Nonce, "value", msgValue, "aggregateTokenLimit", aggregateTokenLimit) @@ -513,49 +418,6 @@ func (r *ExecutionReportingPlugin) getTokenDataWithTimeout( return tokenData, tDur, err } -func (r *ExecutionReportingPlugin) isRateLimitEnoughForTokenPool( - destTokenPoolRateLimits map[cciptypes.Address]*big.Int, - sourceTokenAmounts []cciptypes.TokenAmount, - inflightTokenAmounts map[cciptypes.Address]*big.Int, - sourceToDestToken map[cciptypes.Address]cciptypes.Address, -) bool { - rateLimitsCopy := make(map[cciptypes.Address]*big.Int) - for destToken, rl := range destTokenPoolRateLimits { - rateLimitsCopy[destToken] = new(big.Int).Set(rl) - } - - for sourceToken, amount := range inflightTokenAmounts { - if destToken, exists := sourceToDestToken[sourceToken]; exists { - if rl, exists := rateLimitsCopy[destToken]; exists { - rateLimitsCopy[destToken] = rl.Sub(rl, amount) - } - } - } - - for _, sourceToken := range sourceTokenAmounts { - destToken, exists := sourceToDestToken[sourceToken.Token] - if !exists { - r.lggr.Warnw("dest token not found", "sourceToken", sourceToken.Token) - continue - } - - rl, exists := rateLimitsCopy[destToken] - if !exists { - r.lggr.Debugw("rate limit not applied to token", "token", destToken) - continue - } - - if rl.Cmp(sourceToken.Amount) < 0 { - r.lggr.Warnw("token pool rate limit reached", - "token", sourceToken.Token, "destToken", destToken, "amount", sourceToken.Amount, "rateLimit", rl) - return false - } - rateLimitsCopy[destToken] = rl.Sub(rl, sourceToken.Amount) - } - - return true -} - func hasEnoughTokens(tokenLimit *big.Int, msgValue *big.Int, inflightValue *big.Int) (*big.Int, bool) { tokensLeft := big.NewInt(0).Sub(tokenLimit, inflightValue) return tokensLeft, tokensLeft.Cmp(msgValue) >= 0 @@ -917,28 +779,19 @@ func inflightAggregates( inflight []InflightInternalExecutionReport, destTokenPrices map[cciptypes.Address]*big.Int, sourceToDest map[cciptypes.Address]cciptypes.Address, -) (*big.Int, map[cciptypes.Address]*big.Int, error) { +) (*big.Int, error) { inflightAggregateValue := big.NewInt(0) - inflightTokenAmounts := make(map[cciptypes.Address]*big.Int) for _, rep := range inflight { for _, message := range rep.messages { msgValue, err := aggregateTokenValue(destTokenPrices, sourceToDest, message.TokenAmounts) if err != nil { - return nil, nil, err + return nil, err } inflightAggregateValue.Add(inflightAggregateValue, msgValue) - - for _, tk := range message.TokenAmounts { - if rl, exists := inflightTokenAmounts[tk.Token]; exists { - inflightTokenAmounts[tk.Token] = rl.Add(rl, tk.Amount) - } else { - inflightTokenAmounts[tk.Token] = new(big.Int).Set(tk.Amount) - } - } } } - return inflightAggregateValue, inflightTokenAmounts, nil + return inflightAggregateValue, nil } // getTokensPrices returns token prices of the given price registry, diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go index 19227cfdd7..44e419e5af 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go @@ -34,7 +34,6 @@ 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/batchreader" - tokenpoolbatchedmocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks" ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" 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_0_0" @@ -512,7 +511,6 @@ func TestExecutionReportingPlugin_buildBatch(t *testing.T) { tokenLimit, destGasPrice *big.Int srcPrices, dstPrices map[cciptypes.Address]*big.Int offRampNoncesBySender map[cciptypes.Address]uint64 - destRateLimits map[cciptypes.Address]*big.Int srcToDestTokens map[cciptypes.Address]cciptypes.Address expectedSeqNrs []ccip.ObservedMessage }{ @@ -571,22 +569,6 @@ func TestExecutionReportingPlugin_buildBatch(t *testing.T) { offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, expectedSeqNrs: nil, }, - { - name: "rate limit hit", - reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg4}, - tokenLimit: big.NewInt(0), - destGasPrice: big.NewInt(10), - srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, - dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, - offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, - destRateLimits: map[cciptypes.Address]*big.Int{ - destNative: big.NewInt(99), - }, - srcToDestTokens: map[cciptypes.Address]cciptypes.Address{ - srcNative: destNative, - }, - expectedSeqNrs: nil, - }, { name: "message with tokens is not executed if limit is reached", reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg4}, @@ -710,273 +692,12 @@ func TestExecutionReportingPlugin_buildBatch(t *testing.T) { tc.dstPrices, tc.destGasPrice, tc.srcToDestTokens, - tc.destRateLimits, ) assert.Equal(t, tc.expectedSeqNrs, seqNrs) }) } } -func TestExecutionReportingPlugin_isRateLimitEnoughForTokenPool(t *testing.T) { - testCases := []struct { - name string - destTokenPoolRateLimits map[cciptypes.Address]*big.Int - tokenAmounts []cciptypes.TokenAmount - inflightTokenAmounts map[cciptypes.Address]*big.Int - srcToDestToken map[cciptypes.Address]cciptypes.Address - exp bool - }{ - { - name: "base", - destTokenPoolRateLimits: map[cciptypes.Address]*big.Int{ - cciptypes.Address("10"): big.NewInt(100), - cciptypes.Address("20"): big.NewInt(50), - }, - tokenAmounts: []cciptypes.TokenAmount{ - {Token: ccipcalc.HexToAddress("1"), Amount: big.NewInt(50)}, - {Token: ccipcalc.HexToAddress("2"), Amount: big.NewInt(20)}, - }, - srcToDestToken: map[cciptypes.Address]cciptypes.Address{ - cciptypes.Address("1"): cciptypes.Address("10"), - cciptypes.Address("2"): cciptypes.Address("20"), - }, - inflightTokenAmounts: map[cciptypes.Address]*big.Int{ - cciptypes.Address("1"): big.NewInt(20), - cciptypes.Address("2"): big.NewInt(30), - }, - exp: true, - }, - { - name: "rate limit hit", - destTokenPoolRateLimits: map[cciptypes.Address]*big.Int{ - cciptypes.Address("10"): big.NewInt(100), - cciptypes.Address("20"): big.NewInt(50), - }, - srcToDestToken: map[cciptypes.Address]cciptypes.Address{ - cciptypes.Address("1"): cciptypes.Address("10"), - cciptypes.Address("2"): cciptypes.Address("20"), - }, - tokenAmounts: []cciptypes.TokenAmount{ - {Token: cciptypes.Address("1"), Amount: big.NewInt(50)}, - {Token: cciptypes.Address("2"), Amount: big.NewInt(51)}, - }, - exp: true, - }, - { - name: "rate limit hit, inflight included", - destTokenPoolRateLimits: map[cciptypes.Address]*big.Int{ - cciptypes.Address("10"): big.NewInt(100), - cciptypes.Address("20"): big.NewInt(50), - }, - srcToDestToken: map[cciptypes.Address]cciptypes.Address{ - cciptypes.Address("1"): cciptypes.Address("10"), - cciptypes.Address("2"): cciptypes.Address("20"), - }, - tokenAmounts: []cciptypes.TokenAmount{ - {Token: cciptypes.Address("1"), Amount: big.NewInt(50)}, - {Token: cciptypes.Address("2"), Amount: big.NewInt(20)}, - }, - inflightTokenAmounts: map[cciptypes.Address]*big.Int{ - cciptypes.Address("1"): big.NewInt(51), - cciptypes.Address("2"): big.NewInt(30), - }, - exp: true, - }, - { - destTokenPoolRateLimits: map[cciptypes.Address]*big.Int{}, - tokenAmounts: []cciptypes.TokenAmount{ - {Token: cciptypes.Address("1"), Amount: big.NewInt(50)}, - {Token: cciptypes.Address("2"), Amount: big.NewInt(20)}, - }, - srcToDestToken: map[cciptypes.Address]cciptypes.Address{ - cciptypes.Address("1"): cciptypes.Address("10"), - cciptypes.Address("2"): cciptypes.Address("20"), - }, - inflightTokenAmounts: map[cciptypes.Address]*big.Int{ - cciptypes.Address("1"): big.NewInt(20), - cciptypes.Address("2"): big.NewInt(30), - }, - name: "rate limit not applied to token", - exp: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - p := &ExecutionReportingPlugin{lggr: logger.TestLogger(t)} - p.isRateLimitEnoughForTokenPool(tc.destTokenPoolRateLimits, tc.tokenAmounts, tc.inflightTokenAmounts, tc.srcToDestToken) - }) - } -} - -func TestExecutionReportingPlugin_destPoolRateLimits(t *testing.T) { - randAddr := func() cciptypes.Address { - return cciptypes.Address(utils.RandomAddress().String()) - } - tk1 := randAddr() - tk1dest := randAddr() - tk1pool := randAddr() - - tk2 := randAddr() - tk2dest := randAddr() - tk2pool := randAddr() - - testCases := []struct { - name string - tokenAmounts []cciptypes.TokenAmount - // the order of the following fields: sourceTokens, destTokens and poolRateLimits - // should follow the order of the tokenAmounts - sourceTokens []cciptypes.Address - destTokens []cciptypes.Address - destPools []cciptypes.Address - poolRateLimits []cciptypes.TokenBucketRateLimit - destPoolsCacheErr error - - expRateLimits map[cciptypes.Address]*big.Int - expErr bool - }{ - { - name: "happy flow", - tokenAmounts: []cciptypes.TokenAmount{ - {Token: tk1}, - {Token: tk2}, - {Token: tk1}, - {Token: tk1}, - }, - sourceTokens: []cciptypes.Address{tk1, tk2}, - destTokens: []cciptypes.Address{tk1dest, tk2dest}, - destPools: []cciptypes.Address{tk1pool, tk2pool}, - poolRateLimits: []cciptypes.TokenBucketRateLimit{ - {Tokens: big.NewInt(1000), IsEnabled: true}, - {Tokens: big.NewInt(2000), IsEnabled: true}, - }, - expRateLimits: map[cciptypes.Address]*big.Int{ - tk1dest: big.NewInt(1000), - tk2dest: big.NewInt(2000), - }, - expErr: false, - }, - { - name: "missing from source to dest mapping should not return error", - tokenAmounts: []cciptypes.TokenAmount{ - {Token: tk1}, - {Token: tk2}, // <- missing - }, - sourceTokens: []cciptypes.Address{tk1}, - destTokens: []cciptypes.Address{tk1dest}, - destPools: []cciptypes.Address{tk1pool}, - poolRateLimits: []cciptypes.TokenBucketRateLimit{ - {Tokens: big.NewInt(1000), IsEnabled: true}, - }, - expRateLimits: map[cciptypes.Address]*big.Int{ - tk1dest: big.NewInt(1000), - }, - expErr: false, - }, - { - name: "pool is disabled", - tokenAmounts: []cciptypes.TokenAmount{ - {Token: tk1}, - {Token: tk2}, - }, - sourceTokens: []cciptypes.Address{tk1, tk2}, - destTokens: []cciptypes.Address{tk1dest, tk2dest}, - destPools: []cciptypes.Address{tk1pool, tk2pool}, - poolRateLimits: []cciptypes.TokenBucketRateLimit{ - {Tokens: big.NewInt(1000), IsEnabled: true}, - {Tokens: big.NewInt(2000), IsEnabled: false}, - }, - expRateLimits: map[cciptypes.Address]*big.Int{ - tk1dest: big.NewInt(1000), - }, - expErr: false, - }, - { - name: "dest pool cache error", - tokenAmounts: []cciptypes.TokenAmount{ - {Token: tk1}, - }, - sourceTokens: []cciptypes.Address{tk1}, - destTokens: []cciptypes.Address{tk1dest}, - destPools: []cciptypes.Address{tk1pool}, - poolRateLimits: []cciptypes.TokenBucketRateLimit{ - {Tokens: big.NewInt(1000), IsEnabled: true}, - }, - expRateLimits: map[cciptypes.Address]*big.Int{ - tk1dest: big.NewInt(1000), - }, - destPoolsCacheErr: errors.New("some err"), - expErr: true, - }, - { - name: "pool for token not found", - tokenAmounts: []cciptypes.TokenAmount{ - {Token: tk1}, {Token: tk2}, {Token: tk1}, {Token: tk2}, - }, - sourceTokens: []cciptypes.Address{tk1, tk2}, - destTokens: []cciptypes.Address{tk1dest, tk2dest}, - destPools: []cciptypes.Address{tk1pool}, // <-- pool2 not found - poolRateLimits: []cciptypes.TokenBucketRateLimit{ - {Tokens: big.NewInt(1000), IsEnabled: true}, - }, - expRateLimits: map[cciptypes.Address]*big.Int{ - tk1dest: big.NewInt(1000), - }, - expErr: true, - }, - } - - ctx := testutils.Context(t) - lggr := logger.TestLogger(t) - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - sourceToDestMapping := make(map[cciptypes.Address]cciptypes.Address) - for i, srcTk := range tc.sourceTokens { - sourceToDestMapping[srcTk] = tc.destTokens[i] - } - - poolsMapping := make(map[cciptypes.Address]cciptypes.Address) - for i, poolAddr := range tc.destPools { - poolsMapping[tc.destTokens[i]] = poolAddr - } - - p := &ExecutionReportingPlugin{} - p.lggr = lggr - - offRampAddr := utils.RandomAddress() - mockOffRampReader := ccipdatamocks.NewOffRampReader(t) - mockOffRampReader.On("Address").Return(offRampAddr, nil).Maybe() - mockOffRampReader.On("GetTokens", ctx).Return(cciptypes.OffRampTokens{ - DestinationPool: poolsMapping, - }, tc.destPoolsCacheErr).Maybe() - p.offRampReader = mockOffRampReader - - tokenPoolFactoryMock := tokenpoolbatchedmocks.NewTokenPoolBatchedReader(t) - tokenPoolFactoryMock.On("GetInboundTokenPoolRateLimits", mock.Anything, mock.Anything).Return(tc.poolRateLimits, nil).Maybe() - p.tokenPoolBatchedReader = tokenPoolFactoryMock - - rateLimits, err := p.destPoolRateLimits(ctx, []commitReportWithSendRequests{ - { - sendRequestsWithMeta: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ - { - EVM2EVMMessage: cciptypes.EVM2EVMMessage{ - TokenAmounts: tc.tokenAmounts, - }, - }, - }, - }, - }, sourceToDestMapping) - - if tc.expErr { - assert.Error(t, err) - return - } - assert.NoError(t, err) - assert.Equal(t, tc.expRateLimits, rateLimits) - }) - } -} - func TestExecutionReportingPlugin_getReportsWithSendRequests(t *testing.T) { testCases := []struct { name string @@ -1516,7 +1237,7 @@ func Test_inflightAggregates(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - inflightAggrVal, inflightTokenAmounts, err := inflightAggregates( + inflightAggrVal, err := inflightAggregates( tc.inflight, tc.destTokenPrices, tc.sourceToDest) if tc.expErr { @@ -1525,7 +1246,6 @@ func Test_inflightAggregates(t *testing.T) { } assert.NoError(t, err) assert.True(t, reflect.DeepEqual(tc.expInflightAggrVal, inflightAggrVal)) - assert.True(t, reflect.DeepEqual(tc.expInflightTokenAmounts, inflightTokenAmounts)) }) } }