Target repo
doublezerofoundation/doublezero-offchain — the change lives in crates/solana-client-tools/src/rpc.rs.
Context
SolanaConnection exposes two batch-fetch helpers with quietly different policies for missing accounts:
The name of the first helper does not signal that it silently substitutes a zero-valued Account for missing keys. A caller reading the signature alone (Result<Vec<Account>>) would not expect the substitution and could end up branching on garbage data.
Suggested change
Rename try_fetch_multiple_accounts on SolanaConnection to something that puts the policy in the name. A few options to choose from:
try_fetch_multiple_accounts_or_default
try_fetch_multiple_accounts_with_defaults
Alternatively, drop the convenience method entirely and have callers use the free function try_fetch_multiple_accounts defined later in the same file, which already returns Vec<Option<Account>> with no silent substitution.
Out of scope
Target repo
doublezerofoundation/doublezero-offchain — the change lives in crates/solana-client-tools/src/rpc.rs.
Context
SolanaConnectionexposes two batch-fetch helpers with quietly different policies for missing accounts:try_fetch_multiple_accountscollapses missing accounts toAccount::default()viaOption::unwrap_or_default.try_fetch_multiple_zero_copy_data, updated in solana-client-tools: tolerate missing/invalid accounts in try_fetch_multiple_zero_copy_data doublezerofoundation/doublezero-offchain#374, preservesOptionper slot and surfaces missing or unparseable accounts asNone.The name of the first helper does not signal that it silently substitutes a zero-valued
Accountfor missing keys. A caller reading the signature alone (Result<Vec<Account>>) would not expect the substitution and could end up branching on garbage data.Suggested change
Rename
try_fetch_multiple_accountsonSolanaConnectionto something that puts the policy in the name. A few options to choose from:try_fetch_multiple_accounts_or_defaulttry_fetch_multiple_accounts_with_defaultsAlternatively, drop the convenience method entirely and have callers use the free function
try_fetch_multiple_accountsdefined later in the same file, which already returnsVec<Option<Account>>with no silent substitution.Out of scope
try_fetch_multiple_zero_copy_dataitself. That was the subject of solana-client-tools: tolerate missing/invalid accounts in try_fetch_multiple_zero_copy_data doublezerofoundation/doublezero-offchain#374 and is already in good shape.