Skip to content

Conversation

@MicaiahReid
Copy link
Member

@MicaiahReid MicaiahReid commented Oct 16, 2025

This pull request introduces support for handling genesis accounts defined in Test.toml and Anchor.toml files for Anchor projects, and refactors the CLI to use a new --anchor-compatibility flag instead of the previous --autopilot flag. The main changes improve the detection and scaffolding of infrastructure-as-code (IaC) for test suites, allowing for more flexible and accurate test environment setup, especially for Anchor-based projects.

Anchor project genesis account discovery and propagation:

  • The Anchor project detection logic (anchor.rs and related calls) now discovers and aggregates genesis accounts from both Anchor.toml and any Test.toml files found in the workspace. These accounts are returned as part of the framework detection result and are used for scaffolding IaC. [1] [2] [3]

  • New types and logic for reading, merging, and canonicalizing Test.toml files, including support for inheritance via the extends field and proper merging of genesis account entries.

CLI flag and workflow refactor:

  • The CLI StartSimnet struct replaces the autopilot flag with a more descriptive anchor_compat flag (--anchor-compatibility), which is used to trigger Anchor test suite-compatible defaults for runbook generation and execution. All related logic and checks in the CLI workflow have been updated accordingly. [1] [2] [3]

IaC scaffolding improvements:

  • The in-memory IaC scaffolding function now accepts the discovered genesis accounts, and the framework abstraction has been extended to allow template interpolation for surfnet setup using these accounts. [1] [2] [3]

Dependency updates:

  • The walkdir crate is added to the workspace and relevant crates to support recursive discovery of Test.toml files. [1] [2]

Type and import updates:

  • Types and imports throughout the CLI and scaffolding modules are updated to support passing genesis account information and new template interpolation logic. [1] [2] [3] [4] [5] [6]

These changes together enable more robust and flexible test environment setup for Anchor projects, particularly when working with complex test suites and custom genesis accounts.

@MicaiahReid MicaiahReid requested a review from lgalabru October 16, 2025 19:43
#[clap(long = "autopilot", action=ArgAction::SetTrue, default_value = "false")]
pub autopilot: bool,
/// Apply suggested defaults for runbook generation and execution when running as part of an anchor test suite (eg. surfpool start --anchor-compatibility)
#[clap(long = "anchor-compatibility", action=ArgAction::SetTrue, default_value = "false")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anchor-compatibility or anchor-legacy ?
I know it's weird, but ideally we only enable this mode for anchor 0.x

Copy link
Member

@lgalabru lgalabru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @MicaiahReid!

@MicaiahReid MicaiahReid force-pushed the feat/setup-surfnet-scaffold branch from 1e5f61b to 78e258b Compare October 17, 2025 15:06
@MicaiahReid MicaiahReid changed the base branch from fix/native-mint to main October 17, 2025 15:06
@MicaiahReid MicaiahReid merged commit 9960a2d into main Oct 17, 2025
@lgalabru lgalabru deleted the feat/setup-surfnet-scaffold branch October 19, 2025 17:59
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.

3 participants