Skip to content

Commit

Permalink
consensus: add dev-context-only-utils to tower (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Apr 9, 2024
1 parent 2470b45 commit 70c4cb0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 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 accounts-cluster-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spl-token = { workspace = true, features = ["no-entrypoint"] }

[dev-dependencies]
solana-accounts-db = { workspace = true }
solana-core = { workspace = true }
solana-core = { workspace = true, features = ["dev-context-only-utils"] }
solana-local-cluster = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-test-validator = { workspace = true }
Expand Down
7 changes: 5 additions & 2 deletions bench-tps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ solana-clap-utils = { workspace = true }
solana-cli-config = { workspace = true }
solana-client = { workspace = true }
solana-connection-cache = { workspace = true }
solana-core = { workspace = true }
solana-core = { workspace = true, features = ["dev-context-only-utils"] }
solana-faucet = { workspace = true }
solana-genesis = { workspace = true }
solana-gossip = { workspace = true }
Expand All @@ -36,7 +36,7 @@ solana-rpc = { workspace = true }
solana-rpc-client = { workspace = true }
solana-rpc-client-api = { workspace = true }
solana-rpc-client-nonce-utils = { workspace = true }
solana-runtime = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-sdk = { workspace = true }
solana-streamer = { workspace = true }
solana-tpu-client = { workspace = true }
Expand All @@ -54,3 +54,6 @@ tempfile = { workspace = true }

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

[features]
dev-context-only-utils = []
1 change: 1 addition & 0 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ impl Tower {
}
}

#[cfg(feature = "dev-context-only-utils")]
pub fn record_vote(&mut self, slot: Slot, hash: Hash) -> Option<Slot> {
self.record_bank_vote_and_update_lockouts(slot, hash)
}
Expand Down
5 changes: 5 additions & 0 deletions dos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ solana-version = { workspace = true }
targets = ["x86_64-unknown-linux-gnu"]

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

[features]
dev-context-only-utils = []
5 changes: 5 additions & 0 deletions local-cluster/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ assert_matches = { workspace = true }
fs_extra = { workspace = true }
gag = { workspace = true }
serial_test = { workspace = true }
solana-core = { workspace = true, features = ["dev-context-only-utils"] }
solana-download-utils = { workspace = true }
solana-ledger = { workspace = true, features = ["dev-context-only-utils"] }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }

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

[features]
dev-context-only-utils = []
1 change: 1 addition & 0 deletions scripts/check-dev-context-only-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ declare tainted_packages=(
solana-accounts-bench
solana-banking-bench
agave-ledger-tool
solana-bench-tps
)

# convert to comma separeted (ref: https://stackoverflow.com/a/53839433)
Expand Down
2 changes: 2 additions & 0 deletions transaction-dos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ solana-transaction-status = { workspace = true }
solana-version = { workspace = true }

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

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

0 comments on commit 70c4cb0

Please sign in to comment.