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
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
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.
10. Migrate primitives and traits to solana-pod
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".
Tracking the path from spl-pod 0.7.2 to 1.0.0 with
no_stdsupport. The crate is currently std-only with transitive deps (solana-zk-sdk, solana-pubkey).Updates
1.
std::tocore::swapsAffected:
All of these are identical in
coreandstd, so they work in both environments.2. Migrate
solana-pubkeytosolana-addressAddress is no-std by default
spl-pod#1773.
solana-program-optionno_stdsolana-program-optionno-std anza-xyz/solana-sdk#5844. Remove
solana-zk-sdkdependencyOptionalNonZeroElGamalPubkey#1715. Put
bytemuckbehind a featureAt the moment, is a first class dependency of the library
6. Dependency
default-features = falsethiserror
num_enum
num-traits
wincode
pod: enable no-std #184
7.
PodOptionto replaceOptionalNonZeroPubkeyFrom @febo
PodOption<Address>#1838. ListView migration
From @joncinque
Also, remove deprecated
PodSlice/PodSliceMut. These types insrc/slice.rsare deprecated since 0.6.0.ListViewto standalone crate #1789. Rename
serde-traitsfeature toserdeMore consistent with
solana-sdk.10. Migrate primitives and traits to
solana-podsolana-zero-copycrate for zero-copy types and traits anza-xyz/solana-sdk#605Publish strategy
Since
spl-podtypes 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:
This means anyone on
spl-pod = "0.7"gets 0.7.3 and their types are the same as someone onspl-pod = "1.0".