Commit Graph

13881 Commits

Author SHA1 Message Date
94e50b61e8 Add llvm feature option to compile for Solana BPF target (#16495) 2021-09-25 22:11:58 -04:00
4113acbf24 Resolve zeroize_derive audit warning by bumping version (backport #20182) (#20189)
* Resolve zeroize_derive audit warning by bumping version (#20182)

* Revert "temporarily disable new audit"

This reverts commit 3dfbd95ddc.

* Bump version of zeroize_derive from v1.0.0 to v1.2.0

(cherry picked from commit 0c62a6fe3f)

# Conflicts:
#	ci/do-audit.sh

* resolve conflict

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-25 09:45:32 -04:00
572c0af699 runtime: remove inactive delegation from stakes cache 2021-09-22 20:39:34 -06:00
0a3bf17bb5 Only allow votes when root distance gets too high #2 (#19991)
Updates from master
2021-09-22 18:25:47 +02:00
431a82276e allow vote to have 1 or 2 sigs (#20082) 2021-09-22 03:13:44 +00:00
14505f5bfd Fix memo handling and "blocks" key formatting (#20044) (#20079)
* Fix memo handling and "blocks" key formatting

* Skip memo equality check

* Define slot_to_tx_by_addr_key

Co-authored-by: Justin Starry <justin@solana.com>
(cherry picked from commit 795dde109c)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-09-21 21:43:59 +00:00
c17c74021c sigverify to identify and mark simple vote transaction (#20021)
* sigverify to identify and mark simple vote transaction

* check vote tx at get_packet_offsets to cover both cpu and gpu paths

* add pubkey_len to PacketOffsets to reduce the redundant bytes counting
2021-09-20 23:00:33 -05:00
cfc0e2d61f Make bigtable delete-slots actually usable (#20037) (#20041)
(cherry picked from commit 22f45dca80)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-09-20 23:26:33 +00:00
b7fc704092 Optimize RPC pubsub for multiple clients with the same subscription (backport #18943) (#19986)
* Optimize RPC pubsub for multiple clients with the same subscription (#18943)

* reimplement rpc pubsub with a broadcast queue

* update tests for new pubsub implementation

* fix: fix review suggestions

* chore(rpc): add additional pubsub metrics

* integrate max subscriptions check into SubscriptionTracker to reduce locking

* separate subscription control from tracker

* limit memory usage of items in pubsub broadcast queue, improve error handling

* add more pubsub metrics

* add final count metrics to pubsub

* add metric for total number of subscriptions

* fix small review suggestions

* remove by_params from SubscriptionTracker and add node_progress_watchers map instead

* add subscription tracker tests

* add metrics for number of pubsub notifications as a counter

* ignore clippy lint in TokenCounter

* fix underflow in token counter

* reduce queue capacity in pubsub tests

* fix(rpc): fix test timeouts

* fix race in account subscription test

* Add RpcSubscriptions::new_for_tests

Co-authored-by: Pavel Strakhov <p.strakhov@iconic.vc>
Co-authored-by: Nikita Podoliako <n.podoliako@zubr.io>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit 65227f44dc)

* Fix conflicts (and standardize naming to make future subscription backports easier)

Co-authored-by: Pavel Strakhov <ri@idzaaus.org>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-20 07:32:34 +00:00
8bf5cdb349 bump 1.6 version (#19988) 2021-09-18 00:09:39 +00:00
eaa6aa0998 Only allow votes when root distance gets too high (#19916) v1.6.26 2021-09-17 22:28:11 +02:00
3b3822846b Add delete subcommand to ledger-tool bigtable (#19931) (#19962)
* Add `delete` subcommand to `ledger-tool bigtable` command

* feedback

(cherry picked from commit c71fab6cb3)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-17 04:25:36 +00:00
da7185e2ed rpc: performance fix for getProgramAccounts (backport #19941) (#19949)
* rpc: performance fix for getProgramAccounts (#19941)

* rpc: performance fix for getProgramAccounts

The accounts were gradually pushed into a vector, which produced
significant slowdowns for very large responses.

* rpc: rewrite loops using iterators

Co-authored-by: Christian Kamm <ckamm@delightful-solutions.de>
(cherry picked from commit f1bbf1d8b0)

# Conflicts:
#	core/src/rpc.rs

* fix conflicts

* Fix conflicts

Co-authored-by: Christian Kamm <mail@ckamm.de>
Co-authored-by: Justin Starry <justin@solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-16 23:09:11 +00:00
ccef24c44e Add banking metrics for buffered and dropped packets (#19902) (#19926)
(cherry picked from commit ca3f147670)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-16 00:39:02 +00:00
0c6a133b63 Restore feature declaration (#19922) 2021-09-15 16:45:59 -06:00
7873f6fb30 Report consumed_buffered_packets_count stat to metrics (#19899) 2021-09-15 07:21:20 -05:00
7cba9b8f8f Add an info log to indicate the node has reached supermajority and print the active stake percentage (#19893) (#19897)
(cherry picked from commit 4ff50519ff)

Co-authored-by: Michael <68944931+michaelh-laine@users.noreply.github.com>
2021-09-15 07:55:17 +00:00
ca55bce522 Bump version to 1.6.26 (#19894) 2021-09-14 23:29:33 -06:00
7de8a55b54 Use f64 for stake math in get_stake_percent_in_gossip (#19892) v1.6.25 2021-09-14 19:17:59 -06:00
7232b01a02 Bump version to v1.6.25 (#19880) 2021-09-14 20:33:13 +00:00
a4ebbc9f55 Remove demote_program_write_locks feature (#19877)
* Remove demote_program_write_locks feature

* Update test
v1.6.24
2021-09-14 12:25:42 -06:00
bf7c2f79c1 filters for recent contact-infos when checking for live stake (backport #19204) (#19873)
* filters for recent contact-infos when checking for live stake (#19204)

Contact-infos are saved to disk:
https://github.com/solana-labs/solana/blob/9dfeee299/gossip/src/cluster_info.rs#L1678-L1683

and restored on validator start-up:
https://github.com/solana-labs/solana/blob/9dfeee299/core/src/validator.rs#L450

Staked nodes entries will not expire until an epoch after. So when the
validator checks for online stake it is erroneously picking up
contact-infos restored from disk, which breaks the entire
wait-for-supermajority logic:
https://github.com/solana-labs/solana/blob/9dfeee299/core/src/validator.rs#L1515-L1561

This commit adds an extra check for the age of contact-info entries and
filters out old ones.

(cherry picked from commit 7a789e0763)

# Conflicts:
#	core/src/validator.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-14 18:21:56 +00:00
d401c3f5ab Bump version 2021-09-14 08:12:02 -07:00
83d08223fd More transaction forwarding (#19834) v1.6.23 2021-09-14 16:08:53 +02:00
6bb63f9abf Silence vercel github comments (#19827) (#19832)
(cherry picked from commit 8ac12c29ed)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-13 17:51:39 -05:00
d8293abc64 debug logs when crds table trim failed (#18307)
reports of this error being possibly spammy:
https://discord.com/channels/428295358100013066/689412830075551748/859441080054710293

The commit changes the log level to debug.
Additionally adding a new metric to understand the frequency of this error.

(cherry picked from commit 9d983a34a0)
2021-09-10 20:02:13 -07:00
4d074a6716 Reduce wait for supermajority threshold back to 80%
(cherry picked from commit 4386e09710)
2021-09-09 21:44:42 -07:00
3eee222667 Return error if Transaction contains writable executable or ProgramData accounts (backport #19629) (#19729)
* Return error if Transaction contains writable executable or ProgramData accounts (#19629)

* Return error if Transaction locks an executable as writable

* Return error if a ProgramData account is writable but the upgradable loader isn't present

* Remove unreachable clause

* Fixup bpf tests

* Review comments

* Add new TransactionError

* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables

(cherry picked from commit 38bbb77989)

# Conflicts:
#	programs/bpf/tests/programs.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	sdk/src/transaction.rs
#	storage-proto/proto/transaction_by_addr.proto
#	storage-proto/src/convert.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-09 03:06:02 +00:00
a78c3c07f2 filters crds values in parallel when responding to gossip pull-requests (backport #18877) (#19450)
* filters crds values in parallel when responding to gossip pull-requests (#18877)

When responding to gossip pull-requests, filter_crds_values takes a lot of time
while holding onto read-lock:
https://github.com/solana-labs/solana/blob/f51d64868/gossip/src/crds_gossip_pull.rs#L509-L566

This commit will filter-crds-values in parallel using rayon thread-pools.

(cherry picked from commit f1198fc6d5)

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-08 17:09:35 +00:00
53f8e58300 Demote write locks on transaction program ids (backport #19593) (backport #19633) (#19637)
* Demote write locks on transaction program ids (backport #19593) (#19633)

* Demote write locks on transaction program ids (#19593)

* Add feature

* Demote write lock on program ids

* Fixup bpf tests

* Update MappedMessage::is_writable

* Comma nit

* Review comments

(cherry picked from commit decec3cd8b)

# Conflicts:
#	core/src/banking_stage.rs
#	core/src/cost_model.rs
#	core/src/cost_tracker.rs
#	ledger-tool/src/main.rs
#	program-runtime/src/instruction_processor.rs
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/src/syscalls.rs
#	rpc/src/transaction_status_service.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs
#	sdk/benches/serialize_instructions.rs
#	sdk/program/src/message/mapped.rs
#	sdk/program/src/message/sanitized.rs
#	sdk/src/transaction/sanitized.rs

* Fix conflicts

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

# Conflicts:
#	cli-output/src/display.rs
#	core/src/transaction_status_service.rs
#	program-test/src/lib.rs
#	programs/bpf_loader/src/syscalls.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs
#	sdk/benches/serialize_instructions.rs
#	sdk/program/src/message.rs
#	sdk/src/feature_set.rs
#	transaction-status/src/parse_accounts.rs

* Replace feature and fix conflicts

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-04 09:10:57 +00:00
b4fdce9443 Populate memo in blockstore signatures-for-address (#19515) (#19604)
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e5744c)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-09-03 18:38:57 +00:00
39fe52fc06 Fix clippy (#17214) (#19609)
Newer clippy from +nightly have new errors about where annotations can and
cannot go.  This commit fixes two of them.

(cherry picked from commit b074e86ad2)

Co-authored-by: Brooks Prumo <brooks@solana.com>
2021-09-03 17:00:25 +00:00
db65b4e641 Populate memo in bigtable transaction structs (backport #19512) (#19606)
* Populate memo in bigtable transaction structs (#19512)

* Populate memo in bigtable transaction structs

* Preface memos with len

(cherry picked from commit f4ae450f34)

# Conflicts:
#	transaction-status/src/parse_instruction.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-03 09:26:08 +00:00
fe1c20c689 excludes epoch-slots from nodes with unknown or different shred version (backport #17899) (#19551)
* excludes epoch-slots from nodes with unknown or different shred version (#17899)

Inspecting TDS gossip table shows that crds values of nodes with
different shred-versions are creeping in. Their epoch-slots are
accumulated in ClusterSlots causing bogus slots very far from current
root which are not purged and so cause ClusterSlots keep consuming more
memory:
https://github.com/solana-labs/solana/issues/17789
https://github.com/solana-labs/solana/issues/14366#issuecomment-769896036
https://github.com/solana-labs/solana/issues/14366#issuecomment-832754654

This commit updates ClusterInfo::get_epoch_slots, and discards entries
from nodes with unknown or different shred-version.

Follow up commits will patch gossip not to waste bandwidth and memory
over crds values of nodes with different shred-version.

(cherry picked from commit 985280ec0b)

# Conflicts:
#	core/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-01 18:50:56 +00:00
6566a0f6c8 short cuts expiration check if origin's contact-info is still valid (#17918) (#19552)
Crds::find_old_labels can skip checking values timestamps if the
origin's contact info hasn't expired yet:
https://github.com/solana-labs/solana/blob/985280ec0/gossip/src/crds.rs#L394-L408

(cherry picked from commit cca46308bc)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-01 18:47:40 +00:00
3606de56f7 Fix tests that make assumptions about tx fee rate (#19538) (#19543)
(cherry picked from commit 4fb43bbd90)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-09-01 05:57:30 +00:00
9a005855dc persists repair-peers cache across repair service loops (backport #18400) (#19526)
* persists repair-peers cache across repair service loops (#18400)

The repair-peers cache is reset each time repair service loop runs,
and so computed repeatedly for the same slots:
https://github.com/solana-labs/solana/blob/d2b07dca9/core/src/repair_service.rs#L275

This commit uses an LRU cache to persists repair-peers for each slot.
In addition to LRU eviction rules, in order to avoid re-using outdated
data, each entry also has 10 seconds TTL.

(cherry picked from commit a0551b4054)

# Conflicts:
#	core/src/repair_service.rs
#	core/src/serve_repair.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-08-31 21:17:22 +00:00
70bdcf06b4 locks gossip only once in push_epoch_slots (backport #17355) (#19484)
* locks gossip only once in push_epoch_slots

push_epoch_slots is unlocking and locking again gossip when iterating
over epoch slot indices which is wasteful:
https://github.com/solana-labs/solana/blob/0486df02b/core/src/cluster_info.rs#L915-L929

(cherry picked from commit 9339a6f8f3)

# Conflicts:
#	core/src/cluster_info.rs

* removes redundant slots sort in push_epoch_slots

(cherry picked from commit 9471ba61c5)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-08-29 17:09:59 +00:00
f53f273585 parallelizes gossip packets receiver with processing of requests (backport #17647) (#19474)
* parallelizes gossip packets receiver with processing of requests (#17647)

Gossip packet processing is composed of two stages:
  * The first is consuming packets from the socket, deserializing,
    sanitizing and verifying them:
    https://github.com/solana-labs/solana/blob/7f0349b29/gossip/src/cluster_info.rs#L2510-L2521
  * The second is actually processing the requests/messages:
    https://github.com/solana-labs/solana/blob/7f0349b29/gossip/src/cluster_info.rs#L2585-L2605

The former does not acquire any locks and so can be parallelized with
the later, allowing better pipelineing properties and smaller latency in
responding to gossip requests or propagating messages.

(cherry picked from commit cab30e2356)

# Conflicts:
#	core/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-08-27 22:13:14 +00:00
e0584b77c5 Fixing missing pubsub notification for programSubscribe and logsSubscribe (backport #19092) (#19455)
* Fixing missing pubsub notification for programSubscribe and logsSubscribe (#19092)

#18587: programSubscribe is missing notifications randomly. The issue is because of two reasons

Not all rooted slots get OptimisticallyConfirmed notifications
The OptimisticallyConfirmed notifications can be out of order for slots: slot A and B with A < B can see notification for B first before A.
Summary of Changes

Changed OptimisticallyConfirmedBankTracker to send notifications for parent banks if they have not been notified yet. We use a new variable last_notified_slot to track that.

Tests:
With my validator running against testnet, before the fix, it was failing 75% of time, with the fix, it is passing consistently. Using the program mentioned in #18587.

(cherry picked from commit 1a372a792e)

# Conflicts:
#	core/src/optimistically_confirmed_bank_tracker.rs
#	core/src/rpc_subscriptions.rs

* Fix conflicts

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-27 01:31:51 +00:00
39a5431790 Bump jsonrpc crates and remove old tokio (#19454) 2021-08-26 23:53:44 +00:00
715c5e64c4 Bump version to 1.6.23 (#19447) 2021-08-26 18:09:15 +00:00
7956f04fa5 Backport Accounts Fixes #16838 and the test #17038 (#19412)
* reclaims unref accounts from index (#16838)

* Test account index and store alignment (#17038)

* Use ReclaimResult::Default() instead of building subtypes

* Add test to ensure account_db store and index are aligned

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: steviez <steven@solana.com>
v1.6.22
2021-08-25 14:40:53 -07:00
2825f82bee Add parameter to allow setting max-retries for SendTransaction rpc (backport #19387) (#19415)
* Add parameter to allow setting max-retries for SendTransaction rpc (#19387)

* Add parameter to cap rpc send retries for a tx

* Add parameter to docs

(cherry picked from commit 7482861f4b)

# Conflicts:
#	banks-server/src/banks_server.rs
#	core/src/rpc.rs
#	core/src/send_transaction_service.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-25 16:47:47 +00:00
45e3cd373b Bump crossbeam-epoch (backport #19378) (#19388)
* Bump to get off yanked crate (#19378)

(cherry picked from commit 82ea4891fd)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-24 08:16:08 +00:00
2b4b260c71 Update crossbeam-deque to 0.8.1 (#19361) (#19381)
(cherry picked from commit 2ccbe471ae)
2021-08-23 23:10:35 +00:00
866fd22fde ci: pin patched solana crates version for downstream project builds 2021-08-18 22:08:12 -06:00
d23df85410 Remove pin-project-lite warning 2021-08-18 22:08:12 -06:00
839cdecfd2 Bump assert_cmd and remove audit ignore 2021-08-18 22:08:12 -06:00
cc6296b1fa Add audit ignores 2021-08-18 22:08:12 -06:00