Compare commits

...

33 Commits

Author SHA1 Message Date
mergify[bot]
0e6b476cbf More set_root metrics (backport #21286) (#21290)
* More set_root metrics (#21286)

(cherry picked from commit 398af132a5)

# Conflicts:
#	core/src/replay_stage.rs

* Fix conflict

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-16 02:29:33 +00:00
mergify[bot]
8bfba571f2 Make cargo-build-bpf clean up after failed installation of bpf-tools (#21143) (#21157)
(cherry picked from commit 55d19e61da)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-11-15 23:45:15 +00:00
mergify[bot]
1a0eabe340 add new macro: pubkey! (backport #21245) (#21288) 2021-11-15 13:42:30 -08:00
mergify[bot]
a05c08e711 Bump bpf-tools to v1.19 (#21256) (#21264)
Toolchain upgrade to rust 1.56.0 and clang 13.0.

(cherry picked from commit 3f4f05865d)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-11-15 20:59:58 +00:00
mergify[bot]
6a6dd86262 throttle store_cached when cache size is too large (#21188) (#21279)
* throttle store_cached when cache size is too large

* reduce max delay

* 100ms max

* 10ms max delay

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-11-15 19:57:27 +00:00
mergify[bot]
5d6b52f9af docs: Replaces "is_rooted" with "is_connected" (#20762) (#21283)
(cherry picked from commit 119549403d)

Co-authored-by: Arthur Burkart <arthur@presynce.com>
2021-11-15 10:26:55 -08:00
Ivan Mironov
8072635967 Add validator options to change priority of snapshot packager and RPC threads (v1.8) (#21020)
* Add function for changing thread's nice value

Linux only.

* Add validator option to change niceness of snapshot packager thread

* Add validator option to change niceness of RPC server threads

Fixes https://github.com/solana-labs/solana/issues/14556

* Run `./scripts/cargo-for-all-lock-files.sh tree`
2021-11-15 09:50:45 -08:00
mergify[bot]
a86fdebb3b Bump timeout on test_rpc_subscriptions (#21259) (#21262)
* Extend timeout

* Add log

(cherry picked from commit 156b8ead42)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-13 14:23:48 +00:00
mergify[bot]
31b3ada6d9 Update various terms to "known" (backport #21257) (#21261)
* Update various terms to "known" (#21257)

* Update snapshot bootstrap terminology

* Update only known rpc terminology

* Update replica-node

(cherry picked from commit ae3777cadb)

# Conflicts:
#	replica-node/src/replica_util.rs
#	validator/src/bootstrap.rs

* Fix conflicts

* Remove dangling file

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-13 07:12:54 +00:00
mergify[bot]
2992a7154a Refactor vote state to remove double negative (backport #21244) (#21250)
* Refactor vote state to remove double negative (#21244)

(cherry picked from commit ef29d2d172)

# Conflicts:
#	runtime/src/stakes.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-11-13 01:27:23 +00:00
mergify[bot]
21cd423e67 Rename "trusted" to "known" in validators/ (backport #21197) (#21255)
* Rename "trusted" to "known" in `validators/` (#21197)

* Replaced trusted with known validator

* Format Convention

(cherry picked from commit b0ca335463)

# Conflicts:
#	core/src/accounts_hash_verifier.rs
#	core/src/serve_repair.rs
#	rpc/src/rpc_service.rs
#	validator/src/bootstrap.rs

* Fix conflicts

Co-authored-by: Michael Keleti <16996410+mkeleti@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-12 21:36:53 +00:00
Tyera Eulberg
09ef4d12f7 Bump version to 1.8.4 (#21232) (#21235)
Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-10 15:20:41 -07:00
mergify[bot]
de94c4e867 Add set_root bank drop logging (#21144) (#21194)
(cherry picked from commit 706b60b5c8)

Co-authored-by: carllin <carl@solana.com>
2021-11-10 11:58:28 -07:00
Tyera Eulberg
74684a107c Revert "Bump version to 1.8.4 (#21232)"
This reverts commit 19b3ba0442.
2021-11-10 11:19:39 -07:00
sakridge
19b3ba0442 Bump version to 1.8.4 (#21232) 2021-11-10 16:38:44 +01:00
mergify[bot]
784c745efa Disable JIT compiler on unsupported platforms (#21215) (#21218)
(cherry picked from commit b4d09388aa)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-11-09 13:29:49 +00:00
mergify[bot]
a7b3436b1e report pubsub stats every 2s (backport #21192) (#21196)
* report pubsub stats every 2s (#21192)

(cherry picked from commit 7659a2edc2)

* remove use of Duration::MAX

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-11-06 15:22:07 +00:00
Justin Starry
89b2a3d0ae Refactor RentDebits to use hashmap instead of vec (v1.8 backport) (#21176)
* Refactor `RentDebits` to use hashmap instead of vec (v1.8 backport)

* Fix rent debits test (#21177)
2021-11-05 08:52:14 +00:00
mergify[bot]
56fc58a2b5 Simplify replay vote tracking by using packet metadata (backport #21112) (#21149)
* Simplify replay vote tracking by using packet metadata (#21112)

(cherry picked from commit 140a5f633d)

# Conflicts:
#	core/src/banking_stage.rs
#	ledger-tool/src/main.rs
#	rpc/src/rpc.rs
#	runtime/src/bank.rs
#	runtime/src/bank_utils.rs
#	runtime/src/stakes.rs
#	sdk/src/transaction/sanitized.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-11-05 00:16:34 +00:00
mergify[bot]
53e0c9710e Fix typo in bankless-leader.md (#21152) (#21160)
Reseting -> Resetting

(cherry picked from commit ae207b7dbb)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2021-11-03 23:16:43 +00:00
sakridge
c14864a608 Add accounts stats for space amplification (#21151) 2021-11-03 16:41:29 +01:00
mergify[bot]
780302af56 Add set_root timing metrics (#21119) (#21135)
(cherry picked from commit 1e5212e60d)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-02 20:17:04 +00:00
Lijun Wang
90557564c3 Accountsdb plugin postgres improvement (#21034) (#21096)
Summary of Changes

Added the reference postgresql.conf
Prepare slot update statement to reduce overhead in updating slot
Support custom connection string
Allow the plugin to panic on replication issues to ensure consistency
2021-11-02 01:07:21 -07:00
mergify[bot]
6d2fd078be Update deprecated variant in RpcClient doctests (#21121) (#21131)
(cherry picked from commit 96e5342292)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-01 23:48:30 -06:00
mergify[bot]
4a874e9ba1 Fixup filter deprecated since (#21123) (#21128)
(cherry picked from commit 1b47f7f2cd)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-02 04:23:32 +00:00
mergify[bot]
22510678b4 docs: Update language around immutable programs (#21116) (#21118)
(cherry picked from commit ec86ff8fb3)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-01 21:01:27 +00:00
mergify[bot]
69b973a3a6 Parallel notifications in RPC PubSub (backport #20543) (#21092)
* Parallel notifications in RPC PubSub (#20543)

* generate rpc notifications in parallel

* Use multithreaded runtime for pubsub

* add metric for time since creation of rpc notification to queue

* measure notification entry processing

* fix: add n_threads config argument

* configure rayon thread pool for rpc notifications

* add config option for pubsub notification threads

* rename metric to created_to_queue_time_us

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* rename metric to notification_entry_processing_time_us

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* use value_of for rpc_pubsub_notification_threads parsing

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* rename threads to sol-sub-notif-N

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* fix rpc tests for TimestampedNotificationEntry

* rustfmt

* use rayon thread limit for rpc

Co-authored-by: Pavel Strakhov <p.strakhov@iconic.vc>
Co-authored-by: Alexander Polakov <a.polakov@zubr.io>
Co-authored-by: Nikita Podoliako <bananaelecitrus@gmail.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 9fabff5129)

# Conflicts:
#	Cargo.lock
#	rpc/Cargo.toml

* Fix conflicts

Co-authored-by: Pavel Strakhov <ri@idzaaus.org>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-01 20:19:51 +00:00
Tyera Eulberg
cc7ed71cb7 Fix serum-dex downstream build (#21115) 2021-11-01 17:54:22 +00:00
mergify[bot]
b6fe051d24 Document next_account_info(s) (#21076) (#21080)
(cherry picked from commit 62c8fb4792)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-10-29 22:22:09 +00:00
mergify[bot]
506d39ea82 Add missing websocket methods to rust RPC PubSub client (backport #21065) (#21073)
* Add missing websocket methods to rust RPC PubSub client (#21065)

- Added accountSubscribe,  programSubscribe, slotSubscribe and rootSubscribe to rust RpcClient
 - Removed duplication on cleanup threads
 - Moved RPCVote from rpc/ to client/rpc_response

(cherry picked from commit a0f9e0e8ee)

# Conflicts:
#	Cargo.lock
#	client-test/Cargo.toml
#	core/tests/client.rs

* Fix conflicts

* Make test result not depend on TestValidator setup

Co-authored-by: Manuel Gil <manugildev@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-29 21:46:59 +00:00
mergify[bot]
a595e06b48 Check whether vote-authorize-voter-checked new vote authority is_interactive (#21051) (#21057)
* Check interactive signer for vote-authorize-voter-checked

* Recommend checked vote reauthorization

(cherry picked from commit 0b8fcf0808)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-28 23:10:25 +00:00
mergify[bot]
da08f3dc2b seeds rng for test_build_crds_filter test (#21031) (#21048)
(cherry picked from commit eea3fb327f)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-28 22:06:13 +00:00
Tyera Eulberg
8dd3c1ece1 Bump version to v1.8.3 (#21040) 2021-10-28 11:17:11 -06:00
189 changed files with 3976 additions and 1995 deletions

340
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-account-decoder"
version = "1.8.2"
version = "1.8.4"
description = "Solana account decoder"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -19,9 +19,9 @@ lazy_static = "1.4.0"
serde = "1.0.122"
serde_derive = "1.0.103"
serde_json = "1.0.56"
solana-config-program = { path = "../programs/config", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-config-program = { path = "../programs/config", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
spl-token-v2-0 = { package = "spl-token", version = "=3.2.0", features = ["no-entrypoint"] }
thiserror = "1.0"
zstd = "0.5.1"

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accounts-bench"
version = "1.8.2"
version = "1.8.4"
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.11"
rayon = "1.5.0"
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
rand = "0.7.0"
clap = "2.33.1"
crossbeam-channel = "0.4"

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accounts-cluster-bench"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -13,24 +13,24 @@ clap = "2.33.1"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.4.1"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.2" }
solana-faucet = { path = "../faucet", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-account-decoder = { path = "../account-decoder", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-faucet = { path = "../faucet", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
spl-token-v2-0 = { package = "spl-token", version = "=3.2.0", features = ["no-entrypoint"] }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "=1.8.2" }
solana-local-cluster = { path = "../local-cluster", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accountsdb-plugin-interface"
description = "The Solana AccountsDb plugin interface."
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accountsdb-plugin-manager"
description = "The Solana AccountsDb plugin manager."
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -17,13 +17,13 @@ log = "0.4.11"
serde = "1.0.130"
serde_derive = "1.0.103"
serde_json = "1.0.67"
solana-accountsdb-plugin-interface = { path = "../accountsdb-plugin-interface", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-rpc = { path = "../rpc", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-accountsdb-plugin-interface = { path = "../accountsdb-plugin-interface", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-rpc = { path = "../rpc", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
thiserror = "1.0.21"
[package.metadata.docs.rs]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accountsdb-plugin-postgres"
description = "The Solana AccountsDb plugin for PostgreSQL database."
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -21,11 +21,11 @@ postgres = { version = "0.19.1", features = ["with-chrono-0_4"] }
serde = "1.0.130"
serde_derive = "1.0.103"
serde_json = "1.0.67"
solana-accountsdb-plugin-interface = { path = "../accountsdb-plugin-interface", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-accountsdb-plugin-interface = { path = "../accountsdb-plugin-interface", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
thiserror = "1.0.21"
tokio-postgres = "0.7.3"

View File

@@ -2,7 +2,7 @@
* Script for cleaning up the schema for PostgreSQL used for the AccountsDb plugin.
*/
DROP TRIGGER account_update_trigger;
DROP TRIGGER account_update_trigger ON account;
DROP FUNCTION audit_account_update;
DROP TABLE account_audit;
DROP TABLE account;

View File

@@ -0,0 +1,802 @@
# This a reference configuration file for the PostgreSQL database version 14.
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
# values can be found in the PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, run "pg_ctl reload", or execute
# "SELECT pg_reload_conf()". Some parameters, which are marked below,
# require a server shutdown and restart to take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# "postgres -c log_connections=on". Some parameters can be changed at run time
# with the "SET" SQL command.
#
# Memory units: B = bytes Time units: us = microseconds
# kB = kilobytes ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days
#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '/var/lib/postgresql/14/main' # use data in another directory
# (change requires restart)
hba_file = '/etc/postgresql/14/main/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '/etc/postgresql/14/main/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/14-main.pid' # write an extra PID file
# (change requires restart)
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
listen_addresses = '*'
port = 5433 # (change requires restart)
max_connections = 200 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
# - TCP settings -
# see "man tcp" for details
#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds;
# 0 selects the system default
#client_connection_check_interval = 0 # time between checks for client
# disconnection while running queries;
# 0 for never
# - Authentication -
#authentication_timeout = 1min # 1s-600s
#password_encryption = scram-sha-256 # scram-sha-256 or md5
#db_user_namespace = off
# GSSAPI using Kerberos
#krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab'
#krb_caseins_users = off
# - SSL -
ssl = on
#ssl_ca_file = ''
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
#ssl_crl_file = ''
#ssl_crl_dir = ''
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
#ssl_prefer_server_ciphers = on
#ssl_ecdh_curve = 'prime256v1'
#ssl_min_protocol_version = 'TLSv1.2'
#ssl_max_protocol_version = ''
#ssl_dh_params_file = ''
#ssl_passphrase_command = ''
#ssl_passphrase_command_supports_reload = off
#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------
# - Memory -
shared_buffers = 1GB # min 128kB
# (change requires restart)
#huge_pages = try # on, off, or try
# (change requires restart)
#huge_page_size = 0 # zero for system default
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
# (change requires restart)
# Caution: it is not advisable to set max_prepared_transactions nonzero unless
# you actively intend to use prepared transactions.
#work_mem = 4MB # min 64kB
#hash_mem_multiplier = 1.0 # 1-1000.0 multiplier on hash table work_mem
#maintenance_work_mem = 64MB # min 1MB
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#logical_decoding_work_mem = 64MB # min 64kB
#max_stack_depth = 2MB # min 100kB
#shared_memory_type = mmap # the default is the first option
# supported by the operating system:
# mmap
# sysv
# windows
# (change requires restart)
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# (change requires restart)
#min_dynamic_shared_memory = 0MB # (change requires restart)
# - Disk -
#temp_file_limit = -1 # limits per-process temp file space
# in kilobytes, or -1 for no limit
# - Kernel Resources -
#max_files_per_process = 1000 # min 64
# (change requires restart)
# - Cost-Based Vacuum Delay -
#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables)
#vacuum_cost_page_hit = 1 # 0-10000 credits
#vacuum_cost_page_miss = 2 # 0-10000 credits
#vacuum_cost_page_dirty = 20 # 0-10000 credits
#vacuum_cost_limit = 200 # 1-10000 credits
# - Background Writer -
#bgwriter_delay = 200ms # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round
#bgwriter_flush_after = 512kB # measured in pages, 0 disables
# - Asynchronous Behavior -
#backend_flush_after = 0 # measured in pages, 0 disables
effective_io_concurrency = 1000 # 1-1000; 0 disables prefetching
#maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching
#max_worker_processes = 8 # (change requires restart)
#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
#max_parallel_workers = 8 # maximum number of max_worker_processes that
# can be used in parallel operations
#parallel_leader_participation = on
#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate
# (change requires restart)
#------------------------------------------------------------------------------
# WRITE-AHEAD LOG
#------------------------------------------------------------------------------
# - Settings -
wal_level = minimal # minimal, replica, or logical
# (change requires restart)
fsync = off # flush data to disk for crash safety
# (turning this off can cause
# unrecoverable data corruption)
synchronous_commit = off # synchronization level;
# off, local, remote_write, remote_apply, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync (default on Linux and FreeBSD)
# fsync
# fsync_writethrough
# open_sync
full_page_writes = off # recover from partial page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#wal_compression = off # enable compression of full-page writes
#wal_init_zero = on # zero-fill new WAL files
#wal_recycle = on # recycle WAL files
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds
#wal_writer_flush_after = 1MB # measured in pages, 0 disables
#wal_skip_threshold = 2MB
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
# - Checkpoints -
#checkpoint_timeout = 5min # range 30s-1d
#checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0
#checkpoint_flush_after = 256kB # measured in pages, 0 disables
#checkpoint_warning = 30s # 0 disables
max_wal_size = 1GB
min_wal_size = 80MB
# - Archiving -
#archive_mode = off # enables archiving; off, on, or always
# (change requires restart)
#archive_command = '' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables
# - Archive Recovery -
# These are only used in recovery mode.
#restore_command = '' # command to use to restore an archived logfile segment
# placeholders: %p = path of file to restore
# %f = file name only
# e.g. 'cp /mnt/server/archivedir/%f %p'
#archive_cleanup_command = '' # command to execute at every restartpoint
#recovery_end_command = '' # command to execute at completion of recovery
# - Recovery Target -
# Set these only when performing a targeted recovery.
#recovery_target = '' # 'immediate' to end recovery as soon as a
# consistent state is reached
# (change requires restart)
#recovery_target_name = '' # the named restore point to which recovery will proceed
# (change requires restart)
#recovery_target_time = '' # the time stamp up to which recovery will proceed
# (change requires restart)
#recovery_target_xid = '' # the transaction ID up to which recovery will proceed
# (change requires restart)
#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed
# (change requires restart)
#recovery_target_inclusive = on # Specifies whether to stop:
# just after the specified recovery target (on)
# just before the recovery target (off)
# (change requires restart)
#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID
# (change requires restart)
#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown'
# (change requires restart)
#------------------------------------------------------------------------------
# REPLICATION
#------------------------------------------------------------------------------
# - Sending Servers -
# Set these on the primary and on any standby that will send replication data.
max_wal_senders = 0 # max number of walsender processes
# (change requires restart)
#max_replication_slots = 10 # max number of replication slots
# (change requires restart)
#wal_keep_size = 0 # in megabytes; 0 disables
#max_slot_wal_keep_size = -1 # in megabytes; -1 disables
#wal_sender_timeout = 60s # in milliseconds; 0 disables
#track_commit_timestamp = off # collect timestamp of transaction commit
# (change requires restart)
# - Primary Server -
# These settings are ignored on a standby server.
#synchronous_standby_names = '' # standby servers that provide sync rep
# method to choose sync standbys, number of sync standbys,
# and comma-separated list of application_name
# from standby(s); '*' = all
#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
# - Standby Servers -
# These settings are ignored on a primary server.
#primary_conninfo = '' # connection string to sending server
#primary_slot_name = '' # replication slot on sending server
#promote_trigger_file = '' # file name whose presence ends recovery
#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
# -1 allows indefinite delay
#max_standby_streaming_delay = 30s # max delay before canceling queries
# when reading streaming WAL;
# -1 allows indefinite delay
#wal_receiver_create_temp_slot = off # create temp slot if primary_slot_name
# is not set
#wal_receiver_status_interval = 10s # send replies at least this often
# 0 disables
#hot_standby_feedback = off # send info from standby to prevent
# query conflicts
#wal_receiver_timeout = 60s # time that receiver waits for
# communication from primary
# in milliseconds; 0 disables
#wal_retrieve_retry_interval = 5s # time to wait before retrying to
# retrieve WAL after a failed attempt
#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery
# - Subscribers -
# These settings are ignored on a publisher.
#max_logical_replication_workers = 4 # taken from max_worker_processes
# (change requires restart)
#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers
#------------------------------------------------------------------------------
# QUERY TUNING
#------------------------------------------------------------------------------
# - Planner Method Configuration -
#enable_async_append = on
#enable_bitmapscan = on
#enable_gathermerge = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_incremental_sort = on
#enable_indexscan = on
#enable_indexonlyscan = on
#enable_material = on
#enable_memoize = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_parallel_append = on
#enable_parallel_hash = on
#enable_partition_pruning = on
#enable_partitionwise_join = off
#enable_partitionwise_aggregate = off
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on
# - Planner Cost Constants -
#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
#parallel_setup_cost = 1000.0 # same scale as above
#parallel_tuple_cost = 0.1 # same scale as above
#min_parallel_table_scan_size = 8MB
#min_parallel_index_scan_size = 512kB
#effective_cache_size = 4GB
#jit_above_cost = 100000 # perform JIT compilation if available
# and query more expensive than this;
# -1 disables
#jit_inline_above_cost = 500000 # inline small functions if query is
# more expensive than this; -1 disables
#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if
# query is more expensive than this;
# -1 disables
# - Genetic Query Optimizer -
#geqo = on
#geqo_threshold = 12
#geqo_effort = 5 # range 1-10
#geqo_pool_size = 0 # selects default based on effort
#geqo_generations = 0 # selects default based on effort
#geqo_selection_bias = 2.0 # range 1.5-2.0
#geqo_seed = 0.0 # range 0.0-1.0
# - Other Planner Options -
#default_statistics_target = 100 # range 1-10000
#constraint_exclusion = partition # on, off, or partition
#cursor_tuple_fraction = 0.1 # range 0.0-1.0
#from_collapse_limit = 8
#jit = on # allow JIT compilation
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOIN clauses
#plan_cache_mode = auto # auto, force_generic_plan or
# force_custom_plan
#------------------------------------------------------------------------------
# REPORTING AND LOGGING
#------------------------------------------------------------------------------
# - Where to Log -
#log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
# This is used when logging to stderr:
#logging_collector = off # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)
# These are only used if logging_collector is on:
#log_directory = 'log' # directory where log files are written,
# can be absolute or relative to PGDATA
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
# can include strftime() escapes
#log_file_mode = 0600 # creation mode for log files,
# begin with 0 to use octal notation
#log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
#log_rotation_size = 10MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.
#log_truncate_on_rotation = off # If on, an existing log file with the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#syslog_sequence_numbers = on
#syslog_split_messages = on
# This is only relevant when logging to eventlog (Windows):
# (change requires restart)
#event_source = 'PostgreSQL'
# - When to Log -
#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
#log_min_duration_sample = -1 # -1 is disabled, 0 logs a sample of statements
# and their durations, > 0 logs only a sample of
# statements running at least this number
# of milliseconds;
# sample fraction is determined by log_statement_sample_rate
#log_statement_sample_rate = 1.0 # fraction of logged statements exceeding
# log_min_duration_sample to be logged;
# 1.0 logs all such statements, 0.0 never logs
#log_transaction_sample_rate = 0.0 # fraction of transactions whose statements
# are logged regardless of their duration; 1.0 logs all
# statements from all transactions, 0.0 never logs
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_autovacuum_min_duration = -1 # log autovacuum activity;
# -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = '%m [%p] %q%u@%d ' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %b = backend type
# %p = process ID
# %P = process ID of parallel group leader
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %n = timestamp with milliseconds (as a Unix epoch)
# %Q = query ID (0 if none or not computed)
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_recovery_conflict_waits = off # log standby recovery conflict waits
# >= deadlock_timeout
#log_parameter_max_length = -1 # when logging statements, limit logged
# bind-parameter values to N bytes;
# -1 means print in full, 0 disables
#log_parameter_max_length_on_error = 0 # when logging an error, limit logged
# bind-parameter values to N bytes;
# -1 means print in full, 0 disables
#log_statement = 'none' # none, ddl, mod, all
#log_replication_commands = off
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = 'Etc/UTC'
#------------------------------------------------------------------------------
# PROCESS TITLE
#------------------------------------------------------------------------------
cluster_name = '14/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
#------------------------------------------------------------------------------
# STATISTICS
#------------------------------------------------------------------------------
# - Query and Index Statistics Collector -
#track_activities = on
#track_activity_query_size = 1024 # (change requires restart)
#track_counts = on
#track_io_timing = off
#track_wal_io_timing = off
#track_functions = none # none, pl, all
stats_temp_directory = '/var/run/postgresql/14-main.pg_stat_tmp'
# - Monitoring -
#compute_query_id = auto
#log_statement_stats = off
#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#------------------------------------------------------------------------------
# AUTOVACUUM
#------------------------------------------------------------------------------
#autovacuum = on # Enable autovacuum subprocess? 'on'
# requires track_counts to also be on.
#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 50 # min number of row updates before
# vacuum
#autovacuum_vacuum_insert_threshold = 1000 # min number of row inserts
# before vacuum; -1 disables insert
# vacuums
#autovacuum_analyze_threshold = 50 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table
# size before insert vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
# before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------
# - Statement Behavior -
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
#search_path = '"$user", public' # schema names
#row_security = on
#default_table_access_method = 'heap'
#default_tablespace = '' # a tablespace name, '' uses the default
#default_toast_compression = 'pglz' # 'pglz' or 'lz4'
#temp_tablespaces = '' # a list of tablespace names, '' uses
# only default tablespace
#check_function_bodies = on
#default_transaction_isolation = 'read committed'
#default_transaction_read_only = off
#default_transaction_deferrable = off
#session_replication_role = 'origin'
#statement_timeout = 0 # in milliseconds, 0 is disabled
#lock_timeout = 0 # in milliseconds, 0 is disabled
#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled
#idle_session_timeout = 0 # in milliseconds, 0 is disabled
#vacuum_freeze_table_age = 150000000
#vacuum_freeze_min_age = 50000000
#vacuum_failsafe_age = 1600000000
#vacuum_multixact_freeze_table_age = 150000000
#vacuum_multixact_freeze_min_age = 5000000
#vacuum_multixact_failsafe_age = 1600000000
#bytea_output = 'hex' # hex, escape
#xmlbinary = 'base64'
#xmloption = 'content'
#gin_pending_list_limit = 4MB
# - Locale and Formatting -
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'Etc/UTC'
#timezone_abbreviations = 'Default' # Select the set of available time zone
# abbreviations. Currently, there are
# Default
# Australia (historical usage)
# India
# You can create your own file in
# share/timezonesets/.
#extra_float_digits = 1 # min -15, max 3; any value >0 actually
# selects precise output mode
#client_encoding = sql_ascii # actually, defaults to database
# encoding
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'C.UTF-8' # locale for system error message
# strings
lc_monetary = 'C.UTF-8' # locale for monetary formatting
lc_numeric = 'C.UTF-8' # locale for number formatting
lc_time = 'C.UTF-8' # locale for time formatting
# default configuration for text search
default_text_search_config = 'pg_catalog.english'
# - Shared Library Preloading -
#local_preload_libraries = ''
#session_preload_libraries = ''
#shared_preload_libraries = '' # (change requires restart)
#jit_provider = 'llvmjit' # JIT library to use
# - Other Defaults -
#dynamic_library_path = '$libdir'
#extension_destdir = '' # prepend path when loading extensions
# and shared objects (added by Debian)
#gin_fuzzy_search_limit = 0
#------------------------------------------------------------------------------
# LOCK MANAGEMENT
#------------------------------------------------------------------------------
#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
# (change requires restart)
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
#max_pred_locks_per_relation = -2 # negative values mean
# (max_pred_locks_per_transaction
# / -max_pred_locks_per_relation) - 1
#max_pred_locks_per_page = 2 # min 0
#------------------------------------------------------------------------------
# VERSION AND PLATFORM COMPATIBILITY
#------------------------------------------------------------------------------
# - Previous PostgreSQL Versions -
#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#escape_string_warning = on
#lo_compat_privileges = off
#quote_all_identifiers = off
#standard_conforming_strings = on
#synchronize_seqscans = on
# - Other Platforms and Clients -
#transform_null_equals = off
#------------------------------------------------------------------------------
# ERROR HANDLING
#------------------------------------------------------------------------------
#exit_on_error = off # terminate session on any error?
#restart_after_crash = on # reinitialize after backend crash?
#data_sync_retry = off # retry or panic on failure to fsync
# data?
# (change requires restart)
#recovery_init_sync_method = fsync # fsync, syncfs (Linux 5.8+)
#------------------------------------------------------------------------------
# CONFIG FILE INCLUDES
#------------------------------------------------------------------------------
# These options allow settings to be loaded from files other than the
# default postgresql.conf. Note that these are directives, not variable
# assignments, so they can usefully be given more than once.
include_dir = 'conf.d' # include files ending in '.conf' from
# a directory, e.g., 'conf.d'
#include_if_exists = '...' # include file only if it exists
#include = '...' # include file
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
# Add settings for extensions here

View File

@@ -32,11 +32,13 @@ impl std::fmt::Debug for AccountsDbPluginPostgres {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountsDbPluginPostgresConfig {
pub host: String,
pub user: String,
pub threads: Option<usize>,
pub host: Option<String>,
pub user: Option<String>,
pub port: Option<u16>,
pub connection_str: Option<String>,
pub threads: Option<usize>,
pub batch_size: Option<usize>,
pub panic_on_db_errors: Option<bool>,
}
#[derive(Error, Debug)]
@@ -46,6 +48,9 @@ pub enum AccountsDbPluginPostgresError {
#[error("Error preparing data store schema. Error message: ({msg})")]
DataSchemaError { msg: String },
#[error("Error preparing data store schema. Error message: ({msg})")]
ConfigurationError { msg: String },
}
impl AccountsDbPlugin for AccountsDbPluginPostgres {
@@ -54,10 +59,9 @@ impl AccountsDbPlugin for AccountsDbPluginPostgres {
}
/// Do initialization for the PostgreSQL plugin.
/// # Arguments
///
/// Format of the config file:
/// The `accounts_selector` section allows the user to controls accounts selections.
/// # Format of the config file:
/// * The `accounts_selector` section allows the user to controls accounts selections.
/// "accounts_selector" : {
/// "accounts" : \["pubkey-1", "pubkey-2", ..., "pubkey-n"\],
/// }
@@ -72,13 +76,21 @@ impl AccountsDbPlugin for AccountsDbPluginPostgres {
/// "accounts_selector" : {
/// "accounts" : \["*"\],
/// }
/// "host" specifies the PostgreSQL server.
/// "user" specifies the PostgreSQL user.
/// "threads" optional, specifies the number of worker threads for the plugin. A thread
/// maintains a PostgreSQL connection to the server. The default is 10.
/// "batch_size" optional, specifies the batch size of bulk insert when the AccountsDb is created
/// from restoring a snapshot. The default is "10".
/// * "host", optional, specifies the PostgreSQL server.
/// * "user", optional, specifies the PostgreSQL user.
/// * "port", optional, specifies the PostgreSQL server's port.
/// * "connection_str", optional, the custom PostgreSQL connection string.
/// Please refer to https://docs.rs/postgres/0.19.2/postgres/config/struct.Config.html for the connection configuration.
/// When `connection_str` is set, the values in "host", "user" and "port" are ignored. If `connection_str` is not given,
/// `host` and `user` must be given.
/// * "threads" optional, specifies the number of worker threads for the plugin. A thread
/// maintains a PostgreSQL connection to the server. The default is '10'.
/// * "batch_size" optional, specifies the batch size of bulk insert when the AccountsDb is created
/// from restoring a snapshot. The default is '10'.
/// * "panic_on_db_errors", optional, contols if to panic when there are errors replicating data to the
/// PostgreSQL database. The default is 'false'.
/// # Examples
///
/// {
/// "libpath": "/home/solana/target/release/libsolana_accountsdb_plugin_postgres.so",
/// "host": "host_foo",
@@ -86,6 +98,7 @@ impl AccountsDbPlugin for AccountsDbPluginPostgres {
/// "threads": 10,
/// "accounts_selector" : {
/// "owners" : ["9oT9R5ZyRovSVnt37QvVoBttGpNqR3J7unkb567NP8k3"]
/// }
/// }
fn on_load(&mut self, config_file: &str) -> Result<()> {

View File

@@ -33,11 +33,14 @@ const DEFAULT_POSTGRES_PORT: u16 = 5432;
const DEFAULT_THREADS_COUNT: usize = 100;
const DEFAULT_ACCOUNTS_INSERT_BATCH_SIZE: usize = 10;
const ACCOUNT_COLUMN_COUNT: usize = 9;
const DEFAULT_PANIC_ON_DB_ERROR: bool = false;
struct PostgresSqlClientWrapper {
client: Client,
update_account_stmt: Statement,
bulk_account_insert_stmt: Statement,
update_slot_with_parent_stmt: Statement,
update_slot_without_parent_stmt: Statement,
}
pub struct SimplePostgresClient {
@@ -66,6 +69,19 @@ pub struct DbAccountInfo {
pub write_version: i64,
}
pub(crate) fn abort() -> ! {
#[cfg(not(test))]
{
// standard error is usually redirected to a log file, cry for help on standard output as
// well
eprintln!("Validator process aborted. The validator log may contain further details");
std::process::exit(1);
}
#[cfg(test)]
panic!("process::exit(1) is intercepted for friendly test failure...");
}
impl DbAccountInfo {
fn new<T: ReadableAccountInfo>(account: &T, slot: u64) -> DbAccountInfo {
let data = account.data().to_vec();
@@ -179,13 +195,32 @@ impl SimplePostgresClient {
) -> Result<Client, AccountsDbPluginError> {
let port = config.port.unwrap_or(DEFAULT_POSTGRES_PORT);
let connection_str = format!("host={} user={} port={}", config.host, config.user, port);
let connection_str = if let Some(connection_str) = &config.connection_str {
connection_str.clone()
} else {
if config.host.is_none() || config.user.is_none() {
let msg = format!(
"\"connection_str\": {:?}, or \"host\": {:?} \"user\": {:?} must be specified",
config.connection_str, config.host, config.user
);
return Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::ConfigurationError { msg },
)));
}
format!(
"host={} user={} port={}",
config.host.as_ref().unwrap(),
config.user.as_ref().unwrap(),
port
)
};
match Client::connect(&connection_str, NoTls) {
Err(err) => {
let msg = format!(
"Error in connecting to the PostgreSQL database: {:?} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, connection_str);
"Error in connecting to the PostgreSQL database: {:?} connection_str: {:?}",
err, connection_str
);
error!("{}", msg);
Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::DataStoreConnectionError { msg },
@@ -238,7 +273,7 @@ impl SimplePostgresClient {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the accounts update PostgreSQL database: {} host: {} user: {} config: {:?}",
"Error in preparing for the accounts update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
@@ -263,7 +298,7 @@ impl SimplePostgresClient {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the accounts update PostgreSQL database: {} host: {} user: {} config: {:?}",
"Error in preparing for the accounts update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
@@ -272,6 +307,52 @@ impl SimplePostgresClient {
}
}
fn build_slot_upsert_statement_with_parent(
client: &mut Client,
config: &AccountsDbPluginPostgresConfig,
) -> Result<Statement, AccountsDbPluginError> {
let stmt = "INSERT INTO slot (slot, parent, status, updated_on) \
VALUES ($1, $2, $3, $4) \
ON CONFLICT (slot) DO UPDATE SET parent=excluded.parent, status=excluded.status, updated_on=excluded.updated_on";
let stmt = client.prepare(stmt);
match stmt {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the slot update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
}
Ok(stmt) => Ok(stmt),
}
}
fn build_slot_upsert_statement_without_parent(
client: &mut Client,
config: &AccountsDbPluginPostgresConfig,
) -> Result<Statement, AccountsDbPluginError> {
let stmt = "INSERT INTO slot (slot, status, updated_on) \
VALUES ($1, $2, $3) \
ON CONFLICT (slot) DO UPDATE SET status=excluded.status, updated_on=excluded.updated_on";
let stmt = client.prepare(stmt);
match stmt {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the slot update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
}
Ok(stmt) => Ok(stmt),
}
}
/// Internal function for updating or inserting a single account
fn upsert_account_internal(
account: &DbAccountInfo,
@@ -406,6 +487,11 @@ impl SimplePostgresClient {
Self::build_bulk_account_insert_statement(&mut client, config)?;
let update_account_stmt = Self::build_single_account_upsert_statement(&mut client, config)?;
let update_slot_with_parent_stmt =
Self::build_slot_upsert_statement_with_parent(&mut client, config)?;
let update_slot_without_parent_stmt =
Self::build_slot_upsert_statement_without_parent(&mut client, config)?;
let batch_size = config
.batch_size
.unwrap_or(DEFAULT_ACCOUNTS_INSERT_BATCH_SIZE);
@@ -417,6 +503,8 @@ impl SimplePostgresClient {
client,
update_account_stmt,
bulk_account_insert_stmt,
update_slot_with_parent_stmt,
update_slot_without_parent_stmt,
}),
})
}
@@ -455,32 +543,15 @@ impl PostgresClient for SimplePostgresClient {
let client = self.client.get_mut().unwrap();
let result = match parent {
Some(parent) => {
client.client.execute(
"INSERT INTO slot (slot, parent, status, updated_on) \
VALUES ($1, $2, $3, $4) \
ON CONFLICT (slot) DO UPDATE SET parent=$2, status=$3, updated_on=$4",
&[
&slot,
&parent,
&status_str,
&updated_on,
],
)
}
None => {
client.client.execute(
"INSERT INTO slot (slot, status, updated_on) \
VALUES ($1, $2, $3) \
ON CONFLICT (slot) DO UPDATE SET status=$2, updated_on=$3",
&[
&slot,
&status_str,
&updated_on,
],
)
}
};
Some(parent) => client.client.execute(
&client.update_slot_with_parent_stmt,
&[&slot, &parent, &status_str, &updated_on],
),
None => client.client.execute(
&client.update_slot_without_parent_stmt,
&[&slot, &status_str, &updated_on],
),
};
match result {
Err(err) => {
@@ -541,6 +612,7 @@ impl PostgresClientWorker {
exit_worker: Arc<AtomicBool>,
is_startup_done: Arc<AtomicBool>,
startup_done_count: Arc<AtomicUsize>,
panic_on_db_errors: bool,
) -> Result<(), AccountsDbPluginError> {
while !exit_worker.load(Ordering::Relaxed) {
let mut measure = Measure::start("accountsdb-plugin-postgres-worker-recv");
@@ -555,21 +627,38 @@ impl PostgresClientWorker {
match work {
Ok(work) => match work {
DbWorkItem::UpdateAccount(request) => {
self.client
.update_account(request.account, request.is_startup)?;
if let Err(err) = self
.client
.update_account(request.account, request.is_startup)
{
error!("Failed to update account: ({})", err);
if panic_on_db_errors {
abort();
}
}
}
DbWorkItem::UpdateSlot(request) => {
self.client.update_slot_status(
if let Err(err) = self.client.update_slot_status(
request.slot,
request.parent,
request.slot_status,
)?;
) {
error!("Failed to update slot: ({})", err);
if panic_on_db_errors {
abort();
}
}
}
},
Err(err) => match err {
RecvTimeoutError::Timeout => {
if !self.is_startup_done && is_startup_done.load(Ordering::Relaxed) {
self.client.notify_end_of_startup()?;
if let Err(err) = self.client.notify_end_of_startup() {
error!("Error in notifying end of startup: ({})", err);
if panic_on_db_errors {
abort();
}
}
self.is_startup_done = true;
startup_done_count.fetch_add(1, Ordering::Relaxed);
}
@@ -578,6 +667,9 @@ impl PostgresClientWorker {
}
_ => {
error!("Error in receiving the item {:?}", err);
if panic_on_db_errors {
abort();
}
break;
}
},
@@ -616,6 +708,10 @@ impl ParallelPostgresClient {
let worker = Builder::new()
.name(format!("worker-{}", i))
.spawn(move || -> Result<(), AccountsDbPluginError> {
let panic_on_db_errors = *config
.panic_on_db_errors
.as_ref()
.unwrap_or(&DEFAULT_PANIC_ON_DB_ERROR);
let result = PostgresClientWorker::new(config);
match result {
@@ -626,10 +722,17 @@ impl ParallelPostgresClient {
exit_clone,
is_startup_done_clone,
startup_done_count_clone,
panic_on_db_errors,
)?;
Ok(())
}
Err(err) => Err(err),
Err(err) => {
error!("Error when making connection to database: ({})", err);
if panic_on_db_errors {
abort();
}
Err(err)
}
}
})
.unwrap();

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-banking-bench"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,18 +14,18 @@ crossbeam-channel = "0.4"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.5.0"
solana-core = { path = "../core", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-poh = { path = "../poh", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
solana-poh = { path = "../poh", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-banks-client"
version = "1.8.2"
version = "1.8.4"
description = "Solana banks client"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -15,16 +15,16 @@ borsh = "0.9.0"
borsh-derive = "0.9.0"
futures = "0.3"
mio = "0.7.6"
solana-banks-interface = { path = "../banks-interface", version = "=1.8.2" }
solana-program = { path = "../sdk/program", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-banks-interface = { path = "../banks-interface", version = "=1.8.4" }
solana-program = { path = "../sdk/program", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
tarpc = { version = "0.24.1", features = ["full"] }
tokio = { version = "1", features = ["full"] }
tokio-serde = { version = "0.8", features = ["bincode"] }
[dev-dependencies]
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-banks-server = { path = "../banks-server", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-banks-server = { path = "../banks-server", version = "=1.8.4" }
[lib]
crate-type = ["lib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-banks-interface"
version = "1.8.2"
version = "1.8.4"
description = "Solana banks RPC interface"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
mio = "0.7.6"
serde = { version = "1.0.122", features = ["derive"] }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
tarpc = { version = "0.24.1", features = ["full"] }
[dev-dependencies]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-banks-server"
version = "1.8.2"
version = "1.8.4"
description = "Solana banks server"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -14,10 +14,10 @@ bincode = "1.3.1"
futures = "0.3"
log = "0.4.11"
mio = "0.7.6"
solana-banks-interface = { path = "../banks-interface", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-banks-interface = { path = "../banks-interface", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
tarpc = { version = "0.24.1", features = ["full"] }
tokio = { version = "1", features = ["full"] }
tokio-serde = { version = "0.8", features = ["bincode"] }

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-bench-exchange"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -18,23 +18,23 @@ rand = "0.7.0"
rayon = "1.5.0"
serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.2" }
solana-genesis = { path = "../genesis", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.2" }
solana-faucet = { path = "../faucet", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-genesis = { path = "../genesis", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.4" }
solana-faucet = { path = "../faucet", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "=1.8.2" }
solana-local-cluster = { path = "../local-cluster", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-bench-streamer"
version = "1.8.2"
version = "1.8.4"
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.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-bench-tps"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -15,24 +15,24 @@ log = "0.4.11"
rayon = "1.5.0"
serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.2" }
solana-genesis = { path = "../genesis", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-faucet = { path = "../faucet", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-genesis = { path = "../genesis", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-faucet = { path = "../faucet", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
[dev-dependencies]
serial_test = "0.4.0"
solana-local-cluster = { path = "../local-cluster", version = "=1.8.2" }
solana-local-cluster = { path = "../local-cluster", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-clap-utils"
version = "1.8.2"
version = "1.8.4"
description = "Solana utilities for the clap"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -12,8 +12,9 @@ edition = "2018"
[dependencies]
clap = "2.33.0"
rpassword = "4.0"
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.4" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
thiserror = "1.0.21"
tiny-bip39 = "0.8.1"
uriparse = "0.6.3"

View File

@@ -354,6 +354,27 @@ where
}
}
pub fn is_niceness_adjustment_valid<T>(value: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
let adjustment = value.as_ref().parse::<i8>().map_err(|err| {
format!(
"error parsing niceness adjustment value '{}': {}",
value, err
)
})?;
if solana_perf::thread::is_renice_allowed(adjustment) {
Ok(())
} else {
Err(String::from(
"niceness adjustment supported only on Linux; negative adjustment \
(priority increase) requires root or CAP_SYS_NICE (see `man 7 capabilities` \
for details)",
))
}
}
#[cfg(test)]
mod tests {
use super::*;
@@ -370,4 +391,11 @@ mod tests {
assert!(is_derivation("a/b").is_err());
assert!(is_derivation("0/4294967296").is_err());
}
#[test]
fn test_is_niceness_adjustment_valid() {
assert_eq!(is_niceness_adjustment_valid("0"), Ok(()));
assert!(is_niceness_adjustment_valid("128").is_err());
assert!(is_niceness_adjustment_valid("-129").is_err());
}
}

View File

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

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-cli-output"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -20,12 +20,12 @@ indicatif = "0.15.0"
serde = "1.0.122"
serde_derive = "1.0.103"
serde_json = "1.0.56"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-account-decoder = { path = "../account-decoder", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
spl-memo = { version = "=3.0.1", features = ["no-entrypoint"] }
[package.metadata.docs.rs]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-cli"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -30,30 +30,30 @@ semver = "1.0.4"
serde = "1.0.122"
serde_derive = "1.0.103"
serde_json = "1.0.56"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.2" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-cli-config = { path = "../cli-config", version = "=1.8.2" }
solana-cli-output = { path = "../cli-output", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-config-program = { path = "../programs/config", version = "=1.8.2" }
solana-faucet = { path = "../faucet", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-account-decoder = { path = "../account-decoder", version = "=1.8.4" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-cli-config = { path = "../cli-config", version = "=1.8.4" }
solana-cli-output = { path = "../cli-output", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-config-program = { path = "../programs/config", version = "=1.8.4" }
solana-faucet = { path = "../faucet", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana_rbpf = "=0.2.11"
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
spl-memo = { version = "=3.0.1", features = ["no-entrypoint"] }
thiserror = "1.0.21"
tiny-bip39 = "0.8.1"
url = "2.1.1"
[dev-dependencies]
solana-core = { path = "../core", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
tempfile = "3.1.0"
[[bin]]

View File

@@ -683,7 +683,15 @@ pub fn process_vote_authorize(
)
})?
.1;
check_current_authority(current_authorized_voter, &authorized.pubkey())?
check_current_authority(current_authorized_voter, &authorized.pubkey())?;
if let Some(signer) = new_authorized_signer {
if signer.is_interactive() {
return Err(CliError::BadParameter(format!(
"invalid new authorized vote signer {:?}. Interactive vote signers not supported",
new_authorized_pubkey
)).into());
}
}
}
VoteAuthorize::Withdrawer => {
check_current_authority(&vote_state.authorized_withdrawer, &authorized.pubkey())?

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-client"
version = "1.8.2"
version = "1.8.4"
description = "Solana Client"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -24,14 +24,14 @@ semver = "0.11.0"
serde = "1.0.122"
serde_derive = "1.0.103"
serde_json = "1.0.56"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-faucet = { path = "../faucet", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-account-decoder = { path = "../account-decoder", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-faucet = { path = "../faucet", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
thiserror = "1.0"
tokio = { version = "1", features = ["full"] }
tungstenite = "0.10.1"
@@ -40,7 +40,7 @@ url = "2.1.1"
[dev-dependencies]
assert_matches = "1.3.0"
jsonrpc-http-server = "18.0.0"
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,10 +1,12 @@
use {
crate::{
rpc_config::{
RpcSignatureSubscribeConfig, RpcTransactionLogsConfig, RpcTransactionLogsFilter,
RpcAccountInfoConfig, RpcProgramAccountsConfig, RpcSignatureSubscribeConfig,
RpcTransactionLogsConfig, RpcTransactionLogsFilter,
},
rpc_response::{
Response as RpcResponse, RpcLogsResponse, RpcSignatureResult, SlotInfo, SlotUpdate,
Response as RpcResponse, RpcKeyedAccount, RpcLogsResponse, RpcSignatureResult,
SlotInfo, SlotUpdate,
},
},
log::*,
@@ -14,12 +16,13 @@ use {
value::Value::{Number, Object},
Map, Value,
},
solana_sdk::signature::Signature,
solana_account_decoder::UiAccount,
solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature},
std::{
marker::PhantomData,
sync::{
atomic::{AtomicBool, Ordering},
mpsc::{channel, Receiver},
mpsc::{channel, Receiver, Sender},
Arc, RwLock,
},
thread::{sleep, JoinHandle},
@@ -153,16 +156,37 @@ where
}
}
pub type PubsubLogsClientSubscription = PubsubClientSubscription<RpcResponse<RpcLogsResponse>>;
pub type LogsSubscription = (
PubsubClientSubscription<RpcResponse<RpcLogsResponse>>,
PubsubLogsClientSubscription,
Receiver<RpcResponse<RpcLogsResponse>>,
);
pub type SlotsSubscription = (PubsubClientSubscription<SlotInfo>, Receiver<SlotInfo>);
pub type PubsubSlotClientSubscription = PubsubClientSubscription<SlotInfo>;
pub type SlotsSubscription = (PubsubSlotClientSubscription, Receiver<SlotInfo>);
pub type PubsubSignatureClientSubscription =
PubsubClientSubscription<RpcResponse<RpcSignatureResult>>;
pub type SignatureSubscription = (
PubsubClientSubscription<RpcResponse<RpcSignatureResult>>,
PubsubSignatureClientSubscription,
Receiver<RpcResponse<RpcSignatureResult>>,
);
pub type PubsubProgramClientSubscription = PubsubClientSubscription<RpcResponse<RpcKeyedAccount>>;
pub type ProgramSubscription = (
PubsubProgramClientSubscription,
Receiver<RpcResponse<RpcKeyedAccount>>,
);
pub type PubsubAccountClientSubscription = PubsubClientSubscription<RpcResponse<UiAccount>>;
pub type AccountSubscription = (
PubsubAccountClientSubscription,
Receiver<RpcResponse<UiAccount>>,
);
pub type PubsubRootClientSubscription = PubsubClientSubscription<Slot>;
pub type RootSubscription = (PubsubRootClientSubscription, Receiver<Slot>);
pub struct PubsubClient {}
fn connect_with_retry(url: Url) -> Result<WebSocket<AutoStream>, tungstenite::Error> {
@@ -188,6 +212,47 @@ fn connect_with_retry(url: Url) -> Result<WebSocket<AutoStream>, tungstenite::Er
}
impl PubsubClient {
pub fn account_subscribe(
url: &str,
pubkey: &Pubkey,
config: Option<RpcAccountInfoConfig>,
) -> Result<AccountSubscription, PubsubClientError> {
let url = Url::parse(url)?;
let socket = connect_with_retry(url)?;
let (sender, receiver) = channel();
let socket = Arc::new(RwLock::new(socket));
let socket_clone = socket.clone();
let exit = Arc::new(AtomicBool::new(false));
let exit_clone = exit.clone();
let body = json!({
"jsonrpc":"2.0",
"id":1,
"method":"accountSubscribe",
"params":[
pubkey.to_string(),
config
]
})
.to_string();
let subscription_id = PubsubAccountClientSubscription::send_subscribe(&socket_clone, body)?;
let t_cleanup = std::thread::spawn(move || {
Self::cleanup_with_sender(exit_clone, &socket_clone, sender)
});
let result = PubsubClientSubscription {
message_type: PhantomData,
operation: "account",
socket,
subscription_id,
t_cleanup: Some(t_cleanup),
exit,
};
Ok((result, receiver))
}
pub fn logs_subscribe(
url: &str,
filter: RpcTransactionLogsFilter,
@@ -201,38 +266,18 @@ impl PubsubClient {
let socket_clone = socket.clone();
let exit = Arc::new(AtomicBool::new(false));
let exit_clone = exit.clone();
let body = json!({
"jsonrpc":"2.0",
"id":1,
"method":"logsSubscribe",
"params":[filter, config]
})
.to_string();
let subscription_id =
PubsubClientSubscription::<RpcResponse<RpcLogsResponse>>::send_subscribe(
&socket_clone,
json!({
"jsonrpc":"2.0","id":1,"method":"logsSubscribe","params":[filter, config]
})
.to_string(),
)?;
let subscription_id = PubsubLogsClientSubscription::send_subscribe(&socket_clone, body)?;
let t_cleanup = std::thread::spawn(move || {
loop {
if exit_clone.load(Ordering::Relaxed) {
break;
}
match PubsubClientSubscription::read_message(&socket_clone) {
Ok(message) => match sender.send(message) {
Ok(_) => (),
Err(err) => {
info!("receive error: {:?}", err);
break;
}
},
Err(err) => {
info!("receive error: {:?}", err);
break;
}
}
}
info!("websocket - exited receive loop");
Self::cleanup_with_sender(exit_clone, &socket_clone, sender)
});
let result = PubsubClientSubscription {
@@ -247,49 +292,71 @@ impl PubsubClient {
Ok((result, receiver))
}
pub fn slot_subscribe(url: &str) -> Result<SlotsSubscription, PubsubClientError> {
pub fn program_subscribe(
url: &str,
pubkey: &Pubkey,
config: Option<RpcProgramAccountsConfig>,
) -> Result<ProgramSubscription, PubsubClientError> {
let url = Url::parse(url)?;
let socket = connect_with_retry(url)?;
let (sender, receiver) = channel::<SlotInfo>();
let (sender, receiver) = channel();
let socket = Arc::new(RwLock::new(socket));
let socket_clone = socket.clone();
let exit = Arc::new(AtomicBool::new(false));
let exit_clone = exit.clone();
let subscription_id = PubsubClientSubscription::<SlotInfo>::send_subscribe(
&socket_clone,
json!({
"jsonrpc":"2.0","id":1,"method":"slotSubscribe","params":[]
})
.to_string(),
)?;
let body = json!({
"jsonrpc":"2.0",
"id":1,
"method":"programSubscribe",
"params":[
pubkey.to_string(),
config
]
})
.to_string();
let subscription_id = PubsubProgramClientSubscription::send_subscribe(&socket_clone, body)?;
let t_cleanup = std::thread::spawn(move || {
loop {
if exit_clone.load(Ordering::Relaxed) {
break;
}
match PubsubClientSubscription::read_message(&socket_clone) {
Ok(message) => match sender.send(message) {
Ok(_) => (),
Err(err) => {
info!("receive error: {:?}", err);
break;
}
},
Err(err) => {
info!("receive error: {:?}", err);
break;
}
}
}
info!("websocket - exited receive loop");
Self::cleanup_with_sender(exit_clone, &socket_clone, sender)
});
let result = PubsubClientSubscription {
message_type: PhantomData,
operation: "slot",
operation: "program",
socket,
subscription_id,
t_cleanup: Some(t_cleanup),
exit,
};
Ok((result, receiver))
}
pub fn root_subscribe(url: &str) -> Result<RootSubscription, PubsubClientError> {
let url = Url::parse(url)?;
let socket = connect_with_retry(url)?;
let (sender, receiver) = channel();
let socket = Arc::new(RwLock::new(socket));
let socket_clone = socket.clone();
let exit = Arc::new(AtomicBool::new(false));
let exit_clone = exit.clone();
let body = json!({
"jsonrpc":"2.0",
"id":1,
"method":"rootSubscribe",
})
.to_string();
let subscription_id = PubsubRootClientSubscription::send_subscribe(&socket_clone, body)?;
let t_cleanup = std::thread::spawn(move || {
Self::cleanup_with_sender(exit_clone, &socket_clone, sender)
});
let result = PubsubClientSubscription {
message_type: PhantomData,
operation: "root",
socket,
subscription_id,
t_cleanup: Some(t_cleanup),
@@ -323,35 +390,10 @@ impl PubsubClient {
})
.to_string();
let subscription_id =
PubsubClientSubscription::<RpcResponse<RpcSignatureResult>>::send_subscribe(
&socket_clone,
body,
)?;
PubsubSignatureClientSubscription::send_subscribe(&socket_clone, body)?;
let t_cleanup = std::thread::spawn(move || {
loop {
if exit_clone.load(Ordering::Relaxed) {
break;
}
let message: Result<RpcResponse<RpcSignatureResult>, PubsubClientError> =
PubsubClientSubscription::read_message(&socket_clone);
if let Ok(msg) = message {
match sender.send(msg.clone()) {
Ok(_) => (),
Err(err) => {
info!("receive error: {:?}", err);
break;
}
}
} else {
info!("receive error: {:?}", message);
break;
}
}
info!("websocket - exited receive loop");
Self::cleanup_with_sender(exit_clone, &socket_clone, sender)
});
let result = PubsubClientSubscription {
@@ -366,6 +408,40 @@ impl PubsubClient {
Ok((result, receiver))
}
pub fn slot_subscribe(url: &str) -> Result<SlotsSubscription, PubsubClientError> {
let url = Url::parse(url)?;
let socket = connect_with_retry(url)?;
let (sender, receiver) = channel::<SlotInfo>();
let socket = Arc::new(RwLock::new(socket));
let socket_clone = socket.clone();
let exit = Arc::new(AtomicBool::new(false));
let exit_clone = exit.clone();
let body = json!({
"jsonrpc":"2.0",
"id":1,
"method":"slotSubscribe",
"params":[]
})
.to_string();
let subscription_id = PubsubSlotClientSubscription::send_subscribe(&socket_clone, body)?;
let t_cleanup = std::thread::spawn(move || {
Self::cleanup_with_sender(exit_clone, &socket_clone, sender)
});
let result = PubsubClientSubscription {
message_type: PhantomData,
operation: "slot",
socket,
subscription_id,
t_cleanup: Some(t_cleanup),
exit,
};
Ok((result, receiver))
}
pub fn slot_updates_subscribe(
url: &str,
handler: impl Fn(SlotUpdate) + Send + 'static,
@@ -374,35 +450,21 @@ impl PubsubClient {
let socket = connect_with_retry(url)?;
let socket = Arc::new(RwLock::new(socket));
let socket_clone = socket.clone();
let exit = Arc::new(AtomicBool::new(false));
let exit_clone = exit.clone();
let subscription_id = PubsubClientSubscription::<SlotUpdate>::send_subscribe(
&socket,
json!({
"jsonrpc":"2.0","id":1,"method":"slotsUpdatesSubscribe","params":[]
})
.to_string(),
)?;
let body = json!({
"jsonrpc":"2.0",
"id":1,
"method":"slotsUpdatesSubscribe",
"params":[]
})
.to_string();
let subscription_id = PubsubSlotClientSubscription::send_subscribe(&socket, body)?;
let t_cleanup = {
let socket = socket.clone();
std::thread::spawn(move || {
loop {
if exit_clone.load(Ordering::Relaxed) {
break;
}
match PubsubClientSubscription::read_message(&socket) {
Ok(message) => handler(message),
Err(err) => {
info!("receive error: {:?}", err);
break;
}
}
}
info!("websocket - exited receive loop");
})
};
let t_cleanup = std::thread::spawn(move || {
Self::cleanup_with_handler(exit_clone, &socket_clone, handler)
});
Ok(PubsubClientSubscription {
message_type: PhantomData,
@@ -413,6 +475,47 @@ impl PubsubClient {
exit,
})
}
fn cleanup_with_sender<T>(
exit: Arc<AtomicBool>,
socket: &Arc<RwLock<WebSocket<AutoStream>>>,
sender: Sender<T>,
) where
T: DeserializeOwned + Send + 'static,
{
let handler = move |message| match sender.send(message) {
Ok(_) => (),
Err(err) => {
info!("receive error: {:?}", err);
}
};
Self::cleanup_with_handler(exit, socket, handler);
}
fn cleanup_with_handler<T, F>(
exit: Arc<AtomicBool>,
socket: &Arc<RwLock<WebSocket<AutoStream>>>,
handler: F,
) where
T: DeserializeOwned,
F: Fn(T) + Send + 'static,
{
loop {
if exit.load(Ordering::Relaxed) {
break;
}
match PubsubClientSubscription::read_message(socket) {
Ok(message) => handler(message),
Err(err) => {
info!("receive error: {:?}", err);
break;
}
}
}
info!("websocket - exited receive loop");
}
}
#[cfg(test)]

View File

@@ -4029,22 +4029,19 @@ impl RpcClient {
/// # use solana_account_decoder::{UiDataSliceConfig, UiAccountEncoding};
/// # let rpc_client = RpcClient::new_mock("succeeds".to_string());
/// # let alice = Keypair::new();
/// # let base58_bytes = "\
/// # 1111111111111111111111111111111111111111111111111111111111111111\
/// # 1111111111111111111111111111111111111111111111111111111111111111";
/// # let base64_bytes = "\
/// # AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
/// # AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
/// # AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
/// let memcmp = RpcFilterType::Memcmp(Memcmp {
/// offset: 0,
/// bytes: MemcmpEncodedBytes::Binary(base58_bytes.to_string()),
/// bytes: MemcmpEncodedBytes::Base64(base64_bytes.to_string()),
/// encoding: None,
/// });
/// let config = RpcProgramAccountsConfig {
/// filters: Some(vec![
/// RpcFilterType::DataSize(128),
/// RpcFilterType::Memcmp(Memcmp {
/// offset: 0,
/// bytes: MemcmpEncodedBytes::Binary(base58_bytes.to_string()),
/// encoding: None,
/// }),
/// memcmp,
/// ]),
/// account_config: RpcAccountInfoConfig {
/// encoding: Some(UiAccountEncoding::Base64),

View File

@@ -77,13 +77,13 @@ pub enum RpcFilterError {
#[error("encoded binary data should be less than 129 bytes")]
DataTooLarge,
#[deprecated(
since = "1.9.0",
since = "1.8.1",
note = "Error for MemcmpEncodedBytes::Binary which is deprecated"
)]
#[error("encoded binary (base 58) data should be less than 129 bytes")]
Base58DataTooLarge,
#[deprecated(
since = "1.9.0",
since = "1.8.1",
note = "Error for MemcmpEncodedBytes::Binary which is deprecated"
)]
#[error("bs58 decode error")]
@@ -104,7 +104,7 @@ pub enum MemcmpEncoding {
#[serde(rename_all = "camelCase", untagged)]
pub enum MemcmpEncodedBytes {
#[deprecated(
since = "1.9.0",
since = "1.8.1",
note = "Please use MemcmpEncodedBytes::Base58 instead"
)]
Binary(String),

View File

@@ -279,6 +279,14 @@ pub struct RpcIdentity {
pub identity: String,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct RpcVote {
pub slots: Vec<Slot>,
pub hash: String,
pub timestamp: Option<UnixTimestamp>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct RpcVoteAccountStatus {

View File

@@ -1,7 +1,7 @@
[package]
name = "solana-core"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-core"
readme = "../README.md"
@@ -44,34 +44,34 @@ retain_mut = "0.1.2"
serde = "1.0.122"
serde_bytes = "0.11"
serde_derive = "1.0.103"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.2" }
solana-accountsdb-plugin-manager = { path = "../accountsdb-plugin-manager", version = "=1.8.2" }
solana-banks-server = { path = "../banks-server", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-poh = { path = "../poh", version = "=1.8.2" }
solana-program-test = { path = "../program-test", version = "=1.8.2" }
solana-rpc = { path = "../rpc", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.8.2" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-account-decoder = { path = "../account-decoder", version = "=1.8.4" }
solana-accountsdb-plugin-manager = { path = "../accountsdb-plugin-manager", version = "=1.8.4" }
solana-banks-server = { path = "../banks-server", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
solana-poh = { path = "../poh", version = "=1.8.4" }
solana-program-test = { path = "../program-test", version = "=1.8.4" }
solana-rpc = { path = "../rpc", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.8.4" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
spl-token-v2-0 = { package = "spl-token", version = "=3.2.0", features = ["no-entrypoint"] }
tempfile = "3.1.0"
thiserror = "1.0"
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.2" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.4" }
trees = "0.2.1"
[dev-dependencies]
@@ -84,8 +84,8 @@ num_cpus = "1.13.0"
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
serde_json = "1.0.56"
serial_test = "0.4.0"
solana-stake-program = { path = "../programs/stake", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
symlink = "0.1.0"
systemstat = "0.1.5"
tokio = { version = "1", features = ["full"] }

View File

@@ -1,4 +1,4 @@
// Service to verify accounts hashes with other trusted validator nodes.
// Service to verify accounts hashes with other known validator nodes.
//
// Each interval, publish the snapshat hash which is the full accounts state
// hash on gossip. Monitor gossip for messages from validators in the `--known-validator`s
@@ -33,8 +33,8 @@ impl AccountsHashVerifier {
pending_snapshot_package: Option<PendingSnapshotPackage>,
exit: &Arc<AtomicBool>,
cluster_info: &Arc<ClusterInfo>,
trusted_validators: Option<HashSet<Pubkey>>,
halt_on_trusted_validators_accounts_hash_mismatch: bool,
known_validators: Option<HashSet<Pubkey>>,
halt_on_known_validators_accounts_hash_mismatch: bool,
fault_injection_rate_slots: u64,
snapshot_interval_slots: u64,
) -> Self {
@@ -62,8 +62,8 @@ impl AccountsHashVerifier {
Self::process_accounts_package_pre(
accounts_package,
&cluster_info,
&trusted_validators,
halt_on_trusted_validators_accounts_hash_mismatch,
&known_validators,
halt_on_known_validators_accounts_hash_mismatch,
&pending_snapshot_package,
&mut hashes,
&exit,
@@ -87,8 +87,8 @@ impl AccountsHashVerifier {
fn process_accounts_package_pre(
accounts_package: AccountsPackagePre,
cluster_info: &ClusterInfo,
trusted_validators: &Option<HashSet<Pubkey>>,
halt_on_trusted_validator_accounts_hash_mismatch: bool,
known_validators: &Option<HashSet<Pubkey>>,
halt_on_known_validator_accounts_hash_mismatch: bool,
pending_snapshot_package: &Option<PendingSnapshotPackage>,
hashes: &mut Vec<(Slot, Hash)>,
exit: &Arc<AtomicBool>,
@@ -103,8 +103,8 @@ impl AccountsHashVerifier {
Self::process_accounts_package(
accounts_package,
cluster_info,
trusted_validators,
halt_on_trusted_validator_accounts_hash_mismatch,
known_validators,
halt_on_known_validator_accounts_hash_mismatch,
pending_snapshot_package,
hashes,
exit,
@@ -116,8 +116,8 @@ impl AccountsHashVerifier {
fn process_accounts_package(
accounts_package: AccountsPackage,
cluster_info: &ClusterInfo,
trusted_validators: &Option<HashSet<Pubkey>>,
halt_on_trusted_validator_accounts_hash_mismatch: bool,
known_validators: &Option<HashSet<Pubkey>>,
halt_on_known_validator_accounts_hash_mismatch: bool,
pending_snapshot_package: &Option<PendingSnapshotPackage>,
hashes: &mut Vec<(Slot, Hash)>,
exit: &Arc<AtomicBool>,
@@ -143,12 +143,12 @@ impl AccountsHashVerifier {
hashes.remove(0);
}
if halt_on_trusted_validator_accounts_hash_mismatch {
if halt_on_known_validator_accounts_hash_mismatch {
let mut slot_to_hash = HashMap::new();
for (slot, hash) in hashes.iter() {
slot_to_hash.insert(*slot, *hash);
}
if Self::should_halt(cluster_info, trusted_validators, &mut slot_to_hash) {
if Self::should_halt(cluster_info, known_validators, &mut slot_to_hash) {
exit.store(true, Ordering::Relaxed);
}
}
@@ -164,20 +164,20 @@ impl AccountsHashVerifier {
fn should_halt(
cluster_info: &ClusterInfo,
trusted_validators: &Option<HashSet<Pubkey>>,
known_validators: &Option<HashSet<Pubkey>>,
slot_to_hash: &mut HashMap<Slot, Hash>,
) -> bool {
let mut verified_count = 0;
let mut highest_slot = 0;
if let Some(trusted_validators) = trusted_validators.as_ref() {
for trusted_validator in trusted_validators {
let is_conflicting = cluster_info.get_accounts_hash_for_node(trusted_validator, |accounts_hashes|
if let Some(known_validators) = known_validators.as_ref() {
for known_validator in known_validators {
let is_conflicting = cluster_info.get_accounts_hash_for_node(known_validator, |accounts_hashes|
{
accounts_hashes.iter().any(|(slot, hash)| {
if let Some(reference_hash) = slot_to_hash.get(slot) {
if *hash != *reference_hash {
error!("Trusted validator {} produced conflicting hashes for slot: {} ({} != {})",
trusted_validator,
error!("Known validator {} produced conflicting hashes for slot: {} ({} != {})",
known_validator,
slot,
hash,
reference_hash,
@@ -241,11 +241,11 @@ mod tests {
let cluster_info = new_test_cluster_info(contact_info);
let cluster_info = Arc::new(cluster_info);
let mut trusted_validators = HashSet::new();
let mut known_validators = HashSet::new();
let mut slot_to_hash = HashMap::new();
assert!(!AccountsHashVerifier::should_halt(
&cluster_info,
&Some(trusted_validators.clone()),
&Some(known_validators.clone()),
&mut slot_to_hash,
));
@@ -258,10 +258,10 @@ mod tests {
cluster_info.flush_push_queue();
}
slot_to_hash.insert(0, hash2);
trusted_validators.insert(validator1.pubkey());
known_validators.insert(validator1.pubkey());
assert!(AccountsHashVerifier::should_halt(
&cluster_info,
&Some(trusted_validators),
&Some(known_validators),
&mut slot_to_hash,
));
}
@@ -277,7 +277,7 @@ mod tests {
let cluster_info = new_test_cluster_info(contact_info);
let cluster_info = Arc::new(cluster_info);
let trusted_validators = HashSet::new();
let known_validators = HashSet::new();
let exit = Arc::new(AtomicBool::new(false));
let mut hashes = vec![];
for i in 0..MAX_SNAPSHOT_HASHES + 1 {
@@ -297,7 +297,7 @@ mod tests {
AccountsHashVerifier::process_accounts_package(
accounts_package,
&cluster_info,
&Some(trusted_validators.clone()),
&Some(known_validators.clone()),
false,
&None,
&mut hashes,

View File

@@ -1157,7 +1157,11 @@ impl BankingStage {
let message_bytes = Self::packet_message(p)?;
let message_hash = Message::hash_raw_message(message_bytes);
Some((
HashedTransaction::new(Cow::Owned(tx), message_hash),
HashedTransaction::new(
Cow::Owned(tx),
message_hash,
Some(p.meta.is_simple_vote_tx),
),
tx_index,
))
})

View File

@@ -2406,11 +2406,20 @@ impl ReplayStage {
has_new_vote_been_rooted: &mut bool,
voted_signatures: &mut Vec<Signature>,
) {
bank_forks.write().unwrap().set_root(
let removed_banks = bank_forks.write().unwrap().set_root(
new_root,
accounts_background_request_sender,
highest_confirmed_root,
);
let mut dropped_banks_time = Measure::start("handle_new_root::drop_banks");
drop(removed_banks);
dropped_banks_time.stop();
if dropped_banks_time.as_ms() > 10 {
datapoint_info!(
"handle_new_root-dropped_banks",
("elapsed_ms", dropped_banks_time.as_ms(), i64)
);
}
let r_bank_forks = bank_forks.read().unwrap();
let new_root_bank = &r_bank_forks[new_root];
if !*has_new_vote_been_rooted {

View File

@@ -1046,23 +1046,23 @@ mod tests {
// 2) repair validator set only includes our own id
// then no repairs should be generated
for pubkey in &[solana_sdk::pubkey::new_rand(), me.id] {
let trusted_validators = Some(vec![*pubkey].into_iter().collect());
assert!(serve_repair.repair_peers(&trusted_validators, 1).is_empty());
let known_validators = Some(vec![*pubkey].into_iter().collect());
assert!(serve_repair.repair_peers(&known_validators, 1).is_empty());
assert!(serve_repair
.repair_request(
&cluster_slots,
RepairType::Shred(0, 0),
&mut LruCache::new(100),
&mut RepairStats::default(),
&trusted_validators,
&known_validators,
&mut OutstandingRepairs::default(),
)
.is_err());
}
// If trusted validator exists in gossip, should return repair successfully
let trusted_validators = Some(vec![contact_info2.id].into_iter().collect());
let repair_peers = serve_repair.repair_peers(&trusted_validators, 1);
// If known validator exists in gossip, should return repair successfully
let known_validators = Some(vec![contact_info2.id].into_iter().collect());
let repair_peers = serve_repair.repair_peers(&known_validators, 1);
assert_eq!(repair_peers.len(), 1);
assert_eq!(repair_peers[0].id, contact_info2.id);
assert!(serve_repair
@@ -1071,12 +1071,12 @@ mod tests {
RepairType::Shred(0, 0),
&mut LruCache::new(100),
&mut RepairStats::default(),
&trusted_validators,
&known_validators,
&mut OutstandingRepairs::default(),
)
.is_ok());
// Using no trusted validators should default to all
// Using no known validators should default to all
// validator's available in gossip, excluding myself
let repair_peers: HashSet<Pubkey> = serve_repair
.repair_peers(&None, 1)

View File

@@ -1,4 +1,5 @@
use solana_gossip::cluster_info::{ClusterInfo, MAX_SNAPSHOT_HASHES};
use solana_perf::thread::renice_this_thread;
use solana_runtime::{snapshot_package::AccountsPackage, snapshot_utils};
use solana_sdk::{clock::Slot, hash::Hash};
use std::{
@@ -23,6 +24,7 @@ impl SnapshotPackagerService {
exit: &Arc<AtomicBool>,
cluster_info: &Arc<ClusterInfo>,
maximum_snapshots_to_retain: usize,
niceness_adj: i8,
) -> Self {
let exit = exit.clone();
let cluster_info = cluster_info.clone();
@@ -30,6 +32,7 @@ impl SnapshotPackagerService {
let t_snapshot_packager = Builder::new()
.name("snapshot-packager".to_string())
.spawn(move || {
renice_this_thread(niceness_adj).unwrap();
let mut hashes = vec![];
if let Some(starting_snapshot_hash) = starting_snapshot_hash {
hashes.push(starting_snapshot_hash);

View File

@@ -513,6 +513,7 @@ impl TestValidator {
archive_format: ArchiveFormat::Tar,
snapshot_version: SnapshotVersion::default(),
maximum_snapshots_to_retain: DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
packager_thread_niceness_adj: 0,
}),
enforce_ulimit_nofile: false,
warp_slot: config.warp_slot,

View File

@@ -83,8 +83,8 @@ pub struct Sockets {
pub struct TvuConfig {
pub max_ledger_shreds: Option<u64>,
pub shred_version: u16,
pub halt_on_trusted_validators_accounts_hash_mismatch: bool,
pub trusted_validators: Option<HashSet<Pubkey>>,
pub halt_on_known_validators_accounts_hash_mismatch: bool,
pub known_validators: Option<HashSet<Pubkey>>,
pub repair_validators: Option<HashSet<Pubkey>>,
pub accounts_hash_fault_injection_slots: u64,
pub accounts_db_caching_enabled: bool,
@@ -217,8 +217,8 @@ impl Tvu {
pending_snapshot_package,
exit,
cluster_info,
tvu_config.trusted_validators.clone(),
tvu_config.halt_on_trusted_validators_accounts_hash_mismatch,
tvu_config.known_validators.clone(),
tvu_config.halt_on_known_validators_accounts_hash_mismatch,
tvu_config.accounts_hash_fault_injection_slots,
snapshot_interval_slots,
);

View File

@@ -120,10 +120,10 @@ pub struct ValidatorConfig {
pub fixed_leader_schedule: Option<FixedSchedule>,
pub wait_for_supermajority: Option<Slot>,
pub new_hard_forks: Option<Vec<Slot>>,
pub trusted_validators: Option<HashSet<Pubkey>>, // None = trust all
pub repair_validators: Option<HashSet<Pubkey>>, // None = repair from all
pub gossip_validators: Option<HashSet<Pubkey>>, // None = gossip with all
pub halt_on_trusted_validators_accounts_hash_mismatch: bool,
pub known_validators: Option<HashSet<Pubkey>>, // None = trust all
pub repair_validators: Option<HashSet<Pubkey>>, // None = repair from all
pub gossip_validators: Option<HashSet<Pubkey>>, // None = gossip with all
pub halt_on_known_validators_accounts_hash_mismatch: bool,
pub accounts_hash_fault_injection_slots: u64, // 0 = no fault injection
pub frozen_accounts: Vec<Pubkey>,
pub no_rocksdb_compaction: bool,
@@ -178,10 +178,10 @@ impl Default for ValidatorConfig {
fixed_leader_schedule: None,
wait_for_supermajority: None,
new_hard_forks: None,
trusted_validators: None,
known_validators: None,
repair_validators: None,
gossip_validators: None,
halt_on_trusted_validators_accounts_hash_mismatch: false,
halt_on_known_validators_accounts_hash_mismatch: false,
accounts_hash_fault_injection_slots: 0,
frozen_accounts: vec![],
no_rocksdb_compaction: false,
@@ -588,7 +588,7 @@ impl Validator {
genesis_config.hash(),
ledger_path,
config.validator_exit.clone(),
config.trusted_validators.clone(),
config.known_validators.clone(),
rpc_override_health_check.clone(),
optimistically_confirmed_bank.clone(),
config.send_transaction_service_config.clone(),
@@ -681,6 +681,7 @@ impl Validator {
&exit,
&cluster_info,
snapshot_config.maximum_snapshots_to_retain,
snapshot_config.packager_thread_niceness_adj,
);
(
Some(snapshot_packager_service),
@@ -789,10 +790,10 @@ impl Validator {
cluster_confirmed_slot_receiver,
TvuConfig {
max_ledger_shreds: config.max_ledger_shreds,
halt_on_trusted_validators_accounts_hash_mismatch: config
.halt_on_trusted_validators_accounts_hash_mismatch,
halt_on_known_validators_accounts_hash_mismatch: config
.halt_on_known_validators_accounts_hash_mismatch,
shred_version: node.info.shred_version,
trusted_validators: config.trusted_validators.clone(),
known_validators: config.known_validators.clone(),
repair_validators: config.repair_validators.clone(),
accounts_hash_fault_injection_slots: config.accounts_hash_fault_injection_slots,
accounts_db_caching_enabled: config.accounts_db_caching_enabled,

View File

@@ -1,4 +1,11 @@
use solana_client::{pubsub_client::PubsubClient, rpc_client::RpcClient, rpc_response::SlotInfo};
use serde_json::{json, Value};
use serial_test::serial;
use solana_client::{
pubsub_client::PubsubClient,
rpc_client::RpcClient,
rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
rpc_response::SlotInfo,
};
use solana_core::test_validator::TestValidator;
use solana_rpc::{
optimistically_confirmed_bank_tracker::OptimisticallyConfirmedBank,
@@ -8,18 +15,21 @@ use solana_rpc::{
use solana_runtime::{
bank::Bank,
bank_forks::BankForks,
commitment::BlockCommitmentCache,
commitment::{BlockCommitmentCache, CommitmentSlots},
genesis_utils::{create_genesis_config, GenesisConfigInfo},
};
use solana_sdk::{
clock::Slot,
commitment_config::CommitmentConfig,
native_token::sol_to_lamports,
pubkey::Pubkey,
rpc_port,
signature::{Keypair, Signer},
system_transaction,
system_program, system_transaction,
};
use solana_streamer::socket::SocketAddrSpace;
use std::{
collections::HashSet,
net::{IpAddr, SocketAddr},
sync::{
atomic::{AtomicBool, Ordering},
@@ -87,6 +97,246 @@ fn test_rpc_client() {
}
#[test]
#[serial]
fn test_account_subscription() {
let pubsub_addr = SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
rpc_port::DEFAULT_RPC_PUBSUB_PORT,
);
let exit = Arc::new(AtomicBool::new(false));
let GenesisConfigInfo {
genesis_config,
mint_keypair: alice,
..
} = create_genesis_config(10_000);
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank)));
let bank0 = bank_forks.read().unwrap().get(0).unwrap().clone();
let bank1 = Bank::new_from_parent(&bank0, &Pubkey::default(), 1);
bank_forks.write().unwrap().insert(bank1);
let bob = Keypair::new();
let subscriptions = Arc::new(RpcSubscriptions::new_for_tests(
&exit,
bank_forks.clone(),
Arc::new(RwLock::new(BlockCommitmentCache::default())),
OptimisticallyConfirmedBank::locked_from_bank_forks_root(&bank_forks),
));
let (trigger, pubsub_service) =
PubSubService::new(PubSubConfig::default(), &subscriptions, pubsub_addr);
std::thread::sleep(Duration::from_millis(400));
let config = Some(RpcAccountInfoConfig {
commitment: Some(CommitmentConfig::finalized()),
encoding: None,
data_slice: None,
});
let (mut client, receiver) = PubsubClient::account_subscribe(
&format!("ws://0.0.0.0:{}/", pubsub_addr.port()),
&bob.pubkey(),
config,
)
.unwrap();
// Transfer 100 lamports from alice to bob
let tx = system_transaction::transfer(&alice, &bob.pubkey(), 100, blockhash);
bank_forks
.write()
.unwrap()
.get(1)
.unwrap()
.process_transaction(&tx)
.unwrap();
let commitment_slots = CommitmentSlots {
slot: 1,
..CommitmentSlots::default()
};
subscriptions.notify_subscribers(commitment_slots);
let commitment_slots = CommitmentSlots {
slot: 2,
root: 1,
highest_confirmed_slot: 1,
highest_confirmed_root: 1,
};
subscriptions.notify_subscribers(commitment_slots);
let expected = json!({
"context": { "slot": 1 },
"value": {
"owner": system_program::id().to_string(),
"lamports": 100,
"data": "",
"executable": false,
"rentEpoch": 0,
},
});
// Read notification
let mut errors: Vec<(Value, Value)> = Vec::new();
let response = receiver.recv();
match response {
Ok(response) => {
let actual = serde_json::to_value(response).unwrap();
if expected != actual {
errors.push((expected, actual));
}
}
Err(_) => eprintln!("unexpected websocket receive timeout"),
}
exit.store(true, Ordering::Relaxed);
trigger.cancel();
client.shutdown().unwrap();
pubsub_service.close().unwrap();
assert_eq!(errors, [].to_vec());
}
#[test]
#[serial]
fn test_program_subscription() {
let pubsub_addr = SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
rpc_port::DEFAULT_RPC_PUBSUB_PORT,
);
let exit = Arc::new(AtomicBool::new(false));
let GenesisConfigInfo {
genesis_config,
mint_keypair: alice,
..
} = create_genesis_config(10_000);
let bank = Bank::new(&genesis_config);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank)));
let bank0 = bank_forks.read().unwrap().get(0).unwrap().clone();
let bank1 = Bank::new_from_parent(&bank0, &Pubkey::default(), 1);
bank_forks.write().unwrap().insert(bank1);
let bob = Keypair::new();
let subscriptions = Arc::new(RpcSubscriptions::new_for_tests(
&exit,
bank_forks.clone(),
Arc::new(RwLock::new(BlockCommitmentCache::default())),
OptimisticallyConfirmedBank::locked_from_bank_forks_root(&bank_forks),
));
let (trigger, pubsub_service) =
PubSubService::new(PubSubConfig::default(), &subscriptions, pubsub_addr);
std::thread::sleep(Duration::from_millis(400));
let config = Some(RpcProgramAccountsConfig {
..RpcProgramAccountsConfig::default()
});
let program_id = Pubkey::new_unique();
let (mut client, receiver) = PubsubClient::program_subscribe(
&format!("ws://0.0.0.0:{}/", pubsub_addr.port()),
&program_id,
config,
)
.unwrap();
// Create new program account at bob's address
let tx = system_transaction::create_account(&alice, &bob, blockhash, 100, 0, &program_id);
bank_forks
.write()
.unwrap()
.get(1)
.unwrap()
.process_transaction(&tx)
.unwrap();
let commitment_slots = CommitmentSlots {
slot: 1,
..CommitmentSlots::default()
};
subscriptions.notify_subscribers(commitment_slots);
let commitment_slots = CommitmentSlots {
slot: 2,
root: 1,
highest_confirmed_slot: 1,
highest_confirmed_root: 1,
};
subscriptions.notify_subscribers(commitment_slots);
// Poll notifications generated by the transfer
let mut notifications = Vec::new();
let mut pubkeys = HashSet::new();
loop {
let response = receiver.recv_timeout(Duration::from_millis(100));
match response {
Ok(response) => {
notifications.push(response.clone());
pubkeys.insert(response.value.pubkey);
}
Err(_) => {
break;
}
}
}
// Shutdown
exit.store(true, Ordering::Relaxed);
trigger.cancel();
client.shutdown().unwrap();
pubsub_service.close().unwrap();
assert_eq!(notifications.len(), 1);
assert!(pubkeys.contains(&bob.pubkey().to_string()));
}
#[test]
#[serial]
fn test_root_subscription() {
let pubsub_addr = SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
rpc_port::DEFAULT_RPC_PUBSUB_PORT,
);
let exit = Arc::new(AtomicBool::new(false));
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
let bank = Bank::new(&genesis_config);
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank)));
let bank0 = bank_forks.read().unwrap().get(0).unwrap().clone();
let bank1 = Bank::new_from_parent(&bank0, &Pubkey::default(), 1);
bank_forks.write().unwrap().insert(bank1);
let subscriptions = Arc::new(RpcSubscriptions::new_for_tests(
&exit,
bank_forks.clone(),
Arc::new(RwLock::new(BlockCommitmentCache::default())),
OptimisticallyConfirmedBank::locked_from_bank_forks_root(&bank_forks),
));
let (trigger, pubsub_service) =
PubSubService::new(PubSubConfig::default(), &subscriptions, pubsub_addr);
std::thread::sleep(Duration::from_millis(400));
let (mut client, receiver) =
PubsubClient::root_subscribe(&format!("ws://0.0.0.0:{}/", pubsub_addr.port())).unwrap();
let roots = vec![1, 2, 3];
subscriptions.notify_roots(roots.clone());
// Read notifications
let mut errors: Vec<(Slot, Slot)> = Vec::new();
for expected in roots {
let response = receiver.recv();
match response {
Ok(response) => {
if expected != response {
errors.push((expected, response));
}
}
Err(_) => eprintln!("unexpected websocket receive timeout"),
}
}
exit.store(true, Ordering::Relaxed);
trigger.cancel();
client.shutdown().unwrap();
pubsub_service.close().unwrap();
assert_eq!(errors, [].to_vec());
}
#[test]
#[serial]
fn test_slot_subscription() {
let pubsub_addr = SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),

View File

@@ -339,16 +339,19 @@ fn test_rpc_subscriptions() {
// Track mint balance to know when transactions have completed
let now = Instant::now();
let expected_mint_balance = mint_balance - transactions.len() as u64;
while mint_balance != expected_mint_balance && now.elapsed() < Duration::from_secs(5) {
while mint_balance != expected_mint_balance && now.elapsed() < Duration::from_secs(15) {
mint_balance = rpc_client
.get_balance_with_commitment(&alice.pubkey(), CommitmentConfig::processed())
.unwrap()
.value;
sleep(Duration::from_millis(100));
}
if mint_balance != expected_mint_balance {
error!("mint-check timeout. mint_balance {:?}", mint_balance);
}
// Wait for all signature subscriptions
let deadline = Instant::now() + Duration::from_secs(7);
let deadline = Instant::now() + Duration::from_secs(15);
while !signature_set.is_empty() {
let timeout = deadline.saturating_duration_since(Instant::now());
match status_receiver.recv_timeout(timeout) {

View File

@@ -122,6 +122,7 @@ mod tests {
archive_format: ArchiveFormat::TarBzip2,
snapshot_version,
maximum_snapshots_to_retain: DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
packager_thread_niceness_adj: 0,
};
bank_forks.set_snapshot_config(Some(snapshot_config.clone()));
SnapshotTestConfig {
@@ -459,6 +460,7 @@ mod tests {
&exit,
&cluster_info,
DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
0,
);
let thread_pool = accounts_db::make_min_priority_thread_pool();

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-crate-features"
version = "1.8.2"
version = "1.8.4"
description = "Solana Crate Features"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"

View File

@@ -3048,7 +3048,7 @@ curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
Result:
```json
{"jsonrpc":"2.0","result":{"solana-core": "1.8.2"},"id":1}
{"jsonrpc":"2.0","result":{"solana-core": "1.8.4"},"id":1}
```
### getVoteAccounts

View File

@@ -11,9 +11,13 @@ clients via a _program ID_. The program ID is an _address_ specified when
deploying and is used to reference the program in subsequent transactions.
Upon a successful deployment the account that holds the program is marked
executable and its account data become permanently immutable. If any changes
are required to the program (features, patches, etc...) the new program must be
deployed to a new program ID.
executable. If the program is marked "final", its account data become permanently
immutable. If any changes are required to the finalized program (features, patches,
etc...) the new program must be deployed to a new program ID.
If a program is upgradeable, the account that holds the program is marked
executable, but it is possible to redeploy a new shared object to the same
program ID, provided that the program's upgrade authority signs the transaction.
The Solana command line interface supports deploying programs, for more
information see the [`deploy`](cli/usage.md#deploy-program) command line usage

View File

@@ -47,9 +47,11 @@ instruction's [program id](transactions.md#program-id). Accounts are marked as
executable during a successful program deployment process by the loader that
owns the account. When a program is deployed to the execution engine (BPF deployment),
the loader determines that the bytecode in the account's data is valid.
If so, the loader
permanently marks the program account as executable. Once executable, the
runtime enforces that the account's data (the program) is immutable.
If so, the loader permanently marks the program account as executable.
If a program is marked as final (non-upgradeable), the runtime enforces that the
account's data (the program) is immutable. Through the upgradeable loader, it is
possible to upload a totally new program to an existing program address.
## Creating

View File

@@ -84,8 +84,10 @@ signers and writable accounts. For example, if the instruction the caller is
processing contains a signer or writable account, then the caller can invoke an
instruction that also contains that signer and/or writable account.
This privilege extension relies on the fact that programs are immutable. In the
case of the `acme` program, the runtime can safely treat the transaction's
This privilege extension relies on the fact that programs are immutable, except
during the special case of program upgrades.
In the case of the `acme` program, the runtime can safely treat the transaction's
signature as a signature of a `token` instruction. When the runtime sees the
`token` instruction references `alice_pubkey`, it looks up the key in the `acme`
instruction to see if that key corresponds to a signed account. In this case, it

View File

@@ -42,7 +42,7 @@ A leader can be scheduled to produce multiple blocks in a row. In that scenario
When the leader finishes the replay stage it can reset the balance cache by clearing it, and set a new fork as the base for the cache which can become active on the next block.
## Reseting the Balance Cache
## Resetting the Balance Cache
1. At the start of the block, if the balance cache is uninitialized, set the base fork for the balance cache to be the parent of the block and create an empty cache.
2. if the cache is initialized, check if block's parents has a new frozen bank that is newer than the current base fork for the balance cache.

View File

@@ -19,9 +19,9 @@ of the account.
- To change the [validator identity](#validator-identity), use
[vote-update-validator](../cli/usage.md#solana-vote-update-validator).
- To change the [vote authority](#vote-authority), use
[vote-authorize-voter](../cli/usage.md#solana-vote-authorize-voter).
[vote-authorize-voter-checked](../cli/usage.md#solana-vote-authorize-voter-checked).
- To change the [authorized withdrawer](#authorized-withdrawer), use
[vote-authorize-withdrawer](../cli/usage.md#solana-vote-authorize-withdrawer).
[vote-authorize-withdrawer-checked](../cli/usage.md#solana-vote-authorize-withdrawer-checked).
- To change the [commission](#commission), use
[vote-update-commission](../cli/usage.md#solana-vote-update-commission).
@@ -84,10 +84,10 @@ different accounts.
The vote authority can be set when the vote account is created. If it is not
provided, the default behavior is to assign it the same as the validator identity.
The vote authority can be changed later with the
[vote-authorize-voter](../cli/usage.md#solana-vote-authorize-voter) command.
[vote-authorize-voter-checked](../cli/usage.md#solana-vote-authorize-voter-checked) command.
The vote authority can be changed at most once per epoch. If the authority is
changed with [vote-authorize-voter](../cli/usage.md#solana-vote-authorize-voter),
changed with [vote-authorize-voter-checked](../cli/usage.md#solana-vote-authorize-voter-checked),
this will not take effect until the beginning of the next epoch.
To support a smooth transition of the vote signing,
`solana-validator` allows the `--authorized-voter` argument to be specified
@@ -117,7 +117,7 @@ not be set to a keypair that is the same as either the validator identity
keypair or the vote authority keypair.
The authorized withdrawer can be changed later with the
[vote-authorize-withdrawer](../cli/usage.md#solana-vote-authorize-withdrawer)
[vote-authorize-withdrawer-checked](../cli/usage.md#solana-vote-authorize-withdrawer-checked)
command.
### Commission

View File

@@ -52,13 +52,13 @@ Repair requests for recent shreds are served out of RAM or recent files and out
the ledger to find possible fork points.
- `last_index` - The index of the shred that is flagged as the last shred for this slot. This flag on a shred will be set by the leader for a slot when they are transmitting the last shred for a slot.
- `is_rooted` - True iff every block from 0...slot forms a full sequence without any holes. We can derive is_rooted for each slot with the following rules. Let slot\(n\) be the slot with index `n`, and slot\(n\).is_full\(\) is true if the slot with index `n` has all the ticks expected for that slot. Let is_rooted\(n\) be the statement that "the slot\(n\).is_rooted is true". Then:
- `is_connected` - True iff every block from 0...slot forms a full sequence without any holes. We can derive is_connected for each slot with the following rules. Let slot\(n\) be the slot with index `n`, and slot\(n\).is_full\(\) is true if the slot with index `n` has all the ticks expected for that slot. Let is_connected\(n\) be the statement that "the slot\(n\).is_connected is true". Then:
is_rooted\(0\) is_rooted\(n+1\) iff \(is_rooted\(n\) and slot\(n\).is_full\(\)
is_connected\(0\) is_connected\(n+1\) iff \(is_connected\(n\) and slot\(n\).is_full\(\)
3. Chaining - When a shred for a new slot `x` arrives, we check the number of blocks \(`num_blocks`\) for that new slot \(this information is encoded in the shred\). We then know that this new slot chains to slot `x - num_blocks`.
4. Subscriptions - The Blockstore records a set of slots that have been "subscribed" to. This means entries that chain to these slots will be sent on the Blockstore channel for consumption by the ReplayStage. See the `Blockstore APIs` for details.
5. Update notifications - The Blockstore notifies listeners when slot\(n\).is_rooted is flipped from false to true for any `n`.
5. Update notifications - The Blockstore notifies listeners when slot\(n\).is_connected is flipped from false to true for any `n`.
## Blockstore APIs

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-dos"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,18 +14,18 @@ clap = "2.33.1"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.5.0"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-download-utils"
version = "1.8.2"
version = "1.8.4"
description = "Solana Download Utils"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -15,8 +15,8 @@ console = "0.14.1"
indicatif = "0.15.0"
log = "0.4.11"
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
tar = "0.4.37"
[lib]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-faucet"
version = "1.8.2"
version = "1.8.4"
description = "Solana Faucet"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -16,12 +16,12 @@ clap = "2.33"
log = "0.4.11"
serde = "1.0.122"
serde_derive = "1.0.103"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-cli-config = { path = "../cli-config", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-cli-config = { path = "../cli-config", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
spl-memo = { version = "=3.0.1", features = ["no-entrypoint"] }
thiserror = "1.0"
tokio = { version = "1", features = ["full"] }

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-frozen-abi"
version = "1.8.2"
version = "1.8.4"
description = "Solana Frozen ABI"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -16,11 +16,11 @@ log = "0.4.11"
serde = "1.0.122"
serde_derive = "1.0.103"
sha2 = "0.9.2"
solana-frozen-abi-macro = { path = "macro", version = "=1.8.2" }
solana-frozen-abi-macro = { path = "macro", version = "=1.8.4" }
thiserror = "1.0"
[target.'cfg(not(target_arch = "bpf"))'.dependencies]
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
generic-array = { version = "0.14.3", default-features = false, features = ["serde", "more_lengths"]}
memmap2 = "0.1.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-frozen-abi-macro"
version = "1.8.2"
version = "1.8.4"
description = "Solana Frozen ABI Macro"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-genesis-utils"
version = "1.8.2"
version = "1.8.4"
description = "Solana Genesis Utils"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,9 +10,9 @@ documentation = "https://docs.rs/solana-download-utils"
edition = "2018"
[dependencies]
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-download-utils = { path = "../download-utils", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-download-utils = { path = "../download-utils", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
[lib]
crate-type = ["lib"]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-genesis"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -16,16 +16,16 @@ chrono = "0.4"
serde = "1.0.122"
serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-cli-config = { path = "../cli-config", version = "=1.8.2" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-cli-config = { path = "../cli-config", version = "=1.8.4" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
tempfile = "3.1.0"
[[bin]]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-gossip"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -26,22 +26,22 @@ rayon = "1.5.0"
serde = "1.0.122"
serde_bytes = "0.11"
serde_derive = "1.0.103"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.8.2" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-net-utils = { path = "../net-utils", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.8.4" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-net-utils = { path = "../net-utils", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
thiserror = "1.0"
[dev-dependencies]

View File

@@ -553,7 +553,7 @@ impl Crds {
&mut self,
cap: usize, // Capacity hint for number of unique pubkeys.
// Set of pubkeys to never drop.
// e.g. trusted validators, self pubkey, ...
// e.g. known validators, self pubkey, ...
keep: &[Pubkey],
stakes: &HashMap<Pubkey, u64>,
now: u64,

View File

@@ -629,7 +629,8 @@ pub(crate) mod tests {
crds_value::{CrdsData, Vote},
},
itertools::Itertools,
rand::{seq::SliceRandom, thread_rng},
rand::{seq::SliceRandom, thread_rng, SeedableRng},
rand_chacha::ChaChaRng,
rayon::ThreadPoolBuilder,
solana_perf::test_tx::test_tx,
solana_sdk::{
@@ -913,11 +914,14 @@ pub(crate) mod tests {
#[test]
fn test_build_crds_filter() {
let mut rng = thread_rng();
const SEED: [u8; 32] = [0x55; 32];
let mut rng = ChaChaRng::from_seed(SEED);
let thread_pool = ThreadPoolBuilder::new().build().unwrap();
let crds_gossip_pull = CrdsGossipPull::default();
let mut crds = Crds::default();
let keypairs: Vec<_> = repeat_with(Keypair::new).take(10_000).collect();
let keypairs: Vec<_> = repeat_with(|| Keypair::generate(&mut rng))
.take(10_000)
.collect();
let mut num_inserts = 0;
for _ in 0..40_000 {
let keypair = keypairs.choose(&mut rng).unwrap();
@@ -934,7 +938,13 @@ pub(crate) mod tests {
assert_eq!(filters.len(), MIN_NUM_BLOOM_FILTERS.max(32));
let purged: Vec<_> = thread_pool.install(|| crds.purged().collect());
let hash_values: Vec<_> = crds.values().map(|v| v.value_hash).chain(purged).collect();
assert_eq!(hash_values.len(), 40_000);
// CrdsValue::new_rand may generate exact same value twice in which
// case its hash-value is not added to purged values.
assert!(
hash_values.len() >= 40_000 - 5,
"hash_values.len(): {}",
hash_values.len()
);
let mut false_positives = 0;
for hash_value in hash_values {
let mut num_hits = 0;

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-install"
description = "The solana cluster software installer"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -25,12 +25,12 @@ reqwest = { version = "0.11.2", default-features = false, features = ["blocking"
serde = { version = "1.0.122", features = ["derive"] }
serde_json = "1.0.62"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-config-program = { path = "../programs/config", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-config-program = { path = "../programs/config", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
semver = "0.9.0"
tar = "0.4.37"
tempfile = "3.1.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-keygen"
version = "1.8.2"
version = "1.8.4"
description = "Solana key generation utility"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -14,11 +14,11 @@ bs58 = "0.3.1"
clap = "2.33"
dirs-next = "2.0.0"
num_cpus = "1.13.0"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-cli-config = { path = "../cli-config", version = "=1.8.2" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-cli-config = { path = "../cli-config", version = "=1.8.4" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
tiny-bip39 = "0.8.1"
[[bin]]

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-ledger-tool"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -24,19 +24,19 @@ regex = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-cli-output = { path = "../cli-output", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.2" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-cli-output = { path = "../cli-output", version = "=1.8.4" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.4" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
tempfile = "3.1.0"
tokio = { version = "1", features = ["full"] }

View File

@@ -696,6 +696,7 @@ fn load_bank_forks(
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: SnapshotVersion::default(),
maximum_snapshots_to_retain: DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
packager_thread_niceness_adj: 0,
})
};
let account_paths = if let Some(account_paths) = arg_matches.value_of("account_paths") {

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-ledger"
version = "1.8.2"
version = "1.8.4"
description = "Solana ledger"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -33,21 +33,21 @@ rayon = "1.5.0"
serde = "1.0.122"
serde_bytes = "0.11.5"
sha2 = "0.9.2"
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.8.2" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.8.2" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.8.2" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.8.2" }
solana-storage-proto = { path = "../storage-proto", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.8.4" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.8.4" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.8.4" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.8.4" }
solana-storage-proto = { path = "../storage-proto", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
tempfile = "3.1.0"
thiserror = "1.0"
tokio = { version = "1", features = ["full"] }
@@ -72,7 +72,7 @@ features = ["lz4"]
[dev-dependencies]
assert_matches = "1.3.0"
matches = "0.1.6"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.2" }
solana-account-decoder = { path = "../account-decoder", version = "=1.8.4" }
[build-dependencies]
rustc_version = "0.2"

View File

@@ -12,6 +12,12 @@ macro_rules! to_builtin {
/// Builtin programs that are always available
fn genesis_builtins(bpf_jit: bool) -> Vec<Builtin> {
// Currently JIT is not supported on the BPF VM:
// !x86_64: https://github.com/qmonnet/rbpf/issues/48
// Windows: https://github.com/solana-labs/rbpf/issues/217
#[cfg(any(not(target_arch = "x86_64"), target_family = "windows"))]
let bpf_jit = false;
vec![
to_builtin!(solana_bpf_loader_deprecated_program!()),
if bpf_jit {

View File

@@ -534,7 +534,11 @@ impl EntrySlice for [Entry] {
tx.message().hash()
};
Some(HashedTransaction::new(Cow::Borrowed(tx), message_hash))
Some(HashedTransaction::new(
Cow::Borrowed(tx),
message_hash,
None,
))
};
PAR_THREAD_POOL.with(|thread_pool| {

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-local-cluster"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -17,22 +17,22 @@ fs_extra = "1.2.0"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.5.0"
solana-config-program = { path = "../programs/config", version = "=1.8.2" }
solana-core = { path = "../core", version = "=1.8.2" }
solana-client = { path = "../client", version = "=1.8.2" }
solana-download-utils = { path = "../download-utils", version = "=1.8.2" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.2" }
solana-faucet = { path = "../faucet", version = "=1.8.2" }
solana-gossip = { path = "../gossip", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.2" }
solana-rpc = { path = "../rpc", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.2" }
solana-streamer = { path = "../streamer", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-config-program = { path = "../programs/config", version = "=1.8.4" }
solana-core = { path = "../core", version = "=1.8.4" }
solana-client = { path = "../client", version = "=1.8.4" }
solana-download-utils = { path = "../download-utils", version = "=1.8.4" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.4" }
solana-faucet = { path = "../faucet", version = "=1.8.4" }
solana-gossip = { path = "../gossip", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.4" }
solana-rpc = { path = "../rpc", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-stake-program = { path = "../programs/stake", version = "=1.8.4" }
solana-streamer = { path = "../streamer", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
tempfile = "3.1.0"
[dev-dependencies]

View File

@@ -23,11 +23,11 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
fixed_leader_schedule: config.fixed_leader_schedule.clone(),
wait_for_supermajority: config.wait_for_supermajority,
new_hard_forks: config.new_hard_forks.clone(),
trusted_validators: config.trusted_validators.clone(),
known_validators: config.known_validators.clone(),
repair_validators: config.repair_validators.clone(),
gossip_validators: config.gossip_validators.clone(),
halt_on_trusted_validators_accounts_hash_mismatch: config
.halt_on_trusted_validators_accounts_hash_mismatch,
halt_on_known_validators_accounts_hash_mismatch: config
.halt_on_known_validators_accounts_hash_mismatch,
accounts_hash_fault_injection_slots: config.accounts_hash_fault_injection_slots,
frozen_accounts: config.frozen_accounts.clone(),
no_rocksdb_compaction: config.no_rocksdb_compaction,

View File

@@ -1629,15 +1629,15 @@ fn test_consistency_halt() {
let mut validator_snapshot_test_config =
setup_snapshot_validator_config(snapshot_interval_slots, num_account_paths);
let mut trusted_validators = HashSet::new();
trusted_validators.insert(cluster_nodes[0].id);
let mut known_validators = HashSet::new();
known_validators.insert(cluster_nodes[0].id);
validator_snapshot_test_config
.validator_config
.trusted_validators = Some(trusted_validators);
.known_validators = Some(known_validators);
validator_snapshot_test_config
.validator_config
.halt_on_trusted_validators_accounts_hash_mismatch = true;
.halt_on_known_validators_accounts_hash_mismatch = true;
warn!("adding a validator");
cluster.add_validator(
@@ -1901,11 +1901,11 @@ fn test_snapshots_blockstore_floor() {
SocketAddrSpace::Unspecified,
)
.unwrap();
let mut trusted_validators = HashSet::new();
trusted_validators.insert(cluster_nodes[0].id);
let mut known_validators = HashSet::new();
known_validators.insert(cluster_nodes[0].id);
validator_snapshot_test_config
.validator_config
.trusted_validators = Some(trusted_validators);
.known_validators = Some(known_validators);
cluster.add_validator(
&validator_snapshot_test_config.validator_config,
@@ -3277,6 +3277,7 @@ fn setup_snapshot_validator_config(
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_snapshots_to_retain: snapshot_utils::DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
packager_thread_niceness_adj: 0,
};
// Create the account paths

View File

@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-log-analyzer"
description = "The solana cluster network analysis tool"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -14,9 +14,9 @@ byte-unit = "4.0.9"
clap = "2.33.1"
serde = "1.0.122"
serde_json = "1.0.56"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
[[bin]]
name = "solana-log-analyzer"

View File

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

View File

@@ -1,7 +1,7 @@
[package]
name = "solana-measure"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-measure"
readme = "../README.md"
@@ -12,8 +12,8 @@ edition = "2018"
[dependencies]
log = "0.4.11"
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-merkle-root-bench"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -10,11 +10,11 @@ publish = false
[dependencies]
log = "0.4.11"
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
clap = "2.33.1"
[package.metadata.docs.rs]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-merkle-tree"
version = "1.8.2"
version = "1.8.4"
description = "Solana Merkle Tree"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-merkle-tree"
edition = "2018"
[dependencies]
solana-program = { path = "../sdk/program", version = "=1.8.2" }
solana-program = { path = "../sdk/program", version = "=1.8.4" }
fast-math = "0.1"
# This can go once the BPF toolchain target Rust 1.42.0+

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-metrics"
version = "1.8.2"
version = "1.8.4"
description = "Solana Metrics"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -15,7 +15,7 @@ gethostname = "0.2.1"
lazy_static = "1.4.0"
log = "0.4.11"
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
[dev-dependencies]
rand = "0.7.0"

View File

@@ -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.8.2"
version = "1.8.4"
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.122"
serde_json = "1.0.56"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
rand = "0.7.0"
[[bin]]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-net-utils"
version = "1.8.2"
version = "1.8.4"
description = "Solana Network Utilities"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -18,10 +18,10 @@ rand = "0.7.0"
serde = "1.0.122"
serde_derive = "1.0.103"
socket2 = "0.3.17"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
tokio = { version = "1", features = ["full"] }
url = "2.1.1"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-notifier"
version = "1.8.2"
version = "1.8.4"
description = "Solana Notifier"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-perf"
version = "1.8.2"
version = "1.8.4"
description = "Solana Performance APIs"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -19,11 +19,16 @@ log = "0.4.11"
rand = "0.7.0"
rayon = "1.5.0"
serde = "1.0.126"
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
[target."cfg(target_os = \"linux\")".dependencies]
caps = "0.5.3"
libc = "0.2.81"
nix = "0.20.0"
[lib]
name = "solana_perf"

View File

@@ -6,6 +6,7 @@ pub mod recycler;
pub mod recycler_cache;
pub mod sigverify;
pub mod test_tx;
pub mod thread;
#[macro_use]
extern crate lazy_static;

105
perf/src/thread.rs Normal file
View File

@@ -0,0 +1,105 @@
/// Wrapper for `nice(3)`.
#[cfg(target_os = "linux")]
fn nice(adjustment: i8) -> Result<i8, nix::errno::Errno> {
use std::convert::TryFrom;
unsafe {
*libc::__errno_location() = 0;
let niceness = libc::nice(libc::c_int::from(adjustment));
let errno = *libc::__errno_location();
if (niceness == -1) && (errno != 0) {
Err(errno)
} else {
Ok(niceness)
}
}
.map(|niceness| i8::try_from(niceness).expect("Unexpected niceness value"))
.map_err(nix::errno::from_i32)
}
/// Adds `adjustment` to the nice value of calling thread. Negative `adjustment` increases priority,
/// positive `adjustment` decreases priority. New thread inherits nice value from current thread
/// when created.
///
/// Fails on non-Linux systems for all `adjustment` values except of zero.
#[cfg(target_os = "linux")]
pub fn renice_this_thread(adjustment: i8) -> Result<(), String> {
// On Linux, the nice value is a per-thread attribute. See `man 7 sched` for details.
// Other systems probably should use pthread_setschedprio(), but, on Linux, thread priority
// is fixed to zero for SCHED_OTHER threads (which is the default).
nice(adjustment)
.map(|_| ())
.map_err(|err| format!("Failed to change thread's nice value: {}", err))
}
/// Adds `adjustment` to the nice value of calling thread. Negative `adjustment` increases priority,
/// positive `adjustment` decreases priority. New thread inherits nice value from current thread
/// when created.
///
/// Fails on non-Linux systems for all `adjustment` values except of zero.
#[cfg(not(target_os = "linux"))]
pub fn renice_this_thread(adjustment: i8) -> Result<(), String> {
if adjustment == 0 {
Ok(())
} else {
Err(String::from(
"Failed to change thread's nice value: only supported on Linux",
))
}
}
/// Check whether the nice value can be changed by `adjustment`.
#[cfg(target_os = "linux")]
pub fn is_renice_allowed(adjustment: i8) -> bool {
use caps::{CapSet, Capability};
if adjustment >= 0 {
true
} else {
nix::unistd::geteuid().is_root()
|| caps::has_cap(None, CapSet::Effective, Capability::CAP_SYS_NICE)
.map_err(|err| warn!("Failed to get thread's capabilities: {}", err))
.unwrap_or(false)
}
}
/// Check whether the nice value can be changed by `adjustment`.
#[cfg(not(target_os = "linux"))]
pub fn is_renice_allowed(adjustment: i8) -> bool {
adjustment == 0
}
#[cfg(test)]
mod tests {
use super::*;
#[cfg(target_os = "linux")]
#[test]
fn test_nice() {
// No change / get current niceness
let niceness = nice(0).unwrap();
// Decrease priority (allowed for unprivileged processes)
let result = std::thread::spawn(|| nice(1)).join().unwrap();
assert_eq!(result, Ok(niceness + 1));
// Sanity check: ensure that current thread's nice value not changed after previous call
// from different thread
assert_eq!(nice(0), Ok(niceness));
// Sanity check: ensure that new thread inherits nice value from current thread
let inherited_niceness = std::thread::spawn(|| {
nice(1).unwrap();
std::thread::spawn(|| nice(0).unwrap()).join().unwrap()
})
.join()
.unwrap();
assert_eq!(inherited_niceness, niceness + 1);
if !is_renice_allowed(-1) {
// Increase priority (not allowed for unprivileged processes)
let result = std::thread::spawn(|| nice(-1)).join().unwrap();
assert!(result.is_err());
}
}
}

View File

@@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-poh-bench"
version = "1.8.2"
version = "1.8.4"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@@ -13,13 +13,13 @@ clap = "2.33.1"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.5.0"
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-version = { path = "../version", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-version = { path = "../version", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-poh"
version = "1.8.2"
version = "1.8.4"
description = "Solana PoH"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -13,20 +13,20 @@ edition = "2018"
core_affinity = "0.5.10"
crossbeam-channel = "0.4"
log = "0.4.11"
solana-ledger = { path = "../ledger", version = "=1.8.2" }
solana-measure = { path = "../measure", version = "=1.8.2" }
solana-metrics = { path = "../metrics", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-sys-tuner = { path = "../sys-tuner", version = "=1.8.2" }
solana-ledger = { path = "../ledger", version = "=1.8.4" }
solana-measure = { path = "../measure", version = "=1.8.4" }
solana-metrics = { path = "../metrics", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-sys-tuner = { path = "../sys-tuner", version = "=1.8.4" }
thiserror = "1.0"
[dev-dependencies]
bincode = "1.3.1"
matches = "0.1.6"
rand = "0.7.0"
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-perf = { path = "../perf", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-perf = { path = "../perf", version = "=1.8.4" }
[lib]
crate-type = ["lib"]

View File

@@ -5,7 +5,7 @@ edition = "2018"
license = "Apache-2.0"
name = "solana-program-test"
repository = "https://github.com/solana-labs/solana"
version = "1.8.2"
version = "1.8.4"
[dependencies]
async-trait = "0.1.42"
@@ -17,13 +17,13 @@ log = "0.4.11"
mio = "0.7.6"
serde = "1.0.112"
serde_derive = "1.0.103"
solana-banks-client = { path = "../banks-client", version = "=1.8.2" }
solana-banks-server = { path = "../banks-server", version = "=1.8.2" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.8.2" }
solana-logger = { path = "../logger", version = "=1.8.2" }
solana-runtime = { path = "../runtime", version = "=1.8.2" }
solana-sdk = { path = "../sdk", version = "=1.8.2" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.2" }
solana-banks-client = { path = "../banks-client", version = "=1.8.4" }
solana-banks-server = { path = "../banks-server", version = "=1.8.4" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.8.4" }
solana-logger = { path = "../logger", version = "=1.8.4" }
solana-runtime = { path = "../runtime", version = "=1.8.4" }
solana-sdk = { path = "../sdk", version = "=1.8.4" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.4" }
thiserror = "1.0"
tokio = { version = "1", features = ["full"] }

363
programs/bpf/Cargo.lock generated
View File

@@ -375,6 +375,17 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "caps"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c"
dependencies = [
"errno",
"libc",
"thiserror",
]
[[package]]
name = "cc"
version = "1.0.67"
@@ -742,6 +753,29 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "dlopen"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937"
dependencies = [
"dlopen_derive",
"lazy_static",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "dlopen_derive"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581"
dependencies = [
"libc",
"quote 0.6.13",
"syn 0.15.44",
]
[[package]]
name = "dtoa"
version = "0.4.8"
@@ -854,6 +888,27 @@ dependencies = [
"termcolor",
]
[[package]]
name = "errno"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
dependencies = [
"errno-dragonfly",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "failure"
version = "0.1.8"
@@ -2468,9 +2523,9 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.122"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "974ef1bd2ad8a507599b336595454081ff68a9599b4890af7643c0c0ed73a62c"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
dependencies = [
"serde_derive",
]
@@ -2486,9 +2541,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.122"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dee1f300f838c8ac340ecb0112b3ac472464fa67e87292bdb3dfc9c49128e17"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.6",
@@ -2618,7 +2673,7 @@ dependencies = [
[[package]]
name = "solana-account-decoder"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"Inflector",
"base64 0.12.3",
@@ -2639,7 +2694,7 @@ dependencies = [
[[package]]
name = "solana-banks-client"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"borsh",
@@ -2647,7 +2702,7 @@ dependencies = [
"futures",
"mio",
"solana-banks-interface",
"solana-program 1.8.2",
"solana-program 1.8.4",
"solana-sdk",
"tarpc",
"tokio",
@@ -2656,7 +2711,7 @@ dependencies = [
[[package]]
name = "solana-banks-interface"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"mio",
"serde",
@@ -2666,7 +2721,7 @@ dependencies = [
[[package]]
name = "solana-banks-server"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"futures",
@@ -2684,7 +2739,7 @@ dependencies = [
[[package]]
name = "solana-bpf-loader-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"byteorder 1.3.4",
@@ -2704,7 +2759,7 @@ dependencies = [
[[package]]
name = "solana-bpf-programs"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"byteorder 1.3.4",
@@ -2716,7 +2771,7 @@ dependencies = [
"solana-account-decoder",
"solana-bpf-loader-program",
"solana-cli-output",
"solana-logger 1.8.2",
"solana-logger 1.8.4",
"solana-measure",
"solana-runtime",
"solana-sdk",
@@ -2727,299 +2782,300 @@ dependencies = [
[[package]]
name = "solana-bpf-rust-128bit"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-bpf-rust-128bit-dep",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-128bit-dep"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-alloc"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-call-depth"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-caller-access"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-custom-heap"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-dep-crate"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"byteorder 1.3.4",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-deprecated-loader"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-dup-accounts"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-error-handling"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"num-derive 0.2.5",
"num-traits",
"solana-program 1.8.2",
"solana-program 1.8.4",
"thiserror",
]
[[package]]
name = "solana-bpf-rust-external-spend"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-finalize"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-instruction-introspection"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-invoke"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-bpf-rust-invoked",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-invoke-and-error"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-invoke-and-ok"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-invoke-and-return"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-invoked"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-iter"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-log-data"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-many-args"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-bpf-rust-many-args-dep",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-many-args-dep"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-mem"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
"solana-program-test",
"solana-sdk",
]
[[package]]
name = "solana-bpf-rust-membuiltins"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-bpf-rust-mem",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-noop"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-panic"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-param-passing"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-bpf-rust-param-passing-dep",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-param-passing-dep"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-rand"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"getrandom 0.1.14",
"rand 0.7.3",
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-ro-account_modify"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-ro-modify"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-sanity"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-secp256k1-recover"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-sha"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-spoof1"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-spoof1-system"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-sysvar"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
"solana-program-test",
"solana-sdk",
]
[[package]]
name = "solana-bpf-rust-upgradeable"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-bpf-rust-upgraded"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-program 1.8.2",
"solana-program 1.8.4",
]
[[package]]
name = "solana-clap-utils"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"chrono",
"clap",
"rpassword",
"solana-perf",
"solana-remote-wallet",
"solana-sdk",
"thiserror",
@@ -3030,7 +3086,7 @@ dependencies = [
[[package]]
name = "solana-cli-config"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"dirs-next",
"lazy_static",
@@ -3042,7 +3098,7 @@ dependencies = [
[[package]]
name = "solana-cli-output"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"Inflector",
"base64 0.13.0",
@@ -3065,7 +3121,7 @@ dependencies = [
[[package]]
name = "solana-client"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"base64 0.13.0",
"bincode",
@@ -3097,14 +3153,14 @@ dependencies = [
[[package]]
name = "solana-compute-budget-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-sdk",
]
[[package]]
name = "solana-config-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"chrono",
@@ -3117,7 +3173,7 @@ dependencies = [
[[package]]
name = "solana-crate-features"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"backtrace",
"bytes 0.4.12",
@@ -3139,14 +3195,14 @@ dependencies = [
[[package]]
name = "solana-ed25519-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-sdk",
]
[[package]]
name = "solana-faucet"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"byteorder 1.3.4",
@@ -3156,7 +3212,7 @@ dependencies = [
"serde_derive",
"solana-clap-utils",
"solana-cli-config",
"solana-logger 1.8.2",
"solana-logger 1.8.4",
"solana-metrics",
"solana-sdk",
"solana-version",
@@ -3187,7 +3243,7 @@ dependencies = [
[[package]]
name = "solana-frozen-abi"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bs58 0.3.1",
"bv",
@@ -3198,8 +3254,8 @@ dependencies = [
"serde",
"serde_derive",
"sha2",
"solana-frozen-abi-macro 1.8.2",
"solana-logger 1.8.2",
"solana-frozen-abi-macro 1.8.4",
"solana-logger 1.8.4",
"thiserror",
]
@@ -3217,7 +3273,7 @@ dependencies = [
[[package]]
name = "solana-frozen-abi-macro"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.6",
@@ -3238,7 +3294,7 @@ dependencies = [
[[package]]
name = "solana-logger"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"env_logger",
"lazy_static",
@@ -3247,7 +3303,7 @@ dependencies = [
[[package]]
name = "solana-measure"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"log",
"solana-metrics",
@@ -3256,7 +3312,7 @@ dependencies = [
[[package]]
name = "solana-metrics"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"env_logger",
"gethostname",
@@ -3268,7 +3324,7 @@ dependencies = [
[[package]]
name = "solana-net-utils"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"clap",
@@ -3279,13 +3335,36 @@ dependencies = [
"serde_derive",
"socket2 0.3.17",
"solana-clap-utils",
"solana-logger 1.8.2",
"solana-logger 1.8.4",
"solana-sdk",
"solana-version",
"tokio",
"url",
]
[[package]]
name = "solana-perf"
version = "1.8.4"
dependencies = [
"bincode",
"caps",
"curve25519-dalek 2.1.0",
"dlopen",
"dlopen_derive",
"lazy_static",
"libc",
"log",
"nix",
"rand 0.7.3",
"rayon",
"serde",
"solana-logger 1.8.4",
"solana-metrics",
"solana-rayon-threadlimit",
"solana-sdk",
"solana-vote-program",
]
[[package]]
name = "solana-program"
version = "1.7.6"
@@ -3323,7 +3402,7 @@ dependencies = [
[[package]]
name = "solana-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"base64 0.13.0",
"bincode",
@@ -3349,16 +3428,16 @@ dependencies = [
"serde_derive",
"sha2",
"sha3",
"solana-frozen-abi 1.8.2",
"solana-frozen-abi-macro 1.8.2",
"solana-logger 1.8.2",
"solana-sdk-macro 1.8.2",
"solana-frozen-abi 1.8.4",
"solana-frozen-abi-macro 1.8.4",
"solana-logger 1.8.4",
"solana-sdk-macro 1.8.4",
"thiserror",
]
[[package]]
name = "solana-program-test"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"async-trait",
"base64 0.12.3",
@@ -3372,7 +3451,7 @@ dependencies = [
"solana-banks-client",
"solana-banks-server",
"solana-bpf-loader-program",
"solana-logger 1.8.2",
"solana-logger 1.8.4",
"solana-runtime",
"solana-sdk",
"solana-vote-program",
@@ -3382,7 +3461,7 @@ dependencies = [
[[package]]
name = "solana-rayon-threadlimit"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"lazy_static",
"num_cpus",
@@ -3390,7 +3469,7 @@ dependencies = [
[[package]]
name = "solana-remote-wallet"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"base32",
"console 0.14.1",
@@ -3409,7 +3488,7 @@ dependencies = [
[[package]]
name = "solana-runtime"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"arrayref",
"bincode",
@@ -3441,9 +3520,9 @@ dependencies = [
"solana-compute-budget-program",
"solana-config-program",
"solana-ed25519-program",
"solana-frozen-abi 1.8.2",
"solana-frozen-abi-macro 1.8.2",
"solana-logger 1.8.2",
"solana-frozen-abi 1.8.4",
"solana-frozen-abi-macro 1.8.4",
"solana-logger 1.8.4",
"solana-measure",
"solana-metrics",
"solana-rayon-threadlimit",
@@ -3460,7 +3539,7 @@ dependencies = [
[[package]]
name = "solana-sdk"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"assert_matches",
"base64 0.13.0",
@@ -3500,11 +3579,11 @@ dependencies = [
"sha2",
"sha3",
"solana-crate-features",
"solana-frozen-abi 1.8.2",
"solana-frozen-abi-macro 1.8.2",
"solana-logger 1.8.2",
"solana-program 1.8.2",
"solana-sdk-macro 1.8.2",
"solana-frozen-abi 1.8.4",
"solana-frozen-abi-macro 1.8.4",
"solana-logger 1.8.4",
"solana-program 1.8.4",
"solana-sdk-macro 1.8.4",
"thiserror",
"uriparse",
]
@@ -3524,7 +3603,7 @@ dependencies = [
[[package]]
name = "solana-sdk-macro"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bs58 0.3.1",
"proc-macro2 1.0.24",
@@ -3535,14 +3614,14 @@ dependencies = [
[[package]]
name = "solana-secp256k1-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"solana-sdk",
]
[[package]]
name = "solana-stake-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"log",
@@ -3552,8 +3631,8 @@ dependencies = [
"serde",
"serde_derive",
"solana-config-program",
"solana-frozen-abi 1.8.2",
"solana-frozen-abi-macro 1.8.2",
"solana-frozen-abi 1.8.4",
"solana-frozen-abi-macro 1.8.4",
"solana-metrics",
"solana-sdk",
"solana-vote-program",
@@ -3562,7 +3641,7 @@ dependencies = [
[[package]]
name = "solana-transaction-status"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"Inflector",
"base64 0.12.3",
@@ -3587,21 +3666,21 @@ dependencies = [
[[package]]
name = "solana-version"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"log",
"rustc_version",
"serde",
"serde_derive",
"solana-frozen-abi 1.8.2",
"solana-frozen-abi-macro 1.8.2",
"solana-logger 1.8.2",
"solana-frozen-abi 1.8.4",
"solana-frozen-abi-macro 1.8.4",
"solana-logger 1.8.4",
"solana-sdk",
]
[[package]]
name = "solana-vote-program"
version = "1.8.2"
version = "1.8.4"
dependencies = [
"bincode",
"log",
@@ -3610,9 +3689,9 @@ dependencies = [
"rustc_version",
"serde",
"serde_derive",
"solana-frozen-abi 1.8.2",
"solana-frozen-abi-macro 1.8.2",
"solana-logger 1.8.2",
"solana-frozen-abi 1.8.4",
"solana-frozen-abi-macro 1.8.4",
"solana-logger 1.8.4",
"solana-metrics",
"solana-sdk",
"thiserror",

View File

@@ -1,7 +1,7 @@
[package]
name = "solana-bpf-programs"
description = "Blockchain, Rebuilt for Scale"
version = "1.8.2"
version = "1.8.4"
documentation = "https://docs.rs/solana"
homepage = "https://solana.com/"
readme = "README.md"
@@ -26,15 +26,15 @@ itertools = "0.10.0"
log = "0.4.11"
miow = "0.2.2"
net2 = "0.2.37"
solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.8.2" }
solana-cli-output = { path = "../../cli-output", version = "=1.8.2" }
solana-logger = { path = "../../logger", version = "=1.8.2" }
solana-measure = { path = "../../measure", version = "=1.8.2" }
solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.8.4" }
solana-cli-output = { path = "../../cli-output", version = "=1.8.4" }
solana-logger = { path = "../../logger", version = "=1.8.4" }
solana-measure = { path = "../../measure", version = "=1.8.4" }
solana_rbpf = "=0.2.11"
solana-runtime = { path = "../../runtime", version = "=1.8.2" }
solana-sdk = { path = "../../sdk", version = "=1.8.2" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.8.2" }
solana-account-decoder = { path = "../../account-decoder", version = "=1.8.2" }
solana-runtime = { path = "../../runtime", version = "=1.8.4" }
solana-sdk = { path = "../../sdk", version = "=1.8.4" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.8.4" }
solana-account-decoder = { path = "../../account-decoder", version = "=1.8.4" }
[[bench]]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-128bit"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,8 +10,8 @@ documentation = "https://docs.rs/solana-bpf-rust-128bit"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-128bit-dep"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-128bit-dep"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-alloc"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-alloc"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-call-depth"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-call-depth"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-caller-access"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-caller-access"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-custom-heap"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-custom-heap"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[features]
default = ["custom-heap"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-dep-crate"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
byteorder = { version = "1", default-features = false }
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-deprecated-loader"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-deprecated-loader"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-dup-accounts"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-dup-accounts"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-error-handling"
version = "1.8.2"
version = "1.8.4"
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 @@ edition = "2018"
[dependencies]
num-derive = "0.2"
num-traits = "0.2"
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
thiserror = "1.0"
[lib]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-external-spend"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-external-spend"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-finalize"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-finalize"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-instruction-introspection"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/solana-bpf-rust-instruction-introspection"
edition = "2018"
[dependencies]
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

View File

@@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-invoke"
version = "1.8.2"
version = "1.8.4"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
solana-bpf-rust-invoked = { path = "../invoked", default-features = false }
solana-program = { path = "../../../../sdk/program", version = "=1.8.2" }
solana-program = { path = "../../../../sdk/program", version = "=1.8.4" }
[lib]
crate-type = ["cdylib"]

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