Skip to content

add pinocchio repository-layout example#582

Open
MarkFeder wants to merge 3 commits into
solana-developers:mainfrom
MarkFeder:pinocchio-repository-layout
Open

add pinocchio repository-layout example#582
MarkFeder wants to merge 3 commits into
solana-developers:mainfrom
MarkFeder:pinocchio-repository-layout

Conversation

@MarkFeder
Copy link
Copy Markdown

@MarkFeder MarkFeder commented May 25, 2026

Summary

  • Ports basics/repository-layout (the carnival program) to a Pinocchio variant, mirroring the existing anchor + native module layout (lib, processor, instructions/*, state/*, error).
  • The pinocchio crate is #![no_std], uses pinocchio + pinocchio-log, and replaces the heap-allocated Vec<FoodStand|Game|Ride> lookups with &'static const tables.
  • Instruction data wire format matches the existing native borsh layout, so the bankrun test reuses the same encoding (just with a different program name).

Test plan

  • cargo check -p repository-layout-pinocchio-program — clean
  • cargo build -p repository-layout-pinocchio-program — clean
  • biome check --write — formatting clean
  • Full pnpm build-and-test (cargo build-sbf + bankrun) reproduced locally in a rust:latest Docker container with Solana CLI stable. All 3 bankrun tests pass — every dispatch path exercised (rides, games, food; ticket-check, height-check, and happy-path branches all hit).
  • CI to run the same pnpm build-and-test on stable + beta. Workflow runs are pending maintainer approval (action_required).

Ports the carnival program from anchor/native to a Pinocchio variant
mirroring the same module layout (lib/processor/instructions/state/error).

- #![no_std] crate using pinocchio + pinocchio-log
- Instruction data wire format matches the native borsh layout, so the
  bankrun test reuses the same encoding
- Static const tables replace heap-allocated Vec<FoodStand|Game|Ride>
@MarkFeder MarkFeder force-pushed the pinocchio-repository-layout branch from edc8357 to 32719ae Compare May 25, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant