From a338de44c342e3c3a032ebb020f7de1179b8c246 Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Wed, 19 Aug 2026 11:39:15 +0000 Subject: [PATCH] docs: note that Instruction variants need guest entries, run make clippy-guest --- CLAUDE.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index c3ea208..80547f5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,6 +19,9 @@ Five programs are implemented: # Check all workspace crates (skips expensive guest ZK builds) make clippy +# Lint the guest crates (compiles for the riscv32im target — slow, but CI runs it) +make clippy-guest + # Run all tests (dev mode skips ZK proof generation) make test @@ -159,4 +162,8 @@ Each program follows a layered pattern: **Chained calls**: The AMM's swap and liquidity operations compose with the token program via `ChainedCall` — the AMM instructs the token program to execute transfers as part of the same atomic operation. +**`Instruction` variants and guest entries must land together**: `#[lez_program]` generates an exhaustive `match` over the program's `Instruction` enum, so every variant needs a matching `#[instruction]` guest function. Adding a variant to a `*_core` crate without its guest entry fails the guest build with `error[E0004]: non-exhaustive patterns`. Split work so the variant, host function, and guest entry ship in the same PR. + +**Verify guest builds before pushing**: `make clippy` runs with `RISC0_SKIP_BUILD=1` and never compiles the guests, so guest-only breakage (see above) passes locally and fails CI in both `Build Guest Programs` and `Lint`. Run `make clippy-guest` as well — it is the only local check that compiles guest crates. + **Testing**: Tests call program functions directly (no zkVM overhead). Set `RISC0_DEV_MODE=1` to skip ZK proof generation when running integration tests that go through the zkVM. The Rust toolchain version is pinned in `rust-toolchain.toml`.