Skip to content

Commit

Permalink
Remove destination chain rate limiting as it is not needed (#1041)
Browse files Browse the repository at this point in the history
## Motivation
The test `TestSmokeCCIPSelfServeRateLimitOnRamp` intends to set rate
limit to OnRamp contract and verify it. In this, rate limiting on the
source chain is good enough and rate limiting on the destination is not
needed.

## Solution
Remove the rate limiting on the destination part.
  • Loading branch information
b-gopalswami authored Jun 19, 2024
1 parent 95ff331 commit 592426a
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions integration-tests/ccip-tests/smoke/ccip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func TestSmokeCCIPForBidirectionalLane(t *testing.T) {

func TestSmokeCCIPRateLimit(t *testing.T) {
t.Parallel()

log := logging.GetTestLogger(t)
TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke)
require.True(t, TestCfg.TestGroupInput.MsgDetails.IsTokenTransfer(), "Test config should have token transfer message type")
Expand Down Expand Up @@ -492,19 +491,7 @@ func TestSmokeCCIPSelfServeRateLimitOnRamp(t *testing.T) {
require.NoError(t, err)
tc.lane.ValidateRequests()

// Enable aggregate rate limiting on the destination and source chains for the limited token
err = dest.AddRateLimitTokens([]*contracts.ERC20Token{limitedSrcToken}, []*contracts.ERC20Token{limitedDestToken})
require.NoError(t, err, "Error setting destination rate limits")
err = dest.OffRamp.SetRateLimit(contracts.RateLimiterConfig{
IsEnabled: true,
Capacity: aggregateRateLimit,
Rate: aggregateRateLimit,
})
require.NoError(t, err, "Error setting destination rate limits")
err = dest.Common.ChainClient.WaitForEvents()
require.NoError(t, err, "Error waiting for events")
tc.lane.Logger.Debug().Str("Token", limitedSrcToken.ContractAddress.Hex()).Msg("Enabled aggregate rate limit on destination chain")

// Enable aggregate rate limiting on the source chains for the limited token
err = src.OnRamp.SetTokenTransferFeeConfig([]evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{
{
Token: limitedSrcToken.ContractAddress,
Expand All @@ -520,7 +507,7 @@ func TestSmokeCCIPSelfServeRateLimitOnRamp(t *testing.T) {
require.NoError(t, err, "Error setting OnRamp rate limits")
err = src.Common.ChainClient.WaitForEvents()
require.NoError(t, err, "Error waiting for events")

tc.lane.Logger.Debug().Str("Token", limitedSrcToken.ContractAddress.Hex()).Msg("Enabled aggregate rate limit on source chain")
// Send free token that should not have a rate limit and should succeed
src.TransferAmount[freeTokenIndex] = overLimitAmount
src.TransferAmount[limitedTokenIndex] = big.NewInt(0)
Expand Down

0 comments on commit 592426a

Please sign in to comment.