Skip to content

Commit

Permalink
Plumbing for percentage library
Browse files Browse the repository at this point in the history
  • Loading branch information
ksolana committed Feb 12, 2024
1 parent ca78198 commit 8dae0ed
Show file tree
Hide file tree
Showing 14 changed files with 328 additions and 24 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ ouroboros = "0.15.6"
parking_lot = "0.12"
pbkdf2 = { version = "0.11.0", default-features = false }
pem = "1.1.1"
percentage = "0.1.0"
# percentage = "0.1.0"
pickledb = { version = "0.5.1", default-features = false }
predicates = "2.1"
pretty-hex = "0.3.0"
Expand Down Expand Up @@ -390,6 +390,7 @@ solana-zk-keygen = { path = "zk-keygen", version = "=1.18.0" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=1.18.0" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=1.18.0" }
solana_rbpf = "=0.8.0"
solana_utils = { path = "utils", version = "=1.18.0", default-features = false }
spl-associated-token-account = "=2.3.1"
spl-instruction-padding = "0.1"
spl-memo = "=4.0.1"
Expand Down
2 changes: 1 addition & 1 deletion accounts-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ num-traits = { workspace = true }
num_cpus = { workspace = true }
num_enum = { workspace = true }
ouroboros = { workspace = true }
percentage = { workspace = true }
#percentage = { workspace = true }
qualifier_attr = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion program-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ libc = { workspace = true }
log = { workspace = true }
num-derive = { workspace = true }
num-traits = { workspace = true }
percentage = { workspace = true }
rand = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
solana-frozen-abi = { workspace = true }
Expand All @@ -28,6 +27,7 @@ solana-measure = { workspace = true }
solana-metrics = { workspace = true }
solana-sdk = { workspace = true }
solana_rbpf = { workspace = true }
solana_utils = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {
timings::ExecuteDetailsTimings,
},
log::{debug, error, log_enabled, trace},
percentage::PercentageInteger,
solana_utils::percentage::PercentageInteger,
rand::{thread_rng, Rng},
solana_measure::measure::Measure,
solana_rbpf::{
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ num-traits = { workspace = true }
num_cpus = { workspace = true }
num_enum = { workspace = true }
ouroboros = { workspace = true }
percentage = { workspace = true }
qualifier_attr = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
Expand All @@ -66,6 +65,7 @@ solana-sdk = { workspace = true }
solana-stake-program = { workspace = true }
solana-svm = { workspace = true }
solana-system-program = { workspace = true }
solana_utils = { workspace = true }
solana-version = { workspace = true }
solana-vote = { workspace = true }
solana-vote-program = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion streamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ libc = { workspace = true }
log = { workspace = true }
nix = { workspace = true }
pem = { workspace = true }
percentage = { workspace = true }
quinn = { workspace = true }
quinn-proto = { workspace = true }
rand = { workspace = true }
rustls = { workspace = true, features = ["dangerous_configuration"] }
solana-metrics = { workspace = true }
solana-perf = { workspace = true }
solana-sdk = { workspace = true }
solana_utils = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }
x509-parser = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use {
bytes::Bytes,
crossbeam_channel::Sender,
indexmap::map::{Entry, IndexMap},
percentage::Percentage,
solana_utils::percentage::Percentage,
quinn::{Connecting, Connection, Endpoint, EndpointConfig, TokioRuntime, VarInt},
quinn_proto::VarIntBoundsExceeded,
rand::{thread_rng, Rng},
Expand Down
2 changes: 1 addition & 1 deletion streamer/src/nonblocking/stream_throttle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use {
nonblocking::quic::ConnectionPeerType,
quic::{StreamStats, MAX_UNSTAKED_CONNECTIONS},
},
percentage::Percentage,
solana_utils::percentage::Percentage,
std::{
cmp,
sync::{
Expand Down
2 changes: 1 addition & 1 deletion svm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ edition = { workspace = true }
[dependencies]
itertools = { workspace = true }
log = { workspace = true }
percentage = { workspace = true }
solana-accounts-db = { workspace = true }
solana-bpf-loader-program = { workspace = true }
solana-frozen-abi = { workspace = true }
Expand All @@ -23,6 +22,7 @@ solana-metrics = { workspace = true }
solana-program-runtime = { workspace = true }
solana-sdk = { workspace = true }
solana-system-program = { workspace = true }
solana_utils = { workspace = true }

[lib]
crate-type = ["lib"]
Expand Down
2 changes: 1 addition & 1 deletion svm/src/transaction_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use {
transaction_error_metrics::TransactionErrorMetrics,
},
log::debug,
percentage::Percentage,
solana_utils::percentage::Percentage,
solana_accounts_db::{
accounts::{LoadedTransaction, TransactionLoadResult},
transaction_results::{
Expand Down
21 changes: 21 additions & 0 deletions utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "solana_utils"
description = "Solana utils"
documentation = "https://docs.rs/solana-utils"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
clap = { workspace = true }
solana-version = { workspace = true }
num="0.2.0"

[dev-dependencies]
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
1 change: 1 addition & 0 deletions utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod percentage;
Loading

0 comments on commit 8dae0ed

Please sign in to comment.