Skip to content

PLEX-1920 add Solana WriteReport test in remote DON#20856

Open
Unheilbar wants to merge 40 commits intodevelopfrom
PLEX-1920
Open

PLEX-1920 add Solana WriteReport test in remote DON#20856
Unheilbar wants to merge 40 commits intodevelopfrom
PLEX-1920

Conversation

@Unheilbar
Copy link
Collaborator

Requires

Supports

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
* 20 @smartcontractkit/foundations, @smartcontractkit/core
/core/capabilities/ 💬 2 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
/deployment 1 @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/operations-platform, @smartcontractkit/core
/deployment/cre 9 @smartcontractkit/keystone, @smartcontractkit/operations-platform
/deployment/keystone 1 @smartcontractkit/keystone, @smartcontractkit/operations-platform, @smartcontractkit/core
/.github/** 💬 1 @smartcontractkit/devex-cicd, @smartcontractkit/devex-tooling, @smartcontractkit/core
go.md 1 @smartcontractkit/core, @smartcontractkit/foundations
go.mod 29 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 29 @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
Contributor

I see you updated files related to core. Please run pnpm changeset 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.

@trunk-io
Copy link

trunk-io bot commented Jan 21, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link
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

Adds a new CRE v2 Solana “WriteReport” smoke test that runs against a remote capabilities DON, along with the supporting Solana capability registration/feature wiring and dependency updates.

Changes:

  • Introduces a new v2 Solana capability smoke test and a WASM workflow that writes a report on-chain.
  • Adds/rewires Solana capability support (new solana flag, v2 Solana feature implementation, job template support).
  • Updates Solana forwarder deployment/configuration plumbing and bumps several Go module dependencies/toolchain versions.

Reviewed changes

Copilot reviewed 64 out of 94 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
system-tests/tests/test-helpers/t_helpers.go Adds Solana workflow config type support in workflow config factory.
system-tests/tests/smoke/cre/v2_solana_capability_test.go New v2 Solana write smoke test harness (deploys cache, uploads workflow, asserts on-chain update).
system-tests/tests/smoke/cre/v1_securemint_test.go Removes legacy v1 SecureMint test.
system-tests/tests/smoke/cre/solana/solwrite/main.go New WASI workflow that derives remaining accounts, generates a report, and calls Solana WriteReport.
system-tests/tests/smoke/cre/solana/solwrite/go.mod New module for the Solana write workflow binary dependencies.
system-tests/tests/smoke/cre/solana/solwrite/config/config.go Defines workflow config struct for Solana write workflow.
system-tests/tests/smoke/cre/httpaction/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/smoke/cre/evm/logtrigger/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/smoke/cre/evm/evmread/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/smoke/cre/cre_suite_test.go Replaces v1 SecureMint suite entry with new v2 Solana suite entry.
system-tests/tests/regression/cre/httpaction-negative/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/regression/cre/http/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/regression/cre/evm/logtrigger-negative/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/regression/cre/evm/evmwrite-negative/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/regression/cre/evm/evmread-negative/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/regression/cre/consensus/go.mod Toolchain/dependency bumps to align with updated repo deps.
system-tests/tests/go.mod Adds replace/require for new Solana workflow module; bumps Solana deps.
system-tests/tests/canaries_sentinels/proof-of-reserve/cron-based/go.mod Dependency alignment bumps.
system-tests/lib/go.mod Bumps chainlink-solana version and adds contracts module as indirect.
system-tests/lib/cre/types.go Adds SolanaCapability flag and updates OCR requirement logic.
system-tests/lib/cre/flags/provider.go Adds Solana capability into default flag providers.
system-tests/lib/cre/flags/flags.go Updates forwarder requirement logic to include Solana capability.
system-tests/lib/cre/features/solana/v2/solana.go New v2 Solana feature: forwarder deploy, node config patching, capability registration, job creation, forwarder configuration.
system-tests/lib/cre/features/solana/solana.go Removes old Solana feature implementation.
system-tests/lib/cre/features/sets/sets.go Switches feature set to use Solana v2 feature.
system-tests/lib/cre/environment/environment.go Adds additional feature/capability logging during env setup.
system-tests/lib/cre/environment/blockchains/solana/solana.go Updates Solana artifacts download commit SHA.
system-tests/lib/cre/don/config/config.go Minor whitespace-only changes while preparing node TOMLs.
system-tests/lib/cre/don.go Treats SolanaCapability as Solana-enabled for supported chain discovery.
plugins/plugins.public.yaml Bumps chainlink-solana plugin gitRef.
plugins/plugins.private.yaml Bumps consensus gitRef and adds private Solana capability plugin.
integration-tests/load/go.mod Bumps chainlink-solana version.
integration-tests/go.mod Bumps chainlink-solana version.
go.mod Bumps chainlink-solana version and adds purego indirect.
go.md Updates dependency graph documentation for new/changed relationships.
devenv/go.mod Toolchain bump and dependency alignment.
devenv/fakes/go.mod Toolchain bump and dependency alignment.
deployment/utils/nodetestutils/node.go Sets Solana SkipPreflight in test chain config.
deployment/keystone/changeset/internal/types.go Adds extra debugging info when CapReg GetDONs fails.
deployment/go.mod Bumps chainlink-solana and adds chainlink-solana/contracts dependency.
deployment/cre/jobs/types/job_spec_template.go Adds a solana job spec template type.
deployment/cre/jobs/propose_job_spec.go Allows proposing Solana standard-capability jobs (verification TODO).
deployment/cre/forwarder/solana/sequence/seq_forwarder.go Adds Solana forwarder deploy/init sequence.
deployment/cre/forwarder/solana/sequence/operation/operation.go Adds Solana forwarder ops: deploy/init/configure/upgrade authority.
deployment/cre/forwarder/solana/deploy_forwarder_test.go Adds tests for Solana forwarder deploy/config paths (some skipped in CI).
deployment/cre/forwarder/solana/deploy_forwarder.go Adds Solana forwarder changesets (deploy, configure, set upgrade authority) and helpers.
deployment/cre/forwarder/solana/cs_ownership.go Adds ownership transfer changeset wrapper for Solana forwarder.
deployment/cre/forwarder/solana/cs_build_solana.go Adds Solana build params/config for forwarder artifacts.
core/scripts/go.mod Bumps chainlink-solana and adds contracts module indirect.
core/scripts/cre/environment/examples/workflows/v2/time_consensus/go.mod Toolchain/dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v2/time/go.mod Toolchain/dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v2/proof-of-reserve/cron-based/go.mod Dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v2/node-mode/go.mod Toolchain/dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v2/http_simple/go.mod Toolchain/dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v2/http/go.mod Toolchain/dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v2/cron/go.mod Toolchain/dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/web-trigger-based/go.mod Dependency alignment bumps.
core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/cron-based/go.mod Dependency alignment bumps.
core/scripts/cre/environment/configs/workflow-don-solana.toml Updates Solana workflow DON topology (node counts, capabilities, splits remote-capabilities DON).
core/scripts/cre/environment/configs/capability_defaults.toml Adds defaults for new solana capability config and tweaks write-solana defaults.
core/scripts/ccip/manual-execution/go.mod Toolchain/dependency alignment bumps.
core/capabilities/remote/executable/hasher_test.go Updates tests to populate CapabilityId in messages (needed by hasher changes).
core/capabilities/remote/executable/hasher.go Extends WriteReport hasher to support Solana requests based on capability ID family.
.github/workflows/cre-system-tests.yaml Switches topology mapping to run new v2 Solana suite instead of v1 SecureMint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if !w.IsFamily(chainselectors.FamilySolana) {
continue
}
require.IsType(t, &solana.Blockchain{}, solChain, "expected Solana blockchain type")
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

require.IsType is checking solChain before it’s assigned (it’s nil on the first Solana chain), so this will fail even in a correct environment. Validate/cast w instead (or assign solChain = w.(*solana.Blockchain) first and then assert on solChain).

Suggested change
require.IsType(t, &solana.Blockchain{}, solChain, "expected Solana blockchain type")
require.IsType(t, &solana.Blockchain{}, w, "expected Solana blockchain type")

Copilot uses AI. Check for mistakes.
Comment on lines +117 to +127
writeFlagKey, _, err := solgo.FindProgramAddress(writeFlagSeeds, config.Receiver)
return []*solana.AccountMeta{
{PublicKey: config.ForwarderState[:]}, // 0 state
{PublicKey: authority[:]}, // 1 authority
{PublicKey: config.ReceiverState[:]}, // 2 cache state
{PublicKey: config.Receiver[:]}, // 3 dummy legacy store
{PublicKey: config.Receiver[:]}, // 4 dummy legacy feed config
{PublicKey: config.Receiver[:]}, // 5 dummy legacy writer
{PublicKey: decimalReportKey[:], IsWritable: true}, // 6 decimal report pda
{PublicKey: writeFlagKey[:]}, // 7 write permission pda
}, nil
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

FindProgramAddress can return an error, but err is ignored here and the function always returns nil error. Check err and return it (or wrap it) before constructing the accounts list.

Copilot uses AI. Check for mistakes.
}
func onTrigger(config config.Config, runtime cre.Runtime, payload *cron.Payload) (string, error) {
runtime.Logger().Info("Solana Write workflow started", "payload", payload)
solClient := solana.Client{ChainSelector: chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The workflow hardcodes the Solana chain selector, which makes the binary non-reusable across environments/topologies and can silently target the wrong chain. Prefer passing the selector via config.Config (or deriving it from runtime/environment inputs) and constructing the client from that value.

Suggested change
solClient := solana.Client{ChainSelector: chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector}
solClient := solana.Client{ChainSelector: config.ChainSelector}

Copilot uses AI. Check for mistakes.
Comment on lines +170 to +174
func encodeReport(accHash [32]byte, cfg config.Config) ([]byte, error) {
var payloadBuf bytes.Buffer
payloadEnc := ag_binary.NewBorshEncoder(&payloadBuf)
var answer [16]byte
copy(answer[:], big.NewInt(15).Bytes())
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

big.Int.Bytes() is big-endian and variable-length; this copy will not produce the required fixed-width 16-byte little-endian u128 encoding (it will also place bytes at the start rather than right-aligning). Encode to exactly 16 bytes and ensure little-endian layout to match on-chain parsing.

Suggested change
func encodeReport(accHash [32]byte, cfg config.Config) ([]byte, error) {
var payloadBuf bytes.Buffer
payloadEnc := ag_binary.NewBorshEncoder(&payloadBuf)
var answer [16]byte
copy(answer[:], big.NewInt(15).Bytes())
func u128ToLittleEndianBytes(n *big.Int) [16]byte {
var out [16]byte
if n.Sign() < 0 {
// Clamp negative values to zero; encoding for signed values is not supported.
return out
}
// First obtain a fixed-width 16-byte big-endian representation, then reverse it
// to get the required 16-byte little-endian layout.
be := n.FillBytes(make([]byte, 16))
for i := 0; i < 16; i++ {
out[i] = be[15-i]
}
return out
}
func encodeReport(accHash [32]byte, cfg config.Config) ([]byte, error) {
var payloadBuf bytes.Buffer
payloadEnc := ag_binary.NewBorshEncoder(&payloadBuf)
answer := u128ToLittleEndianBytes(big.NewInt(15))

Copilot uses AI. Check for mistakes.
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
32.7% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube

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.

3 participants