Skip to content

serviceability: golden fixtures for instruction builders + CI diff guard (Rust) #4026

Description

@juan-malbeclabs

Part of #4014.

Extend the shared fixture infrastructure so builder output is captured as golden files and guarded in CI.

Scope

  • Extend sdk/serviceability/testdata/fixtures/generate-fixtures/src/main.rs to depend on the builder crate and emit, per instruction (deterministic inputs, fixed program_id):
    • ix_<name>.bin = instruction.data (tag + borsh).
    • ix_<name>.json = { variant, data_hex, accounts: [{pubkey, is_signer, is_writable}] } (account order + flags).
  • Wire regeneration into make generate-fixtures.
  • CI check that fails on uncommitted fixture diffs.

Notes

  • This can land early (alongside R0) to establish the format, then each domain PR adds its fixtures. Fixtures remain available for future Go/Python/TS parity checks (out of scope now).

Acceptance

  • make generate-fixtures produces stable, committed ix_* files; CI fails if they drift.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    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