Skip to content

no-std friendly interface#57

Open
grod220 wants to merge 1 commit intomainfrom
no-std-interface
Open

no-std friendly interface#57
grod220 wants to merge 1 commit intomainfrom
no-std-interface

Conversation

@grod220
Copy link
Member

@grod220 grod220 commented Mar 23, 2026

No std updates to the interface crate:

  • Update solana-pubkey to solana-address (it was an alias anyway)
  • Replaces use of spl-pod with solana-zero-copy
  • Switch OptionalNonZeroPubkey usage with solana-nullable's MaybeNull.

See inline note on serde serialization.

Comment on lines +323 to +327
// Preserves the old serde behavior from before the `OptionalNonZeroPubkey` -> `MaybeNull<Address>`
// migration. `Some(address)` serializes as a base58 string and `None` as `null`. Reference:
// https://github.com/solana-program/libraries/blob/8c73d863e928e726a555085fdb5e09a190df5786/pod/src/optional_keys.rs#L76-L129
#[cfg(feature = "serde-traits")]
mod maybe_null_address_str {
Copy link
Member Author

Choose a reason for hiding this comment

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

Worth discussing if we want to keep backwards compatibility on the option serialization

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, can we do this at the MaybeNull level? That would be pretty neat

@grod220 grod220 force-pushed the no-std-interface branch 2 times, most recently from d4b6840 to eba203b Compare March 23, 2026 11:27
@grod220 grod220 marked this pull request as draft March 23, 2026 11:51
@grod220 grod220 marked this pull request as ready for review March 23, 2026 22:06
@grod220 grod220 requested review from febo and joncinque March 23, 2026 22:06
Copy link
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 good to me! Just wondering if we should customize serde for MaybeNull

Comment on lines +323 to +327
// Preserves the old serde behavior from before the `OptionalNonZeroPubkey` -> `MaybeNull<Address>`
// migration. `Some(address)` serializes as a base58 string and `None` as `null`. Reference:
// https://github.com/solana-program/libraries/blob/8c73d863e928e726a555085fdb5e09a190df5786/pod/src/optional_keys.rs#L76-L129
#[cfg(feature = "serde-traits")]
mod maybe_null_address_str {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, can we do this at the MaybeNull level? That would be pretty neat

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