Commit Graph

14831 Commits

Author SHA1 Message Date
c693ecc4c8 fixes backports code changes (#20541) 2021-10-08 15:30:27 +00:00
afe866ad02 Enable easy full-rpc services on testnet nodes (#20530) 2021-10-07 19:36:23 -06:00
6a73bf767b adds metrics for number of nodes vs number of pubkeys (backport #20512) (#20524)
* 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-07 22:27:48 +00:00
7d0494fcaa Merge AccountsDb plugin framework to v1.8 (#20518)
Merge AccountsDb plugin framework to v1.8 (#20518)
Summary of Changes

Create a plugin mechanism in the accounts update path so that accounts data can be streamed out to external data stores (be it Kafka or Postgres). The plugin mechanism allows

Data stores of connection strings/credentials to be configured,
Accounts with patterns to be streamed
PostgreSQL implementation of the streaming for different destination stores to be plugged in.

The code comprises 4 major parts:

accountsdb-plugin-intf: defines the plugin interface which concrete plugin should implement.
accountsdb-plugin-manager: manages the load/unload of plugins and provide interfaces which the validator can notify of accounts update to plugins.
accountsdb-plugin-postgres: the concrete plugin implementation for PostgreSQL
The validator integrations: updated streamed right after snapshot restore and after account update from transaction processing or other real updates.
The plugin is optionally loaded on demand by new validator CLI argument -- there is no impact if the plugin is not loaded.
2021-10-07 14:15:05 -07:00
33d8e242c5 Fixup docs on deprecated JSON-RPC methods (backport #20515) (#20521)
* 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-07 20:37:01 +00:00
ef55045724 rebase 2021-10-07 07:44:12 -07:00
81d2c3261c Derive Pod/Zeroable for Pubkey
(cherry picked from commit f966859829)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	sdk/program/Cargo.toml
2021-10-07 07:44:12 -07:00
348ba57b12 Bump version to 1.8.1 2021-10-06 17:57:06 -07:00
4a8ff62ad3 Add RecentItems metrics (#20484) (#20490) v1.8.0 2021-10-06 17:07:33 -06:00
db85d659b9 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:55:29 -06:00
a4df784e82 Bump version to 1.8.0 2021-10-06 15:48:23 -06: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) v1.7.14 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
257ddbeee1 Tpu vote 1.7 (#20187)
* Add separate vote processing tpu port

* Add feature to send to tpu vote port

* Add vote rejecting sigverify mode

* use packet.meta.is_simple_vote_tx in place of deserialization

* consolidate code that identifies vote tx atcommon path for cpu and gpu

* new key for feature set

* banking forward tpu vote

* add tpu vote port to dockerfile and other review changes

* Simplify thread id compare

* fix a test; updated cluster_info ABI change

Co-authored-by: Tao Zhu <tao@solana.com>
v1.7.13
2021-09-29 18:12:58 +02:00
47c1730808 uses rayon thread-pool for retransmit-stage parallelization (#19486) (#20293)
(cherry picked from commit 01a7ec8198)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-29 14:11:46 +00:00
a005a6b816 Restore ability for programs to upgrade themselves (backport #20265) (#20295)
* Restore ability for programs to upgrade themselves (#20265)

* Make helper associated fn

* Add feature definition

* Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test

* Use single feature

(cherry picked from commit 2cd9dc99b6)

# Conflicts:
#	runtime/src/accounts.rs
#	sdk/program/src/message.rs
#	sdk/program/src/message/mapped.rs
#	sdk/program/src/message/sanitized.rs
#	sdk/src/feature_set.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-29 01:34:33 +00:00
2f2948f998 Extricate RpcCompletedSlotsService from RetransmitStage (backport #18017) (#20294)
* Extricate RpcCompletedSlotsService from RetransmitStage

(cherry picked from commit fa04531c7a)

# Conflicts:
#	core/src/replay_stage.rs
#	core/src/retransmit_stage.rs
#	core/src/tvu.rs
#	core/src/validator.rs

* removes backport merge conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 18:25:51 +00:00
55ccff7604 skips retransmit for shreds with unknown slot leader (backport #19472) (#20291)
* skips retransmit for shreds with unknown slot leader (#19472)

Shreds' signatures should be verified before they reach retransmit
stage, and if the leader is unknown they should fail signature check.
Therefore retransmit-stage can as well expect to know who the slot
leader is and otherwise just skip the shred.

Blockstore checking signature of recovered shreds before sending them to
retransmit stage:
https://github.com/solana-labs/solana/blob/4305d4b7b/ledger/src/blockstore.rs#L884-L930

Shred signature verifier:
https://github.com/solana-labs/solana/blob/4305d4b7b/core/src/sigverify_shreds.rs#L41-L57
https://github.com/solana-labs/solana/blob/4305d4b7b/ledger/src/sigverify_shreds.rs#L105

(cherry picked from commit 6d9818b8e4)

# Conflicts:
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	ledger/src/shred.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 15:26:30 +00:00
1bf88556ee removes Slot from TransmitShreds (backport #19327) (#20260)
* removes Slot from TransmitShreds (#19327)

An earlier version of the code was funneling through stakes along with
shreds to broadcast:
https://github.com/solana-labs/solana/blob/b67ffab37/core/src/broadcast_stage.rs#L127

This was changed to only slots as stakes computation was pushed further
down the pipeline in:
https://github.com/solana-labs/solana/pull/18971

However shreds themselves embody which slot they belong to. So pairing
them with slot is redundant and adds rooms for bugs should they become
inconsistent.

(cherry picked from commit 1deb4add81)

# Conflicts:
#	core/benches/cluster_info.rs
#	core/src/broadcast_stage.rs
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
#	core/src/broadcast_stage/standard_broadcast_run.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 12:55:01 +00:00
4c4f183515 reverts #17542 (#20259) (#20273)
https://github.com/solana-labs/solana/pull/17542
excludes caller's crds values from pull responses.

Reverting that commit so that when a (staked) node restarts, it can
obtain its crds values before restart from other nodes.

(cherry picked from commit 43ed727ba7)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 12:54:31 +00:00
282322cbe8 Add more docs for RpcClient (backport #19771) (#20266)
* Add more docs for RpcClient (#19771)

* Add more docs for RpcClient

* Use custom mocks in rpc_client examples

* Move create_rpc_client_mocks into rpc_client module

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* Update client/src/rpc_client.rs

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

* Update RpcClient docs per review feedback

* Consistently link 'commitment level' in RpcClient docs

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

# Conflicts:
#	client/src/mock_sender.rs
#	client/src/rpc_client.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-28 07:27:23 +00:00
2dc00d0e13 Paper wallet: fix URI scheme (#20233) (#20278)
(cherry picked from commit 38844a7010)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-28 01:29:42 +00:00
a90c338982 Rpc: use rust convenient methods
(cherry picked from commit ac79ae6848)
2021-09-27 13:46:27 -07:00
36c283026f fix Borsh typo
changes `BORSH_IO_ERROR` from `unkown` to `unknown` error

(cherry picked from commit e94b7984a1)
2021-09-27 12:30:41 -07:00
a1a0c63862 retransmits shreds recovered from erasure codes (backport #19233) (#20249)
* removes packet-count metrics from retransmit stage

Working towards sending shreds (instead of packets) to retransmit stage
so that shreds recovered from erasure codes are as well retransmitted.

Following commit will add these metrics back to window-service, earlier
in the pipeline.

(cherry picked from commit bf437b0336)

# Conflicts:
#	core/src/retransmit_stage.rs

* adds packet/shred count stats to window-service

Adding back these metrics from the earlier commit which removed them
from retransmit stage.

(cherry picked from commit 8198a7eae1)

* removes erroneous uses of Arc<...> from retransmit stage

(cherry picked from commit 6e413331b5)

# Conflicts:
#	core/src/retransmit_stage.rs
#	core/src/tvu.rs

* sends shreds (instead of packets) to retransmit stage

Working towards channelling through shreds recovered from erasure codes
to retransmit stage.

(cherry picked from commit 3efccbffab)

# Conflicts:
#	core/src/retransmit_stage.rs

* returns completed-data-set-info from insert_data_shred

instead of opaque (u32, u32) which are then converted to
CompletedDataSetInfo at the call-site.

(cherry picked from commit 3c71670bd9)

# Conflicts:
#	ledger/src/blockstore.rs

* retransmits shreds recovered from erasure codes

Shreds recovered from erasure codes have not been received from turbine
and have not been retransmitted to other nodes downstream. This results
in more repairs across the cluster which is slower.

This commit channels through recovered shreds to retransmit stage in
order to further broadcast the shreds to downstream nodes in the tree.

(cherry picked from commit 7a8807b8bb)

# Conflicts:
#	core/src/retransmit_stage.rs
#	core/src/window_service.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 18:11:37 +00:00
e20fdde0a4 Wallet guide: fix grammar (#20228) (#20254)
(cherry picked from commit f107aa296b)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-27 16:56:14 +00:00
5b52ac8990 Fix grammar in conventions.md (#20236) (#20252)
(cherry picked from commit af57bd3d48)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-27 16:39:39 +00:00
502ae8b319 removes repeated bank-forks locking in window-service (backport #19210) (#20239)
* removes repeated bank-forks locking in window-service

Window service is repeatedly locking bank-forks to look-up working-bank
for every single shred:
https://github.com/solana-labs/solana/blob/5fde4ee3a/core/src/window_service.rs#L597-L606

This commit updates shred_filter signature in recv_window so that where
we already obtain the lock on bank-forks, we can also look-up
working-bank once for all packets:
https://github.com/solana-labs/solana/blob/5fde4ee3a/core/src/window_service.rs#L256-L277

(cherry picked from commit d57398a959)

# Conflicts:
#	core/src/window_service.rs

* removes erroneous uses of &Arc<...> from window-service

(cherry picked from commit b64eeb7729)

# Conflicts:
#	core/src/window_service.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 13:48:58 +00:00
30f0b3cf53 removes raw indexing from streamer (backport #19183) (#20237)
* removes raw indexing from streamer (#19183)

Raw indexing is verbose and error-prone. This same code had an indexing
bug causing validator nodes panic just a few months ago:
https://github.com/solana-labs/solana/commit/482b8c6be

(cherry picked from commit 8229a4fbf6)

# Conflicts:
#	streamer/Cargo.toml

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 13:48:13 +00:00
2975dc5c1a removes use of public ip addresses from perf tests (backport #19184) (#20238)
* removes use of public ip addresses from system tests

Using global IPs causes outbound traffic which costs money:
https://github.com/solana-labs/solana/pull/18728#issuecomment-884290209

(cherry picked from commit bd8f793809)

* removes redundant allow-private-addr from system tests

Following https://github.com/solana-labs/solana/pull/19130
if gce.sh creat is invoked without -P then --allow-private-addr is
implied:
https://github.com/solana-labs/solana/blob/4cc1b1504/net/common.sh#L68-L73

Therefore tests only need to specify:
  USE_PUBLIC_IP_ADDRESSES: "false"

(cherry picked from commit 18463aa846)

# Conflicts:
#	system-test/partition-testcases/gce-5-node-3-partition.yml
#	system-test/partition-testcases/gce-partition-once-then-stabilize.yml
#	system-test/partition-testcases/gce-partition-with-offline.yml

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 01:23:02 +00:00