Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
489a7bb576 | |||
688dd85e61 | |||
fe54a30084 | |||
80942841a2 | |||
d2808a8e29 | |||
f8413a28b5 | |||
bc96332899 | |||
ceeeb3c9dd | |||
bd058ec8f1 | |||
4b5ac44fc8 | |||
fef979f0e5 | |||
cca2cdf39b | |||
6e91996606 | |||
99be00d61f | |||
68f808026e | |||
0c7ab0a1bb | |||
3d8ccbc079 | |||
275d096a46 | |||
6d70a06b23 | |||
7e68b2e1bd | |||
f0d761630e | |||
1986927eb6 | |||
9a0ea61007 | |||
51a70e52f2 | |||
9797c93db3 | |||
9598114658 | |||
d3ef061044 | |||
1f102d2617 | |||
5e97bd3d8a | |||
ed06e8b85d | |||
10b9225edb | |||
b1b5ddd2b9 | |||
6b9b107ead | |||
3fef98fd1e | |||
e999823b4b | |||
1e46a5b147 | |||
567a1cb944 | |||
2996cebfaa | |||
7a1889aaf9 | |||
9188153b7d | |||
4b9f2e987a | |||
bb5c76483a | |||
aafbb251b9 | |||
dd32540ceb | |||
e1a9cbaf3c | |||
83740246fc | |||
7a53ca18a6 | |||
c1a8637cb5 | |||
d6831309cd |
565
Cargo.lock
generated
565
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-account-decoder"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana account decoder"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -18,11 +18,11 @@ lazy_static = "1.4.0"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.6", features = ["skip-no-mangle"] }
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.8" }
|
||||
thiserror = "1.0"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-accounts-bench"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -11,11 +11,11 @@ publish = false
|
||||
[dependencies]
|
||||
log = "0.4.6"
|
||||
rayon = "1.4.0"
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
rand = "0.7.0"
|
||||
clap = "2.33.1"
|
||||
crossbeam-channel = "0.4"
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-banking-bench"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -14,16 +14,16 @@ crossbeam-channel = "0.4"
|
||||
log = "0.4.6"
|
||||
rand = "0.7.0"
|
||||
rayon = "1.4.0"
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-streamer = { path = "../streamer", version = "1.4.0" }
|
||||
solana-perf = { path = "../perf", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-streamer = { path = "../streamer", version = "1.4.1" }
|
||||
solana-perf = { path = "../perf", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-client"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana banks client"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,15 +12,15 @@ edition = "2018"
|
||||
async-trait = "0.1.36"
|
||||
bincode = "1.3.1"
|
||||
futures = "0.3"
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
tarpc = { version = "0.22.0", features = ["full"] }
|
||||
tokio = "0.2"
|
||||
tokio-serde = { version = "0.6", features = ["bincode"] }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.4.1" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-interface"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana banks RPC interface"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -10,7 +10,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.112", features = ["derive"] }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
tarpc = { version = "0.22.0", features = ["full"] }
|
||||
|
||||
[lib]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-server"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana banks server"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,10 +12,10 @@ edition = "2018"
|
||||
bincode = "1.3.1"
|
||||
futures = "0.3"
|
||||
log = "0.4.8"
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
tarpc = { version = "0.22.0", features = ["full"] }
|
||||
tokio = "0.2"
|
||||
tokio-serde = { version = "0.6", features = ["bincode"] }
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-bench-exchange"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -18,21 +18,21 @@ rand = "0.7.0"
|
||||
rayon = "1.4.0"
|
||||
serde_json = "1.0.56"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-genesis = { path = "../genesis", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
solana-genesis = { path = "../genesis", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.1" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.4.0" }
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-bench-streamer"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -10,11 +10,11 @@ publish = false
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33.1"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-streamer = { path = "../streamer", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-streamer = { path = "../streamer", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-bench-tps"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -15,23 +15,23 @@ log = "0.4.8"
|
||||
rayon = "1.4.0"
|
||||
serde_json = "1.0.56"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-genesis = { path = "../genesis", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
solana-genesis = { path = "../genesis", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
|
||||
[dev-dependencies]
|
||||
serial_test = "0.4.0"
|
||||
serial_test_derive = "0.4.0"
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.4.0" }
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
27
cargo
Executable file
27
cargo
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck source=ci/rust-version.sh
|
||||
here=$(dirname "$0")
|
||||
|
||||
source "${here}"/ci/rust-version.sh all
|
||||
|
||||
toolchain=
|
||||
case "$1" in
|
||||
stable)
|
||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||
toolchain="$rust_stable"
|
||||
shift
|
||||
;;
|
||||
nightly)
|
||||
# shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh
|
||||
toolchain="$rust_nightly"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||
toolchain="$rust_stable"
|
||||
;;
|
||||
esac
|
||||
|
||||
set -x
|
||||
exec cargo "+${toolchain}" "${@}"
|
@ -42,10 +42,10 @@ def get_packages():
|
||||
sys.exit(1)
|
||||
|
||||
# Order dependencies
|
||||
deleted_dependencies = []
|
||||
sorted_dependency_graph = []
|
||||
max_iterations = pow(len(dependency_graph),2)
|
||||
while len(deleted_dependencies) < len(dependency_graph):
|
||||
while dependency_graph:
|
||||
deleted_packages = []
|
||||
if max_iterations == 0:
|
||||
# One day be more helpful and find the actual cycle for the user...
|
||||
sys.exit('Error: Circular dependency suspected between these packages: \n {}\n'.format('\n '.join(dependency_graph.keys())))
|
||||
@ -53,13 +53,17 @@ def get_packages():
|
||||
max_iterations -= 1
|
||||
|
||||
for package, dependencies in dependency_graph.items():
|
||||
if package in deleted_packages:
|
||||
continue
|
||||
for dependency in dependencies:
|
||||
if dependency in dependency_graph:
|
||||
break
|
||||
else:
|
||||
deleted_dependencies.append(package)
|
||||
deleted_packages.append(package)
|
||||
sorted_dependency_graph.append((package, manifest_path[package]))
|
||||
|
||||
dependency_graph = {p: d for p, d in dependency_graph.items() if not p in deleted_packages }
|
||||
|
||||
|
||||
return sorted_dependency_graph
|
||||
|
||||
|
@ -41,7 +41,7 @@ if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
|
||||
echo "$0: [tree (for outdated Cargo.lock sync)|check (for compilation error)|update -p foo --precise x.y.z (for your Cargo.toml update)] ..." >&2
|
||||
exit "$check_status"
|
||||
fi
|
||||
|
||||
|
||||
# Ensure nightly and --benches
|
||||
_ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets
|
||||
else
|
||||
@ -57,7 +57,18 @@ _ cargo +"$rust_nightly" clippy \
|
||||
-Zunstable-options --workspace --all-targets \
|
||||
-- --deny=warnings --allow=clippy::stable_sort_primitive
|
||||
|
||||
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-2020-0002 --ignore RUSTSEC-2020-0008
|
||||
cargo_audit_ignores=(
|
||||
# failure is officially deprecated/unmaintained
|
||||
#
|
||||
# Blocked on multiple upstream crates removing their `failure` dependency.
|
||||
--ignore RUSTSEC-2020-0036
|
||||
|
||||
# `net2` crate has been deprecated; use `socket2` instead
|
||||
#
|
||||
# Blocked on https://github.com/paritytech/jsonrpc/issues/575
|
||||
--ignore RUSTSEC-2020-0016
|
||||
)
|
||||
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit "${cargo_audit_ignores[@]}"
|
||||
|
||||
{
|
||||
cd programs/bpf
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-clap-utils"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana utilities for the clap"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
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.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
thiserror = "1.0.20"
|
||||
tiny-bip39 = "0.7.0"
|
||||
url = "2.1.0"
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-cli-config"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-cli-output"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -17,13 +17,13 @@ indicatif = "0.15.0"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -301,7 +301,7 @@ pub struct CliValidatorsStakeByVersion {
|
||||
pub struct CliValidators {
|
||||
pub total_active_stake: u64,
|
||||
pub total_current_stake: u64,
|
||||
pub total_deliquent_stake: u64,
|
||||
pub total_delinquent_stake: u64,
|
||||
pub current_validators: Vec<CliValidator>,
|
||||
pub delinquent_validators: Vec<CliValidator>,
|
||||
pub stake_by_version: BTreeMap<String, CliValidatorsStakeByVersion>,
|
||||
@ -360,7 +360,7 @@ impl fmt::Display for CliValidators {
|
||||
"Active Stake:",
|
||||
&build_balance_message(self.total_active_stake, self.use_lamports_unit, true),
|
||||
)?;
|
||||
if self.total_deliquent_stake > 0 {
|
||||
if self.total_delinquent_stake > 0 {
|
||||
writeln_name_value(
|
||||
f,
|
||||
"Current Stake:",
|
||||
@ -376,11 +376,11 @@ impl fmt::Display for CliValidators {
|
||||
&format!(
|
||||
"{} ({:0.2}%)",
|
||||
&build_balance_message(
|
||||
self.total_deliquent_stake,
|
||||
self.total_delinquent_stake,
|
||||
self.use_lamports_unit,
|
||||
true
|
||||
),
|
||||
100. * self.total_deliquent_stake as f64 / self.total_active_stake as f64
|
||||
100. * self.total_delinquent_stake as f64 / self.total_active_stake as f64
|
||||
),
|
||||
)?;
|
||||
}
|
||||
|
@ -197,6 +197,15 @@ pub fn write_transaction<W: io::Write>(
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(log_messages) = &transaction_status.log_messages {
|
||||
if !log_messages.is_empty() {
|
||||
writeln!(w, "{}Log Messages:", prefix,)?;
|
||||
for log_message in log_messages {
|
||||
writeln!(w, "{} {}", prefix, log_message,)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
writeln!(w, "{}Status: Unavailable", prefix)?;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-cli"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -23,32 +23,34 @@ indicatif = "0.15.0"
|
||||
humantime = "2.0.1"
|
||||
num-traits = "0.2"
|
||||
pretty-hex = "0.1.1"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.0" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.4.0" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.1" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.4.1" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.1" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana_rbpf = "=0.1.32"
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.4.1" }
|
||||
thiserror = "1.0.20"
|
||||
url = "2.1.1"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
tempfile = "3.1.0"
|
||||
|
||||
[[bin]]
|
||||
|
@ -7,6 +7,7 @@ use log::*;
|
||||
use num_traits::FromPrimitive;
|
||||
use serde_json::{self, json, Value};
|
||||
use solana_account_decoder::{UiAccount, UiAccountEncoding};
|
||||
use solana_bpf_loader_program::bpf_verifier;
|
||||
use solana_clap_utils::{
|
||||
self,
|
||||
commitment::commitment_arg_with_default,
|
||||
@ -36,6 +37,7 @@ use solana_client::{
|
||||
use solana_faucet::faucet::request_airdrop_transaction;
|
||||
#[cfg(test)]
|
||||
use solana_faucet::faucet_mock::request_airdrop_transaction;
|
||||
use solana_rbpf::vm::EbpfVm;
|
||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||
use solana_sdk::{
|
||||
bpf_loader, bpf_loader_deprecated,
|
||||
@ -98,7 +100,7 @@ pub enum CliCommand {
|
||||
Fees,
|
||||
FirstAvailableBlock,
|
||||
GetBlock {
|
||||
slot: Slot,
|
||||
slot: Option<Slot>,
|
||||
},
|
||||
GetBlockTime {
|
||||
slot: Option<Slot>,
|
||||
@ -1144,6 +1146,9 @@ fn process_deploy(
|
||||
CliError::DynamicProgramError(format!("Unable to read program file: {}", err))
|
||||
})?;
|
||||
|
||||
EbpfVm::create_executable_from_elf(&program_data, Some(|x| bpf_verifier::check(x, true)))
|
||||
.map_err(|err| CliError::DynamicProgramError(format!("ELF error: {}", err)))?;
|
||||
|
||||
let loader_id = if use_deprecated_loader {
|
||||
bpf_loader_deprecated::id()
|
||||
} else {
|
||||
@ -1266,8 +1271,8 @@ fn process_deploy(
|
||||
config.commitment,
|
||||
config.send_transaction_config,
|
||||
);
|
||||
log_instruction_custom_error::<SystemError>(result, &config).map_err(|_| {
|
||||
CliError::DynamicProgramError("Program account allocation failed".to_string())
|
||||
log_instruction_custom_error::<SystemError>(result, &config).map_err(|err| {
|
||||
CliError::DynamicProgramError(format!("Program account allocation failed: {}", err))
|
||||
})?;
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
||||
.validator(is_slot)
|
||||
.value_name("SLOT")
|
||||
.takes_value(true)
|
||||
.index(1)
|
||||
.required(true),
|
||||
.index(1),
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
@ -363,7 +362,7 @@ pub fn parse_cluster_ping(
|
||||
}
|
||||
|
||||
pub fn parse_get_block(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
||||
let slot = value_t_or_exit!(matches, "slot", Slot);
|
||||
let slot = value_of(matches, "slot");
|
||||
Ok(CliCommandInfo {
|
||||
command: CliCommand::GetBlock { slot },
|
||||
signers: vec![],
|
||||
@ -700,7 +699,17 @@ pub fn process_leader_schedule(rpc_client: &RpcClient) -> ProcessResult {
|
||||
Ok("".to_string())
|
||||
}
|
||||
|
||||
pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot) -> ProcessResult {
|
||||
pub fn process_get_block(
|
||||
rpc_client: &RpcClient,
|
||||
_config: &CliConfig,
|
||||
slot: Option<Slot>,
|
||||
) -> ProcessResult {
|
||||
let slot = if let Some(slot) = slot {
|
||||
slot
|
||||
} else {
|
||||
rpc_client.get_slot()?
|
||||
};
|
||||
|
||||
let mut block =
|
||||
rpc_client.get_confirmed_block_with_encoding(slot, UiTransactionEncoding::Base64)?;
|
||||
|
||||
@ -716,18 +725,23 @@ pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot
|
||||
let mut total_rewards = 0;
|
||||
println!("Rewards:",);
|
||||
println!(
|
||||
" {:<44} {:<15} {:<13} {:>14}",
|
||||
"Address", "Amount", "New Balance", "Percent Change"
|
||||
" {:<44} {:^15} {:<15} {:<20} {:>14}",
|
||||
"Address", "Type", "Amount", "New Balance", "Percent Change"
|
||||
);
|
||||
for reward in block.rewards {
|
||||
let sign = if reward.lamports < 0 { "-" } else { "" };
|
||||
|
||||
total_rewards += reward.lamports;
|
||||
println!(
|
||||
" {:<44} {:>15} {}",
|
||||
" {:<44} {:^15} {:>15} {}",
|
||||
reward.pubkey,
|
||||
if let Some(reward_type) = reward.reward_type {
|
||||
format!("{}", reward_type)
|
||||
} else {
|
||||
"-".to_string()
|
||||
},
|
||||
format!(
|
||||
"{}◎{:<14.4}",
|
||||
"{}◎{:<14.9}",
|
||||
sign,
|
||||
lamports_to_sol(reward.lamports.abs() as u64)
|
||||
),
|
||||
@ -735,7 +749,7 @@ pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot
|
||||
" - -".to_string()
|
||||
} else {
|
||||
format!(
|
||||
"◎{:<12.4} {:>13.4}%",
|
||||
"◎{:<19.9} {:>13.9}%",
|
||||
lamports_to_sol(reward.post_balance),
|
||||
reward.lamports.abs() as f64
|
||||
/ (reward.post_balance as f64 - reward.lamports as f64)
|
||||
@ -746,7 +760,7 @@ pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot
|
||||
|
||||
let sign = if total_rewards < 0 { "-" } else { "" };
|
||||
println!(
|
||||
"Total Rewards: {}◎{:12.9}",
|
||||
"Total Rewards: {}◎{:<12.9}",
|
||||
sign,
|
||||
lamports_to_sol(total_rewards.abs() as u64)
|
||||
);
|
||||
@ -1405,12 +1419,12 @@ pub fn process_show_validators(
|
||||
.map(|vote_account| vote_account.activated_stake)
|
||||
.sum();
|
||||
|
||||
let total_deliquent_stake = vote_accounts
|
||||
let total_delinquent_stake = vote_accounts
|
||||
.delinquent
|
||||
.iter()
|
||||
.map(|vote_account| vote_account.activated_stake)
|
||||
.sum();
|
||||
let total_current_stake = total_active_stake - total_deliquent_stake;
|
||||
let total_current_stake = total_active_stake - total_delinquent_stake;
|
||||
|
||||
let mut current = vote_accounts.current;
|
||||
current.sort_by(|a, b| b.activated_stake.cmp(&a.activated_stake));
|
||||
@ -1464,7 +1478,7 @@ pub fn process_show_validators(
|
||||
let cli_validators = CliValidators {
|
||||
total_active_stake,
|
||||
total_current_stake,
|
||||
total_deliquent_stake,
|
||||
total_delinquent_stake,
|
||||
current_validators,
|
||||
delinquent_validators,
|
||||
stake_by_version,
|
||||
|
@ -23,13 +23,17 @@ use solana_cli_output::{
|
||||
CliStakeType,
|
||||
};
|
||||
use solana_client::{
|
||||
blockhash_query::BlockhashQuery, nonce_utils, rpc_client::RpcClient,
|
||||
rpc_request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
|
||||
blockhash_query::BlockhashQuery,
|
||||
client_error::{ClientError, ClientErrorKind},
|
||||
nonce_utils,
|
||||
rpc_client::RpcClient,
|
||||
rpc_custom_error,
|
||||
rpc_request::{self, DELINQUENT_VALIDATOR_SLOT_DISTANCE},
|
||||
};
|
||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||
use solana_sdk::{
|
||||
account_utils::StateMut,
|
||||
clock::{Clock, Epoch, Slot, UnixTimestamp},
|
||||
clock::{Clock, Epoch, Slot, UnixTimestamp, SECONDS_PER_DAY},
|
||||
message::Message,
|
||||
pubkey::Pubkey,
|
||||
system_instruction::SystemError,
|
||||
@ -1605,10 +1609,26 @@ pub(crate) fn fetch_epoch_rewards(
|
||||
.get(0)
|
||||
.ok_or_else(|| format!("Unable to fetch first confirmed block for epoch {}", epoch))?;
|
||||
|
||||
let first_confirmed_block = rpc_client.get_confirmed_block_with_encoding(
|
||||
let first_confirmed_block = match rpc_client.get_confirmed_block_with_encoding(
|
||||
first_confirmed_block_in_epoch,
|
||||
solana_transaction_status::UiTransactionEncoding::Base64,
|
||||
)?;
|
||||
) {
|
||||
Ok(first_confirmed_block) => first_confirmed_block,
|
||||
Err(ClientError {
|
||||
kind:
|
||||
ClientErrorKind::RpcError(rpc_request::RpcError::RpcResponseError {
|
||||
code: rpc_custom_error::JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE,
|
||||
message: _,
|
||||
}),
|
||||
request: _,
|
||||
}) => {
|
||||
// RPC node doesn't have this block
|
||||
break;
|
||||
}
|
||||
Err(err) => {
|
||||
return Err(err.into());
|
||||
}
|
||||
};
|
||||
|
||||
let epoch_start_time = if let Some(block_time) = first_confirmed_block.block_time {
|
||||
block_time
|
||||
@ -1620,13 +1640,13 @@ pub(crate) fn fetch_epoch_rewards(
|
||||
let previous_epoch_rewards = first_confirmed_block.rewards;
|
||||
|
||||
if let Some((effective_slot, epoch_end_time, epoch_rewards)) = epoch_info {
|
||||
let wall_clock_epoch_duration =
|
||||
let wallclock_epoch_duration =
|
||||
{ Local.timestamp(epoch_end_time, 0) - Local.timestamp(epoch_start_time, 0) }
|
||||
.to_std()?
|
||||
.as_secs_f64();
|
||||
|
||||
const SECONDS_PER_YEAR: f64 = (24 * 60 * 60 * 356) as f64;
|
||||
let percent_of_year = SECONDS_PER_YEAR / wall_clock_epoch_duration;
|
||||
let wallclock_epochs_per_year =
|
||||
(SECONDS_PER_DAY * 356) as f64 / wallclock_epoch_duration;
|
||||
|
||||
if let Some(reward) = epoch_rewards
|
||||
.into_iter()
|
||||
@ -1642,7 +1662,7 @@ pub(crate) fn fetch_epoch_rewards(
|
||||
amount: reward.lamports.abs() as u64,
|
||||
post_balance: reward.post_balance,
|
||||
percent_change: balance_increase_percent,
|
||||
apr: balance_increase_percent * percent_of_year,
|
||||
apr: balance_increase_percent * wallclock_epochs_per_year,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-client"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Client"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -17,16 +17,16 @@ indicatif = "0.15.0"
|
||||
jsonrpc-core = "15.0.0"
|
||||
log = "0.4.8"
|
||||
rayon = "1.4.0"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
thiserror = "1.0"
|
||||
tungstenite = "0.10.1"
|
||||
url = "2.1.1"
|
||||
@ -35,7 +35,7 @@ url = "2.1.1"
|
||||
assert_matches = "1.3.0"
|
||||
jsonrpc-core = "15.0.0"
|
||||
jsonrpc-http-server = "15.0.0"
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -50,10 +50,10 @@ impl Into<TransportError> for ClientErrorKind {
|
||||
#[derive(Error, Debug)]
|
||||
#[error("{kind}")]
|
||||
pub struct ClientError {
|
||||
request: Option<rpc_request::RpcRequest>,
|
||||
pub request: Option<rpc_request::RpcRequest>,
|
||||
|
||||
#[source]
|
||||
kind: ClientErrorKind,
|
||||
pub kind: ClientErrorKind,
|
||||
}
|
||||
|
||||
impl ClientError {
|
||||
|
@ -27,6 +27,13 @@ impl HttpSender {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
struct RpcErrorObject {
|
||||
code: i64,
|
||||
message: String,
|
||||
/*data field omitted*/
|
||||
}
|
||||
|
||||
impl RpcSender for HttpSender {
|
||||
fn send(&self, request: RpcRequest, params: serde_json::Value) -> Result<serde_json::Value> {
|
||||
// Concurrent requests are not supported so reuse the same request id for all requests
|
||||
@ -63,11 +70,20 @@ impl RpcSender for HttpSender {
|
||||
|
||||
let json: serde_json::Value = serde_json::from_str(&response.text()?)?;
|
||||
if json["error"].is_object() {
|
||||
return Err(RpcError::RpcRequestError(format!(
|
||||
"RPC Error response: {}",
|
||||
serde_json::to_string(&json["error"]).unwrap()
|
||||
))
|
||||
.into());
|
||||
return match serde_json::from_value::<RpcErrorObject>(json["error"].clone())
|
||||
{
|
||||
Ok(rpc_error_object) => Err(RpcError::RpcResponseError {
|
||||
code: rpc_error_object.code,
|
||||
message: rpc_error_object.message,
|
||||
}
|
||||
.into()),
|
||||
Err(err) => Err(RpcError::RpcRequestError(format!(
|
||||
"Failed to deserialize RPC error response: {} [{}]",
|
||||
serde_json::to_string(&json["error"]).unwrap(),
|
||||
err
|
||||
))
|
||||
.into()),
|
||||
};
|
||||
}
|
||||
return Ok(json["result"].clone());
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ pub mod perf_utils;
|
||||
pub mod pubsub_client;
|
||||
pub mod rpc_client;
|
||||
pub mod rpc_config;
|
||||
pub mod rpc_custom_error;
|
||||
pub mod rpc_filter;
|
||||
pub mod rpc_request;
|
||||
pub mod rpc_response;
|
||||
|
@ -112,7 +112,7 @@ impl RpcSender for MockSender {
|
||||
Signature::new(&[8; 64]).to_string()
|
||||
} else {
|
||||
let tx_str = params.as_array().unwrap()[0].as_str().unwrap().to_string();
|
||||
let data = bs58::decode(tx_str).into_vec().unwrap();
|
||||
let data = base64::decode(tx_str).unwrap();
|
||||
let tx: Transaction = bincode::deserialize(&data).unwrap();
|
||||
tx.signatures[0].to_string()
|
||||
};
|
||||
|
@ -133,7 +133,11 @@ impl RpcClient {
|
||||
transaction: &Transaction,
|
||||
config: RpcSendTransactionConfig,
|
||||
) -> ClientResult<Signature> {
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base58);
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base64);
|
||||
let config = RpcSendTransactionConfig {
|
||||
encoding: Some(encoding),
|
||||
..config
|
||||
};
|
||||
let serialized_encoded = serialize_encode_transaction(transaction, encoding)?;
|
||||
let signature_base58_str: String = self.send(
|
||||
RpcRequest::SendTransaction,
|
||||
@ -161,26 +165,24 @@ impl RpcClient {
|
||||
pub fn simulate_transaction(
|
||||
&self,
|
||||
transaction: &Transaction,
|
||||
sig_verify: bool,
|
||||
) -> RpcResult<RpcSimulateTransactionResult> {
|
||||
self.simulate_transaction_with_config(
|
||||
transaction,
|
||||
sig_verify,
|
||||
RpcSimulateTransactionConfig::default(),
|
||||
)
|
||||
self.simulate_transaction_with_config(transaction, RpcSimulateTransactionConfig::default())
|
||||
}
|
||||
|
||||
pub fn simulate_transaction_with_config(
|
||||
&self,
|
||||
transaction: &Transaction,
|
||||
sig_verify: bool,
|
||||
config: RpcSimulateTransactionConfig,
|
||||
) -> RpcResult<RpcSimulateTransactionResult> {
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base58);
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base64);
|
||||
let config = RpcSimulateTransactionConfig {
|
||||
encoding: Some(encoding),
|
||||
..config
|
||||
};
|
||||
let serialized_encoded = serialize_encode_transaction(transaction, encoding)?;
|
||||
self.send(
|
||||
RpcRequest::SimulateTransaction,
|
||||
json!([serialized_encoded, { "sigVerify": sig_verify }]),
|
||||
json!([serialized_encoded, config]),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
//! Implementation defined RPC server errors
|
||||
|
||||
use crate::rpc_response::RpcSimulateTransactionResult;
|
||||
use jsonrpc_core::{Error, ErrorCode};
|
||||
use solana_client::rpc_response::RpcSimulateTransactionResult;
|
||||
use solana_sdk::clock::Slot;
|
||||
|
||||
const JSON_RPC_SERVER_ERROR_1: i64 = -32001;
|
||||
const JSON_RPC_SERVER_ERROR_2: i64 = -32002;
|
||||
const JSON_RPC_SERVER_ERROR_3: i64 = -32003;
|
||||
const JSON_RPC_SERVER_ERROR_4: i64 = -32004;
|
||||
const JSON_RPC_SERVER_ERROR_5: i64 = -32005;
|
||||
const JSON_RPC_SERVER_ERROR_6: i64 = -32006;
|
||||
pub const JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: i64 = -32001;
|
||||
pub const JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: i64 = -32002;
|
||||
pub const JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: i64 = -32003;
|
||||
pub const JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: i64 = -32004;
|
||||
pub const JSON_RPC_SERVER_ERROR_NODE_UNHEALTHLY: i64 = -32005;
|
||||
pub const JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: i64 = -32006;
|
||||
|
||||
pub enum RpcCustomError {
|
||||
BlockCleanedUp {
|
||||
@ -33,7 +35,7 @@ impl From<RpcCustomError> for Error {
|
||||
slot,
|
||||
first_available_block,
|
||||
} => Self {
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_1),
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP),
|
||||
message: format!(
|
||||
"Block {} cleaned up, does not exist on node. First available block: {}",
|
||||
slot, first_available_block,
|
||||
@ -41,27 +43,33 @@ impl From<RpcCustomError> for Error {
|
||||
data: None,
|
||||
},
|
||||
RpcCustomError::SendTransactionPreflightFailure { message, result } => Self {
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_2),
|
||||
code: ErrorCode::ServerError(
|
||||
JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
|
||||
),
|
||||
message,
|
||||
data: Some(serde_json::json!(result)),
|
||||
},
|
||||
RpcCustomError::TransactionSignatureVerificationFailure => Self {
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_3),
|
||||
code: ErrorCode::ServerError(
|
||||
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE,
|
||||
),
|
||||
message: "Transaction signature verification failure".to_string(),
|
||||
data: None,
|
||||
},
|
||||
RpcCustomError::BlockNotAvailable { slot } => Self {
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_4),
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE),
|
||||
message: format!("Block not available for slot {}", slot),
|
||||
data: None,
|
||||
},
|
||||
RpcCustomError::RpcNodeUnhealthy => Self {
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_5),
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_NODE_UNHEALTHLY),
|
||||
message: "RPC node is unhealthy".to_string(),
|
||||
data: None,
|
||||
},
|
||||
RpcCustomError::TransactionPrecompileVerificationFailure(e) => Self {
|
||||
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_6),
|
||||
code: ErrorCode::ServerError(
|
||||
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE,
|
||||
),
|
||||
message: format!("Transaction precompile verification failure {:?}", e),
|
||||
data: None,
|
||||
},
|
@ -140,8 +140,10 @@ impl RpcRequest {
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum RpcError {
|
||||
#[error("rpc request error: {0}")]
|
||||
#[error("RPC request error: {0}")]
|
||||
RpcRequestError(String),
|
||||
#[error("RPC response error {code}: {message}")]
|
||||
RpcResponseError { code: i64, message: String },
|
||||
#[error("parse error: expected {0}")]
|
||||
ParseError(String), /* "expected" */
|
||||
// Anything in a `ForUser` needs to die. The caller should be
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "solana-core"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
documentation = "https://docs.rs/solana"
|
||||
homepage = "https://solana.com/"
|
||||
readme = "../README.md"
|
||||
@ -39,48 +39,47 @@ num-traits = "0.2"
|
||||
rand = "0.7.0"
|
||||
rand_chacha = "0.2.2"
|
||||
raptorq = "1.4.2"
|
||||
rayon = "1.4.0"
|
||||
rayon = "1.4.1"
|
||||
regex = "1.3.9"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.0" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.4.0" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-perf = { path = "../perf", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-sdk-macro-frozen-abi = { path = "../sdk/macro-frozen-abi", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.4.0" }
|
||||
solana-streamer = { path = "../streamer", version = "1.4.0" }
|
||||
solana-sys-tuner = { path = "../sys-tuner", version = "1.4.0" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.4.0" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.6", features = ["skip-no-mangle"] }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.1" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-perf = { path = "../perf", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-sdk-macro-frozen-abi = { path = "../sdk/macro-frozen-abi", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.4.1" }
|
||||
solana-streamer = { path = "../streamer", version = "1.4.1" }
|
||||
solana-sys-tuner = { path = "../sys-tuner", version = "1.4.1" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.4.1" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.8" }
|
||||
tempfile = "3.1.0"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
tokio_01 = { version = "0.1", package = "tokio" }
|
||||
tokio_fs_01 = { version = "0.1", package = "tokio-fs" }
|
||||
tokio_io_01 = { version = "0.1", package = "tokio-io" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.0" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.1" }
|
||||
trees = "0.2.1"
|
||||
|
||||
[dev-dependencies]
|
||||
matches = "0.1.6"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serial_test = "0.4.0"
|
||||
serial_test_derive = "0.4.0"
|
||||
systemstat = "0.1.5"
|
||||
|
@ -204,6 +204,7 @@ mod tests {
|
||||
{
|
||||
let message = make_accounts_hashes_message(&validator1, vec![(0, hash1)]).unwrap();
|
||||
cluster_info.push_message(message);
|
||||
cluster_info.flush_push_queue();
|
||||
}
|
||||
slot_to_hash.insert(0, hash2);
|
||||
trusted_validators.insert(validator1.pubkey());
|
||||
@ -254,6 +255,7 @@ mod tests {
|
||||
100,
|
||||
);
|
||||
}
|
||||
cluster_info.flush_push_queue();
|
||||
let cluster_hashes = cluster_info
|
||||
.get_accounts_hash_for_node(&keypair.pubkey(), |c| c.clone())
|
||||
.unwrap();
|
||||
|
@ -534,13 +534,14 @@ impl BankingStage {
|
||||
mut loaded_accounts,
|
||||
results,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
mut retryable_txs,
|
||||
tx_count,
|
||||
signature_count,
|
||||
) = bank.load_and_execute_transactions(
|
||||
batch,
|
||||
MAX_PROCESSING_AGE,
|
||||
None,
|
||||
transaction_status_sender.is_some(),
|
||||
transaction_status_sender.is_some(),
|
||||
);
|
||||
load_execute_time.stop();
|
||||
@ -580,6 +581,7 @@ impl BankingStage {
|
||||
tx_results.processing_results,
|
||||
TransactionBalancesSet::new(pre_balances, post_balances),
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
sender,
|
||||
);
|
||||
}
|
||||
|
@ -257,6 +257,7 @@ pub struct ClusterInfo {
|
||||
id: Pubkey,
|
||||
stats: GossipStats,
|
||||
socket: UdpSocket,
|
||||
local_message_pending_push_queue: RwLock<Vec<(CrdsValue, u64)>>,
|
||||
}
|
||||
|
||||
impl Default for ClusterInfo {
|
||||
@ -414,6 +415,7 @@ impl ClusterInfo {
|
||||
id,
|
||||
stats: GossipStats::default(),
|
||||
socket: UdpSocket::bind("0.0.0.0:0").unwrap(),
|
||||
local_message_pending_push_queue: RwLock::new(vec![]),
|
||||
};
|
||||
{
|
||||
let mut gossip = me.gossip.write().unwrap();
|
||||
@ -440,6 +442,12 @@ impl ClusterInfo {
|
||||
id: *new_id,
|
||||
stats: GossipStats::default(),
|
||||
socket: UdpSocket::bind("0.0.0.0:0").unwrap(),
|
||||
local_message_pending_push_queue: RwLock::new(
|
||||
self.local_message_pending_push_queue
|
||||
.read()
|
||||
.unwrap()
|
||||
.clone(),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,9 +470,14 @@ impl ClusterInfo {
|
||||
self.my_contact_info.write().unwrap().wallclock = now;
|
||||
let entry =
|
||||
CrdsValue::new_signed(CrdsData::ContactInfo(self.my_contact_info()), &self.keypair);
|
||||
let mut w_gossip = self.gossip.write().unwrap();
|
||||
w_gossip.refresh_push_active_set(stakes, gossip_validators);
|
||||
w_gossip.process_push_message(&self.id(), vec![entry], now);
|
||||
self.gossip
|
||||
.write()
|
||||
.unwrap()
|
||||
.refresh_push_active_set(stakes, gossip_validators);
|
||||
self.local_message_pending_push_queue
|
||||
.write()
|
||||
.unwrap()
|
||||
.push((entry, now));
|
||||
}
|
||||
|
||||
// TODO kill insert_info, only used by tests
|
||||
@ -633,10 +646,10 @@ impl ClusterInfo {
|
||||
CrdsData::LowestSlot(0, LowestSlot::new(id, min, now)),
|
||||
&self.keypair,
|
||||
);
|
||||
self.gossip
|
||||
self.local_message_pending_push_queue
|
||||
.write()
|
||||
.unwrap()
|
||||
.process_push_message(&self.id(), vec![entry], now);
|
||||
.push((entry, now));
|
||||
}
|
||||
}
|
||||
|
||||
@ -689,8 +702,10 @@ impl ClusterInfo {
|
||||
let n = slots.fill(&update[num..], now);
|
||||
if n > 0 {
|
||||
let entry = CrdsValue::new_signed(CrdsData::EpochSlots(ix, slots), &self.keypair);
|
||||
self.time_gossip_write_lock("epcoh_slots_push", &self.stats.epoch_slots_push)
|
||||
.process_push_message(&self.id(), vec![entry], now);
|
||||
self.local_message_pending_push_queue
|
||||
.write()
|
||||
.unwrap()
|
||||
.push((entry, now));
|
||||
}
|
||||
num += n;
|
||||
if num < update.len() {
|
||||
@ -718,9 +733,10 @@ impl ClusterInfo {
|
||||
|
||||
pub fn push_message(&self, message: CrdsValue) {
|
||||
let now = message.wallclock();
|
||||
let id = message.pubkey();
|
||||
self.time_gossip_write_lock("process_push_message", &self.stats.push_message)
|
||||
.process_push_message(&id, vec![message], now);
|
||||
self.local_message_pending_push_queue
|
||||
.write()
|
||||
.unwrap()
|
||||
.push((message, now));
|
||||
}
|
||||
|
||||
pub fn push_accounts_hashes(&self, accounts_hashes: Vec<(Slot, Hash)>) {
|
||||
@ -761,8 +777,10 @@ impl ClusterInfo {
|
||||
CrdsValue::compute_vote_index(tower_index, current_votes)
|
||||
};
|
||||
let entry = CrdsValue::new_signed(CrdsData::Vote(vote_ix, vote), &self.keypair);
|
||||
self.time_gossip_write_lock("push_vote_process_push", &self.stats.vote_process_push)
|
||||
.process_push_message(&self.id(), vec![entry], now);
|
||||
self.local_message_pending_push_queue
|
||||
.write()
|
||||
.unwrap()
|
||||
.push((entry, now));
|
||||
}
|
||||
|
||||
pub fn send_vote(&self, vote: &Transaction) -> Result<()> {
|
||||
@ -1425,11 +1443,21 @@ impl ClusterInfo {
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
fn drain_push_queue(&self) -> Vec<(CrdsValue, u64)> {
|
||||
let mut push_queue = self.local_message_pending_push_queue.write().unwrap();
|
||||
std::mem::take(&mut *push_queue)
|
||||
}
|
||||
#[cfg(test)]
|
||||
pub fn flush_push_queue(&self) {
|
||||
let pending_push_messages = self.drain_push_queue();
|
||||
let mut gossip = self.gossip.write().unwrap();
|
||||
gossip.process_push_messages(pending_push_messages);
|
||||
}
|
||||
fn new_push_requests(&self) -> Vec<(SocketAddr, Protocol)> {
|
||||
let self_id = self.id();
|
||||
let (_, push_messages) = self
|
||||
.time_gossip_write_lock("new_push_requests", &self.stats.new_push_requests)
|
||||
.new_push_messages(timestamp());
|
||||
.new_push_messages(self.drain_push_queue(), timestamp());
|
||||
let messages: Vec<_> = push_messages
|
||||
.into_iter()
|
||||
.filter_map(|(peer, messages)| {
|
||||
@ -2909,7 +2937,7 @@ mod tests {
|
||||
.gossip
|
||||
.write()
|
||||
.unwrap()
|
||||
.new_push_messages(timestamp());
|
||||
.new_push_messages(cluster_info.drain_push_queue(), timestamp());
|
||||
// there should be some pushes ready
|
||||
assert_eq!(push_messages.is_empty(), false);
|
||||
push_messages
|
||||
@ -3092,6 +3120,7 @@ mod tests {
|
||||
let tx = test_tx();
|
||||
let index = 1;
|
||||
cluster_info.push_vote(index, tx.clone());
|
||||
cluster_info.flush_push_queue();
|
||||
|
||||
// -1 to make sure that the clock is strictly lower then when insert occurred
|
||||
let (labels, votes, max_ts) = cluster_info.get_votes(now - 1);
|
||||
@ -3121,6 +3150,7 @@ mod tests {
|
||||
assert!(slots.is_empty());
|
||||
assert!(since.is_none());
|
||||
cluster_info.push_epoch_slots(&[0]);
|
||||
cluster_info.flush_push_queue();
|
||||
|
||||
let (slots, since) = cluster_info.get_epoch_slots_since(Some(std::u64::MAX));
|
||||
assert!(slots.is_empty());
|
||||
@ -3449,7 +3479,9 @@ mod tests {
|
||||
range.push(last + rand::thread_rng().gen_range(1, 32));
|
||||
}
|
||||
cluster_info.push_epoch_slots(&range[..16000]);
|
||||
cluster_info.flush_push_queue();
|
||||
cluster_info.push_epoch_slots(&range[16000..]);
|
||||
cluster_info.flush_push_queue();
|
||||
let (slots, since) = cluster_info.get_epoch_slots_since(None);
|
||||
let slots: Vec<_> = slots.iter().flat_map(|x| x.to_slots(0)).collect();
|
||||
assert_eq!(slots, range);
|
||||
|
@ -181,6 +181,7 @@ mod test {
|
||||
let node_info = Node::new_localhost_with_pubkey(&Pubkey::default());
|
||||
let cluster_info = ClusterInfo::new_with_invalid_keypair(node_info.info);
|
||||
ClusterSlotsService::update_lowest_slot(&Pubkey::default(), 5, &cluster_info);
|
||||
cluster_info.flush_push_queue();
|
||||
let lowest = cluster_info
|
||||
.get_lowest_slot_for_node(&Pubkey::default(), None, |lowest_slot, _| {
|
||||
lowest_slot.clone()
|
||||
|
@ -30,11 +30,11 @@ use std::{
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(PartialEq, Clone, Debug, AbiExample)]
|
||||
pub enum SwitchForkDecision {
|
||||
SwitchProof(Hash),
|
||||
NoSwitch,
|
||||
FailedSwitchThreshold,
|
||||
SameFork,
|
||||
FailedSwitchThreshold(u64, u64),
|
||||
}
|
||||
|
||||
impl SwitchForkDecision {
|
||||
@ -45,8 +45,11 @@ impl SwitchForkDecision {
|
||||
authorized_voter_pubkey: &Pubkey,
|
||||
) -> Option<Instruction> {
|
||||
match self {
|
||||
SwitchForkDecision::FailedSwitchThreshold => None,
|
||||
SwitchForkDecision::NoSwitch => Some(vote_instruction::vote(
|
||||
SwitchForkDecision::FailedSwitchThreshold(_, total_stake) => {
|
||||
assert_ne!(*total_stake, 0);
|
||||
None
|
||||
}
|
||||
SwitchForkDecision::SameFork => Some(vote_instruction::vote(
|
||||
vote_account_pubkey,
|
||||
authorized_voter_pubkey,
|
||||
vote,
|
||||
@ -61,6 +64,10 @@ impl SwitchForkDecision {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn can_vote(&self) -> bool {
|
||||
!matches!(self, SwitchForkDecision::FailedSwitchThreshold(_, _))
|
||||
}
|
||||
}
|
||||
|
||||
pub const VOTE_THRESHOLD_DEPTH: usize = 8;
|
||||
@ -101,6 +108,8 @@ pub struct Tower {
|
||||
// This could be emptied after some time; but left intact indefinitely for easier
|
||||
// implementation
|
||||
stray_restored_slot: Option<Slot>,
|
||||
#[serde(skip)]
|
||||
pub last_switch_threshold_check: Option<(Slot, SwitchForkDecision)>,
|
||||
}
|
||||
|
||||
impl Default for Tower {
|
||||
@ -115,6 +124,7 @@ impl Default for Tower {
|
||||
path: PathBuf::default(),
|
||||
tmp_path: PathBuf::default(),
|
||||
stray_restored_slot: Option::default(),
|
||||
last_switch_threshold_check: Option::default(),
|
||||
};
|
||||
// VoteState::root_slot is ensured to be Some in Tower
|
||||
tower.lockouts.root_slot = Some(Slot::default());
|
||||
@ -493,7 +503,7 @@ impl Tower {
|
||||
false
|
||||
}
|
||||
|
||||
pub(crate) fn check_switch_threshold(
|
||||
fn make_check_switch_threshold_decision(
|
||||
&self,
|
||||
switch_slot: u64,
|
||||
ancestors: &HashMap<Slot, HashSet<u64>>,
|
||||
@ -520,9 +530,34 @@ impl Tower {
|
||||
// all of them.
|
||||
panic!("no ancestors found with slot: {}", last_voted_slot);
|
||||
} else {
|
||||
// bank_forks doesn't have corresponding data for the stray restored last vote,
|
||||
// meaning some inconsistency between saved tower and ledger.
|
||||
// (newer snapshot, or only a saved tower is moved over to new setup?)
|
||||
// This condition shouldn't occur under normal validator operation, indicating
|
||||
// something unusual happened.
|
||||
// Possible causes include: OS/HW crash, validator process crash, only saved tower
|
||||
// is moved over to a new setup, etc...
|
||||
|
||||
// However, returning empty ancestors as a fallback here shouldn't result in
|
||||
// slashing by itself (Note that we couldn't fully preclude any kind of slashing if
|
||||
// the failure was OS or HW level).
|
||||
|
||||
// Firstly, lockout is ensured elsewhere.
|
||||
|
||||
// Also, there is no risk of optimistic conf. violation. Although empty ancestors
|
||||
// could result in incorrect (= more than actual) locked_out_stake and
|
||||
// false-positive SwitchProof later in this function, there should be no such a
|
||||
// heavier fork candidate, first of all, if the last vote (or any of its
|
||||
// unavailable ancestors) were already optimistically confirmed.
|
||||
// The only exception is that other validator is already violating it...
|
||||
if self.is_first_switch_check() && switch_slot < last_voted_slot {
|
||||
// `switch < last` is needed not to warn! this message just because of using
|
||||
// newer snapshots on validator restart
|
||||
let message = format!(
|
||||
"bank_forks doesn't have corresponding data for the stray restored \
|
||||
last vote({}), meaning some inconsistency between saved tower and ledger.",
|
||||
last_voted_slot
|
||||
);
|
||||
warn!("{}", message);
|
||||
datapoint_warn!("tower_warn", ("warn", message, String));
|
||||
}
|
||||
&empty_ancestors
|
||||
}
|
||||
});
|
||||
@ -532,7 +567,7 @@ impl Tower {
|
||||
if switch_slot == last_voted_slot || switch_slot_ancestors.contains(&last_voted_slot) {
|
||||
// If the `switch_slot is a descendant of the last vote,
|
||||
// no switching proof is necessary
|
||||
return SwitchForkDecision::NoSwitch;
|
||||
return SwitchForkDecision::SameFork;
|
||||
}
|
||||
|
||||
// Should never consider switching to an ancestor
|
||||
@ -598,7 +633,7 @@ impl Tower {
|
||||
}
|
||||
|
||||
// Only count lockouts on slots that are:
|
||||
// 1) Not ancestors of `last_vote`
|
||||
// 1) Not ancestors of `last_vote`, meaning being on different fork
|
||||
// 2) Not from before the current root as we can't determine if
|
||||
// anything before the root was an ancestor of `last_vote` or not
|
||||
if !last_vote_ancestors.contains(lockout_interval_start)
|
||||
@ -622,10 +657,43 @@ impl Tower {
|
||||
if (locked_out_stake as f64 / total_stake as f64) > SWITCH_FORK_THRESHOLD {
|
||||
SwitchForkDecision::SwitchProof(switch_proof)
|
||||
} else {
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(locked_out_stake, total_stake)
|
||||
}
|
||||
})
|
||||
.unwrap_or(SwitchForkDecision::NoSwitch)
|
||||
.unwrap_or(SwitchForkDecision::SameFork)
|
||||
}
|
||||
|
||||
pub(crate) fn check_switch_threshold(
|
||||
&mut self,
|
||||
switch_slot: u64,
|
||||
ancestors: &HashMap<Slot, HashSet<u64>>,
|
||||
descendants: &HashMap<Slot, HashSet<u64>>,
|
||||
progress: &ProgressMap,
|
||||
total_stake: u64,
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, Account)>,
|
||||
) -> SwitchForkDecision {
|
||||
let decision = self.make_check_switch_threshold_decision(
|
||||
switch_slot,
|
||||
ancestors,
|
||||
descendants,
|
||||
progress,
|
||||
total_stake,
|
||||
epoch_vote_accounts,
|
||||
);
|
||||
let new_check = Some((switch_slot, decision.clone()));
|
||||
if new_check != self.last_switch_threshold_check {
|
||||
trace!(
|
||||
"new switch threshold check: slot {}: {:?}",
|
||||
switch_slot,
|
||||
decision,
|
||||
);
|
||||
self.last_switch_threshold_check = new_check;
|
||||
}
|
||||
decision
|
||||
}
|
||||
|
||||
fn is_first_switch_check(&self) -> bool {
|
||||
self.last_switch_threshold_check.is_none()
|
||||
}
|
||||
|
||||
pub fn check_vote_stake_threshold(
|
||||
@ -932,9 +1000,9 @@ impl Tower {
|
||||
self.lockouts = vote_state;
|
||||
self.do_initialize_lockouts(root, |v| v.slot > root);
|
||||
trace!(
|
||||
"{} lockouts initialized to {:?}",
|
||||
"Lockouts in tower for {} is initialized using bank {}",
|
||||
self.node_pubkey,
|
||||
self.lockouts
|
||||
bank.slot(),
|
||||
);
|
||||
assert_eq!(
|
||||
self.lockouts.node_pubkey, self.node_pubkey,
|
||||
@ -986,6 +1054,7 @@ impl Tower {
|
||||
bincode::serialize_into(&mut file, &saved_tower)?;
|
||||
// file.sync_all() hurts performance; pipeline sync-ing and submitting votes to the cluster!
|
||||
}
|
||||
trace!("persisted votes: {:?}", self.voted_slots());
|
||||
fs::rename(&new_filename, &filename)?;
|
||||
// self.path.parent().sync_all() hurts performance same as the above sync
|
||||
|
||||
@ -1047,6 +1116,16 @@ pub enum TowerError {
|
||||
FatallyInconsistent(&'static str),
|
||||
}
|
||||
|
||||
impl TowerError {
|
||||
pub fn is_file_missing(&self) -> bool {
|
||||
if let TowerError::IOError(io_err) = &self {
|
||||
io_err.kind() == std::io::ErrorKind::NotFound
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[frozen_abi(digest = "Gaxfwvx5MArn52mKZQgzHmDCyn5YfCuTHvp5Et3rFfpp")]
|
||||
#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, AbiExample)]
|
||||
pub struct SavedTower {
|
||||
@ -1267,7 +1346,7 @@ pub mod test {
|
||||
&ancestors,
|
||||
&descendants,
|
||||
&self.progress,
|
||||
&tower,
|
||||
tower,
|
||||
);
|
||||
|
||||
// Make sure this slot isn't locked out or failing threshold
|
||||
@ -1464,11 +1543,11 @@ pub mod test {
|
||||
#[test]
|
||||
fn test_to_vote_instruction() {
|
||||
let vote = Vote::default();
|
||||
let mut decision = SwitchForkDecision::FailedSwitchThreshold;
|
||||
let mut decision = SwitchForkDecision::FailedSwitchThreshold(0, 1);
|
||||
assert!(decision
|
||||
.to_vote_instruction(vote.clone(), &Pubkey::default(), &Pubkey::default())
|
||||
.is_none());
|
||||
decision = SwitchForkDecision::NoSwitch;
|
||||
decision = SwitchForkDecision::SameFork;
|
||||
assert_eq!(
|
||||
decision.to_vote_instruction(vote.clone(), &Pubkey::default(), &Pubkey::default()),
|
||||
Some(vote_instruction::vote(
|
||||
@ -1571,7 +1650,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::NoSwitch
|
||||
SwitchForkDecision::SameFork
|
||||
);
|
||||
|
||||
// Trying to switch to another fork at 110 should fail
|
||||
@ -1584,7 +1663,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Adding another validator lockout on a descendant of last vote should
|
||||
@ -1599,7 +1678,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Adding another validator lockout on an ancestor of last vote should
|
||||
@ -1614,7 +1693,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Adding another validator lockout on a different fork, but the lockout
|
||||
@ -1629,7 +1708,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Adding another validator lockout on a different fork, and the lockout
|
||||
@ -1646,7 +1725,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Adding another validator lockout on a different fork, and the lockout
|
||||
@ -1697,7 +1776,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
}
|
||||
|
||||
@ -2365,7 +2444,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::NoSwitch
|
||||
SwitchForkDecision::SameFork
|
||||
);
|
||||
|
||||
// Trying to switch to another fork at 110 should fail
|
||||
@ -2378,7 +2457,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
vote_simulator.simulate_lockout_interval(111, (10, 49), &other_vote_account);
|
||||
@ -2456,7 +2535,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Add lockout_interval which should be excluded
|
||||
@ -2470,7 +2549,7 @@ pub mod test {
|
||||
total_stake,
|
||||
bank0.epoch_vote_accounts(0).unwrap(),
|
||||
),
|
||||
SwitchForkDecision::FailedSwitchThreshold
|
||||
SwitchForkDecision::FailedSwitchThreshold(0, 20000)
|
||||
);
|
||||
|
||||
// Add lockout_interval which should not be excluded
|
||||
|
@ -88,7 +88,20 @@ impl CrdsGossip {
|
||||
prune_map
|
||||
}
|
||||
|
||||
pub fn new_push_messages(&mut self, now: u64) -> (Pubkey, HashMap<Pubkey, Vec<CrdsValue>>) {
|
||||
pub fn process_push_messages(&mut self, pending_push_messages: Vec<(CrdsValue, u64)>) {
|
||||
for (push_message, timestamp) in pending_push_messages {
|
||||
let _ =
|
||||
self.push
|
||||
.process_push_message(&mut self.crds, &self.id, push_message, timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_push_messages(
|
||||
&mut self,
|
||||
pending_push_messages: Vec<(CrdsValue, u64)>,
|
||||
now: u64,
|
||||
) -> (Pubkey, HashMap<Pubkey, Vec<CrdsValue>>) {
|
||||
self.process_push_messages(pending_push_messages);
|
||||
let push_messages = self.push.new_push_messages(&self.crds, now);
|
||||
(self.id, push_messages)
|
||||
}
|
||||
|
@ -6,14 +6,10 @@
|
||||
//! command-line tools to spin up validators and a Rust library
|
||||
//!
|
||||
|
||||
#[macro_use]
|
||||
extern crate solana_bpf_loader_program;
|
||||
|
||||
pub mod accounts_hash_verifier;
|
||||
pub mod banking_stage;
|
||||
pub mod bigtable_upload_service;
|
||||
pub mod broadcast_stage;
|
||||
mod builtins;
|
||||
pub mod cache_block_time_service;
|
||||
pub mod cluster_info_vote_listener;
|
||||
pub mod commitment_service;
|
||||
@ -59,7 +55,6 @@ mod result;
|
||||
pub mod retransmit_stage;
|
||||
pub mod rewards_recorder_service;
|
||||
pub mod rpc;
|
||||
pub mod rpc_error;
|
||||
pub mod rpc_health;
|
||||
pub mod rpc_pubsub;
|
||||
pub mod rpc_pubsub_service;
|
||||
|
@ -79,6 +79,26 @@ solana_sdk::pubkeys!(
|
||||
"GumSE5HsMV5HCwBTv2D2D81yy9x17aDkvobkqAfTRgmo",
|
||||
"AzVV9ZZDxTgW4wWfJmsG6ytaHpQGSe1yz76Nyy84VbQF",
|
||||
"8CUUMKYNGxdgYio5CLHRHyzMEhhVRMcqefgE6dLqnVRK",
|
||||
"CQDYc4ET2mbFhVpgj41gXahL6Exn5ZoPcGAzSHuYxwmE",
|
||||
"5PLJZLJiRR9vf7d1JCCg7UuWjtyN9nkab9uok6TqSyuP",
|
||||
"7xJ9CLtEAcEShw9kW2gSoZkRWL566Dg12cvgzANJwbTr",
|
||||
"BuCEvc9ze8UoAQwwsQLy8d447C8sA4zeVtVpc6m5wQeS",
|
||||
"8ndGYFjav6NDXvzYcxs449Aub3AxYv4vYpk89zRDwgj7",
|
||||
"8W58E8JVJjH1jCy5CeHJQgvwFXTyAVyesuXRZGbcSUGG",
|
||||
"GNiz4Mq886bTNDT3pijGsu2gbw6it7sqrwncro45USeB",
|
||||
"GhsotwFMH6XUrRLJCxcx62h7748N2Uq8mf87hUGkmPhg",
|
||||
"Fgyh8EeYGZtbW8sS33YmNQnzx54WXPrJ5KWNPkCfWPot",
|
||||
"8UVjvYyoqP6sqcctTso3xpCdCfgTMiv3VRh7vraC2eJk",
|
||||
"BhvLngiqqKeZ8rpxch2uGjeCiC88zzewoWPRuoxpp1aS",
|
||||
"63DtkW7zuARcd185EmHAkfF44bDcC2SiTSEj2spLP3iA",
|
||||
"GvpCiTgq9dmEeojCDBivoLoZqc4AkbUDACpqPMwYLWKh",
|
||||
"7Y8smnoUrYKGGuDq2uaFKVxJYhojgg7DVixHyAtGTYEV",
|
||||
"DUS1KxwUhUyDKB4A81E8vdnTe3hSahd92Abtn9CXsEcj",
|
||||
"F9MWFw8cnYVwsRq8Am1PGfFL3cQUZV37mbGoxZftzLjN",
|
||||
"8vqrX3H2BYLaXVintse3gorPEM4TgTwTFZNN1Fm9TdYs",
|
||||
"CUageMFi49kzoDqtdU8NvQ4Bq3sbtJygjKDAXJ45nmAi",
|
||||
"5smrYwb1Hr2T8XMnvsqccTgXxuqQs14iuE8RbHFYf2Cf",
|
||||
"xQadXQiUTCCFhfHjvQx1hyJK6KVWr1w2fD6DT3cdwj7",
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -291,7 +291,6 @@ impl ReplayStage {
|
||||
&bank_forks,
|
||||
&leader_schedule_cache,
|
||||
&subscriptions,
|
||||
rewards_recorder_sender.clone(),
|
||||
&mut progress,
|
||||
&mut all_pubkeys,
|
||||
);
|
||||
@ -313,6 +312,7 @@ impl ReplayStage {
|
||||
&mut heaviest_subtree_fork_choice,
|
||||
&replay_vote_sender,
|
||||
&bank_notification_sender,
|
||||
&rewards_recorder_sender,
|
||||
);
|
||||
replay_active_banks_time.stop();
|
||||
Self::report_memory(&allocated, "replay_active_banks", start);
|
||||
@ -408,7 +408,7 @@ impl ReplayStage {
|
||||
&ancestors,
|
||||
&descendants,
|
||||
&progress,
|
||||
&tower,
|
||||
&mut tower,
|
||||
);
|
||||
select_vote_and_reset_forks_time.stop();
|
||||
|
||||
@ -554,7 +554,6 @@ impl ReplayStage {
|
||||
&poh_recorder,
|
||||
&leader_schedule_cache,
|
||||
&subscriptions,
|
||||
rewards_recorder_sender.clone(),
|
||||
&progress,
|
||||
&retransmit_slots_sender,
|
||||
&mut skipped_slots_info,
|
||||
@ -854,7 +853,6 @@ impl ReplayStage {
|
||||
poh_recorder: &Arc<Mutex<PohRecorder>>,
|
||||
leader_schedule_cache: &Arc<LeaderScheduleCache>,
|
||||
subscriptions: &Arc<RpcSubscriptions>,
|
||||
rewards_recorder_sender: Option<RewardsRecorderSender>,
|
||||
progress_map: &ProgressMap,
|
||||
retransmit_slots_sender: &RetransmitSlotsSender,
|
||||
skipped_slots_info: &mut SkippedSlotsInfo,
|
||||
@ -953,7 +951,6 @@ impl ReplayStage {
|
||||
poh_slot,
|
||||
root_slot,
|
||||
my_pubkey,
|
||||
&rewards_recorder_sender,
|
||||
subscriptions,
|
||||
);
|
||||
|
||||
@ -1265,6 +1262,7 @@ impl ReplayStage {
|
||||
heaviest_subtree_fork_choice: &mut HeaviestSubtreeForkChoice,
|
||||
replay_vote_sender: &ReplayVoteSender,
|
||||
bank_notification_sender: &Option<BankNotificationSender>,
|
||||
rewards_recorder_sender: &Option<RewardsRecorderSender>,
|
||||
) -> bool {
|
||||
let mut did_complete_bank = false;
|
||||
let mut tx_count = 0;
|
||||
@ -1340,6 +1338,8 @@ impl ReplayStage {
|
||||
.send(BankNotification::Frozen(bank.clone()))
|
||||
.unwrap_or_else(|err| warn!("bank_notification_sender failed: {:?}", err));
|
||||
}
|
||||
|
||||
Self::record_rewards(&bank, &rewards_recorder_sender);
|
||||
} else {
|
||||
trace!(
|
||||
"bank {} not completed tick_height: {}, max_tick_height: {}",
|
||||
@ -1525,7 +1525,7 @@ impl ReplayStage {
|
||||
ancestors: &HashMap<u64, HashSet<u64>>,
|
||||
descendants: &HashMap<u64, HashSet<u64>>,
|
||||
progress: &ProgressMap,
|
||||
tower: &Tower,
|
||||
tower: &mut Tower,
|
||||
) -> SelectVoteAndResetForkResult {
|
||||
// Try to vote on the actual heaviest fork. If the heaviest bank is
|
||||
// locked out or fails the threshold check, the validator will:
|
||||
@ -1552,7 +1552,7 @@ impl ReplayStage {
|
||||
.epoch_vote_accounts(heaviest_bank.epoch())
|
||||
.expect("Bank epoch vote accounts must contain entry for the bank's own epoch"),
|
||||
);
|
||||
if switch_fork_decision == SwitchForkDecision::FailedSwitchThreshold {
|
||||
if let SwitchForkDecision::FailedSwitchThreshold(_, _) = switch_fork_decision {
|
||||
// If we can't switch, then reset to the the next votable
|
||||
// bank on the same fork as our last vote, but don't vote
|
||||
info!(
|
||||
@ -1601,7 +1601,7 @@ impl ReplayStage {
|
||||
if !is_locked_out
|
||||
&& vote_threshold
|
||||
&& propagation_confirmed
|
||||
&& switch_fork_decision != SwitchForkDecision::FailedSwitchThreshold
|
||||
&& switch_fork_decision.can_vote()
|
||||
{
|
||||
info!("voting: {} {}", bank.slot(), fork_weight);
|
||||
SelectVoteAndResetForkResult {
|
||||
@ -1817,7 +1817,6 @@ impl ReplayStage {
|
||||
bank_forks: &RwLock<BankForks>,
|
||||
leader_schedule_cache: &Arc<LeaderScheduleCache>,
|
||||
subscriptions: &Arc<RpcSubscriptions>,
|
||||
rewards_recorder_sender: Option<RewardsRecorderSender>,
|
||||
progress: &mut ProgressMap,
|
||||
all_pubkeys: &mut PubkeyReferences,
|
||||
) {
|
||||
@ -1863,7 +1862,6 @@ impl ReplayStage {
|
||||
child_slot,
|
||||
forks.root(),
|
||||
&leader,
|
||||
&rewards_recorder_sender,
|
||||
subscriptions,
|
||||
);
|
||||
let empty: Vec<&Pubkey> = vec![];
|
||||
@ -1891,21 +1889,18 @@ impl ReplayStage {
|
||||
slot: u64,
|
||||
root_slot: u64,
|
||||
leader: &Pubkey,
|
||||
rewards_recorder_sender: &Option<RewardsRecorderSender>,
|
||||
subscriptions: &Arc<RpcSubscriptions>,
|
||||
) -> Bank {
|
||||
subscriptions.notify_slot(slot, parent.slot(), root_slot);
|
||||
|
||||
let child_bank = Bank::new_from_parent(parent, leader, slot);
|
||||
Self::record_rewards(&child_bank, &rewards_recorder_sender);
|
||||
child_bank
|
||||
Bank::new_from_parent(parent, leader, slot)
|
||||
}
|
||||
|
||||
fn record_rewards(bank: &Bank, rewards_recorder_sender: &Option<RewardsRecorderSender>) {
|
||||
if let Some(rewards_recorder_sender) = rewards_recorder_sender {
|
||||
if let Some(ref rewards) = bank.rewards {
|
||||
let rewards = bank.rewards.read().unwrap();
|
||||
if !rewards.is_empty() {
|
||||
rewards_recorder_sender
|
||||
.send((bank.slot(), rewards.iter().copied().collect()))
|
||||
.send((bank.slot(), rewards.clone()))
|
||||
.unwrap_or_else(|err| warn!("rewards_recorder_sender failed: {:?}", err));
|
||||
}
|
||||
}
|
||||
@ -2155,7 +2150,6 @@ pub(crate) mod tests {
|
||||
&bank_forks,
|
||||
&leader_schedule_cache,
|
||||
&rpc_subscriptions,
|
||||
None,
|
||||
&mut progress,
|
||||
&mut PubkeyReferences::default(),
|
||||
);
|
||||
@ -2179,7 +2173,6 @@ pub(crate) mod tests {
|
||||
&bank_forks,
|
||||
&leader_schedule_cache,
|
||||
&rpc_subscriptions,
|
||||
None,
|
||||
&mut progress,
|
||||
&mut PubkeyReferences::default(),
|
||||
);
|
||||
|
@ -54,6 +54,7 @@ impl RewardsRecorderService {
|
||||
pubkey: pubkey.to_string(),
|
||||
lamports: reward_info.lamports,
|
||||
post_balance: reward_info.post_balance,
|
||||
reward_type: Some(reward_info.reward_type),
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
@ -5,7 +5,6 @@ use crate::{
|
||||
contact_info::ContactInfo,
|
||||
non_circulating_supply::calculate_non_circulating_supply,
|
||||
optimistically_confirmed_bank_tracker::OptimisticallyConfirmedBank,
|
||||
rpc_error::RpcCustomError,
|
||||
rpc_health::*,
|
||||
send_transaction_service::{SendTransactionService, TransactionInfo},
|
||||
validator::ValidatorExit,
|
||||
@ -23,6 +22,7 @@ use solana_account_decoder::{
|
||||
};
|
||||
use solana_client::{
|
||||
rpc_config::*,
|
||||
rpc_custom_error::RpcCustomError,
|
||||
rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType},
|
||||
rpc_request::{
|
||||
TokenAccountsFilter, DELINQUENT_VALIDATOR_SLOT_DISTANCE, MAX_GET_CONFIRMED_BLOCKS_RANGE,
|
||||
@ -35,6 +35,7 @@ use solana_client::{
|
||||
};
|
||||
use solana_faucet::faucet::request_airdrop_transaction;
|
||||
use solana_ledger::{blockstore::Blockstore, blockstore_db::BlockstoreError, get_tmp_ledger_path};
|
||||
use solana_metrics::inc_new_counter_info;
|
||||
use solana_perf::packet::PACKET_DATA_SIZE;
|
||||
use solana_runtime::{
|
||||
accounts::AccountAddressFilter,
|
||||
@ -548,9 +549,6 @@ impl JsonRpcRequestProcessor {
|
||||
} else {
|
||||
0
|
||||
};
|
||||
let epoch_vote_account = epoch_vote_accounts
|
||||
.iter()
|
||||
.any(|(epoch_vote_pubkey, _)| epoch_vote_pubkey == pubkey);
|
||||
RpcVoteAccountInfo {
|
||||
vote_pubkey: (pubkey).to_string(),
|
||||
node_pubkey: vote_state.node_pubkey.to_string(),
|
||||
@ -558,7 +556,7 @@ impl JsonRpcRequestProcessor {
|
||||
commission: vote_state.commission,
|
||||
root_slot: vote_state.root_slot.unwrap_or(0),
|
||||
epoch_credits: vote_state.epoch_credits().clone(),
|
||||
epoch_vote_account,
|
||||
epoch_vote_account: epoch_vote_accounts.contains_key(pubkey),
|
||||
last_vote,
|
||||
}
|
||||
})
|
||||
@ -2609,6 +2607,7 @@ fn deserialize_transaction(
|
||||
) -> Result<(Vec<u8>, Transaction)> {
|
||||
let wire_transaction = match encoding {
|
||||
UiTransactionEncoding::Base58 => {
|
||||
inc_new_counter_info!("rpc-base58_encoded_tx", 1);
|
||||
if encoded_transaction.len() > WORST_CASE_BASE58_TX {
|
||||
return Err(Error::invalid_params(format!(
|
||||
"encoded transaction too large: {} bytes (max: encoded/raw {}/{})",
|
||||
@ -2622,6 +2621,7 @@ fn deserialize_transaction(
|
||||
.map_err(|e| Error::invalid_params(format!("{:?}", e)))?
|
||||
}
|
||||
UiTransactionEncoding::Base64 => {
|
||||
inc_new_counter_info!("rpc-base64_encoded_tx", 1);
|
||||
if encoded_transaction.len() > WORST_CASE_BASE64_TX {
|
||||
return Err(Error::invalid_params(format!(
|
||||
"encoded transaction too large: {} bytes (max: encoded/raw {}/{})",
|
||||
|
@ -566,6 +566,7 @@ mod tests {
|
||||
|
||||
// No account hashes for any trusted validators == "behind"
|
||||
cluster_info.push_accounts_hashes(vec![(1000, Hash::default()), (900, Hash::default())]);
|
||||
cluster_info.flush_push_queue();
|
||||
assert_eq!(rm.health_check(), "behind");
|
||||
override_health_check.store(true, Ordering::Relaxed);
|
||||
assert_eq!(rm.health_check(), "ok");
|
||||
|
@ -56,6 +56,7 @@ impl TransactionStatusService {
|
||||
statuses,
|
||||
balances,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
} = write_transaction_status_receiver.recv_timeout(Duration::from_secs(1))?;
|
||||
|
||||
let slot = bank.slot();
|
||||
@ -65,12 +66,14 @@ impl TransactionStatusService {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
) in izip!(
|
||||
OrderedIterator::new(&transactions, iteration_order.as_deref()),
|
||||
statuses,
|
||||
balances.pre_balances,
|
||||
balances.post_balances,
|
||||
inner_instructions
|
||||
inner_instructions,
|
||||
transaction_logs
|
||||
) {
|
||||
if Bank::can_commit(&status) && !transaction.signatures.is_empty() {
|
||||
let fee_calculator = match hash_age_kind {
|
||||
@ -96,6 +99,8 @@ impl TransactionStatusService {
|
||||
.collect()
|
||||
});
|
||||
|
||||
let log_messages = Some(log_messages);
|
||||
|
||||
blockstore
|
||||
.write_transaction_status(
|
||||
slot,
|
||||
@ -108,6 +113,7 @@ impl TransactionStatusService {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
},
|
||||
)
|
||||
.expect("Expect database write to succeed");
|
||||
|
@ -2,12 +2,11 @@
|
||||
|
||||
use crate::{
|
||||
broadcast_stage::BroadcastStageType,
|
||||
builtins,
|
||||
cache_block_time_service::{CacheBlockTimeSender, CacheBlockTimeService},
|
||||
cluster_info::{ClusterInfo, Node},
|
||||
cluster_info_vote_listener::VoteTracker,
|
||||
completed_data_sets_service::CompletedDataSetsService,
|
||||
consensus::{reconcile_blockstore_roots_with_tower, Tower, TowerError},
|
||||
consensus::{reconcile_blockstore_roots_with_tower, Tower},
|
||||
contact_info::ContactInfo,
|
||||
gossip_service::GossipService,
|
||||
optimistically_confirmed_bank_tracker::{
|
||||
@ -731,12 +730,7 @@ fn post_process_restored_tower(
|
||||
.unwrap_or_else(|err| {
|
||||
let voting_has_been_active =
|
||||
active_vote_account_exists_in_bank(&bank_forks.working_bank(), &vote_account);
|
||||
let saved_tower_is_missing = if let TowerError::IOError(io_err) = &err {
|
||||
io_err.kind() == std::io::ErrorKind::NotFound
|
||||
} else {
|
||||
false
|
||||
};
|
||||
if !saved_tower_is_missing {
|
||||
if !err.is_file_missing() {
|
||||
datapoint_error!(
|
||||
"tower_error",
|
||||
(
|
||||
@ -754,7 +748,7 @@ fn post_process_restored_tower(
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
if saved_tower_is_missing && !voting_has_been_active {
|
||||
if err.is_file_missing() && !voting_has_been_active {
|
||||
// Currently, don't protect against spoofed snapshots with no tower at all
|
||||
info!(
|
||||
"Ignoring expected failed tower restore because this is the initial \
|
||||
@ -839,7 +833,6 @@ fn new_banks_from_ledger(
|
||||
new_hard_forks: config.new_hard_forks.clone(),
|
||||
frozen_accounts: config.frozen_accounts.clone(),
|
||||
debug_keys: config.debug_keys.clone(),
|
||||
additional_builtins: Some(builtins::get(genesis_config.cluster_type)),
|
||||
..blockstore_processor::ProcessOptions::default()
|
||||
};
|
||||
|
||||
|
@ -293,9 +293,10 @@ fn network_run_push(network: &mut Network, start: usize, end: usize) -> (usize,
|
||||
let requests: Vec<_> = network_values
|
||||
.par_iter()
|
||||
.map(|node| {
|
||||
let timeouts = node.lock().unwrap().make_timeouts_test();
|
||||
node.lock().unwrap().purge(now, &timeouts);
|
||||
node.lock().unwrap().new_push_messages(now)
|
||||
let mut node_lock = node.lock().unwrap();
|
||||
let timeouts = node_lock.make_timeouts_test();
|
||||
node_lock.purge(now, &timeouts);
|
||||
node_lock.new_push_messages(vec![], now)
|
||||
})
|
||||
.collect();
|
||||
let transfered: Vec<_> = requests
|
||||
|
@ -156,7 +156,7 @@ mod tests {
|
||||
.get(&deserialized_bank.slot())
|
||||
.unwrap()
|
||||
.clone();
|
||||
bank.compare_bank(&deserialized_bank);
|
||||
assert!(*bank == deserialized_bank);
|
||||
|
||||
let slot_snapshot_paths = snapshot_utils::get_snapshot_paths(&snapshot_path);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-crate-features"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Crate Features"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -14,12 +14,11 @@ bytes = { version = "0.4.12", features = ["either"] }
|
||||
cc = { version = "1.0.45", features = ["jobserver", "num_cpus", "parallel"]}
|
||||
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.2.2" }
|
||||
regex-syntax = { version = "0.6.12" }
|
||||
reqwest = { version = "0.10.1", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serde = { version = "1.0.100", features = ["rc"] }
|
||||
ed25519-dalek = { version = "=1.0.0-pre.4", features = ["serde"] }
|
||||
syn_0_15 = { package = "syn", version = "0.15.42", features = ["extra-traits", "fold", "full"] }
|
||||
|
@ -5,7 +5,11 @@ cd "$(dirname "$0")"
|
||||
|
||||
eval "$(../ci/channel-info.sh)"
|
||||
|
||||
LATEST_SOLANA_RELEASE_VERSION=$BETA_CHANNEL_LATEST_TAG
|
||||
if [[ -n $BETA_CHANNEL_LATEST_TAG ]]; then
|
||||
LATEST_SOLANA_RELEASE_VERSION=$BETA_CHANNEL_LATEST_TAG
|
||||
else
|
||||
LATEST_SOLANA_RELEASE_VERSION=$STABLE_CHANNEL_LATEST_TAG
|
||||
fi
|
||||
VERSION_FOR_DOCS_RS="${LATEST_SOLANA_RELEASE_VERSION:1}"
|
||||
|
||||
set -x
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -57,7 +57,7 @@ that you are calling.
|
||||
|
||||
This program error can occur while trying to deserialize the instruction, check
|
||||
that the structure passed in matches exactly the instruction. There may be some
|
||||
padding between fields. If the program implements the Rust `Pack` trait then ry
|
||||
padding between fields. If the program implements the Rust `Pack` trait then try
|
||||
packing and unpacking the instruction type `T` to determine the exact encoding
|
||||
the program expects:
|
||||
|
||||
|
@ -23,7 +23,7 @@ Explorers:
|
||||
- Devnet includes a token faucet for airdrops for application testing
|
||||
- Devnet may be subject to ledger resets
|
||||
- Devnet typically runs a newer software version than Mainnet Beta
|
||||
- Gossip entrypoint for Devnet: `devnet.solana.com:8001`
|
||||
- Gossip entrypoint for Devnet: `entrypoint.devnet.solana.com:8001`
|
||||
- RPC URL for Devnet: `https://devnet.solana.com`
|
||||
|
||||
##### Example `solana` command-line configuration
|
||||
@ -45,6 +45,7 @@ $ solana-validator \
|
||||
--dynamic-port-range 8000-8010 \
|
||||
--entrypoint entrypoint.devnet.solana.com:8001 \
|
||||
--expected-genesis-hash EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG \
|
||||
--wal-recovery-mode skip_any_corrupted_record \
|
||||
--limit-ledger-size
|
||||
```
|
||||
|
||||
@ -63,7 +64,7 @@ The `--trusted-validator`s is operated by Solana
|
||||
- Testnet includes a token faucet for airdrops for application testing
|
||||
- Testnet typically runs a newer software release than both Devnet and
|
||||
Mainnet Beta
|
||||
- Gossip entrypoint for Testnet: `35.203.170.30:8001`
|
||||
- Gossip entrypoint for Testnet: `entrypoint.testnet.solana.com:8001`
|
||||
- RPC URL for Testnet: `https://testnet.solana.com`
|
||||
|
||||
##### Example `solana` command-line configuration
|
||||
@ -88,6 +89,7 @@ $ solana-validator \
|
||||
--dynamic-port-range 8000-8010 \
|
||||
--entrypoint entrypoint.testnet.solana.com:8001 \
|
||||
--expected-genesis-hash 4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY \
|
||||
--wal-recovery-mode skip_any_corrupted_record \
|
||||
--limit-ledger-size
|
||||
```
|
||||
|
||||
@ -131,10 +133,11 @@ $ solana-validator \
|
||||
--no-untrusted-rpc \
|
||||
--ledger ~/validator-ledger \
|
||||
--rpc-port 8899 \
|
||||
--private-rpc \
|
||||
--dynamic-port-range 8000-8010 \
|
||||
--entrypoint mainnet-beta.solana.com:8001 \
|
||||
--expected-genesis-hash 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d \
|
||||
--expected-shred-version 64864 \
|
||||
--wal-recovery-mode skip_any_corrupted_record \
|
||||
--limit-ledger-size
|
||||
```
|
||||
|
||||
|
@ -8,8 +8,8 @@ import styles from "./styles.module.css";
|
||||
|
||||
const features = [
|
||||
{
|
||||
title: <>⛏ Build an Application</>,
|
||||
imageUrl: "apps",
|
||||
title: <>⛏ Build Your First App</>,
|
||||
imageUrl: "https://github.com/solana-labs/example-helloworld",
|
||||
description: <>Get started building your decentralized app or marketplace.</>,
|
||||
},
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ Here are our recommendations for low, medium, and high end machine specification
|
||||
| :------------------ | :---------------------------------------------------- | :--------------------- | :--------------------- | :------------------------------------------------------------------------------------- |
|
||||
| CPU | AMD Ryzen 3950x | AMD Threadripper 3960x | AMD Threadripper 3990x | Consider a 10Gb-capable motherboard with as many PCIe lanes and m.2 slots as possible. |
|
||||
| RAM | 16GB | 64GB | 128GB | |
|
||||
| OS Drive | Samsung 860 Evo 2TB | Samsung 860 Evo 4TB | Samsung 860 Evo 4TB | Or equivalent SSD |
|
||||
| Ledger Drive | Samsung 860 Evo 2TB | Samsung 860 Evo 4TB | Samsung 860 Evo 4TB | Or equivalent SSD |
|
||||
| Accounts Drive\(s\) | None | Samsung 970 Pro 1TB | 2x Samsung 970 Pro 1TB | |
|
||||
| GPU | Nvidia 1660ti | Nvidia 2080 Ti | 2x Nvidia 2080 Ti | Any number of cuda-capable GPUs are supported on Linux platforms. |
|
||||
|
||||
|
@ -144,3 +144,46 @@ Commission can also be changed later with the
|
||||
When setting the commission, only integer values in the set [0-100] are accepted.
|
||||
The integer represents the number of percentage points for the commission, so
|
||||
creating an account with `--commission 10` will set a 10% commission.
|
||||
|
||||
## Key Rotation
|
||||
Rotating the vote account authority keys require special handling when dealing
|
||||
with a live validator.
|
||||
|
||||
### Vote Account Validator Identity
|
||||
|
||||
You will need access to the _withdraw authority_ keypair for the vote account to
|
||||
change the validator identity. The follow steps assume that
|
||||
`~/withdraw-authority.json` is that keypair.
|
||||
|
||||
1. Create the new validator identity keypair, `solana-keygen new -o ~/new-validator-keypair.json`.
|
||||
2. Ensure that the new identity account has been funded, `solana transfer ~/new-validator-keypair.json 500`.
|
||||
3. Run `solana vote-update-validator ~/vote-account-keypair.json ~/new-validator-keypair.json ~/withdraw-authority.json`
|
||||
to modify the validator identity in your vote account
|
||||
4. Restart your validator with the new identity keypair for the `--identity` argument
|
||||
|
||||
### Vote Account Authorized Voter
|
||||
The _vote authority_ keypair may only be changed at epoch boundaries and
|
||||
requires some additional arguments to `solana-validator` for a seamless
|
||||
migration.
|
||||
|
||||
1. Run `solana epoch-info`. If there is not much time remaining time in the
|
||||
current epoch, consider waiting for the next epoch to allow your validator
|
||||
plenty of time to restart and catch up.
|
||||
2. Create the new vote authority keypair, `solana-keygen new -o ~/new-vote-authority.json`.
|
||||
3. Determine the current _vote authority_ keypair by running `solana
|
||||
vote-account ~/vote-account-keypair.json`. It may be validator's
|
||||
identity account (the default) or some other keypair. The following steps
|
||||
assume that ` ~/validator-keypair.json` is that keypair.
|
||||
4. Run `solana vote-authorize-voter ~/vote-account-keypair.json ~/validator-keypair.json ~/new-vote-authority.json`.
|
||||
The new vote authority is scheduled to become active starting at the next epoch.
|
||||
5. `solana-validator` now needs to be restarted with the old and new vote
|
||||
authority keypairs, so that it can smoothly transition at the next epoch. Add
|
||||
the two arguments on restart: `--authorized-voter ~/validator-keypair.json
|
||||
--authorized-voter ~/new-vote-authority.json`
|
||||
6. After the cluster reaches the next epoch, remove the
|
||||
`--authorized-voter ~/validator-keypair.json` argument and restart
|
||||
`solana-validator`, as the old vote authority keypair is no longer required.
|
||||
|
||||
|
||||
### Vote Account Authorized Withdrawer
|
||||
No special handling is required. Use the `solana vote-authorize-withdrawer` command as needed.
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-dos"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -13,16 +13,16 @@ bincode = "1.3.1"
|
||||
clap = "2.33.1"
|
||||
log = "0.4.8"
|
||||
rand = "0.7.0"
|
||||
rayon = "1.4.0"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
rayon = "1.4.1"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-download-utils"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Download Utils"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -13,9 +13,9 @@ bzip2 = "0.3.3"
|
||||
console = "0.11.3"
|
||||
indicatif = "0.15.0"
|
||||
log = "0.4.8"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
tar = "0.4.28"
|
||||
|
||||
[lib]
|
||||
|
2
explorer/wasm/Cargo.lock
generated
2
explorer/wasm/Cargo.lock
generated
@ -98,7 +98,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-wasm"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"bs58",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-sdk-wasm"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana SDK Wasm"
|
||||
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@ -113,7 +113,7 @@ pub type Epoch = u64;
|
||||
|
||||
#[wasm_bindgen]
|
||||
#[repr(transparent)]
|
||||
#[derive(Serialize, Deserialize, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Serialize, Debug, Deserialize, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
pub struct Pubkey([u8; 32]);
|
||||
|
||||
#[wasm_bindgen]
|
||||
@ -164,7 +164,7 @@ impl Stake {
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
#[derive(Serialize, Deserialize, PartialEq, Clone, Copy)]
|
||||
#[derive(Serialize, Debug, Deserialize, PartialEq, Clone, Copy)]
|
||||
pub struct Delegation {
|
||||
/// to whom the stake is delegated
|
||||
voter_pubkey: Pubkey,
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-faucet"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Faucet"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -16,11 +16,11 @@ clap = "2.33"
|
||||
log = "0.4.8"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
tokio = "0.1"
|
||||
tokio-codec = "0.1"
|
||||
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-genesis"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -15,17 +15,17 @@ chrono = "0.4"
|
||||
serde = "1.0.112"
|
||||
serde_json = "1.0.56"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
tempfile = "3.1.0"
|
||||
|
||||
[[bin]]
|
||||
|
@ -3,20 +3,20 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-gossip"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33.1"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-install"
|
||||
description = "The solana cluster software installer"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -20,19 +20,19 @@ dirs = "2.0.2"
|
||||
indicatif = "0.15.0"
|
||||
lazy_static = "1.4.0"
|
||||
nix = "0.17.0"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
semver = "0.9.0"
|
||||
tar = "0.4.28"
|
||||
tempdir = "0.3.7"
|
||||
tempfile = "3.1.0"
|
||||
url = "2.1.1"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
|
@ -23,7 +23,7 @@ use std::{
|
||||
sync::mpsc,
|
||||
time::{Duration, Instant, SystemTime},
|
||||
};
|
||||
use tempdir::TempDir;
|
||||
use tempfile::TempDir;
|
||||
use url::Url;
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
@ -84,7 +84,7 @@ fn download_to_temp(
|
||||
|
||||
let url = Url::parse(url).map_err(|err| format!("Unable to parse {}: {}", url, err))?;
|
||||
|
||||
let temp_dir = TempDir::new(clap::crate_name!())?;
|
||||
let temp_dir = TempDir::new()?;
|
||||
let temp_file = temp_dir.path().join("download");
|
||||
|
||||
let client = reqwest::blocking::Client::new();
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-keygen"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana key generation utility"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -13,11 +13,11 @@ bs58 = "0.3.1"
|
||||
clap = "2.33"
|
||||
dirs = "2.0.2"
|
||||
num_cpus = "1.13.0"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.4.1" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
tiny-bip39 = "0.7.0"
|
||||
|
||||
[[bin]]
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-ledger-tool"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -19,18 +19,18 @@ log = { version = "0.4.8" }
|
||||
regex = "1"
|
||||
serde_json = "1.0.56"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.4.0" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.4.1" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
tempfile = "3.1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-ledger"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana ledger"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -26,23 +26,24 @@ log = { version = "0.4.8" }
|
||||
num_cpus = "1.13.0"
|
||||
rand = "0.7.0"
|
||||
rand_chacha = "0.2.2"
|
||||
rayon = "1.4.0"
|
||||
rayon = "1.4.1"
|
||||
reed-solomon-erasure = { version = "4.0.2", features = ["simd-accel"] }
|
||||
serde = "1.0.112"
|
||||
serde_bytes = "0.11.4"
|
||||
sha2 = "0.8.2"
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-perf = { path = "../perf", version = "1.4.0" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.4.1" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
solana-perf = { path = "../perf", version = "1.4.1" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
tempfile = "3.1.0"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
@ -58,7 +59,7 @@ features = ["lz4"]
|
||||
[dev-dependencies]
|
||||
assert_matches = "1.3.0"
|
||||
matches = "0.1.6"
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.4.0" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.4.1" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@ -66,7 +66,7 @@ pub fn load(
|
||||
compression,
|
||||
genesis_config,
|
||||
process_options.debug_keys.clone(),
|
||||
process_options.additional_builtins.as_ref(),
|
||||
Some(&crate::builtins::get(genesis_config.cluster_type)),
|
||||
)
|
||||
.expect("Load from snapshot failed");
|
||||
|
||||
|
@ -33,6 +33,7 @@ use solana_sdk::{
|
||||
program_utils::limited_deserialize,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signature, Signer},
|
||||
stake_weighted_timestamp::{calculate_stake_weighted_timestamp, TIMESTAMP_SLOT_RANGE},
|
||||
timing::timestamp,
|
||||
transaction::Transaction,
|
||||
};
|
||||
@ -77,7 +78,6 @@ thread_local!(static PAR_THREAD_POOL_ALL_CPUS: RefCell<ThreadPool> = RefCell::ne
|
||||
pub const MAX_COMPLETED_SLOTS_IN_CHANNEL: usize = 100_000;
|
||||
pub const MAX_TURBINE_PROPAGATION_IN_MS: u64 = 100;
|
||||
pub const MAX_TURBINE_DELAY_IN_TICKS: u64 = MAX_TURBINE_PROPAGATION_IN_MS / MS_PER_TICK;
|
||||
const TIMESTAMP_SLOT_RANGE: usize = 16;
|
||||
|
||||
// An upper bound on maximum number of data shreds we can handle in a slot
|
||||
// 32K shreds would allow ~320K peak TPS
|
||||
@ -1630,7 +1630,7 @@ impl Blockstore {
|
||||
|
||||
let mut calculate_timestamp = Measure::start("calculate_timestamp");
|
||||
let stake_weighted_timestamp =
|
||||
calculate_stake_weighted_timestamp(unique_timestamps, stakes, slot, slot_duration)
|
||||
calculate_stake_weighted_timestamp(&unique_timestamps, stakes, slot, slot_duration)
|
||||
.ok_or(BlockstoreError::EmptyEpochStakes)?;
|
||||
calculate_timestamp.stop();
|
||||
datapoint_info!(
|
||||
@ -3130,33 +3130,6 @@ fn slot_has_updates(slot_meta: &SlotMeta, slot_meta_backup: &Option<SlotMeta>) -
|
||||
(slot_meta_backup.is_some() && slot_meta_backup.as_ref().unwrap().consumed != slot_meta.consumed))
|
||||
}
|
||||
|
||||
fn calculate_stake_weighted_timestamp(
|
||||
unique_timestamps: HashMap<Pubkey, (Slot, UnixTimestamp)>,
|
||||
stakes: &HashMap<Pubkey, (u64, Account)>,
|
||||
slot: Slot,
|
||||
slot_duration: Duration,
|
||||
) -> Option<UnixTimestamp> {
|
||||
let (stake_weighted_timestamps_sum, total_stake) = unique_timestamps
|
||||
.into_iter()
|
||||
.filter_map(|(vote_pubkey, (timestamp_slot, timestamp))| {
|
||||
let offset = (slot - timestamp_slot) as u32 * slot_duration;
|
||||
stakes.get(&vote_pubkey).map(|(stake, _account)| {
|
||||
(
|
||||
(timestamp as u128 + offset.as_secs() as u128) * *stake as u128,
|
||||
stake,
|
||||
)
|
||||
})
|
||||
})
|
||||
.fold((0, 0), |(timestamps, stakes), (timestamp, stake)| {
|
||||
(timestamps + timestamp, stakes + *stake as u128)
|
||||
});
|
||||
if total_stake > 0 {
|
||||
Some((stake_weighted_timestamps_sum / total_stake) as i64)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a new ledger with slot 0 full of ticks (and only ticks).
|
||||
//
|
||||
// Returns the blockhash that can be used to append entries with.
|
||||
@ -3478,7 +3451,6 @@ pub mod tests {
|
||||
hash::{self, hash, Hash},
|
||||
instruction::CompiledInstruction,
|
||||
message::Message,
|
||||
native_token::sol_to_lamports,
|
||||
packet::PACKET_DATA_SIZE,
|
||||
pubkey::Pubkey,
|
||||
signature::Signature,
|
||||
@ -5686,6 +5658,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances.clone(),
|
||||
post_balances: post_balances.clone(),
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
@ -5699,6 +5672,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances.clone(),
|
||||
post_balances: post_balances.clone(),
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
@ -5710,6 +5684,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
}),
|
||||
}
|
||||
})
|
||||
@ -5886,113 +5861,6 @@ pub mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_calculate_stake_weighted_timestamp() {
|
||||
let recent_timestamp: UnixTimestamp = 1_578_909_061;
|
||||
let slot = 5;
|
||||
let slot_duration = Duration::from_millis(400);
|
||||
let expected_offset = (slot * slot_duration).as_secs();
|
||||
let pubkey0 = Pubkey::new_rand();
|
||||
let pubkey1 = Pubkey::new_rand();
|
||||
let pubkey2 = Pubkey::new_rand();
|
||||
let pubkey3 = Pubkey::new_rand();
|
||||
let unique_timestamps: HashMap<Pubkey, (Slot, UnixTimestamp)> = [
|
||||
(pubkey0, (0, recent_timestamp)),
|
||||
(pubkey1, (0, recent_timestamp)),
|
||||
(pubkey2, (0, recent_timestamp)),
|
||||
(pubkey3, (0, recent_timestamp)),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
let stakes: HashMap<Pubkey, (u64, Account)> = [
|
||||
(
|
||||
pubkey0,
|
||||
(
|
||||
sol_to_lamports(4_500_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
(
|
||||
pubkey1,
|
||||
(
|
||||
sol_to_lamports(4_500_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
(
|
||||
pubkey2,
|
||||
(
|
||||
sol_to_lamports(4_500_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
(
|
||||
pubkey3,
|
||||
(
|
||||
sol_to_lamports(4_500_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect();
|
||||
assert_eq!(
|
||||
calculate_stake_weighted_timestamp(
|
||||
unique_timestamps.clone(),
|
||||
&stakes,
|
||||
slot as Slot,
|
||||
slot_duration
|
||||
),
|
||||
Some(recent_timestamp + expected_offset as i64)
|
||||
);
|
||||
|
||||
let stakes: HashMap<Pubkey, (u64, Account)> = [
|
||||
(
|
||||
pubkey0,
|
||||
(
|
||||
sol_to_lamports(15_000_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
(
|
||||
pubkey1,
|
||||
(
|
||||
sol_to_lamports(1_000_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
(
|
||||
pubkey2,
|
||||
(
|
||||
sol_to_lamports(1_000_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
(
|
||||
pubkey3,
|
||||
(
|
||||
sol_to_lamports(1_000_000_000.0),
|
||||
Account::new(1, 0, &Pubkey::default()),
|
||||
),
|
||||
),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect();
|
||||
assert_eq!(
|
||||
calculate_stake_weighted_timestamp(
|
||||
unique_timestamps,
|
||||
&stakes,
|
||||
slot as Slot,
|
||||
slot_duration
|
||||
),
|
||||
Some(recent_timestamp + expected_offset as i64)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_persist_transaction_status() {
|
||||
let blockstore_path = get_tmp_ledger_path!();
|
||||
@ -6006,6 +5874,7 @@ pub mod tests {
|
||||
index: 0,
|
||||
instructions: vec![CompiledInstruction::new(1, &(), vec![0])],
|
||||
}];
|
||||
let log_messages_vec = vec![String::from("Test message\n")];
|
||||
|
||||
// result not found
|
||||
assert!(transaction_status_cf
|
||||
@ -6025,6 +5894,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances_vec.clone(),
|
||||
post_balances: post_balances_vec.clone(),
|
||||
inner_instructions: Some(inner_instructions_vec.clone()),
|
||||
log_messages: Some(log_messages_vec.clone()),
|
||||
},
|
||||
)
|
||||
.is_ok());
|
||||
@ -6036,6 +5906,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
} = transaction_status_cf
|
||||
.get((0, Signature::default(), 0))
|
||||
.unwrap()
|
||||
@ -6045,6 +5916,7 @@ pub mod tests {
|
||||
assert_eq!(pre_balances, pre_balances_vec);
|
||||
assert_eq!(post_balances, post_balances_vec);
|
||||
assert_eq!(inner_instructions.unwrap(), inner_instructions_vec);
|
||||
assert_eq!(log_messages.unwrap(), log_messages_vec);
|
||||
|
||||
// insert value
|
||||
assert!(transaction_status_cf
|
||||
@ -6056,6 +5928,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances_vec.clone(),
|
||||
post_balances: post_balances_vec.clone(),
|
||||
inner_instructions: Some(inner_instructions_vec.clone()),
|
||||
log_messages: Some(log_messages_vec.clone()),
|
||||
},
|
||||
)
|
||||
.is_ok());
|
||||
@ -6067,6 +5940,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
} = transaction_status_cf
|
||||
.get((0, Signature::new(&[2u8; 64]), 9))
|
||||
.unwrap()
|
||||
@ -6078,6 +5952,7 @@ pub mod tests {
|
||||
assert_eq!(pre_balances, pre_balances_vec);
|
||||
assert_eq!(post_balances, post_balances_vec);
|
||||
assert_eq!(inner_instructions.unwrap(), inner_instructions_vec);
|
||||
assert_eq!(log_messages.unwrap(), log_messages_vec);
|
||||
}
|
||||
Blockstore::destroy(&blockstore_path).expect("Expected successful database destruction");
|
||||
}
|
||||
@ -6305,6 +6180,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances_vec,
|
||||
post_balances: post_balances_vec,
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
};
|
||||
|
||||
let signature1 = Signature::new(&[1u8; 64]);
|
||||
@ -6438,6 +6314,7 @@ pub mod tests {
|
||||
index: 0,
|
||||
instructions: vec![CompiledInstruction::new(1, &(), vec![0])],
|
||||
}]);
|
||||
let log_messages = Some(vec![String::from("Test message\n")]);
|
||||
let signature = transaction.signatures[0];
|
||||
blockstore
|
||||
.transaction_status_cf
|
||||
@ -6449,6 +6326,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances.clone(),
|
||||
post_balances: post_balances.clone(),
|
||||
inner_instructions: inner_instructions.clone(),
|
||||
log_messages: log_messages.clone(),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
@ -6460,6 +6338,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
}),
|
||||
}
|
||||
})
|
||||
@ -6900,6 +6779,7 @@ pub mod tests {
|
||||
pre_balances: vec![],
|
||||
post_balances: vec![],
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -16,8 +16,8 @@ use solana_metrics::{datapoint_error, inc_new_counter_debug};
|
||||
use solana_rayon_threadlimit::get_thread_count;
|
||||
use solana_runtime::{
|
||||
bank::{
|
||||
Bank, Builtins, InnerInstructionsList, TransactionBalancesSet, TransactionProcessResult,
|
||||
TransactionResults,
|
||||
Bank, InnerInstructionsList, TransactionBalancesSet, TransactionLogMessages,
|
||||
TransactionProcessResult, TransactionResults,
|
||||
},
|
||||
bank_forks::BankForks,
|
||||
bank_utils,
|
||||
@ -103,12 +103,13 @@ fn execute_batch(
|
||||
transaction_status_sender: Option<TransactionStatusSender>,
|
||||
replay_vote_sender: Option<&ReplayVoteSender>,
|
||||
) -> Result<()> {
|
||||
let (tx_results, balances, inner_instructions) =
|
||||
let (tx_results, balances, inner_instructions, transaction_logs) =
|
||||
batch.bank().load_execute_and_commit_transactions(
|
||||
batch,
|
||||
MAX_PROCESSING_AGE,
|
||||
transaction_status_sender.is_some(),
|
||||
transaction_status_sender.is_some(),
|
||||
transaction_status_sender.is_some(),
|
||||
);
|
||||
|
||||
bank_utils::find_and_send_votes(batch.transactions(), &tx_results, replay_vote_sender);
|
||||
@ -127,6 +128,7 @@ fn execute_batch(
|
||||
processing_results,
|
||||
balances,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
sender,
|
||||
);
|
||||
}
|
||||
@ -318,7 +320,6 @@ pub struct ProcessOptions {
|
||||
pub new_hard_forks: Option<Vec<Slot>>,
|
||||
pub frozen_accounts: Vec<Pubkey>,
|
||||
pub debug_keys: Option<Arc<HashSet<Pubkey>>>,
|
||||
pub additional_builtins: Option<Builtins>,
|
||||
}
|
||||
|
||||
pub fn process_blockstore(
|
||||
@ -342,7 +343,7 @@ pub fn process_blockstore(
|
||||
account_paths,
|
||||
&opts.frozen_accounts,
|
||||
opts.debug_keys.clone(),
|
||||
opts.additional_builtins.as_ref(),
|
||||
Some(&crate::builtins::get(genesis_config.cluster_type)),
|
||||
);
|
||||
let bank0 = Arc::new(bank0);
|
||||
info!("processing ledger for slot 0...");
|
||||
@ -1031,6 +1032,7 @@ pub struct TransactionStatusBatch {
|
||||
pub statuses: Vec<TransactionProcessResult>,
|
||||
pub balances: TransactionBalancesSet,
|
||||
pub inner_instructions: Vec<Option<InnerInstructionsList>>,
|
||||
pub transaction_logs: Vec<TransactionLogMessages>,
|
||||
}
|
||||
|
||||
pub type TransactionStatusSender = Sender<TransactionStatusBatch>;
|
||||
@ -1042,6 +1044,7 @@ pub fn send_transaction_status_batch(
|
||||
statuses: Vec<TransactionProcessResult>,
|
||||
balances: TransactionBalancesSet,
|
||||
inner_instructions: Vec<Option<InnerInstructionsList>>,
|
||||
transaction_logs: Vec<TransactionLogMessages>,
|
||||
transaction_status_sender: TransactionStatusSender,
|
||||
) {
|
||||
let slot = bank.slot();
|
||||
@ -1052,6 +1055,7 @@ pub fn send_transaction_status_batch(
|
||||
statuses,
|
||||
balances,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
}) {
|
||||
trace!(
|
||||
"Slot {} transaction_status send batch failed: {:?}",
|
||||
@ -2891,11 +2895,13 @@ pub mod tests {
|
||||
},
|
||||
_balances,
|
||||
_inner_instructions,
|
||||
_log_messages,
|
||||
) = batch.bank().load_execute_and_commit_transactions(
|
||||
&batch,
|
||||
MAX_PROCESSING_AGE,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
let (err, signature) = get_first_error(&batch, fee_collection_results).unwrap();
|
||||
// First error found should be for the 2nd transaction, due to iteration_order
|
||||
|
@ -1,3 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate solana_bpf_loader_program;
|
||||
|
||||
pub mod bank_forks_utils;
|
||||
pub mod bigtable_upload;
|
||||
pub mod block_error;
|
||||
@ -7,6 +10,7 @@ pub mod ancestor_iterator;
|
||||
pub mod blockstore_db;
|
||||
pub mod blockstore_meta;
|
||||
pub mod blockstore_processor;
|
||||
pub mod builtins;
|
||||
pub mod entry;
|
||||
pub mod erasure;
|
||||
pub mod genesis_utils;
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-local-cluster"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -13,21 +13,21 @@ itertools = "0.9.0"
|
||||
gag = "0.1.10"
|
||||
log = "0.4.8"
|
||||
rand = "0.7.0"
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.0" }
|
||||
solana-core = { path = "../core", version = "1.4.0" }
|
||||
solana-client = { path = "../client", version = "1.4.0" }
|
||||
solana-download-utils = { path = "../download-utils", version = "1.4.0" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.4.0" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.4.1" }
|
||||
solana-core = { path = "../core", version = "1.4.1" }
|
||||
solana-client = { path = "../client", version = "1.4.1" }
|
||||
solana-download-utils = { path = "../download-utils", version = "1.4.1" }
|
||||
solana-faucet = { path = "../faucet", version = "1.4.1" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-runtime = { path = "../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.4.1" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.4.1" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.4.1" }
|
||||
tempfile = "3.1.0"
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.0" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.1" }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_matches = "1.3.0"
|
||||
|
@ -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.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -14,9 +14,9 @@ byte-unit = "4.0.8"
|
||||
clap = "2.33.1"
|
||||
serde = "1.0.112"
|
||||
serde_json = "1.0.56"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
|
||||
[[bin]]
|
||||
name = "solana-log-analyzer"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-logger"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Logger"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "solana-measure"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
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.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
|
||||
[target."cfg(unix)".dependencies]
|
||||
jemallocator = "0.3.2"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-merkle-tree"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Merkle Tree"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -9,7 +9,7 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
fast-math = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-metrics"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Metrics"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -13,8 +13,8 @@ env_logger = "0.7.1"
|
||||
gethostname = "0.2.1"
|
||||
lazy_static = "1.4.0"
|
||||
log = "0.4.8"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.7.0"
|
||||
|
@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-net-shaper"
|
||||
description = "The solana cluster network shaping tool"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -13,8 +13,8 @@ publish = false
|
||||
clap = "2.33.1"
|
||||
serde = "1.0.112"
|
||||
serde_json = "1.0.56"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
rand = "0.7.0"
|
||||
|
||||
[[bin]]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-net-utils"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Network Utilities"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -18,9 +18,9 @@ rand = "0.7.0"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
socket2 = "0.3.15"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
tokio = "0.1"
|
||||
tokio-codec = "0.1"
|
||||
url = "2.1.1"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-notifier"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Notifier"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -10,7 +10,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4.8"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serde_json = "1.0"
|
||||
|
||||
[lib]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-perf"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana Performance APIs"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -17,11 +17,11 @@ serde = "1.0.112"
|
||||
dlopen_derive = "0.1.4"
|
||||
lazy_static = "1.4.0"
|
||||
log = "0.4.8"
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.0" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.1" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.4.1" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-metrics = { path = "../metrics", version = "1.4.1" }
|
||||
curve25519-dalek = { version = "2" }
|
||||
|
||||
[lib]
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-poh-bench"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@ -12,13 +12,13 @@ clap = "2.33.1"
|
||||
log = "0.4.6"
|
||||
rand = "0.7.0"
|
||||
rayon = "1.4.0"
|
||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||
solana-version = { path = "../version", version = "1.4.0" }
|
||||
solana-perf = { path = "../perf", version = "1.4.0" }
|
||||
solana-logger = { path = "../logger", version = "1.4.1" }
|
||||
solana-ledger = { path = "../ledger", version = "1.4.1" }
|
||||
solana-sdk = { path = "../sdk", version = "1.4.1" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.1" }
|
||||
solana-measure = { path = "../measure", version = "1.4.1" }
|
||||
solana-version = { path = "../version", version = "1.4.1" }
|
||||
solana-perf = { path = "../perf", version = "1.4.1" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
170
programs/bpf/Cargo.lock
generated
170
programs/bpf/Cargo.lock
generated
@ -79,12 +79,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.12.3"
|
||||
@ -301,12 +295,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6"
|
||||
checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"maybe-uninit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -337,12 +331,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab6bffe714b6bb07e42f201352c34f51fefd355ace793f9e638ebd52d23f98d2"
|
||||
checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"maybe-uninit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -502,28 +497,6 @@ dependencies = [
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "failure"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"failure_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "failure_derive"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.19",
|
||||
"quote 1.0.6",
|
||||
"syn 1.0.27",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fake-simd"
|
||||
version = "0.1.2"
|
||||
@ -850,9 +823,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hyper-rustls"
|
||||
version = "0.20.0"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08"
|
||||
checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6"
|
||||
dependencies = [
|
||||
"bytes 0.5.4",
|
||||
"futures-util",
|
||||
@ -893,6 +866,12 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipnet"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.9.0"
|
||||
@ -1430,9 +1409,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfd016f0c045ad38b5251be2c9c0ab806917f82da4d36b2a327e5166adad9270"
|
||||
checksum = "dcf6960dc9a5b4ee8d3e4c5787b4a112a8818e0290a42ff664ad60692fdf2032"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"crossbeam-deque",
|
||||
@ -1442,9 +1421,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rayon-core"
|
||||
version = "1.8.0"
|
||||
version = "1.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91739a34c4355b5434ce54c9086c5895604a9c278586d1f1aa95e04f66b525a0"
|
||||
checksum = "e8c4fec834fb6e6d2dd5eece3c7b432a52f0ba887cf40e595190c4107edc08bf"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"crossbeam-deque",
|
||||
@ -1488,11 +1467,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.10.6"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b82c9238b305f26f53443e3a4bc8528d64b8d0bee408ec949eb7bf5635ec680"
|
||||
checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e"
|
||||
dependencies = [
|
||||
"base64 0.12.3",
|
||||
"base64",
|
||||
"bytes 0.5.4",
|
||||
"encoding_rs",
|
||||
"futures-core",
|
||||
@ -1501,6 +1480,7 @@ dependencies = [
|
||||
"http-body",
|
||||
"hyper",
|
||||
"hyper-rustls",
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"lazy_static",
|
||||
"log",
|
||||
@ -1554,11 +1534,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.17.0"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1"
|
||||
checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81"
|
||||
dependencies = [
|
||||
"base64 0.11.0",
|
||||
"base64",
|
||||
"log",
|
||||
"ring",
|
||||
"sct",
|
||||
@ -1741,13 +1721,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.4.0"
|
||||
version = "1.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4"
|
||||
checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-loader-program"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder 1.3.4",
|
||||
@ -1762,7 +1742,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-programs"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder 1.3.4",
|
||||
@ -1778,7 +1758,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-128bit"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-128bit-dep",
|
||||
"solana-sdk",
|
||||
@ -1786,28 +1766,35 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-128bit-dep"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-alloc"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-call-depth"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-custom-heap"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-dep-crate"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"solana-sdk",
|
||||
@ -1815,21 +1802,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-deprecated_loader"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-dup-accounts"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-error-handling"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"num-derive 0.2.5",
|
||||
"num-traits",
|
||||
@ -1839,21 +1826,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-external-spend"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-instruction-introspection"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-invoke"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-invoked",
|
||||
"solana-sdk",
|
||||
@ -1861,21 +1848,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-invoked"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-iter"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-many-args"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-many-args-dep",
|
||||
"solana-sdk",
|
||||
@ -1883,28 +1870,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-many-args-dep"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-noop"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-panic"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-param-passing"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-param-passing-dep",
|
||||
"solana-sdk",
|
||||
@ -1912,14 +1899,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-param-passing-dep"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-rand"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"rand",
|
||||
@ -1928,7 +1915,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-ristretto"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"curve25519-dalek 3.0.0",
|
||||
"getrandom",
|
||||
@ -1937,28 +1924,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sanity"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sha256"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sysval"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-config-program"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"chrono",
|
||||
@ -1970,7 +1957,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-crate-features"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes 0.4.12",
|
||||
@ -1978,7 +1965,6 @@ dependencies = [
|
||||
"curve25519-dalek 2.1.0",
|
||||
"ed25519-dalek",
|
||||
"either",
|
||||
"failure",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
@ -1993,7 +1979,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-logger"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
@ -2002,7 +1988,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-measure"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"jemalloc-ctl",
|
||||
"jemallocator",
|
||||
@ -2013,7 +1999,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-metrics"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"gethostname",
|
||||
@ -2025,7 +2011,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-rayon-threadlimit"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"num_cpus",
|
||||
@ -2033,7 +2019,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-runtime"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"blake3",
|
||||
@ -2079,7 +2065,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"assert_matches",
|
||||
"bincode",
|
||||
@ -2119,7 +2105,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bs58",
|
||||
"proc-macro2 1.0.19",
|
||||
@ -2130,7 +2116,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro-frozen-abi"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"proc-macro2 1.0.19",
|
||||
@ -2141,7 +2127,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-secp256k1-program"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"digest 0.9.0",
|
||||
@ -2154,7 +2140,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-stake-program"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
@ -2173,7 +2159,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-vote-program"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
@ -2191,9 +2177,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.1.31"
|
||||
version = "0.1.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "962f8f04ac7239fe4dd45fa4ce706ec78b59a0da9f41def463832857e36c60b0"
|
||||
checksum = "9a95dbe2b00920ac4e1524b7442cf5319f01e8fa5742930ac60148882fd7738b"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"combine",
|
||||
@ -2455,9 +2441,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.13.1"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "15cb62a0d2770787abc96e99c1cd98fcf17f94959f3af63ca85bdfb203f051b4"
|
||||
checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"rustls",
|
||||
@ -2607,7 +2593,7 @@ version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4"
|
||||
dependencies = [
|
||||
"smallvec 1.4.0",
|
||||
"smallvec 1.4.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "solana-bpf-programs"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
documentation = "https://docs.rs/solana"
|
||||
homepage = "https://solana.com/"
|
||||
readme = "README.md"
|
||||
@ -22,12 +22,12 @@ walkdir = "2"
|
||||
bincode = "1.1.4"
|
||||
byteorder = "1.3.2"
|
||||
elf = "0.0.10"
|
||||
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.4.0" }
|
||||
solana-logger = { path = "../../logger", version = "1.4.0" }
|
||||
solana-measure = { path = "../../measure", version = "1.4.0" }
|
||||
solana-runtime = { path = "../../runtime", version = "1.4.0" }
|
||||
solana-sdk = { path = "../../sdk", version = "1.4.0" }
|
||||
solana_rbpf = "=0.1.31"
|
||||
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.4.1" }
|
||||
solana-logger = { path = "../../logger", version = "1.4.1" }
|
||||
solana-measure = { path = "../../measure", version = "1.4.1" }
|
||||
solana-runtime = { path = "../../runtime", version = "1.4.1" }
|
||||
solana-sdk = { path = "../../sdk", version = "1.4.1" }
|
||||
solana_rbpf = "=0.1.32"
|
||||
|
||||
[[bench]]
|
||||
name = "bpf_loader"
|
||||
@ -57,6 +57,7 @@ members = [
|
||||
"rust/ristretto",
|
||||
"rust/sanity",
|
||||
"rust/sha256",
|
||||
"rust/call_depth",
|
||||
"rust/sysval",
|
||||
]
|
||||
|
||||
|
@ -85,6 +85,7 @@ fn main() {
|
||||
"ristretto",
|
||||
"sanity",
|
||||
"sha256",
|
||||
"call_depth",
|
||||
"sysval",
|
||||
];
|
||||
for program in rust_programs.iter() {
|
||||
|
@ -31,9 +31,9 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
return ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
uint8_t nonce1 = params.data[1];
|
||||
uint8_t nonce2 = params.data[2];
|
||||
uint8_t nonce3 = params.data[3];
|
||||
uint8_t bump_seed1 = params.data[1];
|
||||
uint8_t bump_seed2 = params.data[2];
|
||||
uint8_t bump_seed3 = params.data[3];
|
||||
|
||||
switch (params.data[0]) {
|
||||
case TEST_SUCCESS: {
|
||||
@ -54,7 +54,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
uint8_t seed1[] = {'Y', 'o', 'u', ' ', 'p', 'a', 's', 's',
|
||||
' ', 'b', 'u', 't', 't', 'e', 'r'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{&nonce1, 1}};
|
||||
{&bump_seed1, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)}};
|
||||
sol_assert(SUCCESS == sol_invoke_signed(&instruction, accounts,
|
||||
SOL_ARRAY_SIZE(accounts),
|
||||
@ -144,7 +144,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
uint8_t seed1[] = {'Y', 'o', 'u', ' ', 'p', 'a', 's', 's',
|
||||
' ', 'b', 'u', 't', 't', 'e', 'r'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{&nonce1, 1}};
|
||||
{&bump_seed1, 1}};
|
||||
SolPubkey address;
|
||||
sol_assert(SUCCESS ==
|
||||
sol_create_program_address(seeds1, SOL_ARRAY_SIZE(seeds1),
|
||||
@ -163,14 +163,14 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
{accounts[DERIVED_KEY1_INDEX].key, true, true},
|
||||
{accounts[DERIVED_KEY2_INDEX].key, true, false},
|
||||
{accounts[DERIVED_KEY3_INDEX].key, false, false}};
|
||||
uint8_t data[] = {TEST_DERIVED_SIGNERS, nonce2, nonce3};
|
||||
uint8_t data[] = {TEST_DERIVED_SIGNERS, bump_seed2, bump_seed3};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
uint8_t seed1[] = {'Y', 'o', 'u', ' ', 'p', 'a', 's', 's',
|
||||
' ', 'b', 'u', 't', 't', 'e', 'r'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{&nonce1, 1}};
|
||||
{&bump_seed1, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)}};
|
||||
sol_assert(SUCCESS == sol_invoke_signed(&instruction, accounts,
|
||||
SOL_ARRAY_SIZE(accounts),
|
||||
@ -178,33 +178,6 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
SOL_ARRAY_SIZE(signers_seeds)));
|
||||
}
|
||||
|
||||
sol_log("Test multiple derived signers");
|
||||
{
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[DERIVED_KEY1_INDEX].key, true, false},
|
||||
{accounts[DERIVED_KEY2_INDEX].key, true, true},
|
||||
{accounts[DERIVED_KEY3_INDEX].key, false, true}};
|
||||
uint8_t data[] = {TEST_VERIFY_NESTED_SIGNERS};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
uint8_t seed1[] = {'L', 'i', 'l', '\''};
|
||||
uint8_t seed2[] = {'B', 'i', 't', 's'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{seed2, SOL_ARRAY_SIZE(seed2)},
|
||||
{&nonce2, 1}};
|
||||
const SolSignerSeed seeds2[] = {
|
||||
{(uint8_t *)accounts[DERIVED_KEY2_INDEX].key, SIZE_PUBKEY},
|
||||
{&nonce3, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)},
|
||||
{seeds2, SOL_ARRAY_SIZE(seeds2)}};
|
||||
|
||||
sol_assert(SUCCESS == sol_invoke_signed(&instruction, accounts,
|
||||
SOL_ARRAY_SIZE(accounts),
|
||||
signers_seeds,
|
||||
SOL_ARRAY_SIZE(signers_seeds)));
|
||||
}
|
||||
|
||||
sol_log("Test readonly with writable account");
|
||||
{
|
||||
SolAccountMeta arguments[] = {
|
||||
@ -227,7 +200,8 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[INVOKED_ARGUMENT_INDEX].key, true, true},
|
||||
{accounts[ARGUMENT_INDEX].key, true, true}};
|
||||
{accounts[ARGUMENT_INDEX].key, true, true},
|
||||
{accounts[INVOKED_PROGRAM_DUP_INDEX].key, false, false}};
|
||||
uint8_t data[] = {TEST_NESTED_INVOKE};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
@ -240,8 +214,9 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
sol_assert(SUCCESS ==
|
||||
sol_invoke(&instruction, accounts, SOL_ARRAY_SIZE(accounts)));
|
||||
|
||||
sol_assert(*accounts[ARGUMENT_INDEX].lamports == 42 - 5 + 1 + 1);
|
||||
sol_assert(*accounts[INVOKED_ARGUMENT_INDEX].lamports == 10 + 5 - 1 - 1);
|
||||
sol_assert(*accounts[ARGUMENT_INDEX].lamports == 42 - 5 + 1 + 1 + 1 + 1);
|
||||
sol_assert(*accounts[INVOKED_ARGUMENT_INDEX].lamports ==
|
||||
10 + 5 - 1 - 1 - 1 - 1);
|
||||
}
|
||||
|
||||
sol_log("Verify data values are retained and updated");
|
||||
|
@ -101,6 +101,32 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
sol_assert(!accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
sol_assert(!accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
|
||||
uint8_t bump_seed2 = params.data[1];
|
||||
uint8_t bump_seed3 = params.data[2];
|
||||
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[DERIVED_KEY1_INDEX].key, true, false},
|
||||
{accounts[DERIVED_KEY2_INDEX].key, true, true},
|
||||
{accounts[DERIVED_KEY3_INDEX].key, false, true}};
|
||||
uint8_t data[] = {TEST_VERIFY_NESTED_SIGNERS};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
uint8_t seed1[] = {'L', 'i', 'l', '\''};
|
||||
uint8_t seed2[] = {'B', 'i', 't', 's'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{seed2, SOL_ARRAY_SIZE(seed2)},
|
||||
{&bump_seed2, 1}};
|
||||
const SolSignerSeed seeds2[] = {
|
||||
{(uint8_t *)accounts[DERIVED_KEY2_INDEX].key, SIZE_PUBKEY},
|
||||
{&bump_seed3, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)},
|
||||
{seeds2, SOL_ARRAY_SIZE(seeds2)}};
|
||||
|
||||
sol_assert(SUCCESS == sol_invoke_signed(
|
||||
&instruction, accounts, SOL_ARRAY_SIZE(accounts),
|
||||
signers_seeds, SOL_ARRAY_SIZE(signers_seeds)));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -114,6 +140,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
sol_assert(!accounts[DERIVED_KEY1_INDEX].is_signer);
|
||||
sol_assert(accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
sol_assert(accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -133,6 +160,12 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
|
||||
static const int INVOKED_ARGUMENT_INDEX = 0;
|
||||
static const int ARGUMENT_INDEX = 1;
|
||||
static const int INVOKED_PROGRAM_INDEX = 2;
|
||||
|
||||
if (!sol_deserialize(input, ¶ms, 3)) {
|
||||
sol_assert(sol_deserialize(input, ¶ms, 2));
|
||||
}
|
||||
|
||||
sol_assert(sol_deserialize(input, ¶ms, 2));
|
||||
|
||||
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].is_signer);
|
||||
@ -141,9 +174,23 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
*accounts[INVOKED_ARGUMENT_INDEX].lamports -= 1;
|
||||
*accounts[ARGUMENT_INDEX].lamports += 1;
|
||||
|
||||
sol_log("Last invoke");
|
||||
for (int i = 0; i < accounts[INVOKED_ARGUMENT_INDEX].data_len; i++) {
|
||||
accounts[INVOKED_ARGUMENT_INDEX].data[i] = i;
|
||||
if (params.ka_num == 3) {
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[INVOKED_ARGUMENT_INDEX].key, true, true},
|
||||
{accounts[ARGUMENT_INDEX].key, true, true}};
|
||||
uint8_t data[] = {TEST_NESTED_INVOKE};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
|
||||
sol_log("Invoke again");
|
||||
sol_assert(SUCCESS ==
|
||||
sol_invoke(&instruction, accounts, SOL_ARRAY_SIZE(accounts)));
|
||||
} else {
|
||||
sol_log("Last invoked");
|
||||
for (int i = 0; i < accounts[INVOKED_ARGUMENT_INDEX].data_len; i++) {
|
||||
accounts[INVOKED_ARGUMENT_INDEX].data[i] = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-128bit"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,8 +12,8 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-128bit-dep"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,7 +12,7 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-alloc"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,7 +12,7 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
26
programs/bpf/rust/call_depth/Cargo.toml
Normal file
26
programs/bpf/rust/call_depth/Cargo.toml
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
# Note: This crate must be built using do.sh
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-call-depth"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
default = ["program", "solana-sdk/default"]
|
||||
|
||||
[lib]
|
||||
name = "solana_bpf_rust_call_depth"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
2
programs/bpf/rust/call_depth/Xargo.toml
Normal file
2
programs/bpf/rust/call_depth/Xargo.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[target.bpfel-unknown-unknown.dependencies.std]
|
||||
features = []
|
27
programs/bpf/rust/call_depth/src/lib.rs
Normal file
27
programs/bpf/rust/call_depth/src/lib.rs
Normal file
@ -0,0 +1,27 @@
|
||||
//! @brief Example Rust-based BPF program that tests call depth and stack usage
|
||||
|
||||
use solana_sdk::{entrypoint::SUCCESS, info};
|
||||
|
||||
#[inline(never)]
|
||||
pub fn recurse(data: &mut [u8]) {
|
||||
if data.len() <= 1 {
|
||||
return;
|
||||
}
|
||||
recurse(&mut data[1..]);
|
||||
info!(line!(), 0, 0, 0, data[0]);
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
#[inline(never)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
|
||||
info!("Call depth");
|
||||
let depth = *(input.add(16) as *mut u8);
|
||||
info!(line!(), 0, 0, 0, depth);
|
||||
let mut data = Vec::with_capacity(depth as usize);
|
||||
for i in 0_u8..depth {
|
||||
data.push(i);
|
||||
}
|
||||
recurse(&mut data);
|
||||
SUCCESS
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-custom-heap"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,7 +12,7 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
custom-heap = []
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-dep-crate"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -13,7 +13,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
byteorder = { version = "1", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-deprecated_loader"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,7 +12,7 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-dup-accounts"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -12,7 +12,7 @@ homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-error-handling"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@ -14,7 +14,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
num-derive = "0.2"
|
||||
num-traits = "0.2"
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.4.1", default-features = false }
|
||||
thiserror = "1.0"
|
||||
|
||||
[features]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user