Skip to content

fix(solana): add patched anchor-go NewCleanupIncompleteUploadInstruction instruction#906

Merged
mariuszzak merged 5 commits intomainfrom
mariuszzak/patched-anchor-go-type
Jan 23, 2026
Merged

fix(solana): add patched anchor-go NewCleanupIncompleteUploadInstruction instruction#906
mariuszzak merged 5 commits intomainfrom
mariuszzak/patched-anchor-go-type

Conversation

@mariuszzak
Copy link
Collaborator

@mariuszzak mariuszzak commented Jan 22, 2026

Description

Add the manually patched function because the fix in anchor-go hasn't been merged for a while. Because of this bug, every time we run just generate-solana-types the auto-generated function is recreated with a bug (missing discriminator).

gagliardetto/anchor-go#50
gagliardetto/anchor-go#52


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@mariuszzak mariuszzak self-assigned this Jan 22, 2026
@mariuszzak mariuszzak requested a review from srdtrk as a code owner January 22, 2026 12:15
@mariuszzak mariuszzak changed the title fix(solana): add patched instruction for anchor-go no-argument bug (NewCleanupIncompleteUploadInstruction) fix(solana): add patched anchor-go NewCleanupIncompleteUploadInstruction instruction Jan 22, 2026
@@ -356,15 +355,6 @@ func NewAssembleAndUpdateClientInstruction(
func NewCleanupIncompleteUploadInstruction(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is not used now. We use the patched version added in this PR.

// The generated NewCleanupIncompleteUploadInstruction function sets instruction data to `nil`
// instead of encoding the discriminator. This file provides a corrected version.
//
// Tracking: This should be removed once the anchor-go bug is fixed upstream.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd suggest opening an issue to track it.

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather open an issue in anchor go and link it here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there are already issues in anchor-go for this problem. Linked in the PR's description.

gagliardetto/anchor-go#50
gagliardetto/anchor-go#52

Copy link
Collaborator Author

@mariuszzak mariuszzak Jan 22, 2026

Choose a reason for hiding this comment

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

I will add it in a comment

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.90%. Comparing base (2e41fb1) to head (125db31).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #906       +/-   ##
===========================================
+ Coverage   73.73%   99.90%   +26.17%     
===========================================
  Files         111       27       -84     
  Lines       15931     1092    -14839     
===========================================
- Hits        11747     1091    -10656     
+ Misses       4184        1     -4183     
Flag Coverage Δ
solana ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@srdtrk srdtrk left a comment

Choose a reason for hiding this comment

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

Lgtm. You can merge it after linking an issue

// The generated NewCleanupIncompleteUploadInstruction function sets instruction data to `nil`
// instead of encoding the discriminator. This file provides a corrected version.
//
// Tracking: This should be removed once the anchor-go bug is fixed upstream.
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather open an issue in anchor go and link it here

@mariuszzak mariuszzak merged commit 81da6e3 into main Jan 23, 2026
173 checks passed
@mariuszzak mariuszzak deleted the mariuszzak/patched-anchor-go-type branch January 23, 2026 15:27
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