Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ serde_with = { version = "3.14.0", default-features = false }
strum = { version = "0.26", default-features = false, features = ["derive"] }
solana-account = { version = "4.3", default-features = false }
solana-account-decoder = { version = "4.0", default-features = false }
solana-account-decoder-client-types = { version = "4.0", default-features = false }
solana-account-decoder-client-types = { version = "4.0", default-features = false, features = [
"zstd",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I removed this feature and the test above still passed. Are we sure it's needed?

@Arrowana Arrowana Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both solana-account-decoder and solana-rpc-client already enable solana-account-decoder-client-types/zstd

https://github.com/anza-xyz/agave/blob/d32fc31eb1717f534466fca42eea7848e335ef4d/account-decoder/Cargo.toml#L30

so yes that's indeed incorrect, i think the symptoms are similar to #738 but the root cause was misdiagnosed wildly

] }
solana-address-lookup-table-interface = { version = "3.0", default-features = false }
solana-client = { version = "4.0", default-features = false }
solana-clock = { version = "3.0", default-features = false }
Expand Down
48 changes: 48 additions & 0 deletions crates/core/src/rpc/accounts_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ impl AccountsData for SurfpoolAccountsDataRpc {
#[cfg(test)]
mod tests {
use solana_account::Account;
use solana_account_decoder::{UiAccountData, UiAccountEncoding};
use solana_keypair::Keypair;
use solana_program_option::COption;
use solana_program_pack::Pack;
Expand All @@ -717,6 +718,53 @@ mod tests {
types::SyntheticBlockhash,
};

#[tokio::test(flavor = "multi_thread")]
async fn test_get_account_info_base64_zstd() {
let setup = TestSetup::new(SurfpoolAccountsDataRpc);
let pubkey = Pubkey::new_unique();
let expected_account = Account {
lamports: 1_000_000,
data: b"surfpool-zstd-account-data".to_vec(),
owner: solana_system_interface::program::id(),
executable: false,
rent_epoch: 0,
};

setup
.context
.svm_locker
.write_account_update(GetAccountResult::FoundAccount(
pubkey,
expected_account.clone(),
true,
));

let response = setup
.rpc
.get_account_info(
Some(setup.context),
pubkey.to_string(),
Some(RpcAccountInfoConfig {
encoding: Some(UiAccountEncoding::Base64Zstd),
..Default::default()
}),
)
.await
.unwrap();

let ui_account = response.value.expect("account should be returned");
assert!(matches!(
&ui_account.data,
UiAccountData::Binary(_, UiAccountEncoding::Base64Zstd)
));
assert_eq!(
ui_account
.to_account()
.expect("base64+zstd account data should decode"),
expected_account
);
}

#[ignore = "connection-required"]
#[tokio::test(flavor = "multi_thread")]
async fn test_get_token_account_balance() {
Expand Down
Loading