2367 Commits

Author SHA1 Message Date
mergify[bot]
e012a05b08 Add RecentItems metrics (#20484) (#20486)
(cherry picked from commit e13ed8a627)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-06 16:51:19 -06:00
Justin Starry
aa5e23799f Optimize stakes cache and rewards at epoch boundaries (backport #20432) (#20475)
* Optimize stakes cache and rewards at epoch boundaries (backport #20432)

* fix conflicts
2021-10-06 16:25:30 -04:00
Tyera Eulberg
5df386ae0e Bump version to v1.6.28 (#20300) 2021-09-28 20:23:27 +00:00
Tyera Eulberg
c5d174c170 Use single feature (#20289) 2021-09-28 04:30:11 -06:00
Tyera Eulberg
9b6ec0b6d5 v1.6: Restore ability for programs to upgrade themselves (#20263)
* Make helper associated fn

* Add feature definition

* Restore program-id write lock when upgradeable loader is present; restore bpf upgrade-self test

* Remove spurious comment
2021-09-27 22:29:59 +00:00
sakridge
0a3bf17bb5 Only allow votes when root distance gets too high #2 (#19991)
Updates from master
2021-09-22 18:25:47 +02:00
mergify[bot]
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
sakridge
8bf5cdb349 bump 1.6 version (#19988) 2021-09-18 00:09:39 +00:00
sakridge
eaa6aa0998 Only allow votes when root distance gets too high (#19916) 2021-09-17 22:28:11 +02:00
mergify[bot]
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
mergify[bot]
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
Justin Starry
7873f6fb30 Report consumed_buffered_packets_count stat to metrics (#19899) 2021-09-15 07:21:20 -05:00
mergify[bot]
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
Michael Vines
ca55bce522 Bump version to 1.6.26 (#19894) 2021-09-14 23:29:33 -06:00
Tyera Eulberg
7de8a55b54 Use f64 for stake math in get_stake_percent_in_gossip (#19892) 2021-09-14 19:17:59 -06:00
Tyera Eulberg
7232b01a02 Bump version to v1.6.25 (#19880) 2021-09-14 20:33:13 +00:00
Tyera Eulberg
a4ebbc9f55 Remove demote_program_write_locks feature (#19877)
* Remove demote_program_write_locks feature

* Update test
2021-09-14 12:25:42 -06:00
mergify[bot]
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
Stephen Akridge
d401c3f5ab Bump version 2021-09-14 08:12:02 -07:00
sakridge
83d08223fd More transaction forwarding (#19834) 2021-09-14 16:08:53 +02:00
behzad nouri
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
Michael Vines
4d074a6716 Reduce wait for supermajority threshold back to 80%
(cherry picked from commit 4386e09710)
2021-09-09 21:44:42 -07:00
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
mergify[bot]
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
Tyera Eulberg
39a5431790 Bump jsonrpc crates and remove old tokio (#19454) 2021-08-26 23:53:44 +00:00
sakridge
715c5e64c4 Bump version to 1.6.23 (#19447) 2021-08-26 18:09:15 +00:00
mergify[bot]
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
Trent Nelson
011fe72aa2 Bump version to v1.6.22 2021-08-18 22:08:12 -06:00
mergify[bot]
40fc14471d Really start caching by fixing swapped CAS... (#18842) (#18969)
(cherry picked from commit 611af87fdb)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-07-29 16:52:46 +00:00
mergify[bot]
7fc85b8c9b Fix erroneous default start_slot (#18948) (#18951)
(cherry picked from commit 578f2aa22b)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-29 03:56:54 +00:00
Tyera Eulberg
4d77ac1688 Bump version to v1.6.21 (#18953) 2021-07-28 23:47:03 +00:00
sakridge
3539849a7f Add voting service (#18552) (#18781) 2021-07-22 22:26:04 +02:00
Jon Cinque
ba8426e0fd 1.6: Bump crates to 1.6.20 (#18805) 2021-07-21 17:44:41 +02:00
Trent Nelson
d7b381c90c Bump version to v1.6.19 2021-07-17 08:57:44 +00:00
mergify[bot]
6f661dd8a9 excludes private ip addresses (#18739)
(cherry picked from commit e316586516)

# Conflicts:
#	core/src/broadcast_stage.rs
#	core/src/cluster_info.rs

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-17 03:48:07 +00:00
Trent Nelson
3dbdaa5341 Bump version to v1.6.18 2021-07-16 09:57:58 +00:00
mergify[bot]
8f3ce5fc57 Cli configurable validators (backport #18630) (#18665)
* rpc: more params for `GetVoteAccountsConfig`

(cherry picked from commit bf90ea282a)

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

* cli: allow returning more `solana validators`

(cherry picked from commit a4a24b6531)

# Conflicts:
#	Cargo.lock
#	cli/Cargo.toml
#	cli/src/cluster_query.rs

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-16 07:45:49 +00:00
mergify[bot]
63d7fdb4bd Gate libsecp256k1 update (backport #18656) (#18700)
* hijack secp256k1 enablement feature plumbing for libsecp256k1 upgrade

* Bump libsecp256k1 to v0.5.0

* gate libsecp256k1 upgrade to v0.5.0

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-16 03:34:13 +00:00
Michael Vines
b629291848 Record vote account commission with voting/staking rewards and surface in RPC
(cherry picked from commit 4098af3b5b)

# Conflicts:
#	docs/src/developing/clients/jsonrpc-api.md
#	runtime/src/bank.rs
2021-07-12 18:16:25 -07:00
mergify[bot]
1be989c5d2 adds fallback logic if retransmit multicast fails (backport #17714) (#18498)
* adds fallback logic if retransmit multicast fails (#17714)

In retransmit-stage, based on the packet.meta.seed and resulting
children/neighbors, each packet is sent to a different set of peers:
https://github.com/solana-labs/solana/blob/708bbcb00/core/src/retransmit_stage.rs#L421-L457

However, current code errors out as soon as a multicast call fails,
which will skip all the remaining packets:
https://github.com/solana-labs/solana/blob/708bbcb00/core/src/retransmit_stage.rs#L467-L470

This can exacerbate packets loss in turbine.

This commit:
  * keeps iterating over retransmit packets for loop even if some
    intermediate sends fail.
  * adds a fallback to UdpSocket::send_to if multicast fails.

Recent discord chat:
https://discord.com/channels/428295358100013066/689412830075551748/849530845052403733

(cherry picked from commit be957f25c9)

# Conflicts:
#	core/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-07 22:36:32 +00:00
sakridge
06b1c980d4 Bump version to v1.6.17 (#18393) 2021-07-02 19:40:37 +00:00
Trent Nelson
86c26f8432 Revert "Clean up build warning"
This reverts commit 17a173ebb5.

(cherry picked from commit d269975784)
2021-07-01 19:09:08 -07:00
mergify[bot]
78d44ae215 More detailed voting timings in replay stage (#18229) (#18246)
(cherry picked from commit 5d08bf9aa3)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-07-01 14:10:04 +00:00