Commit Graph

14883 Commits

Author SHA1 Message Date
85048c667c cli: account for rpc nodes when considering feature set adoption (#20774)
(cherry picked from commit 5794bba65c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-20 17:41:47 -06:00
440ccd189e Add program heap bump instruction (backport #20607) (#20815)
* Add program heap bump instruction (#20607)

(cherry picked from commit 58164517e4)

* nudge

Co-authored-by: Jack May <jack@solana.com>
2021-10-20 23:05:57 +00:00
d5fc81e12a Reduce budget request instruction length (#20636) (#20644)
(cherry picked from commit c231cfe235)

Co-authored-by: Jack May <jack@solana.com>
2021-10-20 12:17:29 -07:00
53f4bde471 add checked instructions sysvar api (backport #20790) (#20816)
* add checked instructions sysvar api (#20790)

(cherry picked from commit a8098f37d0)

# Conflicts:
#	programs/bpf/rust/sysvar/src/lib.rs
#	runtime/src/accounts.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-10-20 18:11:51 +00:00
232731e869 adds more metrics to blockstore insert shreds stats (backport #20701) (#20751)
* adds more metrics to blockstore insert shreds stats (#20701)

(cherry picked from commit 231b58b5f1)

# Conflicts:
#	ledger/src/blockstore.rs

* removes backport merge conflicts

* removes error logs

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-20 08:12:32 +00:00
63835ec214 prior to panicing with cap mismatch, try other calculation (#20292) (#20804)
(cherry picked from commit fa5b091b4c)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-10-20 02:26:23 +00:00
6de9ef62e8 docs: Amend RPC Transaction History proposal (#20794) (#20812)
# Problem

The initial proposal ruled out implementing BigTable queries for
the `getBlockTime` RPC, but then it was implemented a couple months
later. Indicating that the functionality was never implemented in
the "implemented-proposals" document is a little confusing, so let's
bring the document in line with what actually happened. 🦾

# Summary of Changes

Remove the blurb about how `getBlockTime` was going to be deprecated
and add it to the list of calls that didn't yet support BigTable
queries at the time the proposal was written.

(cherry picked from commit 0c7bade0b2)

Co-authored-by: Arthur Burkart <arthur@presynce.com>
2021-10-20 02:07:17 +00:00
0759b666ce Expand Rust API docs entry point (#20770) (#20801)
(cherry picked from commit cc4bb5a451)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-10-20 01:53:55 +00:00
c7e3d4cf79 Add docs to solana_clap_utils::keypair (backport #20665) (#20789)
* Add docs to solana_clap_utils::keypair (#20665)

* Add docs to solana_clap_utils::keypair

* Apply suggestions from code review

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

* Move imports to module level in solana_clap_utils::keypair::tests

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 96c6ba6eb2)

# Conflicts:
#	clap-utils/src/keypair.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-20 01:45:14 +00:00
63e37b2b20 Remove @brief annotations from Rust API docs (backport #20769) (#20807)
* Remove @brief annotations from Rust API docs (#20769)

(cherry picked from commit d9b0fc0e3e)

# Conflicts:
#	programs/bpf/rust/invoke/src/instructions.rs
#	programs/bpf/rust/invoke/src/processor.rs
#	programs/bpf/rust/realloc/src/instructions.rs
#	programs/bpf/rust/realloc/src/lib.rs
#	programs/bpf/rust/realloc/src/processor.rs
#	programs/bpf/rust/realloc_invoke/src/instructions.rs
#	programs/bpf/rust/realloc_invoke/src/lib.rs
#	programs/bpf/rust/realloc_invoke/src/processor.rs
#	sdk/cargo-build-bpf/tests/crates/fail/src/lib.rs
#	sdk/src/precompiles.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-19 19:17:33 -06:00
436ec212f4 report udp stats from validator (backport #20587) (#20799)
* report udp stats from validator (#20587)

(cherry picked from commit 4cac66244d)

# Conflicts:
#	core/src/validator.rs

* resolve merge conflicts

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-10-20 00:57:38 +00:00
564cc95b00 runtime: Add foundation stake pool withdraw authority (#20797)
(cherry picked from commit cb2bd65858)
2021-10-19 17:56:09 -07:00
28eb6ff796 Invoke cost tracker from its bank (backport #20627) (#20800)
* - make cost_tracker a member of bank, remove shared instance from TPU; (#20627)

- decouple cost_model from cost_tracker; allowing one cost_model
  instance being shared within a validator;
- update cost_model api to calculate_cost(&self...)->transaction_cost

(cherry picked from commit 7496b5784b)

# Conflicts:
#	core/src/banking_stage.rs
#	ledger-tool/src/main.rs
#	runtime/src/bank.rs
#	runtime/src/cost_model.rs
#	runtime/src/cost_tracker.rs

* manual fix merge conflicts

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
Co-authored-by: Tao Zhu <tao@solana.com>
2021-10-20 00:22:38 +00:00
de32ab4d57 Separate out interrupted slots broadcast metrics (#20537) (#20798)
(cherry picked from commit 838ff3b871)

Co-authored-by: carllin <carl@solana.com>
2021-10-19 22:26:49 +00:00
cabe2d5d04 Use node LTS (#20803) (#20806)
(cherry picked from commit 2c2bcd20e6)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-19 15:51:59 -06:00
ece4ecb792 stake: Add BorshSerialize trait to structs (#20784) (#20792)
(cherry picked from commit dc1b8ddea1)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-19 20:23:24 +00:00
ba366f49ad Ignore RUSTSEC-2020-0159
(cherry picked from commit 7baeb04f26)
2021-10-18 13:50:31 -07:00
8e666f47e0 optimistic-confirmation-and-slashing - fix typos (#20741) (#20765)
(cherry picked from commit 84660bbf3d)

Co-authored-by: Elliot Lee <github.public@intelliot.com>
2021-10-18 17:49:45 +00:00
0619705ce5 Simplify ed25519 instruction index
Allow u16::MAX to be specified for the instruction index. This makes it
possible to specify the current instruction, so it is not necessary to
know the instruction number.
2021-10-18 15:41:24 +01:00
188089389f feat: support for builtin ed25519 program
Conflicts:
	web3.js/src/index.ts
2021-10-18 15:41:24 +01:00
0a6bb84aec feat: add ed25519 signature verify program
Solang requires a method for verify ed25519 signatures. Add a new
builtin program at address Ed25519SigVerify111111111111111111111111111
which takes any number of ed25519 signature, public key, and message.
If any of the signatures fails to verify, an error is returned.

The changes for the web3.js package will go into another commit, since
the tests test against a released solana node. Adding web3.js ed25519
testing will break CI.

(cherry picked from commit b491354e51)

Conflicts:
	Cargo.lock
	Cargo.toml
	programs/bpf/Cargo.lock
	runtime/Cargo.toml
	sdk/src/feature_set.rs
	sdk/src/transaction.rs
	sdk/src/transaction/sanitized.rs
2021-10-18 15:41:24 +01:00
c8f6a0817b verify_precompiles needs FeatureSet
Rather than pass in individual features, pass in the entire feature set
so that we can add the ed25519 program feature in a later commit.

(cherry picked from commit 0f62771f42)

 Conflicts:
	banks-server/src/banks_server.rs
	core/src/banking_stage.rs
	programs/secp256k1/src/lib.rs
	rpc/src/rpc.rs
	runtime/src/bank.rs
	sdk/src/transaction.rs
	sdk/src/transaction/sanitized.rs
2021-10-18 15:41:24 +01:00
5350250a06 Improve program-test process_transaction() speed by reducing sleep duration in banks-server (backport #20508) (#20733)
* Improve program-test process_transaction() speed by reducing sleep duration in banks-server (#20508)

* banks_server: Reduce sleep duration for local server

This speeds up process_transaction_with_commitment_and_context()
and thus most program tests by a lot.

* Plumb tick duration through poh config and signature polling

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
(cherry picked from commit bea181eba9)

# Conflicts:
#	banks-server/src/banks_server.rs
#	program-test/src/lib.rs

* Fix merge issues

Co-authored-by: Christian Kamm <ckamm@delightful-solutions.de>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-15 21:36:59 +00:00
f8fccc7e91 docs: prefer solana gossip to solana-gossip spy (#20734)
(cherry picked from commit 9543fd9cdd)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-15 19:42:20 +00:00
eaa6d1a4b5 adds counters for errors in window-service run_insert (#20670) (#20724)
(cherry picked from commit 0f03971c3c)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-15 18:09:11 +00:00
b66c9539c2 program-test: Fix getting new blockhash post-warp (#20710) (#20723)
(cherry picked from commit 0419e6c22e)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-15 16:13:09 +00:00
bdea60cc19 Rpc: filters performance improvement (#20185) (#20703)
* 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-14 21:48:13 +00:00
63ac5e4561 clap-utils: trim single-quotes from signer uris on windows (#20695)
(cherry picked from commit 6649dfa899)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-14 20:23:15 +00:00
88e6f41bec Include token owners in TransactionTokenBalances (backport #20642) (#20677)
* 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 07:09:13 +00:00
e0280a68ba Accountsdb plugin metrics (#20606) (#20664)
Added metrics for accountsdb plugin
Handle and log postgres db errors
Print account pubkeys nicely in logging
2021-10-13 14:35:46 -07:00
aa8d04d44b uses nanos precision for timestamp when submitting metrics to influxdb (#20623) (#20659)
Current datapoint_info! is apparently overwriting itself when run inside
a loop. For example in
https://github.com/solana-labs/solana/blob/005d6863f/core/src/window_service.rs#L101-L107
only one of the slots will show up in influxdb.

This is apparently because of metrics code using milliseconds as the
timestamp, as mentioned here:
https://github.com/solana-labs/solana/issues/19789#issuecomment-922482013

(cherry picked from commit cd87525f54)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-13 20:47:01 +00:00
778f37b12d fix unstable test (#20645) (#20663)
(cherry picked from commit 220fd41bbc)

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2021-10-13 20:02:42 +00:00
ebe77a0985 Proposal: log binary data for Solidity
Rename "Program return data: " to "Program return: " since "data" is
redundant.

(cherry picked from commit b89177c8de)

Conflicts:
	programs/bpf_loader/src/syscalls.rs
	sdk/bpf/c/inc/sol/log.h
	sdk/program/Cargo.toml
	sdk/src/feature_set.rs
	sdk/src/process_instruction.rs
2021-10-13 14:34:36 +01:00
400a88786a aggregate cost_tracker to bank (backport #20527) (#20622)
* - move cost tracker into bank, so each bank has its own cost tracker; (#20527)

- move related modules to runtime

(cherry picked from commit 005d6863fd)

# Conflicts:
#	Cargo.lock
#	core/benches/banking_stage.rs
#	core/src/banking_stage.rs
#	core/src/lib.rs
#	core/src/tvu.rs
#	ledger-tool/src/main.rs
#	ledger/src/blockstore_processor.rs
#	programs/bpf/Cargo.lock
#	runtime/Cargo.toml
#	runtime/src/cost_model.rs

* manual fix merge conflicts

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
Co-authored-by: Tao Zhu <tao@solana.com>
2021-10-13 05:07:09 +00:00
29eae21057 Ignore delinquent stake on exit (backport #20367) (#20612)
* Ignore delinquent stake on exit (#20367)

* 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)

# Conflicts:
#	validator/src/main.rs

* Fixes cherry-pick conflict

Co-authored-by: Michael <68944931+michaelh-laine@users.noreply.github.com>
Co-authored-by: Steven Czabaniuk <steven@solana.com>
2021-10-12 20:30:47 +00:00
0d1dbb6160 Fix return data too large test
(cherry picked from commit d09687c30e)
2021-10-12 18:31:42 +01:00
927d3b5e0d Add return data implementation
This consists of:
 - syscalls
 - passing return data from invoked to invoker
 - printing to stable log
 - rust and C SDK changes

(cherry picked from commit 53b47b87b2)
2021-10-12 18:31:42 +01:00
df929bda38 Do not shell out for tar (#19043)
When making a snapshot archive, we used to shell out and call `tar -S`
for sparse file support.  The tar crate supports sparse files, so no
need to do this anymore.

Fixes #10860

(cherry picked from commit 68cc71409e)

# Conflicts:
#	runtime/src/snapshot_utils.rs
2021-10-12 15:36:51 +00:00
200c5c9fd6 solana-validator wait-for-restart-window command now accepts an optional --identity argument (backport #18684) (#20610)
* 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 07:07:40 +00:00
9acf708344 Remove support for dynamically loaded native programs (backport #20444) (#20560)
* Remove support for dynamically loaded native programs (#20444)

(cherry picked from commit 785fcb63f5)

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	program-runtime/src/instruction_processor.rs
#	programs/failure/Cargo.toml
#	programs/failure/tests/failure.rs
#	programs/noop/Cargo.toml
#	programs/ownable/Cargo.toml
#	programs/ownable/src/ownable_processor.rs
#	runtime/src/bank.rs
#	runtime/tests/noop.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-10-11 23:55:39 +00:00
af4c1785b6 Reorder RpcClient method defs for more logical docs. (backport #20549) (#20597)
* Reorder RpcClient method defs for more logical docs. (#20549)

Methods follow this order:

- Constructors
- send_and_confirm variations
- send variations
- confirm variations
- simulate variations
- queries

(cherry picked from commit 1417c1456d)

# Conflicts:
#	client/src/rpc_client.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-11 21:33:10 +00:00
b8f68860a4 docs: Remove outdated instructions for managing stake accounts (#20555) (#20600)
(cherry picked from commit 03d3e0098e)

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-11 20:17:02 +00:00
547f33d1d1 Adjust solana validators output to account for the 1k+ validators on mainnet (#20576)
(cherry picked from commit bdf8b1da6b)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-10-11 16:51:18 +00:00
67738a229c fix(docs): getInflationRate epoch type from f64 => u64 (#20589) (#20590)
(cherry picked from commit 185c9f9e8f)

Co-authored-by: Yihau Chen <a122092487@gmail.com>
2021-10-11 16:03:41 +00:00
50803c3f58 Rework AVX/AVX2 detection again
(cherry picked from commit c16510152e)
2021-10-10 15:28:14 -07:00
50cb612ae1 Accountsdb stream plugin improvement (#20419) (#20573)
* Accountsdb stream plugin improvement (#20419)

Support using connection pooling and use multiple threads to do Postgres db operations. The performance is improved from 1500 RPS to 40,000 RPS measured during validator start.

Support multiple plugins at the same time.

* Fixed a fmt issue
2021-10-10 15:24:12 -07:00
e5dc8d731b Web3 docs updated with quickstart guide (#19457) (#20571) 2021-10-09 16:01:35 -06:00
f9dcb8228f Added web3 reference guide (#19970) (#20568)
Co-authored-by: cryptogosu <82475023+cryptogosu@users.noreply.github.com>
2021-10-09 15:24:50 -06:00
68e8a05848 Fix solana docker image (#20551)
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-09 04:05:10 +00:00
bfc5f9fb6c v1.8: Bump crates to resolve audit failures (#20552)
* Bump nix

* Bump sha2 to resolve warning
2021-10-09 00:27:30 +00:00