Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnogo committed Nov 15, 2024
1 parent 8eb6bed commit 59c11b9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions core/capabilities/ccip/ccipevm/gas_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
ExecutionStateProcessingOverheadGas = 2_100 + // COLD_SLOAD_COST for first reading the state
20_000 + // SSTORE_SET_GAS for writing from 0 (untouched) to non-zero (in-progress)
100 //# SLOAD_GAS = WARM_STORAGE_READ_COST for rewriting from non-zero (in-progress) to non-zero (success/failure)
// TODO: investigate the write overhead for v1.6
DestGasOverhead = 110_000 + 110_000 + 130_000 // 110K for commit, 110K for RMN, 130K for Exec
)

Expand Down
7 changes: 4 additions & 3 deletions deployment/ccip/add_lane.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/ethereum/go-ethereum/common"

"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
Expand Down Expand Up @@ -122,15 +123,15 @@ func DefaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig {
MaxNumberOfTokensPerMsg: 10,
MaxDataBytes: 256,
MaxPerMsgGasLimit: 3_000_000,
DestGasOverhead: 350_000,
DestGasOverhead: ccipevm.DestGasOverhead,
DefaultTokenFeeUSDCents: 1,
DestGasPerPayloadByte: 16,
DestGasPerPayloadByte: ccipevm.CalldataGasPerByte,
DestDataAvailabilityOverheadGas: 100,
DestGasPerDataAvailabilityByte: 100,
DestDataAvailabilityMultiplierBps: 1,
DefaultTokenDestGasOverhead: 125_000,
DefaultTxGasLimit: 200_000,
GasMultiplierWeiPerEth: 11e17,
GasMultiplierWeiPerEth: 11e17, // Gas multiplier in wei per eth is scaled by 1e18, so 11e17 is 1.1 = 110%
NetworkFeeUSDCents: 1,
ChainFamilySelector: [4]byte(evmFamilySelector),
}
Expand Down
9 changes: 0 additions & 9 deletions integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/networks"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip"
integrationactions "github.com/smartcontractkit/chainlink/integration-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts"
Expand Down Expand Up @@ -1435,11 +1434,3 @@ func createEnvironmentConfig(t *testing.T, envName string, testConfig *CCIPTestC
}
return envConfig
}

func SleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) {
time.Sleep(30 * time.Second)
replayBlocks := make(map[uint64]uint64)
replayBlocks[sourceChain] = 1
replayBlocks[destChain] = 1
ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks)
}
11 changes: 10 additions & 1 deletion integration-tests/smoke/ccip_messaging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package smoke

import (
"testing"
"time"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -170,6 +171,14 @@ func Test_CCIPMessaging(t *testing.T) {
})
}

func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) {
time.Sleep(30 * time.Second)
replayBlocks := make(map[uint64]uint64)
replayBlocks[sourceChain] = 1
replayBlocks[destChain] = 1
ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks)
}

func runMessagingTestCase(
tc messagingTestCase,
receiver common.Address,
Expand Down Expand Up @@ -198,7 +207,7 @@ func runMessagingTestCase(

// hack
if !tc.replayed {
testsetups.SleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain)
sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain)
out.replayed = true
}

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/smoke/fee_boosting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type priceFeedPrices struct {
wethPrice *big.Int
}

// TODO: find a way to reuse the same test setup for all tests
func Test_CCIPFeeBoosting(t *testing.T) {
t.Skip("Skipping test as it is not fully implemented yet")
ctx := ccdeploy.Context(t)

setupTestEnv := func(t *testing.T, numChains int) (ccipdeployment.DeployedEnv, ccipdeployment.CCIPOnChainState, []uint64) {
Expand Down Expand Up @@ -161,7 +161,7 @@ func runFeeboostTestCase(tc feeboostTestCase) {
})
expectedSeqNum[tc.destChain] = seqNum

testsetups.SleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain)
sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain)

ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks)
ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks)
Expand Down

0 comments on commit 59c11b9

Please sign in to comment.