-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Tracking the path from spl-pod 0.7.2 to 1.0.0 with no_std support. The crate is currently std-only with transitive deps (solana-zk-sdk, solana-pubkey).
Updates
1. std:: to core:: swaps
Affected:
- std::mem::size_of
- std::num::TryFromIntError
- std::ops::Deref
- std::{marker::PhantomData, mem::*, ops::Range}
- std::ops::{Deref, DerefMut}
All of these are identical in core and std, so they work in both environments.
2. Migrate solana-pubkey to solana-address
Address is no-std by default
3. solana-program-option no_std
- Make
solana-program-optionno-std anza-xyz/solana-sdk#584 - Version bump and consumed in spl-pod
4. Remove solana-zk-sdk dependency
5. Put bytemuck behind a feature
At the moment, is a first class dependency of the library
6. Dependency default-features = false
- thiserror
- num_enum
- num-traits
- wincode
7. PodOption to replace OptionalNonZeroPubkey
From @febo
I think we can also remove the optional_keys.rs module. Those types can be implemented with PodOption.
8. ListView migration
From @joncinque
We should also move out the list view to a new crate to iterate on that more easily
Also, remove deprecated PodSlice / PodSliceMut. These types in src/slice.rs are deprecated since 0.6.0.
9. Rename serde-traits feature to serde
More consistent with solana-sdk.
Publish strategy
Since spl-pod types appear in the public APIs of many downstream crates, upgrading to 1.0.0 would normally require simultaneous upgrades. To avoid that, we'll use the semver trick:
1 - Make all breaking changes above on main
2 - Publish 1.0.0
3 - From a branch of the 0.7.2 tag, publish 0.7.3 with spl-pod 1.0.0 as a dep and a lib.rs with re-exports like:
// re-export unchanged types
pub use spl_pod_v1::option;
pub use spl_pod_v1::primitives;
...
// keep removed types for backward compat
pub mod optional_keys;
...
This means anyone onspl-pod = "0.7" gets 0.7.3 and their types are the same as someone on spl-pod = "1.0".