Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract quic-definitions crate #3119

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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 @@ -140,6 +140,7 @@ members = [
"sdk/program-option",
"sdk/program-pack",
"sdk/pubkey",
"sdk/quic-definitions",
"sdk/rent",
"sdk/reserved-account-keys",
"sdk/sanitize",
Expand Down Expand Up @@ -492,6 +493,7 @@ solana-program-test = { path = "program-test", version = "=2.2.0" }
solana-pubkey = { path = "sdk/pubkey", version = "=2.2.0", default-features = false }
solana-pubsub-client = { path = "pubsub-client", version = "=2.2.0" }
solana-quic-client = { path = "quic-client", version = "=2.2.0" }
solana-quic-definitions = { path = "sdk/quic-definitions", version = "=2.2.0" }
solana-rayon-threadlimit = { path = "rayon-threadlimit", version = "=2.2.0" }
solana-remote-wallet = { path = "remote-wallet", version = "=2.2.0", default-features = false }
solana-rent = { path = "sdk/rent", version = "=2.2.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.

2 changes: 2 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ full = [
"dep:solana-keypair",
"dep:solana-precompile-error",
"dep:solana-presigner",
"dep:solana-quic-definitions",
"dep:solana-seed-derivable",
"dep:solana-seed-phrase",
"dep:solana-signer",
Expand Down Expand Up @@ -116,6 +117,7 @@ solana-presigner = { workspace = true, optional = true }
solana-program = { workspace = true }
solana-program-memory = { workspace = true }
solana-pubkey = { workspace = true, default-features = false, features = ["std"] }
solana-quic-definitions = { workspace = true, optional = true }
solana-reserved-account-keys = { workspace = true }
solana-reward-info = { workspace = true, features = ["serde"] }
solana-sanitize = { 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-keypair = { workspace = true }

[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_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;
kevinheavey marked this conversation as resolved.
Show resolved Hide resolved

/// 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;
kevinheavey marked this conversation as resolved.
Show resolved Hide resolved

/// 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;
kevinheavey marked this conversation as resolved.
Show resolved Hide resolved

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 @@ -85,7 +85,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;
#[deprecated(since = "2.2.0", note = "Use `solana-reward-info` crate instead")]
Expand Down Expand Up @@ -149,6 +148,9 @@ pub use solana_program_memory as program_memory;
/// ```
pub use solana_pubkey::pubkey;
#[cfg(feature = "full")]
#[deprecated(since = "2.2.0", note = "Use `solana-quic-definitions` crate instead")]
pub use solana_quic_definitions as quic;
#[cfg(feature = "full")]
#[deprecated(
since = "2.2.0",
note = "Use `solana-reserved-account-keys` crate instead"
Expand Down
Loading