Commit Graph

3766 Commits

Author SHA1 Message Date
Ryo Onodera 4def121c96
dcou: mod banking_trace::for_test (#32428)
* dcou: mod banking_trace::for_test

* Add comment

* Simplify comment to avoid being redundant
2023-07-14 09:39:46 +09:00
Brooks 1663a7091a
Uses checked math in EAH tests (#32483) 2023-07-13 18:06:11 -04:00
steviez 4bdd73a234
Minor cleanup in Validator::new() (#32480)
- Use .map_err() instead of match and return
- Adjust log severity and add context to generic "done" logs
2023-07-13 16:44:36 -05:00
Brooks 60130fdd75
Uses while-let (#32479) 2023-07-13 13:51:15 -04:00
Brooks 7143667dbe
Removes unnecessary mut (#32476) 2023-07-13 13:14:33 -04:00
Andrew Fitzgerald 0b5421f5ca
Bugfix: would_be_leader_shortly_fn period set to 1 slot instead of 20 (#32468) 2023-07-12 16:54:40 -07:00
behzad nouri a3ada9c5ea
separates out turbine QUIC from TPU implementation (#32368)
* separates out turbine QUIC from TPU implementation

Turbine being tied to QUIC implementation for TPU hinders development
and makes it hard to optimize QUIC specifically for turbine.
The commit separates out turbine QUIC from TPU implementation.

* Update core/src/validator.rs

Co-authored-by: Jon Cinque <me@jonc.dev>

* Update turbine/src/retransmit_stage.rs

Co-authored-by: Jon Cinque <me@jonc.dev>

---------

Co-authored-by: Jon Cinque <me@jonc.dev>
2023-07-12 14:15:28 +00:00
behzad nouri d54b6204be
removes instances of clippy::manual_let_else (#32417) 2023-07-09 21:41:36 +00:00
Ashwin Sekar c172dfd268
Only send earliest mismatched ancestor to replay (#31842) 2023-07-06 21:31:12 -07:00
Illia Bobyr 282e043177
`cargo fmt` using 1.6.0-nightly (#32390)
Seems like rustfmt 1.6.0 can now format `let/else` statements.
1.5.2 we use in our `solana-nightly` does not mind the reformatting.

```
$ cargo +nightly fmt --version
rustfmt 1.6.0-nightly (f20afcc 2023-07-04)

$ cargo +nightly fmt
$ git add -u
$ git commit

$ ./cargo nightly fmt --version
+ exec cargo +nightly-2023-04-19 fmt --version
rustfmt 1.5.2-nightly (c609da5 2023-04-18)

$ ./cargo nightly fmt
$ git diff
[empty output]
```
2023-07-06 20:45:29 -07:00
behzad nouri 0da01270ef
removes redundant recycler clones (#32401) 2023-07-06 18:25:20 +00:00
Pankaj Garg 4674b0099f
Move CostModel and CostTracker to its own crate (#32354)
* Move CostModel and CostTracker to its own crate

* compile new crate and update imports

* update sbf Cargo.lock

* fix AbiExample

* fix cargo sort

* Fix AbiExample
2023-07-06 10:08:18 -07:00
Pankaj Garg b060f62004
Move transaction results data structures out of bank.rs (#32386)
* Move transaction results data structures out of bank.rs

* Fix CI check failures
2023-07-06 09:45:01 -07:00
Jeff Biseda bad5197cb0
refactor core to create repair module (#32303) 2023-07-05 12:20:46 -07:00
Andrew Fitzgerald 06e5482ff6
move ThreadAwareAccountLocks into scheduler module (#32298) 2023-07-05 09:44:18 -07:00
Ashwin Sekar e1576b5352
Don't attempt to refresh votes on non voting validators (#32315) 2023-06-30 17:53:06 -07:00
steviez d5ad29d837
Make Blockstore::scan_and_fix_roots() take optional start/stop slots (#32289)
The optional args allow reuse by ledger-tool repair roots command Also,
hold cleanup lock for duration of Blockstore::scan_and_fix_roots().

This prevents a scenario where scan_and_fix_roots() could identify a
slot as needing to be marked root, that slot getting cleaned by
LedgerCleanupService, and then scan_and_fix_roots() marking the slot as
root on the now purged slot.
2023-06-28 22:32:03 -05:00
buffalu 5dee2e4d0c
Ensure that uncommitted transactions are always removed from QoS (#32285)
Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2023-06-28 13:44:58 -07:00
Jeff Biseda 87c1b67d53
refactor core to create consensus module (#32282) 2023-06-27 17:25:08 -07:00
Brennan 8ddce4b566
report last slot vote send metrics (#32258)
* report last slot vote send metrics

* push conditional checking down

* fix up unit tests
2023-06-27 19:43:10 +00:00
Wen 6f72258e3e
Vote refresh fix when outside slothash (#29948)
* When there are too many pubkeys in one slot, kick the one with lowest
stake out.

* Cache last_root to reduce read locks we need.

* Use slots_in_epoch to limit number of slots in the map.

* Fix lint errors.

* Only cache stake and slots per epoch once per epoch.

* Revert "Only cache stake and slots per epoch once per epoch."

This reverts commit 8658aad0083456794b4c4403adaf9c74d1a71d09.

* Vote at the tip of current fork if last vote is outside SlotHash
of the tip and last vote expired.

* Add unittest when last vote is outside slothash, we should vote at the tip
of the current fork.

* Revert "Use slots_in_epoch to limit number of slots in the map."

This reverts commit 93574f57a48d2a70fbbc0f62fa8810d3b6bee0af.

* Revert "Cache last_root to reduce read locks we need."

This reverts commit bb114ec2b62cb9c0207328b19c415f6116be0f1c.

* Revert "When there are too many pubkeys in one slot, kick the one with lowest"

This reverts commit 711e29a6a025fd4f11fbc97dcbbe90e4832be04c.

* Move new vote generation when last vote is outside slothash into the
main path, this actually makes more sense since we don't select where
to vote in two different places, and all the vote generation logic
is seamlessly inherited.

* - Move vote refresh to be behind select vote and do not refresh vote if a new
  vote is selected.
- Check whether last vote is inside slothash inside select_vote_and_reset_forks
- rename slot_within_slothash to is_in_slothashes_history
- remove one unittest for now, more tests will be added in a separate CL

* Remove new test, it will be in another file.

* Add is_in_slot_hashes_history test in the new file.

* Add unittest for the case when last vote is outside slot hashes.

* Small improvements and more unittests.

* Fix bad merge.

* Update docs/src/terminology.md

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

* Put SwitchForkDecision::FailedSwitchThreshold logic into separate function.

* Make linter happy.

---------

Co-authored-by: mvines <mvines@gmail.com>
2023-06-26 18:21:24 -07:00
Ashwin Sekar 1e12a18e01
Use bank status instead of default hash in state machine (#31699) 2023-06-27 01:14:40 +00:00
Jeff Biseda 5cf5edd5fe
unnecessary error conversions in core (#32257) 2023-06-26 10:31:55 -07:00
steviez 77b587aa4d
Add constant for disabled snapshot interval (#32236)
Slot::MAX was used to specify that a type of snapshots should not be
created; define a constant to be that value and reference the constant
to have a single point of edit.
2023-06-26 12:26:56 -05:00
Brooks 5f1b5b877a
Replace boot_from_local_state with use_snapshot_archives_at_startup (#32260) 2023-06-26 12:44:25 -04:00
Jeff Biseda 5ca1b40f11
refactor core to create cluster_slots_service module (#32119) 2023-06-26 08:54:49 -07:00
behzad nouri f6e039b0b3
moves turbine to a separate crate out of solana/core (#32226) 2023-06-22 16:22:11 +00:00
Ashwin Sekar 8135cf35bf
Only dump duplicate descendants in dump & repair (#31559) 2023-06-21 11:28:42 -07:00
steviez 20a7cdd43d
Restrict access to Bank's HardForks (#32180)
* Restrict access to Bank's HardForks

Callers could previously obtain a a lock to read/write HardForks from
any Bank. This would allow any caller to modify, and creates the
opportunity for inconsistent handling of what is considered a valid hard
fork (ie too old).

This PR adds a function to Bank so consistent sanity checks can be
applied; the caller will already have a Bank as that is where they would
have obtained the HardForks from in the first place. Additionally,
change the getter to return a copy of HardForks (simple Vec).

* Allow hard fork at bank slot if bank is not yet frozen
2023-06-20 23:44:43 -05:00
behzad nouri 469661d217
removes outdated tvu_forward socket (#32101)
Shreds are no longer sent to tvu_forward socket.
2023-06-20 20:50:16 +00:00
Brooks bfaf073ecf
Tests get snapshot archive format from snapshot config (#32209) 2023-06-20 15:44:03 -04:00
Ashwin Sekar 4ba78de8cb
Add metrics for invalid vote timestamps (#32206) 2023-06-20 17:29:13 +00:00
behzad nouri 987e8eeeaf
removes feature gate code dropping redundant turbine path (#32075) 2023-06-16 19:53:05 +00:00
Brooks 47ff3cecc9
Enables creating snapshots after booting from local state (#32137) 2023-06-15 22:54:32 -04:00
Ashwin Sekar 01d3546de0
Increment timestamp on refreshed votes (#31908) 2023-06-15 10:38:22 -07:00
Trent Nelson 077e29aa1e bank_send_loop: Reduce feature flag polling frequency 2023-06-13 15:51:50 -06:00
Ashwin Sekar dd379bfad8 bank_send_loop: Get feature flag from root bank 2023-06-13 15:51:50 -06:00
Jeff Biseda 667b2053a7
rationalize repair type min/max metrics (#31805) 2023-06-13 13:34:31 -07:00
Jeff Biseda b06df6ad25
require repair request signature (#31888) 2023-06-12 16:47:03 -07:00
behzad nouri ec0001ef85
adds code-path broadcasting shreds using QUIC (#31610)
adds quic connection cache to turbine

Working towards migrating turbine to QUIC.
2023-06-12 22:58:27 +00:00
behzad nouri aed4ecb633
adds quic receiver to shred-fetch-stage (#31576)
Working towards migrating turbine to QUIC.
2023-06-12 13:16:27 +00:00
Andrew Fitzgerald 450e7c2395
rename MAX_NUM_TRANSACTIONS_PER_BATCH (#32023) 2023-06-09 15:05:28 -07:00
Ikko Eltociear Ashimine d0a573f28c
Fix typo in repair_generic_traversal.rs (#32016)
Additionaly -> Additionally
2023-06-07 15:42:48 -07:00
Brooks 8596e00549
Revert "EpochAccountsHash tests no longer ignore shutdown errors (#31883)" (#32018)
This reverts commit 2fc1dc1bf6.
2023-06-07 16:44:46 -04:00
steviez 843d6ed34a
Move BankingStage impl modules into banking_stage directory (#31864)
The core/src/ directory is already pretty crowded, and moving these
items into the subdirectory more clearly identifies that they are tied
to banking_stage.
2023-06-07 13:54:05 -05:00
Alexander Meißner ee2c2ef6c7
Cleanup - require_static_program_ids_in_transaction (#31767)
require_static_program_ids_in_transaction
2023-06-07 17:12:41 +02:00
behzad nouri 8a47086246
rolls out merkle shreds to ~50% of testnet (#31950) 2023-06-06 17:36:06 +00:00
Andrew Fitzgerald a2e7d1356c
Fix typo: process_and_record_tramsaction -> process_and_record_transaction (#31974) 2023-06-06 10:29:31 -07:00
Tao Zhu 83ac66caa1
split TransactionCost to its own module (#31977)
* split TransactionCost to its own module

* remove unused function
2023-06-06 11:15:38 -05:00
Tyera 841609959c
Send messages to EntryNotifierService in Tpu, simpler (#31962)
* Add TpuEntryNotifier to send EntryNotifications from Tpu

* Optionally run TpuEntryNotifier to send out EntrySummarys alongside BroadcastStage messages

* Track entry index in TpuEntryNotifier

* Allow for leader slots that switch forks

* Exit if broadcast send fails
2023-06-06 00:19:17 +00:00