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

Add generic codec for CCIP plugin #15454

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

huangzhen1997
Copy link
Contributor

@huangzhen1997 huangzhen1997 commented Nov 29, 2024

https://smartcontract-it.atlassian.net/browse/NONEVM-935

This is part of the change for supporting solana plugin codec. The plugin component will use generic codec for encode and decode commit and exec report. This PR adds a new commitReportCodec and execReportCodec using the evm codec. Once Solana codec is fully implemented, we will add the solana implementation under ccipsolana

Copy link
Contributor

github-actions bot commented Nov 29, 2024

AER Report: CI Core

aer_workflow , commit , Scheduled Run Frequency , Detect Changes , Clean Go Tidy & Generate , Flakeguard Root Project / Get Tests To Run , lint , Flakeguard Deployment Project , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_race_tests) , Core Tests (go_core_fuzz) , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec, ubuntu-latest) , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm, ubuntu-latest) , Flakeguard Root Project / Report , SonarQube Scan , Flakey Test Detection

1. File is not goimports-ed with -local:

Job ID: Golang Lint

Source of Error:
Golang Lint	2024-12-03T03:15:33.5831228Z core/capabilities/ccip/ccipevm/commitcodecv2.go:8: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint	2024-12-03T03:15:33.5832265Z 	"github.com/ethereum/go-ethereum/common"
Golang Lint	2024-12-03T03:15:33.5834872Z core/services/relay/evm/codec/codec_test.go:13: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint	2024-12-03T03:15:33.5835973Z 	cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
Golang Lint	2024-12-03T03:15:33.5837230Z 	"github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils"

Why: The error indicates that the Go files are not formatted according to the goimports tool with the -local flag set to github.com/smartcontractkit/chainlink. This is a common linting issue where import statements are not grouped and ordered correctly.

Suggested fix: Run goimports -local github.com/smartcontractkit/chainlink -w . in the project directory to automatically format the import statements correctly.

2. Error mapping test results to owners:

Job ID: Set combined test results

Source of Error:
Set combined test results	2024-12-03T03:08:07.4524023Z 2024/12/03 03:08:07 Error mapping test results to owners: open .github/CODEOWNERS: no such file or directory
Set combined test results	2024-12-03T03:08:07.4541462Z ##[error]Process completed with exit code 1.

Why: The error occurs because the .github/CODEOWNERS file is missing. This file is used to map test results to code owners, and its absence causes the process to fail.

Suggested fix: Ensure that the .github/CODEOWNERS file exists in the repository. If it does not, create it and define the appropriate code owners.

3. TestScripts/health/default test failures:

Job ID: Run tests

Source of Error:
Run tests	2024-12-03T03:11:03.0281062Z --- FAIL: TestScripts (0.00s)
Run tests	2024-12-03T03:11:03.0282250Z --- FAIL: TestScripts/health (0.00s)
Run tests	2024-12-03T03:11:03.0283525Z --- FAIL: TestScripts/health/default (3.81s)
Run tests	2024-12-03T03:11:03.0364538Z > env NODEURL=http://localhost:
Run tests	2024-12-03T03:11:03.0366430Z > exec curl --retry 10 --retry-max-time 60 --retry-connrefused 
Run tests	2024-12-03T03:11:03.0367445Z [stdout]
Run tests	2024-12-03T03:11:03.0368282Z 404 page not found
Run tests	2024-12-03T03:11:03.0369183Z [stderr]
Run tests	2024-12-03T03:11:03.0370758Z % Total % Received % Xferd Average Speed Time Time Time Current
Run tests	2024-12-03T03:11:03.0373437Z Dload Upload Total Spent Left Speed
Run tests	2024-12-03T03:11:03.0374291Z 
Run tests	2024-12-03T03:11:03.0375100Z 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Run tests	2024-12-03T03:11:03.0376153Z 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Run tests	2024-12-03T03:11:03.0377869Z curl: (7) Failed to connect to localhost port 14502 after 0 ms: Connection refused
Run tests	2024-12-03T03:11:03.0379870Z Warning: Problem : connection refused. Will retry in 1 seconds. 10 retries 
Run tests	2024-12-03T03:11:03.0380975Z Warning: left.
Run tests	2024-12-03T03:11:03.0655479Z FAIL: testdata/scripts/health/default.txtar:8: unexpected command failure
Run tests	2024-12-03T03:11:03.0657370Z > exec chainlink --remote-node-url  health
Run tests	2024-12-03T03:11:03.0658368Z [stderr]
Run tests	2024-12-03T03:11:03.0660008Z Get "http://localhost:14502/health": dial tcp [::1]:14502: connect: connection refused
Run tests	2024-12-03T03:11:03.0661348Z [exit status 1]
Run tests	2024-12-03T03:11:03.0662873Z FAIL: testdata/scripts/health/default.txtar:10: unexpected command failure
Run tests	2024-12-03T03:11:03.0912452Z [stderr]
Run tests	2024-12-03T03:11:03.0915359Z 2024-12-03T03:10:52.749Z [INFO] Starting Chainlink Node unset at commit unset cmd/shell_local.go:324 SHA=unset Version=unset logger=RunNode version=unset@unset 
Run tests	2024-12-03T03:11:03.0973416Z 2024-12-03T03:10:52.797Z [INFO] Starting StartUpHealthReport services/health.go:55 version=unset@unset 
Run tests	2024-12-03T03:11:03.0975992Z 2024-12-03T03:10:52.829Z [INFO] StartUpHealthReport shutdown complete services/health.go:47 version=unset@unset 
Run tests	2024-12-03T03:13:37.0679589Z 2024-12-03T03:10:52.840Z [INFO] Created CSA key with ID 2b511443aa1d9e67338c9a849696b998a31418f4f8762244b72bd28515a79b2a keystore/csa.go:153 logger=KeyStore version=unset@unset 
Run tests	2024-12-03T03:13:37.0683517Z 2024-12-03T03:10:54.070Z [INFO] Nurse service (automatic pprof profiling) is disabled chainlink/application.go:383 version=unset@unset 
Run tests	2024-12-03T03:13:37.0687978Z 2024-12-03T03:10:54.071Z [INFO] DatabaseBackup: periodic database backups are disabled. To enable automatic backups, set Database.Backup.Mode=lite or Database.Backup.Mode=full chainlink/application.go:399 version=unset@unset 
Run tests	2024-12-03T03:13:37.0692324Z 2024-12-03T03:10:54.071Z [INFO] Created P2P key with ID 12D3KooWDiYXPUSV6cPHF5kcLDzYgZD4Rnvysn7R5Le9A1QwBpwC keystore/p2p.go:147 logger=KeyStore version=unset@unset 
Run tests	2024-12-03T03:13:37.0695997Z 2024-12-03T03:10:54.669Z [INFO] Shutting down due to interrupt signal received... cmd/shell_local.go:351 logger=RunNode version=unset@unset 
Run tests	2024-12-03T03:13:37.0698742Z time=2024-12-03T03:10:55.179Z level=INFO msg="Graceful shutdown time: 510.525721ms"
Run tests	2024-12-03T03:13:37.0700567Z failed to ensure p2p key: context canceled

Why: The test failures are due to the Chainlink node not starting correctly, resulting in connection refused errors when attempting to access the health endpoint. This could be due to misconfiguration or issues with the test environment setup.

Suggested fix: Verify that the Chainlink node configuration is correct and that all necessary services are running. Ensure that the test environment is properly set up and that there are no port conflicts or other issues preventing the node from starting.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types"
)

const commitReportABI = `[{"components":[{"name":"chainSel","type":"uint64","internalType":"uint64"},{"name":"onRampAddress","type":"bytes","internalType":"bytes"},{"name":"seqNumsRange","type":"uint64[2]","internalType":"uint64[2]"},{"name":"merkleRoot","type":"bytes32","internalType":"bytes32"}],"name":"merkleRoots","type":"tuple[]","internalType":"struct MerkleRootChain[]"},{"components":[{"components":[{"name":"tokenID","type":"string","internalType":"string"},{"name":"price","type":"uint256","internalType":"uint256"}],"name":"tokenPriceUpdates","type":"tuple[]","internalType":"struct TokenPrice[]"},{"components":[{"name":"chainSel","type":"uint64","internalType":"uint64"},{"name":"gasPrice","type":"uint256","internalType":"uint256"}],"name":"gasPriceUpdates","type":"tuple[]","internalType":"struct GasPriceChain[]"}],"name":"priceUpdates","type":"tuple","internalType":"struct PriceUpdates"},{"components":[{"name":"r","type":"bytes32","internalType":"bytes32"},{"name":"s","type":"bytes32","internalType":"bytes32"}],"name":"rmnSignatures","type":"tuple[]"}]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be generated from the contracts eventually?

Copy link
Contributor Author

@huangzhen1997 huangzhen1997 Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be ideal. The existing generated ABI seems match with the format from generated MerkleRoot, not with the original report format. See discussion from slack thread

Comment on lines 62 to 65
cd, err := codec.NewCodec(commitCodecConfig)
if err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialize in constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants