Skip to content

Solana client should stringify bigint payload fields before JSON serialization #17

@antfleet-ops

Description

@antfleet-ops

Summary

Several Solana client methods pass bigint-capable fields into makeIx(), which serializes the payload with JSON.stringify(). If callers pass bigint values for fields such as jobId or expiredAt, serialization throws before the provider can receive the instruction.

Evidence

  • src/clients/solanaAcpClient.ts passes expiredAt through createJob().
  • src/clients/solanaAcpClient.ts passes jobId through setBudget(), fund(), submit(), complete(), and reject().
  • makeIx() serializes the payload with JSON.stringify({ method, payload }).
  • amount is explicitly converted with .toString(), but the other bigint-capable fields are not.

Why this matters

The SDK already uses bigint-oriented types for on-chain job and amount values. A valid caller using bigint job IDs or timestamps can hit TypeError: Do not know how to serialize a BigInt locally, so the Solana operation never reaches the wallet/provider path.

Suggested fix

Normalize bigint-capable payload fields before JSON.stringify(), either at each call site or with a replacer inside makeIx(). For example, convert bigint values to decimal strings consistently with amount.

Suggested regression test

Add a Solana client unit test with a stub provider that calls methods such as submit(..., { jobId: 1n, ... }) and asserts instruction data is produced without throwing.


Found by AntFleet's Virtuals-backed public repo scan using an Opus-first, blind GPT confirmation workflow.

Metadata

Metadata

Assignees

No one assigned

    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