Commit Graph

437 Commits

Author SHA1 Message Date
sakridge 1036abf250 Fix gossip contact trace (#241) 2024-03-15 22:25:14 -05:00
Greg Cusack 274382ff68 Add in metrics for detecting Redundant Pulls (#199) 2024-03-15 22:25:14 -05:00
Greg Cusack 82fefb7de7 update changelog and remove deprecated label on `gossip_service::get_client()` (#227)
update changelog and remove deprecated label on get_client
2024-03-15 22:25:14 -05:00
Greg Cusack d5c5f06ddb Remove `ThinClient` from `dos/` (#117)
* remove `ThinClient` from `dos/` and replace `ThinClient` with `TpuClient`

* remove test for valid_client_facing_addr since it is no longer used
2024-03-15 22:22:45 -05:00
Greg Cusack 4a80bb902e bump deprecated version numbers for `get_client` and `get_multi_client` (#184)
bump deprecated version numbers
2024-03-15 22:22:45 -05:00
behzad nouri 4d3546ad75 expands weighted-shuffle benchmarks (#179)
Adding separate benchmarks for WeightedShuffle::new and
WeightedShuffle::shuffle.
2024-03-15 22:22:45 -05:00
Greg Cusack f5e13a1c9f deprecate `get_client` and `get_multi_client` (#177)
deprecate get_client and get_multi_client
2024-03-15 22:21:42 -05:00
steviez 7d6f1d5911
Give streamer::receiver() threads unique names (#35369)
The name was previously hard-coded to solReceiver. The use of the same
name makes it hard to figure out which thread is which when these
threads are handling many services (Gossip, Tvu, etc).
2024-03-01 13:36:08 -06:00
Brooks c8cdd0087f
Removes pushing and pulling account hashes in gossip (#34979) 2024-01-29 17:19:55 -05:00
behzad nouri 79bbe4381a
adds chained_merkle_root to shredder arguments (#34952)
Working towards chaining Merkle root of erasure batches, the commit adds
chained_merkle_root to shredder arguments.
2024-01-27 15:04:31 +00:00
Ashwin Sekar 93271d91b0
gossip: notify state machine of duplicate proofs (#32963)
* gossip: notify state machine of duplicate proofs

* Add feature flag for ingesting duplicate proofs from Gossip.

* Use the Epoch the shred is in instead of the root bank epoch.

* Fix unittest by activating the feature.

* Add a test for feature disabled case.

* EpochSchedule is now not copyable, clone it explicitly.

* pr feedback: read epoch schedule on startup, add guard for ff recache

* pr feedback: bank_forks lock, -cached_slots_in_epoch, init ff

* pr feedback: bank.forks_try_read() -> read()

* pr feedback: fix local-cluster setup

* local-cluster: do not expose gossip internals, use retry mechanism instead

* local-cluster: split out case 4b into separate test and ignore

* pr feedback: avoid taking lock if ff is already found

* pr feedback: do not cache ff epoch

* pr feedback: bank_forks lock, revert to cached_slots_in_epoch

* pr feedback: move local variable into helper function

* pr feedback: use let else, remove epoch 0 hack

---------

Co-authored-by: Wen <crocoxu@gmail.com>
2024-01-26 07:58:37 -08:00
Wen 0d92254736
Add push_heaviest_fork and get_heaviest_fork. (#34892)
Add push_get_heaviest_fork and push_get_heaviest_fork.
2024-01-24 08:57:50 -08:00
Wen 4a2871f384
Add RestartHeaviestFork to Gossip (#34161)
* Add RestartHeaviestFork to Gossip.

* Add a test for out of bound value.

* Send observed_stake and total_epoch_stake in ResatartHeaviestFork.

* Remove total_epoch_stake from RestartHeaviestFork.

* Forgot to update ABI digest.

* Remove checking of whether stake is zero.

* Remove unnecessary new function and make new_rand pub(crate).
2024-01-19 13:59:25 -08:00
Greg Cusack 8ed149a3f2
Add ContactInfo handling for shred versioning (#34286)
* handle ContactInfo in places where only LegacyContactInfo was used

* missed a spot

* missed a spot

* import contact info for crds lookup

* cargo fmt

* rm contactinfo from crds_entry. not supported yet

* typo

* remove crds.nodes insert for ContactInfo. not supported yet

* forgot to remove clusterinfo in remove()

* move around contactinfo match arm

* remove contactinfo updating crds.shred_version
2023-12-21 14:15:50 -08:00
GoodDaisy 03386cc7b9
Fix typos (#34459)
* Fix typos

* Fix typos

* fix typo
2023-12-21 13:06:00 -07:00
Andrew Fitzgerald f0ff69b9cb
Rename: AtomicBloom to ConcurrentBloom (#34483) 2023-12-21 06:59:20 -08:00
Lucas Steuernagel b97b3dd4ab
Use BankForks on tests - Part 3 (#34248)
* Add BankForks to core tests

* Refactor functions under DCOU
2023-12-01 13:47:22 -03:00
Greg Cusack 0a2ff8525a
Increase pull request clusterinfo probability (#34231)
* ensure new contactinfo propagated quicker when handling pull requests

* improve readability
2023-11-28 16:08:12 -08:00
Wen ae4b62c6f5
Move Gossip values added for wen_retart into restart_crds_values. (#34128)
* HvA9J

* Rename file and change orders of definitions.

* Use .from() on u16 to usize which shouldn't fail.

* Update ABI congest.
2023-11-17 10:13:25 -08:00
Ashwin Sekar ca6ab08555
gossip: process duplicate proofs for merkle root conflicts (#34066)
* gossip: process duplicate proofs for merkle root conflicts

* pr comments + abi
2023-11-17 11:59:53 -05:00
Wen 3081b4378d
Add push and get methods for RestartLastVotedForkSlots (#33613)
* Add push and get methods for RestartLastVotedForkSlots

* Improve expression format.

* Remove fill() from RestartLastVotedForkSlots and move into constructor.

* Update ABI signature.

* Use flate2 compress directly instead of relying on CompressedSlots.

* Make constructor of RestartLastVotedForkSlots return error if necessary.

* Use minmax and remove unnecessary code.

* Replace flate2 with run-length encoding in RestartLastVotedForkSlots.

* Remove accidentally added file.

* The passed in last_voted_fork don't need to be mutable any more.

* Switch to different type of run-length encoding.

* Fix typo.

* Move constant into RestartLastVotedForkSlots.

* Use BitVec in RawOffsets.

* Remove the unnecessary clone.

* Use iter functions for RLE.

* Use take_while instead of loop.

* Change Run length encoding to iterator implementation.

* Allow one slot in RestartLastVotedForkSlots.

* Various simplifications.

* Fix various errors and use customized error type.

* Various simplifications.

* Return error from push_get_restart_last_voted_fork_slots and
remove unnecessary constraints in to_slots.

* Allow 81k slots on RestartLastVotedForkSlots.

* Limit MAX_SLOTS to 65535 so we can go back to u16.

* Use u16::MAX instead of 65535.
2023-11-16 12:35:34 -08:00
behzad nouri ba0a49b436
propagates the new contact-info through gossip (#34092)
Working towards migrating from legacy contact-info to the new
contact-info:
https://github.com/solana-labs/solana/pull/29596
2023-11-15 19:02:21 +00:00
steviez b91da2242d
Change Blockstore max_root from RwLock<Slot> to AtomicU64 (#33998)
The Blockstore currently maintains a RwLock<Slot> of the maximum root
it has seen inserted. The value is initialized during
Blockstore::open() and updated during calls to Blockstore::set_roots().
The max root is queried fairly often for several use cases, and caching
the value is cheaper than constructing an iterator to look it up every
time.

However, the access patterns of these RwLock match that of an atomic.
That is, there is no critical section of code that is run while the
lock is head. Rather, read/write locks are acquired in order to read/
update, respectively. So, change the RwLock<u64> to an AtomicU64.
2023-11-10 17:27:43 -06:00
Jeff Biseda 3f805ad06d
improve batch_send error handling (#33936) 2023-10-31 23:39:26 -07:00
Pankaj Garg 9d42cd7efe
Initialize fork graph in program cache during bank_forks creation (#33810)
* Initialize fork graph in program cache during bank_forks creation

* rename BankForks::new to BankForks::new_rw_arc

* fix compilation

* no need to set fork_graph on insert()

* fix partition tests
2023-10-23 09:32:41 -07:00
behzad nouri afd044e296
removes redundant ClusterInfo::drain_push_queue (#33753) 2023-10-18 18:53:58 +00:00
behzad nouri 2465abce5c
simplifies pull-responses handling (#33743)
Following:
https://github.com/solana-labs/solana/pull/33722
from pubkey in PullResponse is no longer used in processing
pull-responses and so the code can be simplified.
2023-10-18 18:06:14 +00:00
behzad nouri c699bc9cab
down samples outgoing gossip pull requests (#33719)
Push message propagation has improved in recent versions of the gossip
code and we don't rely on pull requests as much as before. Handling pull
requests is also inefficient and expensive.
The commit reduces number of outgoing pull requests by down sampling.
2023-10-18 13:41:42 +00:00
Greg Cusack 6efc7ec61d
remove redundant pubkey update record (#33722)
* remove redundant pubkey update record

* from became unused, so removed from all process_pull_response() calls
2023-10-17 10:34:12 -07:00
Wen 0a3810854f
Add RestartLastVotedForkSlots for wen_restart. (#33239)
* Add RestartLastVotedForkSlots and RestartHeaviestFork for wen_restart.

* Fix linter errors.

* Revert RestartHeaviestFork, it will be added in another PR.

* Update frozen abi message.

* Fix wrong number in test generation, change to pub(crate) to limit scope.

* Separate push_epoch_slots and push_restart_last_voted_fork_slots.

* Add RestartLastVotedForkSlots data structure.

* Remove unused parts to make PR smaller.

* Remove unused clone.

* Use CompressedSlotsVec to share code between EpochSlots and RestartLastVotedForkSlots.

* Add total_messages to show how many messages are there.

* Reduce RestartLastVotedForkSlots to one packet (16k slots).

* Replace last_vote_slot with shred_version, revert CompressedSlotsVec.
2023-10-09 15:01:50 -07:00
behzad nouri 1d91b60a57
removes unused legacy-snapshot-hashes api in gossip (#33593)
https://github.com/solana-labs/solana/pull/33576
stops broadcasting legacy snapshot hashes over gossip, and this commit
removes unused legacy snapshot hashed code in gossip.
2023-10-09 15:22:34 +00:00
Wen 630feeddf2
Add wen_restart module (#33344)
* Add wen_restart module:
- Implement reading LastVotedForkSlots from blockstore.
- Add proto file to record the intermediate results.
- Also link wen_restart into validator.
- Move recreation of tower outside replay_stage so we can get last_vote.

* Update lock file.

* Fix linter errors.

* Fix depencies order.

* Update wen_restart explanation and small fixes.

* Generate tower outside tvu.

* Update validator/src/cli.rs

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

* Update wen-restart/protos/wen_restart.proto

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

* Update wen-restart/build.rs

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

* Update wen-restart/src/wen_restart.rs

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

* Rename proto directory.

* Rename InitRecord to MyLastVotedForkSlots, add imports.

* Update wen-restart/Cargo.toml

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

* Update wen-restart/src/wen_restart.rs

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

* Move prost-build dependency to project toml.

* No need to continue if the distance between slot and last_vote is
already larger than MAX_SLOTS_ON_VOTED_FORKS.

* Use 16k slots instead of 81k slots, a few more wording changes.

* Use AncestorIterator which does the same thing.

* Update Cargo.lock

* Update Cargo.lock

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2023-10-06 15:04:37 -07:00
Greg Cusack 1261b3d496
gossip test update (#33431)
fix bug in gossip test
2023-09-29 08:57:32 -07:00
Pankaj Garg f50342a790
Split vote related code from runtime to its own crate (#32882)
* Move vote related code to its own crate

* Update imports in code and tests

* update programs/sbf/Cargo.lock

* fix check errors

* update abi_digest

* rebase fixes

* fixes after rebase
2023-09-19 10:46:37 -07:00
behzad nouri 528a03f32a
removes outdated matches crate from dependencies (#33172)
removes outdated matches crate from the dependencies

std::matches has been stable since rust 1.42.0.
Other use-cases are covered by assert_matches crate.
2023-09-07 12:52:57 +00:00
Alexander Meißner 9e703f85de
Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint

* allow lint with false-positive triggered by `test-case` crate

* nightly `fmt` correction

* adapt to rust layout changes

* remove dubious test

* Use transmute instead of pointer cast and de/ref when check_aligned is false.

* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.

* bump rust nightly to 2023-08-25

* Upgrades Rust to 1.72.0

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-09-01 07:26:13 +00:00
behzad nouri 39615bd075
removes manual let...else (#33089)
https://rust-lang.github.io/rust-clippy/master/index.html#/manual_let_else
2023-08-31 22:35:47 +00:00
Ashwin Sekar 6d2dae6ab0
send duplicate shred proofs for conflicting shred scenarios (#32965)
* send duplicate shred proofs for conflicting shred scenarios

The scenarios are multiple last_shred_in_slot shreds and
coding shreds with conflicting erasure metas.

* Pr feedback: deprecate shred_index for gossip duplicate shred proofs

* Pr feedback

* Remove extraneous dead code
2023-08-31 12:08:10 -07:00
Trent Nelson b13589b588
round two preliminaries for bumping nightly to 2023-08-25 (#33064)
* work around nightly ICE

seems to be something related to `const ref`s in generic contexts...

* allow lint false-positive on ignored trait bounds
2023-08-30 21:46:20 +02:00
Trent Nelson b8dc5daedb
preliminaries for bumping nightly to 2023-08-25 (#33047)
* remove unnecessary hashes around raw string literals

* remove unncessary literal `unwrap()`s

* remove panicking `unwrap()`

* remove unnecessary `unwrap()`

* use `[]` instead of `vec![]` where applicable

* remove (more) unnecessary explicit `into_iter()` calls

* remove redundant pattern matching

* don't cast to same type and constness

* do not `cfg(any(...` a single item

* remove needless pass by `&mut`

* prefer `or_default()` to `or_insert_with(T::default())`

* `filter_map()` better written as `filter()`

* incorrect `PartialOrd` impl on `Ord` type

* replace "slow zero-filled `Vec` initializations"

* remove redundant local bindings

* add required lifetime to associated constant
2023-08-29 23:05:35 +00:00
Alexander Meißner a8be70fa7a
General cleanup (#32980)
* Fixes `cargo::` in build.rs

* Fixes overshadowing reexports.

* Removes unnecessary `as *const u8`.

* Removes unnecessary `.into_iter()`.

* cargo clippy
2023-08-24 21:44:19 +02:00
Jon Cinque 0fe902ced7
Bump rand to 0.8, rand_chacha to 0.3, getrandom to 0.2 (#32871)
* sdk: Add concurrent support for rand 0.7 and 0.8

* Update rand, rand_chacha, and getrandom versions

* Run command to replace `gen_range`

Run `git grep -l gen_range | xargs sed -i'' -e 's/gen_range(\(\S*\), /gen_range(\1../'

* sdk: Fix users of older `gen_range`

* Replace `hash::new_rand` with `hash::new_with_thread_rng`

Run:
```
git grep -l hash::new_rand | xargs sed -i'' -e 's/hash::new_rand([^)]*/hash::new_with_thread_rng(/'
```

* perf: Use `Keypair::new()` instead of `generate`

* Use older rand version in zk-token-sdk

* program-runtime: Inline random key generation

* bloom: Fix clippy warnings in tests

* streamer: Scope rng usage correctly

* perf: Fix clippy warning

* accounts-db: Map to char to generate a random string

* Remove `from_secret_key_bytes`, it's just `keypair_from_seed`

* ledger: Generate keypairs by hand

* ed25519-tests: Use new rand

* runtime: Use new rand in all tests

* gossip: Clean up clippy and inline keypair generators

* core: Inline keypair generation for tests

* Push sbf lockfile change

* sdk: Sort dependencies correctly

* Remove `hash::new_with_thread_rng`, use `Hash::new_unique()`

* Use Keypair::new where chacha isn't used

* sdk: Fix build by marking rand 0.7 optional

* Hardcode secret key length, add static assertion

* Unify `getrandom` crate usage to fix linking errors

* bloom: Fix tests that require a random hash

* Remove some dependencies, try to unify others

* Remove unnecessary uses of rand and rand_core

* Update lockfiles

* Add back some dependencies to reduce rebuilds

* Increase max rebuilds from 14 to 15

* frozen-abi: Remove `getrandom`

* Bump rebuilds to 17

* Remove getrandom from zk-token-proof
2023-08-21 19:11:21 +02:00
behzad nouri a9ecdc0ae5
asserts that socket addresses set in new_with_external_ip are valid (#32860)
new_with_external_ip silently ignores errors when setting socket
addresses which makes it harder to catch bugs:
https://github.com/solana-labs/solana/blob/7beeb8310/gossip/src/cluster_info.rs#L3054-L3063
2023-08-16 20:41:40 +00:00
behzad nouri 7beeb83104
patches set_serve_repair instead of set_serve_repair_quic (#32856) 2023-08-16 18:26:00 +00:00
behzad nouri 0de8ccfda9
adds socket address for repair service over QUIC (#32834)
Working towards migrating repair to QUIC.
2023-08-15 17:09:09 +00:00
behzad nouri 35ed7122f6
reuses old TVU-forwards socket tag for TVU over QUIC (#32828)
The commit revises socket tag for TVU over QUIC to reuse old
TVU-forwards socket tag. This avoids gaps in socket tags which wastes
space in ContactInfo.cache.
The change is backward compatible because TVU-forwards is not used any
more and TVU over QUIC is not released yet.
2023-08-15 12:19:10 +00:00
behzad nouri 52616cf7aa
removes repair socket from gossip ContactInfo (#32831)
Repair responses are sent back to the address the repair request came
from and there is no need to gossip repair socket address.
https://github.com/solana-labs/solana/blob/9212ac347/core/src/repair/serve_repair.rs#L519
2023-08-14 20:01:18 +00:00
behzad nouri b06500ee66
adds extensions to contact-info (#32309)
The commit adds a Vec<Extension> to ContactInfo so that future additions
to ContactInfo can be done by only adding new Extensions instead of
modifying the entire ContactInfo.
2023-08-09 22:01:20 +00:00
behzad nouri b7c2ad5b67
repurposes tvu_forwards socket for TVU over QUIC (#32737)
LegacyContactInfo.tvu_forwards is unused.
Repurposing the field for TVU over QUIC will avoid QUIC_PORT_OFFSET hack
in a backward compatible way.
2023-08-07 22:02:41 +00:00
behzad nouri 0511753276
moves DATA_PLANE_FANOUT to turbine (#32744) 2023-08-07 20:53:49 +00:00