Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use real deployed contracts in CCIPReader tests [CCIP-4239] #15357

Merged
merged 32 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c73e6e4
WIP Use real deployed contracts in CCIPReader tests
asoliman92 Nov 21, 2024
2d3fff0
Add NewMemoryEnvironmentContractsOnly to make testing faster without …
asoliman92 Nov 21, 2024
69495cd
Use deployed contracts in
asoliman92 Nov 21, 2024
b833bbc
Use deployed contracts in
asoliman92 Nov 21, 2024
e5534ea
Use deployed contracts in
asoliman92 Nov 21, 2024
f955bfe
go mod tidy
asoliman92 Nov 21, 2024
543ce0c
TestCCIPReader_Nonces using deployment env - Not working
asoliman92 Nov 21, 2024
8d5bec3
Use parameter object
asoliman92 Nov 21, 2024
09abc68
Finality test
asoliman92 Nov 21, 2024
f2e4580
Extract common functionality
asoliman92 Nov 21, 2024
10be982
Nonces won't work with real contracts, needs plugins running
asoliman92 Nov 22, 2024
428291f
Nonces won't work with real contracts, needs plugins running
asoliman92 Nov 22, 2024
bd37cf2
Merge branch 'develop' into ccipreader-tests2
asoliman92 Nov 22, 2024
188945a
modtidy
asoliman92 Nov 22, 2024
2c6c21b
move back to core/capabilities until ./integration-tests is ready wit…
asoliman92 Nov 27, 2024
687a3df
Add TestCCIPReader_GetLatestPriceSeqNr
asoliman92 Nov 27, 2024
4da1b54
Merge branch 'develop' into ccipreader-tests2
asoliman92 Nov 27, 2024
3ba9c66
after merge
asoliman92 Nov 27, 2024
94a18a3
Importing txdb from internal
b-gopalswami Nov 27, 2024
9af0c51
Reducing parallel to avoid too many client error
b-gopalswami Nov 27, 2024
a73ede0
Linting
asoliman92 Nov 28, 2024
34c5045
[Bot] Update changeset file with jira issues
app-token-issuer-infra-releng[bot] Nov 28, 2024
79b3199
Use latest CCIP and comment GetLatestPriceSeqNr until the cl-ccip bra…
asoliman92 Nov 28, 2024
23a7b13
Merge branch 'develop' into ccipreader-tests2
asoliman92 Nov 28, 2024
7203c84
Reduce timeout for Eventually and Never
asoliman92 Nov 29, 2024
81acb1c
Add PR that we need to uncomment the test for once it's merged
asoliman92 Nov 29, 2024
e67d90e
Remove test until cl-ccip pr is merged
asoliman92 Nov 29, 2024
c73fd83
Merge branch 'develop' into ccipreader-tests2
asoliman92 Nov 29, 2024
7cfd74c
Merge branch 'develop' into ccipreader-tests2
asoliman92 Nov 29, 2024
acf744d
skip failing test
asoliman92 Nov 29, 2024
461eb43
fix lint
asoliman92 Nov 29, 2024
0e42634
Merge branch 'develop' into ccipreader-tests2
asoliman92 Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/afraid-houses-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#updated use real contracts in ccipreader_tests where possible
9 changes: 9 additions & 0 deletions .github/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ runner-test-matrix:
triggers:
- PR Integration CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_fee_boosting_test.go -timeout 12m -test.parallel=2 -count=1 -json

- id: contracts/ccipreader_test.go:*
path: integration-tests/contracts/ccipreader_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

# END: CCIP tests
10 changes: 10 additions & 0 deletions contracts/.changeset/mean-masks-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@chainlink/contracts': patch
---

#added new function to CCIPReaderTester getLatestPriceSequenceNumber


PR issue: CCIP-4239

Solidity Review issue: CCIP-3966
14 changes: 14 additions & 0 deletions contracts/src/v0.8/ccip/test/helpers/CCIPReaderTester.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ contract CCIPReaderTester {
mapping(uint64 sourceChainSelector => OffRamp.SourceChainConfig sourceChainConfig) internal s_sourceChainConfigs;
mapping(uint64 destChainSelector => uint64 sequenceNumber) internal s_destChainSeqNrs;
mapping(uint64 sourceChainSelector => mapping(bytes sender => uint64 nonce)) internal s_senderNonce;
uint64 private s_latestPriceSequenceNumber;

/// @notice Gets the next sequence number to be used in the onRamp
/// @param destChainSelector The destination chain selector
Expand Down Expand Up @@ -52,6 +53,19 @@ contract CCIPReaderTester {
s_sourceChainConfigs[sourceChainSelector] = sourceChainConfig;
}

/// @notice sets the sequence number of the last price update.
function setLatestPriceSequenceNumber(
uint64 seqNr
) external {
s_latestPriceSequenceNumber = seqNr;
}

/// @notice Returns the sequence number of the last price update.
/// @return sequenceNumber The latest price update sequence number.
function getLatestPriceSequenceNumber() external view returns (uint64) {
return s_latestPriceSequenceNumber;
}

function emitCCIPMessageSent(uint64 destChainSelector, Internal.EVM2AnyRampMessage memory message) external {
emit OnRamp.CCIPMessageSent(destChainSelector, message.header.sequenceNumber, message);
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ burn_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMint
burn_with_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.bin c3f723e7f6394297c095a9d9696f1bceec4a2e85b5be2159f7a21d257eb6b480
ccip_encoding_utils: ../../../contracts/solc/v0.8.24/ICCIPEncodingUtils/ICCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/ICCIPEncodingUtils/ICCIPEncodingUtils.bin 9971fc93c34442a0989570d3dab90a125de31e6e60754ad972807ce6ad4dfba0
ccip_home: ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.abi ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.bin 02cb75b4274a5be7f4006cf2b72cc09e77eb6dba4c1a9c720af86668ff8ea1df
ccip_reader_tester: ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin 893c9930e874fe5235db24e28a22650c37f562da94fac93618566bcd84839fdc
ccip_reader_tester: ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin b368699ae7dbee7c21d049a641642837f18ce2cc8d4ece69509f205de673108e
ether_sender_receiver: ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.abi ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.bin 09510a3f773f108a3c231e8d202835c845ded862d071ec54c4f89c12d868b8de
fee_quoter: ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.abi ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.bin 8a0869d14bb5247fbc6d836fc20d123358373ed688e0d3b387d59e7d05496fea
lock_release_token_pool: ../../../contracts/solc/v0.8.24/LockReleaseTokenPool/LockReleaseTokenPool.abi ../../../contracts/solc/v0.8.24/LockReleaseTokenPool/LockReleaseTokenPool.bin 1067f557abeb5570f1da7f050ea982ffad0f35dc064e668a8a0e6af128df490c
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ require (
github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect
github.com/smartcontractkit/chain-selectors v1.0.31 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241125151847-c63f5f567fcd // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,8 @@ github.com/smartcontractkit/chain-selectors v1.0.31 h1:oRHyK88KnsCh4OdU2hr0u70pm
github.com/smartcontractkit/chain-selectors v1.0.31/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-20241125151847-c63f5f567fcd h1:hzisF429DPXIXg2yXOHT1Z0TeUcJSO71WN1u03yoeMU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241125151847-c63f5f567fcd/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6 h1:A/qi1YCY/9V9i/sthhizZCA0EECAcBfDKeA2w27H5fo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d h1:0tnjo1gpG16PHAouXamgDAAu6e7PWaM0Ppq6dMWnjx0=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
Expand Down
10 changes: 10 additions & 0 deletions deployment/ccip/changeset/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1187,3 +1187,13 @@ func GetTokenBalance(

return balance
}

func DefaultRouterMessage(receiverAddress common.Address) router.ClientEVM2AnyMessage {
asoliman92 marked this conversation as resolved.
Show resolved Hide resolved
return router.ClientEVM2AnyMessage{
Receiver: common.LeftPadBytes(receiverAddress.Bytes(), 32),
Data: []byte("hello world"),
TokenAmounts: nil,
FeeToken: common.HexToAddress("0x0"),
ExtraArgs: nil,
}
}
2 changes: 1 addition & 1 deletion deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/sethvargo/go-retry v0.2.4
github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86
github.com/smartcontractkit/chain-selectors v1.0.31
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241125151847-c63f5f567fcd
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d
github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1382,8 +1382,8 @@ github.com/smartcontractkit/chain-selectors v1.0.31 h1:oRHyK88KnsCh4OdU2hr0u70pm
github.com/smartcontractkit/chain-selectors v1.0.31/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-20241125151847-c63f5f567fcd h1:hzisF429DPXIXg2yXOHT1Z0TeUcJSO71WN1u03yoeMU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241125151847-c63f5f567fcd/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6 h1:A/qi1YCY/9V9i/sthhizZCA0EECAcBfDKeA2w27H5fo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d h1:0tnjo1gpG16PHAouXamgDAAu6e7PWaM0Ppq6dMWnjx0=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.31
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241125151847-c63f5f567fcd
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,8 @@ github.com/smartcontractkit/chain-selectors v1.0.31 h1:oRHyK88KnsCh4OdU2hr0u70pm
github.com/smartcontractkit/chain-selectors v1.0.31/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-20241125151847-c63f5f567fcd h1:hzisF429DPXIXg2yXOHT1Z0TeUcJSO71WN1u03yoeMU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241125151847-c63f5f567fcd/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6 h1:A/qi1YCY/9V9i/sthhizZCA0EECAcBfDKeA2w27H5fo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241128080738-06bef8620ac6/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d h1:0tnjo1gpG16PHAouXamgDAAu6e7PWaM0Ppq6dMWnjx0=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241125150608-97ceadb2072d/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
Expand Down
Loading
Loading