Compare commits

..

22 Commits

Author SHA1 Message Date
mergify[bot]
bf1ceab6ed catchup now estimates the time remaining (#9782) (#9784)
automerge
2020-04-29 00:31:43 -07:00
mergify[bot]
dbaff495c8 v1.1: backport commitment max changes (#9775) (#9778)
automerge
2020-04-28 16:42:08 -07:00
Michael Vines
f65caa66bf Don't --use-move 2020-04-28 12:47:08 -07:00
Michael Vines
2f455e18ef Reorder steps by relative priority for when there aren't enough agents 2020-04-28 12:46:19 -07:00
Michael Vines
7b155f384d Disable move more 2020-04-28 12:38:51 -07:00
mergify[bot]
fd405239d9 Report duration of last alarm in the All Clear message (#9766) (#9770)
automerge

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-04-28 12:38:34 -07:00
sakridge
8698156e27 Update dalek (v1.0 bp) (#9765)
* Disable Move/Libra components

* Update dalek version

Co-authored-by: Trent Nelson <trent@solana.com>
2020-04-28 12:02:09 -07:00
mergify[bot]
2f0f218ad9 Use Blockstore lowest_slot to start root iterator (#9738) (#9767)
automerge
2020-04-28 11:11:10 -07:00
mergify[bot]
3cc75b4bab Set HOME correctly (#9757) (#9761)
automerge
2020-04-28 02:57:49 -07:00
mergify[bot]
0a0f8470d7 Clean up use to keep rust 1.43.0 from complaining (bp #9740) (#9748)
* Clean up `use` to keep rust 1.43.0 from complaining (#9740)

(cherry picked from commit c11abf88b7)
2020-04-27 23:21:32 -07:00
mergify[bot]
e46026f1fb Input values are not sanitized after they are deserialized, making it far too easy for Leo to earn SOL (bp #9706) (#9735)
automerge
2020-04-27 19:58:40 -07:00
mergify[bot]
fef5089d7e Fix broken doc link to anatomy of transaction (#9728) (#9729)
automerge
2020-04-27 01:27:26 -07:00
Michael Vines
a844bd70da Update metrics dashboard 2020-04-26 09:54:19 -07:00
Michael Vines
cbc01bd1b9 Cargo.lock 2020-04-25 23:08:21 -07:00
Michael Vines
e096cc1101 Use vec! 2020-04-25 23:08:09 -07:00
sakridge
0dc559d3cf Filter program ids v1.0 (#9723)
* Filter program ids to store

* add test
2020-04-25 22:52:39 -07:00
mergify[bot]
34f537adad Add support for log rotation, sending SIGUSR1 will cause the log file to be re-opened (#9713) (#9715)
(cherry picked from commit 50f1ec0374)

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-04-24 15:57:47 -07:00
Michael Vines
9558628537 Update to rocksdb 0.14 and set max wal size (#9668) (#9688) (#9708)
Co-authored-by: sakridge <sakridge@gmail.com>
2020-04-24 10:43:01 -07:00
Dan Albert
940bf7081a Update solana-user-authorized_keys.sh 2020-04-23 16:32:23 -06:00
mergify[bot]
38c31c3b4e Exit cleanly on panic! so the process don't limp along in a half-dead state (#9690) (#9692)
automerge
2020-04-23 14:07:12 -07:00
mergify[bot]
253272d757 Remove stray 'v' (#9679) (#9680)
automerge
2020-04-23 00:51:25 -07:00
Michael Vines
9b1bd8065f Bump version to 1.0.20 2020-04-22 22:17:34 -07:00
141 changed files with 5909 additions and 7177 deletions

2230
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-archiver-lib"
version = "1.0.19"
version = "1.0.20"
description = "Solana Archiver Library"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -11,26 +11,26 @@ edition = "2018"
[dependencies]
bincode = "1.2.1"
crossbeam-channel = "0.3"
ed25519-dalek = "=1.0.0-pre.1"
ed25519-dalek = "=1.0.0-pre.3"
log = "0.4.8"
rand = "0.6.5"
rand_chacha = "0.1.1"
solana-client = { path = "../client", version = "1.0.19" }
solana-storage-program = { path = "../programs/storage", version = "1.0.19" }
rand = "0.7.0"
rand_chacha = "0.2.2"
solana-client = { path = "../client", version = "1.0.20" }
solana-storage-program = { path = "../programs/storage", version = "1.0.20" }
thiserror = "1.0"
serde = "1.0.104"
serde_json = "1.0.46"
serde_derive = "1.0.103"
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-chacha = { path = "../chacha", version = "1.0.19" }
solana-chacha-sys = { path = "../chacha-sys", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-perf = { path = "../perf", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-archiver-utils = { path = "../archiver-utils", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-chacha = { path = "../chacha", version = "1.0.20" }
solana-chacha-sys = { path = "../chacha-sys", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-perf = { path = "../perf", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-archiver-utils = { path = "../archiver-utils", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
[dev-dependencies]
hex = "0.4.0"

View File

@@ -1,7 +1,7 @@
use crate::result::ArchiverError;
use crossbeam_channel::unbounded;
use rand::{thread_rng, Rng, SeedableRng};
use rand_chacha::ChaChaRng;
use rand::{thread_rng, Rng};
use rand_chacha::{rand_core::SeedableRng, ChaChaRng};
use solana_archiver_utils::sample_file;
use solana_chacha::chacha::{chacha_cbc_encrypt_ledger, CHACHA_BLOCK_SIZE};
use solana_client::{

View File

@@ -1,4 +1,3 @@
use serde_json;
use solana_client::client_error;
use solana_ledger::blockstore;
use solana_sdk::transport;

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-archiver-utils"
version = "1.0.19"
version = "1.0.20"
description = "Solana Archiver Utils"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,13 +10,13 @@ edition = "2018"
[dependencies]
log = "0.4.8"
rand = "0.6.5"
solana-chacha = { path = "../chacha", version = "1.0.19" }
solana-chacha-sys = { path = "../chacha-sys", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-perf = { path = "../perf", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
rand = "0.7.0"
solana-chacha = { path = "../chacha", version = "1.0.20" }
solana-chacha-sys = { path = "../chacha-sys", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-perf = { path = "../perf", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[dev-dependencies]
hex = "0.4.0"

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-archiver"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -10,13 +10,13 @@ homepage = "https://solana.com/"
[dependencies]
clap = "2.33.0"
console = "0.9.2"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-archiver-lib = { path = "../archiver-lib", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
solana-archiver-lib = { path = "../archiver-lib", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[package.metadata.docs.rs]

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-banking-bench"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -10,13 +10,13 @@ homepage = "https://solana.com/"
[dependencies]
log = "0.4.6"
rayon = "1.2.0"
solana-core = { path = "../core", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-measure = { path = "../measure", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
rand = "0.6.5"
solana-core = { path = "../core", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-measure = { path = "../measure", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
rand = "0.7.0"
crossbeam-channel = "0.3"
[package.metadata.docs.rs]

View File

@@ -246,7 +246,7 @@ fn main() {
poh_recorder.lock().unwrap().set_bank(&bank);
assert!(poh_recorder.lock().unwrap().bank().is_some());
if bank.slot() > 32 {
bank_forks.set_root(root, &None);
bank_forks.set_root(root, &None, None);
root += 1;
}
debug!(

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-bench-exchange"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,24 +14,24 @@ itertools = "0.8.2"
log = "0.4.8"
num-derive = "0.3"
num-traits = "0.2"
rand = "0.6.5"
rand = "0.7.0"
rayon = "1.2.0"
serde_json = "1.0.46"
serde_yaml = "0.8.11"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-genesis = { path = "../genesis", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-faucet = { path = "../faucet", version = "1.0.19" }
solana-exchange-program = { path = "../programs/exchange", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-genesis = { path = "../genesis", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-faucet = { path = "../faucet", version = "1.0.20" }
solana-exchange-program = { path = "../programs/exchange", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "1.0.19" }
solana-local-cluster = { path = "../local-cluster", version = "1.0.20" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -2,17 +2,17 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-bench-streamer"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
[dependencies]
clap = "2.33.0"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-bench-tps"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,27 +14,27 @@ log = "0.4.8"
rayon = "1.2.0"
serde_json = "1.0.46"
serde_yaml = "0.8.11"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-genesis = { path = "../genesis", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-faucet = { path = "../faucet", version = "1.0.19" }
solana-librapay = { path = "../programs/librapay", version = "1.0.19", optional = true }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-measure = { path = "../measure", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-move-loader-program = { path = "../programs/move_loader", version = "1.0.19", optional = true }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-genesis = { path = "../genesis", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-faucet = { path = "../faucet", version = "1.0.20" }
#solana-librapay = { path = "../programs/librapay", version = "1.0.20", optional = true }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
solana-measure = { path = "../measure", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
#solana-move-loader-program = { path = "../programs/move_loader", version = "1.0.20", optional = true }
[dev-dependencies]
serial_test = "0.3.2"
serial_test_derive = "0.4.0"
solana-local-cluster = { path = "../local-cluster", version = "1.0.19" }
solana-local-cluster = { path = "../local-cluster", version = "1.0.20" }
[features]
move = ["solana-librapay", "solana-move-loader-program"]
#[features]
#move = ["solana-librapay", "solana-move-loader-program"]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-chacha-cuda"
version = "1.0.19"
version = "1.0.20"
description = "Solana Chacha Cuda APIs"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,12 +10,12 @@ edition = "2018"
[dependencies]
log = "0.4.8"
solana-archiver-utils = { path = "../archiver-utils", version = "1.0.19" }
solana-chacha = { path = "../chacha", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-perf = { path = "../perf", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-archiver-utils = { path = "../archiver-utils", version = "1.0.20" }
solana-chacha = { path = "../chacha", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-perf = { path = "../perf", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[dev-dependencies]
hex-literal = "0.2.1"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-chacha-sys"
version = "1.0.19"
version = "1.0.20"
description = "Solana chacha-sys"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-chacha"
version = "1.0.19"
version = "1.0.20"
description = "Solana Chacha APIs"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,13 +10,13 @@ edition = "2018"
[dependencies]
log = "0.4.8"
rand = "0.6.5"
rand_chacha = "0.1.1"
solana-chacha-sys = { path = "../chacha-sys", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-perf = { path = "../perf", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
rand = "0.7.0"
rand_chacha = "0.2.2"
solana-chacha-sys = { path = "../chacha-sys", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-perf = { path = "../perf", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[dev-dependencies]
hex-literal = "0.2.1"

View File

@@ -2,6 +2,16 @@
# Build steps that run after the primary pipeline on pushes and tags.
# Pull requests to not run these steps.
steps:
- command: "ci/publish-tarball.sh"
timeout_in_minutes: 60
name: "publish tarball"
- command: "ci/publish-docs.sh"
timeout_in_minutes: 15
name: "publish docs"
- command: "ci/publish-bpf-sdk.sh"
timeout_in_minutes: 5
name: "publish bpf sdk"
- wait
- command: "sdk/docker-solana/build.sh"
timeout_in_minutes: 60
name: "publish docker"
@@ -9,15 +19,6 @@ steps:
timeout_in_minutes: 240
name: "publish crate"
branches: "!master"
- command: "ci/publish-bpf-sdk.sh"
timeout_in_minutes: 5
name: "publish bpf sdk"
- command: "ci/publish-tarball.sh"
timeout_in_minutes: 60
name: "publish tarball"
- command: "ci/publish-docs.sh"
timeout_in_minutes: 15
name: "publish docs"
- command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-move.sh"
name: "move"
timeout_in_minutes: 20
# - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-move.sh"
# name: "move"
# timeout_in_minutes: 20

View File

@@ -49,7 +49,7 @@ else
# ~/.cargo
ARGS+=(--volume "$PWD:/home")
fi
ARGS+=(--env "CARGO_HOME=/home/.cargo")
ARGS+=(--env "HOME=/home" --env "CARGO_HOME=/home/.cargo")
# kcov tries to set the personality of the binary which docker
# doesn't allow by default.

View File

@@ -71,7 +71,7 @@ echo --- Creating release tarball
export CHANNEL
source ci/rust-version.sh stable
scripts/cargo-install-all.sh +"$rust_stable" --use-move solana-release
scripts/cargo-install-all.sh +"$rust_stable" solana-release
tar cvf solana-release-$TARGET.tar solana-release
bzip2 solana-release-$TARGET.tar

View File

@@ -47,7 +47,7 @@ echo "Executing $testName"
case $testName in
test-stable)
_ cargo +"$rust_stable" test --jobs "$NPROC" --all --exclude solana-local-cluster ${V:+--verbose} -- --nocapture
_ cargo +"$rust_stable" test --manifest-path bench-tps/Cargo.toml --features=move ${V:+--verbose} test_bench_tps_local_cluster_move -- --nocapture
#_ cargo +"$rust_stable" test --manifest-path bench-tps/Cargo.toml --features=move ${V:+--verbose} test_bench_tps_local_cluster_move -- --nocapture
;;
test-stable-perf)
ci/affects-files.sh \

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-clap-utils"
version = "1.0.19"
version = "1.0.20"
description = "Solana utilities for the clap"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -11,8 +11,8 @@ edition = "2018"
[dependencies]
clap = "2.33.0"
rpassword = "4.0"
solana-remote-wallet = { path = "../remote-wallet", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-remote-wallet = { path = "../remote-wallet", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
thiserror = "1.0.11"
tiny-bip39 = "0.7.0"
url = "2.1.0"

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-cli-config"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-cli"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -26,28 +26,28 @@ reqwest = { version = "0.10.1", default-features = false, features = ["blocking"
serde = "1.0.104"
serde_derive = "1.0.103"
serde_json = "1.0.46"
solana-budget-program = { path = "../programs/budget", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-cli-config = { path = "../cli-config", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-config-program = { path = "../programs/config", version = "1.0.19" }
solana-faucet = { path = "../faucet", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-remote-wallet = { path = "../remote-wallet", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-storage-program = { path = "../programs/storage", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-vote-signer = { path = "../vote-signer", version = "1.0.19" }
solana-budget-program = { path = "../programs/budget", version = "1.0.20" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-cli-config = { path = "../cli-config", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-config-program = { path = "../programs/config", version = "1.0.20" }
solana-faucet = { path = "../faucet", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-remote-wallet = { path = "../remote-wallet", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
solana-storage-program = { path = "../programs/storage", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
solana-vote-signer = { path = "../vote-signer", version = "1.0.20" }
titlecase = "1.1.0"
thiserror = "1.0.11"
url = "2.1.1"
[dev-dependencies]
solana-core = { path = "../core", version = "1.0.19" }
solana-budget-program = { path = "../programs/budget", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.20" }
solana-budget-program = { path = "../programs/budget", version = "1.0.20" }
tempfile = "3.1.0"
[[bin]]

View File

@@ -454,25 +454,36 @@ pub fn process_catchup(
}
let slot_distance = rpc_slot as i64 - node_slot as i64;
let slots_per_second =
(previous_slot_distance - slot_distance) as f64 / f64::from(sleep_interval);
let time_remaining = if slots_per_second < 0.0 {
"".to_string()
} else {
format!(
". Time remaining: {}",
humantime::format_duration(Duration::from_secs_f64(
(slot_distance as f64 / slots_per_second).round()
))
)
};
progress_bar.set_message(&format!(
"Validator is {} slots away (us:{} them:{}){}",
"{} slots behind (us:{} them:{}){}",
slot_distance,
node_slot,
rpc_slot,
if previous_rpc_slot == std::u64::MAX {
"".to_string()
} else {
let slots_per_second =
(previous_slot_distance - slot_distance) as f64 / f64::from(sleep_interval);
format!(
" and {} at {:.1} slots/second",
", {} at {:.1} slots/second{}",
if slots_per_second < 0.0 {
"falling behind"
} else {
"gaining"
},
slots_per_second,
time_remaining
)
}
));

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-client"
version = "1.0.19"
version = "1.0.20"
description = "Solana Client"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -19,10 +19,10 @@ reqwest = { version = "0.10.1", default-features = false, features = ["blocking"
serde = "1.0.104"
serde_derive = "1.0.103"
serde_json = "1.0.46"
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-transaction-status = { path = "../transaction-status", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-transaction-status = { path = "../transaction-status", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
thiserror = "1.0"
tungstenite = "0.10.1"
url = "2.1.1"
@@ -31,7 +31,7 @@ url = "2.1.1"
assert_matches = "1.3.0"
jsonrpc-core = "14.0.5"
jsonrpc-http-server = "14.0.6"
solana-logger = { path = "../logger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.20" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,7 +1,7 @@
[package]
name = "solana-core"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
documentation = "https://docs.rs/solana"
homepage = "https://solana.com/"
readme = "../README.md"
@@ -36,41 +36,41 @@ log = "0.4.8"
nix = "0.17.0"
num_cpus = "1.0.0"
num-traits = "0.2"
rand = "0.6.5"
rand_chacha = "0.1.1"
rand = "0.7.0"
rand_chacha = "0.2.2"
rayon = "1.2.0"
regex = "1.3.4"
serde = "1.0.104"
serde_derive = "1.0.103"
serde_json = "1.0.46"
solana-budget-program = { path = "../programs/budget", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-transaction-status = { path = "../transaction-status", version = "1.0.19" }
solana-faucet = { path = "../faucet", version = "1.0.19" }
ed25519-dalek = "=1.0.0-pre.1"
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-merkle-tree = { path = "../merkle-tree", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-measure = { path = "../measure", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-chacha-cuda = { path = "../chacha-cuda", version = "1.0.19" }
solana-perf = { path = "../perf", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-storage-program = { path = "../programs/storage", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-vote-signer = { path = "../vote-signer", version = "1.0.19" }
solana-sys-tuner = { path = "../sys-tuner", version = "1.0.19" }
solana-budget-program = { path = "../programs/budget", version = "1.0.20" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-transaction-status = { path = "../transaction-status", version = "1.0.20" }
solana-faucet = { path = "../faucet", version = "1.0.20" }
ed25519-dalek = "=1.0.0-pre.3"
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-merkle-tree = { path = "../merkle-tree", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
solana-measure = { path = "../measure", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-chacha-cuda = { path = "../chacha-cuda", version = "1.0.20" }
solana-perf = { path = "../perf", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
solana-storage-program = { path = "../programs/storage", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
solana-vote-signer = { path = "../vote-signer", version = "1.0.20" }
solana-sys-tuner = { path = "../sys-tuner", version = "1.0.20" }
tempfile = "3.1.0"
thiserror = "1.0"
tokio = "0.1"
tokio-codec = "0.1"
tokio-fs = "0.1"
tokio-io = "0.1"
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.19" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.20" }
trees = "0.2.1"
[dev-dependencies]

View File

@@ -12,8 +12,6 @@
//! * layer 2 - Everyone else, if layer 1 is `2^10`, layer 2 should be able to fit `2^20` number of nodes.
//!
//! Bank needs to provide an interface for us to query the stake weight
use crate::crds_value::CompressionType::*;
use crate::crds_value::EpochIncompleteSlots;
use crate::packet::limited_deserialize;
use crate::streamer::{PacketReceiver, PacketSender};
use crate::{
@@ -21,7 +19,9 @@ use crate::{
crds_gossip::CrdsGossip,
crds_gossip_error::CrdsGossipError,
crds_gossip_pull::{CrdsFilter, CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS},
crds_value::{self, CrdsData, CrdsValue, CrdsValueLabel, EpochSlots, SnapshotHash, Vote},
crds_value::{
self, CrdsData, CrdsValue, CrdsValueLabel, EpochSlots, SnapshotHash, Vote, MAX_WALLCLOCK,
},
packet::{Packet, PACKET_DATA_SIZE},
result::{Error, Result},
sendmmsg::{multicast, send_mmsg},
@@ -31,9 +31,9 @@ use crate::{
use rand::distributions::{Distribution, WeightedIndex};
use rand::SeedableRng;
use rand_chacha::ChaChaRng;
use solana_sdk::sanitize::{Sanitize, SanitizeError};
use bincode::{serialize, serialized_size};
use compression::prelude::*;
use core::cmp;
use itertools::Itertools;
use rayon::iter::IntoParallelIterator;
@@ -87,9 +87,6 @@ const MAX_PROTOCOL_HEADER_SIZE: u64 = 214;
/// 128MB/PACKET_DATA_SIZE
const MAX_GOSSIP_TRAFFIC: usize = 128_000_000 / PACKET_DATA_SIZE;
const NUM_BITS_PER_BYTE: u64 = 8;
const MIN_SIZE_TO_COMPRESS_GZIP: u64 = 64;
/// Keep the number of snapshot hashes a node publishes under MAX_PROTOCOL_PAYLOAD_SIZE
pub const MAX_SNAPSHOT_HASHES: usize = 16;
@@ -157,6 +154,15 @@ pub struct PruneData {
pub wallclock: u64,
}
impl Sanitize for PruneData {
fn sanitize(&self) -> std::result::Result<(), SanitizeError> {
if self.wallclock >= MAX_WALLCLOCK {
return Err(SanitizeError::ValueOutOfRange);
}
Ok(())
}
}
impl Signable for PruneData {
fn pubkey(&self) -> Pubkey {
self.pubkey
@@ -221,6 +227,20 @@ enum Protocol {
PruneMessage(Pubkey, PruneData),
}
impl Sanitize for Protocol {
fn sanitize(&self) -> std::result::Result<(), SanitizeError> {
match self {
Protocol::PullRequest(filter, val) => {
filter.sanitize()?;
val.sanitize()
}
Protocol::PullResponse(_, val) => val.sanitize(),
Protocol::PushMessage(_, val) => val.sanitize(),
Protocol::PruneMessage(_, val) => val.sanitize(),
}
}
}
// Rating for pull requests
// A response table is generated as a
// 2-d table arranged by target nodes and a
@@ -373,115 +393,17 @@ impl ClusterInfo {
)
}
pub fn compress_incomplete_slots(incomplete_slots: &BTreeSet<Slot>) -> EpochIncompleteSlots {
if !incomplete_slots.is_empty() {
let first_slot = incomplete_slots
.iter()
.next()
.expect("expected to find at least one slot");
let last_slot = incomplete_slots
.iter()
.next_back()
.expect("expected to find last slot");
let num_uncompressed_bits = last_slot.saturating_sub(*first_slot) + 1;
let num_uncompressed_bytes = if num_uncompressed_bits % NUM_BITS_PER_BYTE > 0 {
1
} else {
0
} + num_uncompressed_bits / NUM_BITS_PER_BYTE;
let mut uncompressed = vec![0u8; num_uncompressed_bytes as usize];
incomplete_slots.iter().for_each(|slot| {
let offset_from_first_slot = slot.saturating_sub(*first_slot);
let index = offset_from_first_slot / NUM_BITS_PER_BYTE;
let bit_index = offset_from_first_slot % NUM_BITS_PER_BYTE;
uncompressed[index as usize] |= 1 << bit_index;
});
if num_uncompressed_bytes >= MIN_SIZE_TO_COMPRESS_GZIP {
if let Ok(compressed) = uncompressed
.iter()
.cloned()
.encode(&mut GZipEncoder::new(), Action::Finish)
.collect::<std::result::Result<Vec<u8>, _>>()
{
return EpochIncompleteSlots {
first: *first_slot,
compression: GZip,
compressed_list: compressed,
};
}
} else {
return EpochIncompleteSlots {
first: *first_slot,
compression: Uncompressed,
compressed_list: uncompressed,
};
}
}
EpochIncompleteSlots::default()
}
fn bitmap_to_slot_list(first: Slot, bitmap: &[u8]) -> BTreeSet<Slot> {
let mut old_incomplete_slots: BTreeSet<Slot> = BTreeSet::new();
bitmap.iter().enumerate().for_each(|(i, val)| {
if *val != 0 {
(0..8).for_each(|bit_index| {
if (1 << bit_index & *val) != 0 {
let slot = first + i as u64 * NUM_BITS_PER_BYTE + bit_index as u64;
old_incomplete_slots.insert(slot);
}
})
}
});
old_incomplete_slots
}
pub fn decompress_incomplete_slots(slots: &EpochIncompleteSlots) -> BTreeSet<Slot> {
match slots.compression {
Uncompressed => Self::bitmap_to_slot_list(slots.first, &slots.compressed_list),
GZip => {
if let Ok(decompressed) = slots
.compressed_list
.iter()
.cloned()
.decode(&mut GZipDecoder::new())
.collect::<std::result::Result<Vec<u8>, _>>()
{
Self::bitmap_to_slot_list(slots.first, &decompressed)
} else {
BTreeSet::new()
}
}
BZip2 => {
if let Ok(decompressed) = slots
.compressed_list
.iter()
.cloned()
.decode(&mut BZip2Decoder::new())
.collect::<std::result::Result<Vec<u8>, _>>()
{
Self::bitmap_to_slot_list(slots.first, &decompressed)
} else {
BTreeSet::new()
}
}
}
}
pub fn push_epoch_slots(
&mut self,
id: Pubkey,
root: Slot,
_root: Slot,
min: Slot,
slots: BTreeSet<Slot>,
incomplete_slots: &BTreeSet<Slot>,
_slots: BTreeSet<Slot>,
_incomplete_slots: &BTreeSet<Slot>,
) {
let compressed = Self::compress_incomplete_slots(incomplete_slots);
let now = timestamp();
let entry = CrdsValue::new_signed(
CrdsData::EpochSlots(
0,
EpochSlots::new(id, root, min, slots, vec![compressed], now),
),
CrdsData::EpochSlots(0, EpochSlots::new(id, min, now)),
&self.keypair,
);
self.gossip
@@ -1358,6 +1280,7 @@ impl ClusterInfo {
let from_addr = packet.meta.addr();
limited_deserialize(&packet.data[..packet.meta.size])
.into_iter()
.filter(|r: &Protocol| r.sanitize().is_ok())
.for_each(|request| match request {
Protocol::PullRequest(filter, caller) => {
let start = allocated.get();
@@ -2500,14 +2423,7 @@ mod tests {
}
let value = CrdsValue::new_unsigned(CrdsData::EpochSlots(
0,
EpochSlots {
from: Pubkey::default(),
root: 0,
lowest: 0,
slots: btree_slots,
stash: vec![],
wallclock: 0,
},
EpochSlots::new(Pubkey::default(), 0, 0),
));
test_split_messages(value);
}
@@ -2519,39 +2435,19 @@ mod tests {
let payload: Vec<CrdsValue> = vec![];
let vec_size = serialized_size(&payload).unwrap();
let desired_size = MAX_PROTOCOL_PAYLOAD_SIZE - vec_size;
let mut value = CrdsValue::new_unsigned(CrdsData::EpochSlots(
0,
EpochSlots {
from: Pubkey::default(),
root: 0,
lowest: 0,
slots: BTreeSet::new(),
stash: vec![],
wallclock: 0,
},
));
let mut value = CrdsValue::new_unsigned(CrdsData::SnapshotHashes(SnapshotHash {
from: Pubkey::default(),
hashes: vec![],
wallclock: 0,
}));
let mut i = 0;
while value.size() <= desired_size {
let slots = (0..i).collect::<BTreeSet<_>>();
if slots.len() > 200 {
panic!(
"impossible to match size: last {:?} vs desired {:?}",
serialized_size(&value).unwrap(),
desired_size
);
}
value.data = CrdsData::EpochSlots(
0,
EpochSlots {
from: Pubkey::default(),
root: 0,
lowest: 0,
slots,
stash: vec![],
wallclock: 0,
},
);
value.data = CrdsData::SnapshotHashes(SnapshotHash {
from: Pubkey::default(),
hashes: vec![(0, Hash::default()); i],
wallclock: 0,
});
i += 1;
}
let split = ClusterInfo::split_gossip_messages(vec![value.clone()]);
@@ -2681,11 +2577,9 @@ mod tests {
node_keypair,
);
for i in 0..10 {
let mut peer_root = 5;
let mut peer_lowest = 0;
if i >= 5 {
// make these invalid for the upcoming repair request
peer_root = 15;
peer_lowest = 10;
}
let other_node_pubkey = Pubkey::new_rand();
@@ -2693,14 +2587,7 @@ mod tests {
cluster_info.insert_info(other_node.clone());
let value = CrdsValue::new_unsigned(CrdsData::EpochSlots(
0,
EpochSlots::new(
other_node_pubkey,
peer_root,
peer_lowest,
BTreeSet::new(),
vec![],
timestamp(),
),
EpochSlots::new(other_node_pubkey, peer_lowest, timestamp()),
));
let _ = cluster_info.gossip.crds.insert(value, timestamp());
}
@@ -2749,6 +2636,14 @@ mod tests {
assert_eq!(MAX_PROTOCOL_HEADER_SIZE, max_protocol_size);
}
#[test]
fn test_protocol_sanitize() {
let mut pd = PruneData::default();
pd.wallclock = MAX_WALLCLOCK;
let msg = Protocol::PruneMessage(Pubkey::default(), pd);
assert_eq!(msg.sanitize(), Err(SanitizeError::ValueOutOfRange));
}
// computes the maximum size for pull request blooms
fn max_bloom_size() -> usize {
let filter_size = serialized_size(&CrdsFilter::default())
@@ -2761,38 +2656,4 @@ mod tests {
serialized_size(&protocol).expect("unable to serialize gossip protocol") as usize;
PACKET_DATA_SIZE - (protocol_size - filter_size)
}
#[test]
fn test_compress_incomplete_slots() {
let mut incomplete_slots: BTreeSet<Slot> = BTreeSet::new();
assert_eq!(
EpochIncompleteSlots::default(),
ClusterInfo::compress_incomplete_slots(&incomplete_slots)
);
incomplete_slots.insert(100);
let compressed = ClusterInfo::compress_incomplete_slots(&incomplete_slots);
assert_eq!(100, compressed.first);
let decompressed = ClusterInfo::decompress_incomplete_slots(&compressed);
assert_eq!(incomplete_slots, decompressed);
incomplete_slots.insert(104);
let compressed = ClusterInfo::compress_incomplete_slots(&incomplete_slots);
assert_eq!(100, compressed.first);
let decompressed = ClusterInfo::decompress_incomplete_slots(&compressed);
assert_eq!(incomplete_slots, decompressed);
incomplete_slots.insert(80);
let compressed = ClusterInfo::compress_incomplete_slots(&incomplete_slots);
assert_eq!(80, compressed.first);
let decompressed = ClusterInfo::decompress_incomplete_slots(&compressed);
assert_eq!(incomplete_slots, decompressed);
incomplete_slots.insert(10000);
let compressed = ClusterInfo::compress_incomplete_slots(&incomplete_slots);
assert_eq!(80, compressed.first);
let decompressed = ClusterInfo::decompress_incomplete_slots(&compressed);
assert_eq!(incomplete_slots, decompressed);
}
}

View File

@@ -1,4 +1,5 @@
use crate::consensus::VOTE_THRESHOLD_SIZE;
use solana_ledger::blockstore::Blockstore;
use solana_measure::measure::Measure;
use solana_metrics::inc_new_counter_info;
use solana_runtime::bank::Bank;
@@ -45,11 +46,12 @@ impl BlockCommitment {
}
}
#[derive(Default)]
pub struct BlockCommitmentCache {
block_commitment: HashMap<Slot, BlockCommitment>,
largest_confirmed_root: Slot,
total_stake: u64,
bank: Arc<Bank>,
blockstore: Arc<Blockstore>,
root: Slot,
}
@@ -70,22 +72,41 @@ impl std::fmt::Debug for BlockCommitmentCache {
impl BlockCommitmentCache {
pub fn new(
block_commitment: HashMap<Slot, BlockCommitment>,
largest_confirmed_root: Slot,
total_stake: u64,
bank: Arc<Bank>,
blockstore: Arc<Blockstore>,
root: Slot,
) -> Self {
Self {
block_commitment,
largest_confirmed_root,
total_stake,
bank,
blockstore,
root,
}
}
pub fn default_with_blockstore(blockstore: Arc<Blockstore>) -> Self {
Self {
block_commitment: HashMap::default(),
largest_confirmed_root: Slot::default(),
total_stake: u64::default(),
bank: Arc::new(Bank::default()),
blockstore,
root: Slot::default(),
}
}
pub fn get_block_commitment(&self, slot: Slot) -> Option<&BlockCommitment> {
self.block_commitment.get(&slot)
}
pub fn largest_confirmed_root(&self) -> Slot {
self.largest_confirmed_root
}
pub fn total_stake(&self) -> u64 {
self.total_stake
}
@@ -123,24 +144,28 @@ impl BlockCommitmentCache {
}
pub fn is_confirmed_rooted(&self, slot: Slot) -> bool {
self.get_block_commitment(slot)
.map(|block_commitment| {
(block_commitment.get_rooted_stake() as f64 / self.total_stake as f64)
> VOTE_THRESHOLD_SIZE
})
.unwrap_or(false)
slot <= self.largest_confirmed_root()
&& (self.blockstore.is_root(slot) || self.bank.status_cache_ancestors().contains(&slot))
}
#[cfg(test)]
pub fn new_for_tests() -> Self {
pub fn new_for_tests_with_blockstore(blockstore: Arc<Blockstore>) -> Self {
let mut block_commitment: HashMap<Slot, BlockCommitment> = HashMap::new();
block_commitment.insert(0, BlockCommitment::default());
Self {
block_commitment,
blockstore,
total_stake: 42,
..Self::default()
largest_confirmed_root: Slot::default(),
bank: Arc::new(Bank::default()),
root: Slot::default(),
}
}
#[cfg(test)]
pub(crate) fn set_get_largest_confirmed_root(&mut self, root: Slot) {
self.largest_confirmed_root = root;
}
}
pub struct CommitmentAggregationData {
@@ -159,6 +184,18 @@ impl CommitmentAggregationData {
}
}
fn get_largest_confirmed_root(mut rooted_stake: Vec<(Slot, u64)>, total_stake: u64) -> Slot {
rooted_stake.sort_by(|a, b| a.0.cmp(&b.0).reverse());
let mut stake_sum = 0;
for (root, stake) in rooted_stake {
stake_sum += stake;
if (stake_sum as f64 / total_stake as f64) > VOTE_THRESHOLD_SIZE {
return root;
}
}
0
}
pub struct AggregateCommitmentService {
t_commitment: JoinHandle<()>,
}
@@ -216,12 +253,18 @@ impl AggregateCommitmentService {
}
let mut aggregate_commitment_time = Measure::start("aggregate-commitment-ms");
let block_commitment = Self::aggregate_commitment(&ancestors, &aggregation_data.bank);
let (block_commitment, rooted_stake) =
Self::aggregate_commitment(&ancestors, &aggregation_data.bank);
let largest_confirmed_root =
get_largest_confirmed_root(rooted_stake, aggregation_data.total_staked);
let mut new_block_commitment = BlockCommitmentCache::new(
block_commitment,
largest_confirmed_root,
aggregation_data.total_staked,
aggregation_data.bank,
block_commitment_cache.read().unwrap().blockstore.clone(),
aggregation_data.root,
);
@@ -236,7 +279,10 @@ impl AggregateCommitmentService {
}
}
pub fn aggregate_commitment(ancestors: &[Slot], bank: &Bank) -> HashMap<Slot, BlockCommitment> {
pub fn aggregate_commitment(
ancestors: &[Slot],
bank: &Bank,
) -> (HashMap<Slot, BlockCommitment>, Vec<(Slot, u64)>) {
assert!(!ancestors.is_empty());
// Check ancestors is sorted
@@ -245,6 +291,7 @@ impl AggregateCommitmentService {
}
let mut commitment = HashMap::new();
let mut rooted_stake: Vec<(Slot, u64)> = Vec::new();
for (_, (lamports, account)) in bank.vote_accounts().into_iter() {
if lamports == 0 {
continue;
@@ -257,17 +304,19 @@ impl AggregateCommitmentService {
let vote_state = vote_state.unwrap();
Self::aggregate_commitment_for_vote_account(
&mut commitment,
&mut rooted_stake,
&vote_state,
ancestors,
lamports,
);
}
commitment
(commitment, rooted_stake)
}
fn aggregate_commitment_for_vote_account(
commitment: &mut HashMap<Slot, BlockCommitment>,
rooted_stake: &mut Vec<(Slot, u64)>,
vote_state: &VoteState,
ancestors: &[Slot],
lamports: u64,
@@ -286,6 +335,7 @@ impl AggregateCommitmentService {
break;
}
}
rooted_stake.push((root, lamports));
}
for vote in &vote_state.votes {
@@ -312,6 +362,7 @@ impl AggregateCommitmentService {
mod tests {
use super::*;
use crate::genesis_utils::{create_genesis_config, GenesisConfigInfo};
use solana_ledger::get_tmp_ledger_path;
use solana_sdk::pubkey::Pubkey;
use solana_stake_program::stake_state;
use solana_vote_program::vote_state::{self, VoteStateVersions};
@@ -329,6 +380,8 @@ mod tests {
#[test]
fn test_get_confirmations() {
let bank = Arc::new(Bank::default());
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
// Build BlockCommitmentCache with votes at depths 0 and 1 for 2 slots
let mut cache0 = BlockCommitment::default();
cache0.increase_confirmation_stake(1, 5);
@@ -346,7 +399,8 @@ mod tests {
block_commitment.entry(0).or_insert(cache0.clone());
block_commitment.entry(1).or_insert(cache1.clone());
block_commitment.entry(2).or_insert(cache2.clone());
let block_commitment_cache = BlockCommitmentCache::new(block_commitment, 50, bank, 0);
let block_commitment_cache =
BlockCommitmentCache::new(block_commitment, 0, 50, bank, blockstore, 0);
assert_eq!(block_commitment_cache.get_confirmation_count(0), Some(2));
assert_eq!(block_commitment_cache.get_confirmation_count(1), Some(1));
@@ -354,17 +408,68 @@ mod tests {
assert_eq!(block_commitment_cache.get_confirmation_count(3), None,);
}
#[test]
fn test_is_confirmed_rooted() {
let bank = Arc::new(Bank::default());
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
blockstore.set_roots(&[0, 1]).unwrap();
// Build BlockCommitmentCache with rooted slots
let mut cache0 = BlockCommitment::default();
cache0.increase_rooted_stake(50);
let mut cache1 = BlockCommitment::default();
cache1.increase_rooted_stake(40);
let mut cache2 = BlockCommitment::default();
cache2.increase_rooted_stake(20);
let mut block_commitment = HashMap::new();
block_commitment.entry(1).or_insert(cache0.clone());
block_commitment.entry(2).or_insert(cache1.clone());
block_commitment.entry(3).or_insert(cache2.clone());
let largest_confirmed_root = 1;
let block_commitment_cache = BlockCommitmentCache::new(
block_commitment,
largest_confirmed_root,
50,
bank,
blockstore,
0,
);
assert!(block_commitment_cache.is_confirmed_rooted(0));
assert!(block_commitment_cache.is_confirmed_rooted(1));
assert!(!block_commitment_cache.is_confirmed_rooted(2));
assert!(!block_commitment_cache.is_confirmed_rooted(3));
}
#[test]
fn test_get_largest_confirmed_root() {
assert_eq!(get_largest_confirmed_root(vec![], 10), 0);
let mut rooted_stake = vec![];
rooted_stake.push((0, 5));
rooted_stake.push((1, 5));
assert_eq!(get_largest_confirmed_root(rooted_stake, 10), 0);
let mut rooted_stake = vec![];
rooted_stake.push((1, 5));
rooted_stake.push((0, 10));
rooted_stake.push((2, 5));
rooted_stake.push((1, 4));
assert_eq!(get_largest_confirmed_root(rooted_stake, 10), 1);
}
#[test]
fn test_aggregate_commitment_for_vote_account_1() {
let ancestors = vec![3, 4, 5, 7, 9, 11];
let mut commitment = HashMap::new();
let mut rooted_stake = vec![];
let lamports = 5;
let mut vote_state = VoteState::default();
let root = ancestors.last().unwrap();
vote_state.root_slot = Some(*root);
let root = ancestors.last().unwrap().clone();
vote_state.root_slot = Some(root);
AggregateCommitmentService::aggregate_commitment_for_vote_account(
&mut commitment,
&mut rooted_stake,
&vote_state,
&ancestors,
lamports,
@@ -375,12 +480,14 @@ mod tests {
expected.increase_rooted_stake(lamports);
assert_eq!(*commitment.get(&a).unwrap(), expected);
}
assert_eq!(rooted_stake[0], (root, lamports));
}
#[test]
fn test_aggregate_commitment_for_vote_account_2() {
let ancestors = vec![3, 4, 5, 7, 9, 11];
let mut commitment = HashMap::new();
let mut rooted_stake = vec![];
let lamports = 5;
let mut vote_state = VoteState::default();
@@ -389,6 +496,7 @@ mod tests {
vote_state.process_slot_vote_unchecked(*ancestors.last().unwrap());
AggregateCommitmentService::aggregate_commitment_for_vote_account(
&mut commitment,
&mut rooted_stake,
&vote_state,
&ancestors,
lamports,
@@ -405,12 +513,14 @@ mod tests {
assert_eq!(*commitment.get(&a).unwrap(), expected);
}
}
assert_eq!(rooted_stake[0], (root, lamports));
}
#[test]
fn test_aggregate_commitment_for_vote_account_3() {
let ancestors = vec![3, 4, 5, 7, 9, 10, 11];
let mut commitment = HashMap::new();
let mut rooted_stake = vec![];
let lamports = 5;
let mut vote_state = VoteState::default();
@@ -421,6 +531,7 @@ mod tests {
vote_state.process_slot_vote_unchecked(ancestors[6]);
AggregateCommitmentService::aggregate_commitment_for_vote_account(
&mut commitment,
&mut rooted_stake,
&vote_state,
&ancestors,
lamports,
@@ -441,6 +552,7 @@ mod tests {
assert_eq!(*commitment.get(&a).unwrap(), expected);
}
}
assert_eq!(rooted_stake[0], (root, lamports));
}
#[test]
@@ -450,6 +562,8 @@ mod tests {
mut genesis_config, ..
} = create_genesis_config(10_000);
let rooted_stake_amount = 40;
let sk1 = Pubkey::new_rand();
let pk1 = Pubkey::new_rand();
let mut vote_account1 = vote_state::create_account(&pk1, &Pubkey::new_rand(), 0, 100);
@@ -460,12 +574,36 @@ mod tests {
let mut vote_account2 = vote_state::create_account(&pk2, &Pubkey::new_rand(), 0, 50);
let stake_account2 =
stake_state::create_account(&sk2, &pk2, &vote_account2, &genesis_config.rent, 50);
let sk3 = Pubkey::new_rand();
let pk3 = Pubkey::new_rand();
let mut vote_account3 = vote_state::create_account(&pk3, &Pubkey::new_rand(), 0, 1);
let stake_account3 = stake_state::create_account(
&sk3,
&pk3,
&vote_account3,
&genesis_config.rent,
rooted_stake_amount,
);
let sk4 = Pubkey::new_rand();
let pk4 = Pubkey::new_rand();
let mut vote_account4 = vote_state::create_account(&pk4, &Pubkey::new_rand(), 0, 1);
let stake_account4 = stake_state::create_account(
&sk4,
&pk4,
&vote_account4,
&genesis_config.rent,
rooted_stake_amount,
);
genesis_config.accounts.extend(vec![
(pk1, vote_account1.clone()),
(sk1, stake_account1),
(pk2, vote_account2.clone()),
(sk2, stake_account2),
(pk3, vote_account3.clone()),
(sk3, stake_account3),
(pk4, vote_account4.clone()),
(sk4, stake_account4),
]);
// Create bank
@@ -485,7 +623,20 @@ mod tests {
VoteState::to(&versioned, &mut vote_account2).unwrap();
bank.store_account(&pk2, &vote_account2);
let commitment = AggregateCommitmentService::aggregate_commitment(&ancestors, &bank);
let mut vote_state3 = VoteState::from(&vote_account3).unwrap();
vote_state3.root_slot = Some(1);
let versioned = VoteStateVersions::Current(Box::new(vote_state3));
VoteState::to(&versioned, &mut vote_account3).unwrap();
bank.store_account(&pk3, &vote_account3);
let mut vote_state4 = VoteState::from(&vote_account4).unwrap();
vote_state4.root_slot = Some(2);
let versioned = VoteStateVersions::Current(Box::new(vote_state4));
VoteState::to(&versioned, &mut vote_account4).unwrap();
bank.store_account(&pk4, &vote_account4);
let (commitment, rooted_stake) =
AggregateCommitmentService::aggregate_commitment(&ancestors, &bank);
for a in ancestors {
if a <= 3 {
@@ -509,5 +660,7 @@ mod tests {
assert!(commitment.get(&a).is_none());
}
}
assert_eq!(rooted_stake.len(), 2);
assert_eq!(get_largest_confirmed_root(rooted_stake, 100), 1)
}
}

View File

@@ -621,7 +621,7 @@ pub mod test {
}
let vote = tower.new_vote_from_bank(&bank, &my_vote_pubkey).0;
if let Some(new_root) = tower.record_bank_vote(vote) {
ReplayStage::handle_new_root(new_root, bank_forks, progress, &None);
ReplayStage::handle_new_root(new_root, bank_forks, progress, &None, None);
}
// Mark the vote for this bank under this node's pubkey so it will be

View File

@@ -1,6 +1,8 @@
use crate::crds_value::MAX_WALLCLOCK;
use solana_sdk::pubkey::Pubkey;
#[cfg(test)]
use solana_sdk::rpc_port;
use solana_sdk::sanitize::{Sanitize, SanitizeError};
#[cfg(test)]
use solana_sdk::signature::{Keypair, Signer};
use solana_sdk::timing::timestamp;
@@ -37,6 +39,15 @@ pub struct ContactInfo {
pub shred_version: u16,
}
impl Sanitize for ContactInfo {
fn sanitize(&self) -> std::result::Result<(), SanitizeError> {
if self.wallclock >= MAX_WALLCLOCK {
return Err(SanitizeError::Failed);
}
Ok(())
}
}
impl Ord for ContactInfo {
fn cmp(&self, other: &Self) -> Ordering {
self.id.cmp(&other.id)

View File

@@ -14,7 +14,6 @@ use crate::crds::Crds;
use crate::crds_gossip::{get_stake, get_weight, CRDS_GOSSIP_DEFAULT_BLOOM_ITEMS};
use crate::crds_gossip_error::CrdsGossipError;
use crate::crds_value::{CrdsValue, CrdsValueLabel};
use rand;
use rand::distributions::{Distribution, WeightedIndex};
use rand::Rng;
use solana_runtime::bloom::Bloom;
@@ -37,6 +36,13 @@ pub struct CrdsFilter {
mask_bits: u32,
}
impl solana_sdk::sanitize::Sanitize for CrdsFilter {
fn sanitize(&self) -> std::result::Result<(), solana_sdk::sanitize::SanitizeError> {
self.filter.sanitize()?;
Ok(())
}
}
impl CrdsFilter {
pub fn new_rand(num_items: usize, max_bytes: usize) -> Self {
let max_bits = (max_bytes * 8) as f64;

View File

@@ -1,5 +1,6 @@
use crate::contact_info::ContactInfo;
use bincode::{serialize, serialized_size};
use solana_sdk::sanitize::{Sanitize, SanitizeError};
use solana_sdk::timing::timestamp;
use solana_sdk::{
clock::Slot,
@@ -14,10 +15,14 @@ use std::{
fmt,
};
pub const MAX_WALLCLOCK: u64 = 1_000_000_000_000_000;
pub const MAX_SLOT: u64 = 1_000_000_000_000_000;
pub type VoteIndex = u8;
pub const MAX_VOTES: VoteIndex = 32;
pub type EpochSlotIndex = u8;
pub const MAX_EPOCH_SLOTS: EpochSlotIndex = 1;
/// CrdsValue that is replicated across the cluster
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
@@ -26,6 +31,13 @@ pub struct CrdsValue {
pub data: CrdsData,
}
impl Sanitize for CrdsValue {
fn sanitize(&self) -> Result<(), SanitizeError> {
self.signature.sanitize()?;
self.data.sanitize()
}
}
impl Signable for CrdsValue {
fn pubkey(&self) -> Pubkey {
self.pubkey()
@@ -44,14 +56,8 @@ impl Signable for CrdsValue {
}
fn verify(&self) -> bool {
let sig_check = self
.get_signature()
.verify(&self.pubkey().as_ref(), self.signable_data().borrow());
let data_check = match &self.data {
CrdsData::Vote(ix, _) => *ix < MAX_VOTES,
_ => true,
};
sig_check && data_check
self.get_signature()
.verify(&self.pubkey().as_ref(), self.signable_data().borrow())
}
}
@@ -87,6 +93,39 @@ pub struct EpochIncompleteSlots {
pub compressed_list: Vec<u8>,
}
impl Sanitize for EpochIncompleteSlots {
fn sanitize(&self) -> Result<(), SanitizeError> {
if self.first >= MAX_SLOT {
return Err(SanitizeError::Failed);
}
//rest of the data doesn't matter since we no longer decompress
//these values
Ok(())
}
}
impl Sanitize for CrdsData {
fn sanitize(&self) -> Result<(), SanitizeError> {
match self {
CrdsData::ContactInfo(val) => val.sanitize(),
CrdsData::Vote(ix, val) => {
if *ix >= MAX_VOTES {
return Err(SanitizeError::Failed);
}
val.sanitize()
}
CrdsData::SnapshotHashes(val) => val.sanitize(),
CrdsData::AccountsHashes(val) => val.sanitize(),
CrdsData::EpochSlots(ix, val) => {
if *ix as usize >= MAX_EPOCH_SLOTS as usize {
return Err(SanitizeError::Failed);
}
val.sanitize()
}
}
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct SnapshotHash {
pub from: Pubkey,
@@ -94,6 +133,20 @@ pub struct SnapshotHash {
pub wallclock: u64,
}
impl Sanitize for SnapshotHash {
fn sanitize(&self) -> Result<(), SanitizeError> {
if self.wallclock >= MAX_WALLCLOCK {
return Err(SanitizeError::Failed);
}
for (slot, _) in &self.hashes {
if *slot >= MAX_SLOT {
return Err(SanitizeError::Failed);
}
}
self.from.sanitize()
}
}
impl SnapshotHash {
pub fn new(from: Pubkey, hashes: Vec<(Slot, Hash)>) -> Self {
Self {
@@ -107,33 +160,47 @@ impl SnapshotHash {
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct EpochSlots {
pub from: Pubkey,
pub root: Slot,
root: Slot,
pub lowest: Slot,
pub slots: BTreeSet<Slot>,
pub stash: Vec<EpochIncompleteSlots>,
slots: BTreeSet<Slot>,
stash: Vec<EpochIncompleteSlots>,
pub wallclock: u64,
}
impl EpochSlots {
pub fn new(
from: Pubkey,
root: Slot,
lowest: Slot,
slots: BTreeSet<Slot>,
stash: Vec<EpochIncompleteSlots>,
wallclock: u64,
) -> Self {
pub fn new(from: Pubkey, lowest: Slot, wallclock: u64) -> Self {
Self {
from,
root,
root: 0,
lowest,
slots,
stash,
slots: BTreeSet::new(),
stash: vec![],
wallclock,
}
}
}
impl Sanitize for EpochSlots {
fn sanitize(&self) -> Result<(), SanitizeError> {
if self.wallclock >= MAX_WALLCLOCK {
return Err(SanitizeError::Failed);
}
if self.lowest >= MAX_SLOT {
return Err(SanitizeError::Failed);
}
if self.root >= MAX_SLOT {
return Err(SanitizeError::Failed);
}
for slot in &self.slots {
if *slot >= MAX_SLOT {
return Err(SanitizeError::Failed);
}
}
self.stash.sanitize()?;
self.from.sanitize()
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct Vote {
pub from: Pubkey,
@@ -141,6 +208,16 @@ pub struct Vote {
pub wallclock: u64,
}
impl Sanitize for Vote {
fn sanitize(&self) -> Result<(), SanitizeError> {
if self.wallclock >= MAX_WALLCLOCK {
return Err(SanitizeError::Failed);
}
self.from.sanitize()?;
self.transaction.sanitize()
}
}
impl Vote {
pub fn new(from: &Pubkey, transaction: Transaction, wallclock: u64) -> Self {
Self {
@@ -356,7 +433,7 @@ mod test {
let v = CrdsValue::new_unsigned(CrdsData::EpochSlots(
0,
EpochSlots::new(Pubkey::default(), 0, 0, BTreeSet::new(), vec![], 0),
EpochSlots::new(Pubkey::default(), 0, 0),
));
assert_eq!(v.wallclock(), 0);
let key = v.clone().epoch_slots().unwrap().from;
@@ -377,10 +454,9 @@ mod test {
Vote::new(&keypair.pubkey(), test_tx(), timestamp()),
));
verify_signatures(&mut v, &keypair, &wrong_keypair);
let btreeset: BTreeSet<Slot> = vec![1, 2, 3, 6, 8].into_iter().collect();
v = CrdsValue::new_unsigned(CrdsData::EpochSlots(
0,
EpochSlots::new(keypair.pubkey(), 0, 0, btreeset, vec![], timestamp()),
EpochSlots::new(keypair.pubkey(), 0, timestamp()),
));
verify_signatures(&mut v, &keypair, &wrong_keypair);
}
@@ -395,9 +471,21 @@ mod test {
),
&keypair,
);
assert!(!vote.verify());
assert!(vote.sanitize().is_err());
}
#[test]
fn test_max_epoch_slots_index() {
let keypair = Keypair::new();
let item = CrdsValue::new_signed(
CrdsData::Vote(
MAX_VOTES,
Vote::new(&keypair.pubkey(), test_tx(), timestamp()),
),
&keypair,
);
assert!(item.sanitize().is_err());
}
#[test]
fn test_compute_vote_index_empty() {
for i in 0..MAX_VOTES {

View File

@@ -1,10 +1,8 @@
//! The `poh_service` module implements a service that records the passing of
//! "ticks", a measure of time in the PoH stream
use crate::poh_recorder::PohRecorder;
use core_affinity;
use solana_sdk::clock::DEFAULT_TICKS_PER_SLOT;
use solana_sdk::poh_config::PohConfig;
use solana_sys_tuner;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
use std::thread::{self, sleep, Builder, JoinHandle};

View File

@@ -67,7 +67,6 @@ impl Drop for Finalizer {
}
}
#[derive(Default)]
pub struct ReplayStageConfig {
pub my_pubkey: Pubkey,
pub vote_account: Pubkey,
@@ -257,13 +256,15 @@ impl ReplayStage {
);
let ancestors = Arc::new(bank_forks.read().unwrap().ancestors());
let forks_root = bank_forks.read().unwrap().root();
let start = allocated.get();
let mut frozen_banks: Vec<_> = bank_forks
.read()
.unwrap()
.frozen_banks()
.values()
.cloned()
.into_iter()
.filter(|(slot, _)| *slot >= forks_root)
.map(|(_, bank)| bank)
.collect();
let newly_computed_slot_stats = Self::compute_bank_stats(
&my_pubkey,
@@ -344,6 +345,7 @@ impl ReplayStage {
&accounts_hash_sender,
&latest_root_senders,
&subscriptions,
&block_commitment_cache,
)?;
}
datapoint_debug!(
@@ -618,6 +620,7 @@ impl ReplayStage {
accounts_hash_sender: &Option<SnapshotPackageSender>,
latest_root_senders: &[Sender<Slot>],
subscriptions: &Arc<RpcSubscriptions>,
block_commitment_cache: &Arc<RwLock<BlockCommitmentCache>>,
) -> Result<()> {
if bank.is_empty() {
inc_new_counter_info!("replay_stage-voted_empty_bank", 1);
@@ -643,7 +646,20 @@ impl ReplayStage {
blockstore
.set_roots(&rooted_slots)
.expect("Ledger set roots failed");
Self::handle_new_root(new_root, &bank_forks, progress, accounts_hash_sender);
let largest_confirmed_root = Some(
block_commitment_cache
.read()
.unwrap()
.largest_confirmed_root(),
);
Self::handle_new_root(
new_root,
&bank_forks,
progress,
accounts_hash_sender,
largest_confirmed_root,
);
subscriptions.notify_roots(rooted_slots);
latest_root_senders.iter().for_each(|s| {
if let Err(e) = s.send(new_root) {
@@ -979,15 +995,17 @@ impl ReplayStage {
}
pub(crate) fn handle_new_root(
new_root: u64,
new_root: Slot,
bank_forks: &RwLock<BankForks>,
progress: &mut HashMap<u64, ForkProgress>,
accounts_hash_sender: &Option<SnapshotPackageSender>,
largest_confirmed_root: Option<Slot>,
) {
bank_forks
.write()
.unwrap()
.set_root(new_root, accounts_hash_sender);
bank_forks.write().unwrap().set_root(
new_root,
accounts_hash_sender,
largest_confirmed_root,
);
let r_bank_forks = bank_forks.read().unwrap();
progress.retain(|k, _| r_bank_forks.get(*k).is_some());
}
@@ -1016,7 +1034,11 @@ impl ReplayStage {
// Find the next slot that chains to the old slot
let forks = forks_lock.read().unwrap();
let frozen_banks = forks.frozen_banks();
let frozen_bank_slots: Vec<u64> = frozen_banks.keys().cloned().collect();
let frozen_bank_slots: Vec<u64> = frozen_banks
.keys()
.cloned()
.filter(|s| *s >= forks.root())
.collect();
let next_slots = blockstore
.get_slots_since(&frozen_bank_slots)
.expect("Db error");
@@ -1419,7 +1441,9 @@ pub(crate) mod tests {
let exit = Arc::new(AtomicBool::new(false));
let subscriptions = Arc::new(RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::default())),
Arc::new(RwLock::new(BlockCommitmentCache::default_with_blockstore(
blockstore.clone(),
))),
));
let bank_forks = BankForks::new(0, bank0);
bank_forks.working_bank().freeze();
@@ -1472,12 +1496,58 @@ pub(crate) mod tests {
for i in 0..=root {
progress.insert(i, ForkProgress::new(Hash::default()));
}
ReplayStage::handle_new_root(root, &bank_forks, &mut progress, &None);
ReplayStage::handle_new_root(root, &bank_forks, &mut progress, &None, None);
assert_eq!(bank_forks.read().unwrap().root(), root);
assert_eq!(progress.len(), 1);
assert!(progress.get(&root).is_some());
}
#[test]
fn test_handle_new_root_ahead_of_largest_confirmed_root() {
let genesis_config = create_genesis_config(10_000).genesis_config;
let bank0 = Bank::new(&genesis_config);
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank0)));
let confirmed_root = 1;
let fork = 2;
let bank1 = Bank::new_from_parent(
bank_forks.read().unwrap().get(0).unwrap(),
&Pubkey::default(),
confirmed_root,
);
bank_forks.write().unwrap().insert(bank1);
let bank2 = Bank::new_from_parent(
bank_forks.read().unwrap().get(confirmed_root).unwrap(),
&Pubkey::default(),
fork,
);
bank_forks.write().unwrap().insert(bank2);
let root = 3;
let root_bank = Bank::new_from_parent(
bank_forks.read().unwrap().get(confirmed_root).unwrap(),
&Pubkey::default(),
root,
);
bank_forks.write().unwrap().insert(root_bank);
let mut progress = HashMap::new();
for i in 0..=root {
progress.insert(i, ForkProgress::new(Hash::default()));
}
ReplayStage::handle_new_root(
root,
&bank_forks,
&mut progress,
&None,
Some(confirmed_root),
);
assert_eq!(bank_forks.read().unwrap().root(), root);
assert!(bank_forks.read().unwrap().get(confirmed_root).is_some());
assert!(bank_forks.read().unwrap().get(fork).is_none());
assert_eq!(progress.len(), 2);
assert!(progress.get(&root).is_some());
assert!(progress.get(&confirmed_root).is_some());
assert!(progress.get(&fork).is_none());
}
#[test]
fn test_dead_fork_transaction_error() {
let keypair1 = Keypair::new();
@@ -1745,7 +1815,11 @@ pub(crate) mod tests {
bank.store_account(&pubkey, &leader_vote_account);
}
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let (lockouts_sender, _) = AggregateCommitmentService::new(
&Arc::new(AtomicBool::new(false)),
block_commitment_cache.clone(),

View File

@@ -9,7 +9,7 @@ use crate::{
validator::ValidatorExit,
};
use bincode::serialize;
use jsonrpc_core::{Error, Metadata, Result};
use jsonrpc_core::{Error, ErrorCode, Metadata, Result};
use jsonrpc_derive::rpc;
use solana_client::rpc_response::*;
use solana_faucet::faucet::request_airdrop_transaction;
@@ -31,6 +31,7 @@ use solana_transaction_status::{
};
use solana_vote_program::vote_state::{VoteState, MAX_LOCKOUT_HISTORY};
use std::{
cmp::max,
collections::HashMap,
net::{SocketAddr, UdpSocket},
str::FromStr,
@@ -39,6 +40,7 @@ use std::{
time::{Duration, Instant},
};
const JSON_RPC_SERVER_ERROR_0: i64 = -32000;
const MAX_QUERY_ITEMS: usize = 256;
const MAX_SLOT_RANGE: u64 = 10_000;
@@ -78,17 +80,32 @@ pub struct JsonRpcRequestProcessor {
}
impl JsonRpcRequestProcessor {
fn bank(&self, commitment: Option<CommitmentConfig>) -> Arc<Bank> {
fn bank(&self, commitment: Option<CommitmentConfig>) -> Result<Arc<Bank>> {
debug!("RPC commitment_config: {:?}", commitment);
let r_bank_forks = self.bank_forks.read().unwrap();
if commitment.is_some() && commitment.unwrap().commitment == CommitmentLevel::Recent {
let bank = r_bank_forks.working_bank();
debug!("RPC using working_bank: {:?}", bank.slot());
bank
Ok(bank)
} else {
let slot = r_bank_forks.root();
debug!("RPC using block: {:?}", slot);
r_bank_forks.get(slot).cloned().unwrap()
let cluster_root = self
.block_commitment_cache
.read()
.unwrap()
.largest_confirmed_root();
debug!("RPC using block: {:?}", cluster_root);
r_bank_forks
.get(cluster_root)
.cloned()
.ok_or_else(|| Error {
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_0),
message: format!(
"Cluster largest_confirmed_root {} does not exist on node. Node root: {}",
cluster_root,
r_bank_forks.root(),
),
data: None,
})
}
}
@@ -115,7 +132,7 @@ impl JsonRpcRequestProcessor {
pubkey: Result<Pubkey>,
commitment: Option<CommitmentConfig>,
) -> RpcResponse<Option<RpcAccount>> {
let bank = &*self.bank(commitment);
let bank = &*self.bank(commitment)?;
pubkey.and_then(|key| new_response(bank, bank.get_account(&key).map(RpcAccount::encode)))
}
@@ -125,7 +142,7 @@ impl JsonRpcRequestProcessor {
commitment: Option<CommitmentConfig>,
) -> Result<u64> {
Ok(self
.bank(commitment)
.bank(commitment)?
.get_minimum_balance_for_rent_exemption(data_len))
}
@@ -135,7 +152,7 @@ impl JsonRpcRequestProcessor {
commitment: Option<CommitmentConfig>,
) -> Result<Vec<RpcKeyedAccount>> {
Ok(self
.bank(commitment)
.bank(commitment)?
.get_program_accounts(Some(&program_id))
.into_iter()
.map(|(pubkey, account)| RpcKeyedAccount {
@@ -146,13 +163,13 @@ impl JsonRpcRequestProcessor {
}
pub fn get_inflation(&self, commitment: Option<CommitmentConfig>) -> Result<Inflation> {
Ok(self.bank(commitment).inflation())
Ok(self.bank(commitment)?.inflation())
}
pub fn get_epoch_schedule(&self) -> Result<EpochSchedule> {
// Since epoch schedule data comes from the genesis config, any commitment level should be
// fine
Ok(*self.bank(None).epoch_schedule())
Ok(*self.bank(None)?.epoch_schedule())
}
pub fn get_balance(
@@ -160,7 +177,7 @@ impl JsonRpcRequestProcessor {
pubkey: Result<Pubkey>,
commitment: Option<CommitmentConfig>,
) -> RpcResponse<u64> {
let bank = &*self.bank(commitment);
let bank = &*self.bank(commitment)?;
pubkey.and_then(|key| new_response(bank, bank.get_balance(&key)))
}
@@ -168,7 +185,7 @@ impl JsonRpcRequestProcessor {
&self,
commitment: Option<CommitmentConfig>,
) -> RpcResponse<RpcBlockhashFeeCalculator> {
let bank = &*self.bank(commitment);
let bank = &*self.bank(commitment)?;
let (blockhash, fee_calculator) = bank.confirmed_last_blockhash();
new_response(
bank,
@@ -183,7 +200,7 @@ impl JsonRpcRequestProcessor {
&self,
blockhash: &Hash,
) -> RpcResponse<Option<RpcFeeCalculator>> {
let bank = &*self.bank(None);
let bank = &*self.bank(None)?;
let fee_calculator = bank.get_fee_calculator(blockhash);
new_response(
bank,
@@ -192,7 +209,7 @@ impl JsonRpcRequestProcessor {
}
fn get_fee_rate_governor(&self) -> RpcResponse<RpcFeeRateGovernor> {
let bank = &*self.bank(None);
let bank = &*self.bank(None)?;
let fee_rate_governor = bank.get_fee_rate_governor();
new_response(
bank,
@@ -207,7 +224,7 @@ impl JsonRpcRequestProcessor {
signature: Result<Signature>,
commitment: Option<CommitmentConfig>,
) -> RpcResponse<bool> {
let bank = &*self.bank(commitment);
let bank = &*self.bank(commitment)?;
match signature {
Err(e) => Err(e),
Ok(sig) => {
@@ -231,11 +248,11 @@ impl JsonRpcRequestProcessor {
}
fn get_slot(&self, commitment: Option<CommitmentConfig>) -> Result<u64> {
Ok(self.bank(commitment).slot())
Ok(self.bank(commitment)?.slot())
}
fn get_slot_leader(&self, commitment: Option<CommitmentConfig>) -> Result<String> {
Ok(self.bank(commitment).collector_id().to_string())
Ok(self.bank(commitment)?.collector_id().to_string())
}
fn minimum_ledger_slot(&self) -> Result<Slot> {
@@ -252,18 +269,18 @@ impl JsonRpcRequestProcessor {
}
fn get_transaction_count(&self, commitment: Option<CommitmentConfig>) -> Result<u64> {
Ok(self.bank(commitment).transaction_count() as u64)
Ok(self.bank(commitment)?.transaction_count() as u64)
}
fn get_total_supply(&self, commitment: Option<CommitmentConfig>) -> Result<u64> {
Ok(self.bank(commitment).capitalization())
Ok(self.bank(commitment)?.capitalization())
}
fn get_vote_accounts(
&self,
commitment: Option<CommitmentConfig>,
) -> Result<RpcVoteAccountStatus> {
let bank = self.bank(commitment);
let bank = self.bank(commitment)?;
let vote_accounts = bank.vote_accounts();
let epoch_vote_accounts = bank
.epoch_vote_accounts(bank.get_epoch_and_slot_index(bank.slot()).0)
@@ -325,7 +342,7 @@ impl JsonRpcRequestProcessor {
}
fn get_slots_per_segment(&self, commitment: Option<CommitmentConfig>) -> Result<u64> {
Ok(self.bank(commitment).slots_per_segment())
Ok(self.bank(commitment)?.slots_per_segment())
}
fn get_storage_pubkeys_for_slot(&self, slot: Slot) -> Result<Vec<String>> {
@@ -375,13 +392,17 @@ impl JsonRpcRequestProcessor {
start_slot: Slot,
end_slot: Option<Slot>,
) -> Result<Vec<Slot>> {
let end_slot = end_slot.unwrap_or_else(|| self.bank(None).slot());
let end_slot = if let Some(end_slot) = end_slot {
end_slot
} else {
self.bank(None)?.slot()
};
if end_slot < start_slot {
return Ok(vec![]);
}
Ok(self
.blockstore
.rooted_slot_iterator(start_slot)
.rooted_slot_iterator(max(start_slot, self.blockstore.lowest_slot()))
.map_err(|_| Error::internal_error())?
.filter(|&slot| slot <= end_slot)
.collect())
@@ -393,7 +414,7 @@ impl JsonRpcRequestProcessor {
// queried). If these values will be variable in the future, those timing parameters will
// need to be stored persistently, and the slot_duration calculation will likely need to be
// moved upstream into blockstore. Also, an explicit commitment level will need to be set.
let bank = self.bank(None);
let bank = self.bank(None)?;
let slot_duration = slot_duration_from_slots_per_year(bank.slots_per_year());
let epoch = bank.epoch_schedule().get_epoch(slot);
let stakes = HashMap::new();
@@ -411,7 +432,7 @@ impl JsonRpcRequestProcessor {
signature: Signature,
commitment: Option<CommitmentConfig>,
) -> Option<RpcSignatureConfirmation> {
self.get_transaction_status(signature, &self.bank(commitment))
self.get_transaction_status(signature, &self.bank(commitment).ok()?)
.map(
|TransactionStatus {
status,
@@ -429,7 +450,7 @@ impl JsonRpcRequestProcessor {
signature: Signature,
commitment: Option<CommitmentConfig>,
) -> Option<transaction::Result<()>> {
self.bank(commitment).get_signature_status(&signature)
self.bank(commitment).ok()?.get_signature_status(&signature)
}
pub fn get_signature_statuses(
@@ -448,7 +469,7 @@ impl JsonRpcRequestProcessor {
let search_transaction_history = config
.and_then(|x| x.search_transaction_history)
.unwrap_or(false);
let bank = self.bank(commitment);
let bank = self.bank(commitment)?;
for signature in signatures {
let status = if let Some(status) = self.get_transaction_status(signature, &bank) {
@@ -943,7 +964,7 @@ impl RpcSol for RpcSolImpl {
meta: Self::Metadata,
commitment: Option<CommitmentConfig>,
) -> Result<RpcEpochInfo> {
let bank = meta.request_processor.read().unwrap().bank(commitment);
let bank = meta.request_processor.read().unwrap().bank(commitment)?;
let epoch_schedule = bank.epoch_schedule();
let slot = bank.slot();
@@ -979,7 +1000,7 @@ impl RpcSol for RpcSolImpl {
slot: Option<Slot>,
commitment: Option<CommitmentConfig>,
) -> Result<Option<RpcLeaderSchedule>> {
let bank = meta.request_processor.read().unwrap().bank(commitment);
let bank = meta.request_processor.read().unwrap().bank(commitment)?;
let slot = slot.unwrap_or_else(|| bank.slot());
let epoch = bank.epoch_schedule().get_epoch(slot);
@@ -1143,7 +1164,7 @@ impl RpcSol for RpcSolImpl {
.request_processor
.read()
.unwrap()
.bank(commitment.clone())
.bank(commitment.clone())?
.confirmed_last_blockhash()
.0;
let transaction = request_airdrop_transaction(&faucet_addr, &pubkey, lamports, blockhash)
@@ -1490,8 +1511,10 @@ pub mod tests {
.or_insert(commitment_slot1.clone());
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::new(
block_commitment,
0,
10,
bank.clone(),
blockstore.clone(),
0,
)));
@@ -1523,15 +1546,13 @@ pub mod tests {
let mut roots = blockstore_roots.clone();
if !roots.is_empty() {
roots.retain(|&x| x > 1);
roots.retain(|&x| x > 0);
let mut parent_bank = bank;
for (i, root) in roots.iter().enumerate() {
let new_bank =
Bank::new_from_parent(&parent_bank, parent_bank.collector_id(), *root);
parent_bank = bank_forks.write().unwrap().insert(new_bank);
parent_bank.squash();
bank_forks.write().unwrap().set_root(*root, &None);
let parent = if i > 0 { roots[i - 1] } else { 1 };
let parent = if i > 0 { roots[i - 1] } else { 0 };
fill_blockstore_slot_with_ticks(&blockstore, 5, *root, parent, Hash::default());
}
blockstore.set_roots(&roots).unwrap();
@@ -1541,6 +1562,10 @@ pub mod tests {
roots.iter().max().unwrap() + 1,
);
bank_forks.write().unwrap().insert(new_bank);
for root in roots.iter() {
bank_forks.write().unwrap().set_root(*root, &None, Some(0));
}
}
let bank = bank_forks.read().unwrap().working_bank();
@@ -1609,14 +1634,16 @@ pub mod tests {
let validator_exit = create_validator_exit(&exit);
let (bank_forks, alice, _) = new_bank_forks();
let bank = bank_forks.read().unwrap().working_bank();
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&ledger_path).unwrap();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let request_processor = JsonRpcRequestProcessor::new(
JsonRpcConfig::default(),
bank_forks,
block_commitment_cache,
Arc::new(blockstore),
blockstore,
StorageState::default(),
validator_exit,
);
@@ -2088,7 +2115,7 @@ pub mod tests {
.expect("actual response deserialization");
let result = result.as_ref().unwrap();
assert_eq!(expected_res, result.status);
assert_eq!(Some(2), result.confirmations);
assert_eq!(None, result.confirmations);
// Test getSignatureStatus request on unprocessed tx
let tx = system_transaction::transfer(&alice, &bob_pubkey, 10, blockhash);
@@ -2252,9 +2279,11 @@ pub mod tests {
fn test_rpc_send_bad_tx() {
let exit = Arc::new(AtomicBool::new(false));
let validator_exit = create_validator_exit(&exit);
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&ledger_path).unwrap();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let mut io = MetaIoHandler::default();
let rpc = RpcSolImpl;
@@ -2265,7 +2294,7 @@ pub mod tests {
JsonRpcConfig::default(),
new_bank_forks().0,
block_commitment_cache,
Arc::new(blockstore),
blockstore,
StorageState::default(),
validator_exit,
);
@@ -2355,14 +2384,16 @@ pub mod tests {
fn test_rpc_request_processor_config_default_trait_validator_exit_fails() {
let exit = Arc::new(AtomicBool::new(false));
let validator_exit = create_validator_exit(&exit);
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&ledger_path).unwrap();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let request_processor = JsonRpcRequestProcessor::new(
JsonRpcConfig::default(),
new_bank_forks().0,
block_commitment_cache,
Arc::new(blockstore),
blockstore,
StorageState::default(),
validator_exit,
);
@@ -2374,16 +2405,18 @@ pub mod tests {
fn test_rpc_request_processor_allow_validator_exit_config() {
let exit = Arc::new(AtomicBool::new(false));
let validator_exit = create_validator_exit(&exit);
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&ledger_path).unwrap();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let mut config = JsonRpcConfig::default();
config.enable_validator_exit = true;
let request_processor = JsonRpcRequestProcessor::new(
config,
new_bank_forks().0,
block_commitment_cache,
Arc::new(blockstore),
blockstore,
StorageState::default(),
validator_exit,
);
@@ -2438,6 +2471,8 @@ pub mod tests {
let exit = Arc::new(AtomicBool::new(false));
let validator_exit = create_validator_exit(&exit);
let bank_forks = new_bank_forks().0;
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let commitment_slot0 = BlockCommitment::new([8; MAX_LOCKOUT_HISTORY + 1]);
let commitment_slot1 = BlockCommitment::new([9; MAX_LOCKOUT_HISTORY + 1]);
@@ -2450,12 +2485,12 @@ pub mod tests {
.or_insert(commitment_slot1.clone());
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::new(
block_commitment,
0,
42,
bank_forks.read().unwrap().working_bank(),
blockstore.clone(),
0,
)));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&ledger_path).unwrap();
let mut config = JsonRpcConfig::default();
config.enable_validator_exit = true;
@@ -2463,7 +2498,7 @@ pub mod tests {
config,
bank_forks,
block_commitment_cache,
Arc::new(blockstore),
blockstore,
StorageState::default(),
validator_exit,
);
@@ -2647,8 +2682,16 @@ pub mod tests {
fn test_get_confirmed_blocks() {
let bob_pubkey = Pubkey::new_rand();
let roots = vec![0, 1, 3, 4, 8];
let RpcHandler { io, meta, .. } =
start_rpc_handler_with_tx_and_blockstore(&bob_pubkey, roots.clone(), 0);
let RpcHandler {
io,
meta,
block_commitment_cache,
..
} = start_rpc_handler_with_tx_and_blockstore(&bob_pubkey, roots.clone(), 0);
block_commitment_cache
.write()
.unwrap()
.set_get_largest_confirmed_root(8);
let req =
format!(r#"{{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[0]}}"#);
@@ -2656,7 +2699,7 @@ pub mod tests {
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, roots);
assert_eq!(confirmed_blocks, roots[1..].to_vec());
let req =
format!(r#"{{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[2]}}"#);
@@ -2672,7 +2715,7 @@ pub mod tests {
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, vec![0, 1, 3, 4]);
assert_eq!(confirmed_blocks, vec![1, 3, 4]);
let req =
format!(r#"{{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[0, 7]}}"#);
@@ -2680,7 +2723,7 @@ pub mod tests {
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, vec![0, 1, 3, 4]);
assert_eq!(confirmed_blocks, vec![1, 3, 4]);
let req =
format!(r#"{{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[9, 11]}}"#);

View File

@@ -7,8 +7,13 @@ use jsonrpc_pubsub::{typed::Subscriber, Session, SubscriptionId};
use solana_client::rpc_response::{
Response as RpcResponse, RpcAccount, RpcKeyedAccount, RpcSignatureResult,
};
#[cfg(test)]
use solana_ledger::blockstore::Blockstore;
use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature};
use std::sync::{atomic, Arc};
use std::{
str::FromStr,
sync::{atomic, Arc},
};
// Suppress needless_return due to
// https://github.com/paritytech/jsonrpc/blob/2d38e6424d8461cdf72e78425ce67d51af9c6586/derive/src/lib.rs#L204
@@ -118,7 +123,6 @@ pub trait RpcSolPubSub {
fn root_unsubscribe(&self, meta: Option<Self::Metadata>, id: SubscriptionId) -> Result<bool>;
}
#[derive(Default)]
pub struct RpcSolPubSubImpl {
uid: Arc<atomic::AtomicUsize>,
subscriptions: Arc<RpcSubscriptions>,
@@ -129,9 +133,14 @@ impl RpcSolPubSubImpl {
let uid = Arc::new(atomic::AtomicUsize::default());
Self { uid, subscriptions }
}
}
use std::str::FromStr;
#[cfg(test)]
fn default_with_blockstore(blockstore: Arc<Blockstore>) -> Self {
let uid = Arc::new(atomic::AtomicUsize::default());
let subscriptions = Arc::new(RpcSubscriptions::default_with_blockstore(blockstore));
Self { uid, subscriptions }
}
}
fn param<T: FromStr>(param_str: &str, thing: &str) -> Result<T> {
param_str.parse::<T>().map_err(|_e| Error {
@@ -323,7 +332,7 @@ mod tests {
use jsonrpc_pubsub::{PubSubHandler, Session};
use serial_test_derive::serial;
use solana_budget_program::{self, budget_instruction};
use solana_ledger::bank_forks::BankForks;
use solana_ledger::{bank_forks::BankForks, get_tmp_ledger_path};
use solana_runtime::bank::Bank;
use solana_sdk::{
pubkey::Pubkey,
@@ -370,12 +379,16 @@ mod tests {
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let rpc = RpcSolPubSubImpl {
subscriptions: Arc::new(RpcSubscriptions::new(
&Arc::new(AtomicBool::new(false)),
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
)),
..RpcSolPubSubImpl::default()
uid: Arc::new(atomic::AtomicUsize::default()),
};
// Test signature subscriptions
@@ -416,11 +429,13 @@ mod tests {
let bank = Bank::new(&genesis_config);
let arc_bank = Arc::new(bank);
let blockhash = arc_bank.last_blockhash();
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let session = create_session();
let mut io = PubSubHandler::default();
let rpc = RpcSolPubSubImpl::default();
let rpc = RpcSolPubSubImpl::default_with_blockstore(blockstore);
io.extend_with(rpc.to_delegate());
let tx = system_transaction::transfer(&alice, &bob_pubkey, 20, blockhash);
@@ -475,13 +490,17 @@ mod tests {
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let rpc = RpcSolPubSubImpl {
subscriptions: Arc::new(RpcSubscriptions::new(
&Arc::new(AtomicBool::new(false)),
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
)),
..RpcSolPubSubImpl::default()
uid: Arc::new(atomic::AtomicUsize::default()),
};
let session = create_session();
let (subscriber, _id_receiver, receiver) = Subscriber::new_test("accountNotification");
@@ -569,9 +588,11 @@ mod tests {
fn test_account_unsubscribe() {
let bob_pubkey = Pubkey::new_rand();
let session = create_session();
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let mut io = PubSubHandler::default();
let rpc = RpcSolPubSubImpl::default();
let rpc = RpcSolPubSubImpl::default_with_blockstore(blockstore);
io.extend_with(rpc.to_delegate());
@@ -615,13 +636,17 @@ mod tests {
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let bob = Keypair::new();
let mut rpc = RpcSolPubSubImpl::default();
let mut rpc = RpcSolPubSubImpl::default_with_blockstore(blockstore.clone());
let exit = Arc::new(AtomicBool::new(false));
let subscriptions = RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
);
rpc.subscriptions = Arc::new(subscriptions);
let session = create_session();
@@ -652,11 +677,15 @@ mod tests {
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let bob = Keypair::new();
let mut rpc = RpcSolPubSubImpl::default();
let mut rpc = RpcSolPubSubImpl::default_with_blockstore(blockstore.clone());
let exit = Arc::new(AtomicBool::new(false));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests()));
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore.clone()),
));
let subscriptions = RpcSubscriptions::new(&exit, block_commitment_cache.clone());
rpc.subscriptions = Arc::new(subscriptions);
@@ -683,8 +712,14 @@ mod tests {
cache0.increase_confirmation_stake(1, 10);
let mut block_commitment = HashMap::new();
block_commitment.entry(0).or_insert(cache0.clone());
let mut new_block_commitment =
BlockCommitmentCache::new(block_commitment, 10, bank1.clone(), 0);
let mut new_block_commitment = BlockCommitmentCache::new(
block_commitment,
0,
10,
bank1.clone(),
blockstore.clone(),
0,
);
let mut w_block_commitment_cache = block_commitment_cache.write().unwrap();
std::mem::swap(&mut *w_block_commitment_cache, &mut new_block_commitment);
drop(w_block_commitment_cache);
@@ -698,7 +733,8 @@ mod tests {
cache0.increase_confirmation_stake(2, 10);
let mut block_commitment = HashMap::new();
block_commitment.entry(0).or_insert(cache0.clone());
let mut new_block_commitment = BlockCommitmentCache::new(block_commitment, 10, bank2, 0);
let mut new_block_commitment =
BlockCommitmentCache::new(block_commitment, 0, 10, bank2, blockstore.clone(), 0);
let mut w_block_commitment_cache = block_commitment_cache.write().unwrap();
std::mem::swap(&mut *w_block_commitment_cache, &mut new_block_commitment);
drop(w_block_commitment_cache);
@@ -728,7 +764,9 @@ mod tests {
#[test]
#[serial]
fn test_slot_subscribe() {
let rpc = RpcSolPubSubImpl::default();
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let rpc = RpcSolPubSubImpl::default_with_blockstore(blockstore);
let session = create_session();
let (subscriber, _id_receiver, receiver) = Subscriber::new_test("slotNotification");
rpc.slot_subscribe(session, subscriber);
@@ -753,7 +791,9 @@ mod tests {
#[test]
#[serial]
fn test_slot_unsubscribe() {
let rpc = RpcSolPubSubImpl::default();
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let rpc = RpcSolPubSubImpl::default_with_blockstore(blockstore);
let session = create_session();
let (subscriber, _id_receiver, receiver) = Subscriber::new_test("slotNotification");
rpc.slot_subscribe(session, subscriber);

View File

@@ -73,6 +73,7 @@ impl PubSubService {
mod tests {
use super::*;
use crate::commitment::BlockCommitmentCache;
use solana_ledger::{blockstore::Blockstore, get_tmp_ledger_path};
use std::{
net::{IpAddr, Ipv4Addr},
sync::RwLock,
@@ -82,9 +83,13 @@ mod tests {
fn test_pubsub_new() {
let pubsub_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0);
let exit = Arc::new(AtomicBool::new(false));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let subscriptions = Arc::new(RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
));
let pubsub_service = PubSubService::new(&subscriptions, pubsub_addr, &exit);
let thread = pubsub_service.thread_hdl.thread();

View File

@@ -361,16 +361,18 @@ mod tests {
solana_net_utils::find_available_port_in_range(ip_addr, (10000, 65535)).unwrap(),
);
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank.slot(), bank)));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Blockstore::open(&ledger_path).unwrap();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let mut rpc_service = JsonRpcService::new(
rpc_addr,
JsonRpcConfig::default(),
None,
bank_forks,
block_commitment_cache,
Arc::new(blockstore),
blockstore,
cluster_info,
Hash::default(),
&PathBuf::from("farf"),

View File

@@ -11,7 +11,7 @@ use serde::Serialize;
use solana_client::rpc_response::{
Response, RpcAccount, RpcKeyedAccount, RpcResponseContext, RpcSignatureResult,
};
use solana_ledger::bank_forks::BankForks;
use solana_ledger::{bank_forks::BankForks, blockstore::Blockstore};
use solana_runtime::bank::Bank;
use solana_sdk::{
account::Account, clock::Slot, pubkey::Pubkey, signature::Signature, transaction,
@@ -246,15 +246,6 @@ pub struct RpcSubscriptions {
exit: Arc<AtomicBool>,
}
impl Default for RpcSubscriptions {
fn default() -> Self {
Self::new(
&Arc::new(AtomicBool::new(false)),
Arc::new(RwLock::new(BlockCommitmentCache::default())),
)
}
}
impl Drop for RpcSubscriptions {
fn drop(&mut self) {
self.shutdown().unwrap_or_else(|err| {
@@ -324,6 +315,15 @@ impl RpcSubscriptions {
}
}
pub fn default_with_blockstore(blockstore: Arc<Blockstore>) -> Self {
Self::new(
&Arc::new(AtomicBool::new(false)),
Arc::new(RwLock::new(BlockCommitmentCache::default_with_blockstore(
blockstore,
))),
)
}
fn check_account(
pubkey: &Pubkey,
bank_forks: &Arc<RwLock<BankForks>>,
@@ -624,6 +624,7 @@ pub(crate) mod tests {
use jsonrpc_pubsub::typed::Subscriber;
use serial_test_derive::serial;
use solana_budget_program;
use solana_ledger::get_tmp_ledger_path;
use solana_sdk::{
signature::{Keypair, Signer},
system_transaction,
@@ -664,6 +665,8 @@ pub(crate) mod tests {
mint_keypair,
..
} = create_genesis_config(100);
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
@@ -690,7 +693,9 @@ pub(crate) mod tests {
let exit = Arc::new(AtomicBool::new(false));
let subscriptions = RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
);
subscriptions.add_account_subscription(alice.pubkey(), None, sub_id.clone(), subscriber);
@@ -737,6 +742,8 @@ pub(crate) mod tests {
mint_keypair,
..
} = create_genesis_config(100);
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
@@ -763,7 +770,9 @@ pub(crate) mod tests {
let exit = Arc::new(AtomicBool::new(false));
let subscriptions = RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
);
subscriptions.add_program_subscription(
solana_budget_program::id(),
@@ -818,6 +827,8 @@ pub(crate) mod tests {
mint_keypair,
..
} = create_genesis_config(100);
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let mut bank_forks = BankForks::new(0, bank);
@@ -856,7 +867,8 @@ pub(crate) mod tests {
let mut block_commitment = HashMap::new();
block_commitment.entry(0).or_insert(cache0.clone());
block_commitment.entry(1).or_insert(cache1.clone());
let block_commitment_cache = BlockCommitmentCache::new(block_commitment, 10, bank1, 0);
let block_commitment_cache =
BlockCommitmentCache::new(block_commitment, 0, 10, bank1, blockstore, 0);
let exit = Arc::new(AtomicBool::new(false));
let subscriptions =
@@ -959,9 +971,13 @@ pub(crate) mod tests {
Subscriber::new_test("slotNotification");
let sub_id = SubscriptionId::Number(0 as u64);
let exit = Arc::new(AtomicBool::new(false));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let subscriptions = RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
);
subscriptions.add_slot_subscription(sub_id.clone(), subscriber);
@@ -1001,9 +1017,13 @@ pub(crate) mod tests {
Subscriber::new_test("rootNotification");
let sub_id = SubscriptionId::Number(0 as u64);
let exit = Arc::new(AtomicBool::new(false));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let subscriptions = RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::new_for_tests())),
Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_blockstore(blockstore),
)),
);
subscriptions.add_root_subscription(sub_id.clone(), subscriber);

View File

@@ -663,6 +663,7 @@ mod tests {
use super::*;
use crate::genesis_utils::{create_genesis_config, GenesisConfigInfo};
use rayon::prelude::*;
use solana_ledger::get_tmp_ledger_path;
use solana_runtime::bank::Bank;
use solana_sdk::{
hash::Hasher,
@@ -690,7 +691,11 @@ mod tests {
&[bank.clone()],
vec![0],
)));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore),
));
let (_slot_sender, slot_receiver) = channel();
let storage_state = StorageState::new(
&bank.last_blockhash(),

View File

@@ -301,7 +301,9 @@ pub mod tests {
let voting_keypair = Keypair::new();
let storage_keypair = Arc::new(Keypair::new());
let leader_schedule_cache = Arc::new(LeaderScheduleCache::new_from_bank(&bank));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let tvu = Tvu::new(
&voting_keypair.pubkey(),
Some(Arc::new(voting_keypair)),
@@ -320,10 +322,7 @@ pub mod tests {
&StorageState::default(),
None,
l_receiver,
&Arc::new(RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::default())),
)),
&Arc::new(RpcSubscriptions::new(&exit, block_commitment_cache.clone())),
&poh_recorder,
&leader_schedule_cache,
&exit,

View File

@@ -202,7 +202,6 @@ impl Validator {
}
let bank_forks = Arc::new(RwLock::new(bank_forks));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let mut validator_exit = ValidatorExit::default();
let exit_ = exit.clone();
@@ -238,6 +237,9 @@ impl Validator {
);
let blockstore = Arc::new(blockstore);
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let subscriptions = Arc::new(RpcSubscriptions::new(&exit, block_commitment_cache.clone()));

View File

@@ -137,7 +137,7 @@ mod tests {
// and to allow snapshotting of bank and the purging logic on status_cache to
// kick in
if slot % set_root_interval == 0 || slot == last_slot - 1 {
bank_forks.set_root(bank.slot(), &sender);
bank_forks.set_root(bank.slot(), &sender, None);
}
}
// Generate a snapshot package for last bank
@@ -377,9 +377,11 @@ mod tests {
snapshot_test_config.bank_forks.insert(new_bank);
current_bank = snapshot_test_config.bank_forks[new_slot].clone();
}
snapshot_test_config
.bank_forks
.set_root(current_bank.slot(), &snapshot_sender);
snapshot_test_config.bank_forks.set_root(
current_bank.slot(),
&snapshot_sender,
None,
);
}
let num_old_slots = num_set_roots * *add_root_interval - MAX_CACHE_ENTRIES + 1;

View File

@@ -6,6 +6,7 @@ use solana_core::{
commitment::BlockCommitmentCache, rpc_pubsub_service::PubSubService,
rpc_subscriptions::RpcSubscriptions, validator::TestValidator,
};
use solana_ledger::{blockstore::Blockstore, get_tmp_ledger_path};
use solana_sdk::{
commitment_config::CommitmentConfig, pubkey::Pubkey, rpc_port, signature::Signer,
system_transaction,
@@ -85,9 +86,13 @@ fn test_slot_subscription() {
rpc_port::DEFAULT_RPC_PUBSUB_PORT,
);
let exit = Arc::new(AtomicBool::new(false));
let ledger_path = get_tmp_ledger_path!();
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
let subscriptions = Arc::new(RpcSubscriptions::new(
&exit,
Arc::new(RwLock::new(BlockCommitmentCache::default())),
Arc::new(RwLock::new(BlockCommitmentCache::default_with_blockstore(
blockstore,
))),
));
let pubsub_service = PubSubService::new(&subscriptions, pubsub_addr, &exit);
std::thread::sleep(Duration::from_millis(400));

View File

@@ -59,7 +59,9 @@ mod tests {
&[bank.clone()],
vec![0],
)));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let cluster_info = test_cluster_info(&keypair.pubkey());
let (bank_sender, bank_receiver) = channel();
@@ -180,7 +182,9 @@ mod tests {
&[bank.clone()],
vec![0],
)));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let cluster_info = test_cluster_info(&keypair.pubkey());
let (bank_sender, bank_receiver) = channel();

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-crate-features"
version = "1.0.19"
version = "1.0.20"
description = "Solana Crate Features"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,16 +12,16 @@ edition = "2018"
backtrace = { version = "0.3.33", features = ["serialize-serde"] }
bytes = { version = "0.4.12", features = ["either"] }
cc = { version = "1.0.45", features = ["jobserver", "num_cpus", "parallel"]}
curve25519-dalek = { version = "1.1.3" }
curve25519-dalek = { version = "2" }
either= { version = "1.5.2" }
failure = { version = "0.1.5" }
lazy_static = { version = "1.4.0", features = ["spin", "spin_no_std"] }
libc = { version = "0.2.62", features = ["extra_traits"] }
rand_chacha = { version = "0.1.1" }
rand_chacha = { version = "0.2.2" }
regex-syntax = { version = "0.6.12" }
reqwest = { version = "0.9.20", default-features = false, features = ["rustls-tls"] }
serde = { version = "1.0.100", features = ["rc"] }
ed25519-dalek = { version = "=1.0.0-pre.1", features = ["serde"] }
ed25519-dalek = { version = "=1.0.0-pre.3", features = ["serde"] }
syn_0_15 = { package = "syn", version = "0.15.42", features = ["extra-traits", "fold", "full"] }
syn_1_0 = { package = "syn", version = "1.0.3", features = ["extra-traits", "fold", "full"] }
tokio = { version = "0.1.22",features=["bytes", "codec", "default", "fs", "io", "mio", "num_cpus", "reactor", "rt-full", "sync", "tcp", "timer", "tokio-codec", "tokio-current-thread", "tokio-executor", "tokio-io", "tokio-io", "tokio-reactor", "tokio-tcp", "tokio-tcp", "tokio-threadpool", "tokio-timer", "tokio-udp", "tokio-uds", "udp", "uds"] }

View File

@@ -318,7 +318,7 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0","id":1,"m
#### Transaction Structure
Transactions are quite different from those on other blockchains. Be sure to review [Anatomy of a Transaction](transaction.md) to learn about transactions on Solana.
Transactions are quite different from those on other blockchains. Be sure to review [Anatomy of a Transaction](../transaction.md) to learn about transactions on Solana.
The JSON structure of a transaction is defined as follows:
@@ -975,7 +975,7 @@ The result field will be a JSON object with the following fields:
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getVersion"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":{"solana-core": "1.0.19"},"id":1}
{"jsonrpc":"2.0","result":{"solana-core": "1.0.20"},"id":1}
```
### getVoteAccounts

View File

@@ -171,7 +171,7 @@ $ solana send-timestamp <PUBKEY> <PROCESS_ID> --date 2018-12-24T23:59:00
## Usage
### solana-cli
```text
solana-cli 1.0.19 [channel=unknown commit=unknown]
solana-cli 1.0.20 [channel=unknown commit=unknown]
Blockchain, Rebuilt for Scale
USAGE:

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-faucet"
version = "1.0.19"
version = "1.0.20"
description = "Solana Faucet"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -19,10 +19,10 @@ clap = "2.33"
log = "0.4.8"
serde = "1.0.104"
serde_derive = "1.0.103"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
tokio = "0.1"
tokio-codec = "0.1"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-genesis-programs"
version = "1.0.19"
version = "1.0.20"
description = "Solana genesis programs"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,16 +10,16 @@ edition = "2018"
[dependencies]
log = { version = "0.4.8" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.0.19" }
solana-budget-program = { path = "../programs/budget", version = "1.0.19" }
solana-config-program = { path = "../programs/config", version = "1.0.19" }
solana-exchange-program = { path = "../programs/exchange", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-storage-program = { path = "../programs/storage", version = "1.0.19" }
solana-vest-program = { path = "../programs/vest", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.0.20" }
solana-budget-program = { path = "../programs/budget", version = "1.0.20" }
solana-config-program = { path = "../programs/config", version = "1.0.20" }
solana-exchange-program = { path = "../programs/exchange", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
solana-storage-program = { path = "../programs/storage", version = "1.0.20" }
solana-vest-program = { path = "../programs/vest", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
[lib]
crate-type = ["lib"]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-genesis"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -15,13 +15,13 @@ chrono = "0.4"
serde = "1.0.104"
serde_json = "1.0.46"
serde_yaml = "0.8.11"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-genesis-programs = { path = "../genesis-programs", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-storage-program = { path = "../programs/storage", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-genesis-programs = { path = "../genesis-programs", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
solana-storage-program = { path = "../programs/storage", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
tempfile = "3.1.0"
[[bin]]

View File

@@ -3,19 +3,19 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-gossip"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
[dependencies]
clap = "2.33.0"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-net-utils = { path = "../net-utils", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-net-utils = { path = "../net-utils", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-install"
description = "The solana cluster software installer"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -24,11 +24,11 @@ reqwest = { version = "0.10.1", default-features = false, features = ["blocking"
serde = "1.0.104"
serde_derive = "1.0.103"
serde_yaml = "0.8.11"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-config-program = { path = "../programs/config", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-config-program = { path = "../programs/config", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
semver = "0.9.0"
tar = "0.4.26"
tempdir = "0.3.7"

View File

@@ -581,7 +581,7 @@ pub fn info(config_file: &str, local_info_only: bool) -> Result<Option<UpdateMan
if let Some(explicit_release) = &config.explicit_release {
match explicit_release {
ExplicitRelease::Semver(release_semver) => {
println_name_value(&format!("v{}Release version:", BULLET), &release_semver);
println_name_value(&format!("{}Release version:", BULLET), &release_semver);
println_name_value(
&format!("{}Release URL:", BULLET),
&github_release_download_url(release_semver),

View File

@@ -1,4 +1,3 @@
use atty;
use std::process::exit;
fn press_enter() {

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-keygen"
version = "1.0.19"
version = "1.0.20"
description = "Solana key generation utility"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -13,10 +13,10 @@ bs58 = "0.3.0"
clap = "2.33"
dirs = "2.0.2"
num_cpus = "1.12.0"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-cli-config = { path = "../cli-config", version = "1.0.19" }
solana-remote-wallet = { path = "../remote-wallet", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-cli-config = { path = "../cli-config", version = "1.0.20" }
solana-remote-wallet = { path = "../remote-wallet", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
tiny-bip39 = "0.7.0"
[[bin]]

View File

@@ -1,10 +1,8 @@
use bip39::{Language, Mnemonic, MnemonicType, Seed};
use bs58;
use clap::{
crate_description, crate_name, value_t, values_t_or_exit, App, AppSettings, Arg, ArgMatches,
SubCommand,
};
use num_cpus;
use solana_clap_utils::{
input_validators::is_derivation,
keypair::{

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-ledger-tool"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,13 +14,13 @@ clap = "2.33.0"
histogram = "*"
serde_json = "1.0.46"
serde_yaml = "0.8.11"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
tempfile = "3.1.0"
[dev-dependencies]

View File

@@ -2,7 +2,6 @@ use clap::{
crate_description, crate_name, value_t, value_t_or_exit, values_t_or_exit, App, Arg,
ArgMatches, SubCommand,
};
use histogram;
use serde_json::json;
use solana_clap_utils::input_validators::is_slot;
use solana_ledger::{

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-ledger"
version = "1.0.19"
version = "1.0.20"
description = "Solana ledger"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -21,26 +21,26 @@ itertools = "0.8.2"
libc = "0.2.66"
log = { version = "0.4.8" }
num_cpus = "1.0.0"
rand = "0.6.5"
rand_chacha = "0.1.1"
rand = "0.7.0"
rand_chacha = "0.2.2"
rayon = "1.2.0"
reed-solomon-erasure = { package = "solana-reed-solomon-erasure", version = "4.0.1-3", features = ["simd-accel"] }
regex = "1.3.4"
serde = "1.0.104"
serde_bytes = "0.11.3"
solana-transaction-status = { path = "../transaction-status", version = "1.0.19" }
solana-genesis-programs = { path = "../genesis-programs", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-measure = { path = "../measure", version = "1.0.19" }
solana-merkle-tree = { path = "../merkle-tree", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-perf = { path = "../perf", version = "1.0.19" }
solana-transaction-status = { path = "../transaction-status", version = "1.0.20" }
solana-genesis-programs = { path = "../genesis-programs", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-measure = { path = "../measure", version = "1.0.20" }
solana-merkle-tree = { path = "../merkle-tree", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
solana-perf = { path = "../perf", version = "1.0.20" }
ed25519-dalek = "1.0.0-pre.1"
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
symlink = "0.1.0"
tar = "0.4.26"
thiserror = "1.0"
@@ -50,14 +50,14 @@ lazy_static = "1.4.0"
[dependencies.rocksdb]
# Avoid the vendored bzip2 within rocksdb-sys that can cause linker conflicts
# when also using the bzip2 crate
version = "0.13.0"
version = "0.14.0"
default-features = false
features = ["lz4"]
[dev-dependencies]
assert_matches = "1.3.0"
matches = "0.1.6"
solana-budget-program = { path = "../programs/budget", version = "1.0.19" }
solana-budget-program = { path = "../programs/budget", version = "1.0.20" }
[lib]
crate-type = ["lib"]

View File

@@ -165,6 +165,7 @@ impl BankForks {
&mut self,
root: Slot,
snapshot_package_sender: &Option<SnapshotPackageSender>,
largest_confirmed_root: Option<Slot>,
) {
self.root = root;
let set_root_start = Instant::now();
@@ -205,7 +206,7 @@ impl BankForks {
}
}
self.prune_non_root(root);
self.prune_non_root(root, largest_confirmed_root);
inc_new_counter_info!(
"bank-forks_set_root_ms",
@@ -276,10 +277,19 @@ impl BankForks {
Ok(())
}
fn prune_non_root(&mut self, root: Slot) {
fn prune_non_root(&mut self, root: Slot, largest_confirmed_root: Option<Slot>) {
let descendants = self.descendants();
self.banks
.retain(|slot, _| slot == &root || descendants[&root].contains(slot));
self.banks.retain(|slot, _| {
*slot == root
|| descendants[&root].contains(slot)
|| (*slot < root
&& *slot >= largest_confirmed_root.unwrap_or(root)
&& descendants[slot].contains(&root))
});
datapoint_debug!(
"bank_forks_purge_non_root",
("num_banks_retained", self.banks.len(), i64),
);
}
pub fn set_snapshot_config(&mut self, snapshot_config: Option<SnapshotConfig>) {

View File

@@ -1468,7 +1468,7 @@ impl Blockstore {
}
pub fn get_first_available_block(&self) -> Result<Slot> {
let mut root_iterator = self.rooted_slot_iterator(0)?;
let mut root_iterator = self.rooted_slot_iterator(self.lowest_slot())?;
Ok(root_iterator.next().unwrap_or_default())
}

View File

@@ -1,7 +1,6 @@
use crate::blockstore_meta;
use bincode::{deserialize, serialize};
use byteorder::{BigEndian, ByteOrder};
use fs_extra;
use log::*;
pub use rocksdb::Direction as IteratorDirection;
use rocksdb::{
@@ -247,12 +246,12 @@ impl Rocks {
IteratorMode::Start => RocksIteratorMode::Start,
IteratorMode::End => RocksIteratorMode::End,
};
let iter = self.0.iterator_cf(cf, iterator_mode)?;
let iter = self.0.iterator_cf(cf, iterator_mode);
Ok(iter)
}
fn raw_iterator_cf(&self, cf: &ColumnFamily) -> Result<DBRawIterator> {
let raw_iter = self.0.raw_iterator_cf(cf)?;
let raw_iter = self.0.raw_iterator_cf(cf);
Ok(raw_iter)
}
@@ -783,13 +782,12 @@ where
impl<'a> WriteBatch<'a> {
pub fn put_bytes<C: Column + ColumnName>(&mut self, key: C::Index, bytes: &[u8]) -> Result<()> {
self.write_batch
.put_cf(self.get_cf::<C>(), &C::key(key), bytes)?;
.put_cf(self.get_cf::<C>(), &C::key(key), bytes);
Ok(())
}
pub fn delete<C: Column + ColumnName>(&mut self, key: C::Index) -> Result<()> {
self.write_batch
.delete_cf(self.get_cf::<C>(), &C::key(key))?;
self.write_batch.delete_cf(self.get_cf::<C>(), &C::key(key));
Ok(())
}
@@ -800,7 +798,7 @@ impl<'a> WriteBatch<'a> {
) -> Result<()> {
let serialized_value = serialize(&value)?;
self.write_batch
.put_cf(self.get_cf::<C>(), &C::key(key), &serialized_value)?;
.put_cf(self.get_cf::<C>(), &C::key(key), &serialized_value);
Ok(())
}
@@ -816,7 +814,7 @@ impl<'a> WriteBatch<'a> {
to: C::Index,
) -> Result<()> {
self.write_batch
.delete_range_cf(cf, C::key(from), C::key(to))?;
.delete_range_cf(cf, C::key(from), C::key(to));
Ok(())
}
}
@@ -844,5 +842,9 @@ fn get_db_options() -> Options {
options.create_missing_column_families(true);
// A good value for this is the number of cores on the machine
options.increase_parallelism(num_cpus::get() as i32);
// Set max total wal size to 4G.
options.set_max_total_wal_size(4 * 1024 * 1024 * 1024);
options
}

View File

@@ -1,6 +1,5 @@
use rand::distributions::{Distribution, WeightedIndex};
use rand::SeedableRng;
use rand_chacha::ChaChaRng;
use rand_chacha::{rand_core::SeedableRng, ChaChaRng};
use solana_sdk::pubkey::Pubkey;
use std::ops::Index;
use std::sync::Arc;

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-local-cluster"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -11,24 +11,24 @@ homepage = "https://solana.com/"
[dependencies]
itertools = "0.8.1"
log = "0.4.8"
rand = "0.6.5"
solana-archiver-lib = { path = "../archiver-lib", version = "1.0.19" }
solana-config-program = { path = "../programs/config", version = "1.0.19" }
solana-core = { path = "../core", version = "1.0.19" }
solana-client = { path = "../client", version = "1.0.19" }
solana-faucet = { path = "../faucet", version = "1.0.19" }
solana-exchange-program = { path = "../programs/exchange", version = "1.0.19" }
solana-genesis-programs = { path = "../genesis-programs", version = "1.0.19" }
solana-ledger = { path = "../ledger", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-runtime = { path = "../runtime", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-stake-program = { path = "../programs/stake", version = "1.0.19" }
solana-storage-program = { path = "../programs/storage", version = "1.0.19" }
solana-vest-program = { path = "../programs/vest", version = "1.0.19" }
solana-vote-program = { path = "../programs/vote", version = "1.0.19" }
rand = "0.7.0"
solana-archiver-lib = { path = "../archiver-lib", version = "1.0.20" }
solana-config-program = { path = "../programs/config", version = "1.0.20" }
solana-core = { path = "../core", version = "1.0.20" }
solana-client = { path = "../client", version = "1.0.20" }
solana-faucet = { path = "../faucet", version = "1.0.20" }
solana-exchange-program = { path = "../programs/exchange", version = "1.0.20" }
solana-genesis-programs = { path = "../genesis-programs", version = "1.0.20" }
solana-ledger = { path = "../ledger", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-runtime = { path = "../runtime", version = "1.0.20" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-stake-program = { path = "../programs/stake", version = "1.0.20" }
solana-storage-program = { path = "../programs/storage", version = "1.0.20" }
solana-vest-program = { path = "../programs/vest", version = "1.0.20" }
solana-vote-program = { path = "../programs/vote", version = "1.0.20" }
tempfile = "3.1.0"
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.19" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.20" }
[dev-dependencies]
assert_matches = "1.3.0"

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-log-analyzer"
description = "The solana cluster network analysis tool"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,8 +14,8 @@ byte-unit = "3.0.3"
clap = "2.33.0"
serde = "1.0.104"
serde_json = "1.0.46"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
[[bin]]
name = "solana-log-analyzer"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-logger"
version = "1.0.19"
version = "1.0.20"
description = "Solana Logger"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"

View File

@@ -1,7 +1,7 @@
[package]
name = "solana-measure"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
documentation = "https://docs.rs/solana"
homepage = "https://solana.com/"
readme = "../README.md"
@@ -12,8 +12,8 @@ edition = "2018"
[dependencies]
log = "0.4.8"
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
[target."cfg(unix)".dependencies]
jemallocator = "0.3.2"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-merkle-tree"
version = "1.0.19"
version = "1.0.20"
description = "Solana Merkle Tree"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -9,7 +9,7 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[dev-dependencies]
hex = "0.4.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-metrics"
version = "1.0.19"
version = "1.0.20"
description = "Solana Metrics"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -14,10 +14,10 @@ gethostname = "0.2.1"
lazy_static = "1.4.0"
log = "0.4.8"
reqwest = { version = "0.10.1", default-features = false, features = ["blocking", "rustls-tls"] }
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
[dev-dependencies]
rand = "0.6.5"
rand = "0.7.0"
serial_test = "0.3.2"
serial_test_derive = "0.4.0"

View File

@@ -5,13 +5,17 @@ use gethostname::gethostname;
use lazy_static::lazy_static;
use log::*;
use solana_sdk::hash::hash;
use std::collections::HashMap;
use std::convert::Into;
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError, Sender};
use std::sync::{Arc, Barrier, Mutex, Once, RwLock};
use std::thread;
use std::time::{Duration, Instant};
use std::{cmp, env};
use std::{
collections::HashMap,
convert::Into,
sync::{
mpsc::{channel, Receiver, RecvTimeoutError, Sender},
Arc, Barrier, Mutex, Once, RwLock,
},
thread,
time::{Duration, Instant},
{cmp, env},
};
type CounterMap = HashMap<(&'static str, u64), CounterPoint>;
@@ -416,11 +420,10 @@ pub fn flush() {
/// Hook the panic handler to generate a data point on each panic
pub fn set_panic_hook(program: &'static str) {
use std::panic;
static SET_HOOK: Once = Once::new();
SET_HOOK.call_once(|| {
let default_hook = panic::take_hook();
panic::set_hook(Box::new(move |ono| {
let default_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |ono| {
default_hook(ono);
let location = match ono.location() {
Some(location) => location.to_string(),
@@ -438,9 +441,11 @@ pub fn set_panic_hook(program: &'static str) {
.to_owned(),
Level::Error,
);
// Flush metrics immediately in case the process exits immediately
// upon return
// Flush metrics immediately
flush();
// Exit cleanly so the process don't limp along in a half-dead state
std::process::exit(1);
}));
});
}

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-net-shaper"
description = "The solana cluster network shaping tool"
version = "1.0.19"
version = "1.0.20"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -13,9 +13,9 @@ publish = false
clap = "2.33.0"
serde = "1.0.104"
serde_json = "1.0.46"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
rand = "0.6.5"
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
rand = "0.7.0"
[[bin]]
name = "solana-net-shaper"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-net-utils"
version = "1.0.19"
version = "1.0.20"
description = "Solana Network Utilities"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -14,12 +14,12 @@ bytes = "0.4"
clap = "2.33.0"
log = "0.4.8"
nix = "0.17.0"
rand = "0.6.1"
rand = "0.7.0"
serde = "1.0.104"
serde_derive = "1.0.103"
socket2 = "0.3.11"
solana-clap-utils = { path = "../clap-utils", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-clap-utils = { path = "../clap-utils", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
tokio = "0.1"
tokio-codec = "0.1"

View File

@@ -1,14 +1,8 @@
use bytes::Bytes;
use log::*;
use serde_derive::{Deserialize, Serialize};
use std::io;
use std::net::SocketAddr;
use std::time::Duration;
use tokio;
use tokio::net::TcpListener;
use tokio::prelude::*;
use tokio::reactor::Handle;
use tokio::runtime::Runtime;
use std::{io, net::SocketAddr, time::Duration};
use tokio::{net::TcpListener, prelude::*, reactor::Handle, runtime::Runtime};
use tokio_codec::{BytesCodec, Decoder};
pub type IpEchoServer = Runtime;

View File

@@ -61,6 +61,12 @@ SOLANA_PUBKEYS+=('ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdH
#ci-testnet-deployer
SOLANA_USERS+=('buildkite-agent')
SOLANA_PUBKEYS+=('ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJnESaQpgLM2s3XLW2jvqRrvkBMDd/qGDZCjPR4X/73IwiR+hSw220JaT1JlweRrEh0rodgBTCFsWYSeMbLeGu4= buildkite-agent@ci-testnet-deployer')
#pacman (used by colo-testnet-deployer)
SOLANA_USERS+=('buildkite-agent')
SOLANA_PUBKEYS+=('ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL5bkSnIRevXXtx/sSvVtioeiLv9GLqchABi8JfMLolyv/az9mJxu77UGsxcK05ebuVQPe3PHne9isQPyrdxaE4= buildkite-agent@pacman')
#bernal
SOLANA_USERS+=('buildkite-agent')
SOLANA_PUBKEYS+=('ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG0P5eBR9rf96KWfO1PFaE9KhJadXWEHUZxAQhJ4hZ/GmvGq442gjR+7l3Yrh4PDztH+rsEUd3Ibt/x2XfNoiFE= buildkite-agent@bernal')
SOLANA_USERS+=('pankaj')
SOLANA_PUBKEYS+=('ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPBLR4Z2HbksF+MUFmdjf5jkWoMWB0JC9a0Bz0OHvrvp pankaj@Pankajs-MacBook-Pro.local')

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-perf"
version = "1.0.19"
version = "1.0.20"
description = "Solana Performance APIs"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -9,7 +9,7 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
rand = "0.6.5"
rand = "0.7.0"
dlopen = "0.1.8"
bincode = "1.2.1"
rayon = "1.2.0"
@@ -17,11 +17,11 @@ serde = "1.0.104"
dlopen_derive = "0.1.4"
lazy_static = "1.4.0"
log = "0.4.8"
solana-sdk = { path = "../sdk", version = "1.0.19" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.19" }
solana-budget-program = { path = "../programs/budget", version = "1.0.19" }
solana-logger = { path = "../logger", version = "1.0.19" }
solana-metrics = { path = "../metrics", version = "1.0.19" }
solana-sdk = { path = "../sdk", version = "1.0.20" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.0.20" }
solana-budget-program = { path = "../programs/budget", version = "1.0.20" }
solana-logger = { path = "../logger", version = "1.0.20" }
solana-metrics = { path = "../metrics", version = "1.0.20" }
[lib]
name = "solana_perf"

View File

@@ -312,7 +312,7 @@ pub fn ed25519_verify(
// power-of-two number around that accounting for the fact that the CPU
// may be busy doing other things while being a real validator
// TODO: dynamically adjust this crossover
if count < 64 {
if count < std::usize::MAX {
return ed25519_verify_cpu(batches);
}

2908
programs/bpf/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
[package]
name = "solana-bpf-programs"
description = "Blockchain, Rebuilt for Scale"
version = "1.0.19"
version = "1.0.20"
documentation = "https://docs.rs/solana"
homepage = "https://solana.com/"
readme = "README.md"
@@ -22,10 +22,10 @@ walkdir = "2"
bincode = "1.1.4"
byteorder = "1.3.2"
elf = "0.0.10"
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.0.19" }
solana-logger = { path = "../../logger", version = "1.0.19" }
solana-runtime = { path = "../../runtime", version = "1.0.19" }
solana-sdk = { path = "../../sdk", version = "1.0.19" }
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.0.20" }
solana-logger = { path = "../../logger", version = "1.0.20" }
solana-runtime = { path = "../../runtime", version = "1.0.20" }
solana-sdk = { path = "../../sdk", version = "1.0.20" }
solana_rbpf = "=0.1.21"
[[bench]]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-128bit"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,11 +12,11 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.0.19" }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.0.20" }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-128bit-dep"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-alloc"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-dep-crate"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -13,10 +13,10 @@ edition = "2018"
[dependencies]
byteorder = { version = "1", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-dup-accounts"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-error-handling"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -14,11 +14,11 @@ edition = "2018"
[dependencies]
num-derive = "0.2"
num-traits = "0.2"
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
thiserror = "1.0"
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-external-spend"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-iter"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-many-args"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,11 +12,11 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-bpf-rust-many-args-dep = { path = "../many_args_dep", version = "1.0.19" }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
solana-bpf-rust-many-args-dep = { path = "../many_args_dep", version = "1.0.20" }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-many-args-dep"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-noop"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-panic"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-param-passing"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,11 +12,11 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-bpf-rust-param-passing-dep = { path = "../param_passing_dep", version = "1.0.19" }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
solana-bpf-rust-param-passing-dep = { path = "../param_passing_dep", version = "1.0.20" }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-param-passing-dep"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-sysval"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,10 +12,10 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "1.0.19", default-features = false }
solana-sdk = { path = "../../../../sdk/", version = "1.0.20", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.19" }
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "1.0.20" }
[features]
program = ["solana-sdk/program"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-loader-program"
version = "1.0.19"
version = "1.0.20"
description = "Solana BPF loader"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -15,8 +15,8 @@ libc = "0.2.66"
log = "0.4.8"
num-derive = { version = "0.3" }
num-traits = { version = "0.2" }
solana-logger = { path = "../../logger", version = "1.0.19" }
solana-sdk = { path = "../../sdk", version = "1.0.19" }
solana-logger = { path = "../../logger", version = "1.0.20" }
solana-sdk = { path = "../../sdk", version = "1.0.20" }
solana_rbpf = "=0.1.21"
thiserror = "1.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-btc-spv-program"
version = "1.0.19"
version = "1.0.20"
description = "Solana Bitcoin spv parsing program"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -15,7 +15,7 @@ num-derive = "0.3"
num-traits = "0.2"
serde = "1.0.104"
serde_derive = "1.0.103"
solana-sdk = { path = "../../sdk", version = "1.0.19"}
solana-sdk = { path = "../../sdk", version = "1.0.20"}
hex = "0.3.2"
[lib]

View File

@@ -4,7 +4,6 @@ use crate::spv_instruction::*;
use crate::spv_state::*;
#[allow(unused_imports)]
use crate::utils::*;
use hex;
use log::*;
use solana_sdk::account::KeyedAccount;
use solana_sdk::instruction::InstructionError;

View File

@@ -1,6 +1,6 @@
[package]
name = "btc_spv_bin"
version = "1.0.19"
version = "1.0.20"
description = "Solana Bitcoin spv parsing program"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"

View File

@@ -1,7 +1,4 @@
use clap;
use clap::{App, Arg};
use hex;
use reqwest;
use std::fs::File;
use std::io::prelude::*;

View File

@@ -1,6 +1,4 @@
use clap;
use clap::{App, Arg};
use reqwest;
use serde_derive::Deserialize;
// pub type blockHash = [u8; 32];

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-budget-program"
version = "1.0.19"
version = "1.0.20"
description = "Solana Budget program"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@@ -16,11 +16,11 @@ num-derive = "0.3"
num-traits = "0.2"
serde = "1.0.104"
serde_derive = "1.0.103"
solana-sdk = { path = "../../sdk", version = "1.0.19" }
solana-sdk = { path = "../../sdk", version = "1.0.20" }
thiserror = "1.0"
[dev-dependencies]
solana-runtime = { path = "../../runtime", version = "1.0.19" }
solana-runtime = { path = "../../runtime", version = "1.0.20" }
[lib]
crate-type = ["lib", "cdylib"]

Some files were not shown because too many files have changed in this diff Show More