Skip to content
Merged
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
25 changes: 0 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion account-decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spl-token-2022 = { workspace = true, features = ["no-entrypoint"] }
spl-token-group-interface = { workspace = true }
spl-token-metadata-interface = { workspace = true }
thiserror = { workspace = true }
zstd = { workspace = true }
# zstd = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
Expand Down
54 changes: 27 additions & 27 deletions account-decoder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use {
pubkey::Pubkey,
},
std::{
io::{Read, Write},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: can we comment this out instead of deleting it so that we know what our changes are when looking back? 🙏

// io::{Read, Write},
str::FromStr,
},
};
Expand Down Expand Up @@ -65,15 +65,15 @@ impl UiAccountData {
UiAccountData::Binary(blob, encoding) => match encoding {
UiAccountEncoding::Base58 => bs58::decode(blob).into_vec().ok(),
UiAccountEncoding::Base64 => BASE64_STANDARD.decode(blob).ok(),
UiAccountEncoding::Base64Zstd => {
BASE64_STANDARD.decode(blob).ok().and_then(|zstd_data| {
let mut data = vec![];
zstd::stream::read::Decoder::new(zstd_data.as_slice())
.and_then(|mut reader| reader.read_to_end(&mut data))
.map(|_| data)
.ok()
})
}
// UiAccountEncoding::Base64Zstd => {
// BASE64_STANDARD.decode(blob).ok().and_then(|zstd_data| {
// let mut data = vec![];
// zstd::stream::read::Decoder::new(zstd_data.as_slice())
// .and_then(|mut reader| reader.read_to_end(&mut data))
// .map(|_| data)
// .ok()
// })
// }
UiAccountEncoding::Binary | UiAccountEncoding::JsonParsed => None,
},
}
Expand All @@ -87,8 +87,8 @@ pub enum UiAccountEncoding {
Base58,
Base64,
JsonParsed,
#[serde(rename = "base64+zstd")]
Base64Zstd,
// #[serde(rename = "base64+zstd")]
// Base64Zstd, // Unsupproted by svm-rollup
}

impl UiAccount {
Expand Down Expand Up @@ -125,21 +125,21 @@ impl UiAccount {
BASE64_STANDARD.encode(slice_data(account.data(), data_slice_config)),
encoding,
),
UiAccountEncoding::Base64Zstd => {
let mut encoder = zstd::stream::write::Encoder::new(Vec::new(), 0).unwrap();
match encoder
.write_all(slice_data(account.data(), data_slice_config))
.and_then(|()| encoder.finish())
{
Ok(zstd_data) => {
UiAccountData::Binary(BASE64_STANDARD.encode(zstd_data), encoding)
}
Err(_) => UiAccountData::Binary(
BASE64_STANDARD.encode(slice_data(account.data(), data_slice_config)),
UiAccountEncoding::Base64,
),
}
}
// UiAccountEncoding::Base64Zstd => {
// let mut encoder = zstd::stream::write::Encoder::new(Vec::new(), 0).unwrap();
// match encoder
// .write_all(slice_data(account.data(), data_slice_config))
// .and_then(|()| encoder.finish())
// {
// Ok(zstd_data) => {
// UiAccountData::Binary(BASE64_STANDARD.encode(zstd_data), encoding)
// }
// Err(_) => UiAccountData::Binary(
// BASE64_STANDARD.encode(slice_data(account.data(), data_slice_config)),
// UiAccountEncoding::Base64,
// ),
// }
// }
UiAccountEncoding::JsonParsed => {
if let Ok(parsed_data) =
parse_account_data_v2(pubkey, account.owner(), account.data(), additional_data)
Expand Down
8 changes: 4 additions & 4 deletions accounts-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ bincode = { workspace = true }
blake3 = { workspace = true }
bv = { workspace = true, features = ["serde"] }
bytemuck = { workspace = true }
bzip2 = { workspace = true }
# bzip2 = { workspace = true }
crossbeam-channel = { workspace = true }
dashmap = { workspace = true, features = ["rayon", "raw-api"] }
index_list = { workspace = true }
indexmap = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
lz4 = { workspace = true }
# lz4 = { workspace = true }
memmap2 = { workspace = true }
modular-bitfield = { workspace = true }
num_cpus = { workspace = true }
Expand All @@ -39,15 +39,15 @@ solana-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }
solana-inline-spl = { workspace = true }
solana-measure = { workspace = true }
solana-metrics = { workspace = true }
# solana-metrics = { workspace = true }
solana-nohash-hasher = { workspace = true }
solana-rayon-threadlimit = { workspace = true }
solana-sdk = { workspace = true }
solana-stake-program = { workspace = true, optional = true }
solana-svm = { workspace = true }
solana-vote-program = { workspace = true, optional = true }
static_assertions = { workspace = true }
tar = { workspace = true }
# tar = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }

Expand Down
69 changes: 35 additions & 34 deletions accounts-db/src/accounts_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ impl Drop for SlotCacheInner {

impl SlotCacheInner {
pub fn report_slot_store_metrics(&self) {
datapoint_info!(
"slot_repeated_writes",
(
"same_account_writes",
self.same_account_writes.load(Ordering::Relaxed),
i64
),
(
"same_account_writes_size",
self.same_account_writes_size.load(Ordering::Relaxed),
i64
),
(
"unique_account_writes_size",
self.unique_account_writes_size.load(Ordering::Relaxed),
i64
),
("size", self.size.load(Ordering::Relaxed), i64)
);
// datapoint_info!(
// "slot_repeated_writes",
// (
// "same_account_writes",
// self.same_account_writes.load(Ordering::Relaxed),
// i64
// ),
// (
// "same_account_writes_size",
// self.same_account_writes_size.load(Ordering::Relaxed),
// i64
// ),
// (
// "unique_account_writes_size",
// self.unique_account_writes_size.load(Ordering::Relaxed),
// i64
// ),
// ("size", self.size.load(Ordering::Relaxed), i64)
// );
}

pub fn get_all_pubkeys(&self) -> Vec<Pubkey> {
Expand Down Expand Up @@ -176,6 +176,7 @@ impl AccountsCache {
is_frozen: AtomicBool::default(),
})
}
#[allow(dead_code)]
fn unique_account_writes_size(&self) -> u64 {
self.cache
.iter()
Expand All @@ -191,21 +192,21 @@ impl AccountsCache {
self.total_size.load(Ordering::Relaxed)
}
pub fn report_size(&self) {
datapoint_info!(
"accounts_cache_size",
(
"num_roots",
self.maybe_unflushed_roots.read().unwrap().len(),
i64
),
("num_slots", self.cache.len(), i64),
(
"total_unique_writes_size",
self.unique_account_writes_size(),
i64
),
("total_size", self.size(), i64),
);
// datapoint_info!(
// "accounts_cache_size",
// (
// "num_roots",
// self.maybe_unflushed_roots.read().unwrap().len(),
// i64
// ),
// ("num_slots", self.cache.len(), i64),
// (
// "total_unique_writes_size",
// self.unique_account_writes_size(),
// i64
// ),
// ("total_size", self.size(), i64),
// );
}

pub fn store(&self, slot: Slot, pubkey: &Pubkey, account: AccountSharedData) -> CachedAccount {
Expand Down
Loading