Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
774a12e7b9 | ||
|
85e8926d81 | ||
|
a2be9c647f | ||
|
744006fe78 | ||
|
edf59cccd8 | ||
|
9c72bf871f | ||
|
033c87e3f1 | ||
|
d35d853e57 | ||
|
03317f6bf7 | ||
|
4f0e928a0a | ||
|
8600d5188d | ||
|
8cd7716ee3 | ||
|
b13385fba6 | ||
|
9f82208c29 | ||
|
596ede864b | ||
|
e4bd382472 | ||
|
a70aa28832 | ||
|
9a63cf51b5 | ||
|
b31ec0579c | ||
|
ad31768dd9 | ||
|
079ea91d6f | ||
|
48d08f2010 | ||
|
b34ba0fc4e | ||
|
41b99b96c0 | ||
|
fea6e4d39d | ||
|
fced68c3f4 | ||
|
7f006d810c | ||
|
cab1b102e6 | ||
|
448887a469 | ||
|
bded162ed8 | ||
|
765dd1b775 | ||
|
b74fbdf7eb | ||
|
fb0f0adb16 | ||
|
2a3c4d87ce | ||
|
eaa6e04e83 | ||
|
925973ee60 | ||
|
2c55319e41 | ||
|
f22a5efde5 | ||
|
add5c5b29f | ||
|
1b53f8b33d | ||
|
34591d2f2f | ||
|
bc1b95d6d0 |
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Only proceed if we are on one of the channels passed in when calling this file
|
||||
# Only proceed if we are on one of the channels passed in, or a tag build
|
||||
#
|
||||
|
||||
set -ex
|
||||
|
||||
[[ -n $CI_TAG ]] && exit 0
|
||||
|
||||
eval "$(ci/channel-info.sh)"
|
||||
|
||||
for acceptable_channel in "$@"; do
|
||||
|
377
Cargo.lock
generated
377
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.15"
|
||||
version = "1.3.17"
|
||||
description = "Solana account decoder"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -18,11 +18,11 @@ lazy_static = "1.4.0"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.56"
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "2.0.6", features = ["skip-no-mangle"] }
|
||||
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" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "=2.0.6", features = ["skip-no-mangle"] }
|
||||
thiserror = "1.0"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
@@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-accounts-bench"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.15" }
|
||||
solana-perf = { path = "../perf", version = "1.3.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-client"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-banks-interface = { path = "../banks-interface", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
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.15" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.17" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-interface"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
tarpc = { version = "0.21.0", features = ["full"] }
|
||||
|
||||
[lib]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-banks-server"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
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" }
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-core = { path = "../core", version = "1.3.15" }
|
||||
solana-genesis = { path = "../genesis", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.15" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.15" }
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.17" }
|
||||
|
||||
[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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-core = { path = "../core", version = "1.3.15" }
|
||||
solana-genesis = { path = "../genesis", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[dev-dependencies]
|
||||
serial_test = "0.4.0"
|
||||
serial_test_derive = "0.4.0"
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.15" }
|
||||
solana-local-cluster = { path = "../local-cluster", version = "1.3.17" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
27
cargo
Executable file
27
cargo
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck source=ci/rust-version.sh
|
||||
here=$(dirname "$0")
|
||||
|
||||
source "${here}"/ci/rust-version.sh all
|
||||
|
||||
toolchain=
|
||||
case "$1" in
|
||||
stable)
|
||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||
toolchain="$rust_stable"
|
||||
shift
|
||||
;;
|
||||
nightly)
|
||||
# shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh
|
||||
toolchain="$rust_nightly"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||
toolchain="$rust_stable"
|
||||
;;
|
||||
esac
|
||||
|
||||
set -x
|
||||
exec cargo "+${toolchain}" "${@}"
|
@@ -42,10 +42,10 @@ def get_packages():
|
||||
sys.exit(1)
|
||||
|
||||
# Order dependencies
|
||||
deleted_dependencies = []
|
||||
sorted_dependency_graph = []
|
||||
max_iterations = pow(len(dependency_graph),2)
|
||||
while len(deleted_dependencies) < len(dependency_graph):
|
||||
while dependency_graph:
|
||||
deleted_packages = []
|
||||
if max_iterations == 0:
|
||||
# One day be more helpful and find the actual cycle for the user...
|
||||
sys.exit('Error: Circular dependency suspected between these packages: \n {}\n'.format('\n '.join(dependency_graph.keys())))
|
||||
@@ -53,13 +53,17 @@ def get_packages():
|
||||
max_iterations -= 1
|
||||
|
||||
for package, dependencies in dependency_graph.items():
|
||||
if package in deleted_packages:
|
||||
continue
|
||||
for dependency in dependencies:
|
||||
if dependency in dependency_graph:
|
||||
break
|
||||
else:
|
||||
deleted_dependencies.append(package)
|
||||
deleted_packages.append(package)
|
||||
sorted_dependency_graph.append((package, manifest_path[package]))
|
||||
|
||||
dependency_graph = {p: d for p, d in dependency_graph.items() if not p in deleted_packages }
|
||||
|
||||
|
||||
return sorted_dependency_graph
|
||||
|
||||
|
@@ -56,7 +56,19 @@ _ cargo +"$rust_stable" fmt --all -- --check
|
||||
# run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there
|
||||
_ cargo +"$rust_nightly" clippy -Zunstable-options --workspace --all-targets -- --deny=warnings
|
||||
|
||||
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-2020-0002 --ignore RUSTSEC-2020-0008
|
||||
|
||||
cargo_audit_ignores=(
|
||||
# failure is officially deprecated/unmaintained
|
||||
#
|
||||
# Blocked on multiple upstream crates removing their `failure` dependency.
|
||||
--ignore RUSTSEC-2020-0036
|
||||
|
||||
# `net2` crate has been deprecated; use `socket2` instead
|
||||
#
|
||||
# Blocked on https://github.com/paritytech/jsonrpc/issues/575
|
||||
--ignore RUSTSEC-2020-0016
|
||||
)
|
||||
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit "${cargo_audit_ignores[@]}"
|
||||
|
||||
{
|
||||
cd programs/bpf
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-clap-utils"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.17" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
thiserror = "1.0.20"
|
||||
tiny-bip39 = "0.7.0"
|
||||
url = "2.1.0"
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-cli-config"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -301,7 +301,7 @@ pub struct CliValidatorsStakeByVersion {
|
||||
pub struct CliValidators {
|
||||
pub total_active_stake: u64,
|
||||
pub total_current_stake: u64,
|
||||
pub total_deliquent_stake: u64,
|
||||
pub total_delinquent_stake: u64,
|
||||
pub current_validators: Vec<CliValidator>,
|
||||
pub delinquent_validators: Vec<CliValidator>,
|
||||
pub stake_by_version: BTreeMap<String, CliValidatorsStakeByVersion>,
|
||||
@@ -360,7 +360,7 @@ impl fmt::Display for CliValidators {
|
||||
"Active Stake:",
|
||||
&build_balance_message(self.total_active_stake, self.use_lamports_unit, true),
|
||||
)?;
|
||||
if self.total_deliquent_stake > 0 {
|
||||
if self.total_delinquent_stake > 0 {
|
||||
writeln_name_value(
|
||||
f,
|
||||
"Current Stake:",
|
||||
@@ -376,11 +376,11 @@ impl fmt::Display for CliValidators {
|
||||
&format!(
|
||||
"{} ({:0.2}%)",
|
||||
&build_balance_message(
|
||||
self.total_deliquent_stake,
|
||||
self.total_delinquent_stake,
|
||||
self.use_lamports_unit,
|
||||
true
|
||||
),
|
||||
100. * self.total_deliquent_stake as f64 / self.total_active_stake as f64
|
||||
100. * self.total_delinquent_stake as f64 / self.total_active_stake as f64
|
||||
),
|
||||
)?;
|
||||
}
|
||||
@@ -571,6 +571,48 @@ impl fmt::Display for CliKeyedStakeState {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliEpochReward {
|
||||
pub epoch: Epoch,
|
||||
pub effective_slot: Slot,
|
||||
pub amount: u64, // lamports
|
||||
pub post_balance: u64, // lamports
|
||||
pub percent_change: f64,
|
||||
pub apr: f64,
|
||||
}
|
||||
|
||||
fn show_epoch_rewards(
|
||||
f: &mut fmt::Formatter,
|
||||
epoch_rewards: &Option<Vec<CliEpochReward>>,
|
||||
) -> fmt::Result {
|
||||
if let Some(epoch_rewards) = epoch_rewards {
|
||||
if epoch_rewards.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
writeln!(f, "Epoch Rewards:")?;
|
||||
writeln!(
|
||||
f,
|
||||
" {:<8} {:<11} {:<15} {:<15} {:>14} {:>14}",
|
||||
"Epoch", "Reward Slot", "Amount", "New Balance", "Percent Change", "APR"
|
||||
)?;
|
||||
for reward in epoch_rewards {
|
||||
writeln!(
|
||||
f,
|
||||
" {:<8} {:<11} ◎{:<14.9} ◎{:<14.9} {:>13.9}% {:>13.9}%",
|
||||
reward.epoch,
|
||||
reward.effective_slot,
|
||||
lamports_to_sol(reward.amount),
|
||||
lamports_to_sol(reward.post_balance),
|
||||
reward.percent_change,
|
||||
reward.apr,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Default, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliStakeState {
|
||||
@@ -600,6 +642,8 @@ pub struct CliStakeState {
|
||||
pub activating_stake: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub deactivating_stake: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub epoch_rewards: Option<Vec<CliEpochReward>>,
|
||||
}
|
||||
|
||||
impl QuietDisplay for CliStakeState {}
|
||||
@@ -753,13 +797,14 @@ impl fmt::Display for CliStakeState {
|
||||
}
|
||||
show_authorized(f, self.authorized.as_ref().unwrap())?;
|
||||
show_lockup(f, self.lockup.as_ref())?;
|
||||
show_epoch_rewards(f, &self.epoch_rewards)?
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[derive(Serialize, Deserialize, PartialEq)]
|
||||
pub enum CliStakeType {
|
||||
Stake,
|
||||
RewardsPool,
|
||||
@@ -936,6 +981,8 @@ pub struct CliVoteAccount {
|
||||
pub epoch_voting_history: Vec<CliEpochVotingHistory>,
|
||||
#[serde(skip_serializing)]
|
||||
pub use_lamports_unit: bool,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub epoch_rewards: Option<Vec<CliEpochReward>>,
|
||||
}
|
||||
|
||||
impl QuietDisplay for CliVoteAccount {}
|
||||
@@ -980,6 +1027,7 @@ impl fmt::Display for CliVoteAccount {
|
||||
)?;
|
||||
}
|
||||
}
|
||||
show_epoch_rewards(f, &self.epoch_rewards)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-cli"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -27,30 +27,30 @@ 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.15" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.3.15" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.15" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.3.15" }
|
||||
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" }
|
||||
thiserror = "1.0.20"
|
||||
url = "2.1.1"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-core = { path = "../core", version = "1.3.15" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.15" }
|
||||
solana-core = { path = "../core", version = "1.3.17" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
tempfile = "3.1.0"
|
||||
|
||||
[[bin]]
|
||||
|
@@ -114,7 +114,7 @@ pub enum CliCommand {
|
||||
Fees,
|
||||
FirstAvailableBlock,
|
||||
GetBlock {
|
||||
slot: Slot,
|
||||
slot: Option<Slot>,
|
||||
},
|
||||
GetBlockTime {
|
||||
slot: Option<Slot>,
|
||||
|
@@ -73,8 +73,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
||||
.validator(is_slot)
|
||||
.value_name("SLOT")
|
||||
.takes_value(true)
|
||||
.index(1)
|
||||
.required(true),
|
||||
.index(1),
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
@@ -363,7 +362,7 @@ pub fn parse_cluster_ping(
|
||||
}
|
||||
|
||||
pub fn parse_get_block(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
||||
let slot = value_t_or_exit!(matches, "slot", Slot);
|
||||
let slot = value_of(matches, "slot");
|
||||
Ok(CliCommandInfo {
|
||||
command: CliCommand::GetBlock { slot },
|
||||
signers: vec![],
|
||||
@@ -700,7 +699,17 @@ pub fn process_leader_schedule(rpc_client: &RpcClient) -> ProcessResult {
|
||||
Ok("".to_string())
|
||||
}
|
||||
|
||||
pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot) -> ProcessResult {
|
||||
pub fn process_get_block(
|
||||
rpc_client: &RpcClient,
|
||||
_config: &CliConfig,
|
||||
slot: Option<Slot>,
|
||||
) -> ProcessResult {
|
||||
let slot = if let Some(slot) = slot {
|
||||
slot
|
||||
} else {
|
||||
rpc_client.get_slot()?
|
||||
};
|
||||
|
||||
let mut block =
|
||||
rpc_client.get_confirmed_block_with_encoding(slot, UiTransactionEncoding::Base64)?;
|
||||
|
||||
@@ -713,19 +722,26 @@ pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot
|
||||
}
|
||||
if !block.rewards.is_empty() {
|
||||
block.rewards.sort_by(|a, b| a.pubkey.cmp(&b.pubkey));
|
||||
let mut total_rewards = 0;
|
||||
println!("Rewards:",);
|
||||
println!(
|
||||
" {:<44} {:<15} {:<13} {:>14}",
|
||||
"Address", "Amount", "New Balance", "Percent Change"
|
||||
" {:<44} {:^15} {:<15} {:<20} {:>14}",
|
||||
"Address", "Type", "Amount", "New Balance", "Percent Change"
|
||||
);
|
||||
for reward in block.rewards {
|
||||
let sign = if reward.lamports < 0 { "-" } else { "" };
|
||||
|
||||
total_rewards += reward.lamports;
|
||||
println!(
|
||||
" {:<44} {:>15} {}",
|
||||
" {:<44} {:^15} {:>15} {}",
|
||||
reward.pubkey,
|
||||
if let Some(reward_type) = reward.reward_type {
|
||||
format!("{}", reward_type)
|
||||
} else {
|
||||
"-".to_string()
|
||||
},
|
||||
format!(
|
||||
"{}◎{:<14.4}",
|
||||
"{}◎{:<14.9}",
|
||||
sign,
|
||||
lamports_to_sol(reward.lamports.abs() as u64)
|
||||
),
|
||||
@@ -733,7 +749,7 @@ pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot
|
||||
" - -".to_string()
|
||||
} else {
|
||||
format!(
|
||||
"◎{:<12.4} {:>13.4}%",
|
||||
"◎{:<19.9} {:>13.9}%",
|
||||
lamports_to_sol(reward.post_balance),
|
||||
reward.lamports.abs() as f64
|
||||
/ (reward.post_balance as f64 - reward.lamports as f64)
|
||||
@@ -741,6 +757,13 @@ pub fn process_get_block(rpc_client: &RpcClient, _config: &CliConfig, slot: Slot
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
let sign = if total_rewards < 0 { "-" } else { "" };
|
||||
println!(
|
||||
"Total Rewards: {}◎{:<12.9}",
|
||||
sign,
|
||||
lamports_to_sol(total_rewards.abs() as u64)
|
||||
);
|
||||
}
|
||||
for (index, transaction_with_meta) in block.transactions.iter().enumerate() {
|
||||
println!("Transaction {}:", index);
|
||||
@@ -1396,12 +1419,12 @@ pub fn process_show_validators(
|
||||
.map(|vote_account| vote_account.activated_stake)
|
||||
.sum();
|
||||
|
||||
let total_deliquent_stake = vote_accounts
|
||||
let total_delinquent_stake = vote_accounts
|
||||
.delinquent
|
||||
.iter()
|
||||
.map(|vote_account| vote_account.activated_stake)
|
||||
.sum();
|
||||
let total_current_stake = total_active_stake - total_deliquent_stake;
|
||||
let total_current_stake = total_active_stake - total_delinquent_stake;
|
||||
|
||||
let mut current = vote_accounts.current;
|
||||
current.sort_by(|a, b| b.activated_stake.cmp(&a.activated_stake));
|
||||
@@ -1455,7 +1478,7 @@ pub fn process_show_validators(
|
||||
let cli_validators = CliValidators {
|
||||
total_active_stake,
|
||||
total_current_stake,
|
||||
total_deliquent_stake,
|
||||
total_delinquent_stake,
|
||||
current_validators,
|
||||
delinquent_validators,
|
||||
stake_by_version,
|
||||
|
106
cli/src/stake.rs
106
cli/src/stake.rs
@@ -7,6 +7,7 @@ use crate::{
|
||||
nonce::check_nonce_account,
|
||||
spend_utils::{resolve_spend_tx_and_check_account_balances, SpendAmount},
|
||||
};
|
||||
use chrono::{Local, TimeZone};
|
||||
use clap::{App, Arg, ArgGroup, ArgMatches, SubCommand};
|
||||
use solana_clap_utils::{
|
||||
fee_payer::{fee_payer_arg, FEE_PAYER_ARG},
|
||||
@@ -18,7 +19,8 @@ use solana_clap_utils::{
|
||||
ArgConstant,
|
||||
};
|
||||
use solana_cli_output::{
|
||||
return_signers, CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType,
|
||||
return_signers, CliEpochReward, CliStakeHistory, CliStakeHistoryEntry, CliStakeState,
|
||||
CliStakeType,
|
||||
};
|
||||
use solana_client::{
|
||||
blockhash_query::BlockhashQuery, nonce_utils, rpc_client::RpcClient,
|
||||
@@ -27,7 +29,7 @@ use solana_client::{
|
||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||
use solana_sdk::{
|
||||
account_utils::StateMut,
|
||||
clock::Clock,
|
||||
clock::{Clock, Epoch, Slot, UnixTimestamp, SECONDS_PER_DAY},
|
||||
message::Message,
|
||||
pubkey::Pubkey,
|
||||
system_instruction::SystemError,
|
||||
@@ -43,7 +45,7 @@ use solana_stake_program::{
|
||||
stake_state::{Authorized, Lockup, Meta, StakeAuthorize, StakeState},
|
||||
};
|
||||
use solana_vote_program::vote_state::VoteState;
|
||||
use std::{ops::Deref, sync::Arc};
|
||||
use std::{convert::TryInto, ops::Deref, sync::Arc};
|
||||
|
||||
pub const STAKE_AUTHORITY_ARG: ArgConstant<'static> = ArgConstant {
|
||||
name: "stake_authority",
|
||||
@@ -1543,6 +1545,7 @@ pub fn build_stake_state(
|
||||
active_stake: u64_some_if_not_zero(active_stake),
|
||||
activating_stake: u64_some_if_not_zero(activating_stake),
|
||||
deactivating_stake: u64_some_if_not_zero(deactivating_stake),
|
||||
..CliStakeState::default()
|
||||
}
|
||||
}
|
||||
StakeState::RewardsPool => CliStakeState {
|
||||
@@ -1577,17 +1580,96 @@ pub fn build_stake_state(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn fetch_epoch_rewards(
|
||||
rpc_client: &RpcClient,
|
||||
address: &Pubkey,
|
||||
lowest_epoch: Epoch,
|
||||
) -> Result<Vec<CliEpochReward>, Box<dyn std::error::Error>> {
|
||||
let mut all_epoch_rewards = vec![];
|
||||
|
||||
let epoch_schedule = rpc_client.get_epoch_schedule()?;
|
||||
let slot = rpc_client.get_slot()?;
|
||||
let first_available_block = rpc_client.get_first_available_block()?;
|
||||
|
||||
let mut epoch = epoch_schedule.get_epoch_and_slot_index(slot).0;
|
||||
let mut epoch_info: Option<(Slot, UnixTimestamp, solana_transaction_status::Rewards)> = None;
|
||||
while epoch > lowest_epoch {
|
||||
let first_slot_in_epoch = epoch_schedule.get_first_slot_in_epoch(epoch);
|
||||
if first_slot_in_epoch < first_available_block {
|
||||
// RPC node is out of history data
|
||||
break;
|
||||
}
|
||||
|
||||
let first_confirmed_block_in_epoch = *rpc_client
|
||||
.get_confirmed_blocks_with_limit(first_slot_in_epoch, 1)?
|
||||
.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(
|
||||
first_confirmed_block_in_epoch,
|
||||
solana_transaction_status::UiTransactionEncoding::Base64,
|
||||
)?;
|
||||
|
||||
let epoch_start_time = if let Some(block_time) = first_confirmed_block.block_time {
|
||||
block_time
|
||||
} else {
|
||||
break;
|
||||
};
|
||||
|
||||
// Rewards for the previous epoch are found in the first confirmed block of the current epoch
|
||||
let previous_epoch_rewards = first_confirmed_block.rewards;
|
||||
|
||||
if let Some((effective_slot, epoch_end_time, epoch_rewards)) = epoch_info {
|
||||
let wallclock_epoch_duration =
|
||||
{ Local.timestamp(epoch_end_time, 0) - Local.timestamp(epoch_start_time, 0) }
|
||||
.to_std()?
|
||||
.as_secs_f64();
|
||||
|
||||
let wallclock_epochs_per_year =
|
||||
(SECONDS_PER_DAY * 356) as f64 / wallclock_epoch_duration;
|
||||
|
||||
if let Some(reward) = epoch_rewards
|
||||
.into_iter()
|
||||
.find(|reward| reward.pubkey == address.to_string())
|
||||
{
|
||||
if reward.post_balance > reward.lamports.try_into().unwrap_or(0) {
|
||||
let balance_increase_percent = reward.lamports.abs() as f64
|
||||
/ (reward.post_balance as f64 - reward.lamports as f64);
|
||||
|
||||
all_epoch_rewards.push(CliEpochReward {
|
||||
epoch,
|
||||
effective_slot,
|
||||
amount: reward.lamports.abs() as u64,
|
||||
post_balance: reward.post_balance,
|
||||
percent_change: balance_increase_percent,
|
||||
apr: balance_increase_percent * wallclock_epochs_per_year,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
epoch -= 1;
|
||||
epoch_info = Some((
|
||||
first_confirmed_block_in_epoch,
|
||||
epoch_start_time,
|
||||
previous_epoch_rewards,
|
||||
));
|
||||
}
|
||||
|
||||
Ok(all_epoch_rewards)
|
||||
}
|
||||
|
||||
pub fn process_show_stake_account(
|
||||
rpc_client: &RpcClient,
|
||||
config: &CliConfig,
|
||||
stake_account_pubkey: &Pubkey,
|
||||
stake_account_address: &Pubkey,
|
||||
use_lamports_unit: bool,
|
||||
) -> ProcessResult {
|
||||
let stake_account = rpc_client.get_account(stake_account_pubkey)?;
|
||||
let stake_account = rpc_client.get_account(stake_account_address)?;
|
||||
if stake_account.owner != solana_stake_program::id() {
|
||||
return Err(CliError::RpcRequestError(format!(
|
||||
"{:?} is not a stake account",
|
||||
stake_account_pubkey,
|
||||
stake_account_address,
|
||||
))
|
||||
.into());
|
||||
}
|
||||
@@ -1603,13 +1685,23 @@ pub fn process_show_stake_account(
|
||||
CliError::RpcRequestError("Failed to deserialize clock sysvar".to_string())
|
||||
})?;
|
||||
|
||||
let state = build_stake_state(
|
||||
let mut state = build_stake_state(
|
||||
stake_account.lamports,
|
||||
&stake_state,
|
||||
use_lamports_unit,
|
||||
&stake_history,
|
||||
&clock,
|
||||
);
|
||||
|
||||
if state.stake_type == CliStakeType::Stake {
|
||||
if let Some(activation_epoch) = state.activation_epoch {
|
||||
state.epoch_rewards = Some(fetch_epoch_rewards(
|
||||
rpc_client,
|
||||
stake_account_address,
|
||||
activation_epoch,
|
||||
)?);
|
||||
}
|
||||
}
|
||||
Ok(config.output_format.formatted_string(&state))
|
||||
}
|
||||
Err(err) => Err(CliError::RpcRequestError(format!(
|
||||
|
@@ -671,11 +671,11 @@ fn get_vote_account(
|
||||
pub fn process_show_vote_account(
|
||||
rpc_client: &RpcClient,
|
||||
config: &CliConfig,
|
||||
vote_account_pubkey: &Pubkey,
|
||||
vote_account_address: &Pubkey,
|
||||
use_lamports_unit: bool,
|
||||
) -> ProcessResult {
|
||||
let (vote_account, vote_state) =
|
||||
get_vote_account(rpc_client, vote_account_pubkey, config.commitment)?;
|
||||
get_vote_account(rpc_client, vote_account_address, config.commitment)?;
|
||||
|
||||
let epoch_schedule = rpc_client.get_epoch_schedule()?;
|
||||
|
||||
@@ -696,6 +696,12 @@ pub fn process_show_vote_account(
|
||||
}
|
||||
}
|
||||
|
||||
let epoch_rewards = Some(crate::stake::fetch_epoch_rewards(
|
||||
rpc_client,
|
||||
vote_account_address,
|
||||
1,
|
||||
)?);
|
||||
|
||||
let vote_account_data = CliVoteAccount {
|
||||
account_balance: vote_account.lamports,
|
||||
validator_identity: vote_state.node_pubkey.to_string(),
|
||||
@@ -708,6 +714,7 @@ pub fn process_show_vote_account(
|
||||
votes,
|
||||
epoch_voting_history,
|
||||
use_lamports_unit,
|
||||
epoch_rewards,
|
||||
};
|
||||
|
||||
Ok(config.output_format.formatted_string(&vote_account_data))
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-client"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
description = "Solana Client"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -9,6 +9,7 @@ license = "Apache-2.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
base64 = "0.13.0"
|
||||
bincode = "1.3.1"
|
||||
bs58 = "0.3.1"
|
||||
clap = "2.33.0"
|
||||
@@ -20,12 +21,12 @@ 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.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
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" }
|
||||
thiserror = "1.0"
|
||||
tungstenite = "0.10.1"
|
||||
url = "2.1.1"
|
||||
@@ -34,7 +35,7 @@ url = "2.1.1"
|
||||
assert_matches = "1.3.0"
|
||||
jsonrpc-core = "15.0.0"
|
||||
jsonrpc-http-server = "15.0.0"
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -112,7 +112,7 @@ impl RpcSender for MockSender {
|
||||
Signature::new(&[8; 64]).to_string()
|
||||
} else {
|
||||
let tx_str = params.as_array().unwrap()[0].as_str().unwrap().to_string();
|
||||
let data = bs58::decode(tx_str).into_vec().unwrap();
|
||||
let data = base64::decode(tx_str).unwrap();
|
||||
let tx: Transaction = bincode::deserialize(&data).unwrap();
|
||||
tx.signatures[0].to_string()
|
||||
};
|
||||
|
@@ -5,7 +5,8 @@ use crate::{
|
||||
rpc_config::RpcAccountInfoConfig,
|
||||
rpc_config::{
|
||||
RpcGetConfirmedSignaturesForAddress2Config, RpcLargestAccountsConfig,
|
||||
RpcProgramAccountsConfig, RpcSendTransactionConfig, RpcTokenAccountsFilter,
|
||||
RpcProgramAccountsConfig, RpcSendTransactionConfig, RpcSimulateTransactionConfig,
|
||||
RpcTokenAccountsFilter,
|
||||
},
|
||||
rpc_request::{RpcError, RpcRequest, TokenAccountsFilter},
|
||||
rpc_response::*,
|
||||
@@ -48,6 +49,26 @@ pub struct RpcClient {
|
||||
sender: Box<dyn RpcSender + Send + Sync + 'static>,
|
||||
}
|
||||
|
||||
fn serialize_encode_transaction(
|
||||
transaction: &Transaction,
|
||||
encoding: UiTransactionEncoding,
|
||||
) -> ClientResult<String> {
|
||||
let serialized = serialize(transaction)
|
||||
.map_err(|e| ClientErrorKind::Custom(format!("transaction serialization failed: {}", e)))?;
|
||||
let encoded = match encoding {
|
||||
UiTransactionEncoding::Base58 => bs58::encode(serialized).into_string(),
|
||||
UiTransactionEncoding::Base64 => base64::encode(serialized),
|
||||
_ => {
|
||||
return Err(ClientErrorKind::Custom(format!(
|
||||
"unsupported transaction encoding: {}. Supported encodings: base58, base64",
|
||||
encoding
|
||||
))
|
||||
.into())
|
||||
}
|
||||
};
|
||||
Ok(encoded)
|
||||
}
|
||||
|
||||
impl RpcClient {
|
||||
pub fn new_sender<T: RpcSender + Send + Sync + 'static>(sender: T) -> Self {
|
||||
Self {
|
||||
@@ -112,8 +133,12 @@ impl RpcClient {
|
||||
transaction: &Transaction,
|
||||
config: RpcSendTransactionConfig,
|
||||
) -> ClientResult<Signature> {
|
||||
let serialized_encoded = bs58::encode(serialize(transaction).unwrap()).into_string();
|
||||
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base64);
|
||||
let config = RpcSendTransactionConfig {
|
||||
encoding: Some(encoding),
|
||||
..config
|
||||
};
|
||||
let serialized_encoded = serialize_encode_transaction(transaction, encoding)?;
|
||||
let signature_base58_str: String = self.send(
|
||||
RpcRequest::SendTransaction,
|
||||
json!([serialized_encoded, config]),
|
||||
@@ -140,12 +165,24 @@ impl RpcClient {
|
||||
pub fn simulate_transaction(
|
||||
&self,
|
||||
transaction: &Transaction,
|
||||
sig_verify: bool,
|
||||
) -> RpcResult<RpcSimulateTransactionResult> {
|
||||
let serialized_encoded = bs58::encode(serialize(transaction).unwrap()).into_string();
|
||||
self.simulate_transaction_with_config(transaction, RpcSimulateTransactionConfig::default())
|
||||
}
|
||||
|
||||
pub fn simulate_transaction_with_config(
|
||||
&self,
|
||||
transaction: &Transaction,
|
||||
config: RpcSimulateTransactionConfig,
|
||||
) -> RpcResult<RpcSimulateTransactionResult> {
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base64);
|
||||
let config = RpcSimulateTransactionConfig {
|
||||
encoding: Some(encoding),
|
||||
..config
|
||||
};
|
||||
let serialized_encoded = serialize_encode_transaction(transaction, encoding)?;
|
||||
self.send(
|
||||
RpcRequest::SimulateTransaction,
|
||||
json!([serialized_encoded, { "sigVerify": sig_verify }]),
|
||||
json!([serialized_encoded, config]),
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@ use solana_sdk::{
|
||||
clock::Epoch,
|
||||
commitment_config::{CommitmentConfig, CommitmentLevel},
|
||||
};
|
||||
use solana_transaction_status::UiTransactionEncoding;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -17,6 +18,7 @@ pub struct RpcSendTransactionConfig {
|
||||
#[serde(default)]
|
||||
pub skip_preflight: bool,
|
||||
pub preflight_commitment: Option<CommitmentLevel>,
|
||||
pub encoding: Option<UiTransactionEncoding>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
||||
@@ -26,6 +28,7 @@ pub struct RpcSimulateTransactionConfig {
|
||||
pub sig_verify: bool,
|
||||
#[serde(flatten)]
|
||||
pub commitment: Option<CommitmentConfig>,
|
||||
pub encoding: Option<UiTransactionEncoding>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "solana-core"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
documentation = "https://docs.rs/solana"
|
||||
homepage = "https://solana.com/"
|
||||
readme = "../README.md"
|
||||
@@ -14,6 +14,7 @@ edition = "2018"
|
||||
codecov = { repository = "solana-labs/solana", branch = "master", service = "github" }
|
||||
|
||||
[dependencies]
|
||||
base64 = "0.12.3"
|
||||
bincode = "1.3.1"
|
||||
bv = { version = "0.11.1", features = ["serde"] }
|
||||
bs58 = "0.3.1"
|
||||
@@ -43,43 +44,41 @@ 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.15" }
|
||||
solana-banks-server = { path = "../banks-server", version = "1.3.15" }
|
||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.3.15" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-perf = { path = "../perf", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-sdk-macro-frozen-abi = { path = "../sdk/macro-frozen-abi", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.15" }
|
||||
solana-streamer = { path = "../streamer", version = "1.3.15" }
|
||||
solana-sys-tuner = { path = "../sys-tuner", version = "1.3.15" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
solana-vote-signer = { path = "../vote-signer", version = "1.3.15" }
|
||||
spl-token-v2-0 = { package = "spl-token", version = "2.0.6", features = ["skip-no-mangle"] }
|
||||
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" }
|
||||
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.15" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.17" }
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
trees = "0.2.1"
|
||||
|
||||
[dev-dependencies]
|
||||
base64 = "0.12.3"
|
||||
matches = "0.1.6"
|
||||
reqwest = { version = "0.10.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serial_test = "0.4.0"
|
||||
|
@@ -534,13 +534,14 @@ impl BankingStage {
|
||||
mut loaded_accounts,
|
||||
results,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
mut retryable_txs,
|
||||
tx_count,
|
||||
signature_count,
|
||||
) = bank.load_and_execute_transactions(
|
||||
batch,
|
||||
MAX_PROCESSING_AGE,
|
||||
None,
|
||||
transaction_status_sender.is_some(),
|
||||
transaction_status_sender.is_some(),
|
||||
);
|
||||
load_execute_time.stop();
|
||||
@@ -580,6 +581,7 @@ impl BankingStage {
|
||||
tx_results.processing_results,
|
||||
TransactionBalancesSet::new(pre_balances, post_balances),
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
sender,
|
||||
);
|
||||
}
|
||||
|
@@ -6,15 +6,11 @@
|
||||
//! command-line tools to spin up validators and a Rust library
|
||||
//!
|
||||
|
||||
#[macro_use]
|
||||
extern crate solana_bpf_loader_program;
|
||||
|
||||
pub mod accounts_background_service;
|
||||
pub mod accounts_hash_verifier;
|
||||
pub mod banking_stage;
|
||||
pub mod bigtable_upload_service;
|
||||
pub mod broadcast_stage;
|
||||
mod builtins;
|
||||
pub mod cache_block_time_service;
|
||||
pub mod cluster_info_vote_listener;
|
||||
pub mod commitment_service;
|
||||
|
@@ -79,6 +79,26 @@ solana_sdk::pubkeys!(
|
||||
"GumSE5HsMV5HCwBTv2D2D81yy9x17aDkvobkqAfTRgmo",
|
||||
"AzVV9ZZDxTgW4wWfJmsG6ytaHpQGSe1yz76Nyy84VbQF",
|
||||
"8CUUMKYNGxdgYio5CLHRHyzMEhhVRMcqefgE6dLqnVRK",
|
||||
"CQDYc4ET2mbFhVpgj41gXahL6Exn5ZoPcGAzSHuYxwmE",
|
||||
"5PLJZLJiRR9vf7d1JCCg7UuWjtyN9nkab9uok6TqSyuP",
|
||||
"7xJ9CLtEAcEShw9kW2gSoZkRWL566Dg12cvgzANJwbTr",
|
||||
"BuCEvc9ze8UoAQwwsQLy8d447C8sA4zeVtVpc6m5wQeS",
|
||||
"8ndGYFjav6NDXvzYcxs449Aub3AxYv4vYpk89zRDwgj7",
|
||||
"8W58E8JVJjH1jCy5CeHJQgvwFXTyAVyesuXRZGbcSUGG",
|
||||
"GNiz4Mq886bTNDT3pijGsu2gbw6it7sqrwncro45USeB",
|
||||
"GhsotwFMH6XUrRLJCxcx62h7748N2Uq8mf87hUGkmPhg",
|
||||
"Fgyh8EeYGZtbW8sS33YmNQnzx54WXPrJ5KWNPkCfWPot",
|
||||
"8UVjvYyoqP6sqcctTso3xpCdCfgTMiv3VRh7vraC2eJk",
|
||||
"BhvLngiqqKeZ8rpxch2uGjeCiC88zzewoWPRuoxpp1aS",
|
||||
"63DtkW7zuARcd185EmHAkfF44bDcC2SiTSEj2spLP3iA",
|
||||
"GvpCiTgq9dmEeojCDBivoLoZqc4AkbUDACpqPMwYLWKh",
|
||||
"7Y8smnoUrYKGGuDq2uaFKVxJYhojgg7DVixHyAtGTYEV",
|
||||
"DUS1KxwUhUyDKB4A81E8vdnTe3hSahd92Abtn9CXsEcj",
|
||||
"F9MWFw8cnYVwsRq8Am1PGfFL3cQUZV37mbGoxZftzLjN",
|
||||
"8vqrX3H2BYLaXVintse3gorPEM4TgTwTFZNN1Fm9TdYs",
|
||||
"CUageMFi49kzoDqtdU8NvQ4Bq3sbtJygjKDAXJ45nmAi",
|
||||
"5smrYwb1Hr2T8XMnvsqccTgXxuqQs14iuE8RbHFYf2Cf",
|
||||
"xQadXQiUTCCFhfHjvQx1hyJK6KVWr1w2fD6DT3cdwj7",
|
||||
]
|
||||
);
|
||||
|
||||
|
@@ -327,7 +327,6 @@ impl ReplayStage {
|
||||
&bank_forks,
|
||||
&leader_schedule_cache,
|
||||
&subscriptions,
|
||||
rewards_recorder_sender.clone(),
|
||||
&mut progress,
|
||||
&mut all_pubkeys,
|
||||
);
|
||||
@@ -349,6 +348,7 @@ impl ReplayStage {
|
||||
&mut heaviest_subtree_fork_choice,
|
||||
&replay_vote_sender,
|
||||
&bank_notification_sender,
|
||||
&rewards_recorder_sender,
|
||||
);
|
||||
replay_active_banks_time.stop();
|
||||
Self::report_memory(&allocated, "replay_active_banks", start);
|
||||
@@ -590,7 +590,6 @@ impl ReplayStage {
|
||||
&poh_recorder,
|
||||
&leader_schedule_cache,
|
||||
&subscriptions,
|
||||
rewards_recorder_sender.clone(),
|
||||
&progress,
|
||||
&retransmit_slots_sender,
|
||||
&mut skipped_slots_info,
|
||||
@@ -831,7 +830,6 @@ impl ReplayStage {
|
||||
poh_recorder: &Arc<Mutex<PohRecorder>>,
|
||||
leader_schedule_cache: &Arc<LeaderScheduleCache>,
|
||||
subscriptions: &Arc<RpcSubscriptions>,
|
||||
rewards_recorder_sender: Option<RewardsRecorderSender>,
|
||||
progress_map: &ProgressMap,
|
||||
retransmit_slots_sender: &RetransmitSlotsSender,
|
||||
skipped_slots_info: &mut SkippedSlotsInfo,
|
||||
@@ -930,7 +928,6 @@ impl ReplayStage {
|
||||
poh_slot,
|
||||
root_slot,
|
||||
my_pubkey,
|
||||
&rewards_recorder_sender,
|
||||
subscriptions,
|
||||
);
|
||||
|
||||
@@ -1234,6 +1231,7 @@ impl ReplayStage {
|
||||
heaviest_subtree_fork_choice: &mut HeaviestSubtreeForkChoice,
|
||||
replay_vote_sender: &ReplayVoteSender,
|
||||
bank_notification_sender: &Option<BankNotificationSender>,
|
||||
rewards_recorder_sender: &Option<RewardsRecorderSender>,
|
||||
) -> bool {
|
||||
let mut did_complete_bank = false;
|
||||
let mut tx_count = 0;
|
||||
@@ -1309,6 +1307,8 @@ impl ReplayStage {
|
||||
.send(BankNotification::Frozen(bank.clone()))
|
||||
.unwrap_or_else(|err| warn!("bank_notification_sender failed: {:?}", err));
|
||||
}
|
||||
|
||||
Self::record_rewards(&bank, &rewards_recorder_sender);
|
||||
} else {
|
||||
trace!(
|
||||
"bank {} not completed tick_height: {}, max_tick_height: {}",
|
||||
@@ -1786,7 +1786,6 @@ impl ReplayStage {
|
||||
bank_forks: &RwLock<BankForks>,
|
||||
leader_schedule_cache: &Arc<LeaderScheduleCache>,
|
||||
subscriptions: &Arc<RpcSubscriptions>,
|
||||
rewards_recorder_sender: Option<RewardsRecorderSender>,
|
||||
progress: &mut ProgressMap,
|
||||
all_pubkeys: &mut PubkeyReferences,
|
||||
) {
|
||||
@@ -1832,7 +1831,6 @@ impl ReplayStage {
|
||||
child_slot,
|
||||
forks.root(),
|
||||
&leader,
|
||||
&rewards_recorder_sender,
|
||||
subscriptions,
|
||||
);
|
||||
let empty: Vec<&Pubkey> = vec![];
|
||||
@@ -1860,21 +1858,18 @@ impl ReplayStage {
|
||||
slot: u64,
|
||||
root_slot: u64,
|
||||
leader: &Pubkey,
|
||||
rewards_recorder_sender: &Option<RewardsRecorderSender>,
|
||||
subscriptions: &Arc<RpcSubscriptions>,
|
||||
) -> Bank {
|
||||
subscriptions.notify_slot(slot, parent.slot(), root_slot);
|
||||
|
||||
let child_bank = Bank::new_from_parent(parent, leader, slot);
|
||||
Self::record_rewards(&child_bank, &rewards_recorder_sender);
|
||||
child_bank
|
||||
Bank::new_from_parent(parent, leader, slot)
|
||||
}
|
||||
|
||||
fn record_rewards(bank: &Bank, rewards_recorder_sender: &Option<RewardsRecorderSender>) {
|
||||
if let Some(rewards_recorder_sender) = rewards_recorder_sender {
|
||||
if let Some(ref rewards) = bank.rewards {
|
||||
let rewards = bank.rewards.read().unwrap();
|
||||
if !rewards.is_empty() {
|
||||
rewards_recorder_sender
|
||||
.send((bank.slot(), rewards.iter().copied().collect()))
|
||||
.send((bank.slot(), rewards.clone()))
|
||||
.unwrap_or_else(|err| warn!("rewards_recorder_sender failed: {:?}", err));
|
||||
}
|
||||
}
|
||||
@@ -2124,7 +2119,6 @@ pub(crate) mod tests {
|
||||
&bank_forks,
|
||||
&leader_schedule_cache,
|
||||
&rpc_subscriptions,
|
||||
None,
|
||||
&mut progress,
|
||||
&mut PubkeyReferences::default(),
|
||||
);
|
||||
@@ -2148,7 +2142,6 @@ pub(crate) mod tests {
|
||||
&bank_forks,
|
||||
&leader_schedule_cache,
|
||||
&rpc_subscriptions,
|
||||
None,
|
||||
&mut progress,
|
||||
&mut PubkeyReferences::default(),
|
||||
);
|
||||
|
@@ -54,6 +54,7 @@ impl RewardsRecorderService {
|
||||
pubkey: pubkey.to_string(),
|
||||
lamports: reward_info.lamports,
|
||||
post_balance: reward_info.post_balance,
|
||||
reward_type: Some(reward_info.reward_type),
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
101
core/src/rpc.rs
101
core/src/rpc.rs
@@ -2273,7 +2273,8 @@ impl RpcSol for RpcSolImpl {
|
||||
) -> Result<String> {
|
||||
debug!("send_transaction rpc request received");
|
||||
let config = config.unwrap_or_default();
|
||||
let (wire_transaction, transaction) = deserialize_bs58_transaction(data)?;
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base58);
|
||||
let (wire_transaction, transaction) = deserialize_transaction(data, encoding)?;
|
||||
let bank = &*meta.bank(None);
|
||||
let last_valid_slot = bank
|
||||
.get_blockhash_last_valid_slot(&transaction.message.recent_blockhash)
|
||||
@@ -2318,8 +2319,9 @@ impl RpcSol for RpcSolImpl {
|
||||
config: Option<RpcSimulateTransactionConfig>,
|
||||
) -> Result<RpcResponse<RpcSimulateTransactionResult>> {
|
||||
debug!("simulate_transaction rpc request received");
|
||||
let (_, transaction) = deserialize_bs58_transaction(data)?;
|
||||
let config = config.unwrap_or_default();
|
||||
let encoding = config.encoding.unwrap_or(UiTransactionEncoding::Base58);
|
||||
let (_, transaction) = deserialize_transaction(data, encoding)?;
|
||||
|
||||
let mut result = if config.sig_verify {
|
||||
transaction.verify()
|
||||
@@ -2604,10 +2606,45 @@ impl RpcSol for RpcSolImpl {
|
||||
}
|
||||
}
|
||||
|
||||
fn deserialize_bs58_transaction(bs58_transaction: String) -> Result<(Vec<u8>, Transaction)> {
|
||||
let wire_transaction = bs58::decode(bs58_transaction)
|
||||
.into_vec()
|
||||
.map_err(|e| Error::invalid_params(format!("{:?}", e)))?;
|
||||
const WORST_CASE_BASE58_TX: usize = 1683; // Golden, bump if PACKET_DATA_SIZE changes
|
||||
const WORST_CASE_BASE64_TX: usize = 1644; // Golden, bump if PACKET_DATA_SIZE changes
|
||||
fn deserialize_transaction(
|
||||
encoded_transaction: String,
|
||||
encoding: UiTransactionEncoding,
|
||||
) -> Result<(Vec<u8>, Transaction)> {
|
||||
let wire_transaction = match encoding {
|
||||
UiTransactionEncoding::Base58 => {
|
||||
if encoded_transaction.len() > WORST_CASE_BASE58_TX {
|
||||
return Err(Error::invalid_params(format!(
|
||||
"encoded transaction too large: {} bytes (max: encoded/raw {}/{})",
|
||||
encoded_transaction.len(),
|
||||
WORST_CASE_BASE58_TX,
|
||||
PACKET_DATA_SIZE,
|
||||
)));
|
||||
}
|
||||
bs58::decode(encoded_transaction)
|
||||
.into_vec()
|
||||
.map_err(|e| Error::invalid_params(format!("{:?}", e)))?
|
||||
}
|
||||
UiTransactionEncoding::Base64 => {
|
||||
if encoded_transaction.len() > WORST_CASE_BASE64_TX {
|
||||
return Err(Error::invalid_params(format!(
|
||||
"encoded transaction too large: {} bytes (max: encoded/raw {}/{})",
|
||||
encoded_transaction.len(),
|
||||
WORST_CASE_BASE64_TX,
|
||||
PACKET_DATA_SIZE,
|
||||
)));
|
||||
}
|
||||
base64::decode(encoded_transaction)
|
||||
.map_err(|e| Error::invalid_params(format!("{:?}", e)))?
|
||||
}
|
||||
_ => {
|
||||
return Err(Error::invalid_params(format!(
|
||||
"unsupported transaction encoding: {}. Supported encodings: base58, base64",
|
||||
encoding
|
||||
)))
|
||||
}
|
||||
};
|
||||
if wire_transaction.len() > PACKET_DATA_SIZE {
|
||||
let err = format!(
|
||||
"transaction too large: {} bytes (max: {} bytes)",
|
||||
@@ -5797,4 +5834,56 @@ pub mod tests {
|
||||
let slot: Slot = serde_json::from_value(json["result"].clone()).unwrap();
|
||||
assert_eq!(slot, 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_worst_case_encoded_tx_goldens() {
|
||||
let ff_tx = vec![0xffu8; PACKET_DATA_SIZE];
|
||||
let tx58 = bs58::encode(&ff_tx).into_string();
|
||||
assert_eq!(tx58.len(), WORST_CASE_BASE58_TX);
|
||||
let tx64 = base64::encode(&ff_tx);
|
||||
assert_eq!(tx64.len(), WORST_CASE_BASE64_TX);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_deserialize_transacion_too_large_payloads_fail() {
|
||||
// +2 because +1 still fits in base64 encoded worst-case
|
||||
let too_big = PACKET_DATA_SIZE + 2;
|
||||
let tx_ser = vec![0xffu8; too_big];
|
||||
let tx58 = bs58::encode(&tx_ser).into_string();
|
||||
let tx58_len = tx58.len();
|
||||
let expect58 = Error::invalid_params(format!(
|
||||
"encoded transaction too large: {} bytes (max: encoded/raw {}/{})",
|
||||
tx58_len, WORST_CASE_BASE58_TX, PACKET_DATA_SIZE,
|
||||
));
|
||||
assert_eq!(
|
||||
deserialize_transaction(tx58, UiTransactionEncoding::Base58).unwrap_err(),
|
||||
expect58
|
||||
);
|
||||
let tx64 = base64::encode(&tx_ser);
|
||||
let tx64_len = tx64.len();
|
||||
let expect64 = Error::invalid_params(format!(
|
||||
"encoded transaction too large: {} bytes (max: encoded/raw {}/{})",
|
||||
tx64_len, WORST_CASE_BASE64_TX, PACKET_DATA_SIZE,
|
||||
));
|
||||
assert_eq!(
|
||||
deserialize_transaction(tx64, UiTransactionEncoding::Base64).unwrap_err(),
|
||||
expect64
|
||||
);
|
||||
let too_big = PACKET_DATA_SIZE + 1;
|
||||
let tx_ser = vec![0x00u8; too_big];
|
||||
let tx58 = bs58::encode(&tx_ser).into_string();
|
||||
let expect = Error::invalid_params(format!(
|
||||
"transaction too large: {} bytes (max: {} bytes)",
|
||||
too_big, PACKET_DATA_SIZE
|
||||
));
|
||||
assert_eq!(
|
||||
deserialize_transaction(tx58, UiTransactionEncoding::Base58).unwrap_err(),
|
||||
expect
|
||||
);
|
||||
let tx64 = base64::encode(&tx_ser);
|
||||
assert_eq!(
|
||||
deserialize_transaction(tx64, UiTransactionEncoding::Base64).unwrap_err(),
|
||||
expect
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -56,6 +56,7 @@ impl TransactionStatusService {
|
||||
statuses,
|
||||
balances,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
} = write_transaction_status_receiver.recv_timeout(Duration::from_secs(1))?;
|
||||
|
||||
let slot = bank.slot();
|
||||
@@ -65,12 +66,14 @@ impl TransactionStatusService {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
) in izip!(
|
||||
OrderedIterator::new(&transactions, iteration_order.as_deref()),
|
||||
statuses,
|
||||
balances.pre_balances,
|
||||
balances.post_balances,
|
||||
inner_instructions
|
||||
inner_instructions,
|
||||
transaction_logs
|
||||
) {
|
||||
if Bank::can_commit(&status) && !transaction.signatures.is_empty() {
|
||||
let fee_calculator = match hash_age_kind {
|
||||
@@ -96,6 +99,8 @@ impl TransactionStatusService {
|
||||
.collect()
|
||||
});
|
||||
|
||||
let log_messages = Some(log_messages);
|
||||
|
||||
blockstore
|
||||
.write_transaction_status(
|
||||
slot,
|
||||
@@ -108,6 +113,7 @@ impl TransactionStatusService {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
},
|
||||
)
|
||||
.expect("Expect database write to succeed");
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
use crate::{
|
||||
broadcast_stage::BroadcastStageType,
|
||||
builtins,
|
||||
cache_block_time_service::{CacheBlockTimeSender, CacheBlockTimeService},
|
||||
cluster_info::{ClusterInfo, Node},
|
||||
cluster_info_vote_listener::VoteTracker,
|
||||
@@ -742,7 +741,6 @@ fn new_banks_from_ledger(
|
||||
new_hard_forks: config.new_hard_forks.clone(),
|
||||
frozen_accounts: config.frozen_accounts.clone(),
|
||||
debug_keys: config.debug_keys.clone(),
|
||||
additional_builtins: Some(builtins::get(genesis_config.cluster_type)),
|
||||
..blockstore_processor::ProcessOptions::default()
|
||||
};
|
||||
|
||||
|
@@ -153,7 +153,7 @@ mod tests {
|
||||
.get(&deserialized_bank.slot())
|
||||
.unwrap()
|
||||
.clone();
|
||||
bank.compare_bank(&deserialized_bank);
|
||||
assert!(*bank == deserialized_bank);
|
||||
|
||||
let slot_snapshot_paths = snapshot_utils::get_snapshot_paths(&snapshot_path);
|
||||
|
||||
|
@@ -44,7 +44,7 @@ fn test_rpc_client() {
|
||||
|
||||
assert_eq!(
|
||||
client.get_version().unwrap().solana_core,
|
||||
solana_version::version!()
|
||||
solana_version::semver!()
|
||||
);
|
||||
|
||||
assert!(client.get_account(&bob_pubkey).is_err());
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-crate-features"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
description = "Solana Crate Features"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@@ -5,7 +5,11 @@ cd "$(dirname "$0")"
|
||||
|
||||
eval "$(../ci/channel-info.sh)"
|
||||
|
||||
LATEST_SOLANA_RELEASE_VERSION=$BETA_CHANNEL_LATEST_TAG
|
||||
if [[ -n $BETA_CHANNEL_LATEST_TAG ]]; then
|
||||
LATEST_SOLANA_RELEASE_VERSION=$BETA_CHANNEL_LATEST_TAG
|
||||
else
|
||||
LATEST_SOLANA_RELEASE_VERSION=$STABLE_CHANNEL_LATEST_TAG
|
||||
fi
|
||||
VERSION_FOR_DOCS_RS="${LATEST_SOLANA_RELEASE_VERSION:1}"
|
||||
|
||||
set -x
|
||||
|
@@ -7,15 +7,7 @@ module.exports = {
|
||||
],
|
||||
"Wallets": [
|
||||
"wallet-guide",
|
||||
{
|
||||
type: "category",
|
||||
label: "App Wallets",
|
||||
items: [
|
||||
"wallet-guide/apps",
|
||||
"wallet-guide/trust-wallet",
|
||||
"wallet-guide/ledger-live",
|
||||
],
|
||||
},
|
||||
"wallet-guide/apps",
|
||||
{
|
||||
type: "category",
|
||||
label: "Web Wallets",
|
||||
@@ -24,6 +16,13 @@ module.exports = {
|
||||
"wallet-guide/solflare",
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Hardware Wallets",
|
||||
items: [
|
||||
"wallet-guide/ledger-live",
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Command-line Wallets",
|
||||
@@ -33,7 +32,10 @@ module.exports = {
|
||||
{
|
||||
type: "category",
|
||||
label: "Hardware Wallets",
|
||||
items: ["wallet-guide/hardware-wallets", "wallet-guide/hardware-wallets/ledger"],
|
||||
items: [
|
||||
"wallet-guide/hardware-wallets",
|
||||
"wallet-guide/hardware-wallets/ledger",
|
||||
],
|
||||
},
|
||||
"wallet-guide/file-system-wallet",
|
||||
],
|
||||
|
@@ -341,6 +341,7 @@ The result field will be an object with the following fields:
|
||||
- `pubkey: <string>` - The public key, as base-58 encoded string, of the account that received the reward
|
||||
- `lamports: <i64>`- number of reward lamports credited or debited by the account, as a i64
|
||||
- `postBalance: <u64>` - account balance in lamports after the reward was applied
|
||||
- `rewardType: <string|undefined>` - type of reward: "fee", "rent", "voting", "staking"
|
||||
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
|
||||
|
||||
#### Example:
|
||||
@@ -1440,10 +1441,11 @@ Before submitting, the following preflight checks are performed:
|
||||
|
||||
#### Parameters:
|
||||
|
||||
- `<string>` - fully-signed Transaction, as base-58 encoded string
|
||||
- `<string>` - fully-signed Transaction, as encoded string
|
||||
- `<object>` - (optional) Configuration object containing the following field:
|
||||
- `skipPreflight: <bool>` - if true, skip the preflight transaction checks (default: false)
|
||||
- `preflightCommitment: <string>` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) level to use for preflight (default: `"max"`).
|
||||
- `encoding: <string>` - (optional) Encoding used for the transaction data. Either `"base58"` (*slow*, **DEPRECATED**), or `"base64"`. (default: `"base58"`).
|
||||
|
||||
#### Results:
|
||||
|
||||
@@ -1465,10 +1467,11 @@ Simulate sending a transaction
|
||||
|
||||
#### Parameters:
|
||||
|
||||
- `<string>` - Transaction, as base-58 encoded string. The transaction must have a valid blockhash, but is not required to be signed.
|
||||
- `<string>` - Transaction, as an encoded string. The transaction must have a valid blockhash, but is not required to be signed.
|
||||
- `<object>` - (optional) Configuration object containing the following field:
|
||||
- `sigVerify: <bool>` - if true the transaction signatures will be verified (default: false)
|
||||
- `commitment: <string>` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) level to simulate the transaction at (default: `"max"`).
|
||||
- `encoding: <string>` - (optional) Encoding used for the transaction data. Either `"base58"` (*slow*, **DEPRECATED**), or `"base64"`. (default: `"base58"`).
|
||||
|
||||
#### Results:
|
||||
|
||||
|
@@ -23,7 +23,7 @@ Explorers:
|
||||
- Devnet includes a token faucet for airdrops for application testing
|
||||
- Devnet may be subject to ledger resets
|
||||
- Devnet typically runs a newer software version than Mainnet Beta
|
||||
- Gossip entrypoint for Devnet: `devnet.solana.com:8001`
|
||||
- Gossip entrypoint for Devnet: `entrypoint.devnet.solana.com:8001`
|
||||
- RPC URL for Devnet: `https://devnet.solana.com`
|
||||
|
||||
##### Example `solana` command-line configuration
|
||||
@@ -63,7 +63,7 @@ The `--trusted-validator`s is operated by Solana
|
||||
- Testnet includes a token faucet for airdrops for application testing
|
||||
- Testnet typically runs a newer software release than both Devnet and
|
||||
Mainnet Beta
|
||||
- Gossip entrypoint for Testnet: `35.203.170.30:8001`
|
||||
- Gossip entrypoint for Testnet: `entrypoint.testnet.solana.com:8001`
|
||||
- RPC URL for Testnet: `https://testnet.solana.com`
|
||||
|
||||
##### Example `solana` command-line configuration
|
||||
@@ -134,7 +134,6 @@ $ solana-validator \
|
||||
--dynamic-port-range 8000-8010 \
|
||||
--entrypoint mainnet-beta.solana.com:8001 \
|
||||
--expected-genesis-hash 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d \
|
||||
--expected-shred-version 64864 \
|
||||
--limit-ledger-size
|
||||
```
|
||||
|
||||
|
@@ -257,25 +257,6 @@ solana-validator \
|
||||
--log ~/solana-validator.log
|
||||
```
|
||||
|
||||
Lastly, to configure log rotation, please run the following:
|
||||
|
||||
```bash
|
||||
# Setup log rotation
|
||||
|
||||
cat > logrotate.sol <<EOF
|
||||
~/solana-validator.log {
|
||||
rotate 7
|
||||
daily
|
||||
missingok
|
||||
postrotate
|
||||
systemctl kill -s USR1 sol.service
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
sudo cp logrotate.sol /etc/logrotate.d/sol
|
||||
systemctl restart logrotate.service
|
||||
```
|
||||
|
||||
To force validator logging to the console add a `--log -` argument, otherwise
|
||||
the validator will automatically log to a file.
|
||||
|
||||
@@ -306,3 +287,70 @@ the validator to ports 11000-11010.
|
||||
|
||||
The `--limit-ledger-size` argument will instruct the validator to only retain the
|
||||
last couple hours of ledger. To retain the full ledger, simply remove that arg.
|
||||
|
||||
|
||||
### Systemd Unit
|
||||
Running the validator as a systemd unit is one easy way to manage running in the
|
||||
background.
|
||||
|
||||
Assuming you have a user called `sol` on your machine, create the file `/etc/systemd/system/sol.service` with
|
||||
the following:
|
||||
```
|
||||
[Unit]
|
||||
Description=Solana Validator
|
||||
After=network.target
|
||||
Wants=solana-sys-tuner.service
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=sol
|
||||
LimitNOFILE=500000
|
||||
LogRateLimitIntervalSec=0
|
||||
Environment="PATH=/bin:/usr/bin:/home/sol/.local/share/solana/install/active_release/bin"
|
||||
ExecStart=/home/sol/bin/validator.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Now create `/home/sol/bin/validator.sh` to include the desired `solana-validator`
|
||||
command-line. Ensure that running `/home/sol/bin/validator.sh` manually starts
|
||||
the validator as expected. Don't forget to mark it executable with `chmod +x /home/sol/bin/validator.sh`
|
||||
|
||||
Start the service with:
|
||||
```bash
|
||||
$ sudo systemctl enable --now sol
|
||||
```
|
||||
|
||||
### Log rotation
|
||||
|
||||
The validator log file, as specified by `--log ~/solana-validator.log`, can get
|
||||
very large over time and it's recommended that log rotation be configured.
|
||||
|
||||
The validator will re-open its when it receives the `USR1` signal, which is the
|
||||
basic primitive that enables log rotation.
|
||||
|
||||
### Using logrotate
|
||||
|
||||
An example setup for the `logrotate`, which assumes that the validator is
|
||||
running as a systemd service called `sol.service` and writes a log file at
|
||||
/home/sol/solana-validator.log:
|
||||
```bash
|
||||
# Setup log rotation
|
||||
|
||||
cat > logrotate.sol <<EOF
|
||||
/home/sol/solana-validator.log {
|
||||
rotate 7
|
||||
daily
|
||||
missingok
|
||||
postrotate
|
||||
systemctl kill -s USR1 sol.service
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
sudo cp logrotate.sol /etc/logrotate.d/sol
|
||||
systemctl restart logrotate.service
|
||||
```
|
||||
|
@@ -66,12 +66,12 @@ description is below.
|
||||
#### Supported Wallets
|
||||
Staking operations are supported by the following wallet solutions:
|
||||
|
||||
- SolFlare.com in conjunction with a keystore file or a Ledger Nano S. Check
|
||||
out our [guide to using SolFlare](wallet-guide/solflare.md) for details.
|
||||
- SolFlare.com in conjunction with a keystore file or a Ledger Nano.
|
||||
Check out our [guide to using SolFlare](wallet-guide/solflare.md) for details.
|
||||
|
||||
- Solana command line tools can perform all stake operations in conjunction
|
||||
with a CLI-generated keypair file wallet, a paper wallet, or with a connected
|
||||
Ledger Nano S.
|
||||
Ledger Nano.
|
||||
[Staking commands using the Solana Command Line Tools](cli/delegate-stake.md).
|
||||
|
||||
#### Create a Stake Account
|
||||
|
@@ -1,15 +1,13 @@
|
||||
---
|
||||
title: App Wallets
|
||||
title: Mobile App Wallets
|
||||
---
|
||||
|
||||
Solana supports multiple third-party apps which should provide a familiar
|
||||
Solana is supported by multiple third-party apps which should provide a familiar
|
||||
experience for most people who are new or experienced with using crypto wallets.
|
||||
|
||||
## Trust Wallet
|
||||
[Trust Wallet](https://trustwallet.com/) is an app for iOS and Android. This is
|
||||
currently the easiest and fastest way to get set up with a new wallet to send
|
||||
and receive SOL tokens on the Solana network.
|
||||
The app is free and getting your wallet set up only takes a few minutes.
|
||||
[Trust Wallet](https://trustwallet.com/) is an app available for iOS and Android
|
||||
and can be used to send and receive SOL tokens.
|
||||
|
||||
*Note: Trust Wallet does not support stake accounts or staking operations*
|
||||
|
||||
@@ -33,21 +31,8 @@ viewed at any later time in the app by following these steps:
|
||||
- Go to Setting -> Wallets
|
||||
- Under the Options menu for a particular wallet tap "Show Recovery Phrase"
|
||||
|
||||
[Trust Wallet](trust-wallet.md)
|
||||
## Coin98
|
||||
[Coin98](https://coin98.app/) is an app available for iOS and Android and can
|
||||
be used to send and receive SOL tokens.
|
||||
|
||||
## Ledger Live with Ledger Nano S
|
||||
|
||||
[Ledger Live](https://www.ledger.com/ledger-live) is available as free desktop
|
||||
software and as a free app for iOS and Android. It is used to manage apps and
|
||||
crypto accounts on a Ledger _hardware wallet_, which must be purchased
|
||||
separately and connected to the device running Ledger Live.
|
||||
|
||||
[Ledger Nano S](https://shop.ledger.com/products/ledger-nano-s) is a
|
||||
hardware wallet which stores the wallet's private keys on a secure device that
|
||||
is physically separate from the computer, and connects via USB cable.
|
||||
This provides an extra level of security but requires the user to purchase and
|
||||
keep track of the hardware device.
|
||||
|
||||
Solana does not support the Ledger Nano **X** at this time.
|
||||
|
||||
[Ledger Live](ledger-live.md)
|
||||
*Note: Coin98 does not support stake accounts or staking operations*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Hardware Wallets
|
||||
title: Using Hardware Wallets on the Solana CLI
|
||||
---
|
||||
|
||||
Signing a transaction requires a private key, but storing a private
|
||||
@@ -19,7 +19,7 @@ hardware wallet.
|
||||
|
||||
The Solana CLI supports the following hardware wallets:
|
||||
|
||||
- [Ledger Nano S](hardware-wallets/ledger.md)
|
||||
- [Ledger Nano S and Ledger Nano X](hardware-wallets/ledger.md)
|
||||
|
||||
## Specify a Keypair URL
|
||||
|
||||
|
@@ -1,23 +1,22 @@
|
||||
---
|
||||
title: Ledger Hardware Wallet
|
||||
title: Ledger Nano
|
||||
---
|
||||
|
||||
The Ledger Nano S hardware wallet offers secure storage of your Solana private
|
||||
keys. The Solana Ledger app enables derivation of essentially infinite keys, and
|
||||
secure transaction signing.
|
||||
This page describes how to use a Ledger Nano S or Nano X to interact with Solana
|
||||
using the command line tools. To see other solutions to interact with Solana with
|
||||
your Nano, [click here](../ledger-live.md#interact-with-the-solana-network).
|
||||
|
||||
## Before You Begin
|
||||
|
||||
- [Set up a Ledger Nano S with the Solana App](../ledger-live.md)
|
||||
- [Set up a Nano with the Solana App](../ledger-live.md)
|
||||
- [Install the Solana command-line tools](../../cli/install-solana-cli-tools.md)
|
||||
|
||||
## Use Ledger Nano S with Solana CLI
|
||||
## Use Ledger Nano with Solana CLI
|
||||
|
||||
1. Ensure the Ledger Live application is closed
|
||||
2. Plug your Ledger device into your computer's USB port
|
||||
3. Enter your pin and start the Solana app on the Ledger device
|
||||
4. Press both buttons to advance past the "Pending Ledger review" screen
|
||||
5. Ensure the screen reads "Application is ready"
|
||||
2. Plug your Nano into your computer's USB port
|
||||
3. Enter your pin and start the Solana app on the Nano
|
||||
4. Ensure the screen reads "Application is ready"
|
||||
|
||||
### View your Wallet ID
|
||||
|
||||
@@ -29,16 +28,16 @@ solana-keygen pubkey usb://ledger
|
||||
|
||||
This confirms your Ledger device is connected properly and in the correct state
|
||||
to interact with the Solana CLI. The command returns your Ledger's unique
|
||||
_wallet ID_. When you have multiple Nano S devices connected to the same
|
||||
_wallet ID_. When you have multiple Nano devices connected to the same
|
||||
computer, you can use your wallet ID to specify which Ledger hardware wallet
|
||||
you want to use. If you only plan to use a single Nano S on your computer
|
||||
you want to use. If you only plan to use a single Nano on your computer
|
||||
at a time, you don't need to include the wallet ID. For information on
|
||||
using the wallet ID to use a specific Ledger, see
|
||||
[Manage Multiple Hardware Wallets](#manage-multiple-hardware-wallets).
|
||||
|
||||
### View your Wallet Addresses
|
||||
|
||||
Your Nano S supports an arbitrary number of valid wallet addresses and signers.
|
||||
Your Nano supports an arbitrary number of valid wallet addresses and signers.
|
||||
To view any address, use the `solana-keygen pubkey` command, as shown below,
|
||||
followed by a valid [keypair URL](../hardware-wallets.md#specify-a-keypair-url).
|
||||
|
||||
@@ -59,7 +58,7 @@ solana-keygen pubkey usb://ledger?key=2
|
||||
You can use other values for the number after `key=` as well.
|
||||
Any of the addresses displayed by these commands are valid Solana wallet
|
||||
addresses. The private portion associated with each address is stored securely
|
||||
on the Nano S device, and is used to sign transactions from this address.
|
||||
on the Nano, and is used to sign transactions from this address.
|
||||
Just make a note of which keypair URL you used to derive any address you will be
|
||||
using to receive tokens.
|
||||
|
||||
@@ -100,11 +99,11 @@ Ledger, will show as "Not Found" in the explorer. Empty accounts and non-existen
|
||||
accounts are treated the same in Solana. This will change when your account
|
||||
address has some SOL in it.
|
||||
|
||||
### Send SOL from a Ledger Nano S
|
||||
### Send SOL from a Nano
|
||||
|
||||
To send some tokens from an address controlled by your Nano S device, you will
|
||||
To send some tokens from an address controlled by your Nano, you will
|
||||
need to use the device to sign a transaction, using the same keypair URL you
|
||||
used to derive the address. To do this, make sure your Nano S is plugged in,
|
||||
used to derive the address. To do this, make sure your Nano is plugged in,
|
||||
unlocked with the PIN, Ledger Live is not running, and the Solana App is open
|
||||
on the device, showing "Application is Ready".
|
||||
|
||||
@@ -160,7 +159,7 @@ choose which wallet to use for each signature.
|
||||
|
||||
Instead of using the interactive prompts, you can generate fully qualified
|
||||
URLs using the Solana CLI `resolve-signer` command. For example, try
|
||||
connecting a Ledger Nano-S to USB, unlock it with your pin, and running the
|
||||
connecting a Nano to USB, unlock it with your pin, and running the
|
||||
following command:
|
||||
|
||||
```text
|
||||
@@ -181,61 +180,6 @@ Use the output from the `resolve-signer` command anywhere a `solana` command
|
||||
expects a `<KEYPAIR>` entry to use that resolved path as the signer for that
|
||||
part of the given transaction.
|
||||
|
||||
### Install the Solana Beta App
|
||||
|
||||
You're invited to help us test the latest pre-release version of our Ledger app
|
||||
on one of the public testnets.
|
||||
|
||||
You can use the command-line to install the latest Solana Ledger app release
|
||||
before it has been validated by
|
||||
the Ledger team and made available via Ledger Live. Note that because the app
|
||||
is not installed via Ledger Live, you will need to approve installation from an
|
||||
"unsafe" manager, as well as see the message, "This app is not genuine" each
|
||||
time you open the app. Once the app is available on Ledger Live, you can
|
||||
reinstall the app from there, and the message will no longer be displayed.
|
||||
|
||||
**WARNING:** Installing an unsigned Ledger app reduces the security of your
|
||||
Ledger device.
|
||||
If your client is compromised, an attacker will be able to trick you into
|
||||
signing arbitrary transactions with arbitrary derivation paths.
|
||||
Only use this installation method if you understand
|
||||
the security implications. We strongly recommend that you use a separate
|
||||
Ledger device, with no other wallets/apps sharing the same seed phrase.
|
||||
|
||||
1. Connect your Ledger device via USB and enter your pin to unlock it
|
||||
2. Download and run the Solana Ledger app installer:
|
||||
```text
|
||||
curl -sSLf https://github.com/solana-labs/ledger-app-solana/releases/download/v0.2.1/install.sh | sh
|
||||
```
|
||||
3. When prompted, approve the "unsafe" manager on your device
|
||||
4. When prompted, approve the installation on your device
|
||||
5. An installation window appears and your device will display "Processing..."
|
||||
6. The app installation is confirmed
|
||||
|
||||
#### Installing the Solana Beta App returns an error
|
||||
|
||||
If you encounter the following error:
|
||||
|
||||
```text
|
||||
Traceback (most recent call last):
|
||||
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
|
||||
"__main__", mod_spec)
|
||||
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
|
||||
exec(code, run_globals)
|
||||
File "ledger-env/lib/python3.7/site-packages/ledgerblue/loadApp.py", line 197, in <module>
|
||||
dongle = getDongle(args.apdu)
|
||||
File "ledger-env/lib/python3.7/site-packages/ledgerblue/comm.py", line 216, in getDongle
|
||||
dev.open_path(hidDevicePath)
|
||||
File "hid.pyx", line 72, in hid.device.open_path
|
||||
OSError: open failed
|
||||
```
|
||||
|
||||
To fix, check the following:
|
||||
|
||||
1. Ensure your Ledger device is connected to USB
|
||||
2. Ensure your Ledger device is unlocked and not waiting for you to enter your pin
|
||||
3. Ensure the Ledger Live application is not open
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Keypair URL parameters are ignored in zsh
|
||||
|
@@ -1,81 +1,77 @@
|
||||
---
|
||||
title: Ledger Live and Ledger Nano S
|
||||
title: Set up a Ledger Nano S or Nano X
|
||||
---
|
||||
|
||||
This document describes how to set up a
|
||||
[Ledger Nano S hardware wallet](https://shop.ledger.com/products/ledger-nano-s)
|
||||
[Ledger Nano S](https://shop.ledger.com/products/ledger-nano-s) or
|
||||
[Ledger Nano X](https://shop.ledger.com/pages/ledger-nano-x)
|
||||
with the [Ledger Live](https://www.ledger.com/ledger-live) software.
|
||||
|
||||
Once the setup steps shown below are complete and the Solana app is installed
|
||||
on your Nano S device, users have several options of how to
|
||||
[use the Nano S to interact with the Solana Network](#interact-with-the-solana-network)
|
||||
on your Nano device, users have several options of how to
|
||||
[use the Nano to interact with the Solana Network](#interact-with-the-solana-network)
|
||||
|
||||
## Set up a Ledger Nano S
|
||||
## Getting Started
|
||||
|
||||
- Order a [Nano S from Ledger](https://shop.ledger.com/products/ledger-nano-s)
|
||||
- Order a [Nano S](https://shop.ledger.com/products/ledger-nano-s) or
|
||||
[Nano X](https://shop.ledger.com/pages/ledger-nano-x) from Ledger.
|
||||
- Follow the instructions for device setup included in the package,
|
||||
or [Ledger's Start page](https://www.ledger.com/start/)
|
||||
- [Install the latest device firmware](https://support.ledgerwallet.com/hc/en-us/articles/360002731113-Update-Ledger-Nano-S-firmware)
|
||||
- Install [Ledger Live desktop software](https://www.ledger.com/ledger-live/)
|
||||
- If you already have Ledger Live installed, please update to the latest
|
||||
version of Ledger Live, which enables the newest firmware and app updates.
|
||||
- Connect your Nano to your computer and follow the on-screen instructions.
|
||||
- Update the firmware on your new Nano. This is needed to ensure you are able
|
||||
to install the latest version of the Solana App.
|
||||
- [Update Nano S Firmware](https://support.ledger.com/hc/en-us/articles/360002731113-Update-Ledger-Nano-S-firmware)
|
||||
- [Update Nano X Firmware](https://support.ledger.com/hc/en-us/articles/360013349800)
|
||||
|
||||
## Install Ledger Live
|
||||
|
||||
- Install [Ledger Live desktop software](https://www.ledger.com/ledger-live/),
|
||||
or
|
||||
- Install the [Ledger Live app for iOS](https://apps.apple.com/app/id1361671700)
|
||||
or [Ledger Live for Android](https://play.google.com/store/apps/details?id=com.ledger.live).
|
||||
- Requires iOS 9.1 or later. Compatible with iPhone, iPad, and iPod touch.
|
||||
- Requires Android 7.0 or later.
|
||||
- Connect your Nano S to your device and follow the instructions
|
||||
|
||||
## Install the Solana App on your Nano S
|
||||
## Install the Solana App on your Nano
|
||||
|
||||
- Open Ledger Live
|
||||
- Currently Ledger Live needs to be in "Developer Mode"
|
||||
(Settings > Experimental Features > Developer Mode) to see our app.
|
||||
|
||||

|
||||
|
||||
- Go to Manager in the app and find "Solana" in the App Catalog and
|
||||
click Install
|
||||
- Click on "Manager" in the left pane on the app and search for "Solana" in the
|
||||
App Catalog, then click "Install".
|
||||
- Make sure your device is plugged in via USB and is unlocked with its PIN
|
||||
- You may be prompted on the Nano S to confirm the install of Solana App
|
||||
- You may be prompted on the Nano to confirm the install of Solana App
|
||||
- "Solana" should now show as "Installed" in the Ledger Live Manager
|
||||
|
||||

|
||||
|
||||
## Upgrade to the latest version of the Solana App
|
||||
|
||||
To make sure you have the latest functionality, if you are using an older version
|
||||
of the Solana App, please upgrade to version v0.2.2 by following these steps.
|
||||
of the Solana App, please upgrade to version `v1.0.1` by following these steps.
|
||||
|
||||
- Connect your Nano S to your computer an unlock it by entering your PIN on the
|
||||
device
|
||||
- Open Ledger Live and click on "Manager" in the left pane
|
||||
- On your Nano S, click both buttons when prompted to "Allow Manager"
|
||||
- Click the "Update All" button to update the Solana app to the latest version
|
||||
(v.0.2.2)
|
||||
|
||||

|
||||
|
||||
- Once the upgrade is finished, confirm v0.2.2 is installed under "Apps Installed"
|
||||
|
||||

|
||||
- Make sure you have Ledger Live version 2.10.0 or later.
|
||||
- To check your version of Ledger Live, click on the Settings button in the
|
||||
upper-right corner, then click "About". If a newer version of Ledger Live is
|
||||
available, you should see a banner prompting you to upgrade when you first open
|
||||
Ledger Live.
|
||||
- Update the firmware on your Nano
|
||||
- [Update Nano S Firmware](https://support.ledger.com/hc/en-us/articles/360002731113-Update-Ledger-Nano-S-firmware)
|
||||
- [Update Nano X Firmware](https://support.ledger.com/hc/en-us/articles/360013349800)
|
||||
- After a successful firmware update, the Solana app should automatically get
|
||||
re-installed with the latest version of the app.
|
||||
|
||||
## Interact with the Solana network
|
||||
|
||||
Users can use any of the following options to sign and submit transactions with
|
||||
the Ledger Nano S to interact with the Solana network:
|
||||
Users can use any of the following options to use their Nano to interact with
|
||||
Solana:
|
||||
|
||||
- [SolFlare.com](https://solflare.com/) is a non-custodial web wallet built
|
||||
specifically for Solana and supports basic transfers and staking operations
|
||||
with the Ledger device.
|
||||
Check out our guide for [using a Ledger Nano S with SolFlare](solflare.md).
|
||||
Check out our guide for [using a Nano with SolFlare](solflare.md).
|
||||
|
||||
- Developers and advanced users may
|
||||
[use a Ledger Nano S with the Solana command line tools](hardware-wallets/ledger.md).
|
||||
[use a Nano with the Solana command line tools](hardware-wallets/ledger.md).
|
||||
New wallet features are almost always supported in the native command line tools
|
||||
before being supported by third-party wallets.
|
||||
|
||||
## Known Issues
|
||||
|
||||
- Nano X sometimes cannot connect to web wallets using the Windows operating
|
||||
system. This is likely to affect any browser-based wallets that use WebUSB.
|
||||
The Ledger team is working to resolve this.
|
||||
|
||||
## Support
|
||||
|
||||
Check out our [Wallet Support Page](support.md) for ways to get help.
|
||||
|
@@ -13,7 +13,7 @@ SolFlare also supports staking of SOL tokens.
|
||||
As a _non-custodial_ wallet, your private keys are not stored by the SolFlare
|
||||
site itself, but rather they are stored in an encrypted
|
||||
[Keystore File](#using-a-keystore-file) or on a
|
||||
[Ledger Nano S hardware wallet](#using-a-ledger-nano-s-hardware-wallet).
|
||||
[Ledger Nano S or X hardware wallet](#using-a-ledger-nano-hardware-wallet).
|
||||
|
||||
This guide describes how to set up a wallet using SolFlare, how to send and
|
||||
receive SOL tokens, and how to create and manage a stake account.
|
||||
@@ -22,7 +22,7 @@ receive SOL tokens, and how to create and manage a stake account.
|
||||
|
||||
Go to https://www.solflare.com in a supported browser. Most popular web browsers
|
||||
should work when interacting with a Keystore File, but currently only
|
||||
Chrome and Brave are supported when interacting with a Ledger Nano S.
|
||||
Chrome and Brave are supported when interacting with a Ledger Nano.
|
||||
|
||||
### Using a Keystore File
|
||||
|
||||
@@ -48,21 +48,23 @@ Keystore file, you will be taken to the Access page directly.
|
||||
You will be prompted to enter the password and upload your Keystore file,
|
||||
then you will be taken to the wallet interface main page.
|
||||
|
||||
### Using a Ledger Nano S hardware wallet
|
||||
### Using a Ledger Nano hardware wallet
|
||||
|
||||
*NOTE: Please see [known issues](ledger-live.md#known-issues) for any current
|
||||
limitations in using the Nano.*
|
||||
|
||||
#### Initial Device Setup
|
||||
To use a Ledger Nano S with SolFlare, first ensure you have
|
||||
[set up your Nano S](ledger-live.md) and have [installed the latest version of
|
||||
To use a Ledger Nano with SolFlare, first ensure you have
|
||||
[set up your Nano](ledger-live.md) and have [installed the latest version of
|
||||
the Solana app](ledger-live.md#upgrade-to-the-latest-version-of-the-solana-app)
|
||||
on your device.
|
||||
|
||||
#### Select a Ledger address to access
|
||||
Plug in your Nano S and open the Solana app. Acknowledge a message of "Pending
|
||||
Ledger Review" by tapping both buttons at once so the device screen displays
|
||||
Plug in your Nano and open the Solana app so the device screen displays
|
||||
"Application is Ready".
|
||||
|
||||
From the SolFlare home page, click "Access a Wallet" then select "Using Ledger
|
||||
Nano S". Under "Select derivation path", select the only option:
|
||||
Nano S | Ledger Nano X". Under "Select derivation path", select the only option:
|
||||
|
||||
```Solana - 44`/501`/```
|
||||
|
||||
@@ -174,10 +176,10 @@ it will be accepted by the network.
|
||||
If you accessed your wallet using a Keystore file, you will be prompted to enter
|
||||
your password any time the key is needed to sign a transaction.
|
||||
|
||||
### Using a Ledger Nano S
|
||||
If you accessed your wallet with a Ledger Nano S, you will be prompted to confirm
|
||||
the pending transaction details on your device whenever the key is needed to sign.
|
||||
On the Nano S, use the left and right buttons to view and confirm all of the
|
||||
### Using a Ledger Nano
|
||||
If you accessed your wallet with a Ledger Nano, you will be prompted to
|
||||
confirm the pending transaction details on your device whenever the key is needed
|
||||
to sign. On the Nano, use the left and right buttons to view and confirm all of the
|
||||
transaction details. If everything looks correct, keep clicking the right button
|
||||
until the screen shows "Approve". Click both buttons to approve the transaction.
|
||||
If something looks incorrect, press the right button once more so the screen shows
|
||||
|
@@ -1,119 +0,0 @@
|
||||
---
|
||||
title: Trust Wallet
|
||||
---
|
||||
|
||||
Trust Wallet is an app for your smartphone or tablet and is the fastest and
|
||||
simplest way for most users to get started with a Solana wallet to send and
|
||||
receive tokens.
|
||||
|
||||
## Install Trust Wallet
|
||||
|
||||
#### iOS
|
||||
|
||||
- Open the App Store
|
||||
- Download “Trust: Crypto & Bitcoin Wallet” from Six Days LLC
|
||||
- Requires iOS 13.0 or higher
|
||||
- Open Trust Wallet and follow the app prompts to get started
|
||||
|
||||
#### Android
|
||||
|
||||
- Open the Play Store
|
||||
- Download “Trust Crypto Wallet” from Six Days LLC
|
||||
- Requires Android 6.0 or higher
|
||||
- Open Trust Wallet and follow the app prompts to get started
|
||||
|
||||
## Add Solana (SOL) tokens to your wallet
|
||||
|
||||
- From the main page, go to the “Tokens” tab at the top of the screen
|
||||
- Tap the “+” icon at the top right corner
|
||||
- Search for “Solana” in the search page, and when the “Solana SOL” token is
|
||||
shown, slide the slider to enable this token.
|
||||
- You can now tap the Solana icon to access your Solana wallet.
|
||||
|
||||
[Trust Wallet Official Docs: How to Add or Remove a Coin](https://community.trustwallet.com/t/how-to-add-or-remove-a-coin/896)
|
||||
|
||||
## Receiving SOL tokens
|
||||
|
||||
- To receive SOL tokens that you’ve purchased or earned, you need to send your
|
||||
Receive Address to whoever is sending you tokens.
|
||||
- Tap “Receive” to view a QR code and your text address, which is a long string
|
||||
of letters and numbers.
|
||||
- Tap “Copy” or “Share” to send the address.
|
||||
- Be very careful when you copy and paste your receive address anywhere that
|
||||
you do not miss any characters at the beginning or end of the string.
|
||||
- If you send an incorrect Receive address to someone and they send tokens
|
||||
to that address, **those tokens will be lost forever**.
|
||||
|
||||
[Trust Wallet Official Docs: How to Find my Receiving Address](https://community.trustwallet.com/t/how-to-find-my-receiving-address/2006)
|
||||
|
||||
## Sending SOL tokens
|
||||
|
||||
You can send SOL from your Trust Wallet to any other valid address on the Solana
|
||||
network. Once you know the other party's receiving address,
|
||||
go to the main page of the wallet from which you want to send some SOL tokens:
|
||||
|
||||
- Tap the "Solana" icon.
|
||||
- Tap "Send"
|
||||
- Under "Recipient Address":
|
||||
- If you already have the receiving address you are going to send to,
|
||||
tap "Paste"
|
||||
- If you are transferring to another Trust Wallet user, you can use the app's
|
||||
QR code reader by tapping the square icon to the right of the "Paste" button.
|
||||
- Under "Amount", enter the amount of SOL you want to send, or tap "Max"
|
||||
to send **all** of the SOL in your wallet to the new address
|
||||
- Tap "Next" to view a summary/confirmation page to review before submitting
|
||||
the transaction
|
||||
- The real-time network transaction fee will be shown. This fee will be
|
||||
paid by the sending account in addition to the full amount transferred.
|
||||
- If you chose to send all your tokens to the new address by selecting
|
||||
"Max" under amount, the amount sent to the recipient will be the account
|
||||
balance _minus_ the current network transaction fee.
|
||||
- **Make sure you entered the "To" address correctly and that it matches your
|
||||
desired wallet's receiving address!**
|
||||
- Tap "Send" to submit the transaction. The transaction will show as "Pending"
|
||||
for a few seconds, and then will show as "Sent".
|
||||
|
||||
[Trust Wallet Official Docs: Sending Cryptocurrencies](https://community.trustwallet.com/t/sending-cryptocurrencies/65)
|
||||
|
||||
## Using Multiple Wallet Addresses
|
||||
|
||||
Trust Wallet allows you to create multiple wallets, each of which is
|
||||
secured by a different set of random seed words. If you want to use more than
|
||||
one Solana address, follow these steps.
|
||||
|
||||
#### Create an additional wallet
|
||||
|
||||
- In the main page of the Trust Wallet App, tap "Settings" in the bottom-right
|
||||
corner.
|
||||
- Tap "Wallets"
|
||||
- Tap "+" to create a new Wallet
|
||||
- Follow the steps above to add SOL tokens to your new wallet
|
||||
|
||||
_Note: In the "Wallets" page under "Settings" you can re-name each of your wallets.
|
||||
Consider giving each a descriptive name if you are planning to use your wallets
|
||||
for different purposes, so you don't mistake one for the other._
|
||||
|
||||
#### Transferring SOL between your wallets
|
||||
|
||||
Just like you can transfer SOL to another party, you can transfer SOL between
|
||||
wallets that you own.
|
||||
|
||||
- Copy the receive address of your **newly created** wallet.
|
||||
- Make sure your **new** wallet is selected by going to
|
||||
"Settings" --> "Wallets", then tap on the name of your new wallet.
|
||||
- Tap the "Solana" icon.
|
||||
- Tap "Receive" then tap "Copy".
|
||||
- Select your previous/original wallet which already has some SOL by going to
|
||||
"Settings" --> "Wallets", then tap on the name of your **original** wallet.
|
||||
- Now follow the same process for [sending SOL tokens](#sending-sol-tokens)
|
||||
using your **new** wallet's receiving address as the address in the "To"
|
||||
field when you make the transfer.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you are having trouble setting up your Trust Wallet app, check out their
|
||||
[Community Help Center](https://community.trustwallet.com/c/helpcenter)
|
||||
|
||||
## Support
|
||||
|
||||
Check out our [Wallet Support Page](support.md) for ways to get help.
|
@@ -2,9 +2,23 @@
|
||||
title: Web Wallets
|
||||
---
|
||||
|
||||
Solana is supported by the following web wallets.
|
||||
|
||||
## SolFlare
|
||||
[SolFlare.com](https://solflare.com/) is a community-created non-custodial
|
||||
web wallet that was built specifically for Solana. Check out our guide for
|
||||
[using SolFlare](solflare.md).
|
||||
web wallet that was built specifically for Solana. SolFlare supports the creation
|
||||
and management of stake accounts, and gives users the ability to send and receive
|
||||
any SPL Token.
|
||||
|
||||
Check out our [guide for using SolFlare](solflare.md).
|
||||
|
||||
## Sollet
|
||||
[sollet.io](https://www.sollet.io/) is a non-custodial web wallet created by the
|
||||
[Project Serum](https://projectserum.com/) team. sollet.io can be used to send
|
||||
and receive SOL and any SPL Token.
|
||||
|
||||
## MathWallet
|
||||
|
||||
[MathWallet](https://mathwallet.org/) supports wallet
|
||||
addresses for sending and receiving SOL and SPL Tokens through its
|
||||
browser extension and web wallet interface.
|
||||
|
||||
*Note: The MathWallet iOS and Android app do not yet support SOL and SPL Tokens*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-dos"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-core = { path = "../core", version = "1.3.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-download-utils"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.17" }
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"bs58",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-sdk-wasm"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
description = "Solana SDK Wasm"
|
||||
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
|
@@ -113,7 +113,7 @@ pub type Epoch = u64;
|
||||
|
||||
#[wasm_bindgen]
|
||||
#[repr(transparent)]
|
||||
#[derive(Serialize, Deserialize, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Serialize, Debug, Deserialize, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
pub struct Pubkey([u8; 32]);
|
||||
|
||||
#[wasm_bindgen]
|
||||
@@ -164,7 +164,7 @@ impl Stake {
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
#[derive(Serialize, Deserialize, PartialEq, Clone, Copy)]
|
||||
#[derive(Serialize, Debug, Deserialize, PartialEq, Clone, Copy)]
|
||||
pub struct Delegation {
|
||||
/// to whom the stake is delegated
|
||||
voter_pubkey: Pubkey,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-faucet"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
tokio = "0.1"
|
||||
tokio-codec = "0.1"
|
||||
|
||||
|
@@ -87,7 +87,10 @@ impl Faucet {
|
||||
}
|
||||
|
||||
pub fn check_time_request_limit(&mut self, request_amount: u64) -> bool {
|
||||
(self.request_current + request_amount) <= self.per_time_cap
|
||||
self.request_current
|
||||
.checked_add(request_amount)
|
||||
.map(|s| s <= self.per_time_cap)
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn clear_request_count(&mut self) {
|
||||
@@ -122,7 +125,7 @@ impl Faucet {
|
||||
}
|
||||
}
|
||||
if self.check_time_request_limit(lamports) {
|
||||
self.request_current += lamports;
|
||||
self.request_current = self.request_current.saturating_add(lamports);
|
||||
datapoint_info!(
|
||||
"faucet-airdrop",
|
||||
("request_amount", lamports, i64),
|
||||
@@ -324,6 +327,8 @@ mod tests {
|
||||
assert!(faucet.check_time_request_limit(1));
|
||||
faucet.request_current = 3;
|
||||
assert!(!faucet.check_time_request_limit(1));
|
||||
faucet.request_current = 1;
|
||||
assert!(!faucet.check_time_request_limit(u64::MAX));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-genesis-programs"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.15" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
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" }
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-core = { path = "../core", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-net-utils = { path = "../net-utils", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[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.15"
|
||||
version = "1.3.17"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -24,15 +24,15 @@ 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.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-config-program = { path = "../programs/config", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
semver = "0.9.0"
|
||||
tar = "0.4.28"
|
||||
tempdir = "0.3.7"
|
||||
tempfile = "3.1.0"
|
||||
url = "2.1.1"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
|
@@ -23,7 +23,7 @@ use std::{
|
||||
sync::mpsc,
|
||||
time::{Duration, Instant, SystemTime},
|
||||
};
|
||||
use tempdir::TempDir;
|
||||
use tempfile::TempDir;
|
||||
use url::Url;
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
@@ -84,7 +84,7 @@ fn download_to_temp(
|
||||
|
||||
let url = Url::parse(url).map_err(|err| format!("Unable to parse {}: {}", url, err))?;
|
||||
|
||||
let temp_dir = TempDir::new(clap::crate_name!())?;
|
||||
let temp_dir = TempDir::new()?;
|
||||
let temp_file = temp_dir.path().join("download");
|
||||
|
||||
let client = reqwest::blocking::Client::new();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-keygen"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-cli-config = { path = "../cli-config", version = "1.3.15" }
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
tiny-bip39 = "0.7.0"
|
||||
|
||||
[[bin]]
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-ledger-tool"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
@@ -19,18 +19,18 @@ log = { version = "0.4.8" }
|
||||
regex = "1"
|
||||
serde_json = "1.0.56"
|
||||
serde_yaml = "0.8.13"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-cli-output = { path = "../cli-output", version = "1.3.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.15" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
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" }
|
||||
tempfile = "3.1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
|
||||
|
@@ -1246,6 +1246,8 @@ fn main() {
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
info!("{} {}", crate_name!(), solana_version::version!());
|
||||
|
||||
let ledger_path = PathBuf::from(value_t!(matches, "ledger_path", String).unwrap_or_else(
|
||||
|_err| {
|
||||
eprintln!(
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-ledger"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
description = "Solana ledger"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
@@ -31,18 +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-transaction-status = { path = "../transaction-status", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-merkle-tree = { path = "../merkle-tree", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
solana-perf = { path = "../perf", version = "1.3.15" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-storage-bigtable = { path = "../storage-bigtable", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
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" }
|
||||
tempfile = "3.1.0"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
@@ -58,7 +59,7 @@ features = ["lz4"]
|
||||
[dev-dependencies]
|
||||
assert_matches = "1.3.0"
|
||||
matches = "0.1.6"
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.15" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.17" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib"]
|
||||
|
@@ -66,7 +66,7 @@ pub fn load(
|
||||
compression,
|
||||
genesis_config,
|
||||
process_options.debug_keys.clone(),
|
||||
process_options.additional_builtins.as_ref(),
|
||||
Some(&crate::builtins::get(genesis_config.cluster_type)),
|
||||
)
|
||||
.expect("Load from snapshot failed");
|
||||
|
||||
|
@@ -5680,6 +5680,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances.clone(),
|
||||
post_balances: post_balances.clone(),
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
@@ -5693,6 +5694,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances.clone(),
|
||||
post_balances: post_balances.clone(),
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
@@ -5704,6 +5706,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
}),
|
||||
}
|
||||
})
|
||||
@@ -6000,6 +6003,7 @@ pub mod tests {
|
||||
index: 0,
|
||||
instructions: vec![CompiledInstruction::new(1, &(), vec![0])],
|
||||
}];
|
||||
let log_messages_vec = vec![String::from("Test message\n")];
|
||||
|
||||
// result not found
|
||||
assert!(transaction_status_cf
|
||||
@@ -6019,6 +6023,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances_vec.clone(),
|
||||
post_balances: post_balances_vec.clone(),
|
||||
inner_instructions: Some(inner_instructions_vec.clone()),
|
||||
log_messages: Some(log_messages_vec.clone()),
|
||||
},
|
||||
)
|
||||
.is_ok());
|
||||
@@ -6030,6 +6035,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
} = transaction_status_cf
|
||||
.get((0, Signature::default(), 0))
|
||||
.unwrap()
|
||||
@@ -6039,6 +6045,7 @@ pub mod tests {
|
||||
assert_eq!(pre_balances, pre_balances_vec);
|
||||
assert_eq!(post_balances, post_balances_vec);
|
||||
assert_eq!(inner_instructions.unwrap(), inner_instructions_vec);
|
||||
assert_eq!(log_messages.unwrap(), log_messages_vec);
|
||||
|
||||
// insert value
|
||||
assert!(transaction_status_cf
|
||||
@@ -6050,6 +6057,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances_vec.clone(),
|
||||
post_balances: post_balances_vec.clone(),
|
||||
inner_instructions: Some(inner_instructions_vec.clone()),
|
||||
log_messages: Some(log_messages_vec.clone()),
|
||||
},
|
||||
)
|
||||
.is_ok());
|
||||
@@ -6061,6 +6069,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
} = transaction_status_cf
|
||||
.get((0, Signature::new(&[2u8; 64]), 9))
|
||||
.unwrap()
|
||||
@@ -6072,6 +6081,7 @@ pub mod tests {
|
||||
assert_eq!(pre_balances, pre_balances_vec);
|
||||
assert_eq!(post_balances, post_balances_vec);
|
||||
assert_eq!(inner_instructions.unwrap(), inner_instructions_vec);
|
||||
assert_eq!(log_messages.unwrap(), log_messages_vec);
|
||||
}
|
||||
Blockstore::destroy(&blockstore_path).expect("Expected successful database destruction");
|
||||
}
|
||||
@@ -6299,6 +6309,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances_vec,
|
||||
post_balances: post_balances_vec,
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
};
|
||||
|
||||
let signature1 = Signature::new(&[1u8; 64]);
|
||||
@@ -6432,6 +6443,7 @@ pub mod tests {
|
||||
index: 0,
|
||||
instructions: vec![CompiledInstruction::new(1, &(), vec![0])],
|
||||
}]);
|
||||
let log_messages = Some(vec![String::from("Test message\n")]);
|
||||
let signature = transaction.signatures[0];
|
||||
blockstore
|
||||
.transaction_status_cf
|
||||
@@ -6443,6 +6455,7 @@ pub mod tests {
|
||||
pre_balances: pre_balances.clone(),
|
||||
post_balances: post_balances.clone(),
|
||||
inner_instructions: inner_instructions.clone(),
|
||||
log_messages: log_messages.clone(),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
@@ -6454,6 +6467,7 @@ pub mod tests {
|
||||
pre_balances,
|
||||
post_balances,
|
||||
inner_instructions,
|
||||
log_messages,
|
||||
}),
|
||||
}
|
||||
})
|
||||
@@ -6893,6 +6907,7 @@ pub mod tests {
|
||||
pre_balances: vec![],
|
||||
post_balances: vec![],
|
||||
inner_instructions: Some(vec![]),
|
||||
log_messages: Some(vec![]),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
@@ -16,8 +16,8 @@ use solana_metrics::{datapoint_error, inc_new_counter_debug};
|
||||
use solana_rayon_threadlimit::get_thread_count;
|
||||
use solana_runtime::{
|
||||
bank::{
|
||||
Bank, Builtins, InnerInstructionsList, TransactionBalancesSet, TransactionProcessResult,
|
||||
TransactionResults,
|
||||
Bank, InnerInstructionsList, TransactionBalancesSet, TransactionLogMessages,
|
||||
TransactionProcessResult, TransactionResults,
|
||||
},
|
||||
bank_forks::BankForks,
|
||||
bank_utils,
|
||||
@@ -103,12 +103,13 @@ fn execute_batch(
|
||||
transaction_status_sender: Option<TransactionStatusSender>,
|
||||
replay_vote_sender: Option<&ReplayVoteSender>,
|
||||
) -> Result<()> {
|
||||
let (tx_results, balances, inner_instructions) =
|
||||
let (tx_results, balances, inner_instructions, transaction_logs) =
|
||||
batch.bank().load_execute_and_commit_transactions(
|
||||
batch,
|
||||
MAX_PROCESSING_AGE,
|
||||
transaction_status_sender.is_some(),
|
||||
transaction_status_sender.is_some(),
|
||||
transaction_status_sender.is_some(),
|
||||
);
|
||||
|
||||
bank_utils::find_and_send_votes(batch.transactions(), &tx_results, replay_vote_sender);
|
||||
@@ -127,6 +128,7 @@ fn execute_batch(
|
||||
processing_results,
|
||||
balances,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
sender,
|
||||
);
|
||||
}
|
||||
@@ -318,7 +320,6 @@ pub struct ProcessOptions {
|
||||
pub new_hard_forks: Option<Vec<Slot>>,
|
||||
pub frozen_accounts: Vec<Pubkey>,
|
||||
pub debug_keys: Option<Arc<HashSet<Pubkey>>>,
|
||||
pub additional_builtins: Option<Builtins>,
|
||||
}
|
||||
|
||||
pub fn process_blockstore(
|
||||
@@ -342,7 +343,7 @@ pub fn process_blockstore(
|
||||
account_paths,
|
||||
&opts.frozen_accounts,
|
||||
opts.debug_keys.clone(),
|
||||
opts.additional_builtins.as_ref(),
|
||||
Some(&crate::builtins::get(genesis_config.cluster_type)),
|
||||
);
|
||||
let bank0 = Arc::new(bank0);
|
||||
info!("processing ledger for slot 0...");
|
||||
@@ -1031,6 +1032,7 @@ pub struct TransactionStatusBatch {
|
||||
pub statuses: Vec<TransactionProcessResult>,
|
||||
pub balances: TransactionBalancesSet,
|
||||
pub inner_instructions: Vec<Option<InnerInstructionsList>>,
|
||||
pub transaction_logs: Vec<TransactionLogMessages>,
|
||||
}
|
||||
|
||||
pub type TransactionStatusSender = Sender<TransactionStatusBatch>;
|
||||
@@ -1042,6 +1044,7 @@ pub fn send_transaction_status_batch(
|
||||
statuses: Vec<TransactionProcessResult>,
|
||||
balances: TransactionBalancesSet,
|
||||
inner_instructions: Vec<Option<InnerInstructionsList>>,
|
||||
transaction_logs: Vec<TransactionLogMessages>,
|
||||
transaction_status_sender: TransactionStatusSender,
|
||||
) {
|
||||
let slot = bank.slot();
|
||||
@@ -1052,6 +1055,7 @@ pub fn send_transaction_status_batch(
|
||||
statuses,
|
||||
balances,
|
||||
inner_instructions,
|
||||
transaction_logs,
|
||||
}) {
|
||||
trace!(
|
||||
"Slot {} transaction_status send batch failed: {:?}",
|
||||
@@ -2891,11 +2895,13 @@ pub mod tests {
|
||||
},
|
||||
_balances,
|
||||
_inner_instructions,
|
||||
_log_messages,
|
||||
) = batch.bank().load_execute_and_commit_transactions(
|
||||
&batch,
|
||||
MAX_PROCESSING_AGE,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
let (err, signature) = get_first_error(&batch, fee_collection_results).unwrap();
|
||||
// First error found should be for the 2nd transaction, due to iteration_order
|
||||
|
@@ -1,3 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate solana_bpf_loader_program;
|
||||
|
||||
pub mod bank_forks_utils;
|
||||
pub mod bigtable_upload;
|
||||
pub mod block_error;
|
||||
@@ -7,6 +10,7 @@ pub mod ancestor_iterator;
|
||||
pub mod blockstore_db;
|
||||
pub mod blockstore_meta;
|
||||
pub mod blockstore_processor;
|
||||
pub mod builtins;
|
||||
pub mod entry;
|
||||
pub mod erasure;
|
||||
pub mod genesis_utils;
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-local-cluster"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-core = { path = "../core", version = "1.3.15" }
|
||||
solana-client = { path = "../client", version = "1.3.15" }
|
||||
solana-download-utils = { path = "../download-utils", version = "1.3.15" }
|
||||
solana-faucet = { path = "../faucet", version = "1.3.15" }
|
||||
solana-exchange-program = { path = "../programs/exchange", version = "1.3.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-runtime = { path = "../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "1.3.15" }
|
||||
solana-vest-program = { path = "../programs/vest", version = "1.3.15" }
|
||||
solana-vote-program = { path = "../programs/vote", version = "1.3.15" }
|
||||
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" }
|
||||
tempfile = "3.1.0"
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.15" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.17" }
|
||||
|
||||
[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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[[bin]]
|
||||
name = "solana-log-analyzer"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-logger"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.17" }
|
||||
|
||||
[target."cfg(unix)".dependencies]
|
||||
jemallocator = "0.3.2"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-merkle-tree"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
fast-math = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-metrics"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.17" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.7.0"
|
||||
|
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-net-shaper"
|
||||
description = "The solana cluster network shaping tool"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.17" }
|
||||
solana-logger = { path = "../logger", version = "1.3.17" }
|
||||
rand = "0.7.0"
|
||||
|
||||
[[bin]]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-net-utils"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
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" }
|
||||
tokio = "0.1"
|
||||
tokio-codec = "0.1"
|
||||
url = "2.1.1"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-notifier"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.3.15" }
|
||||
solana-budget-program = { path = "../programs/budget", version = "1.3.15" }
|
||||
solana-logger = { path = "../logger", version = "1.3.15" }
|
||||
solana-metrics = { path = "../metrics", version = "1.3.15" }
|
||||
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" }
|
||||
curve25519-dalek = { version = "2" }
|
||||
|
||||
[lib]
|
||||
|
@@ -2,7 +2,7 @@
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
edition = "2018"
|
||||
name = "solana-poh-bench"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15" }
|
||||
solana-ledger = { path = "../ledger", version = "1.3.15" }
|
||||
solana-sdk = { path = "../sdk", version = "1.3.15" }
|
||||
solana-clap-utils = { path = "../clap-utils", version = "1.3.15" }
|
||||
solana-measure = { path = "../measure", version = "1.3.15" }
|
||||
solana-version = { path = "../version", version = "1.3.15" }
|
||||
solana-perf = { path = "../perf", version = "1.3.15" }
|
||||
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" }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
105
programs/bpf/Cargo.lock
generated
105
programs/bpf/Cargo.lock
generated
@@ -301,12 +301,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6"
|
||||
checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"maybe-uninit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -337,12 +337,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab6bffe714b6bb07e42f201352c34f51fefd355ace793f9e638ebd52d23f98d2"
|
||||
checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"maybe-uninit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1728,13 +1729,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.4.0"
|
||||
version = "1.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4"
|
||||
checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-loader-program"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder 1.3.4",
|
||||
@@ -1748,7 +1749,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-programs"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder 1.3.4",
|
||||
@@ -1764,7 +1765,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-128bit"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-128bit-dep",
|
||||
"solana-sdk",
|
||||
@@ -1772,21 +1773,35 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-128bit-dep"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-alloc"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-call-depth"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-custom-heap"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-dep-crate"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"solana-sdk",
|
||||
@@ -1794,21 +1809,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-deprecated_loader"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-dup-accounts"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-error-handling"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"num-derive 0.2.5",
|
||||
"num-traits",
|
||||
@@ -1818,21 +1833,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-external-spend"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-instruction-introspection"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-invoke"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-invoked",
|
||||
"solana-sdk",
|
||||
@@ -1840,21 +1855,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-invoked"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-iter"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-many-args"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-many-args-dep",
|
||||
"solana-sdk",
|
||||
@@ -1862,28 +1877,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-many-args-dep"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-noop"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-panic"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-param-passing"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-bpf-rust-param-passing-dep",
|
||||
"solana-sdk",
|
||||
@@ -1891,28 +1906,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-param-passing-dep"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sanity"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-rust-sysval"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"solana-sdk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-config-program"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"chrono",
|
||||
@@ -1924,7 +1939,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-crate-features"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes 0.4.12",
|
||||
@@ -1947,7 +1962,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-logger"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
@@ -1956,7 +1971,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-measure"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"jemalloc-ctl",
|
||||
"jemallocator",
|
||||
@@ -1967,7 +1982,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-metrics"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"gethostname",
|
||||
@@ -1979,7 +1994,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-rayon-threadlimit"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"num_cpus",
|
||||
@@ -1987,7 +2002,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-runtime"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"blake3",
|
||||
@@ -2033,7 +2048,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"assert_matches",
|
||||
"bincode",
|
||||
@@ -2073,7 +2088,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bs58",
|
||||
"proc-macro2 1.0.19",
|
||||
@@ -2084,7 +2099,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro-frozen-abi"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"proc-macro2 1.0.19",
|
||||
@@ -2095,7 +2110,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-secp256k1-program"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"digest 0.9.0",
|
||||
@@ -2108,7 +2123,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-stake-program"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
@@ -2127,7 +2142,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana-vote-program"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
@@ -2145,9 +2160,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.1.31"
|
||||
version = "0.1.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "962f8f04ac7239fe4dd45fa4ce706ec78b59a0da9f41def463832857e36c60b0"
|
||||
checksum = "9a95dbe2b00920ac4e1524b7442cf5319f01e8fa5742930ac60148882fd7738b"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"combine",
|
||||
@@ -2561,7 +2576,7 @@ version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4"
|
||||
dependencies = [
|
||||
"smallvec 1.4.0",
|
||||
"smallvec 1.4.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "solana-bpf-programs"
|
||||
description = "Blockchain, Rebuilt for Scale"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
documentation = "https://docs.rs/solana"
|
||||
homepage = "https://solana.com/"
|
||||
readme = "README.md"
|
||||
@@ -22,12 +22,12 @@ walkdir = "2"
|
||||
bincode = "1.1.4"
|
||||
byteorder = "1.3.2"
|
||||
elf = "0.0.10"
|
||||
solana-bpf-loader-program = { path = "../bpf_loader", version = "1.3.15" }
|
||||
solana-logger = { path = "../../logger", version = "1.3.15" }
|
||||
solana-measure = { path = "../../measure", version = "1.3.15" }
|
||||
solana-runtime = { path = "../../runtime", version = "1.3.15" }
|
||||
solana-sdk = { path = "../../sdk", version = "1.3.15" }
|
||||
solana_rbpf = "=0.1.31"
|
||||
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_rbpf = "=0.1.32"
|
||||
|
||||
[[bench]]
|
||||
name = "bpf_loader"
|
||||
@@ -37,6 +37,8 @@ members = [
|
||||
"rust/128bit",
|
||||
"rust/128bit_dep",
|
||||
"rust/alloc",
|
||||
"rust/call_depth",
|
||||
"rust/custom_heap",
|
||||
"rust/dep_crate",
|
||||
"rust/deprecated_loader",
|
||||
"rust/dup_accounts",
|
||||
|
@@ -218,7 +218,7 @@ fn bench_instruction_count_tuner(_bencher: &mut Bencher) {
|
||||
"Tuner must consume the whole budget"
|
||||
);
|
||||
println!(
|
||||
"{:?} Consumed compute budget took {:?} us ({:?} instructions)",
|
||||
"{:?} compute units took {:?} us ({:?} instructions)",
|
||||
BUDGET - instruction_meter.get_remaining(),
|
||||
measure.as_us(),
|
||||
vm.get_total_instruction_count(),
|
||||
@@ -229,6 +229,7 @@ fn bench_instruction_count_tuner(_bencher: &mut Bencher) {
|
||||
pub struct MockInvokeContext {
|
||||
key: Pubkey,
|
||||
logger: MockLogger,
|
||||
compute_budget: ComputeBudget,
|
||||
compute_meter: Rc<RefCell<MockComputeMeter>>,
|
||||
}
|
||||
impl InvokeContext for MockInvokeContext {
|
||||
@@ -253,11 +254,8 @@ impl InvokeContext for MockInvokeContext {
|
||||
fn get_logger(&self) -> Rc<RefCell<dyn Logger>> {
|
||||
Rc::new(RefCell::new(self.logger.clone()))
|
||||
}
|
||||
fn is_cross_program_supported(&self) -> bool {
|
||||
true
|
||||
}
|
||||
fn get_compute_budget(&self) -> ComputeBudget {
|
||||
ComputeBudget::default()
|
||||
fn get_compute_budget(&self) -> &ComputeBudget {
|
||||
&self.compute_budget
|
||||
}
|
||||
fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>> {
|
||||
self.compute_meter.clone()
|
||||
@@ -267,6 +265,9 @@ impl InvokeContext for MockInvokeContext {
|
||||
None
|
||||
}
|
||||
fn record_instruction(&self, _instruction: &Instruction) {}
|
||||
fn is_feature_active(&self, _feature_id: &Pubkey) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct MockLogger {
|
||||
|
@@ -67,6 +67,8 @@ fn main() {
|
||||
let rust_programs = [
|
||||
"128bit",
|
||||
"alloc",
|
||||
"call_depth",
|
||||
"custom_heap",
|
||||
"dep_crate",
|
||||
"deprecated_loader",
|
||||
"dup_accounts",
|
||||
|
@@ -178,33 +178,6 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
SOL_ARRAY_SIZE(signers_seeds)));
|
||||
}
|
||||
|
||||
sol_log("Test multiple derived signers");
|
||||
{
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[DERIVED_KEY1_INDEX].key, true, false},
|
||||
{accounts[DERIVED_KEY2_INDEX].key, true, true},
|
||||
{accounts[DERIVED_KEY3_INDEX].key, false, true}};
|
||||
uint8_t data[] = {TEST_VERIFY_NESTED_SIGNERS};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
uint8_t seed1[] = {'L', 'i', 'l', '\''};
|
||||
uint8_t seed2[] = {'B', 'i', 't', 's'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{seed2, SOL_ARRAY_SIZE(seed2)},
|
||||
{&nonce2, 1}};
|
||||
const SolSignerSeed seeds2[] = {
|
||||
{(uint8_t *)accounts[DERIVED_KEY2_INDEX].key, SIZE_PUBKEY},
|
||||
{&nonce3, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)},
|
||||
{seeds2, SOL_ARRAY_SIZE(seeds2)}};
|
||||
|
||||
sol_assert(SUCCESS == sol_invoke_signed(&instruction, accounts,
|
||||
SOL_ARRAY_SIZE(accounts),
|
||||
signers_seeds,
|
||||
SOL_ARRAY_SIZE(signers_seeds)));
|
||||
}
|
||||
|
||||
sol_log("Test readonly with writable account");
|
||||
{
|
||||
SolAccountMeta arguments[] = {
|
||||
@@ -227,7 +200,8 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[INVOKED_ARGUMENT_INDEX].key, true, true},
|
||||
{accounts[ARGUMENT_INDEX].key, true, true}};
|
||||
{accounts[ARGUMENT_INDEX].key, true, true},
|
||||
{accounts[INVOKED_PROGRAM_DUP_INDEX].key, false, false}};
|
||||
uint8_t data[] = {TEST_NESTED_INVOKE};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
@@ -240,8 +214,9 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
sol_assert(SUCCESS ==
|
||||
sol_invoke(&instruction, accounts, SOL_ARRAY_SIZE(accounts)));
|
||||
|
||||
sol_assert(*accounts[ARGUMENT_INDEX].lamports == 42 - 5 + 1 + 1);
|
||||
sol_assert(*accounts[INVOKED_ARGUMENT_INDEX].lamports == 10 + 5 - 1 - 1);
|
||||
sol_assert(*accounts[ARGUMENT_INDEX].lamports == 42 - 5 + 1 + 1 + 1 + 1);
|
||||
sol_assert(*accounts[INVOKED_ARGUMENT_INDEX].lamports ==
|
||||
10 + 5 - 1 - 1 - 1 - 1);
|
||||
}
|
||||
|
||||
sol_log("Verify data values are retained and updated");
|
||||
|
@@ -101,6 +101,32 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
sol_assert(!accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
sol_assert(!accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
|
||||
uint8_t nonce2 = params.data[1];
|
||||
uint8_t nonce3 = params.data[2];
|
||||
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[DERIVED_KEY1_INDEX].key, true, false},
|
||||
{accounts[DERIVED_KEY2_INDEX].key, true, true},
|
||||
{accounts[DERIVED_KEY3_INDEX].key, false, true}};
|
||||
uint8_t data[] = {TEST_VERIFY_NESTED_SIGNERS};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
uint8_t seed1[] = {'L', 'i', 'l', '\''};
|
||||
uint8_t seed2[] = {'B', 'i', 't', 's'};
|
||||
const SolSignerSeed seeds1[] = {{seed1, SOL_ARRAY_SIZE(seed1)},
|
||||
{seed2, SOL_ARRAY_SIZE(seed2)},
|
||||
{&nonce2, 1}};
|
||||
const SolSignerSeed seeds2[] = {
|
||||
{(uint8_t *)accounts[DERIVED_KEY2_INDEX].key, SIZE_PUBKEY},
|
||||
{&nonce3, 1}};
|
||||
const SolSignerSeeds signers_seeds[] = {{seeds1, SOL_ARRAY_SIZE(seeds1)},
|
||||
{seeds2, SOL_ARRAY_SIZE(seeds2)}};
|
||||
|
||||
sol_assert(SUCCESS == sol_invoke_signed(
|
||||
&instruction, accounts, SOL_ARRAY_SIZE(accounts),
|
||||
signers_seeds, SOL_ARRAY_SIZE(signers_seeds)));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -114,6 +140,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
sol_assert(!accounts[DERIVED_KEY1_INDEX].is_signer);
|
||||
sol_assert(accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
sol_assert(accounts[DERIVED_KEY2_INDEX].is_signer);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -133,6 +160,12 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
|
||||
static const int INVOKED_ARGUMENT_INDEX = 0;
|
||||
static const int ARGUMENT_INDEX = 1;
|
||||
static const int INVOKED_PROGRAM_INDEX = 2;
|
||||
|
||||
if (!sol_deserialize(input, ¶ms, 3)) {
|
||||
sol_assert(sol_deserialize(input, ¶ms, 2));
|
||||
}
|
||||
|
||||
sol_assert(sol_deserialize(input, ¶ms, 2));
|
||||
|
||||
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].is_signer);
|
||||
@@ -141,9 +174,23 @@ extern uint64_t entrypoint(const uint8_t *input) {
|
||||
*accounts[INVOKED_ARGUMENT_INDEX].lamports -= 1;
|
||||
*accounts[ARGUMENT_INDEX].lamports += 1;
|
||||
|
||||
sol_log("Last invoke");
|
||||
for (int i = 0; i < accounts[INVOKED_ARGUMENT_INDEX].data_len; i++) {
|
||||
accounts[INVOKED_ARGUMENT_INDEX].data[i] = i;
|
||||
if (params.ka_num == 3) {
|
||||
SolAccountMeta arguments[] = {
|
||||
{accounts[INVOKED_ARGUMENT_INDEX].key, true, true},
|
||||
{accounts[ARGUMENT_INDEX].key, true, true}};
|
||||
uint8_t data[] = {TEST_NESTED_INVOKE};
|
||||
const SolInstruction instruction = {accounts[INVOKED_PROGRAM_INDEX].key,
|
||||
arguments, SOL_ARRAY_SIZE(arguments),
|
||||
data, SOL_ARRAY_SIZE(data)};
|
||||
|
||||
sol_log("Invoke again");
|
||||
sol_assert(SUCCESS ==
|
||||
sol_invoke(&instruction, accounts, SOL_ARRAY_SIZE(accounts)));
|
||||
} else {
|
||||
sol_log("Last invoked");
|
||||
for (int i = 0; i < accounts[INVOKED_ARGUMENT_INDEX].data_len; i++) {
|
||||
accounts[INVOKED_ARGUMENT_INDEX].data[i] = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-128bit"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15", default-features = false }
|
||||
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "1.3.15", default-features = false }
|
||||
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 }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-128bit-dep"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.17", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-alloc"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.17", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
|
26
programs/bpf/rust/call_depth/Cargo.toml
Normal file
26
programs/bpf/rust/call_depth/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
# Note: This crate must be built using do.sh
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-call-depth"
|
||||
version = "1.3.17"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.17", default-features = false }
|
||||
|
||||
[features]
|
||||
program = ["solana-sdk/program"]
|
||||
default = ["program", "solana-sdk/default"]
|
||||
|
||||
[lib]
|
||||
name = "solana_bpf_rust_call_depth"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
2
programs/bpf/rust/call_depth/Xargo.toml
Normal file
2
programs/bpf/rust/call_depth/Xargo.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[target.bpfel-unknown-unknown.dependencies.std]
|
||||
features = []
|
27
programs/bpf/rust/call_depth/src/lib.rs
Normal file
27
programs/bpf/rust/call_depth/src/lib.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
//! @brief Example Rust-based BPF program that tests call depth and stack usage
|
||||
|
||||
use solana_sdk::{entrypoint::SUCCESS, info};
|
||||
|
||||
#[inline(never)]
|
||||
pub fn recurse(data: &mut [u8]) {
|
||||
if data.len() <= 1 {
|
||||
return;
|
||||
}
|
||||
recurse(&mut data[1..]);
|
||||
info!(line!(), 0, 0, 0, data[0]);
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
#[inline(never)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
|
||||
info!("Call depth");
|
||||
let depth = *(input.add(16) as *mut u8);
|
||||
info!(line!(), 0, 0, 0, depth);
|
||||
let mut data = Vec::with_capacity(depth as usize);
|
||||
for i in 0_u8..depth {
|
||||
data.push(i);
|
||||
}
|
||||
recurse(&mut data);
|
||||
SUCCESS
|
||||
}
|
27
programs/bpf/rust/custom_heap/Cargo.toml
Normal file
27
programs/bpf/rust/custom_heap/Cargo.toml
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
# Note: This crate must be built using do.sh
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-custom-heap"
|
||||
version = "1.3.17"
|
||||
description = "Solana BPF test program written in Rust"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://solana.com/"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.17", default-features = false }
|
||||
|
||||
[features]
|
||||
custom-heap = []
|
||||
program = ["custom-heap", "solana-sdk/program"]
|
||||
default = ["program", "solana-sdk/default"]
|
||||
|
||||
[lib]
|
||||
name = "solana_bpf_rust_custom_heap"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
2
programs/bpf/rust/custom_heap/Xargo.toml
Normal file
2
programs/bpf/rust/custom_heap/Xargo.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[target.bpfel-unknown-unknown.dependencies.std]
|
||||
features = []
|
68
programs/bpf/rust/custom_heap/src/lib.rs
Normal file
68
programs/bpf/rust/custom_heap/src/lib.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
//! @brief Example Rust-based BPF that tests out using a custom heap
|
||||
|
||||
use solana_sdk::{
|
||||
account_info::AccountInfo,
|
||||
entrypoint,
|
||||
entrypoint::{ProgramResult, HEAP_LENGTH, HEAP_START_ADDRESS},
|
||||
info,
|
||||
pubkey::Pubkey,
|
||||
};
|
||||
use std::{
|
||||
alloc::{alloc, Layout},
|
||||
mem::{align_of, size_of},
|
||||
ptr::null_mut,
|
||||
usize,
|
||||
};
|
||||
|
||||
/// Developers can implement their own heap by defining their own
|
||||
/// `#[global_allocator]`. The following implements a dummy for test purposes
|
||||
/// but can be flushed out with whatever the developer sees fit.
|
||||
struct BumpAllocator;
|
||||
unsafe impl std::alloc::GlobalAlloc for BumpAllocator {
|
||||
#[inline]
|
||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
if layout.size() == usize::MAX - 0x42 {
|
||||
// Return test value
|
||||
0x42 as *mut u8
|
||||
} else {
|
||||
const POS_PTR: *mut usize = HEAP_START_ADDRESS as *mut usize;
|
||||
const TOP_ADDRESS: usize = HEAP_START_ADDRESS + HEAP_LENGTH;
|
||||
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS + size_of::<*mut u8>();
|
||||
|
||||
let mut pos = *POS_PTR;
|
||||
if pos == 0 {
|
||||
// First time, set starting position
|
||||
pos = TOP_ADDRESS;
|
||||
}
|
||||
pos = pos.saturating_sub(layout.size());
|
||||
pos &= !(layout.align().saturating_sub(1));
|
||||
if pos < BOTTOM_ADDRESS {
|
||||
return null_mut();
|
||||
}
|
||||
*POS_PTR = pos;
|
||||
pos as *mut u8
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
unsafe fn dealloc(&self, _: *mut u8, _: Layout) {
|
||||
// I'm a bump allocator, I don't free
|
||||
}
|
||||
}
|
||||
#[cfg(not(test))]
|
||||
#[global_allocator]
|
||||
static A: BumpAllocator = BumpAllocator;
|
||||
|
||||
entrypoint!(process_instruction);
|
||||
fn process_instruction(
|
||||
_program_id: &Pubkey,
|
||||
_accounts: &[AccountInfo],
|
||||
_instruction_data: &[u8],
|
||||
) -> ProgramResult {
|
||||
info!("Custom heap");
|
||||
unsafe {
|
||||
let layout = Layout::from_size_align(usize::MAX - 0x42, align_of::<u8>()).unwrap();
|
||||
let ptr = alloc(layout);
|
||||
assert_eq!(ptr as u64, 0x42);
|
||||
}
|
||||
Ok(())
|
||||
}
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-dep-crate"
|
||||
version = "1.3.15"
|
||||
version = "1.3.17"
|
||||
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.15", default-features = false }
|
||||
solana-sdk = { path = "../../../../sdk/", version = "1.3.17", 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