Repository navigation
test(solana): pin the V1 spec value and the Solana retry policy - #2338
Conversation
Follow-up to #2336, which merged before these tests were pushed. The behaviour is already on main; this only adds the guards for it, raised by the Qodo review on that PR. The spec bump had no test. TestSolanaSpec_GetBlockByNumSupportsV1Transactions is table-driven over both deployed copies of solana.json, asserting that GET_BLOCK_BY_NUM declares maxSupportedTransactionVersion 1 and that the directive is identical across networks. It decodes the rendered request rather than matching the template as a substring, so it survives key reordering and rejects the quoted "1" form that Solana does not accept. Nothing previously stopped the mainnet-1 and testnet-2 copies drifting. The classifier tests asserted which error each Agave code maps to but not whether that error retries. Most targets are generic errors shared with other chain families, so flipping Retryable on one of them would have changed Solana's provider rotation with every test still green. TestClassifyError_SolanaRetryPolicy pins the decision for all 21 codes and records the policy argument beside each value. -32020 stays on CHAIN_TX_NOT_FOUND and stays retryable, against the review's suggestion. The before/until signature may be absent from one node's history but present on a provider with a deeper ledger, and the error is byte-identical in both cases, so the classifier cannot distinguish them. A wasted rotation costs latency; refusing to retry would report "not found" for data another provider holds. This matches CHAIN_TX_NOT_FOUND and CHAIN_RECEIPT_NOT_FOUND on every other chain. Also corrects a comment that implied every code in the block should be non-retryable; the point is that an unmapped code has its retry behaviour decided by the default rather than chosen. Claude-Session: https://claude.ai/code/session_01BmDq4Jk3Xh9EJhC9UdJoy3
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
PR Summary by QodoPin Solana V1 spec and retry policy in tests
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn these tips off under Display preferences |
Description
Follow-up to #2336, which squash-merged as
04596eeabout two hours before these tests were pushed to its branch, so they missed the merge.Tests only. No production code, no behaviour change. Everything under test is already on
main. Both guards are the two findings from the Qodo review on #2336.Files to review: two
_test.gofiles, +126 lines, nothing removed.1. The spec bump had no test
TestSolanaSpec_GetBlockByNumSupportsV1Transactionsinprotocol/parser/parser_test.go, table-driven over both deployed copies ofsolana.json.Two deliberate choices:
"1"cannot pass as the integer1. Solana rejects the quoted form, and a substring match onmaxSupportedTransactionVersionwould not catch it.specs/mainnet-1andspecs/testnet-2are copies differing only in the proposal deposit, and nothing in the repo stopped them drifting. A half-applied two-file edit is a realistic failure mode.2. The classifier tests never asserted retryability
They pinned which error each Agave code maps to, but most targets are generic errors shared with other chain families. Flipping
Retryableon one of them would have changed Solana's provider rotation with every existing test still green.TestClassifyError_SolanaRetryPolicypins the decision for all 21 codes in the-32001..-32021block and records the policy argument beside each value. Retryable means a different provider could plausibly answer; non-retryable means every provider returns the same thing and rotating only burns the pairing.-32020stays retryable, against the review's suggestionThis is the one open disagreement, carried over from the review thread on #2336, which was deliberately left unresolved.
-32020is not deterministic across providers. Whether thebefore/untilsignature is found depends on the node's ledger depth and whether long-term storage is enabled, so a pruned node returns-32020where an archive node answers successfully. The message is byte-identical in both cases, so the classifier cannot separate them. Reproduced live on both clusters with a well-formed signature that exists nowhere:Two further reasons:
CHAIN_TX_NOT_FOUND(3202) andCHAIN_RECEIPT_NOT_FOUND(3203) are already retryable for exactly this ambiguity, so a non-retryable Solana variant would make this family inconsistent with every other one; and the costs are asymmetric, since a wasted rotation costs latency whereas suppressing the retry reports "not found" for data another provider holds.What I could not prove. The retryable branch was not demonstrated live, as no pruned Solana node was available to query; that half rests on reading Agave's lookup path plus repo convention. It reduces to one question for reviewers: does Lava's Solana provider fleet actually vary in history depth? If it is uniform, the review is right and a dedicated non-retryable code is better, which is a one-line change on top of this PR. Note the Solana spec declares no
archiveextension, unlike ETH1, so Lava cannot route by history depth either way.Verification
Both tests pass against merged
main:Both were mutation-tested against merged
main, not just run green. Each guard was broken deliberately, then restored:specs/testnet-2reverted to0, a half-applied edit-32020mapping deletedCHAIN_TX_NOT_FOUNDflipped to non-retryable (checked pre-merge)A test that has never been seen to fail is not yet known to test anything. For example:
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking change (not applicable — tests only)mainbrancherror-registry-design.mdrow landed with feat(solana): support V1 transactions and map the full Agave RPC error surface #2336)Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
https://claude.ai/code/session_01BmDq4Jk3Xh9EJhC9UdJoy3
Generated by Claude Code