Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
74 changes: 74 additions & 0 deletions .ai/agent-integration-tests-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
🧠 Cursor Agent Prompt: Chainlink CCIP Integration Test Troubleshooting Specialist

You are a highly specialized debugging agent focused on Chainlink CCIP (Cross-Chain Interoperability Protocol) integration tests. Your job is to analyze failures by reading log files and understanding the expected behavior of end-to-end test scenarios that involve OCR-based commit and exec phases.

🎯 Your Mission

Given:
• A description of the failing test case (i.e., what it is trying to validate).
• One or more log files or output segments from a test run.
• (Optional) snippets of the test code or configuration.

Your task is to:
1. Identify what went wrong, where, and when.
2. Understand how OCR commit and exec phases behaved in the logs.
3. Determine if the issue is due to off-chain reporting, on-chain contract interaction, timing/messaging issues, or environment/config errors.
4. Recommend concrete next steps toward resolution.


🧬 Background Knowledge: Chainlink CCIP Context
• CCIP enables secure cross-chain messaging and token transfers.
• Each successful CCIP message involves:
1. A commit phase handled via OCR (Off-chain Reporting) where validators observe and reach consensus on the event.
2. An exec phase, also handled via OCR, which is responsible for executing the delivery of the message on the destination chain.
• Tests typically spin up simulated source and destination chains, with mock tokens, on-chain routers, and OCR processes running in Docker or in-memory environments.
• Failures might result from:
• OCR misconfigurations or timeouts
• Transaction reverts on either chain
• Race conditions between chains
• Gossip protocol delays or failures
• Contract state mismatches


🧪 Integration Test Context You May Encounter

Example test goals:
• Sending a token/message from Chain A to Chain B.
• Verifying that the commit report was accepted on Chain A.
• Verifying that the exec report was submitted and processed on Chain B.
• Ensuring proper delivery of tokens or messages at the destination.


🛠️ Expected Agent Response Format

🔍 **Issue Summary**:
<Brief summary of what failed in the test and how it relates to CCIP/OCR>

📚 **Test Case Goal**:
<Short restatement of what the test intended to verify>

🧩 **Relevant Log Events**:
- [timestamp] [component] message
- [timestamp] ocr2.commit: Aggregated report with digest ...
- [timestamp] ocr2.exec: Transaction failed with revert reason ...
- ...

🧠 **Root Cause Analysis**:
<Explanation of what the logs suggest went wrong — include OCR timing, message propagation, tx failures, etc. Tie back to commit/exec phases.>

🛠️ **Recommended Next Steps**:
<Concrete suggestions: inspect config, re-run with logging, fix test logic, retry with delay, fix revert, etc.>

❓ **If Inconclusive**:
<Explain what data is missing and what logs or config would help troubleshoot further>


📝 Additional Instructions
• Favor signal over noise—summarize logs, don’t repeat them verbatim unless essential.
• Cross-reference OCR phase logs with test intentions to catch phase-specific failures (e.g., commit success but exec failed).
• Be strict about temporal ordering of events—many bugs are time-sensitive.
• If OCR rounds are involved, verify if consensus was reached and correctly propagated on-chain.
• Surface revert reasons, gas estimation errors, or unexpected nil pointers if visible in logs.
13 changes: 13 additions & 0 deletions .github/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,19 @@ runner-test-matrix:
aptos_cli_version: 7.2.0
install_plugins_public: true

# SUI tests
- id: smoke/ccip/ccip_sui_source_messaging_test.go:Test_CCIP_Messaging_Sui2EVM
path: integration-tests/smoke/ccip/ccip_sui_source_messaging_test.go
test_env_type: in-memory
runs_on: ubuntu-latest
triggers:
- PR Integration CCIP Tests
- Nightly Integration CCIP Tests
test_cmd: cd smoke/ccip && go test ccip_sui_source_messaging_test.go -run "Test_CCIP_Messaging_Sui2EVM" -timeout 20m -test.parallel=1 -count=1 -json
test_go_project_path: integration-tests
install_plugins_public: true
sui_cli_version: mainnet-v1.50.1

# TON tests
- id: smoke/ccip/ccip_ton_messaging_test.go:*
path: integration-tests/smoke/ccip/ccip_ton_messaging_test.go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
contents: read
needs: changes
if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@08494221eaae4aff37a01669818cff24a4f80b4c # 2025-06-20
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@ce42e0f4d4f108a242d9bd777c30aa24702a712a # Not merged yet
with:
workflow_name: Run CCIP Integration Tests For PR
chainlink_version: ${{ inputs.cl_ref || github.sha }}
Expand Down
8 changes: 4 additions & 4 deletions core/capabilities/ccip/configs/sui/contract_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/smartcontractkit/chainlink-ccip/pkg/consts"
"github.com/smartcontractkit/chainlink-sui/relayer/chainreader"
chainreaderConfig "github.com/smartcontractkit/chainlink-sui/relayer/chainreader/config"
"github.com/smartcontractkit/chainlink-sui/relayer/client"
"github.com/smartcontractkit/chainlink-sui/relayer/codec"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey"
Expand Down Expand Up @@ -111,7 +111,7 @@ func GetChainReaderConfig(pubKeyStr string) (map[string]any, error) {
},
"offramp": map[string]any{
"Name": "offramp",
"Functions": map[string]*chainreader.ChainReaderFunction{
"Functions": map[string]*chainreaderConfig.ChainReaderFunction{
consts.MethodNameOffRampLatestConfigDetails: {
Name: "latest_config_details",
SignerAddress: fromAddress,
Expand Down Expand Up @@ -314,7 +314,7 @@ func GetChainReaderConfig(pubKeyStr string) (map[string]any, error) {
},
"OnRamp": map[string]any{
"Name": "onramp",
"Functions": map[string]*chainreader.ChainReaderFunction{
"Functions": map[string]*chainreaderConfig.ChainReaderFunction{
"OnRampGetDynamicConfig": {
Name: "get_dynamic_config",
SignerAddress: fromAddress,
Expand Down Expand Up @@ -375,7 +375,7 @@ func GetChainReaderConfig(pubKeyStr string) (map[string]any, error) {
},
},
},
"Events": map[string]*chainreader.ChainReaderEvent{
"Events": map[string]*chainreaderConfig.ChainReaderEvent{
"CCIPMessageSent": {
Name: "CCIPMessageSent",
EventType: "CCIPMessageSent",
Expand Down
12 changes: 6 additions & 6 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../../

replace github.com/smartcontractkit/chainlink/system-tests/lib => ../../system-tests/lib

// replace github.com/smartcontractkit/chainlink-sui => ../../../chainlink-sui
replace github.com/smartcontractkit/chainlink-sui => ../../../chainlink-sui

// replace github.com/smartcontractkit/chainlink-deployments-framework => ../../../chainlink-deployments-framework

Expand All @@ -22,7 +22,7 @@ require (

require (
github.com/BurntSushi/toml v1.4.0
github.com/Masterminds/semver/v3 v3.3.1
github.com/Masterminds/semver/v3 v3.4.0
github.com/docker/docker v28.0.4+incompatible
github.com/docker/go-connections v0.5.0
github.com/ethereum/go-ethereum v1.15.11
Expand All @@ -36,7 +36,7 @@ require (
github.com/manyminds/api2go v0.0.0-20171030193247-e7b693844a6f
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/pelletier/go-toml/v2 v2.2.4
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.22.0
github.com/rs/zerolog v1.33.0
Expand All @@ -47,9 +47,9 @@ require (
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250710062234-1e64a19122f6
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250709160835-3dbd1ee373a2
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250604171706-a98fa6515eae
github.com/smartcontractkit/chainlink-deployments-framework v0.17.3-0.20250711225258-bceac2b92545
github.com/smartcontractkit/chainlink-deployments-framework v0.17.3
github.com/smartcontractkit/chainlink-evm v0.0.0-20250707140145-45280ea11f19
github.com/smartcontractkit/chainlink-testing-framework/framework v0.9.7
github.com/smartcontractkit/chainlink-testing-framework/framework v0.10.3
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.2
github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.4
github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2
Expand Down Expand Up @@ -467,7 +467,7 @@ require (
github.com/smartcontractkit/chainlink-protos/svr v1.1.0 // indirect
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20250619160901-79b609b1021c // indirect
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250708220600-853616d583f4 // indirect
github.com/smartcontractkit/chainlink-sui v0.0.0-20250713062856-8e588ade17f7 // indirect
github.com/smartcontractkit/chainlink-sui v0.0.0-20250715135906-48156204741b // indirect
github.com/smartcontractkit/chainlink-testing-framework/parrot v0.6.2 // indirect
github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250701132001-f8be142155b6 // indirect
github.com/smartcontractkit/freeport v0.1.1 // indirect
Expand Down
18 changes: 8 additions & 10 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ github.com/Khan/genqlient v0.7.0/go.mod h1:HNyy3wZvuYwmW3Y7mkoQLZsa/R5n5yIRajS1k
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/Microsoft/hcsshim v0.12.9 h1:2zJy5KA+l0loz1HzEGqyNnjd3fyZA31ZBCGKacp6lLg=
Expand Down Expand Up @@ -1327,8 +1327,8 @@ github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
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/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
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/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM=
Expand Down Expand Up @@ -1519,8 +1519,8 @@ github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-2025
github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk/v2/pb v0.0.0-20250709160835-3dbd1ee373a2/go.mod h1:0B4c6GEcnm67Q/E8vwpxTpdjL8elQkh8pVzxGhXkVsM=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250604171706-a98fa6515eae h1:BmqiIDbA9FB/uOCOHi/shgL7P0XmjFxhfRtJHdKPLE4=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250604171706-a98fa6515eae/go.mod h1:2MggrMtbhqr0u4U2pcYa21lvAtvaeSawjxdIy1ytHWE=
github.com/smartcontractkit/chainlink-deployments-framework v0.17.3-0.20250711225258-bceac2b92545 h1:DRuKVoC8WTsr7F/COnNL0ksUnQJTN0PxtACrTnwDd8A=
github.com/smartcontractkit/chainlink-deployments-framework v0.17.3-0.20250711225258-bceac2b92545/go.mod h1:UBZsviBNPyQFi3iGvf+Zq+8Vn4Phpt+UrEk8eUIc/lM=
github.com/smartcontractkit/chainlink-deployments-framework v0.17.3 h1:zOh6ievxXQwRzNJ9S6mFS75ioDHWakGb75dzndw2kW0=
github.com/smartcontractkit/chainlink-deployments-framework v0.17.3/go.mod h1:UBZsviBNPyQFi3iGvf+Zq+8Vn4Phpt+UrEk8eUIc/lM=
github.com/smartcontractkit/chainlink-evm v0.0.0-20250707140145-45280ea11f19 h1:fbFfEg+XLua6I2zzB+NXfqVMYtviO5bMEnqZQo06w7I=
github.com/smartcontractkit/chainlink-evm v0.0.0-20250707140145-45280ea11f19/go.mod h1:FYO2DGcOpSsrTkK5S+2BT7i0rODi7NO5N9kTYxE6FdY=
github.com/smartcontractkit/chainlink-feeds v0.1.2-0.20250227211209-7cd000095135 h1:8u9xUrC+yHrTDexOKDd+jrA6LCzFFHeX1G82oj2fsSI=
Expand All @@ -1547,10 +1547,8 @@ github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20250619160901-
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20250619160901-79b609b1021c/go.mod h1:HIpGvF6nKCdtZ30xhdkKWGM9+4Z4CVqJH8ZBL1FTEiY=
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250708220600-853616d583f4 h1:Wdvd12kqRWIauMp+Lz1KRpqRJ/SVtmzdTJ7mCywJXI8=
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250708220600-853616d583f4/go.mod h1:UqygC5z2W+fdkkgQEe6tbUfa8yhcvAQhcm4vKJMvoGw=
github.com/smartcontractkit/chainlink-sui v0.0.0-20250713062856-8e588ade17f7 h1:xGkIWrAxtuuDPWGI2GXZTh/xczXnA5j/GaWSLiFM1Bc=
github.com/smartcontractkit/chainlink-sui v0.0.0-20250713062856-8e588ade17f7/go.mod h1:JnCocOIqRjN3IR9J+SRqmJabPTjhf/7wykKuVWRj1hw=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.9.7 h1:haG6hdwUp987TL6UKk6ygeW3hisnGAQXSI+NIh199Kw=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.9.7/go.mod h1:q99H9vcMJDs6T+zsSI8XJZd6PUkZnyG3iaRbrYNUCTk=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.10.3 h1:MopuYT5IFlcitX1IvZ7H9agwuxsMwFsG/4Pt7jN+6r0=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.10.3/go.mod h1:47sm4C5wBxR8VBAZoDRGSt5wJwDJN3vVeE36l5vQs1g=
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.2 h1:uqe6xg+fMb/BRMzEJuzSjXpHnzksk8dlCAvOd1DrQ9k=
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.2/go.mod h1:yZukGfDjLHynPQgPX/XcwjnYCGt6NCmQ+qavePrrYeQ=
github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.4 h1:gbQqdsF8mVRgh4h4KRi+8b00OT3Wp/6zrN0uXr0i/J0=
Expand Down
68 changes: 67 additions & 1 deletion deployment/ccip/changeset/testhelpers/test_assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func ConfirmCommitWithExpectedSeqNumRange(
}
for iter.Next() {
event := iter.Event
fmt.Printf("RECEIpVED COMMIT REPORt ACCEPTED: %v", *event)
fmt.Printf("RECEIVED COMMIT REPORT ACCEPTED: %v", *event)
verified := verifyCommitReport(event)
if verified {
return event, nil
Expand Down Expand Up @@ -862,6 +862,18 @@ func ConfirmExecWithSeqNrsForAll(
if err != nil {
return err
}
//case chainsel.FamilySui:
// innerExecutionStates, err = ConfirmExecWithExpectedSeqNrsSui(
// t,
// srcChain,
// e.BlockChains.SuiChains()[dstChain],
// state.SuiChains[dstChain].CCIPAddress,
// startBlock,
// seqRange,
// )
// if err != nil {
// return err
// }
default:
return fmt.Errorf("unsupported chain family; %v", family)
}
Expand Down Expand Up @@ -1063,6 +1075,60 @@ func ConfirmExecWithExpectedSeqNrsAptos(
}
}

func ConfirmExecWithExpectedSeqNrsSui(
t *testing.T,
srcSelector uint64,
dest cldf_aptos.Chain,
offRampAddress aptos.AccountAddress,
startVersion *uint64,
expectedSeqNrs []uint64,
) (executionStates map[uint64]int, err error) {
if len(expectedSeqNrs) == 0 {
return nil, errors.New("no expected sequence numbers provided")
}
boundOffRamp := aptos_ccip_offramp.Bind(offRampAddress, dest.Client)
offRampStateAddress, err := boundOffRamp.Offramp().GetStateAddress(nil)
require.NoError(t, err)

done := make(chan any)
defer close(done)
sink, errChan := AptosEventEmitter[module_offramp.ExecutionStateChanged](t, dest.Client, offRampStateAddress, offRampAddress.StringLong()+"::offramp::OffRampState", "execution_state_changed_events", startVersion, done)

executionStates = make(map[uint64]int)
seqNrsToWatch := make(map[uint64]bool)
for _, seqNr := range expectedSeqNrs {
seqNrsToWatch[seqNr] = true
}

timeout := time.NewTimer(tests.WaitTimeout(t))
defer timeout.Stop()

for {
select {
case event := <-sink:
if seqNrsToWatch[event.Event.SequenceNumber] && event.Event.SourceChainSelector == srcSelector {
t.Logf("(Aptos) received ExecutionStateChanged (state %s) on chain %d (offramp %s) with expected sequence number %d (tx %d)",
executionStateToString(event.Event.State), dest.Selector, offRampAddress.String(), event.Event.SequenceNumber, event.Version,
)
if event.Event.State == EXECUTION_STATE_INPROGRESS {
continue
}
executionStates[event.Event.SequenceNumber] = int(event.Event.State)
delete(seqNrsToWatch, event.Event.SequenceNumber)
if len(seqNrsToWatch) == 0 {
return executionStates, nil
}
}

case err := <-errChan:
require.NoError(t, err)
case <-timeout.C:
return nil, fmt.Errorf("(Aptos) timed out waiting for ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence numbers %+v",
dest.Selector, offRampAddress.String(), srcSelector, expectedSeqNrs)
}
}
}

func ConfirmNoExecConsistentlyWithSeqNr(
t *testing.T,
sourceSelector uint64,
Expand Down
Loading