Skip to content

import chainlink-solana for codec, and rm codec in core#22124

Draft
huangzhen1997 wants to merge 10 commits intodevelopfrom
jh/import-solana-codec-from-chain-family-repo
Draft

import chainlink-solana for codec, and rm codec in core#22124
huangzhen1997 wants to merge 10 commits intodevelopfrom
jh/import-solana-codec-from-chain-family-repo

Conversation

@huangzhen1997
Copy link
Copy Markdown
Contributor

@huangzhen1997 huangzhen1997 commented Apr 21, 2026

Jira: https://smartcontract-it.atlassian.net/browse/NONEVM-4683

Remove duplicate Solana codec code in core, and import it from chainlink-solana instead.

Copilot AI review requested due to automatic review settings April 21, 2026 23:35
@huangzhen1997 huangzhen1997 requested review from a team as code owners April 21, 2026 23:35
@huangzhen1997 huangzhen1997 marked this pull request as draft April 21, 2026 23:35
@github-actions
Copy link
Copy Markdown
Contributor

👋 huangzhen1997, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
* 💬 1 @smartcontractkit/foundations, @smartcontractkit/core
/core/capabilities/ccip/ 2 @smartcontractkit/ccip-offchain
/core/capabilities/ccip/ccipsolana/ 💬 15 @smartcontractkit/bix-build
/core/capabilities/ccip/ccipton/ 💬 1 @smartcontractkit/bix-build
/deployment/ccip/ 💬 2 @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/operations-platform, @smartcontractkit/core
go.mod 💬 6 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 💬 6 @smartcontractkit/core, @smartcontractkit/foundations
integration-tests/go.mod 💬 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations
integration-tests/go.sum 💬 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

✅ No conflicts with other open PRs targeting develop

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: HIGH — moves Solana CCIP codec logic out of core and rewires multiple call sites to an external module (chainlink-solana), which is critical-path for message encoding/decoding.

This PR migrates Solana CCIP codec usage to github.com/smartcontractkit/chainlink-solana/pkg/solana/ccip/codec and removes the duplicated codec implementation from core/capabilities/ccip/ccipsolana.

Changes:

  • Replace in-repo Solana address/extra-data codec usage with chainlink-solana constructors (NewAddressCodec, NewExtraDataDecoder, etc.).
  • Remove the in-core Solana CCIP codec implementation and its tests (commit/execute codecs, message hasher, extra-data codec, address codec).
  • Update affected tests and deployment helpers to use the new codec package.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
deployment/ccip/manualexechelpers/exec.go Switch Solana extra-data decoder to chainlink-solana codec.
deployment/ccip/changeset/internal/deploy_home_chain.go Switch Solana address codec to chainlink-solana codec for OCR3 config building.
core/capabilities/ccip/ocrimpls/contract_transmitter_test.go Update test to use chainlink-solana extra-data decoder.
core/capabilities/ccip/ccipsolana/pluginconfig.go Wire Solana plugin config to chainlink-solana codecs (commit/execute/hasher/address/extradata).
core/capabilities/ccip/ccipsolana/gas_helpers_test.go Update tests to use chainlink-solana extra-data decoder; adds local extra-args serialization helper.
core/capabilities/ccip/ccipsolana/msghasher_test.go Removed (codec/message hasher tests moved out of core).
core/capabilities/ccip/ccipsolana/msghasher.go Removed (message hasher moved out of core).
core/capabilities/ccip/ccipsolana/extradatacodec_test.go Removed (extra-data decoder tests moved out of core).
core/capabilities/ccip/ccipsolana/extradatacodec.go Removed (extra-data decoder moved out of core).
core/capabilities/ccip/ccipsolana/executecodec_test.go Removed (execute codec tests moved out of core).
core/capabilities/ccip/ccipsolana/executecodec.go Removed (execute codec moved out of core).
core/capabilities/ccip/ccipsolana/commitcodec_test.go Removed (commit codec tests moved out of core).
core/capabilities/ccip/ccipsolana/commitcodec.go Removed (commit codec moved out of core).
core/capabilities/ccip/ccipsolana/addresscodec_test.go Removed (address codec tests moved out of core).
core/capabilities/ccip/ccipsolana/addresscodec.go Removed (address codec moved out of core).
core/capabilities/ccip/ccipevm/msghasher_test.go Update test to use chainlink-solana extra-data decoder for Solana family.

Comment on lines 124 to 126
func makeExtraArgsV2(computeUnits uint32, allowOOO bool) []byte {
extraArgs, err := SerializeExtraArgs(svmExtraArgsV1Tag, fee_quoter.SVMExtraArgsV1{
extraArgs, err := serializeExtraArgs(svmExtraArgsV1Tag, fee_quoter.SVMExtraArgsV1{
AllowOutOfOrderExecution: allowOOO,
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

svmExtraArgsV1Tag is referenced in makeExtraArgsV2, but the tag constant was removed when the in-core Solana codec was deleted (it used to live in extradatacodec.go). This test file will not compile until the tag is reintroduced (e.g., define it locally, or reference an exported tag constant from chainlink-solana/pkg/solana/ccip/codec if available).

Copilot uses AI. Check for mistakes.
AddressCodec: codec.NewAddressCodec(),
ChainRW: ChainRWProvider{},
ExtraDataCodec: ExtraDataDecoder{},
ExtraDataCodec: codec.NewExtraDataDecoder(),
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

NewGasEstimateProvider/EstimateProvider in ccipsolana still depends on helpers (parseExtraDataMap, extractDestGasAmountFromMap) that were removed along with the in-core codec (e.g., msghasher.go/executecodec.go). As-is, the ccipsolana package will not compile. Please either re-home those helpers (e.g., into ccipsolana or the new chainlink-solana/.../codec package with exported APIs) and update EstimateProvider to use them, or refactor EstimateProvider to avoid relying on the removed parsing logic.

Suggested change
ExtraDataCodec: codec.NewExtraDataDecoder(),
ExtraDataCodec: extraDataCodec,

Copilot uses AI. Check for mistakes.
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 21, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestIntegration_DirectRequest/legacy_mode The test failed due to a 'replacement transaction underpriced' error during a transaction replacement attempt. Logs ↗︎
TestIntegration_DirectRequest The test named TestIntegration_DirectRequest failed during execution. Logs ↗︎

View Full Report ↗︎Docs

"github.com/smartcontractkit/chainlink-evm/pkg/assets"
evmtestutils "github.com/smartcontractkit/chainlink-evm/pkg/testutils"
"github.com/smartcontractkit/chainlink-evm/pkg/utils"
solanacodec "github.com/smartcontractkit/chainlink-solana/pkg/solana/ccip/codec"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, what is this code? Ideally we want to completely disallow importing chainlink-solana in to this module.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jmank88 agreed. However, this is a step forward in cleaning up the code. At the moment, we have unnecessary duplication between plugins in core and in chainlink-solana. Core already depends on chainlink-solana, so this is a step forward in fixing things. The ideal scenario would be to remove the dependency entirely but that will require code refactoring in CCIP core and other AltVMs implementing the chain provider, which is a much more ambitious project.

Do we agree that this leaves the code in a better shape and that we should move forward? cc @archseer @ogtownsend

@cl-sonarqube-production
Copy link
Copy Markdown

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.

4 participants