Skip to content

Conversation

@lorisleiva
Copy link
Member

@lorisleiva lorisleiva commented Dec 27, 2025

The Write instruction of the Loader v3 program contains a bytes argument which expects a u64 prefix. However, the generated clients currently use a u32 prefix because of the lack of information coming from the Anchor IDL.

The Anchor IDL can only type this as { type: "bytes" } which is assumed to be a u32 prefixed byte array. When converting the Anchor IDL into a Codama IDL in order to generate clients, that is also the assumption Codama makes.

This PR fixes this issue by adding a new "before" visitor that manually update that prefix from u32 to u64. It also adds a couple of tests to ensure transactions that write to buffers can be sent successfully.

Shout out to Andy for flagging this in one of his latest videos.

@lorisleiva lorisleiva marked this pull request as ready for review December 27, 2025 14:18
@lorisleiva lorisleiva merged commit bd2ab59 into main Dec 27, 2025
9 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