Skip to content

fix(codama): Update authority seed to size_prefix to match bincode#374

Merged
joncinque merged 1 commit intosolana-program:mainfrom
blueshift-gg:fix/codama_authority_seed_size_prefix
Apr 30, 2026
Merged

fix(codama): Update authority seed to size_prefix to match bincode#374
joncinque merged 1 commit intosolana-program:mainfrom
blueshift-gg:fix/codama_authority_seed_size_prefix

Conversation

@dhl
Copy link
Copy Markdown
Contributor

@dhl dhl commented Apr 28, 2026

This also brings in the enum_discriminator fix from codama 0.9.2

Copilot AI review requested due to automatic review settings April 28, 2026 03:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-macros to 0.9.2 and regenerate IDL artifacts.
  • Ensure authority_seed strings are represented with a u64 size prefix in IDL and generated clients.
  • Update JS generated enum encoding to use u32 discriminators 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.

Comment thread interface/tests/codama_schema.rs Outdated
@dhl dhl force-pushed the fix/codama_authority_seed_size_prefix branch from 8ce659e to 86e77b0 Compare April 28, 2026 06:01
This also brings in the enum_discriminator fix from codama 0.9.2

Co-authored-by: Copilot <copilot@github.com>
@dhl dhl force-pushed the fix/codama_authority_seed_size_prefix branch from 86e77b0 to 44d1f60 Compare April 28, 2026 13:49
Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

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. 🙏

@lorisleiva lorisleiva requested a review from joncinque April 28, 2026 23:23
Copy link
Copy Markdown
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@joncinque joncinque merged commit 54c6b41 into solana-program:main Apr 30, 2026
23 checks passed
@dhl dhl deleted the fix/codama_authority_seed_size_prefix branch May 2, 2026 02:18
@dhl
Copy link
Copy Markdown
Contributor Author

dhl commented May 2, 2026

Thanks so much, @lorisleiva and @joncinque.

Could we release an updated @solana-program/stake for npm to get the fix published?

@lorisleiva
Copy link
Copy Markdown
Member

@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?

@joncinque
Copy link
Copy Markdown
Contributor

My apologies, I messed up the publish token turnaround, this should work on the next attempt

@lorisleiva
Copy link
Copy Markdown
Member

Thank you! A new patch version of the JS package has been published.

@dhl
Copy link
Copy Markdown
Contributor Author

dhl commented May 4, 2026

ty sers!

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.

4 participants