Skip to content

Commit

Permalink
extract quic-definitions crate
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Oct 11, 2024
1 parent ddf0adb commit bd2b0e0
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ members = [
"sdk/program-option",
"sdk/program-pack",
"sdk/pubkey",
"sdk/quic-definitions",
"sdk/rent",
"sdk/seed-derivable",
"sdk/seed-phrase",
Expand Down Expand Up @@ -453,6 +454,7 @@ solana-program-test = { path = "program-test", version = "=2.1.0" }
solana-pubkey = { path = "sdk/pubkey", version = "=2.1.0", default-features = false }
solana-pubsub-client = { path = "pubsub-client", version = "=2.1.0" }
solana-quic-client = { path = "quic-client", version = "=2.1.0" }
solana-quic-definitions = { path = "sdk/quic-definitions", version = "=2.1.0" }
solana-rayon-threadlimit = { path = "rayon-threadlimit", version = "=2.1.0" }
solana-remote-wallet = { path = "remote-wallet", version = "=2.1.0", default-features = false }
solana-rent = { path = "sdk/rent", version = "=2.1.0", default-features = false }
Expand Down
8 changes: 8 additions & 0 deletions programs/sbf/Cargo.lock

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

1 change: 1 addition & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ solana-frozen-abi-macro = { workspace = true, optional = true, features = [
solana-presigner = { workspace = true, optional = true }
solana-program = { workspace = true }
solana-program-memory = { workspace = true }
solana-quic-definitions = { workspace = true }
solana-sanitize = { workspace = true }
solana-sdk-macro = { workspace = true }
solana-secp256k1-recover = { workspace = true }
Expand Down
19 changes: 19 additions & 0 deletions sdk/quic-definitions/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "solana-quic-definitions"
description = "Definitions related to Solana over QUIC."
documentation = "https://docs.rs/solana-quic-definitions"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
solana-signer = { workspace = true, features = ["keypair"] }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true
9 changes: 7 additions & 2 deletions sdk/src/quic.rs → sdk/quic-definitions/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg(feature = "full")]
//! Definitions related to Solana over QUIC.
use {crate::signer::keypair::Keypair, std::time::Duration};
use {solana_signer::keypair::Keypair, std::time::Duration};

pub const QUIC_PORT_OFFSET: u16 = 6;
// Empirically found max number of concurrent streams
Expand All @@ -27,14 +26,20 @@ pub const QUIC_CONNECTION_HANDSHAKE_TIMEOUT: Duration = Duration::from_secs(60);

/// The receive window for QUIC connection from unstaked nodes is
/// set to this ratio times [`solana_sdk::packet::PACKET_DATA_SIZE`]
///
/// [`solana_sdk::packet::PACKET_DATA_SIZE`]: https://docs.rs/solana-sdk/latest/solana_sdk/packet/constant.PACKET_DATA_SIZE.html
pub const QUIC_UNSTAKED_RECEIVE_WINDOW_RATIO: u64 = 128;

/// The receive window for QUIC connection from minimum staked nodes is
/// set to this ratio times [`solana_sdk::packet::PACKET_DATA_SIZE`]
///
/// [`solana_sdk::packet::PACKET_DATA_SIZE`]: https://docs.rs/solana-sdk/latest/solana_sdk/packet/constant.PACKET_DATA_SIZE.html
pub const QUIC_MIN_STAKED_RECEIVE_WINDOW_RATIO: u64 = 128;

/// The receive window for QUIC connection from maximum staked nodes is
/// set to this ratio times [`solana_sdk::packet::PACKET_DATA_SIZE`]
///
/// [`solana_sdk::packet::PACKET_DATA_SIZE`]: https://docs.rs/solana-sdk/latest/solana_sdk/packet/constant.PACKET_DATA_SIZE.html
pub const QUIC_MAX_STAKED_RECEIVE_WINDOW_RATIO: u64 = 512;

pub trait NotifyKeyUpdate {
Expand Down
4 changes: 3 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ pub mod poh_config;
pub mod precompiles;
pub mod program_utils;
pub mod pubkey;
pub mod quic;
pub mod rent_collector;
pub mod rent_debits;
pub mod reserved_account_keys;
Expand Down Expand Up @@ -118,6 +117,9 @@ pub use solana_derivation_path as derivation_path;
pub use solana_feature_set as feature_set;
#[deprecated(since = "2.1.0", note = "Use `solana-program-memory` crate instead")]
pub use solana_program_memory as program_memory;
#[cfg(feature = "full")]
#[deprecated(since = "2.1.0", note = "Use `solana-quic-definitions` crate instead")]
pub use solana_quic_definitions as quic;
#[deprecated(since = "2.1.0", note = "Use `solana-sanitize` crate instead")]
pub use solana_sanitize as sanitize;
/// Same as `declare_id` except report that this id has been deprecated.
Expand Down

0 comments on commit bd2b0e0

Please sign in to comment.