Commit Graph

14570 Commits

Author SHA1 Message Date
Michael Vines 30b60a976b Avoid ip_echo_server unwrap 2021-05-24 12:10:50 -07:00
jon-chuang ad1f24d487
runtime: Executor usage counts retain only single-epoch memory (#17162) 2021-05-24 12:01:56 -07:00
behzad nouri e867d7f3b8
removes Crds::lookup and lookup_versioned (#17438) 2021-05-24 18:21:54 +00:00
sakridge a8dca3976b
Refactor genesis download/load/check functions (#17276)
* Refactor genesis ingest functions

* Consolidate genesis.bin/genesis.tar.bz2 references
2021-05-24 16:45:36 +02:00
behzad nouri 9d112cf41f
encapsulates purged values bookkeeping into crds module (#17265)
For all code paths (gossip push, pull, purge, etc) that remove or
override a crds value, it is necessary to record hash of values purged
from crds table, in order to exclude them from subsequent pull-requests;
otherwise the next pull request will likely return outdated values,
wasting bandwidth:
https://github.com/solana-labs/solana/blob/ed51cde37/core/src/crds_gossip_pull.rs#L486-L491

Currently this is done all over the place in multiple modules, and this
has caused bugs in the past where purged values were not recorded.

This commit encapsulated this bookkeeping into crds module, so that any
code path which removes or overrides a crds value, also records the hash
of purged value in-place.
2021-05-24 13:47:21 +00:00
behzad nouri 060332c704
indexes crds votes by insert order (#17340)
Crds::get_votes is scanning over all votes in the crds table only to
return those inserted since the given cursor:
https://github.com/solana-labs/solana/blob/2ae57c172/core/src/crds.rs#L250-L266

Having votes indexed by insert order avoids the table scan and will be
more efficient.
2021-05-24 13:35:01 +00:00
dependabot[bot] 8aec50a275
chore: bump ts-node from 9.1.1 to 10.0.0 in /web3.js (#17432)
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.1.1 to 10.0.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.1.1...v10.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 12:10:12 +00:00
dependabot[bot] b58ebb7bcd
chore: bump @babel/core from 7.14.2 to 7.14.3 in /web3.js (#17431)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.14.2 to 7.14.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.3/packages/babel-core)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:50:41 +00:00
dependabot[bot] 702d0a4d10
chore: bump start-server-and-test from 1.12.1 to 1.12.2 in /web3.js (#17430)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.12.1...v1.12.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:32:38 +00:00
dependabot[bot] 65f6949376
chore: bump rpc-websockets from 7.4.11 to 7.4.12 in /web3.js (#17429)
Bumps [rpc-websockets](https://github.com/elpheria/rpc-websockets) from 7.4.11 to 7.4.12.
- [Release notes](https://github.com/elpheria/rpc-websockets/releases)
- [Commits](https://github.com/elpheria/rpc-websockets/compare/v7.4.11...v7.4.12)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:09:39 +00:00
dependabot[bot] e13cd33290
chore: bump @babel/plugin-transform-runtime in /web3.js (#17428)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.14.2 to 7.14.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.3/packages/babel-plugin-transform-runtime)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 09:58:13 +00:00
dependabot[bot] c8169a2f1b
chore: bump @typescript-eslint/eslint-plugin in /web3.js (#17427)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.23.0 to 4.24.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.24.0/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 09:30:56 +00:00
dependabot[bot] 2d63e15023
chore: bump @types/node from 15.0.3 to 15.6.0 in /web3.js (#17426)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.3 to 15.6.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 09:01:23 +00:00
dependabot[bot] db38ba81ee
chore: bump eslint-plugin-import from 2.22.1 to 2.23.3 in /web3.js (#17425)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.22.1 to 2.23.3.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.22.1...v2.23.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 08:40:34 +00:00
behzad nouri 5567305a5f
rolls back min number of bloom items for debug builds (#17420)
coverage ci builds are have become flaky presumably because of the
overhead added in https://github.com/solana-labs/solana/pull/17236
for very small test clusters.

This commit uses a smaller min number of bloom items condition on that
if debug assertions are enabled or not.

Previous attempt at fixing the flakiness:
https://github.com/solana-labs/solana/pull/17408
2021-05-23 16:50:19 +00:00
carllin 8664b2cc39
Fix bad assertion (#17401) 2021-05-22 20:18:13 -07:00
behzad nouri cf1acfb021 uses Duration type for gossip discover timeout 2021-05-22 19:17:36 +00:00
behzad nouri d6496376ce increases timeout duration for gossip discover 2021-05-22 19:17:36 +00:00
behzad nouri a7870cda8d records hash of timed-out pull responses
Gossip should record hash of pull responses which are timed out and
fail to insert:
https://github.com/solana-labs/solana/blob/ed51cde37/core/src/crds_gossip_pull.rs#L397-L400

so that they are excluded from the next pull request:
https://github.com/solana-labs/solana/blob/ed51cde37/core/src/crds_gossip_pull.rs#L486-L491

otherwise the next pull request will likely include the same timed out
values and waste bandwidth.
2021-05-22 17:02:24 +00:00
Nikita d41266e4e9
rpc: add context toggle to getProgramAccounts (#17399)
* fix(rpc): return context in get_program_accounts

* doc(rpc): document withContext flag

* fix(rpc): fix comment

Co-authored-by: Michael Vines <mvines@gmail.com>

* fix(rpc): fix doc

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-22 07:12:21 +00:00
Alexander Polakov 51178ccb33
account-decoder: don't use strings to convert between Pubkey types (#17391)
* account-decoder: don't use strings to convert between Pubkey types

* transaction-status: don't use strings to convert between Pubkey types
2021-05-21 22:53:53 +00:00
Alexander Meißner 855ae79598
Fix InvokeContext::push() account_deps (#17350)
* Reverts aliasing of account_deps with the previous invocation stack frame in InvokeContext::push().
* Adds explicit assert of programdata account content in test_program_bpf_upgrade_via_cpi.
2021-05-21 22:34:07 +02:00
behzad nouri 9471ba61c5 removes redundant slots sort in push_epoch_slots 2021-05-21 19:17:15 +00:00
behzad nouri 9339a6f8f3 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
2021-05-21 19:17:15 +00:00
Christian Machacek 8758e9ed82
Remove const qualifier from syscall out-parameters (#17382) 2021-05-21 12:09:22 -07:00
Jeff Washington (jwash) 3f3324231d
Hold read lock during startup shrink (#17309)
* hold read lock during account scan of shrink

* rename and improve rusty
2021-05-21 13:59:32 -05:00
Michael Vines 96cde36784 SetLockup now requires the authorized withdrawer when the lockup is not in force 2021-05-21 11:49:01 -07:00
behzad nouri ff0e623d30 removes the nested for loop from retransmit-stage
The code can be simplified by just flattening the vector of packets.
2021-05-21 17:10:56 +00:00
behzad nouri 71de021177 adds metric for turbine retransmit tree mismatch
In order to remove port-based forwarding logic in turbine, we need to
first track how often the turbine retransmit/broadcast trees mismatch
across nodes.
One consistency condition is that if the node is on the critical path
(i.e. the first node in each neighborhood), then we expect that the
packet arrives at tvu socket as opposed to tvu-forwards.

This commit adds a metric to track how often above condition is not met.
2021-05-21 17:10:56 +00:00
Trent Nelson 019bccab51 stake: merge accounts with mismatched, but expired lockups 2021-05-21 10:50:27 -06:00
Trent Nelson 74ac6ab80f stake: plumb `can_merge_expired_lockups` feature flag 2021-05-21 10:50:27 -06:00
Jack May 8c073b2c94 Update getrandom bpf dependency 2021-05-21 08:55:47 -07:00
behzad nouri 2adce67260
extends crds values timeouts if stakes are unknown (#17261)
If stakes are unknown, then timeouts will be short, resulting in values
being purged from the crds table, and consequently higher pull-response
load when they are obtained again from gossip. In particular, this slows
down validator start where almost all values obtained from entrypoint
are immediately discarded.
2021-05-21 15:55:22 +00:00
Jeff Washington (jwash) 44831c18d2
reuse work in is_non_loader_key (#16521) 2021-05-21 10:07:04 -05:00
Jeff Washington (jwash) 8143ee5502
add AccountsIndex AccountMapsReadLock type (#17365) 2021-05-21 10:02:14 -05:00
Jeff Washington (jwash) 2f55547d37
remove flatten in storage scan (#17354)
* remove flatten in storage scan

* fix tests
2021-05-21 09:26:46 -05:00
behzad nouri 5e6b00fe98
prioritizes more recent values in pull responses (#17238)
On the receiving end, the outdated values are discarded, and they will
only waste bandwidth:
https://github.com/solana-labs/solana/blob/3f0480d06/core/src/crds_gossip_pull.rs#L385-L400

This is also exacerbating validator start, since the entrypoint is
returning old values in pull responses, and the validator immediately
discards those; resulting in huge delay until the validator obtains
contact-info of the entrypoint and is able to adopt shred-version and
fully start.
2021-05-21 14:07:46 +00:00
behzad nouri e8b35a4f7b
bumps up min number of bloom items in gossip pull requests (#17236)
When a validator starts, it has an (almost) empty crds table and it only
sends one pull-request to the entrypoint. The bloom filter in the
pull-request targets 10% false rate given the number of items. So, if
the `num_items` is very wrong, it makes a very small bloom filter with a
very high false rate:
https://github.com/solana-labs/solana/blob/2ae57c172/runtime/src/bloom.rs#L70-L80
https://github.com/solana-labs/solana/blob/2ae57c172/core/src/crds_gossip_pull.rs#L48

As a result, it is very unlikely that the validator obtains entrypoint's
contact-info in response. This exacerbates how long the validator will
loop on:
    > Waiting to adopt entrypoint shred version
https://github.com/solana-labs/solana/blob/ed51cde37/validator/src/main.rs#L390-L412

This commit increases the min number of bloom items when making gossip
pull requests. Effectively this will break the entrypoint crds table
into 64 shards, one pull-request for each, a larger bloom filter for
each shard, and increases the chances that the response will include
entrypoint's contact-info, which is needed for adopting shred version
and validator start.
2021-05-21 13:59:26 +00:00
jon-chuang 662c2aaeec
programs/stake: cancel deactivate (#17344)
fix: remove stray println

add error for inconsistent input.

fix: lamports don't need to match when redelegating to same vote account

Improve comments

bump

Apply suggestions from code review


Add assert in test

Use stake_program_v4

Co-Authored-By: Trent Nelson <trent.a.b.nelson@gmail.com>

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-05-21 05:31:55 +00:00
Trent Nelson e320af99a0 clap-utils: Fix signer resolution on Windows 2021-05-21 02:12:57 +00:00
Tyera Eulberg 91f2b6185e
Prevent withrawing Initialized stake account to zero stake (#17366) 2021-05-21 02:01:08 +00:00
Michael Vines 2c99b23ad7 Add get_sysvar() helper to sdk 2021-05-21 01:30:12 +00:00
Jeff Washington (jwash) 45552d271a
take mutex once in process_dead_slots (#17357) 2021-05-20 19:50:58 -05:00
Michael Vines a1a0d6f84b Add stake_program_v4 feature 2021-05-20 21:15:18 +00:00
Josh 741f99ebb6
Explorer: introduce rewards tab for stake/vote accounts (#16851)
* feat: introduce staking rewards tab

* feat: take into consideration stake activation

* fix: report fetch errors

* fix: find rewards all the way to epoch 0

* fix: find rewards all the way to epoch 0

* fix: autocomplete error

* fix: load one page at a time
2021-05-20 14:00:48 -07:00
Jeff Washington (jwash) 0486df02ba
don't limit to thread pool when cleaning on startup (#17317) 2021-05-20 14:36:35 -05:00
Tao Zhu dd13a31a5a
restore Serum in CI downstream job (#17346) 2021-05-20 15:33:19 +00:00
Jeff Washington (jwash) 33ab9c4e8d
batch insert account_index items in generate_index (#17290) 2021-05-20 10:29:13 -05:00
Jeff Washington (jwash) 9b74988fc6
calculate_accounts_hash does not throttle threads on startup (#17338) 2021-05-20 10:25:54 -05:00
Jeff Washington (jwash) a9aa533684
replace Ancestors HashMap for performance (#16477)
* replace Ancestors HashMap for performance

* add ancestors module
2021-05-20 10:11:56 -05:00