fix(codama): Update authority seed to size_prefix to match bincode#374
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Codama-derived IDL and generated clients to better match the stake program’s bincode serialization expectations (u64 length prefixes for strings and u32 enum discriminators), including the Codama 0.9.2 enum discriminator fix.
Changes:
- Bump
codama/codama-macrosto0.9.2and regenerate IDL artifacts. - Ensure
authority_seedstrings are represented with au64size prefix in IDL and generated clients. - Update JS generated enum encoding to use
u32discriminators and add schema tests validating these expectations.
Reviewed changes
Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| interface/tests/codama_schema.rs | Adds integration tests asserting Codama IDL uses u64 string size prefixes and u32 enum discriminators. |
| interface/src/instruction.rs | Annotates authority_seed with Codama size_prefix = number(u64) to align IDL with bincode. |
| interface/idl.json | Regenerated IDL reflecting u64 string prefixes and u32 enum sizes; bumps program version metadata. |
| interface/Cargo.toml | Updates Codama dependencies to 0.9.2. |
| clients/rust/src/generated/instructions/authorize_with_seed.rs | Switches authority_seed arg to U64PrefixString (bincode-compatible string length). |
| clients/rust/src/generated/instructions/authorize_checked_with_seed.rs | Switches authority_seed arg to U64PrefixString (bincode-compatible string length). |
| clients/rust/Cargo.toml | Adds kaigan dependency and wires kaigan/serde into the serde feature. |
| clients/js/src/generated/types/stakeAuthorize.ts | Forces enum codec size to u32 for StakeAuthorize. |
| clients/js/src/generated/instructions/authorizeWithSeed.ts | Uses u64 length prefix for authoritySeed string codec. |
| clients/js/src/generated/instructions/authorizeCheckedWithSeed.ts | Uses u64 length prefix for authoritySeed string codec. |
| Cargo.lock | Locks updated dependency graph (Codama bump + new kaigan and transitive deps). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8ce659e to
86e77b0
Compare
This also brings in the enum_discriminator fix from codama 0.9.2 Co-authored-by: Copilot <copilot@github.com>
86e77b0 to
44d1f60
Compare
lorisleiva
left a comment
There was a problem hiding this comment.
Thanks! Looks good to me on the Codama side. Would just like @joncinque's approval on that one as well to make sure the binary layout is correct. 🙏
|
Thanks so much, @lorisleiva and @joncinque. Could we release an updated @solana-program/stake for npm to get the fix published? |
|
@joncinque The "Publish JS" workflow is currently broken for this repo. Is this because we're migrating to a Trusted Publisher setup on the shared actions? |
|
My apologies, I messed up the publish token turnaround, this should work on the next attempt |
|
Thank you! A new patch version of the JS package has been published. |
|
ty sers! |
This also brings in the enum_discriminator fix from codama 0.9.2