Skip to content

Conversation

@puhtaytow
Copy link
Contributor

@puhtaytow puhtaytow commented Nov 28, 2025

Problem

Using StableAbi required consumer crates to depend directly on rand, rand_chacha, and bincode, which made ABI digests sensitive to the exact versions used in each crate.

In addition, the use of rng.gen() conflicted with the gen keyword in Rust 2024 edition to which agave is currently migrating, preventing StableAbi from being used in edition 2024 crates.

Related to anza-xyz/agave#8091

Summary of changes

  • Added re-exports in frozen-abi for all crates on which StableAbi depends
  • Migrated frozen-abi-macro to reference these re-exports
  • Used a raw identifier for rng.r#gen() in the StableAbi trait to enable usage in crates 2021/2024 edition
  • Enabled edition 2024 lints

Example

solana-sdk/account
solana-sdk/transaction
solana-sdk/vote-interface

agave/accounts-db
agave/votor-messages

… changed api)

- make default implementation of random in StableAbi trait, compatible with rust edition 2024
- add re-exports to rand, rand_chacha and bincode (narrows StableAbi strict versions)
@puhtaytow puhtaytow marked this pull request as draft November 28, 2025 11:13
@puhtaytow puhtaytow marked this pull request as ready for review November 28, 2025 11:58
@puhtaytow
Copy link
Contributor Author

Hey @joncinque, sorry to come back with another PR on this, but i missed one detail when working on #443.. the fact that agave was in the middle of migrating to a different rand version and Rust edition at the same time.

In the previous PR I assumed that consumer crates would keep using compatible versions of rand/rand_chacha/bincode and that it was fine to rely on their dependencies directly. The agave migration exposed that this assumption was wrong.

Im really sorry, but could i please you to have a look again? 🙏 this small patch resolved issue in the solana-sdk and agave examples linked in the PR description.

@puhtaytow puhtaytow force-pushed the patch-frozen-abi-edition-2024 branch 3 times, most recently from 09faf62 to 8f5b4c9 Compare November 28, 2025 14:48
@puhtaytow puhtaytow force-pushed the patch-frozen-abi-edition-2024 branch from 8f5b4c9 to 026aefc Compare November 28, 2025 14:51
Copy link
Contributor

@alexpyattaev alexpyattaev left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but I think it would be prudent to add rust 2024 compat lints to frozen-abi to ensure we are not missing anything.

Copy link
Contributor

@alexpyattaev alexpyattaev left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@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! It might be easier to just bump rand in this repo too, but we can do that separately

@joncinque joncinque merged commit d893d59 into anza-xyz:master Dec 1, 2025
24 checks passed
@puhtaytow
Copy link
Contributor Author

Thank you guys 🙏

@puhtaytow puhtaytow deleted the patch-frozen-abi-edition-2024 branch December 1, 2025 17:31
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.

3 participants