Skip to content

solana-client-tools: rename try_fetch_multiple_accounts to reflect default-substitution policy #3766

@karl-dz

Description

@karl-dz

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions