Skip to content

Commit

Permalink
Merge branch 'master' into wen_restart_push_and_aggregate_heaviest_fork
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-coding authored Apr 26, 2024
2 parents a45edb0 + d87e23d commit e10467f
Show file tree
Hide file tree
Showing 15 changed files with 2,668 additions and 26 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions cli-output/src/cli_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2861,6 +2861,8 @@ pub struct CliGossipNode {
pub version: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feature_set: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tpu_quic_port: Option<u16>,
}

impl CliGossipNode {
Expand All @@ -2875,6 +2877,7 @@ impl CliGossipNode {
pubsub_host: info.pubsub.map(|addr| addr.to_string()),
version: info.version,
feature_set: info.feature_set,
tpu_quic_port: info.tpu_quic.map(|addr| addr.port()),
}
}
}
Expand All @@ -2900,13 +2903,14 @@ impl fmt::Display for CliGossipNode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"{:15} | {:44} | {:6} | {:5} | {:21} | {:8}| {}",
"{:15} | {:44} | {:6} | {:5} | {:8} | {:21} | {:8}| {}",
unwrap_to_string_or_none(self.ip_address.as_ref()),
self.identity_label
.as_ref()
.unwrap_or(&self.identity_pubkey),
unwrap_to_string_or_none(self.gossip_port.as_ref()),
unwrap_to_string_or_none(self.tpu_port.as_ref()),
unwrap_to_string_or_none(self.tpu_quic_port.as_ref()),
unwrap_to_string_or_none(self.rpc_host.as_ref()),
unwrap_to_string_or_default(self.version.as_ref(), "unknown"),
unwrap_to_string_or_default(self.feature_set.as_ref(), "unknown"),
Expand All @@ -2925,9 +2929,9 @@ impl fmt::Display for CliGossipNodes {
writeln!(
f,
"IP Address | Identity \
| Gossip | TPU | RPC Address | Version | Feature Set\n\
| Gossip | TPU | TPU-QUIC | RPC Address | Version | Feature Set\n\
----------------+----------------------------------------------+\
--------+-------+-----------------------+---------+----------------",
--------+-------+----------+-----------------------+---------+----------------",
)?;
for node in self.0.iter() {
writeln!(f, "{node}")?;
Expand Down
24 changes: 13 additions & 11 deletions core/src/tvu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,19 @@ impl Tvu {
tower_storage,
);

let connection_cache_use_quic = connection_cache.map(|cc| cc.use_quic()).unwrap_or(false);
let warm_quic_cache_service = if connection_cache_use_quic {
Some(WarmQuicCacheService::new(
connection_cache.unwrap().clone(),
cluster_info.clone(),
poh_recorder.clone(),
exit.clone(),
))
} else {
None
};
let warm_quic_cache_service = connection_cache.and_then(|connection_cache| {
if connection_cache.use_quic() {
Some(WarmQuicCacheService::new(
connection_cache.clone(),
cluster_info.clone(),
poh_recorder.clone(),
exit.clone(),
))
} else {
None
}
});

let (cost_update_sender, cost_update_receiver) = unbounded();
let cost_update_service = CostUpdateService::new(blockstore.clone(), cost_update_receiver);

Expand Down
22 changes: 10 additions & 12 deletions ledger-tool/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,26 +891,24 @@ fn do_blockstore_process_command(ledger_path: &Path, matches: &ArgMatches<'_>) -
AccessType::PrimaryForMaintenance,
);

let end_slot = match end_slot {
Some(end_slot) => end_slot,
None => {
let slot_meta_iterator = blockstore.slot_meta_iterator(start_slot)?;
let slots: Vec<_> = slot_meta_iterator.map(|(slot, _)| slot).collect();
if slots.is_empty() {
return Err(LedgerToolError::BadArgument(format!(
"blockstore is empty beyond purge start slot {start_slot}"
)));
}
*slots.last().unwrap()
}
let Some(highest_slot) = blockstore.highest_slot()? else {
return Err(LedgerToolError::BadArgument(
"blockstore is empty".to_string(),
));
};

let end_slot = if let Some(slot) = end_slot {
std::cmp::min(slot, highest_slot)
} else {
highest_slot
};
if end_slot < start_slot {
return Err(LedgerToolError::BadArgument(format!(
"starting slot {start_slot} should be less than or equal to \
ending slot {end_slot}"
)));
}

info!(
"Purging data from slots {} to {} ({} slots) (do compaction: {}) \
(dead slot only: {})",
Expand Down
18 changes: 18 additions & 0 deletions zk-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ license = { workspace = true }
edition = { workspace = true }

[dependencies]
base64 = { workspace = true }
solana-program = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
tiny-bip39 = { workspace = true }

[target.'cfg(not(target_os = "solana"))'.dependencies]
aes-gcm-siv = { workspace = true }
bincode = { workspace = true }
curve25519-dalek = { workspace = true, features = ["serde"] }
itertools = { workspace = true }
lazy_static = { workspace = true }
rand = { version = "0.7" }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sha3 = "0.9"
solana-sdk = { workspace = true }
subtle = { workspace = true }
zeroize = { workspace = true, features = ["zeroize_derive"] }

[lib]
crate-type = ["cdylib", "rlib"]
Loading

0 comments on commit e10467f

Please sign in to comment.