Commit Graph

13975 Commits

Author SHA1 Message Date
Jeff Washington (jwash) 82e11588a5
lamports -> lamports() (#16915) 2021-04-28 14:55:55 -05:00
carllin b5d30846d6
Retry latest vote if expired (#16735) 2021-04-28 11:46:16 -07:00
Jeff Washington (jwash) 9070191b8b
stats on clean for removing roots (#16849)
* stats on clean for removing roots

* rename

* accumulate and swap metrics
2021-04-28 13:24:01 -05:00
Jeff Washington (jwash) 9218b51de7
accountshareddata.executable is private (#16882) 2021-04-28 12:01:31 -05:00
Brooks Prumo 77f1ffd84b
Collect uncleaned pubkeys from all slots (#16786)
While working on another issue (#16580), the list of uncleaned pubkeys
returned from `remove_uncleaned_slots_and_collect_pubkeys_up_to_slot()`
did not include unrooted slots.  This meant that during cleaning,
unrooted slots would not have their pubkeys cleaned up properly.

Now, return all uncleaned pubkeys, regardless if the slot is rooted or
not.  Additionally, update the tests to have unrooted slots to ensure
this behavior.

This is part two of PR #16879, and originally based on PR #15106.
2021-04-28 10:57:42 -05:00
joeaba 0aecc6033a
Update rpc-endpoints.md (#16910) 2021-04-28 21:01:54 +05:30
Jeff Washington (jwash) f35453f838
AccountSharedData.set_executable() (#16876) 2021-04-28 15:25:58 +00:00
Ryan M. Shea 7f1c1fe6a4
Add banner to page (#16908) 2021-04-28 08:14:25 -06:00
Jeff Washington (jwash) a7a671b3aa
AccountSharedData.set_executable() (#16881) 2021-04-28 14:07:43 +00:00
Jeff Washington (jwash) 2021255f91
executable() (#16880) 2021-04-28 08:53:54 -05:00
Jeff Washington (jwash) 30e83a4a3c
private AccountSharedData.rent_epoch (#16878) 2021-04-28 08:53:21 -05:00
Jeff Washington (jwash) da3342759b
private AccountSharedData.rent_epoch (#16877) 2021-04-28 08:52:20 -05:00
Jeff Washington (jwash) 6381ee38eb
reclaims unref accounts from index (#16838) 2021-04-28 08:50:38 -05:00
Jeff Washington (jwash) 1864bc2080
write Option<AccountSharedData> (#16874)
* write Option<&AccountSharedData>

* add comment
2021-04-28 08:47:26 -05:00
behzad nouri 25054bfd35
retains peer's contact-info when making pull requests (#16715)
ClusterInfo::new_pull_requests has to lookup contact-infos:
https://github.com/solana-labs/solana/blob/a1ef2bd74/core/src/cluster_info.rs#L1663-L1673

when it was already available when making pull requests:
https://github.com/solana-labs/solana/blob/a1ef2bd74/core/src/crds_gossip_pull.rs#L232
2021-04-28 13:19:12 +00:00
Brooks Prumo 1eaff394da
Refactor `collect_uncleaned_pubkeys_to_slot()` (#16879)
* Refactor `collect_uncleaned_pubkeys_to_slot()`

While working on another issue (#16580), I came across
`collect_unclean_pubkeys_to_slot()` and had difficulty understanding it.
Since the function does a few logically separate things, I split the
function up.  I also added documentation, removed an unused return value,
and renamed the functions to be more specific.

This commit is to split up an existing PR (#16786), where I had both this
aesthetic change _and_ a behavioral change.
2021-04-28 08:16:12 -05:00
behzad nouri 1ac2a8cfa5
removes delayed crds inserts when upserting gossip table (#16806)
It is crucial that VersionedCrdsValue::insert_timestamp does not go
backward in time:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds.rs#L67-L79

Otherwise methods such as get_votes and get_epoch_slots_since will
break, which will break their downstream flow, including vote-listener
and optimistic confirmation:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1197-L1215
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1274-L1298

For that, Crds::new_versioned is intended to be called "atomically" with
Crds::insert_verioned (as the comment already says so):
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds.rs#L126-L129

However, currently this is violated in the code. For example,
filter_pull_responses creates VersionedCrdsValues (with the current
timestamp), then acquires an exclusive lock on gossip, then
process_pull_responses writes those values to the crds table:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L2375-L2392

Depending on the workload and lock contention, the insert_timestamps may
well be in the past when these values finally are inserted into gossip.

To avoid such scenarios, this commit:
  * removes Crds::new_versioned and Crd::insert_versioned.
  * makes VersionedCrdsValue constructor private, only invoked in
    Crds::insert, so that insert_timestamp is populated right before
    insert.

This will improve insert_timestamp monotonicity as long as Crds::insert
is not called with a stalled timestamp. Following commits may further
improve this by calling timestamp() inside Crds::insert, and/or
switching to std::time::Instant which guarantees monotonicity.
2021-04-28 11:56:13 +00:00
dependabot[bot] 1c95e2bbee
chore: bump jayson from 3.5.2 to 3.6.1 in /web3.js (#16901)
Bumps [jayson](https://github.com/tedeh/jayson) from 3.5.2 to 3.6.1.
- [Release notes](https://github.com/tedeh/jayson/releases)
- [Commits](https://github.com/tedeh/jayson/compare/v3.5.2...v3.6.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-28 08:55:36 +00:00
Trent Nelson aee30e304d chore: export `is_on_curve()` 2021-04-28 06:37:25 +00:00
behzad nouri b17d5eeaee
moves cluster-info metrics to a separate module (#16883) 2021-04-28 02:04:49 +00:00
Tyera Eulberg 36574c30ef
Add allowed-ip list to faucet (#16891) 2021-04-28 01:31:32 +00:00
behzad nouri b468ead1b1
uses current timestamp when flushing local pending push queue (#16808)
local_message_pending_push_queue is recording timestamps at the time the
value is created, and uses that when the pending values are flushed:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L321
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds_gossip.rs#L96-L102

which is then used as the insert_timestamp when inserting values in the
crds table:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds_gossip_push.rs#L183

The flushing may happen 100ms after the values are created (or even
later if there is a lock contention). This will cause non-monotone
insert_timestamps in the crds table (where time goes backward),
hindering the usability of insert_timestamps for other computations.

For example both ClusterInfo::get_votes and get_epoch_slots_since rely
on monotone insert_timestamps when values are inserted into the table:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1197-L1215
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1274-L1298

This commit removes timestamps from local_message_pending_push_queue and
uses current timestamp when flushing the queue.
2021-04-28 00:15:11 +00:00
Trent Nelson cac666d035 remote-wallet: Move `Locator` to its own module 2021-04-27 17:54:02 -06:00
Trent Nelson 4ce4f04c58 remote-wallet: `derivation-path` crate doesn't like empty trailing child indexes 2021-04-27 17:54:02 -06:00
Trent Nelson 3d12be29ec remote-wallet: Plumb `Locator` into `RemoteWalletInfo` 2021-04-27 17:54:02 -06:00
Trent Nelson 64fcb792c2 remote-wallet: Add helpers for locating remote wallets 2021-04-27 17:54:02 -06:00
Trent Nelson 722de942ca SDK: More conversion for `DerivationPath` 2021-04-27 17:54:02 -06:00
Trent Nelson 9b7120bf73 SDK: More conversions for `Pubkey` 2021-04-27 17:54:02 -06:00
steviez bc31378797
Trim extra shred bytes in blockstore (#16602)
Strip the zero-padding off of data shreds before insertion into blockstore

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
Co-authored-by: Nathan Hawkins <utsl@utsl.org>
2021-04-27 17:40:41 -05:00
Tyera Eulberg 283f587afe
Enable multiple payers in accounts-cluster-bench (#16889)
* Enable multiple payer keypairs

* Suppress tx creation if batch size == 0

* Suppress logs when waiting to create txs

* Double airdrop threshold to prevent stall when closing accounts
2021-04-27 21:26:16 +00:00
Jack May 9b3a59f030
Retain alloc'd and updated data in cpi (#16850) 2021-04-27 13:36:42 -07:00
Jeff Washington (jwash) 1bd623cd15
private AccountSharedData.rent_epoch (#16844) 2021-04-27 13:51:13 -05:00
Jeff Washington (jwash) 2f5102587c
owner() lifetime issue (#16875) 2021-04-27 12:57:47 -05:00
Jeff Washington (jwash) 8f56c116d7
tests: lamports += to checked_add (#16842) 2021-04-27 10:23:07 -05:00
Jeff Washington (jwash) d533f77301
bank.withdraw uses checked_sub_lamports (#16848)
* bank.withdraw uses checked_sub_lamports

* retain previous codepath for error

* map_err from clippy
2021-04-27 09:58:41 -05:00
Jeff Washington (jwash) 69bfbf9e98
AccountSharedData.set_executable (#16836) 2021-04-27 09:56:50 -05:00
Jeff Washington (jwash) 3887169db0
lamports += to checked_add (#16841) 2021-04-27 09:56:18 -05:00
Jeff Washington (jwash) 47ca7063f2
rootstracker.remove returns previous state (#16831) 2021-04-27 09:15:44 -05:00
Jeff Washington (jwash) 3fdbaefaa6
tests: lamports -= to checked_sub (#16843) 2021-04-27 09:12:48 -05:00
Jeff Washington (jwash) 998cba74b5
AccountSharedData.executable() (#16835) 2021-04-27 09:12:17 -05:00
Jeff Washington (jwash) 4e7e675c07
lamports += -> checked_add_lamports (#16791) 2021-04-27 09:11:35 -05:00
Jeff Washington (jwash) 81402ee7f5
pass &Pubkey through account storage, slot clean code to reduce copies (#16778)
* &Pubkey

* use trait to pass &Hash or Hash

* use impl Borrow<Hash> instead of trait

* remove old code line commented out
2021-04-27 09:10:06 -05:00
behzad nouri 3b8d6b59fb
records hash of values purged by expired pull-responses (#16800)
process_pull_responses should record hash of values purged by expired
responses (as well as unexpired ones):
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L385-L387

otherwise, these values are not excluded from following pull-requests
(from likely different nodes):
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L447-L452

and would waste bandwidth should they be included in subsequent
pull-responses.
2021-04-27 12:06:49 +00:00
behzad nouri 0f3ac51cf1
limits to data_header.size when combining shreds' payloads (#16708)
Shredder::deshred is ignoring data_header.size when combining shreds' payloads:
https://github.com/solana-labs/solana/blob/37b8587d4/ledger/src/shred.rs#L940-L961

Also adding more sanity checks on the alignment of data shreds indices.
2021-04-27 12:04:44 +00:00
dependabot[bot] 68d5aec55b
chore:(deps): bump @types/react from 17.0.3 to 17.0.4 in /explorer (#16868)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.3 to 17.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:22:57 +00:00
dependabot[bot] 9606126543
chore:(deps): bump @solana/web3.js from 1.5.0 to 1.7.0 in /explorer (#16866)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.5.0 to 1.7.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.5.0...v1.7.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:15:29 +00:00
dependabot[bot] e5d1037fda
chore: bump flowgen from 1.14.0 to 1.14.1 in /web3.js (#16864)
Bumps flowgen from 1.14.0 to 1.14.1.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:10:05 +00:00
dependabot[bot] ef9a931567
chore: bump @types/node from 14.14.41 to 15.0.0 in /web3.js (#16863)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.41 to 15.0.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-04-27 09:05:59 +00:00
dependabot[bot] 374fee2953
chore:(deps): bump @solana/spl-token-registry in /explorer (#16822)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.60 to 0.2.62.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.60...v0.2.62)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 15:01:43 +08:00
Michael Vines f93565da6f Compress account data by default 2021-04-27 04:56:56 +00:00