Commit Graph

360 Commits

Author SHA1 Message Date
Brooks e1cb8a672b
Renames SnapshotHashes in cluster info metrics (#31145) 2023-04-11 17:35:00 +00:00
Brooks 453f272698
Rename IncrementalSnapshotHashes to SnapshotHashes (#31136) 2023-04-11 10:30:29 -04:00
Brooks f3083ad2e0
Rename SnapshotHashes to LegacySnapshotHashes (#31086) 2023-04-10 17:52:20 -04:00
Brooks aa8d7de2d1
Uses impl_crds_entry! for SnapshotHashes (#31032) 2023-04-04 14:44:05 -04:00
Brooks e8ea722061
Uses AccountsHashes type for AccountsHashes CrdsData variant (#31003) 2023-04-03 16:42:21 -04:00
Jeff Biseda 0e2c6c8989
ammend clarifying comment for duplicate instance detection (#31008) 2023-03-31 12:50:04 -07:00
behzad nouri ff9a42a354
uses Duration type instead of untyped ..._ms: u64 (#30971) 2023-03-31 15:42:49 +00:00
Jeff Biseda 5ada25b4e7
add clarifying comment for duplicate instance detection (#30895) 2023-03-30 17:13:41 -07:00
behzad nouri d4b30adffe
reworks gossip crds timeouts (#30468)
CrdsGossipPull::make_timeouts iterates over the stakes hashmap and
creates a new hashmap which is unnecessary:
https://github.com/solana-labs/solana/blob/c032dc275/gossip/src/crds_gossip_pull.rs#L517-L539

The commit instead keeps a reference to the stakes hashmap.
2023-03-27 21:52:48 +00:00
Ryo Onodera 721719d776
Add solana_clap_utils::hidden_unless_forced() (#30843)
* Add solana_clap_utils::hidden_unless_forced()

* Use more descriptive env name

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

---------

Co-authored-by: mvines <mvines@gmail.com>
2023-03-22 08:59:17 +00:00
Yihau Chen df3ef111f7
chore: workspace inheritance (#29893)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-02-23 22:01:54 +08:00
Michael Vines 5136ed3448
Update homepage value for all crates (#30444) 2023-02-23 02:20:18 +00:00
kirill lykov ee1717b24b
Make clippy to be happy (#30394)
* replace default implementation with default enum

* fix format to make clippy happy
2023-02-17 20:51:18 +01:00
Brennan b678ee3583
Clean up socket binding reuse (#30367) 2023-02-16 11:07:22 -08:00
Brooks febaf36e6d
Apply clippy fixes for future rust upgrade (#30363) 2023-02-16 16:12:51 +00:00
behzad nouri 4892a6a910
removes redundant CrdsGossipPull.msg_timeout (#30334) 2023-02-16 00:23:27 +00:00
behzad nouri eb6d6e9bca
evicts old gossip entries by origin's wallclock (#30331)
Local-timestamp used in current gossip eviction code:
https://github.com/solana-labs/solana/blob/a36e1b211/gossip/src/crds.rs#L469-L511
does not indicate how old the entry is but how recently it was received.

The commit instead uses origin's wallclock to identify old values. In
order to avoid cases where the wallclock on the entry is bogus, it is
capped by local-timestamp.
2023-02-15 20:03:13 +00:00
behzad nouri eede50c868
removes unused code from duplicate-shreds (#30329) 2023-02-15 17:37:15 +00:00
behzad nouri ded457cd73
embeds the new gossip ContactInfo in ClusterInfo (#30022)
Working towards replacing the legacy gossip contact-info with the new
one, the commit updates the respective field in gossip cluster-info.
2023-02-10 20:07:45 +00:00
behzad nouri ceb225f36e
caches blockstore duplicate shreds slots (#30241)
In order to reduce number of calls to blockstore, the commit locally caches
blockstore.has_duplicate_shreds_in_slot in DuplicateShredHandler.consumed.
2023-02-10 18:19:57 +00:00
behzad nouri b3887af7c6
flattens the internal buffer in the duplicate-shreds handler (#30196)
Duplicate-shreds handler is using a nested hash-map for the incomplete
chunks buffered. This is resulting in a convoluted logic to limit the
number of entries:
https://github.com/solana-labs/solana/blob/427bd6264/gossip/src/duplicate_shred_handler.rs#L62

This commit instead uses a flat buffer mapping (Slot, Pubkey) pairs to
the respective duplicate shreds chunks. The buffer is allowed to grow to
twice the intended capacity, at which point the extraneous entries are
removed in linear time, resulting an amortized O(1) performance.
2023-02-09 16:33:20 +00:00
behzad nouri 544fbded07
removes wallclock from duplicate-shreds handler (#30187) 2023-02-08 17:29:30 +00:00
behzad nouri 60858d043c
uses array instead of HashMap in duplicate shreds ProofChunkMap (#30147) 2023-02-06 19:48:56 +00:00
Wen 151585e596
Filter pubkey in gossip duplicateproof ingestion (#29879) 2023-02-03 11:41:32 -08:00
Kevin Ji cd51499ab9
Use Ipv4Addr constants in socketaddr! (#30095) 2023-02-02 16:48:21 -07:00
dependabot[bot] 232e252014
Bump serde from 1.0.144 to 1.0.152 (#29696)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera <tyera@solana.com>
2023-02-01 16:27:17 -07:00
behzad nouri ffc9c90cb4
expands api parity between the new and the legacy contact-info (#30038)
Working towards replacing the legacy contact-info with the new one, the
commit expands api compatibility between the two.
2023-02-01 13:07:42 +00:00
Will Hickey 04a6a631bc
Bump version to v1.16 (#30028) 2023-01-31 17:48:33 -06:00
joeaba a12bf8c003
Update maintainers references (#29997)
* update maintainers references

* chore: update maintainers reference
2023-01-31 08:07:13 -05:00
behzad nouri 4cc07a176e
reduces number of gossip pull requests/responses (#29974) 2023-01-30 17:59:56 +00:00
behzad nouri 5284736b6f
records outdated gossip crds upserts in received-cache (#29973) 2023-01-29 17:53:04 +00:00
Brooks 685c22ff41
Inlines variables into format strings (#29945) 2023-01-27 06:23:03 +00:00
behzad nouri d6fbf3fb17
adds new contact-info with forward compatible sockets (#29596)
The commit implement new ContactInfo where
* Ports and IP addresses are specified separately so that unique IP
  addresses can only be specified once.
* Different sockets (tvu, tpu, etc) are specified by opaque u8 tags so
  that adding and removing sockets is backward and forward compatible.
* solana_version::Version is also embedded in so that it won't need to
  be gossiped separately.
* NodeInstance is also rolled in by adding a field identifying when the
  instance was first created so that it won't need to be gossiped
  separately.

Update plan:
* Once the cluster is able to ingest the new type (i.e. this patch), a
  2nd patch will start gossiping the new ContactInfo along with the
  LegacyContactInfo.
* Once all nodes in the cluster gossip the new ContactInfo, a 3rd patch
  will start solely using the new ContactInfo while still gossiping the
  old LegacyContactInfo.
* Once all nodes in the cluster solely use the new ContactInfo, a 4th
  patch will stop gossiping the old LegacyContactInfo.
2023-01-26 17:02:18 +00:00
Yihau Chen 9193b4221d
Revert "chore: workspace inheritance (#29509)" (#29892)
This reverts commit a67d239dde.
2023-01-25 15:50:41 +08:00
Yihau Chen a67d239dde
chore: workspace inheritance (#29509)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-01-25 13:59:59 +08:00
behzad nouri 1c7662a37f
asserts that cluster-info keypair is consistent with contact-info id (#29818) 2023-01-24 16:57:55 +00:00
Kevin Ji dd92f225bb
Use Ipv4Addr::{LOCALHOST, UNSPECIFIED} constants (#29813) 2023-01-23 16:49:51 -06:00
behzad nouri 590b75140f
removes legacy retransmit tests (#29817)
Retransmit code has moved to core/src/cluster_nodes.rs and has been
significantly revised.
gossip/tests/cluster_info.rs is testing the old code which is no longer
relevant.
2023-01-21 22:28:48 +00:00
behzad nouri 272e667cb2
deprecates Pubkey::new in favor of Pubkey::{,try_}from (#29805)
The commit deprecates Pubkey::new which lacks type-safety and instead
implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.
2023-01-21 18:06:27 +00:00
Wen b36791956e
Ingest duplicate proofs sent through Gossip (#29227)
* First draft of ingesting duplicate proofs in Gossip into blockstore.

* Add more unittests.

* Add more unittests for bad cases.

* Fix lint errors for tests.

* More linter fixes for tests.

* Lint fixes

* Rename get_entries, move location of comment.

* Some renaming changes and comment fixes.

* Fix compile warning, this enum is not used.

* Fix lint errors.

* Slow down cleanup because this could potentially be expensive.

* Forgot to reset cleanup count.

* Add protection against attackers when constructing chunk map when
we ingest Gossip proofs.

* Use duplicate shred index instead of get_entries.

* Rename ClusterInfoDuplicateShredListener and fix a few small problems.

* Use into_shreds to piece together the proof.

* Remove redundant code.

* Address a few small errors.

* Discard slots too advanced in the future.

* - Use oldest proof for each pubkey
- Limit number of pubkeys in each slot to 100

* Disable duplicate shred handling for now.

* Revert "Disable duplicate shred handling for now."

This reverts commit c3fcf403876cfbf90afe4d2265a826f21a5e24ab.
2023-01-19 13:00:56 -08:00
behzad nouri 9f2910e962
factors out common gossip {push,pull}_options code (#29737) 2023-01-18 17:43:09 +00:00
behzad nouri 0941d133a8
adds new solana_version::Version with ClientId (#29649) 2023-01-17 22:21:14 +00:00
behzad nouri d4ce59eee7
reworks weights for gossip pull-requests peer sampling (#28463)
Amplifying gossip peer sampling weights by the time since last
pull-request has undesired consequence that a node coming back online
will see a huge number of pull requests all at once.
This "time since last request" is also unnecessary to include in
weights because as long as sampling probabilities are non-zero, a node
will be almost surely periodically selected in the sample.
The commit reworks peer sampling probabilities by just using (dampened)
stakes as weights.
2023-01-14 15:44:38 +00:00
Illia Bobyr e410d021ea
gossip: crds::test::test_update_timestamp: Remove hash comparison (#29567)
It was not immediately clear why the second `CrdsValue` insertion in the
test must always succeed.  Turns out the test was relying on hash values
having a specific relationship.  It is confusing to someone not deeply
familiar with the test.

As overwrite based on the hash value is not part of the behavior that we
consider valuable, we just remove that check.

Unified assertion between two checks into one.
2023-01-12 00:19:44 -08:00
behzad nouri d89cf0d28b
includes origin's stake in gossip push nodes sampling (#29343)
Gossip push samples nodes by stake. This is unnecessarily wasteful and
creates too much congestion at high staked nodes if the CRDS value to be
propagated is from a node with low or zero stake.
This commit instead maintains several active-sets for push, each
corresponding with a stake bucket. Peer sampling weights are accordingly
capped by the respective bucket stake.
2023-01-11 19:46:32 +00:00
behzad nouri 677b6d6458
removes LegacyContactInfo::is_valid_tvu_address (#29570)
Since
https://github.com/solana-labs/solana/pull/20480
turbine includes all epoch staked nodes in tree construction and no
longer relies on obtaining their contact-info from gossip; and so
distinguishing between is_valid_address and is_valid_tvu_address is no
longer necessary and the latter can be removed.
2023-01-08 22:53:45 +00:00
behzad nouri 8c212f59ad
renames ContactInfo to LegacyContactInfo (#29566)
Working towards adding a new ContactInfo where new sockets can be
added in a backward compatible way.
2023-01-08 16:00:55 +00:00
behzad nouri 283a2b1540
removes #[allow(clippy::same_item_push)] (#29543) 2023-01-06 17:32:26 +00:00
behzad nouri e5323166b3
dedups gossip addresses, taking the one with highest weight (#29421)
dedups gossip addresses, keeping only the one with the highest weight

In order to avoid traffic congestion or sending duplicate packets, when
sampling gossip nodes if several nodes have the same gossip address
(because they are behind a relayer or whatever), they need to be
deduplicated into one.
2023-01-03 19:37:43 +00:00
behzad nouri 2d849a2eae
indexes duplicate-shreds in gossip crds table (#29317)
Also adding Crds::get_duplicate_shreds which retrieves all upserted
duplicate-shreds since a given cursor using the index.
2022-12-20 13:48:05 +00:00