From 5c4e2da8985a4922f57eb7df7c13ad53bf0ee5e5 Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Thu, 24 Sep 2026 17:57:26 +0000 Subject: [PATCH] Pyth: name the program module after the crate so Surfpool finds its IDL The Anchor v1 job has failed on basics/pyth/anchor-v1 since Surfpool 1.6.0 became the latest release (passed on 1.5.0 on Sept 14, failed Sept 21 and Sept 23). `anchor test` stopped at "Surfpool startup failed: Runbook execution failed" before any test ran. The #[program] module was called `anchor_test`, so the IDL's metadata.name was `anchor_test` and Anchor wrote it to target/idl/anchor_test.json. Surfpool 1.6 deploys each program at startup through a runbook that reads target/idl/.json, i.e. target/idl/pythexample.json, which did not exist. Pyth was the only anchor-v1 project whose module name differed from its crate's lib name. Rename the module to `pythexample` in both copies, keeping the Anchor v2 copy in step with v1. Nothing else refers to the old name. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01X69iLEdcB8g5Pc4QccCsri --- basics/pyth/anchor-v1/CHANGELOG.md | 10 ++++++++++ basics/pyth/anchor-v1/programs/pythexample/src/lib.rs | 2 +- basics/pyth/anchor/CHANGELOG.md | 8 ++++++++ basics/pyth/anchor/programs/pythexample/src/lib.rs | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/basics/pyth/anchor-v1/CHANGELOG.md b/basics/pyth/anchor-v1/CHANGELOG.md index 4f1163881..a5f98ba93 100644 --- a/basics/pyth/anchor-v1/CHANGELOG.md +++ b/basics/pyth/anchor-v1/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 2026-09-24 + +### Changed + +- Renamed the `#[program]` module from `anchor_test` to `pythexample`, matching + the crate. Anchor names the generated IDL after the module, so the IDL was + written to `target/idl/anchor_test.json`; Surfpool 1.6 looks for + `target/idl/pythexample.json` when it deploys the program at the start of + `anchor test`, and exited with `Runbook execution failed` before any test ran. + ## 2026-07-07 Added this changelog. Changes prior to this date were tracked in git history only. diff --git a/basics/pyth/anchor-v1/programs/pythexample/src/lib.rs b/basics/pyth/anchor-v1/programs/pythexample/src/lib.rs index 013b6882e..7db83d281 100644 --- a/basics/pyth/anchor-v1/programs/pythexample/src/lib.rs +++ b/basics/pyth/anchor-v1/programs/pythexample/src/lib.rs @@ -21,7 +21,7 @@ pub enum PythExampleError { } #[program] -pub mod anchor_test { +pub mod pythexample { use super::*; pub fn read_price(context: Context) -> Result<()> { diff --git a/basics/pyth/anchor/CHANGELOG.md b/basics/pyth/anchor/CHANGELOG.md index 4f1163881..07222d5e2 100644 --- a/basics/pyth/anchor/CHANGELOG.md +++ b/basics/pyth/anchor/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2026-09-24 + +### Changed + +- Renamed the `#[program]` module from `anchor_test` to `pythexample`, matching + the crate and the Anchor v1 copy, so the generated IDL is named after the + program. + ## 2026-07-07 Added this changelog. Changes prior to this date were tracked in git history only. diff --git a/basics/pyth/anchor/programs/pythexample/src/lib.rs b/basics/pyth/anchor/programs/pythexample/src/lib.rs index fe2911fc6..9b39240e7 100644 --- a/basics/pyth/anchor/programs/pythexample/src/lib.rs +++ b/basics/pyth/anchor/programs/pythexample/src/lib.rs @@ -22,7 +22,7 @@ pub enum PythExampleError { } #[program] -pub mod anchor_test { +pub mod pythexample { use super::*; pub fn read_price(context: &mut Context) -> Result<()> {