Skip to content

Bump solana-go to 1.23 and resolve breakings - #1631

Merged
Unheilbar merged 3 commits into
developfrom
add-v1-support
Sep 8, 2026
Merged

Bump solana-go to 1.23 and resolve breakings#1631
Unheilbar merged 3 commits into
developfrom
add-v1-support

Conversation

@Unheilbar

@Unheilbar Unheilbar commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

core ref: 1294f58cb0ddeed3535c12339b08dadd7cc2ce3b

Bump gagliardetto/solana-go v1.13.0 → v1.23.0

Why

Picks up upstream fixes/features (v1 transaction support, account state helpers, etc.) and lets us drop a local stopgap.

What had to change

  • client.go: MaxSupportTransactionVersion raised to 1 — solana-go can now decode v1 messages natively, so the old MaxRequestedTransactionVersion workaround (requesting a higher version than we could decode, to avoid getBlock failing with -32015) is no longer needed.
  • logpoller: removed that stopgap (job_get_block.go, deleted job_get_block_version_test.go, trimmed related metrics).
  • client.go: solana-go's Transaction.MarshalBinary now silently zero-pads missing signatures instead of erroring, so SendTx explicitly calls VerifySignatures() first and returns a new ErrInvalidSignatures; classify_errors.go classifies it as Fatal.
  • client.go: replaced commonhttp.LimitedTransport with a local sizeLimitedTransport — solana-go's JSON-RPC client now decodes with goccy/go-json, whose stream reader swallows non-EOF errors from the response body, so the size-limit error from the old lazy (read-time) transport never surfaced. The new transport enforces the limit eagerly in RoundTrip, before decoding starts.
  • chainwriter: fixed TestChainWriter_SubmitTransaction — solana-go's AccountMeta.less() now tie-breaks same signer/writable-tier accounts by raw pubkey bytes instead of preserving insertion order, so NewTransaction's compiled AccountKeys are no longer in program-declared order. This doesn't affect execution correctness (each instruction's account references are still resolved by pubkey via CompiledInstruction.Accounts), but the test asserted on fixed indices. Updated it to check account membership/order via the compiled instruction indices instead of raw AccountKeys position.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-solana

⚠️ Breaking Changes (3)

pkg/solana/client (2)
  • MaxRequestedTransactionVersion — 🗑️ Removed

  • MaxSupportTransactionVersion — Value changed from 0 to 1

pkg/solana/logpoller.(*solLpMetrics) (1)
  • IncrementTxsUnsupportedVersion — 🗑️ Removed

✅ Compatible Changes (1)

pkg/solana/client (1)
  • ErrInvalidSignatures — ➕ Added

📄 View full apidiff report

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-solana/contracts

View full report

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-solana/integration-tests

View full report

Comment thread pkg/solana/client/client.go Outdated
// newer transaction would be parsed with the v0 layout rather than rejected. Until that gains
// real support, decoding stays capped at MaxSupportTransactionVersion.
const MaxRequestedTransactionVersion = uint64(1)
// Bump this once solana-go supports decoding a newer message version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: think this comment is stale now since this PR is adding support

@toblich toblich left a comment

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.

Looking good, just a couple comments

Comment on lines +531 to +537
// solana-go's MarshalBinary pads any missing signatures with zero bytes rather than
// erroring, so an under-signed transaction would otherwise wire-encode as if it were
// fully signed and only fail asynchronously once the cluster processes it.
if verr := tx.VerifySignatures(); verr != nil {
err = fmt.Errorf("%w: %w", ErrInvalidSignatures, verr)
return solana.Signature{}, err
}

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.

Is this related to the sdk bump, or is it a gap that we always had? It looks correct to have this anyway, but I wonder if it's safe to add and what downstream effects it might have.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah this gap has always been here, somehow got revealed with solana airdrop constantly failing after sdk bump

result := <-job.blocks
require.Equal(t, slotNumber, result.SlotNumber)
require.Equal(t, &block.Blockhash, result.BlockHash)
require.Empty(t, result.Events) // no "Program log:"/"Program data:" lines in this tx, so no events expected

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.

I'll try to look for (or craft) a v1 tx with some events and inner cross-program invocations, so we can test the event parsing and traversal of inner instructions too

make tidy

fix integration tests

add test case with v1 transaction

fix comment

chore: empty commit to retrigger CI
@Unheilbar
Unheilbar marked this pull request as ready for review September 8, 2026 14:11
@cl-sonarqube-production

Copy link
Copy Markdown

@Unheilbar
Unheilbar merged commit 785b029 into develop Sep 8, 2026
52 of 55 checks passed
@Unheilbar
Unheilbar deleted the add-v1-support branch September 8, 2026 15:51
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