Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
15a49d7508 | ||
|
a86a781fd5 | ||
|
57d8d0ab6e | ||
|
63fe350900 | ||
|
b384ce9e03 | ||
|
d81d4ad8a1 | ||
|
9ed1d2337b | ||
|
14aaae3485 | ||
|
caac786a38 | ||
|
218a76ed1b | ||
|
964f05afa8 | ||
|
a0e2f49263 | ||
|
25078d46ba | ||
|
840ea326db | ||
|
b9fc31ec95 | ||
|
9481ee79a8 | ||
|
dddd0b76f1 | ||
|
7674a5fea8 | ||
|
78be777b65 | ||
|
9b5c10a6aa | ||
|
8714c14549 | ||
|
1982a7a8e3 | ||
|
c2806aa2f9 | ||
|
e6521ef44c | ||
|
03ab8fac29 | ||
|
644304d171 | ||
|
782ed192b6 | ||
|
0da2f73eb4 | ||
|
a3fdfea674 | ||
|
43121a56eb | ||
|
2c0b4f3b4f | ||
|
db30316bb3 | ||
|
73e4d9d623 | ||
|
46b864dcb0 | ||
|
4f2e60fea4 | ||
|
7ce9beacb6 | ||
|
9dab79274b | ||
|
df8b07ddbd | ||
|
762423c9a9 | ||
|
689aa4d44f | ||
|
cff1496e94 | ||
|
d1c51950f3 |
379
Cargo.lock
generated
379
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-account-decoder"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana account decoder"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -18,10 +18,10 @@ 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.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.6", features = ["skip-no-mangle"] }
|
||||
thiserror = "1.0"
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-accounts-bench"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.17" }
|
||||
solana-perf = { path = "../perf", version = "1.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.19" }
|
||||
solana-perf = { path = "../perf", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-client"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
tarpc = { version = "0.21.0", features = ["full"] }
|
||||
tokio = "0.2"
|
||||
tokio-serde = { version = "0.6", features = ["bincode"] }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.19" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-interface"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
tarpc = { version = "0.21.0", features = ["full"] }
|
||||
|
||||
[lib]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-server"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
tarpc = { version = "0.21.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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-genesis = { path = "../genesis", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.17" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-genesis = { path = "../genesis", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.19" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.17" }
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.19" }
|
||||
|
||||
[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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-genesis = { path = "../genesis", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-genesis = { path = "../genesis", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[dev-dependencies]
|
||||
serial_test = "0.4.0"
|
||||
serial_test_derive = "0.4.0"
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.17" }
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.19" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
4
cargo
4
cargo
@@ -17,6 +17,10 @@ case "$1" in
|
||||
toolchain="$rust_nightly"
|
||||
shift
|
||||
;;
|
||||
+*)
|
||||
toolchain="${1#+}"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||
toolchain="$rust_stable"
|
||||
|
@@ -91,17 +91,15 @@ echo --- Creating release tarball
|
||||
cp "${RELEASE_BASENAME}"/version.yml "${TARBALL_BASENAME}"-$TARGET.yml
|
||||
)
|
||||
|
||||
# Metrics tarball is platform agnostic, only publish it from Linux
|
||||
# Maybe tarballs are platform agnostic, only publish them from the Linux build
|
||||
MAYBE_TARBALLS=
|
||||
if [[ "$CI_OS_NAME" = linux ]]; then
|
||||
metrics/create-metrics-tarball.sh
|
||||
(
|
||||
set -x
|
||||
sdk/bpf/scripts/package.sh
|
||||
[[ -f bpf-sdk.tar.bz2 ]]
|
||||
|
||||
)
|
||||
MAYBE_TARBALLS="bpf-sdk.tar.bz2 solana-metrics.tar.bz2"
|
||||
MAYBE_TARBALLS="bpf-sdk.tar.bz2"
|
||||
fi
|
||||
|
||||
source ci/upload-ci-artifact.sh
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-clap-utils"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
thiserror = "1.0.20"
|
||||
tiny-bip39 = "0.7.0"
|
||||
url = "2.1.0"
|
||||
|
@@ -298,7 +298,24 @@ pub fn keypair_from_seed_phrase(
|
||||
keypair_from_seed_phrase_and_passphrase(&seed_phrase, &passphrase)?
|
||||
} else {
|
||||
let sanitized = sanitize_seed_phrase(seed_phrase);
|
||||
let mnemonic = Mnemonic::from_phrase(&sanitized, Language::English)?;
|
||||
let parse_language_fn = || {
|
||||
for language in &[
|
||||
Language::English,
|
||||
Language::ChineseSimplified,
|
||||
Language::ChineseTraditional,
|
||||
Language::Japanese,
|
||||
Language::Spanish,
|
||||
Language::Korean,
|
||||
Language::French,
|
||||
Language::Italian,
|
||||
] {
|
||||
if let Ok(mnemonic) = Mnemonic::from_phrase(&sanitized, *language) {
|
||||
return Ok(mnemonic);
|
||||
}
|
||||
}
|
||||
Err("Can't get mnemonic from seed phrases")
|
||||
};
|
||||
let mnemonic = parse_language_fn()?;
|
||||
let passphrase = prompt_passphrase(&passphrase_prompt)?;
|
||||
let seed = Seed::new(&mnemonic, &passphrase);
|
||||
keypair_from_seed(seed.as_bytes())?
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-cli-config"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -661,13 +661,8 @@ impl fmt::Display for CliStakeState {
|
||||
if lockup.unix_timestamp != UnixTimestamp::default() {
|
||||
writeln!(
|
||||
f,
|
||||
"Lockup Timestamp: {} (UnixTimestamp: {})",
|
||||
DateTime::<Utc>::from_utc(
|
||||
NaiveDateTime::from_timestamp(lockup.unix_timestamp, 0),
|
||||
Utc
|
||||
)
|
||||
.to_rfc3339_opts(SecondsFormat::Secs, true),
|
||||
lockup.unix_timestamp
|
||||
"Lockup Timestamp: {}",
|
||||
unix_timestamp_to_string(lockup.unix_timestamp)
|
||||
)?;
|
||||
}
|
||||
if lockup.epoch != Epoch::default() {
|
||||
@@ -1008,7 +1003,12 @@ impl fmt::Display for CliVoteAccount {
|
||||
None => "~".to_string(),
|
||||
}
|
||||
)?;
|
||||
writeln!(f, "Recent Timestamp: {:?}", self.recent_timestamp)?;
|
||||
writeln!(
|
||||
f,
|
||||
"Recent Timestamp: {} from slot {}",
|
||||
unix_timestamp_to_string(self.recent_timestamp.timestamp),
|
||||
self.recent_timestamp.slot
|
||||
)?;
|
||||
if !self.votes.is_empty() {
|
||||
writeln!(f, "Recent Votes:")?;
|
||||
for vote in &self.votes {
|
||||
@@ -1093,19 +1093,22 @@ pub struct CliBlockTime {
|
||||
impl QuietDisplay for CliBlockTime {}
|
||||
impl VerboseDisplay for CliBlockTime {}
|
||||
|
||||
fn unix_timestamp_to_string(unix_timestamp: UnixTimestamp) -> String {
|
||||
format!(
|
||||
"{} (UnixTimestamp: {})",
|
||||
match NaiveDateTime::from_timestamp_opt(unix_timestamp, 0) {
|
||||
Some(ndt) =>
|
||||
DateTime::<Utc>::from_utc(ndt, Utc).to_rfc3339_opts(SecondsFormat::Secs, true),
|
||||
None => "unknown".to_string(),
|
||||
},
|
||||
unix_timestamp,
|
||||
)
|
||||
}
|
||||
|
||||
impl fmt::Display for CliBlockTime {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
writeln_name_value(f, "Block:", &self.slot.to_string())?;
|
||||
writeln_name_value(
|
||||
f,
|
||||
"Date:",
|
||||
&format!(
|
||||
"{} (UnixTimestamp: {})",
|
||||
DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(self.timestamp, 0), Utc)
|
||||
.to_rfc3339_opts(SecondsFormat::Secs, true),
|
||||
self.timestamp
|
||||
),
|
||||
)
|
||||
writeln_name_value(f, "Date:", &unix_timestamp_to_string(self.timestamp))
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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.3.17"
|
||||
version = "1.3.19"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -27,30 +27,33 @@ reqwest = { version = "0.10.6", default-features = false, features = ["blocking"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.3.17" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.17" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.3.17" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.3.19" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.3.19" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.19" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana_rbpf = "=0.1.32"
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.3.19" }
|
||||
thiserror = "1.0.20"
|
||||
tiny-bip39 = "0.7.0"
|
||||
url = "2.1.1"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
tempfile = "3.1.0"
|
||||
|
||||
[[bin]]
|
||||
|
@@ -54,12 +54,42 @@ pub fn check_account_for_multiple_fees_with_commitment(
|
||||
fee_calculator: &FeeCalculator,
|
||||
messages: &[&Message],
|
||||
commitment: CommitmentConfig,
|
||||
) -> Result<(), CliError> {
|
||||
check_account_for_spend_multiple_fees_with_commitment(
|
||||
rpc_client,
|
||||
account_pubkey,
|
||||
0,
|
||||
fee_calculator,
|
||||
messages,
|
||||
commitment,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn check_account_for_spend_multiple_fees_with_commitment(
|
||||
rpc_client: &RpcClient,
|
||||
account_pubkey: &Pubkey,
|
||||
balance: u64,
|
||||
fee_calculator: &FeeCalculator,
|
||||
messages: &[&Message],
|
||||
commitment: CommitmentConfig,
|
||||
) -> Result<(), CliError> {
|
||||
let fee = calculate_fee(fee_calculator, messages);
|
||||
if !check_account_for_balance_with_commitment(rpc_client, account_pubkey, fee, commitment)
|
||||
.map_err(Into::<ClientError>::into)?
|
||||
if !check_account_for_balance_with_commitment(
|
||||
rpc_client,
|
||||
account_pubkey,
|
||||
balance + fee,
|
||||
commitment,
|
||||
)
|
||||
.map_err(Into::<ClientError>::into)?
|
||||
{
|
||||
return Err(CliError::InsufficientFundsForFee(lamports_to_sol(fee)));
|
||||
if balance > 0 {
|
||||
return Err(CliError::InsufficientFundsForSpendAndFee(
|
||||
lamports_to_sol(balance),
|
||||
lamports_to_sol(fee),
|
||||
));
|
||||
} else {
|
||||
return Err(CliError::InsufficientFundsForFee(lamports_to_sol(fee)));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@@ -2,12 +2,14 @@ use crate::{
|
||||
checks::*, cluster_query::*, feature::*, inflation::*, nonce::*, spend_utils::*, stake::*,
|
||||
validator_info::*, vote::*,
|
||||
};
|
||||
use bip39::{Language, Mnemonic, MnemonicType, Seed};
|
||||
use chrono::prelude::*;
|
||||
use clap::{value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand};
|
||||
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_budget_program::budget_instruction::{self, BudgetError};
|
||||
use solana_clap_utils::{
|
||||
self,
|
||||
@@ -38,6 +40,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,
|
||||
@@ -49,7 +52,7 @@ use solana_sdk::{
|
||||
loader_instruction,
|
||||
message::Message,
|
||||
pubkey::{Pubkey, MAX_SEED_LEN},
|
||||
signature::{Keypair, Signature, Signer, SignerError},
|
||||
signature::{keypair_from_seed, Keypair, Signature, Signer, SignerError},
|
||||
signers::Signers,
|
||||
system_instruction::{self, SystemError},
|
||||
system_program,
|
||||
@@ -1238,7 +1241,48 @@ fn process_deploy(
|
||||
address: Option<SignerIndex>,
|
||||
use_deprecated_loader: bool,
|
||||
) -> ProcessResult {
|
||||
let new_keypair = Keypair::new(); // Create ephemeral keypair to use for program address, if not provided
|
||||
const WORDS: usize = 12;
|
||||
// Create ephemeral keypair to use for program address, if not provided
|
||||
let mnemonic = Mnemonic::new(MnemonicType::for_word_count(WORDS)?, Language::English);
|
||||
let seed = Seed::new(&mnemonic, "");
|
||||
let new_keypair = keypair_from_seed(seed.as_bytes())?;
|
||||
|
||||
let result = do_process_deploy(
|
||||
rpc_client,
|
||||
config,
|
||||
program_location,
|
||||
address,
|
||||
use_deprecated_loader,
|
||||
new_keypair,
|
||||
);
|
||||
|
||||
if result.is_err() && address.is_none() {
|
||||
let phrase: &str = mnemonic.phrase();
|
||||
let divider = String::from_utf8(vec![b'='; phrase.len()]).unwrap();
|
||||
eprintln!(
|
||||
"{}\nTo reuse this address, recover the ephemeral keypair file with",
|
||||
divider
|
||||
);
|
||||
eprintln!(
|
||||
"`solana-keygen recover` and the following {}-word seed phrase,",
|
||||
WORDS
|
||||
);
|
||||
eprintln!(
|
||||
"then pass it as the [ADDRESS_SIGNER] argument to `solana deploy ...`\n{}\n{}\n{}",
|
||||
divider, phrase, divider
|
||||
);
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn do_process_deploy(
|
||||
rpc_client: &RpcClient,
|
||||
config: &CliConfig,
|
||||
program_location: &str,
|
||||
address: Option<SignerIndex>,
|
||||
use_deprecated_loader: bool,
|
||||
new_keypair: Keypair,
|
||||
) -> ProcessResult {
|
||||
let program_id = if let Some(i) = address {
|
||||
config.signers[i]
|
||||
} else {
|
||||
@@ -1252,6 +1296,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 {
|
||||
@@ -1262,11 +1309,12 @@ fn process_deploy(
|
||||
let signers = [config.signers[0], program_id];
|
||||
|
||||
// Check program account to see if partial initialization has occurred
|
||||
let initial_instructions = if let Some(account) = rpc_client
|
||||
let (initial_instructions, balance_needed) = if let Some(account) = rpc_client
|
||||
.get_account_with_commitment(&program_id.pubkey(), config.commitment)?
|
||||
.value
|
||||
{
|
||||
let mut instructions: Vec<Instruction> = vec![];
|
||||
let mut balance_needed = 0;
|
||||
if account.executable {
|
||||
return Err(CliError::DynamicProgramError(
|
||||
"Program account is already executable".to_string(),
|
||||
@@ -1290,21 +1338,26 @@ fn process_deploy(
|
||||
}
|
||||
}
|
||||
if account.lamports < minimum_balance {
|
||||
let balance = minimum_balance - account.lamports;
|
||||
instructions.push(system_instruction::transfer(
|
||||
&config.signers[0].pubkey(),
|
||||
&program_id.pubkey(),
|
||||
minimum_balance - account.lamports,
|
||||
balance,
|
||||
));
|
||||
balance_needed = balance;
|
||||
}
|
||||
instructions
|
||||
(instructions, balance_needed)
|
||||
} else {
|
||||
vec![system_instruction::create_account(
|
||||
&config.signers[0].pubkey(),
|
||||
&program_id.pubkey(),
|
||||
(
|
||||
vec![system_instruction::create_account(
|
||||
&config.signers[0].pubkey(),
|
||||
&program_id.pubkey(),
|
||||
minimum_balance,
|
||||
program_data.len() as u64,
|
||||
&loader_id,
|
||||
)],
|
||||
minimum_balance,
|
||||
program_data.len() as u64,
|
||||
&loader_id,
|
||||
)]
|
||||
)
|
||||
};
|
||||
let initial_message = if !initial_instructions.is_empty() {
|
||||
Some(Message::new(
|
||||
@@ -1347,9 +1400,10 @@ fn process_deploy(
|
||||
.get_recent_blockhash_with_commitment(config.commitment)?
|
||||
.value;
|
||||
|
||||
check_account_for_multiple_fees_with_commitment(
|
||||
check_account_for_spend_multiple_fees_with_commitment(
|
||||
rpc_client,
|
||||
&config.signers[0].pubkey(),
|
||||
balance_needed,
|
||||
&fee_calculator,
|
||||
&messages,
|
||||
config.commitment,
|
||||
@@ -1374,8 +1428,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))
|
||||
})?;
|
||||
}
|
||||
|
||||
@@ -2605,7 +2659,7 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
|
||||
.arg(
|
||||
Arg::with_name("address_signer")
|
||||
.index(2)
|
||||
.value_name("SIGNER_KEYPAIR")
|
||||
.value_name("ADDRESS_SIGNER")
|
||||
.takes_value(true)
|
||||
.validator(is_valid_signer)
|
||||
.help("The signer for the desired address of the program [default: new random address]")
|
||||
|
@@ -230,7 +230,7 @@ fn active_stake_by_feature_set(rpc_client: &RpcClient) -> Result<HashMap<u32, u6
|
||||
}
|
||||
|
||||
// Feature activation is only allowed when 95% of the active stake is on the current feature set
|
||||
fn feature_activation_allowed(rpc_client: &RpcClient) -> Result<bool, ClientError> {
|
||||
fn feature_activation_allowed(rpc_client: &RpcClient, quiet: bool) -> Result<bool, ClientError> {
|
||||
let my_feature_set = solana_version::Version::default().feature_set;
|
||||
|
||||
let active_stake_by_feature_set = active_stake_by_feature_set(rpc_client)?;
|
||||
@@ -240,8 +240,8 @@ fn feature_activation_allowed(rpc_client: &RpcClient) -> Result<bool, ClientErro
|
||||
.map(|percentage| *percentage >= 95)
|
||||
.unwrap_or(false);
|
||||
|
||||
if !feature_activation_allowed {
|
||||
println!("\n{}", style("Stake By Feature Set:").bold());
|
||||
if !feature_activation_allowed && !quiet {
|
||||
println!("{}", style("Stake By Feature Set:").bold());
|
||||
for (feature_set, percentage) in active_stake_by_feature_set.iter() {
|
||||
if *feature_set == 0 {
|
||||
println!("unknown - {}%", percentage);
|
||||
@@ -258,6 +258,7 @@ fn feature_activation_allowed(rpc_client: &RpcClient) -> Result<bool, ClientErro
|
||||
);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
Ok(feature_activation_allowed)
|
||||
@@ -299,9 +300,10 @@ fn process_status(
|
||||
});
|
||||
}
|
||||
|
||||
let feature_activation_allowed = feature_activation_allowed(rpc_client, features.len() <= 1)?;
|
||||
let feature_set = CliFeatures {
|
||||
features,
|
||||
feature_activation_allowed: feature_activation_allowed(rpc_client)?,
|
||||
feature_activation_allowed,
|
||||
inactive,
|
||||
};
|
||||
Ok(config.output_format.formatted_string(&feature_set))
|
||||
@@ -323,7 +325,7 @@ fn process_activate(
|
||||
}
|
||||
}
|
||||
|
||||
if !feature_activation_allowed(rpc_client)? {
|
||||
if !feature_activation_allowed(rpc_client, false)? {
|
||||
return Err("Feature activation is not allowed at this time".into());
|
||||
}
|
||||
|
||||
|
@@ -23,8 +23,12 @@ 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::{
|
||||
@@ -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
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-client"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana Client"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -18,15 +18,17 @@ 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"] }
|
||||
semver = "0.11.0"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
thiserror = "1.0"
|
||||
tungstenite = "0.10.1"
|
||||
url = "2.1.1"
|
||||
@@ -35,7 +37,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.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
|
||||
[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;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
use crate::{
|
||||
client_error::Result,
|
||||
rpc_request::RpcRequest,
|
||||
rpc_response::{Response, RpcResponseContext},
|
||||
rpc_response::{Response, RpcResponseContext, RpcVersionInfo},
|
||||
rpc_sender::RpcSender,
|
||||
};
|
||||
use serde_json::{Number, Value};
|
||||
use serde_json::{json, Number, Value};
|
||||
use solana_sdk::{
|
||||
fee_calculator::{FeeCalculator, FeeRateGovernor},
|
||||
instruction::InstructionError,
|
||||
@@ -12,6 +12,7 @@ use solana_sdk::{
|
||||
transaction::{self, Transaction, TransactionError},
|
||||
};
|
||||
use solana_transaction_status::TransactionStatus;
|
||||
use solana_version::Version;
|
||||
use std::{collections::HashMap, sync::RwLock};
|
||||
|
||||
pub const PUBKEY: &str = "7RoSF9fUmdphVCpabEoefH81WwrW7orsWonXWqTXkKV8";
|
||||
@@ -119,6 +120,13 @@ impl RpcSender for MockSender {
|
||||
Value::String(signature)
|
||||
}
|
||||
RpcRequest::GetMinimumBalanceForRentExemption => Value::Number(Number::from(20)),
|
||||
RpcRequest::GetVersion => {
|
||||
let version = Version::default();
|
||||
json!(RpcVersionInfo {
|
||||
solana_core: version.to_string(),
|
||||
feature_set: Some(version.feature_set),
|
||||
})
|
||||
}
|
||||
_ => Value::Null,
|
||||
};
|
||||
Ok(val)
|
||||
|
@@ -41,12 +41,14 @@ use solana_transaction_status::{
|
||||
use solana_vote_program::vote_state::MAX_LOCKOUT_HISTORY;
|
||||
use std::{
|
||||
net::SocketAddr,
|
||||
sync::RwLock,
|
||||
thread::sleep,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
pub struct RpcClient {
|
||||
sender: Box<dyn RpcSender + Send + Sync + 'static>,
|
||||
default_cluster_transaction_encoding: RwLock<Option<UiTransactionEncoding>>,
|
||||
}
|
||||
|
||||
fn serialize_encode_transaction(
|
||||
@@ -73,6 +75,7 @@ impl RpcClient {
|
||||
pub fn new_sender<T: RpcSender + Send + Sync + 'static>(sender: T) -> Self {
|
||||
Self {
|
||||
sender: Box::new(sender),
|
||||
default_cluster_transaction_encoding: RwLock::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,12 +131,41 @@ impl RpcClient {
|
||||
self.send_transaction_with_config(transaction, RpcSendTransactionConfig::default())
|
||||
}
|
||||
|
||||
fn default_cluster_transaction_encoding(&self) -> Result<UiTransactionEncoding, RpcError> {
|
||||
let default_cluster_transaction_encoding =
|
||||
self.default_cluster_transaction_encoding.read().unwrap();
|
||||
if let Some(encoding) = *default_cluster_transaction_encoding {
|
||||
Ok(encoding)
|
||||
} else {
|
||||
drop(default_cluster_transaction_encoding);
|
||||
let cluster_version = self.get_version().map_err(|e| {
|
||||
RpcError::RpcRequestError(format!("cluster version query failed: {}", e))
|
||||
})?;
|
||||
let cluster_version =
|
||||
semver::Version::parse(&cluster_version.solana_core).map_err(|e| {
|
||||
RpcError::RpcRequestError(format!("failed to parse cluster version: {}", e))
|
||||
})?;
|
||||
// Prefer base64 since 1.3.16
|
||||
let encoding = if cluster_version < semver::Version::new(1, 3, 16) {
|
||||
UiTransactionEncoding::Base58
|
||||
} else {
|
||||
UiTransactionEncoding::Base64
|
||||
};
|
||||
*self.default_cluster_transaction_encoding.write().unwrap() = Some(encoding);
|
||||
Ok(encoding)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn send_transaction_with_config(
|
||||
&self,
|
||||
transaction: &Transaction,
|
||||
config: RpcSendTransactionConfig,
|
||||
) -> ClientResult<Signature> {
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base64);
|
||||
let encoding = if let Some(encoding) = config.encoding {
|
||||
encoding
|
||||
} else {
|
||||
self.default_cluster_transaction_encoding()?
|
||||
};
|
||||
let config = RpcSendTransactionConfig {
|
||||
encoding: Some(encoding),
|
||||
..config
|
||||
@@ -174,7 +206,11 @@ impl RpcClient {
|
||||
transaction: &Transaction,
|
||||
config: RpcSimulateTransactionConfig,
|
||||
) -> RpcResult<RpcSimulateTransactionResult> {
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base64);
|
||||
let encoding = if let Some(encoding) = config.encoding {
|
||||
encoding
|
||||
} else {
|
||||
self.default_cluster_transaction_encoding()?
|
||||
};
|
||||
let config = RpcSimulateTransactionConfig {
|
||||
encoding: Some(encoding),
|
||||
..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.3.17"
|
||||
version = "1.3.19"
|
||||
documentation = "https://docs.rs/solana"
|
||||
homepage = "https://solana.com/"
|
||||
readme = "../README.md"
|
||||
@@ -44,37 +44,37 @@ 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.3.17" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-perf = { path = "../perf", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-sdk-macro-frozen-abi = { path = "../sdk/macro-frozen-abi", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.17" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.17" }
|
||||
solana-sys-tuner = { path = "../sys-tuner", version = "1.3.17" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.3.17" }
|
||||
solana-account-decoder = { path = "../account-decoder", version = "1.3.19" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.19" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-perf = { path = "../perf", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-sdk-macro-frozen-abi = { path = "../sdk/macro-frozen-abi", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.19" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.19" }
|
||||
solana-sys-tuner = { path = "../sys-tuner", version = "1.3.19" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.3.19" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.6", features = ["skip-no-mangle"] }
|
||||
tempfile = "3.1.0"
|
||||
thiserror = "1.0"
|
||||
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.3.17" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.19" }
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
trees = "0.2.1"
|
||||
|
||||
|
@@ -281,8 +281,7 @@ impl CrdsGossipPull {
|
||||
) {
|
||||
requests.into_iter().for_each(|(caller, _)| {
|
||||
let key = caller.label().pubkey();
|
||||
let old = crds.insert(caller, now);
|
||||
if let Some(val) = old.ok().and_then(|opt| opt) {
|
||||
if let Ok(Some(val)) = crds.insert(caller, now) {
|
||||
self.purged_values
|
||||
.push_back((val.value_hash, val.local_timestamp));
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ use crate::{
|
||||
use bincode::serialized_size;
|
||||
use indexmap::map::IndexMap;
|
||||
use itertools::Itertools;
|
||||
use rand::{self, seq::SliceRandom, thread_rng, RngCore};
|
||||
use rand::{seq::SliceRandom, Rng};
|
||||
use solana_runtime::bloom::Bloom;
|
||||
use solana_sdk::{hash::Hash, packet::PACKET_DATA_SIZE, pubkey::Pubkey, timing::timestamp};
|
||||
use std::{
|
||||
@@ -36,6 +36,8 @@ pub const CRDS_GOSSIP_PUSH_MSG_TIMEOUT_MS: u64 = 30000;
|
||||
pub const CRDS_GOSSIP_PRUNE_MSG_TIMEOUT_MS: u64 = 500;
|
||||
pub const CRDS_GOSSIP_PRUNE_STAKE_THRESHOLD_PCT: f64 = 0.15;
|
||||
pub const CRDS_GOSSIP_PRUNE_MIN_INGRESS_NODES: usize = 2;
|
||||
// Do not push to peers which have not been updated for this long.
|
||||
const PUSH_ACTIVE_TIMEOUT_MS: u64 = 60_000;
|
||||
|
||||
// 10 minutes
|
||||
const MAX_PUSHED_TO_TIMEOUT_MS: u64 = 10 * 60 * 1000;
|
||||
@@ -126,7 +128,7 @@ impl CrdsGossipPush {
|
||||
.collect();
|
||||
|
||||
let mut seed = [0; 32];
|
||||
seed[0..8].copy_from_slice(&thread_rng().next_u64().to_le_bytes());
|
||||
rand::thread_rng().fill(&mut seed[..]);
|
||||
let shuffle = weighted_shuffle(
|
||||
staked_peers.iter().map(|(_, stake)| *stake).collect_vec(),
|
||||
seed,
|
||||
@@ -216,52 +218,59 @@ impl CrdsGossipPush {
|
||||
/// The list of push messages is created such that all the randomly selected peers have not
|
||||
/// pruned the source addresses.
|
||||
pub fn new_push_messages(&mut self, crds: &Crds, now: u64) -> HashMap<Pubkey, Vec<CrdsValue>> {
|
||||
let mut total_bytes: usize = 0;
|
||||
let mut values = vec![];
|
||||
let mut push_messages: HashMap<Pubkey, Vec<CrdsValue>> = HashMap::new();
|
||||
trace!("new_push_messages {}", self.push_messages.len());
|
||||
for (label, hash) in &self.push_messages {
|
||||
let res = crds.lookup_versioned(label);
|
||||
if res.is_none() {
|
||||
continue;
|
||||
}
|
||||
let version = res.unwrap();
|
||||
if version.value_hash != *hash {
|
||||
continue;
|
||||
}
|
||||
let value = &version.value;
|
||||
if value.wallclock() > now || value.wallclock() + self.msg_timeout < now {
|
||||
continue;
|
||||
}
|
||||
total_bytes += serialized_size(value).unwrap() as usize;
|
||||
if total_bytes > self.max_bytes {
|
||||
break;
|
||||
}
|
||||
values.push(value.clone());
|
||||
let push_fanout = self.push_fanout.min(self.active_set.len());
|
||||
if push_fanout == 0 {
|
||||
return HashMap::default();
|
||||
}
|
||||
trace!(
|
||||
"new_push_messages {} {}",
|
||||
values.len(),
|
||||
self.active_set.len()
|
||||
);
|
||||
for v in values {
|
||||
let mut num_pushes = 0;
|
||||
let mut num_values = 0;
|
||||
let mut total_bytes: usize = 0;
|
||||
let mut labels = vec![];
|
||||
let mut push_messages: HashMap<Pubkey, Vec<CrdsValue>> = HashMap::new();
|
||||
let cutoff = now.saturating_sub(self.msg_timeout);
|
||||
let lookup = |label, &hash| -> Option<&CrdsValue> {
|
||||
let value = crds.lookup_versioned(label)?;
|
||||
if value.value_hash != hash || value.value.wallclock() < cutoff {
|
||||
None
|
||||
} else {
|
||||
Some(&value.value)
|
||||
}
|
||||
};
|
||||
let mut push_value = |origin: Pubkey, value: &CrdsValue| {
|
||||
//use a consistent index for the same origin so
|
||||
//the active set learns the MST for that origin
|
||||
let start = v.label().pubkey().as_ref()[0] as usize;
|
||||
let max = self.push_fanout.min(self.active_set.len());
|
||||
for i in start..(start + max) {
|
||||
let ix = i % self.active_set.len();
|
||||
if let Some((p, filter)) = self.active_set.get_index(ix) {
|
||||
if !filter.contains(&v.label().pubkey()) {
|
||||
trace!("new_push_messages insert {} {:?}", *p, v);
|
||||
push_messages.entry(*p).or_default().push(v.clone());
|
||||
self.num_pushes += 1;
|
||||
}
|
||||
let start = origin.as_ref()[0] as usize;
|
||||
for i in start..(start + push_fanout) {
|
||||
let index = i % self.active_set.len();
|
||||
let (peer, filter) = self.active_set.get_index(index).unwrap();
|
||||
if !filter.contains(&origin) {
|
||||
trace!("new_push_messages insert {} {:?}", *peer, value);
|
||||
push_messages.entry(*peer).or_default().push(value.clone());
|
||||
num_pushes += 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
for (label, hash) in &self.push_messages {
|
||||
match lookup(label, hash) {
|
||||
None => labels.push(label.clone()),
|
||||
Some(value) if value.wallclock() > now => continue,
|
||||
Some(value) => {
|
||||
total_bytes += serialized_size(value).unwrap() as usize;
|
||||
if total_bytes > self.max_bytes {
|
||||
break;
|
||||
}
|
||||
num_values += 1;
|
||||
labels.push(label.clone());
|
||||
push_value(label.pubkey(), value);
|
||||
}
|
||||
self.push_messages.remove(&v.label());
|
||||
}
|
||||
}
|
||||
|
||||
self.num_pushes += num_pushes;
|
||||
trace!("new_push_messages {} {}", num_values, self.active_set.len());
|
||||
for label in labels {
|
||||
self.push_messages.remove(&label);
|
||||
}
|
||||
for target_pubkey in push_messages.keys() {
|
||||
*self.last_pushed_to.entry(*target_pubkey).or_insert(0) = now;
|
||||
}
|
||||
@@ -302,6 +311,7 @@ impl CrdsGossipPush {
|
||||
network_size: usize,
|
||||
ratio: usize,
|
||||
) {
|
||||
let mut rng = rand::thread_rng();
|
||||
let need = Self::compute_need(self.num_active, self.active_set.len(), ratio);
|
||||
let mut new_items = HashMap::new();
|
||||
|
||||
@@ -317,7 +327,7 @@ impl CrdsGossipPush {
|
||||
}
|
||||
|
||||
let mut seed = [0; 32];
|
||||
seed[0..8].copy_from_slice(&thread_rng().next_u64().to_le_bytes());
|
||||
rng.fill(&mut seed[..]);
|
||||
let mut shuffle = weighted_shuffle(
|
||||
options.iter().map(|weighted| weighted.0).collect_vec(),
|
||||
seed,
|
||||
@@ -343,7 +353,7 @@ impl CrdsGossipPush {
|
||||
}
|
||||
}
|
||||
let mut keys: Vec<Pubkey> = self.active_set.keys().cloned().collect();
|
||||
keys.shuffle(&mut rand::thread_rng());
|
||||
keys.shuffle(&mut rng);
|
||||
let num = keys.len() / ratio;
|
||||
for k in &keys[..num] {
|
||||
self.active_set.swap_remove(k);
|
||||
@@ -361,11 +371,26 @@ impl CrdsGossipPush {
|
||||
stakes: &HashMap<Pubkey, u64>,
|
||||
gossip_validators: Option<&HashSet<Pubkey>>,
|
||||
) -> Vec<(f32, &'a ContactInfo)> {
|
||||
let now = timestamp();
|
||||
let mut rng = rand::thread_rng();
|
||||
let max_weight = u16::MAX as f32 - 1.0;
|
||||
let active_cutoff = now.saturating_sub(PUSH_ACTIVE_TIMEOUT_MS);
|
||||
crds.table
|
||||
.values()
|
||||
.filter(|v| v.value.contact_info().is_some())
|
||||
.map(|v| (v.value.contact_info().unwrap(), v))
|
||||
.filter(|(info, _)| {
|
||||
.filter_map(|value| {
|
||||
let info = value.value.contact_info()?;
|
||||
// Stop pushing to nodes which have not been active recently.
|
||||
if value.local_timestamp < active_cutoff {
|
||||
// In order to mitigate eclipse attack, for staked nodes
|
||||
// continue retrying periodically.
|
||||
let stake = stakes.get(&info.id).unwrap_or(&0);
|
||||
if *stake == 0 || rng.gen_ratio(7, 8) {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
Some(info)
|
||||
})
|
||||
.filter(|info| {
|
||||
info.id != *self_id
|
||||
&& ContactInfo::is_valid_address(&info.gossip)
|
||||
&& self_shred_version == info.shred_version
|
||||
@@ -373,10 +398,9 @@ impl CrdsGossipPush {
|
||||
gossip_validators.contains(&info.id)
|
||||
})
|
||||
})
|
||||
.map(|(info, _value)| {
|
||||
let max_weight = f32::from(u16::max_value()) - 1.0;
|
||||
.map(|info| {
|
||||
let last_pushed_to: u64 = *self.last_pushed_to.get(&info.id).unwrap_or(&0);
|
||||
let since = ((timestamp() - last_pushed_to) / 1024) as u32;
|
||||
let since = (now.saturating_sub(last_pushed_to) / 1024) as u32;
|
||||
let stake = get_stake(&info.id, stakes);
|
||||
let weight = get_weight(max_weight, since, stake);
|
||||
(weight, info)
|
||||
@@ -556,6 +580,7 @@ mod test {
|
||||
#[test]
|
||||
fn test_refresh_active_set() {
|
||||
solana_logger::setup();
|
||||
let now = timestamp();
|
||||
let mut crds = Crds::default();
|
||||
let mut push = CrdsGossipPush::default();
|
||||
let value1 = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
|
||||
@@ -563,7 +588,7 @@ mod test {
|
||||
0,
|
||||
)));
|
||||
|
||||
assert_eq!(crds.insert(value1.clone(), 0), Ok(None));
|
||||
assert_eq!(crds.insert(value1.clone(), now), Ok(None));
|
||||
push.refresh_push_active_set(&crds, &HashMap::new(), None, &Pubkey::default(), 0, 1, 1);
|
||||
|
||||
assert!(push.active_set.get(&value1.label().pubkey()).is_some());
|
||||
@@ -572,7 +597,7 @@ mod test {
|
||||
0,
|
||||
)));
|
||||
assert!(push.active_set.get(&value2.label().pubkey()).is_none());
|
||||
assert_eq!(crds.insert(value2.clone(), 0), Ok(None));
|
||||
assert_eq!(crds.insert(value2.clone(), now), Ok(None));
|
||||
for _ in 0..30 {
|
||||
push.refresh_push_active_set(&crds, &HashMap::new(), None, &Pubkey::default(), 0, 1, 1);
|
||||
if push.active_set.get(&value2.label().pubkey()).is_some() {
|
||||
@@ -585,7 +610,7 @@ mod test {
|
||||
let value2 = CrdsValue::new_unsigned(CrdsData::ContactInfo(
|
||||
ContactInfo::new_localhost(&Pubkey::new_rand(), 0),
|
||||
));
|
||||
assert_eq!(crds.insert(value2.clone(), 0), Ok(None));
|
||||
assert_eq!(crds.insert(value2.clone(), now), Ok(None));
|
||||
}
|
||||
push.refresh_push_active_set(&crds, &HashMap::new(), None, &Pubkey::default(), 0, 1, 1);
|
||||
assert_eq!(push.active_set.len(), push.num_active);
|
||||
@@ -619,6 +644,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_no_pushes_to_from_different_shred_versions() {
|
||||
let now = timestamp();
|
||||
let mut crds = Crds::default();
|
||||
let stakes = HashMap::new();
|
||||
let node = CrdsGossipPush::default();
|
||||
@@ -650,10 +676,10 @@ mod test {
|
||||
..ContactInfo::default()
|
||||
}));
|
||||
|
||||
crds.insert(me.clone(), 0).unwrap();
|
||||
crds.insert(spy.clone(), 0).unwrap();
|
||||
crds.insert(node_123.clone(), 0).unwrap();
|
||||
crds.insert(node_456, 0).unwrap();
|
||||
crds.insert(me.clone(), now).unwrap();
|
||||
crds.insert(spy.clone(), now).unwrap();
|
||||
crds.insert(node_123.clone(), now).unwrap();
|
||||
crds.insert(node_456, now).unwrap();
|
||||
|
||||
// shred version 123 should ignore nodes with versions 0 and 456
|
||||
let options = node
|
||||
@@ -676,6 +702,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_pushes_only_to_allowed() {
|
||||
let now = timestamp();
|
||||
let mut crds = Crds::default();
|
||||
let stakes = HashMap::new();
|
||||
let node = CrdsGossipPush::default();
|
||||
@@ -693,7 +720,7 @@ mod test {
|
||||
}));
|
||||
|
||||
crds.insert(me.clone(), 0).unwrap();
|
||||
crds.insert(node_123.clone(), 0).unwrap();
|
||||
crds.insert(node_123.clone(), now).unwrap();
|
||||
|
||||
// Unknown pubkey in gossip_validators -- will push to nobody
|
||||
let mut gossip_validators = HashSet::new();
|
||||
@@ -734,13 +761,14 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_new_push_messages() {
|
||||
let now = timestamp();
|
||||
let mut crds = Crds::default();
|
||||
let mut push = CrdsGossipPush::default();
|
||||
let peer = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
|
||||
&Pubkey::new_rand(),
|
||||
0,
|
||||
)));
|
||||
assert_eq!(crds.insert(peer.clone(), 0), Ok(None));
|
||||
assert_eq!(crds.insert(peer.clone(), now), Ok(None));
|
||||
push.refresh_push_active_set(&crds, &HashMap::new(), None, &Pubkey::default(), 0, 1, 1);
|
||||
|
||||
let new_msg = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
|
||||
@@ -758,24 +786,25 @@ mod test {
|
||||
}
|
||||
#[test]
|
||||
fn test_personalized_push_messages() {
|
||||
let now = timestamp();
|
||||
let mut crds = Crds::default();
|
||||
let mut push = CrdsGossipPush::default();
|
||||
let peer_1 = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
|
||||
&Pubkey::new_rand(),
|
||||
0,
|
||||
)));
|
||||
assert_eq!(crds.insert(peer_1.clone(), 0), Ok(None));
|
||||
assert_eq!(crds.insert(peer_1.clone(), now), Ok(None));
|
||||
let peer_2 = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
|
||||
&Pubkey::new_rand(),
|
||||
0,
|
||||
)));
|
||||
assert_eq!(crds.insert(peer_2.clone(), 0), Ok(None));
|
||||
assert_eq!(crds.insert(peer_2.clone(), now), Ok(None));
|
||||
let peer_3 = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
|
||||
&Pubkey::new_rand(),
|
||||
0,
|
||||
now,
|
||||
)));
|
||||
assert_eq!(
|
||||
push.process_push_message(&mut crds, &Pubkey::default(), peer_3.clone(), 0),
|
||||
push.process_push_message(&mut crds, &Pubkey::default(), peer_3.clone(), now),
|
||||
Ok(None)
|
||||
);
|
||||
push.refresh_push_active_set(&crds, &HashMap::new(), None, &Pubkey::default(), 0, 1, 1);
|
||||
@@ -789,7 +818,7 @@ mod test {
|
||||
expected.insert(peer_1.pubkey(), vec![new_msg.clone()]);
|
||||
expected.insert(peer_2.pubkey(), vec![new_msg]);
|
||||
assert_eq!(push.active_set.len(), 3);
|
||||
assert_eq!(push.new_push_messages(&crds, 0), expected);
|
||||
assert_eq!(push.new_push_messages(&crds, now), expected);
|
||||
}
|
||||
#[test]
|
||||
fn test_process_prune() {
|
||||
|
@@ -56,7 +56,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;
|
||||
|
@@ -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,
|
||||
@@ -2614,6 +2615,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 {}/{})",
|
||||
@@ -2627,6 +2629,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 {}/{})",
|
||||
|
@@ -357,19 +357,6 @@ impl Validator {
|
||||
leader_schedule_cache.slot_leader_at(bank.slot(), Some(&bank))
|
||||
);
|
||||
|
||||
if config.dev_halt_at_slot.is_some() {
|
||||
// Simulate a confirmed root to avoid RPC errors with CommitmentConfig::max() and
|
||||
// to ensure RPC endpoints like getConfirmedBlock, which require a confirmed root, work
|
||||
block_commitment_cache
|
||||
.write()
|
||||
.unwrap()
|
||||
.set_highest_confirmed_root(bank_forks.read().unwrap().root());
|
||||
|
||||
// Park with the RPC service running, ready for inspection!
|
||||
warn!("Validator halted");
|
||||
std::thread::park();
|
||||
}
|
||||
|
||||
let poh_config = Arc::new(genesis_config.poh_config.clone());
|
||||
let (mut poh_recorder, entry_receiver) = PohRecorder::new_with_clear_signal(
|
||||
bank.tick_height(),
|
||||
@@ -453,6 +440,19 @@ impl Validator {
|
||||
(None, None)
|
||||
};
|
||||
|
||||
if config.dev_halt_at_slot.is_some() {
|
||||
// Simulate a confirmed root to avoid RPC errors with CommitmentConfig::max() and
|
||||
// to ensure RPC endpoints like getConfirmedBlock, which require a confirmed root, work
|
||||
block_commitment_cache
|
||||
.write()
|
||||
.unwrap()
|
||||
.set_highest_confirmed_root(bank_forks.read().unwrap().root());
|
||||
|
||||
// Park with the RPC service running, ready for inspection!
|
||||
warn!("Validator halted");
|
||||
std::thread::park();
|
||||
}
|
||||
|
||||
let ip_echo_server = solana_net_utils::ip_echo_server(node.sockets.ip_echo.unwrap());
|
||||
|
||||
let gossip_service = GossipService::new(
|
||||
@@ -830,8 +830,8 @@ fn backup_and_clear_blockstore(ledger_path: &Path, start_slot: Slot, shred_versi
|
||||
|
||||
let end_slot = last_slot.unwrap();
|
||||
info!("Purging slots {} to {}", start_slot, end_slot);
|
||||
blockstore.purge_slots(start_slot, end_slot, PurgeType::Exact);
|
||||
blockstore.purge_from_next_slots(start_slot, end_slot);
|
||||
blockstore.purge_slots(start_slot, end_slot, PurgeType::Exact);
|
||||
info!("Purging done, compacting db..");
|
||||
if let Err(e) = blockstore.compact_storage(start_slot, end_slot) {
|
||||
warn!(
|
||||
|
@@ -153,7 +153,7 @@ mod tests {
|
||||
.get(&deserialized_bank.slot())
|
||||
.unwrap()
|
||||
.clone();
|
||||
assert!(*bank == deserialized_bank);
|
||||
assert_eq!(*bank, deserialized_bank);
|
||||
|
||||
let slot_snapshot_paths = snapshot_utils::get_snapshot_paths(&snapshot_path);
|
||||
|
||||
|
@@ -88,15 +88,15 @@ fn star_network_create(num: usize) -> Network {
|
||||
)));
|
||||
let id = new.label().pubkey();
|
||||
let mut node = CrdsGossip::default();
|
||||
node.crds.insert(new.clone(), 0).unwrap();
|
||||
node.crds.insert(entry.clone(), 0).unwrap();
|
||||
node.crds.insert(new.clone(), timestamp()).unwrap();
|
||||
node.crds.insert(entry.clone(), timestamp()).unwrap();
|
||||
node.set_self(&id);
|
||||
(new.label().pubkey(), Node::new(Arc::new(Mutex::new(node))))
|
||||
})
|
||||
.collect();
|
||||
let mut node = CrdsGossip::default();
|
||||
let id = entry.label().pubkey();
|
||||
node.crds.insert(entry, 0).unwrap();
|
||||
node.crds.insert(entry, timestamp()).unwrap();
|
||||
node.set_self(&id);
|
||||
network.insert(id, Node::new(Arc::new(Mutex::new(node))));
|
||||
Network::new(network)
|
||||
@@ -109,7 +109,7 @@ fn rstar_network_create(num: usize) -> Network {
|
||||
)));
|
||||
let mut origin = CrdsGossip::default();
|
||||
let id = entry.label().pubkey();
|
||||
origin.crds.insert(entry, 0).unwrap();
|
||||
origin.crds.insert(entry, timestamp()).unwrap();
|
||||
origin.set_self(&id);
|
||||
let mut network: HashMap<_, _> = (1..num)
|
||||
.map(|_| {
|
||||
@@ -119,8 +119,8 @@ fn rstar_network_create(num: usize) -> Network {
|
||||
)));
|
||||
let id = new.label().pubkey();
|
||||
let mut node = CrdsGossip::default();
|
||||
node.crds.insert(new.clone(), 0).unwrap();
|
||||
origin.crds.insert(new.clone(), 0).unwrap();
|
||||
node.crds.insert(new.clone(), timestamp()).unwrap();
|
||||
origin.crds.insert(new.clone(), timestamp()).unwrap();
|
||||
node.set_self(&id);
|
||||
(new.label().pubkey(), Node::new(Arc::new(Mutex::new(node))))
|
||||
})
|
||||
@@ -138,7 +138,7 @@ fn ring_network_create(num: usize) -> Network {
|
||||
)));
|
||||
let id = new.label().pubkey();
|
||||
let mut node = CrdsGossip::default();
|
||||
node.crds.insert(new.clone(), 0).unwrap();
|
||||
node.crds.insert(new.clone(), timestamp()).unwrap();
|
||||
node.set_self(&id);
|
||||
(new.label().pubkey(), Node::new(Arc::new(Mutex::new(node))))
|
||||
})
|
||||
@@ -157,7 +157,11 @@ fn ring_network_create(num: usize) -> Network {
|
||||
.clone()
|
||||
};
|
||||
let end = network.get_mut(&keys[(k + 1) % keys.len()]).unwrap();
|
||||
end.lock().unwrap().crds.insert(start_info, 0).unwrap();
|
||||
end.lock()
|
||||
.unwrap()
|
||||
.crds
|
||||
.insert(start_info, timestamp())
|
||||
.unwrap();
|
||||
}
|
||||
Network::new(network)
|
||||
}
|
||||
@@ -172,7 +176,7 @@ fn connected_staked_network_create(stakes: &[u64]) -> Network {
|
||||
)));
|
||||
let id = new.label().pubkey();
|
||||
let mut node = CrdsGossip::default();
|
||||
node.crds.insert(new.clone(), 0).unwrap();
|
||||
node.crds.insert(new.clone(), timestamp()).unwrap();
|
||||
node.set_self(&id);
|
||||
(
|
||||
new.label().pubkey(),
|
||||
@@ -196,7 +200,7 @@ fn connected_staked_network_create(stakes: &[u64]) -> Network {
|
||||
let mut end = end.lock().unwrap();
|
||||
if keys[k] != end.id {
|
||||
let start_info = start_entries[k].clone();
|
||||
end.crds.insert(start_info, 0).unwrap();
|
||||
end.crds.insert(start_info, timestamp()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,10 +232,12 @@ fn network_simulator(thread_pool: &ThreadPool, network: &mut Network, max_conver
|
||||
.refresh_push_active_set(&HashMap::new(), None);
|
||||
});
|
||||
let mut total_bytes = bytes_tx;
|
||||
for second in 1..num {
|
||||
let start = second * 10;
|
||||
let end = (second + 1) * 10;
|
||||
let mut ts = timestamp();
|
||||
for _ in 1..num {
|
||||
let start = ((ts + 99) / 100) as usize;
|
||||
let end = start + 10;
|
||||
let now = (start * 100) as u64;
|
||||
ts += 1000;
|
||||
// push a message to the network
|
||||
network_values.par_iter().for_each(|locked_node| {
|
||||
let node = &mut locked_node.lock().unwrap();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-crate-features"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana Crate Features"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@@ -165,7 +165,7 @@ Returns all information associated with the account of provided Pubkey
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64", or jsonParsed". "base58" is limited to Account data of less than 128 bytes. "base64" will return base64 encoded data for Account data of any size.
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`.
|
||||
- (optional) `dataSlice: <object>` - limit the returned account data using the provided `offset: <usize>` and `length: <usize>` fields; only available for "base58" or "base64" encoding.
|
||||
|
||||
#### Results:
|
||||
@@ -314,7 +314,7 @@ Returns identity and transaction information about a confirmed block in the ledg
|
||||
#### Parameters:
|
||||
|
||||
- `<u64>` - slot, as u64 integer
|
||||
- `<string>` - encoding for each returned Transaction, either "json", "jsonParsed", "base58" (*slow*), or "base64". If parameter not provided, the default encoding is JSON. **jsonParsed encoding is UNSTABLE**
|
||||
- `<string>` - encoding for each returned Transaction, either "json", "jsonParsed", "base58" (*slow*), or "base64". If parameter not provided, the default encoding is JSON.
|
||||
Parsed-JSON encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in the `transaction.message.instructions` list. If parsed-JSON is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields).
|
||||
|
||||
#### Results:
|
||||
@@ -512,7 +512,7 @@ Returns transaction details for a confirmed transaction
|
||||
|
||||
- `<string>` - transaction signature as base-58 encoded string
|
||||
N encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in the `transaction.message.instructions` list. If parsed-JSON is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields).
|
||||
- `<string>` - (optional) encoding for the returned Transaction, either "json", "jsonParsed", "base58" (*slow*), or "base64". If parameter not provided, the default encoding is JSON. **jsonParsed encoding is UNSTABLE**
|
||||
- `<string>` - (optional) encoding for the returned Transaction, either "json", "jsonParsed", "base58" (*slow*), or "base64". If parameter not provided, the default encoding is JSON.
|
||||
|
||||
#### Results:
|
||||
|
||||
@@ -894,7 +894,7 @@ Returns the account information for a list of Pubkeys
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64", or jsonParsed". "base58" is limited to Account data of less than 128 bytes. "base64" will return base64 encoded data for Account data of any size.
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`.
|
||||
- (optional) `dataSlice: <object>` - limit the returned account data using the provided `offset: <usize>` and `length: <usize>` fields; only available for "base58" or "base64" encoding.
|
||||
|
||||
#### Results:
|
||||
@@ -937,7 +937,7 @@ Returns all accounts owned by the provided program Pubkey
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64" or jsonParsed".
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`. If parsed-JSON is requested for the SPL Token program, when a valid mint cannot be found for a particular account, that account will be filtered out from results. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`. If parsed-JSON is requested for the SPL Token program, when a valid mint cannot be found for a particular account, that account will be filtered out from results.
|
||||
- (optional) `dataSlice: <object>` - limit the returned account data using the provided `offset: <usize>` and `length: <usize>` fields; only available for "base58" or "base64" encoding.
|
||||
- (optional) `filters: <array>` - filter results using various [filter objects](jsonrpc-api.md#filters); account must meet all filter criteria to be included in results
|
||||
|
||||
@@ -1192,7 +1192,7 @@ Returns all SPL Token accounts by approved Delegate. **UNSTABLE**
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64" or jsonParsed".
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a valid mint cannot be found for a particular account, that account will be filtered out from results. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a valid mint cannot be found for a particular account, that account will be filtered out from results.
|
||||
- (optional) `dataSlice: <object>` - limit the returned account data using the provided `offset: <usize>` and `length: <usize>` fields; only available for "base58" or "base64" encoding.
|
||||
|
||||
#### Results:
|
||||
@@ -1229,7 +1229,7 @@ Returns all SPL Token accounts by token owner. **UNSTABLE**
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64" or jsonParsed".
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a valid mint cannot be found for a particular account, that account will be filtered out from results. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a valid mint cannot be found for a particular account, that account will be filtered out from results.
|
||||
- (optional) `dataSlice: <object>` - limit the returned account data using the provided `offset: <usize>` and `length: <usize>` fields; only available for "base58" or "base64" encoding.
|
||||
|
||||
#### Results:
|
||||
@@ -1553,7 +1553,7 @@ Subscribe to an account to receive notifications when the lamports or data for a
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- `<object>` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64" or jsonParsed".
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to binary encoding, detectable when the `data` field is type `<string>`. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to binary encoding, detectable when the `data` field is type `<string>`.
|
||||
|
||||
#### Results:
|
||||
|
||||
@@ -1663,7 +1663,7 @@ Subscribe to a program to receive notifications when the lamports or data for a
|
||||
- `<object>` - (optional) Configuration object containing the following optional fields:
|
||||
- (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
|
||||
- `encoding: <string>` - encoding for Account data, either "base58" (*slow*), "base64" or jsonParsed".
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`. **jsonParsed encoding is UNSTABLE**
|
||||
Parsed-JSON encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If parsed-JSON is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the `data` field is type `<string>`.
|
||||
- (optional) `filters: <array>` - filter results using various [filter objects](jsonrpc-api.md#filters); account must meet all filter criteria to be included in results
|
||||
|
||||
#### Results:
|
||||
|
@@ -7,9 +7,19 @@ exchange.
|
||||
|
||||
## Node Setup
|
||||
|
||||
We highly recommend setting up at least two of your own Solana api nodes to
|
||||
give you a trusted entrypoint to the network, allow you full control over how
|
||||
much data is retained, and ensure you do not miss any data if one node fails.
|
||||
We highly recommend setting up at least two nodes on high-grade computers/cloud
|
||||
instances, upgrading to newer versions promptly, and keeping an eye on service
|
||||
operations with a bundled monitoring tool.
|
||||
|
||||
This setup enables you:
|
||||
- to have a trusted gateway to the Solana mainnet-beta cluster to get data and
|
||||
submit withdrawal transactions
|
||||
- to have full control over how much historical block data is retained
|
||||
- to maintain your service availability even if one node fails
|
||||
|
||||
Solana nodes demand relatively high computing power to handle our fast blocks
|
||||
and high TPS. For specific requirements, please see
|
||||
[hardware recommendations](../running-validator/validator-reqs.md).
|
||||
|
||||
To run an api node:
|
||||
|
||||
@@ -43,12 +53,37 @@ Optional parameters to consider:
|
||||
- `--private-rpc` prevents your RPC port from being published for use by other nodes
|
||||
- `--rpc-bind-address` allows you to specify a different IP address to bind the RPC port
|
||||
|
||||
### Automatic Restarts
|
||||
### Automatic Restarts and Monitoring
|
||||
|
||||
We recommend configuring each of your nodes to restart automatically on exit, to
|
||||
ensure you miss as little data as possible. Running the solana software as a
|
||||
systemd service is one great option.
|
||||
|
||||
For monitoring, we provide
|
||||
[`solana-watchtower`](https://github.com/solana-labs/solana/blob/master/watchtower/README.md),
|
||||
which can monitor your validator and detect with the `solana-validator` process
|
||||
is unhealthy. It can directly be configured to alert you via Slack, Telegram,
|
||||
Discord, or Twillio. For details, run `solana-watchtower --help`.
|
||||
|
||||
```bash
|
||||
solana-watchtower --validator-identity <YOUR VALIDATOR IDENTITY>
|
||||
```
|
||||
|
||||
#### New Software Release Announcements
|
||||
|
||||
We release new software frequently (around 1 release / week).
|
||||
Sometimes newer versions include incompatible protocol changes, which
|
||||
necessitate timely software update to avoid errors in processing blocks.
|
||||
|
||||
Our official release announcements for all kinds of releases (normal and
|
||||
security) are communicated via a discord channel called
|
||||
[`#mb-announcement`](https://discord.com/channels/428295358100013066/669406841830244375)
|
||||
(`mb` stands for `mainnet-beta`).
|
||||
|
||||
Like staked validators, we expect any exchange-operated validators to be updated
|
||||
at your earliest convenience within a business day or two after a normal release
|
||||
announcement. For security-related releases, more urgent action may be needed.
|
||||
|
||||
### Ledger Continuity
|
||||
|
||||
By default, each of your nodes will boot from a snapshot provided by one of your
|
||||
|
@@ -32,6 +32,33 @@ Here are our recommendations for low, medium, and high end machine specification
|
||||
| Accounts Drive\(s\) | None | Samsung 970 Pro 1TB | 2x Samsung 970 Pro 1TB | |
|
||||
| GPU | 4x Nvidia 1070 or 2x Nvidia 1080 Ti or 2x Nvidia 2070 | 2x Nvidia 2080 Ti | 4x Nvidia 2080 Ti | Any number of cuda-capable GPUs are supported on Linux platforms. |
|
||||
|
||||
## Virtual machines on Cloud Platforms
|
||||
|
||||
While you can run a validator on a cloud computing platform, it may not
|
||||
be cost-efficient over the long term.
|
||||
|
||||
However, it may be convenient to run non-voting api nodes on VM instances for
|
||||
your own internal usage. This use case includes exchanges and services built on
|
||||
Solana.
|
||||
|
||||
In fact, the offical mainnet-beta API nodes are currently (Oct. 2020) run on GCE
|
||||
`n1-standard-32` (32 vCPUs, 120 GB memory) instances with 2048 GB SSD for
|
||||
operational convenience.
|
||||
|
||||
For other cloud platforms, select instance types with similar specs.
|
||||
|
||||
Also note that egress internet traffic usage may turn out to be high,
|
||||
especially for the case of running staked validators.
|
||||
|
||||
## Docker
|
||||
|
||||
Running validator for live clusters (including mainnet-beta) inside Docker is
|
||||
not recommended and generally not supported. This is due to concerns of general
|
||||
docker's containerzation overhead and resultant performance degradation unless
|
||||
specially configured.
|
||||
|
||||
We use docker only for development purpose.
|
||||
|
||||
## Software
|
||||
|
||||
- We build and run on Ubuntu 18.04. Some users have had trouble when running on Ubuntu 16.04
|
||||
|
@@ -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.3.17"
|
||||
version = "1.3.19"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -14,14 +14,14 @@ clap = "2.33.1"
|
||||
log = "0.4.8"
|
||||
rand = "0.7.0"
|
||||
rayon = "1.4.0"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-download-utils"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana Download Utils"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -14,8 +14,8 @@ 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.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
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.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"bs58",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-sdk-wasm"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana SDK Wasm"
|
||||
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-faucet"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
tokio = "0.1"
|
||||
tokio-codec = "0.1"
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-genesis-programs"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana genesis programs"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -10,12 +10,12 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
log = { version = "0.4.8" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.17" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.3.19" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.19" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-genesis"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[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.3.17"
|
||||
version = "1.3.19"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -24,12 +24,12 @@ reqwest = { version = "0.10.6", default-features = false, features = ["blocking"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
semver = "0.9.0"
|
||||
tar = "0.4.28"
|
||||
tempfile = "3.1.0"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-keygen"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.3.17" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.3.19" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
tiny-bip39 = "0.7.0"
|
||||
|
||||
[[bin]]
|
||||
|
@@ -270,6 +270,15 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
.takes_value(true)
|
||||
.help("Specify the number of words that will be present in the generated seed phrase"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("language")
|
||||
.long("language")
|
||||
.possible_values(&["english", "chinese-simplified", "chinese-traditional", "japanese", "spanish", "korean", "french", "italian"])
|
||||
.default_value("english")
|
||||
.value_name("LANGUAGE")
|
||||
.takes_value(true)
|
||||
.help("Specify the mnemonic lanaguage that will be present in the generated seed phrase"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("no_passphrase")
|
||||
.long("no-passphrase")
|
||||
@@ -430,7 +439,18 @@ fn do_main(matches: &ArgMatches<'_>) -> Result<(), Box<dyn error::Error>> {
|
||||
|
||||
let word_count = value_t!(matches.value_of("word_count"), usize).unwrap();
|
||||
let mnemonic_type = MnemonicType::for_word_count(word_count)?;
|
||||
let mnemonic = Mnemonic::new(mnemonic_type, Language::English);
|
||||
let language = match matches.value_of("language").unwrap() {
|
||||
"english" => Language::English,
|
||||
"chinese-simplified" => Language::ChineseSimplified,
|
||||
"chinese-traditional" => Language::ChineseTraditional,
|
||||
"japanese" => Language::Japanese,
|
||||
"spanish" => Language::Spanish,
|
||||
"korean" => Language::Korean,
|
||||
"french" => Language::French,
|
||||
"italian" => Language::Italian,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let mnemonic = Mnemonic::new(mnemonic_type, language);
|
||||
let passphrase = if matches.is_present("no_passphrase") {
|
||||
NO_PASSPHRASE.to_string()
|
||||
} else {
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-ledger-tool"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -15,22 +15,23 @@ clap = "2.33.1"
|
||||
futures = "0.3.5"
|
||||
futures-util = "0.3.5"
|
||||
histogram = "*"
|
||||
itertools = "0.9.0"
|
||||
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.3.17" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.17" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.19" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
tempfile = "3.1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
|
||||
|
@@ -2,6 +2,7 @@ use clap::{
|
||||
crate_description, crate_name, value_t, value_t_or_exit, values_t_or_exit, App, Arg,
|
||||
ArgMatches, SubCommand,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use log::*;
|
||||
use regex::Regex;
|
||||
use serde_json::json;
|
||||
@@ -889,6 +890,11 @@ fn main() {
|
||||
)
|
||||
.arg(&allow_dead_slots_arg)
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("dead-slots")
|
||||
.arg(&starting_slot_arg)
|
||||
.about("Print all of dead slots")
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("set-dead-slot")
|
||||
.about("Mark one or more slots dead")
|
||||
@@ -1203,6 +1209,14 @@ fn main() {
|
||||
.value_name("SLOT")
|
||||
.help("Ending slot to stop purging (inclusive) [default: the highest slot in the ledger]"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("batch_size")
|
||||
.long("batch-size")
|
||||
.value_name("NUM")
|
||||
.takes_value(true)
|
||||
.default_value("1000")
|
||||
.help("Removes at most BATCH_SIZE slots while purging in loop"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("no_compaction")
|
||||
.long("no-compaction")
|
||||
@@ -1210,6 +1224,13 @@ fn main() {
|
||||
.takes_value(false)
|
||||
.help("Skip ledger compaction after purge")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("dead_slots_only")
|
||||
.long("dead-slots-only")
|
||||
.required(false)
|
||||
.takes_value(false)
|
||||
.help("Limit puring to dead slots only")
|
||||
)
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("list-roots")
|
||||
@@ -1445,6 +1466,17 @@ fn main() {
|
||||
true,
|
||||
);
|
||||
}
|
||||
("dead-slots", Some(arg_matches)) => {
|
||||
let blockstore = open_blockstore(
|
||||
&ledger_path,
|
||||
AccessType::TryPrimaryThenSecondary,
|
||||
wal_recovery_mode,
|
||||
);
|
||||
let starting_slot = value_t_or_exit!(arg_matches, "starting_slot", Slot);
|
||||
for slot in blockstore.dead_slots_iterator(starting_slot).unwrap() {
|
||||
println!("{}", slot);
|
||||
}
|
||||
}
|
||||
("set-dead-slot", Some(arg_matches)) => {
|
||||
let slots = values_t_or_exit!(arg_matches, "slots", Slot);
|
||||
let blockstore =
|
||||
@@ -2045,9 +2077,15 @@ fn main() {
|
||||
("purge", Some(arg_matches)) => {
|
||||
let start_slot = value_t_or_exit!(arg_matches, "start_slot", Slot);
|
||||
let end_slot = value_t!(arg_matches, "end_slot", Slot).ok();
|
||||
let no_compaction = arg_matches.is_present("no-compaction");
|
||||
let blockstore =
|
||||
open_blockstore(&ledger_path, AccessType::PrimaryOnly, wal_recovery_mode);
|
||||
let no_compaction = arg_matches.is_present("no_compaction");
|
||||
let dead_slots_only = arg_matches.is_present("dead_slots_only");
|
||||
let batch_size = value_t_or_exit!(arg_matches, "batch_size", usize);
|
||||
let access_type = if !no_compaction {
|
||||
AccessType::PrimaryOnly
|
||||
} else {
|
||||
AccessType::PrimaryOnlyForMaintenance
|
||||
};
|
||||
let blockstore = open_blockstore(&ledger_path, access_type, wal_recovery_mode);
|
||||
|
||||
let end_slot = match end_slot {
|
||||
Some(end_slot) => end_slot,
|
||||
@@ -2074,13 +2112,48 @@ fn main() {
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
println!("Purging data from slots {} to {}", start_slot, end_slot);
|
||||
if no_compaction {
|
||||
blockstore.purge_slots(start_slot, end_slot, PurgeType::Exact);
|
||||
info!(
|
||||
"Purging data from slots {} to {} ({} slots) (skip compaction: {}) (dead slot only: {})",
|
||||
start_slot,
|
||||
end_slot,
|
||||
end_slot - start_slot,
|
||||
no_compaction,
|
||||
dead_slots_only,
|
||||
);
|
||||
let purge_from_blockstore = |start_slot, end_slot| {
|
||||
blockstore.purge_from_next_slots(start_slot, end_slot);
|
||||
if no_compaction {
|
||||
blockstore.purge_slots(start_slot, end_slot, PurgeType::Exact);
|
||||
} else {
|
||||
blockstore.purge_and_compact_slots(start_slot, end_slot);
|
||||
}
|
||||
};
|
||||
if !dead_slots_only {
|
||||
let slots_iter = &(start_slot..=end_slot).chunks(batch_size);
|
||||
for slots in slots_iter {
|
||||
let slots = slots.collect::<Vec<_>>();
|
||||
assert!(!slots.is_empty());
|
||||
|
||||
let start_slot = *slots.first().unwrap();
|
||||
let end_slot = *slots.last().unwrap();
|
||||
info!(
|
||||
"Purging chunked slots from {} to {} ({} slots)",
|
||||
start_slot,
|
||||
end_slot,
|
||||
end_slot - start_slot
|
||||
);
|
||||
purge_from_blockstore(start_slot, end_slot);
|
||||
}
|
||||
} else {
|
||||
blockstore.purge_and_compact_slots(start_slot, end_slot);
|
||||
let dead_slots_iter = blockstore
|
||||
.dead_slots_iterator(start_slot)
|
||||
.unwrap()
|
||||
.take_while(|s| *s <= end_slot);
|
||||
for dead_slot in dead_slots_iter {
|
||||
info!("Purging dead slot {}", dead_slot);
|
||||
purge_from_blockstore(dead_slot, dead_slot);
|
||||
}
|
||||
}
|
||||
blockstore.purge_from_next_slots(start_slot, end_slot);
|
||||
}
|
||||
("list-roots", Some(arg_matches)) => {
|
||||
let blockstore = open_blockstore(
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-ledger"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana ledger"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -31,19 +31,19 @@ reed-solomon-erasure = { version = "4.0.2", features = ["simd-accel"] }
|
||||
serde = "1.0.112"
|
||||
serde_bytes = "0.11.4"
|
||||
sha2 = "0.8.2"
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.3.17" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-perf = { path = "../perf", version = "1.3.17" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.3.19" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
solana-perf = { path = "../perf", version = "1.3.19" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
tempfile = "3.1.0"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
@@ -59,7 +59,7 @@ features = ["lz4"]
|
||||
[dev-dependencies]
|
||||
assert_matches = "1.3.0"
|
||||
matches = "0.1.6"
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@@ -59,7 +59,11 @@ impl Blockstore {
|
||||
meta.next_slots
|
||||
.retain(|slot| *slot < from_slot || *slot > to_slot);
|
||||
if meta.next_slots.len() != original_len {
|
||||
info!("purge_from_next_slots: adjusted meta for slot {}", slot);
|
||||
info!(
|
||||
"purge_from_next_slots: meta for slot {} no longer refers to slots {:?}",
|
||||
slot,
|
||||
from_slot..=to_slot
|
||||
);
|
||||
self.put_meta_bytes(
|
||||
slot,
|
||||
&bincode::serialize(&meta).expect("couldn't update meta"),
|
||||
|
@@ -150,6 +150,7 @@ pub mod columns {
|
||||
|
||||
pub enum AccessType {
|
||||
PrimaryOnly,
|
||||
PrimaryOnlyForMaintenance, // this indicates no compaction
|
||||
TryPrimaryThenSecondary,
|
||||
}
|
||||
|
||||
@@ -213,37 +214,45 @@ impl Rocks {
|
||||
fs::create_dir_all(&path)?;
|
||||
|
||||
// Use default database options
|
||||
let mut db_options = get_db_options();
|
||||
if matches!(access_type, AccessType::PrimaryOnlyForMaintenance) {
|
||||
warn!("Disabling rocksdb's auto compaction for maintenance bulk ledger update...");
|
||||
}
|
||||
let mut db_options = get_db_options(&access_type);
|
||||
if let Some(recovery_mode) = recovery_mode {
|
||||
db_options.set_wal_recovery_mode(recovery_mode.into());
|
||||
}
|
||||
|
||||
// Column family names
|
||||
let meta_cf_descriptor = ColumnFamilyDescriptor::new(SlotMeta::NAME, get_cf_options());
|
||||
let meta_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(SlotMeta::NAME, get_cf_options(&access_type));
|
||||
let dead_slots_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(DeadSlots::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(DeadSlots::NAME, get_cf_options(&access_type));
|
||||
let duplicate_slots_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(DuplicateSlots::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(DuplicateSlots::NAME, get_cf_options(&access_type));
|
||||
let erasure_meta_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(ErasureMeta::NAME, get_cf_options());
|
||||
let orphans_cf_descriptor = ColumnFamilyDescriptor::new(Orphans::NAME, get_cf_options());
|
||||
let root_cf_descriptor = ColumnFamilyDescriptor::new(Root::NAME, get_cf_options());
|
||||
let index_cf_descriptor = ColumnFamilyDescriptor::new(Index::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(ErasureMeta::NAME, get_cf_options(&access_type));
|
||||
let orphans_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(Orphans::NAME, get_cf_options(&access_type));
|
||||
let root_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(Root::NAME, get_cf_options(&access_type));
|
||||
let index_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(Index::NAME, get_cf_options(&access_type));
|
||||
let shred_data_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(ShredData::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(ShredData::NAME, get_cf_options(&access_type));
|
||||
let shred_code_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(ShredCode::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(ShredCode::NAME, get_cf_options(&access_type));
|
||||
let transaction_status_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(TransactionStatus::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(TransactionStatus::NAME, get_cf_options(&access_type));
|
||||
let address_signatures_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(AddressSignatures::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(AddressSignatures::NAME, get_cf_options(&access_type));
|
||||
let transaction_status_index_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(TransactionStatusIndex::NAME, get_cf_options());
|
||||
let rewards_cf_descriptor = ColumnFamilyDescriptor::new(Rewards::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(TransactionStatusIndex::NAME, get_cf_options(&access_type));
|
||||
let rewards_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(Rewards::NAME, get_cf_options(&access_type));
|
||||
let blocktime_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(Blocktime::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(Blocktime::NAME, get_cf_options(&access_type));
|
||||
let perf_samples_cf_descriptor =
|
||||
ColumnFamilyDescriptor::new(PerfSamples::NAME, get_cf_options());
|
||||
ColumnFamilyDescriptor::new(PerfSamples::NAME, get_cf_options(&access_type));
|
||||
|
||||
let cfs = vec![
|
||||
(SlotMeta::NAME, meta_cf_descriptor),
|
||||
@@ -268,7 +277,7 @@ impl Rocks {
|
||||
|
||||
// Open the database
|
||||
let db = match access_type {
|
||||
AccessType::PrimaryOnly => Rocks(
|
||||
AccessType::PrimaryOnly | AccessType::PrimaryOnlyForMaintenance => Rocks(
|
||||
DB::open_cf_descriptors(&db_options, path, cfs.into_iter().map(|c| c.1))?,
|
||||
ActualAccessType::Primary,
|
||||
),
|
||||
@@ -961,7 +970,7 @@ impl<'a> WriteBatch<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_cf_options() -> Options {
|
||||
fn get_cf_options(access_type: &AccessType) -> Options {
|
||||
let mut options = Options::default();
|
||||
// 256 * 8 = 2GB. 6 of these columns should take at most 12GB of RAM
|
||||
options.set_max_write_buffer_number(8);
|
||||
@@ -975,10 +984,14 @@ fn get_cf_options() -> Options {
|
||||
options.set_level_zero_file_num_compaction_trigger(file_num_compaction_trigger as i32);
|
||||
options.set_max_bytes_for_level_base(total_size_base);
|
||||
options.set_target_file_size_base(file_size_base);
|
||||
if matches!(access_type, AccessType::PrimaryOnlyForMaintenance) {
|
||||
options.set_disable_auto_compactions(true);
|
||||
}
|
||||
|
||||
options
|
||||
}
|
||||
|
||||
fn get_db_options() -> Options {
|
||||
fn get_db_options(access_type: &AccessType) -> Options {
|
||||
let mut options = Options::default();
|
||||
options.create_if_missing(true);
|
||||
options.create_missing_column_families(true);
|
||||
@@ -987,6 +1000,9 @@ fn get_db_options() -> Options {
|
||||
|
||||
// Set max total wal size to 4G.
|
||||
options.set_max_total_wal_size(4 * 1024 * 1024 * 1024);
|
||||
if matches!(access_type, AccessType::PrimaryOnlyForMaintenance) {
|
||||
options.set_disable_auto_compactions(true);
|
||||
}
|
||||
|
||||
options
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-local-cluster"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-client = { path = "../client", version = "1.3.17" }
|
||||
solana-download-utils = { path = "../download-utils", version = "1.3.17" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.17" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.17" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.17" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.17" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.19" }
|
||||
solana-core = { path = "../core", version = "1.3.19" }
|
||||
solana-client = { path = "../client", version = "1.3.19" }
|
||||
solana-download-utils = { path = "../download-utils", version = "1.3.19" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.19" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.19" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.19" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.19" }
|
||||
tempfile = "3.1.0"
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.17" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.19" }
|
||||
|
||||
[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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
|
||||
[[bin]]
|
||||
name = "solana-log-analyzer"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-logger"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
|
||||
[target."cfg(unix)".dependencies]
|
||||
jemallocator = "0.3.2"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-merkle-tree"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
fast-math = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-metrics"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana Metrics"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -14,7 +14,7 @@ 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.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.7.0"
|
||||
|
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo --- Creating metrics tarball
|
||||
(
|
||||
set -x
|
||||
rm -rf solana-metrics/
|
||||
mkdir solana-metrics/
|
||||
|
||||
COMMIT="$(git rev-parse HEAD)"
|
||||
|
||||
(
|
||||
echo "commit: $COMMIT"
|
||||
) > solana-metrics/version.yml
|
||||
|
||||
cp -a metrics/scripts/* solana-metrics
|
||||
|
||||
tar jvcf solana-metrics.tar.bz2 solana-metrics/
|
||||
)
|
||||
|
||||
ls -hl "$PWD"/solana-metrics.tar.bz2
|
@@ -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.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
rand = "0.7.0"
|
||||
|
||||
[[bin]]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-net-utils"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.12"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
tokio = "0.1"
|
||||
tokio-codec = "0.1"
|
||||
url = "2.1.1"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-notifier"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana Notifier"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-perf"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.19" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.19" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.19" }
|
||||
curve25519-dalek = { version = "2" }
|
||||
|
||||
[lib]
|
||||
|
@@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-poh-bench"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-measure = { path = "../measure", version = "1.3.17" }
|
||||
solana-version = { path = "../version", version = "1.3.17" }
|
||||
solana-perf = { path = "../perf", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.19" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.19" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.19" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.19" }
|
||||
solana-measure = { path = "../measure", version = "1.3.19" }
|
||||
solana-version = { path = "../version", version = "1.3.19" }
|
||||
solana-perf = { path = "../perf", version = "1.3.19" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
74
programs/bpf/Cargo.lock
generated
74
programs/bpf/Cargo.lock
generated
@@ -1735,7 +1735,7 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-loader-program"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder 1.3.4",
|
||||
@@ -1749,7 +1749,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-programs"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder 1.3.4",
|
||||
@@ -1765,7 +1765,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-128bit"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-128bit-dep",
|
||||
"solana-sdk",
|
||||
@@ -1773,35 +1773,35 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-128bit-dep"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-alloc"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-call-depth"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-custom-heap"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-dep-crate"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"solana-sdk",
|
||||
@@ -1809,21 +1809,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-deprecated_loader"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-dup-accounts"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-error-handling"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"num-derive 0.2.5",
|
||||
"num-traits",
|
||||
@@ -1833,21 +1833,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-external-spend"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-instruction-introspection"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-invoke"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-invoked",
|
||||
"solana-sdk",
|
||||
@@ -1855,21 +1855,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-invoked"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-iter"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-many-args"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-many-args-dep",
|
||||
"solana-sdk",
|
||||
@@ -1877,28 +1877,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-many-args-dep"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-noop"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-panic"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-param-passing"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-param-passing-dep",
|
||||
"solana-sdk",
|
||||
@@ -1906,28 +1906,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-param-passing-dep"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sanity"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sysval"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-config-program"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"chrono",
|
||||
@@ -1939,7 +1939,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-crate-features"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes 0.4.12",
|
||||
@@ -1962,7 +1962,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-logger"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
@@ -1971,7 +1971,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-measure"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"jemalloc-ctl",
|
||||
"jemallocator",
|
||||
@@ -1982,7 +1982,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-metrics"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"gethostname",
|
||||
@@ -1994,7 +1994,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-rayon-threadlimit"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"num_cpus",
|
||||
@@ -2002,7 +2002,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-runtime"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"blake3",
|
||||
@@ -2048,7 +2048,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"assert_matches",
|
||||
"bincode",
|
||||
@@ -2088,7 +2088,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bs58",
|
||||
"proc-macro2 1.0.19",
|
||||
@@ -2099,7 +2099,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro-frozen-abi"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"proc-macro2 1.0.19",
|
||||
@@ -2110,7 +2110,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-secp256k1-program"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"digest 0.9.0",
|
||||
@@ -2123,7 +2123,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-stake-program"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
@@ -2142,7 +2142,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-vote-program"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "solana-bpf-programs"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
documentation = "https://docs.rs/solana"
|
||||
homepage = "https://solana.com/"
|
||||
readme = "README.md"
|
||||
@@ -22,11 +22,11 @@ walkdir = "2"
|
||||
bincode = "1.1.4"
|
||||
byteorder = "1.3.2"
|
||||
elf = "0.0.10"
|
||||
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.3.17" }
|
||||
solana-logger = { path = "../../logger", version = "1.3.17" }
|
||||
solana-measure = { path = "../../measure", version = "1.3.17" }
|
||||
solana-runtime = { path = "../../runtime", version = "1.3.17" }
|
||||
solana-sdk = { path = "../../sdk", version = "1.3.17" }
|
||||
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.3.19" }
|
||||
solana-logger = { path = "../../logger", version = "1.3.19" }
|
||||
solana-measure = { path = "../../measure", version = "1.3.19" }
|
||||
solana-runtime = { path = "../../runtime", version = "1.3.19" }
|
||||
solana-sdk = { path = "../../sdk", version = "1.3.19" }
|
||||
solana_rbpf = "=0.1.32"
|
||||
|
||||
[[bench]]
|
||||
|
@@ -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),
|
||||
|
@@ -101,8 +101,8 @@ 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 nonce2 = params.data[1];
|
||||
uint8_t nonce3 = params.data[2];
|
||||
uint8_t bump_seed2 = params.data[1];
|
||||
uint8_t bump_seed3 = params.data[2];
|
||||
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[DERIVED_KEY1_INDEX].key, true, false},
|
||||
@@ -116,10 +116,10 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
uint8_t seed2[] = {'B', 'i', 't', 's'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{seed2, SOL_ARRAY_SIZE(seed2)},
|
||||
{&nonce2, 1}};
|
||||
{&bump_seed2, 1}};
|
||||
const SolSignerSeed seeds2[] = {
|
||||
{(uint8_t *)accounts[DERIVED_KEY2_INDEX].key, SIZE_PUBKEY},
|
||||
{&nonce3, 1}};
|
||||
{&bump_seed3, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)},
|
||||
{seeds2, SOL_ARRAY_SIZE(seeds2)}};
|
||||
|
||||
|
@@ -18,6 +18,12 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
*val = *val + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// // Uncomment for Pubkey logging syscall
|
||||
// {
|
||||
// SolPubkey pubkey;
|
||||
// sol_log_pubkey(&pubkey);
|
||||
// }
|
||||
}
|
||||
return *val;
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-128bit"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-128bit-dep"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-alloc"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-call-depth"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-custom-heap"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
custom-heap = []
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-dep-crate"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-deprecated_loader"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-dup-accounts"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-error-handling"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
thiserror = "1.0"
|
||||
|
||||
[features]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-external-spend"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-instruction-introspection"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-invoke"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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]
|
||||
solana-bpf-rust-invoked = { path = "../invoked", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -41,9 +41,9 @@ fn process_instruction(
|
||||
) -> ProgramResult {
|
||||
info!("invoke Rust program");
|
||||
|
||||
let nonce1 = instruction_data[1];
|
||||
let nonce2 = instruction_data[2];
|
||||
let nonce3 = instruction_data[3];
|
||||
let bump_seed1 = instruction_data[1];
|
||||
let bump_seed2 = instruction_data[2];
|
||||
let bump_seed3 = instruction_data[3];
|
||||
|
||||
match instruction_data[0] {
|
||||
TEST_SUCCESS => {
|
||||
@@ -63,7 +63,11 @@ fn process_instruction(
|
||||
MAX_PERMITTED_DATA_INCREASE as u64,
|
||||
program_id,
|
||||
);
|
||||
invoke_signed(&instruction, accounts, &[&[b"You pass butter", &[nonce1]]])?;
|
||||
invoke_signed(
|
||||
&instruction,
|
||||
accounts,
|
||||
&[&[b"You pass butter", &[bump_seed1]]],
|
||||
)?;
|
||||
|
||||
assert_eq!(accounts[FROM_INDEX].lamports(), from_lamports - 42);
|
||||
assert_eq!(accounts[DERIVED_KEY1_INDEX].lamports(), to_lamports + 42);
|
||||
@@ -140,10 +144,99 @@ fn process_instruction(
|
||||
);
|
||||
}
|
||||
|
||||
info!("Test refcell usage");
|
||||
{
|
||||
let writable = INVOKED_ARGUMENT_INDEX;
|
||||
let readable = INVOKED_PROGRAM_INDEX;
|
||||
|
||||
let instruction = create_instruction(
|
||||
*accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
&[
|
||||
(accounts[writable].key, true, true),
|
||||
(accounts[readable].key, false, false),
|
||||
],
|
||||
vec![TEST_RETURN_ERROR, 1, 2, 3, 4, 5],
|
||||
);
|
||||
|
||||
// success with this account configuration as a check
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::Custom(42))
|
||||
);
|
||||
|
||||
{
|
||||
// writable but lamports borrow_mut'd
|
||||
let _ref_mut = accounts[writable].try_borrow_mut_lamports()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::AccountBorrowFailed)
|
||||
);
|
||||
}
|
||||
{
|
||||
// writable but data borrow_mut'd
|
||||
let _ref_mut = accounts[writable].try_borrow_mut_data()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::AccountBorrowFailed)
|
||||
);
|
||||
}
|
||||
{
|
||||
// writable but lamports borrow'd
|
||||
let _ref_mut = accounts[writable].try_borrow_lamports()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::AccountBorrowFailed)
|
||||
);
|
||||
}
|
||||
{
|
||||
// writable but data borrow'd
|
||||
let _ref_mut = accounts[writable].try_borrow_data()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::AccountBorrowFailed)
|
||||
);
|
||||
}
|
||||
{
|
||||
// readable but lamports borrow_mut'd
|
||||
let _ref_mut = accounts[readable].try_borrow_mut_lamports()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::AccountBorrowFailed)
|
||||
);
|
||||
}
|
||||
{
|
||||
// readable but data borrow_mut'd
|
||||
let _ref_mut = accounts[readable].try_borrow_mut_data()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::AccountBorrowFailed)
|
||||
);
|
||||
}
|
||||
{
|
||||
// readable but lamports borrow'd
|
||||
let _ref_mut = accounts[readable].try_borrow_lamports()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::Custom(42))
|
||||
);
|
||||
}
|
||||
{
|
||||
// readable but data borrow'd
|
||||
let _ref_mut = accounts[readable].try_borrow_data()?;
|
||||
assert_eq!(
|
||||
invoke(&instruction, accounts),
|
||||
Err(ProgramError::Custom(42))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
info!("Test create_program_address");
|
||||
{
|
||||
assert_eq!(
|
||||
&Pubkey::create_program_address(&[b"You pass butter", &[nonce1]], program_id)?,
|
||||
&Pubkey::create_program_address(
|
||||
&[b"You pass butter", &[bump_seed1]],
|
||||
program_id
|
||||
)?,
|
||||
accounts[DERIVED_KEY1_INDEX].key
|
||||
);
|
||||
assert_eq!(
|
||||
@@ -167,12 +260,12 @@ fn process_instruction(
|
||||
(accounts[DERIVED_KEY2_INDEX].key, true, false),
|
||||
(accounts[DERIVED_KEY3_INDEX].key, false, false),
|
||||
],
|
||||
vec![TEST_DERIVED_SIGNERS, nonce2, nonce3],
|
||||
vec![TEST_DERIVED_SIGNERS, bump_seed2, bump_seed3],
|
||||
);
|
||||
invoke_signed(
|
||||
&invoked_instruction,
|
||||
accounts,
|
||||
&[&[b"You pass butter", &[nonce1]]],
|
||||
&[&[b"You pass butter", &[bump_seed1]]],
|
||||
)?;
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-invoked"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -118,8 +118,8 @@ fn process_instruction(
|
||||
assert!(!accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
assert!(!accounts[DERIVED_KEY3_INDEX].is_signer);
|
||||
|
||||
let nonce2 = instruction_data[1];
|
||||
let nonce3 = instruction_data[2];
|
||||
let bump_seed2 = instruction_data[1];
|
||||
let bump_seed3 = instruction_data[2];
|
||||
let invoked_instruction = create_instruction(
|
||||
*accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
&[
|
||||
@@ -133,8 +133,8 @@ fn process_instruction(
|
||||
&invoked_instruction,
|
||||
accounts,
|
||||
&[
|
||||
&[b"Lil'", b"Bits", &[nonce2]],
|
||||
&[accounts[DERIVED_KEY2_INDEX].key.as_ref(), &[nonce3]],
|
||||
&[b"Lil'", b"Bits", &[bump_seed2]],
|
||||
&[accounts[DERIVED_KEY2_INDEX].key.as_ref(), &[bump_seed3]],
|
||||
],
|
||||
)?;
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-iter"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-many-args"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-bpf-rust-many-args-dep = { path = "../many_args_dep", version = "1.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
solana-bpf-rust-many-args-dep = { path = "../many_args_dep", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-many-args-dep"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-noop"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-panic"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-param-passing"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-bpf-rust-param-passing-dep = { path = "../param_passing_dep", version = "1.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
solana-bpf-rust-param-passing-dep = { path = "../param_passing_dep", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-param-passing-dep"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
description = "Solana BPF 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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-sanity"
|
||||
version = "1.3.17"
|
||||
version = "1.3.19"
|
||||
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.3.17", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.19", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user