From e811fad365e5d702d485194486220a717c5418f8 Mon Sep 17 00:00:00 2001 From: Jon C Date: Thu, 3 Sep 2026 13:12:01 +0200 Subject: [PATCH] tlv-account-resolution: Remove spl-pod dependency #### Problem spl-pod mostly re-exports a lot of other types at this point, but the tlv-account-resolution library still depends on it explicitly. #### Summary of changes Remove the dependency, use solana-zero-copy directly --- Cargo.lock | 2 +- tlv-account-resolution/Cargo.toml | 2 +- tlv-account-resolution/src/account.rs | 6 +++--- tlv-account-resolution/src/state.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf5596ea..74bcc96b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1780,9 +1780,9 @@ dependencies = [ "solana-instruction", "solana-program-error", "solana-pubkey", + "solana-zero-copy", "spl-discriminator 0.5.2", "spl-list-view", - "spl-pod 0.7.4", "spl-type-length-value 0.9.1", "thiserror 2.0.18", "tokio", diff --git a/tlv-account-resolution/Cargo.toml b/tlv-account-resolution/Cargo.toml index 77c44b07..84efe059 100644 --- a/tlv-account-resolution/Cargo.toml +++ b/tlv-account-resolution/Cargo.toml @@ -20,9 +20,9 @@ solana-account-info = "3.0.0" solana-instruction = { version = "3.0.0", features = ["std"] } solana-program-error = "3.0.0" solana-pubkey = { version = "3.0.0", features = ["curve25519"] } +solana-zero-copy = { version = "1.0.0", features = ["bytemuck"] } spl-discriminator = { version = "0.5.1", path = "../discriminator" } spl-list-view = { version = "0.1.1", path = "../list-view" } -spl-pod = { version = "0.7.4", path = "../pod" } spl-type-length-value = { version = "0.9.1", path = "../type-length-value" } thiserror = "2.0" diff --git a/tlv-account-resolution/src/account.rs b/tlv-account-resolution/src/account.rs index 42478021..4610217a 100644 --- a/tlv-account-resolution/src/account.rs +++ b/tlv-account-resolution/src/account.rs @@ -11,7 +11,7 @@ use { solana_instruction::AccountMeta, solana_program_error::ProgramError, solana_pubkey::{Pubkey, PUBKEY_BYTES}, - spl_pod::primitives::PodBool, + solana_zero_copy::unaligned::Bool, }; /// Resolve a program-derived address (PDA) from the instruction data @@ -129,9 +129,9 @@ pub struct ExtraAccountMeta { /// data used to derive the pubkey (account or instruction data). pub address_config: [u8; 32], /// Whether the account should sign - pub is_signer: PodBool, + pub is_signer: Bool, /// Whether the account should be writable - pub is_writable: PodBool, + pub is_writable: Bool, } /// Helper used to know when the top bit is set, to interpret the /// discriminator as an index rather than as a type diff --git a/tlv-account-resolution/src/state.rs b/tlv-account-resolution/src/state.rs index b9ec2818..f00e91da 100644 --- a/tlv-account-resolution/src/state.rs +++ b/tlv-account-resolution/src/state.rs @@ -6,9 +6,9 @@ use { solana_instruction::{AccountMeta, Instruction}, solana_program_error::ProgramError, solana_pubkey::Pubkey, + solana_zero_copy::unaligned::U32, spl_discriminator::SplDiscriminate, spl_list_view::{ListView, ListViewReadOnly}, - spl_pod::primitives::PodU32, spl_type_length_value::state::{TlvState, TlvStateBorrowed, TlvStateMut}, std::future::Future, }; @@ -189,9 +189,9 @@ impl ExtraAccountMetaList { /// `TlvStateBorrowed`. I hope there's a better way to do this! pub fn unpack_with_tlv_state<'a, T: SplDiscriminate>( tlv_state: &'a TlvStateBorrowed, - ) -> Result, ProgramError> { + ) -> Result, ProgramError> { let bytes = tlv_state.get_first_bytes::()?; - ListView::::unpack(bytes) + ListView::::unpack(bytes) } /// Get the byte size required to hold `num_items` items