Commit Graph

13819 Commits

Author SHA1 Message Date
7e073e64a3 indexes crds votes by insert order (#17340) (#17435)
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.

(cherry picked from commit 060332c704)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-24 14:55:09 +00:00
7d438e5c28 rolls back min number of bloom items for debug builds (#17420) (#17421)
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

(cherry picked from commit 5567305a5f)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-23 18:07:38 +00:00
83cc44953d increases timeout duration for gossip discover (backport #17408) (#17414)
* increases timeout duration for gossip discover

(cherry picked from commit d6496376ce)

* uses Duration type for gossip discover timeout

(cherry picked from commit cf1acfb021)

# Conflicts:
#	core/src/gossip_service.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-22 20:53:56 +00:00
215928445c records hash of timed-out pull responses (#17410)
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.

(cherry picked from commit a7870cda8d)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-22 18:35:16 +00:00
de6de7a367 rpc: add context toggle to getProgramAccounts (#17399) (#17403)
* 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>
(cherry picked from commit d41266e4e9)

Co-authored-by: Nikita <bananaelecitrus@gmail.com>
2021-05-22 08:28:19 +00:00
e8c054b1f4 account-decoder: don't use strings to convert between Pubkey types (#17391) (#17398)
* account-decoder: don't use strings to convert between Pubkey types

* transaction-status: don't use strings to convert between Pubkey types

(cherry picked from commit 51178ccb33)

Co-authored-by: Alexander Polakov <polachok@users.noreply.github.com>
2021-05-22 01:24:02 +00:00
df08ba5dcd SetLockup now requires the authorized withdrawer when the lockup is not in force (#17394)
(cherry picked from commit 96cde36784)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-21 21:17:06 +00:00
72d038ecd8 Remove const qualifier from syscall out-parameters (#17382) (#17395)
(cherry picked from commit 8758e9ed82)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-21 20:45:35 +00:00
b08c0caefe adds metric for turbine retransmit tree mismatch (backport #17351) (#17392)
* 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.

(cherry picked from commit 71de021177)

* removes the nested for loop from retransmit-stage

The code can be simplified by just flattening the vector of packets.

(cherry picked from commit ff0e623d30)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-21 20:08:12 +00:00
8fe5b41f5f Stake merge inactive lockup (backport #17376) (#17390)
* stake: plumb `can_merge_expired_lockups` feature flag

(cherry picked from commit 74ac6ab80f)

* stake: merge accounts with mismatched, but expired lockups

(cherry picked from commit 019bccab51)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-21 20:00:59 +00:00
25333abd96 extends crds values timeouts if stakes are unknown (#17261) (#17389)
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.

(cherry picked from commit 2adce67260)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-21 17:29:37 +00:00
f09a100e60 retains one node-instance per pubkey (#17187) (#17386)
crds table retains up to 32 node-instance values per each pubkey. This
is so because if there are multiple running instances of the same node,
then we want gossip to propagate node-instance values associated with
both instances, therefore the corresponding label/key includes the
randomly generated token in addition to the pubkey:
https://github.com/solana-labs/solana/blob/9c42a89a4/core/src/crds_value.rs#L448
https://github.com/solana-labs/solana/pull/14037

As a result, the number of such values per pubkey are effectively
unbounded, requiring custom mitigations implemented in:
https://github.com/solana-labs/solana/pull/14467
but still taking redundant extra memory and bandwidth.

This commit instead retains only one node-instance per pubkey by
extending crds values override logic. If a crds value is of type
node-instance, it will always override an existing one with the same key
if it has more recent starting timestamp (not wallclock). As a result,
gossip will always propagate the node-instance with more recent
timestamp. Since the check_duplicate logic will stop the node with older
timestamp, this change should preserve existing functionality.

(cherry picked from commit 0aa7824884)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-21 17:20:36 +00:00
7cc96dc20f Update getrandom bpf dependency (#17388)
(cherry picked from commit 8c073b2c94)

Co-authored-by: Jack May <jack@solana.com>
2021-05-21 16:56:09 +00:00
40c95dde4f prioritizes more recent values in pull responses (#17238) (#17384)
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.

(cherry picked from commit 5e6b00fe98)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-21 16:03:04 +00:00
0d38f11998 bumps up min number of bloom items in gossip pull requests (#17236) (#17383)
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.

(cherry picked from commit e8b35a4f7b)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-21 15:21:52 +00:00
3e89cb6b43 programs/stake: cancel deactivate (backport #17344) (#17375)
* 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>
(cherry picked from commit 662c2aaeec)

# Conflicts:
#	programs/stake/src/stake_instruction.rs
#	programs/stake/src/stake_state.rs

* Fix conflicts

Co-authored-by: jon-chuang <9093549+jon-chuang@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-21 10:41:13 +00:00
5025c7c983 Prevent withrawing Initialized stake account to rent-exempt reserve (backport #17366) (#17370)
* Prevent withrawing Initialized stake account to zero stake (#17366)

(cherry picked from commit 91f2b6185e)

# Conflicts:
#	programs/stake/src/stake_instruction.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-21 10:23:20 +00:00
c3fafda981 clap-utils: Fix signer resolution on Windows (#17371)
(cherry picked from commit e320af99a0)

# Conflicts:
#	clap-utils/src/keypair.rs

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-21 07:27:49 +00:00
3f6964d264 InvokeContext: Add get_sysvar() helper to sdk (backport #17360) (#17368)
* Add get_sysvar() helper to sdk

(cherry picked from commit 2c99b23ad7)

# Conflicts:
#	runtime/src/message_processor.rs
#	sdk/src/process_instruction.rs

* Resolve conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-21 03:42:20 +00:00
b1d294de75 Add stake_program_v4 feature (#17356)
(cherry picked from commit a1a0d6f84b)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-20 22:32:30 +00:00
2b34800870 docs: Update transaction expiration time (#17347) (#17349)
(cherry picked from commit ddfc15b9f2)

Co-authored-by: Justin Starry <justin@solana.com>
2021-05-20 15:29:44 +00:00
e9c3e0b0ee datapoint for verify_snapshot_bank (#17306) (#17339)
(cherry picked from commit 75335b4f58)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-05-20 04:37:10 +00:00
0e9fe0847f Optimize aligned memory used by the runtime (backport #17324) (#17334)
* Optimize aligned memory used by the runtime (#17324)

(cherry picked from commit 477898f682)

# Conflicts:
#	cli/Cargo.toml
#	programs/bpf/Cargo.toml
#	programs/bpf_loader/Cargo.toml
#	programs/bpf_loader/src/syscalls.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-05-19 23:21:47 +00:00
d2e98cb531 prunes received-cache only once per unique owner's key (#17039) (#17337)
(cherry picked from commit 0e646d10bb)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-19 22:50:42 +00:00
32681e2739 removes manual trait impl for contact-info (#17332) (#17335)
The current implementations use only the id and disregard other fields,
in particular wallclock. This can lead to bugs where an outdated
contact-info shadows or overrides a current one because they compare
equal.

(cherry picked from commit 13b032b2d4)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-19 22:33:32 +00:00
dc0b21fa83 patches flaky test_new_mark_creation_time (#17288) (#17336)
(cherry picked from commit f7b0184f81)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-19 22:22:24 +00:00
c4e770e2f8 Add C Serialization Tests for #17217 (#17294) (#17297)
(cherry picked from commit f15dd1b4ef)

Co-authored-by: Jack May <jack@solana.com>
2021-05-19 22:14:23 +00:00
f80af6dc1c adds gossip metrics for number of staked nodes (#17330) (#17333)
(cherry picked from commit e7073ecab1)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-19 20:41:07 +00:00
36ac9b3bb1 Fix typo (#17326) (#17331)
(cherry picked from commit f1b4a0a2e0)

Co-authored-by: Ulrich Stark <8657779+ulrichstark@users.noreply.github.com>
2021-05-19 17:46:50 +00:00
282c98a82a Validator progress bars are now rendered when stdout is not a terminal (#17323)
(cherry picked from commit 305d9dd3f4)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-19 08:49:17 +00:00
11f6c04990 get_program_accounts_with_config() now correctly defaults to RpcClient's commitment level (backport #17312) (#17315)
* get_program_accounts_with_config() now correctly defaults to RpcClient's commitment level

(cherry picked from commit 63b97729e6)

# Conflicts:
#	client/src/rpc_client.rs

* Update rpc_client.rs

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-18 21:19:19 +00:00
18c4d13ab2 fix test (#17310) (#17314)
(cherry picked from commit cfcae50022)

# Conflicts:
#	programs/bpf/c/src/ser/ser.c

Co-authored-by: Jack May <jack@solana.com>
2021-05-18 20:05:00 +00:00
d2e907655f Add Contextual Search (#17299) (#17300)
* this should prevent other language results appearing in the search area

(cherry picked from commit c65c4475f6)

Co-authored-by: Ryan M. Shea <8948187+rmshea@users.noreply.github.com>
2021-05-18 06:32:51 +00:00
e182afa50f Minor test cleanup and comments (backport #17283) (#17295)
* Minor test cleanup and comments (#17283)

(cherry picked from commit bcbe155575)

# Conflicts:
#	runtime/src/rent_collector.rs

* Fix conflicts

* More clean cherry-pick...

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-05-18 03:50:28 +00:00
00d1cb0333 Clear release cache for stable-perf (#17287) (#17296)
(cherry picked from commit 7ea1131090)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-17 23:38:24 +00:00
bab82ab632 Update keypair configuration output (backport #17277) (#17285)
* Update keypair configuration output

While going through the tutorial to start a validator I noticed that the output I received from running...

```
solana config set --keypair ~/validator-keypair.json
```

...different from the output I was seeing. Wondering whether the docs are out of date I thought I'd propose an update to the docs just in case.

(cherry picked from commit 02157f4753)

* Update docs/src/running-validator/validator-start.md

(cherry picked from commit de76adbdf3)

Co-authored-by: Chris Bellew <cjbellew@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-05-17 17:38:31 +00:00
b9ba312975 Add two more testnet entrypoints (#17282)
(cherry picked from commit 1f322b8a9c)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-17 16:32:36 +00:00
c5ff373965 fixed getProgramAccounts fields list (#17278) (#17279)
(cherry picked from commit 611628a402)

Co-authored-by: Marcin Zawiejski <dragmz@gmail.com>
2021-05-17 14:46:59 +00:00
51a2d93a0d Remove duplicate std::net reference (#17254) (#17266)
(cherry picked from commit d6ab4196ea)

Co-authored-by: Sebastian Ibarguen <sebasibarguen@users.noreply.github.com>
2021-05-17 01:15:22 +00:00
409ac4dcfa Bump version to v1.6.10 (#17250) 2021-05-15 01:47:56 +00:00
9e42883d4b Fix a bug in input deserialization in the C SDK (#17217) (#17249)
When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.

(cherry picked from commit e02b4e1192)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
v1.6.9
2021-05-15 00:10:02 +00:00
e41460d500 feat: update api urls (backport #17186) (#17248)
* feat: update api urls

(cherry picked from commit 0f3045fb68)

* fix: cluster test

(cherry picked from commit ae5a10dffd)

* docs: update old devnet and testnet url references

(cherry picked from commit ec621e71dc)

* fix: update devnet and testnet urls

(cherry picked from commit 7be3171f4a)

Co-authored-by: Josh Hundley <josh.hundley@gmail.com>
2021-05-15 00:08:24 +00:00
9aacd0f3c3 Zero pad data shreds on fetch from blockstore (#17147)
* Zero pad data shreds on fetch from blockstore

This is a partial backport of #16602 to allow compatibility with that change.

* Remove size check and resize shreds to consistent length
2021-05-14 16:18:00 -05:00
3f908306a3 test-validator: Hint at airdrop when wallet is unavailable (#17235)
(cherry picked from commit 2c8dde7224)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-14 18:32:48 +00:00
8093586b78 docs: remove missig link (#17212) (#17230)
(cherry picked from commit 5e642a174c)

Co-authored-by: Laptev Stanislav <42931743+dubalda@users.noreply.github.com>
2021-05-14 15:51:22 +00:00
a08a6d55fa test-validator: Display genesis hash in dashboard (backport #17216) (#17225)
* rpc: plumb shred_version through RpcContactInfo

(cherry picked from commit 67e6a3106f)

* test-validator: Display more cluster info in dash

(cherry picked from commit 754c708473)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-14 09:56:27 +00:00
802c5fcb00 Update clusters.md (#17220) (#17221)
(cherry picked from commit 26afc7620b)

Co-authored-by: joeaba <77398477+joeaba@users.noreply.github.com>
2021-05-14 04:39:04 +00:00
8749a97b94 Remove bloat from secondary indexes (#17048) (#17219)
(cherry picked from commit 239ab8799c)

Co-authored-by: carllin <carl@solana.com>
2021-05-14 04:04:55 +00:00
4313240b1b Return error for excluded secondary-index keys (backport #17193) (#17215)
* Return error for excluded secondary-index keys (#17193)

* Add runtime helpers to check secondary indexes for key

* Add custom rpc error

* Check secondary-index key inclusion in rpc

* Clone complete AccountSecondaryIndexes into rpc to avoid bank query

(cherry picked from commit 27004f1b76)

# Conflicts:
#	core/src/rpc.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-13 23:04:01 +00:00
24bae00560 docs: Add docs for solana-test-validator (backport #17199) (#17211)
* docs: Add docs for `solana-test-validator`

(cherry picked from commit 768a2ebe9d)

* Update docs/src/developing/test-validator.md

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

* Update docs/src/developing/test-validator.md

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

* Update docs/src/developing/test-validator.md

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

* Update docs/src/developing/test-validator.md

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

* Update docs/src/developing/test-validator.md

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

* Update docs/src/developing/test-validator.md

(cherry picked from commit 7868df3211)

* Update docs/src/developing/test-validator.md

(cherry picked from commit 3e0c0abb53)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-13 18:41:16 +00:00