Skip to content

Swap spl-pod for solana-zero-copy + solana-nullable#1069

Open
grod220 wants to merge 1 commit intomainfrom
spl-pod-swap
Open

Swap spl-pod for solana-zero-copy + solana-nullable#1069
grod220 wants to merge 1 commit intomainfrom
spl-pod-swap

Conversation

@grod220
Copy link
Copy Markdown
Member

@grod220 grod220 commented Apr 1, 2026

rebased after #1090

This PR migrates token-2022 away from spl-pod and onto solana-zero-copy + solana-nullable. On the road to making the library crates no-std.

Comment thread interface/src/lib.rs Outdated
@grod220 grod220 force-pushed the spl-pod-swap branch 6 times, most recently from d655ba0 to b68f68c Compare April 22, 2026 20:10
Comment thread clients/cli/Cargo.toml
Comment on lines +43 to +44
spl-token-metadata-interface = "1.0.0"
spl-token-group-interface = "0.7.2"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

New versions support the new solana-zero-copy/nullable types

Comment on lines +18 to +19
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Without this, make build-wasm-interface fails.

the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature

Turns out spl-pod previously activates getrandom/js transitively. So need to be explicit here now.

Comment on lines +506 to +507
#[cfg_attr(feature = "serde", serde(with = "As::<Option<DisplayFromStr>>"))]
pub authority: MaybeNull<Address>,
Copy link
Copy Markdown
Member Author

@grod220 grod220 Apr 22, 2026

Choose a reason for hiding this comment

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

the serde_with usage here is to preserve the base58 serde encoding that was built into OptionalNonZeroPubkey

Comment thread program/Cargo.toml
Comment on lines -22 to -25
arrayref = "0.3.9"
bytemuck = { version = "1.25.0", features = ["derive"] }
num-derive = "0.4"
num-traits = "0.2"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

While deps/features were being added, used cargo machete to find a collection of unused ones in this program and removed them

@grod220 grod220 marked this pull request as ready for review April 22, 2026 21:33
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