Skip to content

Conversation

@AvhiMaz
Copy link
Contributor

@AvhiMaz AvhiMaz commented Nov 27, 2025

Resolves issue #294 by gracefully handling IDL format incompatibilities with older Anchor versions (< 0.26.0).
Instead of blocking deployment when subgraph IaC generation fails, the system now:

  • Detects the Anchor version from Anchor.toml
  • Skips subgraph infrastructure-as-code generation for incompatible versions
  • Allows program deployment to proceed without subgraph generation
  • Maintains normal subgraph generation for newer versions (>= 0.26.0)

Changes:

  • Add anchor_version field to ProgramFrameworkData struct
  • Pass Anchor version through the entire scaffold pipeline
  • Implement version checking before subgraph template generation
  • Skip subgraph generation for versions < 0.26.0

… generation

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
Copy link
Member

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

Nice, thanks @AvhiMaz!

I like the overall logic of this approach. However, I'd like to keep the "anchor-specific" logic in the anchor.rs file. With this approach, we're passing around an anchor_version even though the project might not be using the anchor framework at all.

Additionally, we have this version checking logic for the anchor version in a types mod.

Can we instead have all of the version logic in the anchor.rs file, and have a generate_subgraphs bool be passed around instead? The anchor framework file will parse the version and dictate if subgraphs should be generated, and the external functions only need to check this bool.

…lity

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
@AvhiMaz AvhiMaz requested a review from MicaiahReid December 2, 2025 05:05
Copy link
Member

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

That's CLEAN ✨
Thanks @AvhiMaz!

@MicaiahReid MicaiahReid merged commit 4bebd13 into txtx:main Dec 2, 2025
3 checks passed
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.

2 participants