Compare commits

...

57 Commits

Author SHA1 Message Date
e9bef42502 Bump version to v1.7.18 (#21011) 2021-10-26 23:02:09 -06:00
35ab022dbe Restore getProgramAccounts spl-token secondary-index functionality (backport #20993) (#21004)
* Restore getProgramAccounts spl-token secondary-index functionality (#20993)

* Allow get_spl_token_X_filters to match on any encoding, and optimize earlier

* Remove redundant optimize calls

* Compress match statements

* Add method docs, including note to use optimize_filters before spl-token checks

* Add logs

(cherry picked from commit b2f6cfb9ff)

# Conflicts:
#	rpc/src/rpc.rs

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-27 00:29:51 +00:00
e6bd6dd260 Swap banking stage vote channels (#20987) (#20999)
(cherry picked from commit 261dd96ae3)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-26 23:14:22 +00:00
b216e3c9f7 Add CrdsData::IncrementalSnapshotHashes (backport #20374) (#20983)
* Add CrdsData::IncrementalSnapshotHashes (#20374)

(cherry picked from commit 4e3818e5c1)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: Brooks Prumo <brooks@solana.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-26 17:24:39 +00:00
5f86735382 Add check for shred data header size (#20668) (#20680)
(cherry picked from commit 588168b99d)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-25 01:23:11 +00:00
ea61142c3e Use config limit instead of default (#20900) (#20906)
(cherry picked from commit 9dd87bcdb5)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-23 20:17:10 +00:00
b4735893bd CLI: Add SW versions to feature status output (backport #20878) (#20904)
* cli: struct the tuples

(cherry picked from commit b9eb6242f5)

* cli: add software version(s) to feature status

(cherry picked from commit 152da44b62)

# Conflicts:
#	cli/Cargo.toml

* cli: sort feature status output

(cherry picked from commit 30d277b9fd)

* cli: improve feature status arithmatic readability

(cherry picked from commit d98c8b861c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-23 18:58:17 +00:00
e3e1396c1d Bump version to v1.7.17 (#20896) 2021-10-23 09:48:15 -04:00
4453e2937f solana-test-validator --log now includes version/argument information (#20892)
(cherry picked from commit 86bf071d77)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-10-22 21:45:34 +00:00
5013828326 ci: Increase timeout duration for coverage step (#20888) (#20890)
(cherry picked from commit 4fbf44dc75)

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-22 21:03:06 +00:00
c597a6c828 Report timing info for stakes cache updates from txs (backport #20856) (#20883)
* Report timing info for stakes cache updates from txs (#20856)

(cherry picked from commit 735016661b)

# Conflicts:
#	runtime/src/bank.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-22 15:51:20 -04:00
d890aa93a5 Add counter for new transactions in SendTransactionService (#20852) (#20858)
* Add counter for inserted transactions

* Add counter for tx recv

(cherry picked from commit 8959d5e21c)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-21 23:08:54 -06:00
1d7f6a2c66 Rpc: filters performance improvement (#20185) (#20862)
* Add Base58,Base64,Bytes to MemcmpEncodedBytes

* Rpc: decode memcmp before filtering accounts

* Add deprecated attribute

* Add Memcmp::bytes

* Fix clippy for deprecated

* Another clippy fix

* merge RpcFilterError::DataTooLarge

* add deprecation for Base58DataTooLarge

* change filter data size limit

* strict data size len for base58

* add magic numbers

* fix tests

(cherry picked from commit e9a427b9c8)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-10-22 01:29:49 +00:00
a483a7da47 Add counter for dropped duplicated packets, fix dropped_packets_count (#20834) (#20837)
(cherry picked from commit 71d0bd4605)

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2021-10-21 04:55:11 +00:00
e333cd48e8 rpc-send-tx-svc server-side retry knobs (backport #20818) (#20829)
* rpc-send-tx-svc: add with_config constructor

(cherry picked from commit fe098b5ddc)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	replica-node/Cargo.toml
#	rpc/src/rpc_service.rs
#	rpc/src/send_transaction_service.rs
#	validator/Cargo.toml

* rpc-send-tx-svc: server-side retry knobs

(cherry picked from commit 2744a2128c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-21 00:13:46 +00:00
b3be0b7b44 cli: account for rpc nodes when considering feature set adoption (#20773)
(cherry picked from commit 5794bba65c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-20 23:33:21 +00:00
4ec275b5cd fix bad merge 2021-10-18 13:56:45 -07:00
a6e6bc6dc0 Ignore RUSTSEC-2020-0159
(cherry picked from commit 7baeb04f26)

# Conflicts:
#	ci/do-audit.sh
2021-10-18 13:56:45 -07:00
91e56bdb5e clap-utils: trim single-quotes from signer uris on windows (#20694)
(cherry picked from commit 6649dfa899)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-14 18:01:42 +00:00
3fd0f45e91 Include token owners in TransactionTokenBalances (backport #20642) (#20676)
* Include token owners in TransactionTokenBalances (#20642)

* Cache owners in TransactionTokenBalances

* Light cleanup

* Use return struct, and remove pub

* Single-use statements

* Why not, just do the whole crate

* Add metrics

* Make datapoint_debug to prevent spam unless troubleshooting

(cherry picked from commit e806fa6904)

# Conflicts:
#	ledger/src/blockstore.rs
#	transaction-status/Cargo.toml
#	transaction-status/src/token_balances.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-14 16:37:35 +00:00
84644ce994 Ignore delinquent stake on exit (#20367) (#20381)
* add --ignore-delinquency flag to validator exit and wait-for-restart-window sub commands

* Fix a merge issue

* Add missing variable declaration

* Remove empty line to help CI checks pass

* run rustfmt

* Change argument wording for clarity and verbosity

* Change --ignore-delinquent-stake to --max-delinquent-stake

* cargo fmtgit add validator/src/main.rsgit add validator/src/main.rs

* Adjust per mvines

* Formatting

* Improve input validation

* Please automate cargo fmt somehow

(cherry picked from commit fc5dd7f3bc)

Co-authored-by: Michael <68944931+michaelh-laine@users.noreply.github.com>
2021-10-12 19:14:30 +00:00
353cb8efa5 solana-validator wait-for-restart-window command now accepts an optional --identity argument (backport #18684) (#20609)
* wait-for-restart-window command now accepts an optional --identity argument

(cherry picked from commit c418e8f370)

# Conflicts:
#	validator/src/main.rs

* Fixed cherry-pick conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Steven Czabaniuk <steven@solana.com>
2021-10-12 06:15:30 +00:00
779f36a1bd Rework AVX/AVX2 detection again
(cherry picked from commit c16510152e)
2021-10-10 15:28:26 -07:00
7b216d67ce Remove support for dynamically loaded native programs (backport #20444) (#20483)
* Remove support for dynamically loaded native programs (#20444)

(cherry picked from commit 785fcb63f5)

* nudge

Co-authored-by: Jack May <jack@solana.com>
2021-10-09 01:18:13 +00:00
ca271892c8 Fix solana docker image (#20550)
The docker image fails with:

/usr/bin/solana-run.sh: line 66: ./fetch-spl.sh: No such file or directory

In the solana docker image, scripts/run.sh is copied to
/usr/bin/solana-run.sh and fetch-spl.sh to /usr/bin/fetch-spl.sh. This
means that the line:

cd "$(dirname "$0")/.."

means we're doing a "cd /usr", which means we can't find fetch-spl.sh or
spl-genesis-args.sh (i.e., the error above).

(cherry picked from commit 2762f6f96f)

Co-authored-by: Sean Young <sean@mess.org>
2021-10-08 22:33:42 +00:00
598e2934ba v1.7: Bump crates to resolve audit failures (#20553)
* Bump nix

* Bump sha2 to resolve warning
2021-10-08 20:59:57 +00:00
9ff9234280 adds metrics for number of nodes vs number of pubkeys (backport #20512) (#20523)
* adds metrics for number of nodes vs number of pubkeys (#20512)

(cherry picked from commit 0da661de62)

# Conflicts:
#	gossip/src/cluster_info_metrics.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-08 15:20:27 +00:00
8f07b46a69 Enable easy full-rpc services on testnet nodes (#20530) (#20532)
(cherry picked from commit afe866ad02)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-08 03:02:48 +00:00
b48bfc19c1 Fixup docs on deprecated JSON-RPC methods (backport #20515) (#20520)
* Update expected removal version to match backward-compatibility policy (#20515)

(cherry picked from commit d56ad8ff4f)

# Conflicts:
#	docs/src/developing/clients/jsonrpc-api.md

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-08 00:41:35 +00:00
33c24ec3ae Bump version to 1.7.16 (#20519) 2021-10-07 18:29:40 -06:00
4892eb4e1a Derive Pod/Zeroable for Pubkey (backport #20493) (#20496)
* Derive Pod/Zeroable for Pubkey

(cherry picked from commit f966859829)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	sdk/program/Cargo.toml

* rebase

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-10-07 07:59:17 +00:00
2d930052dc fixes backports code changes (#20482) 2021-10-07 03:44:30 +00:00
70c9ca061f Add RecentItems metrics (#20484) (#20487)
(cherry picked from commit e13ed8a627)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-06 16:51:31 -06:00
e4aecd9320 Revert "Cost model 1.7 (#20188)"
This reverts commit 1dd6dc3709.
2021-10-06 16:25:24 -06:00
1dd6dc3709 Cost model 1.7 (#20188)
* Cost Model to limit transactions which are not parallelizeable (#16694)

* * Add following to banking_stage:
  1. CostModel as immutable ref shared between threads, to provide estimated cost for transactions.
  2. CostTracker which is shared between threads, tracks transaction costs for each block.

* replace hard coded program ID with id() calls

* Add Account Access Cost as part of TransactionCost. Account Access cost are weighted differently between read and write, signed and non-signed.

* Establish instruction_execution_cost_table, add function to update or insert instruction cost, unit tested. It is read-only for now; it allows Replay to insert realtime instruction execution costs to the table.

* add test for cost_tracker atomically try_add operation, serves as safety guard for future changes

* check cost against local copy of cost_tracker, return transactions that would exceed limit as unprocessed transaction to be buffered; only apply bank processed transactions cost to tracker;

* bencher to new banking_stage with max cost limit to allow cost model being hit consistently during bench iterations

* replay stage feed back program cost (#17731)

* replay stage feeds back realtime per-program execution cost to cost model;

* program cost execution table is initialized into empty table, no longer populated with hardcoded numbers;

* changed cost unit to microsecond, using value collected from mainnet;

* add ExecuteCostTable with fixed capacity for security concern, when its limit is reached, programs with old age AND less occurrence will be pushed out to make room for new programs.

* investigate system performance test degradation  (#17919)

* Add stats and counter around cost model ops, mainly:
- calculate transaction cost
- check transaction can fit in a block
- update block cost tracker after transactions are added to block
- replay_stage to update/insert execution cost to table

* Change mutex on cost_tracker to RwLock

* removed cloning cost_tracker for local use, as the metrics show clone is very expensive.

* acquire and hold locks for block of TXs, instead of acquire and release per transaction;

* remove redundant would_fit check from cost_tracker update execution path

* refactor cost checking with less frequent lock acquiring

* avoid many Transaction_cost heap allocation when calculate cost, which
is in the hot path - executed per transaction.

* create hashmap with new_capacity to reduce runtime heap realloc.

* code review changes: categorize stats, replace explicit drop calls, concisely initiate to default

* address potential deadlock by acquiring locks one at time

* Persist cost table to blockstore (#18123)

* Add `ProgramCosts` Column Family to blockstore, implement LedgerColumn; add `delete_cf` to Rocks
* Add ProgramCosts to compaction excluding list alone side with TransactionStatusIndex in one place: `excludes_from_compaction()`

* Write cost table to blockstore after `replay_stage` replayed active banks; add stats to measure persist time
* Deletes program from `ProgramCosts` in blockstore when they are removed from cost_table in memory
* Only try to persist to blockstore when cost_table is changed.
* Restore cost table during validator startup

* Offload `cost_model` related operations from replay main thread to dedicated service thread, add channel to send execute_timings between these threads;
* Move `cost_update_service` to its own module; replay_stage is now decoupled from cost_model.

* log warning when channel send fails (#18391)

* Aggregate cost_model into cost_tracker (#18374)

* * aggregate cost_model into cost_tracker, decouple it from banking_stage to prevent accidental deadlock. * Simplified code, removed unused functions

* review fixes

* update ledger tool to restore cost table from blockstore (#18489)

* update ledger tool to restore cost model from blockstore when compute-slot-cost

* Move initialize_cost_table into cost_model, so the function can be tested and shared between validator and ledger-tool

* refactor and simplify a test

* manually fix merge conflicts

* Per-program id timings (#17554)

* more manual fixing

* solve a merge conflict

* featurize cost model

* more merge fix

* cost model uses compute_unit to replace microsecond as cost unit
(#18934)

* Reject blocks for costs above the max block cost (#18994)

* Update block max cost limit to fix performance regession (#19276)

* replace function with const var for better readability (#19285)

* Add few more metrics data points (#19624)

* periodically report sigverify_stage stats (#19674)

* manual merge

* cost model nits (#18528)

* Accumulate consumed units (#18714)

* tx wide compute budget (#18631)

* more manual merge

* ignore zerorize drop security

* - update const cost values with data collected by #19627
- update cost calculation to closely proposed fee schedule #16984

* add transaction cost histogram metrics (#20350)

* rebase to 1.7.15

* add tx count and thread id to stats (#20451)
each stat reports and resets when slot changes

* remove cost_model feature_set

* ignore vote transactions from cost model

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
Co-authored-by: Jack May <jack@solana.com>
2021-10-06 15:11:41 -05:00
414674eba1 Fix dos data-type for non-gossip mode (#20465) (#20478)
(cherry picked from commit b178f3f2d3)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-06 19:00:34 +00:00
d922971ec6 Optimize stakes cache and rewards at epoch boundaries (backport #20432) (#20472)
* Optimize stakes cache and rewards at epoch boundaries (backport #20432)

* fix conflicts
2021-10-06 16:15:27 +00:00
95ac00d30a Make rewards tracer async friendly (backport #20452) (#20456)
* Make rewards tracer async friendly (#20452)

(cherry picked from commit 250a8503fe)

# Conflicts:
#	Cargo.lock
#	ledger-tool/Cargo.toml
#	runtime/src/bank.rs

* fix conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-06 11:20:50 +00:00
1ca4f7d110 Install openssl for travisci windows builds (#20420) (#20458)
(cherry picked from commit df73d8e8a1)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-05 22:30:23 -06:00
8999f07ed2 Remove nodejs (#20399) (#20433)
(cherry picked from commit 6df0ce5457)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-05 08:56:57 +00:00
9f4f8fc9e9 Add struct and convenience methods to track stake activation status (backport #20392) (#20425)
* Add struct and convenience methods to track stake activation status (#20392)

* Add struct and convenience methods to track stake activation status

* fix nits

* rename

(cherry picked from commit 0ddb34a0b4)

# Conflicts:
#	runtime/src/stakes.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-05 04:33:30 +00:00
00b03897e1 Default --rpc-bind-address to 127.0.0.1 when --private-rpc is provided and --bind-address is not
(cherry picked from commit 221343e849)
2021-10-04 16:58:46 -07:00
6181df68cf Staking docs: link to overview (#20426)
(cherry picked from commit 2d5b471c09)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-10-04 23:22:21 +00:00
1588b00f2c fix syntax error in bash_profile (#20386)
if there is no newline at the end of the file, this export is glued to the rest of the code and generates a syntax error like this

```bash
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fiexport PATH="/Users/user/.local/share/solana/install/active_release/bin:$PATH"
```

(cherry picked from commit 87c0d8d9e7)

Co-authored-by: OleG <emptystamp@gmail.com>
2021-10-02 04:50:39 +00:00
ef306aa7cb Deploy error is buffer is too small (#20358) (#20362)
* Deploy error is buffer is too small

* missing file

(cherry picked from commit de8331eeaf)

# Conflicts:
#	cli/tests/fixtures/noop.so

Co-authored-by: Jack May <jack@solana.com>
2021-10-01 05:25:11 +00:00
e718f4b04a terminology.md: remove CBC block and unneeded filename (#20269) (#20349)
(cherry picked from commit a7f2d9f55f)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-30 23:19:12 +00:00
51593a882b Properly enable unprefixed_malloc_on_supported_platforms in tikv-jemallocator (#20351) (#20354)
Trivial typo fix.

Fixes: 4bf6d0c4d7 ("adds unprefixed_malloc_on_supported_platforms to jemalloc (#20317)")
(cherry picked from commit 8ae88632cb)

Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
2021-09-30 20:26:11 +00:00
1c15cc6e9a add unchecked invokes (#20313) (#20337)
(cherry picked from commit 8188c1dd59)

Co-authored-by: Jack May <jack@solana.com>
2021-09-30 17:05:51 +00:00
734b380cdb Bump version to v1.7.15 (#20338) 2021-09-30 10:51:34 -06:00
9cc26b3b00 cli: Stop topping up buffer balance (#20181) (#20312)
(cherry picked from commit 53a810dbad)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-30 12:31:12 -04:00
ef5a0e842c stake-accounts.md: fix grammar, link Solana Explorer (#20270) (#20274)
(cherry picked from commit f24fff8495)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-29 22:57:00 -06:00
5bdb824267 Remove original feature gating (#20334) 2021-09-29 22:36:51 -06:00
474f2bcdf4 Prune sigverify queue (#20315) 2021-09-30 05:40:48 +02:00
2302211963 Remove files (#20332) 2021-09-30 02:25:24 +00:00
8178db52a5 Add transaction mode to dos (#20191) (#20329)
(cherry picked from commit 94a1a57106)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-09-29 23:53:15 +00:00
5d8429d953 adds unprefixed_malloc_on_supported_platforms to jemalloc (#20317) (#20325)
Without this feature jemalloc is used only for Rust code but not for
bundled C/C++ libraries (like rocksdb).
https://github.com/solana-labs/solana/issues/14366#issuecomment-930404992

(cherry picked from commit 4bf6d0c4d7)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-29 22:49:47 +00:00
fec15f69f4 Increment 1.7 version (#20316) 2021-09-29 15:37:45 -04:00
209 changed files with 3515 additions and 3270 deletions

View File

@ -61,6 +61,12 @@ jobs:
- <<: *release-artifacts
name: "Windows release artifacts"
os: windows
install:
- choco install openssl
- export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64"
- source ci/rust-version.sh
- PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
- readlink -f .
# Linux release artifacts are still built by ci/buildkite-secondary.yml
#- <<: *release-artifacts
# name: "Linux release artifacts"

391
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -45,9 +45,6 @@ members = [
"programs/bpf_loader",
"programs/config",
"programs/exchange",
"programs/failure",
"programs/noop",
"programs/ownable",
"programs/secp256k1",
"programs/stake",
"programs/vote",

View File

@ -1,6 +1,6 @@
[package]
name = "solana-account-decoder"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-config-program = { path = "../programs/config", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-core = { path = "../core", version = "=1.7.13" }
solana-faucet = { path = "../faucet", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-account-decoder = { path = "../account-decoder", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-faucet = { path = "../faucet", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
spl-token-v2-0 = { package = "spl-token", version = "=3.2.0", features = ["no-entrypoint"] }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "=1.7.13" }
solana-local-cluster = { path = "../local-cluster", version = "=1.7.18" }
[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-banking-bench"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-perf = { path = "../perf", version = "=1.7.13" }
solana-poh = { path = "../poh", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
solana-poh = { path = "../poh", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-banks-client"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../sdk/program", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-banks-interface = { path = "../banks-interface", version = "=1.7.18" }
solana-program = { path = "../sdk/program", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
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.7.13" }
solana-banks-server = { path = "../banks-server", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-banks-server = { path = "../banks-server", version = "=1.7.18" }
[lib]
crate-type = ["lib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-banks-interface"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
tarpc = { version = "0.24.1", features = ["full"] }
[dev-dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-banks-server"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-banks-interface = { path = "../banks-interface", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13" }
solana-core = { path = "../core", version = "=1.7.13" }
solana-genesis = { path = "../genesis", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.7.13" }
solana-faucet = { path = "../faucet", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-genesis = { path = "../genesis", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.7.18" }
solana-faucet = { path = "../faucet", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "=1.7.13" }
solana-local-cluster = { path = "../local-cluster", version = "=1.7.18" }
[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.7.13"
version = "1.7.18"
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.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
[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.7.13"
version = "1.7.18"
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.7.13" }
solana-core = { path = "../core", version = "=1.7.13" }
solana-genesis = { path = "../genesis", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-faucet = { path = "../faucet", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-genesis = { path = "../genesis", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-faucet = { path = "../faucet", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
[dev-dependencies]
serial_test = "0.4.0"
solana-local-cluster = { path = "../local-cluster", version = "=1.7.13" }
solana-local-cluster = { path = "../local-cluster", version = "=1.7.18" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -137,7 +137,7 @@ all_test_steps() {
^ci/test-coverage.sh \
^scripts/coverage.sh \
; then
command_step coverage ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_nightly_docker_image ci/test-coverage.sh" 30
command_step coverage ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_nightly_docker_image ci/test-coverage.sh" 40
wait_step
else
annotate --style info --context test-coverage \

View File

@ -45,5 +45,12 @@ cargo_audit_ignores=(
# Blocked on jsonrpc removing dependency on unmaintained `websocket`
# https://github.com/paritytech/jsonrpc/issues/605
--ignore RUSTSEC-2021-0079
# chrono: Potential segfault in `localtime_r` invocations
#
# Blocked due to no safe upgrade
# https://github.com/chronotope/chrono/issues/499
--ignore RUSTSEC-2020-0159
)
scripts/cargo-for-all-lock-files.sh stable audit "${cargo_audit_ignores[@]}"

View File

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

View File

@ -258,6 +258,15 @@ pub(crate) fn parse_signer_source<S: AsRef<str>>(
let source = {
#[cfg(target_family = "windows")]
{
// trim matched single-quotes since cmd.exe won't
let mut source = source;
while let Some(trimmed) = source.strip_prefix('\'') {
source = if let Some(trimmed) = trimmed.strip_suffix('\'') {
trimmed
} else {
break;
}
}
source.replace("\\", "/")
}
#[cfg(not(target_family = "windows"))]

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.7.13"
version = "1.7.18"
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.7.13"
version = "1.7.18"
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.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-account-decoder = { path = "../account-decoder", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -26,33 +26,34 @@ humantime = "2.0.1"
num-traits = "0.2"
pretty-hex = "0.2.1"
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
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.7.13" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-cli-config = { path = "../cli-config", version = "=1.7.13" }
solana-cli-output = { path = "../cli-output", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-config-program = { path = "../programs/config", version = "=1.7.13" }
solana-faucet = { path = "../faucet", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-account-decoder = { path = "../account-decoder", version = "=1.7.18" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-cli-config = { path = "../cli-config", version = "=1.7.18" }
solana-cli-output = { path = "../cli-output", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-config-program = { path = "../programs/config", version = "=1.7.18" }
solana-faucet = { path = "../faucet", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana_rbpf = "=0.2.11"
solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
tempfile = "3.1.0"
[[bin]]

View File

@ -1721,7 +1721,7 @@ pub fn process_show_stakes(
// Filter by `StakeState::Stake(_, _)`
rpc_filter::RpcFilterType::Memcmp(rpc_filter::Memcmp {
offset: 0,
bytes: rpc_filter::MemcmpEncodedBytes::Binary(
bytes: rpc_filter::MemcmpEncodedBytes::Base58(
bs58::encode([2, 0, 0, 0]).into_string(),
),
encoding: Some(rpc_filter::MemcmpEncoding::Binary),
@ -1729,7 +1729,7 @@ pub fn process_show_stakes(
// Filter by `Delegation::voter_pubkey`, which begins at byte offset 124
rpc_filter::RpcFilterType::Memcmp(rpc_filter::Memcmp {
offset: 124,
bytes: rpc_filter::MemcmpEncodedBytes::Binary(
bytes: rpc_filter::MemcmpEncodedBytes::Base58(
vote_account_pubkeys[0].to_string(),
),
encoding: Some(rpc_filter::MemcmpEncoding::Binary),

View File

@ -18,7 +18,12 @@ use solana_sdk::{
pubkey::Pubkey,
transaction::Transaction,
};
use std::{collections::HashMap, fmt, sync::Arc};
use std::{
cmp::Ordering,
collections::{HashMap, HashSet},
fmt,
sync::Arc,
};
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ForceActivation {
@ -222,44 +227,103 @@ pub fn process_feature_subcommand(
}
}
fn active_stake_by_feature_set(rpc_client: &RpcClient) -> Result<HashMap<u32, f64>, ClientError> {
#[derive(Debug, Default)]
struct WorkingFeatureSetStatsEntry {
stake: u64,
rpc_nodes_count: u32,
software_versions: HashSet<Option<semver::Version>>,
}
type WorkingFeatureSetStats = HashMap<u32, WorkingFeatureSetStatsEntry>;
#[derive(Debug, Default)]
struct FeatureSetStatsEntry {
stake_percent: f64,
rpc_nodes_percent: f32,
software_versions: Vec<Option<semver::Version>>,
}
type FeatureSetStats = HashMap<u32, FeatureSetStatsEntry>;
fn feature_set_stats(rpc_client: &RpcClient) -> Result<FeatureSetStats, ClientError> {
// Validator identity -> feature set
let feature_set_map = rpc_client
let feature_sets = rpc_client
.get_cluster_nodes()?
.into_iter()
.map(|contact_info| (contact_info.pubkey, contact_info.feature_set))
.collect::<HashMap<_, _>>();
.map(|contact_info| {
(
contact_info.pubkey,
contact_info.feature_set,
contact_info.rpc.is_some(),
contact_info
.version
.and_then(|v| semver::Version::parse(&v).ok()),
)
})
.collect::<Vec<_>>();
let vote_accounts = rpc_client.get_vote_accounts()?;
let total_active_stake: u64 = vote_accounts
.current
let mut total_active_stake: u64 = vote_accounts
.delinquent
.iter()
.chain(vote_accounts.delinquent.iter())
.map(|vote_account| vote_account.activated_stake)
.sum();
// Sum all active stake by feature set
let mut active_stake_by_feature_set: HashMap<u32, u64> = HashMap::new();
for vote_account in vote_accounts.current {
if let Some(Some(feature_set)) = feature_set_map.get(&vote_account.node_pubkey) {
*active_stake_by_feature_set.entry(*feature_set).or_default() +=
vote_account.activated_stake;
} else {
*active_stake_by_feature_set
.entry(0 /* "unknown" */)
.or_default() += vote_account.activated_stake;
let vote_stakes = vote_accounts
.current
.into_iter()
.map(|vote_account| {
total_active_stake += vote_account.activated_stake;
(vote_account.node_pubkey, vote_account.activated_stake)
})
.collect::<HashMap<_, _>>();
let mut feature_set_stats: WorkingFeatureSetStats = HashMap::new();
let mut total_rpc_nodes = 0;
for (node_id, feature_set, is_rpc, version) in feature_sets {
let feature_set = feature_set.unwrap_or(0);
let feature_set_entry = feature_set_stats.entry(feature_set).or_default();
feature_set_entry.software_versions.insert(version);
if let Some(vote_stake) = vote_stakes.get(&node_id) {
feature_set_entry.stake += *vote_stake;
}
if is_rpc {
feature_set_entry.rpc_nodes_count += 1;
total_rpc_nodes += 1;
}
}
Ok(active_stake_by_feature_set
Ok(feature_set_stats
.into_iter()
.map(|(feature_set, active_stake)| {
(
.filter_map(
|(
feature_set,
active_stake as f64 * 100. / total_active_stake as f64,
)
})
WorkingFeatureSetStatsEntry {
stake,
rpc_nodes_count,
software_versions,
},
)| {
let stake_percent = (stake as f64 / total_active_stake as f64) * 100.;
let rpc_nodes_percent = (rpc_nodes_count as f32 / total_rpc_nodes as f32) * 100.;
let mut software_versions = software_versions.into_iter().collect::<Vec<_>>();
software_versions.sort();
if stake_percent >= 0.001 || rpc_nodes_percent >= 0.001 {
Some((
feature_set,
FeatureSetStatsEntry {
stake_percent,
rpc_nodes_percent,
software_versions,
},
))
} else {
None
}
},
)
.collect())
}
@ -267,50 +331,164 @@ fn active_stake_by_feature_set(rpc_client: &RpcClient) -> Result<HashMap<u32, f6
fn feature_activation_allowed(rpc_client: &RpcClient, quiet: bool) -> Result<bool, ClientError> {
let my_feature_set = solana_version::Version::default().feature_set;
let active_stake_by_feature_set = active_stake_by_feature_set(rpc_client)?;
let feature_set_stats = feature_set_stats(rpc_client)?;
let feature_activation_allowed = active_stake_by_feature_set
let (stake_allowed, rpc_allowed) = feature_set_stats
.get(&my_feature_set)
.map(|percentage| *percentage >= 95.)
.unwrap_or(false);
.map(
|FeatureSetStatsEntry {
stake_percent,
rpc_nodes_percent,
..
}| (*stake_percent >= 95., *rpc_nodes_percent >= 95.),
)
.unwrap_or((false, false));
if !feature_activation_allowed && !quiet {
if active_stake_by_feature_set.get(&my_feature_set).is_none() {
if !stake_allowed && !rpc_allowed && !quiet {
if feature_set_stats.get(&my_feature_set).is_none() {
println!(
"{}",
style("To activate features the tool and cluster feature sets must match, select a tool version that matches the cluster")
.bold());
} else {
println!(
"{}",
style("To activate features the stake must be >= 95%").bold()
);
if !stake_allowed {
print!(
"\n{}",
style("To activate features the stake must be >= 95%")
.bold()
.red()
);
}
if !rpc_allowed {
print!(
"\n{}",
style("To activate features the RPC nodes must be >= 95%")
.bold()
.red()
);
}
}
println!(
"\n\n{}",
style(format!("Tool Feature Set: {}", my_feature_set)).bold()
);
let mut feature_set_stats = feature_set_stats.into_iter().collect::<Vec<_>>();
feature_set_stats.sort_by(|l, r| {
match l.1.software_versions[0]
.cmp(&r.1.software_versions[0])
.reverse()
{
Ordering::Equal => {
match l
.1
.stake_percent
.partial_cmp(&r.1.stake_percent)
.unwrap()
.reverse()
{
Ordering::Equal => {
l.1.rpc_nodes_percent
.partial_cmp(&r.1.rpc_nodes_percent)
.unwrap()
.reverse()
}
o => o,
}
}
o => o,
}
});
let software_versions_title = "Software Version";
let feature_set_title = "Feature Set";
let stake_percent_title = "Stake";
let rpc_percent_title = "RPC";
let mut stats_output = Vec::new();
let mut max_software_versions_len = software_versions_title.len();
let mut max_feature_set_len = feature_set_title.len();
let mut max_stake_percent_len = stake_percent_title.len();
let mut max_rpc_percent_len = rpc_percent_title.len();
for (
feature_set,
FeatureSetStatsEntry {
stake_percent,
rpc_nodes_percent,
software_versions,
},
) in feature_set_stats.into_iter()
{
let me = feature_set == my_feature_set;
let feature_set = if feature_set == 0 {
"unknown".to_string()
} else {
feature_set.to_string()
};
let stake_percent = format!("{:.2}%", stake_percent);
let rpc_percent = format!("{:.2}%", rpc_nodes_percent);
let mut has_unknown = false;
let mut software_versions = software_versions
.iter()
.filter_map(|v| {
if v.is_none() {
has_unknown = true;
}
v.as_ref()
})
.map(ToString::to_string)
.collect::<Vec<_>>();
if has_unknown {
software_versions.push("unknown".to_string());
}
let software_versions = software_versions.join(", ");
max_software_versions_len = max_software_versions_len.max(software_versions.len());
max_feature_set_len = max_feature_set_len.max(feature_set.len());
max_stake_percent_len = max_stake_percent_len.max(stake_percent.len());
max_rpc_percent_len = max_rpc_percent_len.max(rpc_percent.len());
stats_output.push((
software_versions,
feature_set,
stake_percent,
rpc_percent,
me,
));
}
println!(
"{}",
style(format!("Tool Feature Set: {}", my_feature_set)).bold()
style(format!(
"{1:<0$} {3:<2$} {5:<4$} {7:<6$}",
max_software_versions_len,
software_versions_title,
max_feature_set_len,
feature_set_title,
max_stake_percent_len,
stake_percent_title,
max_rpc_percent_len,
rpc_percent_title,
))
.bold(),
);
println!("{}", style("Cluster Feature Sets and Stakes:").bold());
for (feature_set, percentage) in active_stake_by_feature_set.iter() {
if *feature_set == 0 {
println!(" unknown - {:.2}%", percentage);
} else {
println!(
" {:<10} - {:.2}% {}",
feature_set,
percentage,
if *feature_set == my_feature_set {
" <-- me"
} else {
""
}
);
}
for (software_versions, feature_set, stake_percent, rpc_percent, me) in stats_output {
println!(
"{1:<0$} {3:>2$} {5:>4$} {7:>6$} {8}",
max_software_versions_len,
software_versions,
max_feature_set_len,
feature_set,
max_stake_percent_len,
stake_percent,
max_rpc_percent_len,
rpc_percent,
if me { "<-- me" } else { "" },
);
}
println!();
}
Ok(feature_activation_allowed)
Ok(stake_allowed && rpc_allowed)
}
fn status_from_account(account: Account) -> Option<CliFeatureStatus> {

View File

@ -1146,18 +1146,18 @@ fn get_buffers(
) -> Result<CliUpgradeableBuffers, Box<dyn std::error::Error>> {
let mut filters = vec![RpcFilterType::Memcmp(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![1, 0, 0, 0]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![1, 0, 0, 0]).into_string()),
encoding: None,
})];
if let Some(authority_pubkey) = authority_pubkey {
filters.push(RpcFilterType::Memcmp(Memcmp {
offset: ACCOUNT_TYPE_SIZE,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![1]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![1]).into_string()),
encoding: None,
}));
filters.push(RpcFilterType::Memcmp(Memcmp {
offset: ACCOUNT_TYPE_SIZE + OPTION_SIZE,
bytes: MemcmpEncodedBytes::Binary(
bytes: MemcmpEncodedBytes::Base58(
bs58::encode(authority_pubkey.as_ref()).into_string(),
),
encoding: None,
@ -1199,18 +1199,18 @@ fn get_programs(
) -> Result<CliUpgradeablePrograms, Box<dyn std::error::Error>> {
let mut filters = vec![RpcFilterType::Memcmp(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![3, 0, 0, 0]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![3, 0, 0, 0]).into_string()),
encoding: None,
})];
if let Some(authority_pubkey) = authority_pubkey {
filters.push(RpcFilterType::Memcmp(Memcmp {
offset: ACCOUNT_TYPE_SIZE + SLOT_SIZE,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![1]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![1]).into_string()),
encoding: None,
}));
filters.push(RpcFilterType::Memcmp(Memcmp {
offset: ACCOUNT_TYPE_SIZE + SLOT_SIZE + OPTION_SIZE,
bytes: MemcmpEncodedBytes::Binary(
bytes: MemcmpEncodedBytes::Base58(
bs58::encode(authority_pubkey.as_ref()).into_string(),
),
encoding: None,
@ -1234,7 +1234,7 @@ fn get_programs(
bytes.extend_from_slice(programdata_address.as_ref());
let filters = vec![RpcFilterType::Memcmp(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(bytes).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(bytes).into_string()),
encoding: None,
})];
@ -2018,7 +2018,13 @@ fn complete_partial_program_init(
return Err("Buffer account is already executable".into());
}
if account.owner != *loader_id && !system_program::check_id(&account.owner) {
return Err("Buffer account is already owned by another account".into());
return Err("Buffer account passed is already in use by another program".into());
}
if !account.data.is_empty() && account.data.len() < account_data_len {
return Err(
"Buffer account passed is not large enough, may have been for a different deploy?"
.into(),
);
}
if account.data.is_empty() && system_program::check_id(&account.owner) {
@ -2029,24 +2035,24 @@ fn complete_partial_program_init(
if account.owner != *loader_id {
instructions.push(system_instruction::assign(elf_pubkey, loader_id));
}
}
if account.lamports < minimum_balance {
let balance = minimum_balance - account.lamports;
instructions.push(system_instruction::transfer(
payer_pubkey,
elf_pubkey,
balance,
));
balance_needed = balance;
} else if account.lamports > minimum_balance
&& system_program::check_id(&account.owner)
&& !allow_excessive_balance
{
return Err(format!(
"Buffer account has a balance: {:?}; it may already be in use",
Sol(account.lamports)
)
.into());
if account.lamports < minimum_balance {
let balance = minimum_balance - account.lamports;
instructions.push(system_instruction::transfer(
payer_pubkey,
elf_pubkey,
balance,
));
balance_needed = balance;
} else if account.lamports > minimum_balance
&& system_program::check_id(&account.owner)
&& !allow_excessive_balance
{
return Err(format!(
"Buffer account has a balance: {:?}; it may already be in use",
Sol(account.lamports)
)
.into());
}
}
Ok((instructions, balance_needed))
}

View File

@ -39,13 +39,11 @@ use solana_sdk::{
stake::{
self,
instruction::{self as stake_instruction, LockupArgs, StakeError},
state::{Authorized, Lockup, Meta, StakeAuthorize, StakeState},
state::{Authorized, Lockup, Meta, StakeActivationStatus, StakeAuthorize, StakeState},
},
stake_history::StakeHistory,
system_instruction::SystemError,
sysvar::{
clock,
stake_history::{self, StakeHistory},
},
sysvar::{clock, stake_history},
transaction::Transaction,
};
use solana_vote_program::vote_state::VoteState;
@ -2020,7 +2018,11 @@ pub fn build_stake_state(
stake,
) => {
let current_epoch = clock.epoch;
let (active_stake, activating_stake, deactivating_stake) = stake
let StakeActivationStatus {
effective,
activating,
deactivating,
} = stake
.delegation
.stake_activating_and_deactivating(current_epoch, Some(stake_history));
let lockup = if lockup.is_in_force(clock, None) {
@ -2055,9 +2057,9 @@ pub fn build_stake_state(
use_lamports_unit,
current_epoch,
rent_exempt_reserve: Some(*rent_exempt_reserve),
active_stake: u64_some_if_not_zero(active_stake),
activating_stake: u64_some_if_not_zero(activating_stake),
deactivating_stake: u64_some_if_not_zero(deactivating_stake),
active_stake: u64_some_if_not_zero(effective),
activating_stake: u64_some_if_not_zero(activating),
deactivating_stake: u64_some_if_not_zero(deactivating),
..CliStakeState::default()
}
}

View File

@ -5,3 +5,4 @@ cd "$(dirname "$0")"
make -C ../../../programs/bpf/c/
cp ../../../programs/bpf/c/out/noop.so .
cat noop.so noop.so noop.so > noop_large.so

BIN
cli/tests/fixtures/noop_large.so vendored Normal file

Binary file not shown.

View File

@ -22,11 +22,11 @@ use std::{env, fs::File, io::Read, path::PathBuf, str::FromStr};
fn test_cli_program_deploy_non_upgradeable() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -37,7 +37,7 @@ fn test_cli_program_deploy_non_upgradeable() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let minimum_balance_for_rent_exemption = rpc_client
@ -55,7 +55,7 @@ fn test_cli_program_deploy_non_upgradeable() {
process_command(&config).unwrap();
config.command = CliCommand::Deploy {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
address: None,
use_deprecated_loader: false,
allow_excessive_balance: false,
@ -75,7 +75,7 @@ fn test_cli_program_deploy_non_upgradeable() {
assert_eq!(account0.lamports, minimum_balance_for_rent_exemption);
assert_eq!(account0.owner, bpf_loader::id());
assert!(account0.executable);
let mut file = File::open(pathbuf.to_str().unwrap().to_string()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap().to_string()).unwrap();
let mut elf = Vec::new();
file.read_to_end(&mut elf).unwrap();
assert_eq!(account0.data, elf);
@ -84,7 +84,7 @@ fn test_cli_program_deploy_non_upgradeable() {
let custom_address_keypair = Keypair::new();
config.signers = vec![&keypair, &custom_address_keypair];
config.command = CliCommand::Deploy {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
address: Some(1),
use_deprecated_loader: false,
allow_excessive_balance: false,
@ -111,7 +111,7 @@ fn test_cli_program_deploy_non_upgradeable() {
process_command(&config).unwrap();
config.signers = vec![&keypair, &custom_address_keypair];
config.command = CliCommand::Deploy {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
address: Some(1),
use_deprecated_loader: false,
allow_excessive_balance: false,
@ -120,7 +120,7 @@ fn test_cli_program_deploy_non_upgradeable() {
// Use forcing parameter to deploy to account with excess balance
config.command = CliCommand::Deploy {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
address: Some(1),
use_deprecated_loader: false,
allow_excessive_balance: true,
@ -139,11 +139,11 @@ fn test_cli_program_deploy_non_upgradeable() {
fn test_cli_program_deploy_no_authority() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -154,7 +154,7 @@ fn test_cli_program_deploy_no_authority() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -181,7 +181,7 @@ fn test_cli_program_deploy_no_authority() {
// Deploy a program
config.signers = vec![&keypair, &upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: None,
buffer_signer_index: None,
@ -206,7 +206,7 @@ fn test_cli_program_deploy_no_authority() {
// Attempt to upgrade the program
config.signers = vec![&keypair, &upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: Some(program_id),
buffer_signer_index: None,
@ -223,11 +223,11 @@ fn test_cli_program_deploy_no_authority() {
fn test_cli_program_deploy_with_authority() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -238,7 +238,7 @@ fn test_cli_program_deploy_with_authority() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -266,7 +266,7 @@ fn test_cli_program_deploy_with_authority() {
let program_keypair = Keypair::new();
config.signers = vec![&keypair, &upgrade_authority, &program_keypair];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: Some(2),
program_pubkey: Some(program_keypair.pubkey()),
buffer_signer_index: None,
@ -313,7 +313,7 @@ fn test_cli_program_deploy_with_authority() {
// Deploy the upgradeable program
config.signers = vec![&keypair, &upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: None,
buffer_signer_index: None,
@ -354,7 +354,7 @@ fn test_cli_program_deploy_with_authority() {
// Upgrade the program
config.signers = vec![&keypair, &upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: Some(program_pubkey),
buffer_signer_index: None,
@ -408,7 +408,7 @@ fn test_cli_program_deploy_with_authority() {
// Upgrade with new authority
config.signers = vec![&keypair, &new_upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: Some(program_pubkey),
buffer_signer_index: None,
@ -482,7 +482,7 @@ fn test_cli_program_deploy_with_authority() {
// Upgrade with no authority
config.signers = vec![&keypair, &new_upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: Some(program_pubkey),
buffer_signer_index: None,
@ -497,7 +497,7 @@ fn test_cli_program_deploy_with_authority() {
// deploy with finality
config.signers = vec![&keypair, &new_upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: None,
buffer_signer_index: None,
@ -556,11 +556,11 @@ fn test_cli_program_deploy_with_authority() {
fn test_cli_program_close_program() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -571,7 +571,7 @@ fn test_cli_program_close_program() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -599,7 +599,7 @@ fn test_cli_program_close_program() {
let program_keypair = Keypair::new();
config.signers = vec![&keypair, &upgrade_authority, &program_keypair];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: Some(2),
program_pubkey: Some(program_keypair.pubkey()),
buffer_signer_index: None,
@ -638,11 +638,17 @@ fn test_cli_program_close_program() {
fn test_cli_program_write_buffer() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mut noop_large_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_large_path.push("tests");
noop_large_path.push("fixtures");
noop_large_path.push("noop_large");
noop_large_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -653,7 +659,7 @@ fn test_cli_program_write_buffer() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -681,7 +687,7 @@ fn test_cli_program_write_buffer() {
// Write a buffer with default params
config.signers = vec![&keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: None,
buffer_pubkey: None,
buffer_authority_signer_index: None,
@ -715,7 +721,7 @@ fn test_cli_program_write_buffer() {
let buffer_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: None,
@ -776,7 +782,7 @@ fn test_cli_program_write_buffer() {
let authority_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair, &authority_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: Some(2),
@ -813,7 +819,7 @@ fn test_cli_program_write_buffer() {
let authority_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair, &authority_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: None,
buffer_pubkey: None,
buffer_authority_signer_index: Some(2),
@ -885,7 +891,7 @@ fn test_cli_program_write_buffer() {
// Write a buffer with default params
config.signers = vec![&keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: None,
buffer_pubkey: None,
buffer_authority_signer_index: None,
@ -919,17 +925,47 @@ fn test_cli_program_write_buffer() {
pre_lamports + minimum_balance_for_buffer,
recipient_account.lamports
);
// write small buffer then attempt to deploy larger program
let buffer_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: None,
max_len: None, //Some(max_len),
});
process_command(&config).unwrap();
config.signers = vec![&keypair, &buffer_keypair];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(noop_large_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: None,
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
allow_excessive_balance: false,
upgrade_authority_signer_index: 1,
is_final: true,
max_len: None,
});
config.output_format = OutputFormat::JsonCompact;
let error = process_command(&config).unwrap_err();
assert_eq!(
error.to_string(),
"Buffer account passed is not large enough, may have been for a different deploy?"
);
}
#[test]
fn test_cli_program_set_buffer_authority() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -940,7 +976,7 @@ fn test_cli_program_set_buffer_authority() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -964,7 +1000,7 @@ fn test_cli_program_set_buffer_authority() {
let buffer_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: None,
@ -1039,11 +1075,11 @@ fn test_cli_program_set_buffer_authority() {
fn test_cli_program_mismatch_buffer_authority() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -1054,7 +1090,7 @@ fn test_cli_program_mismatch_buffer_authority() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -1079,7 +1115,7 @@ fn test_cli_program_mismatch_buffer_authority() {
let buffer_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair, &buffer_authority];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: Some(2),
@ -1097,7 +1133,7 @@ fn test_cli_program_mismatch_buffer_authority() {
let upgrade_authority = Keypair::new();
config.signers = vec![&keypair, &upgrade_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: None,
buffer_signer_index: None,
@ -1112,7 +1148,7 @@ fn test_cli_program_mismatch_buffer_authority() {
// Attempt to deploy matched authority
config.signers = vec![&keypair, &buffer_authority];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: None,
program_pubkey: None,
buffer_signer_index: None,
@ -1129,11 +1165,11 @@ fn test_cli_program_mismatch_buffer_authority() {
fn test_cli_program_show() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -1144,7 +1180,7 @@ fn test_cli_program_show() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -1172,7 +1208,7 @@ fn test_cli_program_show() {
let authority_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair, &authority_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: Some(2),
@ -1227,7 +1263,7 @@ fn test_cli_program_show() {
let program_keypair = Keypair::new();
config.signers = vec![&keypair, &authority_keypair, &program_keypair];
config.command = CliCommand::Program(ProgramCliCommand::Deploy {
program_location: Some(pathbuf.to_str().unwrap().to_string()),
program_location: Some(noop_path.to_str().unwrap().to_string()),
program_signer_index: Some(2),
program_pubkey: Some(program_keypair.pubkey()),
buffer_signer_index: None,
@ -1314,11 +1350,11 @@ fn test_cli_program_show() {
fn test_cli_program_dump() {
solana_logger::setup();
let mut pathbuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
pathbuf.push("tests");
pathbuf.push("fixtures");
pathbuf.push("noop");
pathbuf.set_extension("so");
let mut noop_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
noop_path.push("tests");
noop_path.push("fixtures");
noop_path.push("noop");
noop_path.set_extension("so");
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
@ -1329,7 +1365,7 @@ fn test_cli_program_dump() {
let rpc_client =
RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
let mut file = File::open(pathbuf.to_str().unwrap()).unwrap();
let mut file = File::open(noop_path.to_str().unwrap()).unwrap();
let mut program_data = Vec::new();
file.read_to_end(&mut program_data).unwrap();
let max_len = program_data.len();
@ -1357,7 +1393,7 @@ fn test_cli_program_dump() {
let authority_keypair = Keypair::new();
config.signers = vec![&keypair, &buffer_keypair, &authority_keypair];
config.command = CliCommand::Program(ProgramCliCommand::WriteBuffer {
program_location: pathbuf.to_str().unwrap().to_string(),
program_location: noop_path.to_str().unwrap().to_string(),
buffer_signer_index: Some(1),
buffer_pubkey: Some(buffer_keypair.pubkey()),
buffer_authority_signer_index: Some(2),

View File

@ -1,6 +1,6 @@
[package]
name = "solana-client"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-faucet = { path = "../faucet", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-account-decoder = { path = "../account-decoder", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-faucet = { path = "../faucet", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,4 +1,9 @@
use thiserror::Error;
#![allow(deprecated)]
use {std::borrow::Cow, thiserror::Error};
const MAX_DATA_SIZE: usize = 128;
const MAX_DATA_BASE58_SIZE: usize = 175;
const MAX_DATA_BASE64_SIZE: usize = 172;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
@ -15,15 +20,50 @@ impl RpcFilterType {
let encoding = compare.encoding.as_ref().unwrap_or(&MemcmpEncoding::Binary);
match encoding {
MemcmpEncoding::Binary => {
let MemcmpEncodedBytes::Binary(bytes) = &compare.bytes;
if bytes.len() > 128 {
Err(RpcFilterError::Base58DataTooLarge)
} else {
bs58::decode(&bytes)
.into_vec()
.map(|_| ())
.map_err(|e| e.into())
use MemcmpEncodedBytes::*;
match &compare.bytes {
// DEPRECATED
Binary(bytes) => {
if bytes.len() > MAX_DATA_BASE58_SIZE {
return Err(RpcFilterError::Base58DataTooLarge);
}
let bytes = bs58::decode(&bytes)
.into_vec()
.map_err(RpcFilterError::DecodeError)?;
if bytes.len() > MAX_DATA_SIZE {
Err(RpcFilterError::Base58DataTooLarge)
} else {
Ok(())
}
}
Base58(bytes) => {
if bytes.len() > MAX_DATA_BASE58_SIZE {
return Err(RpcFilterError::DataTooLarge);
}
let bytes = bs58::decode(&bytes).into_vec()?;
if bytes.len() > MAX_DATA_SIZE {
Err(RpcFilterError::DataTooLarge)
} else {
Ok(())
}
}
Base64(bytes) => {
if bytes.len() > MAX_DATA_BASE64_SIZE {
return Err(RpcFilterError::DataTooLarge);
}
let bytes = base64::decode(&bytes)?;
if bytes.len() > MAX_DATA_SIZE {
Err(RpcFilterError::DataTooLarge)
} else {
Ok(())
}
}
Bytes(bytes) => {
if bytes.len() > MAX_DATA_SIZE {
return Err(RpcFilterError::DataTooLarge);
}
Ok(())
}
}
}
}
@ -34,10 +74,24 @@ impl RpcFilterType {
#[derive(Error, PartialEq, Debug)]
pub enum RpcFilterError {
#[error("bs58 decode error")]
DecodeError(#[from] bs58::decode::Error),
#[error("encoded binary data should be less than 129 bytes")]
DataTooLarge,
#[deprecated(
since = "1.9.0",
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",
note = "Error for MemcmpEncodedBytes::Binary which is deprecated"
)]
#[error("bs58 decode error")]
DecodeError(bs58::decode::Error),
#[error("base58 decode error")]
Base58DecodeError(#[from] bs58::decode::Error),
#[error("base64 decode error")]
Base64DecodeError(#[from] base64::DecodeError),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
@ -49,7 +103,14 @@ pub enum MemcmpEncoding {
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", untagged)]
pub enum MemcmpEncodedBytes {
#[deprecated(
since = "1.9.0",
note = "Please use MemcmpEncodedBytes::Base58 instead"
)]
Binary(String),
Base58(String),
Base64(String),
Bytes(Vec<u8>),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
@ -63,14 +124,18 @@ pub struct Memcmp {
}
impl Memcmp {
pub fn bytes_match(&self, data: &[u8]) -> bool {
pub fn bytes(&self) -> Option<Cow<Vec<u8>>> {
use MemcmpEncodedBytes::*;
match &self.bytes {
MemcmpEncodedBytes::Binary(bytes) => {
let bytes = bs58::decode(bytes).into_vec();
if bytes.is_err() {
return false;
}
let bytes = bytes.unwrap();
Binary(bytes) | Base58(bytes) => bs58::decode(bytes).into_vec().ok().map(Cow::Owned),
Base64(bytes) => base64::decode(bytes).ok().map(Cow::Owned),
Bytes(bytes) => Some(Cow::Borrowed(bytes)),
}
}
pub fn bytes_match(&self, data: &[u8]) -> bool {
match self.bytes() {
Some(bytes) => {
if self.offset > data.len() {
return false;
}
@ -79,6 +144,7 @@ impl Memcmp {
}
data[self.offset..self.offset + bytes.len()] == bytes[..]
}
None => false,
}
}
}
@ -87,6 +153,15 @@ impl Memcmp {
mod tests {
use super::*;
#[test]
fn test_worst_case_encoded_tx_goldens() {
let ff_data = vec![0xffu8; MAX_DATA_SIZE];
let data58 = bs58::encode(&ff_data).into_string();
assert_eq!(data58.len(), MAX_DATA_BASE58_SIZE);
let data64 = base64::encode(&ff_data);
assert_eq!(data64.len(), MAX_DATA_BASE64_SIZE);
}
#[test]
fn test_bytes_match() {
let data = vec![1, 2, 3, 4, 5];
@ -94,7 +169,7 @@ mod tests {
// Exact match of data succeeds
assert!(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![1, 2, 3, 4, 5]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![1, 2, 3, 4, 5]).into_string()),
encoding: None,
}
.bytes_match(&data));
@ -102,7 +177,7 @@ mod tests {
// Partial match of data succeeds
assert!(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![1, 2]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![1, 2]).into_string()),
encoding: None,
}
.bytes_match(&data));
@ -110,7 +185,7 @@ mod tests {
// Offset partial match of data succeeds
assert!(Memcmp {
offset: 2,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![3, 4]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![3, 4]).into_string()),
encoding: None,
}
.bytes_match(&data));
@ -118,7 +193,7 @@ mod tests {
// Incorrect partial match of data fails
assert!(!Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![2]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![2]).into_string()),
encoding: None,
}
.bytes_match(&data));
@ -126,7 +201,7 @@ mod tests {
// Bytes overrun data fails
assert!(!Memcmp {
offset: 2,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![3, 4, 5, 6]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![3, 4, 5, 6]).into_string()),
encoding: None,
}
.bytes_match(&data));
@ -134,7 +209,7 @@ mod tests {
// Offset outside data fails
assert!(!Memcmp {
offset: 6,
bytes: MemcmpEncodedBytes::Binary(bs58::encode(vec![5]).into_string()),
bytes: MemcmpEncodedBytes::Base58(bs58::encode(vec![5]).into_string()),
encoding: None,
}
.bytes_match(&data));
@ -142,7 +217,7 @@ mod tests {
// Invalid base-58 fails
assert!(!Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary("III".to_string()),
bytes: MemcmpEncodedBytes::Base58("III".to_string()),
encoding: None,
}
.bytes_match(&data));
@ -157,7 +232,7 @@ mod tests {
assert_eq!(
RpcFilterType::Memcmp(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(base58_bytes.to_string()),
bytes: MemcmpEncodedBytes::Base58(base58_bytes.to_string()),
encoding: None,
})
.verify(),
@ -172,11 +247,11 @@ mod tests {
assert_eq!(
RpcFilterType::Memcmp(Memcmp {
offset: 0,
bytes: MemcmpEncodedBytes::Binary(base58_bytes.to_string()),
bytes: MemcmpEncodedBytes::Base58(base58_bytes.to_string()),
encoding: None,
})
.verify(),
Err(RpcFilterError::Base58DataTooLarge)
Err(RpcFilterError::DataTooLarge)
);
}
}

View File

@ -1,7 +1,7 @@
[package]
name = "solana-core"
description = "Blockchain, Rebuilt for Scale"
version = "1.7.13"
version = "1.7.18"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-core"
readme = "../README.md"
@ -43,33 +43,33 @@ 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.7.13" }
solana-banks-server = { path = "../banks-server", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-perf = { path = "../perf", version = "=1.7.13" }
solana-poh = { path = "../poh", version = "=1.7.13" }
solana-program-test = { path = "../program-test", version = "=1.7.13" }
solana-rpc = { path = "../rpc", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.7.13" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-account-decoder = { path = "../account-decoder", version = "=1.7.18" }
solana-banks-server = { path = "../banks-server", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
solana-poh = { path = "../poh", version = "=1.7.18" }
solana-program-test = { path = "../program-test", version = "=1.7.18" }
solana-rpc = { path = "../rpc", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.7.18" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.18" }
trees = "0.2.1"
[dev-dependencies]
@ -82,8 +82,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.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
symlink = "0.1.0"
systemstat = "0.1.5"
tokio = { version = "1", features = ["full"] }

View File

@ -75,9 +75,9 @@ fn broadcast_shreds_bench(bencher: &mut Bencher) {
&cluster_nodes_cache,
&last_datapoint,
&mut TransmitShredsStats::default(),
&SocketAddrSpace::Unspecified,
&cluster_info,
&bank_forks,
&SocketAddrSpace::Unspecified,
)
.unwrap();
});

View File

@ -18,6 +18,44 @@ use std::sync::mpsc::channel;
use std::time::{Duration, Instant};
use test::Bencher;
#[bench]
fn bench_packet_discard(bencher: &mut Bencher) {
solana_logger::setup();
let len = 30 * 1000;
let chunk_size = 1024;
let tx = test_tx();
let mut batches = to_packets_chunked(&vec![tx; len], chunk_size);
let mut total = 0;
let ips: Vec<_> = (0..10_000)
.into_iter()
.map(|_| {
let mut addr = [0u16; 8];
thread_rng().fill(&mut addr);
addr
})
.collect();
for batch in batches.iter_mut() {
total += batch.packets.len();
for p in batch.packets.iter_mut() {
let ip_index = thread_rng().gen_range(0, ips.len());
p.meta.addr = ips[ip_index];
}
}
info!("total packets: {}", total);
bencher.iter(move || {
SigVerifyStage::discard_excess_packets(&mut batches, 10_000);
for batch in batches.iter_mut() {
for p in batch.packets.iter_mut() {
p.meta.discard = false;
}
}
});
}
#[bench]
fn bench_sigverify_stage(bencher: &mut Bencher) {
solana_logger::setup();

View File

@ -88,6 +88,7 @@ pub struct BankingStageStats {
new_tx_count: AtomicUsize,
dropped_packet_batches_count: AtomicUsize,
dropped_packets_count: AtomicUsize,
dropped_duplicated_packets_count: AtomicUsize,
newly_buffered_packets_count: AtomicUsize,
current_buffered_packets_count: AtomicUsize,
current_buffered_packet_batches_count: AtomicUsize,
@ -137,6 +138,12 @@ impl BankingStageStats {
self.dropped_packets_count.swap(0, Ordering::Relaxed) as i64,
i64
),
(
"dropped_duplicated_packets_count",
self.dropped_duplicated_packets_count
.swap(0, Ordering::Relaxed) as i64,
i64
),
(
"newly_buffered_packets_count",
self.newly_buffered_packets_count.swap(0, Ordering::Relaxed) as i64,
@ -258,8 +265,8 @@ impl BankingStage {
cluster_info: &Arc<ClusterInfo>,
poh_recorder: &Arc<Mutex<PohRecorder>>,
verified_receiver: CrossbeamReceiver<Vec<Packets>>,
verified_vote_receiver: CrossbeamReceiver<Vec<Packets>>,
tpu_verified_vote_receiver: CrossbeamReceiver<Vec<Packets>>,
verified_vote_receiver: CrossbeamReceiver<Vec<Packets>>,
num_threads: u32,
transaction_status_sender: Option<TransactionStatusSender>,
gossip_vote_sender: ReplayVoteSender,
@ -1258,8 +1265,8 @@ impl BankingStage {
buffered_packets,
msgs,
packet_indexes,
&mut dropped_packets_count,
&mut dropped_packet_batches_count,
&mut dropped_packets_count,
&mut newly_buffered_packets_count,
batch_limit,
duplicates,
@ -1353,6 +1360,9 @@ impl BankingStage {
banking_stage_stats
.dropped_packet_batches_count
.fetch_add(dropped_packet_batches_count, Ordering::Relaxed);
banking_stage_stats
.dropped_packets_count
.fetch_add(dropped_packets_count, Ordering::Relaxed);
banking_stage_stats
.newly_buffered_packets_count
.fetch_add(newly_buffered_packets_count, Ordering::Relaxed);
@ -1379,6 +1389,7 @@ impl BankingStage {
banking_stage_stats: &BankingStageStats,
) {
{
let original_packets_count = packet_indexes.len();
let mut packet_duplicate_check_time = Measure::start("packet_duplicate_check");
let mut duplicates = duplicates.lock().unwrap();
let (cache, hasher) = duplicates.deref_mut();
@ -1396,6 +1407,12 @@ impl BankingStage {
banking_stage_stats
.packet_duplicate_check_elapsed
.fetch_add(packet_duplicate_check_time.as_us(), Ordering::Relaxed);
banking_stage_stats
.dropped_duplicated_packets_count
.fetch_add(
original_packets_count.saturating_sub(packet_indexes.len()),
Ordering::Relaxed,
);
}
if Self::packet_has_more_unprocessed_transactions(&packet_indexes) {
if unprocessed_packets.len() >= batch_limit {

View File

@ -22,8 +22,10 @@ use {
solana_metrics::{inc_new_counter_error, inc_new_counter_info},
solana_poh::poh_recorder::WorkingBankEntry,
solana_runtime::{bank::Bank, bank_forks::BankForks},
solana_sdk::timing::{timestamp, AtomicInterval},
solana_sdk::{clock::Slot, pubkey::Pubkey},
solana_sdk::{
timing::{timestamp, AtomicInterval},
{clock::Slot, pubkey::Pubkey},
},
solana_streamer::{
sendmmsg::{batch_send, SendPktsError},
socket::SocketAddrSpace,
@ -31,9 +33,11 @@ use {
std::{
collections::HashMap,
net::UdpSocket,
sync::atomic::{AtomicBool, Ordering},
sync::mpsc::{channel, Receiver, RecvError, RecvTimeoutError, Sender},
sync::{Arc, Mutex, RwLock},
sync::{
atomic::{AtomicBool, Ordering},
mpsc::{channel, Receiver, RecvError, RecvTimeoutError, Sender},
Arc, Mutex, RwLock,
},
thread::{self, Builder, JoinHandle},
time::{Duration, Instant},
},
@ -399,9 +403,9 @@ pub fn broadcast_shreds(
cluster_nodes_cache: &ClusterNodesCache<BroadcastStage>,
last_datapoint_submit: &Arc<AtomicInterval>,
transmit_stats: &mut TransmitShredsStats,
socket_addr_space: &SocketAddrSpace,
cluster_info: &ClusterInfo,
bank_forks: &Arc<RwLock<BankForks>>,
socket_addr_space: &SocketAddrSpace,
) -> Result<()> {
let mut result = Ok(());
let mut shred_select = Measure::start("shred_select");

View File

@ -145,9 +145,9 @@ impl BroadcastRun for FailEntryVerificationBroadcastRun {
&self.cluster_nodes_cache,
&Arc::new(AtomicInterval::default()),
&mut TransmitShredsStats::default(),
cluster_info.socket_addr_space(),
cluster_info,
bank_forks,
cluster_info.socket_addr_space(),
)
}
fn record(

View File

@ -362,9 +362,9 @@ impl StandardBroadcastRun {
&self.cluster_nodes_cache,
&self.last_datapoint_submit,
&mut transmit_stats,
cluster_info.socket_addr_space(),
cluster_info,
bank_forks,
cluster_info.socket_addr_space(),
)?;
transmit_time.stop();

View File

@ -63,6 +63,11 @@ impl ReplaySlotStats {
("load_us", self.execute_timings.load_us, i64),
("execute_us", self.execute_timings.execute_us, i64),
("store_us", self.execute_timings.store_us, i64),
(
"update_stakes_cache_us",
self.execute_timings.update_stakes_cache_us,
i64
),
(
"total_batches_len",
self.execute_timings.total_batches_len,

View File

@ -41,8 +41,11 @@ use solana_rpc::{
rpc_subscriptions::RpcSubscriptions,
};
use solana_runtime::{
accounts_background_service::AbsRequestSender, bank::Bank, bank_forks::BankForks,
commitment::BlockCommitmentCache, vote_sender_types::ReplayVoteSender,
accounts_background_service::AbsRequestSender,
bank::{Bank, NewBankOptions},
bank_forks::BankForks,
commitment::BlockCommitmentCache,
vote_sender_types::ReplayVoteSender,
};
use solana_sdk::{
clock::{Slot, MAX_PROCESSING_AGE, NUM_CONSECUTIVE_LEADER_SLOTS},
@ -128,6 +131,7 @@ pub struct ReplayStageConfig {
pub cache_block_meta_sender: Option<CacheBlockMetaSender>,
pub bank_notification_sender: Option<BankNotificationSender>,
pub wait_for_vote_to_start_leader: bool,
pub disable_epoch_boundary_optimization: bool,
}
#[derive(Default)]
@ -327,6 +331,7 @@ impl ReplayStage {
cache_block_meta_sender,
bank_notification_sender,
wait_for_vote_to_start_leader,
disable_epoch_boundary_optimization,
} = config;
trace!("replay stage");
@ -689,6 +694,7 @@ impl ReplayStage {
&retransmit_slots_sender,
&mut skipped_slots_info,
has_new_vote_been_rooted,
disable_epoch_boundary_optimization,
);
let poh_bank = poh_recorder.lock().unwrap().bank();
@ -1069,6 +1075,7 @@ impl ReplayStage {
}
}
#[allow(clippy::too_many_arguments)]
fn maybe_start_leader(
my_pubkey: &Pubkey,
bank_forks: &Arc<RwLock<BankForks>>,
@ -1079,6 +1086,7 @@ impl ReplayStage {
retransmit_slots_sender: &RetransmitSlotsSender,
skipped_slots_info: &mut SkippedSlotsInfo,
has_new_vote_been_rooted: bool,
disable_epoch_boundary_optimization: bool,
) {
// all the individual calls to poh_recorder.lock() are designed to
// increase granularity, decrease contention
@ -1196,7 +1204,10 @@ impl ReplayStage {
root_slot,
my_pubkey,
rpc_subscriptions,
vote_only_bank,
NewBankOptions {
vote_only_bank,
disable_epoch_boundary_optimization,
},
);
let tpu_bank = bank_forks.write().unwrap().insert(tpu_bank);
@ -2452,7 +2463,7 @@ impl ReplayStage {
forks.root(),
&leader,
rpc_subscriptions,
false,
NewBankOptions::default(),
);
let empty: Vec<Pubkey> = vec![];
Self::update_fork_propagated_threshold_from_votes(
@ -2479,10 +2490,10 @@ impl ReplayStage {
root_slot: u64,
leader: &Pubkey,
rpc_subscriptions: &Arc<RpcSubscriptions>,
vote_only_bank: bool,
new_bank_options: NewBankOptions,
) -> Bank {
rpc_subscriptions.notify_slot(slot, parent.slot(), root_slot);
Bank::new_from_parent_with_vote_only(parent, leader, slot, vote_only_bank)
Bank::new_from_parent_with_options(parent, leader, slot, new_bank_options)
}
fn record_rewards(bank: &Bank, rewards_recorder_sender: &Option<RewardsRecorderSender>) {

View File

@ -10,16 +10,14 @@ use crossbeam_channel::{SendError, Sender as CrossbeamSender};
use solana_measure::measure::Measure;
use solana_metrics::datapoint_debug;
use solana_perf::packet::Packets;
use solana_perf::perf_libs;
use solana_sdk::timing;
use solana_streamer::streamer::{self, PacketReceiver, StreamerError};
use std::collections::HashMap;
use std::sync::mpsc::{Receiver, RecvTimeoutError};
use std::sync::{Arc, Mutex};
use std::thread::{self, Builder, JoinHandle};
use thiserror::Error;
const RECV_BATCH_MAX_CPU: usize = 1_000;
const RECV_BATCH_MAX_GPU: usize = 5_000;
const MAX_SIGVERIFY_BATCH: usize = 10_000;
#[derive(Error, Debug)]
pub enum SigVerifyServiceError {
@ -33,7 +31,7 @@ pub enum SigVerifyServiceError {
type Result<T> = std::result::Result<T, SigVerifyServiceError>;
pub struct SigVerifyStage {
thread_hdls: Vec<JoinHandle<()>>,
thread_hdl: JoinHandle<()>,
}
pub trait SigVerifier {
@ -57,49 +55,67 @@ impl SigVerifyStage {
verified_sender: CrossbeamSender<Vec<Packets>>,
verifier: T,
) -> Self {
let thread_hdls = Self::verifier_services(packet_receiver, verified_sender, verifier);
Self { thread_hdls }
let thread_hdl = Self::verifier_services(packet_receiver, verified_sender, verifier);
Self { thread_hdl }
}
pub fn discard_excess_packets(batches: &mut Vec<Packets>, max_packets: usize) {
let mut received_ips = HashMap::new();
for (batch_index, batch) in batches.iter().enumerate() {
for (packet_index, packets) in batch.packets.iter().enumerate() {
let e = received_ips
.entry(packets.meta.addr().ip())
.or_insert_with(Vec::new);
e.push((batch_index, packet_index));
}
}
let mut batch_len = 0;
while batch_len < max_packets {
for (_ip, indexes) in received_ips.iter_mut() {
if !indexes.is_empty() {
indexes.remove(0);
batch_len += 1;
if batch_len >= MAX_SIGVERIFY_BATCH {
break;
}
}
}
}
for (_addr, indexes) in received_ips {
for (batch_index, packet_index) in indexes {
batches[batch_index].packets[packet_index].meta.discard = true;
}
}
}
fn verifier<T: SigVerifier>(
recvr: &Arc<Mutex<PacketReceiver>>,
recvr: &PacketReceiver,
sendr: &CrossbeamSender<Vec<Packets>>,
id: usize,
verifier: &T,
) -> Result<()> {
let (batch, len, recv_time) = streamer::recv_batch(
&recvr.lock().expect("'recvr' lock in fn verifier"),
if perf_libs::api().is_some() {
RECV_BATCH_MAX_GPU
} else {
RECV_BATCH_MAX_CPU
},
)?;
let (mut batches, len, recv_time) = streamer::recv_batch(recvr)?;
let mut verify_batch_time = Measure::start("sigverify_batch_time");
let batch_len = batch.len();
debug!(
"@{:?} verifier: verifying: {} id: {}",
timing::timestamp(),
len,
id
);
sendr.send(verifier.verify_batch(batch))?;
let batches_len = batches.len();
debug!("@{:?} verifier: verifying: {}", timing::timestamp(), len,);
if len > MAX_SIGVERIFY_BATCH {
Self::discard_excess_packets(&mut batches, MAX_SIGVERIFY_BATCH);
}
sendr.send(verifier.verify_batch(batches))?;
verify_batch_time.stop();
debug!(
"@{:?} verifier: done. batches: {} total verify time: {:?} id: {} verified: {} v/s {}",
"@{:?} verifier: done. batches: {} total verify time: {:?} verified: {} v/s {}",
timing::timestamp(),
batch_len,
batches_len,
verify_batch_time.as_ms(),
id,
len,
(len as f32 / verify_batch_time.as_s())
);
datapoint_debug!(
"sigverify_stage-total_verify_time",
("num_batches", batch_len, i64),
("num_batches", batches_len, i64),
("num_packets", len, i64),
("verify_time_ms", verify_batch_time.as_ms(), i64),
("recv_time", recv_time, i64),
@ -109,16 +125,15 @@ impl SigVerifyStage {
}
fn verifier_service<T: SigVerifier + 'static + Send + Clone>(
packet_receiver: Arc<Mutex<PacketReceiver>>,
packet_receiver: PacketReceiver,
verified_sender: CrossbeamSender<Vec<Packets>>,
id: usize,
verifier: &T,
) -> JoinHandle<()> {
let verifier = verifier.clone();
Builder::new()
.name(format!("solana-verifier-{}", id))
.name("solana-verifier".to_string())
.spawn(move || loop {
if let Err(e) = Self::verifier(&packet_receiver, &verified_sender, id, &verifier) {
if let Err(e) = Self::verifier(&packet_receiver, &verified_sender, &verifier) {
match e {
SigVerifyServiceError::Streamer(StreamerError::RecvTimeout(
RecvTimeoutError::Disconnected,
@ -140,19 +155,43 @@ impl SigVerifyStage {
packet_receiver: PacketReceiver,
verified_sender: CrossbeamSender<Vec<Packets>>,
verifier: T,
) -> Vec<JoinHandle<()>> {
let receiver = Arc::new(Mutex::new(packet_receiver));
(0..4)
.map(|id| {
Self::verifier_service(receiver.clone(), verified_sender.clone(), id, &verifier)
})
.collect()
) -> JoinHandle<()> {
Self::verifier_service(packet_receiver, verified_sender, &verifier)
}
pub fn join(self) -> thread::Result<()> {
for thread_hdl in self.thread_hdls {
thread_hdl.join()?;
}
Ok(())
self.thread_hdl.join()
}
}
#[cfg(test)]
mod tests {
use super::*;
use solana_perf::packet::Packet;
fn count_non_discard(packets: &[Packets]) -> usize {
packets
.iter()
.map(|pp| {
pp.packets
.iter()
.map(|p| if p.meta.discard { 0 } else { 1 })
.sum::<usize>()
})
.sum::<usize>()
}
#[test]
fn test_packet_discard() {
solana_logger::setup();
let mut p = Packets::default();
p.packets.resize(10, Packet::default());
p.packets[3].meta.addr = [1u16; 8];
let mut packets = vec![p];
let max = 3;
SigVerifyStage::discard_excess_packets(&mut packets, max);
assert_eq!(count_non_discard(&packets), max);
assert!(!packets[0].packets[0].meta.discard);
assert!(!packets[0].packets[3].meta.discard);
}
}

View File

@ -91,6 +91,7 @@ pub struct TvuConfig {
pub rocksdb_max_compaction_jitter: Option<u64>,
pub wait_for_vote_to_start_leader: bool,
pub accounts_shrink_ratio: AccountShrinkThreshold,
pub disable_epoch_boundary_optimization: bool,
}
impl Tvu {
@ -273,6 +274,7 @@ impl Tvu {
cache_block_meta_sender,
bank_notification_sender,
wait_for_vote_to_start_leader: tvu_config.wait_for_vote_to_start_leader,
disable_epoch_boundary_optimization: tvu_config.disable_epoch_boundary_optimization,
};
let (voting_sender, voting_receiver) = channel();

View File

@ -1,5 +1,6 @@
//! The `validator` module hosts all the validator microservices.
pub use solana_perf::report_target_features;
use {
crate::{
broadcast_stage::BroadcastStageType,
@ -52,6 +53,7 @@ use {
rpc_pubsub_service::{PubSubConfig, PubSubService},
rpc_service::JsonRpcService,
rpc_subscriptions::RpcSubscriptions,
send_transaction_service,
transaction_status_service::TransactionStatusService,
},
solana_runtime::{
@ -132,8 +134,7 @@ pub struct ValidatorConfig {
pub contact_debug_interval: u64,
pub contact_save_interval: u64,
pub bpf_jit: bool,
pub send_transaction_retry_ms: u64,
pub send_transaction_leader_forward_count: u64,
pub send_transaction_service_config: send_transaction_service::Config,
pub no_poh_speed_test: bool,
pub poh_pinned_cpu_core: usize,
pub poh_hashes_per_batch: u64,
@ -147,6 +148,7 @@ pub struct ValidatorConfig {
pub validator_exit: Arc<RwLock<Exit>>,
pub no_wait_for_vote_to_start_leader: bool,
pub accounts_shrink_ratio: AccountShrinkThreshold,
pub disable_epoch_boundary_optimization: bool,
}
impl Default for ValidatorConfig {
@ -189,8 +191,7 @@ impl Default for ValidatorConfig {
contact_debug_interval: DEFAULT_CONTACT_DEBUG_INTERVAL_MILLIS,
contact_save_interval: DEFAULT_CONTACT_SAVE_INTERVAL_MILLIS,
bpf_jit: false,
send_transaction_retry_ms: 2000,
send_transaction_leader_forward_count: 2,
send_transaction_service_config: send_transaction_service::Config::default(),
no_poh_speed_test: true,
poh_pinned_cpu_core: poh_service::DEFAULT_PINNED_CPU_CORE,
poh_hashes_per_batch: poh_service::DEFAULT_HASHES_PER_BATCH,
@ -204,6 +205,7 @@ impl Default for ValidatorConfig {
validator_exit: Arc::new(RwLock::new(Exit::default())),
no_wait_for_vote_to_start_leader: true,
accounts_shrink_ratio: AccountShrinkThreshold::default(),
disable_epoch_boundary_optimization: false,
}
}
}
@ -546,8 +548,7 @@ impl Validator {
config.trusted_validators.clone(),
rpc_override_health_check.clone(),
optimistically_confirmed_bank.clone(),
config.send_transaction_retry_ms,
config.send_transaction_leader_forward_count,
config.send_transaction_service_config.clone(),
max_slots.clone(),
leader_schedule_cache.clone(),
max_complete_transaction_status_slot,
@ -753,6 +754,7 @@ impl Validator {
rocksdb_max_compaction_jitter: config.rocksdb_compaction_interval,
wait_for_vote_to_start_leader,
accounts_shrink_ratio: config.accounts_shrink_ratio,
disable_epoch_boundary_optimization: config.disable_epoch_boundary_optimization,
},
&max_slots,
);
@ -1445,76 +1447,6 @@ fn wait_for_supermajority(
Ok(true)
}
fn is_rosetta_emulated() -> bool {
#[cfg(target_os = "macos")]
{
use std::str::FromStr;
std::process::Command::new("sysctl")
.args(&["-in", "sysctl.proc_translated"])
.output()
.map_err(|_| ())
.and_then(|output| String::from_utf8(output.stdout).map_err(|_| ()))
.and_then(|stdout| u8::from_str(stdout.trim()).map_err(|_| ()))
.map(|enabled| enabled == 1)
.unwrap_or(false)
}
#[cfg(not(target_os = "macos"))]
{
false
}
}
pub fn report_target_features() {
warn!(
"CUDA is {}abled",
if solana_perf::perf_libs::api().is_some() {
"en"
} else {
"dis"
}
);
if !is_rosetta_emulated() {
unsafe { check_avx() };
unsafe { check_avx2() };
}
}
// Validator binaries built on a machine with AVX support will generate invalid opcodes
// when run on machines without AVX causing a non-obvious process abort. Instead detect
// the mismatch and error cleanly.
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[target_feature(enable = "avx")]
unsafe fn check_avx() {
if is_x86_feature_detected!("avx") {
info!("AVX detected");
} else {
error!(
"Incompatible CPU detected: missing AVX support. Please build from source on the target"
);
abort();
}
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
unsafe fn check_avx() {}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[target_feature(enable = "avx2")]
unsafe fn check_avx2() {
if is_x86_feature_detected!("avx2") {
info!("AVX2 detected");
} else {
error!(
"Incompatible CPU detected: missing AVX2 support. Please build from source on the target"
);
abort();
}
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
unsafe fn check_avx2() {}
// Get the activated stake percentage (based on the provided bank) that is visible in gossip
fn get_stake_percent_in_gossip(bank: &Bank, cluster_info: &ClusterInfo, log: bool) -> u64 {
let mut online_stake = 0;

View File

@ -158,6 +158,9 @@ pub(crate) fn should_retransmit_and_persist(
} else if shred.index() >= MAX_DATA_SHREDS_PER_SLOT as u32 {
inc_new_counter_warn!("streamer-recv_window-shred_index_overrun", 1);
false
} else if shred.data_header.size as usize > shred.payload.len() {
inc_new_counter_warn!("streamer-recv_window-shred_bad_meta_size", 1);
false
} else {
true
}
@ -729,7 +732,7 @@ mod test {
));
let cache = Arc::new(LeaderScheduleCache::new_from_bank(&bank));
let mut shreds = local_entries_to_shred(&[Entry::default()], 0, 0, &leader_keypair);
let shreds = local_entries_to_shred(&[Entry::default()], 0, 0, &leader_keypair);
// with a Bank for slot 0, shred continues
assert!(should_retransmit_and_persist(
@ -781,9 +784,22 @@ mod test {
));
// with a Bank and no idea who leader is, shred gets thrown out
shreds[0].set_slot(MINIMUM_SLOTS_PER_EPOCH as u64 * 3);
let mut bad_slot_shred = shreds[0].clone();
bad_slot_shred.set_slot(MINIMUM_SLOTS_PER_EPOCH as u64 * 3);
assert!(!should_retransmit_and_persist(
&shreds[0],
&bad_slot_shred,
Some(bank.clone()),
&cache,
&me_id,
0,
0
));
// with a bad header size
let mut bad_header_shred = shreds[0].clone();
bad_header_shred.data_header.size = (bad_header_shred.payload.len() + 1) as u16;
assert!(!should_retransmit_and_persist(
&bad_header_shred,
Some(bank.clone()),
&cache,
&me_id,

View File

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

View File

@ -1,6 +1,10 @@
---
title: Delegate Stake
title: Staking
---
For an overview of staking, read first the
[Staking and Inflation FAQ](https://solana.com/staking).
------
After you have [received SOL](transfer-tokens.md), you might consider putting
it to use by delegating _stake_ to a validator. Stake is what we call tokens

View File

@ -3039,7 +3039,7 @@ curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
Result:
```json
{"jsonrpc":"2.0","result":{"solana-core": "1.7.13"},"id":1}
{"jsonrpc":"2.0","result":{"solana-core": "1.7.18"},"id":1}
```
### getVoteAccounts
@ -4151,7 +4151,7 @@ Response:
### getConfirmedBlock
**DEPRECATED: Please use [getBlock](jsonrpc-api.md#getblock) instead**
This method is expected to be removed in solana-core v1.8
This method is expected to be removed in solana-core v2.0
Returns identity and transaction information about a confirmed block in the ledger
@ -4345,7 +4345,7 @@ For more details on returned data:
### getConfirmedBlocks
**DEPRECATED: Please use [getBlocks](jsonrpc-api.md#getblocks) instead**
This method is expected to be removed in solana-core v1.8
This method is expected to be removed in solana-core v2.0
Returns a list of confirmed blocks between two slots
@ -4379,7 +4379,7 @@ Result:
### getConfirmedBlocksWithLimit
**DEPRECATED: Please use [getBlocksWithLimit](jsonrpc-api.md#getblockswithlimit) instead**
This method is expected to be removed in solana-core v1.8
This method is expected to be removed in solana-core v2.0
Returns a list of confirmed blocks starting at the given slot
@ -4411,7 +4411,7 @@ Result:
### getConfirmedSignaturesForAddress2
**DEPRECATED: Please use [getSignaturesForAddress](jsonrpc-api.md#getsignaturesforaddress) instead**
This method is expected to be removed in solana-core v1.8
This method is expected to be removed in solana-core v2.0
Returns confirmed signatures for transactions involving an
address backwards in time from the provided signature or most recent confirmed block
@ -4473,7 +4473,7 @@ Result:
### getConfirmedTransaction
**DEPRECATED: Please use [getTransaction](jsonrpc-api.md#gettransaction) instead**
This method is expected to be removed in solana-core v1.8
This method is expected to be removed in solana-core v2.0
Returns transaction details for a confirmed transaction

View File

@ -23,8 +23,8 @@ any control over the account. In fact, a keypair or private key may not even
exist for a stake account's address.
The only time a stake account's address has a keypair file is when [creating
a stake account using the command line tools](../cli/delegate-stake.md#create-a-stake-account),
a new keypair file is created first only to ensure that the stake account's
a stake account using the command line tools](../cli/delegate-stake.md#create-a-stake-account).
A new keypair file is created first only to ensure that the stake account's
address is new and unique.
#### Understanding Account Authorities
@ -137,7 +137,5 @@ re-created for the address to be used again.
#### Viewing Stake Accounts
Stake account details can be viewed on the Solana Explorer by copying and pasting
an account address into the search bar.
- http://explorer.solana.com/accounts
Stake account details can be viewed on the [Solana Explorer](http://explorer.solana.com/accounts)
by copying and pasting an account address into the search bar.

View File

@ -8,7 +8,7 @@ The following terms are used throughout the documentation.
A record in the Solana ledger that either holds data or is an executable program.
Like an account at a traditional bank, a Solana account may hold funds called [lamports](terminology.md#lamport). Like a file in Linux, it is addressable by a key, often referred to as a [public key](terminology.md#public-key-pubkey) or pubkey.
Like an account at a traditional bank, a Solana account may hold funds called [lamports](#lamport). Like a file in Linux, it is addressable by a key, often referred to as a [public key](#public-key-pubkey) or pubkey.
The key may be one of:
@ -26,59 +26,55 @@ A front-end application that interacts with a Solana cluster.
## bank state
The result of interpreting all programs on the ledger at a given [tick height](terminology.md#tick-height). It includes at least the set of all [accounts](terminology.md#account) holding nonzero [native tokens](terminology.md#native-token).
The result of interpreting all programs on the ledger at a given [tick height](#tick-height). It includes at least the set of all [accounts](#account) holding nonzero [native tokens](#native-token).
## block
A contiguous set of [entries](terminology.md#entry) on the ledger covered by a [vote](terminology.md#ledger-vote). A [leader](terminology.md#leader) produces at most one block per [slot](terminology.md#slot).
A contiguous set of [entries](#entry) on the ledger covered by a [vote](#ledger-vote). A [leader](#leader) produces at most one block per [slot](#slot).
## blockhash
A unique value ([hash](terminology.md#hash)) that identifies a record (block). Solana computes a blockhash from the last [entry id](terminology.md#entry-id) of the block.
A unique value ([hash](#hash)) that identifies a record (block). Solana computes a blockhash from the last [entry id](#entry-id) of the block.
## block height
The number of [blocks](terminology.md#block) beneath the current block. The first block after the [genesis block](terminology.md#genesis-block) has height one.
The number of [blocks](#block) beneath the current block. The first block after the [genesis block](#genesis-block) has height one.
## bootstrap validator
The [validator](terminology.md#validator) that produces the genesis (first) [block](terminology.md#block) of a block chain.
The [validator](#validator) that produces the genesis (first) [block](#block) of a block chain.
## BPF loader
The Solana program that owns and loads [BPF](developing/on-chain-programs/overview#berkeley-packet-filter-bpf) smart contract programs, allowing the program to interface with the runtime.
## CBC block
The smallest encrypted chunk of ledger, an encrypted ledger segment would be made of many CBC blocks. `ledger_segment_size / cbc_block_size` to be exact.
## client
A computer program that accesses the Solana server network [cluster](terminology.md#cluster).
A computer program that accesses the Solana server network [cluster](#cluster).
## cluster
A set of [validators](terminology.md#validator) maintaining a single [ledger](terminology.md#ledger).
A set of [validators](#validator) maintaining a single [ledger](#ledger).
## confirmation time
The wallclock duration between a [leader](terminology.md#leader) creating a [tick entry](terminology.md#tick) and creating a [confirmed block](terminology.md#confirmed-block).
The wallclock duration between a [leader](#leader) creating a [tick entry](#tick) and creating a [confirmed block](#confirmed-block).
## confirmed block
A [block](terminology.md#block) that has received a [supermajority](terminology.md#supermajority) of [ledger votes](terminology.md#ledger-vote).
A [block](#block) that has received a [supermajority](#supermajority) of [ledger votes](#ledger-vote).
## control plane
A gossip network connecting all [nodes](terminology.md#node) of a [cluster](terminology.md#cluster).
A gossip network connecting all [nodes](#node) of a [cluster](#cluster).
## cooldown period
Some number of [epochs](terminology.md#epoch) after [stake](terminology.md#stake) has been deactivated while it progressively becomes available for withdrawal. During this period, the stake is considered to be "deactivating". More info about: [warmup and cooldown](implemented-proposals/staking-rewards.md#stake-warmup-cooldown-withdrawal)
Some number of [epochs](#epoch) after [stake](#stake) has been deactivated while it progressively becomes available for withdrawal. During this period, the stake is considered to be "deactivating". More info about: [warmup and cooldown](implemented-proposals/staking-rewards.md#stake-warmup-cooldown-withdrawal)
## credit
See [vote credit](terminology.md#vote-credit).
See [vote credit](#vote-credit).
## cross-program invocation (CPI)
@ -86,7 +82,7 @@ A call from one smart contract program to another. For more information, see [ca
## data plane
A multicast network used to efficiently validate [entries](terminology.md#entry) and gain consensus.
A multicast network used to efficiently validate [entries](#entry) and gain consensus.
## drone
@ -94,21 +90,21 @@ An off-chain service that acts as a custodian for a user's private key. It typic
## entry
An entry on the [ledger](terminology.md#ledger) either a [tick](terminology.md#tick) or a [transactions entry](terminology.md#transactions-entry).
An entry on the [ledger](#ledger) either a [tick](#tick) or a [transactions entry](#transactions-entry).
## entry id
A preimage resistant [hash](terminology.md#hash) over the final contents of an entry, which acts as the [entry's](terminology.md#entry) globally unique identifier. The hash serves as evidence of:
A preimage resistant [hash](#hash) over the final contents of an entry, which acts as the [entry's](#entry) globally unique identifier. The hash serves as evidence of:
- The entry being generated after a duration of time
- The specified [transactions](terminology.md#transaction) are those included in the entry
- The entry's position with respect to other entries in [ledger](terminology.md#ledger)
- The specified [transactions](#transaction) are those included in the entry
- The entry's position with respect to other entries in [ledger](#ledger)
See [proof of history](terminology.md#proof-of-history-poh).
See [proof of history](#proof-of-history-poh).
## epoch
The time, i.e. number of [slots](terminology.md#slot), for which a [leader schedule](terminology.md#leader-schedule) is valid.
The time, i.e. number of [slots](#slot), for which a [leader schedule](#leader-schedule) is valid.
## fee account
@ -116,19 +112,19 @@ The fee account in the transaction is the account pays for the cost of including
## finality
When nodes representing 2/3rd of the [stake](terminology.md#stake) have a common [root](terminology.md#root).
When nodes representing 2/3rd of the [stake](#stake) have a common [root](#root).
## fork
A [ledger](terminology.md#ledger) derived from common entries but then diverged.
A [ledger](#ledger) derived from common entries but then diverged.
## genesis block
The first [block](terminology.md#block) in the chain.
The first [block](#block) in the chain.
## genesis config
The configuration file that prepares the [ledger](terminology.md#ledger) for the [genesis block](terminology.md#genesis-block).
The configuration file that prepares the [ledger](#ledger) for the [genesis block](#genesis-block).
## hash
@ -140,76 +136,76 @@ An increase in token supply over time used to fund rewards for validation and to
## inner instruction
See [cross-program invocation](terminology.md#cross-program-invocation-cpi).
See [cross-program invocation](#cross-program-invocation-cpi).
## instruction
The smallest contiguous unit of execution logic in a [program](terminology.md#program). An instruction specifies which program it is calling, which accounts it wants to read or modify, and additional data that serves as auxiliary input to the program. A [client](terminology.md#client) can include one or multiple instructions in a [transaction](terminology.md#transaction). An instruction may contain one or more [cross-program invocations](terminology.md#cross-program-invocation-cpi).
The smallest contiguous unit of execution logic in a [program](#program). An instruction specifies which program it is calling, which accounts it wants to read or modify, and additional data that serves as auxiliary input to the program. A [client](#client) can include one or multiple instructions in a [transaction](#transaction). An instruction may contain one or more [cross-program invocations](#cross-program-invocation-cpi).
## keypair
A [public key](terminology.md#public-key-pubkey) and corresponding [private key](terminology.md#private-key) for accessing an account.
A [public key](#public-key-pubkey) and corresponding [private key](#private-key) for accessing an account.
## lamport
A fractional [native token](terminology.md#native-token) with the value of 0.000000001 [sol](terminology.md#sol).
A fractional [native token](#native-token) with the value of 0.000000001 [sol](#sol).
## leader
The role of a [validator](terminology.md#validator) when it is appending [entries](terminology.md#entry) to the [ledger](terminology.md#ledger).
The role of a [validator](#validator) when it is appending [entries](#entry) to the [ledger](#ledger).
## leader schedule
A sequence of [validator](terminology.md#validator) [public keys](terminology.md#public-key-pubkey) mapped to [slots](terminology.md#slot). The cluster uses the leader schedule to determine which validator is the [leader](terminology.md#leader) at any moment in time.
A sequence of [validator](#validator) [public keys](#public-key-pubkey) mapped to [slots](#slot). The cluster uses the leader schedule to determine which validator is the [leader](#leader) at any moment in time.
## ledger
A list of [entries](terminology.md#entry) containing [transactions](terminology.md#transaction) signed by [clients](terminology.md#client).
Conceptually, this can be traced back to the [genesis block](terminology.md#genesis-block), but an actual [validator](terminology.md#validator)'s ledger may have only newer [blocks](terminology.md#block) to reduce storage, as older ones are not needed for validation of future blocks by design.
A list of [entries](#entry) containing [transactions](#transaction) signed by [clients](#client).
Conceptually, this can be traced back to the [genesis block](#genesis-block), but an actual [validator](#validator)'s ledger may have only newer [blocks](#block) to reduce storage, as older ones are not needed for validation of future blocks by design.
## ledger vote
A [hash](terminology.md#hash) of the [validator's state](terminology.md#bank-state) at a given [tick height](terminology.md#tick-height). It comprises a [validator's](terminology.md#validator) affirmation that a [block](terminology.md#block) it has received has been verified, as well as a promise not to vote for a conflicting [block](terminology.md#block) \(i.e. [fork](terminology.md#fork)\) for a specific amount of time, the [lockout](terminology.md#lockout) period.
A [hash](#hash) of the [validator's state](#bank-state) at a given [tick height](#tick-height). It comprises a [validator's](#validator) affirmation that a [block](#block) it has received has been verified, as well as a promise not to vote for a conflicting [block](#block) \(i.e. [fork](#fork)\) for a specific amount of time, the [lockout](#lockout) period.
## light client
A type of [client](terminology.md#client) that can verify it's pointing to a valid [cluster](terminology.md#cluster). It performs more ledger verification than a [thin client](terminology.md#thin-client) and less than a [validator](terminology.md#validator).
A type of [client](#client) that can verify it's pointing to a valid [cluster](#cluster). It performs more ledger verification than a [thin client](#thin-client) and less than a [validator](#validator).
## loader
A [program](terminology.md#program) with the ability to interpret the binary encoding of other on-chain programs.
A [program](#program) with the ability to interpret the binary encoding of other on-chain programs.
## lockout
The duration of time for which a [validator](terminology.md#validator) is unable to [vote](terminology.md#ledger-vote) on another [fork](terminology.md#fork).
The duration of time for which a [validator](#validator) is unable to [vote](#ledger-vote) on another [fork](#fork).
## native token
The [token](terminology.md#token) used to track work done by [nodes](terminology.md#node) in a cluster.
The [token](#token) used to track work done by [nodes](#node) in a cluster.
## node
A computer participating in a [cluster](terminology.md#cluster).
A computer participating in a [cluster](#cluster).
## node count
The number of [validators](terminology.md#validator) participating in a [cluster](terminology.md#cluster).
The number of [validators](#validator) participating in a [cluster](#cluster).
## PoH
See [Proof of History](terminology.md#proof-of-history-poh).
See [Proof of History](#proof-of-history-poh).
## point
A weighted [credit](terminology.md#credit) in a rewards regime. In the [validator](terminology.md#validator) [rewards regime](cluster/stake-delegation-and-rewards.md), the number of points owed to a [stake](terminology.md#stake) during redemption is the product of the [vote credits](terminology.md#vote-credit) earned and the number of lamports staked.
A weighted [credit](#credit) in a rewards regime. In the [validator](#validator) [rewards regime](cluster/stake-delegation-and-rewards.md), the number of points owed to a [stake](#stake) during redemption is the product of the [vote credits](#vote-credit) earned and the number of lamports staked.
## private key
The private key of a [keypair](terminology.md#keypair).
The private key of a [keypair](#keypair).
## program
The code that interprets [instructions](terminology.md#instruction).
The code that interprets [instructions](#instruction).
## program derived account (PDA)
@ -217,23 +213,23 @@ An account whose owner is a program and thus is not controlled by a private key
## program id
The public key of the [account](terminology.md#account) containing a [program](terminology.md#program).
The public key of the [account](#account) containing a [program](#program).
## proof of history (PoH)
A stack of proofs, each which proves that some data existed before the proof was created and that a precise duration of time passed before the previous proof. Like a [VDF](terminology.md#verifiable-delay-function-vdf), a Proof of History can be verified in less time than it took to produce.
A stack of proofs, each which proves that some data existed before the proof was created and that a precise duration of time passed before the previous proof. Like a [VDF](#verifiable-delay-function-vdf), a Proof of History can be verified in less time than it took to produce.
## public key (pubkey)
The public key of a [keypair](terminology.md#keypair).
The public key of a [keypair](#keypair).
## root
A [block](terminology.md#block) or [slot](terminology.md#slot) that has reached maximum [lockout](terminology.md#lockout) on a [validator](terminology.md#validator). The root is the highest block that is an ancestor of all active forks on a validator. All ancestor blocks of a root are also transitively a root. Blocks that are not an ancestor and not a descendant of the root are excluded from consideration for consensus and can be discarded.
A [block](#block) or [slot](#slot) that has reached maximum [lockout](#lockout) on a [validator](#validator). The root is the highest block that is an ancestor of all active forks on a validator. All ancestor blocks of a root are also transitively a root. Blocks that are not an ancestor and not a descendant of the root are excluded from consideration for consensus and can be discarded.
## runtime
The component of a [validator](terminology.md#validator) responsible for [program](terminology.md#program) execution.
The component of a [validator](#validator) responsible for [program](#program) execution.
## Sealevel
@ -241,25 +237,25 @@ Solana's parallel smart contracts run-time.
## shred
A fraction of a [block](terminology.md#block); the smallest unit sent between [validators](terminology.md#validator).
A fraction of a [block](#block); the smallest unit sent between [validators](#validator).
## signature
A 64-byte ed25519 signature of R (32-bytes) and S (32-bytes). With the requirement that R is a packed Edwards point not of small order and S is a scalar in the range of 0 <= S < L.
This requirement ensures no signature malleability. Each transaction must have at least one signature for [fee account](terminology#fee-account).
Thus, the first signature in transaction can be treated as [transacton id](terminology.md#transaction-id)
Thus, the first signature in transaction can be treated as [transacton id](#transaction-id)
## skipped slot
A past [slot](terminology.md#slot) that did not produce a [block](terminology.md#block), because the leader was offline or the [fork](terminology.md#fork) containing the slot was abandoned for a better alternative by cluster consensus. A skipped slot will not appear as an ancestor for blocks at subsequent slots, nor increment the [block height](terminology#block-height), nor expire the oldest `recent_blockhash`.
A past [slot](#slot) that did not produce a [block](#block), because the leader was offline or the [fork](#fork) containing the slot was abandoned for a better alternative by cluster consensus. A skipped slot will not appear as an ancestor for blocks at subsequent slots, nor increment the [block height](terminology#block-height), nor expire the oldest `recent_blockhash`.
Whether a slot has been skipped can only be determined when it becomes older than the latest [rooted](terminology.md#root) (thus not-skipped) slot.
Whether a slot has been skipped can only be determined when it becomes older than the latest [rooted](#root) (thus not-skipped) slot.
## slot
The period of time for which each [leader](terminology.md#leader) ingests transactions and produces a [block](terminology.md#block).
The period of time for which each [leader](#leader) ingests transactions and produces a [block](#block).
Collectively, slots create a logical clock. Slots are ordered sequentially and non-overlapping, comprising roughly equal real-world time as per [PoH](terminology.md#proof-of-history-poh).
Collectively, slots create a logical clock. Slots are ordered sequentially and non-overlapping, comprising roughly equal real-world time as per [PoH](#proof-of-history-poh).
## smart contract
@ -267,7 +263,7 @@ A program on a blockchain that can read and modify accounts over which it has co
## sol
The [native token](terminology.md#native-token) of a Solana [cluster](terminology.md#cluster).
The [native token](#native-token) of a Solana [cluster](#cluster).
## Solana Program Library (SPL)
@ -275,27 +271,27 @@ A library of programs on Solana such as spl-token that facilitates tasks such as
## stake
Tokens forfeit to the [cluster](terminology.md#cluster) if malicious [validator](terminology.md#validator) behavior can be proven.
Tokens forfeit to the [cluster](#cluster) if malicious [validator](#validator) behavior can be proven.
## supermajority
2/3 of a [cluster](terminology.md#cluster).
2/3 of a [cluster](#cluster).
## sysvar
A system [account](terminology.md#account). [Sysvars](developing/runtime-facilities/sysvars.md) provide cluster state information such as current tick height, rewards [points](terminology.md#point) values, etc. Programs can access Sysvars via a Sysvar account (pubkey) or by querying via a syscall.
A system [account](#account). [Sysvars](developing/runtime-facilities/sysvars.md) provide cluster state information such as current tick height, rewards [points](#point) values, etc. Programs can access Sysvars via a Sysvar account (pubkey) or by querying via a syscall.
## thin client
A type of [client](terminology.md#client) that trusts it is communicating with a valid [cluster](terminology.md#cluster).
A type of [client](#client) that trusts it is communicating with a valid [cluster](#cluster).
## tick
A ledger [entry](terminology.md#entry) that estimates wallclock duration.
A ledger [entry](#entry) that estimates wallclock duration.
## tick height
The Nth [tick](terminology.md#tick) in the [ledger](terminology.md#ledger).
The Nth [tick](#tick) in the [ledger](#ledger).
## token
@ -303,31 +299,31 @@ A digitally transferable asset.
## tps
[Transactions](terminology.md#transaction) per second.
[Transactions](#transaction) per second.
## transaction
One or more [instructions](terminology.md#instruction) signed by a [client](terminology.md#client) using one or more [keypairs](terminology.md#keypair) and executed atomically with only two possible outcomes: success or failure.
One or more [instructions](#instruction) signed by a [client](#client) using one or more [keypairs](#keypair) and executed atomically with only two possible outcomes: success or failure.
## transaction id
The first [signature](terminology.md#signature) in a [transaction](terminology.md#transaction), which can be used to uniquely identify the transaction across the complete [ledger](terminology.md#ledger).
The first [signature](#signature) in a [transaction](#transaction), which can be used to uniquely identify the transaction across the complete [ledger](#ledger).
## transaction confirmations
The number of [confirmed blocks](terminology.md#confirmed-block) since the transaction was accepted onto the [ledger](terminology.md#ledger). A transaction is finalized when its block becomes a [root](terminology.md#root).
The number of [confirmed blocks](#confirmed-block) since the transaction was accepted onto the [ledger](#ledger). A transaction is finalized when its block becomes a [root](#root).
## transactions entry
A set of [transactions](terminology.md#transaction) that may be executed in parallel.
A set of [transactions](#transaction) that may be executed in parallel.
## validator
A full participant in a Solana network [cluster](terminology.md#cluster) that produces new [blocks](terminology.md#block). A validator validates the transactions added to the [ledger](terminology.md#ledger)
A full participant in a Solana network [cluster](#cluster) that produces new [blocks](#block). A validator validates the transactions added to the [ledger](#ledger)
## VDF
See [verifiable delay function](terminology.md#verifiable-delay-function-vdf).
See [verifiable delay function](#verifiable-delay-function-vdf).
## verifiable delay function (VDF)
@ -335,16 +331,16 @@ A function that takes a fixed amount of time to execute that produces a proof th
## vote
See [ledger vote](terminology.md#ledger-vote).
See [ledger vote](#ledger-vote).
## vote credit
A reward tally for [validators](terminology.md#validator). A vote credit is awarded to a validator in its vote account when the validator reaches a [root](terminology.md#root).
A reward tally for [validators](#validator). A vote credit is awarded to a validator in its vote account when the validator reaches a [root](#root).
## wallet
A collection of [keypairs](terminology.md#keypair) that allows users to manage their funds.
A collection of [keypairs](#keypair) that allows users to manage their funds.
## warmup period
Some number of [epochs](terminology.md#epoch) after [stake](terminology.md#stake) has been delegated while it progressively becomes effective. During this period, the stake is considered to be "activating". More info about: [warmup and cooldown](cluster/stake-delegation-and-rewards.md#stake-warmup-cooldown-withdrawal)
Some number of [epochs](#epoch) after [stake](#stake) has been delegated while it progressively becomes effective. During this period, the stake is considered to be "activating". More info about: [warmup and cooldown](cluster/stake-delegation-and-rewards.md#stake-warmup-cooldown-withdrawal)

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-dos"
version = "1.7.13"
version = "1.7.18"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -14,17 +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.7.13" }
solana-core = { path = "../core", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -12,6 +12,13 @@ use std::process::exit;
use std::str::FromStr;
use std::time::{Duration, Instant};
fn get_repair_contact(nodes: &[ContactInfo]) -> ContactInfo {
let source = thread_rng().gen_range(0, nodes.len());
let mut contact = nodes[source].clone();
contact.id = solana_sdk::pubkey::new_rand();
contact
}
fn run_dos(
nodes: &[ContactInfo],
iterations: usize,
@ -56,34 +63,35 @@ fn run_dos(
let mut data = Vec::new();
if !nodes.is_empty() {
let source = thread_rng().gen_range(0, nodes.len());
let mut contact = nodes[source].clone();
contact.id = solana_sdk::pubkey::new_rand();
match data_type.as_str() {
"repair_highest" => {
let slot = 100;
let req = RepairProtocol::WindowIndexWithNonce(contact, slot, 0, 0);
data = bincode::serialize(&req).unwrap();
}
"repair_shred" => {
let slot = 100;
let req = RepairProtocol::HighestWindowIndexWithNonce(contact, slot, 0, 0);
data = bincode::serialize(&req).unwrap();
}
"repair_orphan" => {
let slot = 100;
let req = RepairProtocol::OrphanWithNonce(contact, slot, 0);
data = bincode::serialize(&req).unwrap();
}
"random" => {
data.resize(data_size, 0);
}
"get_account_info" => {}
"get_program_accounts" => {}
&_ => {
panic!("unknown data type");
}
match data_type.as_str() {
"repair_highest" => {
let slot = 100;
let req = RepairProtocol::WindowIndexWithNonce(get_repair_contact(nodes), slot, 0, 0);
data = bincode::serialize(&req).unwrap();
}
"repair_shred" => {
let slot = 100;
let req =
RepairProtocol::HighestWindowIndexWithNonce(get_repair_contact(nodes), slot, 0, 0);
data = bincode::serialize(&req).unwrap();
}
"repair_orphan" => {
let slot = 100;
let req = RepairProtocol::OrphanWithNonce(get_repair_contact(nodes), slot, 0);
data = bincode::serialize(&req).unwrap();
}
"random" => {
data.resize(data_size, 0);
}
"transaction" => {
let tx = solana_perf::test_tx::test_tx();
info!("{:?}", tx);
data = bincode::serialize(&tx).unwrap();
}
"get_account_info" => {}
"get_program_accounts" => {}
&_ => {
panic!("unknown data type");
}
}
@ -183,6 +191,7 @@ fn main() {
"random",
"get_account_info",
"get_program_accounts",
"transaction",
])
.help("Type of data to send"),
)

View File

@ -1,6 +1,6 @@
[package]
name = "solana-download-utils"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
tar = "0.4.37"
[lib]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-faucet"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-cli-config = { path = "../cli-config", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-cli-config = { path = "../cli-config", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13" }
solana-frozen-abi-macro = { path = "macro", version = "=1.7.18" }
thiserror = "1.0"
[target.'cfg(not(target_arch = "bpf"))'.dependencies]
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13"
version = "1.7.18"
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.7.13" }
solana-download-utils = { path = "../download-utils", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-download-utils = { path = "../download-utils", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
[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.7.13"
version = "1.7.18"
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.7.13" }
solana-cli-config = { path = "../cli-config", version = "=1.7.13" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-cli-config = { path = "../cli-config", version = "=1.7.18" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.7.13" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-net-utils = { path = "../net-utils", version = "=1.7.13" }
solana-perf = { path = "../perf", version = "=1.7.13" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.7.18" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-net-utils = { path = "../net-utils", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
thiserror = "1.0"
[dev-dependencies]

View File

@ -255,7 +255,7 @@ pub fn make_accounts_hashes_message(
pub(crate) type Ping = ping_pong::Ping<[u8; GOSSIP_PING_TOKEN_SIZE]>;
// TODO These messages should go through the gpu pipeline for spam filtering
#[frozen_abi(digest = "3qq56sFGXGbNqr7qKq8x47t144ugdfv5adCkVJUMnMf3")]
#[frozen_abi(digest = "D2ebKKmm6EQ8JJjYc3xUpzpBTJguqgEzShhj9fiUcP6F")]
#[derive(Serialize, Deserialize, Debug, AbiEnumVisitor, AbiExample)]
#[allow(clippy::large_enum_variant)]
pub(crate) enum Protocol {
@ -372,7 +372,7 @@ fn retain_staked(values: &mut Vec<CrdsValue>, stakes: &HashMap<Pubkey, u64>) {
// Unstaked nodes can still help repair.
CrdsData::EpochSlots(_, _) => true,
// Unstaked nodes can still serve snapshots.
CrdsData::SnapshotHashes(_) => true,
CrdsData::SnapshotHashes(_) | CrdsData::IncrementalSnapshotHashes(_) => true,
// Otherwise unstaked voting nodes will show up with no version in
// the various dashboards.
CrdsData::Version(_) => true,

View File

@ -163,11 +163,12 @@ pub(crate) fn submit_gossip_stats(
gossip: &RwLock<CrdsGossip>,
stakes: &HashMap<Pubkey, u64>,
) {
let (table_size, num_nodes, purged_values_size, failed_inserts_size) = {
let (table_size, num_nodes, num_pubkeys, purged_values_size, failed_inserts_size) = {
let gossip = gossip.read().unwrap();
(
gossip.crds.len(),
gossip.crds.num_nodes(),
gossip.crds.num_pubkeys(),
gossip.crds.num_purged(),
gossip.pull.failed_inserts.len(),
)
@ -192,6 +193,7 @@ pub(crate) fn submit_gossip_stats(
("failed_inserts_size", failed_inserts_size as i64, i64),
("num_nodes", num_nodes as i64, i64),
("num_nodes_staked", num_nodes_staked as i64, i64),
("num_pubkeys", num_pubkeys, i64),
);
datapoint_info!(
"cluster_info_stats2",

View File

@ -319,8 +319,13 @@ impl Crds {
.map(move |i| self.table.index(*i))
}
/// Returns number of known pubkeys (network size).
/// Returns number of known contact-infos (network size).
pub(crate) fn num_nodes(&self) -> usize {
self.nodes.len()
}
/// Returns number of unique pubkeys.
pub(crate) fn num_pubkeys(&self) -> usize {
self.records.len()
}

View File

@ -91,6 +91,7 @@ pub enum CrdsData {
Version(Version),
NodeInstance(NodeInstance),
DuplicateShred(DuplicateShredIndex, DuplicateShred),
IncrementalSnapshotHashes(IncrementalSnapshotHashes),
}
impl Sanitize for CrdsData {
@ -127,6 +128,7 @@ impl Sanitize for CrdsData {
shred.sanitize()
}
}
CrdsData::IncrementalSnapshotHashes(val) => val.sanitize(),
}
}
}
@ -204,6 +206,33 @@ impl SnapshotHash {
}
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)]
pub struct IncrementalSnapshotHashes {
from: Pubkey,
base: (Slot, Hash),
hashes: Vec<(Slot, Hash)>,
wallclock: u64,
}
impl Sanitize for IncrementalSnapshotHashes {
fn sanitize(&self) -> Result<(), SanitizeError> {
sanitize_wallclock(self.wallclock)?;
if self.base.0 >= MAX_SLOT {
return Err(SanitizeError::ValueOutOfBounds);
}
for (slot, _) in &self.hashes {
if *slot >= MAX_SLOT {
return Err(SanitizeError::ValueOutOfBounds);
}
if self.base.0 >= *slot {
return Err(SanitizeError::InvalidValue);
}
}
self.from.sanitize()
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)]
pub struct LowestSlot {
pub from: Pubkey,
@ -470,6 +499,7 @@ pub enum CrdsValueLabel {
Version(Pubkey),
NodeInstance(Pubkey),
DuplicateShred(DuplicateShredIndex, Pubkey),
IncrementalSnapshotHashes(Pubkey),
}
impl fmt::Display for CrdsValueLabel {
@ -485,6 +515,9 @@ impl fmt::Display for CrdsValueLabel {
CrdsValueLabel::Version(_) => write!(f, "Version({})", self.pubkey()),
CrdsValueLabel::NodeInstance(pk) => write!(f, "NodeInstance({})", pk),
CrdsValueLabel::DuplicateShred(ix, pk) => write!(f, "DuplicateShred({}, {})", ix, pk),
CrdsValueLabel::IncrementalSnapshotHashes(_) => {
write!(f, "IncrementalSnapshotHashes({})", self.pubkey())
}
}
}
}
@ -502,6 +535,7 @@ impl CrdsValueLabel {
CrdsValueLabel::Version(p) => *p,
CrdsValueLabel::NodeInstance(p) => *p,
CrdsValueLabel::DuplicateShred(_, p) => *p,
CrdsValueLabel::IncrementalSnapshotHashes(p) => *p,
}
}
}
@ -550,6 +584,7 @@ impl CrdsValue {
CrdsData::Version(version) => version.wallclock,
CrdsData::NodeInstance(node) => node.wallclock,
CrdsData::DuplicateShred(_, shred) => shred.wallclock,
CrdsData::IncrementalSnapshotHashes(hash) => hash.wallclock,
}
}
pub fn pubkey(&self) -> Pubkey {
@ -564,6 +599,7 @@ impl CrdsValue {
CrdsData::Version(version) => version.from,
CrdsData::NodeInstance(node) => node.from,
CrdsData::DuplicateShred(_, shred) => shred.from,
CrdsData::IncrementalSnapshotHashes(hash) => hash.from,
}
}
pub fn label(&self) -> CrdsValueLabel {
@ -578,6 +614,9 @@ impl CrdsValue {
CrdsData::Version(_) => CrdsValueLabel::Version(self.pubkey()),
CrdsData::NodeInstance(node) => CrdsValueLabel::NodeInstance(node.from),
CrdsData::DuplicateShred(ix, shred) => CrdsValueLabel::DuplicateShred(*ix, shred.from),
CrdsData::IncrementalSnapshotHashes(_) => {
CrdsValueLabel::IncrementalSnapshotHashes(self.pubkey())
}
}
}
pub fn contact_info(&self) -> Option<&ContactInfo> {

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.7.13"
version = "1.7.18"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -16,21 +16,21 @@ bzip2 = "0.3.3"
chrono = { version = "0.4.11", features = ["serde"] }
clap = { version = "2.33.1" }
console = "0.14.1"
ctrlc = { version = "3.1.5", features = ["termination"] }
ctrlc = { version = "3.1.9", features = ["termination"] }
dirs-next = "2.0.0"
indicatif = "0.15.0"
lazy_static = "1.4.0"
nix = "0.19.0"
nix = "0.20.0"
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
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.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-config-program = { path = "../programs/config", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-config-program = { path = "../programs/config", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
semver = "0.9.0"
tar = "0.4.37"
tempfile = "3.1.0"

View File

@ -436,7 +436,7 @@ fn add_to_path(new_path: &str) -> bool {
#[cfg(unix)]
fn add_to_path(new_path: &str) -> bool {
let shell_export_string = format!(r#"export PATH="{}:$PATH""#, new_path);
let shell_export_string = format!("\nexport PATH=\"{}:$PATH\"", new_path);
let mut modified_rcfiles = false;
// Look for sh, bash, and zsh rc files

View File

@ -1,6 +1,6 @@
[package]
name = "solana-keygen"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-cli-config = { path = "../cli-config", version = "=1.7.13" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-cli-config = { path = "../cli-config", version = "=1.7.18" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -14,6 +14,7 @@ bs58 = "0.3.1"
bytecount = "0.6.0"
clap = "2.33.1"
csv = "1.1.3"
dashmap = "4.0.2"
futures = "0.3.8"
futures-util = "0.3.5"
histogram = "*"
@ -23,18 +24,18 @@ 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.7.13" }
solana-cli-output = { path = "../cli-output", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.13" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-cli-output = { path = "../cli-output", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.18" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
tempfile = "3.1.0"
tokio = { version = "1", features = ["full"] }

View File

@ -3,6 +3,7 @@ use clap::{
crate_description, crate_name, value_t, value_t_or_exit, values_t_or_exit, App, AppSettings,
Arg, ArgMatches, SubCommand,
};
use dashmap::DashMap;
use itertools::Itertools;
use log::*;
use regex::Regex;
@ -57,7 +58,7 @@ use std::{
path::{Path, PathBuf},
process::{exit, Command, Stdio},
str::FromStr,
sync::Arc,
sync::{Arc, RwLock},
};
mod bigtable;
@ -2345,15 +2346,16 @@ fn main() {
skipped_reasons: String,
}
use solana_stake_program::stake_state::InflationPointCalculationEvent;
let mut stake_calcuration_details: HashMap<Pubkey, CalculationDetail> =
HashMap::new();
let mut last_point_value = None;
let stake_calculation_details: DashMap<Pubkey, CalculationDetail> =
DashMap::new();
let last_point_value = Arc::new(RwLock::new(None));
let tracer = |event: &RewardCalculationEvent| {
// Currently RewardCalculationEvent enum has only Staking variant
// because only staking tracing is supported!
#[allow(irrefutable_let_patterns)]
if let RewardCalculationEvent::Staking(pubkey, event) = event {
let detail = stake_calcuration_details.entry(**pubkey).or_default();
let mut detail =
stake_calculation_details.entry(**pubkey).or_default();
match event {
InflationPointCalculationEvent::CalculatedPoints(
epoch,
@ -2378,12 +2380,11 @@ fn main() {
detail.point_value = Some(point_value.clone());
// we have duplicate copies of `PointValue`s for possible
// miscalculation; do some minimum sanity check
let point_value = detail.point_value.clone();
if point_value.is_some() {
if last_point_value.is_some() {
assert_eq!(last_point_value, point_value,);
}
last_point_value = point_value;
let mut last_point_value = last_point_value.write().unwrap();
if let Some(last_point_value) = last_point_value.as_ref() {
assert_eq!(last_point_value, point_value);
} else {
*last_point_value = Some(point_value.clone());
}
}
InflationPointCalculationEvent::EffectiveStakeAtRewardedEpoch(stake) => {
@ -2488,16 +2489,17 @@ fn main() {
},
);
let mut unchanged_accounts = stake_calcuration_details
.keys()
let mut unchanged_accounts = stake_calculation_details
.iter()
.map(|entry| *entry.key())
.collect::<HashSet<_>>()
.difference(
&rewarded_accounts
.iter()
.map(|(pubkey, ..)| *pubkey)
.map(|(pubkey, ..)| **pubkey)
.collect(),
)
.map(|pubkey| (**pubkey, warped_bank.get_account(pubkey).unwrap()))
.map(|pubkey| (*pubkey, warped_bank.get_account(pubkey).unwrap()))
.collect::<Vec<_>>();
unchanged_accounts.sort_unstable_by_key(|(pubkey, account)| {
(*account.owner(), account.lamports(), *pubkey)
@ -2518,7 +2520,9 @@ fn main() {
if let Some(base_account) = base_bank.get_account(&pubkey) {
let delta = warped_account.lamports() - base_account.lamports();
let detail = stake_calcuration_details.get(&pubkey);
let detail_ref = stake_calculation_details.get(&pubkey);
let detail: Option<&CalculationDetail> =
detail_ref.as_ref().map(|detail_ref| detail_ref.value());
println!(
"{:<45}({}): {} => {} (+{} {:>4.9}%) {:?}",
format!("{}", pubkey), // format! is needed to pad/justify correctly.
@ -2641,10 +2645,18 @@ fn main() {
),
commission: format_or_na(detail.map(|d| d.commission)),
cluster_rewards: format_or_na(
last_point_value.as_ref().map(|pv| pv.rewards),
last_point_value
.read()
.unwrap()
.clone()
.map(|pv| pv.rewards),
),
cluster_points: format_or_na(
last_point_value.as_ref().map(|pv| pv.points),
last_point_value
.read()
.unwrap()
.clone()
.map(|pv| pv.points),
),
old_capitalization: base_bank.capitalization(),
new_capitalization: warped_bank.capitalization(),

View File

@ -1,6 +1,6 @@
[package]
name = "solana-ledger"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.7.13" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.7.13" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-perf = { path = "../perf", version = "=1.7.13" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.7.13" }
solana-storage-proto = { path = "../storage-proto", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.7.18" }
solana-frozen-abi = { path = "../frozen-abi", version = "=1.7.18" }
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "=1.7.18" }
solana-transaction-status = { path = "../transaction-status", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-merkle-tree = { path = "../merkle-tree", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-storage-bigtable = { path = "../storage-bigtable", version = "=1.7.18" }
solana-storage-proto = { path = "../storage-proto", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
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.7.13" }
solana-account-decoder = { path = "../account-decoder", version = "=1.7.18" }
[build-dependencies]
rustc_version = "0.2"

View File

@ -8387,6 +8387,7 @@ pub mod tests {
amount: "11".to_string(),
ui_amount_string: "1.1".to_string(),
},
owner: Pubkey::new_unique().to_string(),
}]),
post_token_balances: Some(vec![TransactionTokenBalance {
account_index: 0,
@ -8397,6 +8398,7 @@ pub mod tests {
amount: "11".to_string(),
ui_amount_string: "1.1".to_string(),
},
owner: Pubkey::new_unique().to_string(),
}]),
rewards: Some(vec![Reward {
pubkey: "My11111111111111111111111111111111111111111".to_string(),

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.7.13"
version = "1.7.18"
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.7.13" }
solana-core = { path = "../core", version = "=1.7.13" }
solana-client = { path = "../client", version = "=1.7.13" }
solana-download-utils = { path = "../download-utils", version = "=1.7.13" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.7.13" }
solana-faucet = { path = "../faucet", version = "=1.7.13" }
solana-gossip = { path = "../gossip", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.13" }
solana-rpc = { path = "../rpc", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.13" }
solana-streamer = { path = "../streamer", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-config-program = { path = "../programs/config", version = "=1.7.18" }
solana-core = { path = "../core", version = "=1.7.18" }
solana-client = { path = "../client", version = "=1.7.18" }
solana-download-utils = { path = "../download-utils", version = "=1.7.18" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.7.18" }
solana-faucet = { path = "../faucet", version = "=1.7.18" }
solana-gossip = { path = "../gossip", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.18" }
solana-rpc = { path = "../rpc", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.18" }
solana-streamer = { path = "../streamer", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
tempfile = "3.1.0"
[dev-dependencies]

View File

@ -42,8 +42,7 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
contact_debug_interval: config.contact_debug_interval,
contact_save_interval: config.contact_save_interval,
bpf_jit: config.bpf_jit,
send_transaction_retry_ms: config.send_transaction_retry_ms,
send_transaction_leader_forward_count: config.send_transaction_leader_forward_count,
send_transaction_service_config: config.send_transaction_service_config.clone(),
no_poh_speed_test: config.no_poh_speed_test,
poh_pinned_cpu_core: config.poh_pinned_cpu_core,
account_indexes: config.account_indexes.clone(),
@ -57,6 +56,7 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
poh_hashes_per_batch: config.poh_hashes_per_batch,
no_wait_for_vote_to_start_leader: config.no_wait_for_vote_to_start_leader,
accounts_shrink_ratio: config.accounts_shrink_ratio,
disable_epoch_boundary_optimization: config.disable_epoch_boundary_optimization,
}
}

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.7.13"
version = "1.7.18"
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.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
[[bin]]
name = "solana-log-analyzer"

View File

@ -1,6 +1,6 @@
[package]
name = "solana-logger"
version = "1.7.13"
version = "1.7.18"
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.7.13"
version = "1.7.18"
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.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
[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.7.13"
version = "1.7.18"
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.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
clap = "2.33.1"
[package.metadata.docs.rs]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-merkle-tree"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../sdk/program", version = "=1.7.18" }
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.7.13"
version = "1.7.18"
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.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
[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.7.13"
version = "1.7.18"
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.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
rand = "0.7.0"
[[bin]]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-net-utils"
version = "1.7.13"
version = "1.7.18"
description = "Solana Network Utilities"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@ -13,15 +13,15 @@ edition = "2018"
bincode = "1.3.1"
clap = "2.33.1"
log = "0.4.11"
nix = "0.19.0"
nix = "0.20.0"
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.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
tokio = { version = "1", features = ["full"] }
url = "2.1.1"

View File

@ -805,7 +805,6 @@ $(
install-earlyoom.sh \
install-iftop.sh \
install-libssl-compatability.sh \
install-nodejs.sh \
install-redis.sh \
install-rsync.sh \
localtime.sh \

View File

@ -106,6 +106,8 @@ Operate a configured testnet
- Override the number of slots in an epoch
--warp-slot WARP_SLOT
- Boot from a snapshot that has warped ahead to WARP_SLOT rather than a slot 0 genesis.
--full-rpc
- Support full RPC services on all nodes
sanity/start-specific options:
-F - Discard validator nodes that didn't bootup successfully
-o noInstallCheck - Skip solana-install sanity
@ -312,6 +314,7 @@ startBootstrapLeader() {
\"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority $maybeAllowPrivateAddr $maybeAccountsDbSkipShrink $maybeSkipRequireTower\" \
\"$gpuMode\" \
\"$maybeWarpSlot\" \
\"$maybeFullRpc\" \
\"$waitForNodeInit\" \
\"$extraPrimordialStakes\" \
\"$TMPFS_ACCOUNTS\" \
@ -384,6 +387,7 @@ startNode() {
\"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority $maybeAllowPrivateAddr $maybeAccountsDbSkipShrink $maybeSkipRequireTower\" \
\"$gpuMode\" \
\"$maybeWarpSlot\" \
\"$maybeFullRpc\" \
\"$waitForNodeInit\" \
\"$extraPrimordialStakes\" \
\"$TMPFS_ACCOUNTS\" \
@ -795,6 +799,7 @@ netemCommand="add"
clientDelayStart=0
netLogDir=
maybeWarpSlot=
maybeFullRpc=false
waitForNodeInit=true
extraPrimordialStakes=0
@ -903,6 +908,9 @@ while [[ -n $1 ]]; do
elif [[ $1 == --warp-slot ]]; then
maybeWarpSlot="$1 $2"
shift 2
elif [[ $1 == --full-rpc ]]; then
maybeFullRpc=true
shift 1
elif [[ $1 == --async-node-init ]]; then
waitForNodeInit=false
shift 1

View File

@ -26,9 +26,10 @@ genesisOptions="${17}"
extraNodeArgs="${18}"
gpuMode="${19:-auto}"
maybeWarpSlot="${20}"
waitForNodeInit="${21}"
extraPrimordialStakes="${22:=0}"
tmpfsAccounts="${23:false}"
maybeFullRpc="${21}"
waitForNodeInit="${22}"
extraPrimordialStakes="${23:=0}"
tmpfsAccounts="${24:false}"
set +x
missing() {
@ -286,6 +287,11 @@ EOF
args+=(--accounts /mnt/solana-accounts)
fi
if $maybeFullRpc; then
args+=(--enable-rpc-transaction-history)
args+=(--enable-cpi-and-log-storage)
fi
if [[ $airdropsEnabled = true ]]; then
cat >> ~/solana/on-reboot <<EOF
./multinode-demo/faucet.sh > faucet.log 2>&1 &
@ -409,6 +415,11 @@ EOF
args+=(--accounts /mnt/solana-accounts)
fi
if $maybeFullRpc; then
args+=(--enable-rpc-transaction-history)
args+=(--enable-cpi-and-log-storage)
fi
cat >> ~/solana/on-reboot <<EOF
$maybeSkipAccountsCreation
nohup multinode-demo/validator.sh ${args[@]} > validator.log.\$now 2>&1 &

View File

@ -1,6 +1,6 @@
[package]
name = "solana-notifier"
version = "1.7.13"
version = "1.7.18"
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.7.13"
version = "1.7.18"
description = "Solana Performance APIs"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
@ -19,11 +19,11 @@ log = "0.4.11"
rand = "0.7.0"
rayon = "1.5.0"
serde = "1.0.126"
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
[lib]
name = "solana_perf"

11
perf/build.rs Normal file
View File

@ -0,0 +1,11 @@
fn main() {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
{
if is_x86_feature_detected!("avx") {
println!("cargo:rustc-cfg=build_target_feature_avx");
}
if is_x86_feature_detected!("avx2") {
println!("cargo:rustc-cfg=build_target_feature_avx2");
}
}
}

View File

@ -19,3 +19,62 @@ extern crate matches;
#[macro_use]
extern crate solana_metrics;
fn is_rosetta_emulated() -> bool {
#[cfg(target_os = "macos")]
{
use std::str::FromStr;
std::process::Command::new("sysctl")
.args(&["-in", "sysctl.proc_translated"])
.output()
.map_err(|_| ())
.and_then(|output| String::from_utf8(output.stdout).map_err(|_| ()))
.and_then(|stdout| u8::from_str(stdout.trim()).map_err(|_| ()))
.map(|enabled| enabled == 1)
.unwrap_or(false)
}
#[cfg(not(target_os = "macos"))]
{
false
}
}
pub fn report_target_features() {
warn!(
"CUDA is {}abled",
if crate::perf_libs::api().is_some() {
"en"
} else {
"dis"
}
);
// Validator binaries built on a machine with AVX support will generate invalid opcodes
// when run on machines without AVX causing a non-obvious process abort. Instead detect
// the mismatch and error cleanly.
if !is_rosetta_emulated() {
#[cfg(build_target_feature_avx)]
{
if is_x86_feature_detected!("avx") {
info!("AVX detected");
} else {
error!(
"Incompatible CPU detected: missing AVX support. Please build from source on the target"
);
std::process::abort();
}
}
#[cfg(build_target_feature_avx2)]
{
if is_x86_feature_detected!("avx2") {
info!("AVX2 detected");
} else {
error!(
"Incompatible CPU detected: missing AVX2 support. Please build from source on the target"
);
std::process::abort();
}
}
}
}

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-poh-bench"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-version = { path = "../version", version = "=1.7.13" }
solana-perf = { path = "../perf", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-clap-utils = { path = "../clap-utils", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-version = { path = "../version", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-poh"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-measure = { path = "../measure", version = "=1.7.13" }
solana-metrics = { path = "../metrics", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-sys-tuner = { path = "../sys-tuner", version = "=1.7.13" }
solana-ledger = { path = "../ledger", version = "=1.7.18" }
solana-measure = { path = "../measure", version = "=1.7.18" }
solana-metrics = { path = "../metrics", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-sys-tuner = { path = "../sys-tuner", version = "=1.7.18" }
thiserror = "1.0"
[dev-dependencies]
bincode = "1.3.1"
matches = "0.1.6"
rand = "0.7.0"
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-perf = { path = "../perf", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-perf = { path = "../perf", version = "=1.7.18" }
[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.7.13"
version = "1.7.18"
[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.7.13" }
solana-banks-server = { path = "../banks-server", version = "=1.7.13" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.7.13" }
solana-logger = { path = "../logger", version = "=1.7.13" }
solana-runtime = { path = "../runtime", version = "=1.7.13" }
solana-sdk = { path = "../sdk", version = "=1.7.13" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.13" }
solana-banks-client = { path = "../banks-client", version = "=1.7.18" }
solana-banks-server = { path = "../banks-server", version = "=1.7.18" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.7.18" }
solana-logger = { path = "../logger", version = "=1.7.18" }
solana-runtime = { path = "../runtime", version = "=1.7.18" }
solana-sdk = { path = "../sdk", version = "=1.7.18" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.18" }
thiserror = "1.0"
tokio = { version = "1", features = ["full"] }

View File

@ -1,6 +1,5 @@
#![allow(clippy::integer_arithmetic)]
use {
assert_matches::assert_matches,
bincode::deserialize,
solana_banks_client::BanksClient,
solana_program_test::{processor, ProgramTest, ProgramTestContext, ProgramTestError},
@ -15,7 +14,7 @@ use {
signature::{Keypair, Signer},
stake::{
instruction as stake_instruction,
state::{Authorized, Lockup, StakeState},
state::{Authorized, Lockup, StakeActivationStatus, StakeState},
},
system_instruction, system_program,
sysvar::{
@ -298,11 +297,11 @@ async fn stake_rewards_from_warp() {
let stake_history: StakeHistory = deserialize(&stake_history_account.data).unwrap();
let clock: Clock = deserialize(&clock_account.data).unwrap();
let stake = stake_state.stake().unwrap();
assert_matches!(
assert_eq!(
stake
.delegation
.stake_activating_and_deactivating(clock.epoch, Some(&stake_history)),
(_, 0, 0)
StakeActivationStatus::with_effective(stake.delegation.stake),
);
}

305
programs/bpf/Cargo.lock generated
View File

@ -294,6 +294,26 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
[[package]]
name = "bytemuck"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b"
dependencies = [
"bytemuck_derive",
]
[[package]]
name = "bytemuck_derive"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.6",
"syn 1.0.67",
]
[[package]]
name = "byteorder"
version = "0.5.3"
@ -1423,9 +1443,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.98"
version = "0.2.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6"
[[package]]
name = "libloading"
@ -1546,9 +1566,9 @@ dependencies = [
[[package]]
name = "memoffset"
version = "0.6.1"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"
checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
dependencies = [
"autocfg",
]
@ -1634,14 +1654,15 @@ dependencies = [
[[package]]
name = "nix"
version = "0.19.1"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2"
checksum = "f5e06129fb611568ef4e868c14b326274959aa70ff7776e9d55323531c374945"
dependencies = [
"bitflags",
"cc",
"cfg-if 1.0.0",
"libc",
"memoffset",
]
[[package]]
@ -2592,7 +2613,7 @@ dependencies = [
[[package]]
name = "solana-account-decoder"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"Inflector",
"base64 0.12.3",
@ -2613,7 +2634,7 @@ dependencies = [
[[package]]
name = "solana-banks-client"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"borsh",
@ -2621,7 +2642,7 @@ dependencies = [
"futures",
"mio",
"solana-banks-interface",
"solana-program 1.7.13",
"solana-program 1.7.18",
"solana-sdk",
"tarpc",
"tokio",
@ -2630,7 +2651,7 @@ dependencies = [
[[package]]
name = "solana-banks-interface"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"mio",
"serde",
@ -2640,7 +2661,7 @@ dependencies = [
[[package]]
name = "solana-banks-server"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"futures",
@ -2658,7 +2679,7 @@ dependencies = [
[[package]]
name = "solana-bpf-loader-program"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"byteorder 1.3.4",
@ -2677,7 +2698,7 @@ dependencies = [
[[package]]
name = "solana-bpf-programs"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"byteorder 1.3.4",
@ -2689,7 +2710,7 @@ dependencies = [
"solana-account-decoder",
"solana-bpf-loader-program",
"solana-cli-output",
"solana-logger 1.7.13",
"solana-logger 1.7.18",
"solana-measure",
"solana-runtime",
"solana-sdk",
@ -2700,288 +2721,288 @@ dependencies = [
[[package]]
name = "solana-bpf-rust-128bit"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-bpf-rust-128bit-dep",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-128bit-dep"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-alloc"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-call-depth"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-caller-access"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-custom-heap"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-dep-crate"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"byteorder 1.3.4",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-deprecated-loader"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-dup-accounts"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-error-handling"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"num-derive 0.2.5",
"num-traits",
"solana-program 1.7.13",
"solana-program 1.7.18",
"thiserror",
]
[[package]]
name = "solana-bpf-rust-external-spend"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-finalize"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-instruction-introspection"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-invoke"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-bpf-rust-invoked",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-invoke-and-error"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-invoke-and-ok"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-invoke-and-return"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-invoked"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-iter"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-many-args"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-bpf-rust-many-args-dep",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-many-args-dep"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-mem"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
"solana-program-test",
"solana-sdk",
]
[[package]]
name = "solana-bpf-rust-membuiltins"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-bpf-rust-mem",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-noop"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-panic"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-param-passing"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-bpf-rust-param-passing-dep",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-param-passing-dep"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-rand"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"getrandom 0.1.14",
"rand 0.7.3",
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-ro-account_modify"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-ro-modify"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-sanity"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-secp256k1-recover"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-sha"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-spoof1"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-spoof1-system"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-sysvar"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
"solana-program-test",
"solana-sdk",
]
[[package]]
name = "solana-bpf-rust-upgradeable"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-bpf-rust-upgraded"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-program 1.7.13",
"solana-program 1.7.18",
]
[[package]]
name = "solana-clap-utils"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"chrono",
"clap",
@ -2996,7 +3017,7 @@ dependencies = [
[[package]]
name = "solana-cli-config"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"dirs-next",
"lazy_static",
@ -3008,7 +3029,7 @@ dependencies = [
[[package]]
name = "solana-cli-output"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"Inflector",
"base64 0.13.0",
@ -3031,7 +3052,7 @@ dependencies = [
[[package]]
name = "solana-client"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"base64 0.13.0",
"bincode",
@ -3063,7 +3084,7 @@ dependencies = [
[[package]]
name = "solana-config-program"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"chrono",
@ -3076,7 +3097,7 @@ dependencies = [
[[package]]
name = "solana-crate-features"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"backtrace",
"bytes 0.4.12",
@ -3098,7 +3119,7 @@ dependencies = [
[[package]]
name = "solana-faucet"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"byteorder 1.3.4",
@ -3108,7 +3129,7 @@ dependencies = [
"serde_derive",
"solana-clap-utils",
"solana-cli-config",
"solana-logger 1.7.13",
"solana-logger 1.7.18",
"solana-metrics",
"solana-sdk",
"solana-version",
@ -3139,7 +3160,7 @@ dependencies = [
[[package]]
name = "solana-frozen-abi"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bs58",
"bv",
@ -3150,8 +3171,8 @@ dependencies = [
"serde",
"serde_derive",
"sha2",
"solana-frozen-abi-macro 1.7.13",
"solana-logger 1.7.13",
"solana-frozen-abi-macro 1.7.18",
"solana-logger 1.7.18",
"thiserror",
]
@ -3169,7 +3190,7 @@ dependencies = [
[[package]]
name = "solana-frozen-abi-macro"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.6",
@ -3190,7 +3211,7 @@ dependencies = [
[[package]]
name = "solana-logger"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"env_logger",
"lazy_static",
@ -3199,7 +3220,7 @@ dependencies = [
[[package]]
name = "solana-measure"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"log",
"solana-metrics",
@ -3208,7 +3229,7 @@ dependencies = [
[[package]]
name = "solana-metrics"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"env_logger",
"gethostname",
@ -3220,7 +3241,7 @@ dependencies = [
[[package]]
name = "solana-net-utils"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"clap",
@ -3231,7 +3252,7 @@ dependencies = [
"serde_derive",
"socket2 0.3.17",
"solana-clap-utils",
"solana-logger 1.7.13",
"solana-logger 1.7.18",
"solana-sdk",
"solana-version",
"tokio",
@ -3275,7 +3296,7 @@ dependencies = [
[[package]]
name = "solana-program"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"blake3",
@ -3283,6 +3304,7 @@ dependencies = [
"borsh-derive",
"bs58",
"bv",
"bytemuck",
"curve25519-dalek 2.1.0",
"hex",
"itertools 0.9.0",
@ -3299,16 +3321,16 @@ dependencies = [
"serde_derive",
"sha2",
"sha3",
"solana-frozen-abi 1.7.13",
"solana-frozen-abi-macro 1.7.13",
"solana-logger 1.7.13",
"solana-sdk-macro 1.7.13",
"solana-frozen-abi 1.7.18",
"solana-frozen-abi-macro 1.7.18",
"solana-logger 1.7.18",
"solana-sdk-macro 1.7.18",
"thiserror",
]
[[package]]
name = "solana-program-test"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"async-trait",
"base64 0.12.3",
@ -3322,7 +3344,7 @@ dependencies = [
"solana-banks-client",
"solana-banks-server",
"solana-bpf-loader-program",
"solana-logger 1.7.13",
"solana-logger 1.7.18",
"solana-runtime",
"solana-sdk",
"solana-vote-program",
@ -3332,7 +3354,7 @@ dependencies = [
[[package]]
name = "solana-rayon-threadlimit"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"lazy_static",
"num_cpus",
@ -3340,7 +3362,7 @@ dependencies = [
[[package]]
name = "solana-remote-wallet"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"base32",
"console 0.14.1",
@ -3359,7 +3381,7 @@ dependencies = [
[[package]]
name = "solana-runtime"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"arrayref",
"bincode",
@ -3389,9 +3411,9 @@ dependencies = [
"serde",
"serde_derive",
"solana-config-program",
"solana-frozen-abi 1.7.13",
"solana-frozen-abi-macro 1.7.13",
"solana-logger 1.7.13",
"solana-frozen-abi 1.7.18",
"solana-frozen-abi-macro 1.7.18",
"solana-logger 1.7.18",
"solana-measure",
"solana-metrics",
"solana-rayon-threadlimit",
@ -3408,7 +3430,7 @@ dependencies = [
[[package]]
name = "solana-sdk"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"assert_matches",
"bincode",
@ -3444,11 +3466,11 @@ dependencies = [
"sha2",
"sha3",
"solana-crate-features",
"solana-frozen-abi 1.7.13",
"solana-frozen-abi-macro 1.7.13",
"solana-logger 1.7.13",
"solana-program 1.7.13",
"solana-sdk-macro 1.7.13",
"solana-frozen-abi 1.7.18",
"solana-frozen-abi-macro 1.7.18",
"solana-logger 1.7.18",
"solana-program 1.7.18",
"solana-sdk-macro 1.7.18",
"thiserror",
"uriparse",
]
@ -3468,7 +3490,7 @@ dependencies = [
[[package]]
name = "solana-sdk-macro"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bs58",
"proc-macro2 1.0.24",
@ -3479,14 +3501,14 @@ dependencies = [
[[package]]
name = "solana-secp256k1-program"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"solana-sdk",
]
[[package]]
name = "solana-stake-program"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"log",
@ -3496,8 +3518,8 @@ dependencies = [
"serde",
"serde_derive",
"solana-config-program",
"solana-frozen-abi 1.7.13",
"solana-frozen-abi-macro 1.7.13",
"solana-frozen-abi 1.7.18",
"solana-frozen-abi-macro 1.7.18",
"solana-metrics",
"solana-sdk",
"solana-vote-program",
@ -3506,17 +3528,20 @@ dependencies = [
[[package]]
name = "solana-transaction-status"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"Inflector",
"base64 0.12.3",
"bincode",
"bs58",
"lazy_static",
"log",
"serde",
"serde_derive",
"serde_json",
"solana-account-decoder",
"solana-measure",
"solana-metrics",
"solana-runtime",
"solana-sdk",
"solana-vote-program",
@ -3528,21 +3553,21 @@ dependencies = [
[[package]]
name = "solana-version"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"log",
"rustc_version",
"serde",
"serde_derive",
"solana-frozen-abi 1.7.13",
"solana-frozen-abi-macro 1.7.13",
"solana-logger 1.7.13",
"solana-frozen-abi 1.7.18",
"solana-frozen-abi-macro 1.7.18",
"solana-logger 1.7.18",
"solana-sdk",
]
[[package]]
name = "solana-vote-program"
version = "1.7.13"
version = "1.7.18"
dependencies = [
"bincode",
"log",
@ -3551,9 +3576,9 @@ dependencies = [
"rustc_version",
"serde",
"serde_derive",
"solana-frozen-abi 1.7.13",
"solana-frozen-abi-macro 1.7.13",
"solana-logger 1.7.13",
"solana-frozen-abi 1.7.18",
"solana-frozen-abi-macro 1.7.18",
"solana-logger 1.7.18",
"solana-metrics",
"solana-sdk",
"thiserror",

View File

@ -1,7 +1,7 @@
[package]
name = "solana-bpf-programs"
description = "Blockchain, Rebuilt for Scale"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-cli-output = { path = "../../cli-output", version = "=1.7.13" }
solana-logger = { path = "../../logger", version = "=1.7.13" }
solana-measure = { path = "../../measure", version = "=1.7.13" }
solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.7.18" }
solana-cli-output = { path = "../../cli-output", version = "=1.7.18" }
solana-logger = { path = "../../logger", version = "=1.7.18" }
solana-measure = { path = "../../measure", version = "=1.7.18" }
solana_rbpf = "=0.2.11"
solana-runtime = { path = "../../runtime", version = "=1.7.13" }
solana-sdk = { path = "../../sdk", version = "=1.7.13" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.7.13" }
solana-account-decoder = { path = "../../account-decoder", version = "=1.7.13" }
solana-runtime = { path = "../../runtime", version = "=1.7.18" }
solana-sdk = { path = "../../sdk", version = "=1.7.18" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.7.18" }
solana-account-decoder = { path = "../../account-decoder", version = "=1.7.18" }
[[bench]]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-128bit"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "=1.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
solana-bpf-rust-128bit-dep = { path = "../128bit_dep", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-128bit-dep"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-alloc"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-call-depth"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-caller-access"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-custom-heap"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[features]
default = ["custom-heap"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-dep-crate"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-deprecated-loader"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-dup-accounts"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
[lib]
crate-type = ["cdylib"]

View File

@ -1,6 +1,6 @@
[package]
name = "solana-bpf-rust-error-handling"
version = "1.7.13"
version = "1.7.18"
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.7.13" }
solana-program = { path = "../../../../sdk/program", version = "=1.7.18" }
thiserror = "1.0"
[lib]

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